libpaper_1.0.3-12.1
===================

This can be compiled if patched.

First, config.guess and config.sub are from 1996 and don't know about
the Hurd.  Copy newer ones from libtool.

Then, change configure.in:

--- configure.in.orig   Wed Jun  2 19:43:39 1999
+++ configure.in        Wed Jun  2 20:45:29 1999
@@ -17,10 +17,11 @@
 AC_PROG_RANLIB
 AC_PROG_LN_S
 AC_PROG_MAKE_SET
-dnl Check for Linux ELF
+dnl Check for Linux or Hurd ELF
+dnl Beware of *-*-linux-gnuaout
 AC_CANONICAL_HOST
-case "$host" in
-    *linux | *linux-gnu)
+case "$host_os" in
+    linux | linux-gnu | gnu*)
        shared=shared
        SHAREDCFLAGS="-D_REENTRANT -fPIC"
        STATICCFLAGS=-D_REENTRANT

Rerun autoconf, so the change takes effect.

Next, change src/paperconf.c so that it doesn't use MAXPATHLEN and
takes errno from <errno.h> instead of just declaring it:

--- src/paperconf.c.orig        Wed Jun  2 20:23:46 1999
+++ src/paperconf.c     Wed Jun  2 20:31:34 1999
@@ -1,7 +1,6 @@
 
-#include <sys/param.h>
-
 #include <ctype.h>
+#include <errno.h>
 #include <getopt.h>
 #include <stdio.h>
 #include <string.h>
@@ -213,17 +212,15 @@
 
         if (!paper) paper = systempapername();
        if (!paper) {
-           extern int errno;
-
-           char errmsg[2 * MAXPATHLEN + 64];
-
-           sprintf(errmsg, "%s: cannot get paper size from %s",
-               progname, systempapersizefile());
+           fprintf(stderr, "%s: cannot get paper size from %s",
+                   progname, systempapersizefile());
 
            if (errno) {
-               perror(errmsg);
+               /* perror("") would do the same as perror(NULL).  */
+               fputs(": ", stderr);
+               perror(NULL);
            } else {
-               fputs(errmsg, stderr);
+               putc('\n', stderr);
            }
 
            paperdone();

Similarly:

--- lib/paper.c.orig    Wed Jun  2 20:59:49 1999
+++ lib/paper.c Wed Jun  2 21:01:00 1999
@@ -18,9 +18,11 @@
 
 #ifdef __STDC__
 #include <stdlib.h>
+#include <errno.h>
 #else
 extern double atof();
 extern char* getenv();
+extern int errno;
 #endif
 
 #include "paper.h"
@@ -155,8 +157,6 @@
     const struct paper* pp; /* MP */
    
     if (!paper) {
-       extern int errno;
-
        FILE* ps;
        const char* papersize = getenv(PAPERSIZEVAR);
        struct stat statbuf;

Then it will compile :)

I haven't checked if these changes work on GNU/Linux too, but I don't
see why they wouldn't.


netpbm-free_1:19940301.2-10
===========================

Source-Depends: xlib6g-dev      /* for xmkmf */
Source-Depends: libtiff3g-dev, libpaperg

You must edit pbmplus.h.  Move #include <errno.h> out of #ifdef VMS,
and uncomment #define A_STRERROR.

Then the library and most of the utilities will compile, but some
programs need libtiff which has not been ported yet.

Reply via email to