summaryrefslogtreecommitdiff
path: root/libstdc++-v3/configure.ac
diff options
context:
space:
mode:
authorrwild <rwild@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-15 07:02:33 +0000
committerrwild <rwild@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-15 07:02:33 +0000
commite98472f06dec3b0d227a05f058a02ad0b1ff9f9b (patch)
tree0cec67570cc453f9e2d808c5fb0d6678d45be00d /libstdc++-v3/configure.ac
parent335a3409722f216463e36f20ab097edf48dbf580 (diff)
downloadgcc-e98472f06dec3b0d227a05f058a02ad0b1ff9f9b.tar.gz
libstdc++-v3/
* configure.ac: Move guarded checks for CC and CXX ... * acinclude.m4 (GLIBCXX_CONFIGURE): ... from here. * configure: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150788 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/configure.ac')
-rw-r--r--libstdc++-v3/configure.ac31
1 files changed, 30 insertions, 1 deletions
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index 977e12cf91d..0b1edfd7c75 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -78,7 +78,36 @@ AM_INIT_AUTOMAKE([1.9.3 no-define foreign no-dependencies -Wall -Wno-portability
AH_TEMPLATE(PACKAGE, [Name of package])
AH_TEMPLATE(VERSION, [Version number of package])
-# Runs configure.host, finds CC, CXX, and assorted other critical bits. Sets
+# We're almost certainly being configured before anything else which uses
+# C++, so all of our AC_PROG_* discoveries will be cached. It's vital that
+# we not cache the value of CXX that we "discover" here, because it's set
+# to something unique for us and libjava. Other target libraries need to
+# find CXX for themselves. We yank the rug out from under the normal AC_*
+# process by sneakily renaming the cache variable. This also lets us debug
+# the value of "our" CXX in postmortems.
+#
+# We must also force CXX to /not/ be a precious variable, otherwise the
+# wrong (non-multilib-adjusted) value will be used in multilibs. This
+# little trick also affects CPPFLAGS, CXXFLAGS, and LDFLAGS. And as a side
+# effect, CXXFLAGS is no longer automagically subst'd, so we have to do
+# that ourselves. Un-preciousing AC_PROG_CC also affects CC and CFLAGS.
+#
+# -fno-builtin must be present here so that a non-conflicting form of
+# std::exit can be guessed by AC_PROG_CXX, and used in later tests.
+
+m4_define([ac_cv_prog_CXX],[glibcxx_cv_prog_CXX])
+m4_rename([_AC_ARG_VAR_PRECIOUS],[glibcxx_PRECIOUS])
+m4_define([_AC_ARG_VAR_PRECIOUS],[])
+save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS -fno-builtin"
+AC_PROG_CC
+AC_PROG_CXX
+CXXFLAGS="$save_CXXFLAGS"
+m4_rename_force([glibcxx_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
+AC_SUBST(CFLAGS)
+AC_SUBST(CXXFLAGS)
+
+# Runs configure.host, and assorted other critical bits. Sets
# up critical shell variables.
GLIBCXX_CONFIGURE