Bertrand SIMONNET | 92c9b18 | 2015-07-01 18:24:39 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
Alex Deymo | 234096a | 2016-06-28 16:26:00 -0700 | [diff] [blame] | 3 | set -e |
| 4 | |
| 5 | if [[ "${TARGET_PRODUCT}" != "aosp_arm" ]]; then |
| 6 | # Some of the include paths below assume that this is an arm 32bit configure |
| 7 | # run. |
Alex Deymo | 1624682 | 2017-11-28 14:10:40 +0100 | [diff] [blame] | 8 | echo "Run 'lunch aosp_arm-eng' and build the current version first." >&2 |
Alex Deymo | 234096a | 2016-06-28 16:26:00 -0700 | [diff] [blame] | 9 | exit 1 |
| 10 | fi |
| 11 | |
| 12 | cd $(dirname "$0") |
| 13 | |
Alex Deymo | 1624682 | 2017-11-28 14:10:40 +0100 | [diff] [blame] | 14 | HOST="arm-linux-androideabi" |
| 15 | export CC="${ANDROID_TOOLCHAIN}/${HOST}-gcc" |
| 16 | export LD="${ANDROID_TOOLCHAIN}/${HOST}-ld" |
Bertrand SIMONNET | 92c9b18 | 2015-07-01 18:24:39 -0700 | [diff] [blame] | 17 | |
| 18 | T="${ANDROID_BUILD_TOP}" |
| 19 | CFLAGS=( |
| 20 | "-isystem ${T}/external/libcxx/include" |
| 21 | "-isystem ${T}/bionic/libc/include/" |
| 22 | "-isystem ${T}/bionic/libc/arch-arm/include" |
Alex Deymo | 31e6b20 | 2016-10-05 09:44:33 -0700 | [diff] [blame] | 23 | "-isystem ${T}/bionic/libc/kernel/android/uapi/" |
Bertrand SIMONNET | 92c9b18 | 2015-07-01 18:24:39 -0700 | [diff] [blame] | 24 | "-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 SIMONNET | 92c9b18 | 2015-07-01 18:24:39 -0700 | [diff] [blame] | 28 | "-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 Deymo | 1624682 | 2017-11-28 14:10:40 +0100 | [diff] [blame] | 40 | CFLAGS="${CFLAGS[@]}" |
| 41 | |
| 42 | CONFIGURE_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 Deymo | 251844e | 2017-12-19 14:16:42 +0100 | [diff] [blame] | 58 | # Disable FTP and FTPS support. |
| 59 | --disable-ftp |
| 60 | |
Alex Deymo | 1624682 | 2017-11-28 14:10:40 +0100 | [diff] [blame] | 61 | # 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 Deymo | 54ee1ae | 2018-05-14 11:36:37 +0200 | [diff] [blame] | 77 | ### Enable HTTP and FILE explicitly. These are enabled by default but |
Alex Deymo | 1624682 | 2017-11-28 14:10:40 +0100 | [diff] [blame] | 78 | # listed here as documentation. |
| 79 | --enable-http |
Alex Deymo | 1624682 | 2017-11-28 14:10:40 +0100 | [diff] [blame] | 80 | --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. |
| 92 | set -x |
Bertrand SIMONNET | 92c9b18 | 2015-07-01 18:24:39 -0700 | [diff] [blame] | 93 | |
Bertrand SIMONNET | 92c9b18 | 2015-07-01 18:24:39 -0700 | [diff] [blame] | 94 | ./buildconf |
Alex Deymo | 1624682 | 2017-11-28 14:10:40 +0100 | [diff] [blame] | 95 | ./configure "${CONFIGURE_ARGS[@]}" |
Bertrand SIMONNET | 92c9b18 | 2015-07-01 18:24:39 -0700 | [diff] [blame] | 96 | |
Alex Deymo | 234096a | 2016-06-28 16:26:00 -0700 | [diff] [blame] | 97 | # Apply local changes to the default configure output. |
| 98 | patch -p1 --no-backup-if-mismatch < local-configure.patch |