[glib] build: Add --disable-compile-warnings



commit 156b14cde5423c5bdaf8f28f1a8a5a0b54fbe455
Author: Colin Walters <walters verbum org>
Date:   Tue Feb 26 11:19:51 2013 -0500

    build: Add --disable-compile-warnings
    
    Some (broken) toolchains for example trip up
    -Werror=missing-prototypes in system headers.  This patch allows
    people to skip the formerly hardcoded "baseline" warnings.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694757

 configure.ac              |   10 ++++++++--
 gio/Makefile.am           |    2 ++
 gio/tests/Makefile.am     |   11 ++++++-----
 glib/Makefile.am          |    2 ++
 glib/tests/Makefile.am    |    2 ++
 gmodule/Makefile.am       |    2 ++
 gobject/Makefile.am       |    2 ++
 gobject/tests/Makefile.am |    2 ++
 gthread/Makefile.am       |    2 ++
 9 files changed, 28 insertions(+), 7 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 8745702..f734b7c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3616,12 +3616,18 @@ AC_SUBST(GLIB_HIDDEN_VISIBILITY_CFLAGS)
 
 dnl Compiler flags; macro originates from systemd
 dnl See https://bugzilla.gnome.org/show_bug.cgi?id=608953
-CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
+AC_ARG_ENABLE(compile-warnings,
+              [AS_HELP_STRING([--disable-compile-warnings],
+                              [Don't use builtin compiler warnings])],,
+                             enable_compile_warnings=yes)
+AS_IF([test "x$enable_compile_warnings" = xyes], [
+  CC_CHECK_FLAGS_APPEND([GLIB_WARN_CFLAGS], [CFLAGS], [\
    -Wall -Wstrict-prototypes -Werror=declaration-after-statement \
    -Werror=missing-prototypes -Werror=implicit-function-declaration \
    -Werror=pointer-arith -Werror=init-self -Werror=format-security \
    -Werror=format=2 -Werror=missing-include-dirs])
-CFLAGS="$with_cflags $CFLAGS"
+])
+AC_SUBST(GLIB_WARN_CFLAGS)
 
 #
 # Define variables corresponding to the correct include paths to use for
diff --git a/gio/Makefile.am b/gio/Makefile.am
index 06c71b9..94d7f59 100644
--- a/gio/Makefile.am
+++ b/gio/Makefile.am
@@ -30,6 +30,8 @@ AM_CPPFLAGS = \
        -DGIO_COMPILATION                               \
        -DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\"  
 
+AM_CFLAGS = $(GLIB_WARN_CFLAGS)
+
 lib_LTLIBRARIES = libgio-2.0.la
 
 gdbus_headers =                        \
diff --git a/gio/tests/Makefile.am b/gio/tests/Makefile.am
index a6c56e1..c8a4090 100644
--- a/gio/tests/Makefile.am
+++ b/gio/tests/Makefile.am
@@ -16,6 +16,7 @@ AM_CPPFLAGS =                                 \
        -DSRCDIR=\""$(srcdir)"\"        \
        -DTEST_SERVICES=\""$(abs_top_builddir)/gio/tests/services"\"
 
+AM_CFLAGS = $(GLIB_WARN_CFLAGS)
 
 noinst_PROGRAMS = $(TEST_PROGS) $(SAMPLE_PROGS)
 noinst_DATA = $(MISC_STUFF)
@@ -198,7 +199,7 @@ gdbus_testserver_SOURCES = gdbus-testserver.c
 if HAVE_DBUS1
 TEST_PROGS += gdbus-serialization
 gdbus_serialization_SOURCES = gdbus-serialization.c gdbus-tests.h gdbus-tests.c
-gdbus_serialization_CFLAGS = $(DBUS1_CFLAGS)
+gdbus_serialization_CFLAGS = $(AM_CFLAGS) $(DBUS1_CFLAGS)
 gdbus_serialization_LDADD = $(LDADD) $(DBUS1_LIBS)
 endif
 
@@ -368,18 +369,18 @@ tls_certificate_SOURCES = tls-certificate.c gtesttlsbackend.c gtesttlsbackend.h
 # -----------------------------------------------------------------------------
 
 if OS_UNIX
-gdbus_example_objectmanager_server_CFLAGS   = -I$(top_builddir)/gio/tests/gdbus-object-manager-example
+gdbus_example_objectmanager_server_CFLAGS   = $(AM_CFLAGS) 
-I$(top_builddir)/gio/tests/gdbus-object-manager-example
 gdbus_example_objectmanager_server_LDADD    = 
$(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
 
-gdbus_example_objectmanager_client_CFLAGS   = -I$(top_builddir)/gio/tests/gdbus-object-manager-example
+gdbus_example_objectmanager_client_CFLAGS   = $(AM_CFLAGS) 
-I$(top_builddir)/gio/tests/gdbus-object-manager-example
 gdbus_example_objectmanager_client_LDADD    = 
$(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
 
 gdbus_peer_SOURCES = gdbus-peer.c gdbus-tests.h gdbus-tests.c
-gdbus_peer_CFLAGS  = -I$(top_builddir)/gio/tests/gdbus-object-manager-example
+gdbus_peer_CFLAGS  = $(AM_CFLAGS) -I$(top_builddir)/gio/tests/gdbus-object-manager-example
 gdbus_peer_LDADD   = 
$(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
 
 gdbus_test_fixture_SOURCES = gdbus-test-fixture.c
-gdbus_test_fixture_CFLAGS  = -I$(top_builddir)/gio/tests/gdbus-object-manager-example
+gdbus_test_fixture_CFLAGS  = $(AM_CFLAGS) -I$(top_builddir)/gio/tests/gdbus-object-manager-example
 gdbus_test_fixture_LDADD   = 
$(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
 
 endif OS_UNIX
diff --git a/glib/Makefile.am b/glib/Makefile.am
index 657978d..9230ecc 100644
--- a/glib/Makefile.am
+++ b/glib/Makefile.am
@@ -49,6 +49,8 @@ AM_CPPFLAGS =                                 \
        -DGLIB_COMPILATION              \
        -DPCRE_STATIC
 
+AM_CFLAGS = $(GLIB_WARN_CFLAGS)
+
 MIRRORING_TAB_SOURCE =                                 \
        glib-mirroring-tab/Makefile             \
        glib-mirroring-tab/gen-mirroring-tab.c  \
diff --git a/glib/tests/Makefile.am b/glib/tests/Makefile.am
index 3ffbab1..d3fc0b0 100644
--- a/glib/tests/Makefile.am
+++ b/glib/tests/Makefile.am
@@ -7,6 +7,8 @@ AM_CPPFLAGS =                           \
        -DSRCDIR=\""$(srcdir)"\"        \
        $(GLIB_DEBUG_FLAGS)
 
+AM_CFLAGS = $(GLIB_WARN_CFLAGS)
+
 LDADD = $(top_builddir)/glib/libglib-2.0.la -lm
 
 TEST_PROGS +=                          \
diff --git a/gmodule/Makefile.am b/gmodule/Makefile.am
index e0a8e1a..4a75a30 100644
--- a/gmodule/Makefile.am
+++ b/gmodule/Makefile.am
@@ -7,6 +7,8 @@ AM_CPPFLAGS =                           \
        @GLIB_DEBUG_FLAGS@              \
        -DG_DISABLE_DEPRECATED
 
+AM_CFLAGS = $(GLIB_WARN_CFLAGS)
+
 EXTRA_DIST +=                          \
                makefile.msc.in         \
                gmoduleconf.h.in        \
diff --git a/gobject/Makefile.am b/gobject/Makefile.am
index ae27b51..d1b52d1 100644
--- a/gobject/Makefile.am
+++ b/gobject/Makefile.am
@@ -18,6 +18,8 @@ AM_CPPFLAGS =                                         \
        $(GLIB_DEBUG_FLAGS)                     \
        -DGOBJECT_COMPILATION
 
+AM_CFLAGS = $(GLIB_WARN_CFLAGS)
+
 libglib = $(top_builddir)/glib/libglib-2.0.la
 
 # libraries to compile and install
diff --git a/gobject/tests/Makefile.am b/gobject/tests/Makefile.am
index 28bd09d..74efcf8 100644
--- a/gobject/tests/Makefile.am
+++ b/gobject/tests/Makefile.am
@@ -6,6 +6,8 @@ AM_CPPFLAGS =                                   \
        $(gobject_INCLUDES)                     \
        $(GLIB_DEBUG_FLAGS)
 
+AM_CFLAGS = $(GLIB_WARN_CFLAGS)
+
 if CROSS_COMPILING
   glib_genmarshal=$(GLIB_GENMARSHAL)
 else
diff --git a/gthread/Makefile.am b/gthread/Makefile.am
index 2aa5078..9132be6 100644
--- a/gthread/Makefile.am
+++ b/gthread/Makefile.am
@@ -7,6 +7,8 @@ AM_CPPFLAGS =                           \
        @GTHREAD_COMPILE_IMPL_DEFINES@  \
        @GLIB_DEBUG_FLAGS@
 
+AM_CFLAGS = $(GLIB_WARN_CFLAGS)
+
 EXTRA_DIST +=                          \
                makefile.msc.in         \
                gthread.def             \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]