Merge branch 'dd/poll-dot-h'
authorJunio C Hamano <gitster@pobox.com>
Mon, 19 Nov 2018 07:24:41 +0000 (16:24 +0900)
committerJunio C Hamano <gitster@pobox.com>
Mon, 19 Nov 2018 07:24:41 +0000 (16:24 +0900)
A build update.

* dd/poll-dot-h:
git-compat-util: prefer poll.h to sys/poll.h

Makefile
configure.ac
git-compat-util.h
index 6579c01f9f119b25353cf883c973dffae45edbe0..d81a53a52257050806ff026c45486e388de89c13 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -210,10 +210,12 @@ all::
 # Define MMAP_PREVENTS_DELETE if a file that is currently mmapped cannot be
 # deleted or cannot be replaced using rename().
 #
+# Define NO_POLL_H if you don't have poll.h.
+#
 # Define NO_SYS_POLL_H if you don't have sys/poll.h.
 #
 # Define NO_POLL if you do not have or don't want to use poll().
-# This also implies NO_SYS_POLL_H.
+# This also implies NO_POLL_H and NO_SYS_POLL_H.
 #
 # Define NEEDS_SYS_PARAM_H if you need to include sys/param.h to compile,
 # *PLEASE* REPORT to git@vger.kernel.org if your platform needs this;
@@ -1456,6 +1458,7 @@ ifdef NO_GETTEXT
        USE_GETTEXT_SCHEME ?= fallthrough
 endif
 ifdef NO_POLL
+       NO_POLL_H = YesPlease
        NO_SYS_POLL_H = YesPlease
        COMPAT_CFLAGS += -DNO_POLL -Icompat/poll
        COMPAT_OBJS += compat/poll/poll.o
@@ -1494,6 +1497,9 @@ endif
 ifdef NO_SYS_SELECT_H
        BASIC_CFLAGS += -DNO_SYS_SELECT_H
 endif
+ifdef NO_POLL_H
+       BASIC_CFLAGS += -DNO_POLL_H
+endif
 ifdef NO_SYS_POLL_H
        BASIC_CFLAGS += -DNO_SYS_POLL_H
 endif
index 44e8c036b6ec417e95ca4e5c2861785900d8634c..e0d0da3c0c9bccb0b6b1b1a5a3db0097f4f10757 100644 (file)
@@ -789,6 +789,12 @@ AC_CHECK_HEADER([sys/select.h],
 [NO_SYS_SELECT_H=UnfortunatelyYes])
 GIT_CONF_SUBST([NO_SYS_SELECT_H])
 #
+# Define NO_POLL_H if you don't have poll.h
+AC_CHECK_HEADER([poll.h],
+[NO_POLL_H=],
+[NO_POLL_H=UnfortunatelyYes])
+GIT_CONF_SUBST([NO_POLL_H])
+#
 # Define NO_SYS_POLL_H if you don't have sys/poll.h
 AC_CHECK_HEADER([sys/poll.h],
 [NO_SYS_POLL_H=],
index 3a08d9916fb49b5a1578c74a5ae2949d98a8e699..f16058182f76bcb9fe50e00a239993de0fb28b12 100644 (file)
 #include <regex.h>
 #include <utime.h>
 #include <syslog.h>
-#ifndef NO_SYS_POLL_H
+#if !defined(NO_POLL_H)
+#include <poll.h>
+#elif !defined(NO_SYS_POLL_H)
 #include <sys/poll.h>
 #else
+/* Pull the compat stuff */
 #include <poll.h>
 #endif
 #ifdef HAVE_BSD_SYSCTL