CONFIG_COMEDI_HAVE_LINUX_SEMAPHORE_H macro in config.h if present. Note
<linux/semaphore.h> was added in kernel version 2.6.26, replacing
<asm/semaphore.h>. We need a compatibility header for it.
if test ${HAVE_MUTEX_H} = "yes" ; then
AC_DEFINE([CONFIG_COMEDI_HAVE_MUTEX_H], [true], [Define if Linux kernel has mutex.h header])
fi
+COMEDI_CHECK_HAVE_LINUX_SEMAPHORE_H([$LINUX_SRC_DIR], [HAVE_LINUX_SEMAPHORE_H="yes"], [HAVE_LINUX_SEMAPHORE_H="no"])
+if test ${HAVE_LINUX_SEMAPHORE_H} = "yes" ; then
+ AC_DEFINE([CONFIG_COMEDI_HAVE_LINUX_SEMAPHORE_H], [true], [Define if Linux kernel has linux/semaphore.h header])
+fi
AS_LINUX_CONFIG_OPTION_MODULE(CONFIG_ISA)
AC_DEFINE(CONFIG_COMEDI_DEBUG, true, [Define if debugging is enabled])
$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
+])