OSDN Git Service

gn-build: Get bluetooth.default.so to compile
authorArman Uguray <armansito@google.com>
Fri, 29 May 2015 22:30:13 +0000 (15:30 -0700)
committerMiao Chou <mcchou@google.com>
Mon, 1 Jun 2015 23:57:07 +0000 (16:57 -0700)
Now that most of the modules here are compiled in their own static libraries,
there is no need to include their sources from main/BUILD.gn. This CL cleans
this up and adds all the missing dependencies for the //main:bluetooth.default
shared library target. Missing includes and non-Android compile errors have
always been fixed.

BUG=21339022

Change-Id: Ibcc693d5ff17aa9c446db777d4b9fbb706f8c7dd

main/BUILD.gn
main/bte_logmsg.c
main/bte_main.c

index d922824..e89bbc2 100644 (file)
@@ -29,68 +29,6 @@ shared_library("bluetooth.default") {
     "stack_config.c",
   ]
 
-  # BTIF
-  sources += [
-    "//btif/src/btif_av.c",
-    "//btif/src/btif_config.c",
-    "//btif/src/btif_config_transcode.cpp",
-    "//btif/src/btif_core.c",
-    "//btif/src/btif_dm.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_hh.c",
-    "//btif/src/btif_hl.c",
-    "//btif/src/btif_mce.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_sco.c",
-    "//btif/src/btif_sock_sdp.c",
-    "//btif/src/btif_sock_thread.c",
-    "//btif/src/btif_sock_util.c",
-    "//btif/src/btif_storage.c",
-    "//btif/src/btif_util.c",
-    "//btif/src/stack_manager",
-  ]
-
-  # callouts
-  sources += [
-    "//btif/co/bta_ag_co.c",
-    "//btif/co/bta_dm_co.c",
-    "//btif/co/bta_av_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",
-  ]
-
-  # sbc encoder
-  sources += [
-    "//embdrv/sbc/encoder/srce/sbc_analysis.c",
-    "//embdrv/sbc/encoder/srce/sbc_dct.c",
-    "//embdrv/sbc/encoder/srce/sbc_dct_coeffs.c",
-    "//embdrv/sbc/encoder/srce/sbc_enc_bit_alloc_mono.c",
-    "//embdrv/sbc/encoder/srce/sbc_enc_bit_alloc_ste.c",
-    "//embdrv/sbc/encoder/srce/sbc_enc_coeffs.c",
-    "//embdrv/sbc/encoder/srce/sbc_encoder.c",
-    "//embdrv/sbc/encoder/srce/sbc_packing.c",
-  ]
-
-  sources += [
-    "//udrv/ulinux/uipc.c",
-  ]
-
   include_dirs = [
     "//",
     "//bta/include",
@@ -121,25 +59,33 @@ shared_library("bluetooth.default") {
   ]
 
   deps = [
+    "//audio_a2dp_hw:audio.a2dp.default",
     "//bta",
-    "//gki",
-    "//stack",
+    "//btcore",
+    "//btif",
     "//device",
+    "//embdrv/sbc",
+    "//gki",
     "//hci",
-    "//utils",
-    "//btcore",
     "//osi",
-    # TODO tinyxml2
-    # TODO qcom sbc decoder
+    "//stack",
+    "//third_party/tinyxml2",
+    "//udrv",
+    "//utils",
   ]
 
+  # TODO(armansito): Remove all of the flags below, as we want to be able to
+  # compile the source code with as many warnings enabled as possible.
   cflags = [
     "-Wno-unused-variable",
     "-Wno-unused-value",
     "-Wno-unused-function",
     "-Wno-int-to-pointer-cast",
   ]
+
   cflags_c = [
     "-Wno-pointer-to-int-cast",
   ]
+
+  libs = [ "-lpthread", "-lrt", "-ldl" ]
 }
index c6944bd..e302cbe 100644 (file)
 #include "smp_api.h"
 #endif
 
+// TODO(armansito): Work-around until we figure out a way to generate logs in a
+// platform-independent manner.
+#if defined(OS_GENERIC)
+#define LOGI0(t,s) fprintf(stderr, "%s\n", s)
+#define LOGD0(t,s) fprintf(stderr, "%s\n", s)
+#define LOGW0(t,s) fprintf(stderr, "%s\n", s)
+#define LOGE0(t,s) fprintf(stderr, "%s\n", s)
+#else  // !defined(OS_GENERIC)
 #define LOGI0(t,s) __android_log_write(ANDROID_LOG_INFO, t, s)
 #define LOGD0(t,s) __android_log_write(ANDROID_LOG_DEBUG, t, s)
 #define LOGW0(t,s) __android_log_write(ANDROID_LOG_WARN, t, s)
 #define LOGE0(t,s) __android_log_write(ANDROID_LOG_ERROR, t, s)
+#endif  // defined(OS_GENERIC)
 
 #ifndef DEFAULT_CONF_TRACE_LEVEL
 #define DEFAULT_CONF_TRACE_LEVEL BT_TRACE_LEVEL_WARNING
index de62232..96b41c9 100644 (file)
@@ -27,7 +27,6 @@
 #define LOG_TAG "bt_main"
 
 #include <assert.h>
-#include <cutils/properties.h>
 #include <fcntl.h>
 #include <hardware/bluetooth.h>
 #include <pthread.h>