#! /bin/sh

# This script is called by Makefile to build the Perl modules.

# IB=''
# [ "X$*" = "X" ] || IB="INSTALL_BASE=$*"

IB=''
ISA=''
if [ -f destdir.dat ]
then
[ "X$1" = "X" ] || IB="INSTALL_BASE=${DESTDIR}$1"
[ "X$2" != "X" ] || IB=''
[ "X$2" = "X" ] || ISA="INSTALLSITEARCH=${DESTDIR}$2"
else
[ "X$1" = "X" ] || IB="INSTALL_BASE=$1"
[ "X$2" != "X" ] || IB=''
[ "X$2" = "X" ] || ISA="INSTALLSITEARCH=$2"
fi

cd perlxs
echo Current directory is `pwd`
MODULES=`echo DK*`
for i in $MODULES
do
  echo Make perl module $i
  if [ -d "$i" ]
  then
  cd "$i"
    echo Current directory is `pwd`
    echo perl Makefile.PL $IB $ISA
    perl Makefile.PL $IB $ISA
    make
  cd ..
  else
    echo "$i: ERROR: Not a directory"
    exit 1
  fi
done
cd ..


