1
1
use 5.008000;
2
2
use ExtUtils::MakeMaker;
3
3
use Crypt::OpenSSL::Guess qw( openssl_inc_paths openssl_lib_paths) ;
4
+
5
+ use Config;
6
+ use File::Spec;
7
+ use Crypt::OpenSSL::Guess;
8
+ my %args ;
9
+
10
+ my ($major , $minor , $patch ) = openssl_version();
11
+ print " Installed OpenSSL: $major .$minor .$patch \n " ;
12
+
13
+ $args {INC } = openssl_inc_paths();
14
+ $args {LIBS } = [openssl_lib_paths() . ' -lssl -lcrypto' ];
15
+
16
+ my $cc_option_flags = $major ge 3 ? ' -DOPENSSL_API_COMPAT=30000' : ' -DOPENSSL_API_COMPAT=10100' ;
17
+
18
+ if ($Config::Config {cc } =~ / gcc/i ) {
19
+ $cc_option_flags .= $ENV {AUTHOR_TESTING } ? ' -Wall -Werror' : ' -Wall' ;
20
+ } else {
21
+ $cc_option_flags .= ' ' ;
22
+ }
23
+
24
+ if ($Config {gccversion } =~ / llvm/i ) {
25
+ if ( $^O eq ' darwin' && (
26
+ $Config {gccversion } =~ / LLVM 1[2-9].\d .[5-9]/ ||
27
+ $Config {gccversion } =~ / LLVM 1[3-9]/ ))
28
+ {
29
+ $cc_option_flags .= ' -Wno-deprecated-declarations -Wno-compound-token-split-by-macro' ;
30
+ } else {
31
+ $cc_option_flags .= ' -Wno-deprecated-declarations' ;
32
+ }
33
+
34
+ if ($Config {gccversion } =~ / llvm 13/i ) {
35
+ $cc_option_flags .= ' -Wno-compound-token-split-by-macro' ;
36
+ }
37
+
38
+ if ($Config {perl_version } <= 20) {
39
+ $cc_option_flags .= ' -Wno-error=pointer-bool-conversion' ;
40
+ }
41
+ }
42
+
43
+ if ($Config {myuname } =~ / sunos|solaris/i ) {
44
+ $args {OPTIMIZE } = $cc_option_flags ;
45
+ } else {
46
+ $args {OPTIMIZE } = $cc_option_flags ;
47
+ }
48
+
4
49
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
5
50
# the contents of the Makefile that is written.
6
51
WriteMakefile(
@@ -10,8 +55,6 @@ WriteMakefile(
10
55
($] >= 5.005 ? # # Add these new keywords supported since 5.005
11
56
(ABSTRACT_FROM => ' PKCS10.pm' ,
12
57
AUTHOR => ' JoNO <[email protected] >' ) : ()),
13
- LIBS => [openssl_lib_paths().' -lcrypto' ],
14
- DEFINE => ' -DPERL5 -Wall' ,
15
58
INC => openssl_inc_paths(),
16
59
17
60
' dist' => { COMPRESS => ' gzip -9f' , SUFFIX => ' gz' , },
@@ -39,4 +82,5 @@ WriteMakefile(
39
82
)
40
83
: ()
41
84
),
85
+ %args ,
42
86
);
0 commit comments