From bf5848e7a14ff813fd47bb12e9ebe73c7e09c774 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Thu, 11 Jun 2009 11:57:36 +0000 Subject: [PATCH] libnfc can now be compiled without pcsc-lite (but it removes acr122 device support) --- configure.ac | 2 +- src/Makefile.am | 16 ++++++++-------- src/devices.h | 6 +++++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 0a60684..a1701c9 100644 --- a/configure.ac +++ b/configure.ac @@ -36,7 +36,7 @@ then fi AM_CONDITIONAL(PCSC_LITE_ENABLED, [test x"$enable_pcsc_lite" = xyes]) -# --enable-debug support +# --enable-debug support (default:no) AC_ARG_ENABLE([debug],AS_HELP_STRING([--enable-debug],[Debug flags]),[enable_debug=$enableval],[enable_debug="no"]) AC_MSG_CHECKING(for debug flag) diff --git a/src/Makefile.am b/src/Makefile.am index 38d711a..5b8eaf2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -5,19 +5,19 @@ bin_PROGRAMS = nfc-anticol nfc-list nfc-mftool nfc-relay nfc-emulate # set the include path found by configure INCLUDES= $(all_includes) -nfcinclude_HEADERS = libnfc.h bitutils.h defines.h types.h mifaretag.h devices.h rs232.h dev_arygon.h +nfcinclude_HEADERS = libnfc.h bitutils.h defines.h types.h mifaretag.h devices.h rs232.h dev_arygon.h dev_pn531.h dev_pn533.h nfcincludedir = $(includedir)/libnfc lib_LTLIBRARIES = libnfc.la -libnfc_la_SOURCES = bitutils.c libnfc.c rs232.c dev_arygon.c -libnfc_la_CFLAGS = -libnfc_la_LIBADD = +libnfc_la_SOURCES = bitutils.c libnfc.c rs232.c dev_arygon.c dev_pn531.c dev_pn533.c +libnfc_la_CFLAGS = @LIBUSB_CFLAGS@ +libnfc_la_LIBADD = @LIBUSB_LIBS@ if PCSC_LITE_ENABLED - nfcinclude_HEADERS += dev_acr122.h dev_pn531.h dev_pn533.h - libnfc_la_CFLAGS += @LIBUSB_CFLAGS@ @LIBPCSCLITE_CFLAGS@ - libnfc_la_SOURCES += dev_acr122.c dev_pn531.c dev_pn533.c - libnfc_la_LIBADD += @LIBUSB_LIBS@ @LIBPCSCLITE_LIBS@ + nfcinclude_HEADERS += dev_acr122.h + libnfc_la_CFLAGS += @LIBPCSCLITE_CFLAGS@ -DHAVE_PCSC_LITE + libnfc_la_SOURCES += dev_acr122.c + libnfc_la_LIBADD += @LIBPCSCLITE_LIBS@ endif nfc_anticol_SOURCES = anticol.c diff --git a/src/devices.h b/src/devices.h index 15f8333..8a98d68 100644 --- a/src/devices.h +++ b/src/devices.h @@ -23,14 +23,18 @@ along with this program. If not, see . #include "defines.h" #include "types.h" -#include "dev_acr122.h" +#ifdef HAVE_PCSC_LITE + #include "dev_acr122.h" +#endif #include "dev_pn531.h" #include "dev_pn533.h" #include "dev_arygon.h" const static struct dev_callbacks dev_callbacks_list[] = { // Driver Name Connect Transceive Disconect +#ifdef HAVE_PCSC_LITE { "ACR122", dev_acr122_connect, dev_acr122_transceive, dev_acr122_disconnect }, +#endif { "PN531USB", dev_pn531_connect, dev_pn531_transceive, dev_pn531_disconnect }, { "PN533USB", dev_pn533_connect, dev_pn533_transceive, dev_pn533_disconnect }, { "ARYGON", dev_arygon_connect, dev_arygon_transceive, dev_arygon_disconnect }