[Libreoffice-commits] core.git: config_host.mk.in configure.ac external/harfbuzz external/hunspell external/icu external/jpeg-turbo external/lcms2 external/libatomic_ops external/libexttextcat external/libwpd external/libxmlsec external/lpsolve external/poppler solenv/gbuild

Stephan Bergmann sbergman at redhat.com
Thu Jun 22 09:59:37 UTC 2017


 config_host.mk.in                                       |    1 
 configure.ac                                            |   23 ++++++++++++++++
 external/harfbuzz/ExternalProject_harfbuzz.mk           |    7 ++--
 external/hunspell/ExternalProject_hunspell.mk           |    2 -
 external/icu/ExternalProject_icu.mk                     |    6 ++--
 external/jpeg-turbo/ExternalProject_jpeg-turbo.mk       |    2 -
 external/lcms2/ExternalProject_lcms2.mk                 |    2 -
 external/libatomic_ops/ExternalProject_libatomic_ops.mk |    2 -
 external/libexttextcat/ExternalProject_exttextcat.mk    |    2 -
 external/libwpd/ExternalProject_libwpd.mk               |    2 -
 external/libxmlsec/ExternalProject_xmlsec.mk            |    2 -
 external/lpsolve/ExternalProject_lpsolve.mk             |    2 -
 external/poppler/ExternalProject_poppler.mk             |    2 -
 solenv/gbuild/LinkTarget.mk                             |    4 +-
 14 files changed, 42 insertions(+), 17 deletions(-)

New commits:
commit e751e24250fda31dde52b3c65ca79f86142dc789
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Jun 22 09:42:19 2017 +0200

    --enable-optimized should be orthogonal to --enable-debug/--enable-dbgutil
    
    Change-Id: I277f30129560ea9fa76d6439a60bb191358df99d
    Reviewed-on: https://gerrit.libreoffice.org/39088
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/config_host.mk.in b/config_host.mk.in
index e175ecd76b66..5bce0b32697b 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -152,6 +152,7 @@ export ENABLE_EXTENSION_UPDATE=@ENABLE_EXTENSION_UPDATE@
 export ENABLE_OOENV=@ENABLE_OOENV@
 export ENABLE_OPENGL_TRANSITIONS=@ENABLE_OPENGL_TRANSITIONS@
 export ENABLE_OPENGL_CANVAS=@ENABLE_OPENGL_CANVAS@
+export ENABLE_OPTIMIZED=@ENABLE_OPTIMIZED@
 export ENABLE_PCH=@ENABLE_PCH@
 export ENABLE_PDFIMPORT=@ENABLE_PDFIMPORT@
 export ENABLE_PDFIUM=@ENABLE_PDFIUM@
diff --git a/configure.ac b/configure.ac
index c68105505bfa..c71a9469d821 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1164,6 +1164,12 @@ libo_FUZZ_ARG_ENABLE(symbols,
          By default, enabled for --enable-debug and --enable-dbgutil, disabled
          otherwise.]))
 
