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. |
| 8 | echo "Run 'lunch aosp_arm-eng' first." >&2 |
| 9 | exit 1 |
| 10 | fi |
| 11 | |
| 12 | cd $(dirname "$0") |
| 13 | |
| 14 | export CC="$(ls "${ANDROID_TOOLCHAIN}" | grep "\-gcc$" | grep -v kernel)" |
| 15 | export LD="$(ls "${ANDROID_TOOLCHAIN}" | grep "\-ld$" | grep -v kernel)" |
Bertrand SIMONNET | 92c9b18 | 2015-07-01 18:24:39 -0700 | [diff] [blame] | 16 | |
| 17 | T="${ANDROID_BUILD_TOP}" |
| 18 | CFLAGS=( |
| 19 | "-isystem ${T}/external/libcxx/include" |
| 20 | "-isystem ${T}/bionic/libc/include/" |
| 21 | "-isystem ${T}/bionic/libc/arch-arm/include" |
Alex Deymo | 31e6b20 | 2016-10-05 09:44:33 -0700 | [diff] [blame] | 22 | "-isystem ${T}/bionic/libc/kernel/android/uapi/" |
Bertrand SIMONNET | 92c9b18 | 2015-07-01 18:24:39 -0700 | [diff] [blame] | 23 | "-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 SIMONNET | 92c9b18 | 2015-07-01 18:24:39 -0700 | [diff] [blame] | 27 | "-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 SIMONNET | 92c9b18 | 2015-07-01 18:24:39 -0700 | [diff] [blame] | 40 | ./buildconf |
| 41 | CFLAGS="${CFLAGS[@]}" |
Alex Deymo | 234096a | 2016-06-28 16:26:00 -0700 | [diff] [blame] | 42 | ./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 SIMONNET | 92c9b18 | 2015-07-01 18:24:39 -0700 | [diff] [blame] | 53 | |
Alex Deymo | 234096a | 2016-06-28 16:26:00 -0700 | [diff] [blame] | 54 | # Apply local changes to the default configure output. |
| 55 | patch -p1 --no-backup-if-mismatch < local-configure.patch |