Wikia

CHDK Wiki

Srsa 4c/Toolchain scripts

Talk0
577pages on
this wiki

< User:Srsa 4c


The scripts below are slightly modified versions of this one: http://chdk.wikia.com/wiki/Gcc452

gcc 4.4.3 + binutils 2.18Edit

Newlib is not needed, but I haven't tried to remove its traces and compilation from the script. Same gcc and binutils version is used on the autobuild server (as of June 2013).

#!/bin/sh
# Builds a arm-elf cross compiler for use on linux
# host systems. This target has no file system or kernel.
#
TARGET="arm-elf"
BUILDDIR=`pwd`
BUILDDIR="${BUILDDIR}/build-dir"
mkdir ${BUILDDIR}
SRC="${BUILDDIR}/packages" # package directory
PREFIX="${BUILDDIR}/arm/toolchain" # final toolchain directory
PARALLEL="-j 2"
#PARALLEL=
BINUTILS=binutils-2.18
GCC=gcc-4.4.3
GMP=gmp-5.0.1
#MPFR=mpfr-3.1.2
MPFR=mpfr-3.0.1
MPC=mpc-0.8.2
NEWLIB=newlib-1.18.0
export PATH="$PATH:$PREFIX/bin"
# Before we do anything we need all the source files.
# We keep them in one place and we never need to
# download them twice if this build fails.
mkdir $SRC
cd $SRC
echo "Downloading source packages. This may take a while."
echo
wget -c http://ftp.gnu.org/gnu/binutils/$BINUTILS.tar.bz2
wget -c ftp://ftp.gnu.org/gnu/gcc/$GCC/$GCC.tar.bz2
wget -c ftp://ftp.gmplib.org/pub/$GMP/$GMP.tar.bz2
#wget -c http://www.mpfr.org/mpfr-current/$MPFR.tar.bz2
# http://stackoverflow.com/questions/9297933/cannot-configure-gcc-mpfr-not-found
wget -c http://ftp.gnu.org/gnu/mpfr/$MPFR.tar.bz2
wget -c http://www.multiprecision.org/mpc/download/$MPC.tar.gz
wget -c ftp://sources.redhat.com/pub/newlib/$NEWLIB.tar.gz
cd ..
echo "Starting Build..."
echo
mkdir build
echo "Building binutils"
echo
tar xfj $SRC/$BINUTILS.tar.bz2
cd $BINUTILS
./configure --target=$TARGET --prefix=$PREFIX --disable-werror
# --enable-interwork --disable-multilib --with-gnu-as
# --with-gnu-ld --disable-nls --disable-werror
make $PARALLEL
make install
cd ..
rm -rf build/* $BINUTILS
echo "Building GCC pass 1"
tar xfj $SRC/$GCC.tar.bz2
# the compiler math prereqs
tar -jxf $SRC/$GMP.tar.bz2
tar -jxf $SRC/$MPFR.tar.bz2
tar -zxf $SRC/$MPC.tar.gz
cd $GCC
mv ../$GMP gmp
mv ../$MPFR mpfr
mv ../$MPC mpc
cd ../build
#
ed ../$GCC/gcc/config/arm/t-arm-elf << EOF
/MULTILIB_OPTIONS/s/^M/# M/
/MULTILIB_DIRNAMES/s/^M/# M/
/mno-thumb-interwork/s/^# //
/normal interwork/s/^# //
wq
EOF
#
../$GCC/configure --target=$TARGET --prefix=$PREFIX --enable-interwork \
--enable-multilib --enable-languages="c" --disable-newlib \
--with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs \
--without-headers --disable-shared --disable-nls --with-gnu-as --with-gnu-ld --disable-libssp
make $PARALLEL all-gcc
make install-gcc
cd ..
rm -rf build/* # (We retain the GCC directory for pass 2)
echo "Building Newlib"
echo
tar xfz $SRC/$NEWLIB.tar.gz
cd build
../$NEWLIB/configure --target=$TARGET --prefix=$PREFIX --enable-interwork \
--enable-multilib --with-gnu-as --with-gnu-ld --disable-nls
make $PARALLEL
make install
cd ..
rm -rf build/* $NEWLIB
echo " Building GCC pass 2"
echo
cd build
../$GCC/configure --target=$TARGET --prefix=$PREFIX --enable-interwork \
--enable-multilib --enable-languages="c" --disable-newlib \
--with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs \
--without-headers --disable-libssp --disable-nls --disable-zlib --disable-libc --disable-libm --disable-intl \
--disable-hardfloat --disable-threads --with-gnu-as --with-gnu-ld --disable-shared --disable-libssp
make $PARALLEL
make install
cd ..
rm -rf build/* $GCC
echo "Compiler Finished for "$TARGET

gcc 4.6.4 + binutils 2.18Edit

#!/bin/sh
# Builds a arm-elf cross compiler for use on linux
# host systems. This target has no file system or kernel.
#
TARGET="arm-elf"
BUILDDIR=`pwd`
BUILDDIR="${BUILDDIR}/build-dir"
mkdir ${BUILDDIR}
SRC="${BUILDDIR}/packages" # package directory
PREFIX="${BUILDDIR}/arm/toolchain" # final toolchain directory
PARALLEL="-j 2"
#PARALLEL=
BINUTILS=binutils-2.18
GCC=gcc-4.6.4
GMP=gmp-5.0.1
#MPFR=mpfr-3.1.2
MPFR=mpfr-3.0.1
MPC=mpc-0.8.2
NEWLIB=newlib-1.18.0
export PATH="$PATH:$PREFIX/bin"
# Before we do anything we need all the source files.
# We keep them in one place and we never need to
# download them twice if this build fails.
mkdir $SRC
cd $SRC
echo "Downloading source packages. This may take a while."
echo
wget -c http://ftp.gnu.org/gnu/binutils/$BINUTILS.tar.bz2
wget -c ftp://ftp.gnu.org/gnu/gcc/$GCC/$GCC.tar.bz2
wget -c ftp://ftp.gmplib.org/pub/$GMP/$GMP.tar.bz2
#wget -c http://www.mpfr.org/mpfr-current/$MPFR.tar.bz2
# http://stackoverflow.com/questions/9297933/cannot-configure-gcc-mpfr-not-found
wget -c http://ftp.gnu.org/gnu/mpfr/$MPFR.tar.bz2
wget -c http://www.multiprecision.org/mpc/download/$MPC.tar.gz
wget -c ftp://sources.redhat.com/pub/newlib/$NEWLIB.tar.gz
cd ..
echo "Starting Build..."
echo
mkdir build
echo "Building binutils"
echo
tar xfj $SRC/$BINUTILS.tar.bz2
cd $BINUTILS
./configure --target=$TARGET --prefix=$PREFIX --disable-werror
# --enable-interwork --disable-multilib --with-gnu-as
# --with-gnu-ld --disable-nls --disable-werror
make $PARALLEL
make install
cd ..
rm -rf build/* $BINUTILS
echo "Building GCC pass 1"
tar xfj $SRC/$GCC.tar.bz2
# the compiler math prereqs
tar -jxf $SRC/$GMP.tar.bz2
tar -jxf $SRC/$MPFR.tar.bz2
tar -zxf $SRC/$MPC.tar.gz
cd $GCC
mv ../$GMP gmp
mv ../$MPFR mpfr
mv ../$MPC mpc
cd ../build
#
ed ../$GCC/gcc/config/arm/t-arm-elf << EOF
/MULTILIB_OPTIONS/s/^M/# M/
/MULTILIB_DIRNAMES/s/^M/# M/
/mno-thumb-interwork/s/^# //
/normal interwork/s/^# //
wq
EOF
#
../$GCC/configure --target=$TARGET --prefix=$PREFIX --enable-interwork \
--enable-multilib --enable-languages="c" --with-newlib \
--with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs \
--without-headers --disable-shared --disable-nls --with-gnu-as --with-gnu-ld
make $PARALLEL all-gcc
make install-gcc
cd ..
rm -rf build/* # (We retain the GCC directory for pass 2)
echo "Building Newlib"
echo
tar xfz $SRC/$NEWLIB.tar.gz
cd build
../$NEWLIB/configure --target=$TARGET --prefix=$PREFIX --enable-interwork \
--enable-multilib --with-gnu-as --with-gnu-ld --disable-nls
make $PARALLEL
make install
cd ..
rm -rf build/* $NEWLIB
echo " Building GCC pass 2"
echo
cd build
../$GCC/configure --target=$TARGET --prefix=$PREFIX --enable-interwork \
--enable-multilib --enable-languages="c" --with-newlib \
--with-gmp-include=$(pwd)/gmp --with-gmp-lib=$(pwd)/gmp/.libs \
--without-headers --disable-libssp --disable-nls --disable-zlib --disable-libc --disable-libm --disable-intl \
--disable-hardfloat --disable-threads --with-gnu-as --with-gnu-ld
make $PARALLEL
make install
cd ..
rm -rf build/* $GCC
echo "Compiler Finished for "$TARGET

Around Wikia's network

Random Wiki