On Fri, 29 Oct 2004 19:33:43 -0500 Andy wrote:
AS> The attached patch fixes the MinGW build. Thanks Robert! I realize that AS> MinGW may not be a show stopper to most, so we can hold off or commit. AS> Has the rc been cut yet?
Uhhh, are you sure? the patch you sent (ifdef WIN32) would break all the other
platforms! Didn't the patch I sent (!defined(WIN32) && !defined(mingw32))
work for you? Looking at configure a little harder, you may need to add
!defined(mingw32msvc) as well...
Yes, I attached the wrong patch, that was the first attempt. It should be:
#ifndef WIN32
Sorry about that. I have too many directories, I need to clean up. MinGW defines WIN32 and you mentioned Windows not needing that code at all. Usually if it does not compile with MSVC++ it will not compile with MinGW. Cygwin is another animal alltogether and has POSIX emulation built in. The difference in targets comes from the build host. On a Linux host the MinGW compiler is called mingw32msvc (I don't know why), but in mingw32msvc.h I define mingw32 for consistency and fewer long ifdef lines in the code. If you look at that particular header all it does is define mingw32 and include mingw32.h where all the real MinGW specific stuff is. It lets me build Windows binaries on my Linux box and will hopefully lead to a scripted Windows installer build. But as for the patch #ifndef WIN32 works.
Andy
What does configure report for you for "Building for ..."?
diff -Naur net-snmp/agent/mibgroup/mibII/interfaces.h net-snmp-mingw32/agent/mibgroup/mibII/interfaces.h
--- net-snmp/agent/mibgroup/mibII/interfaces.h 2004-10-16 20:53:43.000000000 -0500
+++ net-snmp-mingw32/agent/mibgroup/mibII/interfaces.h 2004-10-29 22:36:10.601618653 -0500
@@ -6,7 +6,9 @@
#define _MIBGROUP_INTERFACES_H
config_require(util_funcs)
+#ifndef WIN32
config_require(if-mib/data_access/interface)
+#endif
config_arch_require(solaris2, kernel_sunos5)
/*
* need get_address in var_route for some platforms (USE_SYSCTL_IFLIST).
diff -Naur net-snmp/configure.in net-snmp-mingw32/configure.in
--- net-snmp/configure.in 2004-10-26 07:37:44.000000000 -0500
+++ net-snmp-mingw32/configure.in 2004-10-29 22:36:18.398545355 -0500
@@ -1737,7 +1737,8 @@
AC_MSG_RESULT([$new_module_list.])
AC_MSG_CACHE_ADD(Agent MIB code: $new_module_list)
-MODULECPP="$CPP -I${srcdir}/include -I${srcdir}/agent/mibgroup"
+MODULECPP="$CPP -D$PARTIALTARGETOS -I${srcdir}/include -I${srcdir}/agent/mibgroup"
+
if test "x$enable_mfd_rewrites" = "xyes"; then
MODULECPP="$MODULECPP -DNETSNMP_ENABLE_MFD_REWRITES"
fi
