[Top][All Lists]

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

Re: pkg-config and autoconf

From: lsiden
Subject: Re: pkg-config and autoconf
Date: 09 Aug 2003 05:17:53 -0400

When examining the Pango distribution as an example, I see there is a which uses PKG_CHECK_MODULES (and thus indirectly uses
pkg-config) but no  Is this what I need to do in order to
use PKG_CHECK_MODULES, forego in favor of 
The syntax of looks much more verbose.

On Sat, 2003-08-09 at 05:01, Larry Siden wrote:
> The man page for pkg-config says: 
>               The  macro  PKG_CHECK_MODULES  can  be used in to 
> check whether
>               modules exist. A typical usage would be:
>                PKG_CHECK_MODULES(MYSTUFF, gtk+-2.0 >= 1.3.5 libxml = 1.8.4)
>               This would result in MYSTUFF_LIBS and MYSTUFF_CFLAGS 
> substitution variables,
>               set  to the libs and cflags for the given module list.  If a 
> module is miss-
>               ing or has the wrong version, by default configure will abort  
> with  a  mes-
>               sage.  To  replace  the  default  action,  specify  an  
>               PKG_CHECK_MODULES will not print any error messages if you 
> specify your  own
>               ACTION-IF-NOT-FOUND.   However, it will set the variable 
>               which you can use to display what went wrong.
>               If you want to use MYSTUFF_LIBS and MYSTUFF_CFLAGS as 
>  variables
>               (i.e.  $(MYSTUFF_LIBS))  then you have to add 
>      so automake can find the variable. You don't need 
> to do this if
>               you   use   the   @MYSTUFF_LIBS@  syntax  in  your 
>  instead  of
>               $(MYSTUFF_LIBS).
> However, autoconf 2.57 doesn't seem to recognize the PKG_CHECK_MODULES
> macro.  In addition, the conventional name "" has been
> replaced by "", suggesting that this document may be
> refering to an earlier version of autoconf.  If so, can someone tell
> me how I can use pkg-config with the latest version of autoconf?
> I am publishing a library that depends on several other non-standard
> (not part of the C/C++ standard) libraries.  Instead of forcing the
> package builder (my client/user) to specify the locations of the
> header files for these libraries on the ./configure command line (e.g.
> "./configure CPPFLAGS=-I..."), I would like for the configure script
> to discover where the corresponding include directories are located on
> the user's/build machine, if possible, using pkg-config.  How can this
> be accomplished?  I'm still a novice with the GNU build tools.
> Thanks in adv.,
> Larry Siden

reply via email to

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