diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 1999-02-02 11:29:13 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1999-02-02 11:29:13 +0000 |
commit | def887e857f95c8bcce66cee167ba8fbaea9a17a (patch) | |
tree | 26565dbb25f46bd67d7b617d7eae8e2bb7e4f4d5 /ext/Errno | |
parent | 2d06e7d7c9e4b70e32f2d5dad2fa2fd30f810ebf (diff) | |
download | perl-def887e857f95c8bcce66cee167ba8fbaea9a17a.tar.gz |
Errno update from maint-5.005 (changes #2583, #2710).
p4raw-link: @2583 on //depot/maint-5.005/perl: 3a193be45bc5e7d45057877fdb7e161e2341e0c1
p4raw-id: //depot/cfgperl@2762
Diffstat (limited to 'ext/Errno')
-rw-r--r-- | ext/Errno/Errno_pm.PL | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL index 3df9881eee..f312a6cfaa 100644 --- a/ext/Errno/Errno_pm.PL +++ b/ext/Errno/Errno_pm.PL @@ -31,7 +31,7 @@ sub process_file { } } else { unless(open(FH,"< $file")) { - # This file could be a temporay file created by cppstdin + # This file could be a temporary file created by cppstdin # so only warn under -w, and return warn "Cannot open '$file'" if $^W; return; @@ -44,6 +44,24 @@ sub process_file { close(FH); } +my $cppstdin; + +sub default_cpp { + unless (defined $cppstdin) { + use File::Spec; + $cppstdin = $Config{cppstdin}; + my $upup_cppstdin = File::Spec->catfile(File::Spec->updir, + File::Spec->updir, + "cppstdin"); + my $cppstdin_is_wrapper = + ($cppstdin eq 'cppstdin' + and -f $upup_cppstdin + and -x $upup_cppstdin); + $cppstdin = $upup_cppstdin if $cppstdin_is_wrapper; + } + return "$cppstdin $Config{cppflags} $Config{cppminus}"; +} + sub get_files { my %file = (); # VMS keeps its include files in system libraries (well, except for Gcc) @@ -74,7 +92,7 @@ sub get_files { open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or die "Cannot run '$Config{cpprun} $Config{cppflags} errno.c'"; } else { - my $cpp = "$Config{cppstdin} $Config{cppflags} $Config{cppminus}"; + my $cpp = default_cpp(); open(CPPO,"$cpp < errno.c |") or die "Cannot exec $cpp"; } @@ -106,6 +124,10 @@ sub get_files { sub write_errno_pm { my $err; + # quick sanity check + + die "No error definitions found" unless keys %err; + # create the CPP input open(CPPI,"> errno.c") or @@ -130,7 +152,7 @@ sub write_errno_pm { open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or die "Cannot run '$Config{cpprun} $Config{cppflags} errno.c'"; } else { - my $cpp = "$Config{cppstdin} $Config{cppflags} $Config{cppminus}"; + my $cpp = default_cpp(); open(CPPO,"$cpp < errno.c |") or die "Cannot exec $cpp"; } |