mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-09 20:35:49 +01:00
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
This commit is contained in:
parent
e3582c617c
commit
156b14cde5
10
configure.ac
10
configure.ac
@ -3616,12 +3616,18 @@ AC_SUBST(GLIB_HIDDEN_VISIBILITY_CFLAGS)
|
|||||||
|
|
||||||
dnl Compiler flags; macro originates from systemd
|
dnl Compiler flags; macro originates from systemd
|
||||||
dnl See https://bugzilla.gnome.org/show_bug.cgi?id=608953
|
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 \
|
-Wall -Wstrict-prototypes -Werror=declaration-after-statement \
|
||||||
-Werror=missing-prototypes -Werror=implicit-function-declaration \
|
-Werror=missing-prototypes -Werror=implicit-function-declaration \
|
||||||
-Werror=pointer-arith -Werror=init-self -Werror=format-security \
|
-Werror=pointer-arith -Werror=init-self -Werror=format-security \
|
||||||
-Werror=format=2 -Werror=missing-include-dirs])
|
-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
|
# Define variables corresponding to the correct include paths to use for
|
||||||
|
@ -30,6 +30,8 @@ AM_CPPFLAGS = \
|
|||||||
-DGIO_COMPILATION \
|
-DGIO_COMPILATION \
|
||||||
-DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\"
|
-DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\"
|
||||||
|
|
||||||
|
AM_CFLAGS = $(GLIB_WARN_CFLAGS)
|
||||||
|
|
||||||
lib_LTLIBRARIES = libgio-2.0.la
|
lib_LTLIBRARIES = libgio-2.0.la
|
||||||
|
|
||||||
gdbus_headers = \
|
gdbus_headers = \
|
||||||
|
@ -16,6 +16,7 @@ AM_CPPFLAGS = \
|
|||||||
-DSRCDIR=\""$(srcdir)"\" \
|
-DSRCDIR=\""$(srcdir)"\" \
|
||||||
-DTEST_SERVICES=\""$(abs_top_builddir)/gio/tests/services"\"
|
-DTEST_SERVICES=\""$(abs_top_builddir)/gio/tests/services"\"
|
||||||
|
|
||||||
|
AM_CFLAGS = $(GLIB_WARN_CFLAGS)
|
||||||
|
|
||||||
noinst_PROGRAMS = $(TEST_PROGS) $(SAMPLE_PROGS)
|
noinst_PROGRAMS = $(TEST_PROGS) $(SAMPLE_PROGS)
|
||||||
noinst_DATA = $(MISC_STUFF)
|
noinst_DATA = $(MISC_STUFF)
|
||||||
@ -198,7 +199,7 @@ gdbus_testserver_SOURCES = gdbus-testserver.c
|
|||||||
if HAVE_DBUS1
|
if HAVE_DBUS1
|
||||||
TEST_PROGS += gdbus-serialization
|
TEST_PROGS += gdbus-serialization
|
||||||
gdbus_serialization_SOURCES = gdbus-serialization.c gdbus-tests.h gdbus-tests.c
|
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)
|
gdbus_serialization_LDADD = $(LDADD) $(DBUS1_LIBS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -368,18 +369,18 @@ tls_certificate_SOURCES = tls-certificate.c gtesttlsbackend.c gtesttlsbackend.h
|
|||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
if OS_UNIX
|
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_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_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_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_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_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)
|
gdbus_test_fixture_LDADD = $(top_builddir)/gio/tests/gdbus-object-manager-example/libgdbus-example-objectmanager.la $(LDADD)
|
||||||
|
|
||||||
endif OS_UNIX
|
endif OS_UNIX
|
||||||
|
@ -49,6 +49,8 @@ AM_CPPFLAGS = \
|
|||||||
-DGLIB_COMPILATION \
|
-DGLIB_COMPILATION \
|
||||||
-DPCRE_STATIC
|
-DPCRE_STATIC
|
||||||
|
|
||||||
|
AM_CFLAGS = $(GLIB_WARN_CFLAGS)
|
||||||
|
|
||||||
MIRRORING_TAB_SOURCE = \
|
MIRRORING_TAB_SOURCE = \
|
||||||
glib-mirroring-tab/Makefile \
|
glib-mirroring-tab/Makefile \
|
||||||
glib-mirroring-tab/gen-mirroring-tab.c \
|
glib-mirroring-tab/gen-mirroring-tab.c \
|
||||||
|
@ -7,6 +7,8 @@ AM_CPPFLAGS = \
|
|||||||
-DSRCDIR=\""$(srcdir)"\" \
|
-DSRCDIR=\""$(srcdir)"\" \
|
||||||
$(GLIB_DEBUG_FLAGS)
|
$(GLIB_DEBUG_FLAGS)
|
||||||
|
|
||||||
|
AM_CFLAGS = $(GLIB_WARN_CFLAGS)
|
||||||
|
|
||||||
LDADD = $(top_builddir)/glib/libglib-2.0.la -lm
|
LDADD = $(top_builddir)/glib/libglib-2.0.la -lm
|
||||||
|
|
||||||
TEST_PROGS += \
|
TEST_PROGS += \
|
||||||
|
@ -7,6 +7,8 @@ AM_CPPFLAGS = \
|
|||||||
@GLIB_DEBUG_FLAGS@ \
|
@GLIB_DEBUG_FLAGS@ \
|
||||||
-DG_DISABLE_DEPRECATED
|
-DG_DISABLE_DEPRECATED
|
||||||
|
|
||||||
|
AM_CFLAGS = $(GLIB_WARN_CFLAGS)
|
||||||
|
|
||||||
EXTRA_DIST += \
|
EXTRA_DIST += \
|
||||||
makefile.msc.in \
|
makefile.msc.in \
|
||||||
gmoduleconf.h.in \
|
gmoduleconf.h.in \
|
||||||
|
@ -18,6 +18,8 @@ AM_CPPFLAGS = \
|
|||||||
$(GLIB_DEBUG_FLAGS) \
|
$(GLIB_DEBUG_FLAGS) \
|
||||||
-DGOBJECT_COMPILATION
|
-DGOBJECT_COMPILATION
|
||||||
|
|
||||||
|
AM_CFLAGS = $(GLIB_WARN_CFLAGS)
|
||||||
|
|
||||||
libglib = $(top_builddir)/glib/libglib-2.0.la
|
libglib = $(top_builddir)/glib/libglib-2.0.la
|
||||||
|
|
||||||
# libraries to compile and install
|
# libraries to compile and install
|
||||||
|
@ -6,6 +6,8 @@ AM_CPPFLAGS = \
|
|||||||
$(gobject_INCLUDES) \
|
$(gobject_INCLUDES) \
|
||||||
$(GLIB_DEBUG_FLAGS)
|
$(GLIB_DEBUG_FLAGS)
|
||||||
|
|
||||||
|
AM_CFLAGS = $(GLIB_WARN_CFLAGS)
|
||||||
|
|
||||||
if CROSS_COMPILING
|
if CROSS_COMPILING
|
||||||
glib_genmarshal=$(GLIB_GENMARSHAL)
|
glib_genmarshal=$(GLIB_GENMARSHAL)
|
||||||
else
|
else
|
||||||
|
@ -7,6 +7,8 @@ AM_CPPFLAGS = \
|
|||||||
@GTHREAD_COMPILE_IMPL_DEFINES@ \
|
@GTHREAD_COMPILE_IMPL_DEFINES@ \
|
||||||
@GLIB_DEBUG_FLAGS@
|
@GLIB_DEBUG_FLAGS@
|
||||||
|
|
||||||
|
AM_CFLAGS = $(GLIB_WARN_CFLAGS)
|
||||||
|
|
||||||
EXTRA_DIST += \
|
EXTRA_DIST += \
|
||||||
makefile.msc.in \
|
makefile.msc.in \
|
||||||
gthread.def \
|
gthread.def \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user