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