summaryrefslogtreecommitdiff
path: root/source3/configure.in
diff options
context:
space:
mode:
Diffstat (limited to 'source3/configure.in')
-rw-r--r--source3/configure.in315
1 files changed, 15 insertions, 300 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 10ce6f6e5e..d11ece1b53 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -703,18 +703,6 @@ CPPFLAGS="$old_CPPFLAGS"
# subdirectory of headers.
AC_CHECK_HEADERS(valgrind.h valgrind/valgrind.h valgrind/memcheck.h)
-# check for linux on amd64 since valgrind is not quite there yet
-case "$host_os" in
- *linux*)
- case "$UNAME_P" in
- *x86_64*)
- AC_DEFINE(HAVE_64BIT_LINUX,1,[Whether we are running on 64bit linux])
- ;;
- esac
- ;;
-esac
-
-
#
# HPUX has a bug in that including shadow.h causes a re-definition of MAXINT.
# This causes configure to fail to detect it. Check for shadow separately on HPUX.
@@ -1041,8 +1029,7 @@ AC_CHECK_FUNCS(getdents64)
AC_CHECK_FUNCS(setenv strcasecmp fcvt fcvtl)
AC_CHECK_FUNCS(syslog vsyslog timegm)
AC_CHECK_FUNCS(setlocale nl_langinfo)
-AC_CHECK_FUNCS(nanosleep)
-AC_CHECK_LIB_EXT(rt, LIBS, nanosleep)
+AC_CHECK_FUNCS(nanosleep,,[AC_CHECK_LIB_EXT(rt, LIBS, nanosleep)])
AC_CHECK_FUNCS(mlock munlock mlockall munlockall)
AC_CHECK_FUNCS(memalign posix_memalign hstrerror)
AC_CHECK_HEADERS(sys/mman.h)
@@ -1311,301 +1298,29 @@ fi
#################################################
# Check whether struct stat has timestamps with sub-second resolution.
-# At least IRIX and Solaris have these. FREEBSD does as well,
-# but with different members
-#
-# We check that
-# all of st_mtim, st_atim and st_ctim exist
-# all of the members are in fact of type struct timespec
#
-# There is some conflicting standards weirdness about whether we should use
-# "struct timespec" or "timespec_t". Linux doesn't have timespec_t, so we
-# prefer struct timespec.
-AC_CACHE_CHECK([whether struct stat has timespec timestamps],
- samba_cv_stat_timespec_hires,
- [
- AC_TRY_COMPILE(
- [
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
- ],
- [
- struct timespec t;
- struct stat s = {0};
- t = s.st_mtimespec;
- t = s.st_ctimespec;
- t = s.st_atimespec;
- ],
- samba_cv_stat_timespec_hires=yes, samba_cv_stat_timespec_hires=no)
- ])
-
-if test x"$samba_cv_stat_timespec_hires" = x"yes" ; then
- AC_DEFINE(HAVE_STAT_ST_MTIMESPEC, 1, [whether struct stat contains st_mtimepec])
- AC_DEFINE(HAVE_STAT_ST_ATIMESPEC, 1, [whether struct stat contains st_atimespec])
- AC_DEFINE(HAVE_STAT_ST_CTIMESPEC, 1, [whether struct stat contains st_ctimespec])
- AC_DEFINE(HAVE_STAT_HIRES_TIMESTAMPS, 1, [whether struct stat has sub-second timestamps])
-fi
-
-
-AC_CACHE_CHECK([whether struct stat has sub-second timestamps], samba_cv_stat_hires,
- [
- AC_TRY_COMPILE(
- [
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
- ],
- [
- struct timespec t;
- struct stat s = {0};
- t.tv_sec = s.st_mtim.tv_sec;
- t.tv_nsec = s.st_mtim.tv_nsec;
- t.tv_sec = s.st_ctim.tv_sec;
- t.tv_nsec = s.st_ctim.tv_nsec;
- t.tv_sec = s.st_atim.tv_sec;
- t.tv_nsec = s.st_atim.tv_nsec;
- ],
- samba_cv_stat_hires=yes, samba_cv_stat_hires=no)
- ])
+samba_cv_stat_hires=no
+AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec], # Linux, Solaris
+ [samba_cv_stat_hires=yes])
+AC_CHECK_MEMBERS([struct stat.st_mtimensec], # BSD, if defined _POSIX_SOURCE
+ [samba_cv_stat_hires=yes])
+AC_CHECK_MEMBERS([struct stat.st_mtimespec.tv_nsec], # BSD, if not defined _POSIX_SOURCE
+ [samba_cv_stat_hires=yes])
+AC_CHECK_MEMBERS([struct stat.st_mtime_n], # AIX
+ [samba_cv_stat_hires=yes])
+AC_CHECK_MEMBERS([struct stat.st_umtime], # Tru64
+ [samba_cv_stat_hires=yes])
if test x"$samba_cv_stat_hires" = x"yes" ; then
- AC_DEFINE(HAVE_STAT_ST_MTIM, 1, [whether struct stat contains st_mtim])
- AC_DEFINE(HAVE_STAT_ST_ATIM, 1, [whether struct stat contains st_atim])
- AC_DEFINE(HAVE_STAT_ST_CTIM, 1, [whether struct stat contains st_ctim])
AC_DEFINE(HAVE_STAT_HIRES_TIMESTAMPS, 1,
[whether struct stat has sub-second timestamps])
fi
-AC_CACHE_CHECK([whether struct stat has sub-second timestamps without struct timespec suffixed nsec], samba_cv_stat_hires_notimespec,
- [
- AC_TRY_COMPILE(
- [
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
- ],
- [
- struct timespec t;
- struct stat s = {0};
- t.tv_sec = s.st_mtime;
- t.tv_nsec = s.st_mtimensec;
- t.tv_sec = s.st_ctime;
- t.tv_nsec = s.st_ctimensec;
- t.tv_sec = s.st_atime;
- t.tv_nsec = s.st_atimensec;
- ],
- samba_cv_stat_hires_notimespec=yes, samba_cv_stat_hires_notimespec=no)
- ])
-
-if test x"$samba_cv_stat_hires_notimespec" = x"yes" ; then
- AC_DEFINE(HAVE_STAT_ST_MTIMENSEC, 1, [whether struct stat contains st_mtimensec])
- AC_DEFINE(HAVE_STAT_ST_ATIMENSEC, 1, [whether struct stat contains st_atimensec])
- AC_DEFINE(HAVE_STAT_ST_CTIMENSEC, 1, [whether struct stat contains st_ctimensec])
- AC_DEFINE(HAVE_STAT_HIRES_TIMESTAMPS, 1,
- [whether struct stat has sub-second timestamps without struct timespec suffixed nsec])
-fi
-
-dnl AIX stype sub-second timestamps:
-AC_CACHE_CHECK([whether struct stat has sub-second timestamps without struct timespec suffixed _n], samba_cv_stat_hires_notimespec_n,
- [
- AC_TRY_COMPILE(
- [
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
- ],
- [
- struct timespec t;
- struct stat s = {0};
- t.tv_sec = s.st_mtime;
- t.tv_nsec = s.st_mtime_n;
- t.tv_sec = s.st_ctime;
- t.tv_nsec = s.st_ctime_n;
- t.tv_sec = s.st_atime;
- t.tv_nsec = s.st_atime_n;
- ],
- samba_cv_stat_hires_notimespec_n=yes, samba_cv_stat_hires_notimespec_n=no)
- ])
-
-if test x"$samba_cv_stat_hires_notimespec_n" = x"yes" ; then
- AC_DEFINE(HAVE_STAT_ST_MTIME_N, 1, [whether struct stat contains st_mtime_n])
- AC_DEFINE(HAVE_STAT_ST_ATIME_N, 1, [whether struct stat contains st_atime_n])
- AC_DEFINE(HAVE_STAT_ST_CTIME_N, 1, [whether struct stat contains st_ctime_n])
- AC_DEFINE(HAVE_STAT_HIRES_TIMESTAMPS, 1,
- [whether struct stat has sub-second timestamps without struct timespec suffixed _n])
-fi
-
-dnl Tru64 has _micro_second_ resolution:
-AC_CACHE_CHECK([whether struct stat has sub-second timestamps in st_uXtime], samba_cv_stat_hires_uxtime,
- [
- AC_TRY_COMPILE(
- [
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
- ],
- [
- struct timespec t;
- struct stat s = {0};
- t.tv_sec = s.st_mtime;
- t.tv_nsec = s.st_umtime * 1000;
- t.tv_sec = s.st_ctime;
- t.tv_nsec = s.st_uctime * 1000;
- t.tv_sec = s.st_atime;
- t.tv_nsec = s.st_uatime * 1000;
- ],
- samba_cv_stat_hires_uxtime=yes, samba_cv_stat_hires_uxtime=no)
- ])
-
-if test x"$samba_cv_stat_hires_uxtime" = x"yes" ; then
- AC_DEFINE(HAVE_STAT_ST_UMTIME, 1, [whether struct stat contains st_umtime])
- AC_DEFINE(HAVE_STAT_ST_UATIME, 1, [whether struct stat contains st_uatime])
- AC_DEFINE(HAVE_STAT_ST_UCTIME, 1, [whether struct stat contains st_uctime])
- AC_DEFINE(HAVE_STAT_HIRES_TIMESTAMPS, 1,
- [whether struct stat has sub-second timestamps in st_uXtime])
-fi
-
-AC_CACHE_CHECK([whether struct stat has st_birthtimespec], samba_cv_stat_st_birthtimespec,
- [
- AC_TRY_COMPILE(
- [
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
- ],
- [
- struct timespec t;
- struct stat s = {0};
- t = s.st_birthtimespec;
- ],
- samba_cv_stat_st_birthtimespec=yes, samba_cv_stat_st_birthtimespec=no)
- ])
-
-if test x"$samba_cv_stat_st_birthtimespec" = x"yes" ; then
- AC_DEFINE(HAVE_STAT_ST_BIRTHTIMESPEC, 1, [whether struct stat contains st_birthtimespec])
-fi
-
-AC_CACHE_CHECK([whether struct stat has st_birthtimensec], samba_cv_stat_st_birthtimensec,
- [
- AC_TRY_COMPILE(
- [
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
- ],
- [
- struct timespec t;
- struct stat s = {0};
- t.tv_nsec = s.st_birthtimensec;
- ],
- samba_cv_stat_st_birthtimensec=yes, samba_cv_stat_st_birthtimensec=no)
- ])
+# recent FreeBSD, NetBSD have creation timestamps called birthtime:
+AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec])
+AC_CHECK_MEMBERS([struct stat.st_birthtime], AC_CHECK_MEMBERS([struct stat.st_birthtimensec]))
-if test x"$samba_cv_stat_st_birthtimensec" = x"yes" ; then
- AC_DEFINE(HAVE_STAT_ST_BIRTHTIMENSEC, 1, [whether struct stat contains st_birthtimensec])
-fi
-
-AC_CACHE_CHECK([whether struct stat has st_birthtime], samba_cv_stat_st_birthtime,
- [
- AC_TRY_COMPILE(
- [
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#else
-# if HAVE_SYS_TIME_H
-# include <sys/time.h>
-# else
-# include <time.h>
-# endif
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
- ],
- [
- struct time_t t;
- struct stat s = {0};
- t = s.st_birthtime;
- ],
- samba_cv_stat_st_birthtime=yes, samba_cv_stat_st_birthtime=no)
- ])
-
-if test x"$samba_cv_stat_st_birthtime" = x"yes" ; then
- AC_DEFINE(HAVE_STAT_ST_BIRTHTIME, 1, [whether struct stat contains st_birthtime])
-fi
AC_CACHE_CHECK([whether there is DOS flags support in the stat struct], samba_cv_stat_dos_flags,
[