Subject: FVWM: PATCH: fvwm 2.0.42 Solaris, Ultrix

From: Larry Schwimmer <[email-masked]>
Date: Fri, 7 Jun 1996 11:55:04 -0700 (PDT)

This also contains the SunOS patch since it is right
next to the Ultrix patch.  As patched, fvwm compiles under X11R6.1pl1
on:

	SunOS4.1.4, Solaris 2.4, OSF/1 2.1, HP-UX 9.05
	IRIX 5.3, Linux 1.2.13, Ultrix 4.4, AIX 3.2.5

For the compiler, I used cc for IRIX and gcc for the others.

	The fixed problems added to the patch include:

1) Fvwm.tmpl does not set up the link environment properly as is
   done for X11R6 and later.  This causes the binary to be linked
   incorrectly under Solaris using X11R6 or later.

2) Ultrix does not have strdup.

	One additional problem I noticed but did not patch was in
FvwmScroll.  Both .c files declare storage for the same variables.
The storage for a given variable should only be in one .c file and the
prototypes should go in the header file.  The problem is not critical
under C, but it would be good to fix before the general release.  It
would cause a problem under C++, however, which assumes static linkage
for variables not declared extern.

			yours,
				Larry Schwimmer
				[email-masked]

--- Fvwm.tmpl.orig	Mon Apr  8 07:59:50 1996
+++ Fvwm.tmpl	Fri Jun  7 01:28:49 1996
@@ -350,7 +350,7 @@
 									@@\
 program: $(OBJS) $(DEPLIBS)						@@\
 	RemoveTargetProgram($@)						@@\
-	$(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
+	$(CCENVSETUP) $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
 									@@\
 InstallProgram(program,$(FVWMDIR))					@@\
 InstallManPage(program,$(MANDIR))					@@\
@@ -375,7 +375,7 @@
 									@@\
 program: $(OBJS) $(DEPLIBS)						@@\
 	RemoveTargetProgram($@)						@@\
-	$(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
+	$(CCENVSETUP) $(CC) -o $@ $(OBJS) $(LDOPTIONS) $(LOCAL_LIBRARIES) $(LDLIBS) $(EXTRA_LOAD_FLAGS) @@\
 									@@\
 InstallProgram(program,$(FVWMBINDIR))					@@\
 InstallManPage(program,$(MANDIR))					@@\
--- libs/Imakefile.orig	Fri Feb 16 17:17:27 1996
+++ libs/Imakefile	Fri Jun  7 04:59:34 1996
@@ -22,6 +22,8 @@
 	mystrcasecmp.c \
 	safemalloc.c \
 	sleep.c \
+	strdup.c \
+	strerror.c \
 	strncmp.c \
 	wild.c
 
@@ -43,6 +45,8 @@
 	mystrcasecmp.o \
 	safemalloc.o \
 	sleep.o \
+	strdup.o \
+	strerror.o \
 	strncmp.o \
 	wild.o
 
--- /dev/null	Fri Jun  7 04:47:43 1996
+++ libs/strerror.c	Thu Jun  6 17:41:47 1996
@@ -0,0 +1,15 @@
+extern int sys_nerr;
+extern char *sys_errlist[];
+
+/* strerror
+ *
+ * Return string corresponding to errno
+ * For systems which lack this function.
+ */
+const char *
+strerror(int errnum)
+{
+  static char unknown[] = "Unknown error";
+
+  return ((unsigned int)errnum < sys_nerr) ? sys_errlist[errnum] : unknown;
+}
--- /dev/null	Fri Jun  7 04:47:43 1996
+++ libs/strdup.c	Fri Jun  7 04:57:02 1996
@@ -0,0 +1,20 @@
+#include <string.h>
+
+/* strdup
+ *
+ * Make a duplicate of a string.
+ * For systems which lack this function.
+ */
+char *
+strdup (const char *input)
+{
+  register char *cp, *retval = NULL;
+
+  if (input == NULL)
+    return NULL;
+  if ((retval = cp = (char *)malloc((strlen(input)+1)*sizeof(char))) == NULL)
+    return NULL;
+  while ((*cp++ = *input++) != '\0')
+    ;
+  return retval;
+}
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].