This is the mail archive of the
mailing list for the GCC project.
Re: [MinGW] Set NATIVE_SYSTEM_HEADER_DIR relative to configured prefix
Ranjit Mathew wrote:
> So did you mean STANDARD_INCLUDE_DIR or SYSTEM_INCLUDE_DIR
> in that patch? The configury seems to set SYSTEM_INCLUDE_DIR to
> NATIVE_SYSTEM_HEADER_DIR for native builds, so your assertion in
> t-mingw32 seemed to be a tautology to me.
The configury code is setting SYSTEM_HEADER_DIR, which is yet another
STANDARD_INCLUDE_DIR is /usr/include on most UNIX systems.
SYSTEM_HEADER_DIR is a directory to search before STANDARD_INCLUDE_DIR.
So, if your system has no /usr/include, you should define
STANDARD_INCLUDE_DIR to the closest equivalent. You should only define
SYSTEM_INCLUDE_DIR if there are two directories you need to search.
Perhaps if you had both /usr/posix/include and /usr/include, and you
wanted to prefer the POSIX headers, you would set SYSTEM_INCLUDE_DIR to
(I'm not sure that SYSTEM_INCLUDE_DIR actually serves any useful
purpose. The only systems configurations that define it are:
I'm not sure if these configurations are still in use, and, if they are,
I'm not sure why they're using SYSTEM_INCLUDE_DIR instead of
You are correct that the documentation I added is incorrect. I meant to
say that the Make variable NATIVE_SYSTEM_HEADER_DIR must match the C
macro STANDARD_INCLUDE_DIR. I shall correct the comments I added.
> My point is that expecting standard headers in the "include" sub-folder
> of the compiler installation root seems to be the norm in MinGW-land
> rather than the exception and in my humble opinion, a very desirable
> property for toolchain relocation.
> When I create a crossed-native compiler, creating "/mingw" is not
> always possible or desirable and I have to use --with-sys-root. Even
> then the headers have to be extracted into the "mingw" sub-folder of
> the sys-root folder, which is weird when you pack it all up and install
> it on a Windows box.
I'm not sure why that's weird. If the toolchain and headers/libraries
are all distributed as a unit, then that makes sense. If the toolchain
is distributed first, and people want to install the headers/libraries
later, then they can put them in the right sysroot.
(650) 331-3385 x713