From 9ae2e8df64ee1443365b7a5edd4bab2daca7684c Mon Sep 17 00:00:00 2001 From: Pixel Date: Sun, 5 Nov 2000 22:49:34 +0100 Subject: [PATCH] Use -dM for gcc (the suggested patch did it only for Linux, but I think it can be generalized). Subject: Re: connect and $!{EINPROGRESS} pb (was [ID 20001030.010] [PATCH] io_multihomed.t failing) Message-ID: p4raw-id: //depot/perl@7565 --- ext/Errno/Errno_pm.PL | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL index 0666b2a..9ea6041 100644 --- a/ext/Errno/Errno_pm.PL +++ b/ext/Errno/Errno_pm.PL @@ -29,6 +29,12 @@ sub process_file { warn "Cannot open '$file'"; return; } + } elsif ($Config{gccversion} ne '') { + # With the -dM option, gcc outputs every #define it finds + unless(open(FH,"$Config{cc} -E -dM $file |")) { + warn "Cannot open '$file'"; + return; + } } else { unless(open(FH,"< $file")) { # This file could be a temporary file created by cppstdin @@ -79,6 +85,10 @@ sub get_files { } elsif ($^O eq 'vmesa') { # OS/390 C compiler doesn't generate #file or #line directives $file{'../../vmesa/errno.h'} = 1; + } elsif ($^O eq 'linux') { + # Some Linuxes have weird errno.hs which generate + # no #file or #line directives + $file{'/usr/include/errno.h'} = 1; } else { open(CPPI,"> errno.c") or die "Cannot open errno.c"; -- 2.7.4