有许多朋友在Ubuntu下不能成功编译安装GCC4.3.2,,编译时经常会碰到了一些错误。下面摘记下Ubuntu社区simonwolf的成功经验,或许对大家有所帮助。
a.下载源代码
b.解压
c.查看里面的INSTALL文件夹, 里面有一些关于安装的帮助信息
–下面描述两个必要的组件GMP, GPFRInstalling GMP method1:sudo apt-get install m4
method2:——recommendeddownload the src.unzip.–to the following steps, please look into the INSTALL file in the source../configuremakemake checkmake install: the default target path is /usr/local
Installing GPFRdownload the src.unzip.–to the following steps, please look into the INSTALL file in the source../configuremakemake checkmake 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 objdirsudo ./../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
一直想去旅行,去很美很美的地方,但往往真正踏足想去的地方,