forked from nfc-tools/libnfc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Put libusb and PC/SC check in m4 macros. - Suppress --disable-pcsclite and --disable-libusb - Add --with-drivers option: we now could choose which driver to build. without this option a default set is build (ATM all drivers except PN532_UART)
- Loading branch information
Showing
13 changed files
with
228 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
SUBDIRS = chips buses drivers . | ||
|
||
# set the include path found by configure | ||
INCLUDES= $(all_includes) $(LIBNFC_CFLAGS) | ||
INCLUDES = $(all_includes) $(LIBNFC_CFLAGS) | ||
|
||
noinst_HEADERS = chips.h buses.h drivers.h bitutils.h | ||
lib_LTLIBRARIES = libnfc.la | ||
libnfc_la_SOURCES = nfc.c bitutils.c | ||
libnfc_la_LDFLAGS = -no-undefined -version-info=0:0:0 | ||
libnfc_la_CFLAGS = | ||
libnfc_la_CFLAGS = @DRIVERS_CFLAGS@ | ||
libnfc_la_LIBADD = \ | ||
$(top_builddir)/libnfc/chips/libnfcchips.la \ | ||
$(top_builddir)/libnfc/buses/libnfcbuses.la \ | ||
$(top_builddir)/libnfc/drivers/libnfcdrivers.la | ||
|
||
if PCSC_LITE_ENABLED | ||
libnfc_la_CFLAGS += @LIBPCSCLITE_CFLAGS@ -DHAVE_PCSC_LITE | ||
libnfc_la_LIBADD += @LIBPCSCLITE_LIBS@ | ||
if PCSC_ENABLED | ||
libnfc_la_CFLAGS += @libpcsclite_CFLAGS@ -DHAVE_PCSC | ||
libnfc_la_LIBADD += @libpcsclite_LIBS@ | ||
endif | ||
|
||
if LIBUSB_ENABLED | ||
libnfc_la_CFLAGS += @LIBUSB_CFLAGS@ -DHAVE_LIBUSB | ||
libnfc_la_LIBADD += @LIBUSB_LIBS@ | ||
libnfc_la_CFLAGS += @libusb_CFLAGS@ -DHAVE_LIBUSB | ||
libnfc_la_LIBADD += @libusb_LIBS@ | ||
endif | ||
|
||
EXTRA_DIST = CMakeLists.txt chips.h buses.h drivers.h bitutils.h | ||
EXTRA_DIST = CMakeLists.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,19 @@ | ||
# set the include path found by configure | ||
INCLUDES= $(all_includes) $(LIBNFC_CFLAGS) | ||
|
||
noinst_HEADERS = arygon.h pn532_uart.h | ||
noinst_HEADERS = acr122.h arygon.h pn531_usb.h pn532_uart.h pn533_usb.h pn53x_usb.h | ||
noinst_LTLIBRARIES = libnfcdrivers.la | ||
libnfcdrivers_la_SOURCES = arygon.c pn532_uart.c | ||
libnfcdrivers_la_CFLAGS = -I$(top_srcdir)/libnfc -I$(top_srcdir)/libnfc/buses | ||
libnfcdrivers_la_SOURCES = acr122.c arygon.c pn531_usb.c pn532_uart.c pn533_usb.c pn53x_usb.c | ||
libnfcdrivers_la_CFLAGS = @DRIVERS_CFLAGS@ -I$(top_srcdir)/libnfc -I$(top_srcdir)/libnfc/buses | ||
libnfcdrivers_la_LIBADD = | ||
|
||
if PCSC_LITE_ENABLED | ||
noinst_HEADERS += acr122.h | ||
libnfcdrivers_la_CFLAGS += @LIBPCSCLITE_CFLAGS@ -DHAVE_PCSC_LITE | ||
libnfcdrivers_la_SOURCES += acr122.c | ||
libnfcdrivers_la_LIBADD += @LIBPCSCLITE_LIBS@ | ||
if PCSC_ENABLED | ||
libnfcdrivers_la_CFLAGS += @libpcsclite_CFLAGS@ | ||
libnfcdrivers_la_LIBADD += @libpcsclite_LIBS@ | ||
endif | ||
|
||
if LIBUSB_ENABLED | ||
noinst_HEADERS += pn531_usb.h pn533_usb.h pn53x_usb.h | ||
libnfcdrivers_la_CFLAGS += @LIBUSB_CFLAGS@ -DHAVE_LIBUSB | ||
libnfcdrivers_la_SOURCES += pn531_usb.c pn533_usb.c pn53x_usb.c | ||
libnfcdrivers_la_LIBADD += @LIBUSB_LIBS@ | ||
libnfcdrivers_la_CFLAGS += @libusb_CFLAGS@ | ||
libnfcdrivers_la_LIBADD += @libusb_LIBS@ | ||
endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
dnl Check for LIBUSB | ||
dnl On success, HAVE_LIBUSB is set to 1 and PKG_CONFIG_REQUIRES is filled when | ||
dnl libusb is found using pkg-config | ||
|
||
AC_DEFUN([LIBNFC_CHECK_LIBUSB], | ||
[ | ||
if test x"$libusb_required" = "xyes"; then | ||
HAVE_LIBUSB=0 | ||
# Search using pkg-config | ||
if test x"$PKG_CONFIG" != "x"; then | ||
PKG_CHECK_MODULES([libusb], [libusb], [HAVE_LIBUSB=1], [HAVE_LIBUSB=0]) | ||
if test x"$HAVE_LIBUSB" = "x1"; then | ||
if test x"$PKG_CONFIG_REQUIRES" != x""; then | ||
PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES," | ||
fi | ||
PKG_CONFIG_REQUIRES="$PKG_CONFIG_REQUIRES libusb" | ||
fi | ||
fi | ||
AC_MSG_CHECKING(for libusb) | ||
# Search using libusb-config | ||
if test x"$HAVE_LIBUSB" = "x0"; then | ||
AC_PATH_PROG(libusb_CONFIG,libusb-config) | ||
if test x"$libusb_CONFIG" != "x" ; then | ||
libusb_CFLAGS=`$libusb_CONFIG --cflags` | ||
libusb_LIBS=`$libusb_CONFIG --libs` | ||
HAVE_LIBUSB=1 | ||
fi | ||
fi | ||
# Search the library and headers directly (last chance) | ||
if test x"$HAVE_LIBUSB" = "x0"; then | ||
AC_CHECK_HEADER(usb.h, [], [AC_MSG_ERROR([The libusb headers are missing])]) | ||
AC_CHECK_LIB(usb, libusb_init, [], [AC_MSG_ERROR([The libusb library is missing])]) | ||
libusb_LIBS="-lusb" | ||
HAVE_LIBUSB=1 | ||
fi | ||
if test x"$HAVE_LIBUSB" = "x0"; then | ||
AC_MSG_RESULT(no) | ||
AC_MSG_ERROR([libusb is mandatory.]) | ||
else | ||
AC_MSG_RESULT(yes) | ||
fi | ||
AC_SUBST(libusb_LIBS) | ||
AC_SUBST(libusb_CFLAGS) | ||
fi | ||
]) |
Oops, something went wrong.