From: Bob R. <bob...@co...> - 2006-12-04 17:25:54
|
On Mon, Dec 04, 2006 at 04:16:22PM +0000, Keith MARSHALL wrote: > Bob Rossi wrote: > > I'm compiling apr, log4cpp and qt on windows. I enjoy using cygwin, > > and recently found out that with cygwin, the -mno-cygwin option can > > be used to invoked the mingw compiler. ... > > Hi Bob, > > AIUI, this isn't strictly accurate. Using the `-mno-cygwin' flag lets > you invoke the *cygwin* compiler and support tools, with a personality > which resembles that of the MinGW compiler; in strict terms, it doesn't > invoke the MinGW compiler. However, the distinction is rather pedantic, > since it does allow you to create Win32 binaries without any dependence > on cygwin-1.dll, and it uses libraries which should be identical to > those used by MinGW. Hi Keith, OK, that is great news. So is it up to the cygwin community to stay up to date with the mingw community in regards to bug fixes and improvements to the mingw runtime? > > I've successfully built 2/3 (not qt) of those packages by cross > > compiling from cygwin to mingw and using the -mno-cygwin compiler > > option. > > As I've already explained, in a reply to yourself on the autoconf list, > unless you are also configuring with `--build=i686-pc-cygwin' and with > `--host=i686-pc-mingw32', you are *not* actually cross compiling; you > are doing nothing more than suppressing the dependence on cygwin-1.dll > in the executables, and library objects, which you are building. Yes, I took your suggestions seriously when you made them. I no longer attempt to trick autoconf. ./configure apr_cv_tcp_nodelay_with_cork=no ac_cv_func_setpgrp_void=yes ac_cv_file__dev_zero=no --build=i686-pc-cygwin --host=i686-pc-mingw32 CC='gcc -mno-cygwin' CXX='g++ -mno-cygwin' The only difference is, I've get the build/host values opposite you. Is that a mistake on your part, or am I reading the autoconf documentation wrong? > > Is there any technical reasons why this is inferior to using the mingw > > environment natively? Would anyone here advise that I should use the > > mingw environment natively? If so, why? > > The problem that you are likely to face is that, if you aren't properly > configuring a cross compile build, simply using `-mno-cygwin' does not OK, I've hopefully resolved the problem you are pointing out here. Are there any other major pitfalls? > I'm sure that there are many other examples, beside this, where you > could come unstuck. My advice, for building native Win32 applications, > is to use MinGW + MSYS; that way you avoid the pitfalls of misidentified > host capabilities, which are too easily inherited from a Cygwin host, > when you assume too much from `-mno-cygwin'. Well, I may end up doing that. It seems like everyone keeps suggesting to do that. I was trying to determine if it was personal opinion or if I just shouldn't be using cygwin for technical reasons. Thanks, Bob Rossi |