[Libreoffice-commits] core.git: 3 commits - include/vcl sd/source solenv/gbuild sw/source toolkit/source vcl/Library_vcl.mk vcl/source vcl/unx
Matúš Kukan
matus.kukan at collabora.com
Tue Feb 25 00:06:12 PST 2014
include/vcl/unohelp.hxx | 1
sd/source/ui/dlg/sdabstdlg.cxx | 4 -
solenv/gbuild/Helper.mk | 16 ++++++
solenv/gbuild/LinkTarget.mk | 52 +++++++++-------------
solenv/gbuild/gbuild.mk | 2
solenv/gbuild/platform/com_GCC_class.mk | 75 ++------------------------------
solenv/gbuild/platform/com_GCC_defs.mk | 10 ----
solenv/gbuild/platform/com_MSC_class.mk | 40 ++---------------
solenv/gbuild/platform/com_MSC_defs.mk | 10 ----
solenv/gbuild/platform/macosx.mk | 7 --
solenv/gbuild/platform/solaris.mk | 9 +--
solenv/gbuild/platform/unxgcc.mk | 7 --
sw/source/ui/dialog/swabstdlg.cxx | 4 -
toolkit/source/awt/vclxtoolkit.cxx | 10 +---
vcl/Library_vcl.mk | 8 ---
vcl/source/app/svapp.cxx | 10 +---
vcl/source/app/unohelp.cxx | 31 -------------
vcl/source/window/abstdlg.cxx | 3 -
vcl/source/window/builder.cxx | 2
vcl/unx/generic/plugadapt/salplug.cxx | 18 +++----
20 files changed, 81 insertions(+), 238 deletions(-)
New commits:
commit c47496fdf9f0ec396f15fb9ddde6bd8d244a1797
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Mon Feb 24 16:51:31 2014 +0100
Add config_libraries.h definitions to get library names easily.
Works for libmerged too, so we can get rid of LIBO_MERGELIBS.
And remove few more #defines in vcl.
It's generated by gbuild, so probably abusing config_host directory.
Open to improvements.
Change-Id: I87ab109bf109e42751766011daf076e9cdf8f5ee
diff --git a/include/vcl/unohelp.hxx b/include/vcl/unohelp.hxx
index 3368856..c149692 100644
--- a/include/vcl/unohelp.hxx
+++ b/include/vcl/unohelp.hxx
@@ -52,7 +52,6 @@ namespace unohelper
{
VCL_DLLPUBLIC ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > CreateBreakIterator();
VCL_DLLPUBLIC ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XCharacterClassification> CreateCharacterClassification();
-VCL_DLLPUBLIC OUString CreateLibraryName( const sal_Char* pModName, bool bSUPD );
VCL_DLLPUBLIC void NotifyAccessibleStateEventGlobally( const ::com::sun::star::accessibility::AccessibleEventObject& rEventObject );
}} // namespace vcl::unohelper
diff --git a/sd/source/ui/dlg/sdabstdlg.cxx b/sd/source/ui/dlg/sdabstdlg.cxx
index cc57f68..fc83a93 100644
--- a/sd/source/ui/dlg/sdabstdlg.cxx
+++ b/sd/source/ui/dlg/sdabstdlg.cxx
@@ -18,12 +18,12 @@
*/
#include <config_features.h>
+#include <config_libraries.h>
#include "sdabstdlg.hxx"
#include <osl/module.hxx>
#include <rtl/ustring.hxx>
-#include <vcl/unohelp.hxx>
typedef SdAbstractDialogFactory* (SAL_CALL *SdFuncPtrCreateDialogFactory)();
@@ -43,7 +43,7 @@ SdAbstractDialogFactory* SdAbstractDialogFactory::Create()
#if HAVE_FEATURE_DESKTOP
#ifndef DISABLE_DYNLOADING
static ::osl::Module aDialogLibrary;
- static const OUString sLibName(::vcl::unohelper::CreateLibraryName("sdui", true));
+ static const OUString sLibName(LIBO_LIBRARY(sdui));
if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, sLibName ) )
fp = ( SdAbstractDialogFactory* (SAL_CALL*)() )
aDialogLibrary.getFunctionSymbol( "SdCreateDialogFactory" );
diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk
index 93ff03e..a1a29f7 100644
--- a/solenv/gbuild/Helper.mk
+++ b/solenv/gbuild/Helper.mk
@@ -204,6 +204,15 @@ else mv $(1) $(2) $(if $(3),&& touch -r $(3) $(2)); \
fi
endef
+define gb_Helper_generate_config_libraries
+$(shell FILE=$(BUILDDIR)/config_$(gb_Side)/config_libraries.h && \
+printf "// This file is generated by gbuild: gb_Helper_generate_config_libraries.\n\n" >> $$FILE.tmp && \
+$(foreach lib,$(gb_Library_KNOWNLIBS), \
+ printf "#define LIBO_LIB_$(subst -,_,$(lib)) \"$(call gb_Library_get_runtime_filename,$(call gb_Library__get_name,$(lib)))\"\n" >> $$FILE.tmp &&) \
+printf "\n#define LIBO_LIBRARY(name) LIBO_LIB_##name\n" >> $$FILE.tmp && \
+$(call gb_Helper_replace_if_different_and_touch,$$FILE.tmp,$$FILE))
+endef
+
define gb_Helper_define_if_set
$(foreach def,$(1),$(if $(filter TRUE YES,$($(def))),-D$(def)))
endef
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 8c0f8b4..a864eb8 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -326,6 +326,8 @@ include $(foreach class, \
$(eval $(call gb_Helper_process_executable_registrations))
$(eval $(call gb_Postprocess_make_targets))
+$(eval $(call gb_Helper_generate_config_libraries))
+
# optional extensions that should never be essential
ifneq ($(wildcard $(GBUILDDIR)/extensions/post_*.mk),)
include $(wildcard $(GBUILDDIR)/extensions/post_*.mk)
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index 986ef39..93d3fe7 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -94,11 +94,6 @@ endif
gb_CFLAGS_WERROR := $(if $(ENABLE_WERROR),-Werror)
-ifneq ($(MERGELIBS),)
-gb_CFLAGS_COMMON += -DLIBO_MERGELIBS
-gb_CXXFLAGS_COMMON += -DLIBO_MERGELIBS
-endif
-
ifeq ($(ENABLE_LTO),TRUE)
ifeq ($(COM_GCC_IS_CLANG),TRUE)
gb_LTOFLAGS := -flto
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index 0779b02..67d2b6b 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -246,11 +246,6 @@ gb_STDLIBS := \
gb_CFLAGS_WERROR := $(if $(ENABLE_WERROR),-WX)
-ifneq ($(MERGELIBS),)
-gb_CFLAGS += -DLIBO_MERGELIBS
-gb_CXXFLAGS += -DLIBO_MERGELIBS
-endif
-
gb_LinkTarget_EXCEPTIONFLAGS := \
-DEXCEPTIONS_ON \
-EHa \
diff --git a/sw/source/ui/dialog/swabstdlg.cxx b/sw/source/ui/dialog/swabstdlg.cxx
index dc459a8..8cf41aa 100644
--- a/sw/source/ui/dialog/swabstdlg.cxx
+++ b/sw/source/ui/dialog/swabstdlg.cxx
@@ -18,11 +18,11 @@
*/
#include <config_features.h>
+#include <config_libraries.h>
#include "swabstdlg.hxx"
#include <osl/module.hxx>
-#include <vcl/unohelp.hxx>
typedef SwAbstractDialogFactory* (SAL_CALL *SwFuncPtrCreateDialogFactory)();
@@ -42,7 +42,7 @@ SwAbstractDialogFactory* SwAbstractDialogFactory::Create()
#if HAVE_FEATURE_DESKTOP
#ifndef DISABLE_DYNLOADING
static ::osl::Module aDialogLibrary;
- static const OUString sLibName(::vcl::unohelper::CreateLibraryName("swui", true));
+ static const OUString sLibName(LIBO_LIBRARY(swui));
if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, sLibName,
SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) )
fp = ( SwAbstractDialogFactory* (SAL_CALL*)() )
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index d17a8ef..bfa45a8 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_libraries.h>
+
#include <boost/ptr_container/ptr_vector.hpp>
#include <stdio.h>
@@ -1230,13 +1232,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
)
{
#ifndef DISABLE_DYNLOADING
- OUString aLibName = ::vcl::unohelper::CreateLibraryName(
-#ifdef LIBO_MERGELIBS
- "merged",
-#else
- "svt",
-#endif
- true );
+ OUString aLibName(LIBO_LIBRARY(svt));
hSvToolsLib = osl_loadModuleRelative(
&thisModule, aLibName.pData, SAL_LOADMODULE_DEFAULT );
if ( hSvToolsLib )
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index ff91533..3cdd784 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -45,8 +45,6 @@ $(eval $(call gb_Library_set_include,vcl,\
$(eval $(call gb_Library_add_defs,vcl,\
-DVCL_DLLIMPLEMENTATION \
- -DCUI_DLL_NAME=\"$(call gb_Library_get_runtime_filename,cui)\" \
- -DDLLPOSTFIX=$(gb_Library_DLLPOSTFIX) \
))
$(eval $(call gb_Library_use_sdk_api,vcl))
@@ -491,8 +489,6 @@ vcl_headless_freetype_code=\
ifeq ($(GUIBASE),unx)
$(eval $(call gb_Library_add_defs,vcl,\
- -DSAL_DLLPREFIX=\"$(gb_Library_SYSPRE)\" \
- -DSAL_DLLPOSTFIX=\"$(gb_Library_OOOEXT)\" \
-D_XSALSET_LIBNAME=\"$(call gb_Library_get_runtime_filename,spa)\" \
))
$(eval $(call gb_Library_add_exception_objects,vcl,\
@@ -518,8 +514,6 @@ endif
ifeq ($(ENABLE_HEADLESS),TRUE)
$(eval $(call gb_Library_add_defs,vcl,\
- -DSAL_DLLPREFIX=\"$(gb_Library_SYSPRE)\" \
- -DSAL_DLLPOSTFIX=\"$(gb_Library_OOOEXT)\" \
-D_XSALSET_LIBNAME=\"$(call gb_Library_get_runtime_filename,spa)\" \
))
$(eval $(call gb_Library_add_exception_objects,vcl,\
@@ -549,8 +543,6 @@ $(eval $(call gb_Library_add_libs,vcl,\
-llo-bootstrap \
))
$(eval $(call gb_Library_add_defs,vcl,\
- -DSAL_DLLPREFIX=\"$(gb_Library_SYSPRE)\" \
- -DSAL_DLLPOSTFIX=\"$(gb_Library_OOOEXT)\" \
-D_XSALSET_LIBNAME=\"$(call gb_Library_get_runtime_filename,spa)\" \
))
$(eval $(call gb_Library_add_exception_objects,vcl,\
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 3abd618..123a0f5 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_libraries.h>
+
#include "comphelper/processfactory.hxx"
#include "osl/module.h"
@@ -1416,13 +1418,7 @@ UnoWrapperBase* Application::GetUnoWrapper( bool bCreateIfNotExist )
if ( !pSVData->mpUnoWrapper && bCreateIfNotExist && !bAlreadyTriedToCreate )
{
#ifndef DISABLE_DYNLOADING
- OUString aLibName = ::vcl::unohelper::CreateLibraryName(
-#ifdef LIBO_MERGELIBS
- "merged",
-#else
- "tk",
-#endif
- true );
+ OUString aLibName(LIBO_LIBRARY(tk));
oslModule hTkLib = osl_loadModuleRelative(
&thisModule, aLibName.pData, SAL_LOADMODULE_DEFAULT );
if ( hTkLib )
diff --git a/vcl/source/app/unohelp.cxx b/vcl/source/app/unohelp.cxx
index 24f40a2..356a465 100644
--- a/vcl/source/app/unohelp.cxx
+++ b/vcl/source/app/unohelp.cxx
@@ -45,37 +45,6 @@ uno::Reference < i18n::XCharacterClassification > vcl::unohelper::CreateCharacte
return i18n::CharacterClassification::create( comphelper::getProcessComponentContext() );
}
-OUString vcl::unohelper::CreateLibraryName( const sal_Char* pModName, bool bSUPD )
-{
- // create variable library name suffixes
- OUString aDLLSuffix = OUString::createFromAscii( SAL_STRINGIFY( DLLPOSTFIX ) );
-
- OUString aLibName;
-
-#if defined( WNT)
- aLibName = OUString::createFromAscii( pModName );
- if ( bSUPD )
- {
- aLibName += aDLLSuffix;
- }
- aLibName += ".dll";
-#else
- aLibName = "lib";
- aLibName += OUString::createFromAscii( pModName );
- if ( bSUPD )
- {
- aLibName += aDLLSuffix;
- }
-#ifdef MACOSX
- aLibName += ".dylib";
-#else
- aLibName += ".so";
-#endif
-#endif
-
- return aLibName;
-}
-
void vcl::unohelper::NotifyAccessibleStateEventGlobally( const ::com::sun::star::accessibility::AccessibleEventObject& rEventObject )
{
::com::sun::star::uno::Reference< ::com::sun::star::awt::XExtendedToolkit > xExtToolkit( Application::GetVCLToolkit(), uno::UNO_QUERY );
diff --git a/vcl/source/window/abstdlg.cxx b/vcl/source/window/abstdlg.cxx
index 7cb7cdc..5cdb757 100644
--- a/vcl/source/window/abstdlg.cxx
+++ b/vcl/source/window/abstdlg.cxx
@@ -18,6 +18,7 @@
*/
#include <config_features.h>
+#include <config_libraries.h>
#include <rtl/ustring.hxx>
#include <osl/module.hxx>
@@ -37,7 +38,7 @@ VclAbstractDialogFactory* VclAbstractDialogFactory::Create()
#if HAVE_FEATURE_DESKTOP
#ifndef DISABLE_DYNLOADING
static ::osl::Module aDialogLibrary;
- if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, OUString( CUI_DLL_NAME ),
+ if ( aDialogLibrary.is() || aDialogLibrary.loadRelative( &thisModule, LIBO_LIBRARY(cui),
SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY ) )
fp = ( VclAbstractDialogFactory* (SAL_CALL*)() )
aDialogLibrary.getFunctionSymbol( OUString("CreateDialogFactory") );
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index c845d8c..79b84d5 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1551,10 +1551,8 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
sModuleBuf.append(SAL_DLLPREFIX);
#endif
sModuleBuf.append(OStringToOUString(name.copy(0, nDelim), RTL_TEXTENCODING_UTF8));
-#ifdef SAL_DLLEXTENSION
sModuleBuf.append(SAL_DLLEXTENSION);
#endif
-#endif
OUString sFunction(OStringToOUString(OString("make") + name.copy(nDelim+1), RTL_TEXTENCODING_UTF8));
#ifndef DISABLE_DYNLOADING
OUString sModule = sModuleBuf.makeStringAndClear();
diff --git a/vcl/unx/generic/plugadapt/salplug.cxx b/vcl/unx/generic/plugadapt/salplug.cxx
index 56d9fe5..0fd81dc 100644
--- a/vcl/unx/generic/plugadapt/salplug.cxx
+++ b/vcl/unx/generic/plugadapt/salplug.cxx
@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <config_libraries.h>
+
#include "osl/module.h"
#include "osl/process.h"
@@ -49,7 +51,11 @@ static SalInstance* tryInstance( const OUString& rModuleBase, bool bForce = fals
{
return NULL;
}
- OUString aModule(SAL_DLLPREFIX "vclplug_" + rModuleBase + SAL_DLLPOSTFIX);
+ OUString aModule(
+#ifdef SAL_DLLPREFIX
+ SAL_DLLPREFIX
+#endif
+ "vclplug_" + rModuleBase + "lo" SAL_DLLEXTENSION );
oslModule aMod = osl_loadModuleRelative(
reinterpret_cast< oslGenericFunction >( &tryInstance ), aModule.pData,
@@ -111,15 +117,7 @@ static SalInstance* tryInstance( const OUString& rModuleBase, bool bForce = fals
static DesktopType get_desktop_environment()
{
- OUString aModule(
- SAL_DLLPREFIX
-#if defined LIBO_MERGELIBS
- "merged"
-#else
- "desktop_detector"
-#endif
- SAL_DLLPOSTFIX);
-
+ OUString aModule(LIBO_LIBRARY(desktop_detector));
oslModule aMod = osl_loadModuleRelative(
reinterpret_cast< oslGenericFunction >( &tryInstance ), aModule.pData,
SAL_LOADMODULE_DEFAULT );
commit 9d17966632a8e756c26b6569ff5e282a719a1ac1
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Mon Feb 24 12:02:33 2014 +0100
gbuild: deduplicate by new gb_Helper_replace_if_different_and_touch
Change-Id: I98767944a74c2b6d90425e0232c40e20c8a6885a
diff --git a/solenv/gbuild/Helper.mk b/solenv/gbuild/Helper.mk
index 0c0c3b2..93ff03e 100644
--- a/solenv/gbuild/Helper.mk
+++ b/solenv/gbuild/Helper.mk
@@ -197,6 +197,13 @@ gb_Package_MODULE_$(1) += $(2)
endef
+# call gb_Helper_replace_if_different_and_touch,source,target,optional-touch-reference-file
+define gb_Helper_replace_if_different_and_touch
+if cmp -s $(1) $(2); then rm $(1); \
+else mv $(1) $(2) $(if $(3),&& touch -r $(3) $(2)); \
+fi
+endef
+
define gb_Helper_define_if_set
$(foreach def,$(1),$(if $(filter TRUE YES,$($(def))),-D$(def)))
endef
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index e0fa5b5..6a77d20 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -189,11 +189,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(filter YES,$(LIBRARY_X64)),$(LINK_X64_BINARY),$(gb_LINK)) \
-dump -exports $(ILIBTARGET) \
>> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \
- if cmp -s $(WORKDIR)/LinkTarget/$(2).exports.tmp $(WORKDIR)/LinkTarget/$(2).exports; \
- then rm $(WORKDIR)/LinkTarget/$(2).exports.tmp; \
- else mv $(WORKDIR)/LinkTarget/$(2).exports.tmp $(WORKDIR)/LinkTarget/$(2).exports && \
- touch -r $(1) $(WORKDIR)/LinkTarget/$(2).exports; \
- fi) \
+ $(call gb_Helper_replace_if_different_and_touch,$(WORKDIR)/LinkTarget/$(2).exports.tmp,$(WORKDIR)/LinkTarget/$(2).exports,$(1)) \
; exit $$RC)
endef
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index 96624b8..5eac8ba 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -158,11 +158,8 @@ $(call gb_Helper_abbreviate_dirs,\
> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \
$(NM) -g -P $(1) | cut -d' ' -f1-2 | grep -v U$$ \
>> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \
- if cmp -s $(WORKDIR)/LinkTarget/$(2).exports.tmp $(WORKDIR)/LinkTarget/$(2).exports; \
- then rm $(WORKDIR)/LinkTarget/$(2).exports.tmp; \
- else mv $(WORKDIR)/LinkTarget/$(2).exports.tmp $(WORKDIR)/LinkTarget/$(2).exports && \
- touch -r $(1) $(WORKDIR)/LinkTarget/$(2).exports; \
- fi &&) \
+ $(call gb_Helper_replace_if_different_and_touch,$(WORKDIR)/LinkTarget/$(2).exports.tmp, \
+ $(WORKDIR)/LinkTarget/$(2).exports,$(1)) &&) \
:)
endef
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk
index 7f1ce40..6122190 100644
--- a/solenv/gbuild/platform/solaris.mk
+++ b/solenv/gbuild/platform/solaris.mk
@@ -186,11 +186,8 @@ $(call gb_Helper_abbreviate_dirs,\
$(NM) --dynamic --extern-only --defined-only --format=posix $(1) \
| cut -d' ' -f1-2 \
>> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \
- if cmp -s $(WORKDIR)/LinkTarget/$(2).exports.tmp $(WORKDIR)/LinkTarget/$(2).exports; \
- then rm $(WORKDIR)/LinkTarget/$(2).exports.tmp; \
- else mv $(WORKDIR)/LinkTarget/$(2).exports.tmp $(WORKDIR)/LinkTarget/$(2).exports && \
- touch -r $(1) $(WORKDIR)/LinkTarget/$(2).exports; \
- fi))
+ $(call gb_Helper_replace_if_different_and_touch,$(WORKDIR)/LinkTarget/$(2).exports.tmp, \
+ $(WORKDIR)/LinkTarget/$(2).exports,$(1))))
endef
define gb_LinkTarget__command_staticlink
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 86be406..17a6a03 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -187,11 +187,8 @@ $(call gb_Helper_abbreviate_dirs,\
$(NM) --dynamic --extern-only --defined-only --format=posix $(1) \
| cut -d' ' -f1-2 \
>> $(WORKDIR)/LinkTarget/$(2).exports.tmp && \
- if cmp -s $(WORKDIR)/LinkTarget/$(2).exports.tmp $(WORKDIR)/LinkTarget/$(2).exports; \
- then rm $(WORKDIR)/LinkTarget/$(2).exports.tmp; \
- else mv $(WORKDIR)/LinkTarget/$(2).exports.tmp $(WORKDIR)/LinkTarget/$(2).exports && \
- touch -r $(1) $(WORKDIR)/LinkTarget/$(2).exports; \
- fi))
+ $(call gb_Helper_replace_if_different_and_touch,$(WORKDIR)/LinkTarget/$(2).exports.tmp, \
+ $(WORKDIR)/LinkTarget/$(2).exports,$(1))))
endef
define gb_LinkTarget__command_staticlink
commit 8491c5c4f1a4e01796dab8ce41904cf6593bd038
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Mon Feb 24 10:02:43 2014 +0100
gbuild: one command for C/C++ objects
Change-Id: I835bd56123acfbfb53e0d3d86e5d66b929b3181f
diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk
index b7cd9c8..773aa3f 100644
--- a/solenv/gbuild/LinkTarget.mk
+++ b/solenv/gbuild/LinkTarget.mk
@@ -27,6 +27,15 @@
# OBJCXXFLAGS
# LDFLAGS
+# defined by platform
+# gb_AsmObject_get_source (.asm on Windows, .s elsewhere)
+# gb_AsmObject__command
+# gb_CObject__command_pattern
+# gb_LinkTarget_CXXFLAGS
+# gb_LinkTarget_LDFLAGS
+# gb_LinkTarget_INCLUDE
+# gb_YaccTarget__command(grammar-file, stem-for-message, source-target, include-target)
+
# enable if: no "-TARGET" defined AND [module is enabled OR "TARGET" defined]
gb_LinkTarget__debug_enabled = \
$(and $(if $(filter -$(1),$(ENABLE_DEBUGINFO_FOR)),,$(true)),\
@@ -120,15 +129,14 @@ endif
# CObject class
gb_CObject_get_source = $(1)/$(2).c
-# defined by platform
-# gb_CObject__command
ifneq ($(COMPILER_PLUGIN_TOOL),)
$(call gb_CObject_get_target,%) : $(call gb_CObject_get_source,$(SRCDIR),%) $(gb_FORCE_COMPILE_ALL_TARGET)
$(call gb_CObject__tool_command,$*,$<)
else
$(call gb_CObject_get_target,%) : $(call gb_CObject_get_source,$(SRCDIR),%)
- $(call gb_CObject__command,$@,$*,$<,$(call gb_CObject_get_dep_target,$*))
+ $(call gb_Output_announce,$*.c,$(true),C ,3)
+ $(call gb_CObject__command_pattern,$@,$(T_CFLAGS) $(T_CFLAGS_APPEND),$<,$(call gb_CObject_get_dep_target,$*))
endif
# Note: if the *Object_dep_target does not exist it will be created by
@@ -143,8 +151,6 @@ endif
# CxxObject class
gb_CxxObject_get_source = $(1)/$(2).cxx
-# defined by platform
-# gb_CxxObject__command
# Only enable PCH if the PCH_CXXFLAGS and the PCH_DEFS (from the linktarget)
# are the same as the T_CXXFLAGS and DEFS we want to use for this object. This
@@ -174,8 +180,9 @@ $(call gb_CxxObject_get_target,%) : $(call gb_CxxObject_get_source,$(SRCDIR),%)
$(call gb_CxxObject__tool_command,$*,$<)
else
$(call gb_CxxObject_get_target,%) : $(call gb_CxxObject_get_source,$(SRCDIR),%)
+ $(call gb_Output_announce,$*.cxx,$(true),CXX,3)
$(eval $(gb_CxxObject__set_pchflags))
- $(call gb_CxxObject__command,$@,$*,$<,$(call gb_CxxObject_get_dep_target,$*))
+ $(call gb_CObject__command_pattern,$@,$(T_CXXFLAGS) $(T_CXXFLAGS_APPEND),$<,$(call gb_CxxObject_get_dep_target,$*))
endif
ifeq ($(gb_FULLDEPS),$(true))
@@ -195,12 +202,11 @@ endif
# GenCObject class
gb_GenCObject_get_source = $(WORKDIR)/$(1).c
-# defined by platform
-# gb_CObject__command
$(call gb_GenCObject_get_target,%) :
+ $(call gb_Output_announce,$*.c,$(true),C ,3)
test -f $(call gb_GenCObject_get_source,$*) || (echo "Missing generated source file $(call gb_GenCObject_get_source,$*)" && false)
- $(call gb_CObject__command,$@,$*,$(call gb_GenCObject_get_source,$*),$(call gb_GenCObject_get_dep_target,$*))
+ $(call gb_CObject__command_pattern,$@,$(T_CFLAGS) $(T_CFLAGS_APPEND),$(call gb_GenCObject_get_source,$*),$(call gb_GenCObject_get_dep_target,$*))
ifeq ($(gb_FULLDEPS),$(true))
$(call gb_GenCObject_get_dep_target,%) :
@@ -212,13 +218,12 @@ endif
# GenCxxObject class
gb_GenCxxObject_get_source = $(WORKDIR)/$(1).$(gb_LinkTarget_CXX_SUFFIX_$(call gb_LinkTarget__get_workdir_linktargetname,$(2)))
-# defined by platform
-# gb_CxxObject__command
$(call gb_GenCxxObject_get_target,%) :
+ $(call gb_Output_announce,$*.cxx,$(true),CXX,3)
test -f $(GEN_CXX_SOURCE) || (echo "Missing generated source file $(GEN_CXX_SOURCE)" && false)
$(eval $(gb_CxxObject__set_pchflags))
- $(call gb_CxxObject__command,$@,$*,$(GEN_CXX_SOURCE),$(call gb_GenCxxObject_get_dep_target,$*))
+ $(call gb_CObject__command_pattern,$@,$(T_CXXFLAGS) $(T_CXXFLAGS_APPEND),$(GEN_CXX_SOURCE),$(call gb_GenCxxObject_get_dep_target,$*))
ifeq ($(gb_FULLDEPS),$(true))
$(call gb_GenCxxObject_get_dep_target,%) :
@@ -236,8 +241,6 @@ endif
# tries to use it.
gb_YaccTarget_get_source = $(1)/$(2).y
-# defined by platform
-# gb_YaccTarget__command(grammar-file, stem-for-message, source-target, include-target)
.PHONY : $(call gb_YaccTarget_get_clean_target,%)
$(call gb_YaccTarget_get_clean_target,%) :
@@ -293,8 +296,6 @@ endef
#
gb_ObjCxxObject_get_source = $(1)/$(2).mm
-# defined by platform
-# gb_ObjCxxObject__command
ifneq ($(COMPILER_PLUGIN_TOOL),)
$(call gb_ObjCxxObject_get_target,%) : $(call gb_ObjCxxObject_get_source,$(SRCDIR),%) $(gb_FORCE_COMPILE_ALL_TARGET)
@@ -302,7 +303,8 @@ $(call gb_ObjCxxObject_get_target,%) : $(call gb_ObjCxxObject_get_source,$(SRCDI
else
$(call gb_ObjCxxObject_get_target,%) : $(call gb_ObjCxxObject_get_source,$(SRCDIR),%)
- $(call gb_ObjCxxObject__command,$@,$*,$<,$(call gb_ObjCxxObject_get_dep_target,$*))
+ $(call gb_Output_announce,$*.mm,$(true),OCX,3)
+ $(call gb_CObject__command_pattern,$@,$(T_OBJCXXFLAGS) $(T_OBJCXXFLAGS_APPEND),$<,$(call gb_ObjCxxObject_get_dep_target,$*))
ifeq ($(gb_FULLDEPS),$(true))
$(call gb_ObjCxxObject_get_dep_target,%) :
@@ -316,8 +318,6 @@ endif
#
gb_ObjCObject_get_source = $(1)/$(2).m
-# defined by platform
-# gb_ObjCObject__command
ifneq ($(COMPILER_PLUGIN_TOOL),)
$(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),%) $(gb_FORCE_COMPILE_ALL_TARGET)
@@ -325,7 +325,8 @@ $(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),%
else
$(call gb_ObjCObject_get_target,%) : $(call gb_ObjCObject_get_source,$(SRCDIR),%)
- $(call gb_ObjCObject__command,$@,$*,$<,$(call gb_ObjCObject_get_dep_target,$*))
+ $(call gb_Output_announce,$*.m,$(true),OCC,3)
+ $(call gb_CObject__command_pattern,$@,$(T_OBJCFLAGS) $(T_OBJCFLAGS_APPEND),$<,$(call gb_ObjCObject_get_dep_target,$*))
ifeq ($(gb_FULLDEPS),$(true))
$(call gb_ObjCObject_get_dep_target,%) :
@@ -337,10 +338,6 @@ endif
# AsmObject class
-# defined by platform
-# gb_AsmObject_get_source (.asm on Windows, .s elsewhere)
-# gb_AsmObject__command
-
$(call gb_AsmObject_get_target,%) : $(call gb_AsmObject_get_source,$(SRCDIR),%)
$(call gb_AsmObject__command,$@,$*,$<,$(call gb_AsmObject_get_dep_target,$*))
@@ -365,11 +362,6 @@ define gb_LinkTarget_rtl_defs
$(if $(filter-out sal salhelper cppu cppuhelper odk, $(gb_Module_CURRENTMODULE_NAME)), -DRTL_USING)
endef
-# defined by platform
-# gb_LinkTarget_CXXFLAGS
-# gb_LinkTarget_LDFLAGS
-# gb_LinkTarget_INCLUDE
-
.PHONY : $(WORKDIR)/Clean/LinkTarget/%
$(WORKDIR)/Clean/LinkTarget/% :
$(call gb_Output_announce,$*,$(false),LNK,4)
@@ -1142,7 +1134,7 @@ endef
# call gb_LinkTarget_add_x64_generated_cobjects,linktarget,sourcefiles,cflags,linktargetmakefilename
define gb_LinkTarget_add_x64_generated_cobjects
$(foreach obj,$(2),$(call gb_LinkTarget_add_generated_c_object,$(1),$(obj),$(3),$(4)))
-$(foreach obj,$(2),$(eval $(call gb_GenCObject_get_target,$(obj)) : COBJECT_X64 := YES))
+$(foreach obj,$(2),$(eval $(call gb_GenCObject_get_target,$(obj)) : CXXOBJECT_X64 := YES))
endef
# call gb_LinkTarget_add_generated_cxxobjects,linktarget,sourcefiles,cxxflags,linktargetmakefilename
diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk
index 2308af8..c8cd30a 100644
--- a/solenv/gbuild/platform/com_GCC_class.mk
+++ b/solenv/gbuild/platform/com_GCC_class.mk
@@ -42,24 +42,24 @@ endef
# CObject class
-# $(call gb_CObject__command,object,relative-source,source,dep-file)
-define gb_CObject__command
-$(call gb_Output_announce,$(2).c,$(true),C ,3)
+# $(call gb_CObject__command_pattern,object,flags,source,dep-file)
+define gb_CObject__command_pattern
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \
$(if $(COMPILER_PLUGINS),$(gb_COMPILER_PLUGINS_SETUP)) \
- $(gb_CC) \
+ $(if $(filter %.c %.m,$(3)), $(gb_CC), $(gb_CXX)) \
$(DEFS) \
$(gb_LTOFLAGS) \
$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
$(if $(COMPILER_PLUGINS),$(gb_COMPILER_PLUGINS)) \
- $(T_CFLAGS) $(T_CFLAGS_APPEND) \
+ $(2) \
-c $(3) \
-o $(1) \
$(call gb_cxx_dep_generation_options,$(1),$(4)) \
-I$(dir $(3)) \
$(INCLUDE) \
+ $(PCHFLAGS) \
$(call gb_cxx_dep_copy,$(4)) \
)
endef
@@ -83,31 +83,6 @@ $(call gb_Helper_abbreviate_dirs,\
)
endef
-# CxxObject class
-
-# $(call gb_CxxObject__command,object,relative-source,source,dep-file)
-define gb_CxxObject__command
-$(call gb_Output_announce,$(2).cxx,$(true),CXX,3)
-$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) $(dir $(4)) && cd $(SRCDIR) && \
- $(if $(COMPILER_PLUGINS),$(gb_COMPILER_PLUGINS_SETUP)) \
- $(gb_CXX) \
- $(DEFS) \
- $(gb_LTOFLAGS) \
- $(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
- $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \
- $(if $(COMPILER_PLUGINS),$(gb_COMPILER_PLUGINS)) \
- $(T_CXXFLAGS) $(T_CXXFLAGS_APPEND) \
- -c $(3) \
- -o $(1) \
- $(call gb_cxx_dep_generation_options,$(1),$(4)) \
- -I$(dir $(3)) \
- $(INCLUDE) \
- $(PCHFLAGS) \
- $(call gb_cxx_dep_copy,$(4)) \
- )
-endef
-
# Used to run a compiler plugin tool.
# $(call gb_CxxObject__tool_command,relative-source,source)
define gb_CxxObject__tool_command
@@ -118,7 +93,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(DEFS) \
$(gb_LTOFLAGS) \
$(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
- $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \
+ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
$(gb_COMPILER_PLUGINS) \
$(T_CXXFLAGS) $(T_CXXFLAGS_APPEND) \
-c $(2) \
@@ -127,44 +102,6 @@ $(call gb_Helper_abbreviate_dirs,\
)
endef
-# ObjCxxObject class
-
-define gb_ObjCxxObject__command
-$(call gb_Output_announce,$(2).mm,$(true),OCX,3)
-$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) $(dir $(4)) && \
- $(gb_CXX) \
- $(DEFS) \
- $(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
- $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \
- $(T_OBJCXXFLAGS) $(T_OBJCXXFLAGS_APPEND) \
- -c $(3) \
- -o $(1) \
- -MMD -MT $(1) \
- -MP -MF $(4) \
- -I$(dir $(3)) \
- $(INCLUDE))
-endef
-
-# ObjCObject class
-
-define gb_ObjCObject__command
-$(call gb_Output_announce,$(2).m,$(true),OCC,3)
-$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) $(dir $(4)) && \
- $(gb_CC) \
- $(DEFS) \
- $(if $(VISIBILITY),,$(gb_VISIBILITY_FLAGS)) \
- $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
- $(T_OBJCFLAGS) $(T_OBJCFLAGS_APPEND) \
- -c $(3) \
- -o $(1) \
- -MMD -MT $(1) \
- -MP -MF $(4) \
- -I$(dir $(3)) \
- $(INCLUDE))
-endef
-
define gb_SrsPartTarget__command_dep
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(call gb_SrsPartTarget_get_dep_target,$(1))) && cd $(SRCDIR) && \
diff --git a/solenv/gbuild/platform/com_GCC_defs.mk b/solenv/gbuild/platform/com_GCC_defs.mk
index e4c105c..986ef39 100644
--- a/solenv/gbuild/platform/com_GCC_defs.mk
+++ b/solenv/gbuild/platform/com_GCC_defs.mk
@@ -92,10 +92,7 @@ gb_CXXFLAGS_COMMON += -fvisibility-inlines-hidden
endif
endif
-ifneq ($(ENABLE_WERROR),)
-gb_CFLAGS_WERROR := -Werror
-gb_CXXFLAGS_WERROR := -Werror
-endif
+gb_CFLAGS_WERROR := $(if $(ENABLE_WERROR),-Werror)
ifneq ($(MERGELIBS),)
gb_CFLAGS_COMMON += -DLIBO_MERGELIBS
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index 3341e35..e0fa5b5 100644
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -34,41 +34,18 @@ endef
# CObject class
-# $(call gb_CObject__command,object,relative-source,source,dep-file)
-define gb_CObject__command
-$(call gb_Output_announce,$(2).c,$(true),C ,3)
+# $(call gb_CObject__command_pattern,object,flags,source,dep-file)
+define gb_CObject__command_pattern
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) $(dir $(4)) && \
unset INCLUDE && \
- $(if $(filter YES,$(COBJECT_X64)), $(CXX_X64_BINARY), $(gb_CC)) \
+ $(if $(filter YES,$(CXXOBJECT_X64)), $(CXX_X64_BINARY), \
+ $(if $(filter %.c,$(3)), $(gb_CC), $(gb_CXX))) \
$(DEFS) \
$(gb_LTOFLAGS) \
- $(T_CFLAGS) $(T_CFLAGS_APPEND) \
+ $(2) \
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
-Fd$(PDBFILE) \
- $(gb_COMPILERDEPFLAGS) \
- -I$(dir $(3)) \
- $(INCLUDE) \
- $(if $(filter YES,$(COBJECT_X64)), -U_X86_ -D_AMD64_,) \
- -c $(3) \
- -Fo$(1)) $(call gb_create_deps,$(4),$(1),$(3))
-endef
-
-
-# CxxObject class
-
-# $(call gb_CxxObject__command,object,relative-source,source,dep-file)
-define gb_CxxObject__command
-$(call gb_Output_announce,$(2).cxx,$(true),CXX,3)
-$(call gb_Helper_abbreviate_dirs,\
- mkdir -p $(dir $(1)) $(dir $(4)) && \
- unset INCLUDE && \
- $(if $(filter YES,$(CXXOBJECT_X64)), $(CXX_X64_BINARY), $(gb_CXX)) \
- $(DEFS) \
- $(gb_LTOFLAGS) \
- $(T_CXXFLAGS) $(T_CXXFLAGS_APPEND) \
- $(if $(WARNINGS_NOT_ERRORS),,$(gb_CXXFLAGS_WERROR)) \
- -Fd$(PDBFILE) \
$(PCHFLAGS) \
$(gb_COMPILERDEPFLAGS) \
-I$(dir $(3)) \
@@ -78,7 +55,6 @@ $(call gb_Helper_abbreviate_dirs,\
-Fo$(1)) $(call gb_create_deps,$(4),$(1),$(3))
endef
-
# PrecompiledHeader class
# Note: MSVC has a race condition when dealing with .pdb files, that can result in error C1033 when
diff --git a/solenv/gbuild/platform/com_MSC_defs.mk b/solenv/gbuild/platform/com_MSC_defs.mk
index 9f050e9..0779b02 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -244,10 +244,7 @@ gb_PCHWARNINGS = \
gb_STDLIBS := \
advapi32.lib \
-ifneq ($(ENABLE_WERROR),)
-gb_CFLAGS_WERROR := -WX
-gb_CXXFLAGS_WERROR := -WX
-endif
+gb_CFLAGS_WERROR := $(if $(ENABLE_WERROR),-WX)
ifneq ($(MERGELIBS),)
gb_CFLAGS += -DLIBO_MERGELIBS
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk
index 68e5020..7f1ce40 100644
--- a/solenv/gbuild/platform/solaris.mk
+++ b/solenv/gbuild/platform/solaris.mk
@@ -149,7 +149,7 @@ gb_LinkTarget__RPATHS := \
NONE:\dORIGIN/../Library \
gb_LinkTarget_CFLAGS := $(gb_CFLAGS) $(gb_CFLAGS_WERROR)
-gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CXXFLAGS_WERROR)
+gb_LinkTarget_CXXFLAGS := $(gb_CXXFLAGS) $(gb_CFLAGS_WERROR)
ifeq ($(gb_SYMBOL),$(true))
gb_LinkTarget_CXXFLAGS += -ggdb2
More information about the Libreoffice-commits
mailing list