This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Unable to build --enable-build-with-cxx --enable-languages=c,c++ --with-gold
- From: Andreas Schwab <schwab at redhat dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: Jerry Quinn <jlquinn at optonline dot net>, gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 05 Oct 2010 17:04:30 +0200
- Subject: Re: Unable to build --enable-build-with-cxx --enable-languages=c,c++ --with-gold
- References: <1286280462.8419.79.camel@cerberus.qb5.org> <mcr7hhwena0.fsf@google.com>
Ian Lance Taylor <iant@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, schwab@redhat.com
GPG Key fingerprint = D4E8 DBE3 3813 BB5D FA84 5EC7 45C6 250E 6F00 984E
"And now for something completely different."