Skip to contentSkip to conversation

make poll available for other platforms lacking it

PATCH In review Joachim Schmitz 2 participants 5 messages Jun 15, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v7 1/4 make poll available for other platforms lacking it

move poll.[ch] out of compat/win32/ into compat/poll/ and adjust Makefile with the changed paths. Adding comments to Makefile about how/when to enable it and add logic for this

---
 Makefile                      | 20 +++++++++++++++-----
 compat/{win32 => poll}/poll.c |  0
 compat/{win32 => poll}/poll.h |  0
 3 files changed, 15 insertions(+), 5 deletions(-)
 rename compat/{win32 => poll}/poll.c (100%)
 rename compat/{win32 => poll}/poll.h (100%)
Makefile +8 -5
index ac49320..7893297 100644
@@ -152,6 +152,11 @@ all::
 #
 # Define NO_MMAP if you want to avoid mmap.
 #
+# 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.
+#
 # Define NO_PTHREADS if you do not have or do not want to use Pthreads.
 #
 # Define NO_PREAD if you have a problem with pread() system call (e.g.
@@ -598,10 +603,10 @@ LIB_H += compat/bswap.h
 LIB_H += compat/cygwin.h
 LIB_H += compat/mingw.h
 LIB_H += compat/obstack.h
+LIB_H += compat/poll/poll.h
 LIB_H += compat/precompose_utf8.h
 LIB_H += compat/terminal.h
 LIB_H += compat/win32/dirent.h
-LIB_H += compat/win32/poll.h
 LIB_H += compat/win32/pthread.h
 LIB_H += compat/win32/syslog.h
 LIB_H += connected.h
@@ -1220,7 +1225,7 @@ ifeq ($(uname_S),Windows)
 	NO_PREAD = YesPlease
 	NEEDS_CRYPTO_WITH_SSL = YesPlease
 	NO_LIBGEN_H = YesPlease
-	NO_SYS_POLL_H = YesPlease
+	NO_POLL_H = YesPlease
 	NO_SYMLINK_HEAD = YesPlease
 	NO_IPV6 = YesPlease
 	NO_UNIX_SOCKETS = YesPlease
@@ -1261,7 +1266,7 @@ ifeq ($(uname_S),Windows)
 	BASIC_CFLAGS = -nologo -I. -I../zlib -Icompat/vcbuild -Icompat/vcbuild/include -DWIN32 -D_CONSOLE -DHAVE_STRING_H
-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE
 	COMPAT_OBJS = compat/msvc.o compat/winansi.o \
 		compat/win32/pthread.o compat/win32/syslog.o \
-		compat/win32/poll.o compat/win32/dirent.o
+		compat/win32/dirent.o
 	COMPAT_CFLAGS = -D__USE_MINGW_ACCESS -DNOGDI -DHAVE_STRING_H -DHAVE_ALLOCA_H -Icompat -Icompat/regex -Icompat/win32
-DSTRIP_EXTENSION=\".exe\"

BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE -NODEFAULTLIB:MSVCRT.lib EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib
@@ -1316,7 +1321,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
NO_PREAD = YesPlease
NEEDS_CRYPTO_WITH_SSL = YesPlease
NO_LIBGEN_H = YesPlease
- NO_SYS_POLL_H = YesPlease
+ NO_POLL_H = YesPlease
NO_SYMLINK_HEAD = YesPlease
NO_UNIX_SOCKETS = YesPlease
NO_SETENV = YesPlease
@@ -1351,7 +1356,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
COMPAT_CFLAGS += -DSTRIP_EXTENSION=\".exe\"
COMPAT_OBJS += compat/mingw.o compat/winansi.o \
compat/win32/pthread.o compat/win32/syslog.o \
- compat/win32/poll.o compat/win32/dirent.o
+ compat/win32/dirent.o
EXTLIBS += -lws2_32
PTHREAD_LIBS =
X = .exe
@@ -1605,6 +1610,11 @@ ifdef NO_GETTEXT
BASIC_CFLAGS += -DNO_GETTEXT
USE_GETTEXT_SCHEME ?= fallthrough
endif
+ifdef NO_POLL
+ NO_SYS_POLL_H = YesPlease
+ COMPAT_CFLAGS += -DNO_POLL -Icompat/poll
+ COMPAT_OBJS += compat/poll/poll.o
+endif
ifdef NO_STRCASESTR
COMPAT_CFLAGS += -DNO_STRCASESTR
COMPAT_OBJS += compat/strcasestr.o

