1
1
#! /bin/sh
2
2
3
+ NDK_STL=" libc++"
4
+
3
5
IFS='
4
6
'
5
7
@@ -23,23 +25,29 @@ grep "64.bit" "$NDK/RELEASE.TXT" >/dev/null 2>&1 && MYARCH="${MYARCH}_64"
23
25
[ -z " $NDK " ] && { echo " You need Andorid NDK r8 or newer installed to run this script" ; exit 1 ; }
24
26
GCCPREFIX=arm-linux-androideabi
25
27
GCCVER=4.8
26
- PLATFORMVER=android-14
28
+ PLATFORMVER=android-16
27
29
LOCAL_PATH=` dirname $0 `
28
30
if which realpath > /dev/null ; then
29
31
LOCAL_PATH=` realpath $LOCAL_PATH `
30
32
else
31
33
LOCAL_PATH=` cd $LOCAL_PATH && pwd`
32
34
fi
33
35
ARCH=armeabi-v7a
36
+ STL_CFLAGS=" -isystem$NDK /sources/cxx-stl/gnu-libstdc++/$GCCVER /include \
37
+ -isystem$NDK /sources/cxx-stl/gnu-libstdc++/$GCCVER /libs/$ARCH /include"
38
+ STL_LDFLAGS=" -L$NDK /sources/cxx-stl/gnu-libstdc++/$GCCVER /libs/$ARCH "
39
+ if [[ " $NDK_STL " -eq " libc++" ]] ; then
40
+ STL_CFLAGS=" -isystem$NDK /sources/cxx-stl/llvm-libc++/include"
41
+ STL_LDFLAGS=" -L$NDK /sources/cxx-stl/llvm-libc++/libs/$ARCH "
42
+ fi
34
43
35
44
CFLAGS=" \
36
45
-fpic -ffunction-sections -funwind-tables -fstack-protector \
37
46
-no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb \
38
47
-fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -marm -fno-omit-frame-pointer \
39
48
-DANDROID -DNDEBUG -O2 -g -finline-functions -Wa,--noexecstack -Wformat -Werror=format-security \
40
49
-isystem$NDK /platforms/$PLATFORMVER /arch-arm/usr/include \
41
- -isystem$NDK /sources/cxx-stl/gnu-libstdc++/$GCCVER /include \
42
- -isystem$NDK /sources/cxx-stl/gnu-libstdc++/$GCCVER /libs/$ARCH /include \
50
+ $STL_CFLAGS \
43
51
$CFLAGS "
44
52
45
53
UNRESOLVED=" -Wl,--no-undefined"
@@ -57,7 +65,7 @@ $SHARED \
57
65
--sysroot=$NDK /platforms/$PLATFORMVER /arch-arm \
58
66
-L$NDK /platforms/$PLATFORMVER /arch-arm/usr/lib \
59
67
-lc -lm -ldl -lz \
60
- -L $NDK /sources/cxx-stl/gnu-libstdc++/ $GCCVER /libs/ $ARCH \
68
+ $STL_LDFLAGS \
61
69
-lgnustl_static \
62
70
-march=armv7-a -Wl,--fix-cortex-a8 \
63
71
-no-canonical-prefixes $UNRESOLVED -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now \
0 commit comments