#!/bin/sh -f

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

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

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=${obuild_platform}_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
bhep_home="/Users/barrand/dev/exp/nemo/bhep/v1r4p1"
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
bhep_platform="Darwin"
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
GeomUtils_home="/Users/barrand/dev/exp/nemo/SNgeom/v0r1p0/build_area/GeomUtils"
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
GeomUtils_platform="Darwin-i386"
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
SNgeom2_home="/Users/barrand/dev/exp/nemo/SNgeom/v0r1p0/build_area/SNgeom2"
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
snova_home="/Users/barrand/dev/exp/nemo/SNgeom/v0r1p0/build_area/snova"
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
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="/geant4/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} 'Darwin'`
if [ ${obuild_platform_result} = yes ] ; then
Geant4_work="${Geant4_home}/Darwin"
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
Geant4_work="${Geant4_home}/slc3_gcc323"
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
Geant4_system="Darwin-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
Geant4_system="Linux-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} 'Windows_NT'`
if [ ${obuild_platform_result} = yes ] ; then
Geant4_system="WIN32-VC"
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_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Windows_NT'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_command="cl.exe"
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} 'Windows_NT'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_optimize="/O2"
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} 'Windows_NT'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_debug="/ZI /Od"
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_platform_exe}" = "" ] ; then
  echo "Variable obuild_platform_exe not defined."
  exit
