automake
[Top][All Lists]
Advanced

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

Re: AM_C*FLAGS and C*FLAGS


From: Andre Stechert
Subject: Re: AM_C*FLAGS and C*FLAGS
Date: Mon, 26 Jun 2006 08:46:57 -0700

The trick is that if we use a configure.ac file to help decide what
flags may be needed, >inside< this configure script we need to use
CFLAGS and CPPFLAGS to effect the running of configure.

Not really.  Just AC_SUBST a variable in the AM_CFLAGS or AM_CPPFLAGS
directive. E.g., when I write an autoconf macro to link against an optional
library, my Makefile.am's usually end up having stuff like this in them:

Makefile.am for foo that optionally depends on bar:

AM_CFLAGS=-I../otherdir @BAR_CFLAGS@
bin_PROGRAMS=foo
address@hidden@

if BAR
        foo_SOURCES += bar-dependent.c
endif

Then, at configure time, the CFLAGS, the "always-on" AM_CFLAGS, and
the "optionally-on" AM_CFLAGS are all respected as configured.

If you want to see an example of an autoconf macro that provides this
kind of substitution, I have one here:

http://andre.stechert.org/urwhatu/2006/04/autoconf_macro_.html

Cheers,
Andre

Attachment: smime.p7s
Description: S/MIME cryptographic signature


reply via email to

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