1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
#!/bin/sh -e
EXTERNAL="/afs/crc.nd.edu/group/ccl/software"
if [ ! -d "${EXTERNAL}" ]
then
cat <<EOF
This configure script is tailored to compile CCTools at Notre Dame with all of
the optional packages enabled. It may be of little use outside Notre Dame.
EOF
PLATFORM=nosuchplatform
else
# Our external packages are installed in $EXTERNAL/PLATFORM/packagename/cctools-dep
PLATFORM=$(${EXTERNAL}/cclplatform.sh)
echo "platform is ${PLATFORM}"
fi
detect_packages()
{
# cleanup GLOBUS_LOCATION
unset GLOBUS_LOCATION
export GLOBUS_LOCATION
echo "$0: Detecting packages ..."
PACKAGES_CONFIG=""
# perl and python taken from host
for package in fuse irods mysql python3 globus swig xrootd cvmfs uuid curl
do
packagepath=$EXTERNAL/${PLATFORM}/$package/cctools-dep
if [ -d $packagepath ]
then
echo "$package -> $packagepath"
PACKAGES_CONFIG="$PACKAGES_CONFIG --with-$package-path $packagepath"
else
echo "$package -> NOTFOUND"
fi
done
echo ""
}
BRANCH="$CCTOOLS_BRANCH"
SOURCE="from source"
GIT_DIR="$(dirname "$0")/.git"
export GIT_DIR
if [ -d "$GIT_DIR" ] && which git > /dev/null 2> /dev/null; then
# `git archive` (man gitattributes(5)) fills this in, otherwise we do it manually...
COMMIT='$Format:%H$'
if [ "$(expr substr "$COMMIT" 1 1)" = '$' ]; then
COMMIT="$(git rev-parse HEAD)"
fi
DATE='$Format:%ci$'
if [ "${DATE:0:1}" = '$' ]; then
DATE="$(git log -1 --pretty=format:%ci HEAD)"
fi
DIRTY=
if [ -n "$(git status --porcelain)" ]; then
echo "Working copy dirty..." >&2
DIRTY='-DIRTY'
fi
if [ -z "$BRANCH" ]; then
BRANCH='$Format:%d$'
if [ "$(expr substr "$BRANCH" 1 1)" = '$' ]; then
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
else
# example BRANCH:
# "(HEAD, origin/heads/master, ccl/heads/master, master, refs/backup/master)"
# or on newer Git:
# "(HEAD -> version-commit, tag: history/version-commit-006, afs/tags/history/version-commit-006, afs/backup/version-commit)"
# find the first instance of a (lowercase) branch name
echo "This commit is referenced by: $BRANCH" >&2
BRANCH="$(echo " ${BRANCH}," | tr -d '\n()' | perl -pe 's|.*? ([^ A-Z/]+),.*|\1|')"
if [ -z "$BRANCH" ]; then
echo "Could not interpret branch name." >&2
BRANCH=HEAD
fi
fi
fi
SOURCE="[${BRANCH}:$(expr substr "$COMMIT" 1 8)${DIRTY}]"
fi
detect_packages
./configure --strict --build-label "${SOURCE}" --build-date "${DATE}" --tcp-low-port 9000 --sge-parameter '-pe smp $cores' $PACKAGES_CONFIG "$@"
# vim: set sts=4 sw=4 ts=8 expandtab ft=sh:
|