Subject: pkg/12055: ucd-snmp doesn't build anymore, due to failures to detect sys/disklabel.h
To: None <gnats-bugs@gnats.netbsd.org>
From: None <bernd@arresum.inka.de>
List: netbsd-bugs
Date: 01/27/2001 12:05:19
>Number:         12055
>Category:       pkg
>Synopsis:       ucd-snmp doesn't build anymore
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 27 12:08:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Bernd Ernesti
>Release:        NetBSD-current 27-Jan-2001
>Organization:
	
>Environment:
	
System: NetBSD arresum.veego.de 1.5R NetBSD 1.5R (ARRESUM) #549: Sat Jan 27 18:15:39 CET 2001 bernd@arresum.veego.de:/obj_i386/sys/arch/i386/compile/ARRESUM i386
Architecture: i386
Machine: i386
>Description:
	Try to build ucd-snmp on a -current system and notice the build error.

	The configure script tries to check if we have a <sys/disklabel.h>,
	but that check fails:

checking for sys/disklabel.h... no

[config.log]
configure:3943: checking for sys/disklabel.h
configure:3953: cc -E  conftest.c >/dev/null 2>conftest.out
In file included from configure:3949:
/usr/include/sys/disklabel.h:80: warning: `DISKUNIT' redefined
/usr/include/machine/disklabel.h:48: warning: this is the location of the previous definition
/usr/include/sys/disklabel.h:81: warning: `DISKPART' redefined
/usr/include/machine/disklabel.h:50: warning: this is the location of the previous definition
/usr/include/sys/disklabel.h:83: warning: `DISKMINOR' redefined
/usr/include/machine/disklabel.h:53: warning: this is the location of the previous definition
configure: failed program was:
#line 3948 "configure"
#include "confdefs.h"
#include <sys/disklabel.h>

[..]
/usr/pkg/bin/libtool  cc -c -I. -I../.. -I. -I./../..  -I./../../snmplib -I./.. -I..  -fPIC -shared -DINET6 -O2 -Dnetbsd1 -Dnetbsd1 -Dnetbsd -o host/hr_disk.o host/hr_disk.c
rm -f host/.libs/hr_disk.lo
cc -c -I. -I../.. -I. -I./../.. -I./../../snmplib -I./.. -I.. -fPIC -shared -DINET6 -O2 -Dnetbsd1 -Dnetbsd1 -Dnetbsd host/hr_disk.c  -fPIC -DPIC -o host/.libs/hr_disk.lo
host/hr_disk.c: In function `Save_HR_Disk_Specific':
host/hr_disk.c:436: invalid use of undefined type `struct disklabel'
host/hr_disk.c: In function `Save_HR_Disk_General':
host/hr_disk.c:453: `dktypenames' undeclared (first use in this function)
host/hr_disk.c:453: (Each undeclared identifier is reported only once
host/hr_disk.c:453: for each function it appears in.)
host/hr_disk.c:453: invalid use of undefined type `struct disklabel'
host/hr_disk.c: In function `Query_Disk':
host/hr_disk.c:490: sizeof applied to an incomplete type
host/hr_disk.c: At top level:
host/hr_disk.c:107: storage size of `HRD_info' isn't known
*** Error code 1

Stop.

Another error is that it tries to install a snmptrapd file, but there is none
in the files directory.

/usr/bin/sed 's,@PREFIX@,/usr/pkg,g' < /pkgsrc/net/ucd-snmp/files/snmptrapd.sh > /pkgsrc/net/ucd-snmp/work.i386/snmptrapd
cannot open /pkgsrc/net/ucd-snmp/files/snmptrapd.sh: no such file
*** Error code 2

>How-To-Repeat:
	cd pkgsrc/net/ucd-snmp && make
>Fix:
	Enabling the disklabel.h support in config.h made it possible to compile
	the package (after removing the snmptrapd file from the PLIST and the package
	Makefile).
	From looking in the header file for sys/disklabel.h and machine/disklabel.h
	it looks like the check for sys/disklabel.h would succeed if it also includes
	machine/types.h during the check.
>Release-Note:
>Audit-Trail:
>Unformatted: