[126] | 1 | #!/bin/sh -f |
---|
| 2 | |
---|
| 3 | # |
---|
| 4 | # File produced by the obuild tool version 1.0 |
---|
| 5 | # for the package bhep with version v1r4p2. |
---|
| 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_bhep_path="@@absolute_dir@@" |
---|
| 44 | |
---|
| 45 | if [ "${obuild_bhep_path}" = '@@absolute_dir@@' ] ; then |
---|
| 46 | echo ' The package bhep had not been installed.' |
---|
| 47 | echo '' |
---|
| 48 | echo ' In the file :' |
---|
| 49 | echo ' bhep/<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_bhep_path}/${obuild_dir_bin}/obuild_platform" ] ; then |
---|
| 91 | if [ ! -e "${obuild_bhep_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_bhep_path}/${obuild_dir_bin}/obuild_platform" "${obuild_bhep_path}/obuild/cpp/obuild_platform.cpp" |
---|
| 105 | unset obuild_platform_compiler |
---|
| 106 | if [ ! -e "${obuild_bhep_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_bhep_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 | # Set environment variables of this package : |
---|
| 122 | |
---|
| 123 | if [ "${obuild_platform_exe}" = "" ] ; then |
---|
| 124 | echo "Variable obuild_platform_exe not defined." |
---|
| 125 | return |
---|
| 126 | fi |
---|
| 127 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'` |
---|
| 128 | if [ ${obuild_platform_result} = yes ] ; then |
---|
| 129 | if [ "${DYLD_LIBRARY_PATH}" = "" ] ; then |
---|
| 130 | DYLD_LIBRARY_PATH="${obuild_bhep_path}/${obuild_dir_bin}" |
---|
| 131 | export DYLD_LIBRARY_PATH |
---|
| 132 | else |
---|
| 133 | DYLD_LIBRARY_PATH="${DYLD_LIBRARY_PATH}:${obuild_bhep_path}/${obuild_dir_bin}" |
---|
| 134 | export DYLD_LIBRARY_PATH |
---|
| 135 | fi |
---|
| 136 | else |
---|
| 137 | if [ "${LD_LIBRARY_PATH}" = "" ] ; then |
---|
| 138 | LD_LIBRARY_PATH="${obuild_bhep_path}/${obuild_dir_bin}" |
---|
| 139 | export LD_LIBRARY_PATH |
---|
| 140 | else |
---|
| 141 | LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${obuild_bhep_path}/${obuild_dir_bin}" |
---|
| 142 | export LD_LIBRARY_PATH |
---|
| 143 | fi |
---|
| 144 | fi |
---|
| 145 | unset obuild_platform_result |
---|
| 146 | |
---|
| 147 | unset obuild_bhep_path |
---|
| 148 | |
---|
| 149 | #FIXME unset obuild_platform |
---|
| 150 | #FIXME unset obuild_dir_bin |
---|