dnl the versioned AS_LINUX macros just use the global variables
dnl this could be cleaned up later on if we feel like it
case $LINUX_VERSION_MAJOR.$LINUX_VERSION_MINOR in
- 2.6)
+ 2.6 | 3.[[0-9]]*)
AS_LINUX_2_6()
;;
2.[[01234]])
dir=`sed -n -e 's/^KERNELSRC *:= *\(.*\)/\1/p' "$1/Makefile"`
if test -z "$dir"; then
# 2.6.25
- dir=`sed -n -e 's/^MAKEARGS *:= *-C *\(.*\)/\1/p' "$1/Makefile"`
+ dir=`sed -n -e 's/^MAKEARGS *:= *-C *\([[^[:space:]]]*\).*/\1/p' "$1/Makefile"`
fi
if test -z "$dir"; then
AC_MSG_RESULT([no])
#
# 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_DEFUN([COMEDI_CHECK_PCMCIA_DRIVER_PROBE],
[
AC_REQUIRE([AC_PROG_EGREP])
AC_MSG_CHECKING([$1 for probe in pcmcia_driver struct])
fi
])
+# COMEDI_CHECK_PCMCIA_DRIVER_NAME([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel pcmcia support is new enough to have a name member in the pcmcia_driver
+# struct.
+AC_DEFUN([COMEDI_CHECK_PCMCIA_DRIVER_NAME],
+[
+ AC_REQUIRE([AC_PROG_EGREP])
+ AC_MSG_CHECKING([$1 for name in pcmcia_driver struct])
+ cat "$1/include/pcmcia/ds.h" | tr \\n ' ' | [$EGREP "struct[[:space:]]+pcmcia_driver[[:space:]]*[{][^}]*name"] > /dev/null
+ if (($?)); then
+ AC_MSG_RESULT([no])
+ $3
+ else
+ AC_MSG_RESULT([yes])
+ $2
+ fi
+])
+
+# COMEDI_CHECK_PCMCIA_LOOP_TUPLE([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel pcmcia support is new enough to have the pcmcia_loop_tuple
+# function.
+AC_DEFUN([COMEDI_CHECK_PCMCIA_LOOP_TUPLE],
+[
+ AC_MSG_CHECKING([$1 for pcmcia_loop_tuple function])
+ if [grep -q 'int[[:space:]]\+pcmcia_loop_tuple[[:space:]]*(' "$1/include/pcmcia/ds.h"] 2>/dev/null ; then
+ AC_MSG_RESULT([yes])
+ $2
+ else
+ AC_MSG_RESULT([no])
+ $3
+ fi
+])
+
+# COMEDI_CHECK_DS_DEV_NODE_T([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel pcmcia support is old enough to have the dev_node_t type
+# in pcmcia/ds.h.
+AC_DEFUN([COMEDI_CHECK_DS_DEV_NODE_T],
+[
+ AC_MSG_CHECKING([$1 for dev_node_t in pcmcia/ds.h (removed in 2.6.35)])
+ if [grep -q dev_node_t "$1/include/pcmcia/ds.h"] 2>/dev/null ; then
+ AC_MSG_RESULT([yes])
+ $2
+ else
+ AC_MSG_RESULT([no])
+ $3
+ fi
+])
+
+# COMEDI_CHECK_CS_IRQ_REQ_T([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel pcmcia support is old enough to have the irq_req_t type
+# in pcmcia/cs.h.
+AC_DEFUN([COMEDI_CHECK_CS_IRQ_REQ_T],
+[
+ AC_MSG_CHECKING([$1 for irq_req_t in pcmcia/cs.h (removed in 2.6.35)])
+ if [grep -q irq_req_t "$1/include/pcmcia/cs.h"] 2>/dev/null ; then
+ AC_MSG_RESULT([yes])
+ $2
+ else
+ AC_MSG_RESULT([no])
+ $3
+ fi
+])
+
+# COMEDI_CHECK_CS_IO_REQ_T([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel pcmcia support is old enough to have the io_req_t type
+# in pcmcia/cs.h.
+AC_DEFUN([COMEDI_CHECK_CS_IO_REQ_T],
+[
+ AC_MSG_CHECKING([$1 for io_req_t in pcmcia/cs.h (removed in 2.6.36)])
+ if [grep -q io_req_t "$1/include/pcmcia/cs.h"] 2>/dev/null ; then
+ AC_MSG_RESULT([yes])
+ $2
+ else
+ AC_MSG_RESULT([no])
+ $3
+ fi
+])
+
+# COMEDI_CHECK_CS_MEMREQ_T([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel pcmcia support is old enough to have the memreq_t type
+# in pcmcia/cs.h.
+AC_DEFUN([COMEDI_CHECK_CS_MEMREQ_T],
+[
+ AC_MSG_CHECKING([$1 for memreq_t in pcmcia/cs.h (removed in 2.6.36)])
+ if [grep -q memreq_t "$1/include/pcmcia/cs.h"] 2>/dev/null ; then
+ AC_MSG_RESULT([yes])
+ $2
+ else
+ AC_MSG_RESULT([no])
+ $3
+ fi
+])
+
+# COMEDI_CHECK_HAVE_CS_TYPES_H([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel has <pcmcia/cs_types.h> file.
+AC_DEFUN([COMEDI_CHECK_HAVE_CS_TYPES_H],
+[
+ AC_MSG_CHECKING([$1 for include/pcmcia/cs_types.h (removed in 2.6.36)])
+ if test -f "$1/include/pcmcia/cs_types.h"; then
+ AC_MSG_RESULT([yes])
+ $2
+ else
+ AC_MSG_RESULT([no])
+ $3
+ fi
+])
+
+# COMEDI_CHECK_HAVE_CS_H([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel has <pcmcia/cs.h> file.
+AC_DEFUN([COMEDI_CHECK_HAVE_CS_H],
+[
+ AC_MSG_CHECKING([$1 for include/pcmcia/cs.h (removed in 2.6.37)])
+ if test -f "$1/include/pcmcia/cs.h"; then
+ AC_MSG_RESULT([yes])
+ $2
+ else
+ AC_MSG_RESULT([no])
+ $3
+ fi
+])
+
# COMEDI_CHECK_HAVE_MUTEX_H([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# -------------------------------------------------------------
#
$3
fi
])
+
+# COMEDI_CHECK_HAVE_LINUX_SEMAPHORE_H([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel has <linux/semaphore.h> file.
+AC_DEFUN([COMEDI_CHECK_HAVE_LINUX_SEMAPHORE_H],
+[
+ AC_MSG_CHECKING([$1 for include/linux/semaphore.h])
+ if test -f "$1/include/linux/semaphore.h"; then
+ AC_MSG_RESULT([yes])
+ $2
+ else
+ AC_MSG_RESULT([no])
+ $3
+ fi
+])
+
+# COMEDI_CHECK_HAVE_GENERIC_BOOL_TYPE([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+#
+# -------------------------------------------------------------
+# Check if kernel is new enough to have generic 'bool' type in <linux/types.h>
+# and 'false' and 'true' enum constants in <linux/stddef.h>. This was added
+# in vanilla 2.6.19, but backported to RHEL5 2.6.18.
+AC_DEFUN([COMEDI_CHECK_HAVE_GENERIC_BOOL_TYPE],
+[
+ AC_MSG_CHECKING([$1 for 'bool' in include/linux/types.h])
+ if grep -q 'bool;' "$1/include/linux/types.h" 2>/dev/null; then
+ AC_MSG_RESULT([yes])
+ $2
+ else
+ AC_MSG_RESULT([no])
+ $3
+ fi
+])