Jueves, 02 de marzo de 2006
Algunas notas que tengo del código fuente del VT-OS del Helio, para conservarlas antes de formatear mi disco duro con Windows y pasarme "definitivamente" (esperemos) a Linux.
Algunas definiciones:
Zorro: Amiga Zorro bus
Betty: "Betty" companion chip (audio/telecom/touch panel) for the r39xx processors. Known as the Toshiba TC35143F or Philips UCB1200.
Configuración para la compilación
binutils -------- gunzip < binutils-2.15.tar.gz | tar xvf - mkdir build-binutils cd build-binutils ../binutils-2.15/configure --target=mips-tx39-ecoff --prefix=/gnutools --disable-nls 2>&1 | tee configure.out make -w all 2>&1 | tee make.out make -w install 2>&1 | tee install.out gcc-bootstrap ------------- gunzip < gcc-core-3.2.3.tar.gz | tar xvf - mkdir build-bootstrap cd build-bootstrap export PATH=$PATH:/gntools/bin ../gcc-3.2.3/configure --target=mips-tx39-ecoff --prefix=/gnutools --disable-nls --enable-languages=c --without-headers --with-newlib --with-gnu-as --with-gnu-ld 2>&1 | tee configure.out make -w all-gcc 2>&1 | tee make.out make -w install 2>&1 | tee install.out
#!/bin/bash
#
# Archivo: build.sh
# Proposito: Construir Utilidades GNU Especificas
################################################################################
# Preferencias Globales
#
# Esa seccion establece las preferencias del tipo de compilador a construir
# y donde sera instalado.
#
##
# El destipo para el compilador-cruzado:
target=mips-tx39-ecoff
##
# El directorio en el que instalaremos las herramientas
prefix=/gnutools/$target
##
# Ubicacion del Compilador Nativo
CC=/bin/gcc
##
# Ensamblador Nativo
AS=/bin/as
##
# Utilizar sudo para instalar (dejar en blanco para no usar sudo)
SUDO=""
################################################################################
# buildUtil
#
##
# Opciones
# -C Argumentos opcionales para la ejecucion de "configure"
# -c Configurar (configure)
# -d Borrar configuracion anterior
# -i Instalar (make install)
# -m Contruir (make all)
# -M Argumentos opcionales para la ejecucion de "make all"
# -p Nombre del programa a construir (binutils | gcc)
# -t Plataforma de destino de la compilacion
# -v Version del programa a construir
# -- Equivalente a "-C"
function buildUtil()
{
progName=
version=
configure=
build=
install=
configArgs=
target=
deleteOldConfig=
# Parametros posibles
optstr="C:cdimMp:t:v:"
# Preparamos getopts para poder leer las opciones pasadas a esta funcion
OPTIND=1
# Leemos la primera opcion pasada
getopts $optstr opt
# Esto creo que no haria falta
OPTIND=1
while [[ $? == 0 ]]; do
case $opt in
"C")
configArgs=$OPTARG
;;
"c")
configure=1
;;
"d")
deleteOldConfig=1
;;
"i")
install=1
;;
"m")
build=1
;;
"M")
buildArgs=$OPTARG
;;
"p")
progName=$OPTARG
;;
"t")
target=$OPTARG
;;
"v")
version=$OPTARG
;;
"--")
configArgs=$OPTARG
;;
*)
echo "Argumento Invalido para $0: $opt"
exit -2
;;
esac
getopts $optstr opt
done
##
# Establecemos el path para binutils si no estamos construyendo binutils
if [[ $progName != 'binutils' ]]; then
export PATH=$PATH':'$prefix'/bin'
fi
echo "Construyendo $progName version $version para $target"
##
# Configuracion
if [[ $configure == 1 ]]; then
# Borramos anterior configuracion si se solicita
if [[ $deleteOldConfig == 1 ]]; then
rm -rf build-$progName-$version-$target
fi
# Creamos el directorio para la configuracion
mkdir -p build-$progName-$version-$target
cd build-$progName-$version-$target
echo "Ejecutando: ../$progName-$version/configure "
echo " --target=$target "
echo " --prefix=$prefix "
echo " -v "
echo " $configArgs"
../$progName-$version/configure \
--target=$target \
--prefix=$prefix \
-v \
$configArgs
cd ..
fi
##
# Compilacion
if [[ $build == 1 ]]; then
cd build-$progName-$version-$target
echo "Ejecutando: make $buildArgs all"
make $buildArgs all
cd ..
fi
##
# Instalacion
if [[ $install == 1 ]]; then
cd build-$progName-$version-$target
if [[ $? == 0 ]]; then
echo "Ejecutando: $SUDO make install"
$SUDO make install
else
cd ..
echo "La construccion de $progName-$version ha fallado!"
exit -1
fi
cd ..
fi
exit 0
}
################################################################################
# Script Principal
#
## Opciones
# -a Tarea de construccion a realizar (0 = todas)
# -b Construir solamente binutils
# -d Eliminar la configuracion de anteriores ejecuciones
# -D Fecha en forma de cadena para anexar a los nombres de los archivos de log
# -g Construir solamente gcc
# -m
# -c
# -t Plataforma de destino de la compilacion cruzada
# -G Version de GCC
# -B Version de BinUtils
# -N Version de NewLib
# -p Directorio de instalacion
actionargs=
del=
optstr="a:B:bcdD:G:gmN:p:t:"
binutilsver=2.10.1
gccver=2.95.3
newlibver=1.9.0
action=
dateStr=`date +%Y%m%d-%H%M%S`
# Probamos a leer el primer argumento para provocar un error si no hay argumentos
getopts $optstr opt
# Esto no se porque esta aqui, yo creo que hace que leamos dos veces el primer parametro
OPTIND=1
# Mientras getopts no produzca error (sigue habiendo argumentos)
while [[ $? == 0 ]]; do
case $opt in
"a")
# Construimos todo pero el que exactamente depende del valor del nivel de a
action="all"
action=$action$OPTARG
;;
"b")
# Construimos solo binutils
action="binutils"
;;
"d")
del="-d"
;;
"D")
dateStr=$OPTARG
;;
"g")
action="gcc"
;;
"m")
actionargs=$actionargs' -m'
;;
"c")
actionargs=$actionargs' -c'
;;
"t")
target=$OPTARG
;;
"G")
gccver=$OPTARG
;;
"B")
binutilsver=$OPTARG
;;
"N")
newlibver=$OPTARG
;;
"p")
prefix=$OPTARG
;;
*)
echo "Argumento invalido para $0: $opt"
exit -2
;;
esac
getopts $optstr opt
done
mkdir -p ./logs
case $action in
"gcc")
# Construimos gcc
buildUtil -p gcc -v $gccver -t $target $actionargs
;;
"binutils")
# Contruimos binutils
buildUtil -p binutils -v $binutilsver -t $target $actionargs
;;
"all0")
# Contruimos todo desde cero
test -d $prefix
if [[ $? == 0 ]]; then
echo "Error: Ya existe el directorio $prefix!"
echo "Error: Cancelando para no sobre-escribir herramientas existentes!"
exit -1
fi
# Ejecutamos "all1" con los mismos parametros
$0 -a1 -t $target -p $prefix -G $gccver -B $binutilsver -N $newlibver $del -D $dateStr
# Obtenemos el codigo de error
excd=$?
# Y si huvo error salimos con ese codigo
if [[ $excd != 0 ]]; then
exit $excd
fi
# Si no hubo error ejecutamos "all2" con los mismos parametros y así hasta "all12"
$0 -a2 -t $target -p $prefix -G $gccver -B $binutilsver -N $newlibver $del -D $dateStr
excd=$?
if [[ $excd != 0 ]]; then
exit $excd
fi
$0 -a3 -t $target -p $prefix -G $gccver -B $binutilsver -N $newlibver $del -D $dateStr
excd=$?
if [[ $excd != 0 ]]; then
exit $excd
fi
$0 -a4 -t $target -p $prefix -G $gccver -B $binutilsver -N $newlibver $del -D $dateStr
excd=$?
if [[ $excd != 0 ]]; then
exit $excd
fi
$0 -a5 -t $target -p $prefix -G $gccver -B $binutilsver -N $newlibver $del -D $dateStr
excd=$?
if [[ $excd != 0 ]]; then
exit $excd
fi
$0 -a6 -t $target -p $prefix -G $gccver -B $binutilsver -N $newlibver $del -D $dateStr
excd=$?
if [[ $excd != 0 ]]; then
exit $excd
fi
$0 -a7 -t $target -p $prefix -G $gccver -B $binutilsver -N $newlibver $del -D $dateStr
excd=$?
if [[ $excd != 0 ]]; then
exit $excd
fi
$0 -a8 -t $target -p $prefix -G $gccver -B $binutilsver -N $newlibver $del -D $dateStr
excd=$?
if [[ $excd != 0 ]]; then
exit $excd
fi
$0 -a9 -t $target -p $prefix -G $gccver -B $binutilsver -N $newlibver $del -D $dateStr
excd=$?
if [[ $excd != 0 ]]; then
exit $excd
fi
$0 -a10 -t $target -p $prefix -G $gccver -B $binutilsver -N $newlibver $del -D $dateStr
excd=$?
if [[ $excd != 0 ]]; then
exit $excd
fi
$0 -a11 -t $target -p $prefix -G $gccver -B $binutilsver -N $newlibver $del -D $dateStr
excd=$?
if [[ $excd != 0 ]]; then
exit $excd
fi
$0 -a12 -t $target -p $prefix -G $gccver -B $binutilsver -N $newlibver $del -D $dateStr
;;
"all1")
# Format for Creating Files...
# ./tst > out.log 1>&2 2>&1 2> out.err
echo "Configurando binutils"
buildUtil -c $del -p binutils -v $binutilsver -t $target \
2>&1 | tee -a ./logs/binutils-$target-$dateStr.log
;;
"all2")
echo "Construyendo binutils"
buildUtil -m -p binutils -v $binutilsver -t $target \
2>&1 | tee -a ./logs/binutils-$target-$dateStr.log
;;
"all3")
echo "Instalando binutils"
buildUtil -i -p binutils -v $binutilsver -t $target \
2>&1 | tee -a ./logs/binutils-$target-$dateStr.log
;;
"all4")
echo "Configurando gcc para construir su nucleo"
buildUtil -c $del -p gcc -v $gccver -t $target \
-C "--with-gnu-ar \
--with-gnu-as \
--with-gnu-ld \
--with-newlib \
--enable-languages=c" \
2>&1 | tee -a ./logs/gcc-$target-$dateStr.log
;;
"all5")
echo "Constuyendo el Nucleo de Construccion de GCC"
buildUtil -m -p gcc -v $gccver -t $target \
2>&1 | tee -a ./logs/gcc-$target-$dateStr.log
#-M "LANGUAGES=c" \
;;
"all6")
echo "Instalando el Nucleo de Construccion de GCC"
buildUtil -i -p gcc -v $gccver -t $target \
2>&1 | tee -a ./logs/gcc-$target-$dateStr.log
;;
"all7")
echo "Configurando newlib"
buildUtil -c $del -p newlib -v $newlibver -t $target \
-C "--with-gnu-ar \
--with-gnu-as \
--with-gnu-ld" \
2>&1 | tee -a ./logs/newlib-$target-$dateStr.log
;;
"all8")
echo "Construyendo newlib"
buildUtil -m -p newlib -v $newlibver -t $target \
2>&1 | tee -a ./logs/newlib-$target-$dateStr.log
;;
"all9")
echo "Instalando newlib"
buildUtil -i -p newlib -v $newlibver -t $target \
2>&1 | tee -a ./logs/newlib-$target-$dateStr.log
;;
"all10")
echo "Configurando gcc para una construccion completa"
buildUtil -c -p gcc -v $gccver -t $target \
-C "--with-gnu-ar \
--with-gnu-as \
--with-gnu-ld \
--with-newlib \
--enable-languages=c,c++" \
2>&1 | tee -a ./logs/gcc-full-$target-$dateStr.log
;;
"all11")
echo "Construyendo la Construccion Completa de gcc"
buildUtil -m -p gcc -v $gccver -t $target \
2>&1 | tee -a ./logs/gcc-full-$target-$dateStr.log
;;
"all12")
echo "Instalando la Construccion Completa de GCC"
buildUtil -i -p gcc -v $gccver -t $target \
2>&1 | tee -a ./logs/gcc-full-$target-$dateStr.log
;;
*)
echo "Nada que hacer!"
exit 0
;;
esac
# Comprobamos si huvo errores
if [[ $? == 0 ]]; then
exit 0
else
exit -1
fi
# Aqui creo que nunca llegariamos
exit -2
Por: Rubén Suárez Alvarez | Helio PDA | Comentarios (0) | Referencias (0)
"El trabajo tiene un peso específico dentro de la empresa. A más trabajo, más peso y por tanto más abajo estás. A menor trabajo más ligero te vuelves y más asciendes. ¿Y tú, trabajas o asciendes en tu empresa?"
rubensa
| << | >> | |||||
| Lu | Ma | Mi | Ju | Vi | Sá | Do |
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | 31 | ||
Bitácora de Rubén Suárez Alvarez
Online gracias a 