From e8651e2c0ba5625da98c46340a824a9df2c5d375 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Thu, 27 Aug 2015 16:53:47 -0700 Subject: Infer ANDROID_BUILD_TOP if it is not set. Change-Id: I78d92443247b7260030bbe023b460696f9289313 --- build.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'build.py') diff --git a/build.py b/build.py index 4cff80a50..34cc19f5b 100755 --- a/build.py +++ b/build.py @@ -25,10 +25,6 @@ import sys def android_path(path=''): top = os.getenv('ANDROID_BUILD_TOP', '') - if not top: - sys.exit('ANDROID_BUILD_TOP not set. Cannot continue.\n' - 'Please set ANDROID_BUILD_TOP to point to the root of an ' - 'Android tree.') return os.path.realpath(os.path.join(top, path)) @@ -98,6 +94,10 @@ def sysroot_path(toolchain): def main(): args = ArgParser().parse_args() + if 'ANDROID_BUILD_TOP' not in os.environ: + top = os.path.join(os.path.dirname(__file__), '../..') + os.environ['ANDROID_BUILD_TOP'] = os.path.realpath(top) + os.chdir(android_path('toolchain/gcc')) toolchain_path = android_path('toolchain') -- cgit v1.2.3