public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Earnie Boyd <earnie_boyd@yahoo.com>
To: Jon Leichter <jon@symas.com>
Cc: cygwin@cygwin.com, hschwentner@yahoo.com
Subject: Re: Compiling apps to Mingw32 with cygwin
Date: Thu, 10 Jan 2002 14:31:00 -0000	[thread overview]
Message-ID: <3C3E1607.EB5DD087@yahoo.com> (raw)
In-Reply-To: <DLEBJKNCNLJEDKMKICHGCENCCBAA.jon@symas.com>

Jon Leichter wrote:
> 
> Earnie Boyd wrote:
> > Your wrapper script is a good idea but has the wrong name as has been
> > pointed out already.  It needs to be named i386-pc-mingw32-gcc and a
> > copy as mingw32-gcc so that when specifying the --host=mingw32 or
> > --host=i386-pc-mingw32 the configure script will find it appropriately.
> > Of course to do this you also need to do the same for the binutils
> > binaries.
> >
> > Yes, specifying --host without the other parts of the triplet indicates
> > a cross build to configure.  You are even warned of this fact.  Specify
> > all three to avoid configure from figuring it out on it's own.  You've
> > just been lucky enough to not configure a package that cares.  Try
> > configuring binutils if you want to see what happens with just
> > specifying host.
> 
> J. Henning Schwentner wrote:
> > Dear Earnie,
> >
> > I do not get it with the --build switch. Am I not building on
> > i686-pc-cygwin? Is it i368-pc-mingw because I use the mingw-headers?
> > But I use the cygwin-compiler.
> >
> > Sorry, but I am confused a bit ...
> 
> Earnie, I'm confused too.
> 

Using `gcc -mno-cygwin' is switching the build environment to MinGW.  It
says use the headers in /usr/include/mingw instead of /usr/include and
to use the libraries in /usr/lib/mingw instead of the ones in /usr/lib. 
Thus you're switching the build environment to MinGW.

> The symlink approach (i.e. i386-pc-mingw32-gcc) might be appropriate for

No, the poster has a wrapper script he named mgcc.  The symlink was for
binutils binaries.

> latter versions of autoconf, but it does not work for earlier versions. I
> contribute to the OpenLDAP project, specifically its MinGW support. To build
> MinGW OpenLDAP, I've also got to build regex-0.12, gdbm-1.8.0, and
> libtool-1.4.2. As far as I can tell, none of the configure scripts in these
> projects conform to the notion of looking for ${host}-gcc or any other
> ${host}-tool. In these projects, the solution I pointed out works
> flawlessly:
> 
>         CC=mgcc ./configure --host=i686-pc-mingw32
> 

Not all configure.in contains AC_CANONICAL_SYSTEM.  Try ones that do. 
E.G.: binutils, gcc.

> The configure script in regex-0.12 does not even accept the --host switch
> (or --target or --build). Instead, it treats the last parameter on the
> command line as the "host":
> 
>         CC=mgcc ./configure i686-pc-mingw32
> 

Must have been built using and older version of autoconf.  This method
is deprecated and will most likely support for this will be removed with
version 3.0.

> The configure script in regex-0.12 does not make any real use of this value,
> so it doesn't really have any effect on the build.
> 

Not all configure.in conform to the standard obviously.  My statements
are based on the standard.

> I originally responded to J. Henning Schwentner, who started this thread. At
> this point, I don't remember what he said he was building. However, it's
> obvious to me that unless you're building a project with a configure script
> built by an up-to-date version of autoconf, none of what you have suggested
> will work. Note that the approach I suggested will work in either case, WITH
> THE POSSIBLE EXCEPTION (as you have stated) that one runs into trouble
> if --build and --target are not specified as well.
> 

My statements are based on the standard.  For those packages conforming
to AC_CAN0NICAL_SYSTEM my statements will make a difference.  I'm saying
you should just get used to always doing it that way so that you never
have a problem.  Fine if you don't, you will find the package that needs
it.

> This spawns another associated topic. What are the right values for the
> triplets (in CURRENT autoconf)? If you're building MinGW binaries in a
> Cygwin-hosted environment, it seems to me that you should ONLY
> specify --target=i686-pc-mingw32 and let the other two switches resolve
> themselves to i686-pc-cygwin. When I build MinGW binaries with Cygwin tools,
> I am not using a MinGW-hosted environment or MinGW tools. All of binutils,
> for example, are still Cygwin tools, and they DON'T honor the -mno-cygwin
> switch. I don't want to symlink those tools either. None of this should
> matter as long as GCC produces MinGW binaries. Why should it matter if
> configure believes that you're doing a cross-compile. In a loose sense, you
> are. This, of course, is a religious argument.
> 

It depends on the filters in your config.sub.

> Note that I have tried to only use the --target switch in my projects,
> opposed to the --host switch. However, in OpenLDAP and the other related
> projects, NONE of the configure scripts handle these switches correctly. I
> found that using --host was the best solution for these projects.
> 

Host is the environment the resulting binaries will execute on.  Build
is the environment doing the building.  Target is the environment that
the resulting binaries for host will produce.  Not all packages need the
target but if the configure script is AC_CANONICAL_SYSTEM aware then it
will look for i686-pc-mingw32-gcc (to use your example of host from
above) and associated binaries similarly named if you supply host
without build.

> Indeed, until the latest version of autoconf makes its way into all projects
> as a standard, these switches will need to be examined by the project
> builder in order to have context on how to build.
> 

I suggest that if you find buggy configure.in and/or Makefile.in files
that you patch it and send the patch to the package maintainer instead
of waiting for someone else to do it.

HTH,
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/

  parent reply	other threads:[~2002-01-10 22:31 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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] <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
     [not found] <3C3C999C.E7DBD5CC@yahoo.com>
2002-01-09 11:42 ` Earnie Boyd
     [not found] <3C391A0A.758D073@yahoo.com>
2002-01-07  6:29 ` Earnie Boyd
2002-01-07  8:34   ` Jon Leichter
2002-01-07  8:49     ` Earnie Boyd
2002-01-07 11:44       ` J. Henning Schwentner
2002-01-09  9:09       ` J. Henning Schwentner
  -- 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=3C3E1607.EB5DD087@yahoo.com \
    --to=earnie_boyd@yahoo.com \
    --cc=cygwin@cygwin.com \
    --cc=hschwentner@yahoo.com \
    --cc=jon@symas.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).