build: Add support for LimeSuite device backend

Change-Id: I239e1b37263a62b374d84974c9347e3654072e87
diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am
index bb253bb..a2163bf 100644
--- a/Transceiver52M/Makefile.am
+++ b/Transceiver52M/Makefile.am
@@ -99,3 +99,13 @@
 	$(USRP_LIBS)
 osmo_trx_usrp1_CPPFLAGS  = $(AM_CPPFLAGS) $(USRP_CFLAGS)
 endif
+
+if DEVICE_LMS
+bin_PROGRAMS += osmo-trx-lms
+osmo_trx_lms_SOURCES = osmo-trx.cpp
+osmo_trx_lms_LDADD = \
+	$(COMMON_LDADD) \
+	$(LMS_LIBS) \
+	$(builddir)/device/lms/libdevice.la
+osmo_trx_lms_CPPFLAGS  = $(AM_CPPFLAGS) $(LMS_CFLAGS)
+endif
diff --git a/Transceiver52M/device/Makefile.am b/Transceiver52M/device/Makefile.am
index 2788eaa..1a2d077 100644
--- a/Transceiver52M/device/Makefile.am
+++ b/Transceiver52M/device/Makefile.am
@@ -11,3 +11,7 @@
 if DEVICE_UHD
 SUBDIRS += uhd
 endif
+
+if DEVICE_LMS
+SUBDIRS += lms
+endif
diff --git a/Transceiver52M/device/lms/Makefile.am b/Transceiver52M/device/lms/Makefile.am
new file mode 100644
index 0000000..8471074
--- /dev/null
+++ b/Transceiver52M/device/lms/Makefile.am
@@ -0,0 +1,10 @@
+include $(top_srcdir)/Makefile.common
+
+AM_CPPFLAGS = -Wall $(STD_DEFINES_AND_INCLUDES) -I${srcdir}/..
+AM_CXXFLAGS = -lpthread $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LMS_CFLAGS)
+
+noinst_HEADERS = LMSDevice.h
+
+noinst_LTLIBRARIES = libdevice.la
+
+libdevice_la_SOURCES = LMSDevice.cpp
diff --git a/configure.ac b/configure.ac
index 5f66225..aae151b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,6 +100,11 @@
         [enable USRP1 gnuradio based transceiver])
 ])
 
+AC_ARG_WITH(lms, [
+    AS_HELP_STRING([--with-lms],
+        [enable LimeSuite gnuradio based transceiver])
+])
+
 AC_ARG_WITH(singledb, [
     AS_HELP_STRING([--with-singledb],
         [enable single daughterboard use on USRP1])
@@ -133,6 +138,10 @@
     PKG_CHECK_MODULES(USRP, usrp >= 3.3)
 ])
 
+AS_IF([test "x$with_lms" = "xyes"], [
+    PKG_CHECK_MODULES(LMS, LimeSuite)
+])
+
 AS_IF([test "x$with_uhd" != "xno"],[
     PKG_CHECK_MODULES(UHD, uhd >= 003.011,
         [AC_DEFINE(USE_UHD_3_11, 1, UHD version 3.11.0 or higher)],
@@ -184,6 +193,7 @@
 
 AM_CONDITIONAL(DEVICE_UHD, [test "x$with_uhd" != "xno"])
 AM_CONDITIONAL(DEVICE_USRP1, [test "x$with_usrp1" = "xyes"])
+AM_CONDITIONAL(DEVICE_LMS, [test "x$with_lms" = "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"])
 
@@ -211,6 +221,7 @@
     Transceiver52M/device/Makefile \
     Transceiver52M/device/uhd/Makefile \
     Transceiver52M/device/usrp1/Makefile \
+    Transceiver52M/device/lms/Makefile \
     tests/Makefile \
     tests/CommonLibs/Makefile \
     tests/Transceiver52M/Makefile \