diff options
author | Dan Albert <danalbert@google.com> | 2015-08-27 16:53:47 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2015-08-27 17:10:55 -0700 |
commit | e8651e2c0ba5625da98c46340a824a9df2c5d375 (patch) | |
tree | d6246b06d22a30d7ed333c6d6b2125c17e606fda /build.py | |
parent | a4e5986f823cf7b71bce508361865abe24a43dfd (diff) | |
download | toolchain_gcc-e8651e2c0ba5625da98c46340a824a9df2c5d375.tar.gz toolchain_gcc-e8651e2c0ba5625da98c46340a824a9df2c5d375.tar.bz2 toolchain_gcc-e8651e2c0ba5625da98c46340a824a9df2c5d375.zip |
Infer ANDROID_BUILD_TOP if it is not set.
Change-Id: I78d92443247b7260030bbe023b460696f9289313
Diffstat (limited to 'build.py')
-rwxr-xr-x | build.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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') |