On 6/20/2015 5:08 PM, LRN wrote:
> On 20.06.2015 19:21, Edward Diener wrote:
>> On 6/20/2015 10:50 AM, LRN wrote:
>>> On 20.06.2015 17:43, Edward Diener wrote:
>>>> Why does mingw-64, or the original mingw for that matter, consistently
>>>> hardcode include and lib search paths in their build for c:\mingw
>>>> instead of searching for include files and libraries relative to its
>>>> installation structure ?
>>>
>>> This is a side-effect of the way gcc is built. It's possible to mitigate
>>> this by
>>> 1) Cross-compiling gcc (instead of compiling it on Windows) from Cygwin or
>>> a GNU system
>>> 2) Patching gcc to throw away include and lib paths that start with '/'
>>> when running on Windows.
>>>
>>> If not cross-compiled, gcc will have an absolute DOS path in its search
>>> list (this is mitigated by building it in a randomly-named staging
>>> directory deep in the temp tree to ensure that this has near-zero
>>> probability of acting up in real life); some people settle for that.
>>
>> Thanks for the info. I guess the question then is why gcc is built in
>> such backwards ( to this programmer ) way. Hardcoding absolute paths, in
>> programing circa the year 2015, seems abolutely lunacy. But I don't
>> expect an answer to why gcc works the way it does on this mailing list.
>
> gcc has a POSIX-centric (and complex) buildsystem. Hardcoding sysroot paths
> is not considered a deadly sin there.

But you are creating a product for Windows in which the entire product, 
including the gcc compiler, standard C library, standard C++ library, 
and whatever other tools are entailed in a mingw-64 release, are all 
part of any mingw-64 distribution. That I appreciate, and it is done 
much better than mingw ever did it.

Why not then set the paths to your include files and libraries to 
relative places within the distribution ?

This would make each mingw-64 release completely self sufficient within 
itself and easily allow multiple mingw-64 releases to coexist and be 
used by the end-user.

Has this ever even been discussed by mingw-64 developers preparing 
releases ? Because I cannot believe in this day and age that any 
programmer thinks that harcoding absolute paths, never mind the same 
absolute path with each new version, can be advantageous to the releases 
of any product, whether it be mingw-64 or otherwise.

Probably the reason why gcc on Linux hardcodes absolute paths is because 
gcc is distributed as a separate package than the C standard library and 
the C++ standard library. But this is not the case with mingw-64 as a 
product installed on Windows. So why not do it the right way and make it 
even easier for end-users to use your product especially if they wish to 
run and test multiple versions.


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

Reply via email to