summaryrefslogtreecommitdiff
path: root/m4/ax_compiler_flags.m4
diff options
context:
space:
mode:
authorDavid King <dking@redhat.com>2015-02-05 10:38:05 +0000
committerDavid King <amigadave@amigadave.com>2015-02-05 11:02:34 +0000
commit0f75e40a50ad6d2c8067b6f0163661d37726e618 (patch)
tree07c41a2c694cc3c06277bc0eac4f55a096f42567 /m4/ax_compiler_flags.m4
parent6c542393749556c1db9606d12d614a7f5eb79b40 (diff)
downloadautoconf-archive-0f75e40a50ad6d2c8067b6f0163661d37726e618.tar.gz
ax_compiler_flags: Adapt for AX_COMPILER_FLAGS_CXXFLAGS
Use the new AX_COMPILER_FLAGS_CXXFLAGS macro in AX_COMPILER_FLAGS to test for available C++ compiler warning options, and AC_SUBST them as WARN_CXXFLAGS. Pass the EXTRA-*-CFLAGS variables to AX_COMPILER_FLAGS_CXXFLAGS, to avoid an explosion of arguments, and as most C++ warnings are also valid C warnings.
Diffstat (limited to 'm4/ax_compiler_flags.m4')
-rw-r--r--m4/ax_compiler_flags.m410
1 files changed, 9 insertions, 1 deletions
diff --git a/m4/ax_compiler_flags.m4 b/m4/ax_compiler_flags.m4
index 27d313d..1781b40 100644
--- a/m4/ax_compiler_flags.m4
+++ b/m4/ax_compiler_flags.m4
@@ -55,6 +55,11 @@
# be manually added to the CFLAGS and LDFLAGS variables for each target in
# the code base.
#
+# Warning flags for the C++ compiler are AC_SUBST-ed as WARN_CXXFLAGS, and
+# must be manually added to the CXXFLAGS variables for each target in the
+# code base. EXTRA-*-CFLAGS can be used to augment the flags enabled at
+# each level.
+#
# Warning flags for g-ir-scanner (from GObject Introspection) are
# AC_SUBST-ed as WARN_SCANNERFLAGS. This variable must be manually added
# to the SCANNERFLAGS variable for each GIR target in the code base. If
@@ -71,16 +76,18 @@
# LICENSE
#
# Copyright (c) 2014, 2015 Philip Withnall <philip@tecnocode.co.uk>
+# Copyright (c) 2015 David King <amigadave@amigadave.com>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 6
+#serial 7
AC_DEFUN([AX_COMPILER_FLAGS],[
AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS_CFLAGS])
+ AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS_CXXFLAGS])
AX_REQUIRE_DEFINED([AX_COMPILER_FLAGS_LDFLAGS])
AC_ARG_ENABLE([compile-warnings],
@@ -94,6 +101,7 @@ AC_DEFUN([AX_COMPILER_FLAGS],[
ax_enable_compile_warnings=$enable_compile_warnings
AX_COMPILER_FLAGS_CFLAGS([$1],[$3],[$4],[$5],[$6],[$7],[$8])
+ AX_COMPILER_FLAGS_CXXFLAGS([WARN_CXXFLAGS],[$3],[$4],[$5],[$6],[$7],[$8])
AX_COMPILER_FLAGS_LDFLAGS([$2],[$3],[$9],[$10],[$11],[$12],[$13])
AX_COMPILER_FLAGS_GIR([WARN_SCANNERFLAGS],[$3])
])dnl AX_COMPILER_FLAGS