Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64079fb3 authored by Chris Manton's avatar Chris Manton
Browse files

Re-layout Android.mk for single shared library

Shared object libraries require complete symbol resolution
while archives do not.  The hci, btutil and a2dp hbtutil were
built as shared, but used the other archive libraries (e.g. gki).
To resolve all symbols in each of the so's, they stubbed out
data interfaces to the common structures.
(e.g. hci/include/utils.h)

This will unify all libraries and eliminate multiple definitions
of the same structure.

Change-Id: I2af9a3e8a87888cd007aaf0809cdfc09039cd460
parent bf9a1002
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -4,12 +4,13 @@ LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_C_INCLUDES:= $(LOCAL_PATH)/common \
LOCAL_C_INCLUDES := \
	$(LOCAL_PATH)/common \
	$(LOCAL_PATH)/ulinux \
	$(LOCAL_PATH)/../include \
	$(LOCAL_PATH)/../stack/include \
	$(LOCAL_PATH)/../utils/include \
                   $(bdroid_C_INCLUDES) \
	$(bdroid_C_INCLUDES)

LOCAL_CFLAGS += -Wno-error=unused-parameter $(bdroid_CFLAGS) -std=c99

@@ -20,14 +21,13 @@ endif

LOCAL_PRELINK_MODULE := false
LOCAL_SRC_FILES := \
    ./ulinux/gki_ulinux.c \
	./common/gki_buffer.c \
	./common/gki_debug.c \
	./common/gki_time.c \
    ./common/gki_buffer.c
	./ulinux/gki_ulinux.c

LOCAL_MODULE := libbt-brcm_gki
LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := libcutils libc
LOCAL_MODULE_CLASS := STATIC_LIBRARIES

include $(BUILD_STATIC_LIBRARY)
+6 −10
Original line number Diff line number Diff line
@@ -5,19 +5,15 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
	audio_a2dp_hw.c

LOCAL_C_INCLUDES+= . $(LOCAL_PATH)/../utils/include
LOCAL_C_INCLUDES += \
	. \
	$(LOCAL_PATH)/../utils/include

LOCAL_CFLAGS += -std=c99

LOCAL_SHARED_LIBRARIES := \
	libcutils liblog

LOCAL_SHARED_LIBRARIES += \
	libpower

LOCAL_MODULE := audio.a2dp.default
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw

LOCAL_MODULE_TAGS := optional

include $(BUILD_SHARED_LIBRARY)
include $(BUILD_STATIC_LIBRARY)
+14 −22
Original line number Diff line number Diff line
@@ -4,10 +4,10 @@ include $(CLEAR_VARS)

LOCAL_SRC_FILES := \
	src/bt_hci_bdroid.c \
        src/lpm.c \
	src/bt_hw.c \
	src/btsnoop.c \
	src/btsnoop_net.c \
	src/lpm.c \
	src/utils.c

ifeq ($(BLUETOOTH_HCI_USE_MCT),true)
@@ -19,11 +19,9 @@ LOCAL_SRC_FILES += \
	src/userial_mct.c

else

LOCAL_SRC_FILES += \
	src/hci_h4.c \
	src/userial.c

endif

LOCAL_CFLAGS += -std=c99
@@ -32,14 +30,8 @@ LOCAL_C_INCLUDES += \
	$(LOCAL_PATH)/include \
	$(LOCAL_PATH)/../utils/include

LOCAL_SHARED_LIBRARIES := \
        libcutils \
        liblog \
        libdl \
        libbt-utils

LOCAL_MODULE := libbt-hci
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_CLASS := STATIC_LIBRARIES

include $(BUILD_SHARED_LIBRARY)
include $(BUILD_STATIC_LIBRARY)
+67 −65
Original line number Diff line number Diff line
@@ -12,54 +12,54 @@ LOCAL_SRC_FILES:= \

# platform specific
LOCAL_SRC_FILES += \
	bte_main.c \
	bte_conf.c \
	bte_init.c \
	bte_version.c \
	bte_logmsg.c \
	bte_conf.c
	bte_main.c \
	bte_version.c

