# this script sets the PS IPP build environment for BASH shell users

INSTALL=/home/kiawe/eugene/src.alala/panstarrs/ipp/psconfig

if (( $# == 0 )); then
  /bin/csh $INSTALL/psconfig.sh
  return 0
fi

if [[ "$1" == "--help" ]]; then
  echo "USAGE: psconfig (version) : set configuration to specified version"
  return 0
fi

version=$1
psconfigure=`/bin/csh $INSTALL/psconfig.sh --psconfigure $version`
psautogen=`/bin/csh $INSTALL/psconfig.sh --psautogen $version`
psperlbuild=`/bin/csh $INSTALL/psconfig.sh --psperlbuild $version`
alias psconfigure=$psconfigure
alias psautogen=$psautogen
alias psperlbuild=$psperlbuild

# psconfig env variables
export PSCONFDIR=`/bin/csh $INSTALL/psconfig.sh --psconfdir $version`
export PSVERSION=`/bin/csh $INSTALL/psconfig.sh --psversion $version`

# environment variables
export PATH=`/bin/csh $INSTALL/psconfig.sh --path $version`
export ARCH=`/bin/csh $INSTALL/psconfig.sh --arch $version`
export LD_LIBRARY_PATH=`/bin/csh $INSTALL/psconfig.sh --ld_library_path $version`
export PKG_CONFIG_PATH=`/bin/csh $INSTALL/psconfig.sh --pkg_config_path $version`
export ACLOCAL_FLAGS=`/bin/csh $INSTALL/psconfig.sh --aclocal_flags $version`
export PERL5LIB=`/bin/csh $INSTALL/psconfig.sh --perl5lib $version`
