configure.ac rework

- 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)
This commit is contained in:
Romuald Conty
2010-04-15 14:41:13 +00:00
parent b747573dc7
commit b55400a0d5
13 changed files with 230 additions and 122 deletions
+8 -12
View File
@@ -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
+4
View File
@@ -22,6 +22,8 @@
* @brief
*/
#ifdef DRIVER_ACR122_ENABLED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
@@ -361,3 +363,5 @@ bool acr122_led_red(const nfc_device_spec_t nds, bool bOn)
}
}
#endif // DRIVER_ACR122_ENABLED
+5
View File
@@ -25,6 +25,8 @@
* UART connection can be direct (host<->arygon_uc) or could be provided by internal USB to serial interface (e.g. host<->ftdi_chip<->arygon_uc)
*/
#ifdef DRIVER_ARYGON_ENABLED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
@@ -297,3 +299,6 @@ bool arygon_transceive(const nfc_device_spec_t nds, const byte_t* pbtTx, const s
return true;
}
#endif // DRIVER_ARYGON_ENABLED
+5
View File
@@ -26,6 +26,8 @@
Thanks to d18c7db and Okko for example code
*/
#ifdef DRIVER_PN531_USB_ENABLED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
@@ -70,3 +72,6 @@ nfc_device_t* pn531_usb_connect(const nfc_device_desc_t* pndd)
{
return pn53x_usb_connect(pndd, pndd->acDevice, NC_PN531);
}
#endif // DRIVER_PN531_USB_ENABLED
+5
View File
@@ -22,6 +22,8 @@
* @brief PN532 driver using UART bus (UART, RS232, etc.)
*/
#ifdef DRIVER_PN532_UART_ENABLED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
@@ -310,3 +312,6 @@ pn532_uart_wakeup(const nfc_device_spec_t nds)
}
return true;
}
#endif // DRIVER_PN532_UART_ENABLED
+5
View File
@@ -26,6 +26,8 @@
Thanks to d18c7db and Okko for example code
*/
#ifdef DRIVER_PN533_USB_ENABLED
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif // HAVE_CONFIG_H
@@ -68,3 +70,6 @@ nfc_device_t* pn533_usb_connect(const nfc_device_desc_t* pndd)
{
return pn53x_usb_connect(pndd, pndd->acDevice, NC_PN533);
}
#endif // DRIVER_PN533_USB_ENABLED
+4
View File
@@ -30,6 +30,8 @@
Thanks to d18c7db and Okko for example code
*/
#if defined (DRIVER_PN531_USB_ENABLED) || defined (DRIVER_PN533_USB_ENABLED)
#include <stdio.h>
#include <stdlib.h>
#include <usb.h>
@@ -329,3 +331,5 @@ bool pn53x_usb_transceive(const nfc_device_spec_t nds, const byte_t* pbtTx, cons
return true;
}
#endif // DRIVER_PN531_USB_ENABLED || DRIVER_PN533_USB_ENABLED