diff --git a/configure.ac b/configure.ac index 31af887..1c9cd72 100644 --- a/configure.ac +++ b/configure.ac @@ -38,10 +38,6 @@ AC_CHECK_HEADERS([csv.h]) PKG_CHECK_MODULES(OSMOCORE, libosmocore >= 1.3.0) PKG_CHECK_MODULES(OSMOGSM, libosmogsm >= 0.11.0) PKG_CHECK_MODULES(OSMOABIS, libosmoabis) -PKG_CHECK_MODULES(OSMOSIM, libosmosim) -PKG_CHECK_MODULES(OSMOUSB, libosmousb) -PKG_CHECK_MODULES(OSMOSIMTRACE2, libosmo-simtrace2) -PKG_CHECK_MODULES(USB, libusb-1.0) AC_ARG_ENABLE([remsim-server],[AS_HELP_STRING([--disable-remsim-server], [Build osmo-remsim-server])], [osmo_ac_build_server="$enableval"],[osmo_ac_build_server="yes"]) @@ -58,11 +54,24 @@ AC_ARG_ENABLE([remsim-bankd],[AS_HELP_STRING([--disable-remsim-bankd], [Build os [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]) + PKG_CHECK_MODULES(OSMOSIM, libosmosim) + PKG_CHECK_MODULES(PCSC, libpcsclite) fi AM_CONDITIONAL(BUILD_BANKD, test "x$osmo_ac_build_bankd" = "xyes") - PKG_CHECK_MODULES(PCSC, libpcsclite) AC_SUBST(BUILD_BANKD) +AC_ARG_ENABLE([remsim-client],[AS_HELP_STRING([--disable-remsim-client], [Build osmo-remsim-client])], + [osmo_ac_build_client="$enableval"],[osmo_ac_build_client="yes"]) +if test "$osmo_ac_build_client" = "yes"; then + AC_DEFINE(BUILD_CLIENT, 1, [Define if we want to build osmo-remsim-client]) + PKG_CHECK_MODULES(OSMOSIM, libosmosim) + PKG_CHECK_MODULES(OSMOUSB, libosmousb) + PKG_CHECK_MODULES(OSMOSIMTRACE2, libosmo-simtrace2) + PKG_CHECK_MODULES(USB, libusb-1.0) +fi +AM_CONDITIONAL(BUILD_CLIENT, test "x$osmo_ac_build_client" = "xyes") +AC_SUBST(BUILD_CLIENT) + AC_CONFIG_MACRO_DIR([m4]) @@ -155,6 +164,7 @@ AC_OUTPUT( src/Makefile src/rspro/Makefile src/bankd/Makefile + src/client/Makefile src/server/Makefile include/Makefile include/osmocom/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 58f02e8..c954db2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,11 +5,12 @@ endif if BUILD_SERVER SUBDIRS += server endif +if BUILD_CLIENT +SUBDIRS += client +endif AM_CFLAGS = -Wall -I$(top_srcdir)/include -I$(top_builddir)/include \ $(OSMOCORE_CFLAGS) $(OSMOGSM_CFLAGS) $(OSMOABIS_CFLAGS) \ - $(PCSC_CFLAGS) $(USB_CFLAGS) $(OSMOSIM_CFLAGS) \ - $(OSMOSIMTRACE2_CFLAGS) \ -I$(top_srcdir)/include/osmocom/rspro RSPRO_LIBVERSION=1:0:0 @@ -19,17 +20,5 @@ libosmo_rspro_la_LIBADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ rspro/libosmo-asn1-rspro.la libosmo_rspro_la_SOURCES = rspro_util.c asn1c_helpers.c -noinst_HEADERS = debug.h client.h rspro_util.h slotmap.h rspro_client_fsm.h \ +noinst_HEADERS = debug.h rspro_util.h slotmap.h rspro_client_fsm.h \ asn1c_helpers.h - -bin_PROGRAMS = osmo-remsim-client-st2 - -remsim_client_SOURCES = remsim_client.c rspro_client_fsm.c debug.c -remsim_client_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ - libosmo-rspro.la - -osmo_remsim_client_st2_SOURCES = simtrace2-remsim_client.c \ - rspro_client_fsm.c debug.c -osmo_remsim_client_st2_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ - $(OSMOUSB_LIBS) $(OSMOSIMTRACE2_LIBS) \ - $(USB_LIBS) $(OSMOSIM_LIBS) libosmo-rspro.la diff --git a/src/bankd/bankd.h b/src/bankd/bankd.h index d713ed1..6de3213 100644 --- a/src/bankd/bankd.h +++ b/src/bankd/bankd.h @@ -14,7 +14,7 @@ #include "rspro_util.h" #include "slotmap.h" -#include "client.h" +#include "rspro_client_fsm.h" #include "debug.h" extern struct value_string worker_state_names[]; diff --git a/src/client/Makefile.am b/src/client/Makefile.am new file mode 100644 index 0000000..106bc5e --- /dev/null +++ b/src/client/Makefile.am @@ -0,0 +1,20 @@ +AM_CFLAGS = -Wall -I$(top_srcdir)/include -I/$(top_builddir)/include -I$(top_srcdir)/src \ + $(OSMOCORE_CFLAGS) $(OSMOGSM_CFLAGS) $(OSMOABIS_CFLAGS) \ + $(PCSC_CFLAGS) $(USB_CFLAGS) $(OSMOSIM_CFLAGS) \ + $(OSMOSIMTRACE2_CFLAGS) \ + -I$(top_srcdir)/include/osmocom/rspro + +bin_PROGRAMS = osmo-remsim-client-st2 + +remsim_client_SOURCES = remsim_client.c ../rspro_client_fsm.c ../debug.c +remsim_client_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ + $(top_builddir)/src/libosmo-rspro.la + +osmo_remsim_client_st2_SOURCES = simtrace2-remsim_client.c \ + ../rspro_client_fsm.c ../debug.c +osmo_remsim_client_st2_LDADD = $(OSMOCORE_LIBS) $(OSMOGSM_LIBS) $(OSMOABIS_LIBS) \ + $(OSMOUSB_LIBS) $(OSMOSIMTRACE2_LIBS) \ + $(USB_LIBS) $(OSMOSIM_LIBS) \ + $(top_builddir)/src/libosmo-rspro.la + +noinst_HEADERS = client.h diff --git a/src/client.h b/src/client/client.h similarity index 100% rename from src/client.h rename to src/client/client.h diff --git a/src/remsim_client.c b/src/client/remsim_client.c similarity index 100% rename from src/remsim_client.c rename to src/client/remsim_client.c diff --git a/src/simtrace2-remsim_client.c b/src/client/simtrace2-remsim_client.c similarity index 100% rename from src/simtrace2-remsim_client.c rename to src/client/simtrace2-remsim_client.c diff --git a/src/rspro_client_fsm.c b/src/rspro_client_fsm.c index 758bde7..d5cf04b 100644 --- a/src/rspro_client_fsm.c +++ b/src/rspro_client_fsm.c @@ -35,8 +35,8 @@ #include #include -#include "client.h" -#include "rspro_util.h" +#include "debug.h" +#include "rspro_client_fsm.h" #define S(x) (1 << (x)) diff --git a/src/rspro_client_fsm.h b/src/rspro_client_fsm.h index ca59c77..2f3f7fc 100644 --- a/src/rspro_client_fsm.h +++ b/src/rspro_client_fsm.h @@ -4,6 +4,8 @@ #include #include +#include "rspro_util.h" + enum server_conn_fsm_event { SRVC_E_ESTABLISH, /* instruct SRVC to (re)etablish TCP connection to bankd */ SRVC_E_TCP_UP,