Skip to contentSkip to conversation

android: Convert libaudio-internal to a plugin

PATCH In review Luiz Augusto von Dentz 1 participant 4 messages Jan 10, 2014 Bluetooth drivers

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/3 android: Convert libaudio-internal to a plugin

From: Luiz Augusto von Dentz <[email protected]>

This convert the static library libaudio-internal.la to audio.a2dp.default.so when building with autotools.

---
 android/Makefile.am | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
android/Makefile.am +5 -4
index 0a32a95..97173db 100644
@@ -114,18 +114,19 @@ android_android_tester_LDADD = lib/libbluetooth-internal.la \
 
 android_android_tester_LDFLAGS = -pthread
 
-noinst_LTLIBRARIES += android/libaudio-internal.la
+plugin_LTLIBRARIES += android/audio.a2dp.default.la
 
-android_libaudio_internal_la_SOURCES = android/audio-msg.h \
+android_audio_a2dp_default_la_SOURCES = android/audio-msg.h \
 					android/hal-audio.c \
 					android/hardware/audio.h \
 					android/hardware/audio_effect.h \
 					android/hardware/hardware.h \
 					android/system/audio.h
 
-android_libaudio_internal_la_CFLAGS = -I$(srcdir)/android
+android_audio_a2dp_default_la_CFLAGS = -I$(srcdir)/android
 
-android_libaudio_internal_la_LDFLAGS = -pthread
+android_audio_a2dp_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
+					-no-undefined -pthread
 
 endif
 
Signature · 1 line
1.8.4.2
author maintainer
#1 lore raw

PATCH 2/3 android: Convert libhal-internal to a plugin

From: Luiz Augusto von Dentz <[email protected]>

This convert the static library libhal-internal.la to bluetooth.default.la when building with autotools.

---
 android/Makefile.am | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
android/Makefile.am +7 -5
index 97173db..4b843b2 100644
@@ -39,9 +39,9 @@ android_bluetoothd_SOURCES = android/main.c \
 
 android_bluetoothd_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@
 
-noinst_LTLIBRARIES += android/libhal-internal.la
+plugin_LTLIBRARIES += android/bluetooth.default.la
 
-android_libhal_internal_la_SOURCES = android/hal.h android/hal-bluetooth.c \
+android_bluetooth_default_la_SOURCES = android/hal.h android/hal-bluetooth.c \
 					android/hal-sock.c \
 					android/hal-hidhost.c \
 					android/hal-pan.c \
@@ -63,8 +63,10 @@ android_libhal_internal_la_SOURCES = android/hal.h android/hal-bluetooth.c \
 					android/hal-log.h \
 					android/hal-ipc.h android/hal-ipc.c
 
-android_libhal_internal_la_CPPFLAGS = -I$(srcdir)/android \
+android_bluetooth_default_la_CPPFLAGS = -I$(srcdir)/android \
 					-DPLATFORM_SDK_VERSION=19
+android_bluetooth_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
+					-no-undefined
 
 noinst_PROGRAMS += android/haltest
 
@@ -87,7 +89,7 @@ android_haltest_SOURCES = android/client/haltest.c \
 				android/client/hwmodule.c \
 				android/hal-utils.h android/hal-utils.c
 
-android_haltest_LDADD = android/libhal-internal.la
+android_haltest_LDADD = android/bluetooth.default.la
 
 android_haltest_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android \
 				-DPLATFORM_SDK_VERSION=19
@@ -110,7 +112,7 @@ android_android_tester_SOURCES = emulator/btdev.h emulator/btdev.c \
 android_android_tester_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android
 
 android_android_tester_LDADD = lib/libbluetooth-internal.la \
-				android/libhal-internal.la @GLIB_LIBS@
+				android/bluetooth.default.la @GLIB_LIBS@
 
 android_android_tester_LDFLAGS = -pthread
 
Signature · 1 line
1.8.4.2
author maintainer
#2 lore raw

PATCH 3/3 android: Load bluetooth.default.so as a module

In reply to Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

This makes haltest and android-tester to load bluetooth.default.so instead of linking directly to it.

---
 android/Makefile.am         |  26 +++++-----
 android/hardware/hardware.c | 124 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 138 insertions(+), 12 deletions(-)
 create mode 100644 android/hardware/hardware.c
