NetBSD Problem Report #39775

From www@NetBSD.org  Tue Oct 21 11:02:08 2008
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id EB2A763B93C
	for <gnats-bugs@gnats.netbsd.org>; Tue, 21 Oct 2008 11:02:07 +0000 (UTC)
Message-Id: <20081021110207.85A9763B88A@narn.NetBSD.org>
Date: Tue, 21 Oct 2008 11:02:07 +0000 (UTC)
From: joern.clausen@uni-bielefeld.de
Reply-To: joern.clausen@uni-bielefeld.de
To: gnats-bugs@NetBSD.org
Subject: trying to get print/ghostscript to work under Solaris
X-Send-Pr-Version: www-1.0

>Number:         39775
>Category:       pkg
>Synopsis:       trying to get print/ghostscript to work under Solaris
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    solaris-pkg-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 21 11:05:00 +0000 2008
>Closed-Date:    Mon Feb 23 14:17:42 +0000 2009
>Last-Modified:  Mon Feb 23 14:17:42 +0000 2009
>Originator:     Jörn Clausen
>Release:        
>Organization:
University of Bielefeld
>Environment:
SunOS rayadm3 5.10 Generic_120012-14 i86pc i386 i86pc

>Description:
The current print/ghostscript fails to compile under Solaris. These changes are necessary to produce a binary:

--- ghostscript/Makefile        Fri Sep  5 17:50:03 2008
+++ ghostscript.patched//Makefile       Fri Oct 17 09:33:03 2008
@@ -50,7 +50,7 @@
 CONFIGURE_ENV+=                ac_cv_func_fopen64=no
 .endif

-.if ${OPSYS} == "NetBSD"
+.if ${OPSYS} == "NetBSD" || ${OPSYS} == "SunOS"
 CFLAGS+=               -fPIC
 .endif


And someone (sed? the shell?) does not like this in configure:

                drivers="`echo $drivers |sed -e \"s/$THIS,//\"`"

(line 10682 in ghostscript-8.63). When changed to

                drivers="`echo $drivers |sed -e "s/$THIS,//"`"

(i.e. dropping the backslashes), the code works.


Unfortunately, the binary that is now generated, bails out with

$ gs
GPL Ghostscript 8.63 (2008-08-01)
Copyright (C) 2008 Artifex Software, Inc.  All rights reserved.
This software comes with NO WARRANTY: see the file PUBLIC for details.
Unrecoverable error: undefined in s
Unrecoverable error: undefined in .uninstallpagedevice

The reason for this is unclear to me. A ghostscript built outside pkgsrc, but using tools and libraries from there, works just fine. This might indicate a cause in the pkgsrc build framework. The problem was already present in ghostscript 8.62 from e.g. 2008Q2.

A diff between the two build directories revealed no obvious reason for this behaviour (to me). I can provide these directories, if someone else wants to have a look.
>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->solaris-pkg-people
Responsible-Changed-By: obache@NetBSD.org
Responsible-Changed-When: Tue, 21 Oct 2008 11:36:10 +0000
Responsible-Changed-Why:
Problem on Solaris.


From: =?ISO-8859-1?Q?J=F6rn_Clausen?= <joern@uni-bielefeld.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/39775 (trying to get print/ghostscript to work under Solaris)
Date: Fri, 31 Oct 2008 11:01:11 +0100

 Short update: It seems to be a local problem. I haven't figured out all 
 the details, but I know this so far:

 1. Building ghostscript inside pkgsrc fails. pkgsrc resides on an NFS 
 filesystem. It seems, gs_init.ps is not found, altough the search path 
 compiled into gs contains the right directory. truss shows, that this 
 path is not even tried.

 2. Building ghostscript inside a pkgsrc tree that resides on a local 
 filesystem (/tmp) succeeds!

 3. Building the same ghostscript with the same options outside pkgsrc, 
 and installing to the same NFS filesystem, succeeds.

 4. Building ghostscript inside pkgsrc with option 
 "--disable-compile-inits" succeeds!

 I assume there is some interaction between the file library that is 
 compiled into ghostscript by default, and our NFS. The library appears 
 in the searchpath as "%rom%lib/". But due to case 3., there must be some 
 additional ingredient provided by the pkgsrc framework, that I don't see.


 Is there a way to provide the additional configure flag in an automated 
 way? Adding this to mk.conf does not seem to work:

 CONFIGURE_ARGS.ghostscript += --disable-compile-inits

 I have added an additional option to the package:

 --- /tmp/T0Kbaih0       Fri Oct 31 10:55:12 2008
 +++ options.mk  Fri Oct 31 10:14:52 2008
 @@ -1,7 +1,7 @@
   # $NetBSD: options.mk,v 1.8 2008/09/03 21:31:12 markd Exp $

   PKG_OPTIONS_VAR=       PKG_OPTIONS.ghostscript
 -PKG_SUPPORTED_OPTIONS= x11 cups fontconfig
 +PKG_SUPPORTED_OPTIONS= x11 cups fontconfig disable-compile-inits
   PKG_SUGGESTED_OPTIONS= x11 fontconfig

   .include "../../mk/bsd.options.mk"
 @@ -40,4 +40,8 @@
   .include "../../fonts/fontconfig/buildlink3.mk"
   .else
   CONFIGURE_ARGS+=       --disable-fontconfig
 +.endif
 +
 +.if !empty(PKG_OPTIONS:Mdisable-compile-inits)
 +CONFIGURE_ARGS+=       --disable-compile-inits
   .endif

 But as this is for a very special and limited case, even I wouldn't be 
 too happy to include it in pkgsrc.

 -- 
   Jörn Clausen                             joern.clausen@uni-bielefeld.de
   Hochschulrechenzentrum                 http://www.uni-bielefeld.de/hrz/
   Universität Bielefeld

