Changes between Version 34 and Version 35 of Building/Preparation/Windows


Ignore:
Timestamp:
Aug 28, 2013 11:09:51 AM (8 months ago)
Author:
simonpj
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Building/Preparation/Windows

    v34 v35  
    1111 
    12121. '''Install the following tools:''' 
    13  
    1413 * [http://hackage.haskell.org/platform/ Haskell Platform] 
    1514 * [http://git-scm.com/ Git] 
     
    1716 * [http://www.llvm.org/releases/download.html LLVM] (Optional, for using GHC's LLVM backend, grab the file called 'LLVM Binaries for Mingw32/x86') 
    1817 
    19 We recommend using the '''default install locations''' for all these tools.  If you choose your own paths, then we recommend not using a path containing spaces if the default did not have spaces. 
     18 We recommend using the '''default install locations''' for all these tools.  If you choose your own paths, then we recommend not using a path containing spaces if the default did not have spaces. 
    2019 
    21 2. '''Install the MinGW and MSYS tools:''' 
    22  
    23 MinGW provides a windows version of GCC while MSYS provides a minimal UNIX environment (e.g bash, make... ect). The website for MinGW is totally confusing, so go here: 
    24  
    25  * [http://www.mingw.org/wiki/Getting_Started Mingw/MSYS Getting Started]  
    26  
    27 and follow the download instructions for the '''mingw-get-inst''' installer. This is an easy to use installer for installing both MinGW and MSYS.   Make sure when you run the installer that you '''select to install g++, MSYS and the MSYS Dev Kit'''. 
     202. '''Install the MinGW and MSYS tools:'''[[BR]][[BR]] 
     21 MinGW provides a windows version of GCC while MSYS provides a minimal UNIX environment (e.g bash, make... ect). The website for MinGW is totally confusing, so go here [http://www.mingw.org/wiki/Getting_Started Mingw/MSYS Getting Started] and follow the download instructions for the '''mingw-get-inst''' installer. This is an easy to use installer for installing both MinGW and MSYS.   Make sure when you run the installer that you '''select to install g++, MSYS and the MSYS Dev Kit'''. 
    2822 
    29233. '''Set your `PATH`'''. You need to include at least 
     
    3327 * `c:/Python27` (or wherever you installed Python) 
    3428 * `c:/dev/llvm/bin` (or wherever you installed LLVM, if you got it) 
     29 * The Haskell platform installer should have already done the work needed to make GHC, `happy`, and `alex` available on the path, but if not add them too: `$HP/bin` and `$HP/lib/extralibs/bin`.  
    3530 
    36 We recommend doing this by creating a file `.profile` in your home directory (by default `c:/MinGW/msys/1.0/home/<username>`). The contents of your `.profile` should be something like this: 
     31 Moreover, '''these must precede the standard `c:/windows/system32`''': see below for the Awful Warnings about your PATH.   
    3732 
     33 We recommend doing this by creating a file `.profile` in your home directory (by default `c:/MinGW/msys/1.0/home/<username>`). The contents of your `.profile` should be something like this: 
    3834{{{ 
    3935# Add Python to path 
    40 export PATH=${PATH}:/c/Python27 
    41  
     36export PATH=/c/Python27:$PATH 
    4237...etc..etc... 
    4338}}} 
    4439 
    45 The Haskell platform installer should have already done the work needed to make GHC available on the path. 
    4640 
    47 If you use a shell within Emacs, make sure your `SHELL` environment variable points to the `bash` in `c:/MinGW/msys/1.0/bin`.  
     414. If you use a shell within Emacs, make sure your `SHELL` environment variable points to the `bash` in `c:/MinGW/msys/1.0/bin`.  
    4842 
    49 4. '''Launch the shell''' by starting the 'MinGW Shell' which should be in your start menu. 
    50  
    51 Use `autoconf --version` to check that you have at least version 2.68 of `autoconf`. Version 2.56 (which was around for a long time) does not work for GHC's build system. 
     435. '''Launch the shell''' by starting the 'MinGW Shell' which should be in your start menu. 
     44 Use `autoconf --version` to check that you have at least version 2.68 of `autoconf`. Version 2.56 (which was around for a long time) does not work for GHC's build system. 
    5245 
    5346 
     
    6558 
    6659If you want to build HTML Help, you have to install the [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/htmlhelp/html/hworiHTMLHelpStartPage.asp HTML Help SDK], tool, and make sure that {{{hhc}}} is in your {{{PATH}}}. 
     60 
     61== Awful warnings about your PATH == 
     62 
     63It is very important to put the msys/mingw stuff on your path ''before'' `c:/windows/system32`. Here is what happens if you don't. 
     64 
     65'''Symptom''': `sh libtool` hangs indefinitely.  The process manager shows an extant `cmd` and `sed`, but nothing else.  `libtool` is a shell script that comes from a tarball, and is unpacked into `libraries/integer-gmp/gmp/gmpbuild/libtool` 
     66 
     67'''Cause''': `libtool` invokes the following command line (in the function `func_convert_coer_msys_to_w32`: 
     68{{{ 
     69     cmd /c “echo blah” 
     70}}} 
     71and pipes the result to `sed`.  But MSYS mangles the command line to turn slashes into backslashes.  So the actual command line is more like 
     72{{{ 
     73     cmd \c “echo blah” 
     74}}} 
     75which does something entirely different, and indeed hangs waiting for input on stdin. 
     76 
     77'''Solution''': How did this ''ever'' work on any MSYS installation?  Because  
     78 * `msys/1.0/bin` has a little script “cmd” which hands off to the real c:/windows/system32/cmd 
     79 * MSYS does not mangle the command-line for programs in `msys/1.0/bin` 
     80 * On my old laptop, `msys/1.0/bin` was in my path before `c:/windows/system32`.  So plain `cmd` gets the script, and MSYS does not mangle the command line. The script passes arguments on unchanged to the real cmd. 
     81 * NB: `c:/windows/system32` is in the “system” path, which precedes the “user” path.  So no amount of fiddling with the “user” path will fix this.  There are two solutions: 
     82   * Modify the system path 
     83   * Use a .bashrc file to prepend the stuff you need 
     84