aboutsummaryrefslogtreecommitdiff
path: root/gcc/configure.ac
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2009-06-24 04:03:51 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2009-06-24 04:03:51 +0000
commit00020c1638f4b23d9889cad741ef40b4997775bf (patch)
tree20ac25787d7feed69119a7cd8e85e41e13482447 /gcc/configure.ac
parent9006a1617947532ece5e1db63f5fa9199dc747c2 (diff)
downloadgcc-00020c1638f4b23d9889cad741ef40b4997775bf.zip
gcc-00020c1638f4b23d9889cad741ef40b4997775bf.tar.gz
gcc-00020c1638f4b23d9889cad741ef40b4997775bf.tar.bz2
configure.ac: Add --enable-build-with-cxx.
./: * configure.ac: Add --enable-build-with-cxx. When set, add c++ to boot_languages. Only bootstrap target libraries listed in target_libs for some boot language. Add --with-stage1-ldflags, --with-stage1-libs, --with-boot-ldflags, --with-boot-libs. Remove with_host_libstdcxx from ppllibs. Only add -fkeep-inline-functions if not building with C++. * Makefile.def: For target_module libstdc++-v3, set bootstrap=true. * Makefile.tpl (STAGE1_LDFLAGS, STAGE1_LIBS): New variables. (POSTSTAGE1_LDFLAGS, POSTSTAGE1_LIBS): New variables. (HOST_EXPORTS): Add STAGE1_LDFLAGS to LDFLAGS. Export HOST_LIBS. (POSTSTAGE1_HOST_EXPORTS): Set CXX and CXX_FOR_BUILD. Add POSTSTAGE1_LDFLAGS to LDFLAGS. Export HOST_LIBS. (POSTSTAGE1_FLAGS_TO_PASS): Likewise. * configure, Makefile.in: Rebuild. gcc/: * configure.ac: Invoke AC_PROG_CXX. Separate C specific warnings from loose_warn into c_loose_warn and from strict_warn into c_strict_warn. Set and substitute warn_cxxflags. Check for --enable-build-with-cxx. Set and substitute ENABLE_BUILD_WITH_CXX. Set and substitute HOST_LIBS. * Makefile.in (CXXFLAGS): New variable. (C_LOOSE_WARN, C_STRICT_WARN): New variables. (GCC_WARN_CFLAGS): Add $(C_LOOSE_WARN). Add $(C_STRICT_WARN) if the default is the same as $(STRICT_WARN). (GCC_WARN_CXXFLAGS, WARN_CXXFLAGS): New variables. (CXX): New variable. (COMPILER): New value if ENABLE_BUILD_WITH_CXX. (COMPILER_FLAGS, LINKER, LINKER_FLAGS): Likewise. (ALL_COMPILERFLAGS, ALL_LINKERFLAGS): Likewise. (HOST_LIBS): New variable. (GCC_CFLAGS): Add $(C_LOOSE_WARN). (ALL_CXXFLAGS): New variable. (LIBS, BACKENDLIBS): Add $(HOST_LIBS). * doc/install.texi (Configuration): Document --enable-build-with-cxx, --with-stage1-ldflags, --with-stage1-libs, --with-boot-ldflags, --with-boot-libs. * configure: Rebuild. From-SVN: r148889
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r--gcc/configure.ac33
1 files changed, 27 insertions, 6 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 341571c..f0a239b 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -276,6 +276,7 @@ rm -f a.out a.exe b.out
# Find the native compiler
AC_PROG_CC
AM_PROG_CC_C_O
+AC_PROG_CXX
ACX_PROG_GNAT([-I"$srcdir"/ada])
# autoconf is lame and doesn't give us any substitution variable for this.
@@ -323,24 +324,30 @@ AC_CHECK_TYPES([__int64], [AC_CHECK_SIZEOF(__int64)])
# So, we only use -pedantic if we can disable those warnings.
ACX_PROG_CC_WARNING_OPTS(
- m4_quote(m4_do([-W -Wall -Wwrite-strings -Wstrict-prototypes ],
- [-Wmissing-prototypes -Wcast-qual])), [loose_warn])
+ m4_quote(m4_do([-W -Wall -Wwrite-strings -Wcast-qual])), [loose_warn])
ACX_PROG_CC_WARNING_OPTS(
- m4_quote(m4_do([-Wold-style-definition -Wc++-compat ],
- [-Wmissing-format-attribute])), [strict_warn])
+ m4_quote(m4_do([-Wstrict-prototypes -Wmissing-prototypes])),
+ [c_loose_warn])
+ACX_PROG_CC_WARNING_OPTS(
+ m4_quote(m4_do([-Wmissing-format-attribute])), [strict_warn])
+ACX_PROG_CC_WARNING_OPTS(
+ m4_quote(m4_do([-Wold-style-definition -Wc++-compat])), [c_strict_warn])
ACX_PROG_CC_WARNING_ALMOST_PEDANTIC(
m4_quote(m4_do([-Wno-long-long -Wno-variadic-macros ],
[-Wno-overlength-strings])), [strict_warn])
ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual], [strict_warn])
# The above macros do nothing if the compiler is not GCC. However, the
-# Makefile has more goo to add other flags, so this variabl is used to
-# enables warnings only for GCC.
+# Makefile has more goo to add other flags, so these variables are used
+# to enable warnings only for GCC.
warn_cflags=
+warn_cxxflags=
if test "x$GCC" = "xyes"; then
warn_cflags='$(GCC_WARN_CFLAGS)'
+ warn_cxxflags='$(GCC_WARN_CXXFLAGS)'
fi
AC_SUBST(warn_cflags)
+AC_SUBST(warn_cxxflags)
# Enable expensive internal checks
is_release=
@@ -573,6 +580,13 @@ fi
# Miscenalleous configure options
# -------------------------------
+# See if we are building gcc with C++.
+AC_ARG_ENABLE(build-with-cxx,
+[ --enable-build-with-cxx build with C++ compiler instead of C compiler],
+ENABLE_BUILD_WITH_CXX=$enableval,
+ENABLE_BUILD_WITH_CXX=no)
+AC_SUBST(ENABLE_BUILD_WITH_CXX)
+
# With stabs
AC_ARG_WITH(stabs,
[ --with-stabs arrange to use stabs instead of host debug format],
@@ -3749,6 +3763,13 @@ esac],
AC_SUBST(GGC)
echo "Using $GGC for garbage collection."
+# Libraries to use on the host. This will normally be set by the top
+# level Makefile. Here we simply capture the value for our Makefile.
+if test -z "${HOST_LIBS+set}"; then
+ HOST_LIBS=
+fi
+AC_SUBST(HOST_LIBS)
+
# Use the system's zlib library.
zlibdir=-L../zlib
zlibinc="-I\$(srcdir)/../zlib"