public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: "Jon Leichter" <jonleichter@mediaone.net>
To: <earnie_boyd@yahoo.com>
Cc: "J. Henning Schwentner" <hschwentner@yahoo.com>,
	"CU List" <Cygwin@Cygwin.Com>
Subject: RE: Compiling apps to Mingw32 with cygwin
Date: Mon, 07 Jan 2002 08:34:00 -0000	[thread overview]
Message-ID: <CIENIMJIOHKBPJEFFFOBIEAFCBAA.jonleichter@mediaone.net> (raw)
In-Reply-To: <3C39B0B4.D220C5CA@yahoo.com>

Some comments:

- In every configure script I've seen, the build and target variables
receive the value assigned to host if they're not explicitly specified. This
behavior is part of autoconf and not the script writer. Perhaps this is
changing in autoconf 2.50. I don't happen to know those details.

- Building MinGW binaries in a Cygwin environment is kind of like a
cross-compile, and kind of not. I heard enough people take both positions,
so it's seems to have become religious point of view.

- Your specification of CXX is correct if you're project is using C++. I
have not been using C++ in the projects that I built, so I left it out.
Also, since I've never built like that, I didn't think it'd be appropriate
for me to mention it as if I'd know it would work.

- Using CC="gcc -mno-cygwin" is good for compiling, but it's bad for GNU
Libtool, as I have mentioned. I use a wrapper script: CC=mgcc. What do you
think of this Earnie?

Jon

> -----Original Message-----
> From: Earnie Boyd [mailto:earnie_boyd@yahoo.com]
> Sent: Monday, January 07, 2002 6:29 AM
> To: CU List
> Cc: Jon Leichter; J. Henning Schwentner
> Subject: Re: Compiling apps to Mingw32 with cygwin
> >
> > Subject: RE: Compiling apps to Mingw32 with cygwin
> > Date: Sat, 5 Jan 2002 11:35:14 -0800
> > From: "Jon Leichter" <jonleichter@mediaone.net>
> > Reply-To: "Jon Leichter" <jon@symas.com>
> > To: "J. Henning Schwentner" <hschwentner@yahoo.com>
> > CC: <cygwin@cygwin.com>
> >
> > 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" <hschwentner@yahoo.com>
> > To: <cygwin@cygwin.com>
> >
> > 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/

  reply	other threads:[~2002-01-07 16:34 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3C391A0A.758D073@yahoo.com>
2002-01-07  6:29 ` Earnie Boyd
2002-01-07  8:34   ` Jon Leichter [this message]
2002-01-07  8:49     ` Earnie Boyd
2002-01-07 11:44       ` J. Henning Schwentner
2002-01-09  9:09       ` J. Henning Schwentner
     [not found] <3C3EDCA7.C40E3CD6@yahoo.com>
2002-01-11  5:12 ` Earnie Boyd
2002-01-11  5:33   ` Robert Collins
     [not found] <3C3ED90B.F0B81A47@yahoo.com>
2002-01-11  4:43 ` Earnie Boyd
2002-01-10  1:39 Bernard Dautrevaux
2002-01-10 13:09 ` Jon Leichter
2002-01-10 13:43   ` Robert Collins
2002-01-10 14:05     ` Charles Wilson
2002-01-10 14:06     ` Jon Leichter
2002-01-10 14:29       ` Robert Collins
2002-01-10 16:25         ` Jon Leichter
2002-01-10 14:31   ` Earnie Boyd
2002-01-10 14:40     ` Robert Collins
2002-01-10 16:18     ` Jon Leichter
2002-01-10 16:28       ` Robert Collins
2002-01-10 17:19         ` Jon Leichter
2002-01-10 17:27           ` Robert Collins
2002-01-10 17:31             ` Jon Leichter
2002-01-10 17:44               ` Robert Collins
2002-01-10 17:50                 ` Jon Leichter
2002-01-10 17:52                   ` Robert Collins
2002-01-10 17:58                     ` Christopher Faylor
2002-01-10 17:59                       ` Robert Collins
2002-01-10 18:11                     ` Jon Leichter
2002-01-10 18:16                       ` Robert Collins
2002-01-10 18:23                         ` Jon Leichter
2002-01-10 18:25                           ` Robert Collins
2002-01-10 18:28                             ` Jon Leichter
2002-01-10 16:34       ` Charles Wilson
2002-01-11  4:11       ` Earnie Boyd
2002-01-11 10:35         ` Jon Leichter
2002-01-12 12:51           ` Earnie Boyd
2002-01-12 15:29             ` Robert Collins
2002-01-13 10:44               ` Jon Leichter
2002-01-13 12:39                 ` Robert Collins
2002-01-13 20:17                   ` Jon Leichter
2002-01-14  0:53                     ` Robert Collins
2002-01-14  6:09                     ` Earnie Boyd
2002-01-14  5:51               ` Earnie Boyd
2002-01-14 10:48                 ` Jon Leichter
2002-01-12 15:27           ` Robert Collins
     [not found] <3C3C999C.E7DBD5CC@yahoo.com>
2002-01-09 11:42 ` Earnie Boyd
  -- strict thread matches above, loose matches on Subject: below --
2002-01-07  6:24 Bernard Dautrevaux
     [not found] <200201061357.IAA27856@zealous.cnchost.com>
2002-01-06  9:55 ` Jon Leichter
     [not found] <200201051541.KAA10021@irresistable.cnchost.com>
2002-01-05 11:38 ` Jon Leichter
2002-01-06  5:55   ` J. Henning Schwentner
     [not found]   ` <ITDOMAIN003sl3xbYiM0000006c@itdomain003.itdomain.net.au>
2002-01-06 13:47     ` Robert Collins
2002-01-05  7:40 J. Henning Schwentner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CIENIMJIOHKBPJEFFFOBIEAFCBAA.jonleichter@mediaone.net \
    --to=jonleichter@mediaone.net \
    --cc=Cygwin@Cygwin.Com \
    --cc=earnie_boyd@yahoo.com \
    --cc=hschwentner@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).