#!/bin/sh
# buildcore.sh
# Written by Eric Blau, Aug 2007

#Set $GLOBUS_CORE_FLAVORS to a space-delimited list of the flavors you wish
#to build.  This will override the default behavior of building all flavors 
#that are present in $GLOBUS_LOCATION/lib
#If $GLOBUS_CORE_REBUILD is non-empty, we will force a rebuild of the specified
#flavors.

if [[ -n "$GLOBUS_CORE_REBUILD" ]]; then
GLOBUS_CORE_FORCE="--force"
else
GLOBUS_CORE_FORCE=""
fi

if [[ -n "$GLOBUS_CORE_FLAVORS" ]]; then
echo "Building globus_core in flavors: $GLOBUS_CORE_FLAVORS"
   $GPT_LOCATION/sbin/gpt-build -nosrc $GLOBUS_CORE_FORCE $GLOBUS_CORE_FLAVORS
else
echo "Building globus_core in flavors found in GL/lib"
ls $GLOBUS_LOCATION/lib/libglobus*.so |sed -e 's/.*_//g' -e 's/\.so//g' |sort |uniq |xargs $GPT_LOCATION/sbin/gpt-build -nosrc $GLOBUS_CORE_FORCE 
fi


