From: danielce@mullian.ee.mu.OZ.AU (Daniel AMP Carosone)
Subject: PATCH: ghostview 1.4
Organization: Computer Science, University of Melbourne, Australia
Date: Wed, 14 Oct 1992 10:01:55 GMT

For those who want it, here are the patches necessary to get the new
ghostview to compile under linux, with shared libs. They're trivial,
but the one in ps.c is interesting - I had to rename a function
because it clashed with a macro defined in ctype.h. This function is
new, ghostview 1.3 didn't need this change.

These are made for my system, and so include a -m486 in the Makefile,
take that out if you don't want it.

These are really just to save you some editing, or for those who like
things to `just work'. I'll mention to the author about the name clash
in ps.c - I have to send him some mail about getting it to run
properly on another platform anyway.

Ghostscript 2.5.2 compiles `out of the box' with no work at all.

--- ps.c~	Thu Oct  1 08:01:34 1992
+++ ps.c	Wed Oct 14 18:41:40 1992
@@ -69,7 +69,7 @@
 static char *readline();
 static char *gettextline();
 static char *gettext();
-static int  isblank();
+static int  isblankline(char *);
 
 /*
  *	psscan -- scan the PostScript file for document structuring comments.
@@ -510,7 +510,7 @@
 
     /* Optional Preview comments for encapsulated PostScript files */ 
 
-    while (isblank(line) &&
+    while (isblankline(line) &&
 	   readline(line, sizeof line, file, &position, &line_len)) {
     }
 
@@ -530,7 +530,7 @@
 
     /* Page Defaults for Version 3.0 files */
 
-    while (isblank(line) &&
+    while (isblankline(line) &&
 	   readline(line, sizeof line, file, &position, &line_len)) {
     }
 
@@ -599,7 +599,7 @@
 
     /* Document Prolog */
 
-    while (isblank(line) &&
+    while (isblankline(line) &&
 	   readline(line, sizeof line, file, &position, &line_len)) {
     }
 
@@ -629,7 +629,7 @@
 
     /* Document Setup,  Page Defaults found here for Version 2 files */
 
-    while (isblank(line) &&
+    while (isblankline(line) &&
 	   readline(line, sizeof line, file, &position, &line_len)) {
     }
 
@@ -709,7 +709,7 @@
 
     /* Individual Pages */
 
-    while (isblank(line) &&
+    while (isblankline(line) &&
 	   readline(line, sizeof line, file, &position, &line_len)) {
     }
 
@@ -1337,11 +1337,11 @@
 }
 
 /*
- *	isblank -- determine whether the line contains nothing but whitespace.
+ *	isblankline -- determine whether the line contains nothing but whitespace.
  */
 
 static int
-isblank(line)
+isblankline(line)
     char *line;
 {
     while (*line == ' ' || *line == '\t') line++;
--- SelFile.c~	Thu Apr 16 00:15:45 1992
+++ SelFile.c	Wed Oct 14 18:42:28 1992
@@ -46,7 +46,7 @@
 /* BSD 4.3 errno.h does not declare errno */
 extern int errno;
 extern int sys_nerr;
-extern char *sys_errlist[];
+/* extern char *sys_errlist[]; */
 
 #include <sys/param.h>
 #include <X11/cursorfont.h>
--- misc.c~	Sun Oct 11 06:08:38 1992
+++ misc.c	Wed Oct 14 18:31:29 1992
@@ -61,7 +61,7 @@
 #include <perror.h>
 #else
 extern int sys_nerr;
-extern char *sys_errlist[];
+/* extern char *sys_errlist[]; */
 #endif
 
 #include "Ghostview.h"
--- Makefile~	Tue Sep 22 10:32:27 1992
+++ Makefile	Wed Oct 14 18:29:59 1992
@@ -46,7 +46,7 @@
                AS = as
 
          COMPRESS = compress
-              CPP = /lib/cpp $(STD_CPP_DEFINES)
+              CPP = gcc -E $(STD_CPP_DEFINES)
     PREPROCESSCMD = cc -E $(STD_CPP_DEFINES)
           INSTALL = install
                LD = ld
@@ -89,8 +89,8 @@
 
      TOP_INCLUDES = -I$(INCROOT)
 
-      CDEBUGFLAGS = -O
-        CCOPTIONS =
+      CDEBUGFLAGS = -O2
+        CCOPTIONS = -pipe -m486
 
       ALLINCLUDES = $(INCLUDES) $(EXTRA_INCLUDES) $(TOP_INCLUDES) $(STD_INCLUDES)
        ALLDEFINES = $(ALLINCLUDES) $(STD_DEFINES) $(EXTRA_DEFINES) $(PROTO_DEFINES) $(DEFINES)
@@ -124,7 +124,7 @@
 # X Window System make variables; this need to be coordinated with rules
 
           PATHSEP = /
-        USRLIBDIR = /usr/lib
+        USRLIBDIR = /usr/X386/lib/jump
            BINDIR = /usr/bin
           INCROOT = /usr/include
      BUILDINCROOT = $(TOP)