Mon 14 Oct 23:41:31 CEST 2024
This commit is contained in:
parent
d0da25c0d8
commit
450a87a775
63
i686-elf-tools.sh
Normal file
63
i686-elf-tools.sh
Normal file
|
@ -0,0 +1,63 @@
|
|||
#!/bin/sh
|
||||
|
||||
GCC="gcc-8.2.0"
|
||||
BINUTILS="binutils-2.31.1"
|
||||
GDB="gdb-9.1"
|
||||
|
||||
CURRDIR=`pwd`
|
||||
PREFIX=$CURRDIR/cross
|
||||
WORKDIR=`mktemp -d`
|
||||
|
||||
echo "Installing cross-compiler to $PREFIX"
|
||||
echo "Building in directory $WORKDIR"
|
||||
|
||||
cd "$WORKDIR"
|
||||
|
||||
# get and extract sources
|
||||
|
||||
if [ ! -d $BINUTILS ]
|
||||
then
|
||||
curl --insecure -O https://ftp.gnu.org/gnu/binutils/$BINUTILS.tar.gz
|
||||
tar -zxf $BINUTILS.tar.gz
|
||||
fi
|
||||
|
||||
if [ ! -d $GCC ]
|
||||
then
|
||||
curl --insecure -O https://ftp.gnu.org/gnu/gcc/$GCC/$GCC.tar.gz
|
||||
tar -zxf $GCC.tar.gz
|
||||
fi
|
||||
|
||||
if [ ! -d $GDB ]
|
||||
then
|
||||
curl --insecure -O http://ftp.gnu.org/gnu/gdb/$GDB.tar.gz
|
||||
tar -zxf $GDB.tar.gz
|
||||
fi
|
||||
|
||||
# build and install libtools
|
||||
cd $BINUTILS
|
||||
./configure --prefix="$PREFIX" --target=i686-elf --disable-nls --disable-werror --with-sysroot
|
||||
make && make install
|
||||
cd ..
|
||||
|
||||
# download gcc prerequisites
|
||||
cd $GCC
|
||||
./contrib/download_prerequisites
|
||||
cd ..
|
||||
|
||||
# build and install gcc
|
||||
mkdir $GCC-elf-objs
|
||||
cd $GCC-elf-objs
|
||||
../$GCC/configure --prefix="$PREFIX" --target=i686-elf --disable-nls --enable-languages=c --without-headers
|
||||
make all-gcc && make all-target-libgcc && make install-gcc && make install-target-libgcc
|
||||
cd ..
|
||||
|
||||
# build and install GDB
|
||||
mkdir ${GDB}-build
|
||||
cd ${GDB}-build
|
||||
../${GDB}/configure --prefix="$PREFIX" --target=i686-elf
|
||||
make && make install
|
||||
cd ..
|
||||
|
||||
cd "$CURRDIR"
|
||||
rm -rf "$WORKDIR"
|
||||
|
Loading…
Reference in New Issue
Block a user