[exim-dev] Patches for SunOS 4

Pàgina inicial
Delete this message
Reply to this message
Autor: Michael Haardt
Data:  
A: exim-dev
Assumpte: [exim-dev] Patches for SunOS 4
Hello,

the attached patches are not complete yet, but fix a few problems
in building exim on SunOS 4, and should not hurt any system else.
I'll send more once I cleaned up a few hacks.

So far, Exim works good enough for me to forward mails to a smart host.
Getting rid of sendmail still feels good after all the years. :-)

Michael
--- ./src/exim-4.80.1/src/buildconfig.c    2012-10-25 05:37:38.000000000 +0200
+++ ./sun3/exim-4.80.1/src/buildconfig.c    2012-11-05 22:18:24.000000000 +0100
@@ -39,6 +39,8 @@
 #include <pwd.h>
 #include <grp.h>


+#include "os.h"
+
 typedef struct {
   const char *name;
   int *flag;
--- ./src/exim-4.80.1/src/exim.h    2012-10-25 05:37:38.000000000 +0200
+++ ./sun3/exim-4.80.1/src/exim.h    2012-11-05 22:37:51.000000000 +0100
@@ -86,7 +86,9 @@


/* C99 integer types, figure out how to undo this if needed for older systems */

+#if (__STDC_VERSION__ >= 199901L)
#include <inttypes.h>
+#endif

/* Just in case some aged system doesn't define them... */

--- ./src/exim-4.80.1/OS/os.h-SunOS4    2012-10-25 05:37:38.000000000 +0200
+++ ./sun3/exim-4.80.1/OS/os.h-SunOS4    2012-11-23 23:59:35.000000000 +0100
@@ -1,5 +1,6 @@
 /* Exim: OS-specific C header file for SunOS4 */


+#define EXIM_SOCKLEN_T size_t
#define LOAD_AVG_NEEDS_ROOT
#define HAVE_DEV_KMEM
#define LOAD_AVG_TYPE long
@@ -17,6 +18,7 @@
#define STRERROR_FROM_ERRLIST
#define memmove(a, b, c) bcopy(b, a, c)
#define strtoul(str, ptr, base) ((unsigned int)strtol((str),(ptr),(base)))
+#define strtoll(str, ptr, base) ((unsigned int)strtol((str),(ptr),(base)))

extern char *strerror(int);
extern int sys_nerr;
@@ -33,4 +35,17 @@

#define FUDGE_GETC_AND_FRIENDS

+typedef int ssize_t;
+typedef int sig_atomic_t;
+typedef struct state *res_state;
+#define int_eximarith_t long
+typedef unsigned int uint32_t;
+
+#define PR_EXIM_ARITH "%ld"
+#define SC_EXIM_ARITH "%li"
+#define SC_EXIM_DEC "%ld"
+
+#define LLONG_MIN LONG_MIN
+#define LLONG_MAX LONG_MAX
+
 /* End */
--- ./src/exim-4.80.1/OS/Makefile-SunOS4    2012-10-25 05:37:38.000000000 +0200
+++ ./sun3/exim-4.80.1/OS/Makefile-SunOS4    2012-12-14 22:05:21.000000000 +0100
@@ -7,10 +7,17 @@
 EXIT_FAILURE=1
 EXIT_SUCCESS=0
 LIBRESOLV=-lresolv
-XINCLUDE=-I/usr/include/X11
+LIBS=-lm
+
+X11=/opt/X11R6
+XINCLUDE=-I$(X11)/include
+XLFLAGS=-L$(X11)/lib
+EXTRALIBS_EXIMON=-lICE -lSM -lXpm


EXIWHAT_PS_ARG=-ax
EXIWHAT_EGREP_ARG='/exim( |$$)'
EXIWHAT_KILL_SIGNAL=-30

+HAVE_IPV6=
+
 # End
--- src/exim-4.80.1/src/pdkim/bignum.c    2012-10-25 05:37:38.000000000 +0200
+++ sun3/exim-4.80.1/src/pdkim/bignum.c    2012-11-14 23:05:40.000000000 +0100
@@ -375,7 +375,8 @@
                 if( c == 0 && k == 0 && (i + j) != 0 )
                     continue;


-                p += sprintf( p, "%02X", c );
+                sprintf( p, "%02X", c );
+                p += 2;
                 k = 1;
             }
         }
--- src/exim-4.80.1/exim_monitor/em_main.c    2012-10-25 05:37:38.000000000 +0200
+++ ./sun3/exim-4.80.1/exim_monitor/em_main.c    2012-11-13 22:44:49.000000000 +0100
@@ -137,7 +137,7 @@
 in their libraries, but can provide the same facility by this simple
 alternative function. */


-uschar *
+char *
 strerror(int n)
 {
 if (n < 0 || n >= sys_nerr) return "unknown error number";
--- src/exim-4.80.1/scripts/lookups-Makefile    2012-10-25 05:37:38.000000000 +0200
+++ sun3/exim-4.80.1/scripts/lookups-Makefile    2012-11-05 22:10:54.000000000 +0100
@@ -19,6 +19,13 @@
     export SHELL
   fi


+  # Bash is always a good choice
+  if [ -x /usr/local/bin/bash ]
+  then
+    SHELL=/usr/local/bin/bash
+    export SHELL
+  fi
+
   # IRIX uses /bin/ksh for sh but in a compatibility mode unless $_XPG == 1,
   # where said compatibility mode disables $(...)
   _XPG=1
--- src/exim-4.80.1/scripts/reversion    2012-10-25 05:37:38.000000000 +0200
+++ sun3/exim-4.80.1/scripts/reversion    2012-11-05 22:24:28.000000000 +0100
@@ -15,6 +15,12 @@
     SHELL=/usr/xpg4/bin/sh
     export PATH SHELL
   fi
+  # Bash is always a good choice:
+  if [ -x /usr/local/bin/bash ]
+  then
+    SHELL=/usr/local/bin/bash
+    export SHELL
+  fi
   # Irix:
   _XPG=1 ; export _XPG
   #