Subject: pkg/26153: net-snmp won't build
To: None <>
From: Masahiro =Rhythm Drive= Ishiyama <>
List: pkgsrc-bugs
Date: 07/04/2004 04:31:05
>Number:         26153
>Category:       pkg
>Synopsis:       net-snmp won't build
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 03 19:32:00 UTC 2004
>Originator:     Masahiro Ishiyama
>Release:        Darwin 7.4.0
System: Darwin grayswandir 7.4.0 Darwin Kernel Version 7.4.0: Wed May 12 16:58:24 PDT 2004; root:xnu/xnu-517.7.7.obj~7/RELEASE_PPC Power Macintosh powerpc
Architecture: powerpc
Machine: Power Macintosh

	net/net-snmp gets compilation errors on Darwin 7.4.0 (Mac OS X 10.3.4).

masahiro@grayswandir[net-snmp] bmake
===> Checking for vulnerabilities in net-snmp-5.1.1nb1
===> Building for net-snmp-5.1.1nb1
/bin/sh ../../libtool --mode=compile gcc -I../../include -I../../include  -I. -I.. -I../.. -I. -I./..   -I./../mibgroup -I./../.. -I./../../snmplib  -no-cpp-precomp -I/usr/include -I/usr/pkg/include  -DINET6 -O2 -I/usr/include -I/usr/pkg/include -Ddarwin -c -o baby_steps.lo baby_steps.c
 gcc -I../../include -I. -I.. -I../.. -I./.. -I./../mibgroup -I./../.. -I./../../snmplib -no-cpp-precomp -I/UFS/pkgsrc/net/net-snmp/work/.buildlink/include -DINET6 -O2 -Ddarwin -c baby_steps.c  -fno-common -DPIC -o .libs/baby_steps.o
In file included from ../../include/net-snmp/agent/net-snmp-agent-includes.h:10,
                 from baby_steps.c:7:
../../include/net-snmp/agent/snmp_vars.h:80: error: parse error before "ipaddr_return"
../../include/net-snmp/agent/snmp_vars.h:80: warning: data definition has no type or storage class
*** Error code 1

bmake: stopped in /UFS/pkgsrc/net/net-snmp/work/net-snmp-5.1.1/agent/helpers
*** Error code 1


	In addition,

/bin/sh ../../libtool --mode=compile gcc -I../../include -I../../include  -I. -I../.. -I. -I./../..  -I./../../snmplib -I./.. -I.. -no-cpp-precomp -I/usr/include -I/usr/pkg/include  -DINET6 -O2 -I/usr/include -I/usr/pkg/include -Ddarwin -c 
-o mibII/tcpTable.lo mibII/tcpTable.c
 gcc -I../../include -I. -I../.. -I./../.. -I./../../snmplib -I./.. -I.. -no-cpp-precomp -I/UFS/pkgsrc/net/net-snmp/work/.buildlink/include -DINET6 -O2 -Ddarwin -c mibII/tcpTable.c  -fno-common -DPIC -o mibII/.libs/tcpTable.o
mibII/tcpTable.c: In function `tcpTable_load':
mibII/tcpTable.c:725: error: structure has no member named `xt_tp'
mibII/tcpTable.c:729: error: structure has no member named `xt_inp'
*** Error code 1

bmake: stopped in /UFS/pkgsrc/net/net-snmp/work/net-snmp-5.1.1/agent/mibgroup
*** Error code 1


	cd /usr/pkgsrc/net/net-snmp; bmake

	Should I wait a new release? I applied the following patches
	to build it anyway.

diff -ru work/net-snmp-5.1.1/agent/mibgroup/mibII/tcpTable.c work.bak/net-snmp-5.1.1/agent/mibgroup/mibII/tcpTable.c
--- work/net-snmp-5.1.1/agent/mibgroup/mibII/tcpTable.c	Sun Jul  4 01:36:11 2004
+++ work.bak/net-snmp-5.1.1/agent/mibgroup/mibII/tcpTable.c	Sun Jul  4 01:35:25 2004
@@ -276,7 +276,11 @@
 TCP_Count_Connections( void ) {
+#if defined(__MACH__) && defined(__APPLE__) && defined(__ppc__)
+    return 0;
     return tcp_estab;
diff -ru work/net-snmp-5.1.1/include/net-snmp/agent/snmp_vars.h work.bak/net-snmp-5.1.1/include/net-snmp/agent/snmp_vars.h
--- work/net-snmp-5.1.1/include/net-snmp/agent/snmp_vars.h	Tue Mar 16 08:27:45 2004
+++ work.bak/net-snmp-5.1.1/include/net-snmp/agent/snmp_vars.h	Sun Jul  4 01:09:35 2004
@@ -5,6 +5,10 @@
 #ifndef _SNMP_VARS_H_
 #define _SNMP_VARS_H_
+#if defined(__MACH__) && defined(__APPLE__) && defined(__ppc__)
+#include <stdint.h>
 #ifdef __cplusplus
 extern          "C" {


Index: Makefile
RCS file: /cvsroot/pkgsrc/net/net-snmp/Makefile,v
retrieving revision 1.21
diff -u -r1.21 Makefile
--- Makefile	31 May 2004 11:47:29 -0000	1.21
+++ Makefile	3 Jul 2004 17:41:04 -0000
@@ -78,6 +78,10 @@
 CONFIGURE_ARGS+=	--enable-ucd-snmp-compatibility
+.if (${OPSYS} == "Darwin")
+CONFIGURE_ARGS+=	 --with-out-mib-modules="mibII/tcpTable mibII/udpTable"
 .if (${OPSYS} == "NetBSD") || !exists(/usr/bin/lpstat)