summaryrefslogtreecommitdiff
path: root/ext/Digest/SHA/Makefile.PL
diff options
context:
space:
mode:
Diffstat (limited to 'ext/Digest/SHA/Makefile.PL')
-rw-r--r--ext/Digest/SHA/Makefile.PL34
1 files changed, 34 insertions, 0 deletions
diff --git a/ext/Digest/SHA/Makefile.PL b/ext/Digest/SHA/Makefile.PL
new file mode 100644
index 0000000000..fea734c2d7
--- /dev/null
+++ b/ext/Digest/SHA/Makefile.PL
@@ -0,0 +1,34 @@
+use ExtUtils::MakeMaker;
+use Getopt::Std;
+use Config;
+
+my %opts;
+getopts('tx', \%opts);
+
+my @defines = ('-DSHA_PERL_MODULE');
+
+push(@defines, '-DSHA_THREAD_SAFE') if $opts{'t'};
+push(@defines, '-DNO_SHA_384_512') if $opts{'x'};
+
+ # Configure SHA source to use static arrays for
+ # message schedules if compiling on Intel platforms.
+ # This seems to speed things up a bit. However,
+ # DON'T do this if thread-safe option is in force.
+
+if ($Config{archname} =~ /^i[3456]86/) {
+ push(@defines, '-DSHA_STO_CLASS=static') unless $opts{'t'};
+}
+
+my $define = join(' ', @defines);
+
+WriteMakefile(
+ 'NAME' => 'Digest::SHA',
+ 'VERSION_FROM' => 'SHA.pm',
+ 'PREREQ_PM' => {},
+ 'AUTHOR' => 'Mark Shelor <mshelor@cpan.org>',
+ 'LIBS' => [''],
+ MAN3PODS => {}, # Pods will be built by installman.
+ 'DEFINE' => $define,
+ 'INC' => '-I.',
+ 'NO_META' => 1,
+);