From 62af4d36dd867c7653066073504df5a7a74bc841 Mon Sep 17 00:00:00 2001 From: Maciej Skrzypkowski Date: Wed, 2 Dec 2015 09:34:58 +0100 Subject: [PATCH] Move OpenSSL Android build to the target directory #8568 --- python/servo/build_commands.py | 11 +++++++++-- python/servo/command_base.py | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/python/servo/build_commands.py b/python/servo/build_commands.py index f4b9770db25..67112c33cc4 100644 --- a/python/servo/build_commands.py +++ b/python/servo/build_commands.py @@ -13,6 +13,7 @@ import os import os.path as path import subprocess import sys +import shutil from time import time @@ -220,14 +221,20 @@ class MachCommands(CommandBase): make_cmd = ["make"] if jobs is not None: make_cmd += ["-j" + jobs] - with cd(self.android_support_dir()): + android_dir = self.android_build_dir(dev) + openssl_dir = path.join(android_dir, "native", "openssl") + if not path.exists(openssl_dir): + os.makedirs(openssl_dir) + shutil.copy(path.join(self.android_support_dir(), "openssl.makefile"), openssl_dir) + shutil.copy(path.join(self.android_support_dir(), "openssl.sh"), openssl_dir) + with cd(openssl_dir): status = call( make_cmd + ["-f", "openssl.makefile"], env=self.build_env(), verbose=verbose) if status: return status - openssl_dir = path.join(self.android_support_dir(), "openssl-1.0.1k") + openssl_dir = path.join(openssl_dir, "openssl-1.0.1k") env['OPENSSL_LIB_DIR'] = openssl_dir env['OPENSSL_INCLUDE_DIR'] = path.join(openssl_dir, "include") env['OPENSSL_STATIC'] = 'TRUE' diff --git a/python/servo/command_base.py b/python/servo/command_base.py index b3b24f8df46..b45916c5946 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -329,6 +329,9 @@ class CommandBase(object): def android_support_dir(self): return path.join(self.context.topdir, "support", "android") + def android_build_dir(self, dev): + return path.join(self.get_target_dir(), "arm-linux-androideabi", "debug" if dev else "release") + def ensure_bootstrapped(self): if self.context.bootstrapped: return