aboutsummaryrefslogtreecommitdiff
path: root/m4/compiler_warnings.m4
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2019-11-19 11:06:43 +0100
committerAleksander Morgado <aleksander@aleksander.es>2020-01-30 11:59:14 +0100
commit1c078531a017358241a35475fb24f2bd65d501db (patch)
treea2dd47febbed8353ca3917f396f905a342fa19dc /m4/compiler_warnings.m4
parent4bfd955e64af56b47d398a857be4e8e1b16ce260 (diff)
build: use AX_IS_RELEASE() and AX_COMPILER_FLAGS()
The autoconf macros AX_COMPILER_FLAGS_{CFLAGS|GIR|LDFLAGS} test for compiler and linker support of various flags, and add the flags to the generated output. If the command-line option '--enable-compile-warnings' is specified to 'configure', a number of additional warning options is also added to the output. This is the default. This update requires the presence of the GNU autoconf-archive in the system.
Diffstat (limited to 'm4/compiler_warnings.m4')
-rw-r--r--m4/compiler_warnings.m435
1 files changed, 0 insertions, 35 deletions
diff --git a/m4/compiler_warnings.m4 b/m4/compiler_warnings.m4
deleted file mode 100644
index 35d005c2..00000000
--- a/m4/compiler_warnings.m4
+++ /dev/null
@@ -1,35 +0,0 @@
-AC_DEFUN([NM_COMPILER_WARNINGS],
-[AC_ARG_ENABLE(more-warnings,
- AS_HELP_STRING([--enable-more-warnings], [Possible values: no/yes/error]),
- set_more_warnings="$enableval",set_more_warnings=error)
-AC_MSG_CHECKING(for more warnings)
-if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
- AC_MSG_RESULT(yes)
- CFLAGS="-Wall -std=gnu89 $CFLAGS"
-
- for option in -Wmissing-declarations -Wmissing-prototypes \
- -Wdeclaration-after-statement -Wstrict-prototypes \
- -Wno-unused-parameter -Wno-sign-compare \
- -Wno-deprecated-declarations -Wno-unused-function \
- -Wunused-variable -Wformat-security; do
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $option -Werror"
- AC_MSG_CHECKING([whether gcc understands $option])
- AC_TRY_COMPILE([], [],
- has_option=yes,
- has_option=no,)
- if test $has_option = no; then
- CFLAGS="$SAVE_CFLAGS"
- fi
- AC_MSG_RESULT($has_option)
- unset has_option
- unset SAVE_CFLAGS
- done
- unset option
- if test "x$set_more_warnings" = xerror; then
- CFLAGS="$CFLAGS -Werror"
- fi
-else
- AC_MSG_RESULT(no)
-fi
-])