[Gtk-sharp-list] [Patch, etc] minimal pkgconfig support
Paolo Molaro
lupus@ximian.com
Thu, 27 Mar 2003 15:53:46 +0100
On 03/26/03 Charles Iliya Krempeaux wrote:
> > mcs and csc should be able to use identical switches. I think mcs
> > emulates all the csc switches now.
>
> I don't think Portable.NET's cscc handles those switches though.
> (I don't want Portable.NET to be left out.)
>
> (We could always modify pkgconfig to maybe check an environment
> variable, and then output the switches in a format that cscc
> understands.)
The pkgconfig file is supposed to use the csc-like switches. If the pnet
compiler doesn't support that, send a bug report to them.
> The reason I created so many different .pc files, is that so the user
> could bind their .exe (or .dll) file to a minimum set of .dll's.
>
> So, for example, if I wanted to only use GnomeVFS#, then I could
> do a:
>
> pkg-config --libs gnomevfs-sharp
>
> And this would any bring in the .dll's that I need to use for
> GnomeVFS#. (It wouldn't bring in gnome-sharp.dll.
> It wouldn't bring in pango-sharp.dll. Etc.)
>
> So... basically having this amount of .pc files is
> to make it so only a minimum set of .dll files
> are binded to your .exe (of .dll) file.
Note that if your program doesn't use types from an assembly,
the assembly is not bound by the compiler, so I think this point is
mostly moot (you just get a tiny slowdown during compilation).
That said, I think we should reduce the number of assemblies.
The reasons are:
*) less clutter
*) each assembly has a fixed overhead, the less are loaded in a program,
the better
One trivial example is atk-sharp: this is a separate assembly
that is linked to gtk-sharp and as such is always loaded: there is no
point in having it as a separate assembly.
Some of the others assemblies are in the same positions: what are the
chances gdk-sharp is used without gtk-sharp? I'd say quite small.
I personally would prefer something like:
glib-sharp
gtk-sharp (includes also gdk-sharp, pango-sharp and atk-sharp)
gnome-sharp (includes also art-sharp and rsvg)
Note that, unlike with C libraries, having your app use gnome-sharp,
would not make the runtime load also the rsvg shared library,
unless you use the feature.
> > Since pkg-config is
> > primarily targetted at C projects, maybe we need to be considering
> > cooking a different solution that works better for the C# realm?
>
> IMO, I think we need our own pkgconfig flag. Maybe an --assemblies
> flag. And then we'd do stuff like:
>
> pkg-config --assemblies gnome-sharp
pkg-config already supports such a feature, though it doesn't
do variable substituion on it. Add:
assemblies=/ref:gtk-sharp /ref:gnome-sharp
to a .pc file and the issue:
pkg-config --variable=assemblies filename.pc
lupus
--
-----------------------------------------------------------------
lupus@debian.org debian/rules
lupus@ximian.com Monkeys do it better