blob: 2ea0df743b19599b205334442f0a3d5328cfa83d [file] [log] [blame]
Bertrand SIMONNET92c9b182015-07-01 18:24:39 -07001#!/bin/bash
2
Alex Deymo234096a2016-06-28 16:26:00 -07003set -e
4
5if [[ "${TARGET_PRODUCT}" != "aosp_arm" ]]; then
6 # Some of the include paths below assume that this is an arm 32bit configure
7 # run.
Alex Deymo16246822017-11-28 14:10:40 +01008 echo "Run 'lunch aosp_arm-eng' and build the current version first." >&2
Alex Deymo234096a2016-06-28 16:26:00 -07009 exit 1
10fi
11
12cd $(dirname "$0")
13
Alex Deymo16246822017-11-28 14:10:40 +010014HOST="arm-linux-androideabi"
15export CC="${ANDROID_TOOLCHAIN}/${HOST}-gcc"
16export LD="${ANDROID_TOOLCHAIN}/${HOST}-ld"
Bertrand SIMONNET92c9b182015-07-01 18:24:39 -070017
18T="${ANDROID_BUILD_TOP}"
19CFLAGS=(
20 "-isystem ${T}/external/libcxx/include"
21 "-isystem ${T}/bionic/libc/include/"
22 "-isystem ${T}/bionic/libc/arch-arm/include"
Alex Deymo31e6b202016-10-05 09:44:33 -070023 "-isystem ${T}/bionic/libc/kernel/android/uapi/"
Bertrand SIMONNET92c9b182015-07-01 18:24:39 -070024 "-isystem ${T}/bionic/libc/kernel/uapi/"
25 "-isystem ${T}/bionic/libc/kernel/uapi/asm-arm/"
26 "-isystem ${T}/bionic/libm/include"
27 "-isystem ${T}/build/core/combo/include/arch/linux-arm/"
Bertrand SIMONNET92c9b182015-07-01 18:24:39 -070028 "-fno-exceptions"
29 "-ffunction-sections"
30 "-fdata-sections"
31 "-fstack-protector"
32 "-fno-short-enums"
33 "-no-canonical-prefixes"
34 "-fmessage-length=0"
35 "-fomit-frame-pointer"
36 "-fPIC"
37 "-fno-strict-aliasing"
38 "-nostdlib"
39)
Alex Deymo16246822017-11-28 14:10:40 +010040CFLAGS="${CFLAGS[@]}"
41
42CONFIGURE_ARGS=(
43 --host="${HOST}"
44 CFLAGS="${CFLAGS}"
45 LIBS="-lc"
46 CPPFLAGS="${CFLAGS} -I${T}/external/zlib/src"
47 LDFLAGS="-L${ANDROID_PRODUCT_OUT}/system/lib/"
48
49 # Disable NTLM delegation to winbind's ntlm_auth.
50 --disable-ntlm-wb
51
52 ### Disable many protocols unused in Android systems:
53 --disable-telnet
54 --disable-tftp
55 --disable-smb
56 --disable-gopher
57
Alex Deymo251844e2017-12-19 14:16:42 +010058 # Disable FTP and FTPS support.
59 --disable-ftp
60
Alex Deymo16246822017-11-28 14:10:40 +010061 # Disable LDAP and LDAPS support.
62 --disable-ldap
63 --disable-ldaps
64
65 # Disable mail protocols (IMAP, POP3).
66 --disable-pop3
67 --disable-imap
68 --disable-smtp
69
70 # Disable RTSP support (RFC 2326 / 7826).
71 --disable-rtsp
72
73 # Disable DICT support (RFC 2229).
74 --disable-dict
75
76
Alex Deymo54ee1ae2018-05-14 11:36:37 +020077 ### Enable HTTP and FILE explicitly. These are enabled by default but
Alex Deymo16246822017-11-28 14:10:40 +010078 # listed here as documentation.
79 --enable-http
Alex Deymo16246822017-11-28 14:10:40 +010080 --enable-file
81 --enable-proxy
82
83 # Enabled IPv6.
84 --enable-ipv6
85
86 --with-ssl="${T}/external/boringssl"
87 --with-zlib
88 --with-ca-path="/system/etc/security/cacerts"
89)
90
91# Show the commands on the terminal.
92set -x
Bertrand SIMONNET92c9b182015-07-01 18:24:39 -070093
Bertrand SIMONNET92c9b182015-07-01 18:24:39 -070094./buildconf
Alex Deymo16246822017-11-28 14:10:40 +010095./configure "${CONFIGURE_ARGS[@]}"
Bertrand SIMONNET92c9b182015-07-01 18:24:39 -070096
Alex Deymo234096a2016-06-28 16:26:00 -070097# Apply local changes to the default configure output.
98patch -p1 --no-backup-if-mismatch < local-configure.patch