1*cdf0e10cSrcweir#************************************************************************* 2*cdf0e10cSrcweir# 3*cdf0e10cSrcweir# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir# 5*cdf0e10cSrcweir# Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir# 7*cdf0e10cSrcweir# OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir# 9*cdf0e10cSrcweir# This file is part of OpenOffice.org. 10*cdf0e10cSrcweir# 11*cdf0e10cSrcweir# OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir# it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir# only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir# 15*cdf0e10cSrcweir# OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir# but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir# GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir# (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir# 21*cdf0e10cSrcweir# You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir# version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir# <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir# for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir# 26*cdf0e10cSrcweir# ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir 29*cdf0e10cSrcweirPRJ = ..$/.. 30*cdf0e10cSrcweirPRJNAME = cli_ure 31*cdf0e10cSrcweir 32*cdf0e10cSrcweirTARGET = cli_cppuhelper 33*cdf0e10cSrcweirNO_BSYMBOLIC = TRUE 34*cdf0e10cSrcweirENABLE_EXCEPTIONS = TRUE 35*cdf0e10cSrcweirLIBTARGET = NO 36*cdf0e10cSrcweirUSE_DEFFILE = TRUE 37*cdf0e10cSrcweir 38*cdf0e10cSrcweir# disable caching to avoid stale objects 39*cdf0e10cSrcweir# on version changes 40*cdf0e10cSrcweirCCACHE_DISABLE=TRUE 41*cdf0e10cSrcweir.EXPORT : CCACHE_DISABLE 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir.INCLUDE : settings.mk 44*cdf0e10cSrcweir.INCLUDE : $(PRJ)$/util$/makefile.pmk 45*cdf0e10cSrcweir 46*cdf0e10cSrcweiruse_shl_versions= 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir.IF "$(BUILD_FOR_CLI)" == "" 49*cdf0e10cSrcweir#do not even build the cxx files because they contain cli cpp 50*cdf0e10cSrcweirall: 51*cdf0e10cSrcweir.ELSE 52*cdf0e10cSrcweir 53*cdf0e10cSrcweir.INCLUDE : $(BIN)$/cliureversion.mk 54*cdf0e10cSrcweir 55*cdf0e10cSrcweirASSEMBLY_KEY="$(BIN)$/cliuno.snk" 56*cdf0e10cSrcweir 57*cdf0e10cSrcweirASSEMBLY_ATTRIBUTES = $(MISC)$/assembly_cppuhelper.cxx 58*cdf0e10cSrcweir 59*cdf0e10cSrcweirPOLICY_ASSEMBLY_FILE=$(BIN)$/$(CLI_CPPUHELPER_POLICY_ASSEMBLY).dll 60*cdf0e10cSrcweir 61*cdf0e10cSrcweirASSEMBLY_KEY_X=$(subst,\,\\ $(ASSEMBLY_KEY)) 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir 64*cdf0e10cSrcweirLINKFLAGS += /delayload:cppuhelper3MSC.dll \ 65*cdf0e10cSrcweir /delayload:cppu3.dll \ 66*cdf0e10cSrcweir /delayload:sal3.dll 67*cdf0e10cSrcweir 68*cdf0e10cSrcweirUWINAPILIB= 69*cdf0e10cSrcweir 70*cdf0e10cSrcweirNO_OFFUH=TRUE 71*cdf0e10cSrcweirCPPUMAKERFLAGS = 72*cdf0e10cSrcweirUNOTYPES = \ 73*cdf0e10cSrcweir com.sun.star.lang.XSingleComponentFactory \ 74*cdf0e10cSrcweir com.sun.star.loader.CannotActivateFactoryException \ 75*cdf0e10cSrcweir com.sun.star.container.XHierarchicalNameAccess \ 76*cdf0e10cSrcweir com.sun.star.registry.CannotRegisterImplementationException \ 77*cdf0e10cSrcweir com.sun.star.registry.XRegistryKey \ 78*cdf0e10cSrcweir com.sun.star.registry.XSimpleRegistry 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir#loader lock was solved as of VS 2005 (CCNUMVER = 0014..) 81*cdf0e10cSrcweir# When compiling for CLR, disable "warning C4339: use of undefined type detected 82*cdf0e10cSrcweir# in CLR meta-data - use of this type may lead to a runtime exception": 83*cdf0e10cSrcweir.IF "$(CCNUMVER)" >= "001399999999" 84*cdf0e10cSrcweirCFLAGSCXX += -clr:oldSyntax -AI $(BIN) -wd4339 85*cdf0e10cSrcweir.ELSE 86*cdf0e10cSrcweirCFLAGSCXX += -clr -AI $(BIN) -wd4339 87*cdf0e10cSrcweir#see Microsoft Knowledge Base Article - 814472 88*cdf0e10cSrcweirLINKFLAGS += -NOENTRY -NODEFAULTLIB:nochkclr.obj -INCLUDE:__DllMainCRTStartup@12 89*cdf0e10cSrcweir.ENDIF 90*cdf0e10cSrcweir 91*cdf0e10cSrcweirSLOFILES = \ 92*cdf0e10cSrcweir $(SLO)$/native_bootstrap.obj \ 93*cdf0e10cSrcweir $(SLO)$/path.obj \ 94*cdf0e10cSrcweir $(SLO)$/assembly_cppuhelper.obj 95*cdf0e10cSrcweir 96*cdf0e10cSrcweir 97*cdf0e10cSrcweirSHL1OBJS = $(SLOFILES) 98*cdf0e10cSrcweir 99*cdf0e10cSrcweirSHL1TARGET = $(TARGET) 100*cdf0e10cSrcweir 101*cdf0e10cSrcweirSHL1STDLIBS = \ 102*cdf0e10cSrcweir $(CPPUHELPERLIB) \ 103*cdf0e10cSrcweir $(CPPULIB) \ 104*cdf0e10cSrcweir $(SALLIB) \ 105*cdf0e10cSrcweir delayimp.lib \ 106*cdf0e10cSrcweir advapi32.lib \ 107*cdf0e10cSrcweir mscoree.lib \ 108*cdf0e10cSrcweir Advapi32.lib 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir.IF "$(CCNUMVER)" >= "001399999999" 111*cdf0e10cSrcweirSHL1STDLIBS += \ 112*cdf0e10cSrcweir msvcmrt.lib 113*cdf0e10cSrcweir.ENDIF 114*cdf0e10cSrcweir 115*cdf0e10cSrcweirSHL1VERSIONMAP = msvc.map 116*cdf0e10cSrcweir 117*cdf0e10cSrcweirSHL1DEF = $(MISC)$/$(SHL1TARGET).def 118*cdf0e10cSrcweirDEF1NAME = $(SHL1TARGET) 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir 121*cdf0e10cSrcweir.INCLUDE : $(PRJ)$/util$/target.pmk 122*cdf0e10cSrcweir.INCLUDE : target.mk 123*cdf0e10cSrcweir 124*cdf0e10cSrcweirSIGN= $(MISC)$/cppuhelper_is_signed_flag 125*cdf0e10cSrcweir 126*cdf0e10cSrcweirALLTAR: \ 127*cdf0e10cSrcweir $(POLICY_ASSEMBLY_FILE) \ 128*cdf0e10cSrcweir $(SIGN) 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir 132*cdf0e10cSrcweir.IF "$(CCNUMVER)" >= "001399999999" 133*cdf0e10cSrcweirCFLAGSCXX += -clr:oldSyntax 134*cdf0e10cSrcweir.ENDIF 135*cdf0e10cSrcweir 136*cdf0e10cSrcweir$(ASSEMBLY_ATTRIBUTES) : assembly.cxx $(BIN)$/cliuno.snk $(BIN)$/cliureversion.mk 137*cdf0e10cSrcweir @echo $(ASSEMBLY_KEY_X) 138*cdf0e10cSrcweir $(GNUCOPY) -p assembly.cxx $@ 139*cdf0e10cSrcweir echo \ 140*cdf0e10cSrcweir '[assembly:System::Reflection::AssemblyVersion( "$(CLI_CPPUHELPER_NEW_VERSION)" )];' \ 141*cdf0e10cSrcweir >> $(OUT)$/misc$/assembly_cppuhelper.cxx 142*cdf0e10cSrcweir echo \ 143*cdf0e10cSrcweir '[assembly:System::Reflection::AssemblyKeyFile($(ASSEMBLY_KEY_X))];' \ 144*cdf0e10cSrcweir >> $(OUT)$/misc$/assembly_cppuhelper.cxx 145*cdf0e10cSrcweir 146*cdf0e10cSrcweir 147*cdf0e10cSrcweir 148*cdf0e10cSrcweir#make sure we build cli_cppuhelper after the version changed 149*cdf0e10cSrcweir$(SHL1OBJS) : $(BIN)$/cli_cppuhelper.config 150*cdf0e10cSrcweir 151*cdf0e10cSrcweir 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir$(SIGN): $(SHL1TARGETN) 154*cdf0e10cSrcweir $(WRAPCMD) sn.exe -R $(BIN)$/$(TARGET).dll $(BIN)$/cliuno.snk && $(TOUCH) $@ 155*cdf0e10cSrcweir 156*cdf0e10cSrcweir#do not forget to deliver cli_cppuhelper.config. It is NOT embedded in the policy file. 157*cdf0e10cSrcweir.IF "$(CCNUMVER)" >= "001399999999" 158*cdf0e10cSrcweir#.NET 2 and higher 159*cdf0e10cSrcweir# If the x86 switch is ommitted then the system assumes the assembly to be MSIL. 160*cdf0e10cSrcweir# The policy file is still found when an application tries to load an older 161*cdf0e10cSrcweir# cli_cppuhelper.dll but the system cannot locate it. It possibly assumes that the 162*cdf0e10cSrcweir# assembly is also 'MSIL' like its policy file. 163*cdf0e10cSrcweir$(POLICY_ASSEMBLY_FILE) : $(BIN)$/cli_cppuhelper.config 164*cdf0e10cSrcweir $(WRAPCMD) AL.exe -out:$@ \ 165*cdf0e10cSrcweir -version:$(CLI_CPPUHELPER_POLICY_VERSION) \ 166*cdf0e10cSrcweir -keyfile:$(BIN)$/cliuno.snk \ 167*cdf0e10cSrcweir -link:$(BIN)$/cli_cppuhelper.config \ 168*cdf0e10cSrcweir -platform:x86 169*cdf0e10cSrcweir.ELSE 170*cdf0e10cSrcweir#.NET 1.1: platform flag not needed 171*cdf0e10cSrcweir$(POLICY_ASSEMBLY_FILE) : $(BIN)$/cli_cppuhelper.config 172*cdf0e10cSrcweir $(WRAPCMD) AL.exe -out:$@ \ 173*cdf0e10cSrcweir -version:$(CLI_CPPUHELPER_POLICY_VERSION) \ 174*cdf0e10cSrcweir -keyfile:$(BIN)$/cliuno.snk \ 175*cdf0e10cSrcweir -link:$(BIN)$/cli_cppuhelper.config 176*cdf0e10cSrcweir.ENDIF 177*cdf0e10cSrcweir 178*cdf0e10cSrcweir#Create the config file that is used with the policy assembly 179*cdf0e10cSrcweir$(BIN)$/cli_cppuhelper.config: cli_cppuhelper_config $(BIN)$/cliureversion.mk 180*cdf0e10cSrcweir $(PERL) $(SOLARENV)$/bin$/clipatchconfig.pl \ 181*cdf0e10cSrcweir $< $@ 182*cdf0e10cSrcweir 183*cdf0e10cSrcweir.ENDIF # "$(BUILD_FOR_CLI)" != "" 184*cdf0e10cSrcweir 185