1Crypt::OpenSSL::Guess(3U)ser Contributed Perl DocumentatiCornypt::OpenSSL::Guess(3)
2
3
4
6 Crypt::OpenSSL::Guess - Guess OpenSSL include path
7
9 use ExtUtils::MakerMaker;
10 use Crypt::OpenSSL::Guess;
11
12 WriteMakefile(
13 # ...
14 LIBS => ['-lssl -lcrypto ' . openssl_lib_paths()],
15 INC => openssl_inc_paths(), # guess include path or get from $ENV{OPENSSL_PREFIX}
16 );
17
19 Crypt::OpenSSL::Guess provides helpers to guess OpenSSL include path on
20 any platforms.
21
22 Often MacOS's homebrew OpenSSL cause a problem on installation due to
23 include path is not added. Some CPAN module provides to modify include
24 path with configure-args, but Carton or Module::CPANfile is not
25 supported to pass configure-args to each modules. Crypt::OpenSSL::*
26 modules should use it on your Makefile.PL.
27
28 This module resolves the include path by Net::SSLeay's workaround.
29 Original code is taken from "inc/Module/Install/PRIVATE/Net/SSLeay.pm"
30 by Net::SSLeay.
31
33 openssl_inc_paths()
34 This functions returns include paths in the format passed to CC. If
35 OpenSSL could not find, then empty string is returned.
36
37 openssl_inc_paths(); # on MacOS: "-I/usr/local/opt/openssl/include"
38
39 openssl_lib_paths()
40 This functions returns library paths in the format passed to CC. If
41 OpenSSL could not find, then empty string is returned.
42
43 openssl_lib_paths(); # on MacOS: "-L/usr/local/opt/openssl -L/usr/local/opt/openssl/lib"
44
45 find_openssl_prefix([$dir])
46 This function returns OpenSSL's prefix. If set "OPENSSL_PREFIX"
47 environment variable, you can overwrite the return value.
48
49 find_openssl_prefix(); # on MacOS: "/usr/local/opt/openssl"
50
51 find_openssl_exec($prefix)
52 This functions returns OpenSSL's executable path.
53
54 find_openssl_exec(); # on MacOS: "/usr/local/opt/openssl/bin/openssl"
55
56 ($major, $minor, $letter) = openssl_version()
57 This functions returns OpenSSL's version as major, minor, letter.
58
59 openssl_version(); # ("1.0", "2", "n")
60
62 Net::SSLeay
63
65 Copyright (C) Takumi Akiyama.
66
67 This library is free software; you can redistribute it and/or modify it
68 under the same terms as Perl itself.
69
71 Takumi Akiyama <t.akiym@gmail.com>
72
73
74
75perl v5.30.1 2020-01-29 Crypt::OpenSSL::Guess(3)