diff --git a/core/main.mk b/core/main.mk index 8f60da751a..e7a97be444 100644 --- a/core/main.mk +++ b/core/main.mk @@ -228,22 +228,8 @@ endif ifndef BUILD_EMULATOR -ifeq (darwin,$(HOST_OS)) -GCC_REALPATH = $(realpath $(shell which $(HOST_CC))) -ifneq ($(findstring llvm-gcc,$(GCC_REALPATH)),) - # Using LLVM GCC results in a non functional emulator due to it - # not honouring global register variables - $(warning ****************************************) - $(warning * gcc is linked to llvm-gcc which will *) - $(warning * not create a useable emulator. *) - $(warning ****************************************) + # Emulator binaries are now provided under prebuilts/android-emulator/ BUILD_EMULATOR := false -else - BUILD_EMULATOR := true -endif -else # HOST_OS is not darwin - BUILD_EMULATOR := true -endif # HOST_OS is darwin endif $(shell echo 'VERSIONS_CHECKED := $(VERSION_CHECK_SEQUENCE_NUMBER)' \ diff --git a/envsetup.sh b/envsetup.sh index 60726d3350..d02646630a 100644 --- a/envsetup.sh +++ b/envsetup.sh @@ -171,6 +171,25 @@ function setpaths() export ANDROID_QTOOLS=$T/development/emulator/qtools export ANDROID_DEV_SCRIPTS=$T/development/scripts:$T/prebuilts/devtools/tools export ANDROID_BUILD_PATHS=$(get_build_var ANDROID_BUILD_PATHS):$ANDROID_QTOOLS:$ANDROID_TOOLCHAIN:$ANDROID_KERNEL_TOOLCHAIN_PATH$ANDROID_DEV_SCRIPTS: + + # If prebuilts/android-emulator// exists, prepend it to our PATH + # to ensure that the corresponding 'emulator' binaries are used. + case $(uname -s) in + Darwin) + ANDROID_EMULATOR_PREBUILTS=$T/prebuilts/android-emulator/darwin-x86_64 + ;; + Linux) + ANDROID_EMULATOR_PREBUILTS=$T/prebuilts/android-emulator/linux-x86_64 + ;; + *) + ANDROID_EMULATOR_PREBUILTS= + ;; + esac + if [ -n "$ANDROID_EMULATOR_PREBUILTS" -a -d "$ANDROID_EMULATOR_PREBUILTS" ]; then + ANDROID_BUILD_PATHS=$ANDROID_EMULATOR_PREBUILTS:$ANDROID_BUILD_PATHS + export ANDROID_EMULATOR_PREBUILTS + fi + export PATH=$ANDROID_BUILD_PATHS$PATH unset ANDROID_JAVA_TOOLCHAIN diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index 1768ffc9b6..9d3bcc035c 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -55,4 +55,3 @@ BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true -BUILD_EMULATOR := false