diff options
author | Jess Robinson <castaway@desert-island.me.uk> | 2013-01-18 15:54:51 +0000 |
---|---|---|
committer | Brian Fraser <fraserbn@gmail.com> | 2013-12-18 20:14:37 -0300 |
commit | 252696ecc516bed42ed7b28e862227f3faf7d46a (patch) | |
tree | da0c47277d368a2a3caac6f39da080dcc47e6fdf /Porting/pod_lib.pl | |
parent | 0d7b27597cc56fd28bf02a6f3e4caeec29e98f62 (diff) | |
download | perl-252696ecc516bed42ed7b28e862227f3faf7d46a.tar.gz |
Amend pod_lib.pl to work with miniperl (no dynamic loading)
This is to allow cross-compilation builds to run installperl using a
host miniperl instead of the built Perl binary.
Diffstat (limited to 'Porting/pod_lib.pl')
-rw-r--r-- | Porting/pod_lib.pl | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Porting/pod_lib.pl b/Porting/pod_lib.pl index 06c3294189..ed8e8efd1d 100644 --- a/Porting/pod_lib.pl +++ b/Porting/pod_lib.pl @@ -1,7 +1,6 @@ #!/usr/bin/perl -w use strict; -use Digest::MD5 'md5'; use File::Find; =head1 NAME @@ -62,6 +61,17 @@ Prints C<ABORTED> to STDERR. =cut +# In some situations, eg cross-compiling, we get run with miniperl, so we can't use Digest::MD5 +my $has_md5; +BEGIN { + use Carp; + $has_md5 = eval { require Digest::MD5; Digest::MD5->import('md5'); 1; }; +} + + +# make it clearer when we haven't run to completion, as we can be quite +# noisy when things are working ok + sub my_die { print STDERR "$0: ", @_; print STDERR "\n" unless $_[-1] =~ /\n\z/; @@ -366,6 +376,8 @@ my %state = ( my $file = shift; local $_; + return if !$has_md5; + # Initialise the list of possible source files on the first call. unless (%Lengths) { __prime_state() unless $state{master}; |