mirror of
https://github.com/KeithDHedger/LFSPkgBuilds.git
synced 2025-08-20 13:14:52 +00:00
545 lines
16 KiB
Bash
Executable File
545 lines
16 KiB
Bash
Executable File
#!/bin/bash -e
|
|
#
|
|
#©K. D. Hedger. Wed 3 Mar 14:36:07 GMT 2021 keithdhedger@gmail.com
|
|
#
|
|
#This file (BuildTools1) is part of LFSPkgBuilds.
|
|
#
|
|
#LFSPkgBuilds is free software: you can redistribute it and/or modify
|
|
#it under the terms of the GNU General Public License as published by
|
|
#the Free Software Foundation, either version 3 of the License, or
|
|
#at your option) any later version.
|
|
#
|
|
#LFSPkgBuilds is distributed in the hope that it will be useful,
|
|
#but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
#GNU General Public License for more details.
|
|
#
|
|
#You should have received a copy of the GNU General Public License
|
|
#along with LFSPkgBuilds. If not, see <http://www.gnu.org/licenses/>.
|
|
#
|
|
#Version 10.1
|
|
|
|
|
|
RED='\e[1;31m'
|
|
GREEN='\e[1;32m'
|
|
NORMAL='\e[0;0m'
|
|
|
|
trap 'echo -e "$0 ${RED}FAILED${NORMAL} at line ${GREEN}${LINENO}${NORMAL}"' ERR
|
|
|
|
if [ -e ./SystemData ];then
|
|
. ./SystemData
|
|
else
|
|
echo "No SystemData file found ..."
|
|
exit 100
|
|
fi
|
|
|
|
if [ -e ./PkgVersions ];then
|
|
. ./PkgVersions
|
|
else
|
|
echo "No PkgVersions file found ..."
|
|
exit 100
|
|
fi
|
|
|
|
mkdir -vp "${LFS}${SOURCEARCHIVES}" "$LFS/${PKGARCHIVES}"|| true
|
|
|
|
if ! mountpoint $LFS/${PKGARCHIVES} && ! mountpoint $LFS/${SOURCEARCHIVES} ;then
|
|
if [ "X$EXTFOLDER" != "X" ];then
|
|
sudo -p "Enter admin PW to bind $EXTFOLDER to $LFS/${PKGARCHIVES}: " mount --bind $EXTFOLDER/${PKGARCHIVES} $LFS/${PKGARCHIVES}
|
|
sudo -p "Enter admin PW to bind $EXTFOLDER $LFS/${SOURCEARCHIVES}: " mount --bind $EXTFOLDER/${SOURCEARCHIVES} $LFS/${SOURCEARCHIVES}
|
|
fi
|
|
fi
|
|
|
|
SYSTEMSOURCE="${LFS}${SOURCEARCHIVES}/SYSTEM"
|
|
NETSOURCE="${LFS}${SOURCEARCHIVES}/NET"
|
|
mkdir -vp "$SYSTEMSOURCE" "$NETSOURCE"|| true
|
|
|
|
mkdir -pv $LFS/{bin,etc,lib${LIBDIRSUFFIX},sbin,usr,var,tmp,usr/lib${LIBDIRSUFFIX}}
|
|
case $(uname -m) in
|
|
x86_64)
|
|
ln -sfnv lib${LIBDIRSUFFIX} $LFS/lib
|
|
ln -sfnv lib${LIBDIRSUFFIX} $LFS/usr/lib
|
|
;;
|
|
esac
|
|
|
|
mkdir -pv $LFS/tools
|
|
|
|
sudo -p "Enter admin PW to set ownership of $LFS/*: " chown -v $USER $LFS/{usr,lib${LIBDIRSUFFIX},var,etc,bin,sbin,tools,tmp,usr/lib${LIBDIRSUFFIX}}
|
|
|
|
cp ./SystemData* $SYSTEMSOURCE
|
|
WGET_version=1.21.1
|
|
|
|
WGETTAR="https://ftp.gnu.org/gnu/wget/wget-$WGET_version.tar.gz"
|
|
|
|
set +h
|
|
umask 022
|
|
LC_ALL=POSIX
|
|
LFS_TGT=$(uname -m)-lfs-linux-gnu
|
|
PATH=/usr/bin
|
|
if [ ! -L /bin ];then
|
|
PATH=/bin:$PATH
|
|
fi
|
|
PATH=$LFS/tools/bin:$PATH
|
|
export LFS LC_ALL LFS_TGT PATH
|
|
export MAKEFLAGS=${MAKEFLAGS:-'-j4'}
|
|
|
|
if [ ! -e "${SYSTEMSOURCE}/gotsystem" ];then
|
|
if [ "$USESYSTEMD" -eq 1 ];then
|
|
wget --no-check-certificate http://www.linuxfromscratch.org/lfs/view/systemd/wget-list
|
|
wget --no-check-certificate http://www.linuxfromscratch.org/lfs/view/systemd/md5sums
|
|
else
|
|
wget --no-check-certificate http://www.linuxfromscratch.org/lfs/view/$LFSVERSION/wget-list
|
|
wget --no-check-certificate http://www.linuxfromscratch.org/lfs/view/$LFSVERSION/md5sums
|
|
fi
|
|
mv md5sums $SYSTEMSOURCE
|
|
wget --no-check-certificate -i wget-list --no-check-certificate -c -P $SYSTEMSOURCE||true
|
|
|
|
#wget from the blfs book I prefer to make this as part of the main system
|
|
wget --no-check-certificate -c "$WGETTAR" -P $NETSOURCE
|
|
fi
|
|
|
|
cd "$SYSTEMSOURCE"
|
|
if [ ! -e ${SYSTEMSOURCE}/gotsystem ];then
|
|
if ! md5sum -c md5sums;then
|
|
echo "Files don't match ..."
|
|
exit 1
|
|
else
|
|
echo "All files check ..."
|
|
touch "${SYSTEMSOURCE}/gotsystem"
|
|
fi
|
|
fi
|
|
|
|
TOOLNUM=$(cat ${SYSTEMSOURCE}/toolnum 2>/dev/null||true)
|
|
|
|
if [ "X$TOOLNUM" = "X" ];then
|
|
TOOLNUM=1
|
|
echo $TOOLNUM > ${SYSTEMSOURCE}/toolnum
|
|
fi
|
|
|
|
while [ $TOOLNUM != "DONE" ]
|
|
do
|
|
cd "$SYSTEMSOURCE"
|
|
case $TOOLNUM in
|
|
1)
|
|
NAME=binutils
|
|
VERSION=$binutils_version
|
|
tar -xvf ${NAME}-${VERSION}.$binutils_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
mkdir -v build
|
|
cd build
|
|
../configure --prefix=$LFS/tools --with-sysroot=$LFS --target=$LFS_TGT --disable-nls --disable-werror
|
|
make $MAKEFLAGS||make
|
|
make install
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
2)
|
|
#pass 1
|
|
NAME=gcc
|
|
VERSION=$gcc_version
|
|
tar -xvf ${NAME}-${VERSION}.$gcc_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
case $(uname -m) in
|
|
armv6l)
|
|
patch -Np1 -i ../gcc-9.1.0-rpi1-cpu-default.patch
|
|
;;
|
|
armv7l)
|
|
case $(sed -n '/^Revision/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo) in
|
|
a02082|a22082|a32082)
|
|
patch -Np1 -i ../gcc-9.1.0-rpi3-cpu-default.patch
|
|
;;
|
|
*)
|
|
patch -Np1 -i ../gcc-9.1.0-rpi2-cpu-default.patch
|
|
;;
|
|
esac
|
|
;;
|
|
x86_64)
|
|
sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
|
|
;;
|
|
esac
|
|
|
|
tar -Jxf ../mpfr-${mpfr_version}.$mpfr_arctype
|
|
mv -v mpfr-$mpfr_version mpfr
|
|
tar -Jxf ../gmp-${gmp_version}.$gmp_arctype
|
|
mv -v gmp-$gmp_version gmp
|
|
tar -zxf ../mpc-${mpc_version}.$mpc_arctype
|
|
mv -v mpc-$mpc_version mpc
|
|
|
|
mkdir -v build
|
|
cd build
|
|
../configure --target=$LFS_TGT --prefix=$LFS/tools --with-glibc-version=2.11 --with-sysroot=$LFS --with-newlib --without-headers --enable-initfini-array --disable-nls --disable-shared --disable-multilib --disable-decimal-float --disable-threads --disable-libatomic --disable-libgomp --disable-libquadmath --disable-libssp --disable-libvtv --disable-libstdcxx --enable-languages=c,c++
|
|
make $MAKEFLAGS||make
|
|
make install
|
|
cd ..
|
|
cat gcc/limitx.h gcc/glimits.h gcc/limity.h > $(dirname $($LFS_TGT-gcc -print-libgcc-file-name))/install-tools/include/limits.h
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
3)
|
|
#TODO rpi odd version string
|
|
NAME=linux
|
|
VERSION=$linux_version
|
|
(mkdir ${NAME}-${VERSION}||true;tar -C ${NAME}-${VERSION} -xvf ${NAME}-${VERSION}.$linux_arctype --strip-components=1)
|
|
pushd ${NAME}-${VERSION}
|
|
make mrproper
|
|
make headers
|
|
find usr/include -name '.*' -delete
|
|
rm usr/include/Makefile
|
|
cp -rv usr/include $LFS/usr
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
4)
|
|
NAME=glibc
|
|
VERSION=$glibc_version
|
|
tar -xvf ${NAME}-${VERSION}.$glibc_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
ln -sfv ld-linux-x86-64.so.2 $LFS/lib${LIBDIRSUFFIX}/ld-lsb-x86-64.so.3
|
|
patch -Np1 -i ../${NAME}-${VERSION}-fhs-1.patch
|
|
mkdir -v build
|
|
cd build
|
|
../configure --prefix=/usr --host=$LFS_TGT --build=$(../scripts/config.guess) --enable-kernel=3.2 --with-headers=$LFS/usr/include libc_cv_slibdir=/lib
|
|
make $MAKEFLAGS||make -j1|| exit 100
|
|
make DESTDIR=$LFS install
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo 'int main(){}' > dummy.c
|
|
$LFS_TGT-gcc dummy.c
|
|
readelf -l a.out | grep '/ld-linux'
|
|
read -t 30 -p "check out " ||true
|
|
rm -v dummy.c a.out
|
|
$LFS/tools/libexec/gcc/$LFS_TGT/$gcc_version/install-tools/mkheaders
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
5)
|
|
#libstdc++
|
|
NAME=gcc
|
|
VERSION=$gcc_version
|
|
tar -xvf ${NAME}-${VERSION}.$gcc_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
mkdir -pv build
|
|
cd build
|
|
../libstdc++-v3/configure --host=$LFS_TGT --build=$(../config.guess) --prefix=/usr --disable-multilib --disable-nls --disable-libstdcxx-pch --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/${VERSION}
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS install
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
6)
|
|
NAME=m4
|
|
VERSION=$m4_version
|
|
tar -xvf ${NAME}-${VERSION}.$m4_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c
|
|
echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h
|
|
./configure --prefix=/usr --host=$LFS_TGT --build=$(build-aux/config.guess)
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS install
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
7)
|
|
NAME=ncurses
|
|
VERSION=$ncurses_version
|
|
tar -xvf ${NAME}-${VERSION}.$ncurses_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
sed -i s/mawk// configure
|
|
mkdir build
|
|
pushd build
|
|
../configure
|
|
make -C include
|
|
make -C progs tic
|
|
popd
|
|
./configure --prefix=/usr --host=$LFS_TGT --build=$(./config.guess) --mandir=/usr/share/man --with-manpage-format=normal --with-shared --without-debug --without-ada --without-normal --enable-widec
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install
|
|
echo "INPUT(-lncursesw)" > $LFS/usr/lib/libncurses.so
|
|
mv -v $LFS/usr/lib/libncursesw.so.6* $LFS/lib
|
|
ln -sfv ../../lib/$(readlink $LFS/usr/lib/libncursesw.so) $LFS/usr/lib/libncursesw.so
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
8)
|
|
NAME=bash
|
|
VERSION=$bash_version
|
|
tar -xvf ${NAME}-${VERSION}.$bash_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
./configure --prefix=/usr --build=$(support/config.guess) --host=$LFS_TGT --without-bash-malloc
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS install
|
|
mv $LFS/usr/bin/bash $LFS/bin/bash
|
|
ln -sfnv bash $LFS/bin/sh
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
9)
|
|
NAME=coreutils
|
|
VERSION=$coreutils_version
|
|
tar -xvf ${NAME}-${VERSION}.$coreutils_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
./configure --prefix=/usr --host=$LFS_TGT --build=$(build-aux/config.guess) --enable-install-program=hostname --enable-no-install-program=kill,uptime
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS install
|
|
mv -v $LFS/usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} $LFS/bin
|
|
mv -v $LFS/usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} $LFS/bin
|
|
mv -v $LFS/usr/bin/{rmdir,stty,sync,true,uname} $LFS/bin
|
|
mv -v $LFS/usr/bin/{head,nice,sleep,touch} $LFS/bin
|
|
mv -v $LFS/usr/bin/chroot $LFS/usr/sbin
|
|
mkdir -pv $LFS/usr/share/man/man8
|
|
mv -v $LFS/usr/share/man/man1/chroot.1 $LFS/usr/share/man/man8/chroot.8
|
|
sed -i 's/"1"/"8"/' $LFS/usr/share/man/man8/chroot.8
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
10)
|
|
NAME=diffutils
|
|
VERSION=$diffutils_version
|
|
tar -xvf ${NAME}-${VERSION}.$diffutils_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
./configure --prefix=/usr --host=$LFS_TGT
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS install
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
11)
|
|
NAME=file
|
|
VERSION=$file_version
|
|
tar -xvf ${NAME}-${VERSION}.$file_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
mkdir build
|
|
pushd build
|
|
../configure --disable-bzlib --disable-libseccomp --disable-xzlib --disable-zlib
|
|
make
|
|
popd
|
|
./configure --prefix=/usr --host=$LFS_TGT --build=$(./config.guess)
|
|
make FILE_COMPILE=$(pwd)/build/src/file
|
|
make DESTDIR=$LFS install
|
|
#hack
|
|
if [ "$USESYSTEMD" -eq 1 ];then
|
|
mv -v $LFS/usr/lib/libmagic.so.* $LFS/lib
|
|
ln -sfv ../../lib/$(readlink /usr/lib/libmagic.so) $LFS/usr/lib/libmagic.so
|
|
fi
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
12)
|
|
NAME=findutils
|
|
VERSION=$findutils_version
|
|
tar -xvf ${NAME}-${VERSION}.$findutils_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
./configure --prefix=/usr --host=$LFS_TGT --build=$(build-aux/config.guess)
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS install
|
|
mv -v $LFS/usr/bin/find $LFS/bin
|
|
sed -i 's|find:=${BINDIR}|find:=/bin|' $LFS/usr/bin/updatedb
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
13)
|
|
NAME=gawk
|
|
VERSION=$gawk_version
|
|
tar -xvf ${NAME}-${VERSION}.$gawk_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
sed -i 's/extras//' Makefile.in
|
|
./configure --prefix=/usr --host=$LFS_TGT --build=$(./config.guess)
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS install
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
14)
|
|
NAME=grep
|
|
VERSION=$grep_version
|
|
tar -xvf ${NAME}-${VERSION}.$grep_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
./configure --prefix=/usr --host=$LFS_TGT --bindir=/bin
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS install
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
15)
|
|
NAME=gzip
|
|
VERSION=$gzip_version
|
|
tar -xvf ${NAME}-${VERSION}.$gzip_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
./configure --prefix=/usr --host=$LFS_TGT
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS install
|
|
mv -v $LFS/usr/bin/gzip $LFS/bin
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
16)
|
|
NAME=make
|
|
VERSION=$make_version
|
|
tar -xvf ${NAME}-${VERSION}.$make_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
./configure --prefix=/usr --without-guile --host=$LFS_TGT --build=$(build-aux/config.guess)
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS install
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
17)
|
|
NAME=patch
|
|
VERSION=$patch_version
|
|
tar -xvf ${NAME}-${VERSION}.$patch_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
./configure --prefix=/usr --host=$LFS_TGT --build=$(build-aux/config.guess)
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS install
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
18)
|
|
NAME=sed
|
|
VERSION=$sed_version
|
|
tar -xvf ${NAME}-${VERSION}.$sed_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
./configure --prefix=/usr --host=$LFS_TGT --bindir=/bin
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS install
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
19)
|
|
NAME=tar
|
|
VERSION=$tar_version
|
|
tar -xvf ${NAME}-${VERSION}.$tar_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
./configure --prefix=/usr --host=$LFS_TGT --build=$(build-aux/config.guess) --bindir=/bin
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS install
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
20)
|
|
NAME=xz
|
|
VERSION=$xz_version
|
|
tar -xvf${NAME}-${VERSION}.$xz_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
./configure --prefix=/usr --host=$LFS_TGT --build=$(build-aux/config.guess) --disable-static --docdir=/usr/share/doc/xz-5.2.5
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS install
|
|
mv -v $LFS/usr/bin/{lzma,unlzma,lzcat,xz,unxz,xzcat} $LFS/bin
|
|
mv -v $LFS/usr/lib/liblzma.so.* $LFS/lib
|
|
ln -sfnvf ../../lib/$(readlink $LFS/usr/lib/liblzma.so) $LFS/usr/lib/liblzma.so
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
21)
|
|
#pass 2
|
|
NAME=binutils
|
|
VERSION=$binutils_version
|
|
tar -xvf ${NAME}-${VERSION}.$binutils_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
mkdir -v build
|
|
cd build
|
|
../configure --prefix=/usr --build=$(../config.guess) --host=$LFS_TGT --disable-nls --enable-shared --disable-werror --enable-64-bit-bfd
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS install
|
|
install -vm755 libctf/.libs/libctf.so.0.0.0 $LFS/usr/lib
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
22)
|
|
#pass 2
|
|
NAME=gcc
|
|
VERSION=$gcc_version
|
|
tar -xvf ${NAME}-${VERSION}.$gcc_arctype
|
|
pushd ${NAME}-${VERSION}
|
|
case $(uname -m) in
|
|
armv6l)
|
|
patch -Np1 -i ../gcc-9.1.0-rpi1-cpu-default.patch
|
|
;;
|
|
armv7l)
|
|
case $(sed -n '/^Revision/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo) in
|
|
a02082|a22082|a32082)
|
|
patch -Np1 -i ../gcc-9.1.0-rpi3-cpu-default.patch
|
|
;;
|
|
*)
|
|
patch -Np1 -i ../gcc-9.1.0-rpi2-cpu-default.patch
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
|
|
tar -Jxf ../mpfr-${mpfr_version}.$mpfr_arctype
|
|
mv -v mpfr-$mpfr_version mpfr
|
|
tar -Jxf ../gmp-${gmp_version}.$gmp_arctype
|
|
mv -v gmp-$gmp_version gmp
|
|
tar -zxf ../mpc-${mpc_version}.$mpc_arctype
|
|
mv -v mpc-$mpc_version mpc
|
|
|
|
case $(uname -m) in
|
|
x86_64)
|
|
sed -e '/m64=/s/lib64/lib/' -i.orig gcc/config/i386/t-linux64
|
|
;;
|
|
esac
|
|
mkdir -v build
|
|
cd build
|
|
mkdir -pv $LFS_TGT/libgcc
|
|
ln -s ../../../libgcc/gthr-posix.h $LFS_TGT/libgcc/gthr-default.h
|
|
../configure --build=$(../config.guess) --host=$LFS_TGT --prefix=/usr CC_FOR_TARGET=${LFS_TGT}-gcc --with-build-sysroot=$LFS --enable-initfini-array --disable-nls --disable-multilib --disable-decimal-float --disable-libatomic --disable-libgomp --disable-libquadmath --disable-libssp --disable-libvtv --disable-libstdcxx --enable-languages=c,c++
|
|
make $MAKEFLAGS||make
|
|
make DESTDIR=$LFS install
|
|
ln -sfnv gcc $LFS/usr/bin/cc
|
|
popd
|
|
rm -rf ${NAME}-${VERSION}
|
|
echo "$((++ TOOLNUM))" > ${SYSTEMSOURCE}/toolnum
|
|
;;
|
|
|
|
23)
|
|
sudo -p "Enter admin PW to set ownership of $LFS/* back to root: " chown -R root:root $LFS/{usr,lib,var,etc,bin,sbin,tools}
|
|
echo "DONE" > ${SYSTEMSOURCE}/toolnum
|
|
TOOLNUM="DONE"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
|
|
|
|
|