Chinaunix首页 | 论坛 | 博客
  • 博客访问: 338629
  • 博文数量: 88
  • 博客积分: 1695
  • 博客等级: 上尉
  • 技术积分: 1380
  • 用 户 组: 普通用户
  • 注册时间: 2009-08-06 15:48
个人简介

喜欢美食, 旅行..

文章分类

全部博文(88)

文章存档

2014年(2)

2013年(12)

2012年(14)

2010年(8)

2009年(52)

我的朋友

分类: Windows平台

2013-03-12 20:47:56

来至:http://tenaclock.iteye.com/blog/789616
另:可参考http://justmei.blog.163.com/blog/static/1160998532011631104911873/
打开 cygwin

一、首先检查一下必备的工具包。用以下命令来检查,如果没有就给他装上。
代码
  1. cygcheck -c bash binutils bzip2 gcc-core gcc-java gzip m4 make unzip zip patch patchutils diffutils cygutils nasm subversion autoconf automake perl wget make libbz2-devel zip unzip python
Java
  1. cygcheck -c bash binutils bzip2 gcc-core gcc-java gzip m4 make unzip zip patch patchutils diffutils cygutils nasm subversion autoconf automake perl wget make libbz2-devel zip unzip python
这条命令很长,很多懒人不愿意自己输入,所以,你可以 Ctrl + c and Ctrl +v 。其实这里的Ctrl+v是不好用的。右键点击cygwin的最上边,==》编辑==》粘贴 就ok了。如果出现下面的内容就可以继续了
代码
  1. Package Version Status
  2. autoconf 3.3-1 OK
  3. automake 2-1 OK
  4. bash 3.1-9 OK
  5. binutils 20060817-1 OK
  6. bzip2 1.0.3-1 OK
  7. cygutils 1.3.0-1 OK
  8. diffutils 2.8.7-1 OK
  9. gcc-core 3.4.4-1 OK
  10. gcc-java 3.4.4-1 OK
  11. gzip 1.3.5-2 OK
  12. m4 1.4.7-1 OK
  13. make 3.81-1 OK
  14. nasm 0.98.39-1 OK
  15. patch 2.5.8-8 OK
  16. patchutils 0.2.31-1 OK
  17. perl 5.8.7-5 OK
  18. python 2.4.3-1 OK
  19. subversion 1.3.2-1 OK
  20. unzip 5.52-2 OK
  21. wget 1.10.2-1 OK
  22. zip 2.32-2 OK
Java
  1. Package Version Status
  2. autoconf 3.3-1 OK
  3. automake 2-1 OK
  4. bash 3.1-9 OK
  5. binutils 20060817-1 OK
  6. bzip2 1.0.3-1 OK
  7. cygutils 1.3.0-1 OK
  8. diffutils 2.8.7-1 OK
  9. gcc-core 3.4.4-1 OK
  10. gcc-java 3.4.4-1 OK
  11. gzip 1.3.5-2 OK
  12. m4 1.4.7-1 OK
  13. make 3.81-1 OK
  14. nasm 0.98.39-1 OK
  15. patch 2.5.8-8 OK
  16. patchutils 0.2.31-1 OK
  17. perl 5.8.7-5 OK
  18. python 2.4.3-1 OK
  19. subversion 1.3.2-1 OK
  20. unzip 5.52-2 OK
  21. wget 1.10.2-1 OK
  22. zip 2.32-2 OK
二、分别从网站下载安装包
yasm :
gmp :
mpfr:
mpc:

最好是去相关网站下载最新的版本. 
然后解压的一个目录里,我是解压到了 /~目录中了。
接着我们就要编译这些包文件
代码
  1. cd yasm-0.8.0 && ./configure --prefix=/usr && make && make install && cd .. && cd gmp-4.3.1 && ./configure --prefix=/usr && make -j 2 && make install && cd .. && cd mpfr-2.4.1 && ./configure --prefix=/usr && make -j2 && make install && cd .. && cd mpc-1.0 && ./configure --prefix=/usr && make -j2 && make install && cd ..
Java
  1. cd yasm-0.8.0 && ./configure --prefix=/usr && make && make install && cd .. && cd gmp-4.3.1 && ./configure --prefix=/usr && make -j 2 && make install && cd .. && cd mpfr-2.4.1 && ./configure --prefix=/usr && make -j 2 && make install && cd .. && cd mpc-1.0 && ./configure --prefix=/usr && make -j2 && make install && cd ..
要等好一会的waiting...

为了确保yasm安装正确可以测试一下:
代码
  1. yasm --version
Java
  1. yasm --version
如果看到的是  yasm 0.8.0.2194  就说明 一切ok了。
重启cygwin。

三、从网站:ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.4.2/gcc-4.4.2.tar.gz 下载gcc的源码
把源码解压到 刚才的~目录,用以下的命令来编译安装:
代码
  1. cd gcc-4.4.2 && ./configure --verbose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-languages=c,c++ --enable-nls --without-included-gettext --enable-version-specific-runtime-libs --without-x --disable-java-awt --with-system-zlib --disable-libgcj-debug --enable-threads=posix --disable-win32-registry --enable-sjlj-exceptions && make -j 2 && make install
Java
  1. cd gcc-4.4.2 && ./configure --verbose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-languages=c,c++ --enable-nls --without-included-gettext --enable-version-specific-runtime-libs --without-x --disable-java-awt --with-system-zlib --disable-libgcj-debug --enable-threads=posix --disable-win32-registry --enable-sjlj-exceptions && make -j 2 && make install
PS:有朋友说实施了却没有成功。说是“--with-gmp and/or --with-mpfr options”的问题,如果你也出现了同样的问题,可以将上面的命令换为
代码
  1. cd gcc-4.4.2 && ./configure --with-gmp-lib=/usr/local/lib --with-gmp=include=/usr/local/include && make -j2 && make install
Java
  1. cd gcc-4.4.2 && ./configure --with-gmp-lib=/usr/local/lib --with-gmp=include=/usr/local/include && make -j 2 && make install
这样就行了
赫赫,等吧。。。
完成以后用一下命令来检查达到目的没有。
代码
  1. gcc -v
Java
  1. gcc -v
gcc version 4.4.2 
看看吧。。
升级成功!
就到这里吧。

以上的命令也可以用shell 调用。赫赫。。。
结果:


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