On Thu, Jun 30, 2005 at 09:24:06AM +0100, Steve Hay wrote:
> Mike Guy wrote:
> 
> >Steve Hay <[EMAIL PROTECTED]> wrote
> >  
> >
> >>Does anyone else see several dozen
> >>
> >>warning: #pragma system_header ignored outside include file
> >>
> >>warnings when building Errno with gcc?
> >>
> >>I see it on Win32 (MinGW -- gcc 3.2.3).  It never used to happen, but 
> >>does as of change 23806 which filled in $Config{gccversion} and thus 
> >>causes Errno_pm.PL to scan the output of "gcc -E -dM" on each header 
> >>file, rather than scanning each header file directly.
> >>    
> >>
> >
> >I dont't know what's meant to be happening here, but is the answer to
> >apply gcc -E -dM to a file containing just (for example)
> >
> >#include windows.h
> >
> >?
> >
> >And if that's the case, can the processing of the files be done in just
> >one call to gcc?
> >
> Yes, and yes!  Done in change 25014 -- thanks.
> 
> (Following the principle of "don't fix it if it ain't broke" I only 
> applied the change to the Win32/gcc case.  Possibly other setups could 
> benefit from working the same way, but it wouldn't exactly save much 
> time so it didn't seem worth the risk.)

In the can't please all the people all the time dept., I note that
this broke cygwin's mingw.  This gets it working for the moment:

--- ext/Errno/Errno_pm.PL.orig  2005-06-30 01:28:18.000000000 -0700
+++ ext/Errno/Errno_pm.PL       2005-07-01 10:50:03.982524800 -0700
@@ -24,6 +24,8 @@
     open INCS, '>includes.c' or
        die "Cannot open includes.c";
     foreach $file (@files) {
+       next if $file eq 'errno.c';
+       next unless -f $file;
        print INCS qq[#include "$file"\n];
     }
     close INCS;
@@ -194,8 +196,6 @@
                if (/$pat/o) {
                   my $f = $1;
                   $f =~ s,\\\\,/,g;
-                  next if $f eq 'errno.c';
-                  next unless -f $f;
                   $file{$f} = 1;
                }
            }
End of Patch.

For some reason, cygwin's mingw isn't setting gccversion, so it's not going
through your code, so the above makes it work again.

The problem with your patch is that gcc is a cygwin program, so the
include file names are posix paths which don't make sense to the
native perl being built, so -f doesn't find them.  I'll come up with a
better fix once I figure out why gccversion isn't set.

Reply via email to