|
1 |
| -#!/usr/bin/env perl |
| 1 | +# This Makefile.PL for Crypt-OpenSSL-Verify was generated by |
| 2 | +# Dist::Zilla::Plugin::MakeMaker::Awesome 0.49. |
| 3 | +# Don't edit it but the dist.ini and plugins used to construct it. |
2 | 4 |
|
3 | 5 | use strict;
|
4 | 6 | use warnings;
|
5 | 7 |
|
6 |
| -BEGIN { unshift @INC, '.' } |
7 |
| - |
8 |
| -use inc::Module::Install 0.91; |
9 |
| -use Module::Install::AuthorRequires; |
10 |
| -use Module::Install::AuthorTests; |
| 8 | +use 5.008; |
| 9 | +use ExtUtils::MakeMaker; |
11 | 10 |
|
12 | 11 | use Config;
|
| 12 | +use File::Spec; |
13 | 13 |
|
14 |
| -sub search_lib { |
15 |
| - my ($lib) = @_; |
16 |
| - unless ($lib =~ /^-l/) { |
17 |
| - warn "search_lib: illegal arguments, \`$lib\'.\n"; |
18 |
| - return undef; |
19 |
| - } |
20 |
| - my $libbase = 'lib' . substr($lib, 2) . $Config{lib_ext}; |
21 |
| - my $libbase_so = 'lib' . substr($lib, 2) . "." . $Config{so}; |
22 |
| - my $libbase_cyg = 'lib' . substr($lib, 2) . ".dll" . $Config{lib_ext}; |
23 |
| - my @paths = split(' ', $Config{libpth}); |
24 |
| - push @paths, $ENV{PERL_LIBPATH} if exists $ENV{PERL_LIBPATH}; |
25 |
| - for my $path (@paths) { |
26 |
| - if (-f $path . '/' . $libbase) { |
27 |
| - print "$path/$libbase\n"; |
28 |
| - print "Found '$path/$libbase'.\n"; |
29 |
| - return $lib; |
30 |
| - } elsif (-f $path . '/' . $libbase_so) { |
31 |
| - print "$path/$libbase_so\n"; |
32 |
| - print "Found `$path/$libbase_so'.\n"; |
33 |
| - return $lib; |
34 |
| - } elsif (-f $path . '/' . $libbase_cyg) { |
35 |
| - print "$path/$libbase_cyg\n"; |
36 |
| - print "Found `$path/$libbase_cyg'.\n"; |
37 |
| - return $lib; |
38 |
| - } |
39 |
| - } |
40 |
| - return undef; |
41 |
| -} |
| 14 | +my %args; |
42 | 15 |
|
43 |
| -if (!defined search_lib('-lcrypto')) { |
44 |
| - warn "* libcrypto is not installed or not in the default lib path. Aborting.\n"; |
45 |
| - exit; |
| 16 | +if ($^O ne 'MSWin32' and my $prefix = `brew --prefix --installed openssl\@1.1 2>@{[File::Spec->devnull]}`) { |
| 17 | + chomp $prefix; |
| 18 | + $args{INC} = "-I$prefix/include"; |
| 19 | + $args{LIBS} = ["-L$prefix/lib -lcrypto -lssl"]; |
| 20 | +} else { |
| 21 | + $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'; |
| 22 | + $args{LIBS} = ['-L/usr/local/opt/openssl/lib -L/usr/local/lib -L/usr/lib -L/usr/local/ssl/lib -lcrypto -lssl']; |
46 | 23 | }
|
47 | 24 |
|
48 |
| -name 'Crypt-OpenSSL-Verify'; |
49 |
| -license 'perl'; |
50 |
| -all_from 'Verify.pm'; |
51 |
| - |
52 |
| -requires_external_cc(); |
53 |
| - |
54 |
| -if (-d "/usr/include/openssl") { |
55 |
| - cc_inc_paths('/usr/include/openssl'); |
56 |
| - cc_lib_paths('/usr/lib'); |
57 |
| -} elsif (-d "/usr/local/include/ssl") { |
58 |
| - cc_inc_paths('/usr/local/include/ssl'); |
59 |
| - cc_lib_paths('/usr/local/lib/ssl'); |
60 |
| -} elsif (-d "/usr/local/ssl/include") { |
61 |
| - cc_inc_paths('/usr/local/ssl/include'); |
62 |
| - cc_lib_paths('/usr/local/ssl/lib'); |
| 25 | +if ($^O eq 'MSWin32') { |
| 26 | + if (my $libs = `pkg-config --libs libcrypto 2>nul`) { |
| 27 | + # strawberry perl has pkg-config |
| 28 | + $args{LIBS} = [ $libs ]; |
| 29 | + } else { |
| 30 | + $args{LIBS} = ['-llibeay32'] if $Config{cc} =~ /cl/; # msvc with ActivePerl |
| 31 | + $args{LIBS} = ['-leay32'] if $Config{gccversion}; # gcc |
| 32 | + } |
63 | 33 | }
|
64 | 34 |
|
65 |
| -cc_lib_links('crypto'); |
66 |
| - |
67 |
| -my $ccflags = ''; |
68 |
| -if ($Config::Config{ccname} =~ /gcc/i) { |
69 |
| - $ccflags = $ENV{AUTHOR_TESTING} ? '-Wall -Werror': '-Wall'; |
70 |
| -} else { |
71 |
| - $ccflags = ''; |
72 |
| -} |
| 35 | +my $cc_option_flags = ' -DOPENSSL_API_COMPAT=0x10100000L'; |
73 | 36 |
|
74 |
| -if (($Config::Config{myuname} =~ /sunos|solaris/i) && ($Config::Config{PATCHLEVEL} =~ /5.20/)) { |
75 |
| - cc_optimize_flags("-O3 -DOPENSSL_API_COMPAT=0x10100000L"); |
| 37 | +if ($Config::Config{cc} =~ /gcc/i) { |
| 38 | + $cc_option_flags .= $ENV{AUTHOR_TESTING} ? ' -Wall -Werror' : ' -Wall'; |
76 | 39 | } else {
|
77 |
| - cc_optimize_flags("-O3 $ccflags -DOPENSSL_API_COMPAT=0x10100000L"); |
| 40 | + $cc_option_flags .= ''; |
78 | 41 | }
|
79 | 42 |
|
80 |
| -requires 'Crypt::OpenSSL::X509' => '1.807'; |
| 43 | +if ($Config{gccversion} =~ /llvm/i) { |
| 44 | + if ( $^O eq 'darwin' && $Config{gccversion} =~ /LLVM 12.0.5/) { |
| 45 | + $cc_option_flags .= ' -Wno-deprecated-declarations -Wno-compound-token-split-by-macro'; |
| 46 | + } else { |
| 47 | + $cc_option_flags .= ' -Wno-deprecated-declarations'; |
| 48 | + } |
81 | 49 |
|
82 |
| -author_requires 'Test::NoTabs'; |
83 |
| -author_requires 'Test::Pod' => '1.14'; |
84 |
| -author_requires 'Test::Pod::Coverage' => '1.04'; |
| 50 | + if ($Config{gccversion} =~ /llvm 13/i) { |
| 51 | + $cc_option_flags .= ' -Wno-compound-token-split-by-macro'; |
| 52 | + } |
85 | 53 |
|
86 |
| -test_requires 'Test::More' => '0.88'; |
87 |
| -test_requires 'File::Slurper'; |
88 |
| -test_requires 'Test::Exception'; |
| 54 | + if ($Config{perl_version} <= 20) { |
| 55 | + $cc_option_flags .= ' -Wno-error=pointer-bool-conversion'; |
| 56 | + } |
| 57 | +} |
89 | 58 |
|
90 |
| -resources |
91 |
| - license => "http://dev.perl.org/licenses", |
92 |
| - bugtracker => "https://github.com/perl-Net-SAML2/perl-Crypt-OpenSSL-Verify/issues", |
93 |
| - repository => "https://github.com/perl-Net-SAML2/perl-Crypt-OpenSSL-Verify"; |
| 59 | +if ($Config{myuname} =~ /sunos|solaris/i) { |
| 60 | + # Any SunStudio flags? |
| 61 | +} else { |
| 62 | + $args{OPTIMIZE} = $cc_option_flags; |
| 63 | +} |
94 | 64 |
|
95 |
| -author_tests 't/author'; |
| 65 | +my %WriteMakefileArgs = ( |
| 66 | + "ABSTRACT" => "OpenSSL Verify certificate verification in XS.", |
| 67 | + "AUTHOR" => "Timothy Legge <timlegge\@cpan.org>, Wesley Schwengle <waterkip\@cpan.org>", |
| 68 | + "CONFIGURE_REQUIRES" => { |
| 69 | + "ExtUtils::MakeMaker" => 0 |
| 70 | + }, |
| 71 | + "DISTNAME" => "Crypt-OpenSSL-Verify", |
| 72 | + "LICENSE" => "perl", |
| 73 | + "MIN_PERL_VERSION" => "5.008", |
| 74 | + "NAME" => "Crypt::OpenSSL::Verify", |
| 75 | + "PREREQ_PM" => { |
| 76 | + "Crypt::OpenSSL::X509" => 0 |
| 77 | + }, |
| 78 | + "TEST_REQUIRES" => { |
| 79 | + "File::Slurper" => "0.012" |
| 80 | + }, |
| 81 | + "VERSION" => "0.30", |
| 82 | + "test" => { |
| 83 | + "TESTS" => "t/*.t t/author/*.t" |
| 84 | + } |
| 85 | +); |
| 86 | + |
| 87 | +%WriteMakefileArgs = ( |
| 88 | + %WriteMakefileArgs, |
| 89 | + %args, |
| 90 | +); |
| 91 | + |
| 92 | +my %FallbackPrereqs = ( |
| 93 | + "Crypt::OpenSSL::X509" => 0, |
| 94 | + "File::Slurper" => "0.012" |
| 95 | +); |
| 96 | + |
| 97 | +unless ( eval { ExtUtils::MakeMaker->VERSION('6.63_03') } ) { |
| 98 | + delete $WriteMakefileArgs{TEST_REQUIRES}; |
| 99 | + delete $WriteMakefileArgs{BUILD_REQUIRES}; |
| 100 | + $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs; |
| 101 | +} |
96 | 102 |
|
97 |
| -WriteAll(); |
| 103 | +delete $WriteMakefileArgs{CONFIGURE_REQUIRES} |
| 104 | + unless eval { ExtUtils::MakeMaker->VERSION(6.52) }; |
98 | 105 |
|
| 106 | +WriteMakefile(%WriteMakefileArgs); |
0 commit comments