From 2844923d62a4c408bd59ddb2caacca4aa7eb86bc Mon Sep 17 00:00:00 2001 From: Markus Duft Date: Wed, 27 Oct 2010 10:39:52 +0200 Subject: 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 Signed-off-by: Junio C Hamano diff --git a/Makefile b/Makefile index 1f1ce04..c9d8c9e 100644 --- a/Makefile +++ b/Makefile @@ -1096,6 +1096,25 @@ else endif X = .exe endif +ifeq ($(uname_S),Interix) + NO_SYS_POLL_H = YesPlease + NO_INTTYPES_H = YesPlease + NO_INITGROUPS = YesPlease + NO_IPV6 = YesPlease + NO_MEMMEM = YesPlease + NO_MKDTEMP = YesPlease + NO_STRTOUMAX = YesPlease + NO_NSEC = YesPlease + NO_MKSTEMPS = YesPlease + ifeq ($(uname_R),3.5) + NO_INET_NTOP = YesPlease + NO_INET_PTON = YesPlease + endif + ifeq ($(uname_R),5.2) + NO_INET_NTOP = YesPlease + NO_INET_PTON = YesPlease + endif +endif ifneq (,$(findstring MINGW,$(uname_S))) pathsep = ; NO_PREAD = YesPlease @@ -1360,6 +1379,15 @@ endif ifdef NO_SYS_SELECT_H BASIC_CFLAGS += -DNO_SYS_SELECT_H endif +ifdef NO_SYS_POLL_H + BASIC_CFLAGS += -DNO_SYS_POLL_H +endif +ifdef NO_INTTYPES_H + BASIC_CFLAGS += -DNO_INTTYPES_H +endif +ifdef NO_INITGROUPS + BASIC_CFLAGS += -DNO_INITGROUPS +endif ifdef NO_MMAP COMPAT_CFLAGS += -DNO_MMAP COMPAT_OBJS += compat/mmap.o diff --git a/daemon.c b/daemon.c index 7ccd097..de59f5d 100644 --- a/daemon.c +++ b/daemon.c @@ -15,6 +15,10 @@ #define NI_MAXSERV 32 #endif +#ifdef NO_INITGROUPS +#define initgroups(x, y) (0) /* nothing */ +#endif + static int log_syslog; static int verbose; static int reuseaddr; diff --git a/git-compat-util.h b/git-compat-util.h index 2af8d3e..625b2e4 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -106,7 +106,11 @@ #include #ifndef __MINGW32__ #include +#ifndef NO_SYS_POLL_H #include +#else +#include +#endif #include #include #include @@ -118,7 +122,11 @@ #include #include #include +#ifndef NO_INTTYPES_H #include +#else +#include +#endif #if defined(__CYGWIN__) #undef _XOPEN_SOURCE #include -- cgit v0.10.2-6-g49f6 From 25fe66f84cea9c2e0a7f6b53180542784b94485a Mon Sep 17 00:00:00 2001 From: Markus Duft Date: Wed, 27 Oct 2010 10:39:53 +0200 Subject: Interix: add configure checks * check for sys/poll.h. define NO_SYS_POLL_H otherwise. * check for inttypes.h, define NO_INTTYPES_H otherwise. * check for initgroups(), define NO_INITGROUPS otherwise. Signed-off-by: Markus Duft Signed-off-by: Junio C Hamano diff --git a/configure.ac b/configure.ac index cc55b6d..c5bc9a0 100644 --- a/configure.ac +++ b/configure.ac @@ -617,6 +617,18 @@ AC_CHECK_HEADER([sys/select.h], [NO_SYS_SELECT_H=UnfortunatelyYes]) AC_SUBST(NO_SYS_SELECT_H) # +# Define NO_SYS_POLL_H if you don't have sys/poll.h +AC_CHECK_HEADER([sys/poll.h], +[NO_SYS_POLL_H=], +[NO_SYS_POLL_H=UnfortunatelyYes]) +AC_SUBST(NO_SYS_POLL_H) +# +# Define NO_INTTYPES_H if you don't have inttypes.h +AC_CHECK_HEADER([inttypes.h], +[NO_INTTYPES_H=], +[NO_INTTYPES_H=UnfortunatelyYes]) +AC_SUBST(NO_INTTYPES_H) +# # Define OLD_ICONV if your library has an old iconv(), where the second # (input buffer pointer) parameter is declared with type (const char **). AC_DEFUN([OLDICONVTEST_SRC], [[ @@ -868,6 +880,12 @@ GIT_CHECK_FUNC(mkstemps, [NO_MKSTEMPS=YesPlease]) AC_SUBST(NO_MKSTEMPS) # +# Define NO_INITGROUPS if you don't have initgroups in the C library. +GIT_CHECK_FUNC(initgroups, +[NO_INITGROUPS=], +[NO_INITGROUPS=YesPlease]) +AC_SUBST(NO_INITGROUPS) +# # # Define NO_MMAP if you want to avoid mmap. # -- cgit v0.10.2-6-g49f6