configure: fix checking for DTLS_method
During checking of DTLS_method, the stub program is linked only with -ssl
libssl.a lacks some function from -lcrypto:
RAND_()
ERR_()
BUF_MEM_*()
etc.
and -lz:
- inflate()
- deflate()
Append -lcrypto and -lz to LIBS variable when checking DTLS_method.
Since I would like to test this patch before applying it: on which operating system did you develop and test this patch?
Hello,
this is a only workaround. It doesn't take into account autotools.
You can notice I don't touch configure.ac.
Anyway here is the log of a build failure with Buildroot:
http://autobuild.buildroot.net/results/e27/e2787d15f72949cbb347e8a1d344f5f80b4d7697/build-end.log
And here they're discussing a better patch:
https://patchwork.ozlabs.org/patch/967726/
So what I propose is something temporary before the one proposed on buildroot patchwork.
Kind regards
How about this patch?
Oh yes.
I've just realized somebody else took exactly that patch for Buildroot.
Here is mailing list mail:
http://buildroot-busybox.2317881.n4.nabble.com/PATCH-1-1-netsnmp-fix-static-build-with-openssl-td203429.html
So we can close this ticket!
Thank you.
A version of this patch that also works for Windows has been pushed out. Please retest.
Sorry, same problem as before, but we're almost there.
Now it's missing only zlib on "checking for DTLS_method"
I'm going to try to fix your patch too.
Here you have a Merge request for the same problem though:
https://sourceforge.net/p/net-snmp/code/merge-requests/17/
Last edit: Giulio Benetti 2018-09-17
Found the problem.
There was a mix of issues.
Going to send a patch for libz check in static linking.
Here is the Merge Request:
https://sourceforge.net/p/net-snmp/code/merge-requests/18/
Please retest with the latest master branch.
And invert AC_CHECK_LIB like below too?
Because otherwise, with latest master we've got the same -lz dependency problem.
No. I think that the root cause was not the order of the tests but caching of the test results. A change that clears the cached result has been checked in. Hence please retest with the latest master branch.
I explained myself bad. I've already tried, but stil gives problem with DTLS.
So:
Build static with master and AC_CHECK_LIB() with -lz inverted works.
Now I'm going to compile without -lz, so let's see what happens
Any other idea?
Last edit: Giulio Benetti 2018-09-17
I mean I recompile Buildroot from scratch with same Architecture, static and without zlib package.
All with my latest patch inverting the testing of -lz.
So let's see if that rules(nested AC_CHECK_LIB()) works or not.
If I find it tries to link with -lz, there is something wrong, otherwise it should be ok.
And of course my patch on top of latest commit of master you've pointed me.
Pardon, you were right.
configure recognizes correctly EVP_md5 linking it with -lz
But still getting error:
The DTLS based transports require the libssl library from OpenSSL to be available and support DTLS
I dig more.
Well, using AC_MSG_NOTICE() as logger, I've found the problem.
I open another Merge Request.
There shouldn't be other drawbacks.