libtool
[Top][All Lists]
Advanced

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

Re: Libtool and Pkg-Config


From: Eric Lemings
Subject: Re: Libtool and Pkg-Config
Date: Sun, 22 Apr 2001 04:12:02 -0600

Havoc Pennington wrote:
I think for libtool it's as simple as having a concept of a "package"
in addition to a concept of a library, so we can pass "gtk+-2.0" to
libtool instead of "-L/home/hp/unst/lib -L/usr/X11R6/lib -lgtk-x11-1.3
-lgdk-x11-1.3 -lXext -lgdk_pixbuf-1.3 -lm -lpangox -lX11 -lpango
-lgobject-1.3 -lgmodule-1.3 -ldl -lglib-1.3", then there is little
point in pkg-config --libs. And at that point it's trivial to glom the
--cflags behavior in there too.
Exactly.  So how would you get the compiler flags into libtool?  I'm not sure but I don't hink libtool could be smart enough to figure this out from the commands given in compile and link modes.  Assuming this true, an option could be added to the link, install, or finish mode...something like:

    -cflags CFLAGS    specifies the flags required to compile source
                      code that can be linked to this library

This would allow libtool to insert CFLAGS into the resulting .la file.  The version information is already supplied though the -version-info option (even though pkg-config uses what libtool refers to as "release numbers" which aren't at all the same as library versions) and libtool should be smart enough (in install or finish mode) to figure out the link flags, dependent libraries, and where they are.

So that leaves a new "query" mode or whatever you want to call it.  Something like:

Usage: libtool [OPTION...] --mode=query [FILE...]

Query a libtool library for configuration information.

This mode accepts the following additional options:

    -version          displays the version number of the installed
                      libtool library
    -cflags           displays the flags required to compile source
                      code that can be linked to this library
    -includes         displays only the -I flags from -cflags
    -ldflags          displays the link flags required to link object
                      files to this library
    -libs             displays only the -l flags from -ldflags

Without options, query mode displays a list of all known libtool
libraries that are currently installed.  These libraries can be
used as the FILE option.

Query mode could have as many options as we need.

Eric.
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]