linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] android: Avoid creating symlinks in lib/
@ 2014-04-07  7:52 Andrzej Kaczmarek
  2014-04-07  7:52 ` [PATCH v2 2/2] android: Rebuild executables on version change Andrzej Kaczmarek
  2014-04-07 10:41 ` [PATCH v2 1/2] android: Avoid creating symlinks in lib/ Szymon Janc
  0 siblings, 2 replies; 3+ messages in thread
From: Andrzej Kaczmarek @ 2014-04-07  7:52 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Andrzej Kaczmarek

This patch add bluetooth-headers module which is fake static library
to provide headers from lib/ directory in proper manner, i.e. from
bluetooth/ directory. Headers are copied to intermediates directory
and proper include path is added by build system once dependency to
this module is added. It's not longer necessary to specify lib/
directory on include path for each module.

This is to avoid modyfing source repository by creating symlinks in
lib/ directory - now it's possible to build BlueZ without touching
source repository at all.
---
 android/Android.mk | 64 +++++++++++++++++++++++++++++++++---------------------
 1 file changed, 39 insertions(+), 25 deletions(-)

diff --git a/android/Android.mk b/android/Android.mk
index 3a62485..71584c4 100644
--- a/android/Android.mk
+++ b/android/Android.mk
@@ -74,27 +74,14 @@ LOCAL_C_INCLUDES := \
 
 LOCAL_C_INCLUDES += \
 	$(LOCAL_PATH)/bluez \
-	$(LOCAL_PATH)/bluez/lib \
 
 LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
 
 LOCAL_SHARED_LIBRARIES := \
 	libglib \
 
-lib_headers := \
-	bluetooth.h \
-	hci.h \
-	hci_lib.h \
-	l2cap.h \
-	sdp_lib.h \
-	sdp.h \
-	rfcomm.h \
-	sco.h \
-	bnep.h \
-
-$(shell mkdir -p $(LOCAL_PATH)/bluez/lib/bluetooth)
-
-$(foreach file,$(lib_headers), $(shell ln -sf ../$(file) $(LOCAL_PATH)/bluez/lib/bluetooth/$(file)))
+LOCAL_STATIC_LIBRARIES := \
+	bluetooth-headers \
 
 LOCAL_MODULE_TAGS := optional
 
@@ -215,10 +202,12 @@ LOCAL_SRC_FILES := \
 
 LOCAL_C_INCLUDES := \
 	$(LOCAL_PATH)/bluez \
-	$(LOCAL_PATH)/bluez/lib \
 
 LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
 
+LOCAL_STATIC_LIBRARIES := \
+	bluetooth-headers \
+
 LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
 LOCAL_MODULE_TAGS := debug
 LOCAL_MODULE := btmon
@@ -285,10 +274,12 @@ LOCAL_SRC_FILES := \
 
 LOCAL_C_INCLUDES := \
 	$(LOCAL_PATH)/bluez \
-	$(LOCAL_PATH)/bluez/lib \
 
 LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
 
+LOCAL_STATIC_LIBRARIES := \
+	bluetooth-headers \
+
 LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
 LOCAL_MODULE_TAGS := debug
 LOCAL_MODULE := l2test
@@ -350,10 +341,12 @@ LOCAL_SRC_FILES := \
 
 LOCAL_C_INCLUDES := \
 	$(LOCAL_PATH)/bluez \
-	$(LOCAL_PATH)/bluez/lib \
 
 LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
 
+LOCAL_STATIC_LIBRARIES := \
+	bluetooth-headers \
+
 LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
 LOCAL_MODULE_TAGS := debug
 LOCAL_MODULE := btmgmt
@@ -374,10 +367,12 @@ LOCAL_SRC_FILES := \
 
 LOCAL_C_INCLUDES := \
 	$(LOCAL_PATH)/bluez \
-	$(LOCAL_PATH)/bluez/lib \
 
 LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
 
+LOCAL_STATIC_LIBRARIES := \
+	bluetooth-headers \
+
 LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
 LOCAL_MODULE_TAGS := debug
 LOCAL_MODULE := hcitool
@@ -395,11 +390,11 @@ LOCAL_SRC_FILES := \
 	bluez/lib/bluetooth.c \
 	bluez/lib/hci.c \
 
-LOCAL_C_INCLUDES := \
-	$(LOCAL_PATH)/bluez/lib \
-
 LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
 
+LOCAL_STATIC_LIBRARIES := \
+	bluetooth-headers \
+
 LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
 LOCAL_MODULE_TAGS := debug
 LOCAL_MODULE := l2ping
@@ -417,11 +412,11 @@ LOCAL_SRC_FILES := \
 	bluez/lib/bluetooth.c \
 	bluez/lib/hci.c \
 
-LOCAL_C_INCLUDES := \
-	$(LOCAL_PATH)/bluez/lib \
-
 LOCAL_CFLAGS := $(BLUEZ_COMMON_CFLAGS)
 
+LOCAL_STATIC_LIBRARIES := \
+	bluetooth-headers \
+
 LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
 LOCAL_MODULE_TAGS := debug
 LOCAL_MODULE := avtest
@@ -490,3 +485,22 @@ LOCAL_REQUIRED_MODULES := \
 include $(BUILD_EXECUTABLE)
 
 endif
+
+#
+# bluetooth-headers
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := bluetooth-headers
+LOCAL_NODULE_TAGS := optional
+LOCAL_MODULE_CLASS := STATIC_LIBRARIES
+
+include_path := $(local-intermediates-dir)/include
+include_files := $(wildcard $(LOCAL_PATH)/bluez/lib/*.h)
+$(shell mkdir -p $(include_path)/bluetooth)
+$(foreach file,$(include_files),$(shell cp -u $(file) $(include_path)/bluetooth))
+
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(include_path)
+
+include $(BUILD_STATIC_LIBRARY)
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-04-07 10:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-07  7:52 [PATCH v2 1/2] android: Avoid creating symlinks in lib/ Andrzej Kaczmarek
2014-04-07  7:52 ` [PATCH v2 2/2] android: Rebuild executables on version change Andrzej Kaczmarek
2014-04-07 10:41 ` [PATCH v2 1/2] android: Avoid creating symlinks in lib/ Szymon Janc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).