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>
Tue, 18 Feb 2020 20:31:55 +0000 (15:31 -0500)
commit7f08cc82e68617aa423952b8f9cc7c74bc247f8d
tree1113a9f95610e708c956f88904df0255f21ec4e8
parent2868dcc95f37ab202cea1e4a3a00a88f7b42ba86
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.025399 seconds and 4 git commands to generate.