1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-27 10:25:49 +01:00

configure: rewrote the detection for -Wunused-macro

This flag is always detected as unsupported because every time autoconf is
generating a test program for any feature, it puts at the beginning of the
test source all the '#define' that have been detected so far, which is what
we expect normally.

But for this option, as we cannot reasonably make a dummy use of every
macro, the warning triggers and falsely gets autoconf into thinking it does
not work.

This patch creates a dedicated macro (WM_CFLAGS_GCC_OPTION_UNUSEDMACROS)
for this flag, which works around the problem by having no '#define' in the
test source. It also adds a new macro WM_CFLAGS_GCC_OPTION_POSTPONED
because if the flag works, we still cannot add it to the compilation
command because it could fail all further tests done, so the macro will add
it to CFLAGS only at the end.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2014-12-08 22:42:22 +01:00
committed by Carlos R. Mafra
parent fa4d50a0ca
commit 11fe8bd860
2 changed files with 75 additions and 1 deletions

View File

@@ -146,7 +146,7 @@ AS_IF([test "x$debug" = "xyes"],
dnl
dnl GCC provides a couple of checks to detect incorrect macro uses
AX_CFLAGS_GCC_OPTION([-Wundef])
AX_CFLAGS_GCC_OPTION([-Wunused-macros])
WM_CFLAGS_GCC_OPTION_UNUSEDMACROS
], [dnl
dnl When debug not enabled, we try to avoid some non-necessary
dnl messages from the compiler
@@ -845,6 +845,12 @@ fi
gl_LD_VERSION_SCRIPT
dnl Add the post-poned compilation options
dnl ======================================
WM_CFLAGS_GCC_OPTION_POSTPONED
AC_OUTPUT(Makefile po/Makefile util/Makefile util/po/Makefile test/Makefile \
WINGs/Makefile WINGs/WINGs/Makefile WINGs/Documentation/Makefile \
WINGs/Examples/Makefile WINGs/Resources/Makefile WINGs/Tests/Makefile \