Whamcloud - gitweb
linux/bit_spinlock.h is not present in some kernels. Introduce configure check
authorgreen <green>
Thu, 22 Jun 2006 14:37:01 +0000 (14:37 +0000)
committergreen <green>
Thu, 22 Jun 2006 14:37:01 +0000 (14:37 +0000)
lustre/autoconf/lustre-core.m4
lustre/include/linux/lustre_dlm.h

index 7b00212..33308da 100644 (file)
@@ -487,6 +487,22 @@ LB_LINUX_TRY_COMPILE([
 ])
 ])
 
+AC_DEFUN([LC_BIT_SPINLOCK_H],
+[LB_CHECK_FILE([$LINUX/include/linux/bit_spinlock.h],[
+       AC_MSG_CHECKING([if bit_spinlock.h can be compiled])
+       LB_LINUX_TRY_COMPILE([
+               #include <linux/spinlock.h>
+               #include <linux/bit_spinlock.h>
+       ],[],[
+               AC_MSG_RESULT([yes])
+               AC_DEFINE(HAVE_BIT_SPINLOCK_H, 1, [Kernel has bit_spinlock.h])
+       ],[
+               AC_MSG_RESULT([no])
+       ])
+],
+[])
+])
+
 #
 # LC_POSIX_ACL_XATTR
 #
@@ -591,6 +607,7 @@ LC_FUNC_PAGE_MAPPED
 LC_STRUCT_FILE_OPS_UNLOCKED_IOCTL
 LC_FILEMAP_POPULATE
 LC_D_ADD_UNIQUE
+LC_BIT_SPINLOCK_H
 LC_XATTR_ACL
 LC_STRUCT_INTENT_FILE
 LC_POSIX_ACL_XATTR_H
index 26a3847..fd9c730 100644 (file)
@@ -12,7 +12,9 @@
 
 #ifdef __KERNEL__
 # include <linux/proc_fs.h>
-# include <linux/bit_spinlock.h>
+# ifdef HAVE_BIT_SPINLOCK_H
+#  include <linux/bit_spinlock.h>
+# endif
 #endif
 
 #endif