mirror of
https://github.com/servo/servo.git
synced 2025-06-21 07:38:59 +01:00
Use mach to build openssl on android instead of glut makefile.
The glut makefile will be removed shortly after glutin lands for android, so we need to build openssl for android elsewhere in the build process.
This commit is contained in:
parent
feabaf34ac
commit
030dab553e
6 changed files with 32 additions and 16 deletions
|
@ -18,21 +18,10 @@ all: glut_app
|
||||||
ant debug
|
ant debug
|
||||||
|
|
||||||
.PHONY: glut_app
|
.PHONY: glut_app
|
||||||
glut_app: openssl
|
glut_app:
|
||||||
cd glut_app; \
|
cd glut_app; \
|
||||||
OPENSSL_PATH=`pwd`/../openssl-1.0.1j ../../../mach cargo build --target=arm-linux-androideabi $(CARGO_OPTS)
|
../../../mach cargo build --target=arm-linux-androideabi $(CARGO_OPTS)
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install:
|
install:
|
||||||
$(ANDROID_SDK)/platform-tools/adb install -r bin/ServoAndroid-debug.apk
|
$(ANDROID_SDK)/platform-tools/adb install -r bin/ServoAndroid-debug.apk
|
||||||
|
|
||||||
# From http://wiki.openssl.org/index.php/Android
|
|
||||||
.PHONY: openssl
|
|
||||||
openssl: openssl-1.0.1j/libssl.so
|
|
||||||
|
|
||||||
openssl-1.0.1j/libssl.so: openssl-1.0.1j/Configure
|
|
||||||
bash openssl.sh ${ANDROID_NDK}
|
|
||||||
|
|
||||||
openssl-1.0.1j/Configure:
|
|
||||||
wget https://www.openssl.org/source/openssl-1.0.1j.tar.gz
|
|
||||||
tar -zxvf openssl-1.0.1j.tar.gz
|
|
||||||
|
|
|
@ -63,17 +63,25 @@ class MachCommands(CommandBase):
|
||||||
opts += ["--features", "%s" % ' '.join(features)]
|
opts += ["--features", "%s" % ' '.join(features)]
|
||||||
|
|
||||||
build_start = time()
|
build_start = time()
|
||||||
|
env = self.build_env()
|
||||||
if android:
|
if android:
|
||||||
|
# Build OpenSSL for android
|
||||||
|
with cd(self.android_support_dir()):
|
||||||
|
status = subprocess.call(
|
||||||
|
["make", "-j4", "-f", "openssl.makefile"],
|
||||||
|
env=self.build_env())
|
||||||
|
env['OPENSSL_PATH'] = path.join(self.android_support_dir(), "openssl-1.0.1j")
|
||||||
|
|
||||||
make_opts = []
|
make_opts = []
|
||||||
if opts:
|
if opts:
|
||||||
make_opts += ["CARGO_OPTS=" + " ".join(opts)]
|
make_opts += ["CARGO_OPTS=" + " ".join(opts)]
|
||||||
status = subprocess.call(
|
status = subprocess.call(
|
||||||
["make", "-C", "ports/android"] + make_opts,
|
["make", "-C", "ports/android"] + make_opts,
|
||||||
env=self.build_env())
|
env=env)
|
||||||
else:
|
else:
|
||||||
status = subprocess.call(
|
status = subprocess.call(
|
||||||
["cargo", "build"] + opts,
|
["cargo", "build"] + opts,
|
||||||
env=self.build_env(), cwd=self.servo_crate())
|
env=env, cwd=self.servo_crate())
|
||||||
elapsed = time() - build_start
|
elapsed = time() - build_start
|
||||||
|
|
||||||
print("Build completed in %0.2fs" % elapsed)
|
print("Build completed in %0.2fs" % elapsed)
|
||||||
|
|
|
@ -145,6 +145,9 @@ class CommandBase(object):
|
||||||
def servo_crate(self):
|
def servo_crate(self):
|
||||||
return path.join(self.context.topdir, "components", "servo")
|
return path.join(self.context.topdir, "components", "servo")
|
||||||
|
|
||||||
|
def android_support_dir(self):
|
||||||
|
return path.join(self.context.topdir, "support", "android")
|
||||||
|
|
||||||
def ensure_bootstrapped(self):
|
def ensure_bootstrapped(self):
|
||||||
if self.context.bootstrapped:
|
if self.context.bootstrapped:
|
||||||
return
|
return
|
||||||
|
|
3
support/android/.gitignore
vendored
Normal file
3
support/android/.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
openssl-1.0.1j/
|
||||||
|
openssl-1.0.1j.tar.gz
|
||||||
|
|
13
support/android/openssl.makefile
Normal file
13
support/android/openssl.makefile
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
.PHONY: all
|
||||||
|
all: openssl
|
||||||
|
|
||||||
|
# From http://wiki.openssl.org/index.php/Android
|
||||||
|
.PHONY: openssl
|
||||||
|
openssl: openssl-1.0.1j/libssl.so
|
||||||
|
|
||||||
|
openssl-1.0.1j/libssl.so: openssl-1.0.1j/Configure
|
||||||
|
./openssl.sh ${ANDROID_NDK}
|
||||||
|
|
||||||
|
openssl-1.0.1j/Configure:
|
||||||
|
wget https://www.openssl.org/source/openssl-1.0.1j.tar.gz
|
||||||
|
tar -zxf openssl-1.0.1j.tar.gz
|
0
ports/android/openssl.sh → support/android/openssl.sh
Normal file → Executable file
0
ports/android/openssl.sh → support/android/openssl.sh
Normal file → Executable file
Loading…
Add table
Add a link
Reference in a new issue