

# $1 must be a fully-qualified pathname to the current working directory.
# Create `nsperl` executables named $2, $3, ...

# Find the full pathnames of the directories into which to install:
PKG=`dirname "$0"`
if [ "$PKG" = "" ]; then
    echo >&2 "$0 can't tell what directory contains it."
    exit 1
fi
case "$PKG" in
   /* ) ;;
    * ) PKG="$1"/"$PKG" ;;
esac
shift
ARCHLIB=`dirname "$PKG"`
PRIVLIB=`dirname "$ARCHLIB"`
PREFIX=`dirname "$PRIVLIB"`

# Create a program that runs standard Perl with added environment variables.
# Don't beautify the following script, much; the code that parses it
# <src/interpreter.cpp> is dumber than you might guess.  In particular,
# {} are not special.  Don't insert whitespace where there is none,
# nor remove any whitespace entirely.
for FILE in "$@"; do
    echo --instructions-- | "$PKG"/executor "$FILE" || exit $?
done
