Change in osmo-remsim[master]: configure.ac: Add --disable-remsim-bankd

Harald Welte gerrit-no-reply at lists.osmocom.org
Wed Apr 3 11:16:10 UTC 2019


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/13504


Change subject: configure.ac: Add --disable-remsim-bankd
......................................................................

configure.ac: Add --disable-remsim-bankd

This allows builds on small/embedded platforms to avoid all the
dependencies required by remsim-bankd, including libpcsc-lite

Change-Id: I29a1a0131fdfea6742ec12d81228879066b1ff7e
---
M configure.ac
M doc/Makefile.am
R doc/examples/bankd_pcsc_slots.csv
M src/Makefile.am
A src/bankd/Makefile.am
R src/bankd/bankd.h
R src/bankd/bankd_main.c
R src/bankd/bankd_pcsc.c
R src/bankd/driver_core.c
R src/bankd/driver_pcsc.c
R src/bankd/internal.h
R src/bankd/main.c
12 files changed, 41 insertions(+), 12 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/04/13504/1

diff --git a/configure.ac b/configure.ac
index b369133..e87c8c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,7 +39,6 @@
 PKG_CHECK_MODULES(OSMOGSM, libosmogsm >= 0.11.0)
 PKG_CHECK_MODULES(OSMOABIS, libosmoabis)
 PKG_CHECK_MODULES(OSMOSIM, libosmosim)
