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/libreoffice/basis3.4/sdk
12 setenv OO_SDK_HOME
'@OO_SDK_HOME@'
14 # Office installation directory.
15 # Example: set OFFICE_HOME=/opt/libreoffice
16 setenv OFFICE_HOME
'@OFFICE_HOME@'
18 # URE installation directory.
19 # Example: setenv OO_SDK_URE_HOME /opt/libreoffice/ure
20 setenv OO_SDK_URE_HOME
'@OO_SDK_URE_HOME@'
22 # Directory of the make command.
23 # Example: setenv OO_SDK_MAKE_HOME /usr/bin
24 setenv OO_SDK_MAKE_HOME @OO_SDK_MAKE_HOME@
26 # Directory of the zip command.
27 # Example: setenv OO_SDK_ZIP_HOME /usr/bin
28 setenv OO_SDK_ZIP_HOME @OO_SDK_ZIP_HOME@
30 # Directory of the C++ compiler.
31 # Example: setenv OO_SDK_CPP_HOME /usr/bin
32 setenv OO_SDK_CPP_HOME @OO_SDK_CPP_HOME@
35 setenv OO_SDK_CC_55_OR_HIGHER @OO_SDK_CC_55_OR_HIGHER@
37 # Directory of the Java SDK.
38 # Example: setenv OO_SDK_JAVA_HOME "/usr/jdk/jdk1.6.0_10"
39 setenv OO_SDK_JAVA_HOME @OO_SDK_JAVA_HOME@
41 # Special output directory
42 # Example: setenv OO_SDK_OUTPUT_DIR "$HOME"
43 setenv OO_SDK_OUTPUT_DIR @OO_SDK_OUTPUT_DIR@
45 # Environment variable to enable auto deployment of example components
46 # Example: set SDK_AUTO_DEPLOYMENT=YES
47 setenv SDK_AUTO_DEPLOYMENT @SDK_AUTO_DEPLOYMENT@
49 # Get the operating system.
50 set sdk_platform
=`${OO_SDK_HOME}/config.guess | cut -d"-" -f3,4`
52 # Set the directory name.
53 set programdir
=program
55 switch
(${sdk_platform})
57 set programdir
="Contents/MacOS"
63 # Set office program path.
64 if ( "${OFFICE_HOME}" != "" ) then
65 setenv OFFICE_PROGRAM_PATH
"${OFFICE_HOME}/${programdir}"
69 # Set UNO path, necessary to ensure that the cpp examples using the
70 # new UNO bootstrap mechanism use the configured office installation.
71 if ( ${?OFFICE_PROGRAM_PATH} ) then
72 setenv UNO_PATH
"${OFFICE_PROGRAM_PATH}"
75 if ( "${OO_SDK_URE_HOME}" != "" ) then
76 setenv OO_SDK_URE_BIN_DIR
"${OO_SDK_URE_HOME}/bin"
77 setenv OO_SDK_URE_LIB_DIR
"${OO_SDK_URE_HOME}/lib"
78 setenv OO_SDK_URE_JAVA_DIR
"${OO_SDK_URE_HOME}/share/java"
80 setenv OO_SDK_URE_BIN_DIR
"${OFFICE_PROGRAM_PATH}"
81 setenv OO_SDK_URE_LIB_DIR
"${OFFICE_PROGRAM_PATH}"
82 setenv OO_SDK_URE_JAVA_DIR
"${OFFICE_PROGRAM_PATH}/classes"
85 # Set SDK example output directory
86 setenv OO_SDK_OUT
${OO_SDK_HOME}
87 if ( $?OO_SDK_OUTPUT_DIR
) then
88 setenv OO_SDK_OUT
${OO_SDK_OUTPUT_DIR}/${OO_SDK_NAME}
91 # check platform and set appropriate variables
92 switch
(`${OO_SDK_HOME}/config.guess | cut -d"-" -f3,4`)
94 if ( `${OO_SDK_HOME}/config.guess | cut -d"-" -f1` == "sparc" ) then
95 set directoryname
=solsparc
96 set platform
=Solaris Sparc
98 set directoryname
=solintel
99 set platform
=Solaris Intel
104 set exampleout
=SOLARISexample.out
106 # set LD_LIBRARY_PATH
107 if ( $?LD_LIBARY_PATH
== 0) then
108 setenv LD_LIBRARY_PATH
${OO_SDK_HOME}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.
110 setenv LD_LIBRARY_PATH
${OO_SDK_HOME}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.:${LD_LIBRARY_PATH}
115 if ( $?OO_SDK_CPP_HOME
== 0) then
116 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`
117 setenv SDK_GXX_INCLUDE_PATH
${sdk_gxx_include_path}
120 set directoryname
=linux
124 set exampleout
=LINUXexample.out
127 # set LD_LIBRARY_PATH
128 if ( $?LD_LIBARY_PATH
== 0) then
129 setenv LD_LIBRARY_PATH
${OO_SDK_HOME}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.
131 setenv LD_LIBRARY_PATH
${OO_SDK_HOME}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.:${LD_LIBRARY_PATH}
136 if ( $?OO_SDK_CPP_HOME
== 0) then
137 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`
138 setenv SDK_GXX_INCLUDE_PATH
${sdk_gxx_include_path}
141 set directoryname
=macosx
145 set exampleout
=MACOSXexample.out
148 # set DYLD_LIBRARY_PATH
149 if ( $?DYLD_LIBRARY_PATH
== 0) then
150 setenv DYLD_LIBRARY_PATH
${OO_SDK_OUT}/${directoryname}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.
152 setenv DYLD_LIBRARY_PATH
${OO_SDK_OUT}/${directoryname}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.:${DYLD_LIBRARY_PATH}
157 if ( $?OO_SDK_CPP_HOME
== 0) then
158 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`
159 setenv SDK_GXX_INCLUDE_PATH
${sdk_gxx_include_path}
162 set directoryname
=freebsd
166 set exampleout
=FREEBSDexample.out
169 # set LD_LIBRARY_PATH
170 if ( $?LD_LIBARY_PATH
== 0) then
171 setenv LD_LIBRARY_PATH
${OO_SDK_HOME}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.
173 setenv LD_LIBRARY_PATH
${OO_SDK_HOME}/lib:${OO_SDK_OUT}/${exampleout}/lib:${OO_SDK_URE_LIB_DIR}:.:${LD_LIBRARY_PATH}
176 if ( -e "/sbin/sysctl" ) then
177 set OSVERSION
=`/sbin/sysctl -n kern.osreldate`
179 set OSVERSION
=`/usr/sbin/sysctl -n kern.osreldate`
182 if ( ${OSVERSION} < 500016 ) then
183 setenv PTHREAD_CFLAGS
-D_THREAD_SAFE
184 setenv PTHREAD_LIBS
-pthread
185 else if ( ${OSVERSION} < 502102 ) then
186 setenv PTHREAD_CFLAGS
-D_THREAD_SAFE
187 setenv PTHREAD_LIBS
-lc_r
189 setenv PTHREAD_LIBS
-pthread
195 if ( $?PATH
== 0) then
196 setenv PATH
${OO_SDK_ZIP_HOME}:${OO_SDK_MAKE_HOME}:${OO_SDK_HOME}/bin:${OO_SDK_OUT}/${exampleout}:${OO_SDK_URE_BIN_DIR}:.
198 setenv PATH
${OO_SDK_ZIP_HOME}:${OO_SDK_MAKE_HOME}:${OO_SDK_HOME}/bin:${OO_SDK_OUT}/${exampleout}:${OO_SDK_URE_BIN_DIR}:.:${PATH}
202 if ( ${?OFFICE_PROGRAM_PATH} ) then
203 if ( ${?CLASSPATH} == 0 ) then
204 setenv CLASSPATH
"${OFFICE_PROGRAM_PATH}/classes/unoil.jar"
206 setenv CLASSPATH
"${OFFICE_PROGRAM_PATH}/classes/unoil.jar:${CLASSPATH}"
209 if ( $?CLASSPATH
== 0) then
210 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"
212 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}"
215 if ( $?OO_SDK_CPP_HOME
== 0) then
216 setenv PATH
${OO_SDK_CPP_HOME}:${PATH}
219 if ( $?OO_SDK_JAVA_HOME
== 0) then
220 setenv PATH
${OO_SDK_JAVA_HOME}:${PATH}
224 if ( "${platform}" == "MacOSX" ) then
225 # For URE, prepare symbolic links for libraries:
226 # Only necessary on MacOSX, on other Unix systems the links are already prepared
227 # in the SDK installation.
229 # cleanup potential old links first
230 rm -f "${OO_SDK_OUT}/${directoryname}/lib/libuno_cppu.so" \
231 "${OO_SDK_OUT}/${directoryname}/lib/libuno_cppuhelper${comid}.${soext}" \
232 "${OO_SDK_OUT}/${directoryname}/lib/libuno_sal.${soext}" \
233 "${OO_SDK_OUT}/${directoryname}/lib/libuno_salhelper${comid}.${soext}" \
234 "${OO_SDK_OUT}/${directoryname}/lib/libuno_purpenvhelper${comid}.${soext}"
236 if ( "${OO_SDK_URE_HOME}" != "" ) then
237 mkdir
-p "${OO_SDK_OUT}/${directoryname}/lib"
238 ln -s "${OO_SDK_URE_LIB_DIR}/libuno_cppu.${soext}.3" \
239 "${OO_SDK_OUT}/${directoryname}/lib/libuno_cppu.${soext}"
240 ln -s "${OO_SDK_URE_LIB_DIR}/libuno_cppuhelper${comid}.${soext}.3" \
241 "${OO_SDK_OUT}/${directoryname}/lib/libuno_cppuhelper${comid}.${soext}"
242 ln -s "${OO_SDK_URE_LIB_DIR}/libuno_sal.${soext}.3" \
243 "${OO_SDK_OUT}/${directoryname}/lib/libuno_sal.${soext}"
244 ln -s "${OO_SDK_URE_LIB_DIR}/libuno_salhelper${comid}.${soext}.3" \
245 "${OO_SDK_OUT}/${directoryname}/lib/libuno_salhelper${comid}.${soext}"
246 ln -s "${OO_SDK_URE_LIB_DIR}/libuno_purpenvhelper${comid}.${soext}.3" \
247 "${OO_SDK_OUT}/${directoryname}/lib/libuno_purpenvhelper${comid}.${soext}"
253 echo " ************************************************************************"
255 echo " * SDK environment is prepared for ${platform}"
257 echo " * SDK = ${OO_SDK_HOME}"
258 echo " * Office = ${OFFICE_HOME}"
259 echo " * URE = ${OO_SDK_URE_HOME}"
260 echo " * Make = ${OO_SDK_MAKE_HOME}"
261 echo " * Zip = ${OO_SDK_ZIP_HOME}"
262 if ( $?OO_SDK_CPP_HOME
== 0) then
263 echo " * C++ Compiler = "
265 echo " * C++ Compiler = ${OO_SDK_CPP_HOME}"
267 if ( $?OO_SDK_JAVA_HOME
== 0) then
270 echo " * Java = ${OO_SDK_JAVA_HOME}"
272 if ( $?OO_SDK_OUTPUT_DIR
== 0) then
273 echo " * Special Output directory = "
275 echo " * SDK Output directory = ${OO_SDK_OUT}"
277 echo " * Auto deployment = ${SDK_AUTO_DEPLOYMENT}"
279 echo " ************************************************************************"
287 echo "\e]2;Shell prepared with the SDK environment\a"