man-page-bash-bashish-20060308
[openafs.git] / acinclude.m4
index a72095f..fd79689 100644 (file)
@@ -24,7 +24,7 @@ AC_ARG_ENABLE( bos-restricted-mode,
 AC_ARG_ENABLE( bos-new-config,
 [  --enable-bos-new-config             enable bosserver pickup of BosConfig.new on restarts],, enable_bos_new_config="no")
 AC_ARG_ENABLE( largefile-fileserver,
-[  --enable-largefile-fileserver        enable large file support in fileserver],, enable_largefile_fileserver="no")
+[  --disable-largefile-fileserver       disable large file support in fileserver],, enable_largefile_fileserver="yes")
 AC_ARG_ENABLE( namei-fileserver,
 [  --enable-namei-fileserver           force compilation of namei fileserver in preference to inode fileserver],, enable_namei_fileserver="no")
 AC_ARG_ENABLE( supergroups,
@@ -180,6 +180,9 @@ case $system in
         *-hpux*)
                MKAFS_OSTYPE=HPUX
                 AC_MSG_RESULT(hp_ux)
+               if test -f "/usr/old/usr/include/ndir.h"; then
+                AC_DEFINE(HAVE_USR_OLD_USR_INCLUDE_NDIR_H, 1, [define if you have old ndir.h])
+               fi
                 ;;
         *-irix*)
                if test -d /usr/include/sys/SN/SN1; then
@@ -207,10 +210,14 @@ case $system in
                fi
                AC_SUBST([HEADER_RT])
                 ;;
-        *-darwin*)
+        powerpc-*-darwin*)
                MKAFS_OSTYPE=DARWIN
                 AC_MSG_RESULT(ppc_darwin)
                 ;;
+        i386-*-darwin*)
+               MKAFS_OSTYPE=DARWIN
+                AC_MSG_RESULT(x86_darwin)
+                ;;
        *-freebsd*)
                MKAFS_OSTYPE=FBSD
                AC_MSG_RESULT(i386_fbsd)
@@ -233,62 +240,17 @@ if test "x$with_afs_sysname" != "x"; then
 else
        AC_MSG_CHECKING(your AFS sysname)
        case $host in
-               i?86-*-openbsd3.1)
-                       AFS_SYSNAME="i386_obsd31"
-                       ;;
-               i?86-*-openbsd3.2)
-                       AFS_SYSNAME="i386_obsd32"
-                       ;;
-               i?86-*-openbsd3.3)
-                       AFS_SYSNAME="i386_obsd33"
-                       ;;
-               i?86-*-openbsd3.4)
-                       AFS_SYSNAME="i386_obsd34"
-                       ;;
-               i?86-*-openbsd3.5)
-                       AFS_SYSNAME="i386_obsd35"
-                       ;;
-               i?86-*-openbsd3.6)
-                       AFS_SYSNAME="i386_obsd36"
-                       ;;
-               i?86-*-openbsd3.7)
-                       AFS_SYSNAME="i386_obsd37"
-                       ;;
-               i?86-*-freebsd4.2*)
-                       AFS_SYSNAME="i386_fbsd_42"
-                       ;;
-               i?86-*-freebsd4.3*)
-                       AFS_SYSNAME="i386_fbsd_43"
-                       ;;
-               i?86-*-freebsd4.4*)
-                       AFS_SYSNAME="i386_fbsd_44"
-                       ;;
-               i?86-*-freebsd4.5*)
-                       AFS_SYSNAME="i386_fbsd_45"
-                       ;;
-               i?86-*-freebsd4.6*)
-                       AFS_SYSNAME="i386_fbsd_46"
-                       ;;
-               i?86-*-freebsd4.7*)
-                       AFS_SYSNAME="i386_fbsd_47"
-                       ;;
-               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-*-freebsd5.3*)
-                       AFS_SYSNAME="i386_fbsd_53"
-                       ;;
-               i?86-*-freebsd5.4*)
-                       AFS_SYSNAME="i386_fbsd_54"
-                       ;;
-               i?86-*-freebsd6.0*)
-                       AFS_SYSNAME="i386_fbsd_60"
+               i?86-*-openbsd?.?)
+                       v=${host#*openbsd}
+                       vM=${v%.*}
+                       vm=${v#*.}
+                       AFS_SYSNAME="i386_obsd${vM}${vm}"
+                       ;;
+               i?86-*-freebsd?.*)
+                       v=${host#*freebsd}
+                       vM=${v%.*}
+                       vm=${v#*.}
+                       AFS_SYSNAME="i386_fbsd_${vM}${vm}"
                        ;;
                i?86-*-netbsd*1.5*)
                        AFS_PARAM_COMMON=param.nbsd15.h
@@ -310,6 +272,10 @@ else
                        AFS_PARAM_COMMON=param.nbsd20.h
                        AFS_SYSNAME="i386_nbsd20"
                        ;;
+               amd64-*-netbsd*2.0*)
+                       AFS_PARAM_COMMON=param.nbsd20.h
+                       AFS_SYSNAME="amd64_nbsd20"
+                       ;;
                powerpc-*-netbsd*2.0*)
                        AFS_PARAM_COMMON=param.nbsd20.h
                        AFS_SYSNAME="ppc_nbsd20"
