From a1bbc39779bee10cf8cab1e6b88f604f39dcb722 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Mon, 2 Jan 2012 10:44:53 +0100 Subject: [PATCH] configure: When doing strict checks, treat Gtk headers as system headers. This way, warnings generated by those headers will be suppressed. Some of the strict check flags generate warnings which would otherwise result in unnecessary compile errors. --- configure.ac | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/configure.ac b/configure.ac index 3ef8703..db3ca4a 100644 --- a/configure.ac +++ b/configure.ac @@ -164,6 +164,7 @@ if test "x$enable_strict_checks" = "xyes"; then -Wmissing-prototypes \ -Wpointer-arith \ -Wshadow \ + -Wstrict-prototypes \ -Wunreachable-code; do AC_MSG_CHECKING([whether $CC accepts $flag]) @@ -203,6 +204,24 @@ PKG_CHECK_MODULES([CAIRO], [cairo]) PKG_CHECK_MODULES([GTK2], [gtk+-2.0]) PKG_CHECK_MODULES([POPPLER_GLIB], [poppler-glib]) +if test "x$enable_strict_checks" = "xyes"; then + # Some Gtk headers generate warnings when doing strict checking, which + # would result in unnecessary compile errors + AC_MSG_NOTICE([Try to suppress warnings from Gtk headers...]) + for flag in `$PKG_CONFIG --cflags-only-I gtk+-2.0`; do + I_dir=${flag#-I} + + flag="-isystem $I_dir" + AC_MSG_CHECKING([whether $CC accepts $flag]) + if test_cc_flags "$flag"; then + STRICT_CFLAGS="$STRICT_CFLAGS $flag" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + done +fi + AC_CONFIG_FILES([Makefile doc/Makefile src/Makefile]) AC_OUTPUT -- 2.30.2