Kaydet (Commit) c47496fd authored tarafından Matúš Kukan's avatar Matúš Kukan

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
üst 9d179666
......@@ -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
......
......@@ -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" );
......
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -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 \
......
......@@ -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*)() )
......
......@@ -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 )
......
......@@ -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,\
......
......@@ -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 )
......
......@@ -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 );
......
......@@ -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") );
......
......@@ -1551,9 +1551,7 @@ 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
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment