autoconf
[Top][All Lists]
Advanced

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

Re: AC_CHECK_HEADER + extra compiler flags


From: Stepan Kasal
Subject: Re: AC_CHECK_HEADER + extra compiler flags
Date: Fri, 4 May 2007 11:18:21 +0200
User-agent: Mutt/1.4.2.1i

Hello,

On Fri, May 04, 2007 at 10:30:22AM +0200, Daniel Barna wrote:
> I am wondering how one can check the presence of a header file (gts.h), 
> which needs extra compiler flags (`gts-config --cflags`)

the trick is to save the previous value of CFLAGS and restore it
after the test.

But whech checking for headers, CPPFLAGS seem to be the one we are
interested in.  With a recent version of pkg-config, one would do:

SAVE_CPPFLAGS=$CPPFLAGS
SAVE_CFLAGS=$CFLAGS
CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags-only-I`"
CFLAGS="$CFLAGS `$PKG_CONFIG --cflags-only-other`"
AC_CHECK_HEADERS([gts.h])
CPPFLAGS=$SAVE_CPPFLAGS
CFLAGS=$SAVE_CFLAGS

But I'm afraid that gts-config does not support all these options, so
you might try:

SAVE_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS `gts-config --cflags-only-I || gts-config --cflags`"
AC_CHECK_HEADERS([gts.h])
CPPFLAGS=$SAVE_CPPFLAGS

HTH,
        Stepan




reply via email to

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