summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas 'Sortie' Termansen <sortie@maxsi.org>2014-08-29 09:42:36 -0700
committerJunio C Hamano <gitster@pobox.com>2014-08-29 12:23:14 -0700
commit2fe4d0abe7bc260967c89353ec18d65c71802bb5 (patch)
treee9e705f4628d9051550baf68a3d5b0c47fea232b
parenta6fd4fb55d255ae14dc3ced5eae6247b4a9d86ea (diff)
downloadgit-2fe4d0abe7bc260967c89353ec18d65c71802bb5.tar.gz
autoconf: check for timer_t
This type will be used in a following commit. This type was not previously used by git. This can cause trouble for people on systems without timer_t if they only rely on config.mak.uname. They will need to set NO_TIMER_T manually. Signed-off-by: Jonas 'Sortie' Termansen <sortie@maxsi.org> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--Makefile5
-rw-r--r--config.mak.uname3
-rw-r--r--configure.ac8
-rw-r--r--git-compat-util.h4
4 files changed, 20 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 2320de592e..4bf02c5c46 100644
--- a/Makefile
+++ b/Makefile
@@ -182,6 +182,8 @@ all::
#
# Define NO_SETITIMER if you don't have setitimer()
#
+# Define NO_TIMER_T if you don't have timer_t.
+#
# Define NO_STRUCT_ITIMERVAL if you don't have struct itimerval
# This also implies NO_SETITIMER
#
@@ -1338,6 +1340,9 @@ endif
ifdef OBJECT_CREATION_USES_RENAMES
COMPAT_CFLAGS += -DOBJECT_CREATION_MODE=1
endif
+ifdef NO_TIMER_T
+ COMPAT_CFLAGS += -DNO_TIMER_T
+endif
ifdef NO_STRUCT_ITIMERVAL
COMPAT_CFLAGS += -DNO_STRUCT_ITIMERVAL
NO_SETITIMER = YesPlease
diff --git a/config.mak.uname b/config.mak.uname
index 15ee15e98c..c14aba3e6b 100644
--- a/config.mak.uname
+++ b/config.mak.uname
@@ -98,6 +98,7 @@ ifeq ($(uname_S),Darwin)
NO_MEMMEM = YesPlease
USE_ST_TIMESPEC = YesPlease
HAVE_DEV_TTY = YesPlease
+ NO_TIMER_T = UnfortunatelyYes
COMPAT_OBJS += compat/precompose_utf8.o
BASIC_CFLAGS += -DPRECOMPOSE_UNICODE
endif
@@ -355,6 +356,7 @@ ifeq ($(uname_S),Windows)
NATIVE_CRLF = YesPlease
DEFAULT_HELP_FORMAT = html
NO_D_INO_IN_DIRENT = YesPlease
+ NO_TIMER_T = UnfortunatelyYes
CC = compat/vcbuild/scripts/clink.pl
AR = compat/vcbuild/scripts/lib.pl
@@ -504,6 +506,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_POSIX_GOODIES = UnfortunatelyYes
DEFAULT_HELP_FORMAT = html
NO_D_INO_IN_DIRENT = YesPlease
+ NO_TIMER_T = UnfortunatelyYes
COMPAT_CFLAGS += -D__USE_MINGW_ACCESS -D_USE_32BIT_TIME_T -DNOGDI -Icompat -Icompat/win32
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
COMPAT_OBJS += compat/mingw.o compat/winansi.o \
diff --git a/configure.ac b/configure.ac
index 6af964797f..126af58365 100644
--- a/configure.ac
+++ b/configure.ac
@@ -754,6 +754,14 @@ AC_CHECK_TYPES([struct itimerval],
[#include <sys/time.h>])
GIT_CONF_SUBST([NO_STRUCT_ITIMERVAL])
#
+# Define NO_TIMER_T if you don't have timer_t.
+AC_CHECK_TYPES([timer_t],
+[NO_TIMER_T=],
+[NO_TIMER_T=UnfortunatelyYes],
+[#include <sys/types.h>
+ #include <time.h>])
+GIT_CONF_SUBST([NO_TIMER_T])
+#
# Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
AC_CHECK_MEMBER(struct dirent.d_ino,
[NO_D_INO_IN_DIRENT=],
diff --git a/git-compat-util.h b/git-compat-util.h
index f7fae20607..e0e7a62b64 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -187,6 +187,10 @@ typedef unsigned long uintptr_t;
extern int compat_mkdir_wo_trailing_slash(const char*, mode_t);
#endif
+#ifdef NO_TIMER_T
+typedef int timer_t;
+#endif
+
#ifdef NO_STRUCT_ITIMERVAL
struct itimerval {
struct timeval it_interval;