mirror of
https://github.com/servo/servo.git
synced 2025-08-11 00:15:32 +01:00
Support i686-linux-android target.
This commit is contained in:
parent
319556cf6a
commit
d6b8aaf576
13 changed files with 54 additions and 17 deletions
|
@ -48,7 +48,7 @@ fn android_main() {
|
|||
"arch-arm"
|
||||
} else if target.contains("aarch64") {
|
||||
"arch-arm64"
|
||||
} else if target.contains("x86") {
|
||||
} else if target.contains("x86") || target.contains("i686") {
|
||||
"arch-x86"
|
||||
} else if target.contains("mips") {
|
||||
"arch-mips"
|
||||
|
@ -62,10 +62,13 @@ fn android_main() {
|
|||
"android-18"
|
||||
};
|
||||
|
||||
let toolchain = if target.contains("armv7") {
|
||||
"arm-linux-androideabi".into()
|
||||
let (toolchain, prefix) = if target.contains("armv7") {
|
||||
let toolchain = "arm-linux-androideabi";
|
||||
(toolchain.into(), toolchain.into())
|
||||
} else if target.contains("i686") {
|
||||
("x86".into(), target)
|
||||
} else {
|
||||
target
|
||||
(target.clone(), target)
|
||||
};
|
||||
|
||||
let toolchain_path = ndk_path.join("toolchains").join(format!("{}-4.9", toolchain)).join("prebuilt").
|
||||
|
@ -77,7 +80,7 @@ fn android_main() {
|
|||
let directory = Path::new(&out_dir);
|
||||
|
||||
// compiling android_native_app_glue.c
|
||||
if Command::new(toolchain_path.join("bin").join(format!("{}-gcc", toolchain)))
|
||||
if Command::new(toolchain_path.join("bin").join(format!("{}-gcc", prefix)))
|
||||
.arg(ndk_path.join("sources").join("android").join("native_app_glue").join("android_native_app_glue.c"))
|
||||
.arg("-c")
|
||||
.arg("-o").arg(directory.join("android_native_app_glue.o"))
|
||||
|
@ -91,7 +94,7 @@ fn android_main() {
|
|||
}
|
||||
|
||||
// compiling libandroid_native_app_glue.a
|
||||
if Command::new(toolchain_path.join("bin").join(format!("{}-ar", toolchain)))
|
||||
if Command::new(toolchain_path.join("bin").join(format!("{}-ar", prefix)))
|
||||
.arg("rcs")
|
||||
.arg(directory.join("libandroid_native_app_glue.a"))
|
||||
.arg(directory.join("android_native_app_glue.o"))
|
||||
|
|
|
@ -11,4 +11,5 @@ set -o pipefail
|
|||
source ./ports/servo/fake-ld.sh
|
||||
|
||||
export _GCC_PARAMS="${@}"
|
||||
call_gcc "arch-arm" "arm-linux-androideabi" "android-18" "armeabi"
|
||||
call_gcc "arch-arm" "arm-linux-androideabi" "android-18" "armeabi" \
|
||||
"arm-linux-androideabi"
|
||||
|
|
|
@ -11,4 +11,5 @@ set -o pipefail
|
|||
source ./ports/servo/fake-ld.sh
|
||||
|
||||
export _GCC_PARAMS="${@}"
|
||||
call_gcc "arch-arm" "arm-linux-androideabi" "android-18" "armeabi-v7a"
|
||||
call_gcc "arch-arm" "arm-linux-androideabi" "android-18" "armeabi-v7a" \
|
||||
"arm-linux-androideabi"
|
||||
|
|
14
ports/servo/fake-ld-x86.sh
Executable file
14
ports/servo/fake-ld-x86.sh
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
source ./ports/servo/fake-ld.sh
|
||||
|
||||
export _GCC_PARAMS="${@}"
|
||||
call_gcc "arch-x86" "x86" "android-18" "x86" "i686-linux-android"
|
|
@ -32,7 +32,7 @@ call_gcc()
|
|||
echo "sysroot: ${ANDROID_SYSROOT}"
|
||||
echo "targetdir: ${ANDROID_CXX_LIBS}"
|
||||
|
||||
"${ANDROID_TOOLCHAIN}/${_ANDROID_EABI}-gcc" \
|
||||
"${ANDROID_TOOLCHAIN}/$5-gcc" \
|
||||
--sysroot="${ANDROID_SYSROOT}" -L "${ANDROID_CXX_LIBS}" ${_GCC_PARAMS} -lc++ \
|
||||
-o "${TARGET_DIR}/libservo.so" -shared && touch "${TARGET_DIR}/servo"
|
||||
}
|
||||
|
|
|
@ -387,12 +387,12 @@ impl Window {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_arch = "arm", target_arch = "aarch64")))]
|
||||
#[cfg(not(any(target_arch = "arm", target_arch = "aarch64", target_os = "android")))]
|
||||
fn gl_version() -> GlRequest {
|
||||
return GlRequest::Specific(Api::OpenGl, (3, 2));
|
||||
}
|
||||
|
||||
#[cfg(any(target_arch = "arm", target_arch = "aarch64"))]
|
||||
#[cfg(any(target_arch = "arm", target_arch = "aarch64", target_os = "android"))]
|
||||
fn gl_version() -> GlRequest {
|
||||
GlRequest::Specific(Api::OpenGlEs, (3, 0))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue