I haven't had a deep look at the patch, but AFAICS the problem is a simple 
matter
that can be solved by adding `-nostdinc 
-I"path/to/the/directory/of/new/headers"`
to `CPPFLAGS` when building the CRT.

------------------                               
Best regards,
lh_mouse
2016-08-26

-------------------------------------------------------------
发件人:David Wohlferd <d...@limegreensocks.com>
发送日期:2016-08-23 07:34
收件人:mingw-w64-public
抄送:
主题:Re: [Mingw-w64-public] Building mingw-w64 and include paths

Let's try this again.  This time the proposed patch is attached which 
may help.  For 'ease of review,' this patch does not include the 
'generated' makefile.in files.

The problem I am trying to fix is that when building mingw-w64, the 
compiler will often use headers from the Tools Directories instead of 
the mingw-w64 source directory.  This is due to the fact that while some 
mingw-w64 SourceDir paths are passed to the compiler, several are not.  
This causes 3 problems:

1) In order for me to make and test changes to intrin.h (for example), I 
have to remember to copy it to ToolsDir after every change.

2) Users who want to build mingw-w64 have to *know* that they need to 
copy certain files (from a variety of locations) to their ToolsDir 
before trying to build mingw-w64.  While the build may succeed without 
this, the results will be uncertain.

3) Header files that are in ToolsDir are usually treated as 'System 
Headers' (https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html). Among 
other things, this means that warnings in these files tend to get 
suppressed rather than found and fixed.

While there are multiple ways to fix this, I have chosen to add the 
necessary paths to Makefile.am.  I also needed to duplicate 2 files 
(_mingw_directx.h _mingw_ddk.h) into appropriately named directories so 
that _mingw.h's #include "sdks/_mingw_directx.h" would work (Is there a 
better way to resolve this?  I can't just generate them into the sdks 
directory, since 'distribution' needs them where they are.).

Kai has suggested that we modify the configure script to copy all the 
header files to a single directory (a la 'make install') and use that 
single directory instead of the 9 above.  My scripting skills are not 
sufficient to do this.  If this is how we want to proceed, someone else 
will need to write it.

dw


------------------------------------------------------------------------------
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to