summaryrefslogtreecommitdiff
path: root/source3/configure.in
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-08-27 15:06:14 -0700
committerJeremy Allison <jra@samba.org>2008-08-27 15:06:14 -0700
commit1cae2ac905cc3e4b6e4c92ec4d64c582cfad8fea (patch)
treec382f2b7aca79306cb45ed77732edcc696857c22 /source3/configure.in
parent34c073c35192850710582b3f558c9fb761e2c24f (diff)
downloadsamba-1cae2ac905cc3e4b6e4c92ec4d64c582cfad8fea.tar.gz
samba-1cae2ac905cc3e4b6e4c92ec4d64c582cfad8fea.tar.bz2
samba-1cae2ac905cc3e4b6e4c92ec4d64c582cfad8fea.zip
Add st_birthtime and friends for accurate create times on systems that support it (*BSD and MacOSX).
Should have done this ages ago, sorry. Jeremy. (This used to be commit 4c3a9558906f213948c3bdc081be73f8fed148cb)
Diffstat (limited to 'source3/configure.in')
-rw-r--r--source3/configure.in90
1 files changed, 90 insertions, 0 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 9436fed1ff..bc5a827b8c 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -1354,6 +1354,96 @@ if test x"$samba_cv_stat_hires_notimespec" = x"yes" ; then
[whether struct stat has sub-second timestamps without struct timespec])
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_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_birthtimensec=no)
+ ])
+
+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_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
+
#####################################
# needed for SRV lookups
AC_CHECK_LIB(resolv, dn_expand)