Ian Lance Taylor <i...@google.com> writes: > Index: configure.ac > =================================================================== > --- configure.ac (revision 164990) > +++ configure.ac (working copy) > @@ -56,15 +56,22 @@ fi > AC_HEADER_TIME > ACX_HEADER_STRING > > +# Running AC_CHECK_HEADERS in a conditional means that we will only > +# test for supporting programs in a conditional. Test for them here, > +# so that the tests are run either way. > +AC_PROG_EGREP > + > # AC_CHECK_HEADERS is repeated to work around apparent autoconf 2.59 bug. If > # AC_CHECK_HEADERS comes after the if clause, the last AC_LANG call gets > used, > # no matter which branch is taken. > if test "$ENABLE_BUILD_WITH_CXX" = "no"; then > AC_LANG(C) > + AC_HEADER_STDC > AC_CHECK_HEADERS(locale.h fcntl.h limits.h stddef.h \ > stdlib.h strings.h string.h sys/file.h unistd.h) > else > AC_LANG(C++) > + AC_HEADER_STDC > AC_CHECK_HEADERS(locale.h fcntl.h limits.h stddef.h \ > stdlib.h strings.h string.h sys/stat.h sys/file.h unistd.h) > fi
You cannot put AC_LANG in a shell conditional like this in the first place. As it stands now all subsequent autoconf macros are using the C++ language variants (try exchanging the two AC_LANG calls and compare the generated configure script). I think the only reliable way to implement that is to put all tests in a macro, and expand it twice in the two arms of the AS_IF macro with [test "$ENABLE_BUILD_WITH_CXX" = "no"] as the condition. Andreas. -- Andreas Schwab, sch...@redhat.com GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E "And now for something completely different."