1,下载源码
wget https://gcc.gnu.org/pub/gcc/infrastructure/mpfr-4.1.0.tar.bz2
wget https://gcc.gnu.org/pub/gcc/infrastructure/gmp-6.1.0.tar.bz2
wget https://gcc.gnu.org/pub/gcc/infrastructure/mpc-1.2.1.tar.gz
git clone --mirror https://github.com/gcc-mirror/gcc.git
cd ./ex/
git clone ../gcc.git
cd gcc
git checkout releases/gcc-12.2.0
2,编译
cd gmp-6.1.0 && \
./configure --prefix=/home/hanmeimei/ex_gcc/tmp1/local/gmp-6.1.0 && \
make -j && sudo make install && \
cd ..
cd mpfr-4.1.0 && \
./configure --prefix=/home/hanmeimei/ex_gcc/tmp1/local/mpfr-4.1.0 --with-gmp=/home/hanmeimei/ex_gcc/tmp1/local/gmp-6.1.0 && \
make -j && sudo make install && \
cd ..
cd mpc-1.2.1 && \
./configure --prefix=/home/hanmeimei/ex_gcc/tmp1/local/mpc-1.2.1 --with-gmp=/home/hanmeimei/ex_gcc/tmp1/local/gmp-6.1.0 --with-mpfr=/home/hanmeimei/ex_gcc/tmp1/local/mpfr-4.1.0 && \
make -j && sudo make install && \
cd ..
cd gcc && \
./configure --prefix=/home/hanmeimei/ex_gcc/tmp1/local/gcc-12.2.0 --enable-checking=release --disable-multilib --with-gmp=/home/hanmeimei/ex_gcc/tmp1/local/gmp-6.1.0 --with-mpfr=/home/hanmeimei/ex_gcc/tmp1/local/mpfr-4.1.0 --with-mpc=/home/hanmeimei/ex_gcc/tmp1/local/mpc-1.2.1 && \
make -j &&sudo make install
3,检查
