1 #!/bin/bash 2 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. 8 echo "Run 'lunch aosp_arm-eng' and build the current version first." >&2 9 exit 1 10 fi 11 12 cd $(dirname "$0") 13 14 HOST="arm-linux-androideabi" 15 T="${ANDROID_BUILD_TOP}" 16 export CC="${T}/prebuilts/clang/host/linux-x86/clang-r353983/bin/clang" 17 export LD="${T}/prebuilts/clang/host/linux-x86/clang-r353983/bin/lld" 18 19 CFLAGS=( 20 "-isystem ${T}/external/libcxx/include" 21 "-isystem ${T}/bionic/libc/include/" 22 "-isystem ${T}/bionic/libc/arch-arm/include" 23 "-isystem ${T}/bionic/libc/kernel/uapi/" 24 "-isystem ${T}/bionic/libc/kernel/android/uapi/" 25 "-isystem ${T}/bionic/libm/include" 26 "-fno-exceptions" 27 "-ffunction-sections" 28 "-fdata-sections" 29 "-fstack-protector" 30 "-fno-short-enums" 31 "-no-canonical-prefixes" 32 "-fmessage-length=0" 33 "-fomit-frame-pointer" 34 "-fPIC" 35 "-fno-strict-aliasing" 36 "-nostdlib" 37 ) 38 CFLAGS="${CFLAGS[@]}" 39 40 CONFIGURE_ARGS=( 41 --host="${HOST}" 42 CFLAGS="${CFLAGS}" 43 LIBS="-lc" 44 CPPFLAGS="${CFLAGS} -I${T}/external/zlib/src" 45 LDFLAGS="-L${ANDROID_PRODUCT_OUT}/system/lib/" 46 47 # Disable NTLM delegation to winbind's ntlm_auth. 48 --disable-ntlm-wb 49 50 ### Disable many protocols unused in Android systems: 51 --disable-telnet 52 --disable-tftp 53 --disable-smb 54 --disable-gopher 55 56 # Disable FTP and FTPS support. 57 --disable-ftp 58 59 # Disable LDAP and LDAPS support. 60 --disable-ldap 61 --disable-ldaps 62 63 # Disable mail protocols (IMAP, POP3). 64 --disable-pop3 65 --disable-imap 66 --disable-smtp 67 68 # Disable RTSP support (RFC 2326 / 7826). 69 --disable-rtsp 70 71 # Disable DICT support (RFC 2229). 72 --disable-dict 73 74 75 ### Enable HTTP and FILE explicitly. These are enabled by default but 76 # listed here as documentation. 77 --enable-http 78 --enable-file 79 --enable-proxy 80 81 # Enabled IPv6. 82 --enable-ipv6 83 84 --with-ssl="${T}/external/boringssl" 85 --with-zlib 86 --with-ca-path="/system/etc/security/cacerts" 87 ) 88 89 # Show the commands on the terminal. 90 set -x 91 92 ./buildconf 93 ./configure "${CONFIGURE_ARGS[@]}" 94 95 # Apply local changes to the default configure output. 96 patch -p1 --no-backup-if-mismatch < local-configure.patch 97