source: snovis/trunk/obuild/setup.sh@ 138

Last change on this file since 138 was 137, checked in by barrand, 19 years ago
File size: 6.9 KB
Line 
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
43obuild_snovis_path="@@absolute_dir@@"
44
45if [ "${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
66fi
67
68if [ "${OBUILD_PLATFORM}" = "" ] ; then
69 obuild_platform=`uname`
70else
71 obuild_platform=${OBUILD_PLATFORM}
72fi
73
74if [ "${obuild_platform}" = "" ] ; then
75 echo "obuild_platform variable not defined."
76 return
77fi
78
79if [ "${OBUILD_DIR_BIN}" = "" ] ; then
80 obuild_dir_bin=${obuild_platform}_obuild
81else
82 obuild_dir_bin=${OBUILD_DIR_BIN}
83fi
84
85if [ "${obuild_dir_bin}" = "" ] ; then
86 echo "obuild_dir_bin variable not defined."
87 return
88fi
89
90if [ ! -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
110fi
111obuild_platform_exe="${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform"
112if [ "${obuild_platform_exe}" = "" ] ; then
113 echo "Variable obuild_platform_exe not defined."
114 return
115fi
116obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
117if [ ${obuild_platform_result} = yes ] ; then
118CLHEP_home="/usr/local/CLHEP/2.0.3.1"
119fi
120unset obuild_platform_result
121if [ "${obuild_platform_exe}" = "" ] ; then
122 echo "Variable obuild_platform_exe not defined."
123 return
124fi
125obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
126if [ ${obuild_platform_result} = yes ] ; then
127Geant4_home="/usr/local/geant4/8.2"
128fi
129unset obuild_platform_result
130if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" ] ; then
131 if [ ! -e "${obuild_snovis_path}/obuild/cpp/obuild_find.cpp" ] ; then
132 echo "Program source obuild_find.cpp not found."
133 return
134 fi
135 if [ "${obuild_cxx_command}" = "" ] ; then
136 if [ "${OBUILD_CXX}" != "" ] ; then
137 obuild_find_compiler=${OBUILD_CXX}
138 else
139 obuild_find_compiler=c++
140 fi
141 else
142 obuild_find_compiler=${obuild_cxx_command}
143 fi
144 ${obuild_find_compiler} -o "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" "${obuild_snovis_path}/obuild/cpp/obuild_find.cpp"
145 unset obuild_find_compiler
146 if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" ] ; then
147 echo "Program obuild_find not found."
148 return
149 fi
150fi
151obuild_find_exe="${obuild_snovis_path}/${obuild_dir_bin}/obuild_find"
152if [ "${obuild_find_exe}" = "" ] ; then
153 echo "Variable obuild_find_exe not defined."
154 return
155fi
156obuild_OnX_path=`"${obuild_find_exe}" OnX 'v17r*'`
157if [ "${obuild_OnX_path}" = "" ] ; then
158 echo "Can't find OnX package."
159 return
160fi
161if [ "${obuild_find_exe}" = "" ] ; then
162 echo "Variable obuild_find_exe not defined."
163 return
164fi
165obuild_G4Lab_path=`"${obuild_find_exe}" G4Lab 'v8r*'`
166if [ "${obuild_G4Lab_path}" = "" ] ; then
167 echo "Can't find G4Lab package."
168 return
169fi
170
171# Execute setup of used packages :
172if [ ! -e "${obuild_OnX_path}/obuild/setup.sh" ] ; then
173 echo "setup.sh not found for package OnX."
174 return
175fi
176. "${obuild_OnX_path}/obuild/setup.sh"
177
178if [ ! -e "${obuild_G4Lab_path}/obuild/setup.sh" ] ; then
179 echo "setup.sh not found for package G4Lab."
180 return
181fi
182. "${obuild_G4Lab_path}/obuild/setup.sh"
183
184# Set environment variables of this package :
185SNOVISROOT="${obuild_snovis_path}"
186export SNOVISROOT
187G4RADIOACTIVEDATA="${Geant4_home}/data/RadiativeDecay3.1"
188export G4RADIOACTIVEDATA
189G4LEVELGAMMADATA="${Geant4_home}/data/PhotonEvaporation2.0"
190export G4LEVELGAMMADATA
191G4LEDATA="${Geant4_home}/data/G4EMLOW4.2"
192export G4LEDATA
193NeutronHPCrossSections="${Geant4_home}/data/G4NDL3.10"
194export NeutronHPCrossSections
195
196if [ "${obuild_platform_exe}" = "" ] ; then
197 echo "Variable obuild_platform_exe not defined."
198 return
199fi
200obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
201if [ ${obuild_platform_result} = yes ] ; then
202 if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then
203 DYLD_LIBRARY_PATH="${obuild_snovis_path}/${obuild_dir_bin}"
204 export DYLD_LIBRARY_PATH
205 else
206 DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${obuild_snovis_path}/${obuild_dir_bin}"
207 export DYLD_LIBRARY_PATH
208 fi
209else
210 if [ "${LD_LIBRARY_PATH}" = "" ] ; then
211 LD_LIBRARY_PATH="${obuild_snovis_path}/${obuild_dir_bin}"
212 export LD_LIBRARY_PATH
213 else
214 LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${obuild_snovis_path}/${obuild_dir_bin}"
215 export LD_LIBRARY_PATH
216 fi
217fi
218unset obuild_platform_result
219
220if [ "${PATH}" = "" ] ; then
221 PATH="${obuild_snovis_path}/${obuild_dir_bin}"
222 export PATH
223else
224 PATH="${PATH}:${obuild_snovis_path}/${obuild_dir_bin}"
225 export PATH
226fi
227unset obuild_snovis_path
228
229#FIXME unset obuild_platform
230#FIXME unset obuild_dir_bin
Note: See TracBrowser for help on using the repository browser.