summaryrefslogtreecommitdiff
path: root/libjava/acinclude.m4
diff options
context:
space:
mode:
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-22 03:21:28 +0000
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>2002-02-22 03:21:28 +0000
commit92b317fc7c6268427795ade8f6aa32ff8586f6a6 (patch)
tree1a4dfd018419fa7cbd13e5ec972e66a13e6bf0d2 /libjava/acinclude.m4
parent4e979746468c19322f1e2f340f270bce4cc47a63 (diff)
downloadgcc-92b317fc7c6268427795ade8f6aa32ff8586f6a6.tar.gz
* acinclude.m4 (LIB_AC_PROG_CXX): Copied from libstdc++-v3.
Use it. * Makefile.am (LIBLINK): Use CXX (and its tag) for linking. * aclocal.m4, configure, Makefile.in: Rebuilt. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49954 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/acinclude.m4')
-rw-r--r--libjava/acinclude.m445
1 files changed, 44 insertions, 1 deletions
diff --git a/libjava/acinclude.m4 b/libjava/acinclude.m4
index 610750763e5..10d59d4a386 100644
--- a/libjava/acinclude.m4
+++ b/libjava/acinclude.m4
@@ -80,7 +80,50 @@ define([AC_PROG_CC_WORKS],[])
define([AC_PROG_CXX_WORKS],[])
AC_PROG_CC
-AC_PROG_CXX
+
+# We use the libstdc++-v3 version of LIB_AC_PROG_CXX, that gets
+# glibcpp_CXX cached instead of CXX. That's because we're passed a
+# different definition of CXX than other directories, since we don't
+# depend on libstdc++-v3 having already been built.
+AC_DEFUN(LIB_AC_PROG_CXX,
+[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl
+dnl Fool anybody using AC_PROG_CXX.
+AC_PROVIDE([AC_PROG_CXX])
+# Use glibcpp_CXX so that we do not cause CXX to be cached with the
+# flags that come in CXX while configuring libstdc++. They're different
+# from those used for all other target libraries. If CXX is set in
+# the environment, respect that here.
+glibcpp_CXX=$CXX
+AC_CHECK_PROGS(glibcpp_CXX, $CCC c++ g++ gcc CC cxx cc++, gcc)
+AC_SUBST(glibcpp_CXX)
+CXX=$glibcpp_CXX
+test -z "$glibcpp_CXX" && AC_MSG_ERROR([no acceptable c++ found in \$PATH])
+
+AC_PROG_CXX_GNU
+
+if test $ac_cv_prog_gxx = yes; then
+ GXX=yes
+dnl Check whether -g works, even if CXXFLAGS is set, in case the package
+dnl plays around with CXXFLAGS (such as to build both debugging and
+dnl normal versions of a library), tasteless as that idea is.
+ ac_test_CXXFLAGS="${CXXFLAGS+set}"
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS=
+ AC_PROG_CXX_G
+ if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ elif test $ac_cv_prog_cxx_g = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-O2"
+ fi
+else
+ GXX=
+ test "${CXXFLAGS+set}" = set || CXXFLAGS="-g"
+fi
+])
+
+LIB_AC_PROG_CXX
dnl version is pulled out to make it a bit easier to change using sed.
version=0.0.7