summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStricted <info@stricted.net>2025-01-12 11:37:52 +0100
committerStricted <info@stricted.net>2025-01-12 11:37:52 +0100
commit5623d73d2c14f46e77e43fda14e0c037ad37bbf8 (patch)
treefd7ee705e16e30ccc26970b2fa2612778eda3e97
parentec9a6a888fb86de7f1d331b030aab54a12891777 (diff)
libbt: convert to bpw16.0
losely based on https://gitlab.com/Linaro/96boards/e850-96/platform/hardware/samsung_slsi/-/tree/android13-e850-96? @ 3f80ca082ee2471ffa4c22f70b131dd6af456de3 Change-Id: I5940a952ddccd97a03c75eb3d45151c137d1f356
-rw-r--r--Android.bp54
-rw-r--r--Android.mk51
-rw-r--r--libbt_vendor.go67
3 files changed, 121 insertions, 51 deletions
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..4ceeab9
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,54 @@
+
+soong_namespace {}
+
+bootstrap_go_package {
+ name: "soong-libbt-vendor",
+ pkgPath: "android/soong/libbt_vendor",
+ deps: [
+ "blueprint",
+ "blueprint-pathtools",
+ "soong",
+ "soong-android",
+ "soong-cc",
+ ],
+ srcs: [
+ "libbt_vendor.go",
+ ],
+ pluginFor: ["soong_build"],
+}
+
+libbt_vendor_defaults {
+ name: "libbt_vendor_defaults",
+}
+
+cc_library_shared {
+ name: "libbt-vendor",
+ owner: "samsung",
+ defaults: [
+ "libbt_vendor_defaults",
+ ],
+ export_include_dirs: [
+ "conf",
+ "include",
+ ],
+ srcs: [
+ "src/bt_vendor_slsi.c",
+ ],
+ include_dirs: [
+ "packages/modules/Bluetooth/system/hci/include",
+ ],
+ shared_libs: [
+ "libcutils",
+ "liblog",
+ ],
+ compile_multilib: "both",
+ soc_specific: true,
+ proprietary: true,
+ product_variables: {
+ debuggable: {
+ cflags: [
+ "-DBTVENDOR_DBG=TRUE",
+ ],
+ },
+ },
+}
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 9f01b4c..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,51 +0,0 @@
-#############################################################################
-#
-# Copyright (c) 2012 - 2013 Samsung Electronics Co., Ltd
-#
-#############################################################################
-LOCAL_PATH := $(call my-dir)
-
-ifneq ($(BOARD_HAVE_BLUETOOTH_SLSI),)
-
-include $(CLEAR_VARS)
-
-# Setup bdroid local make variables for handling configuration
-ifneq ($(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR),)
- bdroid_C_INCLUDES := $(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR)
- bdroid_CFLAGS := -DHAS_BDROID_BUILDCFG
-else
- bdroid_C_INCLUDES :=
- bdroid_CFLAGS := -DHAS_NO_BDROID_BUILDCFG
-endif
-
-BDROID_DIR := $(TOP_DIR)packages/modules/Bluetooth/system
-
-LOCAL_SRC_FILES := \
- src/bt_vendor_slsi.c
-
-LOCAL_C_INCLUDES += \
- $(LOCAL_PATH)/include \
- $(BDROID_DIR)/hci/include \
- $(BDROID_DIR)/stack/include \
- $(BDROID_DIR)/include \
- $(BDROID_DIR)/device/include \
- $(BDROID_DIR) \
- $(bdroid_C_INCLUDES)
-
-LOCAL_CFLAGS += $(bdroid_CFLAGS)
-
-LOCAL_SHARED_LIBRARIES := \
- libcutils \
- liblog
-
-LOCAL_HEADER_LIBRARIES := libutils_headers
-
-LOCAL_MODULE := libbt-vendor
-LOCAL_MODULE_OWNER := samsung
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_CLASS := SHARED_LIBRARIES
-LOCAL_PROPRIETARY_MODULE := true
-
-include $(BUILD_SHARED_LIBRARY)
-
-endif # BOARD_HAVE_BLUETOOTH_SLSI
diff --git a/libbt_vendor.go b/libbt_vendor.go
new file mode 100644
index 0000000..922b3fe
--- /dev/null
+++ b/libbt_vendor.go
@@ -0,0 +1,67 @@
+// Copyright 2016 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+package libbt_vendor
+
+import (
+ "android/soong/android"
+ "android/soong/cc"
+ "github.com/google/blueprint/proptools"
+ "strings"
+)
+
+func init() {
+ android.RegisterModuleType("libbt_vendor_defaults", libbtVendorDefaultsFactory)
+}
+
+func libbtVendorDefaultsFactory() android.Module {
+ module := cc.DefaultsFactory()
+ android.AddLoadHook(module, libbtVendorDefaults)
+
+ return module
+}
+
+func libbtVendorDefaults(ctx android.LoadHookContext) {
+ type props struct {
+ Include_dirs []string
+ Cflags []string
+ Enabled *bool
+ }
+
+ p := &props{}
+ p.Cflags, p.Include_dirs, p.Enabled = globalDefaults(ctx)
+
+ ctx.AppendProperties(p)
+}
+
+func globalDefaults(ctx android.BaseContext) ([]string, []string, *bool) {
+ var cflags []string
+ var includeDirs []string
+ var enabled *bool
+
+ board_bt_buildcfg_include_dir := ctx.DeviceConfig().BtConfigIncludeDir()
+ if len(board_bt_buildcfg_include_dir) > 0 {
+ cflags = append(cflags, "-DHAS_BDROID_BUILDCFG")
+ board_bt_buildcfg_include_dir_list :=
+ strings.Fields(board_bt_buildcfg_include_dir)
+ for _, buildcfg_dir := range board_bt_buildcfg_include_dir_list {
+ includeDirs = append(includeDirs, buildcfg_dir)
+ }
+ } else {
+ cflags = append(cflags, "-DHAS_NO_BDROID_BUILDCFG")
+ }
+
+ enabled = proptools.BoolPtr(true)
+
+ return cflags, includeDirs, enabled
+}