Build: Enable *GNU (Hurd) Bug 2476
authorHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
Tue, 3 Dec 2019 06:23:25 +0000 (07:23 +0100)
committerHeiko Schlittermann (HS12-RIPE) <hs@schlittermann.de>
Tue, 3 Dec 2019 06:23:25 +0000 (07:23 +0100)
src/OS/Makefile-Base
src/OS/Makefile-GNU [new file with mode: 0644]
src/OS/os.c-GNU [new file with mode: 0644]
src/OS/os.h-GNU [new file with mode: 0644]
src/OS/unsupported/Makefile-GNU [deleted file]
src/OS/unsupported/os.c-GNU [deleted file]
src/OS/unsupported/os.h-GNU [deleted file]

index f8c6ebb53b331e6bcf7875d6d62113d881aa6d95..9ecde1d3e71737868ddc57d2658dbfac2116abdc 100644 (file)
@@ -97,6 +97,7 @@ Makefile: ../OS/Makefile-Base ../OS/Makefile-Default \
 
 os.h:  $(SCRIPTS)/Configure-os.h \
        $(O)/os.h-FreeBSD       \
 
 os.h:  $(SCRIPTS)/Configure-os.h \
        $(O)/os.h-FreeBSD       \
+       $(O)/os.h-GNU           \
        $(O)/os.h-Linux         \
        $(O)/os.h-OpenBSD       \
        $(O)/os.h-SunOS5
        $(O)/os.h-Linux         \
        $(O)/os.h-OpenBSD       \
        $(O)/os.h-SunOS5
@@ -113,6 +114,7 @@ os.h:       $(SCRIPTS)/Configure-os.h \
 
 os.c:   ../src/os.c \
        $(SCRIPTS)/Configure-os.c \
 
 os.c:   ../src/os.c \
        $(SCRIPTS)/Configure-os.c \
+       $(O)/os.c-GNU           \
        $(O)/os.c-Linux
        $(SHELL) $(SCRIPTS)/Configure-os.c
 
        $(O)/os.c-Linux
        $(SHELL) $(SCRIPTS)/Configure-os.c
 
