按网上其他人的方法,依次安装GMP,MPFR和MPC。
==========================
最后安装GCC,我按他们的方法安装的时候,出现,libtool: link for XXX to be removed. 一直提示删除同一个文件,终端标签栏显示sleep字样,一直等待删除文件。我在FINDER里面找到手动删除,依然无效。于是只能放弃。然后百度找解决方法。
后来在国外论坛看到一个人说:
I know this is old but will post here in hopes that anybody doing
a search (which is the Right Thing(tm) ) with this problem in the future
can get the solution.
This is abug/issue with libtool. When you see an endless line of
"Waiting for somefile.o.lock to be removed"
The usual explanation is that libtool is confused because your build
directory is not on the same file system as that of libtool (usually for
libtool, /usr).
With Gentoo, the most likely explanation is that you have set
PORTAGE_TMPDIR to duh, a tmp location that is not on the same
partition as /usr. Short solution: reset PORTAGE_TMPDIR for this
package only, i.e.:
export PORTAGE_TMPDIR=/var/tmp
emerge whatever it is you are working on and set PORTAGE_TMPDIR
back to it's original location. This behavior should be fixed in libtool
eventually, but that's a different discussion.
Extended info:
If you are building something manually, many configure scripts allow you
to override the lock check via "./configure --disable-libtool-lock". Keep
in mind the original purpose of the lock is to prevent error between
concurrent builds on multi-user systems - if you are in that
circumstance potentially, use at your own peril.
大致意思是说 ,你的编译目录和你写入东西所在的目录不在一个分区。导致
出现这种问题。是个BUG。这帖子是2003年发的。近十年了,这BUG依然没修
复!解决方法就是使其在同一个目录。也就是你的源码所在文件夹的路径要和你将
要安装的位置在同一个分区下才行。这里我要将GCC安装在/usr/local/gcc-4.7
下面。于是我将源码包解压到/usr下,然后编译在解压后的文件夹下建个文件夹进
行编译。问题解决!!