[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_PROG_LIBTOOL sets CFLAGS
From: |
Peter O'Gorman |
Subject: |
Re: AC_PROG_LIBTOOL sets CFLAGS |
Date: |
Tue, 21 Aug 2007 14:57:55 -0500 |
On Tue, 2007-08-21 at 21:49 +0200, Thien-Thi Nguyen wrote:
> according to my reading of info nodes:
>
> (libtool) AC_PROG_LIBTOOL
> (automake) Flag Variables Ordering
>
> the shell variable CFLAGS should have no value after AC_PROG_LIBTOOL.
> i.e., i should expect the configure.ac fragment:
>
> echo "CFLAGS: $CFLAGS"
> AC_PROG_LIBTOOL
> echo "CFLAGS: $CFLAGS"
>
> to create a configure that outputs "CFLAGS: " both before and after
> whatever code is generated as the expansion of AC_PROG_LIBTOOL.
>
> is my interpretation correct? presently, i see that before, CFLAGS is
> indeed empty, while after, it has the value "-g -O2" (compiler is gcc),
> using libtool 1.5.22, autoconf 2.60, automake 1.9.6.
>
> to see for yourself, try:
>
> $ mkdir /tmp/z
> $ cd /tmp/z
> $ cat > configure.ac <<EOF
> AC_INIT([foo],[0],[ttn])
> AM_INIT_AUTOMAKE
> echo "CFLAGS: $CFLAGS"
> AC_PROG_LIBTOOL
> echo "CFLAGS: $CFLAGS"
> AC_CONFIG_FILES([Makefile])
> AC_OUTPUT
> EOF
> $ touch NEWS README AUTHORS ChangeLog Makefile.am
> $ autoreconf -is
> $ ./configure
>
> i suppose the "-g -O2" is good to have *somewhere*, which would lead,
> presuming the observed behavior is undesirable and will be fixed in some
> future libtool, to the follow on question: if not CFLAGS, then where?
>
AC_PROG_LIBTOOL calls AC_PROG_CC which sets default CFLAGS (but only if
they are not already set).
Peter