1 | #!/bin/sh -f |
---|
2 | |
---|
3 | # |
---|
4 | # File produced by the obuild tool version 1.0 |
---|
5 | # for the package snovis with version v1r1. |
---|
6 | # |
---|
7 | |
---|
8 | #//////////////////////////////////////////////// |
---|
9 | # Usage : |
---|
10 | # sh> . setup.sh |
---|
11 | #//////////////////////////////////////////////// |
---|
12 | |
---|
13 | #set -x # uncomment this line to have full verbosity. |
---|
14 | |
---|
15 | #//////////////////////////////////////////////// |
---|
16 | # Set the absolute path of this package. |
---|
17 | # If in the below line there is the keyword : |
---|
18 | # |
---|
19 | # @@absolute_dir@@ |
---|
20 | # |
---|
21 | # then the package had not been installed. |
---|
22 | # |
---|
23 | # Someone has to replace @@absolute_dir@@ |
---|
24 | # by the absolute path of the package. |
---|
25 | # By "absolute path of the package", we mean that |
---|
26 | # if the obuild directory of the package is |
---|
27 | # found under : |
---|
28 | # some_path/pack/vers/obuild |
---|
29 | # then the "absolute path of the package" is : |
---|
30 | # some_path/pack/vers |
---|
31 | # |
---|
32 | # This replacement can be done on the setup |
---|
33 | # scripts of the package by using the sh/build |
---|
34 | # with the -i option. |
---|
35 | # |
---|
36 | # This replacement can be done recursively |
---|
37 | # on the setups of the used packages by using |
---|
38 | # the sh/build script with the -bci option |
---|
39 | # ("bci" for broadcast install). |
---|
40 | # |
---|
41 | #//////////////////////////////////////////////// |
---|
42 | |
---|
43 | obuild_snovis_path="@@absolute_dir@@" |
---|
44 | |
---|
45 | if [ "${obuild_snovis_path}" = '@@absolute_dir@@' ] ; then |
---|
46 | echo ' The package snovis had not been installed.' |
---|
47 | echo '' |
---|
48 | echo ' In the file :' |
---|
49 | echo ' snovis/<vers>/obuild/setup.sh' |
---|
50 | echo ' someone has to replace ' |
---|
51 | echo ' @@absolute_dir@@' |
---|
52 | echo ' by the absolute path of the package.' |
---|
53 | echo ' By "absolute path of the package", we mean that' |
---|
54 | echo ' if the obuild directory of the package is found under :' |
---|
55 | echo ' some_path/pack/vers/obuild' |
---|
56 | echo ' then the "absolute path of the package" is :' |
---|
57 | echo ' some_path/pack/vers' |
---|
58 | echo '' |
---|
59 | echo ' If having the write access, this replacement can be done' |
---|
60 | echo ' on the setup scripts of the package by using the sh/build' |
---|
61 | echo ' with the -i option. This replacement can be done recursively' |
---|
62 | echo ' on the setups of the used packages by using the sh/build script' |
---|
63 | echo ' with the -bci option ("bci" for broadcast install).' |
---|
64 | echo '' |
---|
65 | return |
---|
66 | fi |
---|
67 | |
---|
68 | if [ "${OBUILD_PLATFORM}" = "" ] ; then |
---|
69 | obuild_platform=`uname` |
---|
70 | else |
---|
71 | obuild_platform=${OBUILD_PLATFORM} |
---|
72 | fi |
---|
73 | |
---|
74 | if [ "${obuild_platform}" = "" ] ; then |
---|
75 | echo "obuild_platform variable not defined." |
---|
76 | return |
---|
77 | fi |
---|
78 | |
---|
79 | if [ "${OBUILD_DIR_BIN}" = "" ] ; then |
---|
80 | obuild_dir_bin=${obuild_platform}_obuild |
---|
81 | else |
---|
82 | obuild_dir_bin=${OBUILD_DIR_BIN} |
---|
83 | fi |
---|
84 | |
---|
85 | if [ "${obuild_dir_bin}" = "" ] ; then |
---|
86 | echo "obuild_dir_bin variable not defined." |
---|
87 | return |
---|
88 | fi |
---|
89 | |
---|
90 | if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform" ] ; then |
---|
91 | if [ ! -e "${obuild_snovis_path}/obuild/cpp/obuild_platform.cpp" ] ; then |
---|
92 | echo "Program source obuild_platform.cpp not found." |
---|
93 | return |
---|
94 | fi |
---|
95 | if [ "${obuild_cxx_command}" = "" ] ; then |
---|
96 | if [ "${OBUILD_CXX}" != "" ] ; then |
---|
97 | obuild_platform_compiler=${OBUILD_CXX} |
---|
98 | else |
---|
99 | obuild_platform_compiler=c++ |
---|
100 | fi |
---|
101 | else |
---|
102 | obuild_platform_compiler=${obuild_cxx_command} |
---|
103 | fi |
---|
104 | ${obuild_platform_compiler} -o "${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform" "${obuild_snovis_path}/obuild/cpp/obuild_platform.cpp" |
---|
105 | unset obuild_platform_compiler |
---|
106 | if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform" ] ; then |
---|
107 | echo "Program obuild_platform not found." |
---|
108 | return |
---|
109 | fi |
---|
110 | fi |
---|
111 | obuild_platform_exe="${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform" |
---|
112 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
113 | echo "Variable obuild_platform_exe not defined." |
---|
114 | return |
---|
115 | fi |
---|
116 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
117 | if [ ${obuild_platform_result} = yes ] ; then |
---|
118 | CLHEP_home="/usr/local/CLHEP/2.0.3.1" |
---|
119 | fi |
---|
120 | unset obuild_platform_result |
---|
121 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
122 | echo "Variable obuild_platform_exe not defined." |
---|
123 | return |
---|
124 | fi |
---|
125 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
126 | if [ ${obuild_platform_result} = yes ] ; then |
---|
127 | Geant4_home="/usr/local/geant4/8.2" |
---|
128 | fi |
---|
129 | unset obuild_platform_result |
---|
130 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
131 | echo "Variable obuild_platform_exe not defined." |
---|
132 | return |
---|
133 | fi |
---|
134 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
135 | if [ ${obuild_platform_result} = yes ] ; then |
---|
136 | HDF5_home="/usr/local/HDF5/1.6.5" |
---|
137 | fi |
---|
138 | unset obuild_platform_result |
---|
139 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
140 | echo "Variable obuild_platform_exe not defined." |
---|
141 | return |
---|
142 | fi |
---|
143 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
144 | if [ ${obuild_platform_result} = yes ] ; then |
---|
145 | OSC_home="/usr/local/OpenScientist/v16r0" |
---|
146 | fi |
---|
147 | unset obuild_platform_result |
---|
148 | if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" ] ; then |
---|
149 | if [ ! -e "${obuild_snovis_path}/obuild/cpp/obuild_find.cpp" ] ; then |
---|
150 | echo "Program source obuild_find.cpp not found." |
---|
151 | return |
---|
152 | fi |
---|
153 | if [ "${obuild_cxx_command}" = "" ] ; then |
---|
154 | if [ "${OBUILD_CXX}" != "" ] ; then |
---|
155 | obuild_find_compiler=${OBUILD_CXX} |
---|
156 | else |
---|
157 | obuild_find_compiler=c++ |
---|
158 | fi |
---|
159 | else |
---|
160 | obuild_find_compiler=${obuild_cxx_command} |
---|
161 | fi |
---|
162 | ${obuild_find_compiler} -o "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" "${obuild_snovis_path}/obuild/cpp/obuild_find.cpp" |
---|
163 | unset obuild_find_compiler |
---|
164 | if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" ] ; then |
---|
165 | echo "Program obuild_find not found." |
---|
166 | return |
---|
167 | fi |
---|
168 | fi |
---|
169 | obuild_find_exe="${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" |
---|
170 | if [ "${obuild_find_exe}" = "" ] ; then |
---|
171 | echo "Variable obuild_find_exe not defined." |
---|
172 | return |
---|
173 | fi |
---|
174 | obuild_snova_path=`"${obuild_find_exe}" snova 'v2r0p0'` |
---|
175 | if [ "${obuild_snova_path}" = "" ] ; then |
---|
176 | echo "Can't find snova package." |
---|
177 | return |
---|
178 | fi |
---|
179 | |
---|
180 | # Execute setup of used packages : |
---|
181 | if [ ! -e "${obuild_snova_path}/obuild/setup.sh" ] ; then |
---|
182 | echo "setup.sh not found for package snova." |
---|
183 | return |
---|
184 | fi |
---|
185 | . "${obuild_snova_path}/obuild/setup.sh" |
---|
186 | |
---|
187 | # Set environment variables of this package : |
---|
188 | SNOVISROOT="${obuild_snovis_path}" |
---|
189 | export SNOVISROOT |
---|
190 | ONXROOT="${OSC_home}/Resources/OnX" |
---|
191 | export ONXROOT |
---|
192 | ONXLABROOT="${OSC_home}/Resources/OnXLab" |
---|
193 | export ONXLABROOT |
---|
194 | G4LABROOT="${obuild_snovis_path}/Resources/G4Lab" |
---|
195 | export G4LABROOT |
---|
196 | |
---|
197 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
198 | echo "Variable obuild_platform_exe not defined." |
---|
199 | return |
---|
200 | fi |
---|
201 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'` |
---|
202 | if [ ${obuild_platform_result} = yes ] ; then |
---|
203 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
204 | echo "Variable obuild_platform_exe not defined." |
---|
205 | return |
---|
206 | fi |
---|
207 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
208 | if [ ${obuild_platform_result} = yes ] ; then |
---|
209 | if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then |
---|
210 | DYLD_LIBRARY_PATH="${HDF5_home}/lib" |
---|
211 | export DYLD_LIBRARY_PATH |
---|
212 | else |
---|
213 | DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${HDF5_home}/lib" |
---|
214 | export DYLD_LIBRARY_PATH |
---|
215 | fi |
---|
216 | fi |
---|
217 | unset obuild_platform_result |
---|
218 | else |
---|
219 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
220 | echo "Variable obuild_platform_exe not defined." |
---|
221 | return |
---|
222 | fi |
---|
223 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
224 | if [ ${obuild_platform_result} = yes ] ; then |
---|
225 | if [ "${LD_LIBRARY_PATH}" = "" ] ; then |
---|
226 | LD_LIBRARY_PATH="${HDF5_home}/lib" |
---|
227 | export LD_LIBRARY_PATH |
---|
228 | else |
---|
229 | LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${HDF5_home}/lib" |
---|
230 | export LD_LIBRARY_PATH |
---|
231 | fi |
---|
232 | fi |
---|
233 | unset obuild_platform_result |
---|
234 | fi |
---|
235 | unset obuild_platform_result |
---|
236 | |
---|
237 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
238 | echo "Variable obuild_platform_exe not defined." |
---|
239 | return |
---|
240 | fi |
---|
241 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'` |
---|
242 | if [ ${obuild_platform_result} = yes ] ; then |
---|
243 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
244 | echo "Variable obuild_platform_exe not defined." |
---|
245 | return |
---|
246 | fi |
---|
247 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
248 | if [ ${obuild_platform_result} = yes ] ; then |
---|
249 | if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then |
---|
250 | DYLD_LIBRARY_PATH="${CLHEP_home}/lib" |
---|
251 | export DYLD_LIBRARY_PATH |
---|
252 | else |
---|
253 | DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${CLHEP_home}/lib" |
---|
254 | export DYLD_LIBRARY_PATH |
---|
255 | fi |
---|
256 | fi |
---|
257 | unset obuild_platform_result |
---|
258 | else |
---|
259 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
260 | echo "Variable obuild_platform_exe not defined." |
---|
261 | return |
---|
262 | fi |
---|
263 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
264 | if [ ${obuild_platform_result} = yes ] ; then |
---|
265 | if [ "${LD_LIBRARY_PATH}" = "" ] ; then |
---|
266 | LD_LIBRARY_PATH="${CLHEP_home}/lib" |
---|
267 | export LD_LIBRARY_PATH |
---|
268 | else |
---|
269 | LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${CLHEP_home}/lib" |
---|
270 | export LD_LIBRARY_PATH |
---|
271 | fi |
---|
272 | fi |
---|
273 | unset obuild_platform_result |
---|
274 | fi |
---|
275 | unset obuild_platform_result |
---|
276 | |
---|
277 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
278 | echo "Variable obuild_platform_exe not defined." |
---|
279 | return |
---|
280 | fi |
---|
281 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'` |
---|
282 | if [ ${obuild_platform_result} = yes ] ; then |
---|
283 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
284 | echo "Variable obuild_platform_exe not defined." |
---|
285 | return |
---|
286 | fi |
---|
287 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
288 | if [ ${obuild_platform_result} = yes ] ; then |
---|
289 | if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then |
---|
290 | DYLD_LIBRARY_PATH="${Geant4_home}/lib" |
---|
291 | export DYLD_LIBRARY_PATH |
---|
292 | else |
---|
293 | DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${Geant4_home}/lib" |
---|
294 | export DYLD_LIBRARY_PATH |
---|
295 | fi |
---|
296 | fi |
---|
297 | unset obuild_platform_result |
---|
298 | else |
---|
299 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
300 | echo "Variable obuild_platform_exe not defined." |
---|
301 | return |
---|
302 | fi |
---|
303 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
304 | if [ ${obuild_platform_result} = yes ] ; then |
---|
305 | if [ "${LD_LIBRARY_PATH}" = "" ] ; then |
---|
306 | LD_LIBRARY_PATH="${Geant4_home}/lib" |
---|
307 | export LD_LIBRARY_PATH |
---|
308 | else |
---|
309 | LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${Geant4_home}/lib" |
---|
310 | export LD_LIBRARY_PATH |
---|
311 | fi |
---|
312 | fi |
---|
313 | unset obuild_platform_result |
---|
314 | fi |
---|
315 | unset obuild_platform_result |
---|
316 | |
---|
317 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
318 | echo "Variable obuild_platform_exe not defined." |
---|
319 | return |
---|
320 | fi |
---|
321 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'` |
---|
322 | if [ ${obuild_platform_result} = yes ] ; then |
---|
323 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
324 | echo "Variable obuild_platform_exe not defined." |
---|
325 | return |
---|
326 | fi |
---|
327 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
328 | if [ ${obuild_platform_result} = yes ] ; then |
---|
329 | if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then |
---|
330 | DYLD_LIBRARY_PATH="${OSC_home}/bin" |
---|
331 | export DYLD_LIBRARY_PATH |
---|
332 | else |
---|
333 | DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${OSC_home}/bin" |
---|
334 | export DYLD_LIBRARY_PATH |
---|
335 | fi |
---|
336 | fi |
---|
337 | unset obuild_platform_result |
---|
338 | else |
---|
339 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
340 | echo "Variable obuild_platform_exe not defined." |
---|
341 | return |
---|
342 | fi |
---|
343 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
344 | if [ ${obuild_platform_result} = yes ] ; then |
---|
345 | if [ "${LD_LIBRARY_PATH}" = "" ] ; then |
---|
346 | LD_LIBRARY_PATH="${OSC_home}/bin" |
---|
347 | export LD_LIBRARY_PATH |
---|
348 | else |
---|
349 | LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${OSC_home}/bin" |
---|
350 | export LD_LIBRARY_PATH |
---|
351 | fi |
---|
352 | fi |
---|
353 | unset obuild_platform_result |
---|
354 | fi |
---|
355 | unset obuild_platform_result |
---|
356 | |
---|
357 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
358 | echo "Variable obuild_platform_exe not defined." |
---|
359 | return |
---|
360 | fi |
---|
361 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'` |
---|
362 | if [ ${obuild_platform_result} = yes ] ; then |
---|
363 | if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then |
---|
364 | DYLD_LIBRARY_PATH="${obuild_snovis_path}/${obuild_dir_bin}" |
---|
365 | export DYLD_LIBRARY_PATH |
---|
366 | else |
---|
367 | DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${obuild_snovis_path}/${obuild_dir_bin}" |
---|
368 | export DYLD_LIBRARY_PATH |
---|
369 | fi |
---|
370 | else |
---|
371 | if [ "${LD_LIBRARY_PATH}" = "" ] ; then |
---|
372 | LD_LIBRARY_PATH="${obuild_snovis_path}/${obuild_dir_bin}" |
---|
373 | export LD_LIBRARY_PATH |
---|
374 | else |
---|
375 | LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${obuild_snovis_path}/${obuild_dir_bin}" |
---|
376 | export LD_LIBRARY_PATH |
---|
377 | fi |
---|
378 | fi |
---|
379 | unset obuild_platform_result |
---|
380 | |
---|
381 | if [ "${PATH}" = "" ] ; then |
---|
382 | PATH="${obuild_snovis_path}/${obuild_dir_bin}" |
---|
383 | export PATH |
---|
384 | else |
---|
385 | PATH="${PATH}:${obuild_snovis_path}/${obuild_dir_bin}" |
---|
386 | export PATH |
---|
387 | fi |
---|
388 | unset obuild_snovis_path |
---|
389 | |
---|
390 | #FIXME unset obuild_platform |
---|
391 | #FIXME unset obuild_dir_bin |
---|