Subject: | Broken for *static* (also) openssl builds on Win32 |
Hi Sinan,
The report at https://rt.cpan.org/Ticket/Display.html?id=61249 is
definitely pertinent. I considered adding my comments to it, rather
than opening a fresh bug report - but I'm building Crypt::SSLeay 0.58
on Win32 (x64) against a *static* (MinGW64-built) openssl library, and
that other report was concerned only with *dynamic* openssl.
I couldn't get anywhere with the Makefile.PL that ships with the
Crypt::SSLeay 0.58 source. Here's the Makefile.PL that I ended up using:
###################################
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'Crypt::SSLeay',
AUTHOR => 'A. Sinan Unur <nanis@cpan.org>',
ABSTRACT_FROM => 'SSLeay.pm',
VERSION_FROM => 'SSLeay.pm',
LIBS => '-LC:/_64/msys/1.0/local/lib -lz -
LC:/_64/msys/1.0/local/ssl/lib -lssl -lcrypto',
INC => "-IC:/_64/msys/1.0/local/ssl/include",
clean => {
FILES => 'crypt_ssleay_version.h test.config',
},
);
###################################
I doubt that the 'clean' entry makes sense - it's just something that
was left there after I copied stuff from the original Makefile.PL.
Both of those paths in the LIBS entry are in my $Config{libpth} and the
path that's specified in INC is in my $ENV{CPATH}.
In addition to that, in SSLeay.xs, I replaced:
#include "crypt_ssleay_version.h"
with:
#################################
#include <openssl/pkcs12.h>
#include <openssl/ssl.h>
#include <openssl/crypto.h>
#define CRYPT_SSLEAY_free OPENSSL_free
#################################
(Is there really a need for the Makefile.PL to determine what
CRYPT_SSLEAY_free needs to be set to ? Couldn't the xs file examine the
OpenSSL version and handle that all by itself ?)
It then built, tested and installed fine.
What annoyed me the most is that I had to rewrite (and wade through) so
much. Given that MinGW will by default find headers that are in $ENV
{CPATH} and that the relevant libraries were to be found in $Config
{libpth}, I believe I should not have been subjected to so much
frustration.
Anyway, I got there in the end - and I'm happy to happy to help out
further if I can. (Just let me know.)
Cheers,
Rob