From d63bbfc6e46c3488a6b7b8780687b28732dbcfd3 Mon Sep 17 00:00:00 2001 From: Alex Ronne Petersen Date: Tue, 10 Jun 2014 09:34:01 +0200 Subject: [PATCH] Add build system plumbing for building with -Werror. * Makefile.am (AM_CFLAGS): Add $(WERROR_CFLAGS). * configure.ac (WERROR_CFLAGS): Define based on --enable-werror new configure option value. Conflicts: Makefile.am configure.ac --- Makefile.am | 2 +- configure.ac | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 1688be21..cef323ba 100644 --- a/Makefile.am +++ b/Makefile.am @@ -126,7 +126,7 @@ EXTRA_DIST += gc_cpp.cpp # ---- AM_CXXFLAGS = @GC_CFLAGS@ -AM_CFLAGS = @GC_CFLAGS@ +AM_CFLAGS = $(WERROR_CFLAGS) @GC_CFLAGS@ ## FIXME: relies on internal code generated by automake. ## FIXME: ./configure --enable-dependency-tracking should be used diff --git a/configure.ac b/configure.ac index fc679239..414edc7d 100644 --- a/configure.ac +++ b/configure.ac @@ -888,6 +888,13 @@ fi AM_CONDITIONAL(USE_LIBDIR, test -z "$with_cross_host") +AC_ARG_ENABLE(werror, [--enable-werror Pass -Werror to the C compiler], + werror_flag=$enableval, werror_flag=no) +if test x$werror_flag = xyes; then + WERROR_CFLAGS="-Werror" +fi +AC_SUBST([WERROR_CFLAGS]) + AC_ARG_ENABLE(single-obj-compilation, [AC_HELP_STRING([--enable-single-obj-compilation], [Compile all library .c files into single .o])], -- 2.40.0