From: Pixel Date: Sun, 5 Nov 2000 21:49:34 +0000 (+0100) Subject: Use -dM for gcc (the suggested patch did it only for Linux, X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9ae2e8df64ee1443365b7a5edd4bab2daca7684c;p=p5sagit%2Fp5-mst-13.2.git 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 --- 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";