Crypt::OpenSSL::Guess(3) | User Contributed Perl Documentation | Crypt::OpenSSL::Guess(3) |
Crypt::OpenSSL::Guess - Guess OpenSSL include path
use ExtUtils::MakerMaker; use Crypt::OpenSSL::Guess; WriteMakefile( # ... LIBS => ['-lssl -lcrypto ' . openssl_lib_paths()], INC => openssl_inc_paths(), # guess include path or get from $ENV{OPENSSL_PREFIX} );
Crypt::OpenSSL::Guess provides helpers to guess OpenSSL include path on any platforms.
Often MacOS's homebrew OpenSSL cause a problem on installation due to include path is not added. Some CPAN module provides to modify include path with configure-args, but Carton or Module::CPANfile is not supported to pass configure-args to each modules. Crypt::OpenSSL::* modules should use it on your Makefile.PL.
This module resolves the include path by Net::SSLeay's workaround. Original code is taken from "inc/Module/Install/PRIVATE/Net/SSLeay.pm" by Net::SSLeay.
openssl_inc_paths(); # on MacOS: "-I/usr/local/opt/openssl/include"
openssl_lib_paths(); # on MacOS: "-L/usr/local/opt/openssl -L/usr/local/opt/openssl/lib"
find_openssl_prefix(); # on MacOS: "/usr/local/opt/openssl"
find_openssl_exec(); # on MacOS: "/usr/local/opt/openssl/bin/openssl"
openssl_version(); # ("1.0", "2", "n")
Net::SSLeay
Copyright (C) Takumi Akiyama.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Takumi Akiyama <t.akiym@gmail.com>
2018-04-16 | perl v5.34.0 |