sim: Use autotools for libpcsc-lite linkage

This commit is contained in:
Harald Welte 2012-09-10 16:28:17 +02:00
parent ad41863b8d
commit 495fe2682c
2 changed files with 18 additions and 4 deletions

View File

@ -82,6 +82,16 @@ CHECK_TM_INCLUDES_TM_GMTOFF
dnl Generate the output dnl Generate the output
AC_CONFIG_HEADER(config.h) AC_CONFIG_HEADER(config.h)
AC_ARG_ENABLE([pcsc], [AS_HELP_STRING([--disable-pcsc], [Build without PC/SC support])],
[
osmo_ac_have_pcsc=$enableval
],
[
PKG_CHECK_MODULES(PCSC, libpcsclite)
osmo_ac_have_pcsc="yes"
])
AM_CONDITIONAL(ENABLE_PCSC, test "x$osmo_ac_have_pcsc" = "xyes")
AC_ARG_ENABLE(talloc, AC_ARG_ENABLE(talloc,
[AS_HELP_STRING( [AS_HELP_STRING(
[--disable-talloc], [--disable-talloc],

View File

@ -3,14 +3,18 @@
LIBVERSION=0:0:0 LIBVERSION=0:0:0
INCLUDES = $(all_includes) -I$(top_srcdir)/include INCLUDES = $(all_includes) -I$(top_srcdir)/include
AM_CFLAGS = -fPIC -Wall AM_CFLAGS = -fPIC -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(PCSC_CFLAGS)
AM_LDFLAGS = $(COVERAGE_LDFLAGS)
if ENABLE_PCSC
# FIXME: only build the PC/SC dependent part conditional, but always build other parts
noinst_HEADERS = sim_int.h gsm_int.h noinst_HEADERS = sim_int.h gsm_int.h
lib_LTLIBRARIES = libosmosim.la lib_LTLIBRARIES = libosmosim.la
libosmosim_la_SOURCES = core.c card_fs_sim.c card_fs_usim.c card_fs_uicc.c reader.c reader_pcsc.c libosmosim_la_SOURCES = core.c card_fs_sim.c card_fs_usim.c card_fs_uicc.c reader.c reader_pcsc.c
# FIXME: use autoconf to determine pcsc include path / library name libosmosim_la_LDFLAGS = -version-info $(LIBVERSION)
libosmosim_la_LDFLAGS = -version-info $(LIBVERSION) -lpcsclite libosmosim_la_LIBADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(PCSC_LIBS)
libosmosim_la_CFLAGS = -I/usr/include/PCSC
endif