Peter Rosin wrote: > From time to time, I'm wondering if reusing *-*-mingw* for cl is the > right decision.
I think so, yes. mingw and msvc share the same kernel, the same object file format, and large parts of the C library. But it definitely ought to be documented, because it is very non-obvious (if you know that mingw came after winnt, and Emacs has a winnt port). > The main benefits that I see are that you don't have to > cross compile if you are in MSYS You have the wrong notion of "cross compile", if you think cross-compiling means that $host != $build. When I am building for i386-pc-linux-gnu from a x86_64-pc-linux-gnu machine, I am *not* cross-compiling. When you are building for i586-pc-mingw32 from i586-pc-cygwin, you are *not* cross- compiling. Cross-compiling means that the generated executable can not be run on the build machine. It can be necessary to use cygpath also when not cross-compiling. Gladly, the Automake emitted build uses it, and the 'compile' script from the Automake 'msvc' branch uses it as well. > > I use Cygwin as a build environment. > > But then you are in the 'fake' cross territory (according to the terminology > of the libtool manual), which is also not always desirable. E.g., if you use > absolute path names (I'm sure you try to avoid them) and Libtool, you need > to tell Libtool that you are faking the cross compile with an extra configure > argument: > > lt_cv_to_tool_file_cmd=func_convert_file_cygwin_to_w32 > > See http://www.gnu.org/s/libtool/manual/libtool.html#Cygwin-to-MinGW-Cross I am not faking a cross-compile; I am not cross-compiling at all. Libtool needs to be fixed to use cygpath when needed, without requiring an extra configure argument. That configure argument is implicit from $host and $build. > MSYS is doing all the faking for you It does it in a buggy way. I pass the argument "/dev/null" to a program, and the MSYS execve call silently converts it to "nul" (or vice versa, I don't remember). That's not reliable, because not all program arguments are meant to be file names. To do it correctly, file name conversions need to be explicit. That's what cygpath is for. Bruno -- In memoriam Sergei Tretyakov <http://en.wikipedia.org/wiki/Sergei_Tretyakov>