1cdf0e10cSrcweir@echo off 258d70080SAndrew Ristrem ************************************************************* 358d70080SAndrew Ristrem 458d70080SAndrew Ristrem Licensed to the Apache Software Foundation (ASF) under one 558d70080SAndrew Ristrem or more contributor license agreements. See the NOTICE file 658d70080SAndrew Ristrem distributed with this work for additional information 758d70080SAndrew Ristrem regarding copyright ownership. The ASF licenses this file 858d70080SAndrew Ristrem to you under the Apache License, Version 2.0 (the 958d70080SAndrew Ristrem "License")rem you may not use this file except in compliance 1058d70080SAndrew Ristrem with the License. You may obtain a copy of the License at 1158d70080SAndrew Ristrem 1258d70080SAndrew Ristrem http://www.apache.org/licenses/LICENSE-2.0 1358d70080SAndrew Ristrem 1458d70080SAndrew Ristrem Unless required by applicable law or agreed to in writing, 1558d70080SAndrew Ristrem software distributed under the License is distributed on an 1658d70080SAndrew Ristrem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 1758d70080SAndrew Ristrem KIND, either express or implied. See the License for the 1858d70080SAndrew Ristrem specific language governing permissions and limitations 1958d70080SAndrew Ristrem under the License. 2058d70080SAndrew Ristrem 2158d70080SAndrew 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 264f913391SAriel Constenla-HaileREM Example: set OO_SDK_NAME=apacheopenoffice4.0_sdk 274f913391SAriel Constenla-Haileset OO_SDK_NAME=apacheopenoffice4.0_sdk 28cdf0e10cSrcweir 29cdf0e10cSrcweirREM Installation directory of the Software Development Kit. 30*599cc5b4SOliver-Rainer WittmannREM Example: set OO_SDK_HOME=C:\Program Files\OpenOffice\Basic 4.0\sdk 31cdf0e10cSrcweirset OO_SDK_HOME= 32cdf0e10cSrcweir 33cdf0e10cSrcweirREM Office installation directory. 34*599cc5b4SOliver-Rainer WittmannREM Example: set OFFICE_HOME=C:\Program Files\OpenOffice 4 35cdf0e10cSrcweirset OFFICE_HOME= 36cdf0e10cSrcweir 37*599cc5b4SOliver-Rainer WittmannREM Example: set OFFICE_HOME=C:\Program Files\OpenOffice\Basis 4.0 38cdf0e10cSrcweirset OFFICE_BASE_HOME= 39cdf0e10cSrcweir 40cdf0e10cSrcweirREM URE installation directory. 41*599cc5b4SOliver-Rainer WittmannREM Example: set OO_SDK_URE_HOME=C:\Program Files\OpenOffice\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 52985d02c7SAriel Constenla-HaileREM Directory of the cat tool. 53985d02c7SAriel Constenla-HaileREM Example: set OO_SDK_CAT_HOME=C:\UnxUtils\usr\local\wbin\ 54985d02c7SAriel Constenla-Haileset OO_SDK_CAT_HOME= 55985d02c7SAriel Constenla-Haile 56985d02c7SAriel Constenla-HaileREM Directory of the sed tool. 57985d02c7SAriel Constenla-HaileREM Example: set OO_SDK_SED_HOME=C:\UnxUtils\usr\local\wbin\ 58985d02c7SAriel Constenla-Haileset OO_SDK_SED_HOME= 59985d02c7SAriel Constenla-Haile 60cdf0e10cSrcweirREM Directory of the C++ compiler. 61cdf0e10cSrcweirREM Example:set OO_SDK_CPP_HOME=C:\Program Files\Microsoft Visual Studio 9.0\VC\bin 62cdf0e10cSrcweirREM Example:set CPP_WINDOWS_SDK=C:\Program Files\\Microsoft SDKs\Windows\v6.0A\ 63cdf0e10cSrcweirset OO_SDK_CPP_HOME= 64cdf0e10cSrcweirset CPP_VC8= 65cdf0e10cSrcweirset CPP_WINDOWS_SDK= 66cdf0e10cSrcweir 67cdf0e10cSrcweirREM Directory of the C# and VB.NET compilers. 68cdf0e10cSrcweirREM Example:set OO_SDK_CLI_HOME=C:\WINXP\Microsoft.NET\Framework\v1.0.3705 69cdf0e10cSrcweirset OO_SDK_CLI_HOME= 70cdf0e10cSrcweir 71cdf0e10cSrcweirREM Java SDK installation directory. 72cdf0e10cSrcweirREM Example: set OO_SDK_JAVA_HOME=C:\Program Files\Java\jdk1.6.0_05 73cdf0e10cSrcweirset OO_SDK_JAVA_HOME= 74cdf0e10cSrcweir 75cdf0e10cSrcweirREM Special output directory 764f913391SAriel Constenla-HaileREM Example: set OO_SDK_OUT=C:\apacheopenoffice4.0_sdk 77cdf0e10cSrcweirset OO_SDK_OUT= 78cdf0e10cSrcweir 79cdf0e10cSrcweirREM Automatic deployment 80cdf0e10cSrcweirREM Example: set SDK_AUTO_DEPLOYMENT=YES 81cdf0e10cSrcweirset SDK_AUTO_DEPLOYMENT=YES 82cdf0e10cSrcweir 83cdf0e10cSrcweirset STLDEBUG= 84cdf0e10cSrcweirREM check stlport lib in 4NT shell 85cdf0e10cSrcweirREM if exist "%OO_SDK_HOME%\windows\lib\stlport_vc71_stldebug.lib". ( 86cdf0e10cSrcweirREM set STLDEBUG=_stldebug 87cdf0e10cSrcweirREM ) 88cdf0e10cSrcweir 89cdf0e10cSrcweirREM Check installation path for the StarOffice Development Kit. 90cdf0e10cSrcweirif not defined OO_SDK_HOME ( 91cdf0e10cSrcweir echo Error: the variable OO_SDK_HOME is missing! 92cdf0e10cSrcweir goto :error 93cdf0e10cSrcweir ) 94cdf0e10cSrcweir 95cdf0e10cSrcweirREM Check installation path for the office. 96cdf0e10cSrcweirREM if not defined OFFICE_HOME ( 97cdf0e10cSrcweirREM if not defined OO_SDK_URE_HOME ( 98cdf0e10cSrcweirREM echo Error: either of the variables OFFICE_HOME and 99cdf0e10cSrcweirREM echo OO_SDK_URE_HOME is missing! 100cdf0e10cSrcweirREM goto :error 101cdf0e10cSrcweirREM ) 102cdf0e10cSrcweirREM ) 103cdf0e10cSrcweir 104cdf0e10cSrcweirREM Check installation path for GNU make. 105cdf0e10cSrcweirif not defined OO_SDK_MAKE_HOME ( 106cdf0e10cSrcweir echo Error: the variable OO_SDK_MAKE_HOME is missing! 107cdf0e10cSrcweir goto :error 108cdf0e10cSrcweir ) 109cdf0e10cSrcweir 110cdf0e10cSrcweirREM Check installation path for the zip tool. 111cdf0e10cSrcweirif not defined OO_SDK_ZIP_HOME ( 112cdf0e10cSrcweir echo Error: the variable OO_SDK_ZIP_HOME is missing! 113cdf0e10cSrcweir goto :error 114cdf0e10cSrcweir ) 115cdf0e10cSrcweir 116985d02c7SAriel Constenla-HaileREM Check installation path for the cat tool. 117985d02c7SAriel Constenla-Haileif not defined OO_SDK_CAT_HOME ( 118985d02c7SAriel Constenla-Haile echo Error: the variable OO_SDK_CAT_HOME is missing! 119985d02c7SAriel Constenla-Haile goto :error 120985d02c7SAriel Constenla-Haile ) 121985d02c7SAriel Constenla-Haile 122985d02c7SAriel Constenla-HaileREM Check installation path for the sed tool. 123985d02c7SAriel Constenla-Haileif not defined OO_SDK_SED_HOME ( 124985d02c7SAriel Constenla-Haile echo Error: the variable OO_SDK_SED_HOME is missing! 125985d02c7SAriel Constenla-Haile goto :error 126985d02c7SAriel Constenla-Haile ) 127985d02c7SAriel Constenla-Haile 128cdf0e10cSrcweirREM Set library path. 129cdf0e10cSrcweirset LIB=%OO_SDK_HOME%\lib;%LIB% 130cdf0e10cSrcweirif defined CPP_WINDOWS_SDK ( 131cdf0e10cSrcweir set LIB=%LIB%;%CPP_WINDOWS_SDK%\lib 132cdf0e10cSrcweir ) 133cdf0e10cSrcweir 134cdf0e10cSrcweirREM Set office program path. 135cdf0e10cSrcweirif defined OFFICE_HOME ( 136cdf0e10cSrcweir set OFFICE_PROGRAM_PATH=%OFFICE_HOME%\program 137cdf0e10cSrcweir ) 138cdf0e10cSrcweir 139cdf0e10cSrcweirREM Set office program path. 140cdf0e10cSrcweirif defined OFFICE_BASE_HOME ( 141cdf0e10cSrcweir set OFFICE_BASE_PROGRAM_PATH=%OFFICE_BASE_HOME%\program 142cdf0e10cSrcweir ) 143cdf0e10cSrcweir 144cdf0e10cSrcweirREM Set UNO path, necessary to ensure that the cpp examples using the 145cdf0e10cSrcweirREM new UNO bootstrap mechanism use the configured office installation 146cdf0e10cSrcweirREM (only set when using an Office). 147cdf0e10cSrcweirif defined OFFICE_HOME ( 148cdf0e10cSrcweir set UNO_PATH=%OFFICE_PROGRAM_PATH% 149cdf0e10cSrcweir ) 150cdf0e10cSrcweir 151cdf0e10cSrcweirREM if defined OO_SDK_URE_HOME ( 152cdf0e10cSrcweirset OO_SDK_URE_BIN_DIR=%OO_SDK_URE_HOME%\bin 153cdf0e10cSrcweirset OO_SDK_URE_LIB_DIR=%OO_SDK_URE_HOME%\bin 154cdf0e10cSrcweirset OO_SDK_URE_JAVA_DIR=%OO_SDK_URE_HOME%\java 155cdf0e10cSrcweirREM ) else ( 156cdf0e10cSrcweirset OO_SDK_OFFICE_BIN_DIR=%OFFICE_PROGRAM_PATH% 157cdf0e10cSrcweirset OO_SDK_OFFICE_LIB_DIR=%OFFICE_BASE_PROGRAM_PATH% 158cdf0e10cSrcweirset OO_SDK_OFFICE_JAVA_DIR=%OFFICE_BASE_PROGRAM_PATH%\classes 159cdf0e10cSrcweirREM ) 160cdf0e10cSrcweir 161cdf0e10cSrcweirREM Set classpath 162cdf0e10cSrcweirset 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 163cdf0e10cSrcweirREM if defined OFFICE_HOME ( 164cdf0e10cSrcweirREM set CLASSPATH=%CLASSPATH%;%OO_SDK_OFFICE_JAVA_DIR%\unoil.jar 165cdf0e10cSrcweirREM ) 166cdf0e10cSrcweir 167cdf0e10cSrcweirREM Add directory of the SDK tools to the path. 168cdf0e10cSrcweirset PATH=%OO_SDK_HOME%\bin;%OO_SDK_URE_BIN_DIR%;%OO_SDK_OFFICE_BIN_DIR%;%OO_SDK_HOME%\WINexample.out\bin;%PATH% 169cdf0e10cSrcweir 170cdf0e10cSrcweirREM Set PATH appropriate to the output directory 171cdf0e10cSrcweirif defined OO_SDK_OUT ( 172cdf0e10cSrcweir set PATH=%OO_SDK_OUT%\WINexample.out\bin;%PATH% 173cdf0e10cSrcweir ) else ( 174cdf0e10cSrcweir set PATH=%OO_SDK_HOME%\WINexample.out\bin;%PATH% 175cdf0e10cSrcweir ) 176cdf0e10cSrcweir 177cdf0e10cSrcweirREM Add directory of the command make to the path, if necessary. 178cdf0e10cSrcweirif defined OO_SDK_MAKE_HOME set PATH=%OO_SDK_MAKE_HOME%;%PATH% 179cdf0e10cSrcweir 180cdf0e10cSrcweirREM Add directory of the zip tool to the path, if necessary. 181cdf0e10cSrcweirif defined OO_SDK_ZIP_HOME set PATH=%OO_SDK_ZIP_HOME%;%PATH% 182cdf0e10cSrcweir 183985d02c7SAriel Constenla-HaileREM Add directory of the cat tool to the path, if necessary. 184985d02c7SAriel Constenla-Haileif defined OO_SDK_CAT_HOME set PATH=%OO_SDK_CAT_HOME%;%PATH% 185985d02c7SAriel Constenla-Haile 186985d02c7SAriel Constenla-HaileREM Add directory of the sed tool to the path, if necessary. 187985d02c7SAriel Constenla-Haileif defined OO_SDK_SED_HOME set PATH=%OO_SDK_SED_HOME%;%PATH% 188985d02c7SAriel Constenla-Haile 189cdf0e10cSrcweirREM Add directory of the C++ compiler to the path, if necessary. 190cdf0e10cSrcweirif defined OO_SDK_CPP_HOME set PATH=%OO_SDK_CPP_HOME%;%PATH% 191cdf0e10cSrcweir 192cdf0e10cSrcweirREM Add directory of the C# and VB.NET compilers to the path, if necessary. 193cdf0e10cSrcweirif defined OO_SDK_CLI_HOME set PATH=%OO_SDK_CLI_HOME%;%PATH% 194cdf0e10cSrcweir 195cdf0e10cSrcweirREM Add directory of the Java tools to the path, if necessary. 196cdf0e10cSrcweirif defined OO_SDK_JAVA_HOME set PATH=%OO_SDK_JAVA_HOME%\bin;%OO_SDK_JAVA_HOME%\jre\bin;%PATH% 197cdf0e10cSrcweir 198cdf0e10cSrcweirREM Set environment for C++ compiler tools, if necessary. 199cdf0e10cSrcweirif defined OO_SDK_CPP_HOME call "%OO_SDK_CPP_HOME%\VCVARS32.bat" 200cdf0e10cSrcweir 201cdf0e10cSrcweirREM Set tilte to identify the prepared shell. 202cdf0e10cSrcweirtitle Shell prepared for SDK 203cdf0e10cSrcweir 204cdf0e10cSrcweirREM Prepare shell with all necessary environment variables. 205cdf0e10cSrcweirecho. 206cdf0e10cSrcweirecho ****************************************************************** 207cdf0e10cSrcweirecho * 208cdf0e10cSrcweirecho * SDK environment is prepared for Windows 209cdf0e10cSrcweirecho * 210cdf0e10cSrcweirecho * SDK = %OO_SDK_HOME% 211cdf0e10cSrcweirecho * Office = %OFFICE_HOME% 212cdf0e10cSrcweirecho * Office Base = %OFFICE_BASE_HOME% 213cdf0e10cSrcweirecho * URE = %OO_SDK_URE_HOME% 214cdf0e10cSrcweirecho * Make = %OO_SDK_MAKE_HOME% 215cdf0e10cSrcweirecho * Zip = %OO_SDK_ZIP_HOME% 216985d02c7SAriel Constenla-Haileecho * cat = %OO_SDK_CAT_HOME% 217985d02c7SAriel Constenla-Haileecho * sed = %OO_SDK_SED_HOME% 218cdf0e10cSrcweirecho * C++ Compiler = %OO_SDK_CPP_HOME% 219cdf0e10cSrcweirecho * C# and VB.NET compilers = %OO_SDK_CLI_HOME% 220cdf0e10cSrcweirecho * Java = %OO_SDK_JAVA_HOME% 221cdf0e10cSrcweirecho * Special Output directory = %OO_SDK_OUT% 222cdf0e10cSrcweirecho * Auto deployment = %SDK_AUTO_DEPLOYMENT% 223cdf0e10cSrcweirecho * 224cdf0e10cSrcweirecho ****************************************************************** 225cdf0e10cSrcweirecho. 226cdf0e10cSrcweirgoto end 227cdf0e10cSrcweir 228cdf0e10cSrcweir :error 229cdf0e10cSrcweirError: Please insert the necessary environment variables into the batch file. 230cdf0e10cSrcweir 231cdf0e10cSrcweir :end 232