[133] | 1 | #!/bin/sh -f |
---|
| 2 | |
---|
| 3 | # |
---|
| 4 | # File produced by the obuild tool version 1.0 |
---|
[144] | 5 | # for the package snova with version v2r0p0. |
---|
[133] | 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_snova_path="@@absolute_dir@@" |
---|
| 44 | |
---|
| 45 | if [ "${obuild_snova_path}" = '@@absolute_dir@@' ] ; then |
---|
| 46 | echo ' The package snova had not been installed.' |
---|
| 47 | echo '' |
---|
| 48 | echo ' In the file :' |
---|
| 49 | echo ' snova/<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_snova_path}/${obuild_dir_bin}/obuild_platform" ] ; then |
---|
| 91 | if [ ! -e "${obuild_snova_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_snova_path}/${obuild_dir_bin}/obuild_platform" "${obuild_snova_path}/obuild/cpp/obuild_platform.cpp" |
---|
| 105 | unset obuild_platform_compiler |
---|
| 106 | if [ ! -e "${obuild_snova_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_snova_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 |
---|
[184] | 130 | if [ ! -e "${obuild_snova_path}/${obuild_dir_bin}/obuild_find" ] ; then |
---|
| 131 | if [ ! -e "${obuild_snova_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_snova_path}/${obuild_dir_bin}/obuild_find" "${obuild_snova_path}/obuild/cpp/obuild_find.cpp" |
---|
| 145 | unset obuild_find_compiler |
---|
| 146 | if [ ! -e "${obuild_snova_path}/${obuild_dir_bin}/obuild_find" ] ; then |
---|
| 147 | echo "Program obuild_find not found." |
---|
| 148 | return |
---|
| 149 | fi |
---|
| 150 | fi |
---|
| 151 | obuild_find_exe="${obuild_snova_path}/${obuild_dir_bin}/obuild_find" |
---|
| 152 | if [ "${obuild_find_exe}" = "" ] ; then |
---|
| 153 | echo "Variable obuild_find_exe not defined." |
---|
| 154 | return |
---|
| 155 | fi |
---|
| 156 | obuild_bhep_path=`"${obuild_find_exe}" bhep 'v1r4p2'` |
---|
| 157 | if [ "${obuild_bhep_path}" = "" ] ; then |
---|
| 158 | echo "Can't find bhep package." |
---|
| 159 | return |
---|
| 160 | fi |
---|
[185] | 161 | if [ "${obuild_find_exe}" = "" ] ; then |
---|
| 162 | echo "Variable obuild_find_exe not defined." |
---|
| 163 | return |
---|
| 164 | fi |
---|
| 165 | obuild_HDF5_path=`"${obuild_find_exe}" HDF5 'v1r*'` |
---|
| 166 | if [ "${obuild_HDF5_path}" = "" ] ; then |
---|
| 167 | echo "Can't find HDF5 package." |
---|
| 168 | return |
---|
| 169 | fi |
---|
[184] | 170 | |
---|
| 171 | # Execute setup of used packages : |
---|
| 172 | if [ ! -e "${obuild_bhep_path}/obuild/setup.sh" ] ; then |
---|
| 173 | echo "setup.sh not found for package bhep." |
---|
| 174 | return |
---|
| 175 | fi |
---|
| 176 | . "${obuild_bhep_path}/obuild/setup.sh" |
---|
| 177 | |
---|
[185] | 178 | if [ ! -e "${obuild_HDF5_path}/obuild/setup.sh" ] ; then |
---|
| 179 | echo "setup.sh not found for package HDF5." |
---|
| 180 | return |
---|
| 181 | fi |
---|
| 182 | . "${obuild_HDF5_path}/obuild/setup.sh" |
---|
| 183 | |
---|
[133] | 184 | # Set environment variables of this package : |
---|
| 185 | |
---|
| 186 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
| 187 | echo "Variable obuild_platform_exe not defined." |
---|
| 188 | return |
---|
| 189 | fi |
---|
| 190 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'` |
---|
| 191 | if [ ${obuild_platform_result} = yes ] ; then |
---|
[186] | 192 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
| 193 | echo "Variable obuild_platform_exe not defined." |
---|
| 194 | return |
---|
| 195 | fi |
---|
| 196 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
| 197 | if [ ${obuild_platform_result} = yes ] ; then |
---|
[133] | 198 | if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then |
---|
[186] | 199 | DYLD_LIBRARY_PATH="${CLHEP_home}/lib" |
---|
| 200 | export DYLD_LIBRARY_PATH |
---|
| 201 | else |
---|
| 202 | DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${CLHEP_home}/lib" |
---|
| 203 | export DYLD_LIBRARY_PATH |
---|
| 204 | fi |
---|
| 205 | fi |
---|
| 206 | unset obuild_platform_result |
---|
| 207 | else |
---|
| 208 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
| 209 | echo "Variable obuild_platform_exe not defined." |
---|
| 210 | return |
---|
| 211 | fi |
---|
| 212 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
| 213 | if [ ${obuild_platform_result} = yes ] ; then |
---|
| 214 | if [ "${LD_LIBRARY_PATH}" = "" ] ; then |
---|
| 215 | LD_LIBRARY_PATH="${CLHEP_home}/lib" |
---|
| 216 | export LD_LIBRARY_PATH |
---|
| 217 | else |
---|
| 218 | LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${CLHEP_home}/lib" |
---|
| 219 | export LD_LIBRARY_PATH |
---|
| 220 | fi |
---|
| 221 | fi |
---|
| 222 | unset obuild_platform_result |
---|
| 223 | fi |
---|
| 224 | unset obuild_platform_result |
---|
| 225 | |
---|
| 226 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
| 227 | echo "Variable obuild_platform_exe not defined." |
---|
| 228 | return |
---|
| 229 | fi |
---|
| 230 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'` |
---|
| 231 | if [ ${obuild_platform_result} = yes ] ; then |
---|
| 232 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
| 233 | echo "Variable obuild_platform_exe not defined." |
---|
| 234 | return |
---|
| 235 | fi |
---|
| 236 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
| 237 | if [ ${obuild_platform_result} = yes ] ; then |
---|
| 238 | if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then |
---|
| 239 | DYLD_LIBRARY_PATH="${Geant4_home}/lib" |
---|
| 240 | export DYLD_LIBRARY_PATH |
---|
| 241 | else |
---|
| 242 | DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${Geant4_home}/lib" |
---|
| 243 | export DYLD_LIBRARY_PATH |
---|
| 244 | fi |
---|
| 245 | fi |
---|
| 246 | unset obuild_platform_result |
---|
| 247 | else |
---|
| 248 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
| 249 | echo "Variable obuild_platform_exe not defined." |
---|
| 250 | return |
---|
| 251 | fi |
---|
| 252 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'` |
---|
| 253 | if [ ${obuild_platform_result} = yes ] ; then |
---|
| 254 | if [ "${LD_LIBRARY_PATH}" = "" ] ; then |
---|
| 255 | LD_LIBRARY_PATH="${Geant4_home}/lib" |
---|
| 256 | export LD_LIBRARY_PATH |
---|
| 257 | else |
---|
| 258 | LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${Geant4_home}/lib" |
---|
| 259 | export LD_LIBRARY_PATH |
---|
| 260 | fi |
---|
| 261 | fi |
---|
| 262 | unset obuild_platform_result |
---|
| 263 | fi |
---|
| 264 | unset obuild_platform_result |
---|
| 265 | |
---|
| 266 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
| 267 | echo "Variable obuild_platform_exe not defined." |
---|
| 268 | return |
---|
| 269 | fi |
---|
| 270 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'` |
---|
| 271 | if [ ${obuild_platform_result} = yes ] ; then |
---|
| 272 | if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then |
---|
[133] | 273 | DYLD_LIBRARY_PATH="${obuild_snova_path}/${obuild_dir_bin}" |
---|
| 274 | export DYLD_LIBRARY_PATH |
---|
| 275 | else |
---|
| 276 | DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${obuild_snova_path}/${obuild_dir_bin}" |
---|
| 277 | export DYLD_LIBRARY_PATH |
---|
| 278 | fi |
---|
| 279 | else |
---|
| 280 | if [ "${LD_LIBRARY_PATH}" = "" ] ; then |
---|
| 281 | LD_LIBRARY_PATH="${obuild_snova_path}/${obuild_dir_bin}" |
---|
| 282 | export LD_LIBRARY_PATH |
---|
| 283 | else |
---|
| 284 | LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${obuild_snova_path}/${obuild_dir_bin}" |
---|
| 285 | export LD_LIBRARY_PATH |
---|
| 286 | fi |
---|
| 287 | fi |
---|
| 288 | unset obuild_platform_result |
---|
| 289 | |
---|
| 290 | unset obuild_snova_path |
---|
| 291 | |
---|
| 292 | #FIXME unset obuild_platform |
---|
| 293 | #FIXME unset obuild_dir_bin |
---|