android_device_oneplus_sm81.../setup-makefiles.sh

106 lines
2.9 KiB
Bash
Executable File

#!/bin/bash
#
# Copyright (C) 2016 The CyanogenMod Project
# Copyright (C) 2017-2020 The LineageOS Project
#
# SPDX-License-Identifier: Apache-2.0
#
set -e
# 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}"
function vendor_imports() {
cat <<EOF >>"$1"
"device/oneplus/sm8150-common",
"hardware/qcom/display",
"hardware/qcom/display/gralloc",
"hardware/qcom/display/libdebug",
"vendor/oneplus/sm8150-common",
"vendor/qcom/common/vendor/adreno-r",
"vendor/qcom/common/vendor/display/4.14",
"vendor/qcom/common/vendor/media-legacy",
EOF
}
function lib_to_package_fixup_vendor_variants() {
if [ "$2" != "vendor" ]; then
return 1
fi
case "$1" in
com.qualcomm.qti.dpm.api@1.0 | \
com.qualcomm.qti.imscmservice* | \
com.qualcomm.qti.uceservice* | \
libmmosal | \
libfastcrc | \
libOmxVideoDSMode | \
vendor.qti.data.* | \
vendor.qti.diaghal@1.0 | \
vendor.qti.hardware.data.* | \
vendor.qti.hardware.embmssl* | \
vendor.qti.hardware.mwqemadapter@1.0 | \
vendor.qti.hardware.radio.* | \
vendor.qti.hardware.slmadapter@1.0 | \
vendor.qti.hardware.qccsyshal@1.0 | \
vendor.qti.hardware.qccvndhal@1.0 | \
vendor.qti.hardware.wifidisplaysession@1.0 | \
vendor.qti.imsrtpservice@3.0 | \
vendor.qti.ims.* | \
vendor.qti.latency*)
echo "$1_vendor"
;;
libOmxCore | \
libwpa_client)
# Android.mk only packages
;;
*)
return 1
;;
esac
}
function lib_to_package_fixup() {
lib_to_package_fixup_clang_rt_ubsan_standalone "$1" ||
lib_to_package_fixup_proto_3_9_1 "$1" ||
lib_to_package_fixup_vendor_variants "$@"
}
# Initialize the helper for common
setup_vendor "${DEVICE_COMMON}" "${VENDOR_COMMON:-$VENDOR}" "${ANDROID_ROOT}" true
# Warning headers and guards
write_headers "oneplus7pro oneplus7 oneplus7tpronr oneplus7tpro oneplus7t"
# The standard common blobs
write_makefiles "${MY_DIR}/proprietary-files.txt"
# Finish
write_footers
if [ -s "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt" ]; then
# Reinitialize the helper for device
source "${MY_DIR}/../../${VENDOR}/${DEVICE}/setup-makefiles.sh"
setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false
# Warning headers and guards
write_headers
# The standard device blobs
write_makefiles "${MY_DIR}/../../${VENDOR}/${DEVICE}/proprietary-files.txt"
# Finish
write_footers
fi