summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-04-11 14:24:54 +0200
committerLuboš Luňák <l.lunak@collabora.com>2022-04-12 13:57:32 +0200
commitea68de2968c0dbcd8e7549435e829db06795c16d (patch)
tree536e47cf39c4f973b246a0705ec84462369a27da /external
parent967717e65fffce20ff6069c2177720c067e174d1 (diff)
use gb_DEBUGINFO_FLAGS consistently in gbuild ExternalProject's
A number of them didn't use it at all, others had it hand-written in various ways. Change-Id: Iaf86325f9cdc032926bac917dc3eef4e34661544 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132818 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'external')
-rw-r--r--external/cairo/ExternalProject_cairo.mk3
-rw-r--r--external/firebird/ExternalProject_firebird.mk9
-rw-r--r--external/fontconfig/ExternalProject_fontconfig.mk6
-rw-r--r--external/freetype/ExternalProject_freetype.mk5
-rw-r--r--external/gpgmepp/ExternalProject_gpgmepp.mk14
-rw-r--r--external/harfbuzz/ExternalProject_harfbuzz.mk4
-rw-r--r--external/hunspell/ExternalProject_hunspell.mk3
-rw-r--r--external/hyphen/ExternalProject_hyphen.mk1
-rw-r--r--external/icu/ExternalProject_icu.mk6
-rw-r--r--external/lcms2/ExternalProject_lcms2.mk2
-rw-r--r--external/libabw/ExternalProject_libabw.mk2
-rw-r--r--external/libassuan/ExternalProject_libassuan.mk4
-rw-r--r--external/libatomic_ops/ExternalProject_libatomic_ops.mk2
-rw-r--r--external/libcdr/ExternalProject_libcdr.mk2
-rw-r--r--external/libebook/ExternalProject_libebook.mk2
-rw-r--r--external/libepubgen/ExternalProject_libepubgen.mk2
-rw-r--r--external/libetonyek/ExternalProject_libetonyek.mk2
-rw-r--r--external/libexttextcat/ExternalProject_libexttextcat.mk2
-rw-r--r--external/libfreehand/ExternalProject_libfreehand.mk2
-rw-r--r--external/libgpg-error/ExternalProject_libgpg-error.mk1
-rw-r--r--external/liblangtag/ExternalProject_liblangtag.mk4
-rw-r--r--external/libmspub/ExternalProject_libmspub.mk2
-rw-r--r--external/libmwaw/ExternalProject_libmwaw.mk2
-rw-r--r--external/libnumbertext/ExternalProject_libnumbertext.mk4
-rw-r--r--external/libodfgen/ExternalProject_libodfgen.mk2
-rw-r--r--external/libpagemaker/ExternalProject_libpagemaker.mk2
-rw-r--r--external/libqxp/ExternalProject_libqxp.mk2
-rw-r--r--external/librevenge/ExternalProject_librevenge.mk2
-rw-r--r--external/libstaroffice/ExternalProject_libstaroffice.mk2
-rw-r--r--external/libvisio/ExternalProject_libvisio.mk2
-rw-r--r--external/libwebp/ExternalProject_libwebp.mk2
-rw-r--r--external/libwpd/ExternalProject_libwpd.mk2
-rw-r--r--external/libwpg/ExternalProject_libwpg.mk2
-rw-r--r--external/libwps/ExternalProject_libwps.mk2
-rw-r--r--external/libxml2/ExternalProject_libxml2.mk4
-rw-r--r--external/libzmf/ExternalProject_libzmf.mk2
-rw-r--r--external/lpsolve/ExternalProject_lpsolve.mk2
-rw-r--r--external/mythes/ExternalProject_mythes.mk1
-rw-r--r--external/openldap/ExternalProject_openldap.mk4
-rw-r--r--external/redland/ExternalProject_raptor.mk4
-rw-r--r--external/redland/ExternalProject_rasqal.mk2
-rw-r--r--external/redland/ExternalProject_redland.mk2
-rw-r--r--external/xmlsec/ExternalProject_xmlsec.mk2
43 files changed, 70 insertions, 59 deletions
diff --git a/external/cairo/ExternalProject_cairo.mk b/external/cairo/ExternalProject_cairo.mk
index 0996572d63ba..7ad9b0c4ca0c 100644
--- a/external/cairo/ExternalProject_cairo.mk
+++ b/external/cairo/ExternalProject_cairo.mk
@@ -49,7 +49,8 @@ $(call gb_ExternalProject_get_state_target,cairo,build) :
$(if $(debug),STRIP=" ") \
$(if $(filter ANDROID iOS,$(OS)),CFLAGS="$(if $(debug),-g) $(ZLIB_CFLAGS) $(gb_VISIBILITY_FLAGS)") \
$(if $(filter EMSCRIPTEN,$(OS)),CFLAGS=" $(ZLIB_CFLAGS) -Wno-enum-conversion $(gb_EMSCRIPTEN_CPPFLAGS)" --enable-pthread=yes PTHREAD_LIBS="") \
- $(if $(filter-out EMSCRIPTEN ANDROID iOS,$(OS)),CFLAGS="$(CFLAGS) $(if $(debug),-g) $(ZLIB_CFLAGS)" ) \
+ $(if $(filter-out EMSCRIPTEN ANDROID iOS,$(OS)), \
+ CFLAGS="$(CFLAGS) $(call gb_ExternalProject_get_build_flags,cairo) $(ZLIB_CFLAGS)" ) \
$(if $(filter ANDROID iOS,$(OS)),PKG_CONFIG=./dummy_pkg_config) \
LIBS="$(ZLIB_LIBS)" \
$(if $(filter -fsanitize=%,$(LDFLAGS)),LDFLAGS="$(LDFLAGS) -fuse-ld=bfd") \
diff --git a/external/firebird/ExternalProject_firebird.mk b/external/firebird/ExternalProject_firebird.mk
index 9c28d5641ef0..76427f34a455 100644
--- a/external/firebird/ExternalProject_firebird.mk
+++ b/external/firebird/ExternalProject_firebird.mk
@@ -44,6 +44,13 @@ $(call gb_ExternalProject_get_state_target,firebird,build):
) \
$(if $(filter GCC-INTEL,$(COM)-$(CPUNAME)),-Di386=1) \
" \
+ && export CFLAGS=" \
+ $(if $(filter MSC,$(COM)),$(if $(MSVC_USE_DEBUG_RUNTIME),-DMSVC_USE_DEBUG_RUNTIME)) \
+ $(if $(filter MSC-TRUE-X86_64,$(COM)-$(COM_IS_CLANG)-$(CPUNAME)),-march=x86-64-v2) \
+ $(if $(HAVE_GCC_FNO_SIZED_DEALLOCATION),-fno-sized-deallocation -fno-delete-null-pointer-checks) \
+ $(call gb_ExternalProject_get_build_flags,firebird) \
+ $(if $(ENABLE_DEBUG),$(if $(filter MSC,$(COM)),-Od -Z7)) \
+ " \
&& export CXXFLAGS=" \
$(BOOST_CXXFLAGS) \
$(if $(filter MSC,$(COM)),$(if $(MSVC_USE_DEBUG_RUNTIME),-DMSVC_USE_DEBUG_RUNTIME)) \
@@ -51,7 +58,7 @@ $(call gb_ExternalProject_get_state_target,firebird,build):
$(if $(HAVE_GCC_FNO_SIZED_DEALLOCATION),-fno-sized-deallocation -fno-delete-null-pointer-checks) \
$(CXXFLAGS_CXX11) \
$(if $(filter TRUE,$(COM_IS_CLANG)), -Wno-c++11-narrowing) \
- $(if $(call gb_Module__symbols_enabled,firebird),$(gb_DEBUGINFO_FLAGS)) \
+ $(call gb_ExternalProject_get_build_flags,firebird) \
$(if $(ENABLE_DEBUG),$(if $(filter MSC,$(COM)),-Od -Z7)) \
" \
&& export LDFLAGS=" \
diff --git a/external/fontconfig/ExternalProject_fontconfig.mk b/external/fontconfig/ExternalProject_fontconfig.mk
index 1daf130d2c2f..3d0369d73ede 100644
--- a/external/fontconfig/ExternalProject_fontconfig.mk
+++ b/external/fontconfig/ExternalProject_fontconfig.mk
@@ -21,7 +21,11 @@ $(eval $(call gb_ExternalProject_register_targets,fontconfig,\
$(call gb_ExternalProject_get_state_target,fontconfig,build) :
$(call gb_Trace_StartRange,fontconfig,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- CFLAGS="$(CFLAGS) $(if $(debug),-g) $(gb_VISIBILITY_FLAGS) $(if $(filter EMSCRIPTEN,$(OS)),-pthread)" $(if $(filter ANDROID,$(OS)),LIBS="-lm") \
+ CFLAGS="$(CFLAGS) \
+ $(call gb_ExternalProject_get_build_flags,fontconfig) \
+ $(gb_VISIBILITY_FLAGS) \
+ $(if $(filter EMSCRIPTEN,$(OS)),-pthread)" \
+ $(if $(filter ANDROID,$(OS)),LIBS="-lm") \
$(gb_RUN_CONFIGURE) ./configure \
--disable-shared \
--disable-silent-rules \
diff --git a/external/freetype/ExternalProject_freetype.mk b/external/freetype/ExternalProject_freetype.mk
index 7f3faca416ca..0e28ab031f6a 100644
--- a/external/freetype/ExternalProject_freetype.mk
+++ b/external/freetype/ExternalProject_freetype.mk
@@ -26,7 +26,10 @@ $(call gb_ExternalProject_get_state_target,freetype,build) :
--without-png \
--prefix=$(call gb_UnpackedTarball_get_dir,freetype/instdir) \
$(gb_CONFIGURE_PLATFORMS) \
- CFLAGS="$(CFLAGS) $(if $(debug),-g) $(gb_VISIBILITY_FLAGS) $(gb_EMSCRIPTEN_CPPFLAGS)" \
+ CFLAGS="$(CFLAGS) \
+ $(call gb_ExternalProject_get_build_flags,freetype) \
+ $(gb_VISIBILITY_FLAGS) \
+ $(gb_EMSCRIPTEN_CPPFLAGS)" \
&& $(MAKE) install \
&& touch $@ )
$(call gb_Trace_EndRange,freetype,EXTERNAL)
diff --git a/external/gpgmepp/ExternalProject_gpgmepp.mk b/external/gpgmepp/ExternalProject_gpgmepp.mk
index b1232bbc7d29..a58717fe3adb 100644
--- a/external/gpgmepp/ExternalProject_gpgmepp.mk
+++ b/external/gpgmepp/ExternalProject_gpgmepp.mk
@@ -36,9 +36,7 @@ $(call gb_ExternalProject_get_state_target,gpgmepp,build): $(call gb_Executable_
--disable-g13-test \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
CFLAGS='$(CFLAGS) \
- $(if $(ENABLE_OPTIMIZED), \
- $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
- $(if $(call gb_Module__symbols_enabled,gpgmepp),$(gb_DEBUGINFO_FLAGS))' \
+ $(call gb_ExternalProject_get_build_flags,gpgmepp)' \
$(gb_WIN_GPG_platform_switches) \
MAKE=$(MAKE) \
&& $(MAKE) \
@@ -60,14 +58,10 @@ $(call gb_ExternalProject_get_state_target,gpgmepp,build):
LIBASSUAN_CFLAGS="$(LIBASSUAN_CFLAGS)" \
LIBASSUAN_LIBS="$(LIBASSUAN_LIBS)" \
CFLAGS='$(CFLAGS) \
- $(if $(ENABLE_OPTIMIZED), \
- $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
- $(if $(call gb_Module__symbols_enabled,gpgmepp),$(gb_DEBUGINFO_FLAGS))' \
+ $(call gb_ExternalProject_get_build_flags,gpgmepp)' \
CXXFLAGS='$(CXXFLAGS) \
- $(if $(ENABLE_OPTIMIZED), \
- $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
- $(gb_COMPILERDEFS_STDLIB_DEBUG) \
- $(if $(call gb_Module__symbols_enabled,gpgmepp),$(gb_DEBUGINFO_FLAGS))' \
+ $(call gb_ExternalProject_get_build_flags,gpgmepp) \
+ $(gb_COMPILERDEFS_STDLIB_DEBUG)' \
$(if $(filter LINUX,$(OS)), \
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \
diff --git a/external/harfbuzz/ExternalProject_harfbuzz.mk b/external/harfbuzz/ExternalProject_harfbuzz.mk
index 2cf32ed04e53..43d2e2e18ab4 100644
--- a/external/harfbuzz/ExternalProject_harfbuzz.mk
+++ b/external/harfbuzz/ExternalProject_harfbuzz.mk
@@ -44,9 +44,7 @@ $(call gb_ExternalProject_get_state_target,harfbuzz,build) :
$(gb_CONFIGURE_PLATFORMS) \
CXXFLAGS=' \
$(if $(filter ANDROID,$(OS)),-DHB_NO_MMAP=1,) \
- $(if $(call gb_Module__symbols_enabled,harfbuzz),$(gb_DEBUGINFO_FLAGS)) \
- $(if $(ENABLE_OPTIMIZED), \
- $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
+ $(call gb_ExternalProject_get_build_flags,harfbuzz) \
$(if $(ENABLE_RUNTIME_OPTIMIZATIONS),,-frtti) \
$(CXXFLAGS) $(CXXFLAGS_CXX11) \
$(ICU_UCHAR_TYPE) \
diff --git a/external/hunspell/ExternalProject_hunspell.mk b/external/hunspell/ExternalProject_hunspell.mk
index aaa3b4805031..a125c819c96e 100644
--- a/external/hunspell/ExternalProject_hunspell.mk
+++ b/external/hunspell/ExternalProject_hunspell.mk
@@ -19,8 +19,7 @@ hunspell_CPPFLAGS+=$(gb_COMPILERDEFS_STDLIB_DEBUG)
hunspell_CXXFLAGS:=$(CXXFLAGS) $(gb_LTOFLAGS) \
$(gb_EMSCRIPTEN_CPPFLAGS) \
- $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
- $(if $(debug),$(gb_DEBUGINFO_FLAGS))
+ $(call gb_ExternalProject_get_build_flags,hunspell)
hunspell_LDFLAGS:=$(gb_LTOFLAGS)
diff --git a/external/hyphen/ExternalProject_hyphen.mk b/external/hyphen/ExternalProject_hyphen.mk
index 9ad32cb48960..dac823184085 100644
--- a/external/hyphen/ExternalProject_hyphen.mk
+++ b/external/hyphen/ExternalProject_hyphen.mk
@@ -24,6 +24,7 @@ $(call gb_ExternalProject_get_state_target,hyphen,build):
$(if $(filter-out iOS,$(OS)),--with-pic) \
$(gb_CONFIGURE_PLATFORMS) \
$(if $(CROSS_COMPILING),gio_can_sniff=no) \
+ CFLAGS=" $(CFLAGS) $(call gb_ExternalProject_get_build_flags,libgpg-error)" \
&& $(MAKE) \
)
$(call gb_Trace_EndRange,hyphen,EXTERNAL)
diff --git a/external/icu/ExternalProject_icu.mk b/external/icu/ExternalProject_icu.mk
index 8a1a1f82995a..aa1ef439b315 100644
--- a/external/icu/ExternalProject_icu.mk
+++ b/external/icu/ExternalProject_icu.mk
@@ -40,18 +40,16 @@ else # $(OS)
icu_CFLAGS:="$(CFLAGS) \
$(if $(filter iOS,$(OS)),-DUCONFIG_NO_FILE_IO) \
$(if $(SYSBASE),-I$(SYSBASE)/usr/include) \
- $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
+ $(call gb_ExternalProject_get_build_flags,icu) \
$(if $(ENABLE_LTO),$(gb_LTOFLAGS)) \
$(if $(filter GCC,$(COM)),-fno-strict-aliasing) \
- $(if $(call gb_Module__symbols_enabled,icu),$(gb_DEBUGINFO_FLAGS)) \
$(if $(filter FUZZERS,$(BUILD_TYPE)),-DU_USE_STRTOD_L=0) \
$(if $(filter ANDROID,$(OS)),-fvisibility=hidden -fno-omit-frame-pointer)"
icu_CXXFLAGS:="$(CXXFLAGS) $(CXXFLAGS_CXX11) \
$(if $(filter iOS,$(OS)),-DUCONFIG_NO_FILE_IO) \
- $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
+ $(call gb_ExternalProject_get_build_flags,icu) \
$(if $(ENABLE_LTO),$(gb_LTOFLAGS)) \
$(if $(filter GCC,$(COM)),-fno-strict-aliasing) \
- $(if $(call gb_Module__symbols_enabled,icu),$(gb_DEBUGINFO_FLAGS)) \
$(if $(filter FUZZERS,$(BUILD_TYPE)),-DU_USE_STRTOD_L=0) \
$(if $(filter ANDROID,$(OS)),-fvisibility=hidden -fno-omit-frame-pointer -I$(SRCDIR)/include)"
icu_LDFLAGS:=" \
diff --git a/external/lcms2/ExternalProject_lcms2.mk b/external/lcms2/ExternalProject_lcms2.mk
index 3ae94d4fb6c0..47d9089dc764 100644
--- a/external/lcms2/ExternalProject_lcms2.mk
+++ b/external/lcms2/ExternalProject_lcms2.mk
@@ -31,7 +31,7 @@ $(call gb_ExternalProject_get_state_target,lcms2,build):
$(gb_CONFIGURE_PLATFORMS) \
$(if $(CROSS_COMPILING),$(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \
CPPFLAGS=" $(SOLARINC)" \
- CFLAGS='$(CFLAGS) $(if $(debug),$(gb_DEBUGINFO_FLAGS)) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))' \
+ CFLAGS='$(CFLAGS) $(call gb_ExternalProject_get_build_flags,lcms2)' \
$(if $(DISABLE_DYNLOADING), \
--enable-static --disable-shared \
, \
diff --git a/external/libabw/ExternalProject_libabw.mk b/external/libabw/ExternalProject_libabw.mk
index 5160b1ddab64..02473c2f818c 100644
--- a/external/libabw/ExternalProject_libabw.mk
+++ b/external/libabw/ExternalProject_libabw.mk
@@ -36,7 +36,7 @@ $(call gb_ExternalProject_get_state_target,libabw,build) :
--disable-werror \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
$(if $(gb_FULLDEPS),,--disable-dependency-tracking) \
- CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libabw)" \
CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \
$(gb_CONFIGURE_PLATFORMS) \
&& $(MAKE) \
diff --git a/external/libassuan/ExternalProject_libassuan.mk b/external/libassuan/ExternalProject_libassuan.mk
index 6382bb9498a5..9b972a55fc27 100644
--- a/external/libassuan/ExternalProject_libassuan.mk
+++ b/external/libassuan/ExternalProject_libassuan.mk
@@ -31,8 +31,7 @@ $(call gb_ExternalProject_get_state_target,libassuan,build): $(call gb_Executabl
--disable-shared \
--disable-doc \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
- CFLAGS="$(CFLAGS) -D__STDC__=1" \
- CXXFLAGS="$(CXXFLAGS)" \
+ CFLAGS="$(CFLAGS) -D__STDC__=1 $(call gb_ExternalProject_get_build_flags,libassuan)" \
GPG_ERROR_CFLAGS="$(GPG_ERROR_CFLAGS)" \
GPG_ERROR_LIBS="$(GPG_ERROR_LIBS)" \
$(gb_WIN_GPG_platform_switches) \
@@ -47,6 +46,7 @@ $(call gb_ExternalProject_get_state_target,libassuan,build):
autoreconf \
&& $(gb_RUN_CONFIGURE) ./configure \
--disable-doc \
+ CFLAGS="$(CFLAGS) $(call gb_ExternalProject_get_build_flags,libassuan)" \
GPG_ERROR_CFLAGS="$(GPG_ERROR_CFLAGS)" \
GPG_ERROR_LIBS="$(GPG_ERROR_LIBS)" \
$(if $(filter LINUX,$(OS)), \
diff --git a/external/libatomic_ops/ExternalProject_libatomic_ops.mk b/external/libatomic_ops/ExternalProject_libatomic_ops.mk
index 85cfbd59c5f5..68fd752850cb 100644
--- a/external/libatomic_ops/ExternalProject_libatomic_ops.mk
+++ b/external/libatomic_ops/ExternalProject_libatomic_ops.mk
@@ -18,7 +18,7 @@ $(eval $(call gb_ExternalProject_register_targets,libatomic_ops,\
$(call gb_ExternalProject_get_state_target,libatomic_ops,build) :
$(call gb_Trace_StartRange,libatomic_ops,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- $(if $(filter TRUE,$(DISABLE_DYNLOADING)),CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" CXXFLAGS="$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))") \
+ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(call gb_ExternalProject_get_build_flags,libatomic_ops)" CXXFLAGS="$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX) $(call gb_ExternalProject_get_build_flags,libatomic_ops)") \
$(gb_RUN_CONFIGURE) ./configure \
$(gb_CONFIGURE_PLATFORMS) \
&& $(MAKE) \
diff --git a/external/libcdr/ExternalProject_libcdr.mk b/external/libcdr/ExternalProject_libcdr.mk
index 95e4259f887c..e950db8d6551 100644
--- a/external/libcdr/ExternalProject_libcdr.mk
+++ b/external/libcdr/ExternalProject_libcdr.mk
@@ -38,7 +38,7 @@ $(call gb_ExternalProject_get_state_target,libcdr,build) :
--disable-weffc \
$(if $(gb_FULLDEPS),,--disable-dependency-tracking) \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
- CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libcdr)" \
CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \
$(gb_CONFIGURE_PLATFORMS) \
&& $(MAKE) \
diff --git a/external/libebook/ExternalProject_libebook.mk b/external/libebook/ExternalProject_libebook.mk
index 4b71ec1285bf..7f5da19d6fce 100644
--- a/external/libebook/ExternalProject_libebook.mk
+++ b/external/libebook/ExternalProject_libebook.mk
@@ -39,7 +39,7 @@ $(call gb_ExternalProject_get_state_target,libebook,build) :
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
--disable-werror \
--disable-weffc \
- CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libebook)" \
CPPFLAGS="$(CPPFLAGS) $(ICU_UCHAR_TYPE) $(BOOST_CPPFLAGS)" \
LANGTAG_CFLAGS="$(LIBLANGTAG_CFLAGS)" \
LANGTAG_LIBS="$(LIBLANGTAG_LIBS)" \
diff --git a/external/libepubgen/ExternalProject_libepubgen.mk b/external/libepubgen/ExternalProject_libepubgen.mk
index b6b784403bb7..3cd170ed1bb6 100644
--- a/external/libepubgen/ExternalProject_libepubgen.mk
+++ b/external/libepubgen/ExternalProject_libepubgen.mk
@@ -32,7 +32,7 @@ $(call gb_ExternalProject_get_state_target,libepubgen,build) :
$(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \
--disable-werror \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
- CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libepubgen)" \
CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \
$(gb_CONFIGURE_PLATFORMS) \
&& $(MAKE) \
diff --git a/external/libetonyek/ExternalProject_libetonyek.mk b/external/libetonyek/ExternalProject_libetonyek.mk
index ed435dd49c61..e0f2f3e08eb1 100644
--- a/external/libetonyek/ExternalProject_libetonyek.mk
+++ b/external/libetonyek/ExternalProject_libetonyek.mk
@@ -49,7 +49,7 @@ $(call gb_ExternalProject_get_state_target,libetonyek,build) :
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \
CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \
- CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libetonyek)" \
LANGTAG_CFLAGS="$(LIBLANGTAG_CFLAGS)" \
LANGTAG_LIBS="$(LIBLANGTAG_LIBS)" \
XML_CFLAGS="$(LIBXML_CFLAGS)" \
diff --git a/external/libexttextcat/ExternalProject_libexttextcat.mk b/external/libexttextcat/ExternalProject_libexttextcat.mk
index fcb423af9f00..8ed8554a99d2 100644
--- a/external/libexttextcat/ExternalProject_libexttextcat.mk
+++ b/external/libexttextcat/ExternalProject_libexttextcat.mk
@@ -20,7 +20,7 @@ $(call gb_ExternalProject_get_state_target,libexttextcat,build):
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
$(if $(ENABLE_WERROR),--enable-werror,--disable-werror) \
$(gb_CONFIGURE_PLATFORMS) \
- CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_DEBUGINFO_FLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
+ CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_DEBUGINFO_FLAGS) $(call gb_ExternalProject_get_build_flags,libexttextcat) \
$(if $(COM_IS_CLANG),-Qunused-arguments) \
$(if $(filter AIX,$(OS)),-D_LINUX_SOURCE_COMPAT)" \
&& $(MAKE) \
diff --git a/external/libfreehand/ExternalProject_libfreehand.mk b/external/libfreehand/ExternalProject_libfreehand.mk
index 2e23bc238b4d..ada9732cecb3 100644
--- a/external/libfreehand/ExternalProject_libfreehand.mk
+++ b/external/libfreehand/ExternalProject_libfreehand.mk
@@ -38,7 +38,7 @@ $(call gb_ExternalProject_get_state_target,libfreehand,build) :
--disable-werror \
--disable-weffc \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
- CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libfreehand)" \
CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \
$(gb_CONFIGURE_PLATFORMS) \
&& $(MAKE) \
diff --git a/external/libgpg-error/ExternalProject_libgpg-error.mk b/external/libgpg-error/ExternalProject_libgpg-error.mk
index c3db35e91900..055cd3cbe394 100644
--- a/external/libgpg-error/ExternalProject_libgpg-error.mk
+++ b/external/libgpg-error/ExternalProject_libgpg-error.mk
@@ -39,6 +39,7 @@ $(call gb_ExternalProject_get_state_target,libgpg-error,build):
--disable-rpath \
--disable-languages \
--disable-doc \
+ CFLAGS=" $(CFLAGS) $(call gb_ExternalProject_get_build_flags,libgpg-error)" \
CPPFLAGS=" $(SOLARINC)" \
$(if $(filter MSC,$(COM)),--force_use_syscfg=true) \
$(gb_CONFIGURE_PLATFORMS) \
diff --git a/external/liblangtag/ExternalProject_liblangtag.mk b/external/liblangtag/ExternalProject_liblangtag.mk
index ce3603cfd5f7..9e2553860986 100644
--- a/external/liblangtag/ExternalProject_liblangtag.mk
+++ b/external/liblangtag/ExternalProject_liblangtag.mk
@@ -30,9 +30,7 @@ $(call gb_ExternalProject_get_state_target,liblangtag,build):
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
$(if $(filter TRUE,$(HAVE_GCC_BUILTIN_ATOMIC)),"lt_cv_has_atomic=yes","lt_cv_has_atomic=no") \
CFLAGS='$(CFLAGS) -pthread \
- $(if $(ENABLE_OPTIMIZED), \
- $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
- $(if $(call gb_Module__symbols_enabled,liblangtag),$(gb_DEBUGINFO_FLAGS))' \
+ $(call gb_ExternalProject_get_build_flags,liblangtag)' \
$(gb_CONFIGURE_PLATFORMS) \
$(if $(CROSS_COMPILING),$(if $(filter WNT,$(OS)),"lt_cv_c99_vsnprintf=yes" "ac_cv_va_copy=yes","ac_cv_va_copy=no")) \
LIBXML2_CFLAGS="$(LIBXML_CFLAGS)" \
diff --git a/external/libmspub/ExternalProject_libmspub.mk b/external/libmspub/ExternalProject_libmspub.mk
index a7907fa89a4f..7951b5b15a5e 100644
--- a/external/libmspub/ExternalProject_libmspub.mk
+++ b/external/libmspub/ExternalProject_libmspub.mk
@@ -36,7 +36,7 @@ $(call gb_ExternalProject_get_state_target,libmspub,build) :
--disable-werror \
--disable-weffc \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
- CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libmspub)" \
CPPFLAGS="$(CPPFLAGS) $(ICU_UCHAR_TYPE) $(BOOST_CPPFLAGS)" \
$(gb_CONFIGURE_PLATFORMS) \
&& $(MAKE) \
diff --git a/external/libmwaw/ExternalProject_libmwaw.mk b/external/libmwaw/ExternalProject_libmwaw.mk
index 2353bf87a85f..7a67a067fa77 100644
--- a/external/libmwaw/ExternalProject_libmwaw.mk
+++ b/external/libmwaw/ExternalProject_libmwaw.mk
@@ -36,7 +36,7 @@ $(call gb_ExternalProject_get_state_target,libmwaw,build) :
$(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
--disable-werror \
- CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libmwaw)" \
$(if $(filter LINUX,$(OS)),$(if $(SYSTEM_REVENGE),, \
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN')) \
diff --git a/external/libnumbertext/ExternalProject_libnumbertext.mk b/external/libnumbertext/ExternalProject_libnumbertext.mk
index 1716f9db8a12..36a9becf0846 100644
--- a/external/libnumbertext/ExternalProject_libnumbertext.mk
+++ b/external/libnumbertext/ExternalProject_libnumbertext.mk
@@ -30,7 +30,9 @@ $(call gb_ExternalProject_get_state_target,libnumbertext,build):
$(gb_CONFIGURE_PLATFORMS) \
$(if $(filter AIX,$(OS)),CFLAGS="-D_LINUX_SOURCE_COMPAT") \
$(if $(libnumbertext_CPPFLAGS),CPPFLAGS='$(libnumbertext_CPPFLAGS)') \
- CXXFLAGS="$(libnumbertext_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(debug),$(gb_DEBUGINFO_FLAGS)) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX)" \
+ CXXFLAGS="$(libnumbertext_CXXFLAGS) \
+ $(call gb_ExternalProject_get_build_flags,libnumbertext) \
+ $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX)" \
&& cd src && $(MAKE) \
)
$(call gb_Trace_EndRange,libnumbertext,EXTERNAL)
diff --git a/external/libodfgen/ExternalProject_libodfgen.mk b/external/libodfgen/ExternalProject_libodfgen.mk
index 077221adf944..c3df917c0177 100644
--- a/external/libodfgen/ExternalProject_libodfgen.mk
+++ b/external/libodfgen/ExternalProject_libodfgen.mk
@@ -36,7 +36,7 @@ $(call gb_ExternalProject_get_state_target,libodfgen,build) :
--disable-weffc \
--without-docs \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
- CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libodfgen)" \
CPPFLAGS="$(CPPFLAGS) $(if $(SYSTEM_REVENGE),,$(if $(filter-out MSC,$(COM)),-DLIBREVENGE_VISIBILITY))" \
XML_CFLAGS="$(LIBXML_CFLAGS)" \
XML_LIBS="$(LIBXML_LIBS)" \
diff --git a/external/libpagemaker/ExternalProject_libpagemaker.mk b/external/libpagemaker/ExternalProject_libpagemaker.mk
index 0fcc3f7f8879..87e407e9eea7 100644
--- a/external/libpagemaker/ExternalProject_libpagemaker.mk
+++ b/external/libpagemaker/ExternalProject_libpagemaker.mk
@@ -34,7 +34,7 @@ $(call gb_ExternalProject_get_state_target,libpagemaker,build) :
--disable-werror \
--disable-weffc \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
- CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libpagemaker)" \
CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \
$(gb_CONFIGURE_PLATFORMS) \
&& $(MAKE) \
diff --git a/external/libqxp/ExternalProject_libqxp.mk b/external/libqxp/ExternalProject_libqxp.mk
index 1298267a0113..89bc262ac128 100644
--- a/external/libqxp/ExternalProject_libqxp.mk
+++ b/external/libqxp/ExternalProject_libqxp.mk
@@ -37,7 +37,7 @@ $(call gb_ExternalProject_get_state_target,libqxp,build) :
--disable-weffc \
$(if $(gb_FULLDEPS),,--disable-dependency-tracking) \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
- CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libqxp)" \
CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \
$(gb_CONFIGURE_PLATFORMS) \
&& $(MAKE) \
diff --git a/external/librevenge/ExternalProject_librevenge.mk b/external/librevenge/ExternalProject_librevenge.mk
index 0af2002c597e..4e64d5534b6b 100644
--- a/external/librevenge/ExternalProject_librevenge.mk
+++ b/external/librevenge/ExternalProject_librevenge.mk
@@ -35,7 +35,7 @@ $(call gb_ExternalProject_get_state_target,librevenge,build) :
--disable-generators \
--without-docs \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
- CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,librevenge)" \
CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \
$(gb_CONFIGURE_PLATFORMS) \
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
diff --git a/external/libstaroffice/ExternalProject_libstaroffice.mk b/external/libstaroffice/ExternalProject_libstaroffice.mk
index 29a5a74c21eb..a81428e713e4 100644
--- a/external/libstaroffice/ExternalProject_libstaroffice.mk
+++ b/external/libstaroffice/ExternalProject_libstaroffice.mk
@@ -37,7 +37,7 @@ $(call gb_ExternalProject_get_state_target,libstaroffice,build) :
$(if $(ENABLE_DEBUG),--enable-debug,--disable-debug) \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
--disable-werror \
- CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libstaroffice)" \
$(if $(filter LINUX,$(OS)),$(if $(SYSTEM_REVENGE),, \
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN')) \
diff --git a/external/libvisio/ExternalProject_libvisio.mk b/external/libvisio/ExternalProject_libvisio.mk
index f49ea2de4828..f0e632fade83 100644
--- a/external/libvisio/ExternalProject_libvisio.mk
+++ b/external/libvisio/ExternalProject_libvisio.mk
@@ -37,7 +37,7 @@ $(call gb_ExternalProject_get_state_target,libvisio,build) :
--disable-werror \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
$(if $(gb_FULLDEPS),,--disable-dependency-tracking) \
- CXXFLAGS="$(CXXFLAGS) $(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(CXXFLAGS) $(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libvisio)" \
CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \
$(gb_CONFIGURE_PLATFORMS) \
&& $(MAKE) \
diff --git a/external/libwebp/ExternalProject_libwebp.mk b/external/libwebp/ExternalProject_libwebp.mk
index 4bdf7a32174a..e224cb959348 100644
--- a/external/libwebp/ExternalProject_libwebp.mk
+++ b/external/libwebp/ExternalProject_libwebp.mk
@@ -46,7 +46,7 @@ $(call gb_ExternalProject_get_state_target,libwebp,build) :
--disable-gif \
--disable-wic \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
- CFLAGS="$(gb_CFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CFLAGS="$(gb_CFLAGS) $(call gb_ExternalProject_get_build_flags,libwebp)" \
CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \
$(gb_CONFIGURE_PLATFORMS) \
&& $(MAKE) \
diff --git a/external/libwpd/ExternalProject_libwpd.mk b/external/libwpd/ExternalProject_libwpd.mk
index e02e44bc6645..3317aecd76d2 100644
--- a/external/libwpd/ExternalProject_libwpd.mk
+++ b/external/libwpd/ExternalProject_libwpd.mk
@@ -36,7 +36,7 @@ $(call gb_ExternalProject_get_state_target,libwpd,build) :
$(if $(filter MACOSX,$(OS)), \
--prefix=/@.__________________________________________________OOO) \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
- CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libwpd)" \
CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \
$(if $(filter LINUX,$(OS)),$(if $(SYSTEM_REVENGE),, \
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
diff --git a/external/libwpg/ExternalProject_libwpg.mk b/external/libwpg/ExternalProject_libwpg.mk
index 1819d8c20468..6a0d2c8984c6 100644
--- a/external/libwpg/ExternalProject_libwpg.mk
+++ b/external/libwpg/ExternalProject_libwpg.mk
@@ -36,7 +36,7 @@ $(call gb_ExternalProject_get_state_target,libwpg,build) :
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
$(gb_CONFIGURE_PLATFORMS) \
- CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libwpg)" \
$(if $(filter LINUX,$(OS)), \
'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN') \
diff --git a/external/libwps/ExternalProject_libwps.mk b/external/libwps/ExternalProject_libwps.mk
index caf2c3d354f1..2fb91ee59b1a 100644
--- a/external/libwps/ExternalProject_libwps.mk
+++ b/external/libwps/ExternalProject_libwps.mk
@@ -21,7 +21,7 @@ $(eval $(call gb_ExternalProject_use_externals,libwps,\
libwps_CPPFLAGS+=$(gb_COMPILERDEFS_STDLIB_DEBUG)
-libwps_CXXFLAGS=$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))
+libwps_CXXFLAGS=$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libwps)
libwps_LDFLAGS=
ifeq ($(OS),LINUX)
diff --git a/external/libxml2/ExternalProject_libxml2.mk b/external/libxml2/ExternalProject_libxml2.mk
index a98ee9e136de..41f5c37c6f5b 100644
--- a/external/libxml2/ExternalProject_libxml2.mk
+++ b/external/libxml2/ExternalProject_libxml2.mk
@@ -41,7 +41,9 @@ $(call gb_ExternalProject_get_state_target,libxml2,build):
$(gb_CONFIGURE_PLATFORMS) \
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________URELIB) \
LDFLAGS="$(if $(SYSBASE),-L$(SYSBASE)/usr/lib)" \
- CFLAGS="$(CFLAGS) $(if $(SYSBASE),-I$(SYSBASE)/usr/include) $(if $(debug),-g) $(if $(gb_Module_CURRENTMODULE_SYMBOLS_ENABLED),-g)" \
+ CFLAGS="$(CFLAGS) \
+ $(if $(SYSBASE),-I$(SYSBASE)/usr/include) \
+ $(call gb_ExternalProject_get_build_flags,libxml2)" \
$(if $(filter TRUE,$(DISABLE_DYNLOADING)),--disable-shared,--disable-static) \
&& $(MAKE) \
)
diff --git a/external/libzmf/ExternalProject_libzmf.mk b/external/libzmf/ExternalProject_libzmf.mk
index d5f06fb71ee6..8c61dd5f29de 100644
--- a/external/libzmf/ExternalProject_libzmf.mk
+++ b/external/libzmf/ExternalProject_libzmf.mk
@@ -38,7 +38,7 @@ $(call gb_ExternalProject_get_state_target,libzmf,build) :
--disable-werror \
--disable-weffc \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
- CXXFLAGS="$(gb_CXXFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CXXFLAGS="$(gb_CXXFLAGS) $(call gb_ExternalProject_get_build_flags,libzmf)" \
CPPFLAGS="$(CPPFLAGS) $(BOOST_CPPFLAGS)" \
$(gb_CONFIGURE_PLATFORMS) \
&& $(MAKE) \
diff --git a/external/lpsolve/ExternalProject_lpsolve.mk b/external/lpsolve/ExternalProject_lpsolve.mk
index b23dddf47a29..7b5338b24725 100644
--- a/external/lpsolve/ExternalProject_lpsolve.mk
+++ b/external/lpsolve/ExternalProject_lpsolve.mk
@@ -25,7 +25,7 @@ else # $(OS)!=WNT
$(call gb_ExternalProject_get_state_target,lpsolve,build):
$(call gb_Trace_StartRange,lpsolve,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- CC="$(CC) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(debug),$(gb_DEBUGINFO_FLAGS))" \
+ CC="$(CC) $(call gb_ExternalProject_get_build_flags,lpsolve)" \
$(if $(filter MACOSX,$(OS)),EXTRA_LINKFLAGS='-install_name @__________________________________________________OOO/liblpsolve55.dylib') \
sh -e $(if $(filter MACOSX,$(OS)),ccc.osx, \
$(if $(filter TRUE,$(DISABLE_DYNLOADING)),ccc.static, \
diff --git a/external/mythes/ExternalProject_mythes.mk b/external/mythes/ExternalProject_mythes.mk
index 183126ae4e78..7ebdfa839319 100644
--- a/external/mythes/ExternalProject_mythes.mk
+++ b/external/mythes/ExternalProject_mythes.mk
@@ -20,6 +20,7 @@ $(eval $(call gb_ExternalProject_register_targets,mythes,\
$(call gb_ExternalProject_get_state_target,mythes,build):
$(call gb_Trace_StartRange,mythes,EXTERNAL)
$(call gb_ExternalProject_run,build,\
+ CXXFLAGS=" $(CXXFLAGS) $(call gb_ExternalProject_get_build_flags,mythes)" \
LIBS="$(gb_STDLIBS) $(LIBS)" $(gb_RUN_CONFIGURE) ./configure --disable-shared --with-pic \
$(gb_CONFIGURE_PLATFORMS) \
$(if $(CROSS_COMPILING),gio_can_sniff=no) \
diff --git a/external/openldap/ExternalProject_openldap.mk b/external/openldap/ExternalProject_openldap.mk
index 6088c1f63e75..79519fcd4e8b 100644
--- a/external/openldap/ExternalProject_openldap.mk
+++ b/external/openldap/ExternalProject_openldap.mk
@@ -42,10 +42,10 @@ $(call gb_ExternalProject_get_state_target,openldap,build) :
ac_cv_func_memcmp_working=yes \
) \
$(if $(SYSTEM_NSS), \
- CPPFLAGS="$(CPPFLAGS) $(NSS_CFLAGS)" CFLAGS="$(CFLAGS) $(NSS_CFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" LDFLAGS="$(LDFLAGS) $(NSS_LIBS)" \
+ CPPFLAGS="$(CPPFLAGS) $(NSS_CFLAGS)" CFLAGS="$(CFLAGS) $(NSS_CFLAGS) $(call gb_ExternalProject_get_build_flags,openldap)" LDFLAGS="$(LDFLAGS) $(NSS_LIBS)" \
, \
CPPFLAGS="$(CPPFLAGS) -I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss -I$(call gb_UnpackedTarball_get_dir,nss)/dist/out/include" \
- CFLAGS="$(CFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) -I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss -I$(call gb_UnpackedTarball_get_dir,nss)/dist/out/include" \
+ CFLAGS="$(CFLAGS) $(call gb_ExternalProject_get_build_flags,openldap) -I$(call gb_UnpackedTarball_get_dir,nss)/dist/public/nss -I$(call gb_UnpackedTarball_get_dir,nss)/dist/out/include" \
) \
$(if $(openldap_LDFLAGS),LDFLAGS="$(LDFLAGS) $(openldap_LDFLAGS)") \
&& MAKEFLAGS= && $(MAKE) \
diff --git a/external/redland/ExternalProject_raptor.mk b/external/redland/ExternalProject_raptor.mk
index bc4f68a088fa..324d231c5073 100644
--- a/external/redland/ExternalProject_raptor.mk
+++ b/external/redland/ExternalProject_raptor.mk
@@ -19,7 +19,9 @@ $(call gb_ExternalProject_get_state_target,raptor,build):
$(call gb_Trace_StartRange,raptor,EXTERNAL)
$(call gb_ExternalProject_run,build,\
$(if $(filter iOS,$(OS)),LIBS="-liconv") \
- CFLAGS="$(CFLAGS) $(if $(debug),-g,-O) $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden) \
+ CFLAGS="$(CFLAGS) \
+ $(call gb_ExternalProject_get_build_flags,raptor) \
+ $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden) \
$(if $(filter GCCLINUXPOWERPC64,$(COM)$(OS)$(CPUNAME)),-mminimal-toc)" \
LDFLAGS=" \
$(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN") \
diff --git a/external/redland/ExternalProject_rasqal.mk b/external/redland/ExternalProject_rasqal.mk
index 3162c930723c..dd8887c669c8 100644
--- a/external/redland/ExternalProject_rasqal.mk
+++ b/external/redland/ExternalProject_rasqal.mk
@@ -22,7 +22,7 @@ $(eval $(call gb_ExternalProject_register_targets,rasqal,\
$(call gb_ExternalProject_get_state_target,rasqal,build):
$(call gb_Trace_StartRange,rasqal,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- CFLAGS="$(CFLAGS) $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CFLAGS="$(CFLAGS) $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden) $(call gb_ExternalProject_get_build_flags,rasqal)" \
LDFLAGS=" \
$(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN") \
$(if $(SYSBASE),$(if $(filter LINUX SOLARIS,$(OS)),-L$(SYSBASE)/lib -L$(SYSBASE)/usr/lib -lpthread -ldl))" \
diff --git a/external/redland/ExternalProject_redland.mk b/external/redland/ExternalProject_redland.mk
index 66ded26e2eba..d4dd34519670 100644
--- a/external/redland/ExternalProject_redland.mk
+++ b/external/redland/ExternalProject_redland.mk
@@ -23,7 +23,7 @@ $(eval $(call gb_ExternalProject_register_targets,redland,\
$(call gb_ExternalProject_get_state_target,redland,build):
$(call gb_Trace_StartRange,redland,EXTERNAL)
$(call gb_ExternalProject_run,build,\
- CFLAGS="$(CFLAGS) $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))" \
+ CFLAGS="$(CFLAGS) $(if $(filter TRUE,$(DISABLE_DYNLOADING)),-fvisibility=hidden) $(call gb_ExternalProject_get_build_flags,redland)" \
LDFLAGS=" \
$(if $(filter LINUX FREEBSD,$(OS)),-Wl$(COMMA)-z$(COMMA)origin -Wl$(COMMA)-rpath$(COMMA)\\"\$$\$$ORIGIN") \
$(if $(SYSBASE),$(if $(filter LINUX SOLARIS,$(OS)),-L$(SYSBASE)/lib -L$(SYSBASE)/usr/lib -lpthread -ldl))" \
diff --git a/external/xmlsec/ExternalProject_xmlsec.mk b/external/xmlsec/ExternalProject_xmlsec.mk
index 452f6ee14768..b4e784099cf9 100644
--- a/external/xmlsec/ExternalProject_xmlsec.mk
+++ b/external/xmlsec/ExternalProject_xmlsec.mk
@@ -51,7 +51,7 @@ $(call gb_ExternalProject_get_state_target,xmlsec,build) :
&& $(gb_RUN_CONFIGURE) ./configure \
--with-pic --disable-shared --disable-crypto-dl --without-libxslt --without-gnutls --without-gcrypt --disable-apps --disable-docs \
$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
- CFLAGS="$(CFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(debug),$(gb_DEBUGINFO_FLAGS)) $(gb_VISIBILITY_FLAGS)" \
+ CFLAGS="$(CFLAGS) $(call gb_ExternalProject_get_build_flags,xmlsec) $(gb_VISIBILITY_FLAGS)" \
$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
$(if $(ENABLE_NSS), \
--without-openssl \