#!/bin/sh
# Run pl from the development system (i.e. after the base system is
# compiled, but not yet installed. If we are building using shared
# libraries we must set LD_LIBRARY_PATH to be able to find them.
#
# On some machines LD_LIBRARY_PATH is called different. The configure
# variable DLLIBVAR holds its name.
bdir=@abs_top_builddir@
PLARCH=@PLARCH@
PL=@PL@
EXEEXT=@EXEEXT@
ldir=$bdir/../lib/$PLARCH
sep=":"
SWIPL_BOOT_FILE=$bdir/swipl.prc
export SWIPL_BOOT_FILE
if [ "@WINEPATHEXE@" != ":" ]; then
lib="$(@WINEPATHEXE@ -w $lib)"
sep=";"
fi
if [ "x$@DLLIBVAR@" = "x" ]; then
@DLLIBVAR@=$ldir
else
@DLLIBVAR@="$ldir$sep$@DLLIBVAR@"
fi
export @DLLIBVAR@
case "$1" in
-C) cd "$2"
shift
shift
;;
*) ;;
esac
$bdir/$PL$EXEEXT "$@"