vlserver-header-updates-20010711
[openafs.git] / configure.in
index b5a320f..95424f5 100644 (file)
@@ -21,6 +21,9 @@ AC_ARG_ENABLE( fast-restart,
 [  --enable-fast-restart               enable fast startup of file server without salvaging],, enable_fast_restart="no")
 AC_ARG_ENABLE( bitmap-later,
 [  --enable-bitmap-later               enable fast startup of file server by not reading bitmap till needed],, enable_bitmap_later="no")
+AC_ARG_WITH(dux-kernel-headers,
+[  --with-dux-kernel-headers=path      use the kernel headers found at path(optional, defaults to first match in /usr/sys)]
+)
 AC_ARG_WITH(linux-kernel-headers,
 [  --with-linux-kernel-headers=path            use the kernel headers found at path(optional, defaults to /usr/src/linux)]
 )
@@ -71,18 +74,33 @@ case $system in
                    LINUX_VERSION="$linux_kvers"
                  fi
                 else
+                    enable_kernel_module="no"
+                 fi
+                if test ! -f "$LINUX_KERNEL_PATH/include/linux/autoconf.h"; then
+                    enable_kernel_module="no"
+                fi
+                if test "x$enable_kernel_module" = "xno"; then
                  if test "x$with_linux_kernel_headers" != "x"; then
-                  AC_MSG_ERROR(No linux headers found at $LINUX_KERNEL_PATH)
+                  AC_MSG_ERROR(No usable linux headers found at $LINUX_KERNEL_PATH)
                   exit 1
                  else
-                  AC_MSG_WARN(No linux headers found at $LINUX_KERNEL_PATH so disabling kernel module)
-                  enable_kernel_module="no"
+                  AC_MSG_WARN(No usable linux headers found at $LINUX_KERNEL_PATH so disabling kernel module)
+                 fi
                 fi
                fi
                AC_MSG_RESULT(linux)
                if test "x$enable_kernel_module" = "xyes"; then
                 LINUX_FS_STRUCT_INODE_HAS_I_BYTES
                 LINUX_INODE_SETATTR_RETURN_TYPE
+                LINUX_NEED_RHCONFIG
+                LINUX_WHICH_MODULES
+                if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
+                 AC_DEFINE(INODE_SETATTR_NOT_VOID)
+                fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_bytes" = "xyes"; then 
+                 AC_DEFINE(STRUCT_INODE_HAS_I_BYTES)
+                fi
+                :
                fi
                 ;;
         *-solaris*)
@@ -104,6 +122,17 @@ case $system in
         *-osf*)
                MKAFS_OSTYPE=DUX
                 AC_MSG_RESULT(alpha_dux)
+               if test "x$enable_kernel_module" = "xyes"; then
+                if test "x$with_dux_kernel_headers" != "x"; then
+                  HEADER_RT=`ls ${with_dux_kernel_headers}/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
+                else
+                  HEADER_RT=`ls /usr/sys/*/rt_preempt.h | head -1 | sed 's,/rt_preempt.h,,;s,/usr/sys/,,'`
+                fi
+               fi
+               if test "$HEADER_RT" = "*" ; then
+                       AC_MSG_ERROR([Need a configured kernel directory])
+               fi
+               AC_SUBST([HEADER_RT])
                 ;;
         *-darwin*)
                MKAFS_OSTYPE=DARWIN
@@ -178,7 +207,7 @@ if test "x$PTHREAD_LIBS" = xerror; then
         AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="")
 fi
 if test "x$PTHREAD_LIBS" = xerror; then
-        AC_MSG_ERROR(*** Unable to locate working posix thread library ***)
+        AC_MSG_WARN(*** Unable to locate working posix thread library ***)
 fi
 AC_SUBST(PTHREAD_LIBS)