安装 gcc-4.1.2

来源:互联网 发布:梦貂蝉11神兽进阶数据 编辑:程序博客网 时间:2024/09/21 06:17

转自: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.

0 0
原创粉丝点击