+libo_FUZZ_ARG_ENABLE(optimized,
+    AS_HELP_STRING([--disable-optimized],
+        [Whether to compile with optimization flags.
+         By default, disabled for --enable-debug and --enable-dbgutil, enabled
+         otherwise.]))
+
 libo_FUZZ_ARG_ENABLE(runtime-optimizations,
     AS_HELP_STRING([--disable-runtime-optimizations],
         [Statically disable certain runtime optimizations (like rtl/alloc.h or
@@ -3924,6 +3930,23 @@ if test "$enable_release_build" != yes -a \( -n "$ENABLE_SYMBOLS" -o -n "$ENABLE
 fi
 AC_SUBST(XCODE_DEBUG_INFORMATION_FORMAT)
 
+AC_MSG_CHECKING([whether to compile with optimization flags])
+if test -z "$enable_optimized"; then
+    if test -n "$ENABLE_DEBUG$ENABLE_DBGUTIL"; then
+        enable_optimized=no
+    else
+        enable_optimized=yes
+    fi
+fi
+if test "$enable_optimized" != no; then
+    ENABLE_OPTIMIZED=TRUE
+    AC_MSG_RESULT([yes])
+else
+    ENABLE_OPTIMIZED=
+    AC_MSG_RESULT([no])
+fi
+AC_SUBST(ENABLE_OPTIMIZED)
+
 #
 # determine CPUNAME, OS, ...
 # The USING_X11 flag tells whether the host os uses X by default. Can be overridden with the --without-x option.
diff --git a/external/harfbuzz/ExternalProject_harfbuzz.mk b/external/harfbuzz/ExternalProject_harfbuzz.mk
index e98cc03bb80a..839bf49ff50d 100644
--- a/external/harfbuzz/ExternalProject_harfbuzz.mk
+++ b/external/harfbuzz/ExternalProject_harfbuzz.mk
@@ -43,10 +43,9 @@ $(call gb_ExternalProject_get_state_target,harfbuzz,build) :
 			$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
 			CXXFLAGS=' \
 				$(if $(filter $(true),$(gb_SYMBOL)),$(gb_DEBUGINFO_FLAGS)) \
-				$(if $(debug), \
-					$(gb_COMPILERNOOPTFLAGS) $(gb_DEBUG_CFLAGS) \
-						$(gb_DEBUG_CXXFLAGS), \
-					$(gb_COMPILEROPTFLAGS)) \
+				$(if $(ENABLE_OPTIMIZED), \
+					$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
+				$(if $(debug),$(gb_DEBUG_CFLAGS) $(gb_DEBUG_CXXFLAGS)) \
 				$(CXXFLAGS) \
 				$(ICU_UCHAR_TYPE) \
 				$(if $(filter LINUX,$(OS)),-fvisibility=hidden)' \
diff --git a/external/hunspell/ExternalProject_hunspell.mk b/external/hunspell/ExternalProject_hunspell.mk
index 984485fc2a2c..220fbc21106f 100644
--- a/external/hunspell/ExternalProject_hunspell.mk
+++ b/external/hunspell/ExternalProject_hunspell.mk
@@ -30,7 +30,7 @@ $(call gb_ExternalProject_get_state_target,hunspell,build):
 			$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM))\
 			$(if $(filter AIX,$(OS)),CFLAGS="-D_LINUX_SOURCE_COMPAT") \
 			$(if $(hunspell_CPPFLAGS),CPPFLAGS='$(hunspell_CPPFLAGS)') \
-			CXXFLAGS="$(CXXFLAGS) $(if $(debug),$(gb_COMPILERNOOPTFLAGS) $(gb_DEBUGINFO_FLAGS) $(gb_DEBUG_CXXFLAGS),$(gb_COMPILEROPTFLAGS))" \
+			CXXFLAGS="$(CXXFLAGS) $(if $(ENABLE_OPTIMIZED) $(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(debug),$(gb_DEBUGINFO_FLAGS) $(gb_DEBUG_CXXFLAGS))" \
 		&& cd src/hunspell && $(MAKE) \
 	)
 
diff --git a/external/icu/ExternalProject_icu.mk b/external/icu/ExternalProject_icu.mk
index 205817938539..4528d62f1d45 100644
--- a/external/icu/ExternalProject_icu.mk
+++ b/external/icu/ExternalProject_icu.mk
@@ -34,7 +34,8 @@ else # $(OS)
 icu_CFLAGS:=" \
 	$(if $(filter IOS,$(OS)),-DUCONFIG_NO_FILE_IO) \
 	$(if $(SYSBASE),-I$(SYSBASE)/usr/include) \
-	$(if $(debug),$(gb_DEBUG_CFLAGS),$(gb_COMPILEROPTFLAGS)) \
+	$(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
+	$(if $(debug),$(gb_DEBUG_CFLAGS)) \
 	$(if $(ENABLE_LTO),$(gb_LTOFLAGS)) \
 	$(if $(filter GCC,$(COM)),-fno-strict-aliasing) \
 	$(if $(filter $(true),$(gb_SYMBOL)),$(gb_DEBUGINFO_FLAGS)) \
@@ -42,7 +43,8 @@ icu_CFLAGS:=" \
 	$(if $(filter ANDROID,$(OS)),-fvisibility=hidden -fno-omit-frame-pointer)"
 icu_CXXFLAGS:="$(CXXFLAGS) $(CXXFLAGS_CXX11) \
 	$(if $(filter IOS,$(OS)),-DUCONFIG_NO_FILE_IO) \
-	$(if $(debug),$(gb_DEBUG_CFLAGS),$(gb_COMPILEROPTFLAGS)) \
+	$(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
+	$(if $(debug),$(gb_DEBUG_CFLAGS)) \
 	$(if $(ENABLE_LTO),$(gb_LTOFLAGS)) \
 	$(if $(filter GCC,$(COM)),-fno-strict-aliasing) \
 	$(if $(filter $(true),$(gb_SYMBOL)),$(gb_DEBUGINFO_FLAGS)) \
diff --git a/external/jpeg-turbo/ExternalProject_jpeg-turbo.mk b/external/jpeg-turbo/ExternalProject_jpeg-turbo.mk
index f3e3945caf99..f902f25e6dee 100644
--- a/external/jpeg-turbo/ExternalProject_jpeg-turbo.mk
+++ b/external/jpeg-turbo/ExternalProject_jpeg-turbo.mk
@@ -33,7 +33,7 @@ $(call gb_ExternalProject_get_state_target,jpeg-turbo,configure) :
 			--without-java \
 			--without-turbojpeg \
 			$(if $(NASM),,--without-simd) \
-			CFLAGS='$(if $(debug),$(gb_DEBUGINFO_FLAGS) $(gb_DEBUG_CFLAGS),$(gb_COMPILEROPTFLAGS)) $(CFLAGS) $(gb_VISIBILITY_FLAGS)' \
+			CFLAGS='$(if $(debug),$(gb_DEBUGINFO_FLAGS) $(gb_DEBUG_CFLAGS)) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(CFLAGS) $(gb_VISIBILITY_FLAGS)' \
 	)
 
 # vim: set noet sw=4 ts=4:
diff --git a/external/lcms2/ExternalProject_lcms2.mk b/external/lcms2/ExternalProject_lcms2.mk
index 0e8fa4fb631f..51eb81acfc68 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):
 			$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM) \
 			$(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \
 			CPPFLAGS=" $(SOLARINC)" \
-			CFLAGS='$(CFLAGS) $(if $(debug),$(gb_DEBUGINFO_FLAGS) $(gb_DEBUG_CFLAGS),$(gb_COMPILEROPTFLAGS))' \
+			CFLAGS='$(CFLAGS) $(if $(debug),$(gb_DEBUGINFO_FLAGS) $(gb_DEBUG_CFLAGS)) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS))' \
 			$(if $(DISABLE_DYNLOADING), \
 				--enable-static --disable-shared \
 			, \
diff --git a/external/libatomic_ops/ExternalProject_libatomic_ops.mk b/external/libatomic_ops/ExternalProject_libatomic_ops.mk
index afbad2e04930..2bb31a4003d3 100644
--- a/external/libatomic_ops/ExternalProject_libatomic_ops.mk
+++ b/external/libatomic_ops/ExternalProject_libatomic_ops.mk
@@ -17,7 +17,7 @@ $(eval $(call gb_ExternalProject_register_targets,libatomic_ops,\
 
 $(call gb_ExternalProject_get_state_target,libatomic_ops,build) :
 	$(call gb_ExternalProject_run,build,\
-		$(if $(filter TRUE,$(DISABLE_DYNLOADING)),CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_COMPILEROPTFLAGS)" CXXFLAGS="$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX) $(gb_COMPILEROPTFLAGS)") \
+		$(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))") \
 		./configure \
 			$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
 		&& $(MAKE) \
diff --git a/external/libexttextcat/ExternalProject_exttextcat.mk b/external/libexttextcat/ExternalProject_exttextcat.mk
index d736ea91cc95..f217e84dd12f 100644
--- a/external/libexttextcat/ExternalProject_exttextcat.mk
+++ b/external/libexttextcat/ExternalProject_exttextcat.mk
@@ -17,7 +17,7 @@ $(call gb_ExternalProject_get_state_target,exttextcat,build):
 	$(call gb_ExternalProject_run,build,\
 		./configure --disable-shared --with-pic \
 			$(if $(CROSS_COMPILING),--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)) \
-		CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_DEBUGINFO_FLAGS) $(gb_DEBUG_CFLAGS) $(gb_COMPILEROPTFLAGS) \
+		CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_DEBUGINFO_FLAGS) $(gb_DEBUG_CFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) \
 			$(if $(COM_IS_CLANG),-Qunused-arguments) \
 			$(if $(filter AIX,$(OS)),-D_LINUX_SOURCE_COMPAT)" \
 		&& $(MAKE) \
diff --git a/external/libwpd/ExternalProject_libwpd.mk b/external/libwpd/ExternalProject_libwpd.mk
index feee6e0270d3..f1b7cdf18cb1 100644
--- a/external/libwpd/ExternalProject_libwpd.mk
+++ b/external/libwpd/ExternalProject_libwpd.mk
@@ -34,7 +34,7 @@ $(call gb_ExternalProject_get_state_target,libwpd,build) :
 				--disable-werror \
 				--prefix=/@.__________________________________________________OOO) \
 			$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
