|
@ -207,7 +207,7 @@ termux_step_setup_variables() { |
|
|
TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_TOPDIR/_lib/toolchain-${TERMUX_ARCH}-ndk${TERMUX_NDK_VERSION}-api${TERMUX_API_LEVEL}" |
|
|
TERMUX_STANDALONE_TOOLCHAIN="$TERMUX_TOPDIR/_lib/toolchain-${TERMUX_ARCH}-ndk${TERMUX_NDK_VERSION}-api${TERMUX_API_LEVEL}" |
|
|
# Bump the below version if a change is made in toolchain setup to ensure |
|
|
# Bump the below version if a change is made in toolchain setup to ensure |
|
|
# that everyone gets an updated toolchain: |
|
|
# that everyone gets an updated toolchain: |
|
|
TERMUX_STANDALONE_TOOLCHAIN+="-v6" |
|
|
TERMUX_STANDALONE_TOOLCHAIN+="-v7" |
|
|
|
|
|
|
|
|
export TERMUX_TAR="tar" |
|
|
export TERMUX_TAR="tar" |
|
|
export TERMUX_TOUCH="touch" |
|
|
export TERMUX_TOUCH="touch" |
|
@ -516,14 +516,18 @@ termux_step_setup_toolchain() { |
|
|
--arch $_NDK_ARCHNAME \ |
|
|
--arch $_NDK_ARCHNAME \ |
|
|
--install-dir $_TERMUX_TOOLCHAIN_TMPDIR |
|
|
--install-dir $_TERMUX_TOOLCHAIN_TMPDIR |
|
|
|
|
|
|
|
|
local w |
|
|
local wrapped plusplus CLANG_TARGET=$TERMUX_HOST_PLATFORM |
|
|
for w in ${TERMUX_ARCH}-linux-android-clang clang; do |
|
|
if [ $TERMUX_ARCH = arm ]; then CLANG_TARGET=${CLANG_TARGET/arm-/armv7a-}; fi |
|
|
cp $TERMUX_SCRIPTDIR/scripts/clang-pie-wrapper $_TERMUX_TOOLCHAIN_TMPDIR/bin/$w |
|
|
for wrapped in ${TERMUX_HOST_PLATFORM}-clang clang; do |
|
|
sed -i 's/COMPILER/clang38/' $_TERMUX_TOOLCHAIN_TMPDIR/bin/$w |
|
|
for plusplus in "" "++"; do |
|
|
sed -i "s/TERMUX_ARCH/$TERMUX_ARCH/" $_TERMUX_TOOLCHAIN_TMPDIR/bin/$w |
|
|
local FILE_TO_REPLACE=$_TERMUX_TOOLCHAIN_TMPDIR/bin/${wrapped}${plusplus} |
|
|
cp $TERMUX_SCRIPTDIR/scripts/clang-pie-wrapper $_TERMUX_TOOLCHAIN_TMPDIR/bin/$w++ |
|
|
if [ ! -f $FILE_TO_REPLACE ]; then |
|
|
sed -i 's/COMPILER/clang38++/' $_TERMUX_TOOLCHAIN_TMPDIR/bin/$w++ |
|
|
termux_error_exit "No toolchain file to override: $FILE_TO_REPLACE" |
|
|
sed -i "s/TERMUX_ARCH/$TERMUX_ARCH/" $_TERMUX_TOOLCHAIN_TMPDIR/bin/$w++ |
|
|
fi |
|
|
|
|
|
cp $TERMUX_SCRIPTDIR/scripts/clang-pie-wrapper $FILE_TO_REPLACE |
|
|
|
|
|
sed -i "s/COMPILER/clang38$plusplus/" $FILE_TO_REPLACE |
|
|
|
|
|
sed -i "s/CLANG_TARGET/$CLANG_TARGET/" $FILE_TO_REPLACE |
|
|
|
|
|
done |
|
|
done |
|
|
done |
|
|
|
|
|
|
|
|
if [ "$TERMUX_ARCH" = "arm" ]; then |
|
|
if [ "$TERMUX_ARCH" = "arm" ]; then |
|
|