From e941124721742b4972785960645a57178fabb71c Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Thu, 3 Nov 2011 17:17:07 +0000 Subject: re PR bootstrap/50857 (The compiler is built with exceptions and RTTI enabled) libcpp/ PR bootstrap/50857 * configure.ac: Check for -fno-exceptions -fno-rtti. * configure: Regenerate. * Makefile.in (NOEXCEPTION_FLAGS): New flag. (ALL_CXXFLAGS): Use it. gcc/ PR bootstrap/50857 * configure.ac: Check for -fno-exceptions -fno-rtti. * configure: Regenerate. * Makefile.in (NOEXCEPTION_FLAGS): New flag. (ALL_CXXFLAGS): Use it. From-SVN: r180833 --- libcpp/configure | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'libcpp/configure') diff --git a/libcpp/configure b/libcpp/configure index a26a4775bf9..803daae2b2e 100755 --- a/libcpp/configure +++ b/libcpp/configure @@ -616,6 +616,7 @@ CCDEPMODE DEPDIR am__leading_dot WERROR +noexception_flags WARN_PEDANTIC c_warn warn @@ -4802,6 +4803,47 @@ fi fi +# Disable exceptions and RTTI if building with g++ +noexception_flags= +save_CFLAGS="$CFLAGS" +for option in -fno-exceptions -fno-rtti; do + as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh` + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5 +$as_echo_n "checking whether $CC supports $option... " >&6; } +if { as_var=$as_acx_Woption; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + CFLAGS="$option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$as_acx_Woption=yes" +else + eval "$as_acx_Woption=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +eval ac_res=\$$as_acx_Woption + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then : + noexception_flags="$noexception_flags${noexception_flags:+ }$option" +fi + done +CFLAGS="$save_CFLAGS" + + # Only enable with --enable-werror-always until existing warnings are # corrected. WERROR= -- cgit v1.2.3