summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLibravatar Brian Gernhardt <benji@silverinsanity.com>2009-03-08 16:04:28 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2009-03-08 14:04:41 -0700
commitc567383b1e3205c895b371d42a39fbdf131032ba (patch)
tree4ebd878ee331e14ec5b7a165b53799917af833d6 /Makefile
parentNot all systems use st_[cm]tim field for ns resolution file timestamp (diff)
downloadtgif-c567383b1e3205c895b371d42a39fbdf131032ba.tar.xz
Create USE_ST_TIMESPEC and turn it on for Darwin
Not all OSes use st_ctim and st_mtim in their struct stat. In particular, it appears that OS X uses st_*timespec instead. So add a Makefile variable and #define called USE_ST_TIMESPEC to switch the USE_NSEC defines to use st_*timespec. This also turns it on by default for OS X (Darwin) machines. Likely this is a sane default for other BSD kernels as well, but I don't have any to test that assumption on. Signed-off-by: Brian Gernhardt <benji@silverinsanity.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 7 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 65b5b8a63f..7b310859e9 100644
--- a/Makefile
+++ b/Makefile
@@ -126,6 +126,9 @@ all::
# randomly break unless your underlying filesystem supports those sub-second
# times (my ext3 doesn't).
#
+# Define USE_ST_TIMESPEC if your "struct stat" uses "st_ctimespec" instead of
+# "st_ctim"
+#
# Define NO_NSEC if your "struct stat" does not have "st_ctim.tv_nsec"
# available. This automatically turns USE_NSEC off.
#
@@ -663,6 +666,7 @@ ifeq ($(uname_S),Darwin)
endif
NO_MEMMEM = YesPlease
THREADED_DELTA_SEARCH = YesPlease
+ USE_ST_TIMESPEC = YesPlease
endif
ifeq ($(uname_S),SunOS)
NEEDS_SOCKET = YesPlease
@@ -928,6 +932,9 @@ endif
ifdef NO_ST_BLOCKS_IN_STRUCT_STAT
BASIC_CFLAGS += -DNO_ST_BLOCKS_IN_STRUCT_STAT
endif
+ifdef USE_ST_TIMESPEC
+ BASIC_CFLAGS += -DUSE_ST_TIMESPEC
+endif
ifdef NO_NSEC
BASIC_CFLAGS += -DNO_NSEC
endif