Subject: AC_CHECK_HEADERS after GUILE_FLAGS loses $CPP
From: Bernd Jendrissek <[email-masked]>
To: [email-masked]
Date: Thu, 17 Mar 2016 03:47:04 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

I have a reduced test case where adding GUILE_FLAGS in shell dead code
before a call to AC_CHECK_HEADERS causes configure to lose $CPP, which
results in warnings like this one:

checking stdarg.h usability... yes
checking stdarg.h presence... no
configure: WARNING: stdarg.h: accepted by the compiler, rejected by
the preprocessor!
configure: WARNING: stdarg.h: proceeding with the compiler's result
checking for stdarg.h... yes

Versions:

/usr/share/aclocal/guile.m4: guile-2.0-dev from Debian jessie (2.0.11+1-9)
autoconf: 2.69

Attached:

configure.ac
guile.m4

To reproduce:

Find a config.rpath somewhere (perhaps steal it from gettext).
autoreconf -fi
./configure

I noticed that a random recent git HEAD of autoconf avoids this
problem; it turns out that in commit
11f520c61d8b21f1522968d6e6afb899070f0a6f autoconf transitions to
compilation-only header checks.