volser-restore-create-timestamp-not-touched-on-incremental-20031114
[openafs.git] / acinclude.m4
index e67da84..387e500 100644 (file)
@@ -39,6 +39,9 @@ AC_ARG_WITH(dux-kernel-headers,
 AC_ARG_WITH(linux-kernel-headers,
 [  --with-linux-kernel-headers=path            use the kernel headers found at path(optional, defaults to /usr/src/linux)]
 )
+AC_ARG_WITH(bsd-kernel-headers,
+[  --with-bsd-kernel-headers=path      use the kernel headers found at path(optional, defaults to /usr/src/sys)]
+)
 AC_ARG_ENABLE(kernel-module,
 [  --disable-kernel-module                     disable compilation of the kernel module (defaults to enabled)],, enable_kernel_module="yes"
 )
@@ -107,10 +110,10 @@ case $system in
                   fi
                 fi
                 if test -f "$LINUX_KERNEL_PATH/include/linux/version.h"; then
-                 linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -1`
+                 linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1`
                  if test "x$linux_kvers" = "x"; then
                    if test -f "$LINUX_KERNEL_PATH/include/linux/version-up.h"; then
-                     linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -1`
+                     linux_kvers=`fgrep UTS_RELEASE $LINUX_KERNEL_PATH/include/linux/version-up.h |awk 'BEGIN { FS="\"" } { print $[]2 }'|tail -n 1`
                      if test "x$linux_kvers" = "x"; then
 
                        AC_MSG_ERROR(Linux headers lack version definition [2])
@@ -162,6 +165,7 @@ case $system in
                 LINUX_EXPORTS_TASKLIST_LOCK
                 LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
                 LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
+                LINUX_FS_STRUCT_INODE_HAS_I_ALLOC_SEM
                 LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM
                 LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
                 LINUX_FS_STRUCT_INODE_HAS_I_DEVICES
@@ -251,6 +255,9 @@ case $system in
                 if test "x$ac_cv_linux_fs_struct_inode_has_i_truncate_sem" = "xyes"; then 
                  AC_DEFINE(STRUCT_INODE_HAS_I_TRUNCATE_SEM, 1, [define if your struct inode has truncate_sem])
                 fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_alloc_sem" = "xyes"; then 
+                 AC_DEFINE(STRUCT_INODE_HAS_I_ALLOC_SEM, 1, [define if your struct inode has alloc_sem])
+                fi
                 if test "x$ac_cv_linux_fs_struct_inode_has_i_devices" = "xyes"; then 
                  AC_DEFINE(STRUCT_INODE_HAS_I_DEVICES, 1, [define if you struct inode has i_devices])
                 fi
@@ -355,6 +362,12 @@ else
                i386-unknown-openbsd3.2)
                        AFS_SYSNAME="i386_obsd32"
                        ;;
+               i386-unknown-openbsd3.3)
+                       AFS_SYSNAME="i386_obsd33"
+                       ;;
+               i386-unknown-openbsd3.4)
+                       AFS_SYSNAME="i386_obsd34"
+                       ;;
                i?86-*-freebsd4.2*)
                        AFS_SYSNAME="i386_fbsd_42"
                        ;;
@@ -376,6 +389,12 @@ else
                i?86-*-freebsd5.0*)
                        AFS_SYSNAME="i386_fbsd_50"
                        ;;
+               i?86-*-freebsd5.1*)
+                       AFS_SYSNAME="i386_fbsd_51"
+                       ;;
+               i?86-*-freebsd5.2*)
+                       AFS_SYSNAME="i386_fbsd_52"
+                       ;;
                i?86-*-netbsd*1.5*)
                        AFS_PARAM_COMMON=param.nbsd15.h
                        AFS_SYSNAME="i386_nbsd15"
@@ -551,16 +570,39 @@ else
                        fi
                        _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/XX\$/$AFS_SYSKVERS/`
                        AFS_SYSNAME="$_AFS_SYSNAME"
-                       AFS_ISUML=`echo $LINUX_VERSION | awk 'BEGIN {FS="-[[0-9]]+"} {print $[]2}'`
-                       if test "x${AFS_ISUML}" = "xum"; then
+                       save_CPPFLAGS="$CPPFLAGS"
+                       CPPFLAGS="-I${LINUX_KERNEL_PATH}/include $CPPFLAGS"
+                       AC_TRY_COMPILE(
+                        [#include <linux/autoconf.h>],
+                        [#ifndef CONFIG_USERMODE
+                         #error not UML
+                         #endif],
+                        ac_cv_linux_is_uml=yes,)
+                       if test "${ac_cv_linux_is_uml}" = yes; then
                         _AFS_SYSNAME=`echo $AFS_SYSNAME|sed s/linux/umlinux/`
                        fi
+                       CPPFLAGS="$save_CPPFLAGS"
                        AFS_SYSNAME="$_AFS_SYSNAME"
                        ;;
        esac
         AC_MSG_RESULT($AFS_SYSNAME)
 fi
 
+# KDUMP64 defaults to KDUMP for systems without a separate kdump64
+KDUMP64='${KDUMP}'
+KDUMP=kdump
+case $AFS_SYSNAME in
+       sgi_6?)
+               KDUMP=kdump.IP20;;
+       sun4x_5[789] | hp_ux11*)
+               KDUMP=kdump32
+               KDUMP64=kdump64;;
+       *linux*)
+               KDUMP='kdump-${LINUX_VERSION}';;
+esac
+AC_SUBST(KDUMP)
+AC_SUBST(KDUMP64)
+
 case $AFS_SYSNAME in
        *_darwin*)
                DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist
