Re: Compiling problems



Owen Taylor wrote:
> 
> Dan Kegel <dank@kegel.com> writes:
> > One way pkg-config, and indeed configure scripts, fall down is that
> > they are inflexible when it comes to tailoring which shared libraries
> > you link to.  This means you have to link to all of the shared libraries
> > a package provides, even if you only use a few of them.  This shouldn't
> > be a problem, except that simply linking to a shared library seems
> > to pull it into memory, causing RAM waste that can be a killer on
> > embedded systems.
> 
>  pkg-config --libs glib-2.0                  [ -lglib only ]
>  pkg-config --libs gmodule-2.0               [ -lgmodule and -lglib because gmodule requires glib ]
>  pkg-config --libs gobject-2.0 gthread-2.0   [ -lgobject -lgthread -lglib ]

As long as each argument to --libs is a name of a shared library,
I suppose that works.  But at that point, why not just use -l?
I don't see what pkg-config buys you there over the linker's smarts.

Another thing that bothers me is that you're assuming 
there's a single pkg-config installation.  However, on
a cross-development system, you'll have many, and you
have to be very careful with the path to get the right one.
It would help if developers would let you specify the exact
pkg-config script to use, just as they usually let you
specify the exact CC.  However, because you don't do that
in your examples, most developers won't, and it'll be another
fragile thing for me to fix.  Grumble.

Well, guess I'll get back to trying to hammer glib and orbit to
work on my cross-develoment system.  I'm trying to do a nice
job of it, and am submitting patches back so others will be
able to do it more easily in the future.  I haven't had much
luck yet having my patches accepted, but I suppose people are
just busy getting gnome 2 out the door...
- Dan



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]