Subject: pkg/16030: graphics/netpbm-9.25 tweaks for building on older a.out systems
To: None <gnats-bugs@gnats.netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 03/23/2002 20:26:58
>Number:         16030
>Category:       pkg
>Synopsis:       graphics/netpbm-9.25 tweaks for building on older a.out systems
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Mar 23 17:28:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Greg A. Woods
>Release:        pkgsrc-2002/03/22
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
System: NetBSD 1.3.3
Architecture: i386
Machine: i386
>Description:

	graphics/netpbm-9.25 doesn't build on 1.3.x i386 (and presumably
	not on any older a.out systems)

>How-To-Repeat:

	the build dies with a complaint about __DYNAMIC not being
	defined while building a shared library.

	once that's fixed another crash due to u_long being hidden by an
	out-of-place/incorrect  #define _XOPEN_SOURCE

>Fix:

	apply the following patch in pkgsrc/graphics/netpbm

	(why does '-nostdlib' have to come first?)

	(I'm not sure why the second patch isn't necessary on all
	platforms since even on -current defining _XOPEN_SOURCE hides
	u_long)

Index: distinfo
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/graphics/netpbm/distinfo,v
retrieving revision 1.7
diff -c -u -r1.7 distinfo
--- distinfo	20 Mar 2002 12:42:11 -0000	1.7
+++ distinfo	24 Mar 2002 01:23:39 -0000
@@ -2,4 +2,5 @@
 
 SHA1 (netpbm-9.25.tgz) = 9c7f6a98348a5f3d6e908b514f33498b2a9c359a
 Size (netpbm-9.25.tgz) = 2052922 bytes
-SHA1 (patch-aa) = b8e3b12a2bc9f65c08b0836e8bc384db1ef66b9f
+SHA1 (patch-aa) = 118cfb177c41c168ab2e6c0365b7cf05b8e4178d
+SHA1 (patch-ab) = 42a6dbfe24447132c6dd654512607c0c9c4a5699
Index: patches/patch-aa
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/graphics/netpbm/patches/patch-aa,v
retrieving revision 1.17
diff -c -u -r1.17 patch-aa
--- patches/patch-aa	20 Mar 2002 12:42:12 -0000	1.17
+++ patches/patch-aa	24 Mar 2002 01:23:34 -0000
@@ -20,6 +20,18 @@
  #Solaris:
  #INSTALL = /usr/ucb/install
  #Tru64:
+@@ -64,9 +64,9 @@
+ 
+ # STRIPFLAG is the option you pass to the above install program to make it
+ # strip unnecessary information out of binaries.
+-STRIPFLAG = -s
++#STRIPFLAG = -s
+ # If you don't want to strip the binaries, just leave it null:
+-#STRIPFLAG = 
++STRIPFLAG = 
+ 
+ SYMLINK = ln -s
+ # At least some Windows environments don't have any concept of symbolic
 @@ -137,10 +137,10 @@
  # the directory information in the executable at link time.
  
@@ -34,7 +46,7 @@
  # Eunice users may want to use -noshare so that the executables can
  # run standalone:
  #LDFLAGS = -noshare
-@@ -156,9 +156,9 @@
+@@ -156,16 +156,16 @@
  
  ifeq ($(NEED_RUNTIME_PATH),Y)
  #If the linker is gcc (e.g. NetBSD):
@@ -46,6 +58,14 @@
  endif
  
  # Linker options for created Netpbm shared libraries.
+ 
+ # Here, $(SONAME) resolves to the soname for the shared library being created.
+ # The following are gcc options.  This works on GNU libc systems.
+-LDSHLIB = -shared -Wl,-soname,$(SONAME)
++LDSHLIB = -nostdlib -shared -Wl,-Bshareable,-soname,$(SONAME)
+ # You need -nostart instead of -shared on BeOS.  Though the BeOS compiler is
+ # ostensibly gcc, it has the -nostart option, which is not mentioned in gcc
+ # documentation and doesn't exist in at least one non-BeOS installation.
 @@ -182,9 +182,9 @@
  
  ifeq ($(NEED_RUNTIME_PATH),Y)
Index: patches/patch-ab
===================================================================
RCS file: patches/patch-ab
diff -N patches/patch-ab
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-ab	24 Mar 2002 00:21:27 -0000
@@ -0,0 +1,18 @@
+# $NetBSD$
+
+--- ppm/ppmtompeg/param.c-orig	Fri Aug 31 16:49:01 2001
++++ ppm/ppmtompeg/param.c	Sat Mar 23 19:20:02 2002
+@@ -11,13 +11,6 @@
+ 
+ /* COPYRIGHT INFORMATION IS AT THE END OF THIS FILE */
+ 
+-#define _XOPEN_SOURCE 1
+-    /* This makes sure popen() is in stdio.h.  In GNU libc 2.1.3, 
+-     _POSIX_C_SOURCE = 2 is sufficient, but on AIX 4.3, the higher level
+-     _XOPEN_SOURCE is required.  2000.09.09 
+-    */
+-
+-
+ /*==============*
+  * HEADER FILES *
+  *==============*/
>Release-Note:
>Audit-Trail:
>Unformatted: