From 506bcec3cd868711ff3bd2f42132416adb0a7f15 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 4 Dec 2017 11:30:45 -0800 Subject: [PATCH 1/3] Add configure flag to explicitly enable BLE support This way BLE dive computers that are otherwise conditional on USBHID will be built on platforms that support them but don't have USBHID (like iOS). Signed-off-by: Dirk Hohndel --- configure.ac | 9 +++++++++ src/descriptor.c | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index a48b734..5239642 100644 --- a/configure.ac +++ b/configure.ac @@ -60,6 +60,15 @@ AC_ARG_ENABLE([doc], [], [enable_doc=yes]) AM_CONDITIONAL([ENABLE_DOC], [test "x$enable_doc" = "xyes"]) +# BLE support +AC_ARG_ENABLE([ble], + [AS_HELP_STRING([--enable-ble=@<:@yes/no@:>@], + [Enable BLE dive computers @<:@default=yes@:>@])], + [], [enable_ble=no]) +AS_IF([test "x$enable_ble" = "xyes"], [ + AC_DEFINE(ENABLE_BLE, [1], [Enable support for BLE dive computers.]) +]) + # Checks for programs. AC_PROG_CC AC_PROG_CC_C99 diff --git a/src/descriptor.c b/src/descriptor.c index a8c8a1a..a267bf3 100644 --- a/src/descriptor.c +++ b/src/descriptor.c @@ -98,7 +98,7 @@ static const dc_descriptor_t g_descriptors[] = { {"Suunto", "Zoop Novo", DC_FAMILY_SUUNTO_D9, 0x1E}, // FTDI {"Suunto", "D4f", DC_FAMILY_SUUNTO_D9, 0x20}, // FTDI /* Suunto EON Steel */ -#ifdef USBHID +#if defined(USBHID) || defined(ENABLE_BLE) {"Suunto", "EON Steel", DC_FAMILY_SUUNTO_EONSTEEL, 0}, // BLE {"Suunto", "EON Core", DC_FAMILY_SUUNTO_EONSTEEL, 1}, // BLE #endif @@ -139,7 +139,7 @@ static const dc_descriptor_t g_descriptors[] = { {"Scubapro", "Chromis", DC_FAMILY_UWATEC_MERIDIAN, 0x24}, {"Scubapro", "Mantis 2", DC_FAMILY_UWATEC_MERIDIAN, 0x26}, /* Scubapro G2 */ -#ifdef USBHID +#if defined(USBHID) || defined(ENABLE_BLE) {"Scubapro", "Aladin Sport Matrix", DC_FAMILY_UWATEC_G2, 0x17}, // BLE {"Scubapro", "Aladin Square", DC_FAMILY_UWATEC_G2, 0x22}, {"Scubapro", "G2", DC_FAMILY_UWATEC_G2, 0x32}, // BLE From f5aee8198f3361df2980e492aa9f245f5af5b4c5 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 4 Dec 2017 13:53:40 -0800 Subject: [PATCH 2/3] Disable a couple of overly aggressive warnings -Wextra and -Wpedantic are creating more noise than useful warnings. Signed-off-by: Dirk Hohndel --- configure.ac | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure.ac b/configure.ac index 5239642..93533d8 100644 --- a/configure.ac +++ b/configure.ac @@ -182,9 +182,7 @@ AC_CHECK_FUNCS([getopt_long]) # Checks for supported compiler options. AX_APPEND_COMPILE_FLAGS([ \ - -pedantic \ -Wall \ - -Wextra \ -Wshadow \ -Wrestrict \ -Wformat=2 \ From db70c581a621814feb881494c890ae8a49da709a Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 6 Dec 2017 21:23:19 -0600 Subject: [PATCH 3/3] Correctly determine git SHA if libdivecomputer is a git submodule In the case of a submodule, the .git file is a text file pointing to the correct module in the parent's .git folder. The git rev-parse works correctly in both cases. Signed-off-by: Dirk Hohndel --- src/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 1545bc7..5df0b68 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -97,7 +97,7 @@ libdivecomputer.lo: revision.h FORCE: $(top_srcdir)/revision: FORCE - @if (test -d $(top_srcdir)/.git && cd $(top_srcdir) \ + @if (test -e $(top_srcdir)/.git && cd $(top_srcdir) \ && git rev-parse --verify HEAD) > revision-t 2>/dev/null \ && ! cmp -s revision-t $@; then \ mv -f revision-t $@; \