[gjs/wip/ptomato/warnings: 3/3] build: Switch to AX_COMPILER_FLAGS



commit aa8bf6b945fd25945e518fa12980ae0efc510e5e
Author: Philip Chimento <philip chimento gmail com>
Date:   Wed Oct 5 20:09:19 2016 -0700

    build: Switch to AX_COMPILER_FLAGS
    
    This gets rid of the last depdenency on gnome-common, switching from
    GNOME_COMPILE_WARNINGS to AX_COMPILER_FLAGS.
    
    We do have to disable one warning which is caused by SpiderMonkey headers
    and can't be disabled using pragmas, due to this bug:
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
    
    See: https://wiki.gnome.org/Projects/GnomeCommon/Migration

 Makefile-insttest.am |   18 +++++++++++++++---
 Makefile.am          |    9 +++++++--
 configure.ac         |    5 ++++-
 3 files changed, 26 insertions(+), 6 deletions(-)
---
diff --git a/Makefile-insttest.am b/Makefile-insttest.am
index f4b94ac..4bc1165 100644
--- a/Makefile-insttest.am
+++ b/Makefile-insttest.am
@@ -97,7 +97,11 @@ libgimarshallingtests_la_LIBADD = $(common_test_libadd)
 Regress-1.0.gir: libregress.la
 Regress_1_0_gir_LIBS = libregress.la
 Regress_1_0_gir_FILES = $(nodist_libregress_la_SOURCES)
-Regress_1_0_gir_SCANNERFLAGS = --warn-all --warn-error $(libregress_scannerflags_includes)
+Regress_1_0_gir_SCANNERFLAGS =                 \
+       --warn-all --warn-error                 \
+       $(libregress_scannerflags_includes)     \
+       $(WARN_SCANNERFLAGS)                    \
+       $(NULL)
 if !ENABLE_CAIRO
 Regress_1_0_gir_CFLAGS = -D_GI_DISABLE_CAIRO
 endif
@@ -107,14 +111,22 @@ WarnLib-1.0.gir: libwarnlib.la
 WarnLib_1_0_gir_LIBS = libwarnlib.la
 WarnLib_1_0_gir_INCLUDES = Gio-2.0
 WarnLib_1_0_gir_FILES = $(nodist_libwarnlib_la_SOURCES)
-WarnLib_1_0_gir_SCANNERFLAGS = --c-include="warnlib.h" --symbol-prefix=warnlib_
+WarnLib_1_0_gir_SCANNERFLAGS =         \
+       --c-include="warnlib.h"         \
+       --symbol-prefix=warnlib_        \
+       $(WARN_SCANNERFLAGS)            \
+       $(NULL)
 TEST_INTROSPECTION_GIRS += WarnLib-1.0.gir
 
 GIMarshallingTests-1.0.gir: libgimarshallingtests.la
 GIMarshallingTests_1_0_gir_LIBS = libgimarshallingtests.la
 GIMarshallingTests_1_0_gir_INCLUDES = Gio-2.0
 GIMarshallingTests_1_0_gir_FILES = $(nodist_libgimarshallingtests_la_SOURCES)
-GIMarshallingTests_1_0_gir_SCANNERFLAGS = --symbol-prefix=gi_marshalling_tests --warn-all --warn-error
+GIMarshallingTests_1_0_gir_SCANNERFLAGS =      \
+       --symbol-prefix=gi_marshalling_tests    \
+       --warn-all --warn-error                 \
+       $(WARN_SCANNERFLAGS)                    \
+       $(NULL)
 TEST_INTROSPECTION_GIRS += GIMarshallingTests-1.0.gir
 
 $(foreach gir,$(TEST_INTROSPECTION_GIRS),$(eval $(call introspection-scanner,$(gir))))
diff --git a/Makefile.am b/Makefile.am
index 68e7e34..480e53c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,7 +18,7 @@ INTROSPECTION_GIRS =
 ACLOCAL_AMFLAGS = -I m4
 AM_CXXFLAGS = $(WARN_CXXFLAGS) $(CODE_COVERAGE_CFLAGS)
 AM_CPPFLAGS = -DG_LOG_DOMAIN=\"Gjs\" $(CODE_COVERAGE_CPPFLAGS)
-AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS)
+AM_LDFLAGS = $(WARN_LDFLAGS) $(CODE_COVERAGE_LDFLAGS)
 MAINTAINERCLEANFILES =                                 \
        $(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL)      \
        $(GITIGNORE_MAINTAINERCLEANFILES_MAKEFILE_IN)   \
@@ -181,7 +181,12 @@ GjsPrivate-1.0.gir: libgjs.la
 GjsPrivate_1_0_gir_LIBS = libgjs.la
 GjsPrivate_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
 GjsPrivate_1_0_gir_FILES = $(libgjs_private_source_files)
-GjsPrivate_1_0_gir_SCANNERFLAGS = --identifier-prefix=Gjs --symbol-prefix=gjs_ --warn-all
+GjsPrivate_1_0_gir_SCANNERFLAGS =      \
+       --identifier-prefix=Gjs         \
+       --symbol-prefix=gjs_            \
+       --warn-all                      \
+       $(WARN_SCANNERFLAGS)            \
+       $(NULL)
 
 if ENABLE_GTK
 GjsPrivate_1_0_gir_INCLUDES += Gtk-3.0
diff --git a/configure.ac b/configure.ac
index f9836aa..9bf05b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,7 +40,10 @@ AC_PROG_MKDIR_P
 AC_PROG_LN_S
 AC_PROG_SED
 
-GNOME_CXX_WARNINGS([maximum])
+dnl -Wno-undef: grr, this is in a mozilla header, and you can't filter it out
+dnl using pragmas: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
+dnl use pragma system header instead?
+AX_COMPILER_FLAGS(,,,,[-Wno-undef])
 
 AX_CODE_COVERAGE
 dnl Clang does not need to link with -lgcov


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