LINUX: Avoid unnecessary afs_ShakeLooseVCaches
[openafs.git] / acinclude.m4
index 70b27fd..8375ed8 100644 (file)
@@ -770,6 +770,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 AC_CHECK_LINUX_STRUCT([inode], [i_security], [fs.h])
                 AC_CHECK_LINUX_STRUCT([file_operations], [flock], [fs.h])
                 AC_CHECK_LINUX_STRUCT([file_operations], [sendfile], [fs.h])
+                AC_CHECK_LINUX_STRUCT([file_system_type], [mount], [fs.h])
                 AC_CHECK_LINUX_STRUCT([nameidata], [path], [namei.h])
                 AC_CHECK_LINUX_STRUCT([proc_dir_entry], [owner], [proc_fs.h])
                 AC_CHECK_LINUX_STRUCT([super_block], [s_bdi], [fs.h])
@@ -1206,14 +1207,16 @@ dnl checks for header files.
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_HEADER_DIRENT
-AC_CHECK_HEADERS(stdlib.h string.h unistd.h fcntl.h sys/time.h sys/file.h grp.h)
+AC_CHECK_HEADERS(stdlib.h stdint.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 sys/resource.h sys/un.h)
 AC_CHECK_HEADERS(security/pam_modules.h ucontext.h regex.h sys/statvfs.h sys/statfs.h sys/bitypes.h)
+AC_CHECK_HEADERS(sys/socket.h sys/ioctl.h errno.h time.h syslog.h)
 AC_CHECK_HEADERS(linux/errqueue.h,,,[#include <linux/types.h>])
-AC_CHECK_HEADERS(et/com_err.h)
+AC_CHECK_HEADERS(et/com_err.h stdio_ext.h)
+AC_CHECK_HEADERS(ncurses.h curses.h)
 
 AC_CHECK_TYPES([fsblkcnt_t],,,[
 #include <sys/types.h>
@@ -1228,6 +1231,14 @@ AC_CHECK_TYPES([fsblkcnt_t],,,[
 #endif
 ])
 
+dnl check for curses-lib
+save_LIBS=$LIBS
+AC_CHECK_LIB( [ncurses], [setupterm],
+[LIB_curses=-lncurses],
+[AC_CHECK_LIB([curses], [setupterm], [LIB_curses=-lcurses])])
+LIBS=$save_LIBS
+AC_SUBST(LIB_curses)
+
 OPENAFS_TEST_PACKAGE(libintl,[#include <libintl.h>],[-lintl],,,INTL)
 
 dnl Don't build PAM on IRIX; the interface doesn't work for us.
@@ -1254,7 +1265,6 @@ AC_SUBST(BUILD_LOGIN)
 
 AC_CHECK_FUNCS([ \
        arc4random \
-       daemon \
        flock \
        fseeko64 \
        ftello64 \
@@ -1278,25 +1288,63 @@ AC_CHECK_FUNCS([ \
        setprogname \
        setvbuf \
        sigaction \
-       snprintf \
        strcasestr \
        strerror \
-       strlcat \
-       strlcpy \
        timegm \
+])
+
+OPENAFS_ROKEN()
+OPENAFS_C_ATTRIBUTE()
+
+dnl Functions that Heimdal's libroken provides, but that we
+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 \
+       readv \
+       strdup \
+       strftime \
+       strndup \
+       strsep \
+])
+
+dnl Functions that are in objects that we always build from libroken
+AC_CHECK_FUNCS([ \
+       asprintf \
+       asnprintf \
+       vasprintf \
+       vasnprintf \
        vsnprintf \
-       vsyslog \
+       snprintf \
 ])
 
 dnl Functions that we're going to try and get from libroken
-
 AC_REPLACE_FUNCS([ \
+       daemon \
+       ecalloc \
+       emalloc \
+       erealloc \
        err \
        errx \
+       getopt \
        getprogname \
+       mkstemp \
+       strcasecmp \
+       strlcat \
+       strnlen \
        strlcpy \
+       strsep \
        verr \
        verrx \
+       vsyslog \
        vwarn \
        vwarnx \
        warn \
@@ -1308,9 +1356,18 @@ AC_CHECK_HEADERS([ \
        err.h \
 ])
 
+AC_CHECK_DECLS([h_errno], [], [], [
+#include <sys/types.h>
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+])
+
+AC_HEADER_TIME
+
 ROKEN_HEADERS=
 AS_IF([test "$ac_cv_header_err_h" != "yes" ],
-      [ROKEN_HEADERS="$ROKEN_HEADERS err.h"],
+      [ROKEN_HEADERS="$ROKEN_HEADERS \$(TOP_INCDIR)/err.h"],
       [])
 AC_SUBST(ROKEN_HEADERS)
 
@@ -1362,6 +1419,32 @@ AC_CHECK_TYPE([socklen_t],[],
 [#include <sys/types.h>
 #include <sys/socket.h>])
 AC_CHECK_TYPES(off64_t)
+AC_CHECK_TYPES([ssize_t], [], [], [#include <unistd.h>])
+AC_CHECK_TYPES([struct winsize], [], [], [
+#ifdef HAVE_TERMIOS_H
+# include <termios.h>
+#else
+# include <sys/termios.h>
+#endif
+#include <sys/ioctl.h>])
+AC_CHECK_TYPES([sa_family_t, socklen_t, struct sockaddr,
+               struct sockaddr_storage],
+              [], [], [
+#include <sys/types.h>
+#include <sys/socket.h>
+])
+AC_CHECK_TYPES([sa_family_t], [], [], [
+#include <sys/types.h>
+#include <sys/socket.h>
+])
+AC_CHECK_TYPES([struct addrinfo], [], [], [
+#include <sys/types.h>
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+])
+AC_CHECK_TYPES([long long], [], [], [])
+
 AC_SIZEOF_TYPE(long)
 
 AC_HEADER_PAM_CONST
@@ -1511,3 +1594,17 @@ dnl Eventually, this will look for the system one, or for OpenSSL
 LIB_hcrypto="-lafshcrypto"
 AC_SUBST(LIB_hcrypto)
 ])
+
+AC_DEFUN([SUMMARY], [
+    # Print a configuration summary
+echo 
+echo "**************************************"
+echo configure summary
+echo
+AS_IF([test $LIB_curses],[
+echo "LIB_curses :                $LIB_curses" ],[
+echo "XXX LIB_curses  not found! not building scout and afsmonitor!"
+])
+echo 
+echo "**************************************"
+])