diff --git a/configure.ac b/configure.ac index 6176591..5e7e486 100644 --- a/configure.ac +++ b/configure.ac @@ -118,9 +118,12 @@ fi # Handle --with-drivers option LIBNFC_ARG_WITH_DRIVERS -# Enable UART if +# Enable UART if AM_CONDITIONAL(UART_ENABLED, [test x"$uart_required" = x"yes"]) +# Enable SPI if +AM_CONDITIONAL(SPI_ENABLED, [test x"$spi_required" = x"yes"]) + # Documentation (default: no) AC_ARG_ENABLE([doc],AS_HELP_STRING([--enable-doc],[Enable documentation generation.]),[enable_doc=$enableval],[enable_doc="no"]) diff --git a/libnfc/buses/Makefile.am b/libnfc/buses/Makefile.am index c1b8056..a875ed7 100644 --- a/libnfc/buses/Makefile.am +++ b/libnfc/buses/Makefile.am @@ -8,11 +8,12 @@ libnfcbuses_la_CFLAGS = -I$(top_srcdir)/libnfc libnfcbuses_la_LIBADD = EXTRA_DIST = -# SPI_ENABLED +if SPI_ENABLED libnfcbuses_la_SOURCES += spi.c spi.h libnfcbuses_la_CFLAGS += libnfcbuses_la_LIBADD += -EXTRA_DIST = spi_posix.c +endif +EXTRA_DIST = spi.c spi.h if UART_ENABLED libnfcbuses_la_SOURCES += uart.c uart.h diff --git a/m4/libnfc_drivers.m4 b/m4/libnfc_drivers.m4 index 62f734a..e27eed1 100644 --- a/m4/libnfc_drivers.m4 +++ b/m4/libnfc_drivers.m4 @@ -76,6 +76,7 @@ AC_DEFUN([LIBNFC_ARG_WITH_DRIVERS], DRIVERS_CFLAGS="$DRIVERS_CFLAGS -DDRIVER_PN532_UART_ENABLED" ;; pn532_spi) + spi_required="yes" driver_pn532_spi_enabled="yes" DRIVERS_CFLAGS="$DRIVERS_CFLAGS -DDRIVER_PN532_SPI_ENABLED" ;;