[1337] | 1 | #! /bin/sh - |
---|
| 2 | #$Id: configure,v 1.17 2009/11/20 03:36:51 kmura Exp $ |
---|
| 3 | # ====================================================================== |
---|
| 4 | # A configure script for Geant4Py |
---|
| 5 | # ====================================================================== |
---|
| 6 | export LANG=C |
---|
| 7 | |
---|
| 8 | IFS=' |
---|
| 9 | ' |
---|
| 10 | PATH=/bin:/usr/bin |
---|
| 11 | export PATH |
---|
| 12 | |
---|
| 13 | # ====================================================================== |
---|
| 14 | # testing the echo features |
---|
| 15 | # ====================================================================== |
---|
| 16 | if `(echo "testing\c"; echo 1,2,3) | grep c > /dev/null` ; then |
---|
| 17 | if `(echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn > /dev/null`; then |
---|
| 18 | ac_n= ac_c=' |
---|
| 19 | ' ac_t=' ' |
---|
| 20 | else |
---|
| 21 | ac_n=-n ac_c= ac_t= |
---|
| 22 | fi |
---|
| 23 | else |
---|
| 24 | ac_n= ac_c='\c' ac_t= |
---|
| 25 | fi |
---|
| 26 | |
---|
| 27 | # ====================================================================== |
---|
| 28 | # help message |
---|
| 29 | # ====================================================================== |
---|
| 30 | show_help() { |
---|
| 31 | cat <<EOF |
---|
| 32 | \`configure' configures Geant4Py to adapt to many kinds of systems. |
---|
| 33 | |
---|
| 34 | Usage: ./configure SYSTEM [OPTION]... [VAR=VALUE]... |
---|
| 35 | |
---|
| 36 | SYSTEM: System type (see Supported Arhitectures) |
---|
| 37 | |
---|
| 38 | Options: |
---|
| 39 | -h, --help Display this help and exit |
---|
| 40 | |
---|
| 41 | Installation directories: |
---|
| 42 | --prefix=PREFIX Installation prefix [./] |
---|
| 43 | --libdir=DIR Python modules dir [PREFIX/lib] |
---|
| 44 | |
---|
| 45 | Fine tuning of the library path: |
---|
| 46 | --with-g4-incdir=DIR Geant4 header dir [\$G4INSTALL/include] |
---|
| 47 | --with-g4-libdir=DIR Geant4 library dir [\$G4INSTALL/lib/\$G4SYSTEM] |
---|
| 48 | --with-clhep-incdir=DIR CLHEP header dir [\$CLHEP_BASE_DIR/include] |
---|
| 49 | --with-clhep-libdir=DIR CLHEP library dir [\$CLHEP_BASE_DIR/lib] |
---|
| 50 | --with-clhep-lib=LIB library name of libCLHEP.so [CLHEP|\$CLHEP_LIB] |
---|
| 51 | |
---|
| 52 | --with-python-incdir=DIR Python header dir [/usr/include/python(2.#)], |
---|
| 53 | (location of pyconfig.h) |
---|
| 54 | --with-python-libdir=DIR Python library dir [/usr/lib(64)] |
---|
| 55 | |
---|
| 56 | --with-boost-incdir=DIR BOOST-C++ header dir [/usr/include], |
---|
| 57 | (location of boost/) |
---|
| 58 | --with-boost-libdir=DIR BOOST-C++ library dir [/usr/lib] |
---|
| 59 | --with-boost-python-lib=LIB library name of libboost_python.so [boost_python] |
---|
| 60 | |
---|
| 61 | --with-package-dir=DIR Geant4 Package dir |
---|
| 62 | |
---|
| 63 | --with-extra-dir=DIR Install path for extra packages [/usr/local] |
---|
| 64 | |
---|
| 65 | --with-xercesc-incdir=DIR Xerces-C header dir [/usr/include] |
---|
| 66 | --with-xercesc-libdir=DIR Xerces-C library dir [/usr/lib(64)] |
---|
| 67 | |
---|
| 68 | Enable/disable options: prefix with either --enable- or --disable- |
---|
| 69 | openglx OpenGLX support [auto] |
---|
| 70 | openglxm OpenGLXm support [disable, \$G4VIS_USE_OPENGLXM] |
---|
| 71 | raytracerx RayTracerX support [disable, \$G4VIS_USE_RAYTRACERX] |
---|
| 72 | |
---|
| 73 | Supported Architectures: |
---|
| 74 | linux for Linux gcc 3.x and 4.x (32bit) |
---|
| 75 | linux64 for Linux gcc 3.x and 4.x (64bit, alias to linuxx8664gcc) |
---|
| 76 | linuxx8664gcc for AMD Opteron and Intel EM64T Linux gcc 3.x and 4.x |
---|
| 77 | macosx for MacOSX with gcc (Tiger/Leopard and Xcode) |
---|
| 78 | |
---|
| 79 | EOF |
---|
| 80 | } |
---|
| 81 | |
---|
| 82 | # ====================================================================== |
---|
| 83 | # main |
---|
| 84 | # ====================================================================== |
---|
| 85 | # input |
---|
| 86 | arguments="$@" |
---|
| 87 | |
---|
| 88 | # default values |
---|
| 89 | prefix=`pwd` |
---|
| 90 | current_dir=`pwd` |
---|
| 91 | |
---|
| 92 | g4_incdir=/zzz |
---|
| 93 | g4_libdir=/zzz |
---|
| 94 | |
---|
| 95 | clhep_incdir=/zzz |
---|
| 96 | clhep_libdir=/zzz |
---|
| 97 | clhep_lib=${CLHEP_LIB:-CLHEP} |
---|
| 98 | |
---|
| 99 | python_incdir=/zzz |
---|
| 100 | boost_incdir=/usr/include |
---|
| 101 | boost_python_lib=boost_python |
---|
| 102 | |
---|
| 103 | enable_openglx=1 |
---|
| 104 | enable_openglxm=${G4VIS_USE_OPENGLXM:+1} |
---|
| 105 | enable_openglxm=${enable_openglxm:-0} |
---|
| 106 | enable_raytracerx=${G4VIS_USE_RAYTRACERX:+1} |
---|
| 107 | enable_raytracerx=${enable_raytracerx:-0} |
---|
| 108 | enable_gl2ps=0 |
---|
| 109 | |
---|
| 110 | enable_physicslist=0 |
---|
| 111 | |
---|
| 112 | enable_gdml=0 |
---|
| 113 | |
---|
| 114 | xercesc_incdir=/usr/include |
---|
| 115 | |
---|
| 116 | extra_dir=/usr/local |
---|
| 117 | |
---|
| 118 | # checking system |
---|
| 119 | case $1 in |
---|
| 120 | linux|linux64|linuxx8664gcc|macosx) |
---|
| 121 | system=$1 |
---|
| 122 | if [ $system = linux64 ]; then |
---|
| 123 | system=linuxx8664gcc |
---|
| 124 | fi |
---|
| 125 | echo $ac_n "Checking for system type ... $ac_c" |
---|
| 126 | if [ ! -e "config/sys/$system.gmk" ]; then |
---|
| 127 | echo "no" |
---|
| 128 | echo $ac_n "### Invalid system type. $ac_c" |
---|
| 129 | echo "Please taka a look in config/sys/." |
---|
| 130 | exit -1 |
---|
| 131 | fi |
---|
| 132 | echo "$system" |
---|
| 133 | ;; |
---|
| 134 | --help|-h) |
---|
| 135 | show_help |
---|
| 136 | exit 0 |
---|
| 137 | ;; |
---|
| 138 | *) |
---|
| 139 | echo "Error: System type is not specified or more than one system type. " |
---|
| 140 | echo "" |
---|
| 141 | echo "Usage: ./configure SYSTEM [OPTION]... [VAR=VALUE]..." |
---|
| 142 | echo "" |
---|
| 143 | exit -1 |
---|
| 144 | ;; |
---|
| 145 | esac |
---|
| 146 | shift |
---|
| 147 | |
---|
| 148 | # parsing options |
---|
| 149 | while test $# -gt 0 |
---|
| 150 | do |
---|
| 151 | case $1 in |
---|
| 152 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; |
---|
| 153 | *) optarg= ;; |
---|
| 154 | esac |
---|
| 155 | |
---|
| 156 | case $1 in |
---|
| 157 | --help|-h) show_help; exit 0 ;; |
---|
| 158 | # --------------------------------------------------------------- |
---|
| 159 | --prefix=*) prefix=$optarg ;; |
---|
| 160 | --libdir=*) libdir=$optarg ;; |
---|
| 161 | --with-package-dir=*) g4_incdir=$optarg/include/Geant4 |
---|
| 162 | g4_libdir=$optarg/lib |
---|
| 163 | clhep_incdir=$optarg/include |
---|
| 164 | clhep_libdir=$optarg/lib ;; |
---|
| 165 | --with-g4-incdir=*) g4_incdir=$optarg ;; |
---|
| 166 | --with-g4-libdir=*) g4_libdir=$optarg ;; |
---|
| 167 | --with-clhep-incdir=*) clhep_incdir=$optarg ;; |
---|
| 168 | --with-clhep-libdir=*) clhep_libdir=$optarg ;; |
---|
| 169 | --with-clhep-lib=*) clhep_lib=$optarg ;; |
---|
| 170 | --with-extra-dir=*) extra_dir=$optarg ;; |
---|
| 171 | --with-python-incdir=*) python_incdir=$optarg ;; |
---|
| 172 | --with-python-libdir=*) python_libdir=$optarg ;; |
---|
| 173 | --with-boost-incdir=*) boost_incdir=$optarg ;; |
---|
| 174 | --with-boost-libdir=*) boost_libdir=$optarg ;; |
---|
| 175 | --with-boost-python-lib=*) boost_python_lib=$optarg ;; |
---|
| 176 | --with-xercesc-incdir=*) xercesc_incdir=$optarg ;; |
---|
| 177 | --with-xercesc-libdir=*) xercesc_libdir=$optarg ;; |
---|
| 178 | # --------------------------------------------------------------- |
---|
| 179 | --enable-openglx ) enable_openglx=1 ;; |
---|
| 180 | --disable-openglx ) enable_openglx=0 ;; |
---|
| 181 | --enable-openglxm ) enable_openglxm=1 ;; |
---|
| 182 | --disable-openglxm ) enable_openglxm=0 ;; |
---|
| 183 | --enable-raytracerx ) enable_raytracerx=1 ;; |
---|
| 184 | --disable-raytracerx ) enable_raytracerx=0 ;; |
---|
| 185 | # --------------------------------------------------------------- |
---|
| 186 | -*) |
---|
| 187 | echo "Unrecognized option: $1" |
---|
| 188 | exit -1 |
---|
| 189 | ;; |
---|
| 190 | *) |
---|
| 191 | echo "Invalid argument: $1" |
---|
| 192 | exit -1 |
---|
| 193 | ;; |
---|
| 194 | esac |
---|
| 195 | shift |
---|
| 196 | done |
---|
| 197 | |
---|
| 198 | # check variables |
---|
| 199 | arch=32 |
---|
| 200 | if [ $system = linuxx8664gcc ]; then |
---|
| 201 | arch=64 |
---|
| 202 | fi |
---|
| 203 | |
---|
| 204 | shlib=so |
---|
| 205 | if [ $system = macosx ]; then |
---|
| 206 | shlib=dylib |
---|
| 207 | fi |
---|
| 208 | |
---|
| 209 | extra_incdir=$extra_dir/include |
---|
| 210 | if [ $arch = 64 ];then |
---|
| 211 | extra_libdir=$extra_dir/lib64 |
---|
| 212 | else |
---|
| 213 | extra_libdir=$extra_dir/lib |
---|
| 214 | fi |
---|
| 215 | |
---|
| 216 | echo $ac_n "Checking for prefix ... $ac_c" |
---|
| 217 | echo $prefix |
---|
| 218 | |
---|
| 219 | echo $ac_n "Checking for lib dir ... $ac_c" |
---|
| 220 | libdir=${libdir:-$prefix/lib} |
---|
| 221 | echo $libdir |
---|
| 222 | |
---|
| 223 | echo $ac_n "Checking for G4 include dir ... $ac_c" |
---|
| 224 | g4_incdir1=${G4INSTALL:+$G4INSTALL/include} |
---|
| 225 | g4_incdir2=${G4INCLUDE:+$G4INCLUDE} |
---|
| 226 | set $g4_incdir $g4_incdir1 $g4_incdir2 |
---|
| 227 | for adir in $* |
---|
| 228 | do |
---|
| 229 | if [ -d "$adir" ]; then |
---|
| 230 | g4_incdir=$adir |
---|
| 231 | break |
---|
| 232 | fi |
---|
| 233 | done |
---|
| 234 | |
---|
| 235 | if [ ! -d "$g4_incdir" ]; then |
---|
| 236 | echo "no" |
---|
| 237 | echo $ac_n "### $g4_incdir (g4-incdir) does not exist. $ac_c" |
---|
| 238 | echo "Try --with-g4-incdir option." |
---|
| 239 | exit -1 |
---|
| 240 | fi |
---|
| 241 | echo "$g4_incdir" |
---|
| 242 | |
---|
| 243 | # --- |
---|
| 244 | echo $ac_n "Checking for G4 lib dir ... $ac_c" |
---|
| 245 | g4_libdir1=${G4INSTALL:+$G4INSTALL/lib/$G4SYSTEM} |
---|
| 246 | g4_libdir2=${G4LIB:+$G4LIB/$G4SYSTEM} |
---|
| 247 | set $g4_libdir/$G4SYSTEM $g4_libdir $g4_libdir1 $g4_libdir2 |
---|
| 248 | for adir in $* |
---|
| 249 | do |
---|
| 250 | if [ -d "$adir" ]; then |
---|
| 251 | g4_libdir=$adir |
---|
| 252 | break |
---|
| 253 | fi |
---|
| 254 | done |
---|
| 255 | |
---|
| 256 | if [ ! -d "$g4_libdir" ]; then |
---|
| 257 | echo "no" |
---|
| 258 | echo $ac_n "### $g4_libdir (g4-libdir) does not exist. $ac_c" |
---|
| 259 | echo "Try --with-g4-libdir option." |
---|
| 260 | exit -1 |
---|
| 261 | fi |
---|
| 262 | echo "$g4_libdir" |
---|
| 263 | |
---|
| 264 | echo $ac_n "Checking for G4 libs are shared libraray ... $ac_c" |
---|
| 265 | if [ ! -f ${g4_libdir}/libG4run.${shlib} ]; then |
---|
| 266 | echo "no" |
---|
| 267 | echo $ac_n "### G4 libray must be global and shared. $ac_c" |
---|
| 268 | echo "Recompile with global and shared mode." |
---|
| 269 | exit -1 |
---|
| 270 | fi |
---|
| 271 | echo "ok" |
---|
| 272 | |
---|
| 273 | # --- |
---|
| 274 | clhep_incdir1=${CLHEP_INCLUDE_DIR:-/zzz} |
---|
| 275 | clhep_incdir2=${CLHEP_BASE_DIR:+$CLHEP_BASE_DIR/include} |
---|
| 276 | set $clhep_incdir $clhep_incdir1 $clhep_incdir2 |
---|
| 277 | for adir in $* |
---|
| 278 | do |
---|
| 279 | if [ -d "$adir" ]; then |
---|
| 280 | clhep_incdir=$adir |
---|
| 281 | break |
---|
| 282 | fi |
---|
| 283 | done |
---|
| 284 | |
---|
| 285 | echo $ac_n "Checking for CLHEP include dir ... $ac_c" |
---|
| 286 | if [ ! -d "$clhep_incdir" ]; then |
---|
| 287 | echo "no" |
---|
| 288 | echo $ac_n "### $clhep_incdir (clhep-incdir) does not exist. $ac_c" |
---|
| 289 | echo "Try --with-clhep-incdir option." |
---|
| 290 | exit -1 |
---|
| 291 | fi |
---|
| 292 | echo "$clhep_incdir" |
---|
| 293 | |
---|
| 294 | # --- |
---|
| 295 | clhep_libdir1=${CLHEP_LIB_DIR:-/zzz} |
---|
| 296 | clhep_libdir2=${CLHEP_BASE_DIR:+$CLHEP_BASE_DIR/lib} |
---|
| 297 | set $clhep_libdir $clhep_libdir1 $clhep_libdir2 |
---|
| 298 | for adir in $* |
---|
| 299 | do |
---|
| 300 | if [ -d "$adir" ]; then |
---|
| 301 | clhep_libdir=$adir |
---|
| 302 | break |
---|
| 303 | fi |
---|
| 304 | done |
---|
| 305 | |
---|
| 306 | echo $ac_n "Checking for CLHEP lib dir ... $ac_c" |
---|
| 307 | if [ ! -d "$clhep_libdir" ]; then |
---|
| 308 | echo "no" |
---|
| 309 | echo $ac_n "### $clhep_libdir (clhep-libdir) does not exist. $ac_c" |
---|
| 310 | echo "Try --with-clhep-libdir option." |
---|
| 311 | exit -1 |
---|
| 312 | fi |
---|
| 313 | echo "$clhep_libdir" |
---|
| 314 | |
---|
| 315 | echo $ac_n "Checking for CLHEP lib name ... $ac_c" |
---|
| 316 | if [ ! -f "$clhep_libdir"/lib${clhep_lib}.${shlib} ]; then |
---|
| 317 | echo "no" |
---|
| 318 | echo $ac_n "### lib${clhep_lib}.${shlib} (clhep-lib) does not exist. $ac_c" |
---|
| 319 | echo "Try --with-clhep-lib option." |
---|
| 320 | exit -1 |
---|
| 321 | fi |
---|
| 322 | echo "lib${clhep_lib}.${shlib}" |
---|
| 323 | |
---|
| 324 | # --- |
---|
| 325 | echo $ac_n "Checking for Python include dir (pyconfig.h) ... $ac_c" |
---|
| 326 | # check version |
---|
| 327 | set python python2.6 python2.5 python2.4 python2.3 python2.2 |
---|
| 328 | for aincdir in $* |
---|
| 329 | do |
---|
| 330 | if [ -d /usr/include/"$aincdir" ]; then |
---|
| 331 | python_incdir=/usr/include/$aincdir |
---|
| 332 | break |
---|
| 333 | fi |
---|
| 334 | done |
---|
| 335 | |
---|
| 336 | if [ ! -f "$python_incdir"/pyconfig.h ]; then |
---|
| 337 | echo "no" |
---|
| 338 | echo $ac_n "### $python_incdir (python-incdir) is invalid. $ac_c" |
---|
| 339 | echo "Try --with-python-incdir option." |
---|
| 340 | exit -1 |
---|
| 341 | fi |
---|
| 342 | echo "$python_incdir" |
---|
| 343 | |
---|
| 344 | echo $ac_n "Checking for Python lib dir ... $ac_c" |
---|
| 345 | if [ ! $python_libdir ]; then |
---|
| 346 | if [ $arch = 64 ]; then |
---|
| 347 | python_libdir=/usr/lib64 |
---|
| 348 | else |
---|
| 349 | python_libdir=/usr/lib |
---|
| 350 | fi |
---|
| 351 | fi |
---|
| 352 | if [ ! -d "$python_libdir" ]; then |
---|
| 353 | echo "no" |
---|
| 354 | echo $ac_n "### $python_libdir (python-libdir) does not exist. $ac_c" |
---|
| 355 | echo "Try --with-python-libdir option." |
---|
| 356 | exit -1 |
---|
| 357 | fi |
---|
| 358 | echo "$python_libdir" |
---|
| 359 | |
---|
| 360 | # --- |
---|
| 361 | echo $ac_n "Checking for Boost include dir (boost/python.hpp) ... $ac_c" |
---|
| 362 | set $boost_incdir $extra_incdir |
---|
| 363 | for adir in $* |
---|
| 364 | do |
---|
| 365 | if [ -f "$adir"/boost/python.hpp ]; then |
---|
| 366 | boost_incdir=$adir |
---|
| 367 | break |
---|
| 368 | fi |
---|
| 369 | done |
---|
| 370 | if [ ! -f "$boost_incdir"/boost/python.hpp ]; then |
---|
| 371 | echo "no" |
---|
| 372 | echo $ac_n "### $boost_incdir (boost-incdir) is invalid. $ac_c" |
---|
| 373 | echo "Try --with-boost-incdir option." |
---|
| 374 | exit -1 |
---|
| 375 | fi |
---|
| 376 | echo "$boost_incdir" |
---|
| 377 | |
---|
| 378 | echo $ac_n "Checking for Boost version ... $ac_c" |
---|
| 379 | cat > conftest.cc <<EOF |
---|
| 380 | #include <boost/version.hpp> |
---|
| 381 | |
---|
| 382 | int main() { |
---|
| 383 | if (BOOST_VERSION >= 103200) |
---|
| 384 | return 0; |
---|
| 385 | else |
---|
| 386 | return 1; |
---|
| 387 | } |
---|
| 388 | EOF |
---|
| 389 | g++ -I$boost_incdir -o conftest conftest.cc > /dev/null 2>&1 |
---|
| 390 | ./conftest |
---|
| 391 | q_boost_version=$? |
---|
| 392 | rm conftest.cc conftest |
---|
| 393 | if [ $q_boost_version = 0 ]; then |
---|
| 394 | echo "ok" |
---|
| 395 | else |
---|
| 396 | echo "boost version >= 1.32.00 is required." |
---|
| 397 | exit -1 |
---|
| 398 | fi |
---|
| 399 | |
---|
| 400 | echo $ac_n "Checking for Boost lib dir ... $ac_c" |
---|
| 401 | if [ ! $boost_libdir ]; then |
---|
| 402 | if [ $arch = 64 ]; then |
---|
| 403 | boost_libdir=/usr/lib64 |
---|
| 404 | else |
---|
| 405 | boost_libdir=/usr/lib |
---|
| 406 | fi |
---|
| 407 | fi |
---|
| 408 | set $boost_libdir $extra_libdir |
---|
| 409 | for adir in $* |
---|
| 410 | do |
---|
| 411 | if [ -f "$adir"/lib${boost_python_lib}.${shlib} ]; then |
---|
| 412 | boost_libdir=$adir |
---|
| 413 | break |
---|
| 414 | fi |
---|
| 415 | done |
---|
| 416 | |
---|
| 417 | if [ ! -d "$boost_libdir" ]; then |
---|
| 418 | echo "no" |
---|
| 419 | echo $ac_n "### $boost_libdir (boost-libdir) does not exist. $ac_c" |
---|
| 420 | echo "Try --with-boost-libdir option." |
---|
| 421 | exit -1 |
---|
| 422 | fi |
---|
| 423 | echo "$boost_libdir" |
---|
| 424 | |
---|
| 425 | echo $ac_n "Checking for Boost Python lib name ... $ac_c" |
---|
| 426 | if [ ! -f "$boost_libdir"/lib${boost_python_lib}.${shlib} ]; then |
---|
| 427 | echo "no" |
---|
| 428 | echo $ac_n "### lib${boost_python_lib}.${shlib} (boost-python-lib) does not exist. $ac_c" |
---|
| 429 | echo "Try --with-boost-python-lib option." |
---|
| 430 | exit -1 |
---|
| 431 | fi |
---|
| 432 | echo "lib${boost_python_lib}.${shlib}" |
---|
| 433 | |
---|
| 434 | # --- |
---|
| 435 | echo $ac_n "Checking for OpenGL support ...$ac_c" |
---|
| 436 | if [ -f "$g4_libdir"/libG4OpenGL.${shlib} ]; then |
---|
| 437 | if [ $enable_openglx = 0 ]; then |
---|
| 438 | echo "disabled" |
---|
| 439 | else |
---|
| 440 | echo "yes" |
---|
| 441 | fi |
---|
| 442 | else |
---|
| 443 | echo "no" |
---|
| 444 | enable_openglx=0 |
---|
| 445 | fi |
---|
| 446 | |
---|
| 447 | # --- |
---|
| 448 | echo $ac_n "Checking for GL2PS support ...$ac_c" |
---|
| 449 | if [ -f "$g4_libdir"/libG4gl2ps.${shlib} ]; then |
---|
| 450 | echo "yes" |
---|
| 451 | enable_gl2ps=1 |
---|
| 452 | else |
---|
| 453 | echo "no" |
---|
| 454 | fi |
---|
| 455 | |
---|
| 456 | # --- |
---|
| 457 | echo $ac_n "Checking for physics list support ...$ac_c" |
---|
| 458 | if [ -f "$g4_incdir"/QGSP.hh ]; then |
---|
| 459 | enable_physicslist=1 |
---|
| 460 | fi |
---|
| 461 | if [ $enable_physicslist = 0 ]; then |
---|
| 462 | echo "no" |
---|
| 463 | else |
---|
| 464 | echo "yes" |
---|
| 465 | fi |
---|
| 466 | |
---|
| 467 | # --- |
---|
| 468 | echo $ac_n "Checking for GDML support ...$ac_c" |
---|
| 469 | if [ -f "$g4_incdir"/G4GDMLParser.hh ]; then |
---|
| 470 | echo "yes" |
---|
| 471 | enable_gdml=1 |
---|
| 472 | else |
---|
| 473 | echo "no" |
---|
| 474 | enable_gdml=0 |
---|
| 475 | fi |
---|
| 476 | |
---|
| 477 | # --- |
---|
| 478 | if [ $enable_gdml = 1 ]; then |
---|
| 479 | echo $ac_n "Checking for Xerces-C include dir ...$ac_c" |
---|
| 480 | set $xercesc_incdir $extra_incdir |
---|
| 481 | for adir in $* |
---|
| 482 | do |
---|
| 483 | if [ -d "$adir/xercesc" ]; then |
---|
| 484 | xercesc_incdir=$adir |
---|
| 485 | break |
---|
| 486 | fi |
---|
| 487 | done |
---|
| 488 | if [ -d "$xercesc_incdir/xercesc" ]; then |
---|
| 489 | echo "yes" |
---|
| 490 | else |
---|
| 491 | echo "no" |
---|
| 492 | echo "### $xercesc_incdir/xercesc does not exist. " |
---|
| 493 | echo "Try --with-xercesc-incdir option." |
---|
| 494 | exit -1 |
---|
| 495 | fi |
---|
| 496 | |
---|
| 497 | echo $ac_n "Checking for Xerces-C lib dir ...$ac_c" |
---|
| 498 | if [ ! $xercesc_libdir ]; then |
---|
| 499 | if [ $arch = 64 ]; then |
---|
| 500 | xercesc_libdir=/usr/lib64 |
---|
| 501 | else |
---|
| 502 | xercesc_libdir=/usr/lib |
---|
| 503 | fi |
---|
| 504 | fi |
---|
| 505 | set $xerces_libdir $extra_libdir |
---|
| 506 | for adir in $* |
---|
| 507 | do |
---|
| 508 | if [ -f "$adir"/libxerces-c.${shlib} ]; then |
---|
| 509 | xercesc_libdir=$adir |
---|
| 510 | break |
---|
| 511 | fi |
---|
| 512 | done |
---|
| 513 | |
---|
| 514 | if [ -f "$xercesc_libdir"/libxerces-c.${shlib} ]; then |
---|
| 515 | echo "yes" |
---|
| 516 | else |
---|
| 517 | echo "no" |
---|
| 518 | echo "### $xercesc_libdir/libxerces-c.${shlib} does not exist. " |
---|
| 519 | echo "Try --with-xercesc-libdir option." |
---|
| 520 | exit -1 |
---|
| 521 | fi |
---|
| 522 | fi |
---|
| 523 | |
---|
| 524 | # --- |
---|
| 525 | echo $ac_n "Writing config.gmk ... $ac_c" |
---|
| 526 | |
---|
| 527 | make_config=config/config.gmk |
---|
| 528 | |
---|
| 529 | cat > $make_config <<EOF |
---|
| 530 | # config.gmk |
---|
| 531 | # |
---|
| 532 | # Automatically generated by configure script |
---|
| 533 | # |
---|
| 534 | # Makefile definitions included by the top Makefile |
---|
| 535 | |
---|
| 536 | G4PY_INSTALL := $current_dir |
---|
| 537 | |
---|
| 538 | Q_SYSTEM := $system |
---|
| 539 | |
---|
| 540 | Q_PREFIX := $prefix |
---|
| 541 | Q_LIBDIR := $libdir |
---|
| 542 | |
---|
| 543 | Q_G4_INCDIR := $g4_incdir |
---|
| 544 | Q_G4_LIBDIR := $g4_libdir |
---|
| 545 | EOF |
---|
| 546 | |
---|
| 547 | |
---|
| 548 | cat >> $make_config <<EOF |
---|
| 549 | |
---|
| 550 | Q_CLHEP_INCDIR := $clhep_incdir |
---|
| 551 | Q_CLHEP_LIBDIR := $clhep_libdir |
---|
| 552 | Q_CLHEP_LIB := $clhep_lib |
---|
| 553 | |
---|
| 554 | Q_PYTHON_INCDIR := $python_incdir |
---|
| 555 | Q_PYTHON_LIBDIR := $python_libdir |
---|
| 556 | Q_BOOST_INCDIR := $boost_incdir |
---|
| 557 | Q_BOOST_LIBDIR := $boost_libdir |
---|
| 558 | Q_BOOST_PYTHON_LIB := $boost_python_lib |
---|
| 559 | |
---|
| 560 | Q_ENABLE_OPENGLX := $enable_openglx |
---|
| 561 | Q_ENABLE_OPENGLXM := $enable_openglxm |
---|
| 562 | Q_ENABLE_RAYTRACERX := $enable_raytracerx |
---|
| 563 | Q_ENABLE_GL2PS := $enable_gl2ps |
---|
| 564 | |
---|
| 565 | Q_ENABLE_PHYSICSLIST := $enable_physicslist |
---|
| 566 | |
---|
| 567 | Q_ENABLE_GDML := $enable_gdml |
---|
| 568 | EOF |
---|
| 569 | |
---|
| 570 | if [ $enable_gdml = 1 ]; then |
---|
| 571 | cat >> $make_config <<EOF |
---|
| 572 | Q_XERCESC_INCDIR := $xercesc_incdir |
---|
| 573 | Q_XERCESC_LIBDIR := $xercesc_libdir |
---|
| 574 | EOF |
---|
| 575 | fi |
---|
| 576 | |
---|
| 577 | echo "done" |
---|
| 578 | echo $ac_n "Writing config.status ... $ac_c" |
---|
| 579 | echo $arguments > config.status |
---|
| 580 | echo "done" |
---|
| 581 | |
---|
| 582 | # --- |
---|
| 583 | echo "" |
---|
| 584 | echo $ac_n "Enabled support for$ac_c" |
---|
| 585 | if [ $enable_openglx = 1 ]; then |
---|
| 586 | echo $ac_n " openglx$ac_c" |
---|
| 587 | fi |
---|
| 588 | |
---|
| 589 | if [ $enable_openglxm = 1 ]; then |
---|
| 590 | echo $ac_n " openglxm$ac_c" |
---|
| 591 | fi |
---|
| 592 | |
---|
| 593 | if [ $enable_raytracerx = 1 ]; then |
---|
| 594 | echo $ac_n " raytracerx$ac_c" |
---|
| 595 | fi |
---|
| 596 | |
---|
| 597 | if [ $enable_gl2ps = 1 ]; then |
---|
| 598 | echo $ac_n " gl2ps$ac_c" |
---|
| 599 | fi |
---|
| 600 | |
---|
| 601 | if [ $enable_physicslist = 1 ]; then |
---|
| 602 | echo $ac_n " physicslist$ac_c" |
---|
| 603 | fi |
---|
| 604 | |
---|
| 605 | if [ $enable_gdml = 1 ]; then |
---|
| 606 | echo $ac_n " gdml$ac_c" |
---|
| 607 | fi |
---|
| 608 | |
---|
| 609 | echo "." |
---|
| 610 | |
---|
| 611 | # --- |
---|
| 612 | echo "" |
---|
| 613 | echo "To build Geant4Py type:" |
---|
| 614 | echo "" |
---|
| 615 | echo " make" |
---|
| 616 | echo " make install" |
---|
| 617 | echo "" |
---|
| 618 | |
---|
| 619 | exit 0 |
---|
| 620 | |
---|