#! /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 data modules... "
modules=`ls modules | grep -v CVS | grep -v Makefile`
modules_makefiles=
delim=
if test "X$modules" != "X" ; then
  echo
  for module in $modules ; do
    if test -f modules/$module/Makefile.am ; then
        modules_makefiles="$modules_makefiles modules/$module/Makefile"
        echo "Including module: $module"
    fi
  done
else
  echo "none found"
fi

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

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