autotools: Fix extra-compiler-warnings for system headers

Use -isystem instead of -I for external headers with GCC/clang to squash
all the noise.

cmake already uses -isystem by default for supported platforms/compilers.

Change-Id: Ia6c9d1eb9b894fda6f48c531094d792e16fd39fc
Reviewed-on: https://code.wireshark.org/review/11947
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
This commit is contained in:
João Valverde 2015-11-18 16:31:31 +00:00 committed by Alexis La Goutte
parent f711fbfae4
commit 67d9daa65b
8 changed files with 31 additions and 20 deletions

View File

@ -1903,6 +1903,28 @@ if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
fi
])
#
# AC_WIRESHARK_GCC_SYSTEM_INCLUDE
#
# Replace -I include flag for -isystem in FLAGS argument
#
AC_DEFUN([AC_WIRESHARK_GCC_SYSTEM_INCLUDE],
[
if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
$1=`AS_ECHO_N([" $$1"]) \
| sed -e 's/ *-I *\// -isystem\//g' -e 's/^ *//'`
fi
])
#
# PKG_WIRESHARK_CHECK_SYSTEM_MODULES
#
AC_DEFUN([PKG_WIRESHARK_CHECK_SYSTEM_MODULES],
[
PKG_CHECK_MODULES($@)
AC_WIRESHARK_GCC_SYSTEM_INCLUDE($1_CFLAGS)
])
#
# AC_WIRESHARK_OSX_INTEGRATION_CHECK
#
@ -2027,7 +2049,9 @@ AC_DEFUN([AC_WIRESHARK_QT_MODULE_CHECK_WITH_QT_VERSION],
if $PKG_CONFIG --atleast-version $min_qt_version $pkg_config_module; then
mod_version=`$PKG_CONFIG --modversion $pkg_config_module`
AC_MSG_RESULT(yes (version $mod_version))
Qt_CFLAGS="$Qt_CFLAGS `$PKG_CONFIG --cflags $pkg_config_module`"
mod_cflags=`$PKG_CONFIG --cflags $pkg_config_module`
AC_WIRESHARK_GCC_SYSTEM_INCLUDE(mod_cflags)
Qt_CFLAGS="$Qt_CFLAGS $mod_cflags"
Qt_LIBS="$Qt_LIBS `$PKG_CONFIG --libs $pkg_config_module`"
# Run Action-If-Found
ifelse([$4], , :, [$4])

View File

@ -67,6 +67,7 @@ AC_ARG_ENABLE(glibtest, [ --disable-glibtest do not try to compile and run
GLIB_COMPILE_RESOURCES=`$PKG_CONFIG --variable=glib_compile_resources gio-2.0`
GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
AC_WIRESHARK_GCC_SYSTEM_INCLUDE(GLIB_CFLAGS)
GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`

View File

@ -54,6 +54,7 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run
if test x"$no_gtk" = x ; then
GTK_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_module`
AC_WIRESHARK_GCC_SYSTEM_INCLUDE(GTK_CFLAGS)
GTK_LIBS=`$PKG_CONFIG --libs $pkg_config_module`
gtk_config_major_version=`$PKG_CONFIG --modversion $pkg_config_module | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`

View File

@ -57,6 +57,7 @@ AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run
if test x"$no_gtk" = x ; then
GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
AC_WIRESHARK_GCC_SYSTEM_INCLUDE(GTK_CFLAGS)
GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`

View File

@ -680,13 +680,13 @@ linux*)
# was requested by the user.
#
if test x$libnl_version = "xany" -o x$libnl_version = "x3"; then
PKG_CHECK_MODULES(LIBNL3, [libnl-route-3.0 >= 3.0 libnl-genl-3.0] >= 3.0, [have_libnl3=yes], [have_libnl3=no])
PKG_WIRESHARK_CHECK_SYSTEM_MODULES(LIBNL3, [libnl-route-3.0 >= 3.0 libnl-genl-3.0] >= 3.0, [have_libnl3=yes], [have_libnl3=no])
fi
if test x$libnl_version = "xany" -o x$libnl_version = "x2"; then
PKG_CHECK_MODULES(LIBNL2, libnl-2.0 >= 2.0, [have_libnl2=yes], [have_libnl2=no])
PKG_WIRESHARK_CHECK_SYSTEM_MODULES(LIBNL2, libnl-2.0 >= 2.0, [have_libnl2=yes], [have_libnl2=no])
fi
if test x$libnl_version = "xany" -o x$libnl_version = "x1"; then
PKG_CHECK_MODULES(LIBNL1, libnl-1 >= 1.0, [have_libnl1=yes], [have_libnl1=no])
PKG_WIRESHARK_CHECK_SYSTEM_MODULES(LIBNL1, libnl-1 >= 1.0, [have_libnl1=yes], [have_libnl1=no])
fi
if (test "${have_libnl3}" = "yes"); then
CFLAGS="$CFLAGS $LIBNL3_CFLAGS"

View File

@ -131,7 +131,6 @@ EXTRA_DIST = \
dftestlib/util.py \
extract_asn1_from_spec.pl \
fix-encoding-args.pl \
fix_pragma_wdocumentation.sh \
fixhf.pl \
ftsanity.py \
fuzz-test.sh \

View File

@ -206,9 +206,6 @@ PATH_SPECIFIC_WHITELISTED_LICENSES = {
'tools/lemon': [
'UNKNOWN',
],
'tools/fix_pragma_wdocumentation.sh': [
'UNKNOWN',
],
# Generated files for GTK pixbuf binary bundling
'ui/gtk/wireshark-gresources.h': [
'UNKNOWN',

View File

@ -1,12 +0,0 @@
#!/bin/sh
# Copyright 2014, Alexis La Goutte (See AUTHORS file)
#
# For clang user: launch the script to add pragma for remove warning about -Wdocumentation
# (using on Petri Dish)
find . ! -name "*.sh" -type f -exec sed -i 's/#include <glib.h>/#pragma clang diagnostic push\n#pragma clang diagnostic ignored "-Wdocumentation"\n#include <glib.h>\n#pragma clang diagnostic pop/g' {} \;
find . ! -name "*.sh" -type f -exec sed -i 's/#include <gtk\/gtk.h>/#pragma clang diagnostic push\n#pragma clang diagnostic ignored "-Wdocumentation"\n#include <gtk\/gtk.h>\n#pragma clang diagnostic pop/g' {} \;
find . ! -name "*.sh" -type f -exec sed -i 's/#include <gmodule.h>/#pragma clang diagnostic push\n#pragma clang diagnostic ignored "-Wdocumentation"\n#include <gmodule.h>\n#pragma clang diagnostic pop/g' {} \;