llvm-capstone/polly/lib/External/update-isl.sh
Michael Kruse 658eb9e142 [Polly] Remove autotools build systems from Externals. NFC.
Building a source distribution using autotools adds GPL-licenced
files into the the sources. Although redistribution of theses files is
explicitly allowed with an exception, these are not used by Polly
which uses a CMake replacement. Use the direct source checkout
instead (replacing the output of 'make dist').

Some m4 scripts with the same licence are also included in isl/ppcg
repository. Removing them renders the autotools-based build scipts
inoperable, so remove the autotools build system altogether.
2021-09-15 17:11:15 -05:00

39 lines
1.3 KiB
Bash
Executable File

#! /bin/sh
set -e
# Replace the content of the isl directory with a fresh clone from
# http://repo.or.cz/isl.git
SCRIPTPATH=`realpath --no-symlinks $(dirname $0)`
ISL_SOURCE_DIR="${SCRIPTPATH}/isl"
GITDIR=`mktemp -d --tmpdir isl-XXX`
# Checkout isl source code
git clone --recursive http://repo.or.cz/isl.git $GITDIR
if [ -n "$1" ]; then
(cd $GITDIR && git checkout --detach $1)
(cd $GITDIR && git submodule update --recursive)
fi
# Customize the source directory for Polly:
# - Remove the autotools build system to avoid including GPL source into
# the LLVM repository, even if covered by the autotools exception
# - Create files that the autotools would have created
# - Save the custom isl C++ binding
# - Strip git source versioning
(cd $GITDIR && rm -rf m4 autogen.sh configure.ac)
(cd $GITDIR && find -name "Makefile.am" -execdir rm -f '{}' \;)
(cd $GITDIR && git describe > $GITDIR/GIT_HEAD_ID)
cp $ISL_SOURCE_DIR/include/isl/isl-noexceptions.h $GITDIR/include/isl/isl-noexceptions.h
rm -rf $GITDIR/.git
rm -rf $GITDIR/imath/.git
# Replace the current isl source
# IMPORTANT: Remember to `git add` any new files in LLVM's versioning
# and add them to its CMakeLists.txt if necessary.
rm -rf $ISL_SOURCE_DIR
mv -T $GITDIR $ISL_SOURCE_DIR
# Cleanup script temporaries
rm -rf $TMPDIR