| 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 | #   UNIX> cd some_path/pack/version/obuild
 | 
|---|
| 11 | # ( UNIX> chmod a+x sh/build_prog_snovis )
 | 
|---|
| 12 | #   UNIX> sh/build_prog_snovis
 | 
|---|
| 13 | #
 | 
|---|
| 14 | #////////////////////////////////////////////////
 | 
|---|
| 15 | 
 | 
|---|
| 16 | obuild_verbose=no
 | 
|---|
| 17 | obuild_debug=no
 | 
|---|
| 18 | obuild_optimize=yes
 | 
|---|
| 19 | obuild_do_not_compile=no
 | 
|---|
| 20 | obuild_dir_bin_o_cleanup=yes
 | 
|---|
| 21 | 
 | 
|---|
| 22 | obuild_set_x=no
 | 
|---|
| 23 | while test $# -ge 1 ; do
 | 
|---|
| 24 |   case $1 in
 | 
|---|
| 25 |     -h) 
 | 
|---|
| 26 |         echo "Options :"
 | 
|---|
| 27 |         echo "  -v : verbose."
 | 
|---|
| 28 |         echo "  -d : build in debug mode."
 | 
|---|
| 29 |         echo "  -g : build in debug mode."
 | 
|---|
| 30 |         echo "  -x : execute script with set -x."
 | 
|---|
| 31 |         echo "  -l : link only, do not (re)compile."
 | 
|---|
| 32 |         echo "  -k : do not remove result of compilations (.o, .obj)."
 | 
|---|
| 33 |         echo ""
 | 
|---|
| 34 |         exit ;;
 | 
|---|
| 35 |     -v) obuild_verbose=yes ;;
 | 
|---|
| 36 |     -x) obuild_set_x=yes ;;
 | 
|---|
| 37 |     -d) obuild_debug=yes ;;
 | 
|---|
| 38 |     -g) obuild_debug=yes ;;
 | 
|---|
| 39 |     -l) obuild_do_not_compile=yes ;;
 | 
|---|
| 40 |     -k) obuild_dir_bin_o_cleanup=no ;;
 | 
|---|
| 41 |     *) echo "unknown option : $1";exit ;;
 | 
|---|
| 42 |   esac
 | 
|---|
| 43 |   shift
 | 
|---|
| 44 | done
 | 
|---|
| 45 | 
 | 
|---|
| 46 | if [ ${obuild_set_x} = yes ] ; then
 | 
|---|
| 47 |   set -x
 | 
|---|
| 48 | fi
 | 
|---|
| 49 | 
 | 
|---|
| 50 | if [ ${obuild_debug} = yes ] ; then
 | 
|---|
| 51 |   obuild_optimize=no
 | 
|---|
| 52 | fi
 | 
|---|
| 53 | 
 | 
|---|
| 54 | if [  "${OBUILD_PLATFORM}" = "" ] ; then
 | 
|---|
| 55 |   obuild_platform=`uname`
 | 
|---|
| 56 | else
 | 
|---|
| 57 |   obuild_platform=${OBUILD_PLATFORM}
 | 
|---|
| 58 | fi
 | 
|---|
| 59 | 
 | 
|---|
| 60 | if [ "${obuild_platform}" = "" ] ; then
 | 
|---|
| 61 |   echo "obuild_platform variable not defined."
 | 
|---|
| 62 |   exit
 | 
|---|
| 63 | fi
 | 
|---|
| 64 | 
 | 
|---|
| 65 | if [  "${OBUILD_DIR_BIN}" = "" ] ; then
 | 
|---|
| 66 |   obuild_dir_bin=bin_obuild
 | 
|---|
| 67 | else
 | 
|---|
| 68 |   obuild_dir_bin=${OBUILD_DIR_BIN}
 | 
|---|
| 69 | fi
 | 
|---|
| 70 | 
 | 
|---|
| 71 | if [ "${obuild_dir_bin}" = "" ] ; then
 | 
|---|
| 72 |   echo "obuild_dir_bin variable not defined."
 | 
|---|
| 73 |   exit
 | 
|---|
| 74 | fi
 | 
|---|
| 75 | 
 | 
|---|
| 76 | obuild_pwd=`pwd`
 | 
|---|
| 77 | obuild_snovis_path=`dirname "${obuild_pwd}"`
 | 
