From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16422 invoked by alias); 7 Jan 2002 14:29:42 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Received: (qmail 16381 invoked from network); 7 Jan 2002 14:29:41 -0000 Received: from unknown (HELO smtp018.mail.yahoo.com) (216.136.174.115) by sources.redhat.com with SMTP; 7 Jan 2002 14:29:41 -0000 Received: from gate1.lci.net (HELO yahoo.com) (150.159.224.8) by smtp.mail.vip.sc5.yahoo.com with SMTP; 7 Jan 2002 14:29:41 -0000 Message-ID: <3C39B0B4.D220C5CA@yahoo.com> Date: Mon, 07 Jan 2002 06:29:00 -0000 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.758D073@yahoo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-01/txt/msg00284.txt.bz2 > 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/