This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [MinGW] Set NATIVE_SYSTEM_HEADER_DIR relative to configured prefix


On 6/3/06, Mark Mitchell <mark@codesourcery.com> wrote:
Ranjit Mathew wrote:
> Hi,
>
>   After Mark's patch in:
>
>   http://gcc.gnu.org/ml/gcc-patches/2005-08/msg00122.html

Ranjit --

Sorry, I got these messages out of order.  Now, I understand what you
were asking about.

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.


> So I propose that MinGW's NATIVE_SYSTEM_HEADER_DIR be
> set relative to its configured prefix as shown by the
> attached patch.

That doesn't make sense to me.  There's no guarantee that the MinGW
headers are in the same location as the compiler; if your MinGW headers
are in /mingw/include, you can still install the compiler in /usr/local.
 On most systems, the system header directory is a constant; if it's
not, for MinGW, then I think you need a new configure option.

Unlike UNIX, MinGW does not have a standard include folder where headers are *always* supposed to be. "/mingw/include" is more like a convention and possibly proclaimed from being forced to spell out such a thing by the rest of GCC (Danny will correct me if I'm wrong).

One can get the following packages from MinGW:

 1. GCC
 2. binutils
 3. mingw-runtime
 4. w32api

extract them into a folder of one's choice and expect to have a
working compiler system. The all-in-one MinGW installer does a
similar thing. MSYS asks for your MinGW installation path and adds
an /etc/fstab entry to make "/mingw" map to that location.

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.


(Of course, if users are free to put the MinGW headers wherever they
like, then if you ship compiler binaries to someone, you can't know
where they may have put the headers.  So, I would expect people would
need to use -isystem in that situation.)

Exactly. If people don't want to put headers inside the "include" sub-folder of the GCC installation for MinGW for some reason, they can always use -isystem.

Thanks,
Ranjit.

--
Ranjit Mathew      Email: rmathew AT gmail DOT com

Bangalore, INDIA. Web: http://rmathew.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]