From 59818a2eb6bc73c64398cfe82386473f7d01c713 Mon Sep 17 00:00:00 2001 From: "ulan@chromium.org" Date: Fri, 31 Aug 2012 13:31:09 +0000 Subject: [PATCH] Add option to build using a standalone Android toolchain without Android NDK. R=jkummerow@chromium.org Review URL: https://chromiumcodereview.appspot.com/10908034 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@12419 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- Makefile | 11 +++++++---- Makefile.android | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index de7433e..99a220d 100644 --- a/Makefile +++ b/Makefile @@ -34,6 +34,7 @@ TESTJOBS ?= -j16 GYPFLAGS ?= TESTFLAGS ?= ANDROID_NDK_ROOT ?= +ANDROID_TOOLCHAIN ?= ANDROID_V8 ?= /data/local/v8 # Special build flags. Use them like this: "make library=shared" @@ -145,7 +146,7 @@ ENVFILE = $(OUTDIR)/environment $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \ $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \ - must-set-ANDROID_NDK_ROOT + must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN # Target definitions. "all" is the default. all: $(MODES) @@ -182,7 +183,7 @@ native: $(OUTDIR)/Makefile.native $(ANDROID_ARCHES): $(addprefix $$@.,$(MODES)) $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) build/android.gypi \ - must-set-ANDROID_NDK_ROOT Makefile.android + must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN Makefile.android @$(MAKE) -f Makefile.android $@ \ ARCH="$(basename $@)" \ MODE="$(subst .,,$(suffix $@))" \ @@ -252,9 +253,11 @@ $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS) -must-set-ANDROID_NDK_ROOT: +must-set-ANDROID_NDK_ROOT_OR_TOOLCHAIN: ifndef ANDROID_NDK_ROOT - $(error ANDROID_NDK_ROOT is not set) +ifndef ANDROID_TOOLCHAIN + $(error ANDROID_NDK_ROOT or ANDROID_TOOLCHAIN must be set)) +endif endif # Replaces the old with the new environment file if they're different, which diff --git a/Makefile.android b/Makefile.android index bdbcbb4..aabd98c 100644 --- a/Makefile.android +++ b/Makefile.android @@ -59,7 +59,7 @@ else endif TOOLCHAIN_PATH = ${ANDROID_NDK_ROOT}/toolchains/${TOOLCHAIN_ARCH}/prebuilt -ANDROID_TOOLCHAIN = ${TOOLCHAIN_PATH}/${TOOLCHAIN_DIR}/bin +ANDROID_TOOLCHAIN ?= ${TOOLCHAIN_PATH}/${TOOLCHAIN_DIR}/bin ifeq ($(wildcard $(ANDROID_TOOLCHAIN)),) $(error Cannot find Android toolchain in "${ANDROID_TOOLCHAIN}") endif -- 2.7.4