From: Ian Abbott Date: Mon, 26 Jul 2010 11:12:19 +0000 (+0000) Subject: Add check for existance of header and define the X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dafee5a9a82de87b91e6feae55c9fdbb336e13c5;p=comedi.git Add check for existance of header and define the CONFIG_COMEDI_HAVE_LINUX_SEMAPHORE_H macro in config.h if present. Note was added in kernel version 2.6.26, replacing . We need a compatibility header for it. --- diff --git a/configure.ac b/configure.ac index 25abece9..dc214f15 100644 --- a/configure.ac +++ b/configure.ac @@ -144,6 +144,10 @@ COMEDI_CHECK_HAVE_MUTEX_H([$LINUX_SRC_DIR], [HAVE_MUTEX_H="yes"], [HAVE_MUTEX_H= 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]) diff --git a/m4/as-linux.m4 b/m4/as-linux.m4 index b0ee39f9..93490891 100644 --- a/m4/as-linux.m4 +++ b/m4/as-linux.m4 @@ -818,3 +818,19 @@ AC_DEFUN([COMEDI_CHECK_HAVE_MUTEX_H], $3 fi ]) + +# COMEDI_CHECK_HAVE_LINUX_SEMAPHORE_H([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# ------------------------------------------------------------- +# +# Check if kernel has 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 +])