#!/bin/sh -f

#
# File produced by the obuild tool version 1.0
# for the package snovis with version v1r1.
#

#////////////////////////////////////////////////
# Usage :
#   UNIX> cd some_path/pack/version/obuild
# ( UNIX> chmod a+x sh/build_G4LabCore )
#   UNIX> sh/build_G4LabCore
#
#////////////////////////////////////////////////

obuild_verbose=no
obuild_debug=no
obuild_optimize=yes
obuild_do_not_compile=no
obuild_dir_bin_o_cleanup=yes

obuild_set_x=no
while test $# -ge 1 ; do
  case $1 in
    -h) 
        echo "Options :"
        echo "  -v : verbose."
        echo "  -d : build in debug mode."
        echo "  -g : build in debug mode."
        echo "  -x : execute script with set -x."
        echo "  -l : link only, do not (re)compile."
        echo "  -k : do not remove result of compilations (.o, .obj)."
        echo ""
        exit ;;
    -v) obuild_verbose=yes ;;
    -x) obuild_set_x=yes ;;
    -d) obuild_debug=yes ;;
    -g) obuild_debug=yes ;;
    -l) obuild_do_not_compile=yes ;;
    -k) obuild_dir_bin_o_cleanup=no ;;
    *) echo "unknown option : $1";exit ;;
  esac
  shift
done

if [ ${obuild_set_x} = yes ] ; then
  set -x
fi

if [ ${obuild_debug} = yes ] ; then
  obuild_optimize=no
fi

if [  "${OBUILD_PLATFORM}" = "" ] ; then
  obuild_platform=`uname`
else
  obuild_platform=${OBUILD_PLATFORM}
fi

if [ "${obuild_platform}" = "" ] ; then
  echo "obuild_platform variable not defined."
  exit
fi

if [  "${OBUILD_DIR_BIN}" = "" ] ; then
  obuild_dir_bin=bin_obuild
else
  obuild_dir_bin=${OBUILD_DIR_BIN}
fi

if [ "${obuild_dir_bin}" = "" ] ; then
  echo "obuild_dir_bin variable not defined."
  exit
fi

obuild_pwd=`pwd`
obuild_snovis_path=`dirname "${obuild_pwd}"`
unset obuild_pwd

# Create the bin directory :
/bin/mkdir -p "${obuild_snovis_path}/${obuild_dir_bin}"

if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform" ] ; then
  if [ ! -e "${obuild_snovis_path}/obuild/cpp/obuild_platform.cpp" ] ; then
    echo "Program source obuild_platform.cpp not found."
    exit
  fi
  if [ "${obuild_cxx_command}" = "" ] ; then 
    if [  "${OBUILD_CXX}" != "" ] ; then
      obuild_platform_compiler=${OBUILD_CXX}
    else
      obuild_platform_compiler=c++ 
    fi
  else
    obuild_platform_compiler=${obuild_cxx_command} 
  fi
  ${obuild_platform_compiler} -o "${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform" "${obuild_snovis_path}/obuild/cpp/obuild_platform.cpp"
  unset obuild_platform_compiler
  if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform" ] ; then
    echo "Program obuild_platform not found."
    exit
  fi
fi
obuild_platform_exe="${obuild_snovis_path}/${obuild_dir_bin}/obuild_platform"
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
if [ ${obuild_platform_result} = yes ] ; then
CLHEP_home="/usr/local/CLHEP/2.0.3.1"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
if [ ${obuild_platform_result} = yes ] ; then
Geant4_home="/usr/local/geant4/8.2"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
if [ ${obuild_platform_result} = yes ] ; then
HDF5_home="/usr/local/HDF5/1.6.5"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
if [ ${obuild_platform_result} = yes ] ; then
OSC_home="/usr/local/OpenScientist/v16r0"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_command="c++"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Linux'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_command="c++"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'OSF1'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_command="cxx"
fi
unset obuild_platform_result
if [ "${obuild_cxx_command}" = "" ] ; then
  echo "Variable obuild_cxx_command not defined."
  exit
fi

if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_optimize="-O"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Linux'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_optimize="-O"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'OSF1'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_optimize="-O"
fi
unset obuild_platform_result

if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_debug="-g"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Linux'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_debug="-g"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'OSF1'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_debug="-g"
fi
unset obuild_platform_result

if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Linux'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_options="-fPIC"
fi
unset obuild_platform_result

if [ ${obuild_debug} = yes ] ; then
  obuild_cxx_debug_local=${obuild_cxx_debug}
else
  obuild_cxx_debug_local=
fi

if [ ${obuild_optimize} = yes ] ; then
  obuild_cxx_optimize_local=${obuild_cxx_optimize}
else
  obuild_cxx_optimize_local=
fi

if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_macros="${obuild_cxx_macros} -DAPPLE_GL"
fi
unset obuild_platform_result


obuild_cxx_includes="-I\"${obuild_snovis_path}/source\""
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_includes="${obuild_cxx_includes} -I${CLHEP_home}/include"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_includes="${obuild_cxx_includes} -I${Geant4_home}/include"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_includes="${obuild_cxx_includes} -I${OSC_home}/Resources/AIDA/src/cpp"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_includes="${obuild_cxx_includes} -I${OSC_home}/Resources/Slash -I${OSC_home}/Resources/expat/include -I${OSC_home}/Resources/Lib/include -I${OSC_home}/Resources/OnX/include"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_includes="${obuild_cxx_includes} -I${OSC_home}/Resources/BatchLab -I${OSC_home}/Resources/OnXLab"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'UNIX'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_includes="${obuild_cxx_includes} -I${OSC_home}/Resources/CoinGL/include -I${OSC_home}/Resources/HEPVis/include"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_includes="${obuild_cxx_includes} -I/System/Library/Frameworks/OpenGL.framework/Headers"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'OSF1'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_includes="${obuild_cxx_includes} -I${OBUILD_OPENGL_HOME}/include"
fi
unset obuild_platform_result

