This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [build, ada] Allow Solaris bootstrap with C++ (PR bootstrap/49794)
- From: Ian Lance Taylor <iant at google dot com>
- To: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- Cc: gcc-patches at gcc dot gnu dot org, Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>
- Date: Wed, 20 Jul 2011 11:06:51 -0700
- Subject: Re: [build, ada] Allow Solaris bootstrap with C++ (PR bootstrap/49794)
- References: <yddbowonc44.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
> diff --git a/gcc/configure.ac b/gcc/configure.ac
> --- a/gcc/configure.ac
> +++ b/gcc/configure.ac
> @@ -1041,7 +1041,16 @@ case "${host}" in
> esac
> AC_FUNC_FORK
>
> +# FIXME: g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a
> +# different iconv() prototype.
> +if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
> +AC_LANG_PUSH([C++])
> +fi
> AM_ICONV
> +if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then
> +AC_LANG_POP([C++])
> +fi
I believe that this kind of conditional use of AC_LANG_PUSH/AC_LANG_POP
does not work correctly. The autoconf macros don't play well with the
shell conditionals. We're going to need a different approach. (That
problem is why I didn't do this long ago--I had a similar patch for a
while, but I had to take it out.)
It seems to me that the version of iconv when _XPG6 is defined is
correct, and it seems to me that that is the one we get if _XOPEN_SOURCE
is defined to be 600 when #including iconv.h. Does that sound right?
If so, perhaps we should change the toplevel configure.ac to use mh-sol2
for host *-*-solaris2* (or whatever is appropriate), and create the file
config/mh-sol2 with BOOT_CFLAGS += -D_XOPEN_SOURCE=600.
Ian