Fórum Debian

Versão Completa: script de compilação automatica do gcc-4.7.1 para debian 32 bits
Você está atualmente visualizando uma versão simplificada do conteúdo. Visualizar a versão completa com formatação.
script em bash de compilação automatica do gcc-4.7.1 para Debian 32 bits,

baixa e compila todas as dependências automaticamente:

Código:
#!/bin/bash
#
# Script de compilação automatica do GCC para DEBIAN 32 BITS,
# baixa e instala todas as dependencias e compiladores automaticamente  
#
# GPL-3.0
#
################################################################################​##

###########################################



### escolha aqui a versão do GCC a ser compilada ##################
vs=4.7.1
###################


# versão das dependencias principais ################################
gmpvs=4.3.2
mpfrvs=2.4.2
mpcvs=0.8.1

###################

sudo mkdir /home/gcc-$vs

cd /home/gcc-$vs




# baixando e compilando as dependencias principais #################
wget -c http://gcc-uk.internet.bs/infrastructure/gmp-$gmpvs.tar.bz2
tar -jxpvf gmp-$gmpvs.tar.bz2
cd /home/gcc-$vs/gmp-$gmpvs
sudo ./configure
sudo make -j2
sudo make -j2 install
#
cd /home/gcc-$vs

#
wget -c http://gcc-uk.internet.bs/infrastructure/mpfr-$mpfrvs.tar.bz2
tar -jxpvf mpfr-$mpfrvs.tar.bz2
cd /home/gcc-$vs/mpfr-$mpfrvs
sudo ./configure
sudo make -j2
sudo make -j2 install
#
cd /home/gcc-$vs

wget -c http://gcc-uk.internet.bs/infrastructure/mpc-$mpcvs.tar.gz
tar -zxpvf mpc-$mpcvs.tar.gz
cd /home/gcc-$vs/mpc-$mpcvs
sudo ./configure
sudo make -j2
sudo make -j2 install
#

################################################################################​#########################

cd /home/gcc-$vs
#



# baixando e decompactando o source do GCC
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-$vs.tar.bz2

tar -jxpvf gcc-$vs.tar.bz2


# baixando dependencias do GCC via apt-get ########
sudo apt-get build-dep gcc-4.4 g++-4.4 gcj-4.4 -y
sudo apt-get install gmpc mpc fixincludes -y



#
cd /home/gcc-$vs/gcc-$vs
#




# arquitetura utilizada na compilação ###################
sudo CHOST="i486-pc-linux-gnu"
sudo export CHOST



# executando a configuração das dependencias e os compiladores que serão suportados nessa versão ###########
sudo ./configure --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --enable-clocale=gnu --enable-plugin --enable-objc-gc --disable-werror  --with-gmp-include=/home/gcc-$vs/gmp-$gmpvs/gmp --with-gmp-lib=/home/gcc-$vs/gmp-$gmpvs/.libs --with-mpfr-include=/home/gcc-$vs/mpfr-$mpfrvs/mpfr --with-mpfr-lib=/home/gcc-$vs/mpfr-$mpfrvs/.libs



# inicia a compilação e logo depois a instalação ######################
sudo make -j2
sudo make -j2 install




echo 'processo terminado com exito'


para executa-lo:

$ time sudo bash scriptgcc-4.7.1_DEBIAN_32BITS.sh


o tempo de compilação em um Atlhon II x2 4GB de ram foi de ~3 horas

site de desenvolvimento do script:

http://sourceforge.net/projects/scriptkernel/files/


vale a penta testar.
nova versão:

Código:
#!/bin/bash
#
# Script de compilação automatica do GCC para DEBIAN 32 BITS,
# baixa e instala todas as dependencias e compiladores automaticamente  
#
# GPL-3.0
#
################################################################################​##

###########################################



### escolha aqui a versão do GCC a ser compilada ##################
vs=4.7.1
###################


# versão das dependencias principais ################################
gmpvs=4.3.2
mpfrvs=2.4.2
mpcvs=0.8.1

###################


# baixando dependencias do GCC via apt-get ########                            
sudo apt-get install gcc g++  build-essential make -y
sudo apt-get build-dep gcc-4.4 g++-4.4 gcj-4.4 -y
sudo apt-get install gmpc mpc fixincludes -y



sudo mkdir /home/gcc-$vs

cd /home/gcc-$vs




# baixando e compilando as dependencias principais #################
wget -c http://gcc-uk.internet.bs/infrastructure/gmp-$gmpvs.tar.bz2
tar -jxpvf gmp-$gmpvs.tar.bz2
cd /home/gcc-$vs/gmp-$gmpvs
sudo ./configure
sudo make -j2
sudo make -j2 install
#
cd /home/gcc-$vs

#
wget -c http://gcc-uk.internet.bs/infrastructure/mpfr-$mpfrvs.tar.bz2
tar -jxpvf mpfr-$mpfrvs.tar.bz2
cd /home/gcc-$vs/mpfr-$mpfrvs
sudo ./configure
sudo make -j2
sudo make -j2 install
#
cd /home/gcc-$vs

wget -c http://gcc-uk.internet.bs/infrastructure/mpc-$mpcvs.tar.gz
tar -zxpvf mpc-$mpcvs.tar.gz
cd /home/gcc-$vs/mpc-$mpcvs
sudo ./configure
sudo make -j2
sudo make -j2 install
#

################################################################################​#########################

cd /home/gcc-$vs
#



# baixando e decompactando o source do GCC
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-$vs.tar.bz2

tar -jxpvf gcc-$vs.tar.bz2



#
cd /home/gcc-$vs/gcc-$vs
#




# arquitetura utilizada na compilação ###################
sudo CHOST="i486-pc-linux-gnu"
sudo export CHOST



# executando a configuração das dependencias e os compiladores que serão suportados nessa versão ###########
sudo ./configure --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --enable-clocale=gnu --enable-plugin --enable-objc-gc --disable-werror  --with-gmp-include=/home/gcc-$vs/gmp-$gmpvs/gmp --with-gmp-lib=/home/gcc-$vs/gmp-$gmpvs/.libs --with-mpfr-include=/home/gcc-$vs/mpfr-$mpfrvs/mpfr --with-mpfr-lib=/home/gcc-$vs/mpfr-$mpfrvs/.libs



# inicia a compilação e logo depois a instalação ######################
sudo make -j2
sudo make -j2 install




echo 'processo terminado com exito'


valeu.
URL de Referência