]> git.kaiwu.me - nginx.git/commitdiff
Configure: GNU Hurd properly recognized.
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 25 May 2015 14:58:13 +0000 (17:58 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 25 May 2015 14:58:13 +0000 (17:58 +0300)
With this change it's no longer needed to pass -D_GNU_SOURCE manually,
and -D_FILE_OFFSET_BITS=64 is set to use 64-bit off_t.

Note that nginx currently fails to work properly with master process
enabled on GNU Hurd, as fcntl(F_SETOWN) returns EOPNOTSUPP for sockets
as of GNU Hurd 0.6.  Additionally, our strerror() preloading doesn't
work well with GNU Hurd, as it uses large numbers for most errors.

auto/os/conf
src/os/unix/ngx_posix_config.h

index fe720160adab37f75a5aa0a84a3217d688665f78..6ad0e74e0d44fbdbf82ea292ae0d378e977fa25a 100644 (file)
@@ -60,6 +60,15 @@ case "$NGX_PLATFORM" in
         CORE_SRCS="$UNIX_SRCS"
     ;;
 
+    GNU:*)
+        # GNU Hurd
+        have=NGX_GNU_HURD . auto/have_headers
+        CORE_INCS="$UNIX_INCS"
+        CORE_DEPS="$UNIX_DEPS $POSIX_DEPS"
+        CORE_SRCS="$UNIX_SRCS"
+        CC_AUX_FLAGS="$CC_AUX_FLAGS -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
+    ;;
+
     *)
         CORE_INCS="$UNIX_INCS"
         CORE_DEPS="$UNIX_DEPS $POSIX_DEPS"
index d725659dfaccb0c82872e3467b819890db78c0dd..443c4b001261212c5f1a10bccbd42bb936119ec2 100644 (file)
 #endif
 
 
+#if (NGX_GNU_HURD)
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE             /* accept4() */
+#endif
+#define _FILE_OFFSET_BITS       64
+#endif
+
+
 #ifdef __CYGWIN__
 #define timezonevar             /* timezone is variable */
 #define NGX_BROKEN_SCM_RIGHTS   1