centos编译gcc10

在centos下编译gcc10,前天是自己先安装好gcc现在的版本

#!/bin/bash
dir=$(pwd)
yum -y install m4
yum -y install bzip2
wget ftp://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2 wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpfr-3.1.4.tar.bz2 wget ftp://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.0.3.tar.gz wget http://mirror.linux-ia64.org/gnu/gcc/releases/gcc-10.1.0/gcc-10.1.0.tar.gz cd $dir tar -xf gmp-6.1.0.tar.bz2 cd gmp-6.1.0 ./configure --prefix=/usr/local/gmp-6.1.0 --disable-shared --enable-static make make install cd $dir tar -xf mpfr-3.1.4.tar.bz2 cd mpfr-3.1.4 ./configure --prefix=/usr/local/mpfr-3.1.4 --disable-shared --enable-static --with-gmp=/usr/local/gmp-6.1.0 make make install cd $dir tar -xf mpc-1.0.3.tar.gz cd mpc-1.0.3 ./configure --prefix=/usr/local/mpc-1.0.3 --disable-shared --enable-static --with-mpfr=/usr/local/mpfr-3.1.4 --with-gmp=/usr/local/gmp-6.1.0 make make install cd $dir tar -xf gcc-10.1.0.tar.gz cd gcc-10.1.0 ./configure --prefix=/usr/local/gcc10 --enable-checking=release --disable-multilib --enable-languages=c,c++ --with-gmp=/usr/local/gmp-6.1.0 --with-mpfr=/usr/local/mpfr-3.1.4 --with-mpc=/usr/local/mpc-1.0.3 make make install

 

posted on 2021-01-27 10:33  弘道者  阅读(327)  评论(0编辑  收藏  举报