[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Possible bug: AC_USE_SYSTEM_EXTENSIONS ignores "AS_IF" conditionals
From: |
Gavin Smith |
Subject: |
Re: Possible bug: AC_USE_SYSTEM_EXTENSIONS ignores "AS_IF" conditionals |
Date: |
Sun, 21 Sep 2014 17:55:43 +0100 |
I got it down to the use of AC_DEFUN_ONCE in the definition of
AC_USE_SYSTEM_EXTENSIONS. If configure.ac is
AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS_TEST],
[ echo here
])# AC_USE_SYSTEM_EXTENSIONS
AC_PREREQ([2.63])
AC_INIT([bug], [0.01])
# XXXXX 111111111111111111111111111111111111111111111111111111111111111111111
AS_IF([test 0 = 1], [AC_USE_SYSTEM_EXTENSIONS_TEST])
# XXXXXX 22222222222222222222222222222222222222222222222222222222222222222222
AC_OUTPUT
the following appears in configure:
# XXXXX 111111111111111111111111111111111111111111111111111111111111111111111
echo here
if test 0 = 1; then :
fi
# XXXXXX 22222222222222222222222222222222222222222222222222222222222222222222
If AC_DEFUN is used instead, this becomes
# XXXXX 111111111111111111111111111111111111111111111111111111111111111111111
if test 0 = 1; then :
echo here
fi
# XXXXXX 22222222222222222222222222222222222222222222222222222222222222222222
I found there was a mention of this "hoisting" in a discussion:
http://lists.gnu.org/archive/html/autoconf-patches/2009-01/msg00044.html.
> Am I going about this the wrong way?
>
> Suggestions welcome.
I haven't investigated or thought about whether this is the right behaviour.