forked from mbdroid/curl-android-aosp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathandroid-configure.sh
More file actions
executable file
·62 lines (50 loc) · 2.22 KB
/
android-configure.sh
File metadata and controls
executable file
·62 lines (50 loc) · 2.22 KB
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
#!/bin/sh
set -e
if [ x"$ANDROID_SOURCE" = x"" ]; then
ANDROID_SOURCE=$PWD
fi
ANDROID_SOURCE=${HOME}/aosp
# host
HOST=`uname -s | tr 'A-Z' 'a-z'`
# target
TARGET=arm-linux-androideabi
# toolchain version
TOOLCHAIN_VERSION="4.7"
# path
PATH=$ANDROID_SOURCE/prebuilt/$HOST-x86/toolchain/$TARGET-$TOOLCHAIN_VERSION/bin:$PATH
# the fullpath of libgcc.a
LIBGCCA=`ls $ANDROID_SOURCE/prebuilts/gcc/$HOST-x86/arm/arm-linux-androideabi-4.7/lib/gcc/$TARGET/*/thumb/libgcc.a`
# the path of openssl
OPENSSL_PREFIX=$ANDROID_SOURCE/external/openssl
# the path of libcrypto.so libssl.so, can get it from /system/lib
OUT_LIBDIR=$ANDROID_SOURCE/out/target/product/rainmachine/system/lib
CURL_VERSION=7.41.0
C_ARES_VERSION=1.10.0
CURL_EXTRA="--disable-file --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-sspi --disable-ares --without-zlib"
pushd `dirname $0`
rm -rf curl curl-$CURL_VERSION
tar xf curl-$CURL_VERSION.tar.*
mv curl-$CURL_VERSION curl
#mkdir -p curl/ares
#rm -rf ares c-ares-$C_ARES_VERSION
#tar xf c-ares-$C_ARES_VERSION.tar.*
#mv c-ares-$C_ARES_VERSION ares
pushd curl
./configure CC=$TARGET-gcc --host=arm-linux-androideabi \
CPPFLAGS="-DANDROID -I$ANDROID_SOURCE/bionic/libc/arch-arm/include -I$ANDROID_SOURCE/bionic/libc/include -I$ANDROID_SOURCE/bionic/libc/kernel/common -I$ANDROID_SOURCE/bionic/libc/kernel/arch-arm -I$ANDROID_SOURCE/external/zlib" \
CFLAGS="-fno-exceptions -Wno-multichar -mthumb-interwork -mthumb -nostdlib " \
LIBS="-lc -ldl -lz $LIBGCCA " \
LDFLAGS="-L$OUT_LIBDIR " \
--enable-ipv6 --disable-manual --with-random=/dev/urandom \
--with-ssl=$OPENSSL_PREFIX --without-ca-bundle --without-ca-path \
--with-zlib --enable-ares $CURL_EXTRA || exit 1
popd
#pushd ares
#./configure CC=$TARGET-gcc --host=arm-linux-androideabi \
# CPPFLAGS="-DANDROID -I$ANDROID_SOURCE/bionic/libc/arch-arm/include -I$ANDROID_SOURCE/bionic/libc/include -I$ANDROID_SOURCE/bionic/libc/kernel/common -I$ANDROID_SOURCE/bionic/libc/kernel/arch-arm" \
# CFLAGS="-fno-exceptions -Wno-multichar -mthumb-interwork -mthumb -nostdlib " \
# LIBS="-lc -ldl " \
# LDFLAGS="-L$OUT_LIBDIR "\
# --with-random=/dev/urandom || exit 1
#popd
popd