compat/poll/poll.c renamed from compat/win32/poll.c +0 -0
similarity index 100%
rename from compat/win32/poll.c
rename to compat/poll/poll.c
compat/poll/poll.h renamed from compat/win32/poll.h +0 -0
similarity index 100%
rename from compat/win32/poll.h
rename to compat/poll/poll.h
Signature · 1 line
1.7.12
#1 lore raw
Quoted 18 lines · Joachim Schmitz

move poll.[ch] out of compat/win32/ into compat/poll/ and adjust Makefile with the changed paths. Adding comments to Makefile about how/when to enable it and add logic for this

---
 Makefile                      | 20 +++++++++++++++-----
 compat/{win32 => poll}/poll.c |  0
 compat/{win32 => poll}/poll.h |  0
 3 files changed, 15 insertions(+), 5 deletions(-)
 rename compat/{win32 => poll}/poll.c (100%)
 rename compat/{win32 => poll}/poll.h (100%)
Makefile +0 -0
index ac49320..7893297 100644

Makefile all:: · line 158

Quoted 7 lines
Makefile +4 -0
@@ -152,6 +152,11 @@ all::
 #
 # Define NO_MMAP if you want to avoid mmap.
 #
+# 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.

Sensible.

Makefile ifeq ($(uname_S),Windows) · line 1228

Quoted 6 lines
Makefile +1 -1
@@ -1220,7 +1225,7 @@ ifeq ($(uname_S),Windows)
 	NO_PREAD = YesPlease
 	NEEDS_CRYPTO_WITH_SSL = YesPlease
 	NO_LIBGEN_H = YesPlease
-	NO_SYS_POLL_H = YesPlease
+	NO_POLL_H = YesPlease

Should this be NO_POLL, not NO_POLL_H?

Makefile ifneq (,$(findstring MINGW,$(uname_S))) · line 1324

Quoted 9 lines
Makefile +1 -2
-DSTRIP_EXTENSION=\".exe\"
 	BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE -NODEFAULTLIB:MSVCRT.lib
 	EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib
@@ -1316,7 +1321,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
 	NO_PREAD = YesPlease
 	NEEDS_CRYPTO_WITH_SSL = YesPlease
 	NO_LIBGEN_H = YesPlease
-	NO_SYS_POLL_H = YesPlease
+	NO_POLL_H = YesPlease

Likewise.

Makefile ifdef NO_GETTEXT · line 1617

Quoted 9 lines
Makefile +5 -0
@@ -1605,6 +1610,11 @@ ifdef NO_GETTEXT
 	BASIC_CFLAGS += -DNO_GETTEXT
 	USE_GETTEXT_SCHEME ?= fallthrough
 endif
+ifdef NO_POLL
+	NO_SYS_POLL_H = YesPlease
+	COMPAT_CFLAGS += -DNO_POLL -Icompat/poll
+	COMPAT_OBJS += compat/poll/poll.o
+endif

I think my guesses above are correct, so will queue with the trivial and obvious fixup.

Thanks.

#2 lore raw
Quoted 57 lines

From: Junio C Hamano [mailto:[email protected]]
Sent: Tuesday, September 18, 2012 12:42 AM
To: Joachim Schmitz
Cc: [email protected]
Subject: Re: [PATCH v7 1/4] make poll available for other platforms lacking it

Quoted 18 lines · Joachim Schmitz

move poll.[ch] out of compat/win32/ into compat/poll/ and adjust Makefile with the changed paths. Adding comments to Makefile about how/when to enable it and add logic for this

---
 Makefile                      | 20 +++++++++++++++-----
 compat/{win32 => poll}/poll.c |  0
 compat/{win32 => poll}/poll.h |  0
 3 files changed, 15 insertions(+), 5 deletions(-)
 rename compat/{win32 => poll}/poll.c (100%)
 rename compat/{win32 => poll}/poll.h (100%)
Makefile +0 -0
index ac49320..7893297 100644

Makefile all:: · line 158

Quoted 7 lines
Makefile +4 -0
@@ -152,6 +152,11 @@ all::
 #
 # Define NO_MMAP if you want to avoid mmap.
 #
+# 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.

Sensible.

Makefile ifeq ($(uname_S),Windows) · line 1228

Quoted 6 lines
Makefile +1 -1
@@ -1220,7 +1225,7 @@ ifeq ($(uname_S),Windows)
 	NO_PREAD = YesPlease
 	NEEDS_CRYPTO_WITH_SSL = YesPlease
 	NO_LIBGEN_H = YesPlease
-	NO_SYS_POLL_H = YesPlease
+	NO_POLL_H = YesPlease

Should this be NO_POLL, not NO_POLL_H?

Makefile ifneq (,$(findstring MINGW,$(uname_S))) · line 1324

