11use 5.008000;
22use ExtUtils::MakeMaker;
33use 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+
449# See lib/ExtUtils/MakeMaker.pm for details of how to influence
550# the contents of the Makefile that is written.
651WriteMakefile(
@@ -10,8 +55,6 @@ WriteMakefile(
1055 ($] >= 5.005 ? # # Add these new keywords supported since 5.005
1156 (ABSTRACT_FROM => ' PKCS10.pm' ,
1257 AUTHOR => ' JoNO <jonozzz@yahoo.com>' ) : ()),
13- LIBS => [openssl_lib_paths().' -lcrypto' ],
14- DEFINE => ' -DPERL5 -Wall' ,
1558 INC => openssl_inc_paths(),
1659
1760 ' dist' => { COMPRESS => ' gzip -9f' , SUFFIX => ' gz' , },
@@ -39,4 +82,5 @@ WriteMakefile(
3982 )
4083 : ()
4184 ),
85+ %args ,
4286);
0 commit comments