android/Makefile.am +14 -12
index 4b843b2..f5e8c99 100644
@@ -1,4 +1,6 @@
 if ANDROID
+android_plugindir = $(abs_top_srcdir)/android/.libs
+
 noinst_PROGRAMS += android/system-emulator
 
 android_system_emulator_SOURCES = android/system-emulator.c \
@@ -61,7 +63,8 @@ android_bluetooth_default_la_SOURCES = android/hal.h android/hal-bluetooth.c \
 					android/hardware/hardware.h \
 					android/cutils/properties.h \
 					android/hal-log.h \
-					android/hal-ipc.h android/hal-ipc.c
+					android/hal-ipc.h android/hal-ipc.c \
+					android/hal-utils.h android/hal-utils.c
 
 android_bluetooth_default_la_CPPFLAGS = -I$(srcdir)/android \
 					-DPLATFORM_SDK_VERSION=19
@@ -86,15 +89,14 @@ android_haltest_SOURCES = android/client/haltest.c \
 				android/client/if-hh.c \
 				android/client/if-pan.c \
 				android/client/if-sock.c \
-				android/client/hwmodule.c \
+				android/hardware/hardware.c \
 				android/hal-utils.h android/hal-utils.c
 
-android_haltest_LDADD = android/bluetooth.default.la
-
 android_haltest_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android \
-				-DPLATFORM_SDK_VERSION=19
+				-DPLATFORM_SDK_VERSION=19 \
+				-DPLUGINDIR=\""$(android_plugindir)"\"
 
-android_haltest_LDFLAGS = -pthread
+android_haltest_LDFLAGS = -pthread -ldl
 
 noinst_PROGRAMS += android/android-tester
 
@@ -106,15 +108,15 @@ android_android_tester_SOURCES = emulator/btdev.h emulator/btdev.c \
 				src/shared/mgmt.h src/shared/mgmt.c \
 				src/shared/hciemu.h src/shared/hciemu.c \
 				src/shared/tester.h src/shared/tester.c \
-				android/hal-utils.h android/hal-utils.c \
-				android/client/hwmodule.c android/android-tester.c
+				android/hardware/hardware.c \
+				android/android-tester.c
 
-android_android_tester_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android
+android_android_tester_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/android \
+				-DPLUGINDIR=\""$(android_plugindir)"\"
 
-android_android_tester_LDADD = lib/libbluetooth-internal.la \
-				android/bluetooth.default.la @GLIB_LIBS@
+android_android_tester_LDADD = lib/libbluetooth-internal.la @GLIB_LIBS@
 
-android_android_tester_LDFLAGS = -pthread
+android_android_tester_LDFLAGS = -pthread -ldl
 
 plugin_LTLIBRARIES += android/audio.a2dp.default.la
 
android/hardware/hardware.c new file +124 -0

124 lines not on this page · raw message

Signature · 1 line
1.8.4.2
author maintainer
#3 lore raw
In reply to Luiz Augusto von Dentz

Hi,

Quoted 37 lines · Luiz Augusto von Dentz

From: Luiz Augusto von Dentz <[email protected]>

This convert the static library libaudio-internal.la to audio.a2dp.default.so when building with autotools.

---
 android/Makefile.am | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
android/Makefile.am +5 -5
index 0a32a95..97173db 100644
@@ -114,18 +114,19 @@ android_android_tester_LDADD = lib/libbluetooth-internal.la \
 
 android_android_tester_LDFLAGS = -pthread
 
-noinst_LTLIBRARIES += android/libaudio-internal.la
+plugin_LTLIBRARIES += android/audio.a2dp.default.la
 
-android_libaudio_internal_la_SOURCES = android/audio-msg.h \
+android_audio_a2dp_default_la_SOURCES = android/audio-msg.h \
                                        android/hal-audio.c \
                                        android/hardware/audio.h \
                                        android/hardware/audio_effect.h \
                                        android/hardware/hardware.h \
                                        android/system/audio.h
 
-android_libaudio_internal_la_CFLAGS = -I$(srcdir)/android
+android_audio_a2dp_default_la_CFLAGS = -I$(srcdir)/android
 
-android_libaudio_internal_la_LDFLAGS = -pthread
+android_audio_a2dp_default_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
+                                       -no-undefined -pthread
 
 endif
 
--
Quoted 1 line

1.8.4.2

This now pushed.

Signature · 1 line
Luiz Augusto von Dentz