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