Makefile patch for Orbot

Signed-off-by: Nathan Freitas <nathan@freitas.net>
This commit is contained in:
Michael Rogers 2014-06-06 15:10:48 +01:00 committed by Nathan Freitas
parent ccaec1ebd3
commit 8b5bb041d1
1 changed files with 6 additions and 10 deletions

16
external/Makefile vendored
View File

@ -23,15 +23,11 @@ endif
# Android NDK setup # Android NDK setup
NDK_BASE ?= /opt/android-ndk NDK_BASE ?= /opt/android-ndk
NDK_PLATFORM_LEVEL ?= 9 NDK_PLATFORM_LEVEL ?= 9
NDK_ABI=arm NDK_ABI ?= arm
NDK_TOOLCHAIN_VERSION=4.8 NDK_TOOLCHAIN_VERSION=4.8
NDK_SYSROOT=$(NDK_BASE)/platforms/android-$(NDK_PLATFORM_LEVEL)/arch-$(NDK_ABI) NDK_SYSROOT=$(NDK_BASE)/platforms/android-$(NDK_PLATFORM_LEVEL)/arch-$(NDK_ABI)
APP_ABI=armeabi APP_ABI ?= armeabi
# NDK platform level, aka APP_PLATFORM, is equivalent to minSdkVersion
APP_PLATFORM := android-$(shell sed -n 's,.*android:minSdkVersion="\([0-9][0-9]*\)".*,\1,p' \
$(EXTERNAL_ROOT)/../AndroidManifest.xml)
NDK_SYSROOT=$(NDK_BASE)/platforms/$(APP_PLATFORM)/arch-$(NDK_ABI)
NDK_UNAME := $(shell uname -s | tr '[A-Z]' '[a-z]') NDK_UNAME := $(shell uname -s | tr '[A-Z]' '[a-z]')
ifeq ($(NDK_ABI),x86) ifeq ($(NDK_ABI),x86)
HOST = i686-linux-android HOST = i686-linux-android
@ -85,14 +81,14 @@ all: assets
lib/libcrypto.a: lib/libcrypto.a:
cd openssl && \ cd openssl && \
./Configure android -DL_ENDIAN && \ ./Configure android -DL_ENDIAN && \
make CC="$(CC)" ANDROID_DEV=$(NDK_BASE)/platforms/android-8/arch-arm /usr build_libs make CC="$(CC)" ANDROID_DEV=$(NDK_SYSROOT)/usr build_libs
lib/libssl.a: lib/libssl.a:
cp config.sub openssl cp config.sub openssl
cp config.guess openssl cp config.guess openssl
cd openssl && \ cd openssl && \
./Configure android -DL_ENDIAN && \ ./Configure android -DL_ENDIAN && \
make CC="$(CC)" ANDROID_DEV=$(NDK_BASE)/platforms/android-8/arch-arm /usr build_libs make CC="$(CC)" ANDROID_DEV=$(NDK_SYSROOT)/usr build_libs
openssl-build-stamp: lib/libcrypto.a lib/libssl.a openssl-build-stamp: lib/libcrypto.a lib/libssl.a
touch openssl-build-stamp touch openssl-build-stamp
@ -351,8 +347,8 @@ clean: openssl-clean libevent-clean tor-clean polipo-clean jtorctl-clean liballi
showsetup: showsetup:
@echo "NDK_TOOLCHAIN_VERSION: $(NDK_TOOLCHAIN_VERSION)" @echo "NDK_TOOLCHAIN_VERSION: $(NDK_TOOLCHAIN_VERSION)"
@echo "NDK_TOOLCHAIN: $(NDK_TOOLCHAIN)" @echo "NDK_TOOLCHAIN: $(NDK_TOOLCHAIN)"
@echo "NDK_PLATFORM_LEVEL: $(NDK_PLATFORM_LEVEL)"
@echo "NDK_SYSROOT: $(NDK_SYSROOT)" @echo "NDK_SYSROOT: $(NDK_SYSROOT)"
@echo "APP_PLATFORM: $(APP_PLATFORM)"
@echo "APP_ABI: $(APP_ABI)" @echo "APP_ABI: $(APP_ABI)"
@echo "HOST: $(HOST)" @echo "HOST: $(HOST)"
@echo "CC: $(CC)" @echo "CC: $(CC)"