-AC_CACHE_CHECK([whether compiler supports -Wextra], [nmh_cv_has_wextra],
-[nmh_saved_cflags="$CFLAGS"
- CFLAGS="$CFLAGS -Wextra -Werror"
- AC_TRY_COMPILE([],[],nmh_cv_has_wextra=yes,nmh_cv_has_wextra=no)
- CFLAGS="$nmh_saved_cflags"])
-
-dnl Can't use -ansi with gcc 4.5.3 on Cygwin, at least through setup
-dnl setup version 2.763, because it disables some features in the
-dnl system system header files and warns about them with -Wall. Try
-dnl to test for that generally, though still with gcc.
-if test "$GCC" = yes; then
- AC_CACHE_CHECK([whether we can use -ansi with linker],
- [nmh_cv_has_dash_ansi_with_linker],
- [nmh_saved_ldflags="$LDFLAGS"
- LDFLAGS="-ansi -pedantic-errors"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>],[tzset();])],
- [nmh_cv_has_dash_ansi_with_linker=yes],
- [nmh_cv_has_dash_ansi_with_linker=no])
- LDFLAGS="$nmh_saved_ldflags"])
-
- dnl Can't use -ansi with the linker on FreeBSD 10. If -ansi can't
- dnl be used with the linker, don't try to put it in CFLAGS.
- if test "$nmh_cv_has_dash_ansi_with_linker" = yes; then
+dnl ----------------
+dnl CUSTOMIZE CFLAGS
+dnl ----------------
+if test -n "$auto_cflags"; then
+ dnl The user didn't specify CFLAGS, so customize them.
+ if test "$GCC" = yes; then
+ dnl Can't use -ansi with gcc 4.5.3 on Cygwin, at least through setup
+ dnl version 2.763, because it disables some features in the system
+ dnl header files and warns about them with -Wall. Try to test for
+ dnl that generally, with gcc.