case $CONFIG in '') if test -f config.sh; then TOP=.; elif test -f ../config.sh; then TOP=..; elif test -f ../../config.sh; then TOP=../..; elif test -f ../../../config.sh; then TOP=../../..; elif test -f ../../../../config.sh; then TOP=../../../..; else echo "Can't find config.sh."; exit 1 fi . $TOP/config.sh ;; esac : This forces SH files to create target in same directory as SH file. : This is so that make depend always knows where to find SH derivatives. case "$0" in */*) cd `expr X$0 : 'X\(.*\)/'` ;; esac #echo "Extracting install.sh (with variable substitutions)" : This section of the file will have variable substitutions done on it. : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!. : Protect any dollar signs and backticks that you do not want interpreted : by putting a backslash in front. You may delete these comments. $spitshell >install.sh < \$G4LIB/\$G4SYSTEM/GNUmakefile.db echo "" echo "Starting build..." echo "" echo "Cleaning up $g4conf/g4make.log" rm -rf $g4conf/g4make.log cd $g4install/source if test $g4make_jobs -gt 1 ; then $g4make obj -j $g4make_jobs fi # There is no env! if [ X$g4global = Xy ] ; then echo "Building global libraries..." $g4make global 2>&1 | tee $g4conf/g4make.log fi # There is env for binaries - for User: should be set in env.[c]sh! if [ X$g4granular = Xy ] ; then echo "Building granular libraries..." G4LIB_USE_GRANULAR=1 export G4LIB_USE_GRANULAR $g4make 2>&1 | tee $g4conf/g4make.log fi if [ X$g4lib_build_dll = Xy ] ; then echo "Building WIN32 DLLs..." $g4make dll 2>&1 | tee $g4conf/g4make.log fi if [ X$g4lib_build_dyn = Xy ] ; then echo "" rm -rf $g4conf/g4make.log $g4make global G4LIB_BUILD_SHARED=1 2>&1 | tee $g4conf/g4make.log fi # Check for errors in log file if test -f \$g4conf/g4make.log ; then # There are two (at least) shells 'sh' and 'bash' with # different arithmetic expansion...So we are doing it by 'text' # in two steps... err=\`grep " Error " $g4conf/g4make.log | wc -w\` int=\`grep " Interrupt " $g4conf/g4make.log | wc -w\` stp=\`grep Stop\. $g4conf/g4make.log | wc -w\` err2=\`echo \$err\` int2=\`echo \$int\` stp2=\`echo \$stp\` if [ X\$err2 = X0 -a X\$int2 = X0 ] ; then echo "" echo "####################################################" echo "# Your Geant4 installation seems to be successful! " echo "# To be sure please have a look into the log file: " echo "# $g4conf/g4make.log " echo "####################################################" echo "" else echo "" echo "############################################################" echo "# It looks like you had errors during Geant4 installation " echo "# (or interrupted installation)! " echo "# Please check log file: " echo "# $g4conf/g4make.log " echo "############################################################" echo "" fi else echo "" echo "############################################################" echo "# It looks like you had errors during Geant4 installation " echo "# (or interrupted installation)! " echo "# You have no log file: " echo "# $g4conf/g4make.log " echo "############################################################" echo "" fi !GROK!THIS! : In the following dollars and backticks do not need the extra backslash. $spitshell >>install.sh <<'!NO!SUBS!' !NO!SUBS! chmod 755 install.sh $eunicefix install.sh