Merge branch 'master' into pcsc

This commit is contained in:
Adam Laurie 2020-04-04 18:35:27 +01:00 committed by GitHub
commit fbae17186b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 663 additions and 10 deletions

View file

@ -4,7 +4,8 @@ AC_DEFUN([LIBNFC_ARG_WITH_DRIVERS],
[
AC_MSG_CHECKING(which drivers to build)
AC_ARG_WITH(drivers,
AS_HELP_STRING([--with-drivers=DRIVERS], [Use a custom driver set, where DRIVERS is a coma-separated list of drivers to build support for. Available drivers are: 'pcsc', 'acr122_pcsc', 'acr122_usb', 'acr122s', 'arygon', 'pn532_i2c', 'pn532_spi', 'pn532_uart' and 'pn53x_usb'. Default drivers set is 'acr122_usb,acr122s,arygon,pn532_i2c,pn532_spi,pn532_uart,pn53x_usb'. The special driver set 'all' compile all available drivers.]),
AS_HELP_STRING([--with-drivers=DRIVERS], [Use a custom driver set, where DRIVERS is a coma-separated list of drivers to build support for. Available drivers are: 'acr122_pcsc', 'acr122_usb', 'acr122s', 'arygon', 'pcsc', 'pn532_i2c', 'pn532_spi', 'pn532_uart', 'pn53x_usb' and 'pn71xx'. Default drivers set is 'acr122_usb,acr122s,arygon,pn532_i2c,pn532_spi,pn532_uart,pn53x_usb'. The special driver set 'all' compile all available drivers.]),
[ case "${withval}" in
yes | no)
dnl ignore calls without any arguments
@ -36,7 +37,8 @@ AC_DEFUN([LIBNFC_ARG_WITH_DRIVERS],
fi
;;
all)
DRIVER_BUILD_LIST="pcsc acr122_pcsc acr122_usb acr122s arygon pn53x_usb pn532_uart"
DRIVER_BUILD_LIST="acr122_pcsc acr122_usb acr122s arygon pn53x_usb pn532_uart pn71xx pcsc"
if test x"$spi_available" = x"yes"
then
DRIVER_BUILD_LIST="$DRIVER_BUILD_LIST pn532_spi"
@ -59,6 +61,7 @@ AC_DEFUN([LIBNFC_ARG_WITH_DRIVERS],
driver_pn532_uart_enabled="no"
driver_pn532_spi_enabled="no"
driver_pn532_i2c_enabled="no"
driver_pn71xx_enabled="no"
for driver in ${DRIVER_BUILD_LIST}
do
@ -108,6 +111,10 @@ AC_DEFUN([LIBNFC_ARG_WITH_DRIVERS],
driver_pn532_i2c_enabled="yes"
DRIVERS_CFLAGS="$DRIVERS_CFLAGS -DDRIVER_PN532_I2C_ENABLED"
;;
pn71xx)
driver_pn71xx_enabled="yes"
DRIVERS_CFLAGS="$DRIVERS_CFLAGS -DDRIVER_PN71XX_ENABLED"
;;
*)
AC_MSG_ERROR([Unknow driver: $driver])
;;
@ -123,6 +130,7 @@ AC_DEFUN([LIBNFC_ARG_WITH_DRIVERS],
AM_CONDITIONAL(DRIVER_PN532_UART_ENABLED, [test x"$driver_pn532_uart_enabled" = xyes])
AM_CONDITIONAL(DRIVER_PN532_SPI_ENABLED, [test x"$driver_pn532_spi_enabled" = xyes])
AM_CONDITIONAL(DRIVER_PN532_I2C_ENABLED, [test x"$driver_pn532_i2c_enabled" = xyes])
AM_CONDITIONAL(DRIVER_PN71XX_ENABLED, [test x"$driver_pn71xx_enabled" = xyes])
])
AC_DEFUN([LIBNFC_DRIVERS_SUMMARY],[
@ -137,4 +145,5 @@ echo " pn53x_usb........ $driver_pn53x_usb_enabled"
echo " pn532_uart....... $driver_pn532_uart_enabled"
echo " pn532_spi....... $driver_pn532_spi_enabled"
echo " pn532_i2c........ $driver_pn532_i2c_enabled"
echo " pn71xx........... $driver_pn71xx_enabled"
])