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: Ian Lance Taylor <iant at google dot com>
- To: Jerry Quinn <jlquinn at optonline dot net>
- Cc: gcc at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Tue, 05 Oct 2010 07:18:15 -0700
- Subject: Re: Unable to build --enable-build-with-cxx --enable-languages=c,c++ --with-gold
- References: <1286280462.8419.79.camel@cerberus.qb5.org>
Jerry Quinn <jlquinn@optonline.net> writes:
> This is on Debian testing. I have a clean tree r164966. I configure as
> follows:
>
> ../../gcc-in-cxx/configure --enable-build-with-cxx
> --enable-languages=c,c++ --with-gold
>
>
> I just run make and it fails as below. Any ideas what might be wrong?
It's a problem with using a condition in autoconf. The AC_REQUIRE
system that autoconf uses fails when some tests are run in conditions.
This patch fixes it. Build maintainers: is the right approach, or is
there a better one?
Ian
2010-10-05 Ian Lance Taylor <iant@google.com>
* configure.ac: Run AC_PROG_EGREP outside of ENABLE_BUILD_WITH_CXX
condition. Run AC_HEADER_STDC inside of condition.
* configure: Rebuild.
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
@@ -93,7 +100,6 @@ AC_CHECK_DECLS(m4_split(m4_normalize(lib
# Checks for library functions.
AC_FUNC_ALLOCA
-AC_HEADER_STDC
AM_LANGINFO_CODESET
ZW_GNU_GETTEXT_SISTER_DIR