Ubuntu下编译安装GCC4.3.2

有许多朋友在Ubuntu下不能成功编译安装GCC4.3.2,编译时经常会碰到了一些错误。下面摘记下Ubuntu社区simonwolf的成功经验,或许对大家有所帮助。

a.下载源代码

b.解压

c.查看里面的INSTALL文件夹, 里面有一些关于安装的帮助信息

--下面描述两个必要的组件GMP, GPFR
Installing GMP method1:
sudo apt-get install m4

method2:------recommended
download the src.
unzip.
--to the following steps, please look into the INSTALL file in the source.
./configure
make
make check
make install: the default target path is /usr/local


Installing GPFR
download the src.
unzip.
--to the following steps, please look into the INSTALL file in the source.
./configure
make
make check
make install: the default target path is /usr/local

------
from the prerequisities of gcc. you may be need to install gawk (sudp apt-get install gawk )too.

d.configure进行注册

假设加压后的源代码目录是 gcc-4.3.2
这个目录下还有不少别的目录 比如INSTALL, gcc, ...
进入这个目录,执行如下操作(可能需要管理员权限,即加sudo )

% mkdir objdir
% cd objdir
sudo ./../configure --enable-languages=c,c++
--prefix=/usr/local/gcc-4.3.2 --enable-shared --with-system-zlib
--without-included-gettext --enable-threads=posix --enable-nls
--enable-libstdcxx-debug --enable-mpfr --enable-targets=all
--enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu
--target=i486-linux-gnu --disable-multilib

linux

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/aa2509f79c487989abaee25de827ead6.html