diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-02-24 16:51:31 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-02-25 09:05:09 +0100 |
commit | c47496fdf9f0ec396f15fb9ddde6bd8d244a1797 (patch) | |
tree | 739b259a6d79e53ddfc673c5c7d40ebc4c634387 | |
parent | 9d17966632a8e756c26b6569ff5e282a719a1ac1 (diff) |
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
-rw-r--r-- | include/vcl/unohelp.hxx | 1 | ||||
-rw-r--r-- | sd/source/ui/dlg/sdabstdlg.cxx | 4 | ||||
-rw-r--r-- | solenv/gbuild/Helper.mk | 9 | ||||
-rw-r--r-- | solenv/gbuild/gbuild.mk | 2 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_GCC_defs.mk | 5 | ||||
-rw-r--r-- | solenv/gbuild/platform/com_MSC_defs.mk | 5 | ||||
-rw-r--r-- | sw/source/ui/dialog/swabstdlg.cxx | 4 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 10 | ||||
-rw-r--r-- | vcl/Library_vcl.mk | 8 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 10 | ||||
-rw-r--r-- | vcl/source/app/unohelp.cxx | 31 | ||||
-rw-r--r-- | vcl/source/window/abstdlg.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/builder.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/plugadapt/salplug.cxx | 18 |
14 files changed, 31 insertions, 81 deletions
diff --git a/include/vcl/unohelp.hxx b/include/vcl/unohelp.hxx index 3368856e651f..c1496928c8f4 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 cc57f68fc360..fc83a93248b5 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 93ff03ef5737..a1a29f745341 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 8c0f8b420c74..a864eb8c0811 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 986ef39d3bc5..93d3fe75d3f3 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 0779b02d6e6f..67d2b6bfb56a 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 dc459a802fd3..8cf41aa5604d 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 d17a8efb0aaf..bfa45a8c47bc 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 ff915330308f..3cdd784209df 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 3abd61839acb..123a0f505db3 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 24f40a2ddd92..356a4650d037 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 7cb7cdcd5cdc..5cdb7575579a 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 c845d8cf4d7e..79b84d5de454 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 56d9fe525560..0fd81dc9ac18 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 ); |