Subject: pkg/22891: GCC3 and SunOS fixes for net/6tunnel
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <jonathan@perkin.org.uk>
List: netbsd-bugs
Date: 09/22/2003 14:55:00
>Number:         22891
>Category:       pkg
>Synopsis:       GCC3 and SunOS fixes for net/6tunnel
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 22 14:56: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:
Multi-line string literal breakage when compiling with GCC3.x, and
missing socket libraries when compiling on Solaris.

Both compile and install targets are overriden in Makefile (due to
simple package), so no changes sent back to authors.

Compile tested on SunOS-5.9/sparc and NetBSD-1.6ZC/sparc64.
>How-To-Repeat:
===> Building for 6tunnel-0.09
/home/jonp/pkg/gcc-3.3/bin/gcc -O -o /tmp/pkgsrc/net/6tunnel/work.build1/6tunnel/6tunnel /tmp/pkgsrc/net/6tunnel/work.build1/6tunnel/6tunnel.c
/tmp/pkgsrc/net/6tunnel/work.build1/6tunnel/6tunnel.c:432:19: missing terminating " character
/tmp/pkgsrc/net/6tunnel/work.build1/6tunnel/6tunnel.c: In function `usage':
/tmp/pkgsrc/net/6tunnel/work.build1/6tunnel/6tunnel.c:434: error: `I' undeclared (first use in this function)
/tmp/pkgsrc/net/6tunnel/work.build1/6tunnel/6tunnel.c:434: error: (Each undeclared identifier is reported only once
/tmp/pkgsrc/net/6tunnel/work.build1/6tunnel/6tunnel.c:434: error: for each function it appears in.)
/tmp/pkgsrc/net/6tunnel/work.build1/6tunnel/6tunnel.c:434: error: parse error before "pass"
/tmp/pkgsrc/net/6tunnel/work.build1/6tunnel/6tunnel.c:441:10: missing terminating ' character
/tmp/pkgsrc/net/6tunnel/work.build1/6tunnel/6tunnel.c:441:10: warning: character constant too long for its type
/tmp/pkgsrc/net/6tunnel/work.build1/6tunnel/6tunnel.c:442:46: missing terminating ' character
/tmp/pkgsrc/net/6tunnel/work.build1/6tunnel/6tunnel.c:442:46: warning: character constant too long for its type
/tmp/pkgsrc/net/6tunnel/work.build1/6tunnel/6tunnel.c:452:1: missing terminating " character
*** Error code 1

===> Building for 6tunnel-0.09
/home/jonp/pkg/gcc-3.3/bin/gcc -O -o /tmp/pkgsrc/net/6tunnel/work.build1/6tunnel/6tunnel /tmp/pkgsrc/net/6tunnel/work.build1/6tunnel/6tunnel.c
Undefined                       first referenced
 symbol                             in file
socket                              /var/tmp//ccgjw4u9.o
accept                              /var/tmp//ccgjw4u9.o
bind                                /var/tmp//ccgjw4u9.o
getaddrinfo                         /var/tmp//ccgjw4u9.o
setsockopt                          /var/tmp//ccgjw4u9.o
freeaddrinfo                        /var/tmp//ccgjw4u9.o
shutdown                            /var/tmp//ccgjw4u9.o
inet_ntop                           /var/tmp//ccgjw4u9.o
listen                              /var/tmp//ccgjw4u9.o
connect                             /var/tmp//ccgjw4u9.o
ld: fatal: Symbol referencing errors. No output written to /tmp/pkgsrc/net/6tunnel/work.build1/6tunnel/6tunnel
collect2: ld returned 1 exit status
*** Error code 1
>Fix:
http://www.perkin.org.uk/projects/netbsd/6tunnel.diff

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/net/6tunnel/Makefile,v
retrieving revision 1.4
diff -u -r1.4 Makefile
--- Makefile	2003/07/17 22:50:56	1.4
+++ Makefile	2003/09/22 14:47:39
@@ -9,8 +9,14 @@
 MAINTAINER=	zuntum@NetBSD.org
 COMMENT=	v4/v6 protocol translation
 
+.include "../../mk/bsd.prefs.mk"
+
+.if ${OPSYS} == "SunOS"
+LDFLAGS+=	-lsocket -lnsl
+.endif
+
 do-build:
-	${CC} ${CFLAGS} -o ${WRKSRC}/6tunnel ${WRKSRC}/6tunnel.c
+	${CC} ${CFLAGS} -o ${WRKSRC}/6tunnel ${WRKSRC}/6tunnel.c ${LDFLAGS}
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/6tunnel ${PREFIX}/bin
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/net/6tunnel/distinfo,v
retrieving revision 1.3
diff -u -r1.3 distinfo
--- distinfo	2001/10/23 20:23:09	1.3
+++ distinfo	2003/09/22 14:47:39
@@ -2,3 +2,4 @@
 
 SHA1 (6tunnel-0.09.tar.gz) = 6af871f4f225372c5f41c2bc097fd173e16ae683
 Size (6tunnel-0.09.tar.gz) = 7389 bytes
+SHA1 (patch-aa) = a3c79786326afcdd65c99aa8284ec05e54e0654e
--- /dev/null	2003-09-22 15:47:55.000000000 +0100
+++ patches/patch-aa	2003-09-22 15:46:42.228845000 +0100
@@ -0,0 +1,52 @@
+$NetBSD$
+
+--- 6tunnel.c.orig	Mon Sep 22 14:57:59 2003
++++ 6tunnel.c	Mon Sep 22 15:02:38 2003
+@@ -429,27 +429,27 @@
+ 
+ void usage(char *a0)
+ {
+-  fprintf(stderr, "\
+-usage: %s [-146dqvh] [-s sourcehost] [-l localhost] [-i pass]
+-           [-I pass] [-m mapfile] [-L limit] [-A filename]
+-	   localport remotehost [remoteport]
+-	   
+-  -1  allow only one connection and quit
+-  -4  preffer IPv4 endpoints
+-  -6  bind to IPv6 address
+-  -v  be verbose
+-  -d  don't detach
+-  -f  force tunneling (even if remotehost isn't resolvable)
+-  -s  connect using specified address
+-  -l  bind to specified address
+-  -i  act like irc proxy and ask for password
+-  -I  send specified password to the irc server
+-  -h  print hex dump of packets
+-  -m  map specified IPv4 addresses to different IPv6 addresses (see manpage)
+-  -L  limit simultanous connections
+-  -A  create apache-like log file
++  fprintf(stderr, "\n"
++"usage: %s [-146dqvh] [-s sourcehost] [-l localhost] [-i pass]\n"
++"           [-I pass] [-m mapfile] [-L limit] [-A filename]\n"
++"	   localport remotehost [remoteport]\n"
++"\n"
++"  -1  allow only one connection and quit\n"
++"  -4  preffer IPv4 endpoints\n"
++"  -6  bind to IPv6 address\n"
++"  -v  be verbose\n"
++"  -d  don't detach\n"
++"  -f  force tunneling (even if remotehost isn't resolvable)\n"
++"  -s  connect using specified address\n"
++"  -l  bind to specified address\n"
++"  -i  act like irc proxy and ask for password\n"
++"  -I  send specified password to the irc server\n"
++"  -h  print hex dump of packets\n"
++"  -m  map specified IPv4 addresses to different IPv6 addresses (see manpage)\n"
++"  -L  limit simultanous connections\n"
++"  -A  create apache-like log file\n"
++"\n", a0);
+ 
+-", a0);
+ 
+ }
+
>Release-Note:
>Audit-Trail:
>Unformatted: