+2008-05-04 Peter Maydell <pmaydell@chiark.greenend.org.uk>
+
+ * bug #23163: various minor fixes for the benefit of
+ older Unixes (specifically SunOS 4):
+ reintroduce strerror() substitute implementation
+ provide memmove() substitute implementation
+
+ * bug #23163: fix accidentally broken 'build outside
+ source directory' feature
+
+ * bug #23162: sbr/dtime.c: fix stray HAVE_TM_GMTOFF that
+ wasn't updated to the new macro name.
+
2008-04-30 Peter Maydell <pmaydell@chiark.greenend.org.uk>
* mts/smtp/smtp.c: provide a callback for SASL_CB_AUTHNAME
${srcdir}/version.sh $(VERSION) > version.c
config.o: config.c
- $(COMPILE2) config.c
+ $(COMPILE2) $<
install:
[Define to 1 if you have the `sigsetjmp'.]) AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
-AC_REPLACE_FUNCS(snprintf strdup)
+AC_REPLACE_FUNCS(memmove snprintf strerror strdup)
dnl Look for the initgroups() declaration. On AIX 4.[13], Solaris 4.1.3, and
dnl ULTRIX 4.2A the function is defined in libc but there's no declaration in
LINT = @LINT@
LINTFLAGS = @LINTFLAGS@
+LIBOBJS = @LIBOBJS@
+
mailspool = @mailspool@
sendmailpath = @sendmailpath@
m_msgdef.c mf.c utils.c
# source for compatibility functions
-COMPAT = snprintf.c strdup.c
+COMPAT = memmove.c snprintf.c strdup.c strerror.c
-OBJS = $(SRCS:.c=.o)
+OBJS = $(SRCS:.c=.o) $(LIBOBJS)
# auxiliary files
AUX = Makefile.in sigmsg.awk dtimep.lex
# Note that some lexes (for example flex 2.5.4) require that there
# be no space between -o and the output filename.
dtimep.c: dtimep.lex
- $(LEX) -o$@ dtimep.lex
+ $(LEX) -o$@ $<
client.o: client.c
- $(COMPILE2) client.c
+ $(COMPILE2) $<
mts.o: mts.c
- $(COMPILE2) mts.c
+ $(COMPILE2) $<
pidstatus.o: sigmsg.h
if (tm->tm_isdst)
tw.tw_flags |= TW_DST;
-#ifdef HAVE_TM_GMTOFF
+#ifdef HAVE_STRUCT_TM_TM_GMTOFF
tw.tw_zone = tm->tm_gmtoff / 60;
if (tm->tm_isdst) /* if DST is in effect */
tw.tw_zone -= 60; /* reset to normal offset */
--- /dev/null
+/* public domain function from Jan Wolter Unix Incompatibility Notes */
+/* http://unixpapa.com/incnote/ */
+char *memmove(char *dst, char *src, int n)
+{
+ if (src > dst)
+ for ( ; n > 0; n--)
+ *(dst++)= *(src++);
+ else
+ for (dst+= n-1, src+= n-1; n > 0; n--)
+ *(dst--)= *(src--);
+}
--- /dev/null
+
+/*
+ * strerror.c -- get error message string
+ *
+ * $Id$
+ */
+
+#include <h/mh.h>
+
+extern int sys_nerr;
+extern char *sys_errlist[];
+
+
+char *
+strerror (int errnum)
+{
+ if (errnum > 0 && errnum < sys_nerr)
+ return sys_errlist[errnum];
+ else
+ return NULL;
+}