-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-makefiles.sh
executable file
·73 lines (57 loc) · 1.67 KB
/
setup-makefiles.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2023 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
set -e
DEVICE=ndk_translation
VENDOR=kang
# Load extract_utils and do some sanity checks
MY_DIR="${BASH_SOURCE%/*}"
if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi
ANDROID_ROOT="${MY_DIR}/../../.."
HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh"
if [ ! -f "${HELPER}" ]; then
echo "Unable to find helper script at ${HELPER}"
exit 1
fi
source "${HELPER}"
# Initialize the helper
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}"
# Warning headers and guards
write_headers
cat << EOF >> $PRODUCTMK
ifeq (\$(ENABLE_NATIVE_BRIDGE),true)
ifneq (\$(filter %x86_64 %x86_64%,\$(TARGET_PRODUCT)),)
EOF
write_makefiles "${MY_DIR}/proprietary-files.txt" true
# Finish
write_footers
cat << EOF >> $PRODUCTMK
include frameworks/libs/native_bridge_support/native_bridge_support.mk
PRODUCT_SOONG_NAMESPACES += \\
frameworks/libs/native_bridge_support/android_api/libc
PRODUCT_PACKAGES += \\
\$(NATIVE_BRIDGE_PRODUCT_PACKAGES)
PRODUCT_SYSTEM_PROPERTIES += \\
ro.dalvik.vm.native.bridge=libndk_translation.so \\
ro.dalvik.vm.isa.arm64=x86_64 \\
ro.dalvik.vm.isa.arm=x86 \\
ro.enable.native.bridge.exec=1 \\
ro.ndk_translation.version=0.2.3 \\
ro.ndk_translation.flags=accurate-sigsegv
endif
endif
EOF
cat << EOF >> $BOARDMK
ifeq (\$(ENABLE_NATIVE_BRIDGE),true)
ifneq (\$(filter %x86_64 %x86_64%,\$(TARGET_PRODUCT)),)
TARGET_NATIVE_BRIDGE_ARCH := arm64
TARGET_NATIVE_BRIDGE_ARCH_VARIANT := armv8-a
TARGET_NATIVE_BRIDGE_CPU_VARIANT := generic
TARGET_NATIVE_BRIDGE_ABI := arm64-v8a
endif
endif
EOF