39 lines · bash
1#! /bin/sh2set -e3 4# Replace the content of the isl directory with a fresh clone from5# http://repo.or.cz/isl.git6 7SCRIPTPATH=`realpath --no-symlinks $(dirname $0)`8ISL_SOURCE_DIR="${SCRIPTPATH}/isl"9GITDIR=`mktemp -d --tmpdir isl-XXX`10 11# Checkout isl source code12git clone --recursive http://repo.or.cz/isl.git $GITDIR13if [ -n "$1" ]; then14 (cd $GITDIR && git checkout --detach $1)15 (cd $GITDIR && git submodule update --recursive)16fi17 18# Customize the source directory for Polly:19# - Remove the autotools build system to avoid including GPL source into20# the LLVM repository, even if covered by the autotools exception21# - Create files that the autotools would have created22# - Save the custom isl C++ binding23# - Strip git source versioning24(cd $GITDIR && rm -rf m4 autogen.sh configure.ac)25(cd $GITDIR && find -name "Makefile.am" -execdir rm -f '{}' \;)26(cd $GITDIR && git describe > $GITDIR/GIT_HEAD_ID)27cp $ISL_SOURCE_DIR/include/isl/isl-noexceptions.h $GITDIR/include/isl/isl-noexceptions.h28rm -rf $GITDIR/.git29rm -rf $GITDIR/imath/.git30 31# Replace the current isl source32# IMPORTANT: Remember to `git add` any new files in LLVM's versioning33# and add them to its CMakeLists.txt if necessary.34rm -rf $ISL_SOURCE_DIR35mv -T $GITDIR $ISL_SOURCE_DIR36 37# Cleanup script temporaries38rm -rf $TMPDIR39