diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-24 04:03:51 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-06-24 04:03:51 +0000 |
commit | 7ab76cecd643d0d098fb7293340afa0e2b5f9f37 (patch) | |
tree | 20ac25787d7feed69119a7cd8e85e41e13482447 /configure.ac | |
parent | 89d108c2ba9190c28f84e125f8e244be4f162342 (diff) | |
download | gcc-7ab76cecd643d0d098fb7293340afa0e2b5f9f37.tar.gz |
./:
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@148889 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 85 |
1 files changed, 78 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac index e6c82685243..dc72b2f137f 100644 --- a/configure.ac +++ b/configure.ac @@ -1191,6 +1191,12 @@ fi ACX_PROG_GNAT ACX_PROG_CMP_IGNORE_INITIAL +# 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) + # Check for GMP, MPFR and MPC gmplibs="-lmpfr -lgmp" gmpinc= @@ -1422,10 +1428,59 @@ case $with_host_libstdcxx in ;; esac +# Linker flags to use for stage1 or when not boostrapping. +AC_ARG_WITH(stage1-ldflags, +[ --with-stage1-ldflags=FLAGS Linker flags for stage1], +[if test "$withval" = "no" -o "$withval" = "yes"; then + stage1_ldflags= + else + stage1_ldflags=$withval + fi], +[stage1_ldflags=]) +AC_SUBST(stage1_ldflags) + +# Libraries to use for stage1 or when not bootstrapping. +AC_ARG_WITH(stage1-libs, +[ -with-stage1-libs=LIBS Libraries for stage1], +[if test "$withval" = "no" -o "$withval" = "yes"; then + stage1_libs= + else + stage1_libs=$withval + fi], +[stage1_libs=$with_host_libstdcxx]) +AC_SUBST(stage1_libs) + +# Linker flags to use for stage2 and later builds. +AC_ARG_WITH(boot-ldflags, +[ --with-boot-ldflags=FLAGS Linker flags for stage2 and later], +[if test "$withval" = "no" -o "$withval" = "yes"; then + poststage1_ldflags= + else + poststage1_ldflags=$withval + fi], +[if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then + poststage1_ldflags=-static-libstdc++ + else + poststage1_ldflags= + fi]) +AC_SUBST(poststage1_ldflags) + +# Libraries to use for stage2 and later builds. This defaults to the +# argument passed to --with-host-libstdcxx. +AC_ARG_WITH(boot-libs, +[ --with-boot-libs=LIBS Libraries for stage2 and later] +[if test "$withval" = "no" -o "$withval" = "yes"; then + poststage1_libs= + else + poststage1_libs=$withval + fi], +[poststage1_libs=$with_host_libstdcxx]) +AC_SUBST(poststage1_libs) + # Check for PPL ppl_major_version=0 ppl_minor_version=10 -ppllibs=" -lppl_c -lppl -lgmpxx $with_host_libstdcxx " +ppllibs=" -lppl_c -lppl -lgmpxx" pplinc= AC_ARG_WITH(ppl, [ --with-ppl=PATH Specify prefix directory for the installed PPL package @@ -1439,7 +1494,7 @@ case $with_ppl in ppllibs= ;; *) - ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx $with_host_libstdcxx" + ppllibs="-L$with_ppl/lib -lppl_c -lppl -lgmpxx" pplinc="-I$with_ppl/include $pplinc" LIBS="$ppllibs $LIBS" ;; @@ -1448,11 +1503,11 @@ if test "x$with_ppl_include" != x; then pplinc="-I$with_ppl_include $pplinc" fi if test "x$with_ppl_lib" != x; then - ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx $with_host_libstdcxx" + ppllibs="-L$with_ppl_lib -lppl_c -lppl -lgmpxx" LIBS="$ppllibs $LIBS" fi if test "x$with_ppl$with_ppl_include$with_ppl_lib" = x && test -d ${srcdir}/ppl; then - ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/.libs -L$$r/$(HOST_SUBDIR)/ppl/_libs -lppl_c -lppl -lgmpxx '"$with_host_libstdcxx " + ppllibs='-L$$r/$(HOST_SUBDIR)/ppl/.libs -L$$r/$(HOST_SUBDIR)/ppl/_libs -lppl_c -lppl -lgmpxx ' pplinc='-I$$r/$(HOST_SUBDIR)/ppl/include -I$$s/ppl/include ' LIBS="$ppllibs $LIBS" fi @@ -1538,6 +1593,9 @@ AC_SUBST(clooginc) # By default, C is the only stage 1 language. stage1_languages=,c, +# Target libraries that we bootstrap. +bootstrap_target_libs=,target-libgcc, + # Figure out what language subdirectories are present. # Look if the user specified --enable-languages="..."; if not, use # the environment variable $LANGUAGES if defined. $LANGUAGES might @@ -1623,6 +1681,10 @@ if test -d ${srcdir}/gcc; then exit 1 fi + if test "$language" = "c++" -a "$ENABLE_BUILD_WITH_CXX" = "yes"; then + boot_language=yes + fi + case ,${enable_languages}, in *,${language},*) # Language was explicitly selected; include it. @@ -1689,6 +1751,8 @@ if test -d ${srcdir}/gcc; then yes) # Add to (comma-separated) list of stage 1 languages. stage1_languages="${stage1_languages}${language}," + # We need to bootstrap any supporting libraries. + bootstrap_target_libs="${bootstrap_target_libs}${target_libs}," ;; esac ;; @@ -2420,11 +2484,18 @@ for module in ${target_configdirs} ; do echo 1>&2 "*** removing ${target_subdir}/${module}/Makefile to force reconfigure" rm -f ${target_subdir}/${module}/Makefile fi + + # We only bootstrap target libraries listed in bootstrap_target_libs. + case $bootstrap_target_libs in + *,target-$module,*) target_bootstrap_suffix=$bootstrap_suffix ;; + *) target_bootstrap_suffix=no-bootstrap ;; + esac + extrasub="$extrasub /^@if target-$module\$/d /^@endif target-$module\$/d -/^@if target-$module-$bootstrap_suffix\$/d -/^@endif target-$module-$bootstrap_suffix\$/d" +/^@if target-$module-$target_bootstrap_suffix\$/d +/^@endif target-$module-$target_bootstrap_suffix\$/d" done extrasub="$extrasub @@ -2988,7 +3059,7 @@ case $build in esac # This is aimed to mimic bootstrap with a non-GCC compiler to catch problems. -if test "$GCC" = yes; then +if test "$GCC" = yes -a "$ENABLE_BUILD_WITH_CXX" != yes; then saved_CFLAGS="$CFLAGS" # Pass -fkeep-inline-functions for stage 1 if the GCC version supports it. |