blob: 59799c8bdc57f39df77493b8a1f5222167b6623e [file] [log] [blame] [view]
Hyang-Ah Hana Kimc6367132015-02-25 16:08:54 -05001# Use [winstrap](https://github.com/golang/winstrap)
Andrew Gerrand5bc444d2014-12-10 11:35:11 +11002
Hyang-Ah Hana Kim0fd917f2015-02-25 17:09:43 -05003Download the latest version of winstrap.exe from the [winstrap](https://github.com/golang/winstrap) page and run it.
Andrew Gerrand5bc444d2014-12-10 11:35:11 +11004
5It will download some installers to your desktop, which you should run. Just click through; all the defaults are fine.
6
7Then it will check out Go and place it in c:\Users\%USER%\goroot and build it.
8
9That's it.
10
11
12---
13
14Older (deprecated?) instructions follow.
15
16
17---
18
19
20# Install MinGW/MSYS
21
22Download and save the latest version of the automated MinGW installer executable (` exe `) file from SourceForge.
23
24http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/
25
26Open and run the saved automated MinGW installer executable file, which is named ` mingw-get-inst-yyyymmdd.exe `, where ` yyyymmdd ` is the version date stamp. For example, ` mingw-get-inst-20110530.exe `.
27
28The MinGW Setup Wizard window will open with the title "Setup - MinGW-Get". Except for the following, accept the setup defaults, unless it's necessary to change them.
29
30For Repository Catalogues, check the Download latest repository catalogues button.
31
32For Select Components, the MinGW Compiler Suite, the C Compiler box is automatically checked. Scroll down to the bottom of the list and check the MinGW Developer Toolkit box, which includes the MSYS Basic System.
33
34For Ready to Install, review and verify the installation settings, which should look similar this:
35```
36 Installing:
37 mingw-get
38 pkginfo
39 C Compiler
40 MSYS Basic System
41 MinGW Developer Toolkit
42 Downloading latest repository catalogues
43 Destination location:
44 C:\MinGW
45```
46When the installation settings are correct, Install.
47
48The installation loads the package installation catalogues and downloads and installs the files. The installation may take some time, largely depending on the download speed.
49
50The MSYS terminal window may be opened by opening and running the ` C:\MinGW\msys\1.0\msys.bat ` batch file.
51
52# Build
53
54```
55hg clone https://code.google.com/p/go/
56cd go\src
57all.bat
58```
59
60# 64-bit Notes
61
62 1. Ensure you are able to compile a working 32-bit Go first.
63 1. Grab the latest zip from http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Automated%20Builds/ and extract it over the MinGW directory, so that for example the .exe files end up in the same location as the 32-bit ones.
64 1. Replace ` gcc.exe ` and ` ar.exe ` with their 64-bit counterparts.
65 1. Set ` GOARCH=amd64 ` and away you go!
66
67# Alternative Strategy
68
69Install http://tdm-gcc.tdragon.net/
70
71Install Python 2.x.
72
73Install Mercurial for Python 2.x.
74
75Make a "godev.bat" file on your desktop with:
76
77```
78set GOROOT=c:\go
79set GOPATH=c:\you\gopath
80set PATH=%PATH%;%GOROOT%\bin;C:\Python27;C:\Python27\Scripts
81cd %GOROOT%\src
82CMD
83```
84
85Then double-click and type "all.bat". The codereview extension should work too (test with "hg pq")