From: =?ISO-8859-1?Q?J=F6rn_Clausen?= <joern@uni-bielefeld.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/39775 (trying to get print/ghostscript to work under Solaris)
Date: Fri, 31 Oct 2008 12:51:20 +0100

 The sed problem is unrelated. Insofar, that a ghostscript built from 
 pkgsrc always has this problem (independent of install path), while a 
 ghostscript built standalone does not.

 The effect of this problem is, that the pdfwriter driver (and maybe 
 others) is not compiled into ghostscript.

 -- 
   Jörn Clausen                             joern.clausen@uni-bielefeld.de
   Hochschulrechenzentrum                 http://www.uni-bielefeld.de/hrz/
   Universität Bielefeld

From: Tim Zingelman <zingelman@fnal.gov>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/39775 (trying to get print/ghostscript to work under Solaris)
Date: Wed, 10 Dec 2008 19:18:28 -0600 (CST)

 Can we get this updated patch applied.  With this patch ghostscript seems 
 to work on Solaris, ignoring any local issues the original reporter has.

 Index: print/ghostscript/Makefile
 ===================================================================
 RCS file: /cvsroot/pkgsrc/print/ghostscript/Makefile,v
 retrieving revision 1.54
 diff -r1.54 Makefile
 57a58
 > CFLAGS.SunOS=         -fPIC

 At least it does well opening the example files included in the 
 distribution.

 Thanks!

From: "=?ISO-8859-1?Q?J=F6rn_Clausen?=" <joernc@googlemail.com>
To: gnats-bugs@netbsd.org
Cc: solaris-pkg-people@netbsd.org, gnats-admin@netbsd.org, 
	pkgsrc-bugs@netbsd.org
Subject: Re: pkg/39775 (trying to get print/ghostscript to work under Solaris)
Date: Thu, 11 Dec 2008 08:53:37 +0100

 Hi Tim!

 On Thu, Dec 11, 2008 at 3:30 AM, Tim Zingelman <zingelman@fnal.gov> wrote:
 >  Can we get this updated patch applied.  With this patch ghostscript seems
 >  to work on Solaris, ignoring any local issues the original reporter has.

 Is the pdfwrite module compiled into your Ghostscript, and does it work?

 -- 
 Joern Clausen
 joernc@gmail.com
 http://www.oe-files.de/oefiles/
 http://thebloeg.blogspot.com/

