Subject: pkg/22889: Fix build of misc/cstream on Solaris
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <jonathan@perkin.org.uk>
List: netbsd-bugs
Date: 09/22/2003 12:18:50
>Number: 22889
>Category: pkg
>Synopsis: Fix build of misc/cstream on Solaris
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: pkg-manager
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Sep 22 12:19: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:
Solaris needs the usual network libraries to get this to compile, plus
a compatability define for the missing INADDR_NONE
>How-To-Repeat:
===> Building for cstream-2.2
Making all in auxdir
Making all in tests
/home/jonp/pkg/gcc-3.3/bin/gcc -DPACKAGE=\"cstream\" -DVERSION=\"2.2\" -DHAVE_LIBM=1 -DSTDC_HEADERS=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_FCNTL_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1 -DHAVE_POLL_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_SOCKLEN_T=1 -DRETSIGTYPE=void -DHAVE_GETTIMEOFDAY=1 -DHAVE_MKFIFO=1 -DHAVE_STRDUP=1 -I. -I. -O -c cstream.c
cstream.c: In function `open_tcp':
cstream.c:325: error: `INADDR_NONE' undeclared (first use in this function)
cstream.c:325: error: (Each undeclared identifier is reported only once
cstream.c:325: error: for each function it appears in.)
*** Error code 1
[...]
/home/jonp/pkg/gcc-3.3/bin/gcc -O -Wl,-R/home/jonp/bulk/pkg/lib -L/home/jonp/bulk/pkg/lib -o cstream cstream.o -lm
Undefined first referenced
symbol in file
socket cstream.o
gethostbyname cstream.o
accept cstream.o
bind cstream.o
inet_addr cstream.o
herror cstream.o
listen cstream.o
connect cstream.o
ld: fatal: Symbol referencing errors. No output written to cstream
collect2: ld returned 1 exit status
*** Error code 1
>Fix:
http://www.perkin.org.uk/projects/netbsd/cstream.diff
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/misc/cstream/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- Makefile 2003/07/17 21:48:51 1.3
+++ Makefile 2003/09/22 12:15:50
@@ -10,4 +10,10 @@
GNU_CONFIGURE= yes
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "SunOS"
+LDFLAGS+= -lsocket -lnsl -lresolv
+.endif
+
.include "../../mk/bsd.pkg.mk"
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/misc/cstream/distinfo,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 distinfo
--- distinfo 2001/09/19 05:24:27 1.1.1.1
+++ distinfo 2003/09/22 12:15:50
@@ -2,3 +2,4 @@
SHA1 (cstream-2.2.tar.gz) = aef89176123f1ae6cb824e66b2e9b3aa3be7644e
Size (cstream-2.2.tar.gz) = 43124 bytes
+SHA1 (patch-aa) = f531a2cc1a7736930cc74d2200c9a7ea305db971
--- /dev/null Mon Sep 22 13:15:51 2003
+++ patches/patch-aa Mon Sep 22 13:12:03 2003
@@ -1,0 +1,16 @@
+$NetBSD$
+
+--- cstream.c.orig Wed Jul 11 16:13:05 2001
++++ cstream.c Mon Sep 22 13:11:17 2003
+@@ -71,6 +71,11 @@
+ #endif
+ #endif /* HAVE_POLL_H */
+
++/* Solaris needs this */
++#ifndef INADDR_NONE
++#define INADDR_NONE 0xffffffff
++#endif
++
+ #ifndef NOSOUND
+ #ifdef HAVE_MACHINE_SOUNDCARD_H
+ #include <machine/soundcard.h>
>Release-Note:
>Audit-Trail:
>Unformatted: