From b729ed01093312cef7ce48d07b13e225b25446db Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sat, 7 Apr 2012 13:03:41 -0500 Subject: Add a new configure option for excessive compiler warning flags This adds a bunch of warning flags to the list used when compiling. Signed-off-by: Dan McGee --- m4/acinclude.m4 | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'm4') diff --git a/m4/acinclude.m4 b/m4/acinclude.m4 index df4f83a4..8ea45973 100644 --- a/m4/acinclude.m4 +++ b/m4/acinclude.m4 @@ -101,6 +101,26 @@ AC_DEFUN([GCC_GNU89_INLINE_CC],[ fi ]) +dnl CFLAGS_ADD(PARAMETER, VARIABLE) +dnl Adds parameter to VARIABLE if the compiler supports it. For example, +dnl CFLAGS_ADD([-Wall],[WARN_FLAGS]). +AC_DEFUN([CFLAGS_ADD], +[AS_VAR_PUSHDEF([my_cflags], [cflags_cv_warn_$1])dnl +AC_CACHE_CHECK([whether compiler handles $1], [my_cflags], [ + save_CFLAGS="$CFLAGS" + CFLAGS="${CFLAGS} $1" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [AS_VAR_SET([my_cflags], [yes])], + [AS_VAR_SET([my_cflags], [no])]) + CFLAGS="$save_CFLAGS" +]) +AS_VAR_PUSHDEF([new_cflags], [[$2]])dnl +AS_VAR_IF([my_cflags], [yes], [AS_VAR_APPEND([new_cflags], [" $1"])]) +AS_VAR_POPDEF([new_cflags])dnl +AS_VAR_POPDEF([my_cflags])dnl +m4_ifval([$2], [AS_LITERAL_IF([$2], [AC_SUBST([$2])], [])])dnl +]) + dnl Checks for getmntinfo and determines whether it uses statfs or statvfs AC_DEFUN([FS_STATS_TYPE], [AC_CACHE_CHECK([filesystem statistics type], fs_stats_cv_type, -- cgit v1.2.3-70-g09d2