2012-02-02: My current mingw-386 (MinGW-02022012-4.zip sha1sum is 6b2d1b9954c2a8d36c1a22b5b1611881b500e011) 2011-12-22: Updated MSYS to MSYS-20111123 because mktemp was missing. 2011-06-16: Added the MinTTY terminal emulator. Updated Hg (Mercurial) to version 1.8.4. The distro is back to using a standard zip compression format. MSYS tools updated to the latest versions. 2011-05-15: Updated hg to version 1.8.3 and GCC to TDM/GCC 4.5.2, added perl, mingw-get, and ack. 2011-04-09: Changed the MSYS.lnk, which was originally MSYS (rxvt).lnk back to to the original. It's recommended that rxvt.exe not be used. 2011-02-04: Removed the "create GOBIN" instruction. Packaged using TDM-GCC MinGW32 (http://tdm-gcc.tdragon.net/), I just dropped the modified MSYS folder and the scripts in to the TDM-GCC MinGW32 folder and renamed it MinGW. Added a bullet item about adding msys' bin folder to the system PATH. 2011-01-11: Fixed some readme typos. I originally placed Mateusz's batch files in the wrong folder, to correct the mistake the "cd to" path was changed in run-mingw.bat. Removed some unnecessary files/folders. Include instruction.d a simple bash script in MinGW\msys\1.0\bin called "goc" for compiling go files. 2010-09-09: add echo.exe to MinGW/msys/1.0/bin 2010-09-09: batch file contributions from Mateusz Czaplinski 2010-09-14: batch file updates from Mateusz Czaplinski Distro Notes ------------ You can start the (recommended) mintty shell using the link in the root of the MinGW folder or if you use gowin-env via run-mingw-mintty.bat. The MinGW distribution was put together by TDM-GCC (http://tdm-gcc.tdragon.net/). You can manage the package contents using their on-demand manager tdm-gcc-webdl.exe, which is in the MinGW/bin folder. The distro includes mingw-get which can be used to install and update both MinGW and MSYS, but it's best to use the TDM-GCC manager (tdm-gcc-webdl.exe) to update MinGW. mingw-get example: $ mingw-get update msys-make Misc. Notes ----------- Note, the pre-built Windows Go toolchain can be downloaded at http://code.google.com/p/gomingw/downloads/list If you do decide to use the pre-built toolchain you may be interested in Mateusz Czaplinski's gowin-env at https://bitbucket.org/akavel/gowin-env One of the following two methods can be used to initially download the Go source code and build the toolchain. Method 1: Using the batch files. The benefit of using this method is that it has no restriction on where the MinGW folder can reside. It also allows one to easily set the Go environment variables in go-env.bat file. ---------------------------------------------------------------------------- - unzip the MinGW folder anywhere - there are 2 batch files in the root of the MinGW folder, go-env.bat and run-mingw.bat, that will be used - you can set the Go environment variables in go-env.bat (defaults should work OK, but you can tweak them if you need to) note that run-mingw.bat will import the environment variables from go-env.bat if it exists - start a shell by clicking on "run-mingw.bat" or "run-mingw-mintty.bat" - download the Go source by entering the following on the command line: $ hg clone -r release https://go.googlecode.com/hg/ $GOROOT - cd to the src directory $ cd $GOROOT/src - build Go $ ./all.bash Method 2: Not using the batch files This method requires the MinGW folder be placed in the root of your C:\ drive. ------------------------------------------------------------------------------ - extract the MinGW folder to the root of your C drive (NOT an option) - add MSYS' bin folder (c:\MinGW\msys\1.0\bin) to the system's PATH environment variable - start a shell by clicking on the "mintty" link in the root of the MinGW folder - set the Go environment variables either on the command line or from System Properties > Advanced tab > Environment Variables button: Note that if you set them via System Properties restart the shell. E.g. in this case the Go source tree sits in the root of the C drive and GOBIN is in the root of the Go source folder GOARCH = 386 GOBIN = c:/go/bin GOOS = windows GOROOT = c:/go *Note that forward slashes are used - download the Go source $ hg clone -r release https://go.googlecode.com/hg/ $GOROOT - cd to the src directory $ cd $GOROOT/src or cd /c/go/src - build Go $ ./all.bash --------------------------------------------------------- --------------------------------------------------------- Once you have a Mercurial tracked Go source tree, updates can be done and the toolchain rebuilt by following one of the followings: Procedure 1: using the batch file --------------------------------- - start a shell by clicking on "run-mingw.bat" or "run-mingw-mintty.bat" - cd to the src directory $ cd $GOROOT/src - pull the changes $ hg pull - update to the current release $ hg update release or for the bleeding edge $ hg update - build Go $ ./all.bash Procedure 2: not using the batch file (assumes you initially used method 2 above) --------------------------------------------- - start a shell by clicking on the "mintty"link in the MinGW folder - cd to the src directory $ cd $GOROOT/src - pull the changes $ hg pull - update to the current release $ hg update release or for the bleeding edge $ hg update - build Go $ ./all.bash --------------------------------------------------------- --------------------------------------------------------- To compile a go file using the goc bash script. Open a mintty shell window, cd to the folder that contains the go source file, e.g. /c/temp, then compile the file and run the executable: Note, if the Go toolchain's bin folder isn't set in your PATH or GOBIN isn't set then set it to where the tools are located, e.g. $ export GOBIN=c:/go/bin $ goc helloworld.go $ hellowworld.exe or just $ helloworld