diff options
author | Satheesh Jayakumar <sjayakum@codeaurora.org> | 2013-05-07 09:25:21 -0700 |
---|---|---|
committer | Satheesh Jayakumar <sjayakum@codeaurora.org> | 2013-07-03 17:08:14 -0700 |
commit | 0590a64deb4ec63a27b779ae6bec91b2ae6eb980 (patch) | |
tree | bfd5e7b3734d305cbe1b0f478041a230e20a7e8f /utils | |
parent | 18875a4f8a3a84711e244c349e287d6510382528 (diff) | |
download | gps-0590a64deb4ec63a27b779ae6bec91b2ae6eb980.tar.gz |
hardware/qcom/gps: Porting HAL and Loc API 2.0
- Wrote makefiles, config and other files
- Made code changes to minimize android dependencies
Change-Id: I350de6378684f5db81a36cc4c6d014c5a8189d4c
Diffstat (limited to 'utils')
-rw-r--r-- | utils/Makefile.am | 44 | ||||
-rw-r--r-- | utils/linked_list.c | 2 | ||||
-rw-r--r-- | utils/loc_cfg.cpp | 4 | ||||
-rw-r--r-- | utils/loc_log.cpp | 5 | ||||
-rw-r--r-- | utils/log_util.h | 20 | ||||
-rw-r--r-- | utils/msg_q.c | 2 |
6 files changed, 71 insertions, 6 deletions
diff --git a/utils/Makefile.am b/utils/Makefile.am new file mode 100644 index 0000000..e5935f0 --- /dev/null +++ b/utils/Makefile.am @@ -0,0 +1,44 @@ +AM_CFLAGS = -Wundef \ + -MD \ + -Wno-trigraphs \ + -g -O0 \ + -fno-inline \ + -fno-short-enums \ + -fpic \ + -I../platform_lib_abstractions + +libgps_utils_so_la_h_sources = log_util.h \ + msg_q.h \ + linked_list.h \ + loc_cfg.h \ + loc_log.h \ + ../platform_lib_abstractions/platform_lib_includes.h \ + ../platform_lib_abstractions/platform_lib_time.h \ + ../platform_lib_abstractions/platform_lib_macros.h + +libgps_utils_so_la_c_sources = linked_list.c \ + msg_q.c \ + loc_cfg.cpp \ + loc_log.cpp \ + ../platform_lib_abstractions/elapsed_millis_since_boot.cpp + +library_includedir = $(pkgincludedir)/utils + +library_include_HEADERS = $(libgps_utils_so_la_h_sources) + +libgps_utils_so_la_SOURCES = $(libgps_utils_so_la_c_sources) + +if USE_GLIB +libgps_utils_so_la_CFLAGS = -DUSE_GLIB $(AM_CFLAGS) @GLIB_CFLAGS@ +libgps_utils_so_la_LDFLAGS = -lstdc++ -lpthread @GLIB_LIBS@ -shared -version-info 1:0:0 +libgps_utils_so_la_CPPFLAGS = -DUSE_GLIB $(AM_CFLAGS) $(AM_CPPFLAGS) @GLIB_CFLAGS@ +else +libgps_utils_so_la_CFLAGS = $(AM_CFLAGS) +libgps_utils_so_la_LDFLAGS = -lpthread -shared -version-info 1:0:0 +libgps_utils_so_la_CPPFLAGS = $(AM_CFLAGS) $(AM_CPPFLAGS) +endif + +libgps_utils_so_la_LIBADD = -lstdc++ -lcutils + +#Create and Install libraries +lib_LTLIBRARIES = libgps_utils_so.la diff --git a/utils/linked_list.c b/utils/linked_list.c index 31ec52d..92617fe 100644 --- a/utils/linked_list.c +++ b/utils/linked_list.c @@ -32,7 +32,7 @@ #define LOG_TAG "LocSvc_utils_ll" #include "log_util.h" - +#include "platform_lib_includes.h" #include <stdlib.h> #include <stdint.h> diff --git a/utils/loc_cfg.cpp b/utils/loc_cfg.cpp index 652eb10..73d1ca4 100644 --- a/utils/loc_cfg.cpp +++ b/utils/loc_cfg.cpp @@ -39,6 +39,10 @@ #include <time.h> #include <loc_cfg.h> #include <log_util.h> +#ifdef USE_GLIB +#include <glib.h> +#endif +#include "platform_lib_includes.h" /*============================================================================= * diff --git a/utils/loc_log.cpp b/utils/loc_log.cpp index ecdfc8f..533fabd 100644 --- a/utils/loc_log.cpp +++ b/utils/loc_log.cpp @@ -34,8 +34,11 @@ #include <sys/time.h> #include "loc_log.h" #include "msg_q.h" +#ifdef USE_GLIB +#include <time.h> +#endif /* USE_GLIB */ #include "log_util.h" - +#include "platform_lib_includes.h" // Logging Improvements const char *loc_logger_boolStr[]={"False","True"}; const char VOID_RET[] = "None"; diff --git a/utils/log_util.h b/utils/log_util.h index 8a9647c..7fb0c78 100644 --- a/utils/log_util.h +++ b/utils/log_util.h @@ -30,6 +30,23 @@ #ifndef __LOG_UTIL_H__ #define __LOG_UTIL_H__ +#ifndef USE_GLIB +#include <utils/Log.h> +#endif /* USE_GLIB */ + +#ifdef USE_GLIB + +#include <stdio.h> +#include <sys/types.h> +#include <unistd.h> + +#ifndef LOG_TAG +#define LOG_TAG "GPS_UTILS" + +#endif // LOG_TAG + +#endif /* USE_GLIB */ + #ifdef __cplusplus extern "C" { @@ -72,9 +89,6 @@ extern const char ENTRY_TAG[]; extern void loc_logger_init(unsigned long debug, unsigned long timestamp); extern char* get_timestamp(char* str, unsigned long buf_size); - -#include <utils/Log.h> - #ifndef DEBUG_DMN_LOC_API /* LOGGING MACROS */ diff --git a/utils/msg_q.c b/utils/msg_q.c index 2c26417..c4f3b9d 100644 --- a/utils/msg_q.c +++ b/utils/msg_q.c @@ -30,7 +30,7 @@ #define LOG_TAG "LocSvc_utils_q" #include "log_util.h" - +#include "platform_lib_includes.h" #include "linked_list.h" #include <stdio.h> #include <stdlib.h> |