Skip to content

Commit

Permalink
Only include UART related files when (at least) one UART driver is en…
Browse files Browse the repository at this point in the history
…abled
  • Loading branch information
neomilium committed Mar 18, 2013
1 parent f3f2ec1 commit 699e912
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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"])

Expand Down
12 changes: 7 additions & 5 deletions libnfc/buses/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions m4/libnfc_drivers.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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"
;;
Expand All @@ -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"
;;
Expand Down

0 comments on commit 699e912

Please sign in to comment.