Commit 156b14cd authored by Colin Walters's avatar Colin Walters

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
parent e3582c61
......@@ -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
......
......@@ -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 = \
......
......@@ -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
......
......@@ -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 \
......
......@@ -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 += \
......
......@@ -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 \
......
......@@ -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
......
......@@ -6,6 +6,8 @@ AM_CPPFLAGS = \
$(gobject_INCLUDES) \
$(GLIB_DEBUG_FLAGS)
AM_CFLAGS = $(GLIB_WARN_CFLAGS)
if CROSS_COMPILING
glib_genmarshal=$(GLIB_GENMARSHAL)
else
......
......@@ -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 \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment