amplc_dio200: Protect access to counter subdevices with a spin lock.
[comedi.git] / configure.ac
index 8cc56db533d0d791cfeb4a09a1a986b0cb08d345..7b056f07b7d90e84d90b052c02f2cbb1909c49cf 100644 (file)
@@ -1,5 +1,5 @@
 
-AC_INIT([comedi],[0.7.74])
+AC_INIT([comedi],[0.7.76])
 AC_CONFIG_SRCDIR([comedi/comedi_fops.c])
 AC_CONFIG_HEADERS(config.h)
 
@@ -12,7 +12,7 @@ fi
 PACKAGE=comedi
 COMEDI_MAJORVERSION=0
 COMEDI_MINORVERSION=7
-COMEDI_MICROVERSION=74
+COMEDI_MICROVERSION=76
 # set the nanoversion to 0 for releases, 1 for CVS, >= 2 for prereleases
 COMEDI_NANOVERSION=0
 
@@ -67,31 +67,78 @@ CC=$LINUX_CC
  -DKBUILD_BASENAME=\$(shell basename \$< .c)"]
 AC_SUBST(COMEDI_CFLAGS)
 
-COMEDI_CHECK_PCMCIA_PROBE([$LINUX_DIR], [ENABLE_PCMCIA="yes"], [ENABLE_PCMCIA="no"])
-#disable pcmcia by default until someone updates it to current kernel api
-ENABLE_PCMCIA="no"
+AS_CHECK_LINUX_CONFIG_OPTION([CONFIG_PCI],[HAVE_PCI="yes"],[HAVE_PCI="yes"],[HAVE_PCI="no"])
+AM_CONDITIONAL([CONFIG_PCI],[test "$HAVE_PCI" = "yes"])
+AC_ARG_ENABLE([pci],[  --disable-pci           Disable support for PCI devices],
+       [ENABLE_PCI=$enableval],[ENABLE_PCI="maybe"])
+if test "$HAVE_PCI" = "yes" ; then
+       if test "$ENABLE_PCI" = "no" ; then
+               AC_MSG_NOTICE([PCI support disabled])
+               USE_PCI="no"
+       else
+               AC_DEFINE([CONFIG_COMEDI_PCI],[true],[Define if PCI support is enabled])
+               USE_PCI="yes"
+       fi
+else
+       if test "$ENABLE_PCI" = "yes" ; then
+               AC_MSG_ERROR([Kernel does not support PCI])
+       fi
+       USE_PCI="no"
+fi
+AM_CONDITIONAL([CONFIG_COMEDI_PCI],[test "$USE_PCI" = "yes"])
+
+COMEDI_CHECK_PCMCIA_PROBE([$LINUX_SRC_DIR],
+       [AS_CHECK_LINUX_CONFIG_OPTION([CONFIG_PCMCIA],
+               [HAVE_PCMCIA="yes"],[HAVE_PCMCIA="yes"],[HAVE_PCMCIA="no"])],
+       [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 supported 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
-COMEDI_CHECK_LINUX_KBUILD([$LINUX_DIR], [ENABLE_KBUILD="yes"], [ENABLE_KBUILD="no"])
+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], [])
 AM_CONDITIONAL([CONFIG_KBUILD], [test ${ENABLE_KBUILD} = "yes"])
+COMEDI_CHECK_HAVE_MUTEX_H([$LINUX_SRC_DIR], [HAVE_MUTEX_H="yes"], [HAVE_MUTEX_H="no"])
+if test ${HAVE_MUTEX_H} = "yes" ; then
+       AC_DEFINE([CONFIG_COMEDI_HAVE_MUTEX_H], [true], [Define if Linux kernel has mutex.h header])
+fi
 AS_LINUX_CONFIG_OPTION_MODULE(CONFIG_ISA)
-AS_LINUX_CONFIG_OPTION_MODULE(CONFIG_PCI)
 
 AC_DEFINE(CONFIG_COMEDI_DEBUG, true, [Define if debugging is enabled])
 AC_DEFINE(CONFIG_COMEDI_8255, true, [Define if 8255 support is enabled])