Subject: toolchain/23259: sunlabel fails to build as host tool
To: None <gnats-bugs@gnats.netbsd.org>
From: None <dmcmahill@netbsd.org>
List: netbsd-bugs
Date: 10/24/2003 08:08:28
>Number:         23259
>Category:       toolchain
>Synopsis:       sunlabel fails to build as host tool
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 24 12:09:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Dan McMahill
>Release:        NetBSD 20031020
>Organization:
NetBSD
>Environment:
Solaris-2.6/sparc with gcc-2.95.1

	
	
System: NetBSD bondage 1.6.1 NetBSD 1.6.1 (BONDAGE) #0: Mon Apr 21 18:28:45 EDT 2003 dan@bondage:/export/disk1/src/src-netbsd-1-6-1/sys/arch/alpha/compile/BONDAGE alpha
Architecture: alpha
Machine: alpha
>Description:

I'm trying to crossbuild NetBSD with Solaris as the host OS.

When building the cross toolchain with build.sh,
sunlabel fails to compile because termcap.h isn't present.

	
>How-To-Repeat:

env HOST_CC=gcc ./build.sh -m i386 -T /export/home1/software/build/tools \
    -D /export/home1/software/build/destdir.i386 \
    -R /export/home1/software/build/release/i386 release

	
>Fix:

the following makes sunlabel build on solaris but breaks netbsd so its obviously
not the right answer but its a start.  Maybe there should be some autoconf test
for termios and/or termcap to get the right thing here.

Index: usr.sbin/sunlabel/sunlabel.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/sunlabel/sunlabel.c,v
retrieving revision 1.11
diff -u -2 -r1.11 sunlabel.c
--- usr.sbin/sunlabel/sunlabel.c        2003/07/13 12:12:58     1.11
+++ usr.sbin/sunlabel/sunlabel.c        2003/10/23 21:34:59
@@ -37,4 +37,8 @@
  */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
@@ -47,5 +51,5 @@
 #include <stdlib.h>
 #include <unistd.h>
-#include <termcap.h>
+#include <termios.h>
 #include <string.h>
 #include <strings.h>
	
>Release-Note:
>Audit-Trail:
>Unformatted: