Add wrappers that target Universal Windows
This commit is contained in:
1 parent
47acbb667e
commit
ca44a11660
3 files changed
+30
-4
No files matched your search
+7
-4
@@ -11,6 +11,7 @@ mkdir -p "$PREFIX"
|
|||||||
PREFIX="$(cd "$PREFIX" && pwd)"
|
PREFIX="$(cd "$PREFIX" && pwd)"
|
||||||
|
|
||||||
: ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
|
: ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
|
||||||
|
: ${TARGET_OSES:=${TOOLCHAIN_TARGET_OSES-mingw32 mingw32uwp}}
|
||||||
|
|
||||||
if [ -n "$HOST" ] && [ -z "$CC" ]; then
|
if [ -n "$HOST" ] && [ -z "$CC" ]; then
|
||||||
CC=$HOST-gcc
|
CC=$HOST-gcc
|
||||||
@@ -49,17 +50,19 @@ else
|
|||||||
fi
|
fi
|
||||||
cd $PREFIX/bin
|
cd $PREFIX/bin
|
||||||
for arch in $ARCHS; do
|
for arch in $ARCHS; do
|
||||||
|
for target_os in $TARGET_OSES; do
|
||||||
for exec in clang clang++ gcc g++ cc c99 c11 c++; do
|
for exec in clang clang++ gcc g++ cc c99 c11 c++; do
|
||||||
ln -sf clang-target-wrapper$CTW_SUFFIX $arch-w64-mingw32-$exec$CTW_LINK_SUFFIX
|
ln -sf clang-target-wrapper$CTW_SUFFIX $arch-w64-$target_os-$exec$CTW_LINK_SUFFIX
|
||||||
done
|
done
|
||||||
for exec in ar ranlib nm objcopy strings strip; do
|
for exec in ar ranlib nm objcopy strings strip; do
|
||||||
ln -sf llvm-$exec$EXEEXT $arch-w64-mingw32-$exec$EXEEXT || true
|
ln -sf llvm-$exec$EXEEXT $arch-w64-$target_os-$exec$EXEEXT || true
|
||||||
done
|
done
|
||||||
for exec in windres; do
|
for exec in windres; do
|
||||||
ln -sf $exec-wrapper$EXEEXT $arch-w64-mingw32-$exec$EXEEXT
|
ln -sf $exec-wrapper$EXEEXT $arch-w64-$target_os-$exec$EXEEXT
|
||||||
done
|
done
|
||||||
for exec in ld objdump dlltool; do
|
for exec in ld objdump dlltool; do
|
||||||
ln -sf $exec-wrapper.sh $arch-w64-mingw32-$exec
|
ln -sf $exec-wrapper.sh $arch-w64-$target_os-$exec
|
||||||
|
done
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
if [ -n "$EXEEXT" ]; then
|
if [ -n "$EXEEXT" ]; then
|
||||||
|
|||||||
@@ -257,6 +257,9 @@ int _tmain(int argc, TCHAR* argv[]) {
|
|||||||
dash = _tcschr(arch, '-');
|
dash = _tcschr(arch, '-');
|
||||||
if (dash)
|
if (dash)
|
||||||
*dash = '\0';
|
*dash = '\0';
|
||||||
|
TCHAR *target_os = _tcsrchr(target, '-');
|
||||||
|
if (target_os)
|
||||||
|
target_os++;
|
||||||
|
|
||||||
// Check if trying to compile Ada; if we try to do this, invoking clang
|
// Check if trying to compile Ada; if we try to do this, invoking clang
|
||||||
// would end up invoking <triplet>-gcc with the same arguments, which ends
|
// would end up invoking <triplet>-gcc with the same arguments, which ends
|
||||||
@@ -293,6 +296,15 @@ int _tmain(int argc, TCHAR* argv[]) {
|
|||||||
// Dwarf is the default here.
|
// Dwarf is the default here.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (target_os && !_tcscmp(target_os, _T("mingw32uwp"))) {
|
||||||
|
// the UWP target is for Windows 10
|
||||||
|
exec_argv[arg++] = _T("-D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00");
|
||||||
|
// the UWP target can only use Windows Store APIs
|
||||||
|
exec_argv[arg++] = _T("-DWINAPI_FAMILY=WINAPI_FAMILY_APP");
|
||||||
|
// the Windows Store API only supports Windows Unicode (some rare ANSI ones are available)
|
||||||
|
exec_argv[arg++] = _T("-DUNICODE");
|
||||||
|
}
|
||||||
|
|
||||||
exec_argv[arg++] = _T("-target");
|
exec_argv[arg++] = _T("-target");
|
||||||
exec_argv[arg++] = target;
|
exec_argv[arg++] = target;
|
||||||
exec_argv[arg++] = _T("-rtlib=compiler-rt");
|
exec_argv[arg++] = _T("-rtlib=compiler-rt");
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ if [ "$TARGET" = "$BASENAME" ]; then
|
|||||||
TARGET=$DEFAULT_TARGET
|
TARGET=$DEFAULT_TARGET
|
||||||
fi
|
fi
|
||||||
ARCH="${TARGET%%-*}"
|
ARCH="${TARGET%%-*}"
|
||||||
|
TARGET_OS="${TARGET##*-}"
|
||||||
|
|
||||||
# Check if trying to compile Ada; if we try to do this, invoking clang
|
# Check if trying to compile Ada; if we try to do this, invoking clang
|
||||||
# would end up invoking <triplet>-gcc with the same arguments, which ends
|
# would end up invoking <triplet>-gcc with the same arguments, which ends
|
||||||
@@ -52,6 +53,16 @@ aarch64)
|
|||||||
# Dwarf is the default here.
|
# Dwarf is the default here.
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
case $TARGET_OS in
|
||||||
|
mingw32uwp)
|
||||||
|
# the UWP target is for Windows 10
|
||||||
|
FLAGS="$FLAGS -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00"
|
||||||
|
# the UWP target can only use Windows Store APIs
|
||||||
|
FLAGS="$FLAGS -DWINAPI_FAMILY=WINAPI_FAMILY_APP"
|
||||||
|
# the Windows Store API only supports Windows Unicode (some rare ANSI ones are available)
|
||||||
|
FLAGS="$FLAGS -DUNICODE"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
FLAGS="$FLAGS -target $TARGET"
|
FLAGS="$FLAGS -target $TARGET"
|
||||||
FLAGS="$FLAGS -rtlib=compiler-rt"
|
FLAGS="$FLAGS -rtlib=compiler-rt"
|
||||||
|
|||||||
Reference in new issue
Block a user