blob: d9f25f44c426fcb0ae0b2f017511b90f7768e235 [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.
8 echo "Run 'lunch aosp_arm-eng' first." >&2
9 exit 1
10fi
11
12cd $(dirname "$0")
13
14export CC="$(ls "${ANDROID_TOOLCHAIN}" | grep "\-gcc$" | grep -v kernel)"
15export LD="$(ls "${ANDROID_TOOLCHAIN}" | grep "\-ld$" | grep -v kernel)"
Bertrand SIMONNET92c9b182015-07-01 18:24:39 -070016
17T="${ANDROID_BUILD_TOP}"
18CFLAGS=(
19 "-isystem ${T}/external/libcxx/include"
20 "-isystem ${T}/bionic/libc/include/"
21 "-isystem ${T}/bionic/libc/arch-arm/include"
Alex Deymo31e6b202016-10-05 09:44:33 -070022 "-isystem ${T}/bionic/libc/kernel/android/uapi/"
Bertrand SIMONNET92c9b182015-07-01 18:24:39 -070023 "-isystem ${T}/bionic/libc/kernel/uapi/"
24 "-isystem ${T}/bionic/libc/kernel/uapi/asm-arm/"
25 "-isystem ${T}/bionic/libm/include"
26 "-isystem ${T}/build/core/combo/include/arch/linux-arm/"
Bertrand SIMONNET92c9b182015-07-01 18:24:39 -070027 "-fno-exceptions"
28 "-ffunction-sections"
29 "-fdata-sections"
30 "-fstack-protector"
31 "-fno-short-enums"
32 "-no-canonical-prefixes"
33 "-fmessage-length=0"
34 "-fomit-frame-pointer"
35 "-fPIC"
36 "-fno-strict-aliasing"
37 "-nostdlib"
38)
39
Bertrand SIMONNET92c9b182015-07-01 18:24:39 -070040./buildconf
41CFLAGS="${CFLAGS[@]}"
Alex Deymo234096a2016-06-28 16:26:00 -070042./configure \
43 --host=arm-linux-androideabi \
44 CFLAGS="${CFLAGS}" \
45 LIBS="-lc" \
46 CPPFLAGS="${CFLAGS} -I${T}/external/zlib/src" \
47 LDFLAGS="-L${ANDROID_PRODUCT_OUT}/obj/lib/" \
48 --disable-ntlm-wb \
49 --enable-ipv6 \
50 --with-ssl="${T}/external/boringssl" \
51 --with-zlib \
52 --with-ca-path="/system/etc/security/cacerts"
Bertrand SIMONNET92c9b182015-07-01 18:24:39 -070053
Alex Deymo234096a2016-06-28 16:26:00 -070054# Apply local changes to the default configure output.
55patch -p1 --no-backup-if-mismatch < local-configure.patch