DragonFly BSD
DragonFly bugs List (threaded) for 2005-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: Package net-mgmt/net-snmp is broken by numerous changes in DF headers


From: walt <wa1ter@xxxxxxxxxxxxx>
Date: Thu, 6 Jan 2005 10:04:23 -0800


On Thu, 6 Jan 2005, Adrian Bocaniciu wrote:

> Justin C. Sherrill wrote:
> > for, hasn't been cleaned up this way, so the port breaks.  I recall
> > mention of net-snmp on the lists before, so it may be worth checking to
> > see if anyone submitted patches that haven't been brought into a dfport
> > override yet.  If you want to work on it more, you can try submitting
>
> 	I looked at the messages posted to the "submit" group and I have seen
> nothing...

Someone here posted a link to his ftp server, I think it was in September
because the date on this file is 20Sep.  Whoever you were, thank you, and
please claim credit for this work.

This file seems to include a recipe as well as diffs.  I assume (?) that
all this is meant to happen after the build fails, but I'm guessing.
==================================================================
add a include/net-snmp/system/dragonfly.h with
--8<---
#include "freebsd4.h"

/*
 * dragonfly1 is a superset of freebsd4
 */
#define	freebsd4 1

#define	_KERNEL_STRUCTURES
-->8--
in it

use autoconf259 to generate a new configure

diff -ru net-snmp-5.2.pre1/aclocal.m4 net-snmp-5.2.pre1.m/aclocal.m4
--- net-snmp-5.2.pre1/aclocal.m4	2003-02-13 17:01:23.000000000 +0100
+++ net-snmp-5.2.pre1.m/aclocal.m4	2004-09-20 01:36:41.000000000 +0200
@@ -55,6 +55,45 @@
 fi
 ]) dnl

+dnl @synopsis AC_CHECK_FOR_STRUCT(INCLUDES,STRUCT,DEFINE,[no])
+dnl
+dnl Checks for STRUCT and defines DEFINE to it if found.
+dnl
+dnl @version 1.15
+dnl @author Wes Hardaker <hardaker@xxxxxxxxxxxxxxxxxxxxx>
+dnl @author Simon 'corecode' Schubert <corecode@xxxxxxxxxxxx>
+dnl
+AC_DEFUN(AC_CHECK_FOR_STRUCT,[
+
+ac_safe_struct=`echo "$2" | sed 'y%./+-%__p_%'`
+ac_safe_all="ac_cv_have_struct_${ac_safe_struct}"
+changequote(, )dnl
+  ac_uc_define=HAVE_STRUCT_`echo "${ac_safe_struct}" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+changequote([, ])dnl
+
+AC_MSG_CHECKING([for struct $2])
+AC_CACHE_VAL($ac_safe_all,
+[
+AC_TRY_COMPILE([
+$1
+],[
+struct $2 testit;
+], eval "${ac_safe_all}=yes", eval "${ac_safe_all}=no" )
+])
+
+if eval "test \"x$`echo ${ac_safe_all}`\" = \"xyes\""; then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE_UNQUOTED($ac_uc_define)
+if test "x$3" = "x"; then :; else
+  safe_define=STRUCT_`echo "$3" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  AC_DEFINE_UNQUOTED($safe_define, struct $2)
+fi
+else
+  AC_MSG_RESULT(no)
+fi
+
+])
+
 dnl @synopsis AC_CHECK_STRUCT_FOR(INCLUDES,STRUCT,MEMBER,DEFINE,[no])
 dnl
 dnl Checks STRUCT for MEMBER and defines DEFINE if found.
@@ -81,10 +120,15 @@
 else
   defineit="$4"
 fi
+struct_alias=STRUCT_`echo "${ac_safe_struct}" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
 AC_TRY_COMPILE([
 $1
 ],[
-struct $2 testit;
+#if defined($struct_alias)
+$struct_alias testit;
+#else
+struct $2 testit;
+#endif
 testit.$3 $defineit;
 ], eval "${ac_safe_all}=yes", eval "${ac_safe_all}=no" )
 ])
diff -ru net-snmp-5.2.pre1/agent/mibgroup/mibII/ip.c net-snmp-5.2.pre1.m/agent/mibgroup/mibII/ip.c
--- net-snmp-5.2.pre1/agent/mibgroup/mibII/ip.c	2004-06-28 03:33:22.000000000 +0200
+++ net-snmp-5.2.pre1.m/agent/mibgroup/mibII/ip.c	2004-09-20 01:41:51.000000000 +0200
@@ -201,6 +201,11 @@
 #define	USES_TRADITIONAL_IPSTAT
 #endif

+#ifdef HAVE_STRUCT_IP_STATS
+#define	IP_STAT_STRUCTURE	struct ip_stats
+#define	USES_TRADITIONAL_IPSTAT
+#endif
+
 #if !defined(IP_STAT_STRUCTURE)
 #define IP_STAT_STRUCTURE	struct ipstat
 #define	USES_TRADITIONAL_IPSTAT
diff -ru net-snmp-5.2.pre1/agent/mibgroup/mibII/tcp.c net-snmp-5.2.pre1.m/agent/mibgroup/mibII/tcp.c
--- net-snmp-5.2.pre1/agent/mibgroup/mibII/tcp.c	2004-06-28 03:33:22.000000000 +0200
+++ net-snmp-5.2.pre1.m/agent/mibgroup/mibII/tcp.c	2004-09-20 02:19:21.000000000 +0200
@@ -165,6 +165,11 @@
 #define USES_TRADITIONAL_TCPSTAT
 #endif

+#ifdef HAVE_STRUCT_IP_STATS
+#define	TCP_STAT_STRUCTURE	struct tcp_stats
+#define	USES_TRADITIONAL_TCPSTAT
+#endif
+
 #if !defined(TCP_STAT_STRUCTURE)
 #define TCP_STAT_STRUCTURE	struct tcpstat
 #define USES_TRADITIONAL_TCPSTAT
diff -ru net-snmp-5.2.pre1/configure.in net-snmp-5.2.pre1.m/configure.in
--- net-snmp-5.2.pre1/configure.in	2004-09-02 07:03:54.000000000 +0200
+++ net-snmp-5.2.pre1.m/configure.in	2004-09-19 20:34:55.000000000 +0200
@@ -2936,6 +2936,17 @@
 #endif
 ],nlist,n_value)

+# check for struct ip_stats
+AC_CHECK_FOR_STRUCT([
+#include <sys/types.h>
+#if HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#if HAVE_NETINET_IP_VAR_H
+#include <netinet/ip_var.h>
+#endif
+], ip_stats, ipstat)
+
 # check struct ipstat for various things
 AC_CHECK_STRUCT_FOR([
 #include <sys/types.h>
diff -ru net-snmp-5.2.pre1/include/net-snmp/net-snmp-config.h.in net-snmp-5.2.pre1.m/include/net-snmp/net-snmp-config.h.in
--- net-snmp-5.2.pre1/include/net-snmp/net-snmp-config.h.in	2004-09-02 07:16:35.000000000 +0200
+++ net-snmp-5.2.pre1.m/include/net-snmp/net-snmp-config.h.in	2004-09-20 01:43:28.000000000 +0200
@@ -1081,6 +1081,8 @@
 #undef STRUCT_NLIST_HAS_N_VALUE

 /* ipstat structure tests */
+#undef HAVE_STRUCT_IP_STATS
+
 #undef STRUCT_IPSTAT_HAS_IPS_CANTFORWARD
 #undef STRUCT_IPSTAT_HAS_IPS_CANTFRAG
 #undef STRUCT_IPSTAT_HAS_IPS_DELIVERED



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]