|---|
| 78 | unset obuild_pwd
 | 
|---|
| 79 | 
 | 
|---|
| 80 | # Create the bin directory :
 | 
|---|
| 81 | /bin/mkdir -p "${obuild_snovis_path}/${obuild_dir_bin}"
 | 
|---|
| 82 | 
 | 
|---|
| 83 | if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform" ] ; then
 | 
|---|
| 84 |   if [ ! -e "${obuild_snovis_path}/obuild/cpp/obuild_platform.cpp" ] ; then
 | 
|---|
| 85 |     echo "Program source obuild_platform.cpp not found."
 | 
|---|
| 86 |     exit
 | 
|---|
| 87 |   fi
 | 
|---|
| 88 |   if [ "${obuild_cxx_command}" = "" ] ; then 
 | 
|---|
| 89 |     if [  "${OBUILD_CXX}" != "" ] ; then
 | 
|---|
| 90 |       obuild_platform_compiler=${OBUILD_CXX}
 | 
|---|
| 91 |     else
 | 
|---|
| 92 |       obuild_platform_compiler=c++ 
 | 
|---|
| 93 |     fi
 | 
|---|
| 94 |   else
 | 
|---|
| 95 |     obuild_platform_compiler=${obuild_cxx_command} 
 | 
|---|
| 96 |   fi
 | 
|---|
| 97 |   ${obuild_platform_compiler} -o "${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform" "${obuild_snovis_path}/obuild/cpp/obuild_platform.cpp"
 | 
|---|
| 98 |   unset obuild_platform_compiler
 | 
|---|
| 99 |   if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform" ] ; then
 | 
|---|
| 100 |     echo "Program obuild_platform not found."
 | 
|---|
| 101 |     exit
 | 
|---|
| 102 |   fi
 | 
|---|
| 103 | fi
 | 
|---|
| 104 | obuild_platform_exe="${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform"
 | 
|---|
| 105 | if [ "${obuild_platform_exe}" = "" ] ; then
 | 
|---|
| 106 |   echo "Variable obuild_platform_exe not defined."
 | 
|---|
| 107 |   exit
 | 
|---|
| 108 | fi
 | 
|---|
| 109 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
 | 
|---|
| 110 | if [ ${obuild_platform_result} = yes ] ; then
 | 
|---|
| 111 | CLHEP_home="/usr/local/CLHEP/2.0.3.1"
 | 
|---|
| 112 | fi
 | 
|---|
| 113 | unset obuild_platform_result
 | 
|---|
| 114 | if [ "${obuild_platform_exe}" = "" ] ; then
 | 
|---|
| 115 |   echo "Variable obuild_platform_exe not defined."
 | 
|---|
| 116 |   exit
 | 
|---|
| 117 | fi
 | 
|---|
| 118 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
 | 
|---|
| 119 | if [ ${obuild_platform_result} = yes ] ; then
 | 
|---|
| 120 | Geant4_home="/usr/local/geant4/8.2"
 | 
|---|
| 121 | fi
 | 
|---|
| 122 | unset obuild_platform_result
 | 
|---|
| 123 | if [ "${obuild_platform_exe}" = "" ] ; then
 | 
|---|
| 124 |   echo "Variable obuild_platform_exe not defined."
 | 
|---|
| 125 |   exit
 | 
|---|
| 126 | fi
 | 
|---|
| 127 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
 | 
|---|
| 128 | if [ ${obuild_platform_result} = yes ] ; then
 | 
|---|
| 129 | HDF5_home="/usr/local/HDF5/1.6.5"
 | 
|---|
| 130 | fi
 | 
|---|
| 131 | unset obuild_platform_result
 | 
|---|
| 132 | if [ "${obuild_platform_exe}" = "" ] ; then
 | 
|---|
| 133 |   echo "Variable obuild_platform_exe not defined."
 | 
|---|
| 134 |   exit
 | 
|---|
| 135 | fi
 | 
|---|
| 136 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
 | 
|---|
| 137 | if [ ${obuild_platform_result} = yes ] ; then
 | 
|---|
| 138 | OSC_home="/usr/local/OpenScientist/v16r0"
 | 
|---|
| 139 | fi
 | 
|---|
| 140 | unset obuild_platform_result
 | 
|---|
| 141 | if [ "${obuild_platform_exe}" = "" ] ; then
 | 
