X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=acinclude.m4;fp=acinclude.m4;h=42ae613bfb88b4fe6d390fd0dcd05e93b764d5cb;hb=11815efff162eacc5a46666af7876035f665965c;hp=e3ddb129b1464f0119500566fbe61d8e8bbdb6c3;hpb=352d48a9cf76667dd4824326c7151df70e90d7a1;p=pspp-builds.git diff --git a/acinclude.m4 b/acinclude.m4 index e3ddb129..42ae613b 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -3,6 +3,22 @@ dnl This file is free software; the Free Software Foundation 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