Browse Source

reformat scripts/build/termux_step_setup_toolchain.sh

emacs-27
Leonid Plyushch 5 years ago
parent
commit
7438159dca
No known key found for this signature in database GPG Key ID: 45F2964132545795
  1. 62
      scripts/build/termux_step_setup_toolchain.sh

62
scripts/build/termux_step_setup_toolchain.sh

@ -101,41 +101,43 @@ termux_step_setup_toolchain() {
cp $_TERMUX_TOOLCHAIN_TMPDIR/aarch64-linux-android/bin/ld.gold \
$_TERMUX_TOOLCHAIN_TMPDIR/aarch64-linux-android/bin/ld
# Linker wrapper script to add '--exclude-libs libgcc.a', see
# https://github.com/android-ndk/ndk/issues/379
# https://android-review.googlesource.com/#/c/389852/
local linker
for linker in ld ld.bfd ld.gold; do
local wrap_linker=$_TERMUX_TOOLCHAIN_TMPDIR/arm-linux-androideabi/bin/$linker
local real_linker=$_TERMUX_TOOLCHAIN_TMPDIR/arm-linux-androideabi/bin/$linker.real
cp $wrap_linker $real_linker
echo '#!/bin/bash' > $wrap_linker
echo -n '$(dirname $0)/' >> $wrap_linker
echo -n $linker.real >> $wrap_linker
echo ' --exclude-libs libunwind.a --exclude-libs libgcc_real.a "$@"' >> $wrap_linker
done
for HOST_PLAT in aarch64-linux-android armv7a-linux-androideabi i686-linux-android x86_64-linux-android; do
# Linker wrapper script to add '--exclude-libs libgcc.a', see
# https://github.com/android-ndk/ndk/issues/379
# https://android-review.googlesource.com/#/c/389852/
local linker
for linker in ld ld.bfd ld.gold; do
local wrap_linker=$_TERMUX_TOOLCHAIN_TMPDIR/arm-linux-androideabi/bin/$linker
local real_linker=$_TERMUX_TOOLCHAIN_TMPDIR/arm-linux-androideabi/bin/$linker.real
cp $wrap_linker $real_linker
echo '#!/bin/bash' > $wrap_linker
echo -n '$(dirname $0)/' >> $wrap_linker
echo -n $linker.real >> $wrap_linker
echo ' --exclude-libs libunwind.a --exclude-libs libgcc_real.a "$@"' >> $wrap_linker
done
# Setup the cpp preprocessor:
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT$TERMUX_PKG_API_LEVEL-clang \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-clang
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT$TERMUX_PKG_API_LEVEL-clang++ \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-clang++
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT$TERMUX_PKG_API_LEVEL-clang \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-cpp
sed -i 's/clang/clang -E/' \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-cpp
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-clang \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-gcc
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-clang++ \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-g++
for HOST_PLAT in aarch64-linux-android armv7a-linux-androideabi i686-linux-android x86_64-linux-android; do
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT$TERMUX_PKG_API_LEVEL-clang \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-clang
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT$TERMUX_PKG_API_LEVEL-clang++ \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-clang++
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT$TERMUX_PKG_API_LEVEL-clang \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-cpp
sed -i 's/clang/clang -E/' \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-cpp
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-clang \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-gcc
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-clang++ \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/$HOST_PLAT-g++
done
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/armv7a-linux-androideabi$TERMUX_PKG_API_LEVEL-clang \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/arm-linux-androideabi-clang
$_TERMUX_TOOLCHAIN_TMPDIR/bin/arm-linux-androideabi-clang
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/armv7a-linux-androideabi$TERMUX_PKG_API_LEVEL-clang++ \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/arm-linux-androideabi-clang++
$_TERMUX_TOOLCHAIN_TMPDIR/bin/arm-linux-androideabi-clang++
cp $_TERMUX_TOOLCHAIN_TMPDIR/bin/armv7a-linux-androideabi-cpp \
$_TERMUX_TOOLCHAIN_TMPDIR/bin/arm-linux-androideabi-cpp
$_TERMUX_TOOLCHAIN_TMPDIR/bin/arm-linux-androideabi-cpp
cd $_TERMUX_TOOLCHAIN_TMPDIR/sysroot
for f in $TERMUX_SCRIPTDIR/ndk-patches/*.patch; do

Loading…
Cancel
Save