From 4bcc1d92f4d49ee7331bd2eacd28d497e505c5c7 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Queru Date: Thu, 5 Jan 2012 12:54:53 -0800 Subject: Explicitly use the top of the source tree to find the kernel. This way, we don't rely on the relative position of the source directory and the out directory, and the emulator works when using OUT_DIR_COMMON_BASE Change-Id: I319f4fffc9ffee676d8040ebbb017831db08f6b6 --- android/main-common.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/android/main-common.c b/android/main-common.c index a662907..04d200a 100644 --- a/android/main-common.c +++ b/android/main-common.c @@ -806,12 +806,15 @@ AvdInfo* createAVD(AndroidOptions* opts, int* inAndroidBuild) exit(2); } - android_build_root = path_parent( out, 4 ); - if (android_build_root == NULL || !path_exists(android_build_root)) { - derror("Can't find the Android build root from '%s'\n" - "Please check the definition of the ANDROID_PRODUCT_OUT variable.\n" - "It should point to your product-specific build output directory.\n", - out ); + android_build_root = getenv("ANDROID_BUILD_TOP"); + if (android_build_root == NULL || android_build_root[0] == 0) + break; + + if (!path_exists(android_build_root)) { + derror("Can't find the Android build root '%s'\n" + "Please check the definition of the ANDROID_BUILD_TOP variable.\n" + "It should point to the root of your source tree.\n", + android_build_root ); exit(2); } android_build_out = out; -- cgit v1.1