Code

Make building with -Werror optional.
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Fri, 14 Aug 2015 22:15:59 +0000 (00:15 +0200)
committerMarc Fournier <marc.fournier@camptocamp.com>
Tue, 8 Sep 2015 05:27:22 +0000 (07:27 +0200)
I noticed various downstream distros patch out -Werror
for one reason or another. This adds an option to make that
easier. It is still on by default.

configure.ac
src/Makefile.am
src/daemon/Makefile.am
src/libcollectdclient/Makefile.am

index 6f65df1ebb0685f6946de492f0ded694e50aec0b..09e87e4b6fe8540c854babd97f567f3686d2c731 100644 (file)
@@ -5915,6 +5915,20 @@ AC_SUBST(LCC_VERSION_STRING)
 
 AC_CONFIG_FILES(src/libcollectdclient/collectd/lcc_features.h)
 
+AM_CFLAGS="-Wall"
+AC_ARG_ENABLE([werror],
+        AS_HELP_STRING(
+                [--disable-werror],
+                [Disable -Werror @<:@default=no@:>@)]
+        )
+)
+
+if test "x$enable_werror" != "xno"
+then
+        AM_CFLAGS="$AM_CFLAGS -Werror"
+fi
+AC_SUBST([AM_CFLAGS])
+
 AC_CONFIG_FILES([Makefile src/Makefile src/daemon/Makefile src/collectd.conf src/libcollectdclient/Makefile src/libcollectdclient/libcollectdclient.pc src/liboconfig/Makefile bindings/Makefile bindings/java/Makefile])
 AC_OUTPUT
 
index 9493c246239e01aff76354e2bd9e5ffb8039452d..adadbbd27bef87c333bb8cdb7f0ca005c4aac15c 100644 (file)
@@ -6,10 +6,6 @@ SUBDIRS += daemon
 
 PLUGIN_LDFLAGS = -module -avoid-version -export-symbols-regex '\<module_register\>'
 
-if COMPILER_IS_GCC
-AM_CFLAGS = -Wall -Werror
-endif
-
 AM_CPPFLAGS = -I$(srcdir)/daemon
 AM_CPPFLAGS += -DPREFIX='"${prefix}"'
 AM_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
index cd53a7bf205d48333f97d272c7f2e58d20db0628..4e383413589b6f9ef43e5a50fa91ed8f6a3bdf0c 100644 (file)
@@ -1,7 +1,3 @@
-if COMPILER_IS_GCC
-AM_CFLAGS = -Wall -Werror
-endif
-
 AM_CPPFLAGS = -I$(top_srcdir)/src
 AM_CPPFLAGS += -DPREFIX='"${prefix}"'
 AM_CPPFLAGS += -DCONFIGFILE='"${sysconfdir}/${PACKAGE_NAME}.conf"'
index 5abee2f1a44f1fd0abdce185c1cb390ffd00aeab..e81a59438394960ab8cb6b4b0c0e40a30ca6befa 100644 (file)
@@ -1,9 +1,5 @@
 AUTOMAKE_OPTIONS = foreign no-dependencies
 
-if COMPILER_IS_GCC
-AM_CFLAGS = -Wall -Werror
-endif
-
 pkginclude_HEADERS = collectd/client.h collectd/network.h collectd/network_buffer.h collectd/lcc_features.h
 lib_LTLIBRARIES = libcollectdclient.la
 nodist_pkgconfig_DATA = libcollectdclient.pc