安装 gcc-4.1.2

转自:http://www.scroll-lock.eu/index.php?option=com_content&view=article&id=244:compile-gcc-412-on-ubuntu-1004&catid=1:scroll-blog

I was trying to compile gcc-4.1.2 on Ubuntu x64 10.04 because Maya 2011 requires this version of gcc to be used to compile plugins.

http://download.autodesk.com/us/maya/2011help/index.html?url=./files/Setting_up_your_build_environment_Linux_compiler_requirement.htm,topicNumber=d0e677620

There were several issues I encountered, so here is the process that someone needs to do in order to compile it correctly.

 

1. You will need to install texinfo 

sudo apt-get install texinfo

2. Download gcc-4.1.2 from http://gcc.gnu.org/

3. Create a directory called gcc412

mkdir gcc412

4. CD into it

cd gcc412

5. Make another directory inside called gcc-build. This is important and is almost never mentioned but you need to have two separate directory trees. One of compiling and one for the source.

mkdir gcc-build

6. Copy the gcc archive to the gcc412 directory and unpack the archive there. Not in the build one.

cp gcc-4.1.2.tar.bz2  .../gcc412

cd .../gcc412

tar jxvf gcc-4.1.2.tar.bz2

7. Go to the build directory

cd gcc-build

8. Now you need to configure . In the Maya documentation they say you need to do this:

../gcc-4.1.2/configure --prefix=/opt/gcc412 --program-suffix=412 --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --disable-libunwind-exceptions --enable-__cxa_atexit

But I was having problems if I use these options only so for me this worked instead:

../gcc-4.1.2/configure --prefix=/opt/gcc412 --program-suffix=412 --enable-shared --enable-threads=posix --enable-checking=release --disable-libunwind-exceptions --enable-__cxa_atexit --disable-multilib

Notice the --disable-multilib flag and the missing --with-system-zlib flag.

9. Now because gcc-4.1.2 has a bug and thinks that versions of makeinfo greater than 10 are actually lower than 9 we need to do something manually. In our case if you run makeinfo --version you will see which version was installed by the first step, but it's usually version 13.  Open the Makefile that was created by the ./configure and edit the line where it says:

MAKEINFO = /opt/YOURUSERNAME/newlib-1.15.0/missing makeinfo

and change it to:

MAKEINFO = makeinfo

Save the file.

10. After the configuration run make

make -j 2 bootstrap

11. Run make install as root after that.

su root

make install

12. Then for convenience you can link the freshly compiled gcc412 to point to usr/bin

ls -s /opt/gcc412/bin/gcc412 /usr/bin/gcc412

 

I hope this will be in help of somebody else that is struggling with compiling it.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值