diff --git a/configure.ac b/configure.ac index eb3bb86..85c3ac2 100644 --- a/configure.ac +++ b/configure.ac @@ -118,6 +118,9 @@ fi # Handle --with-drivers option LIBNFC_ARG_WITH_DRIVERS +# Enable UART if +AM_CONDITIONAL(UART_ENABLED, [test x"$uart_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 2adaf9c..a8be215 100644 --- a/libnfc/buses/Makefile.am +++ b/libnfc/buses/Makefile.am @@ -6,12 +6,14 @@ noinst_LTLIBRARIES = libnfcbuses.la libnfcbuses_la_SOURCES = libnfcbuses_la_CFLAGS = -I$(top_srcdir)/libnfc libnfcbuses_la_LIBADD = +EXTRA_DIST = -# UART_ENABLED -libnfcbuses_la_SOURCES += uart.c uart.h -libnfcbuses_la_CFLAGS += -libnfcbuses_la_LIBADD += -EXTRA_DIST = uart_posix.c uart_win32.c +if UART_ENABLED + libnfcbuses_la_SOURCES += uart.c uart.h + libnfcbuses_la_CFLAGS += + libnfcbuses_la_LIBADD += +endif +EXTRA_DIST += uart.c uart.h uart_posix.c uart_win32.c if LIBUSB_ENABLED libnfcbuses_la_SOURCES += usbbus.c usbbus.h diff --git a/m4/libnfc_drivers.m4 b/m4/libnfc_drivers.m4 index a0ed071..22cfbe2 100644 --- a/m4/libnfc_drivers.m4 +++ b/m4/libnfc_drivers.m4 @@ -55,6 +55,7 @@ AC_DEFUN([LIBNFC_ARG_WITH_DRIVERS], DRIVERS_CFLAGS="$DRIVERS_CFLAGS -DDRIVER_ACR122_USB_ENABLED" ;; acr122s) + uart_required="yes" driver_acr122s_enabled="yes" DRIVERS_CFLAGS="$DRIVERS_CFLAGS -DDRIVER_ACR122S_ENABLED" ;; @@ -64,10 +65,12 @@ AC_DEFUN([LIBNFC_ARG_WITH_DRIVERS], DRIVERS_CFLAGS="$DRIVERS_CFLAGS -DDRIVER_PN53X_USB_ENABLED" ;; arygon) + uart_required="yes" driver_arygon_enabled="yes" DRIVERS_CFLAGS="$DRIVERS_CFLAGS -DDRIVER_ARYGON_ENABLED" ;; pn532_uart) + uart_required="yes" driver_pn532_uart_enabled="yes" DRIVERS_CFLAGS="$DRIVERS_CFLAGS -DDRIVER_PN532_UART_ENABLED" ;;