Rainer Orth <r...@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