Skip to content

Commit

Permalink
Only copy ppport.h to destination if it is different.
Browse files Browse the repository at this point in the history
This avoids unneccessary rebuilds.

p4raw-id: //depot/perl@28715
  • Loading branch information
Marcus Holland-Moritz committed Aug 14, 2006
1 parent d31fb07 commit 16a9235
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions mkppport
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use warnings;
use Getopt::Long;
use Pod::Usage;
use File::Spec;
use File::Compare qw( compare );
use File::Copy qw( copy );
use File::Basename qw( dirname );

Expand Down Expand Up @@ -82,9 +83,14 @@ unless (-e 'ppport.h') {
# Now install the created ppport.h into extension directories
iterdirs {
my($dir, $fulldir) = @_;
print "installing ppport.h for $dir\n";
my $dest = File::Spec->catfile($fulldir, 'ppport.h');
copy('ppport.h', $dest) or die "copying ppport.h to $dest failed: $!\n";
if (compare('ppport.h', $dest)) {
print "installing ppport.h for $dir\n";
copy('ppport.h', $dest) or die "copying ppport.h to $dest failed: $!\n";
}
else {
print "ppport.h in $dir is up-to-date\n";
}
};

exit 0;
Expand Down

0 comments on commit 16a9235

Please sign in to comment.