+Thu Mar 30 15:50:05 2006 Ben Pfaff <blp@gnu.org>
+
+ * Smake: Enable -Wdeclaration-after-statement warning if
+ available.
+
+ * acinclude.m4: Add macro for checking whether a warning is
+ supported.
+
Mon Mar 20 16:32:11 2006 Ben Pfaff <blp@gnu.org>
* Smake: Require "unistd" gnulib module. Removed tests for
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
+dnl Check whether a warning flag is accepted.
+dnl If so, add it to CFLAGS.
+dnl Example: PSPP_ENABLE_WARNING(-Wdeclaration-after-statement)
+AC_DEFUN([PSPP_ENABLE_WARNING],
+[
+ m4_define([pspp_cv_name], [pspp_cv_[]m4_translit([$1], [-], [_])])dnl
+ AC_CACHE_CHECK([whether $CC accepts $1], [pspp_cv_name],
+ [pspp_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $1"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,)], [pspp_cv_name[]=yes], [pspp_cv_name[]=no])
+ CFLAGS="$pspp_save_CFLAGS"])
+ if test $pspp_cv_name = yes; then
+ CFLAGS="$CFLAGS $1"
+ fi
+])
+
dnl Check for readline and history libraries.
dnl Modified for PSPP by Ben Pfaff, based on readline.m4 serial 3 from
-0dnl Process this file with autoconf to produce a configure script.
+dnl Process this file with autoconf to produce a configure script.
dnl Initialize.
AX_PREREQ(2.57)
AC_PROG_RANLIB
gl_EARLY
+PSPP_ENABLE_WARNING(-Wdeclaration-after-statement)
+
AM_CONDITIONAL(cc_is_gcc, test x"$GCC" = x"yes" )