Chinaunix首页 | 论坛 | 博客
  • 博客访问: 283754
  • 博文数量: 65
  • 博客积分: 3091
  • 博客等级: 中校
  • 技术积分: 705
  • 用 户 组: 普通用户
  • 注册时间: 2005-01-25 09:44
文章存档

2013年(2)

2012年(11)

2011年(12)

2010年(13)

2009年(15)

2008年(12)

分类: WINDOWS

2008-08-05 11:10:17

Manual installation the MinGW (GCC) Compiler Suite

(non one-click method)

Instead of using an installer you can as well get all required packets and unpack them manually into a subdirectory. In fact that's what this writer is doing himself.

Download the packages

At least the following are needed (the automated mingw installer I think includes all of these and sets up the right directory for you--what it's doing is downloading compilers and default header files, and putting them in one place on your system, so the future builds will use those compilers and directories for building):
  • GNU Binutils:                    binutils-2.xx.xx-YYYYMMDD-N.tar.gz
  • GCC Version 4, Core:             gcc-core-4.x.x-YYYYMMDD-N.tar.gz
  • GCC Version 4, C++:              gcc-g++-4.x.x-YYYYMMDD-N.tar.gz
  • MINGW Runtime:                   mingw-runtime-3.xx.tar.gz
  • Windows 32 API:                  w32api-3.xx.tar.gz

You may want to add any of the following additional languages

  • GCC Version 4, Objective-C:      gcc-objc-4.x.x-YYYYMMDD-N.tar.gz
  • GCC Version 4, Fortran:          gcc-gfortran-4.x.x-sjlj-N.tar.gz
  • GCC Version 3, JAVA:             gcc-java-3.x.x-YYYYMMDD-N.tar.gz
  • GCC Version 4, ADA:              gcc-ada-4.x.x-YYYYMMDD-N.tar.gz
These files are gzipped tarballs, Linux users will probably be familiar with .tar.gz files, but they are not that common under Windows. Essentially they are compressed folders like zip files. In order to access the contents you will need to decompress them, this requires that you have gzip and tar installed on your machine. Linux comes with these as standard in every distribution, but under Windows you will need to install them manually. ( Gzip for Windows and LibArchive for Windows TAR)

Download the setup files and install the applications. Before you use them you need to tell Windows where to find them; specifically this means adding the install directory to your PATH. To do this carry out the following procedure (Warning - adding entries to the path is totally benign, however if you delete you messup your path string then you could seriously compromise the functioning of your computer, please be careful):

  1. Right-click on "My Computer" and select "Properties".
  2. Click Advanced -> Environment Variables.
  3. In the box entitled "System Variables" scroll down to the line that says "Path" and double-click the entry.
  4. You will be presented with a dialog box with two text boxes, the bottom text box allows you to edit the Path variable. It is *very* important that you do not delete the existsing values in the path string, this will cause all sorts of problems for you!
  5. Scroll to the end of the string and at the end add ";\bin". Here is the full address of the installation directory; if you accepted the defaults when installing tar and gzip then it will (proably) be "C:\Program Files\GnuWin32". Don't forget the semicolon, this separates the entries in the path.
  6. press OK -> OK -> OK and you are done.

Create install directory

Create a directory to install all the stuff into. This writer usually creates X:\MinGW and copies all of the above files in there. Now issue the following commands(X means the driver that files installed in):

  cd /d X:\MinGW
gzip -df binutils-2.xx.xx-YYYYMMDD-N.tar.gz
tar -xf binutils-2.xx.xx-YYYYMMDD-N.tar
cd info
ren dir dir.binutils
cd ..
gzip -df gcc-core-4.x.x-YYYYMMDD-N.tar.gz
tar -xf gcc-core-4.x.x-YYYYMMDD-N.tar
cd info
copy dir dir.gcc
copy dir+dir.binutils
cd ..
gzip -df gcc-g++-4.x.x-YYYYMMDD-N.tar.gz
tar -xf gcc-g++-4.x.x-YYYYMMDD-N.tar
gzip -df mingw-runtime-3.xx.tar.gz
tar -xf mingw-runtime-3.xx.tar
cd info
ren dir dir.gcc
cd ..
gzip -df w32api-3.xx.tar.gz
tar -xf w32api-3.xx.tar

(The commands copying and concatenating the info-dir files are really a rather crude way of creating a combined dir file and could use some enhancement.)

Additional programming languages

To add additional languages apply some or all of the follwoing commands:

  cd /d X:\MinGW
tar xvzf gcc-ada-4.x.x-YYYYMMDD-N.tar.gz
tar xvzf gcc-gfortran-4.x.x-sjlj-N.tar.gz
tar xvzf gcc-java-3.x.x-YYYYMMDD-N.tar.gz
tar xvzf gcc-objc-4.x.x-YYYYMMDD-N.tar.gz

MSYS installation

Last but not least you probably will want to install MSYS as well (details are hopefully described elsewhere)


阅读(788) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~