From 3d511fb93397edcaeab0e5a0b56444933c8461c6 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Thu, 10 Apr 2008 09:57:29 +0000 Subject: [PATCH] Added automake conditionals CONFIG_COMEDI_USB and CONFIG_COMEDI_PCMCIA and used these in place of the automake conditionals CONFIG_USB and CONFIG_PCMCIA. The automake conditionals CONFIG_USB and CONFIG_PCMCIA are no longer used (currently) but they no longer depend on the --disable-usb or --disable-pcmcia configure options. The new automake conditional CONFIG_COMEDI_USB/CONFIG_COMEDI_PCMCIA is 'FALSE' if --disable-usb/ --disable-pcmcia is specified; otherwise it has the same value as CONFIG_USB/CONFIG_PCMCIA. Added config.h defines CONFIG_COMEDI_USB and CONFIG_COMEDI_PCMCIA which are defined only if the corresponding automake conditional is 'TRUE'. Changed the --(en|dis)able-pcmcia option so that it is no longer necessary to specify --enable-pcmcia explicitly to build the PCMCIA modules. --- comedi/comedi_kbuild.inc.in | 4 ++-- comedi/drivers/Makefile.am | 4 ++-- configure.ac | 47 +++++++++++++++++++++++++++---------- 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/comedi/comedi_kbuild.inc.in b/comedi/comedi_kbuild.inc.in index 4be976f2..c550f68d 100644 --- a/comedi/comedi_kbuild.inc.in +++ b/comedi/comedi_kbuild.inc.in @@ -1,4 +1,4 @@ @CONFIG_COMEDI_RT_TRUE@CONFIG_COMEDI_RT=y @CONFIG_COMEDI_RT_TRUE@CONFIG_COMEDI_RT_MODULES=m -@CONFIG_PCMCIA_TRUE@CONFIG_COMEDI_PCMCIA_MODULES=m -@CONFIG_USB_TRUE@CONFIG_COMEDI_USB_MODULES=m +@CONFIG_COMEDI_PCMCIA_TRUE@CONFIG_COMEDI_PCMCIA_MODULES=m +@CONFIG_COMEDI_USB_TRUE@CONFIG_COMEDI_USB_MODULES=m diff --git a/comedi/drivers/Makefile.am b/comedi/drivers/Makefile.am index 8f545500..b1b27784 100644 --- a/comedi/drivers/Makefile.am +++ b/comedi/drivers/Makefile.am @@ -67,7 +67,7 @@ else rt_modules = endif -if CONFIG_PCMCIA +if CONFIG_COMEDI_PCMCIA pcmcia_modules= \ cb_das16_cs.ko \ das08_cs.ko \ @@ -80,7 +80,7 @@ else pcmcia_modules= endif -if CONFIG_USB +if CONFIG_COMEDI_USB usb_modules= \ usbdux.ko \ usbduxfast.ko \ diff --git a/configure.ac b/configure.ac index 1640f390..db86a8d1 100644 --- a/configure.ac +++ b/configure.ac @@ -67,25 +67,46 @@ CC=$LINUX_CC -DKBUILD_BASENAME=\$(shell basename \$< .c)"] AC_SUBST(COMEDI_CFLAGS) -COMEDI_CHECK_PCMCIA_PROBE([$LINUX_SRC_DIR], [ENABLE_PCMCIA="yes"], [ENABLE_PCMCIA="no"]) -#disable pcmcia by default until someone updates it to current kernel api -ENABLE_PCMCIA="no" +COMEDI_CHECK_PCMCIA_PROBE([$LINUX_SRC_DIR], [HAVE_PCMCIA="yes"], [HAVE_PCMCIA="no"]) +AM_CONDITIONAL([CONFIG_PCMCIA],[test "$HAVE_PCMCIA" = "yes"]) AC_ARG_ENABLE([pcmcia],[ --disable-pcmcia Disable support for PCMCIA devices], - [ENABLE_PCMCIA=$enableval],[]) -if test "$ENABLE_PCMCIA" = "yes" ; then - AS_LINUX_CONFIG_OPTION_MODULE(CONFIG_PCMCIA) + [ENABLE_PCMCIA=$enableval],[ENABLE_PCMCIA="maybe"]) +if test "$HAVE_PCMCIA" = "yes" ; then + if test "$ENABLE_PCMCIA" = "no" ; then + AC_MSG_NOTICE([PCMCIA support disabled]) + USE_PCMCIA="no" + else + AC_DEFINE([CONFIG_COMEDI_PCMCIA],[true],[Define if using PCMCIA support]) + USE_PCMCIA="yes" + fi else - AC_MSG_NOTICE([PCMCIA support disabled]) - AM_CONDITIONAL(CONFIG_PCMCIA,false) + if test "$ENABLE_PCMCIA" = "yes" ; then + AC_MSG_ERROR([Kernel does not support PCMCIA or its API is not suported by Comedi]) + fi + USE_PCMCIA="no" fi +AM_CONDITIONAL([CONFIG_COMEDI_PCMCIA],[test "$USE_PCMCIA" = "yes"]) + +AS_CHECK_LINUX_CONFIG_OPTION([CONFIG_USB],[HAVE_USB="yes"],[HAVE_USB="yes"],[HAVE_USB="no"]) +AM_CONDITIONAL([CONFIG_USB],[test "$HAVE_USB" = "yes"]) AC_ARG_ENABLE([usb],[ --disable-usb Disable support for USB devices], - [ENABLE_USB=$enableval],[ENABLE_USB="yes"]) -if test "$ENABLE_USB" = "yes" ; then - AS_LINUX_CONFIG_OPTION_MODULE(CONFIG_USB) + [ENABLE_USB=$enableval],[ENABLE_USB="maybe"]) +if test "$HAVE_USB" = "yes" ; then + if test "$ENABLE_USB" = "no" ; then + AC_MSG_NOTICE([USB support disabled]) + USE_USB="no" + else + AC_DEFINE([CONFIG_COMEDI_USB],[true],[Define if using USB support]) + USE_USB="yes" + fi else - AC_MSG_NOTICE([USB support disabled]) - AM_CONDITIONAL(CONFIG_USB,false) + if test "$ENABLE_USB" = "yes" ; then + AC_MSG_ERROR([Kernel does not support USB]) + fi + USE_USB="no" fi +AM_CONDITIONAL([CONFIG_COMEDI_USB],[test "$USE_USB" = "yes"]) + COMEDI_CHECK_LINUX_KBUILD([$LINUX_SRC_DIR], [ENABLE_KBUILD="yes"], [ENABLE_KBUILD="no"]) AC_ARG_ENABLE([kbuild], [ --enable-kbuild Force use (or not) of kernel's Kbuild system to build modules (needs recent 2.6 kernel)], [ENABLE_KBUILD=$enableval], []) -- 2.26.2