fi
obuild_platform_result=`"${obuild_platform_exe}" ${obuild_platform} 'Windows_NT'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_options="/nologo /DWIN32 /MD /GX /GR /W3"
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 [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" ] ; then
  if [ ! -e "${obuild_snovis_path}/obuild/cpp/obuild_find.cpp" ] ; then
    echo "Program source obuild_find.cpp not found."
    exit
  fi
  if [ "${obuild_cxx_command}" = "" ] ; then
    if [  "${OBUILD_CXX}" != "" ] ; then
      obuild_find_compiler=${OBUILD_CXX}
    else
      obuild_find_compiler=c++
    fi
  else
    obuild_find_compiler=${obuild_cxx_command}
  fi
  ${obuild_find_compiler} -o "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" "${obuild_snovis_path}/obuild/cpp/obuild_find.cpp"
  unset obuild_find_compiler
  if [ ! -e "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find" ] ; then
    echo "Program obuild_find not found."
    exit
  fi
fi
obuild_find_exe="${obuild_snovis_path}/${obuild_dir_bin}/obuild_find"
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_Lib_path=`"${obuild_find_exe}" Lib 'v8r*'`
if [ "${obuild_Lib_path}" = "" ] ; then
  echo "Can't find Lib package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_Slash_path=`"${obuild_find_exe}" Slash 'v1r*'`
if [ "${obuild_Slash_path}" = "" ] ; then
  echo "Can't find Slash package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_AIDA_path=`"${obuild_find_exe}" AIDA 'v3r2p1'`
if [ "${obuild_AIDA_path}" = "" ] ; then
  echo "Can't find AIDA package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_OnX_path=`"${obuild_find_exe}" OnX 'v17r*'`
if [ "${obuild_OnX_path}" = "" ] ; then
  echo "Can't find OnX package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_G4Lab_path=`"${obuild_find_exe}" G4Lab 'v8r*'`
if [ "${obuild_G4Lab_path}" = "" ] ; then
  echo "Can't find G4Lab package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_BatchLab_path=`"${obuild_find_exe}" BatchLab 'v1r*'`
if [ "${obuild_BatchLab_path}" = "" ] ; then
  echo "Can't find BatchLab package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_HEPVis_path=`"${obuild_find_exe}" HEPVis 'v6r*'`
if [ "${obuild_HEPVis_path}" = "" ] ; then
  echo "Can't find HEPVis package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_CoinGL_path=`"${obuild_find_exe}" CoinGL 'v1r*'`
if [ "${obuild_CoinGL_path}" = "" ] ; then
  echo "Can't find CoinGL package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_Lib_path=`"${obuild_find_exe}" Lib 'v8r*'`
if [ "${obuild_Lib_path}" = "" ] ; then
  echo "Can't find Lib package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_expat_path=`"${obuild_find_exe}" expat 'v1r*'`
if [ "${obuild_expat_path}" = "" ] ; then
  echo "Can't find expat package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_Lib_path=`"${obuild_find_exe}" Lib 'v8r*'`
if [ "${obuild_Lib_path}" = "" ] ; then
  echo "Can't find Lib package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_zlib_path=`"${obuild_find_exe}" zlib 'v1r*'`
if [ "${obuild_zlib_path}" = "" ] ; then
  echo "Can't find zlib package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_Lib_path=`"${obuild_find_exe}" Lib 'v8r*'`
if [ "${obuild_Lib_path}" = "" ] ; then
  echo "Can't find Lib package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_HEPVis_path=`"${obuild_find_exe}" HEPVis 'v6r*'`
if [ "${obuild_HEPVis_path}" = "" ] ; then
  echo "Can't find HEPVis package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_HEPVis_path=`"${obuild_find_exe}" HEPVis 'v6r*'`
if [ "${obuild_HEPVis_path}" = "" ] ; then
  echo "Can't find HEPVis package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_jpeg_path=`"${obuild_find_exe}" jpeg 'v1r*'`
if [ "${obuild_jpeg_path}" = "" ] ; then
  echo "Can't find jpeg package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_dvi2bitmap_path=`"${obuild_find_exe}" dvi2bitmap 'v1r*'`
if [ "${obuild_dvi2bitmap_path}" = "" ] ; then
  echo "Can't find dvi2bitmap package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_freetype2_path=`"${obuild_find_exe}" freetype2 'v1r*'`
if [ "${obuild_freetype2_path}" = "" ] ; then
  echo "Can't find freetype2 package."
  exit
fi
if [ "${obuild_find_exe}" = "" ] ; then
  echo "Variable obuild_find_exe not defined."
  exit
fi
obuild_CoinGL_path=`"${obuild_find_exe}" CoinGL 'v1r*'`
if [ "${obuild_CoinGL_path}" = "" ] ; then
  echo "Can't find CoinGL package."
  exit
fi

obuild_cxx_includes="-I\"${obuild_snovis_path}\""
obuild_cxx_includes="${obuild_cxx_includes} -I\"${obuild_Lib_path}/include\""
obuild_cxx_includes="${obuild_cxx_includes} -I\"${obuild_Slash_path}\""
obuild_cxx_includes="${obuild_cxx_includes} -I\"${obuild_AIDA_path}/src/cpp\""
obuild_cxx_includes="${obuild_cxx_includes} -I\"${obuild_OnX_path}/include\""
obuild_cxx_includes="${obuild_cxx_includes} -I\"${obuild_G4Lab_path}/include\""
obuild_cxx_includes="${obuild_cxx_includes} -I\"${obuild_BatchLab_path}\""
obuild_cxx_includes="${obuild_cxx_includes} -I\"${obuild_HEPVis_path}/include\""
obuild_cxx_includes="${obuild_cxx_includes} -I\"${obuild_CoinGL_path}/include\""
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}/dll_snovis"
fi

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

# Compile snovis 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 ./dll_snovis/Callbacks.o ../source/Callbacks.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 ./dll_snovis/InventorCallbacks.o ../source/InventorCallbacks.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 ./dll_snovis/Layouts.o ../source/Layouts.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

obuild_linked_paths="-L\"${obuild_Lib_path}/${obuild_dir_bin}\""
obuild_linked_libraries=" -lLibXML"
obuild_linked_paths="${obuild_linked_paths} -L\"${obuild_expat_path}/${obuild_dir_bin}\""
obuild_linked_libraries="${obuild_linked_libraries}  -losc_expat"
obuild_linked_paths="${obuild_linked_paths} -L\"${obuild_Lib_path}/${obuild_dir_bin}\""
obuild_linked_libraries="${obuild_linked_libraries}  -lLibZip"
obuild_linked_paths="${obuild_linked_paths} -L\"${obuild_zlib_path}/${obuild_dir_bin}\""
obuild_linked_libraries="${obuild_linked_libraries}  -losc_z"
obuild_linked_paths="${obuild_linked_paths} -L\"${obuild_Lib_path}/${obuild_dir_bin}\""
obuild_linked_libraries="${obuild_linked_libraries}  -lLibUtils"
obuild_linked_paths="${obuild_linked_paths} -L\"${obuild_HEPVis_path}/${obuild_dir_bin}\""
obuild_linked_libraries="${obuild_linked_libraries}  -lHEPVisGeometry"
obuild_linked_paths="${obuild_linked_paths} -L\"${obuild_HEPVis_path}/${obuild_dir_bin}\""
obuild_linked_libraries="${obuild_linked_libraries}  -lHEPVisUtils"
obuild_linked_paths="${obuild_linked_paths} -L\"${obuild_jpeg_path}/${obuild_dir_bin}\""
obuild_linked_libraries="${obuild_linked_libraries}  -losc_jpeg"
obuild_linked_paths="${obuild_linked_paths} -L\"${obuild_dvi2bitmap_path}/${obuild_dir_bin}\""
obuild_linked_libraries="${obuild_linked_libraries}  -losc_dvi2bitmap"
obuild_linked_paths="${obuild_linked_paths} -L\"${obuild_freetype2_path}/${obuild_dir_bin}\""
obuild_linked_libraries="${obuild_linked_libraries}  -losc_freetype2"
obuild_linked_paths="${obuild_linked_paths} -L\"${obuild_CoinGL_path}/${obuild_dir_bin}\""
obuild_linked_libraries="${obuild_linked_libraries}  -losc_Coin"
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_linked_libraries="${obuild_linked_libraries} -framework OpenGL -framework AGL"
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_linked_libraries="${obuild_linked_libraries} -framework ApplicationServices"
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_linked_libraries="${obuild_linked_libraries} -L/usr/lib -lGLU -lGL -lm"
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} 'Windows_NT'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_linked_libraries="${obuild_linked_libraries} glu32.lib opengl32.lib gdi32.lib user32.lib"
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_linked_libraries="${obuild_linked_libraries} -L${OBUILD_OPENGL_HOME}/lib -lGLU -lGL -lm"
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_linked_libraries="${obuild_linked_libraries} -lpthread"
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_dll_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_dll_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_dll_builder_command="cxx"
fi
unset obuild_platform_result
if [ "${obuild_cxx_dll_builder_command}" = "" ] ; then
  echo "Variable obuild_cxx_dll_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_dll_builder_options="-bundle -twolevel_namespace -Wl,-headerpad_max_install_names -Wl,-headerpad,800"
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_dll_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_dll_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} 'Linux'`
if [ ${obuild_platform_result} = yes ] ; then
obuild_cxx_dll_builder_prefix="lib"
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_dll_builder_prefix="lib"
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_dll_builder_suffix="bundle"
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_dll_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_dll_builder_suffix="so"
fi
unset obuild_platform_result

if [ ${obuild_debug} = yes ] ; then
  obuild_cxx_dll_builder_debug_local=${obuild_cxx_dll_builder_debug}
else
  obuild_cxx_dll_builder_debug_local=
fi

if [ ${obuild_optimize} = yes ] ; then
  obuild_cxx_dll_builder_optimize_local=${obuild_cxx_dll_builder_optimize}
else
  obuild_cxx_dll_builder_optimize_local=
fi
# Create the dll snovis :
cd "${obuild_snovis_path}/${obuild_dir_bin}"
obuild_objs=`find ./dll_snovis -name '*.o' -print`
/bin/rm -f ./${obuild_cxx_dll_builder_prefix}snovis.${obuild_cxx_dll_builder_suffix}
if [ ${obuild_verbose} = yes ] ; then set -x;fi
 eval ${obuild_cxx_dll_builder_command} ${obuild_cxx_dll_builder_options} -o \"${obuild_snovis_path}/${obuild_dir_bin}/${obuild_cxx_dll_builder_prefix}snovis.${obuild_cxx_dll_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}/dll_snovis"
fi
/bin/rm -f "${obuild_snovis_path}/${obuild_dir_bin}/obuild_find"

