-
Notifications
You must be signed in to change notification settings - Fork 751
/
Copy pathlibvpx-android.patch
72 lines (70 loc) · 2.37 KB
/
libvpx-android.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
diff -ruN libvpx-1.8.1/build/make/configure.sh libvpx-1.8.1-android/build/make/configure.sh
--- libvpx-1.8.1/build/make/configure.sh 2019-07-16 06:55:33.000000000 +0900
+++ libvpx-1.8.1-android/build/make/configure.sh 2019-08-10 13:40:49.859895140 +0900
@@ -1098,10 +1098,30 @@
;;
android*)
- echo "Assuming standalone build with NDK toolchain."
- echo "See build/make/Android.mk for details."
- check_add_ldflags -static
- soft_enable unit_tests
+ if [ -n "${ANDROID_NDK}" ]; then
+ TOOLCHAIN_PATH=${ANDROID_PREFIX}-
+ CC=${ANDROID_CC}
+ CXX=${ANDROID_CC}++
+ AR=${TOOLCHAIN_PATH}ar
+ LD=${ANDROID_CC}
+ AS=${TOOLCHAIN_PATH}as
+ STRIP=${TOOLCHAIN_PATH}strip
+ NM=${TOOLCHAIN_PATH}nm
+ alt_libc=$ANDROID_ROOT
+
+ if [ -d "${alt_libc}" ]; then
+ add_cflags "--sysroot=${alt_libc}"
+ add_ldflags "--sysroot=${alt_libc}"
+ fi
+
+ enable_feature pic
+ soft_enable realtime_only
+ else
+ echo "Assuming standalone build with NDK toolchain."
+ echo "See build/make/Android.mk for details."
+ check_add_ldflags -static
+ soft_enable unit_tests
+ fi
;;
darwin*)
@@ -1252,8 +1272,32 @@
;;
x86*)
case ${tgt_os} in
- android)
+ android*)
soft_enable realtime_only
+ if [ -n "${ANDROID_NDK}" ]; then
+ TOOLCHAIN_PATH=${ANDROID_PREFIX}-
+ CC=${ANDROID_CC}
+ CXX=${ANDROID_CC}++
+ AR=${TOOLCHAIN_PATH}ar
+ LD=${ANDROID_CC}
+ AS=${TOOLCHAIN_PATH}as
+ STRIP=${TOOLCHAIN_PATH}strip
+ NM=${TOOLCHAIN_PATH}nm
+ alt_libc=$ANDROID_ROOT
+
+ if [ -d "${alt_libc}" ]; then
+ add_cflags "--sysroot=${alt_libc}"
+ add_ldflags "--sysroot=${alt_libc}"
+ fi
+
+ enable_feature pic
+ soft_enable realtime_only
+ else
+ echo "Assuming standalone build with NDK toolchain."
+ echo "See build/make/Android.mk for details."
+ check_add_ldflags -static
+ soft_enable unit_tests
+ fi
;;
win*)
enabled gcc && add_cflags -fno-common