[Libreoffice-commits] core.git: desktop/Library_active_native.mk desktop/Library_passive_native.mk external/mysqlcppconn include/rtl mysqlc/Library_mysqlc.mk odk/CppunitTest_odk_checkapi.mk odk/qa solenv/gbuild

Stephan Bergmann sbergman at redhat.com
Thu Dec 18 07:40:08 PST 2014


 desktop/Library_active_native.mk              |    2 ++
 desktop/Library_passive_native.mk             |    2 ++
 external/mysqlcppconn/Library_mysqlcppconn.mk |    2 ++
 include/rtl/stringutils.hxx                   |    4 ----
 mysqlc/Library_mysqlc.mk                      |    4 ++--
 odk/CppunitTest_odk_checkapi.mk               |    3 ++-
 odk/qa/checkapi/checkapi.cxx                  |    6 ++++--
 solenv/gbuild/CppunitTest.mk                  |    1 +
 solenv/gbuild/Executable.mk                   |    1 +
 solenv/gbuild/Library.mk                      |    1 +
 solenv/gbuild/LinkTarget.mk                   |    7 +++++++
 solenv/gbuild/StaticLibrary.mk                |    1 +
 solenv/gbuild/gbuild.mk                       |   14 +++++++-------
 solenv/gbuild/platform/com_GCC_class.mk       |    5 +++++
 solenv/gbuild/platform/com_MSC_class.mk       |    1 +
 15 files changed, 38 insertions(+), 16 deletions(-)

New commits:
commit 86ba184394094c7c043a505a20a0b1b8977f73d7
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Dec 18 16:34:46 2014 +0100

    Introduce gb_*_set_external_code
    
    ...to harmonize the mechanisms to not define LIBO_INTERNAL_ONLY for extension
    code and CppunitTest_odk_checkapi.  (It also needs to revert any -Wundef, as the
    config_host/config_*.h files will not be included, so the HAVE_* macros will be
    undefined.)
    
    This obsoletes the need for RTL_DISABLE_FAST_STRING.
    
    Change-Id: If5eacba80c349efb90762aade8f2ea6d2db7e314

diff --git a/desktop/Library_active_native.mk b/desktop/Library_active_native.mk
index 7c09c10..ef4815f 100644
--- a/desktop/Library_active_native.mk
+++ b/desktop/Library_active_native.mk
@@ -13,6 +13,8 @@ $(eval $(call gb_Library_add_exception_objects,active_native, \
     desktop/test/deployment/active/active_native \
 ))
 
+$(eval $(call gb_Library_set_external_code,active_native))
+
 $(eval $(call gb_Library_use_externals,active_native, \
     boost_headers \
 ))
diff --git a/desktop/Library_passive_native.mk b/desktop/Library_passive_native.mk
index ac2c0bc..8bc14b5 100644
--- a/desktop/Library_passive_native.mk
+++ b/desktop/Library_passive_native.mk
@@ -15,6 +15,8 @@ $(eval $(call gb_Library_add_exception_objects,passive_native, \
 
 $(eval $(call gb_Library_set_componentfile,passive_native,desktop/test/deployment/passive/passive_native))
 
+$(eval $(call gb_Library_set_external_code,passive_native))
+
 $(eval $(call gb_Library_use_externals,passive_native, \
     boost_headers \
 ))
diff --git a/external/mysqlcppconn/Library_mysqlcppconn.mk b/external/mysqlcppconn/Library_mysqlcppconn.mk
index 3a5da71..8b6202f 100644
--- a/external/mysqlcppconn/Library_mysqlcppconn.mk
+++ b/external/mysqlcppconn/Library_mysqlcppconn.mk
@@ -32,6 +32,8 @@ $(eval $(call gb_Library_use_externals,mysqlcppconn,\
 endif
 endif
 
+$(eval $(call gb_Library_set_external_code,mysqlcppconn))
+
 $(eval $(call gb_Library_set_warnings_not_errors,mysqlcppconn))
 
 $(eval $(call gb_Library_set_generated_cxx_suffix,mysqlcppconn,cpp))
diff --git a/include/rtl/stringutils.hxx b/include/rtl/stringutils.hxx
index 52ed1d0..1f1e53b 100644
--- a/include/rtl/stringutils.hxx
+++ b/include/rtl/stringutils.hxx
@@ -13,15 +13,11 @@
 #include <sal/config.h>
 #include <sal/types.h>
 
-// Manually defining RTL_DISABLE_FAST_STRING allows to force turning fast string concatenation off
-// (e.g. for debugging).
-#ifndef RTL_DISABLE_FAST_STRING
 // This feature is not part of public API and is meant to be used only internally by LibreOffice.
 #ifdef LIBO_INTERNAL_ONLY
 // Enable fast string concatenation.
 #define RTL_FAST_STRING
 #endif
-#endif
 
 // The unittest uses slightly different code to help check that the proper
 // calls are made. The class is put into a different namespace to make
diff --git a/mysqlc/Library_mysqlc.mk b/mysqlc/Library_mysqlc.mk
index 656b5dc..bc26eaf 100644
--- a/mysqlc/Library_mysqlc.mk
+++ b/mysqlc/Library_mysqlc.mk
@@ -9,8 +9,6 @@
 
 $(eval $(call gb_Library_Library,mysqlc))
 
-$(eval $(call gb_Library_add_cxxflags,mysqlc,-DRTL_DISABLE_FAST_STRING))
-
 $(eval $(call gb_Library_use_externals,mysqlc,\
 	boost_headers \
 	mysqlcppconn \
@@ -59,4 +57,6 @@ $(eval $(call gb_Library_add_exception_objects,mysqlc,\
 
 $(eval $(call gb_Library_set_componentfile,mysqlc,mysqlc/source/mysqlc))
 
+$(eval $(call gb_Library_set_external_code,mysqlc))
+
 # vim: set noet sw=4 ts=4:
diff --git a/odk/CppunitTest_odk_checkapi.mk b/odk/CppunitTest_odk_checkapi.mk
index 8d2bf2f..3c45814 100644
--- a/odk/CppunitTest_odk_checkapi.mk
+++ b/odk/CppunitTest_odk_checkapi.mk
@@ -26,7 +26,6 @@ $(eval $(call gb_CppunitTest_use_internal_comprehensive_api,odk_checkapi,\
 $(eval $(call gb_CppunitTest_disable_compiler_plugins,odk_checkapi))
 
 $(eval $(call gb_CppunitTest_add_cxxflags,odk_checkapi,\
-	$(gb_CXXFLAGS_Wundef) \
 	$(gb_CXX03FLAGS) \
 ))
 
@@ -38,4 +37,6 @@ $(eval $(call gb_CppunitTest_use_libraries,odk_checkapi,\
 	$(gb_UWINAPI) \
 ))
 
+$(eval $(call gb_CppunitTest_set_external_code,odk_checkapi))
+
 # vim: set noet sw=4 ts=4:
diff --git a/odk/qa/checkapi/checkapi.cxx b/odk/qa/checkapi/checkapi.cxx
index 67e11c6..c76b4fe 100644
--- a/odk/qa/checkapi/checkapi.cxx
+++ b/odk/qa/checkapi/checkapi.cxx
@@ -8,7 +8,9 @@
  */
 
 // Acts as if building outside of LO.
-#undef LIBO_INTERNAL_ONLY
+#ifdef LIBO_INTERNAL_ONLY
+#error Build system problem, LIBO_INTERNAL_ONLY should not be set here.
+#endif
 
 // The whole purpose of this test is to check that public API headers
 // build even without RTL_USING (which enables using e.g. rtl::OUString
@@ -17,7 +19,7 @@
 // for uses of such types.
 
 #ifdef RTL_USING
-#error Build system problem, RTL_USING using should not be set here.
+#error Build system problem, RTL_USING should not be set here.
 #endif
 
 // Additionally, check that public API headers build also with C++03.
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index 47f1110..dd535ae7 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -385,6 +385,7 @@ $(eval $(foreach method,\
 	use_custom_headers \
 	set_visibility_default \
 	set_warnings_not_errors \
+	set_external_code \
 	set_generated_cxx_suffix \
 	disable_compiler_plugins \
 ,\
diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk
index 83298ad..d45e2dc 100644
--- a/solenv/gbuild/Executable.mk
+++ b/solenv/gbuild/Executable.mk
@@ -138,6 +138,7 @@ $(eval $(foreach method,\
 	set_precompiled_header \
 	add_nativeres \
 	set_warnings_not_errors \
+	set_external_code \
 	set_generated_cxx_suffix \
 	disable_compiler_plugins \
 ,\
diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk
index 17135e5..c66b57c 100644
--- a/solenv/gbuild/Library.mk
+++ b/solenv/gbuild/Library.mk
@@ -223,6 +223,7 @@ $(eval $(foreach method,\
 	set_nativeres \
 	set_visibility_default \
 	set_warnings_not_errors \
+	set_external_code \
 	set_generated_cxx_suffix \
 	disable_compiler_plugins \
 ,\
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index 948f656..104c5b6 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -615,6 +615,7 @@ $(call gb_LinkTarget_get_target,$(1)) : EXTRAOBJECTLISTS :=
 $(call gb_LinkTarget_get_target,$(1)) : NATIVERES :=
 $(call gb_LinkTarget_get_target,$(1)) : VISIBILITY :=
 $(call gb_LinkTarget_get_target,$(1)) : WARNINGS_NOT_ERRORS :=
+$(call gb_LinkTarget_get_target,$(1)) : EXTERNAL_CODE :=
 $(call gb_LinkTarget_get_target,$(1)) : SOVERSIONSCRIPT :=
 $(call gb_LinkTarget_get_target,$(1)) : T_COMPILER_PLUGINS := $$(COMPILER_PLUGINS)
 
@@ -1369,6 +1370,12 @@ $(call gb_LinkTarget_get_target,$(1)) : WARNINGS_NOT_ERRORS := $(true)
 
 endef
 
+# call gb_LinkTarget_set_external_code,linktarget
+define gb_LinkTarget_set_external_code
+$(call gb_LinkTarget_get_target,$(1)) : EXTERNAL_CODE := $(true)
+
+endef
+
 # Set suffix of C++ files, if different from 'cxx'
 #
 # This is useful for external libraries.
diff --git a/solenv/gbuild/StaticLibrary.mk b/solenv/gbuild/StaticLibrary.mk
index a78a781..a6e0795 100644
--- a/solenv/gbuild/StaticLibrary.mk
+++ b/solenv/gbuild/StaticLibrary.mk
@@ -110,6 +110,7 @@ $(eval $(foreach method,\
 	add_sdi_headers \
 	set_precompiled_header \
 	set_warnings_not_errors \
+	set_external_code \
 	set_generated_cxx_suffix \
 	disable_compiler_plugins \
 ,\
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index fbf13fe..3d1f0f1 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -210,13 +210,6 @@ gb_GLOBALDEFS := \
 	$(gb_COMPILERDEFS) \
 	$(gb_CPUDEFS) \
 
-# This is used to detect whether LibreOffice is being built (as opposed to building
-# 3rd-party code). Used for tag deprecation for API we want to
-# ensure is not used at all externally while we clean
-# out our internal usage, for code in sal/ that should be used only internally, etc.
-gb_GLOBALDEFS += \
-	-DLIBO_INTERNAL_ONLY \
-
 ifeq ($(gb_ENABLE_DBGUTIL),$(true))
 gb_GLOBALDEFS += -DDBG_UTIL
 
@@ -268,6 +261,13 @@ gb_GLOBALDEFS += \
 
 gb_GLOBALDEFS := $(sort $(gb_GLOBALDEFS))
 
+# This is used to detect whether LibreOffice is being built (as opposed to building
+# 3rd-party code). Used for tag deprecation for API we want to
+# ensure is not used at all externally while we clean
+# out our internal usage, for code in sal/ that should be used only internally, etc.
+gb_DEFS_INTERNAL := \
+	-DLIBO_INTERNAL_ONLY \
+
 include $(GBUILDDIR)/Deliver.mk
 
 $(eval $(call gb_Deliver_init))
diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk
index c7bf4b7..59678bb 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -54,6 +54,7 @@ $(call gb_Helper_abbreviate_dirs,\
 		$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
 		$(if $(5),$(gb_COMPILER_PLUGINS)) \
 		$(2) \
+		$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
 		-c $(3) \
 		-o $(1) \
 		$(call gb_cxx_dep_generation_options,$(1),$(4)) \
@@ -77,6 +78,7 @@ $(call gb_Helper_abbreviate_dirs,\
 		$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
 		$(gb_COMPILER_PLUGINS) \
 		$(T_CFLAGS) $(T_CFLAGS_APPEND) \
+		$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
 		-c $(2) \
 		-I$(dir $(2)) \
 		$(INCLUDE) \
@@ -93,6 +95,7 @@ $(call gb_Helper_abbreviate_dirs,\
 		$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
 		$(gb_COMPILER_PLUGINS) \
 		$(T_OBJCFLAGS) $(T_OBJCFLAGS_APPEND) \
+		$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
 		-c $(2) \
 		-I$(dir $(2)) \
 		$(INCLUDE) \
@@ -112,6 +115,7 @@ $(call gb_Helper_abbreviate_dirs,\
 		$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
 		$(gb_COMPILER_PLUGINS) \
 		$(T_CXXFLAGS) $(T_CXXFLAGS_APPEND) \
+		$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
 		-c $(2) \
 		-I$(dir $(2)) \
 		$(INCLUDE) \
@@ -128,6 +132,7 @@ $(call gb_Helper_abbreviate_dirs,\
 		$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
 		$(gb_COMPILER_PLUGINS) \
 		$(T_OBJCXXFLAGS) $(T_OBJCXXFLAGS_APPEND) \
+		$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
 		-c $(2) \
 		-I$(dir $(2)) \
 		$(INCLUDE) \
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index 7d220c5..92b6e2b 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -42,6 +42,7 @@ $(call gb_Helper_abbreviate_dirs,\
 	$(if $(filter YES,$(CXXOBJECT_X64)), $(CXX_X64_BINARY), \
 		$(if $(filter %.c,$(3)), $(gb_CC), $(gb_CXX))) \
 		$(DEFS) \
+		$(if $(EXTERNAL_CODE),,$(gb_DEFS_INTERNAL)) \
 		$(gb_LTOFLAGS) \
 		$(2) \
 		$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \


More information about the Libreoffice-commits mailing list