[MERGED] osmo-trx[master]: Fix building against sqlite3

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Max gerrit-no-reply at lists.osmocom.org
Fri Jan 27 09:07:37 UTC 2017


Max has submitted this change and it was merged.

Change subject: Fix building against sqlite3
......................................................................


Fix building against sqlite3

* Explicitly check for sqlite3 at configure stage, remove old include
  dir, fix header inclusion.
* Use configure results for linking instead of hardcoded linker option
  for sqlite.
* Add dependency on -dev package for .deb

Change-Id: I6d7f697d67651f02ceb77fc4da4317b64fa47f9e
Fixes: OS#1928
---
M CommonLibs/Makefile.am
M CommonLibs/sqlite3util.cpp
M Makefile.am
M Makefile.common
M Transceiver52M/Makefile.am
M configure.ac
M debian/control
7 files changed, 12 insertions(+), 11 deletions(-)

Approvals:
  Tom Tsou: Looks good to me, approved
  Neels Hofmeyr: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/CommonLibs/Makefile.am b/CommonLibs/Makefile.am
index 26a55ed..ed9cf29 100644
--- a/CommonLibs/Makefile.am
+++ b/CommonLibs/Makefile.am
@@ -78,7 +78,7 @@
 URLEncodeTest_LDADD = libcommon.la
 
 BitVectorTest_SOURCES = BitVectorTest.cpp
-BitVectorTest_LDADD = libcommon.la $(SQLITE_LA)
+BitVectorTest_LDADD = libcommon.la $(SQLITE3_LIBS)
 
 InterthreadTest_SOURCES = InterthreadTest.cpp
 InterthreadTest_LDADD = libcommon.la
@@ -92,19 +92,19 @@
 TimevalTest_LDADD = libcommon.la
 
 VectorTest_SOURCES = VectorTest.cpp
-VectorTest_LDADD = libcommon.la $(SQLITE_LA)
+VectorTest_LDADD = libcommon.la $(SQLITE3_LIBS)
 
 RegexpTest_SOURCES = RegexpTest.cpp
 RegexpTest_LDADD = libcommon.la
 
 ConfigurationTest_SOURCES = ConfigurationTest.cpp
-ConfigurationTest_LDADD = libcommon.la 	$(SQLITE_LA)
+ConfigurationTest_LDADD = libcommon.la 	$(SQLITE3_LIBS)
 
 # ReportingTest_SOURCES = ReportingTest.cpp
 # ReportingTest_LDADD = libcommon.la $(SQLITE_LA)
 
 LogTest_SOURCES = LogTest.cpp
-LogTest_LDADD = libcommon.la $(SQLITE_LA)
+LogTest_LDADD = libcommon.la $(SQLITE3_LIBS)
 
 F16Test_SOURCES = F16Test.cpp
 
diff --git a/CommonLibs/sqlite3util.cpp b/CommonLibs/sqlite3util.cpp
index 036ef2c..2b19ee6 100644
--- a/CommonLibs/sqlite3util.cpp
+++ b/CommonLibs/sqlite3util.cpp
@@ -4,7 +4,7 @@
 */
 
 
-#include "sqlite3.h"
+#include <sqlite3.h>
 #include "sqlite3util.h"
 
 #include <string.h>
diff --git a/Makefile.am b/Makefile.am
index f9f5a5c..56cb4ba 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -21,7 +21,7 @@
 include $(top_srcdir)/Makefile.common
 
 ACLOCAL_AMFLAGS = -I config
-AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(USB_INCLUDES) $(WITH_INCLUDES)
+AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(USB_INCLUDES) $(WITH_INCLUDES) $(SQLITE3_CFLAGS)
 AM_CXXFLAGS = -Wall -pthread -ldl
 #AM_CXXFLAGS = -Wall -O2 -NDEBUG -pthread -ldl
 #AM_CFLAGS = -Wall -O2 -NDEBUG -pthread -ldl
diff --git a/Makefile.common b/Makefile.common
index d7927a5..c0fc850 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -23,16 +23,13 @@
 
 COMMON_INCLUDEDIR = $(top_srcdir)/CommonLibs
 GSM_INCLUDEDIR = $(top_srcdir)/GSM
-SQLITE_INCLUDEDIR = $(top_srcdir)/sqlite3
 
 STD_DEFINES_AND_INCLUDES = \
 	$(SVNDEV) \
 	-I$(COMMON_INCLUDEDIR) \
-	-I$(GSM_INCLUDEDIR) \
-	-I$(SQLITE_INCLUDEDIR)
+	-I$(GSM_INCLUDEDIR)
 
 COMMON_LA = $(top_builddir)/CommonLibs/libcommon.la
 GSM_LA = $(top_builddir)/GSM/libGSM.la
-SQLITE_LA = -lsqlite3
 
 MOSTLYCLEANFILES = *~
diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am
index 667217f..68cdf74 100644
--- a/Transceiver52M/Makefile.am
+++ b/Transceiver52M/Makefile.am
@@ -98,7 +98,7 @@
 	libtransceiver.la \
 	$(ARCH_LA) \
 	$(GSM_LA) \
-	$(COMMON_LA) $(SQLITE_LA)
+	$(COMMON_LA) $(SQLITE3_LIBS)
 
 if USRP1 
 libtransceiver_la_SOURCES += USRPDevice.cpp
diff --git a/configure.ac b/configure.ac
index 0cf3cc5..649bb0e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -118,7 +118,10 @@
 AM_CONDITIONAL(ARCH_ARM, [test "x$with_neon" = "xyes" || test "x$with_neon_vfpv4" = "xyes"])
 AM_CONDITIONAL(ARCH_ARM_A15, [test "x$with_neon_vfpv4" = "xyes"])
 
+AC_CHECK_LIB(sqlite3, sqlite3_open, , AC_MSG_ERROR(sqlite3 is not available))
+
 PKG_CHECK_MODULES(LIBUSB, libusb-1.0)
+PKG_CHECK_MODULES(SQLITE3, sqlite3)
 
 AC_CHECK_HEADER([boost/config.hpp],[],
     [AC_MSG_ERROR([boost/config.hpp not found, install e.g. libboost-dev])])
diff --git a/debian/control b/debian/control
index beb6f6a..d016afa 100644
--- a/debian/control
+++ b/debian/control
@@ -5,6 +5,7 @@
 Build-Depends: debhelper (>= 9),
                autotools-dev,
                libdbd-sqlite3,
+               libsqlite3-dev,
                pkg-config,
                dh-autoreconf,
                libuhd-dev,

-- 
To view, visit https://gerrit.osmocom.org/1691
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6d7f697d67651f02ceb77fc4da4317b64fa47f9e
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Tom Tsou <tom at tsou.cc>



More information about the gerrit-log mailing list