Autor Tópico: script de compilação automatica do gcc 4.6.3 para ubuntu e debian de 32 bits  (Lida 2720 vezes)

Offline 4d4c47

  • Usuário Ubuntu
  • *
  • Mensagens: 14
    • Ver perfil
script baixa todas as dependencias e compiladores tudo automaticamente para sistemas de 32 bits:

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

Código: [Selecionar]
#!/bin/bash
#
# Script de compilação automatica do GCC,
# baixa e instala todas as dependencias e compiladores automaticamente  
#
# GPL-3.0
#
##################################################################################
 
###########################################
### escolha aqui a versão do GCC a ser compilada ##################
vs=4.6.3
###################
 
gmpvs=4.3.2
mpfrvs=2.4.2
mpcvs=0.8.1
 
###################
 
sudo mkdir /home/gcc-$vs
 
cd /home/gcc-$vs
 
#
###########
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
#
 
 
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-$vs.tar.bz2
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-ada-$vs.tar.bz2
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-core-$vs.tar.bz2
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-fortran-$vs.tar.bz2
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-g++-$vs.tar.bz2
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-go-$vs.tar.bz2
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-java-$vs.tar.bz2
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-objc-$vs.tar.bz2
 
tar -jxpvf gcc-$vs.tar.bz2
tar -jxpvf gcc-ada-$vs.tar.bz2
tar -jxpvf gcc-core-$vs.tar.bz2
tar -jxpvf gcc-fortran-$vs.tar.bz2
tar -jxpvf gcc-g++-$vs.tar.bz2
tar -jxpvf gcc-go-$vs.tar.bz2
tar -jxpvf gcc-java-$vs.tar.bz2
tar -jxpvf gcc-objc-$vs.tar.bz2
 
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
#
 
#
sudo CHOST="i486-pc-linux-gnu"
sudo export CHOST
 
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
 
 
sudo make -j2
sudo make -j2 install
 
echo 'processo terminado com exito'


; )...
« Última modificação: 13 de Agosto de 2012, 01:43 por 4d4c47 »

Offline galactus

  • Equipe Ubuntu
  • Usuário Ubuntu
  • *****
  • Mensagens: 4.663
    • Ver perfil
Re: script de compilação automatica do gcc 4.6.3 para ubuntu e debian de 32 bits
« Resposta #1 Online: 13 de Agosto de 2012, 05:38 »
E parao 64bits? Não vai ter?  :D
Kubuntu 19.04 64bits

Offline 4d4c47

  • Usuário Ubuntu
  • *
  • Mensagens: 14
    • Ver perfil
Re: script de compilação automatica do gcc 4.6.3 para ubuntu e debian de 32 bits
« Resposta #2 Online: 13 de Agosto de 2012, 14:30 »
E parao 64bits? Não vai ter?  :D

fala grande Galactus, beleza bicho ?

aqui vai uma modificação para os SO de 64 bits :

Código: [Selecionar]
#!/bin/bash
#
# Script de compilação automatica do GCC,
# baixa e instala todas as dependencias e compiladores automaticamente 
#
# GPL-3.0
#
##################################################################################
 
###########################################
### escolha aqui a versão do GCC a ser compilada ##################
vs=4.6.3
###################
 
gmpvs=4.3.2
mpfrvs=2.4.2
mpcvs=0.8.1
 
###################
 
sudo mkdir /home/gcc-$vs
 
cd /home/gcc-$vs
 
#
###########
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
#
 
 
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-$vs.tar.bz2
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-ada-$vs.tar.bz2
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-core-$vs.tar.bz2
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-fortran-$vs.tar.bz2
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-g++-$vs.tar.bz2
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-go-$vs.tar.bz2
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-java-$vs.tar.bz2
wget -c http://gcc.petsads.us/releases/gcc-$vs/gcc-objc-$vs.tar.bz2
 
tar -jxpvf gcc-$vs.tar.bz2
tar -jxpvf gcc-ada-$vs.tar.bz2
tar -jxpvf gcc-core-$vs.tar.bz2
tar -jxpvf gcc-fortran-$vs.tar.bz2
tar -jxpvf gcc-g++-$vs.tar.bz2
tar -jxpvf gcc-go-$vs.tar.bz2
tar -jxpvf gcc-java-$vs.tar.bz2
tar -jxpvf gcc-objc-$vs.tar.bz2
 
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
#
 
#
#sudo CHOST="i486-pc-linux-gnu"

sudo CHOST="x86_64-pc-linux-gnu"
sudo export CHOST
 
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
 
 
sudo make -j2
sudo make -j2 install
 
echo 'processo terminado com exito'

ainda não fiz os testes não, mas acredito que deve funcionar normalmente, o que eu fiz foi só tracar essa linha aqui:

sudo CHOST="i486-pc-linux-gnu"

por essa:

sudo CHOST="x86_64-pc-linux-gnu"


valeu.


mariojuniorjp

  • Visitante
Re: script de compilação automatica do gcc 4.6.3 para ubuntu e debian de 32 bits
« Resposta #3 Online: 18 de Janeiro de 2013, 16:09 »
No caso, o que esse arquivo faz na verdade, além de baixar as dependencias, arquivos e etc, é informar ao GCC pra qual processador será compilado o software, kernel e etc, quando a pessoa for compilar alguma coisa que utilize o GCC?