Added automake conditionals CONFIG_COMEDI_USB and CONFIG_COMEDI_PCMCIA and
authorIan Abbott <abbotti@mev.co.uk>
Thu, 10 Apr 2008 09:57:29 +0000 (09:57 +0000)
committerIan Abbott <abbotti@mev.co.uk>
Thu, 10 Apr 2008 09:57:29 +0000 (09:57 +0000)
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
comedi/drivers/Makefile.am
configure.ac

index 4be976f2ba45046d97b493619b5016c062d424ac..c550f68d414c0463737a70cb94f7a4b66582957f 100644 (file)
@@ -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
index 8f5455004c3e6e929809e31bbf470594016a4348..b1b27784308c2785cdd53554cc296c5611fff51e 100644 (file)
@@ -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 \
index 1640f390e006b4020b0d50ffd9c7b0ca4d1e831d..db86a8d1833d0f4db3c0ad595b041464cfa8b996 100644 (file)
@@ -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], [])