|---|
| 142 |   echo "Variable obuild_platform_exe not defined."
 | 
|---|
| 143 |   exit
 | 
|---|
| 144 | fi
 | 
|---|
| 145 | obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
 | 
|---|
| 146 | if [ ${obuild_platform_result} = yes ] ; then
 | 
|---|
| 147 | ./sh/build_Darwin_app prog_snovis "${obuild_snovis_path}/${obuild_dir_bin}/snovis.bundle" "${obuild_snovis_path}/${obuild_dir_bin}/G4Lab.bundle" "${OSC_home}/bin/OnXLabInventor.bundle" "${OSC_home}/bin/OnXLabKUIP.bundle" "${OSC_home}/bin/OnXLab.bundle" "${OSC_home}/bin/OnXLab_SWIG_Python.so" "${OSC_home}/bin/BatchLabXML.bundle" "${OSC_home}/bin/BatchLabRio.bundle" "${OSC_home}/bin/BatchLabHDF5.bundle" "${OSC_home}/bin/OnXTestDLD.bundle" "${OSC_home}/bin/OnXKUIP.bundle" "${OSC_home}/bin/OnX.bundle" "${OSC_home}/bin/OnXQt.bundle" "${OSC_home}/bin/OnXPython.bundle" "${OSC_home}/bin/OnX_SWIG_Python.so" "${OSC_home}/bin/HEPVis_SWIG_Python.so" "${OSC_home}/bin/_CoinPython.so"
 | 
|---|
| 148 | 
 | 
|---|
| 149 | /bin/mkdir -p "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/snovis/."
 | 
|---|
| 150 | if [ -d "${obuild_snovis_path}/scripts" ] ; then
 | 
|---|
| 151 |   /bin/cp -R "${obuild_snovis_path}/scripts" "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/snovis/."
 | 
|---|
| 152 | else
 | 
|---|
| 153 |   echo "Directory ${obuild_snovis_path}/scripts not found."
 | 
|---|
| 154 | fi
 | 
|---|
| 155 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/snovis/." -depth -name CVS -exec /bin/rm -R -f {} \;
 | 
|---|
| 156 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/snovis/." -depth -name .svn -exec /bin/rm -R -f {} \;
 | 
|---|
| 157 | /bin/mkdir -p "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/."
 | 
|---|
| 158 | if [ -d "${obuild_snovis_path}/Resources/G4Lab" ] ; then
 | 
|---|
| 159 |   /bin/cp -R "${obuild_snovis_path}/Resources/G4Lab" "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/."
 | 
|---|
| 160 | else
 | 
|---|
| 161 |   echo "Directory ${obuild_snovis_path}/Resources/G4Lab not found."
 | 
|---|
| 162 | fi
 | 
|---|
| 163 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/." -depth -name CVS -exec /bin/rm -R -f {} \;
 | 
|---|
| 164 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/." -depth -name .svn -exec /bin/rm -R -f {} \;
 | 
|---|
| 165 | /bin/mkdir -p "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/OnXLab/."
 | 
|---|
| 166 | if [ -d "${OSC_home}/Resources/OnXLab/scripts" ] ; then
 | 
|---|
| 167 |   /bin/cp -R "${OSC_home}/Resources/OnXLab/scripts" "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/OnXLab/."
 | 
|---|
| 168 | else
 | 
|---|
| 169 |   echo "Directory ${OSC_home}/Resources/OnXLab/scripts not found."
 | 
|---|
| 170 | fi
 | 
|---|
| 171 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/OnXLab/." -depth -name CVS -exec /bin/rm -R -f {} \;
 | 
|---|
| 172 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/OnXLab/." -depth -name .svn -exec /bin/rm -R -f {} \;
 | 
|---|
| 173 | /bin/mkdir -p "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/OnXLab/."
 | 
|---|
| 174 | if [ -d "${OSC_home}/Resources/OnXLab/examples" ] ; then
 | 
|---|
| 175 |   /bin/cp -R "${OSC_home}/Resources/OnXLab/examples" "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/OnXLab/."
 | 
|---|
| 176 | else
 | 
|---|
| 177 |   echo "Directory ${OSC_home}/Resources/OnXLab/examples not found."
 | 
|---|
| 178 | fi
 | 
|---|
| 179 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/OnXLab/." -depth -name CVS -exec /bin/rm -R -f {} \;
 | 