# BTIF
LOCAL_SRC_FILES += \
	../btif/src/btif_av.c \
	../btif/src/btif_config.c \
	../btif/src/btif_config_util.cpp \
	../btif/src/btif_core.c \
	../btif/src/btif_dm.c \
    ../btif/src/btif_storage.c \
    ../btif/src/btif_util.c \
    ../btif/src/btif_sm.c \
	../btif/src/btif_gatt.c \
	../btif/src/btif_gatt_client.c \
	../btif/src/btif_gatt_multi_adv_util.c \
	../btif/src/btif_gatt_server.c \
	../btif/src/btif_gatt_test.c \
	../btif/src/btif_gatt_util.c \
	../btif/src/btif_hf.c \
	../btif/src/btif_hf_client.c \
    ../btif/src/btif_av.c \
    ../btif/src/btif_rc.c \
    ../btif/src/btif_media_task.c \
	../btif/src/btif_hh.c \
	../btif/src/btif_hl.c \
	../btif/src/btif_media_task.c \
	../btif/src/btif_pan.c \
	../btif/src/btif_profile_queue.c \
	../btif/src/btif_rc.c \
	../btif/src/btif_sm.c \
	../btif/src/btif_sock.c \
	../btif/src/btif_sock_rfc.c \
    ../btif/src/btif_sock_thread.c \
	../btif/src/btif_sock_sdp.c \
	../btif/src/btif_sock_thread.c \
	../btif/src/btif_sock_util.c \
    ../btif/src/btif_pan.c \
    ../btif/src/btif_gatt.c \
    ../btif/src/btif_gatt_multi_adv_util.c \
    ../btif/src/btif_gatt_client.c \
    ../btif/src/btif_gatt_server.c \
    ../btif/src/btif_gatt_util.c \
    ../btif/src/btif_gatt_test.c \
    ../btif/src/btif_config.c \
    ../btif/src/btif_config_util.cpp \
    ../btif/src/btif_profile_queue.c
	../btif/src/btif_storage.c \
	../btif/src/btif_util.c

# callouts
LOCAL_SRC_FILES += \
    ../btif/co/bta_sys_co.c \
    ../btif/co/bta_fs_co.c \
	../btif/co/bta_ag_co.c \
    ../btif/co/bta_dm_co.c \
	../btif/co/bta_av_co.c \
	../btif/co/bta_dm_co.c \
	../btif/co/bta_fs_co.c \
	../btif/co/bta_gattc_co.c \
	../btif/co/bta_gatts_co.c \
	../btif/co/bta_hh_co.c \
	../btif/co/bta_hl_co.c \
	../btif/co/bta_pan_co.c \
    ../btif/co/bta_gattc_co.c \
    ../btif/co/bta_gatts_co.c \
	../btif/co/bta_sys_co.c

# sbc encoder
LOCAL_SRC_FILES += \
@@ -115,27 +115,29 @@ ifeq ($(TARGET_PRODUCT), full_maguro)
	LOCAL_CFLAGS += -DTARGET_MAGURO
endif

# Fix this
#ifeq ($(TARGET_VARIANT), eng)
#     LOCAL_CFLAGS += -O2 # and other production release flags
#else
#     LOCAL_CFLAGS +=
#endif

LOCAL_SHARED_LIBRARIES := \
	libcutils \
	libdl \
	liblog \
    libpower \
    libbt-hci \
    libbt-utils
	libpower

#LOCAL_WHOLE_STATIC_LIBRARIES := libbt-brcm_gki libbt-brcm_stack libbt-brcm_bta
LOCAL_STATIC_LIBRARIES := libosi libbt-brcm_gki libbt-brcm_bta libbt-brcm_stack libtinyxml2
LOCAL_STATIC_LIBRARIES := \
	libbt-brcm_bta \
	libbt-brcm_gki \
	libbt-brcm_stack \
	libbt-hci \
	libbt-utils \
	libosi \
	libtinyxml2

LOCAL_MODULE := bluetooth.default
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_REQUIRED_MODULES := libbt-hci libbt-vendor bt_stack.conf bt_did.conf auto_pair_devlist.conf
LOCAL_REQUIRED_MODULES := \
	auto_pair_devlist.conf \
	bt_did.conf \
	bt_stack.conf \
	libbt-vendor

include $(BUILD_SHARED_LIBRARY)
+10 −10
Original line number Diff line number Diff line
@@ -2,7 +2,8 @@ LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

LOCAL_C_INCLUDES:= $(LOCAL_PATH)/include \
LOCAL_C_INCLUDES := \
	$(LOCAL_PATH)/include \
	$(LOCAL_PATH)/../gki/ulinux \
	$(bdroid_C_INCLUDES)

@@ -14,7 +15,6 @@ LOCAL_SRC_FILES:= \

LOCAL_MODULE := libbt-utils
LOCAL_MODULE_TAGS := optional
LOCAL_SHARED_LIBRARIES := libcutils liblog libc
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_CLASS := STATIC_LIBRARIES

include $(BUILD_SHARED_LIBRARY)
include $(BUILD_STATIC_LIBRARY)