1cdf0e10cSrcweir@echo off 2*58d70080SAndrew Ristrem ************************************************************* 3*58d70080SAndrew Ristrem 4*58d70080SAndrew Ristrem Licensed to the Apache Software Foundation (ASF) under one 5*58d70080SAndrew Ristrem or more contributor license agreements. See the NOTICE file 6*58d70080SAndrew Ristrem distributed with this work for additional information 7*58d70080SAndrew Ristrem regarding copyright ownership. The ASF licenses this file 8*58d70080SAndrew Ristrem to you under the Apache License, Version 2.0 (the 9*58d70080SAndrew Ristrem "License")rem you may not use this file except in compliance 10*58d70080SAndrew Ristrem with the License. You may obtain a copy of the License at 11*58d70080SAndrew Ristrem 12*58d70080SAndrew Ristrem http://www.apache.org/licenses/LICENSE-2.0 13*58d70080SAndrew Ristrem 14*58d70080SAndrew Ristrem Unless required by applicable law or agreed to in writing, 15*58d70080SAndrew Ristrem software distributed under the License is distributed on an 16*58d70080SAndrew Ristrem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17*58d70080SAndrew Ristrem KIND, either express or implied. See the License for the 18*58d70080SAndrew Ristrem specific language governing permissions and limitations 19*58d70080SAndrew Ristrem under the License. 20*58d70080SAndrew Ristrem 21*58d70080SAndrew Ristrem ************************************************************* 22cdf0e10cSrcweirREM This script sets all enviroment variables, which 23cdf0e10cSrcweirREM are necessary for building the examples of the Office Development Kit. 24cdf0e10cSrcweirREM The Script was developed for the operating systems Windows. 25cdf0e10cSrcweirREM The SDK name 26cdf0e10cSrcweirREM Example: set OO_SDK_NAME=openoffice3.0_sdk 27cdf0e10cSrcweirset OO_SDK_NAME=openoffice.org3.0_sdk 28cdf0e10cSrcweir 29cdf0e10cSrcweirREM Installation directory of the Software Development Kit. 30cdf0e10cSrcweirREM Example: set OO_SDK_HOME=C:\Program Files\OpenOffice.org\Basic 3.0\sdk 31cdf0e10cSrcweirset OO_SDK_HOME= 32cdf0e10cSrcweir 33cdf0e10cSrcweirREM Office installation directory. 34cdf0e10cSrcweirREM Example: set OFFICE_HOME=C:\Program Files\OpenOffice.org 3 35cdf0e10cSrcweirset OFFICE_HOME= 36cdf0e10cSrcweir 37cdf0e10cSrcweirREM Example: set OFFICE_HOME=C:\Program Files\OpenOffice.org\Basis 3.0 38cdf0e10cSrcweirset OFFICE_BASE_HOME= 39cdf0e10cSrcweir 40cdf0e10cSrcweirREM URE installation directory. 41cdf0e10cSrcweirREM Example: set OO_SDK_URE_HOME=C:\Program Files\OpenOffice.org\URE 42cdf0e10cSrcweirset OO_SDK_URE_HOME= 43cdf0e10cSrcweir 44cdf0e10cSrcweirREM Directory of the make command. 45cdf0e10cSrcweirREM Example: set OO_SDK_MAKE_HOME=D:\NextGenerationMake\make 46cdf0e10cSrcweirset OO_SDK_MAKE_HOME= 47cdf0e10cSrcweir 48cdf0e10cSrcweirREM Directory of the zip tool. 49cdf0e10cSrcweirREM Example: set OO_SDK_ZIP_HOME=D:\infozip\bin 50cdf0e10cSrcweirset OO_SDK_ZIP_HOME= 51cdf0e10cSrcweir 52cdf0e10cSrcweirREM Directory of the C++ compiler. 53cdf0e10cSrcweirREM Example:set OO_SDK_CPP_HOME=C:\Program Files\Microsoft Visual Studio 9.0\VC\bin 54cdf0e10cSrcweirREM Example:set CPP_WINDOWS_SDK=C:\Program Files\\Microsoft SDKs\Windows\v6.0A\ 55cdf0e10cSrcweirset OO_SDK_CPP_HOME= 56cdf0e10cSrcweirset CPP_VC8= 57cdf0e10cSrcweirset CPP_WINDOWS_SDK= 58cdf0e10cSrcweir 59cdf0e10cSrcweirREM Directory of the C# and VB.NET compilers. 60cdf0e10cSrcweirREM Example:set OO_SDK_CLI_HOME=C:\WINXP\Microsoft.NET\Framework\v1.0.3705 61cdf0e10cSrcweirset OO_SDK_CLI_HOME= 62cdf0e10cSrcweir 63cdf0e10cSrcweirREM Java SDK installation directory. 64cdf0e10cSrcweirREM Example: set OO_SDK_JAVA_HOME=C:\Program Files\Java\jdk1.6.0_05 65cdf0e10cSrcweirset OO_SDK_JAVA_HOME= 66cdf0e10cSrcweir 67cdf0e10cSrcweirREM Special output directory 68cdf0e10cSrcweirREM Example: set OO_SDK_OUT=C:\openoffice.org3.0_sdk 69cdf0e10cSrcweirset OO_SDK_OUT= 70cdf0e10cSrcweir 71cdf0e10cSrcweirREM Automatic deployment 72cdf0e10cSrcweirREM Example: set SDK_AUTO_DEPLOYMENT=YES 73cdf0e10cSrcweirset SDK_AUTO_DEPLOYMENT=YES 74cdf0e10cSrcweir 75cdf0e10cSrcweirset STLDEBUG= 76cdf0e10cSrcweirREM check stlport lib in 4NT shell 77cdf0e10cSrcweirREM if exist "%OO_SDK_HOME%\windows\lib\stlport_vc71_stldebug.lib". ( 78cdf0e10cSrcweirREM set STLDEBUG=_stldebug 79cdf0e10cSrcweirREM ) 80cdf0e10cSrcweir 81cdf0e10cSrcweirREM Check installation path for the StarOffice Development Kit. 82cdf0e10cSrcweirif not defined OO_SDK_HOME ( 83cdf0e10cSrcweir echo Error: the variable OO_SDK_HOME is missing! 84cdf0e10cSrcweir goto :error 85cdf0e10cSrcweir ) 86cdf0e10cSrcweir 87cdf0e10cSrcweirREM Check installation path for the office. 88cdf0e10cSrcweirREM if not defined OFFICE_HOME ( 89cdf0e10cSrcweirREM if not defined OO_SDK_URE_HOME ( 90cdf0e10cSrcweirREM echo Error: either of the variables OFFICE_HOME and 91cdf0e10cSrcweirREM echo OO_SDK_URE_HOME is missing! 92cdf0e10cSrcweirREM goto :error 93cdf0e10cSrcweirREM ) 94cdf0e10cSrcweirREM ) 95cdf0e10cSrcweir 96cdf0e10cSrcweirREM Check installation path for GNU make. 97cdf0e10cSrcweirif not defined OO_SDK_MAKE_HOME ( 98cdf0e10cSrcweir echo Error: the variable OO_SDK_MAKE_HOME is missing! 99cdf0e10cSrcweir goto :error 100cdf0e10cSrcweir ) 101cdf0e10cSrcweir 102cdf0e10cSrcweirREM Check installation path for the zip tool. 103cdf0e10cSrcweirif not defined OO_SDK_ZIP_HOME ( 104cdf0e10cSrcweir echo Error: the variable OO_SDK_ZIP_HOME is missing! 105cdf0e10cSrcweir goto :error 106cdf0e10cSrcweir ) 107cdf0e10cSrcweir 108cdf0e10cSrcweirREM Set library path. 109cdf0e10cSrcweirset LIB=%OO_SDK_HOME%\lib;%LIB% 110cdf0e10cSrcweirif defined CPP_WINDOWS_SDK ( 111cdf0e10cSrcweir set LIB=%LIB%;%CPP_WINDOWS_SDK%\lib 112cdf0e10cSrcweir ) 113cdf0e10cSrcweir 114cdf0e10cSrcweirREM Set office program path. 115cdf0e10cSrcweirif defined OFFICE_HOME ( 116cdf0e10cSrcweir set OFFICE_PROGRAM_PATH=%OFFICE_HOME%\program 117cdf0e10cSrcweir ) 118cdf0e10cSrcweir 119cdf0e10cSrcweirREM Set office program path. 120cdf0e10cSrcweirif defined OFFICE_BASE_HOME ( 121cdf0e10cSrcweir set OFFICE_BASE_PROGRAM_PATH=%OFFICE_BASE_HOME%\program 122cdf0e10cSrcweir ) 123cdf0e10cSrcweir 124cdf0e10cSrcweirREM Set UNO path, necessary to ensure that the cpp examples using the 125cdf0e10cSrcweirREM new UNO bootstrap mechanism use the configured office installation 126cdf0e10cSrcweirREM (only set when using an Office). 127cdf0e10cSrcweirif defined OFFICE_HOME ( 128cdf0e10cSrcweir set UNO_PATH=%OFFICE_PROGRAM_PATH% 129cdf0e10cSrcweir ) 130cdf0e10cSrcweir 131cdf0e10cSrcweirREM if defined OO_SDK_URE_HOME ( 132cdf0e10cSrcweirset OO_SDK_URE_BIN_DIR=%OO_SDK_URE_HOME%\bin 133cdf0e10cSrcweirset OO_SDK_URE_LIB_DIR=%OO_SDK_URE_HOME%\bin 134cdf0e10cSrcweirset OO_SDK_URE_JAVA_DIR=%OO_SDK_URE_HOME%\java 135cdf0e10cSrcweirREM ) else ( 136cdf0e10cSrcweirset OO_SDK_OFFICE_BIN_DIR=%OFFICE_PROGRAM_PATH% 137cdf0e10cSrcweirset OO_SDK_OFFICE_LIB_DIR=%OFFICE_BASE_PROGRAM_PATH% 138cdf0e10cSrcweirset OO_SDK_OFFICE_JAVA_DIR=%OFFICE_BASE_PROGRAM_PATH%\classes 139cdf0e10cSrcweirREM ) 140cdf0e10cSrcweir 141cdf0e10cSrcweirREM Set classpath 142cdf0e10cSrcweirset CLASSPATH=%OO_SDK_URE_JAVA_DIR%\juh.jar;%OO_SDK_URE_JAVA_DIR%\jurt.jar;%OO_SDK_URE_JAVA_DIR%\ridl.jar;%OO_SDK_URE_JAVA_DIR%\unoloader.jar;%OO_SDK_OFFICE_JAVA_DIR%\unoil.jar 143cdf0e10cSrcweirREM if defined OFFICE_HOME ( 144cdf0e10cSrcweirREM set CLASSPATH=%CLASSPATH%;%OO_SDK_OFFICE_JAVA_DIR%\unoil.jar 145cdf0e10cSrcweirREM ) 146cdf0e10cSrcweir 147cdf0e10cSrcweirREM Add directory of the SDK tools to the path. 148cdf0e10cSrcweirset PATH=%OO_SDK_HOME%\bin;%OO_SDK_URE_BIN_DIR%;%OO_SDK_OFFICE_BIN_DIR%;%OO_SDK_HOME%\WINexample.out\bin;%PATH% 149cdf0e10cSrcweir 150cdf0e10cSrcweirREM Set PATH appropriate to the output directory 151cdf0e10cSrcweirif defined OO_SDK_OUT ( 152cdf0e10cSrcweir set PATH=%OO_SDK_OUT%\WINexample.out\bin;%PATH% 153cdf0e10cSrcweir ) else ( 154cdf0e10cSrcweir set PATH=%OO_SDK_HOME%\WINexample.out\bin;%PATH% 155cdf0e10cSrcweir ) 156cdf0e10cSrcweir 157cdf0e10cSrcweirREM Add directory of the command make to the path, if necessary. 158cdf0e10cSrcweirif defined OO_SDK_MAKE_HOME set PATH=%OO_SDK_MAKE_HOME%;%PATH% 159cdf0e10cSrcweir 160cdf0e10cSrcweirREM Add directory of the zip tool to the path, if necessary. 161cdf0e10cSrcweirif defined OO_SDK_ZIP_HOME set PATH=%OO_SDK_ZIP_HOME%;%PATH% 162cdf0e10cSrcweir 163cdf0e10cSrcweirREM Add directory of the C++ compiler to the path, if necessary. 164cdf0e10cSrcweirif defined OO_SDK_CPP_HOME set PATH=%OO_SDK_CPP_HOME%;%PATH% 165cdf0e10cSrcweir 166cdf0e10cSrcweirREM Add directory of the C# and VB.NET compilers to the path, if necessary. 167cdf0e10cSrcweirif defined OO_SDK_CLI_HOME set PATH=%OO_SDK_CLI_HOME%;%PATH% 168cdf0e10cSrcweir 169cdf0e10cSrcweirREM Add directory of the Java tools to the path, if necessary. 170cdf0e10cSrcweirif defined OO_SDK_JAVA_HOME set PATH=%OO_SDK_JAVA_HOME%\bin;%OO_SDK_JAVA_HOME%\jre\bin;%PATH% 171cdf0e10cSrcweir 172cdf0e10cSrcweirREM Set environment for C++ compiler tools, if necessary. 173cdf0e10cSrcweirif defined OO_SDK_CPP_HOME call "%OO_SDK_CPP_HOME%\VCVARS32.bat" 174cdf0e10cSrcweir 175cdf0e10cSrcweirREM Set tilte to identify the prepared shell. 176cdf0e10cSrcweirtitle Shell prepared for SDK 177cdf0e10cSrcweir 178cdf0e10cSrcweirREM Prepare shell with all necessary environment variables. 179cdf0e10cSrcweirecho. 180cdf0e10cSrcweirecho ****************************************************************** 181cdf0e10cSrcweirecho * 182cdf0e10cSrcweirecho * SDK environment is prepared for Windows 183cdf0e10cSrcweirecho * 184cdf0e10cSrcweirecho * SDK = %OO_SDK_HOME% 185cdf0e10cSrcweirecho * Office = %OFFICE_HOME% 186cdf0e10cSrcweirecho * Office Base = %OFFICE_BASE_HOME% 187cdf0e10cSrcweirecho * URE = %OO_SDK_URE_HOME% 188cdf0e10cSrcweirecho * Make = %OO_SDK_MAKE_HOME% 189cdf0e10cSrcweirecho * Zip = %OO_SDK_ZIP_HOME% 190cdf0e10cSrcweirecho * C++ Compiler = %OO_SDK_CPP_HOME% 191cdf0e10cSrcweirecho * C# and VB.NET compilers = %OO_SDK_CLI_HOME% 192cdf0e10cSrcweirecho * Java = %OO_SDK_JAVA_HOME% 193cdf0e10cSrcweirecho * Special Output directory = %OO_SDK_OUT% 194cdf0e10cSrcweirecho * Auto deployment = %SDK_AUTO_DEPLOYMENT% 195cdf0e10cSrcweirecho * 196cdf0e10cSrcweirecho ****************************************************************** 197cdf0e10cSrcweirecho. 198cdf0e10cSrcweirgoto end 199cdf0e10cSrcweir 200cdf0e10cSrcweir :error 201cdf0e10cSrcweirError: Please insert the necessary environment variables into the batch file. 202cdf0e10cSrcweir 203cdf0e10cSrcweir :end 204