-			$(if $(filter TRUE,$(DISABLE_DYNLOADING)),CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_COMPILEROPTFLAGS)" CXXFLAGS="$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX) $(gb_COMPILEROPTFLAGS)") \
+			$(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 LINUX,$(OS)),$(if $(SYSTEM_REVENGE),, \
 				'LDFLAGS=-Wl$(COMMA)-z$(COMMA)origin \
 					-Wl$(COMMA)-rpath$(COMMA)\$$$$ORIGIN')) \
diff --git a/external/libxmlsec/ExternalProject_xmlsec.mk b/external/libxmlsec/ExternalProject_xmlsec.mk
index 133b5505ac9e..942bda06fbd4 100644
--- a/external/libxmlsec/ExternalProject_xmlsec.mk
+++ b/external/libxmlsec/ExternalProject_xmlsec.mk
@@ -40,7 +40,7 @@ $(call gb_ExternalProject_get_state_target,xmlsec,build) :
 		&& ./configure \
 			--with-pic --disable-shared --disable-crypto-dl --without-libxslt --without-gnutls --disable-apps --disable-docs \
 			$(if $(verbose),--disable-silent-rules,--enable-silent-rules) \
-			CFLAGS="$(CFLAGS) $(if $(debug),$(gb_COMPILERNOOPTFLAGS) $(gb_DEBUGINFO_FLAGS) $(gb_DEBUG_CFLAGS),$(gb_COMPILEROPTFLAGS)) $(gb_VISIBILITY_FLAGS)" \
+			CFLAGS="$(CFLAGS) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(debug),$(gb_DEBUGINFO_FLAGS) $(gb_DEBUG_CFLAGS)) $(gb_VISIBILITY_FLAGS)" \
 			$(if $(or $(filter-out ANDROID,$(OS)),$(DISABLE_OPENSSL)),--without-openssl,--with-openssl=$(call gb_UnpackedTarball_get_dir,openssl)) \
 			$(if $(filter MACOSX,$(OS)),--prefix=/@.__________________________________________________OOO) \
 			$(if $(SYSTEM_NSS),,$(if $(filter MACOSX,$(OS)),--disable-pkgconfig)) \
