* configure.ac (WEXTRA): New variable (set to "-Wextra" if the latter
is supported by GCC, otherwise to "-W").
* configure.ac (CFLAGS): Use WEXTRA variable (only if GCC).
esac
if test "$GCC" == yes; then
- CFLAGS="-Wall -Wextra $CFLAGS"
+ # Output all warnings.
+ AC_MSG_CHECKING(for gcc -Wextra)
+ old_CFLAGS="$CFLAGS"
+ CFLAGS="-Wextra $CFLAGS"
+ AC_TRY_COMPILE([],[], [ac_cv_cc_wextra=yes], [ac_cv_cc_wextra=no])
+ CFLAGS="$old_CFLAGS"
+ AC_MSG_RESULT($ac_cv_cc_wextra)
+ AS_IF([test "$ac_cv_cc_wextra" = yes], [WEXTRA="-Wextra"], [WEXTRA="-W"])
+ CFLAGS="-Wall $WEXTRA $CFLAGS"
fi
AC_MSG_CHECKING(for xlc)