mirror of
https://github.com/xomboverlord/buildtools.git
synced 2026-01-11 18:33:17 +01:00
refactor and standardize
This commit is contained in:
70
build.sh
70
build.sh
@@ -1,34 +1,16 @@
|
||||
|
||||
# --- Argument processing ---
|
||||
|
||||
for arg in $@; do
|
||||
case $arg in
|
||||
--clean) rm -rf local/ build/*/;;
|
||||
--notest) NOTEST=1;;
|
||||
esac
|
||||
done
|
||||
|
||||
source scripts/functions.sh
|
||||
|
||||
# --- Variables ---
|
||||
source scripts/config.sh
|
||||
|
||||
# EDIT THESE
|
||||
OSNAME=xomb
|
||||
NCPU=4
|
||||
|
||||
BINUTILS_VER=2.21.1
|
||||
GCC_VER=4.6.1
|
||||
GMP_VER=5.0.2
|
||||
MPFR_VER=3.0.1
|
||||
NEWLIB_VER=1.19.0
|
||||
MPC_VER=0.9
|
||||
# NO M0AR EDITS PLZ
|
||||
|
||||
TARGET=x86_64-pc-${OSNAME}
|
||||
PREFIX=`pwd`/local
|
||||
|
||||
export PATH=$PREFIX/bin:$PATH
|
||||
|
||||
WFLAGS=-c
|
||||
if [ $CLEAN -eq 1 ]; then
|
||||
rm -rf $PREFIX build/*/
|
||||
fi
|
||||
|
||||
|
||||
# --- Directory creation ---
|
||||
@@ -37,7 +19,7 @@ mkdir -p build
|
||||
mkdir -p local
|
||||
cd build
|
||||
|
||||
echo "MAKE OBJECT DIRECTORIES"
|
||||
setphase "MAKE OBJECT DIRECTORIES"
|
||||
mkdir -p binutils-obj
|
||||
mkdir -p gcc-obj
|
||||
mkdir -p newlib-obj
|
||||
@@ -48,11 +30,11 @@ mkdir -p mpc-obj
|
||||
|
||||
# --- Fetch and extract each package ---
|
||||
|
||||
echo "FETCH BINUTILS"
|
||||
setphase "FETCH BINUTILS"
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_VER}.tar.bz2
|
||||
tar -xf binutils-${BINUTILS_VER}.tar.bz2
|
||||
|
||||
echo "FETCH GCC"
|
||||
setphase "FETCH GCC"
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/gcc/gcc-${GCC_VER}/gcc-core-${GCC_VER}.tar.gz
|
||||
tar -xf gcc-core-${GCC_VER}.tar.gz
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/gcc/gcc-${GCC_VER}/gcc-g++-${GCC_VER}.tar.gz
|
||||
@@ -60,19 +42,19 @@ tar -xf gcc-g++-${GCC_VER}.tar.gz
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/gcc/gcc-${GCC_VER}/gcc-fortran-${GCC_VER}.tar.gz
|
||||
tar -xf gcc-fortran-${GCC_VER}.tar.gz
|
||||
|
||||
echo "FETCH GMP"
|
||||
setphase "FETCH GMP"
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/gmp/gmp-${GMP_VER}.tar.gz
|
||||
tar -xf gmp-${GMP_VER}.tar.gz
|
||||
|
||||
echo "FETCH MPFR"
|
||||
setphase "FETCH MPFR"
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/mpfr/mpfr-${MPFR_VER}.tar.gz
|
||||
tar -xf mpfr-${MPFR_VER}.tar.gz
|
||||
|
||||
echo "FETCH MPC"
|
||||
setphase "FETCH MPC"
|
||||
wget $WFLAGS http://www.multiprecision.org/mpc/download/mpc-${MPC_VER}.tar.gz
|
||||
tar -xf mpc-${MPC_VER}.tar.gz
|
||||
|
||||
echo "FETCH NEWLIB"
|
||||
setphase "FETCH NEWLIB"
|
||||
wget $WFLAGS ftp://sources.redhat.com/pub/newlib/newlib-${NEWLIB_VER}.tar.gz
|
||||
tar -xf newlib-${NEWLIB_VER}.tar.gz
|
||||
|
||||
@@ -84,15 +66,15 @@ tar -xf newlib-${NEWLIB_VER}.tar.gz
|
||||
#perl -pi -e $PERLCMD *.patch
|
||||
#perl -pi -e $PERLCMD gcc-files/gcc/config/os.h
|
||||
|
||||
echo "PATCH BINUTILS"
|
||||
setphase "PATCH BINUTILS"
|
||||
patch -p0 -d binutils-${BINUTILS_VER} < ../binutils.patch || exit
|
||||
cp ../binutils-files/ld/emulparams/os_x86_64.sh binutils-${BINUTILS_VER}/ld/emulparams/${OSNAME}_x86_64.sh
|
||||
|
||||
echo "PATCH GCC"
|
||||
setphase "PATCH GCC"
|
||||
patch -p0 -d gcc-${GCC_VER} < ../gcc.patch || exit
|
||||
cp ../gcc-files/gcc/config/os.h gcc-${GCC_VER}/gcc/config/${OSNAME}.h
|
||||
|
||||
echo "PATCH NEWLIB"
|
||||
setphase "PATCH NEWLIB"
|
||||
patch -p0 -d newlib-${NEWLIB_VER} < ../newlib.patch || exit
|
||||
mkdir -p newlib-${NEWLIB_VER}/newlib/libc/sys/${OSNAME}
|
||||
cp -r ../newlib-files/* newlib-${NEWLIB_VER}/newlib/libc/sys/${OSNAME}/.
|
||||
@@ -101,7 +83,7 @@ cp ../newlib-files/vanilla-syscalls.c newlib-${NEWLIB_VER}/newlib/libc/sys/${OSN
|
||||
|
||||
# --- Compile all packages ---
|
||||
|
||||
echo "COMPILE BINUTILS"
|
||||
setphase "COMPILE BINUTILS"
|
||||
cd binutils-obj
|
||||
../binutils-${BINUTILS_VER}/configure --target=$TARGET --prefix=$PREFIX --disable-werror --enable-gold --enable-plugins || exit
|
||||
make -j$NCPU all-gold || exit
|
||||
@@ -109,7 +91,7 @@ make -j$NCPU || exit
|
||||
make install || exit
|
||||
cd ..
|
||||
|
||||
echo "COMPILE GMP"
|
||||
setphase "COMPILE GMP"
|
||||
cd gmp-obj
|
||||
../gmp-${GMP_VER}/configure --prefix=$PREFIX --enable-cxx --disable-shared || exit
|
||||
make -j$NCPU || exit
|
||||
@@ -119,7 +101,7 @@ fi
|
||||
make install || exit
|
||||
cd ..
|
||||
|
||||
echo "COMPILE MPFR"
|
||||
setphase "COMPILE MPFR"
|
||||
cd mpfr-obj
|
||||
../mpfr-${MPFR_VER}/configure --prefix=$PREFIX --with-gmp=$PREFIX --disable-shared
|
||||
make -j$NCPU || exit
|
||||
@@ -129,7 +111,7 @@ fi
|
||||
make install || exit
|
||||
cd ..
|
||||
|
||||
echo "COMPILE MPC"
|
||||
setphase "COMPILE MPC"
|
||||
cd mpc-obj
|
||||
../mpc-${MPC_VER}/configure --target=$TARGET --prefix=$PREFIX --with-gmp=$PREFIX --with-mpfr=$PREFIX --disable-shared || exit
|
||||
make -j$NCPU || exit
|
||||
@@ -140,35 +122,35 @@ make install || exit
|
||||
cd ..
|
||||
|
||||
|
||||
echo "AUTOCONF GCC"
|
||||
setphase "AUTOCONF GCC"
|
||||
cd gcc-${GCC_VER}/libstdc++-v3
|
||||
#autoconf || exit
|
||||
cd ../..
|
||||
|
||||
echo "COMPILE GCC"
|
||||
setphase "COMPILE GCC"
|
||||
cd gcc-obj
|
||||
../gcc-${GCC_VER}/configure --target=$TARGET --prefix=$PREFIX --enable-languages=c,c++ --disable-libssp --with-gmp=$PREFIX --with-mpfr=$PREFIX --with-mpc=$PREFIX --without-headers --disable-nls --with-newlib || exit
|
||||
make -j$NCPU all-gcc || exit
|
||||
make install-gcc || exit
|
||||
cd ..
|
||||
|
||||
echo "AUTOCONF NEWLIB-XOMB"
|
||||
setphase "AUTOCONF NEWLIB-XOMB"
|
||||
cd newlib-${NEWLIB_VER}/newlib/libc/sys
|
||||
autoconf || exit
|
||||
cd ${OSNAME}
|
||||
autoreconf || exit
|
||||
cd ../../../../..
|
||||
|
||||
echo "CONFIGURE NEWLIB"
|
||||
setphase "CONFIGURE NEWLIB"
|
||||
cd newlib-obj
|
||||
../newlib-${NEWLIB_VER}/configure --target=$TARGET --prefix=$PREFIX --with-gmp=$PREFIX --with-mpfr=$PREFIX -enable-newlib-hw-fp || exit
|
||||
|
||||
echo "COMPILE NEWLIB"
|
||||
setphase "COMPILE NEWLIB"
|
||||
make -j$NCPU || exit
|
||||
make install || exit
|
||||
cd ..
|
||||
|
||||
echo "PASS-2 COMPILE GCC"
|
||||
setphase "PASS-2 COMPILE GCC"
|
||||
cd gcc-obj
|
||||
#make all-target-libgcc
|
||||
#make install-target-libgcc
|
||||
@@ -178,7 +160,7 @@ make -j$NCPU all || exit
|
||||
make install || exit
|
||||
cd ..
|
||||
|
||||
echo "PASS-2 COMPILE NEWLIB"
|
||||
setphase "PASS-2 COMPILE NEWLIB"
|
||||
cp ../newlib-files/syscalls.c newlib-${NEWLIB_VER}/newlib/libc/sys/${OSNAME}/syscalls.c
|
||||
|
||||
cd newlib-obj
|
||||
|
||||
146
native-build.sh
146
native-build.sh
@@ -1,55 +1,18 @@
|
||||
|
||||
# --- resources ---
|
||||
function title {
|
||||
echo -en "\033]0;$@\007"
|
||||
}
|
||||
|
||||
function setphase {
|
||||
title $1
|
||||
echo ">>>>>>> $1"
|
||||
}
|
||||
|
||||
# --- Argument processing ---
|
||||
NOTEST=1
|
||||
EXTRAS=1
|
||||
CLEAN=0
|
||||
for arg in $@; do
|
||||
case $arg in
|
||||
--clean) CLEAN=1;;
|
||||
--notest) NOTEST=1;;
|
||||
--extras) EXTRA=1;;
|
||||
esac
|
||||
done
|
||||
|
||||
source scripts/functions.sh
|
||||
|
||||
# --- Variables ---
|
||||
|
||||
# EDIT THESE
|
||||
OSNAME=xomb
|
||||
NCPU=4
|
||||
source scripts/config.sh
|
||||
|
||||
BINUTILS_VER=2.21.1
|
||||
GCC_VER=4.6.1
|
||||
GMP_VER=5.0.2
|
||||
MPFR_VER=3.1.0
|
||||
NEWLIB_VER=1.19.0
|
||||
MPC_VER=0.9
|
||||
PPL_VER=0.11.2
|
||||
CLOOG_VER=0.16.3
|
||||
# NO M0AR EDITS PLZ
|
||||
|
||||
TARGET=x86_64-pc-${OSNAME}
|
||||
PREFIX=`pwd`/${OSNAME}-local
|
||||
|
||||
CROSSCONFIG="--prefix=${PREFIX} --host=${TARGET} --bindir=${PREFIX}/binaries --sysconfdir=${PREFIX}/config --libdir=${PREFIX}/lib --includedir=${PREFIX}/include"
|
||||
|
||||
if [ $CLEAN -eq 1 ]; then
|
||||
rm -rf $PREFIX build/*/
|
||||
fi
|
||||
|
||||
#export PATH=$PREFIX/bin:$PATH
|
||||
|
||||
WFLAGS=-c
|
||||
|
||||
|
||||
XOMBPATH=`pwd`/../xomb
|
||||
CROSSPATH=`pwd`/local
|
||||
|
||||
@@ -71,7 +34,8 @@ export LDFLAGS="-static $SHAREDLDFLAGS -L$CROSSPATH/$TARGET"
|
||||
export CPPFLAGS="-I$CROSSPATH/$TARGET/include/c++ -I$CROSSPATH/$TARGET/include/c++/$GCC_VER"
|
||||
|
||||
export CFLAGS="-static -O2 $CPPFLAGS"
|
||||
export CXXFLAGS="$CFLAGS -lsupc++ -lstdc++ -L$CROSSPATH/$TARGET"
|
||||
export CXXFLAGS="$CFLAGS"
|
||||
# -lsupc++ -lstdc++ -L$CROSSPATH/$TARGET"\
|
||||
|
||||
|
||||
export CC=$TARGET-gcc
|
||||
@@ -126,87 +90,7 @@ mkdir -p ppl-obj
|
||||
mkdir -p cloog-obj
|
||||
fi
|
||||
|
||||
# --- Fetch and extract each package ---
|
||||
|
||||
setphase "FETCH BINUTILS"
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_VER}.tar.bz2
|
||||
tar -xf binutils-${BINUTILS_VER}.tar.bz2
|
||||
|
||||
setphase "FETCH GCC"
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/gcc/gcc-${GCC_VER}/gcc-core-${GCC_VER}.tar.gz
|
||||
tar -xf gcc-core-${GCC_VER}.tar.gz
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/gcc/gcc-${GCC_VER}/gcc-g++-${GCC_VER}.tar.gz
|
||||
tar -xf gcc-g++-${GCC_VER}.tar.gz
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/gcc/gcc-${GCC_VER}/gcc-fortran-${GCC_VER}.tar.gz
|
||||
tar -xf gcc-fortran-${GCC_VER}.tar.gz
|
||||
|
||||
setphase "FETCH GMP"
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/gmp/gmp-${GMP_VER}.tar.gz
|
||||
tar -xf gmp-${GMP_VER}.tar.gz
|
||||
|
||||
setphase "FETCH MPFR"
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/mpfr/mpfr-${MPFR_VER}.tar.gz
|
||||
tar -xf mpfr-${MPFR_VER}.tar.gz
|
||||
|
||||
setphase "FETCH MPC"
|
||||
wget $WFLAGS http://www.multiprecision.org/mpc/download/mpc-${MPC_VER}.tar.gz
|
||||
tar -xf mpc-${MPC_VER}.tar.gz
|
||||
|
||||
setphase "FETCH NEWLIB"
|
||||
wget $WFLAGS ftp://sources.redhat.com/pub/newlib/newlib-${NEWLIB_VER}.tar.gz
|
||||
tar -xf newlib-${NEWLIB_VER}.tar.gz
|
||||
|
||||
if [ $EXTRAS -eq 1 ]; then
|
||||
setphase "FETCH PPL"
|
||||
wget $WFLAGS ftp://ftp.cs.unipr.it/pub/ppl/releases/${PPL_VER}/ppl-${PPL_VER}.tar.bz2
|
||||
tar -xf ppl-${PPL_VER}.tar.bz2
|
||||
|
||||
setphase "FETCH CLooG"
|
||||
wget $WFLAGS http://www.bastoul.net/cloog/pages/download/count.php3?url=./cloog-${CLOOG_VER}.tar.gz -O cloog-${CLOOG_VER}.tar.gz
|
||||
tar -xf cloog-${CLOOG_VER}.tar.gz
|
||||
fi
|
||||
|
||||
# --- Patch and push new code into each package ---
|
||||
|
||||
# Fix patches with osname
|
||||
#PERLCMD="s/{{OSNAME}}/${OSNAME}/g"
|
||||
#perl -pi -e $PERLCMD *.patch
|
||||
#perl -pi -e $PERLCMD gcc-files/gcc/config/os.h
|
||||
|
||||
# diff -rupN
|
||||
|
||||
|
||||
setphase "PATCH BINUTILS"
|
||||
patch -p0 -d binutils-${BINUTILS_VER} < ../binutils.patch || exit
|
||||
cp ../binutils-files/ld/emulparams/os_x86_64.sh binutils-${BINUTILS_VER}/ld/emulparams/${OSNAME}_x86_64.sh
|
||||
|
||||
setphase "PATCH GMP"
|
||||
patch -p1 -d gmp-${GMP_VER} < ../gmp.patch || exit
|
||||
|
||||
setphase "PATCH MPFR"
|
||||
patch -p0 -d mpfr-${MPFR_VER} < ../mpfr.patch || exit
|
||||
|
||||
setphase "PATCH MPC"
|
||||
patch -p0 -d mpc-${MPC_VER} < ../mpc.patch || exit
|
||||
|
||||
if [ $EXTRAS -eq 1 ]; then
|
||||
setphase "PATCH PPL"
|
||||
patch -p0 -d ppl-${PPL_VER} < ../ppl.patch || exit
|
||||
|
||||
setphase "PATCH CLOOG"
|
||||
patch -p0 -d cloog-${CLOOG_VER} < ../cloog.patch || exit
|
||||
fi
|
||||
|
||||
setphase "PATCH GCC"
|
||||
patch -p0 -d gcc-${GCC_VER} < ../gcc.patch || exit
|
||||
cp ../gcc-files/gcc/config/os.h gcc-${GCC_VER}/gcc/config/${OSNAME}.h
|
||||
|
||||
setphase "PATCH NEWLIB"
|
||||
patch -p0 -d newlib-${NEWLIB_VER} < ../newlib.patch || exit
|
||||
mkdir -p newlib-${NEWLIB_VER}/newlib/libc/sys/${OSNAME}
|
||||
cp -r ../newlib-files/* newlib-${NEWLIB_VER}/newlib/libc/sys/${OSNAME}/.
|
||||
cp ../newlib-files/vanilla-syscalls.c newlib-${NEWLIB_VER}/newlib/libc/sys/${OSNAME}/syscalls.c
|
||||
|
||||
source ../scripts/fetchandpatch.sh
|
||||
|
||||
# --- Compile all packages ---
|
||||
|
||||
@@ -215,7 +99,7 @@ cp ../newlib-files/vanilla-syscalls.c newlib-${NEWLIB_VER}/newlib/libc/sys/${OSN
|
||||
setphase "COMPILE _static_ BINUTILS"
|
||||
cd binutils-obj
|
||||
#--enable-plugins: Building BFD with plugin support requires a host that supports -ldl.
|
||||
../binutils-${BINUTILS_VER}/configure --host=$TARGET --prefix=$PREFIX --enable-gold --disable-werror || exit
|
||||
../binutils-${BINUTILS_VER}/configure $CROSSCONFIG --enable-gold --disable-werror || exit
|
||||
make configure-host || exit
|
||||
make -j$NCPU all-gold LDFLAGS="-all-static $SHAREDLDFLAGS" || exit
|
||||
make -j$NCPU LDFLAGS="-all-static $SHAREDLDFLAGS" || exit
|
||||
@@ -224,7 +108,7 @@ cd ..
|
||||
|
||||
setphase "COMPILE GMP"
|
||||
cd gmp-obj
|
||||
../gmp-${GMP_VER}/configure --host=$TARGET --prefix=$PREFIX --enable-cxx --disable-shared || exit
|
||||
../gmp-${GMP_VER}/configure $CROSSCONFIG --enable-cxx --disable-shared || exit
|
||||
make -j$NCPU || exit
|
||||
if [ $NOTEST -ne 1 ]; then
|
||||
make check || exit
|
||||
@@ -234,7 +118,7 @@ cd ..
|
||||
|
||||
setphase "COMPILE MPFR"
|
||||
cd mpfr-obj
|
||||
../mpfr-${MPFR_VER}/configure --host=$TARGET --prefix=$PREFIX --with-gmp=$PREFIX --disable-shared
|
||||
../mpfr-${MPFR_VER}/configure $CROSSCONFIG --with-gmp=$PREFIX --disable-shared || exit
|
||||
make -j$NCPU || exit
|
||||
if [ $NOTEST -ne 1 ]; then
|
||||
make check || exit
|
||||
@@ -244,7 +128,7 @@ cd ..
|
||||
|
||||
setphase "COMPILE MPC"
|
||||
cd mpc-obj
|
||||
../mpc-${MPC_VER}/configure --host=$TARGET --prefix=$PREFIX --with-gmp=$PREFIX --with-mpfr=$PREFIX --disable-shared || exit
|
||||
../mpc-${MPC_VER}/configure $CROSSCONFIG --with-gmp=$PREFIX --with-mpfr=$PREFIX --disable-shared || exit
|
||||
make -j$NCPU || exit
|
||||
if [ $NOTEST -ne 1 ]; then
|
||||
make check || exit
|
||||
@@ -255,7 +139,7 @@ cd ..
|
||||
if [ $EXTRAS -eq 1 ]; then
|
||||
setphase "COMPILE PPL"
|
||||
cd ppl-obj
|
||||
../ppl-${PPL_VER}/configure --host=$TARGET --prefix=$PREFIX --with-gmp-prefix=$PREFIX --disable-shared || exit
|
||||
../ppl-${PPL_VER}/configure $CROSSCONFIG --with-gmp-prefix=$PREFIX --disable-shared || exit
|
||||
make -j$NCPU || exit
|
||||
if [ $NOTEST -ne 1 ]; then
|
||||
make check || exit
|
||||
@@ -265,7 +149,7 @@ cd ..
|
||||
|
||||
setphase "COMPILE CLOOG"
|
||||
cd cloog-obj
|
||||
../cloog-${CLOOG_VER}/configure --host=$TARGET --prefix=$PREFIX --with-gmp-prefix=$PREFIX --disable-shared || exit
|
||||
../cloog-${CLOOG_VER}/configure $CROSSCONFIG --with-gmp-prefix=$PREFIX --disable-shared || exit
|
||||
make -j$NCPU || exit
|
||||
if [ $NOTEST -ne 1 ]; then
|
||||
make check || exit
|
||||
@@ -282,7 +166,7 @@ cd ../..
|
||||
|
||||
setphase "COMPILE GCC"
|
||||
cd gcc-obj
|
||||
../gcc-${GCC_VER}/configure --prefix=$PREFIX --host=$TARGET --enable-languages=c,c++ --disable-libssp --with-gmp=$PREFIX --with-mpfr=$PREFIX --with-mpc=$PREFIX --with-ppl=$PREFIX --enable-cloog-backend=isl --disable-nls --with-newlib --without-headers --disable-shared || exit
|
||||
../gcc-${GCC_VER}/configure $CROSSCONFIG --enable-languages=c,c++ --disable-libssp --with-gmp=$PREFIX --with-mpfr=$PREFIX --with-mpc=$PREFIX --with-ppl=$PREFIX --enable-cloog-backend=isl --disable-nls --with-newlib --without-headers --disable-shared || exit
|
||||
#--with-cloog=$PREFIX
|
||||
make -j$NCPU all-gcc LDFLAGS="$LDFLAGS" || exit
|
||||
make install-gcc LDFLAGS="$LDFLAGS" || exit
|
||||
@@ -298,7 +182,7 @@ cd ../../../../..
|
||||
setphase "CONFIGURE NEWLIB"
|
||||
cp ../newlib-files/syscalls.c newlib-${NEWLIB_VER}/newlib/libc/sys/${OSNAME}/syscalls.c
|
||||
cd newlib-obj
|
||||
../newlib-${NEWLIB_VER}/configure --target=$TARGET --host=$TARGET --prefix=$PREFIX --with-gmp=$PREFIX --with-mpfr=$PREFIX -enable-newlib-hw-fp || exit
|
||||
../newlib-${NEWLIB_VER}/configure $CROSSCONFIG --target=$TARGET --with-gmp=$PREFIX --with-mpfr=$PREFIX -enable-newlib-hw-fp || exit
|
||||
|
||||
setphase "COMPILE NEWLIB"
|
||||
make -j$NCPU || exit
|
||||
|
||||
16
scripts/config.sh
Normal file
16
scripts/config.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
# EDIT THESE
|
||||
OSNAME=xomb
|
||||
NCPU=4
|
||||
|
||||
BINUTILS_VER=2.21.1
|
||||
GCC_VER=4.6.1
|
||||
GMP_VER=5.0.2
|
||||
MPFR_VER=3.1.0
|
||||
NEWLIB_VER=1.19.0
|
||||
MPC_VER=0.9
|
||||
PPL_VER=0.11.2
|
||||
CLOOG_VER=0.16.3
|
||||
# NO M0AR EDITS PLZ
|
||||
|
||||
TARGET=x86_64-pc-${OSNAME}
|
||||
WFLAGS=-c
|
||||
80
scripts/fetchandpatch.sh
Normal file
80
scripts/fetchandpatch.sh
Normal file
@@ -0,0 +1,80 @@
|
||||
# --- Fetch and extract each package ---
|
||||
|
||||
setphase "FETCH BINUTILS"
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/binutils/binutils-${BINUTILS_VER}.tar.bz2
|
||||
tar -xf binutils-${BINUTILS_VER}.tar.bz2
|
||||
|
||||
setphase "FETCH GCC"
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/gcc/gcc-${GCC_VER}/gcc-core-${GCC_VER}.tar.gz
|
||||
tar -xf gcc-core-${GCC_VER}.tar.gz
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/gcc/gcc-${GCC_VER}/gcc-g++-${GCC_VER}.tar.gz
|
||||
tar -xf gcc-g++-${GCC_VER}.tar.gz
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/gcc/gcc-${GCC_VER}/gcc-fortran-${GCC_VER}.tar.gz
|
||||
tar -xf gcc-fortran-${GCC_VER}.tar.gz
|
||||
|
||||
setphase "FETCH GMP"
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/gmp/gmp-${GMP_VER}.tar.gz
|
||||
tar -xf gmp-${GMP_VER}.tar.gz
|
||||
|
||||
setphase "FETCH MPFR"
|
||||
wget $WFLAGS http://ftp.gnu.org/gnu/mpfr/mpfr-${MPFR_VER}.tar.gz
|
||||
tar -xf mpfr-${MPFR_VER}.tar.gz
|
||||
|
||||
setphase "FETCH MPC"
|
||||
wget $WFLAGS http://www.multiprecision.org/mpc/download/mpc-${MPC_VER}.tar.gz
|
||||
tar -xf mpc-${MPC_VER}.tar.gz
|
||||
|
||||
setphase "FETCH NEWLIB"
|
||||
wget $WFLAGS ftp://sources.redhat.com/pub/newlib/newlib-${NEWLIB_VER}.tar.gz
|
||||
tar -xf newlib-${NEWLIB_VER}.tar.gz
|
||||
|
||||
if [ $EXTRAS -eq 1 ]; then
|
||||
setphase "FETCH PPL"
|
||||
wget $WFLAGS ftp://ftp.cs.unipr.it/pub/ppl/releases/${PPL_VER}/ppl-${PPL_VER}.tar.bz2
|
||||
tar -xf ppl-${PPL_VER}.tar.bz2
|
||||
|
||||
setphase "FETCH CLooG"
|
||||
wget $WFLAGS http://www.bastoul.net/cloog/pages/download/count.php3?url=./cloog-${CLOOG_VER}.tar.gz -O cloog-${CLOOG_VER}.tar.gz
|
||||
tar -xf cloog-${CLOOG_VER}.tar.gz
|
||||
fi
|
||||
|
||||
# --- Patch and push new code into each package ---
|
||||
|
||||
# Fix patches with osname
|
||||
#PERLCMD="s/{{OSNAME}}/${OSNAME}/g"
|
||||
#perl -pi -e $PERLCMD *.patch
|
||||
#perl -pi -e $PERLCMD gcc-files/gcc/config/os.h
|
||||
|
||||
# diff -rupN
|
||||
|
||||
|
||||
setphase "PATCH BINUTILS"
|
||||
patch -p0 -d binutils-${BINUTILS_VER} < ../binutils.patch || exit
|
||||
cp ../binutils-files/ld/emulparams/os_x86_64.sh binutils-${BINUTILS_VER}/ld/emulparams/${OSNAME}_x86_64.sh
|
||||
|
||||
setphase "PATCH GMP"
|
||||
patch -p1 -d gmp-${GMP_VER} < ../gmp.patch || exit
|
||||
|
||||
setphase "PATCH MPFR"
|
||||
patch -p0 -d mpfr-${MPFR_VER} < ../mpfr.patch || exit
|
||||
|
||||
setphase "PATCH MPC"
|
||||
patch -p0 -d mpc-${MPC_VER} < ../mpc.patch || exit
|
||||
|
||||
if [ $EXTRAS -eq 1 ]; then
|
||||
setphase "PATCH PPL"
|
||||
patch -p0 -d ppl-${PPL_VER} < ../ppl.patch || exit
|
||||
|
||||
setphase "PATCH CLOOG"
|
||||
patch -p0 -d cloog-${CLOOG_VER} < ../cloog.patch || exit
|
||||
fi
|
||||
|
||||
setphase "PATCH GCC"
|
||||
patch -p0 -d gcc-${GCC_VER} < ../gcc.patch || exit
|
||||
cp ../gcc-files/gcc/config/os.h gcc-${GCC_VER}/gcc/config/${OSNAME}.h
|
||||
|
||||
setphase "PATCH NEWLIB"
|
||||
patch -p0 -d newlib-${NEWLIB_VER} < ../newlib.patch || exit
|
||||
mkdir -p newlib-${NEWLIB_VER}/newlib/libc/sys/${OSNAME}
|
||||
cp -r ../newlib-files/* newlib-${NEWLIB_VER}/newlib/libc/sys/${OSNAME}/.
|
||||
cp ../newlib-files/vanilla-syscalls.c newlib-${NEWLIB_VER}/newlib/libc/sys/${OSNAME}/syscalls.c
|
||||
23
scripts/functions.sh
Normal file
23
scripts/functions.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
# --- resources ---
|
||||
function title {
|
||||
echo -en "\033]0;$@\007"
|
||||
}
|
||||
|
||||
function setphase {
|
||||
title $1
|
||||
echo ">>>>>>> $1"
|
||||
}
|
||||
|
||||
# --- Argument processing ---
|
||||
NOTEST=1
|
||||
EXTRAS=1
|
||||
CLEAN=0
|
||||
for arg in $@; do
|
||||
case $arg in
|
||||
--clean) CLEAN=1;;
|
||||
--notest) NOTEST=1;;
|
||||
--extras) EXTRA=1;;
|
||||
esac
|
||||
done
|
||||
|
||||
|
||||
Reference in New Issue
Block a user