@@ -420,6 +386,12 @@ else
                powerpc-apple-darwin8.0*)
                        AFS_SYSNAME="ppc_darwin_80"
                        ;;
+               powerpc-apple-darwin8.*)
+                       AFS_SYSNAME="ppc_darwin_80"
+                       ;;
+               i386-apple-darwin8.*)
+                       AFS_SYSNAME="x86_darwin_80"
+                       ;;
                sparc-sun-solaris2.5*)
                        AFS_SYSNAME="sun4x_55"
                        enable_login="yes"
@@ -581,12 +553,15 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_COMPLETION_H_EXISTS
                 LINUX_DEFINES_FOR_EACH_PROCESS
                 LINUX_DEFINES_PREV_TASK
+                LINUX_FS_STRUCT_SUPER_HAS_ALLOC_INODE
                 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
+                LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED
+                LINUX_FS_STRUCT_INODE_HAS_I_MUTEX
                 LINUX_FS_STRUCT_INODE_HAS_I_SB_LIST
                 LINUX_FS_STRUCT_INODE_HAS_I_SECURITY
                 LINUX_FS_STRUCT_INODE_HAS_INOTIFY_LOCK
@@ -610,6 +585,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_RLIM
                 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM
                 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE
+                LINUX_REFRIGERATOR
                 LINUX_WHICH_MODULES
                  if test "x$ac_cv_linux_config_modversions" = "xno" -o $AFS_SYSKVERS -ge 26; then
                    AC_MSG_WARN([Cannot determine sys_call_table status. assuming it isn't exported])
@@ -638,7 +614,8 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                             linux_syscall_method=kallsyms_symbol
                          fi
                          if test "x$linux_syscall_method" = "xnone"; then
-                        AC_MSG_ERROR([no available sys_call_table access method])
+                           AC_MSG_WARN([no available sys_call_table access method -- guessing scan])
+                            linux_syscall_method=scan
                          fi
                    fi
                  fi
@@ -687,6 +664,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 if test "x$ac_cv_linux_func_write_inode_returns_int" = "xyes" ; then
                  AC_DEFINE(WRITE_INODE_NOT_VOID, 1, [define if your sops.write_inode returns non-void])
                 fi
+                if test "x$ac_cv_linux_fs_struct_super_has_alloc_inode" = "xyes" ; then
+                 AC_DEFINE(STRUCT_SUPER_HAS_ALLOC_INODE, 1, [define if your struct super_operations has alloc_inode])
+                fi
                 if test "x$ac_cv_linux_fs_struct_address_space_has_page_lock" = "xyes"; then 
                  AC_DEFINE(STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK, 1, [define if your struct address_space has page_lock])
                 fi
@@ -768,7 +748,7 @@ case $AFS_SYSNAME in
                DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist
                DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist
                 dnl the test below fails on darwin, even if the CPPFLAGS below
-                dnl are added. the headers from Kernel.Framework must be used
+                dnl are added. the headers from Kernel.framework must be used
                 dnl when KERNEL is defined.
 
                 dnl really, such a thing isn't guaranteed to work on any 
@@ -900,6 +880,11 @@ if test "x$PTHREAD_LIBS" = xerror; then
         AC_CHECK_FUNC(pthread_attr_init, PTHREAD_LIBS="")
 fi
 if test "x$PTHREAD_LIBS" = xerror; then
+        # pthread_attr_init is a macro under HPUX 11.0 and 11.11
+        AC_CHECK_LIB(pthread, pthread_attr_destroy,
+                PTHREAD_LIBS="-lpthread")
+fi
+if test "x$PTHREAD_LIBS" = xerror; then
         AC_MSG_WARN(*** Unable to locate working posix thread library ***)
 fi
 AC_SUBST(PTHREAD_LIBS)
@@ -909,6 +894,8 @@ if test "$enable_obsolete" = "yes"; then
        WITH_OBSOLETE=YES
 fi
 
+HOST_CPU="$host_cpu"
+
 if test "x$with_bsd_kernel_headers" != "x"; then
        BSD_KERNEL_PATH="$with_bsd_kernel_headers"
 else
@@ -919,11 +906,11 @@ if test "x$with_bsd_kernel_build" != "x"; then
        BSD_KERNEL_BUILD="$with_bsd_kernel_build"
 else
        case $AFS_SYSNAME in
-               i386_fbsd_4?)
+               *_fbsd_4?)
                        BSD_KERNEL_BUILD="${BSD_KERNEL_PATH}/compile/GENERIC"
                        ;;
