windows-torture-test-20060625
[openafs.git] / acinclude.m4
index 8755620..f9a7dab 100644 (file)
@@ -16,7 +16,7 @@ AC_ARG_WITH(afs-sysname,
 AC_ARG_ENABLE( obsolete,
 [  --enable-obsolete                   enable obsolete portions of AFS (mpp and package)],, enable_obsolete="no")
 AC_ARG_ENABLE( afsdb,
-[  --disable-afsdb                     disable AFSDB RR support],, enable_afsdb="yes")
+[  --disable-afsdb                     disable AFSDB DNS RR support],, enable_afsdb="yes")
 AC_ARG_ENABLE( pam,
 [  --disable-pam                       disable PAM support],, enable_pam="yes")
 AC_ARG_ENABLE( bos-restricted-mode,
@@ -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,
@@ -33,6 +33,8 @@ 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_ENABLE( demand-attach-fs,
+[  --enable-demand-attach-fs           enable Demand Attach Fileserver (please see documentation)],, enable_demand_attach_fs="no")
 AC_ARG_ENABLE( full-vos-listvol-switch,
 [  --disable-full-vos-listvol-switch    disable vos full listvol switch for formatted output],, enable_full_vos_listvol_switch="yes")
 AC_ARG_WITH(dux-kernel-headers,
@@ -77,6 +79,13 @@ AC_ARG_ENABLE(debug-lwp,
 AC_ARG_ENABLE(optimize-lwp,
 [  --disable-optimize-lwp              disable optimization for compilation of the LWP code (defaults to enabled)],, enable_optimize_lwp="yes"
 )
+AC_ARG_ENABLE(debug-pam,
+[  --enable-debug-pam                  enable compilation of the PAM code with debugging information (defaults to disabled)],, enable_debug_pam="no"
+)
+AC_ARG_ENABLE(optimize-pam,
+[  --disable-optimize-pam              disable optimization for compilation of the PAM code (defaults to enabled)],, enable_optimize_pam="yes"
+)
+
 
 enable_login="no"
 
@@ -180,6 +189,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 +219,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 +249,23 @@ 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}"
+                       ;;
+               sparc64-*-openbsd?.?)
+                       v=${host#*openbsd}
+                       vM=${v%.*}
+                       vm=${v#*.}
+                       AFS_SYSNAME="sparc64_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 +287,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 +401,18 @@ 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"
+                       ;;
+               powerpc-apple-darwin9.*)
+                       AFS_SYSNAME="ppc_darwin_90"
+                       ;;
+               i386-apple-darwin9.*)
+                       AFS_SYSNAME="x86_darwin_90"
+                       ;;
                sparc-sun-solaris2.5*)
                        AFS_SYSNAME="sun4x_55"
                        enable_login="yes"
@@ -494,7 +487,7 @@ else
                i?86-*-linux*)
                        AFS_SYSNAME="i386_linuxXX"
                        ;;
-               parisc-*-linux-gnu)
+               parisc-*-linux-gnu|hppa-*-linux-gnu)
                        AFS_SYSNAME="parisc_linuxXX"
                        enable_pam="no"
                        ;;
@@ -588,6 +581,8 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 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
@@ -611,6 +606,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])
@@ -710,6 +706,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 if test "x$ac_cv_linux_fs_struct_inode_has_i_security" = "xyes"; then 
                  AC_DEFINE(STRUCT_INODE_HAS_I_SECURITY, 1, [define if you struct inode has i_security])
                 fi
+                if test "x$ac_cv_linux_fs_struct_inode_has_i_mutex" = "xyes"; then 
+                 AC_DEFINE(STRUCT_INODE_HAS_I_MUTEX, 1, [define if you struct inode has i_mutex])
+                fi
                 if test "x$ac_cv_linux_fs_struct_inode_has_i_sb_list" = "xyes"; then 
                  AC_DEFINE(STRUCT_INODE_HAS_I_SB_LIST, 1, [define if you struct inode has i_sb_list])
                 fi
@@ -773,7 +772,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 
@@ -891,8 +890,13 @@ else
 fi
 
 PTHREAD_LIBS=error
-AC_CHECK_LIB(pthread, pthread_attr_init,
-             PTHREAD_LIBS="-lpthread")
+if test "x$MKAFS_OSTYPE" = OBSD; then
+        PTHREAD_LIBS="-pthread"
+fi
+if test "x$PTHREAD_LIBS" = xerror; then
+        AC_CHECK_LIB(pthread, pthread_attr_init,
+                PTHREAD_LIBS="-lpthread")
+fi
 if test "x$PTHREAD_LIBS" = xerror; then
         AC_CHECK_LIB(pthreads, pthread_attr_init,
                 PTHREAD_LIBS="-lpthreads")
@@ -905,6 +909,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)
@@ -914,6 +923,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
@@ -924,11 +935,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
@@ -946,6 +957,20 @@ if test "$enable_bitmap_later" = "yes"; then
        AC_DEFINE(BITMAP_LATER, 1, [define if you want to salvager to check bitmasks later])
 fi
 
+if test "$enable_demand_attach_fs" = "yes"; then
+       AC_DEFINE(DEMAND_ATTACH_ENABLE, 1, [define if you want the demand attach fileserver])
+       DEMAND_ATTACH="yes"
+else
+       DEMAND_ATTACH="no"
+fi
+AC_SUBST(DEMAND_ATTACH)
+
+if test "$enable_fast_restart" = "yes" &&
+   test "$enable_demand_attach_fs" = "yes" ; then
+       AC_MSG_ERROR([The Demand Attach and Fast Restart extensions are mutually exclusive.  Demand Attach fileservers automatically salvage volumes in the background, thereby making Fast Restart pointless.])
+       exit 1
+fi
+
 if test "$enable_full_vos_listvol_switch" = "yes"; then
        AC_DEFINE(FULL_LISTVOL_SWITCH, 1, [define if you want to want listvol switch])
 fi
@@ -1001,7 +1026,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"
@@ -1018,8 +1043,9 @@ 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(setvbuf)
+AC_FUNC_SETVBUF_REVERSED
 AC_CHECK_FUNCS(regcomp regexec regerror)
 AC_MSG_CHECKING([for POSIX regex library])
 if test "$ac_cv_header_regex_h" = "yes" && \
@@ -1100,6 +1126,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)