diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2013-03-19 16:39:49 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2013-03-20 11:34:18 +0100 |
commit | 151abb8b2b9d3a22229b98cec12e29484d12109b (patch) | |
tree | c08df7585316d77ce65cf33407ad0cba076338a4 | |
parent | 594a1ca96b465ffdb688febde9e2dbd089e7bbf0 (diff) |
use -isystem instead of -I for 3rd party headers
This should avoid gcc warnings in external code we don't care about,
so there'll be no need to fix them for WaE.
Change-Id: I629dc2672c075908294609249183f27ad2984325
-rw-r--r-- | RepositoryExternal.mk | 84 | ||||
-rw-r--r-- | config_host.mk.in | 1 | ||||
-rw-r--r-- | configure.ac | 22 |
3 files changed, 64 insertions, 43 deletions
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 2d1d75d13eee..6fad496f146a 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -99,7 +99,7 @@ else #!SYSTEM_NPAPI_HEADERS define gb_LinkTarget__use_npapi_headers $(call gb_LinkTarget_use_package,$(1),npapi) $(call gb_LinkTarget_set_include,$(1),\ - -I$(OUTDIR)/inc/external/npsdk \ + $(ISYSTEM)$(OUTDIR)/inc/external/npsdk \ $$(INCLUDE) \ ) @@ -134,7 +134,7 @@ else define gb_LinkTarget__use_vigra_headers $(call gb_LinkTarget_use_unpacked,$(1),vigra) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,vigra/include) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,vigra/include) \ $$(INCLUDE) \ ) @@ -151,7 +151,7 @@ else define gb_LinkTarget__use_mdds_headers $(call gb_LinkTarget_use_unpacked,$(1),mdds) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,mdds/include) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,mdds/include) \ $$(INCLUDE) \ ) @@ -203,7 +203,7 @@ $(call gb_LinkTarget_use_libraries,$(1),\ cppunit \ ) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,cppunit/include)\ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,cppunit/include)\ $$(INCLUDE) \ ) @@ -274,8 +274,8 @@ $(call gb_LinkTarget_add_defs,$(1),\ ) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,mysqlcppconn) \ - -I$(call gb_UnpackedTarball_get_dir,mysqlcppconn)/cppconn \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,mysqlcppconn) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,mysqlcppconn)/cppconn \ $$(INCLUDE) \ ) @@ -315,7 +315,7 @@ $(call gb_LinkTarget_use_packages,$(1),\ ) $(call gb_LinkTarget_set_include,$(1),\ - -I$(OUTDIR)/inc/external/zlib \ + $(ISYSTEM)$(OUTDIR)/inc/external/zlib \ $$(INCLUDE) \ ) @@ -363,7 +363,7 @@ $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \ define gb_LinkTarget__use_jpeg $(call gb_LinkTarget_set_include,$(1),\ $$(INCLUDE) \ - -I$(OUTDIR)/inc/external/jpeg \ + $(ISYSTEM)$(OUTDIR)/inc/external/jpeg \ ) $(call gb_LinkTarget_use_static_libraries,$(1),\ @@ -430,7 +430,7 @@ define gb_LinkTarget__use_expat $(if $(2),,$(error gb_LinkTarget__use_expat needs additional parameter)) $(call gb_LinkTarget_set_include,$(1),\ - -I$(OUTDIR)/inc/external/expat \ + $(ISYSTEM)$(OUTDIR)/inc/external/expat \ $$(INCLUDE) \ ) @@ -481,7 +481,7 @@ $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \ define gb_LinkTarget__use_hyphen $(call gb_LinkTarget_use_unpacked,$(1),hyphen) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,hyphen)\ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,hyphen)\ $$(INCLUDE) \ ) $(call gb_LinkTarget_use_static_libraries,$(1),\ @@ -515,7 +515,7 @@ $(call gb_LinkTarget_add_defs,$(1),\ ) $(call gb_LinkTarget_use_unpacked,$(1),hunspell) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,hunspell/src/hunspell)\ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,hunspell/src/hunspell)\ $$(INCLUDE) \ ) $(call gb_LinkTarget_use_static_libraries,$(1),\ @@ -592,7 +592,7 @@ endef define gb_LinkTarget__use_boost_headers $(call gb_LinkTarget_use_unpacked,$(1),boost) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,boost) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,boost) \ $$(INCLUDE) \ ) @@ -673,7 +673,7 @@ $(call gb_LinkTarget_use_static_libraries,$(1),\ ) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,exttextcat/src) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,exttextcat/src) \ $$(INCLUDE) \ ) @@ -710,7 +710,7 @@ $(call gb_LinkTarget_use_libraries,$(1),\ ) $(call gb_LinkTarget_set_include,$(1),\ $$(INCLUDE) \ - -I$(call gb_UnpackedTarball_get_dir,xml2)/include \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,xml2)/include \ ) endef @@ -754,7 +754,7 @@ define gb_LinkTarget__use_libxslt $(call gb_LinkTarget_use_package,$(1),xslt) $(call gb_LinkTarget_set_include,$(1),\ $$(INCLUDE) \ - -I$(call gb_UnpackedTarball_get_dir,xslt) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,xslt) \ ) $(call gb_LinkTarget_use_libraries,$(1),\ xslt \ @@ -766,7 +766,7 @@ define gb_LinkTarget__use_libexslt $(call gb_LinkTarget_use_package,$(1),xslt) $(call gb_LinkTarget_set_include,$(1),\ $$(INCLUDE) \ - -I$(call gb_UnpackedTarball_get_dir,xslt) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,xslt) \ ) $(call gb_LinkTarget_use_libraries,$(1),\ @@ -804,7 +804,7 @@ $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \ define gb_LinkTarget__use_liblangtag $(call gb_LinkTarget_use_unpacked,$(1),langtag) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,langtag) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,langtag) \ $$(INCLUDE) \ ) $(call gb_LinkTarget_use_static_libraries,$(1),\ @@ -842,7 +842,7 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,\ define gb_LinkTarget__use_neon $(call gb_LinkTarget_use_unpacked,$(1),neon) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,neon/src) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,neon/src) \ $$(INCLUDE) \ ) $(call gb_LinkTarget_use_libraries,$(1),\ @@ -878,7 +878,7 @@ else # !SYSTEM_REDLAND define gb_LinkTarget__use_redland_headers $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,redland)/librdf \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,redland)/librdf \ $$(INCLUDE) \ ) @@ -886,7 +886,7 @@ endef define gb_LinkTarget__use_raptor_headers $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,raptor)/src \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,raptor)/src \ $$(INCLUDE) \ ) @@ -894,7 +894,7 @@ endef define gb_LinkTarget__use_rasqal_headers $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,rasqal)/src \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,rasqal)/src \ $$(INCLUDE) \ ) @@ -968,8 +968,8 @@ define gb_LinkTarget__use_cairo $(call gb_LinkTarget_use_package,$(1),cairo) $(call gb_LinkTarget_use_package,$(1),pixman) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,cairo) \ - -I$(call gb_UnpackedTarball_get_dir,cairo)/src \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,cairo) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,cairo)/src \ $(FREETYPE_CFLAGS) \ $$(INCLUDE) \ ) @@ -1031,7 +1031,7 @@ $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \ define gb_LinkTarget__use_graphite $(call gb_LinkTarget_use_unpacked,$(1),graphite) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,graphite/include) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,graphite/include) \ $$(INCLUDE) \ ) $(call gb_LinkTarget_use_static_libraries,$(1),\ @@ -1083,7 +1083,7 @@ endif define gb_LinkTarget__use_icu_headers $(call gb_LinkTarget_use_package,$(1),icu) $(call gb_LinkTarget_set_include,$(1),\ - -I$(OUTDIR)/inc/external \ + $(ISYSTEM)$(OUTDIR)/inc/external \ $$(INCLUDE) \ ) @@ -1203,7 +1203,7 @@ endef define gb_LinkTarget__use_openssl_headers $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,openssl)/include \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,openssl)/include \ $$(INCLUDE) \ ) @@ -1487,7 +1487,7 @@ $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS, \ define gb_LinkTarget__use_lcms2 $(call gb_LinkTarget_use_package,$(1),lcms2) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,lcms2/include) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,lcms2/include) \ $$(INCLUDE) \ ) $(call gb_LinkTarget_use_static_libraries,$(1),\ @@ -1505,7 +1505,7 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \ define gb_LinkTarget__use_lcms2 $(call gb_LinkTarget_use_package,$(1),lcms2) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,lcms2/include) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,lcms2/include) \ $$(INCLUDE) \ ) $(call gb_LinkTarget_use_libraries,$(1),\ @@ -1540,7 +1540,7 @@ $(call gb_LinkTarget_use_libraries,$(1),\ lpsolve55 \ ) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,lpsolve) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,lpsolve) \ $$(INCLUDE) \ ) @@ -1751,7 +1751,7 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \ define gb_LinkTarget__use_curl $(call gb_LinkTarget_use_package,$(1),curl) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,curl/include) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,curl/include) \ $$(INCLUDE) \ ) $(call gb_LinkTarget_use_libraries,$(1),\ @@ -1814,9 +1814,9 @@ define gb_LinkTarget__use_poppler $(call gb_LinkTarget_use_package,$(1),xpdf) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,xpdf) \ - -I$(call gb_UnpackedTarball_get_dir,xpdf)/xpdf \ - -I$(call gb_UnpackedTarball_get_dir,xpdf)/goo \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,xpdf) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,xpdf)/xpdf \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,xpdf)/goo \ $$(INCLUDE) \ ) @@ -1927,7 +1927,7 @@ $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS,\ define gb_LinkTarget__use_openldap $(call gb_LinkTarget_use_unpacked,$(1),openldap) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,openldap/include) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,openldap/include) \ $$(INCLUDE) \ ) $(call gb_LinkTarget_use_package,$(1),openldap) @@ -1969,7 +1969,7 @@ $(call gb_LinkTarget_use_packages,$(1),\ ) $(call gb_LinkTarget_set_include,$(1),\ - -I$(OUTDIR)/inc/postgresql \ + $(ISYSTEM)$(OUTDIR)/inc/postgresql \ $$(INCLUDE) \ ) @@ -2004,7 +2004,7 @@ $(call gb_LinkTarget_add_defs,$(1),\ $(call gb_LinkTarget_set_include,$(1),\ $$(INCLUDE) \ - -I$(OUTDIR)/inc/mozilla \ + $(ISYSTEM)$(OUTDIR)/inc/mozilla \ ) $(call gb_LinkTarget_use_libraries,$(1),\ @@ -2220,9 +2220,9 @@ define gb_LinkTarget__use_python_headers $(call gb_LinkTarget_use_package,$(1),python3) $(call gb_LinkTarget_use_external_project,$(1),python3) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,python3) \ - -I$(call gb_UnpackedTarball_get_dir,python3)/PC \ - -I$(call gb_UnpackedTarball_get_dir,python3)/Include \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,python3) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,python3)/PC \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,python3)/Include \ $$(INCLUDE) \ ) @@ -2276,7 +2276,7 @@ $(eval $(call gb_Helper_register_static_libraries,PLAINLIBS,\ define gb_LinkTarget__use_orcus $(call gb_LinkTarget_use_unpacked,$(1),orcus) $(call gb_LinkTarget_set_include,$(1),\ - -I$(call gb_UnpackedTarball_get_dir,orcus/include) \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,orcus/include) \ $$(INCLUDE) \ ) $(call gb_LinkTarget_use_static_libraries,$(1),orcus) @@ -2403,8 +2403,8 @@ define gb_LinkTarget__use_nss3 $(call gb_LinkTarget_use_package,$(1),nss) $(call gb_LinkTarget_set_include,$(1),\ $$(INCLUDE) \ - -I$(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/public/nss \ - -I$(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/out/include \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/public/nss \ + $(ISYSTEM)$(call gb_UnpackedTarball_get_dir,nss)/mozilla/dist/out/include \ ) $(call gb_LinkTarget_use_libraries,$(1),\ diff --git a/config_host.mk.in b/config_host.mk.in index 496097cf8bd5..5e68b4129ee9 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -252,6 +252,7 @@ export INPATH_FOR_BUILD=@INPATH_FOR_BUILD@ export INSTALLDIR=@INSTALLDIR@ export INSTALLDIRNAME=@INSTALLDIRNAME@ export INTRO_BITMAP=@INTRO_BITMAP@ +export ISYSTEM=@ISYSTEM@ export JAVACISGCJ=@JAVACISGCJ@ export JAVACISKAFFE=@JAVACISKAFFE@ export JAVACOMPILER=@JAVACOMPILER@ diff --git a/configure.ac b/configure.ac index 9627162ee985..8a7952bc063a 100644 --- a/configure.ac +++ b/configure.ac @@ -2830,6 +2830,26 @@ printf ("hello world\n"); fi AC_SUBST(HAVE_LD_BSYMBOLIC_FUNCTIONS) +# Use -isystem (gcc) if possible, to avoid warnigs in 3rd party headers. +ISYSTEM= +if test "$GCC" = "yes"; then + AC_MSG_CHECKING( for -isystem ) + save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Werror -finline-limit=0" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ ISYSTEM=-isystem ],[]) + CFLAGS=$save_CFLAGS + if test -n "$ISYSTEM"; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi +fi +if test -z "$ISYSTEM"; then + # fall back to using -I + ISYSTEM=-I +fi +AC_SUBST(ISYSTEM) + dnl =================================================================== dnl Check which Visual Studio or MinGW compiler is used dnl =================================================================== @@ -3901,7 +3921,7 @@ else WORKDIR=${BUILDDIR}/workdir/${INPATH} fi OUTDIR="${SOLARVER}/${INPATH}" -SOLARINC="-I. -I${SOLARVER}/$INPATH/inc/external -I${SOLARVER}/$INPATH/inc -I$SRC_ROOT/solenv/inc $SOLARINC" +SOLARINC="-I. ${ISYSTEM}${SOLARVER}/$INPATH/inc/external -I${SOLARVER}/$INPATH/inc -I$SRC_ROOT/solenv/inc $SOLARINC" AC_SUBST(COM) AC_SUBST(CPU) AC_SUBST(CPUNAME) |