-               i386_fbsd_5?)
-                       BSD_KERNEL_BUILD="${BSD_KERNEL_PATH}/i386/compile/GENERIC"
+               *_fbsd_*)
+                       BSD_KERNEL_BUILD="${BSD_KERNEL_PATH}/${HOST_CPU}/compile/GENERIC"
                        ;;
        esac
 fi
@@ -996,7 +983,7 @@ 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 sys/user.h)
-AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h ucontext.h regex.h)
+AC_CHECK_HEADERS(security/pam_modules.h siad.h usersec.h ucontext.h regex.h values.h)
 
 if test "$ac_cv_header_security_pam_modules_h" = yes -a "$enable_pam" = yes; then
        HAVE_PAM="yes"
@@ -1013,7 +1000,7 @@ fi
 AC_SUBST(BUILD_LOGIN)
 
 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(setprogname getprogname sigaction mkstemp vsnprintf strerror strcasestr)
 
 AC_CHECK_FUNCS(regcomp regexec regerror)
 AC_MSG_CHECKING([for POSIX regex library])
@@ -1030,6 +1017,21 @@ fi
 AC_CHECK_TYPE(ssize_t, int)
 AC_SIZEOF_TYPE(long)
 
+AC_MSG_CHECKING(size of time_t)
+AC_CACHE_VAL(ac_cv_sizeof_time_t,
+[AC_TRY_RUN([#include <stdio.h>
+#include <time.h>
+main()
+{
+  FILE *f=fopen("conftestval", "w");
+  if (!f) exit(1);
+  fprintf(f, "%d\n", sizeof(time_t));
+  exit(0);
+}], ac_cv_sizeof_time_t=`cat conftestval`, ac_cv_sizeof_time_t=0)
+])
+AC_MSG_RESULT($ac_cv_sizeof_time_t)
+AC_DEFINE_UNQUOTED(SIZEOF_TIME_T, $ac_cv_sizeof_time_t)
+
 AC_CHECK_FUNCS(timegm)
 AC_CHECK_FUNCS(daemon)
 
@@ -1080,6 +1082,7 @@ AC_SUBST(AFS_PARAM_COMMON)
 AC_SUBST(ENABLE_KERNEL_MODULE)
 AC_SUBST(LIB_AFSDB)
 AC_SUBST(LINUX_KERNEL_PATH)
+AC_SUBST(HOST_CPU)
 AC_SUBST(BSD_KERNEL_PATH)
 AC_SUBST(BSD_KERNEL_BUILD)
 AC_SUBST(LINUX_VERSION)