diff --git a/src/OS/Makefile-GNU b/src/OS/Makefile-GNU
new file mode 100644 (file)
index 0000000..e464341
--- /dev/null
@@ -0,0 +1,29 @@
+# Exim: OS-specific make file for GNU and variants.
+
+HAVE_ICONV=yes
+
+BASENAME_COMMAND=look_for_it
+CHOWN_COMMAND=look_for_it
+CHGRP_COMMAND=look_for_it
+CHMOD_COMMAND=look_for_it
+
+CFLAGS ?= -O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
+
+DBMLIB = -ldb
+USE_DB = yes
+
+LIBS = -lnsl -lcrypt -lm
+LIBRESOLV = -lresolv
+
+X11=/usr/X11R6
+XINCLUDE=-I$(X11)/include
+XLFLAGS=-L$(X11)/lib
+X11_LD_LIB=$(X11)/lib
+
+EXIWHAT_PS_ARG=ax
+EXIWHAT_EGREP_ARG='/exim( |$$)'
+EXIWHAT_MULTIKILL_CMD=killall
+EXIWHAT_MULTIKILL_ARG=exim
+EXIWHAT_KILL_SIGNAL=-USR1
+
+# End
diff --git a/src/OS/os.c-GNU b/src/OS/os.c-GNU
new file mode 100644 (file)
index 0000000..e5d6ff6
--- /dev/null
@@ -0,0 +1,55 @@
+/*************************************************
+*     Exim - an Internet mail transport agent    *
+*************************************************/
+
+/* See the file NOTICE for conditions of use and distribution. */
+
+/* GNU-specific code. This is concatenated onto the generic src/os.c file.
+GNU/Hurd has approximately the same way to determine the load average as NeXT,
+so a variant of this could also be in the generic os.c file. See the GNU EMacs
+getloadavg.c file, from which this snippet was derived. getloadavg.c from Emacs
+is copyrighted by the FSF under the terms of the GPLv2 or any later version.
+Changes are hereby placed under the same license, as requested by the GPL. */
+
+#ifndef OS_LOAD_AVERAGE
+#define OS_LOAD_AVERAGE
+
+#include <mach.h>
+
+static processor_set_t default_set;
+static int getloadavg_initialized;
+
+int
+os_getloadavg (void)
+{
+host_t host;
+struct processor_set_basic_info info;
+unsigned info_count;
+
+if (!getloadavg_initialized)
+  {
+  if (processor_set_default (mach_host_self(), &default_set) == KERN_SUCCESS)
+    getloadavg_initialized = 1;
+  }
+
+if (getloadavg_initialized)
+  {
+  info_count = PROCESSOR_SET_BASIC_INFO_COUNT;
+  if (processor_set_info(default_set, PROCESSOR_SET_BASIC_INFO, &host,
+       (processor_set_info_t)&info, &info_count) != KERN_SUCCESS)
+    getloadavg_initialized = 0;
+  else
+    {
+    #if LOAD_SCALE == 1000
+    return info.load_average;
+    #else
+    return (int) (((double) info.load_average * 1000) / LOAD_SCALE));
+    #endif
+    }
+  }
+
+return -1;
+}
+#endif  /* OS_LOAD_AVERAGE */
+
+/* End of os.c-GNU */
diff --git a/src/OS/os.h-GNU b/src/OS/os.h-GNU
new file mode 100644 (file)
index 0000000..4499316
--- /dev/null
@@ -0,0 +1,23 @@
+/* Exim: OS-specific C header file for GNU/Hurd */
+
+#define CRYPT_H
+#define GLIBC_IP_OPTIONS
+#define HAVE_BSD_GETLOADAVG
+#define HAVE_MMAP
+#define HAVE_SYS_VFS_H
+#define NO_IP_VAR_H
+#define SIG_IGN_WORKS
+#define SIOCGIFCONF_GIVES_ADDR
+
+#define F_FREESP     O_TRUNC
+typedef struct flock flock_t;
+
+#define os_strsignal strsignal
+#define OS_STRSIGNAL
+
+/* Hurd-specific bits below */
+
+/* default is non-const */
+#define ICONV_ARG2_TYPE const char **
+
+/* End */
diff --git a/src/OS/unsupported/Makefile-GNU b/src/OS/unsupported/Makefile-GNU
deleted file mode 100644 (file)
index e464341..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# Exim: OS-specific make file for GNU and variants.
-
-HAVE_ICONV=yes
-
-BASENAME_COMMAND=look_for_it
-CHOWN_COMMAND=look_for_it
-CHGRP_COMMAND=look_for_it
-CHMOD_COMMAND=look_for_it
-
-CFLAGS ?= -O -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-
-DBMLIB = -ldb
-USE_DB = yes
-
-LIBS = -lnsl -lcrypt -lm
-LIBRESOLV = -lresolv
-
-X11=/usr/X11R6
-XINCLUDE=-I$(X11)/include
-XLFLAGS=-L$(X11)/lib
-X11_LD_LIB=$(X11)/lib
-
-EXIWHAT_PS_ARG=ax
-EXIWHAT_EGREP_ARG='/exim( |$$)'
-EXIWHAT_MULTIKILL_CMD=killall
-EXIWHAT_MULTIKILL_ARG=exim
-EXIWHAT_KILL_SIGNAL=-USR1
-
-# End
diff --git a/src/OS/unsupported/os.c-GNU b/src/OS/unsupported/os.c-GNU
deleted file mode 100644 (file)
index e5d6ff6..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*************************************************
-*     Exim - an Internet mail transport agent    *
-*************************************************/
-
-/* See the file NOTICE for conditions of use and distribution. */
-
-/* GNU-specific code. This is concatenated onto the generic src/os.c file.
-GNU/Hurd has approximately the same way to determine the load average as NeXT,
-so a variant of this could also be in the generic os.c file. See the GNU EMacs
-getloadavg.c file, from which this snippet was derived. getloadavg.c from Emacs
-is copyrighted by the FSF under the terms of the GPLv2 or any later version.
-Changes are hereby placed under the same license, as requested by the GPL. */
-
-#ifndef OS_LOAD_AVERAGE
-#define OS_LOAD_AVERAGE
-
-#include <mach.h>
-
-static processor_set_t default_set;
-static int getloadavg_initialized;
-
-int
-os_getloadavg (void)
-{
-host_t host;
-struct processor_set_basic_info info;
-unsigned info_count;
-
-if (!getloadavg_initialized)
-  {
-  if (processor_set_default (mach_host_self(), &default_set) == KERN_SUCCESS)
-    getloadavg_initialized = 1;
-  }
-
-if (getloadavg_initialized)
-  {
-  info_count = PROCESSOR_SET_BASIC_INFO_COUNT;
-  if (processor_set_info(default_set, PROCESSOR_SET_BASIC_INFO, &host,
-       (processor_set_info_t)&info, &info_count) != KERN_SUCCESS)
-    getloadavg_initialized = 0;
-  else
-    {
-    #if LOAD_SCALE == 1000
-    return info.load_average;
-    #else
-    return (int) (((double) info.load_average * 1000) / LOAD_SCALE));
-    #endif
-    }
-  }
-
-return -1;
-}
-#endif  /* OS_LOAD_AVERAGE */
-
-/* End of os.c-GNU */
diff --git a/src/OS/unsupported/os.h-GNU b/src/OS/unsupported/os.h-GNU
deleted file mode 100644 (file)
index 4499316..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Exim: OS-specific C header file for GNU/Hurd */
-
-#define CRYPT_H
-#define GLIBC_IP_OPTIONS
-#define HAVE_BSD_GETLOADAVG
-#define HAVE_MMAP
-#define HAVE_SYS_VFS_H
-#define NO_IP_VAR_H
-#define SIG_IGN_WORKS
-#define SIOCGIFCONF_GIVES_ADDR
-
-#define F_FREESP     O_TRUNC
-typedef struct flock flock_t;
-
-#define os_strsignal strsignal
-#define OS_STRSIGNAL
-
-/* Hurd-specific bits below */
-
-/* default is non-const */
-#define ICONV_ARG2_TYPE const char **
-
-/* End */