aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-01-26 14:57:44 +0100
committerMax <msuraev@sysmocom.de>2017-01-26 17:06:06 +0100
commit2dee3e996e777b67aa3185f7456c041765f0d71f (patch)
treebd3a3c3af522c0096eaae66b2f0aa1dcce598f74
parent1f1cebb2e503c1740ee53caf9664c0d39b5fe70e (diff)
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
-rw-r--r--CommonLibs/Makefile.am8
-rw-r--r--CommonLibs/sqlite3util.cpp2
-rw-r--r--Makefile.am2
-rw-r--r--Makefile.common5
-rw-r--r--Transceiver52M/Makefile.am2
-rw-r--r--configure.ac3
-rw-r--r--debian/control1
7 files changed, 12 insertions, 11 deletions
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_SOURCES = URLEncodeTest.cpp
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_SOURCES = TimevalTest.cpp
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 @@ top_builddir = $(abs_top_builddir)
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 @@ osmo_trx_LDADD = \
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(USRP1, [test "x$with_usrp1" = "xyes"])
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 @@ Maintainer: Ivan Klyuchnikov <ivan.kluchnikov@fairwaves.ru>
Build-Depends: debhelper (>= 9),
autotools-dev,
libdbd-sqlite3,
+ libsqlite3-dev,
pkg-config,
dh-autoreconf,
libuhd-dev,