libafs: Initialize _settok_tokenCell primary flag
[openafs.git] / acinclude.m4
index 8041547..eb158ed 100644 (file)
@@ -59,7 +59,6 @@ AH_BOTTOM([
 #undef RECALC_SIGPENDING_TAKES_VOID
 #undef STRUCT_FS_HAS_FS_ROLLED
 #undef ssize_t
-#undef HAVE_ARPA_NAMESER_COMPAT_H
 /* glue for RedHat kernel bug */
 #undef ENABLE_REDHAT_BUILDSYS
 #if defined(ENABLE_REDHAT_BUILDSYS) && defined(KERNEL) && defined(REDHAT_FIX)
@@ -813,7 +812,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                                     [struct timespec s;
                                      s = current_kernel_time();])
                 AC_CHECK_LINUX_FUNC([d_alloc_anon],
-                                    [#include <linux/dcache.h>],
+                                    [#include <linux/fs.h>],
                                     [d_alloc_anon(NULL);])
                 AC_CHECK_LINUX_FUNC([do_sync_read],
                                     [#include <linux/fs.h>],
@@ -848,6 +847,10 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 AC_CHECK_LINUX_FUNC([pagevec_lru_add_file],
                                     [#include <linux/pagevec.h>],
                                     [__pagevec_lru_add_file(NULL);])
+                AC_CHECK_LINUX_FUNC([path_lookup],
+                                    [#include <linux/fs.h>
+                                     #include <linux/namei.h>],
+                                    [path_lookup(NULL, 0, NULL);])
                 AC_CHECK_LINUX_FUNC([rcu_read_lock],
                                     [#include <linux/rcupdate.h>],
                                     [rcu_read_lock();])
@@ -904,6 +907,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_INIT_WORK_HAS_DATA
                 LINUX_REGISTER_SYSCTL_TABLE_NOFLAG
                 LINUX_HAVE_DCACHE_LOCK
+                LINUX_D_COUNT_IS_INT
 
                 dnl If we are guaranteed that keyrings will work - that is
                 dnl  a) The kernel has keyrings enabled
@@ -1213,18 +1217,24 @@ AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_HEADER_DIRENT
 AC_CHECK_HEADERS([ \
+                  arpa/inet.h \
+                  arpa/nameser.h \
                   curses.h\
                   direct.h \
                   et/com_err.h \
                   errno.h \
                   fcntl.h \
                   grp.h \
+                  math.h \
                   mntent.h \
                   ncurses.h \
+                  net/if.h \
                   netdb.h \
                   netinet/in.h \
+                  pwd.h \
                   regex.h \
-                  security/pam_modules.h \
+                  resolv.h \
+                  security/pam_appl.h \
                   signal.h \
                   stdint.h \
                   stdio_ext.h \
@@ -1233,23 +1243,29 @@ AC_CHECK_HEADERS([ \
                   strings.h \
                   sys/bitypes.h \
                   sys/bswap.h \
+                  sys/dk.h \
                   sys/fcntl.h \
                   sys/file.h \
                   sys/fs_types.h \
                   sys/fstyp.h \
                   sys/ioctl.h \
                   sys/ipc.h \
+                  sys/lockf.h \
+                  sys/map.h \
                   sys/mount.h \
                   sys/mntent.h \
                   sys/mnttab.h \
                   sys/pag.h \
                   sys/param.h \
                   sys/resource.h \
+                  sys/select.h \
                   sys/statfs.h \
                   sys/statvfs.h \
                   sys/socket.h \
+                  sys/sysctl.h \
                   sys/time.h \
                   sys/types.h \
+                  sys/uio.h \
                   sys/un.h \
                   sys/vfs.h \
                   syslog.h \
@@ -1259,6 +1275,14 @@ AC_CHECK_HEADERS([ \
                   unistd.h \
                   windows.h \
                ])
+AC_CHECK_HEADERS([netinet/if_ether.h],[],[],[AC_INCLUDES_DEFAULT
+#ifdef HAVE_NET_IF_H
+# include <net/if.h>
+#endif])
+AC_CHECK_HEADERS([security/pam_modules.h],[],[],[AC_INCLUDES_DEFAULT
+#ifdef HAVE_SECURITY_PAM_APPL_H
+# include <security/pam_appl.h>
+#endif])
 
 AC_CHECK_HEADERS(linux/errqueue.h,,,[#include <linux/types.h>])
 
@@ -1312,7 +1336,7 @@ AC_SUBST(BUILD_LOGIN)
 
 AC_CHECK_FUNCS([ \
        arc4random \
-       flock \
+       fcntl \
        fseeko64 \
        ftello64 \
        getcwd \
@@ -1326,8 +1350,10 @@ AC_CHECK_FUNCS([ \
        mkstemp \
        pread \
        preadv \
+       preadv64 \
        pwrite \
        pwritev \
+       pwritev64 \
        regcomp \
        regerror \
        regexec \
@@ -1337,6 +1363,8 @@ AC_CHECK_FUNCS([ \
        sigaction \
        strcasestr \
        strerror \
+       sysconf \
+       sysctl \
        timegm \
 ])
 
@@ -1348,19 +1376,19 @@ dnl haven't found a need for yet, and so haven't imported
 AC_CHECK_FUNCS([ \
        chown \
        fchown \
-       getdtablesize \
        gethostname \
-       gettimeofday \
-       localtime_r \
        lstat \
        inet_aton \
        inet_ntop \
        inet_pton \
+       putenv \
        readv \
+       setenv \
        strdup \
        strftime \
        strndup \
        strsep \
+       unsetenv \
 ])
 
 dnl Functions that are in objects that we always build from libroken
@@ -1381,14 +1409,22 @@ AC_REPLACE_FUNCS([ \
        erealloc \
        err \
        errx \
+       flock \
+       getdtablesize \
        getopt \
        getprogname \
+       gettimeofday \
+       localtime_r \
        mkstemp \
        strcasecmp \
        strlcat \
        strnlen \
        strlcpy \
        strsep \
+       tdelete \
+       tfind \
+       tsearch \
+       twalk \
        verr \
        verrx \
        vsyslog \
@@ -1401,6 +1437,7 @@ AC_REPLACE_FUNCS([ \
 dnl Headers that we're going to try and get from libroken
 AC_CHECK_HEADERS([ \
        err.h \
+       search.h \
 ])
 
 AC_CHECK_DECLS([h_errno], [], [], [
@@ -1448,22 +1485,29 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([#ifdef HAVE_SYS_TYPES_H
 ],
 [AC_MSG_RESULT(no)])
 
-AC_MSG_CHECKING([for positional I/O])
-if test "$ac_cv_func_pread" = "yes" && \
-        test "$ac_cv_func_pwrite" = "yes"; then
-   AC_DEFINE(HAVE_PIO, 1, [define if you have pread() and pwrite()])
-   AC_MSG_RESULT(yes)
-else
-  AC_MSG_RESULT(no)
-fi
-AC_MSG_CHECKING([for vectored positional I/O])
-if test "$ac_cv_func_preadv" = "yes" && \
-        test "$ac_cv_func_pwritev" = "yes"; then
-   AC_DEFINE(HAVE_PIOV, 1, [define if you have preadv() and pwritev()])
-   AC_MSG_RESULT(yes)
-else
-  AC_MSG_RESULT(no)
-fi
+case $AFS_SYSNAME in
+*hp_ux* | *hpux*)
+   AC_MSG_WARN([Some versions of HP-UX have a buggy positional I/O implementation. Forcing no positional I/O.])
+   ;;
+*)
+   AC_MSG_CHECKING([for positional I/O])
+   if test "$ac_cv_func_pread" = "yes" && \
+           test "$ac_cv_func_pwrite" = "yes"; then
+      AC_DEFINE(HAVE_PIO, 1, [define if you have pread() and pwrite()])
+      AC_MSG_RESULT(yes)
+   else
+     AC_MSG_RESULT(no)
+   fi
+   AC_MSG_CHECKING([for vectored positional I/O])
+   AS_IF([test "$ac_cv_func_preadv" = "yes" -a \
+               "$ac_cv_func_pwritev" = "yes" -a \
+              "$ac_cv_func_preadv64" = "yes" -a \
+              "$ac_cv_func_pwritev64" = "yes"],
+        [AC_DEFINE(HAVE_PIOV, 1, [define if you have preadv() and pwritev()])
+         AC_MSG_RESULT(yes)],
+        [AC_MSG_RESULT(no)])
+   ;;
+esac
 
 AC_MSG_CHECKING([for POSIX regex library])
 if test "$ac_cv_header_regex_h" = "yes" && \
@@ -1669,7 +1713,9 @@ OPENAFS_HAVE_STRUCT_FIELD(DIR, dd_fd, [#include <sys/types.h>
 
 dnl Eventually, this will look for the system one, or for OpenSSL
 LIB_hcrypto="-lafshcrypto"
+LDFLAGS_hcrypto="-L\$(TOP_LIBDIR)"
 AC_SUBST(LIB_hcrypto)
+AC_SUBST(LDFLAGS_hcrypto)
 ])
 
 AC_DEFUN([SUMMARY], [