if [ ${obuild_dir_bin_o_cleanup} = yes ] ; then
  /bin/rm -R -f "${obuild_snovis_path}/${obuild_dir_bin}/lib_G4LabCore"
fi

/bin/mkdir -p "${obuild_snovis_path}/${obuild_dir_bin}/lib_G4LabCore"

# Compile G4LabCore files :
if [ ${obuild_do_not_compile} = no ] ; then

if [ ${obuild_verbose} = yes ] ; then set -x;fi
cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/Transform3D.o \"../source/G4Lab/cxx/Transform3D.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/Polyhedron.o \"../source/G4Lab/cxx/Polyhedron.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/GeometryVisitor.o \"../source/G4Lab/cxx/GeometryVisitor.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/Tree.o \"../source/G4Lab/cxx/Tree.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/Trajectory.o \"../source/G4Lab/cxx/Trajectory.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/State.o \"../source/G4Lab/cxx/State.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/SteppingAction.o \"../source/G4Lab/cxx/SteppingAction.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/TrackingAction.o \"../source/G4Lab/cxx/TrackingAction.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/SoG4RunManager.o \"../source/G4Lab/cxx/SoG4RunManager.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/SoVisitedVolume.o \"../source/G4Lab/cxx/SoVisitedVolume.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/SoG4Trajectories.o \"../source/G4Lab/cxx/SoG4Trajectories.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/PhysicalVolumeAccessor.o \"../source/G4Lab/cxx/PhysicalVolumeAccessor.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/TrajectoryContainerAccessor.o \"../source/G4Lab/cxx/TrajectoryContainerAccessor.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/TrajectoryAccessor.o \"../source/G4Lab/cxx/TrajectoryAccessor.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/PhysicsTableAccessor.o \"../source/G4Lab/cxx/PhysicsTableAccessor.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/HitsCollectionAccessor.o \"../source/G4Lab/cxx/HitsCollectionAccessor.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/DigitsCollectionAccessor.o \"../source/G4Lab/cxx/DigitsCollectionAccessor.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

cd "${obuild_snovis_path}/${obuild_dir_bin}"
 eval ${obuild_cxx_command} -c ${obuild_cxx_debug_local} ${obuild_cxx_optimize_local} ${obuild_cxx_options} ${obuild_cxx_macros} ${obuild_cxx_includes} -o ./lib_G4LabCore/Manager.o \"../source/G4Lab/cxx/Manager.cxx\"
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
cd "${obuild_snovis_path}/obuild"

if [ ${obuild_verbose} = yes ] ; then set +x;fi

fi #do_not_compile

if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_shared_lib_builder_command="c++"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Linux'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_shared_lib_builder_command="c++"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'OSF1'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_shared_lib_builder_command="cxx"
fi
unset obuild_platform_result
if [ "${obuild_cxx_shared_lib_builder_command}" = "" ] ; then
  echo "Variable obuild_cxx_shared_lib_builder_command not defined."
  exit
fi

if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_shared_lib_builder_options="-dynamiclib -twolevel_namespace -undefined dynamic_lookup -dynamic -single_module"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Linux'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_shared_lib_builder_options="-shared"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'OSF1'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_shared_lib_builder_options="-shared -expect_unresolved *"
fi
unset obuild_platform_result

if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Darwin'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_shared_lib_builder_suffix="dylib"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Linux'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_shared_lib_builder_suffix="so"
fi
unset obuild_platform_result
if [ "${obuild_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'OSF1'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_shared_lib_builder_suffix="so"
fi
unset obuild_platform_result

if [ ${obuild_debug} = yes ] ; then
  obuild_cxx_shared_lib_builder_debug_local=${obuild_cxx_shared_lib_builder_debug}
else
  obuild_cxx_shared_lib_builder_debug_local=
fi

if [ ${obuild_optimize} = yes ] ; then
  obuild_cxx_shared_lib_builder_optimize_local=${obuild_cxx_shared_lib_builder_optimize}
else
  obuild_cxx_shared_lib_builder_optimize_local=
fi
# Create the shared library G4LabCore :
cd "${obuild_snovis_path}/${obuild_dir_bin}"
obuild_objs=`find ./lib_G4LabCore -name '*.o' -print`
/bin/rm -f ./libG4LabCore.${obuild_cxx_shared_lib_builder_suffix}

if [ ${obuild_verbose} = yes ] ; then set -x;fi
 ${obuild_cxx_shared_lib_builder_command} ${obuild_cxx_shared_lib_builder_debug_local} ${obuild_cxx_shared_lib_builder_optimize_local} ${obuild_cxx_shared_lib_builder_options} -o "${obuild_snovis_path}/${obuild_dir_bin}/libG4LabCore.${obuild_cxx_shared_lib_builder_suffix}" ${obuild_objs} ${obuild_linked_paths} ${obuild_linked_libraries}
obuild_status=$?;if [ ${obuild_status} != 0 ] ; then exit ${obuild_status};fi
if [ ${obuild_verbose} = yes ] ; then set +x;fi
cd "${obuild_snovis_path}/obuild"

# Some cleanup :
if [ ${obuild_dir_bin_o_cleanup} = yes ] ; then
  /bin/rm -R -f "${obuild_snovis_path}/${obuild_dir_bin}/lib_G4LabCore"
fi
/bin/rm -f "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find"

