2011-10-06 05:10:10 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
2011-12-12 22:52:31 +08:00
|
|
|
CLOOG_HASH="57470e76bfd58a0c38c598e816411663193e0f45"
|
2012-10-16 15:29:19 +08:00
|
|
|
ISL_HASH="cc969a737d4f8de258a462c3cb1c063fe2f1c5cf"
|
2011-10-06 14:53:17 +08:00
|
|
|
|
|
|
|
PWD=`pwd`
|
2011-10-06 05:10:10 +08:00
|
|
|
|
|
|
|
check_command_line() {
|
2011-10-06 14:53:17 +08:00
|
|
|
if [ $# -eq 1 ]
|
2011-10-06 05:10:10 +08:00
|
|
|
then
|
|
|
|
CLOOG_DIR="${1}"
|
2011-10-06 14:53:17 +08:00
|
|
|
else
|
|
|
|
echo "Usage: " ${0} '<Directory to checkout CLooG>'
|
|
|
|
exit 1
|
2011-10-06 05:10:10 +08:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
check_cloog_directory() {
|
2011-10-06 07:11:17 +08:00
|
|
|
if ! [ -e ${CLOOG_DIR} ]
|
2011-10-06 05:10:10 +08:00
|
|
|
then
|
|
|
|
echo :: Directory "'${CLOOG_DIR}'" does not exists. Trying to create it.
|
2011-10-06 07:11:17 +08:00
|
|
|
if ! mkdir -p "${CLOOG_DIR}"
|
2011-10-06 05:10:10 +08:00
|
|
|
then exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2011-10-06 07:11:17 +08:00
|
|
|
if ! [ -d ${CLOOG_DIR} ]
|
2011-10-06 05:10:10 +08:00
|
|
|
then
|
|
|
|
echo "'${CLOOG_DIR}'" is not a directory
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2011-10-06 14:53:17 +08:00
|
|
|
# Make it absolute
|
|
|
|
cd ${CLOOG_DIR}
|
|
|
|
CLOOG_DIR=`pwd`
|
|
|
|
|
2011-10-06 07:11:17 +08:00
|
|
|
if ! [ -e "${CLOOG_DIR}/.git" ]
|
2011-10-06 05:10:10 +08:00
|
|
|
then
|
|
|
|
echo ":: No git checkout found"
|
2011-10-06 14:53:17 +08:00
|
|
|
IS_GIT=0
|
2011-10-06 05:10:10 +08:00
|
|
|
else
|
|
|
|
echo ":: Existing git repo found"
|
|
|
|
IS_GIT=1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
complain() {
|
|
|
|
echo "$@"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
run() {
|
|
|
|
$cmdPre $*
|
|
|
|
if [ $? != 0 ]
|
|
|
|
then
|
|
|
|
complain $* failed
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
check_command_line $@
|
|
|
|
check_cloog_directory
|
|
|
|
|
2011-10-06 14:53:17 +08:00
|
|
|
ISL_DIR=${CLOOG_DIR}/isl
|
2011-10-06 05:10:10 +08:00
|
|
|
|
|
|
|
if [ ${IS_GIT} -eq 0 ]
|
|
|
|
then
|
|
|
|
echo :: Performing initial checkout
|
2011-10-06 14:53:17 +08:00
|
|
|
run git clone http://repo.or.cz/r/cloog.git ${CLOOG_DIR}
|
|
|
|
run git clone http://repo.or.cz/r/isl.git ${ISL_DIR}
|
2011-10-06 05:10:10 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo :: Fetch versions required by Polly
|
2011-10-06 14:53:17 +08:00
|
|
|
run cd ${CLOOG_DIR}
|
2011-10-06 05:10:10 +08:00
|
|
|
run git remote update
|
|
|
|
run cd isl
|
|
|
|
run git remote update
|
2011-10-06 14:53:17 +08:00
|
|
|
|
|
|
|
echo :: Setting CLooG version
|
|
|
|
run cd ${CLOOG_DIR}
|
|
|
|
run git reset --hard "${CLOOG_HASH}"
|
|
|
|
|
|
|
|
echo :: Setting isl version
|
|
|
|
run cd ${ISL_DIR}
|
2011-10-06 05:10:10 +08:00
|
|
|
run git reset --hard "${ISL_HASH}"
|
|
|
|
|
|
|
|
echo :: Generating configure
|
2011-10-06 14:53:17 +08:00
|
|
|
run cd ${CLOOG_DIR}
|
2011-10-06 05:10:10 +08:00
|
|
|
run ./autogen.sh
|
|
|
|
|
|
|
|
echo :: If you install cloog/isl the first time run "'./configure'" followed by
|
|
|
|
echo :: "'make'" and "'make install'", otherwise, just call "'make'" and
|
|
|
|
echo :: "'make'" install.
|