From: Thomas Klausner <wiz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/39775 CVS commit: pkgsrc/print/ghostscript
Date: Thu, 11 Dec 2008 09:18:20 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	wiz
 Date:		Thu Dec 11 09:18:20 UTC 2008

 Modified Files:
 	pkgsrc/print/ghostscript: Makefile

 Log Message:
 Also add -fPIC to CFLAGS for Solaris. PR 39775.


 To generate a diff of this commit:
 cvs rdiff -r1.54 -r1.55 pkgsrc/print/ghostscript/Makefile

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: =?ISO-8859-1?Q?J=F6rn_Clausen?= <joern@uni-bielefeld.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/39775
Date: Wed, 17 Dec 2008 11:15:38 +0100

 This patch avoids a bug in pdksh, if it is used to execute the configure 
 script. Otherwise, the module "pdfwriter" is missing from ghostscript. 
 It has been checked not to break the build on NetBSD 5.0_BETA.

 --- configure   2008/12/17 09:45:31     1.1
 +++ configure   2008/12/17 09:46:23
 @@ -10679,7 +10679,7 @@
   while test -n "$drivers"; do
          if echo $drivers |grep "," >/dev/null; then
                  THIS="`echo $drivers |sed -e 's/,.*//'`"
 -               drivers="`echo $drivers |sed -e \"s/$THIS,//\"`"
 +               drivers="`echo $drivers |sed -e "s/$THIS,//"`"
          else
                  THIS=$drivers
                  drivers=""

 Whis this fix applied, this PR can be closed, all other issues have 
 either been resolved or are local problems.

 -- 
   Jörn Clausen                             joern.clausen@uni-bielefeld.de
   Hochschulrechenzentrum                 http://www.uni-bielefeld.de/hrz/
   Universität Bielefeld

From: =?ISO-8859-1?Q?J=F6rn_Clausen?= <joern@uni-bielefeld.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/39775
Date: Tue, 17 Feb 2009 14:58:05 +0100

 This patch fixes the last remaining problem of this PR:

 --- Makefile    2009/02/17 13:09:00     1.1
 +++ Makefile    2009/02/17 13:47:32
 @@ -49,6 +49,10 @@
   CONFIGURE_ENV+=                ac_cv_func_fopen64=no
   .endif

 +.if ${OPSYS} == "SunOS"
 +TOOLS_PLATFORM.sh = /usr/bin/ksh
 +.endif
 +
   # On Linux-*-x86_64, there was an error message:
   # gp_unix.o: relocation R_X86_64_32 against `a local symbol' can not be
   # used when making a shared object; recompile with -fPIC


 Actually, it would suffice to exchange the shell that runs the configure 
 script. But this patch breaks nothing else (at the moment), so it's 
 better than nothing.

 -- 
   Jörn Clausen                             joern.clausen@uni-bielefeld.de
   Hochschulrechenzentrum                 http://www.uni-bielefeld.de/hrz/
   Universität Bielefeld

From: Jonathan Perkin <jonathan@perkin.org.uk>
To: gnats-bugs@NetBSD.org
Cc: solaris-pkg-people@NetBSD.org, gnats-admin@netbsd.org,
	pkgsrc-bugs@netbsd.org, joern.clausen@uni-bielefeld.de
Subject: Re: pkg/39775
Date: Tue, 17 Feb 2009 14:08:35 +0000

 * On 2009-02-17 at 14:00 GMT, Jörn Clausen wrote:

 >  This patch fixes the last remaining problem of this PR:
 >  
 >  --- Makefile    2009/02/17 13:09:00     1.1
 >  +++ Makefile    2009/02/17 13:47:32
 >  @@ -49,6 +49,10 @@
 >    CONFIGURE_ENV+=                ac_cv_func_fopen64=no
 >    .endif
 >  
 >  +.if ${OPSYS} == "SunOS"
 >  +TOOLS_PLATFORM.sh = /usr/bin/ksh
 >  +.endif
 >  +

 Why is this necessary?  We already set TOOLS_PLATFORM.sh to pdksh in
 bootstrap.

 -- 
 Jonathan Perkin                                     The NetBSD Project
 http://www.perkin.org.uk/                       http://www.netbsd.org/

From: =?ISO-8859-1?Q?J=F6rn_Clausen?= <joern@uni-bielefeld.de>
To: gnats-bugs@NetBSD.org, solaris-pkg-people@NetBSD.org,
 gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org, joern.clausen@uni-bielefeld.de
Cc: 
Subject: Re: pkg/39775
Date: Tue, 17 Feb 2009 15:14:59 +0100

 > Why is this necessary?  We already set TOOLS_PLATFORM.sh to pdksh in
 > bootstrap.

 Because there is obviously a bug in pdksh that causes the sed line 
 mentioned in the first mail to have a wrong syntax. Agreed, pdksh should 
 be fixed in the first place, but for the time being, this patch - 
 finally - allows ghostscript to be built without manual intervention on 
 Solaris.

 -- 
   Jörn Clausen                             joern.clausen@uni-bielefeld.de
   Hochschulrechenzentrum                 http://www.uni-bielefeld.de/hrz/
   Universität Bielefeld

State-Changed-From-To: open->closed
State-Changed-By: sketch@NetBSD.org
State-Changed-When: Mon, 23 Feb 2009 14:17:42 +0000
State-Changed-Why:
Package now builds with pdksh fixes.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.