Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 153096e

Browse files
committed
[[ Prebuilts ]] Ensure CROSS_SYSROOT is set when building for Android
1 parent d213fa1 commit 153096e

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

prebuilt/scripts/android.inc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,13 @@ else
1212
# Attempt to set up the toolchain automatically
1313
if [ -z "${ANDROID_TOOLCHAIN}" ] ; then
1414
ANDROID_TOOLCHAIN="${HOME}/android/toolchain/standalone/bin/arm-linux-androideabi-"
15-
16-
# OpenSSL requires this to be set when cross-compiling for Android
17-
export CROSS_SYSROOT="${HOME}/android/toolchain/standalone/sysroot"
15+
# OpenSSL requires this to be set when cross-compiling for Android
16+
export CROSS_SYSROOT="${HOME}/android/toolchain/standalone/sysroot"
17+
else
18+
# if not defined, derive CROSS_ROOT from ANDROID_TOOLCHAIN
19+
if [ -z "${CROSS_SYSROOT}" ] ; then
20+
export CROSS_ROOT="${ANDROID_TOOLCHAIN%/*/*}/sysroot"
21+
fi
1822
fi
1923
2024
ANDROID_CC_NAME=${ANDROID_CC_NAME:-gcc}

0 commit comments

Comments
 (0)