From 1f616ca10d6c112b81ac7be7e9251d267dc2c283 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 14 Jun 2007 14:41:46 +0000 Subject: [PATCH] 2007-06-14 Paolo Bonzini * configure.ac: Use ACX_PROG_CC_ALMOST_PEDANTIC too. * configure: Regenerate. --- libiberty/ChangeLog | 5 ++++ libiberty/configure | 67 +++++++++++++++++++++++++++++++++++++++++- libiberty/configure.ac | 3 +- 3 files changed, 73 insertions(+), 2 deletions(-) diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 9a80ed4a1f..f700058177 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,8 @@ +2007-06-14 Paolo Bonzini + + * configure.ac: Use ACX_PROG_CC_ALMOST_PEDANTIC too. + * configure: Regenerate. + 2007-06-14 Paolo Bonzini * aclocal.m4: Include config/warnings.m4. diff --git a/libiberty/configure b/libiberty/configure index d350af7898..0312cc418d 100755 --- a/libiberty/configure +++ b/libiberty/configure @@ -2956,7 +2956,7 @@ ac_c_preproc_warn_flag=yes ac_libiberty_warn_cflags= save_CFLAGS="$CFLAGS" -for option in -W -Wall -pedantic -Wwrite-strings -Wc++-compat \ +for option in -W -Wall -Wwrite-strings -Wc++-compat \ -Wstrict-prototypes; do as_acx_Woption=`echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh` @@ -3022,6 +3022,71 @@ fi done CFLAGS="$save_CFLAGS" +if test "$GCC" = yes; then + echo "$as_me:$LINENO: checking whether $CC supports -pedantic " >&5 +echo $ECHO_N "checking whether $CC supports -pedantic ... $ECHO_C" >&6 +if test "${acx_cv_prog_cc_pedantic_+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + save_CFLAGS="$CFLAGS" +CFLAGS="-pedantic " +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 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + acx_cv_prog_cc_pedantic_=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +acx_cv_prog_cc_pedantic_=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS="$save_CFLAGS" +fi +echo "$as_me:$LINENO: result: $acx_cv_prog_cc_pedantic_" >&5 +echo "${ECHO_T}$acx_cv_prog_cc_pedantic_" >&6 +if test $acx_cv_prog_cc_pedantic_ = yes; then + ac_libiberty_warn_cflags="$ac_libiberty_warn_cflags${ac_libiberty_warn_cflags:+ }-pedantic " +fi + + +fi + + if test "x$CC" != xcc; then echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 diff --git a/libiberty/configure.ac b/libiberty/configure.ac index 82123781b3..371864e1e7 100644 --- a/libiberty/configure.ac +++ b/libiberty/configure.ac @@ -132,8 +132,9 @@ GCC_NO_EXECUTABLES AC_PROG_CC AC_PROG_CPP_WERROR -ACX_PROG_CC_WARNING_OPTS([-W -Wall -pedantic -Wwrite-strings -Wc++-compat \ +ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wc++-compat \ -Wstrict-prototypes], [ac_libiberty_warn_cflags]) +ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([], [ac_libiberty_warn_cflags]) AC_PROG_CC_C_O # autoconf is lame and doesn't give us any substitution variable for this.