Subject line change as this one may go on for a while...
Andy Smith wrote:
Alex Burger wrote:
BTW, the reason I wanted to get the eventlog code fixed was because the only other thing left to make the MinGW build comparable to MSVC is the Perl modules. I already documented how to build the Perl modules under MinGW but the missing part is the snmplib DLL.
If we can get the host resources MIB working under MinGW (it already works under Cygwin) then it would be even better than the MSVC version.
The embedded Perl is missing from the agent and snmptrapd for MSVC, but I don't think we will ever be able to enable it until everything is thread safe. The agent and snmptrapd need to be static due to thread issues and --enable-embedded-perl requires shared..
Would it be possible to link against the MinGW Perl libraries rather than Active Perl?
I'm sure I will end up trying that and documenting that too, but I think Active Perl is probably more important, at least when we are talking about the binary release of Net-SNMP.
If we build the binary release to work with Active Perl (like it does now), then all the user needs is the Net-SNMP binary installer and Active Perl. If we link the binary to the MinGW Perl, then I assume the user would need MinGW with a compiled Perl, unless there is a MinGW compiled Perl binary available similar to Active Perl. Is there?
I am going to take a look at building the DLL under MinGW. Hopefully it's not that big of a deal.
One trick I have learned with MinGW and building libraries is that you need to use -mms-bitfields. Try something like:
[EMAIL PROTECTED]@ -mms-bitfield
sharedlib: snmplib.c
$(CC) -DWLANCAP_EXPORTS -c -I./ snmplib.c -o snmplib.o
$(CC) -DWLANCAP_EXPORTS -shared -mthreads -o snmplib.dll snmplib.o -lwinmm -lm -lmorestuff
$(DLLWRAP) --export-all --output-def=libsnmplib.def --output-lib=libsnmplib.a --dllname=snmplib.dll -lwinmm -lm
$(CC) -shared -Wl,--enable-auto-image-base -o snmplib.dll -Wl,--out-implib=libsnmplib.dll.a snmplib.o -lwinmm
I think that will get you a running start. I will look at it myself when I get this Linux box back on it's feet. We will probably have to tell it to build the dll during configure also.
I have not tried the -mms-bitfield option but I will give it a try. We will also need to define NETSNMP_USE_DLL for all programs that need to link against the DLL, and both NETSNMP_USE_DLL and NETSNMP_DLL for the snmplib DLL itself.
I gave it a very quick try (without -mms-bitfield) to see what type of problems I would have and it failed. I'll have to do some more reading on DLLs with MinGW.
Thanks for the tip!
Alex
------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ Net-snmp-coders mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
