Enforce ISO C conformance about empty files.

ISO C forbids empty source files.  Instead of compiling possibly empty source
files depending on the compiler parameters, only compile required files to
build the library as requested at the ./configure stage.

Windows users (and more precisely non-autotools users), you may have to update
whatever you use to build the libnfc to fit your needs.  The Makefile shipped
in the windows directory compiles all drivers as it is written so you should
not notice any difference, but if you don't use _that_ makefile, then you will
have to do some adjustment.

For now, keep the defines in CFLAGS just in case.  Planned for removal in circa
one week.

While here, pet `./configure` output (--help format and summary).
This commit is contained in:
Romain Tartiere 2010-07-31 13:21:56 +00:00
parent bb06d45a05
commit cd53efb038
9 changed files with 61 additions and 22 deletions

View file

@ -4,7 +4,7 @@ AC_DEFUN([LIBNFC_ARG_WITH_DRIVERS],
[
AC_MSG_CHECKING(which drivers to build)
AC_ARG_WITH(drivers,
AC_HELP_STRING([[[[--with-drivers=driver@<:@,driver...@:>@]]]], [Only use specific drivers (default set)]),
AC_HELP_STRING([[[--with-drivers=driver@<:@,driver...@:>@]]], [Only use specific drivers (default set)]),
[ case "${withval}" in
yes | no)
dnl ignore calls without any arguments
@ -34,25 +34,36 @@ AC_DEFUN([LIBNFC_ARG_WITH_DRIVERS],
DRIVERS_CFLAGS=""
driver_acr122_enabled="no"
driver_pn531_usb_enabled="no"
driver_pn533_usb_enabled="no"
driver_arygon_enabled="no"
driver_pn532_uart_enabled="no"
for driver in ${DRIVER_BUILD_LIST}
do
case "${driver}" in
acr122)
pcsc_required="yes"
driver_acr122_enabled="yes"
DRIVERS_CFLAGS="$DRIVERS_CFLAGS -DDRIVER_ACR122_ENABLED"
;;
pn531_usb)
libusb_required="yes"
driver_pn531_usb_enabled="yes"
DRIVERS_CFLAGS="$DRIVERS_CFLAGS -DDRIVER_PN531_USB_ENABLED"
;;
pn533_usb)
libusb_required="yes"
driver_pn533_usb_enabled="yes"
DRIVERS_CFLAGS="$DRIVERS_CFLAGS -DDRIVER_PN533_USB_ENABLED"
;;
arygon)
driver_arygon_enabled="yes"
DRIVERS_CFLAGS="$DRIVERS_CFLAGS -DDRIVER_ARYGON_ENABLED"
;;
pn532_uart)
driver_pn532_uart_enabled="yes"
DRIVERS_CFLAGS="$DRIVERS_CFLAGS -DDRIVER_PN532_UART_ENABLED"
;;
*)
@ -61,4 +72,19 @@ AC_DEFUN([LIBNFC_ARG_WITH_DRIVERS],
esac
done
AC_SUBST(DRIVERS_CFLAGS)
AM_CONDITIONAL(DRIVER_ACR122_ENABLED, [test x"$driver_acr122_enabled" = xyes])
AM_CONDITIONAL(DRIVER_PN531_USB_ENABLED, [test x"$driver_pn531_usb_enabled" = xyes])
AM_CONDITIONAL(DRIVER_PN533_USB_ENABLED, [test x"$driver_pn533_usb_enabled" = xyes])
AM_CONDITIONAL(DRIVER_ARYGON_ENABLED, [test x"$driver_arygon_enabled" = xyes])
AM_CONDITIONAL(DRIVER_PN532_UART_ENABLED, [test x"$driver_pn532_uart_enabled" = xyes])
])
AC_DEFUN([LIBNFC_DRIVERS_SUMMARY],[
echo
echo "Selected drivers:"
echo " acr122........... $driver_acr122_enabled"
echo " arygon........... $driver_arygon_enabled"
echo " pn531_usb........ $driver_pn531_usb_enabled"
echo " pn532_uart....... $driver_pn532_uart_enabled"
echo " pn533_usb........ $driver_pn533_usb_enabled"
])