diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2011-07-22 08:58:25 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2011-07-22 08:58:25 +0000 |
commit | 5b6d595bd778d9737f12c79118ce5cc9410f421b (patch) | |
tree | e86bdc7a288c779fda5bb7d285129adcd52003f3 /gcc/configure | |
parent | 94017021b1c6372bd66c6aad2044a2a3d41f81f5 (diff) | |
download | gcc-5b6d595bd778d9737f12c79118ce5cc9410f421b.zip gcc-5b6d595bd778d9737f12c79118ce5cc9410f421b.tar.gz gcc-5b6d595bd778d9737f12c79118ce5cc9410f421b.tar.bz2 |
re PR bootstrap/49794 (Solaris 10/x86 bootstrap broken by C++ build)
2011-07-20 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
gcc:
PR bootstrap/49794
* configure.ac: Test AM_ICONV with CXX.
* configure: Regenerate.
* config/sol2-c.c (solaris_format_types): Use EXPORTED_CONST.
gcc/ada:
PR bootstrap/49794
* init.c [sun && __SVR4 && !__vxworks] (__gnat_install_handler):
Assign to act.sa_sigaction.
* tracebak.c [USE_GENERIC_UNWINDER] (__gnat_backtrace): Cast
current->return_address to char * before arithmetic.
libcpp:
PR bootstrap/49794
* configure.ac: Test AM_ICONV with CXX.
* configure: Regenerate.
* system.h (HAVE_DESIGNATED_INITIALIZERS): Never define for C++.
Co-Authored-By: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
From-SVN: r176620
Diffstat (limited to 'gcc/configure')
-rwxr-xr-x | gcc/configure | 177 |
1 files changed, 175 insertions, 2 deletions
diff --git a/gcc/configure b/gcc/configure index 0295fc6..e33fc1b 100755 --- a/gcc/configure +++ b/gcc/configure @@ -9294,6 +9294,8 @@ $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi +# g++ on Solaris 10+ defines _XOPEN_SOURCE=600, which exposes a different +# iconv() prototype. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" @@ -9835,6 +9837,175 @@ fi fi +if test "$ENABLE_BUILD_WITH_CXX" = "yes"; then : + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + + + + + + am_save_CPPFLAGS="$CPPFLAGS" + + for element in $INCICONV; do + haveit= + for x in $CPPFLAGS; do + + acl_save_prefix="$prefix" + prefix="$acl_final_prefix" + acl_save_exec_prefix="$exec_prefix" + exec_prefix="$acl_final_exec_prefix" + eval x=\"$x\" + exec_prefix="$acl_save_exec_prefix" + prefix="$acl_save_prefix" + + if test "X$x" = "X$element"; then + haveit=yes + break + fi + done + if test -z "$haveit"; then + CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" + fi + done + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5 +$as_echo_n "checking for iconv... " >&6; } +if test "${am_cv_func_iconv+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <iconv.h> +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS $LIBICONV" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdlib.h> +#include <iconv.h> +int +main () +{ +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$am_save_LIBS" + fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5 +$as_echo "$am_cv_func_iconv" >&6; } + if test "$am_cv_func_iconv" = yes; then + +$as_echo "#define HAVE_ICONV 1" >>confdefs.h + + fi + if test "$am_cv_lib_iconv" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5 +$as_echo_n "checking how to link with libiconv... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5 +$as_echo "$LIBICONV" >&6; } + else + CPPFLAGS="$am_save_CPPFLAGS" + LIBICONV= + LTLIBICONV= + fi + + + + if test "$am_cv_func_iconv" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv declaration" >&5 +$as_echo_n "checking for iconv declaration... " >&6; } + if test "${am_cv_proto_iconv+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include <stdlib.h> +#include <iconv.h> +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_cxx_try_compile "$LINENO"; then : + am_cv_proto_iconv_arg1="" +else + am_cv_proto_iconv_arg1="const" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" +fi + + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_t:- + }$am_cv_proto_iconv" >&5 +$as_echo "${ac_t:- + }$am_cv_proto_iconv" >&6; } + +cat >>confdefs.h <<_ACEOF +#define ICONV_CONST $am_cv_proto_iconv_arg1 +_ACEOF + + fi + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +else @@ -9990,6 +10161,8 @@ _ACEOF fi +fi + # Until we have in-tree GNU iconv: LIBICONV_DEP= @@ -17628,7 +17801,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17631 "configure" +#line 17804 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -17734,7 +17907,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 17737 "configure" +#line 17910 "configure" #include "confdefs.h" #if HAVE_DLFCN_H |