autoconf detection of label support
[openafs.git] / acinclude.m4
index fdb7f3e..5478a22 100644 (file)
@@ -86,47 +86,22 @@ AC_ARG_ENABLE([namei-fileserver],
          fileserver])],
     , 
     [enable_namei_fileserver="default"])
-AC_ARG_ENABLE([cache-bypass],
-    [AS_HELP_STRING([--enable-cache-bypass],
-        [enable client support for cache bypass])],
-    , 
-    [enable_cache_bypass="no"])
 AC_ARG_ENABLE([supergroups],
     [AS_HELP_STRING([--enable-supergroups],
         [enable support for nested pts groups])],
     , 
     [enable_supergroups="no"])
-AC_ARG_ENABLE([fast-restart],
-    [AS_HELP_STRING([--enable-fast-restart],
-        [enable fast startup of file server without salvaging])],
-    , 
-    [enable_fast_restart="no"])
 AC_ARG_ENABLE([bitmap-later],
     [AS_HELP_STRING([--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],
-    [AS_HELP_STRING([--enable-demand-attach-fs],
-        [enable Demand Attach Fileserver (please see documentation)])],
-    , 
-    [enable_demand_attach_fs="no"])
-AC_ARG_ENABLE([disconnected],
-    [AS_HELP_STRING([--enable-disconnected],
-        [enable disconnected support in cache manager (experimental)])],
-    , 
-    [enable_disconnected="no"])
 AC_ARG_ENABLE([unix-sockets],
-    [AS_HELP_STRING([--enable-unix-sockets],
-        [enable use of unix domain sockets for fssync])],
+    [AS_HELP_STRING([--disable-unix-sockets],
+        [disable use of unix domain sockets for fssync (defaults to enabled)])],
     ,
     [enable_unix_sockets="yes"])
-AC_ARG_ENABLE([icmp-pmtu-discovery],
-    [AS_HELP_STRING([--enable-icmp-pmtu-discovery],
-        [enable path MTU discovery by decoding ICMP unreachable replies])],
-    , 
-    [enable_icmp_pmtu_discovery="no"])
 AC_ARG_ENABLE([tivoli-tsm],
     [AS_HELP_STRING([--enable-tivoli-tsm],
         [enable use of the Tivoli TSM API libraries for butc support])],
@@ -140,10 +115,6 @@ AC_ARG_ENABLE([pthreaded-ubik],
     [enable_pthreaded_ubik="no"])
 
 dnl Kernel module build options.
-AC_ARG_WITH([dux-kernel-headers],
-    [AS_HELP_STRING([--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],
     [AS_HELP_STRING([--with-linux-kernel-headers=path],
         [use the kernel headers found at path (optional, defaults to
@@ -290,7 +261,10 @@ AC_PROG_LN_S
 AC_PROG_RANLIB
 AC_PROG_YACC
 AM_PROG_LEX
+dnl if we are flex, be lex-compatible
+OPENAFS_LEX_IS_FLEX([AC_SUBST([LEX], ["$LEX -l"])])
 
+OPENAFS_FORCE_ABS_INSTALL
 OPENAFS_CHECK_BIGENDIAN
 OPENAFS_PRINTF_TAKES_Z_LEN
 
@@ -409,9 +383,9 @@ case $system in
                MKAFS_OSTYPE=AIX
                 AC_MSG_RESULT(rs_aix)
                 ;;
-        *-osf*)
-               MKAFS_OSTYPE=DUX
-                AC_MSG_RESULT(alpha_dux)
+        arm-*-darwin*)
+               MKAFS_OSTYPE=DARWIN
+                AC_MSG_RESULT(arm_darwin)
                 ;;
         powerpc-*-darwin*)
                MKAFS_OSTYPE=DARWIN
@@ -421,6 +395,10 @@ case $system in
                MKAFS_OSTYPE=DARWIN
                 AC_MSG_RESULT(x86_darwin)
                 ;;
+        x86_64-*-darwin*)
+               MKAFS_OSTYPE=DARWIN
+                AC_MSG_RESULT(x86_darwin)
+                ;;
        i386-*-freebsd*)
                MKAFS_OSTYPE=FBSD
                AC_MSG_RESULT(i386_fbsd)
@@ -555,6 +533,9 @@ else
                i?86-apple-darwin10.*)
                        AFS_SYSNAME="x86_darwin_100"
                        ;;
+               x86_64-apple-darwin10.*)
+                       AFS_SYSNAME="x86_darwin_100"
+                       ;;
                sparc-sun-solaris2.5*)
                        AFS_SYSNAME="sun4x_55"
                        enable_login="yes"
@@ -699,6 +680,7 @@ fi
 
 case $AFS_SYSNAME in
        *_darwin*)
+               AC_CHECK_HEADERS(crt_externs.h)
                DARWIN_PLIST=src/libafs/afs.${AFS_SYSNAME}.plist
                DARWIN_INFOFILE=afs.${AFS_SYSNAME}.plist
                ;;
@@ -793,6 +775,8 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 AC_CHECK_LINUX_STRUCT([super_block], [s_bdi], [fs.h])
                 AC_CHECK_LINUX_STRUCT([super_operations], [alloc_inode],
                                       [fs.h])
+                AC_CHECK_LINUX_STRUCT([super_operations], [evict_inode],
+                                      [fs.h])
                  AC_CHECK_LINUX_STRUCT([task_struct], [cred], [sched.h])
                 AC_CHECK_LINUX_STRUCT([task_struct], [exit_state], [sched.h])
                 AC_CHECK_LINUX_STRUCT([task_struct], [parent], [sched.h])
@@ -845,9 +829,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 AC_CHECK_LINUX_FUNC([i_size_read],
                                     [#include <linux/fs.h>],
                                     [i_size_read(NULL);])
-                AC_CHECK_LINUX_FUNC([iget],
+                AC_CHECK_LINUX_FUNC([inode_setattr],
                                     [#include <linux/fs.h>],
-                                    [iget(NULL, NULL);])
+                                    [inode_setattr(NULL, NULL);])
                 AC_CHECK_LINUX_FUNC([kernel_setsockopt],
                                     [#include <linux/net.h>],
                                     [kernel_setsockopt(NULL, 0, 0, NULL, 0);])
@@ -875,9 +859,6 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
 
                 dnl Consequences - things which get set as a result of the
                 dnl                above tests
-                AS_IF([test "x$ac_cv_linux_func_iget" = "xno"],
-                      [AC_DEFINE([LINUX_USE_FH], 1,
-                         [define to use linux file handles for cache files])])
                 AS_IF([test "x$ac_cv_linux_func_d_alloc_anon" = "xno"],
                       [AC_DEFINE([AFS_NONFSTRANS], 1,
                                  [define to disable the nfs translator])])
@@ -897,6 +878,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_IOP_I_PUT_LINK_TAKES_COOKIE
                 LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA
                 LINUX_FOP_F_FLUSH_TAKES_FL_OWNER_T
+                LINUX_FOP_F_FSYNC_TAKES_DENTRY
                 LINUX_AOP_WRITEBACK_CONTROL
                 LINUX_FS_STRUCT_FOP_HAS_SPLICE
                 LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG
@@ -995,6 +977,8 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 fi
                 :
                fi
+dnl Linux-only, but just enable always.
+               AC_DEFINE(AFS_CACHE_BYPASS, 1, [define to activate cache bypassing Unix client])
 esac
 
 AC_CACHE_CHECK([if struct sockaddr has sa_len field],
@@ -1134,26 +1118,10 @@ if test "$enable_supergroups" = "yes"; then
        AC_DEFINE(SUPERGROUPS, 1, [define if you want to have support for nested pts groups])
 fi
 
-if test "$enable_fast_restart" = "yes"; then
-       AC_DEFINE(FAST_RESTART, 1, [define if you want to have fast restart])
-fi
-
 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_disconnected" = "yes"; then
-       AC_DEFINE(AFS_DISCON_ENV, 1, [define if you want support for disconnected operation])
-fi
-
 if test "$enable_unix_sockets" = "yes"; then
        AC_DEFINE(USE_UNIX_SOCKETS, 1, [define if you want to use UNIX sockets for fssync.])
        USE_UNIX_SOCKETS="yes"
@@ -1162,21 +1130,9 @@ else
 fi
 AC_SUBST(USE_UNIX_SOCKETS)
 
-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_icmp_pmtu_discovery" = "yes"; then
-   if test "$ac_cv_setsockopt_iprecverr" = "yes"; then
-       AC_DEFINE(ADAPT_PMTU, 1, [define if you want to decode icmp unreachable packets to discover path mtu])
-   fi
-fi
-
-if test "$enable_cache_bypass" = "yes"; then
-       AC_DEFINE(AFS_CACHE_BYPASS, 1, [define to activate cache bypassing Unix client])
-fi
+dnl if test "$ac_cv_setsockopt_iprecverr" = "yes"; then
+dnl    AC_DEFINE(ADAPT_PMTU, 1, [define if you want to decode icmp unreachable packets to discover path mtu])
+dnl fi
 
 if test "$enable_namei_fileserver" = "yes"; then
        AC_DEFINE(AFS_NAMEI_ENV, 1, [define if you want to want namei fileserver])
@@ -1245,7 +1201,7 @@ AC_CHECK_HEADERS(stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h grp.h)
 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 sys/pag.h)
-AC_CHECK_HEADERS(windows.h direct.h sys/ipc.h)
+AC_CHECK_HEADERS(windows.h direct.h sys/ipc.h sys/resource.h)
 AC_CHECK_HEADERS(security/pam_modules.h ucontext.h regex.h sys/statvfs.h sys/statfs.h sys/bitypes.h)
 AC_CHECK_HEADERS(linux/errqueue.h,,,[#include <linux/types.h>])
 AC_CHECK_HEADERS(et/com_err.h)
@@ -1287,10 +1243,11 @@ else
 fi
 AC_SUBST(BUILD_LOGIN)
 
-AC_CHECK_FUNCS(snprintf strlcat strlcpy flock)
+AC_CHECK_FUNCS(snprintf strlcat strlcpy flock getrlimit)
 AC_CHECK_FUNCS(setprogname getprogname sigaction mkstemp vsnprintf strerror strcasestr)
 AC_CHECK_FUNCS(setvbuf vsyslog getcwd)
 AC_CHECK_FUNCS(regcomp regexec regerror)
+AC_CHECK_FUNCS(fseeko64 ftello64)
 AC_MSG_CHECKING([for POSIX regex library])
 if test "$ac_cv_header_regex_h" = "yes" && \
        test "$ac_cv_func_regcomp" = "yes" && \
@@ -1320,6 +1277,7 @@ AC_CHECK_TYPE([socklen_t],[],
         [Define to int if <sys/socket.h> does not define.])],
 [#include <sys/types.h>
 #include <sys/socket.h>])
+AC_CHECK_TYPES(off64_t)
 AC_SIZEOF_TYPE(long)
 
 AC_HEADER_PAM_CONST
@@ -1400,7 +1358,6 @@ AC_SUBST(HTML_XSL)
 AC_SUBST(XSLTPROC)
 
 OPENAFS_OSCONF
-OPENAFS_KRB5CONF
 OPENAFS_FUSE
 
 TOP_SRCDIR="${srcdir}/src"
@@ -1429,4 +1386,26 @@ AC_SUBST(HELPER_SPLINTCFG)
 
 mkdir -p ${TOP_OBJDIR}/src/JAVA/libjafs
 
+
+dnl Check to see if crypt lives in a different library
+AC_CHECK_LIB(crypt, crypt, LIB_crypt="-lcrypt")
+AC_SUBST(LIB_crypt)
+
+dnl Check to see if the compiler support labels in structs
+AC_MSG_CHECKING(for label support in structs)
+AC_TRY_COMPILE([], [
+extern void osi_UFSOpen(void);
+struct labeltest {
+   void (*open) (void);
+};
+struct labeltest struct_labeltest = {
+   .open       = osi_UFSOpen,
+}
+],
+[AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_STRUCT_LABEL_SUPPORT, 1, [Define to 1 if your compiler supports labels in structs.])
+],
+[AC_MSG_RESULT(no)
+])
+
 ])