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
-DGIO_COMPILATION \
-DGIO_MODULE_DIR=\"$(GIO_MODULE_DIR)\"
+AM_CFLAGS = $(GLIB_WARN_CFLAGS)
+
lib_LTLIBRARIES = libgio-2.0.la
gdbus_headers = \
-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)
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
# -----------------------------------------------------------------------------
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
-DGLIB_COMPILATION \
-DPCRE_STATIC
+AM_CFLAGS = $(GLIB_WARN_CFLAGS)
+
MIRRORING_TAB_SOURCE = \
glib-mirroring-tab/Makefile \
glib-mirroring-tab/gen-mirroring-tab.c \
-DSRCDIR=\""$(srcdir)"\" \
$(GLIB_DEBUG_FLAGS)
+AM_CFLAGS = $(GLIB_WARN_CFLAGS)
+
LDADD = $(top_builddir)/glib/libglib-2.0.la -lm
TEST_PROGS += \
@GLIB_DEBUG_FLAGS@ \
-DG_DISABLE_DEPRECATED
+AM_CFLAGS = $(GLIB_WARN_CFLAGS)
+
EXTRA_DIST += \
makefile.msc.in \
gmoduleconf.h.in \
$(GLIB_DEBUG_FLAGS) \
-DGOBJECT_COMPILATION
+AM_CFLAGS = $(GLIB_WARN_CFLAGS)
+
libglib = $(top_builddir)/glib/libglib-2.0.la
# libraries to compile and install
$(gobject_INCLUDES) \
$(GLIB_DEBUG_FLAGS)
+AM_CFLAGS = $(GLIB_WARN_CFLAGS)
+
if CROSS_COMPILING
glib_genmarshal=$(GLIB_GENMARSHAL)
else
@GTHREAD_COMPILE_IMPL_DEFINES@ \
@GLIB_DEBUG_FLAGS@
+AM_CFLAGS = $(GLIB_WARN_CFLAGS)
+
EXTRA_DIST += \
makefile.msc.in \
gthread.def \