I note you use libcurl installed from MSYS2 other than win64 version, that's why you can build successfully I think
Yes, that probably makes it a bit simpler - certainly a lot simpler than the builds I did a couple of years ago against static libraries that I had built from source.
I finally solved the problem regarding the "loadable library and perl binaries" mismatch - and in so doing, I discovered that I had faced (and solved) the exact same problem when I built Net-Curl-0.37.
There's a line in the Makefile.PL:
CCFLAGS => $devel_cflags . ' ' . $curl{cflags} . $bits,
that needs to be modified to:
CCFLAGS => $Config::Config{ccflags} . ' ' . $devel_cflags . ' ' . $
+curl{cflags} . $bits,
That change then also brings about the need to patch Curl.xs:
--- Curl.xs_orig 2019-11-20 11:44:50 +1100
+++ Curl.xs 2019-11-20 22:55:23 +1100
@@ -17,6 +17,11 @@
#include "perl.h"
#include "XSUB.h"
+#ifdef __MINGW32__
+#undef fread
+#undef fwrite
+#endif
+
#include <curl/curl.h>
#include <curl/easy.h>
#include <curl/multi.h>
I got rid of the overflow in conversion from 'long long unsigned int' to 'int' warning by patching Curl_multi.xsh:
--- Curl_multi.xsh_orig 2019-11-20 11:54:58 +1100
+++ Curl_multi.xsh 2019-11-20 11:55:35 +1100
@@ -564,8 +564,8 @@
int
socket_action( multi, sockfd=CURL_SOCKET_BAD, ev_bitmask=0 )
Net::Curl::Multi multi
- int sockfd
- int ev_bitmask
+ IV sockfd
+ IV ev_bitmask
PREINIT:
int remaining;
CURLMcode ret;
though it doesn't seem to make any difference to the way that the test suite behaves .... and the test suite doesn't behave very well.
A lot of the tests fail or hang. And the examples scripts hang or crash - except for examples/04-share-threads.pl (which runs fine).
The Net-Curl-0.41 test suite covers much more than the Net-Curl-0.37 suite did. 0.37 passed all of its tests, and 0.41 still passes the same tests.
The problems are with the other tests in 0.41 (ie the ones that weren't in 0.37).
I've no idea how useful Net-Curl is on Windows - I think it's a good idea to stick with Inline::C if you can get it to do what you need.
I also built Net-Curl-0.41 with Strawberry Perl 5.30.0.1 - again, building against the MSYS2 libraries.
I get identical results with Strawberry Perl - which is to be expected.
Strawberry Perl's perl/bin/pkg-config.bat doesn't automatically find the Curl library, so I renamed it to pkg-config.bat_hide. With that done, the MSYS2 mingw64/pkg-config.exe gets used instead, and the Curl library is found.
Cheers, Rob |