Changes between Version 13 and Version 14 of Building/Windows


Ignore:
Timestamp:
Jun 4, 2007 9:42:51 AM (8 years ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Building/Windows

    v13 v14  
    264264Now go read the documentation above on building from source ([wiki:Building/QuickStart Quick start: just building and installing GHC]);
    265265the bullets below only tell
    266 you about Windows-specific wrinkles.
    267  * If you used {{{autoconf}}} instead of {{{sh boot}}},
    268    you'll get an error when you run {{{./configure}}}:
    269    {{{
    270 
    271 ...lots of stuff...
    272 creating mk/config.h
    273 mk/config.h is unchanged
    274 configuring in ghc
    275 running /bin/sh ./configure  --cache-file=.././config.cache --srcdir=.
    276 ./configure: ./configure: No such file or directory
    277 configure: error: ./configure failed for ghc
    278 }}}
    279  * {{{autoreconf}}} (which gets run by {{{sh boot}}}) seems to create the file {{{configure}}}
    280    read-only.  So if you need to run {{{sh boot}}} again (which I sometimes do for safety's sake),
    281    you get
    282    {{{
    283 /usr/bin/autoconf: cannot create configure: permission denied
    284 }}}
    285    Solution: delete {{{configure}}} first.
     266you about Windows-specific wrinkles. Also look in the section that immediately follows
     267this one for typical failure cases and what do to about them.
     268
    286269 * After {{{sh boot}}} run {{{./configure}}} in
    287270   {{{$(GHC_TOP)/}}} thus:
     
    339322   It needs all kinds of wierd Jade stuff that we haven't worked out for
    340323   Win32.
     324
     325== What to look for if your build fails ==
     326
     327This section collects typical failure cases, and what to do about them.
     328
     329=== Using autoconf by mistake ===
     330
     331If you used {{{autoconf}}} instead of {{{sh boot}}},
     332   you'll get an error when you run {{{./configure}}}:
     333{{{
     334...lots of stuff...
     335creating mk/config.h
     336mk/config.h is unchanged
     337configuring in ghc
     338running /bin/sh ./configure  --cache-file=.././config.cache --srcdir=.
     339./configure: ./configure: No such file or directory
     340configure: error: ./configure failed for ghc
     341}}}
     342
     343=== Cannot create configure ===
     344{{{autoreconf}}} (which gets run by {{{sh boot}}}) seems to create the file {{{configure}}}
     345   read-only.  So if you need to run {{{sh boot}}} again (which I sometimes do for safety's sake),
     346   you get
     347{{{
     348/usr/bin/autoconf: cannot create configure: permission denied
     349}}}
     350Solution: delete {{{configure}}} first.
     351
     352=== Configure can't find darcs version ===
     353
     354When you run your configure script, it falls over with
     355{{{
     356sh-2.04$ ./configure --with-gcc=c:/mingw/bin/gcc --with-ld=c:/mingw/bin/ld.exe --host=i386-unknown-mingw32
     357configure: WARNING: If you wanted to set the --build type, don't use --host.
     358    If a cross compiler is detected then cross compile mode will be used.
     359checking for GHC version date... -nThe system cannot find the file specified.
     360configure: error: failed to detect version date: check that darcs is in your path
     361}}}
     362This error is nothing to do with `darcs`!  The darcs-version test in `configure` uses `sort`, and it is picking up the Windows sort (in `c:\windows\system32`) instead of the MSYS or Cygwin sort. 
     363
     364Solution: either hack the configure script by hand, or (better) make sure that MSYS/Cygwin are in your PATH before Windows. Since `c:\windows\system32` is, by default, in the System Environment Variable called PATH, and System Variables come first when searching for paths, you'll have to put MSYS/Cygwin bin directory in the System PATH, before `c:\windows\system32`.
     365
     366(Incidentally, `find` is another program that Windows has too, with different functionality to Unix.)
     367
     368=== Aregument list too long ===
     369
     370You may find this towards the end of compiling the base library:
     371{{{
     372c:\ghc\ghc-6.6.1\bin\ar.exe: creating libHSbase.a
     373xargs: c:/ghc/ghc-6.6.1/bin/ar: Argument list too long
     374make[2]: *** [libHSbase.a] Error 126
     375make[2]: *** Deleting file `libHSbase.a'
     376Failed making all in base: 1
     377make[1]: *** [all] Error 1
     378make[1]: Leaving directory `/cygdrive/c/GHC6.6.1/ghc-6.6.1/libraries'
     379make: *** [stage1] Error 2
     380}}}
     381Sadly the argument list has a limited length in Windows.  This may be fixable
     382somehow (Windows expertise welcomed here), but what we do is to set
     383{{{
     384SplitObjs = NO
     385}}}
     386in `build.mk`.  That stops the splitting-up of object files, and dramatically reduces
     387the number of object files involved.  Link times are also improved.  (Binary size increases
     388though.)
    341389
    342390== A Windows build log using Cygwin ==
     
    418466}}}
    419467
    420 == What to look for if your build fails ==
    421 
    422 This section collects typical failure cases, and what to do abouut them.
    423 
    424 === Configure can't find darcs version ===
    425 
    426 When you run your configure script, it falls over with
    427 {{{
    428 sh-2.04$ ./configure --with-gcc=c:/mingw/bin/gcc --with-ld=c:/mingw/bin/ld.exe --host=i386-unknown-mingw32
    429 configure: WARNING: If you wanted to set the --build type, don't use --host.
    430     If a cross compiler is detected then cross compile mode will be used.
    431 checking for GHC version date... -nThe system cannot find the file specified.
    432 configure: error: failed to detect version date: check that darcs is in your path
    433 }}}
    434 This error is nothing to do with `darcs`!  The darcs-version test in `configure` uses `sort`, and it is picking up the Windows sort (in `c:\windows\system32`) instead of the MSYS or Cygwin sort. 
    435 
    436 Solution: either hack the configure script by hand, or (better) make sure that MSYS/Cygwin are in your PATH before Windows. Since `c:\windows\system32` is, by default, in the System Environment Variable called PATH, and System Variables come first when searching for paths, you'll have to put MSYS/Cygwin bin directory in the System PATH, before `c:\windows\system32`.
    437 
    438 (Incidentally, `find` is another program that Windows has too, with different functionality to Unix.)