configure: use AX_APPEND_COMPILE_FLAGS to detect supported warning flags
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 31 Jan 2020 18:05:20 +0000 (13:05 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 25 Mar 2020 19:18:03 +0000 (15:18 -0400)
commitedc3cdab15798fb535180bebb6ed4e8e6119ab8f
tree3f571a0f4e59e4367a9ac5a132c6fa4d204e9231
parent4fdd1e3a8c31ee2427cc0c2b35c583ce6dd53b8f
configure: use AX_APPEND_COMPILE_FLAGS to detect supported warning flags

I would eventually like to enable some additional warnings by default
when building lttng-tools.  However, some warnings are
compiler-specific or are not present in older versions of some compilers
we need to support.  We can therefore not add them unconditionally to
CFLAGS.

This patch uses the AX_APPEND_COMPILE_FLAGS macro to address that.  This
macro tests each individual flag we pass it with the current compiler.
If it finds that the flag is supported (the compiler exits with status 0
when compiling a file with that flag), it appends it to the given
variable, WARN_CFLAGS in our case).  WARN_CFLAGS is then added to
AM_CFLAGS.

With time, we'll be able to throw any warning flag in there that we
think is useful, even if just available in a recent version of one
compiler.

Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Change-Id: Id2ae4b4e8882af788c835ce89a979544531370e9
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac
m4/ax_append_compile_flags.m4 [new file with mode: 0644]
m4/ax_append_flag.m4 [new file with mode: 0644]
m4/ax_check_compile_flag.m4 [new file with mode: 0644]
m4/ax_require_defined.m4 [new file with mode: 0644]
This page took 0.0259 seconds and 4 git commands to generate.