forked from chrisa/perl-Crypt-OpenSSL-VerifyX509
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.PL
106 lines (88 loc) · 2.83 KB
/
Makefile.PL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# This Makefile.PL for Crypt-OpenSSL-VerifyX509 was generated by
# Dist::Zilla::Plugin::MakeMaker::Awesome 0.49.
# Don't edit it but the dist.ini and plugins used to construct it.
use strict;
use warnings;
use 5.008;
use ExtUtils::MakeMaker;
use Config;
use File::Spec;
my %args;
if ($^O ne 'MSWin32' and my $prefix = `brew --prefix --installed openssl\@1.1 2>@{[File::Spec->devnull]}`) {
chomp $prefix;
$args{INC} = "-I$prefix/include";
$args{LIBS} = ["-L$prefix/lib -lcrypto -lssl"];
} else {
$args{INC} = '-I/usr/local/opt/openssl/include -I/usr/local/include/openssl -I/usr/include/openssl -I/usr/local/include/ssl -I/usr/local/ssl/include';
$args{LIBS} = ['-L/usr/local/opt/openssl/lib -L/usr/local/lib -L/usr/lib -L/usr/local/ssl/lib -lcrypto -lssl'];
}
if ($^O eq 'MSWin32') {
if (my $libs = `pkg-config --libs libcrypto 2>nul`) {
# strawberry perl has pkg-config
$args{LIBS} = [ $libs ];
} else {
$args{LIBS} = ['-llibeay32'] if $Config{cc} =~ /cl/; # msvc with ActivePerl
$args{LIBS} = ['-leay32'] if $Config{gccversion}; # gcc
}
}
my $cc_option_flags = ' -DOPENSSL_API_COMPAT=0x10100000L';
if ($Config::Config{cc} =~ /gcc/i) {
$cc_option_flags .= $ENV{AUTHOR_TESTING} ? ' -Wall -Werror' : ' -Wall';
} else {
$cc_option_flags .= '';
}
if ($Config{gccversion} =~ /llvm/i) {
if ( $^O eq 'darwin' && $Config{gccversion} =~ /LLVM 12.0.5/) {
$cc_option_flags .= ' -Wno-deprecated-declarations -Wno-compound-token-split-by-macro';
} else {
$cc_option_flags .= ' -Wno-deprecated-declarations';
}
if ($Config{gccversion} =~ /llvm 13/i) {
$cc_option_flags .= ' -Wno-compound-token-split-by-macro';
}
if ($Config{perl_version} <= 20) {
$cc_option_flags .= ' -Wno-error=pointer-bool-conversion';
}
}
if ($Config{myuname} =~ /sunos|solaris/i) {
$args{OPTIMIZE} = $cc_option_flags;
} else {
$args{OPTIMIZE} = $cc_option_flags;
}
my %WriteMakefileArgs = (
"ABSTRACT" => "simple certificate verification",
"AUTHOR" => "Chris Andrews",
"CONFIGURE_REQUIRES" => {
"ExtUtils::MakeMaker" => 0
},
"DISTNAME" => "Crypt-OpenSSL-VerifyX509",
"LICENSE" => "perl",
"MIN_PERL_VERSION" => "5.008",
"NAME" => "Crypt::OpenSSL::VerifyX509",
"PREREQ_PM" => {
"Crypt::OpenSSL::X509" => 0
},
"TEST_REQUIRES" => {
"File::Slurper" => "0.012"
},
"VERSION" => "0.21",
"test" => {
"TESTS" => "t/*.t"
}
);
%WriteMakefileArgs = (
%WriteMakefileArgs,
%args,
);
my %FallbackPrereqs = (
"Crypt::OpenSSL::X509" => 0,
"File::Slurper" => "0.012"
);
unless ( eval { ExtUtils::MakeMaker->VERSION('6.63_03') } ) {
delete $WriteMakefileArgs{TEST_REQUIRES};
delete $WriteMakefileArgs{BUILD_REQUIRES};
$WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
WriteMakefile(%WriteMakefileArgs);