Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3C39B0B4.D220C5CA@yahoo.com> Date: Mon, 07 Jan 2002 09:29:08 -0500 From: Earnie Boyd Reply-To: CU List X-Mailer: Mozilla 4.77 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 To: CU List CC: Jon Leichter , "J. Henning Schwentner" Subject: Re: Compiling apps to Mingw32 with cygwin References: <3C391A0A DOT 758D073 AT yahoo DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit > Subject: RE: Compiling apps to Mingw32 with cygwin > Date: Sat, 5 Jan 2002 11:35:14 -0800 > From: "Jon Leichter" > Reply-To: "Jon Leichter" > To: "J. Henning Schwentner" > CC: > > Hi Henning. > > You can use Cygwin's GCC. It's just a little more involved. Here's a short > answer. When you configure, do so like this: > > $ env CC="gcc -mno-cygwin" ./configure --host=i386-pc-mingw32 > > Notice that your --host specification was a little off. The way that I have > specified it is the standard way. If your configure script uses the format > that you've specified then your format is correct. > > If your configure script uses Libtool, then the above method will not be > sufficient. Libtool likes to strip the -mno-cygwin switch off at link time. > For this, I use a wrapper script for MinGW. It's called mgcc, and it looks > like this: > > $ cd /usr/bin > $ cat > mgcc > gcc -mno-cygwin $* > ^D > > Now your configure line looks like this: > > $ env CC=mgcc ./configure --host=i386-pc-mingw32 > > Subject: Re: Compiling apps to Mingw32 with cygwin > Date: Sun, 6 Jan 2002 14:57:23 +0100 > From: "J. Henning Schwentner" > To: > > Thanks for your quick help, this works nice! > > But, it is a bit difficult. I think ideally configure should detect > --host=mingw32 --build=cygwin and in this case should add --mno-cygwin to > CFLAGS and CPPFLAGS (and do something to fix libtool). > Both of these are incorrect and both say the same thing as far as configure is concerned. You need to specify the full triplet when using `gcc -mno-cygwin' as your compiler. The method used above tells configure that your cross compiling wanting to build an executable for i386-pc-mingw32 using i686-pc-cygwin. Instead you should: CC='gcc -mno-cygwin' CXX='g++ -mno-cygwin' ./configure --host=i386-pc-mingw32 --build=i386-pc-mingw32 --target=i386-pc-mingw32 OR (if your config.guess and config.sub support it) CC='gcc -mno-cygwin' CXX='g++ -mno-cygwin' ./configure --host=mingw32 --build=mingw32 --target=mingw32 You probably currently see configure scripts check for cross compiling and end up with a value of `no' because the executable can be executed. This method, IIRC, has changed as of autoconf-2.50 which now compares the values of host and build to determine the value for cross compiling. Earnie. _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/