aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-03-07 18:43:28 +0000
committerJoão Valverde <j@v6e.pt>2016-04-07 17:44:36 +0000
commit2b20326fd26b1b956ac3e68f16edcea37191377b (patch)
tree1cd50bbff6fc0315aacc7a619cd0d698373c47b0
parentce83807beff82d3ca15904807c92d254994f40e9 (diff)
autotools: Use AC_SUBST to set -Werror flag
Change-Id: I34a90155ab613ca97bf58b72f56ec08eff87d3ab Reviewed-on: https://code.wireshark.org/review/14849 Reviewed-by: João Valverde <j@v6e.pt>
-rw-r--r--Makefile.am.inc6
-rw-r--r--configure.ac8
-rw-r--r--tools/lemon/Makefile.am6
3 files changed, 6 insertions, 14 deletions
diff --git a/Makefile.am.inc b/Makefile.am.inc
index 45b8533c36..0f39785c9a 100644
--- a/Makefile.am.inc
+++ b/Makefile.am.inc
@@ -27,12 +27,6 @@ LEMON = $(top_builddir)/tools/lemon/lemon$(EXEEXT)
RUNLEX = $(top_srcdir)/tools/runlex.sh
-if HAVE_WARNINGS_AS_ERRORS
-WERROR = -Werror
-else
-WERROR =
-endif
-
INCLUDEDIRS = -I$(top_srcdir)
#AM_CPPFLAGS = $(INCLUDEDIRS) $(WS_CPPFLAGS)
diff --git a/configure.ac b/configure.ac
index b966b2f8d2..1dbe9fd6b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1279,9 +1279,11 @@ AC_ARG_ENABLE(warnings-as-errors,
with_warnings_as_errors="no"
AC_MSG_RESULT(no)
fi
-]
-)
-AM_CONDITIONAL(HAVE_WARNINGS_AS_ERRORS, test "x$with_warnings_as_errors" = "xyes")
+])
+
+AS_IF([test "x$with_warnings_as_errors" = "xyes"], [WERROR="-Werror"], [WERROR=""])
+AC_SUBST(WERROR)
+AM_CONDITIONAL(HAVE_WARNINGS_AS_ERRORS, [test "x$with_warnings_as_errors" = "xyes"])
#
# Add any platform-specific compiler flags needed.
diff --git a/tools/lemon/Makefile.am b/tools/lemon/Makefile.am
index f2a86dc84a..209d1f6d7a 100644
--- a/tools/lemon/Makefile.am
+++ b/tools/lemon/Makefile.am
@@ -31,14 +31,10 @@ CFLAGS = $(CFLAGS_FOR_BUILD)
LDFLAGS = $(LDFLAGS_FOR_BUILD)
LIBS =
-if HAVE_WARNINGS_AS_ERRORS
-WERROR = -Werror
-endif
+AM_CFLAGS = $(WERROR) $(WS_CFLAGS_FOR_BUILD)
noinst_PROGRAMS = lemon
-lemon_CFLAGS = $(WERROR) $(WS_CFLAGS_FOR_BUILD)
-
CLEANFILES = \
*~