Quoted 9 lines
Makefile +1 -2
-DSTRIP_EXTENSION=\".exe\"
 	BASIC_LDFLAGS = -IGNORE:4217 -IGNORE:4049 -NOLOGO -SUBSYSTEM:CONSOLE -NODEFAULTLIB:MSVCRT.lib
 	EXTLIBS = user32.lib advapi32.lib shell32.lib wininet.lib ws2_32.lib
@@ -1316,7 +1321,7 @@ ifneq (,$(findstring MINGW,$(uname_S)))
 	NO_PREAD = YesPlease
 	NEEDS_CRYPTO_WITH_SSL = YesPlease
 	NO_LIBGEN_H = YesPlease
-	NO_SYS_POLL_H = YesPlease
+	NO_POLL_H = YesPlease

Likewise.

Quoted 12 lines

Makefile ifdef NO_GETTEXT · line 1617

Quoted 9 lines
Makefile +5 -0
@@ -1605,6 +1610,11 @@ ifdef NO_GETTEXT
 	BASIC_CFLAGS += -DNO_GETTEXT
 	USE_GETTEXT_SCHEME ?= fallthrough
 endif
+ifdef NO_POLL
+	NO_SYS_POLL_H = YesPlease
+	COMPAT_CFLAGS += -DNO_POLL -Icompat/poll
+	COMPAT_OBJS += compat/poll/poll.o
+endif

I think my guesses above are correct, so will queue with the trivial and obvious fixup.

Well I was unde the impression that is <sys/poll.h> isn't available, there might be a <poll.h> and it that isn't available either we use compat/.../poll.[ch]. But rethinking your changed does makes perfect sense.

OK, so I guess I'm ready for the 'final touch', my NonStop specific changes, will post them shortly...

Bye, Jojo

#3 lore raw
Quoted 13 lines · Joachim Schmitz
Quoted 4 lines
Quoted 4 lines
(quoted diff) +0 -0
@@ -1605,6 +1610,11 @@ ifdef NO_GETTEXT
 	BASIC_CFLAGS += -DNO_GETTEXT
 	USE_GETTEXT_SCHEME ?= fallthrough
 endif
Quoted 8 lines

Review ifdef NO_GETTEXT · line 1617

Quoted 5 lines
(quoted diff) +5 -0
+ifdef NO_POLL
+	NO_SYS_POLL_H = YesPlease
+	COMPAT_CFLAGS += -DNO_POLL -Icompat/poll
+	COMPAT_OBJS += compat/poll/poll.o
+endif

I think my guesses above are correct, so will queue with the trivial and obvious fixup.

Quoted 4 lines

Well I was unde the impression that is <sys/poll.h> isn't available, there might be a <poll.h> and it that isn't available either we use compat/.../poll.[ch]. But rethinking your changed does makes perfect sense.

Heh, my comment was not about names between NO_POLL_H vs NO_POLL. With the way you wrote the code, the symbols defined for Windows and MINGW must match what controls the hunk around ll.1610, so what makes perfect sense to you is indeed your code ;-)

Quoted 2 lines

OK, so I guess I'm ready for the 'final touch', my NonStop specific changes, will post them shortly...

#4 lore raw
Quoted 26 lines

From: Junio C Hamano [mailto:[email protected]]
Sent: Tuesday, September 18, 2012 8:55 AM
To: Joachim Schmitz
Cc: [email protected]
Subject: Re: [PATCH v7 1/4] make poll available for other platforms lacking it

Quoted 13 lines · Joachim Schmitz
Quoted 4 lines
Quoted 4 lines
(quoted diff) +0 -0
@@ -1605,6 +1610,11 @@ ifdef NO_GETTEXT
 	BASIC_CFLAGS += -DNO_GETTEXT
 	USE_GETTEXT_SCHEME ?= fallthrough
 endif
Quoted 8 lines

Review ifdef NO_GETTEXT · line 1617

Quoted 5 lines
(quoted diff) +5 -0
+ifdef NO_POLL
+	NO_SYS_POLL_H = YesPlease
+	COMPAT_CFLAGS += -DNO_POLL -Icompat/poll
+	COMPAT_OBJS += compat/poll/poll.o
+endif

I think my guesses above are correct, so will queue with the trivial and obvious fixup.

Quoted 4 lines

Well I was unde the impression that is <sys/poll.h> isn't available, there might be a <poll.h> and it that isn't available either we use compat/.../poll.[ch]. But rethinking your changed does makes perfect sense.

Quoted 4 lines

Heh, my comment was not about names between NO_POLL_H vs NO_POLL. With the way you wrote the code, the symbols defined for Windows and MINGW must match what controls the hunk around ll.1610, so what makes perfect sense to you is indeed your code ;-)

Yeah, I do understand myself pretty good ;-)
Now I see my typo...