From 5348f86a3f0e25cfdd44d98e2fff05730a3c382d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Tue, 27 Feb 2018 13:41:58 +0200 Subject: [PATCH] Provide dlltool via a shell script wrapper that sets the default architecture --- install-wrappers.sh | 6 +++--- wrappers/dlltool-wrapper.sh | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) create mode 100755 wrappers/dlltool-wrapper.sh diff --git a/install-wrappers.sh b/install-wrappers.sh index 28f30ca..9e270d8 100755 --- a/install-wrappers.sh +++ b/install-wrappers.sh @@ -11,19 +11,19 @@ PREFIX="$1" : ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}} mkdir -p $PREFIX/bin -cp wrappers/clang-target-wrapper.sh wrappers/objdump-wrapper.sh wrappers/ld-wrapper.sh wrappers/windres-wrapper.sh $PREFIX/bin +cp wrappers/*-wrapper.sh $PREFIX/bin cd $PREFIX/bin for arch in $ARCHS; do for exec in clang clang++ gcc g++; do ln -sf clang-target-wrapper.sh $arch-w64-mingw32-$exec done - for exec in ar ranlib nm dlltool strings; do + for exec in ar ranlib nm strings; do ln -sf llvm-$exec $arch-w64-mingw32-$exec done for exec in strip; do ln -sf /bin/true $arch-w64-mingw32-$exec done - for exec in ld objdump windres; do + for exec in ld objdump windres dlltool; do ln -sf $exec-wrapper.sh $arch-w64-mingw32-$exec done done diff --git a/wrappers/dlltool-wrapper.sh b/wrappers/dlltool-wrapper.sh new file mode 100755 index 0000000..8cd17bd --- /dev/null +++ b/wrappers/dlltool-wrapper.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +TARGET="$(basename $0 | sed 's/-[^-]*$//')" +ARCH=$(echo $TARGET | sed 's/-.*//') +case $ARCH in +i686) M=i386 ;; +x86_64) M=i386:x86-64 ;; +armv7) M=arm ;; +aarch64) M=arm64 ;; +esac +llvm-dlltool -m $M "$@"