diff -ruN net-snmp-5.0.7.orig/Makefile.in net-snmp-5.0.7/Makefile.in
--- net-snmp-5.0.7.orig/Makefile.in	Mon Jan  6 09:16:00 2003
+++ net-snmp-5.0.7/Makefile.in	Mon Oct 27 11:28:09 2003
@@ -53,7 +53,7 @@
 # local build rules
 #
 sedscript: sedscript.in include/net-snmp/net-snmp-config.h $(srcdir)/agent/mibgroup/mibdefs.h
-	$(CPP) -DPREFIX=$(prefix) -DLIBDIR=$(libdir) -DDATADIR=$(datadir) $(srcdir)/sedscript.in | egrep '^s[/#]' | sed 's/REMOVEME//g;s# */#/#g;s/ *#/#/g;s#/ *#/#g;s/# g/#g/;' > sedscript
+	$(CPP) -no-cpp-precomp -DPREFIX=$(prefix) -DLIBDIR=$(libdir) -DDATADIR=$(datadir) $(srcdir)/sedscript.in | egrep '^s[/#]' | sed 's/REMOVEME//g;s# */#/#g;s/ *#/#/g;s#/ *#/#g;s/# g/#g/;' > sedscript
 
 EXAMPLE.conf: sedscript EXAMPLE.conf.def
 	$(SED) -f sedscript $(srcdir)/EXAMPLE.conf.def > EXAMPLE.conf
@@ -112,11 +112,11 @@
 	@if test ! -f perl/Makefile; then \
 	  (dir=`pwd`; \
 	   cd perl ; \
-	   perl Makefile.PL -NET-SNMP-IN-SOURCE=true -NET-SNMP-CONFIG="sh $$dir/net-snmp-config") ; \
+	   perl Makefile.PL -NET-SNMP-IN-SOURCE=true -NET-SNMP-CONFIG="sh $$dir/net-snmp-config" PREFIX=@FINKPREFIX@ INSTALLPRIVLIB=@FINKPREFIX@/lib/perl5 INSTALLARCHLIB=@FINKPREFIX@/lib/perl5/darwin INSTALLSITELIB=@FINKPREFIX@/lib/perl5 INSTALLSITEARCH=@FINKPREFIX@/lib/perl5/darwin INSTALLMAN1DIR=@FINKPREFIX@/share/man/man1 INSTALLMAN3DIR=@FINKPREFIX@/share/man/man3 INSTALLSITEMAN1DIR=@FINKPREFIX@/share/man/man1 INSTALLSITEMAN3DIR=@FINKPREFIX@/share/man/man3 INSTALLBIN=@FINKPREFIX@/bin INSTALLSITEBIN=@FINKPREFIX@/bin INSTALLSCRIPT=@FINKPREFIX@/bin ) ; \
         fi ; \
 
 perlinstall:
-	@(cd perl ; $(MAKE) install) ; \
+	@(cd perl ; $(MAKE) install PREFIX=@FINKINSTALL@ INSTALLPRIVLIB=@FINKINSTALL@/lib/perl5 INSTALLARCHLIB=@FINKINSTALL@/lib/perl5/darwin INSTALLSITELIB=@FINKINSTALL@/lib/perl5 INSTALLSITEARCH=@FINKINSTALL@/lib/perl5/darwin INSTALLMAN1DIR=@FINKINSTALL@/share/man/man1 INSTALLMAN3DIR=@FINKINSTALL@/share/man/man3 INSTALLSITEMAN1DIR=@FINKINSTALL@/share/man/man1 INSTALLSITEMAN3DIR=@FINKINSTALL@/share/man/man3 INSTALLBIN=@FINKINSTALL@/bin INSTALLSITEBIN=@FINKINSTALL@/bin INSTALLSCRIPT=@FINKINSTALL@/bin) ; \
         if test $$? != 0 ; then \
            exit 1 ; \
         fi  \
diff -Nurd -x'*~' net-snmp-5.0.7.orig/aclocal.m4 net-snmp-5.0.7/aclocal.m4
--- net-snmp-5.0.7.orig/aclocal.m4	2002-10-17 22:39:47.000000000 -0400
+++ net-snmp-5.0.7/aclocal.m4	2006-03-03 13:14:26.000000000 -0500
@@ -1708,7 +1708,7 @@
     ;;
 
   darwin* | rhapsody*)
-    allow_undefined_flag='-undefined suppress'
+    allow_undefined_flag='-undefined dynamic_lookup'
     # FIXME: Relying on posixy $() will cause problems for
     #        cross-compilation, but unfortunately the echo tests do not
     #        yet detect zsh echo's removal of \ escapes.
diff -ruN net-snmp-5.0.7.orig/agent/mibgroup/mibII/tcp.c net-snmp-5.0.7/agent/mibgroup/mibII/tcp.c
--- net-snmp-5.0.7.orig/agent/mibgroup/mibII/tcp.c	Fri May 17 10:05:13 2002
+++ net-snmp-5.0.7/agent/mibgroup/mibII/tcp.c	Mon Oct 27 10:58:36 2003
@@ -101,6 +101,7 @@
 #include <netinet/tcp.h>
 #endif
 #if HAVE_NETINET_TCPIP_H
+#include <netinet/tcp_var.h>
 #include <netinet/tcpip.h>
 #endif
 #if HAVE_NETINET_TCP_TIMER_H
diff -ruN net-snmp-5.0.7.orig/configure net-snmp-5.0.7/configure
--- net-snmp-5.0.7.orig/configure	Mon Jan 13 19:56:39 2003
+++ net-snmp-5.0.7/configure	Mon Oct 27 10:58:36 2003
@@ -4269,11 +4269,11 @@
     ;;
 
   darwin* | rhapsody*)
-    allow_undefined_flag='-undefined suppress'
+    allow_undefined_flag='-undefined dynamic_lookup'
     # FIXME: Relying on posixy $() will cause problems for
     #        cross-compilation, but unfortunately the echo tests do not
     #        yet detect zsh echo's removal of \ escapes.
-    archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)'
+    archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts $(test .$module != .yes && echo -install_name $rpath/$soname $tmp_verstring)'
     # We need to add '_' to the symbols in $export_symbols first
     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
     hardcode_direct=yes
diff -ruN net-snmp-5.0.7.orig/ltmain.sh net-snmp-5.0.7/ltmain.sh
--- net-snmp-5.0.7.orig/ltmain.sh	Sat Apr 20 01:29:58 2002
+++ net-snmp-5.0.7/ltmain.sh	Mon Oct 27 10:58:36 2003
@@ -2858,6 +2858,11 @@
 	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
 	  eval cmds=\"$archive_expsym_cmds\"
 	else
+	  if test "x$verstring" = "x0.0"; then
+            tmp_verstring=
+          else
+            tmp_verstring="$verstring"
+          fi
 	  eval cmds=\"$archive_cmds\"
 	fi
 	IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
