17 Star 0 Fork 0

openKylin/libdigest-sha3-perl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Makefile.PL 1.78 KB
一键复制 编辑 原始数据 按行查看 历史
邓好 提交于 2022-09-17 04:25 . Import Upstream version 1.05
require 5.003000;
use strict;
use ExtUtils::MakeMaker;
use Getopt::Std;
use Config qw(%Config);
use vars qw($opt_w);
my $PM = 'lib/Digest/SHA3.pm';
my $SHA3SUM = 'sha3sum';
# 'use warnings' if possible, but stay portable
my($use_warnings, @EDITs);
my $warn_1 = 'BEGIN { $^W = 1 }';
my $warn_0 = 'BEGIN { $^W = 0 }';
{
eval "require warnings; import warnings";
$use_warnings = $@ ? 0 : 1;
local(@ARGV) = ($PM, $SHA3SUM);
while (<>) {
if (
(!$use_warnings && /^(use|no) warnings\b/) ||
( $use_warnings && /^\Q$warn_1\E # use warnings\b/) ||
( $use_warnings && /^\Q$warn_0\E # no warnings\b/)) {
push @EDITs, $ARGV;
close ARGV;
}
}
}
if (@EDITs) {
local($^I, @ARGV) = ('', @EDITs);
while (<>) {
if ($use_warnings) {
s/^\Q$warn_1\E # (.*)$/$1/;
s/^\Q$warn_0\E # (.*)$/$1/;
}
else {
s/^(use warnings\b.*)$/$warn_1 # $1/;
s/^(no warnings\b.*)$/$warn_0 # $1/;
}
print;
}
}
getopts('w');
my @extra = ();
# Workaround for DEC compiler bug, adapted from Digest::MD5
if ($^O eq 'VMS') {
if (defined($Config{ccname})) {
if (grep(/VMS_VAX/, @INC) && ($Config{ccname} eq 'DEC')) {
# VAX optimizer, even up to v6.4, gets stuck
push(@extra, OPTIMIZE => "/Optimize=(NODISJOINT)");
}
}
}
# Enhance performance on Intel when using gcc
if ($Config{archname} =~ /^i[3456]86/ && $Config{ccname} eq 'gcc') {
push(@extra, OPTIMIZE => '-O1 -fomit-frame-pointer');
}
my $fussy = '-Wall -Wextra -Wconversion -Wcast-align -Wpointer-arith ';
push(@extra, CCFLAGS => $fussy . $Config{ccflags}) if $opt_w;
my %attr = (
'NAME' => 'Digest::SHA3',
'VERSION_FROM' => $PM,
'LIBS' => [''],
'INC' => '-I.',
'EXE_FILES' => [ $SHA3SUM ],
@extra,
);
my $MMversion = $ExtUtils::MakeMaker::VERSION || '0.00_00';
$attr{NO_META} = 1 if $MMversion ge '6.10_03';
WriteMakefile(%attr);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/openkylin/libdigest-sha3-perl.git
git@gitee.com:openkylin/libdigest-sha3-perl.git
openkylin
libdigest-sha3-perl
libdigest-sha3-perl
openkylin/yangtze

搜索帮助