summaryrefslogtreecommitdiff
path: root/utils/c2ph.PL
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-06-06 16:10:24 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-06-06 16:10:24 +0000
commit231bc313da16da9d626e684e44737b52da2914ce (patch)
tree4734c3319e173bc966d62920275051715e8415b0 /utils/c2ph.PL
parentdfca11dd05cf9f4d9c19047def644407603468f0 (diff)
downloadperl-231bc313da16da9d626e684e44737b52da2914ce.tar.gz
Make pstruct and psed appear also on platforms with
$Config{d_link} but filesystems without link() (like FAT). Should deal with [ID 20020602.003] and "RC1 for MSWin32-x86-multi-thread build bug report". Diagnosis by Sarathy. p4raw-id: //depot/perl@17038
Diffstat (limited to 'utils/c2ph.PL')
-rw-r--r--utils/c2ph.PL22
1 files changed, 22 insertions, 0 deletions
diff --git a/utils/c2ph.PL b/utils/c2ph.PL
index 38b259f0db..f9612068f4 100644
--- a/utils/c2ph.PL
+++ b/utils/c2ph.PL
@@ -3,6 +3,28 @@
use Config;
use File::Basename qw(&basename &dirname);
use Cwd;
+use subs qw(link);
+
+sub link { # This is a cutdown vesion of installperl:link().
+ my($from,$to) = @_;
+ my($success) = 0;
+
+ eval {
+ CORE::link($from, $to)
+ ? $success++
+ : ($from =~ m#^/afs/# || $to =~ m#^/afs/#)
+ ? die "AFS" # okay inside eval {}
+ : die "Couldn't link $from to $to: $!\n";
+ };
+ if ($@) {
+ warn $@;
+ require File::Copy;
+ File::Copy::copy($from, $to)
+ ? $success++
+ : warn "Couldn't copy $from to $to: $!\n";
+ }
+ $success;
+}
# List explicitly here the variables you want Configure to
# generate. Metaconfig only looks for shell variables, so you