Newbie building GHC

Simon Peyton-Jones simonpj@microsoft.com
Tue, 24 Sep 2002 15:44:30 +0100


| In retrospect I think that unless "configure" is doing something
really
| tricky, if you want the Mingw32 "ar" and "ld" to be picked up instead
of the
| Cygwin equivalents then you must have the Mingw32 bin directory in
your path
| ahead of the Cygwin bin directory.

The right thing to do is what the building guide says. =20

The GHC build system is careful to use the newly-built GHC for compiling
even .c files, and for doing linking.  The newly-built GHC will use the
gcc that you point to with the --with-gcc configure command. It will not
use a path in any shape or form (unless you omit --with-gcc in which
case it'll pick whatever random gcc is lying around; probably not the
right one).

The only way I know to make all this work is to use a straightforward
Cygwin environment for building (with absolutely no mingw stuff in your
path) and use --with-gcc in your configure line.  Other things may work,
but you're on your own.

Simon

|=20
| You should also remove the Mingw bin "make.exe" as it is seriously
flawed
| and will not suffice to do much at all, let alone build GHC.
|=20
| Cheers
|=20
| Mike Thomas.
|=20
|=20
| ----- Original Message -----
| From: "Simon Peyton-Jones" <simonpj@microsoft.com>
| To: "Mike Thomas" <miketh@brisbane.paradigmgeo.com>;
| <glasgow-haskell-users@haskell.org>
| Cc: <mthomas@gil.com.au>
| Sent: Tuesday, September 24, 2002 5:30 PM
| Subject: RE: Newbie building GHC
|=20
|=20
| | - Run the following following commands:
| |
| |     export PATH=3D/cygdrive/c/lang/mingw32/bin::${PATH}
| |
| |     make clean; ./configure --build=3Dmingw >& configure.log
|=20
| Uh oh.  You aren't following the instructions in Section 12.4 of the
GHC
| building guide!
| http://haskell.cs.yale.edu/ghc/docs/latest/html/building/winbuild.html
|=20
| (a) I believe that it's important to run autoconf
| (b) I've never seen this --build option for configure.  What I use (as
| the building guide says) is:
|=20
|     ./configure --host=3Di386-unknown-mingw32 =
--with-gcc=3D/mingw/bin/gcc
|=20
| You need to run configure in fptools/ghc first actually.  (No need to
| autoconf there.)
|=20
|=20
| What you did may work, but I am not confident in it.  For example
where
| are you saying where to find the (mingw) gcc that GHC should use?
|=20
| Simon
|=20