3 # This script sets all enviroment variables, which are necessary for building
4 # the examples of the Office Development Kit.
5 # The Script was developed for the operating systems Solaris, Linux and MacOS.
8 setenv OO_SDK_NAME @OO_SDK_NAME@
10 # Installation directory of the Software Development Kit.
11 # Example: setenv OO_SDK_HOME /opt/openoffice.org/basis3.0/sdk
12 setenv OO_SDK_HOME @OO_SDK_HOME@
14 # Office installation directory.
15 # Example: set OFFICE_HOME=/opt/openoffice.org3
16 set OFFICE_HOME
=@OFFICE_HOME@
17 OFFICE_BASE_HOME
=@OFFICE_BASE_HOME@
19 # URE installation directory.
20 # Example: setenv OO_SDK_URE_HOME /opt/openoffice.org/ure
21 setenv OO_SDK_URE_HOME @OO_SDK_URE_HOME@
23 # Directory of the make command.
24 # Example: setenv OO_SDK_MAKE_HOME /usr/bin
25 setenv OO_SDK_MAKE_HOME @OO_SDK_MAKE_HOME@
27 # Directory of the zip command.
28 # Example: setenv OO_SDK_ZIP_HOME /usr/bin
29 setenv OO_SDK_ZIP_HOME @OO_SDK_ZIP_HOME@
31 # Directory of the C++ compiler.
32 # Example: setenv OO_SDK_CPP_HOME /usr/bin
33 setenv OO_SDK_CPP_HOME @OO_SDK_CPP_HOME@
36 setenv OO_SDK_CC_55_OR_HIGHER @OO_SDK_CC_55_OR_HIGHER@
38 # Directory of the Java SDK.
39 # Example: setenv OO_SDK_JAVA_HOME "/usr/jdk/jdk1.6.0_10"
40 setenv OO_SDK_JAVA_HOME @OO_SDK_JAVA_HOME@
42 # Special output directory
43 # Example: setenv OO_SDK_OUTPUT_DIR "$HOME"
44 setenv OO_SDK_OUTPUT_DIR @OO_SDK_OUTPUT_DIR@
46 # Environment variable to enable auto deployment of example components
47 # Example: set SDK_AUTO_DEPLOYMENT=YES
48 setenv SDK_AUTO_DEPLOYMENT @SDK_AUTO_DEPLOYMENT@
50 # Get the operating system.
51 set sdk_platform
=`${OO_SDK_HOME}/config.guess | cut -d"-" -f3,4`
53 # Set the directory name.
54 set programdir
=program
56 switch
(${sdk_platform})
58 set programdir
="Contents/MacOS"
64 # Set office program path.
65 if ( "${OFFICE_HOME}" != "" ) then
66 setenv OFFICE_PROGRAM_PATH
"${OFFICE_HOME}/${programdir}"
69 # Set office base program path.
70 if ( "${OFFICE_BASE_HOME}" != "" ) then
71 setenv OFFICE_BASE_PROGRAM_PATH
"${OFFICE_BASE_HOME}/program"
75 # Set UNO path, necessary to ensure that the cpp examples using the
76 # new UNO bootstrap mechanism use the configured office installation.
77 if ( ${?OFFICE_PROGRAM_PATH} ) then
78 setenv UNO_PATH
"${OFFICE_PROGRAM_PATH}"
81 if ( "${OO_SDK_URE_HOME}" != "" ) then
82 setenv OO_SDK_URE_BIN_DIR
"${OO_SDK_URE_HOME}/bin"
83 setenv OO_SDK_URE_LIB_DIR
"${OO_SDK_URE_HOME}/lib"
84 setenv OO_SDK_URE_JAVA_DIR
"${OO_SDK_URE_HOME}/share/java"
86 setenv OO_SDK_URE_BIN_DIR
"${OFFICE_PROGRAM_PATH}"
87 setenv OO_SDK_URE_LIB_DIR
"${OFFICE_BASE_PROGRAM_PATH}"
88 setenv OO_SDK_URE_JAVA_DIR
"${OFFICE_BASE_PROGRAM_PATH}/classes"
91 # Set SDK example output directory
92 setenv OO_SDK_OUT
${OO_SDK_HOME}
93 if ( $?OO_SDK_OUTPUT_DIR
) then
94 setenv OO_SDK_OUT
${OO_SDK_OUTPUT_DIR}/${OO_SDK_NAME}
97 # check platform and set appropriate variables
98 switch
(`${OO_SDK_HOME}/config.guess | cut -d"-" -f3,4`)
100 if ( `${OO_SDK_HOME}/config.guess | cut -d"-" -f1` == "sparc" ) then
101 set directoryname
=solsparc
102 set platform
=Solaris Sparc
104 set directoryname
=solintel
105 set platform
=Solaris Intel
110 set exampleout
=SOLARISexample.out
113 # set LD_LIBRARY_PATH
114 if ( $?LD_LIBARY_PATH
== 0) then
115 setenv LD_LIBRARY_PATH
${OO_SDK_HOME}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.
117 setenv LD_LIBRARY_PATH
${OO_SDK_HOME}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.:${LD_LIBRARY_PATH}
122 if ( $?OO_SDK_CPP_HOME
== 0) then
123 set sdk_gxx_include_path
=`echo "#include <cstring>" | ${OO_SDK_CPP_HOME}/g++ -E -xc++ - | sed -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1`
124 setenv SDK_GXX_INCLUDE_PATH
${sdk_gxx_include_path}
127 set directoryname
=linux
131 set exampleout
=LINUXexample.out
133 set stldebug
=_stldebug
135 # set LD_LIBRARY_PATH
136 if ( $?LD_LIBARY_PATH
== 0) then
137 setenv LD_LIBRARY_PATH
${OO_SDK_HOME}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.
139 setenv LD_LIBRARY_PATH
${OO_SDK_HOME}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.:${LD_LIBRARY_PATH}
144 if ( $?OO_SDK_CPP_HOME
== 0) then
145 set sdk_gxx_include_path
=`echo "#include <cstring>" | ${OO_SDK_CPP_HOME}/g++ -E -xc++ - | sed -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1`
146 setenv SDK_GXX_INCLUDE_PATH
${sdk_gxx_include_path}
149 set directoryname
=macosx
153 set exampleout
=MACOSXexample.out
155 set stldebug
=_stldebug
157 # set DYLD_LIBRARY_PATH
158 if ( $?DYLD_LIBRARY_PATH
== 0) then
159 setenv DYLD_LIBRARY_PATH
${OO_SDK_OUT}/${directoryname}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.
161 setenv DYLD_LIBRARY_PATH
${OO_SDK_OUT}/${directoryname}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.:${DYLD_LIBRARY_PATH}
166 if ( $?OO_SDK_CPP_HOME
== 0) then
167 set sdk_gxx_include_path
=`echo "#include <cstring>" | ${OO_SDK_CPP_HOME}/g++ -E -xc++ - | sed -n '/.*1*"\(.*\)\/cstring".*/s//\1/p' | head -n 1`
168 setenv SDK_GXX_INCLUDE_PATH
${sdk_gxx_include_path}
171 set directoryname
=freebsd
175 set exampleout
=FREEBSDexample.out
177 set stldebug
=_stldebug
179 # set LD_LIBRARY_PATH
180 if ( $?LD_LIBARY_PATH
== 0) then
181 setenv LD_LIBRARY_PATH
${OO_SDK_HOME}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.
183 setenv LD_LIBRARY_PATH
${OO_SDK_HOME}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.:${LD_LIBRARY_PATH}
186 if ( -e "/sbin/sysctl" ) then
187 set OSVERSION
=`/sbin/sysctl -n kern.osreldate`
189 set OSVERSION
=`/usr/sbin/sysctl -n kern.osreldate`
192 if ( ${OSVERSION} < 500016 ) then
193 setenv PTHREAD_CFLAGS
-D_THREAD_SAFE
194 setenv PTHREAD_LIBS
-pthread
195 else if ( ${OSVERSION} < 502102 ) then
196 setenv PTHREAD_CFLAGS
-D_THREAD_SAFE
197 setenv PTHREAD_LIBS
-lc_r
199 setenv PTHREAD_LIBS
-pthread
205 if ( $?PATH
== 0) then
206 setenv PATH
${OO_SDK_ZIP_HOME}:${OO_SDK_MAKE_HOME}:${OO_SDK_HOME}/bin:${OO_SDK_OUT}/${exampleout}:${OO_SDK_URE_BIN_DIR}:.
208 setenv PATH
${OO_SDK_ZIP_HOME}:${OO_SDK_MAKE_HOME}:${OO_SDK_HOME}/bin:${OO_SDK_OUT}/${exampleout}:${OO_SDK_URE_BIN_DIR}:.:${PATH}
212 if ( ${?OFFICE_PROGRAM_PATH} ) then
213 if ( ${?CLASSPATH} == 0 ) then
214 setenv CLASSPATH
"${OFFICE_PROGRAM_PATH}/classes/unoil.jar"
216 setenv CLASSPATH
"${OFFICE_PROGRAM_PATH}/classes/unoil.jar:${CLASSPATH}"
219 if ( $?CLASSPATH
== 0) then
220 setenv 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"
222 setenv 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:${CLASSPATH}"
225 if ( $?OO_SDK_CPP_HOME
== 0) then
226 setenv PATH
${OO_SDK_CPP_HOME}:${PATH}
229 if ( $?OO_SDK_JAVA_HOME
== 0) then
230 setenv PATH
${OO_SDK_JAVA_HOME}:${PATH}
233 if ( -r "${OO_SDK_URE_LIB_DIR}/libstlport_${pltfrm}${stldebug}.${soext}" ) then
234 setenv STLDEBUG
${stldebug}
240 if [ "${platform}" == "MacOSX" ] then
241 # For URE, prepare symbolic links for libraries:
242 # Only necessary on MacOSX, on other Unix systems the links are already prepared
243 # in the SDK installation.
245 # cleanup potential old links first
246 rm -f "${OO_SDK_OUT}/${directoryname}/lib/libuno_cppu.so" \
247 "${OO_SDK_OUT}/${directoryname}/lib/libuno_cppuhelper${comid}.${soext}" \
248 "${OO_SDK_OUT}/${directoryname}/lib/libuno_sal.${soext}" \
249 "${OO_SDK_OUT}/${directoryname}/lib/libuno_salhelper${comid}.${soext}" \
250 "${OO_SDK_OUT}/${directoryname}/lib/libuno_purpenvhelper${comid}.${soext}"
252 if ( -e "${OO_SDK_OUT}/${directoryname}/lib/libstlport_${pltfrm}${STLDEBUG}.${soext}" ) then
253 rm -rf "${OO_SDK_OUT}/${directoryname}/lib/libstlport_${pltfrm}${STLDEBUG}.${soext}"
256 if ( "${OO_SDK_URE_HOME}" != "" ) then
257 mkdir
-p "${OO_SDK_OUT}/${directoryname}/lib"
258 ln -s "${OO_SDK_URE_LIB_DIR}/libuno_cppu.${soext}.3" \
259 "${OO_SDK_OUT}/${directoryname}/lib/libuno_cppu.${soext}"
260 ln -s "${OO_SDK_URE_LIB_DIR}/libuno_cppuhelper${comid}.${soext}.3" \
261 "${OO_SDK_OUT}/${directoryname}/lib/libuno_cppuhelper${comid}.${soext}"
262 ln -s "${OO_SDK_URE_LIB_DIR}/libuno_sal.${soext}.3" \
263 "${OO_SDK_OUT}/${directoryname}/lib/libuno_sal.${soext}"
264 ln -s "${OO_SDK_URE_LIB_DIR}/libuno_salhelper${comid}.${soext}.3" \
265 "${OO_SDK_OUT}/${directoryname}/lib/libuno_salhelper${comid}.${soext}"
266 ln -s "${OO_SDK_URE_LIB_DIR}/libuno_purpenvhelper${comid}.${soext}.3" \
267 "${OO_SDK_OUT}/${directoryname}/lib/libuno_purpenvhelper${comid}.${soext}"
269 if ( -r "${OO_SDK_URE_LIB_DIR}/libstlport_${pltfrm}${STLDEBUG}.${soext}" ) then
270 ln -s "${OO_SDK_URE_LIB_DIR}/libstlport_${pltfrm}${STLDEBUG}.${soext}" \
271 "${OO_SDK_OUT}/${directoryname}/lib/libstlport_${pltfrm}${STLDEBUG}.${soext}"
278 echo " ************************************************************************"
280 echo " * SDK environment is prepared for ${platform}"
282 echo " * SDK = ${OO_SDK_HOME}"
283 echo " * Office = ${OFFICE_HOME}"
284 echo " * Office Base = ${OFFICE_BASE_HOME}"
285 echo " * URE = ${OO_SDK_URE_HOME}"
286 echo " * Make = ${OO_SDK_MAKE_HOME}"
287 echo " * Zip = ${OO_SDK_ZIP_HOME}"
288 if ( $?OO_SDK_CPP_HOME
== 0) then
289 echo " * C++ Compiler = "
291 echo " * C++ Compiler = ${OO_SDK_CPP_HOME}"
293 if ( $?OO_SDK_JAVA_HOME
== 0) then
296 echo " * Java = ${OO_SDK_JAVA_HOME}"
298 if ( $?OO_SDK_OUTPUT_DIR
== 0) then
299 echo " * Special Output directory = "
301 echo " * SDK Output directory = ${OO_SDK_OUT}"
303 echo " * Auto deployment = ${SDK_AUTO_DEPLOYMENT}"
305 echo " ************************************************************************"
313 echo "\e]2;Shell prepared with the SDK environment\a"