-PKG_CHECK_MODULES(PCSC, libpcsclite)
 PKG_CHECK_MODULES(USB, libusb-1.0)
 
 AC_ARG_ENABLE([remsim-server],[AS_HELP_STRING([--disable-remsim-server], [Build osmo-remsim-server])],
@@ -52,6 +51,16 @@
 AM_CONDITIONAL(BUILD_SERVER, test "x$osmo_ac_build_server" = "xyes")
 AC_SUBST(BUILD_SERVER)
 
+AC_ARG_ENABLE([remsim-bankd],[AS_HELP_STRING([--disable-remsim-bankd], [Build osmo-remsim-bankd])],
+	[osmo_ac_build_bankd="$enableval"],[osmo_ac_build_bankd="yes"])
+if test "$osmo_ac_build_bankd" = "yes"; then
+	AC_DEFINE(BUILD_BANKD, 1, [Define if we want to build osmo-remsim-bankd])
+fi
+AM_CONDITIONAL(BUILD_BANKD, test "x$osmo_ac_build_bankd" = "xyes")
+	PKG_CHECK_MODULES(PCSC, libpcsclite)
+AC_SUBST(BUILD_BANKD)
+
+
 AC_CONFIG_MACRO_DIR([m4])
 
 dnl checks for header files
@@ -142,6 +151,7 @@
 	doc/manuals/Makefile
 	src/Makefile
 	src/rspro/Makefile
+	src/bankd/Makefile
 	src/server/Makefile
 	include/Makefile
 	include/osmocom/Makefile
diff --git a/doc/Makefile.am b/doc/Makefile.am
index adfdcf7..dd4a573 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,3 +1,5 @@
 SUBDIRS = \
 	manuals \
         $(NULL)
+
+EXTRA_DIST = examples/bankd_pcsc_slots.csv
diff --git a/src/bankd_pcsc_slots.csv b/doc/examples/bankd_pcsc_slots.csv
similarity index 100%
rename from src/bankd_pcsc_slots.csv
rename to doc/examples/bankd_pcsc_slots.csv
diff --git a/src/Makefile.am b/src/Makefile.am
index 5b6efb9..165c3f7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,7 @@
 SUBDIRS = rspro
+if BUILD_BANKD
+SUBDIRS += bankd
+endif
 if BUILD_SERVER
 SUBDIRS += server
 endif
@@ -15,7 +18,7 @@
 			  rspro/libosmo-asn1-rspro.la
 libosmo_rspro_la_SOURCES = rspro_util.c asn1c_helpers.c
 
-noinst_HEADERS = debug.h bankd.h client.h internal.h rspro_util.h slotmap.h rspro_client_fsm.h \
+noinst_HEADERS = debug.h client.h rspro_util.h slotmap.h rspro_client_fsm.h \
 		 asn1c_helpers.h \
 		 simtrace2/apdu_dispatch.h \
 		 simtrace2/libusb_util.h \
@@ -23,16 +26,7 @@
 		 simtrace2/simtrace_prot.h \
 		 simtrace2/simtrace_usb.h
 
-bin_PROGRAMS = osmo-remsim-bankd osmo-remsim-client-st2
-noinst_PROGRAMS = pcsc_test remsim-client
-
-pcsc_test_SOURCES = driver_core.c driver_pcsc.c main.c
-pcsc_test_LDADD = $(OSMOCORE_LIBS) \
-		  $(PCSC_LIBS) libosmo-rspro.la
-
-osmo_remsim_bankd_SOURCES = slotmap.c bankd_main.c bankd_pcsc.c rspro_client_fsm.c debug.c
-osmo_remsim_bankd_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \
-			  $(PCSC_LIBS) libosmo-rspro.la -lcsv
+bin_PROGRAMS = osmo-remsim-client-st2
 
 remsim_client_SOURCES = remsim_client.c rspro_client_fsm.c bankd_client_fsm.c debug.c
 remsim_client_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \
diff --git a/src/bankd/Makefile.am b/src/bankd/Makefile.am
new file mode 100644
index 0000000..62ed581
--- /dev/null
+++ b/src/bankd/Makefile.am
@@ -0,0 +1,23 @@
+AM_CFLAGS = -Wall -I$(top_srcdir)/include -I$(top_builddir)/include -I$(top_srcdir)/src \
+	    -I$(top_srcdir)/include/osmocom/rspro \
+	    $(OSMOCORE_CFLAGS) $(OSMOGSM_CFLAGS) $(OSMOABIS_CFLAGS) $(OSMOSIM_CFLAGS) \
+	    $(PCSC_CFLAGS)
+
+noinst_HEADERS = bankd.h internal.h
+
+bin_PROGRAMS = osmo-remsim-bankd
+noinst_PROGRAMS = pcsc_test
+
+pcsc_test_SOURCES = driver_core.c driver_pcsc.c main.c
+pcsc_test_LDADD = $(OSMOCORE_LIBS) \
+		  $(PCSC_LIBS) $(top_builddir)/src/libosmo-rspro.la
+
+osmo_remsim_bankd_SOURCES = ../slotmap.c ../rspro_client_fsm.c ../debug.c \
+			  bankd_main.c bankd_pcsc.c
+osmo_remsim_bankd_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) $(OSMOSIM_LIBS) \
+			  $(PCSC_LIBS) $(top_builddir)/src/libosmo-rspro.la -lcsv
+
+# as suggested in http://lists.gnu.org/archive/html/automake/2009-03/msg00011.html
+FORCE:
+$(top_builddir)/src/libosmo-rspro.la: FORCE
+	(cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) libosmo-rspro.la)
diff --git a/src/bankd.h b/src/bankd/bankd.h
similarity index 100%
rename from src/bankd.h
rename to src/bankd/bankd.h
diff --git a/src/bankd_main.c b/src/bankd/bankd_main.c
similarity index 100%
rename from src/bankd_main.c
rename to src/bankd/bankd_main.c
diff --git a/src/bankd_pcsc.c b/src/bankd/bankd_pcsc.c
similarity index 100%
rename from src/bankd_pcsc.c
rename to src/bankd/bankd_pcsc.c
diff --git a/src/driver_core.c b/src/bankd/driver_core.c
similarity index 100%
rename from src/driver_core.c
rename to src/bankd/driver_core.c
diff --git a/src/driver_pcsc.c b/src/bankd/driver_pcsc.c
similarity index 100%
rename from src/driver_pcsc.c
rename to src/bankd/driver_pcsc.c
diff --git a/src/internal.h b/src/bankd/internal.h
similarity index 100%
rename from src/internal.h
rename to src/bankd/internal.h
diff --git a/src/main.c b/src/bankd/main.c
similarity index 100%
rename from src/main.c
rename to src/bankd/main.c

-- 
To view, visit https://gerrit.osmocom.org/13504
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I29a1a0131fdfea6742ec12d81228879066b1ff7e
Gerrit-Change-Number: 13504
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190403/0504157e/attachment.html>


More information about the gerrit-log mailing list