]> granicus.if.org Git - gc/commitdiff
Add build system plumbing for building with -Werror.
authorAlex Ronne Petersen <alexrp@xamarin.com>
Tue, 10 Jun 2014 07:34:01 +0000 (09:34 +0200)
committerIvan Maidanski <ivmai@mail.ru>
Sun, 17 May 2015 11:05:16 +0000 (14:05 +0300)
* 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
configure.ac

index 1688be2128bd7b54a54729b2926e52b9be9cdd5e..cef323baac95508d53443bb38538b3fa12365c07 100644 (file)
@@ -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
index fc6792395ca400d28d3e537a8f33d9b4c905c19f..414edc7d6b021c033d1e2374368a0e20b7e9a9a9 100644 (file)
@@ -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])],