Dan Albert | 65780b2 | 2016-10-19 14:17:19 -0700 | [diff] [blame] | 1 | #!/bin/bash -ex |
| 2 | |
| 3 | if [ -z "${OUT_DIR}" ]; then |
| 4 | echo Must set OUT_DIR |
| 5 | exit 1 |
| 6 | fi |
| 7 | |
| 8 | TOP=$(pwd) |
| 9 | |
Colin Cross | 9fe6ea8 | 2016-11-09 13:00:16 -0800 | [diff] [blame] | 10 | source build/envsetup.sh |
| 11 | PLATFORM_SDK_VERSION=$(get_build_var PLATFORM_SDK_VERSION) |
Dan Albert | 5903451 | 2017-07-31 14:23:39 -0700 | [diff] [blame] | 12 | PLATFORM_VERSION_ALL_CODENAMES=$(get_build_var PLATFORM_VERSION_ALL_CODENAMES) |
| 13 | |
| 14 | # PLATFORM_VERSION_ALL_CODESNAMES is a comma separated list like O,P. We need to |
| 15 | # turn this into ["O","P"]. |
Dan Albert | 6807ba2 | 2017-08-30 13:55:35 -0700 | [diff] [blame] | 16 | PLATFORM_VERSION_ALL_CODENAMES=${PLATFORM_VERSION_ALL_CODENAMES/,/'","'} |
Dan Albert | 5903451 | 2017-07-31 14:23:39 -0700 | [diff] [blame] | 17 | PLATFORM_VERSION_ALL_CODENAMES="[\"${PLATFORM_VERSION_ALL_CODENAMES}\"]" |
Colin Cross | 9fe6ea8 | 2016-11-09 13:00:16 -0800 | [diff] [blame] | 18 | |
Dan Albert | 65780b2 | 2016-10-19 14:17:19 -0700 | [diff] [blame] | 19 | SOONG_OUT=${OUT_DIR}/soong |
| 20 | SOONG_NDK_OUT=${OUT_DIR}/soong/ndk |
| 21 | rm -rf ${SOONG_OUT} |
| 22 | mkdir -p ${SOONG_OUT} |
| 23 | cat > ${SOONG_OUT}/soong.config << EOF |
| 24 | { |
Dan Albert | 5903451 | 2017-07-31 14:23:39 -0700 | [diff] [blame] | 25 | "Ndk_abis": true |
| 26 | } |
| 27 | EOF |
| 28 | |
| 29 | # We only really need to set some of these variables, but soong won't merge this |
| 30 | # with the defaults, so we need to write out all the defaults with our values |
| 31 | # added. |
| 32 | cat > ${SOONG_OUT}/soong.variables << EOF |
| 33 | { |
| 34 | "Platform_sdk_version": ${PLATFORM_SDK_VERSION}, |
| 35 | "Platform_version_active_codenames": ${PLATFORM_VERSION_ALL_CODENAMES}, |
| 36 | |
| 37 | "DeviceName": "flounder", |
| 38 | "DeviceArch": "arm64", |
| 39 | "DeviceArchVariant": "armv8-a", |
| 40 | "DeviceCpuVariant": "denver64", |
| 41 | "DeviceAbi": [ |
| 42 | "arm64-v8a" |
| 43 | ], |
| 44 | "DeviceUsesClang": true, |
| 45 | "DeviceSecondaryArch": "arm", |
| 46 | "DeviceSecondaryArchVariant": "armv7-a-neon", |
| 47 | "DeviceSecondaryCpuVariant": "denver", |
| 48 | "DeviceSecondaryAbi": [ |
| 49 | "armeabi-v7a" |
| 50 | ], |
| 51 | "HostArch": "x86_64", |
| 52 | "HostSecondaryArch": "x86", |
| 53 | "Malloc_not_svelte": false, |
| 54 | "Safestack": false |
Dan Albert | 65780b2 | 2016-10-19 14:17:19 -0700 | [diff] [blame] | 55 | } |
| 56 | EOF |
Dan Willemsen | e0879fc | 2017-08-04 15:06:27 -0700 | [diff] [blame] | 57 | m --skip-make ${SOONG_OUT}/ndk.timestamp |
Dan Albert | 65780b2 | 2016-10-19 14:17:19 -0700 | [diff] [blame] | 58 | |
| 59 | if [ -n "${DIST_DIR}" ]; then |
| 60 | mkdir -p ${DIST_DIR} || true |
| 61 | tar cjf ${DIST_DIR}/ndk_platform.tar.bz2 -C ${SOONG_OUT} ndk |
| 62 | fi |