aboutsummaryrefslogtreecommitdiff
path: root/libiberty/configure
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2007-06-14 08:17:50 +0000
committerPaolo Bonzini <bonzini@gnu.org>2007-06-14 08:17:50 +0000
commita104c397e762939248436df5128bf6d6a6f04edc (patch)
tree2f00d5946b4f17160d50e6763ada3440fb4e2d86 /libiberty/configure
parent2b58cd72465861cd3bf4fb7249da406326ed98bc (diff)
downloadgdb-a104c397e762939248436df5128bf6d6a6f04edc.zip
gdb-a104c397e762939248436df5128bf6d6a6f04edc.tar.gz
gdb-a104c397e762939248436df5128bf6d6a6f04edc.tar.bz2
2007-06-14 Paolo Bonzini <bonzini@gnu.org>
* aclocal.m4: Include config/warnings.m4. * configure.ac: Use ACX_PROG_CC_WARNING_OPTS. * configure: Regenerate.
Diffstat (limited to 'libiberty/configure')
-rwxr-xr-xlibiberty/configure46
1 files changed, 27 insertions, 19 deletions
diff --git a/libiberty/configure b/libiberty/configure
index c745d8b..d350af7 100755
--- a/libiberty/configure
+++ b/libiberty/configure
@@ -2953,22 +2953,33 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_c_preproc_warn_flag=yes
-# Warn C++ incompatibilities if supported.
-echo "$as_me:$LINENO: checking whether ${CC} accepts -Wc++-compat" >&5
-echo $ECHO_N "checking whether ${CC} accepts -Wc++-compat... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_w_cxx_compat+set}" = set; then
+ac_libiberty_warn_cflags=
+save_CFLAGS="$CFLAGS"
+for option in -W -Wall -pedantic -Wwrite-strings -Wc++-compat \
+ -Wstrict-prototypes; do
+ as_acx_Woption=`echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
+
+ echo "$as_me:$LINENO: checking whether $CC supports $option" >&5
+echo $ECHO_N "checking whether $CC supports $option... $ECHO_C" >&6
+if eval "test \"\${$as_acx_Woption+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- save_CFLAGS="$CFLAGS"
- CFLAGS="-Wc++-compat"
- cat >conftest.$ac_ext <<_ACEOF
+ CFLAGS="$option"
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+int
+main ()
+{
+
+ ;
+ return 0;
+}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -2992,28 +3003,25 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
- ac_cv_prog_cc_w_cxx_compat=yes
+ eval "$as_acx_Woption=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_prog_cc_w_cxx_compat=no
+eval "$as_acx_Woption=no"
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- CFLAGS="$save_CFLAGS"
fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_w_cxx_compat" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_w_cxx_compat" >&6
-
-
-if test x$GCC = xyes; then
- ac_libiberty_warn_cflags='-W -Wall -pedantic -Wwrite-strings -Wstrict-prototypes'
-fi
-if test $ac_cv_prog_cc_w_cxx_compat = yes ; then
- ac_libiberty_warn_cflags="${ac_libiberty_warn_cflags} -Wc++-compat"
+echo "$as_me:$LINENO: result: `eval echo '${'$as_acx_Woption'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_acx_Woption'}'`" >&6
+ if test `eval echo '${'$as_acx_Woption'}'` = yes; then
+ ac_libiberty_warn_cflags="$ac_libiberty_warn_cflags${ac_libiberty_warn_cflags:+ }$option"
fi
+ done
+CFLAGS="$save_CFLAGS"
+
if test "x$CC" != xcc; then
echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5