[CMake] mingw vs MSYS makefiles

Alan W. Irwin irwin at beluga.phys.uvic.ca
Thu Feb 23 18:51:48 EST 2012


On 2012-02-23 17:49-0500 Bill Hoffman wrote:

> On 2/23/2012 5:18 PM, Alan W. Irwin wrote:
>> make commands.  One is called MinGW/bin/mingw32-make.exe and is used
>> by the "MinGW Makefiles" generator while the other is called
>> MinGW/msys/1.0/bin/make.exe and is used by the "MSYS Makefiles"
>> generator.  I presume those two executables correspond to various
>> forks of gmake.
>
> The difference is the c runtime that they use.  The MinGW one uses the 
> Microsoft run time and so understands MS paths (c: and \).  The msys one 
> links to the msys runtime, and understands msys stuff like /c/foo instead of 
> c:/foo.
>
> Both of these things aside, gmake upstream does look for sh:
>
>
> http://unxutils.sourceforge.net/  has the following info :
>
> "From v3.77 upwards, make searches for a sh.exe on the path. If it does not 
> find one, it switches to win32 make mode that is it uses intermediate batch 
> files for command processing."
>
>
> So, both versions of gmake are actually the same source code but they are 
> built with different c run time libraries.

Hi Bill:

Thanks very much for that most enlightening additional background
information.  I had no idea that the two versions of make were so
similar and that the sh.exe distinction was made upstream of those two
versions.

Also, that quote implies I could get a very different build result
even with "MSYS Makefiles" if I rename sh.exe to something else.

So to address that concern as well as the original poster's concern
(and mine) that we still want access to the MSYS tools with the "MinGW
Makefiles" generator, it appears the correct thing to do is to create
two versions of MinGW/msys/1.0/bin/ (one with sh.exe left as is, the
other one with it renamed or removed).  Then for the "MinGW Makefiles"
generator put the version of MinGW/msys/1.0/bin on your path with the
renamed sh.exe which forces use of win32 make mode which uses
"intermediate batch files for command processing". For the "MSYS
Makefiles" generator put the original MinGW/msys/1.0/bin including
sh.exe on your PATH so that everything is built using sh.exe commands.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list