diff --git a/external/lpsolve/ExternalProject_lpsolve.mk b/external/lpsolve/ExternalProject_lpsolve.mk
index cbe35931f473..17a9bd58732c 100644
--- a/external/lpsolve/ExternalProject_lpsolve.mk
+++ b/external/lpsolve/ExternalProject_lpsolve.mk
@@ -22,7 +22,7 @@ $(call gb_ExternalProject_get_state_target,lpsolve,build):
 else # $(OS)!=WNT
 $(call gb_ExternalProject_get_state_target,lpsolve,build):
 	$(call gb_ExternalProject_run,build,\
-		CC="$(CC) $(if $(debug),$(gb_COMPILERNOOPTFLAGS) $(gb_DEBUGINFO_FLAGS) $(gb_DEBUG_CFLAGS),$(gb_COMPILEROPTFLAGS))" \
+		CC="$(CC) $(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(debug),$(gb_DEBUGINFO_FLAGS) $(gb_DEBUG_CFLAGS))" \
 		$(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/poppler/ExternalProject_poppler.mk b/external/poppler/ExternalProject_poppler.mk
index 61cc10e62d06..9db697fd482c 100644
--- a/external/poppler/ExternalProject_poppler.mk
+++ b/external/poppler/ExternalProject_poppler.mk
@@ -21,7 +21,7 @@ $(eval $(call gb_ExternalProject_register_targets,poppler,\
 
 $(call gb_ExternalProject_get_state_target,poppler,build) :
 	$(call gb_ExternalProject_run,build,\
-		$(if $(filter TRUE,$(DISABLE_DYNLOADING)),CFLAGS="$(CFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_COMPILEROPTFLAGS)" CXXFLAGS="$(CXXFLAGS) $(gb_VISIBILITY_FLAGS) $(gb_VISIBILITY_FLAGS_CXX) $(gb_COMPILEROPTFLAGS)") \
+		$(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))") \
 		MAKE=$(MAKE) PKG_CONFIG="" ./configure \
 			--with-pic \
 			--enable-static \
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 0ce457380c15..23d0999112af 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -44,8 +44,8 @@ gb_LinkTarget__debug_enabled = \
 
 # debug flags, if ENABLE_DEBUG is set and the LinkTarget is named
 # in the list of libraries of ENABLE_DEBUGINFO_FOR
-gb_LinkTarget__get_debugcflags=$(if $(call gb_LinkTarget__debug_enabled,$(1)),$(gb_COMPILERNOOPTFLAGS) $(gb_DEBUG_CFLAGS),$(gb_COMPILEROPTFLAGS)) $(if $(filter $(true),$(gb_SYMBOL)),$(gb_DEBUGINFO_FLAGS))
-gb_LinkTarget__get_debugcxxflags=$(if $(call gb_LinkTarget__debug_enabled,$(1)),$(gb_COMPILERNOOPTFLAGS) $(gb_DEBUG_CFLAGS) $(gb_DEBUG_CXXFLAGS),$(gb_COMPILEROPTFLAGS)) $(if $(filter $(true),$(gb_SYMBOL)),$(gb_DEBUGINFO_FLAGS))
+gb_LinkTarget__get_debugcflags=$(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(call gb_LinkTarget__debug_enabled,$(1)),$(gb_DEBUG_CFLAGS)) $(if $(filter $(true),$(gb_SYMBOL)),$(gb_DEBUGINFO_FLAGS))
+gb_LinkTarget__get_debugcxxflags=$(if $(ENABLE_OPTIMIZED),$(gb_COMPILEROPTFLAGS),$(gb_COMPILERNOOPTFLAGS)) $(if $(call gb_LinkTarget__debug_enabled,$(1)),$(gb_DEBUG_CFLAGS)) $(if $(filter $(true),$(gb_SYMBOL)),$(gb_DEBUGINFO_FLAGS))
 
 # similar for LDFLAGS, use linker optimization flags in non-debug case,
 # but moreover strip debug from libraries for which debuginfo is not wanted


More information about the Libreoffice-commits mailing list