aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libiberty/ChangeLog5
-rwxr-xr-xlibiberty/configure67
-rw-r--r--libiberty/configure.ac3
3 files changed, 73 insertions, 2 deletions
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 9a80ed4..f700058 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,5 +1,10 @@
2007-06-14 Paolo Bonzini <bonzini@gnu.org>
+ * configure.ac: Use ACX_PROG_CC_ALMOST_PEDANTIC too.
+ * configure: Regenerate.
+
+2007-06-14 Paolo Bonzini <bonzini@gnu.org>
+
* aclocal.m4: Include config/warnings.m4.
* configure.ac: Use ACX_PROG_CC_WARNING_OPTS.
* configure: Regenerate.
diff --git a/libiberty/configure b/libiberty/configure
index d350af7..0312cc4 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 8212378..371864e 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.