the kernel's pcmcia_driver struct has a probe function pointer.
-DKBUILD_BASENAME=\$(shell basename \$< .c)"]
AC_SUBST(COMEDI_CFLAGS)
+COMEDI_CHECK_PCMCIA_PROBE([$LINUX_DIR], [ENABLE_PCMCIA="yes"], [ENABLE_PCMCIA="no"])
AC_ARG_ENABLE([pcmcia],[ --disable-pcmcia Disable support for PCMCIA devices],
- [ENABLE_PCMCIA=$enableval],[ENABLE_PCMCIA="yes"])
+ [ENABLE_PCMCIA=$enableval],[])
if test "$ENABLE_PCMCIA" = "yes" ; then
AS_LINUX_CONFIG_OPTION_MODULE(CONFIG_PCMCIA)
else
fi
fi
])
+
+# COMEDI_CHECK_PCMCIA_PROBE([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel pcmcia support is new enough to have a probe member in the pcmcia_driver
+# struct.
+AC_DEFUN([COMEDI_CHECK_PCMCIA_PROBE],
+[
+ AC_REQUIRE([AC_PROG_EGREP])
+ AC_MSG_CHECKING([$1 for probe in pcmcia_driver struct])
+ cat "$1/include/pcmcia/ds.h" | tr \\n ' ' | [$EGREP "struct[[:space:]]+pcmcia_driver[[:space:]]*[{][^}]*probe"] > /dev/null
+ if (($?)); then
+ AC_MSG_RESULT([no])
+ $3
+ else
+ AC_MSG_RESULT([yes])
+ $2
+ fi
+])