@@ -694,6 +736,12 @@ if test "$enable_insecure" = "yes"; then
        WITH_INSECURE=YES
 fi
 
+if test "x$with_bsd_kernel_headers" != "x"; then
+       BSD_KERNEL_PATH="$with_bsd_kernel_headers"
+else
+       BSD_KERNEL_PATH="/usr/src/sys"
+fi
+
 # Fast restart
 if test "$enable_supergroups" = "yes"; then
        AC_DEFINE(SUPERGROUPS, 1, [define if you want to have support for nested pts groups])
@@ -758,10 +806,30 @@ AC_CHECK_HEADERS(netinet/in.h netdb.h sys/fcntl.h sys/mnttab.h sys/mntent.h)
 AC_CHECK_HEADERS(mntent.h sys/vfs.h sys/param.h sys/fs_types.h sys/fstyp.h)
 AC_CHECK_HEADERS(sys/mount.h strings.h termios.h signal.h)
 AC_CHECK_HEADERS(windows.h malloc.h winsock2.h direct.h io.h)
-AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h ucontext.h)
+AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h ucontext.h regex.h)
 
-AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf re_comp re_exec)
-AC_CHECK_FUNCS(setprogname getprogname sigaction mkstemp vsnprintf)
+if test "$ac_cv_header_security_pam_modules_h" = "yes"; then
+       HAVE_PAM="yes"
+else
+       HAVE_PAM="no"
+fi
+AC_SUBST(HAVE_PAM)
+
+AC_CHECK_FUNCS(utimes random srandom getdtablesize snprintf strlcat strlcpy re_comp re_exec)
+AC_CHECK_FUNCS(setprogname getprogname sigaction mkstemp vsnprintf strerror)
+
+AC_CHECK_FUNCS(regcomp regexec regerror)
+AC_MSG_CHECKING([for POSIX regex library])
+if test "$ac_cv_header_regex_h" = "yes" && \
+       test "$ac_cv_func_regcomp" = "yes" && \
+       test "$ac_cv_func_regexec" = "yes" && \
+       test "$ac_cv_func_regerror" = "yes"; then
+    AC_DEFINE(HAVE_POSIX_REGEX, 1, [define if you have POSIX regex library])
+    AC_MSG_RESULT(yes)
+else
+    AC_MSG_RESULT(no)
+fi
+       
 AC_CHECK_TYPE(ssize_t, int)
 AC_SIZEOF_TYPE(long)
 
@@ -814,6 +882,7 @@ AC_SUBST(AFS_PARAM_COMMON)
 AC_SUBST(ENABLE_KERNEL_MODULE)
 AC_SUBST(LIB_AFSDB)
 AC_SUBST(LINUX_KERNEL_PATH)
+AC_SUBST(BSD_KERNEL_PATH)
 AC_SUBST(LINUX_VERSION)
 AC_SUBST(MKAFS_OSTYPE)
 AC_SUBST(TOP_OBJDIR)
@@ -847,5 +916,10 @@ if test "${DEST}x" = "x"; then
         DEST="${SRCDIR_PARENT}/${AFS_SYSNAME}/dest"
 fi
 
+HELPER_SPLINT="${TOP_SRCDIR}/helper-splint.sh"
+HELPER_SPLINTCFG="${TOP_SRCDIR}/splint.cfg"
+AC_SUBST(HELPER_SPLINT)
+AC_SUBST(HELPER_SPLINTCFG)
+
 
 ])