For cross-built toolchains, rename the clang executable to clang-$MAJOR.exe

This commit is contained in:
Martin Storsjö committed 2018-10-10 23:33:19 +03:00
1 parent fb26be33a1
commit 1bc3d75a41
2 files changed
+15 -5

No files matched your search

+8 -2
View File
@@ -22,13 +22,14 @@ MINGW*)
esac
if [ -n "$EXEEXT" ]; then
UNICODE=-municode
CLANG_MAJOR=$(basename $(echo $PREFIX/lib/clang/* | awk '{print $NF}') | cut -f 1 -d .)
CTW_FLAGS="-municode -DCLANG=\"clang-$CLANG_MAJOR\""
fi
mkdir -p $PREFIX/bin
cp wrappers/*-wrapper.sh $PREFIX/bin
$CC wrappers/change-pe-arch.c -o $PREFIX/bin/change-pe-arch$EXEEXT
$CC wrappers/clang-target-wrapper.c -o $PREFIX/bin/clang-target-wrapper$EXEEXT -O2 -Wl,-s $UNICODE
$CC wrappers/clang-target-wrapper.c -o $PREFIX/bin/clang-target-wrapper$EXEEXT -O2 -Wl,-s $CTW_FLAGS
if [ -n "$EXEEXT" ]; then
# For Windows, we should prefer the executable wrapper, which also works
# when invoked from outside of MSYS.
@@ -52,3 +53,8 @@ for arch in $ARCHS; do
ln -sf objcopy-wrapper.sh $arch-w64-mingw32-$exec
done
done
if [ -n "$EXEEXT" ]; then
if [ ! -L clang$EXEEXT ]; then
mv clang$EXEEXT clang-$CLANG_MAJOR$EXEEXT
fi
fi