add support for the SUA layer (interix; windows)
* add required build options to Makefile. * introduce new NO_INTTYPES_H for systems lacking inttypes; code includes stdint.h instead, if this is set. * introduce new NO_SYS_POLL_H for systems lacking sys/poll.h; code includes poll.h instead, if this is set. * introduce NO_INITGROUPS. initgroups() call is simply omitted. Signed-off-by: Markus Duft <mduft@gentoo.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Markus Duft committed
Oct 27, 2010 at 10:39 UTC
2844923d62a4c408bd59ddb2caacca4aa7eb86bc
3 files changed
+40
Makefile
+28
@@ -1096,6 +1096,25 @@ else
1096
endif
1097
X = .exe
1098
endif
1099
+ifeq ($(uname_S),Interix)
1100
+ NO_SYS_POLL_H = YesPlease
1101
+ NO_INTTYPES_H = YesPlease
1102
+ NO_INITGROUPS = YesPlease
1103
+ NO_IPV6 = YesPlease
1104
+ NO_MEMMEM = YesPlease
1105
+ NO_MKDTEMP = YesPlease
1106
+ NO_STRTOUMAX = YesPlease
1107
+ NO_NSEC = YesPlease
1108
+ NO_MKSTEMPS = YesPlease
1109
+ ifeq ($(uname_R),3.5)
1110
+ NO_INET_NTOP = YesPlease
1111
+ NO_INET_PTON = YesPlease
1112
+ endif
1113
+ ifeq ($(uname_R),5.2)
1114
+ NO_INET_NTOP = YesPlease
1115
+ NO_INET_PTON = YesPlease
1116
+ endif
1117
+endif
1118
ifneq (,$(findstring MINGW,$(uname_S)))
1119
pathsep = ;
1120
NO_PREAD = YesPlease
@@ -1360,6 +1379,15 @@ endif
1379
ifdef NO_SYS_SELECT_H
1380
BASIC_CFLAGS += -DNO_SYS_SELECT_H
1381
endif
1382
+ifdef NO_SYS_POLL_H
1383
+ BASIC_CFLAGS += -DNO_SYS_POLL_H
1384
+endif
1385
+ifdef NO_INTTYPES_H
1386
+ BASIC_CFLAGS += -DNO_INTTYPES_H
1387
+endif
1388
+ifdef NO_INITGROUPS
1389
+ BASIC_CFLAGS += -DNO_INITGROUPS
1390
+endif
1391
ifdef NO_MMAP
1392
COMPAT_CFLAGS += -DNO_MMAP
1393
COMPAT_OBJS += compat/mmap.o
daemon.c
+4
@@ -15,6 +15,10 @@
15
#define NI_MAXSERV 32
16
#endif
17
18
+#ifdef NO_INITGROUPS
19
+#define initgroups(x, y) (0) /* nothing */
20
+#endif
21
+
22
static int log_syslog;
23
static int verbose;
24
static int reuseaddr;
git-compat-util.h
+8
@@ -106,7 +106,11 @@
106
#include <utime.h>
107
#ifndef __MINGW32__
108
#include <sys/wait.h>
109
+#ifndef NO_SYS_POLL_H
110
#include <sys/poll.h>
111
+#else
112
+#include <poll.h>
113
+#endif
114
#include <sys/socket.h>
115
#include <sys/ioctl.h>
116
#include <termios.h>
@@ -118,7 +122,11 @@
122
#include <arpa/inet.h>
123
#include <netdb.h>
124
#include <pwd.h>
125
+#ifndef NO_INTTYPES_H
126
#include <inttypes.h>
127
+#else
128
+#include <stdint.h>
129
+#endif
130
#if defined(__CYGWIN__)
131
#undef _XOPEN_SOURCE
132
#include <grp.h>