[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Using config binaries to find libraries and include dirs
From: |
Erik de Castro Lopo |
Subject: |
Re: Using config binaries to find libraries and include dirs |
Date: |
Thu, 1 Jun 2006 17:43:37 +1000 |
Paulo J. Matos wrote:
> Hi all,
>
> Some libraries include a xxx-config which accepts --libs or --includes
> and report the flags and the include dirs the compiler should use.
That technique is somewhat old school. The more modern way to do
things is with the pkg-config tool.
> How
> can one use this information in the context of autotools? Is there a
> way to tell autoconf which config-binary to use to a given lib?
For something called whatever, it might look like:
PKG_CHECK_MODULES(WHATEVER, whatever >= 1.0.6, ac_cv_whatever=1,
ac_cv_whatever=0)
AC_DEFINE_UNQUOTED([HAVE_WHATEVER],$ac_cv_whatever,[Set to 1 if you have
libwhatever.])
In your Makefile.am you can then use @WHATEVER_CFLAGS@ and @address@hidden
HTH,
Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo
+-----------------------------------------------------------+
`If you want a vision of the future, it is a wireless broadband
network feeding requests for foreign money-laundering assistance
into a human temporal lobe, forever. With banner ads.'
-- John M. Ford