Huh.  Well, that went a lot better than I thought it would...

On 8/17/2016 1:11 AM, Kai Tietz wrote:
> Hello dw,
>
> 2016-08-17 4:22 GMT+02:00 David Wohlferd <d...@limegreensocks.com>:
>> One of my upcoming patches is going to be a bit controversial (or maybe
>> I'm just missing something).  In either case, I'm going to go ahead and
>> start the discussion early.
>>
>> First a bit of vocabulary.  I'm not including this because I think
>> people here don't know these terms.  It's because *I* am probably using
>> them wrong.  But by defining how I am using them, hopefully you will at
>> least understand what I am trying to convey.
>>
>>    * SourceDir - The directory that contains the git repository of all
>>      the mingw-w64 source files
>>    * BuildDir - The directory into which you will be building the output
>>      of the files in the SourceDir.
>>    * OutputDir - The directory into which the useful output files
>>      (libraries, headers, etc) will be installed when running "make
>>      install".  Its location can be specified by using --prefix on the
>>      configure command.
>>    * BinutilsDir - A loose term that encompasses the system build
>>      utilities (gcc, clang, etc) and their support files (includes, libs,
>>      etc).
> Thanks for pointing out your nomenclature.  These names are always a
> well of misunderstanding.
>
> (I use in common instead of binutilsDir the name ToolsDir ... and for
> OutputDir the name InstallDir)

I was just making terms up.  ToolsDir and InstallDir are better. But 
hey, at least you understood what I was trying to say.

>> With that in mind, here's my question: When I am building mingw-w64,
>> which of these directories should the compiler be searching for include
>> files, and in which order?
>>
>> In my view, the correct answer (in order) is SourceDir, BuildDir, and
>> BinutilsDir.  OutputDir should not be searched at all.
> Why it shouldn't search in OutputDir?  where do you install headers & co too?

I guess I was thinking in terms of a single project.  If you only output 
mingw-w64 to (say) /home/david/mingstuff, having the next build of 
mingw-w64 look in /home/david/mingstuff seems totally pointless.  The 
only files in that directory would be old ones from the previous build.  
Almost by definition, these aren't the includes you want.

But if (as I think you are suggesting) people output headers from *all* 
their projects to a common directory, then it could make sense.  
Assuming the SourceDir directories come earlier in the search path than 
OutputDir.  We'd still want to avoid accidentally using 'old' mingw-w64 
files when building the next.

Or were you referring to your idea (discussed below) of outputting all 
the headers from the build first?

> Anyway, as we have one generated headers (_mingw.h, sdks, ...), it is
> mandatory to (atleast) configure/build headers before trying to build
> crt.
> The include paths in SourceDir are in "mingw-w64-headers/crt/", and
> "mingw-w64-headers/include".

What I'm currently using:

extra_include=-I$(top_srcdir)/include
extra_include2=-I$(top_srcdir)/../mingw-w64-headers/include 
-I$(top_srcdir)/../mingw-w64-headers/crt -I../mingw-w64-headers/crt
extra_includeDX=-I$(top_srcdir)/../mingw-w64-headers/direct-x/include

> Additional the build directory of the
> headers for the generated headers.
> In fact it is easier to install headers before, and just point to the
> include directory in OutputDir (<target>/include for gcc)

While that could work, my understanding of configure is insufficient to 
allow me to do this.  While I have already added the -I statements to my 
Makefile.am, someone else would have to do what (I think) you are 
describing here.

>> However, that does not appear to be what is happening.  The correct
>> SourceDirs and BuildDirs frequently aren't searched at all, and
>> OutputDir is.  As a result, the Mingw-w64 headers you are modifying
>> while working on the project aren't used during the build (IOW you end
>> up using old copies) unless you explicitly copy them around before
>> running make.  While this is a hassle for people maintaining mingw-w64,
>> it's got to be worse for users who "grab the latest" and don't
>> understand what's required to build it.
> See comment above.
>
>> This just seems wrong.  I believe that when building mingw-w64, the
>> default should be to use the mingw-64 headers first (since that's where
>> the newest files will be), then BuildDir (think: generated _mingw.h),
>> then BinutilsDir (for things like ia32intrin.h, etc).  OutputDir should
>> not be used at all, since it is (at best) a copy of a previous (ie
>> out-of-date) build.
> I agree that using current headers is the thing to
>
>> I have a patch for makefile.am that makes things "better" (ie adding the
>> appropriate -I where needed), but I assume there's more to this issue
>> than I currently understand.  Since it will probably take several emails
>> for even the best teachers to fix my misunderstanding here, I'm starting
>> the discussion before sending the patch.
>>
>> Be gentle...
>>
>> dw
> So having a way to use top-level make to build everything without need
> of pre-installing is something of interest IMO.

If you want the -I solution in Makefile.am, just let me know and I'll 
post that.  If you want configure to write out all the headers first and 
use that directory to build the rest of mingw-w64, someone else will 
need to volunteer.

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