|---|
| 180 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/OnXLab/." -depth -name .svn -exec /bin/rm -R -f {} \;
 | 
|---|
| 181 | /bin/mkdir -p "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/BatchLab/."
 | 
|---|
| 182 | if [ -d "${OSC_home}/Resources/BatchLab/scripts" ] ; then
 | 
|---|
| 183 |   /bin/cp -R "${OSC_home}/Resources/BatchLab/scripts" "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/BatchLab/."
 | 
|---|
| 184 | else
 | 
|---|
| 185 |   echo "Directory ${OSC_home}/Resources/BatchLab/scripts not found."
 | 
|---|
| 186 | fi
 | 
|---|
| 187 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/BatchLab/." -depth -name CVS -exec /bin/rm -R -f {} \;
 | 
|---|
| 188 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/BatchLab/." -depth -name .svn -exec /bin/rm -R -f {} \;
 | 
|---|
| 189 | /bin/mkdir -p "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/OnX/."
 | 
|---|
| 190 | if [ -d "${OSC_home}/Resources/OnX/scripts" ] ; then
 | 
|---|
| 191 |   /bin/cp -R "${OSC_home}/Resources/OnX/scripts" "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/OnX/."
 | 
|---|
| 192 | else
 | 
|---|
| 193 |   echo "Directory ${OSC_home}/Resources/OnX/scripts not found."
 | 
|---|
| 194 | fi
 | 
|---|
| 195 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/OnX/." -depth -name CVS -exec /bin/rm -R -f {} \;
 | 
|---|
| 196 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/OnX/." -depth -name .svn -exec /bin/rm -R -f {} \;
 | 
|---|
| 197 | /bin/mkdir -p "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/HEPVis/."
 | 
|---|
| 198 | if [ -d "${OSC_home}/Resources/HEPVis/fonts" ] ; then
 | 
|---|
| 199 |   /bin/cp -R "${OSC_home}/Resources/HEPVis/fonts" "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/HEPVis/."
 | 
|---|
| 200 | else
 | 
|---|
| 201 |   echo "Directory ${OSC_home}/Resources/HEPVis/fonts not found."
 | 
|---|
| 202 | fi
 | 
|---|
| 203 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/HEPVis/." -depth -name CVS -exec /bin/rm -R -f {} \;
 | 
|---|
| 204 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/HEPVis/." -depth -name .svn -exec /bin/rm -R -f {} \;
 | 
|---|
| 205 | /bin/mkdir -p "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/HEPVis/."
 | 
|---|
| 206 | if [ -d "${OSC_home}/Resources/HEPVis/scripts" ] ; then
 | 
|---|
| 207 |   /bin/cp -R "${OSC_home}/Resources/HEPVis/scripts" "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/HEPVis/."
 | 
|---|
| 208 | else
 | 
|---|
| 209 |   echo "Directory ${OSC_home}/Resources/HEPVis/scripts not found."
 | 
|---|
| 210 | fi
 | 
|---|
| 211 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/HEPVis/." -depth -name CVS -exec /bin/rm -R -f {} \;
 | 
|---|
| 212 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/HEPVis/." -depth -name .svn -exec /bin/rm -R -f {} \;
 | 
|---|
| 213 | /bin/mkdir -p "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/CoinPython/."
 | 
|---|
| 214 | if [ -d "${OSC_home}/Resources/CoinPython/scripts" ] ; then
 | 
|---|
| 215 |   /bin/cp -R "${OSC_home}/Resources/CoinPython/scripts" "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/CoinPython/."
 | 
|---|
| 216 | else
 | 
|---|
| 217 |   echo "Directory ${OSC_home}/Resources/CoinPython/scripts not found."
 | 
|---|
| 218 | fi
 | 
|---|
| 219 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/CoinPython/." -depth -name CVS -exec /bin/rm -R -f {} \;
 | 
|---|
| 220 | find "${obuild_snovis_path}/${obuild_dir_bin}/prog_snovis.app/Contents/Resources/CoinPython/." -depth -name .svn -exec /bin/rm -R -f {} \;
 | 
|---|
| 221 | 
 | 
|---|
| 222 | fi
 | 
|---|
| 223 | unset obuild_platform_result
 | 
|---|
| 224 | /bin/rm -f "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find"
 | 
|---|
| 225 | 
 | 
|---|