Subject: pkg/22893: SunOS build fix for net/bing
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <jonathan@perkin.org.uk>
List: netbsd-bugs
Date: 09/22/2003 15:23:16
>Number:         22893
>Category:       pkg
>Synopsis:       SunOS build fix for net/bing
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 22 15:24:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Jonathan Perkin
>Release:        N/A
>Organization:
British Broadcasting Corporation
>Environment:
SunOS build1 5.9 Generic_112233-01 sun4u sparc SUNW,UltraSPARC-IIi-cEngine
>Description:
bing needs socket libraries to compile on Solaris (is already commented
out with a comment in package Makefile, and no auto*, so no possibility
of submitting back to author).

Tested on SunOS-5.9/sparc and NetBSD-1.6ZC/sparc64.
>How-To-Repeat:
===> Building for bing-1.0.4
/home/jonp/pkg/gcc-3.3/bin/gcc -O  -o bing bing.c
Undefined			first referenced
 symbol  			    in file
socket                              /var/tmp//ccEEcm3D.o
getprotobyname                      /var/tmp//ccEEcm3D.o
gethostbyname                       /var/tmp//ccEEcm3D.o
setsockopt                          /var/tmp//ccEEcm3D.o
gethostbyaddr                       /var/tmp//ccEEcm3D.o
inet_addr                           /var/tmp//ccEEcm3D.o
sendto                              /var/tmp//ccEEcm3D.o
inet_ntoa                           /var/tmp//ccEEcm3D.o
recvfrom                            /var/tmp//ccEEcm3D.o
ld: fatal: Symbol referencing errors. No output written to bing
collect2: ld returned 1 exit status
*** Error code 1
>Fix:
http://www.perkin.org.uk/projects/netbsd/bing.diff

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/net/bing/Makefile,v
retrieving revision 1.15
diff -u -r1.15 Makefile
--- Makefile	2003/07/17 22:51:01	1.15
+++ Makefile	2003/09/22 15:19:33
@@ -10,6 +10,12 @@
 HOMEPAGE=	http://www.cnam.fr/reseau/bing.html
 COMMENT=	Bing is a point-to-point bandwith measurement tool
 
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "SunOS"
+LDFLAGS+=	-lsocket -lnsl
+.endif
+
 post-install:
 	${INSTALL_DATA_DIR} ${PREFIX}/share/doc/bing
 	${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/bing
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/net/bing/distinfo,v
retrieving revision 1.3
diff -u -r1.3 distinfo
--- distinfo	2003/01/19 07:29:41	1.3
+++ distinfo	2003/09/22 15:19:33
@@ -2,5 +2,5 @@
 
 SHA1 (bing-1.0.4.tar.gz) = 21954516f4b72895ad7be96d320581510a186b33
 Size (bing-1.0.4.tar.gz) = 27069 bytes
-SHA1 (patch-aa) = ca7016c67815b3d4e2a524ba88fefd25a482c941
+SHA1 (patch-aa) = e5dc4b78498674beacaecaf63f9799a4260c8187
 SHA1 (patch-ab) = ef75a8cd00011b09cef6668228e7e34899984c4b
Index: patches/patch-aa