This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: v3: Move AC_PROG_CC/CXX code block into configure.ac.
- From: Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>
- To: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Fri, 14 Aug 2009 20:02:52 +0200
- Subject: Re: v3: Move AC_PROG_CC/CXX code block into configure.ac.
- References: <20090730211458.GF24465@gmx.de>
Ping <http://gcc.gnu.org/ml/gcc-patches/2009-07/msg01773.html>
This patch (or an equivalent fix as explained in that message) is
required before the autotools upgrade.
Thanks,
Ralf
* Ralf Wildenhues wrote on Thu, Jul 30, 2009 at 11:14:59PM CEST:
> libstdc++-v3/ChangeLog:
> 2009-07-30 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
>
> * configure.ac: Move guarded checks for CC and CXX ...
> * acinclude.m4 (GLIBCXX_CONFIGURE): ... from here.
> * configure: Regenerate.
>
> diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
> index b0b6241..45e0229 100644
> --- a/libstdc++-v3/acinclude.m4
> +++ b/libstdc++-v3/acinclude.m4
> @@ -79,35 +79,6 @@ AC_DEFUN([GLIBCXX_CONFIGURE], [
> AC_HELP_STRING([--with-newlib],
> [assume newlib as a system C library]))
>
> - # 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)
> -
> # Will set LN_S to either 'ln -s', 'ln', or 'cp -p' (if linking isn't
> # available). Uncomment the next line to force a particular method.
> AC_PROG_LN_S
> diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
> index 977e12c..0b1edfd 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