#! /bin/sh

# checking for the GLOBUS_LOCATION

if test "x$GLOBUS_LOCATION" = "x"; then
    echo "Using default GLOBUS_LOCATION of /usr"
    GLOBUS_LOCATION="/usr"
fi

if [ ! -f ${GLOBUS_LOCATION}/share/globus/globus-bootstrap.sh ]; then
    echo "ERROR: Unable to locate \${GLOBUS_LOCATION}/share/globus/globus-bootstrap.sh"
    echo "       Please ensure that you have installed the globus-core package and"
    echo "       that GLOBUS_LOCATION is set to the proper directory"
    exit
fi

echo -n "Checking for builtin drivers... "
builtins=`ls builtins | grep -v CVS |grep -v Makefile`
builtin_makefiles=
delim=
if test "X$builtins" != "X" ; then
  echo
  for builtin in $builtins ; do
    if test -f builtins/$builtin/Makefile.am ; then
      builtin_makefiles="$builtin_makefiles builtins/$builtin/Makefile"
      echo "Including driver: $builtin"
    fi
  done
else
  echo "none found"
fi

cp -f configure.in.in configure.in
echo "$builtin_makefiles)" >> configure.in

. ${GLOBUS_LOCATION}/share/globus/globus-bootstrap.sh
