From 3674a7abc20037dc287f388c22a75d49dc2000ca Mon Sep 17 00:00:00 2001 From: William Harrington Date: Sun, 21 Mar 2021 11:03:16 -0500 Subject: Add chapter 6 commands. Had some fixes for m4 regrding -Wabi=11 and -fpermissive and help2man --no-discard-stderr for m4 and diffutils. Also had to remove host's /usr/lib/libiberty.a as binutils pass2 kept using it for some reason. --- chapter6/bash.sh | 10 ++++++++++ chapter6/binutils.sh | 16 ++++++++++++++++ chapter6/coreutils.sh | 17 +++++++++++++++++ chapter6/diffutils.sh | 6 ++++++ chapter6/file.sh | 15 +++++++++++++++ chapter6/findutils.sh | 10 ++++++++++ chapter6/gawk.sh | 8 ++++++++ chapter6/gcc.sh | 39 +++++++++++++++++++++++++++++++++++++++ chapter6/grep.sh | 7 +++++++ chapter6/gzip.sh | 6 ++++++ chapter6/m4.sh | 14 ++++++++++++++ chapter6/make.sh | 8 ++++++++ chapter6/ncurses.sh | 26 ++++++++++++++++++++++++++ chapter6/patch.sh | 7 +++++++ chapter6/sed.sh | 7 +++++++ chapter6/tar.sh | 8 ++++++++ chapter6/xz.sh | 12 ++++++++++++ 17 files changed, 216 insertions(+) create mode 100644 chapter6/bash.sh create mode 100644 chapter6/binutils.sh create mode 100644 chapter6/coreutils.sh create mode 100644 chapter6/diffutils.sh create mode 100644 chapter6/file.sh create mode 100644 chapter6/findutils.sh create mode 100644 chapter6/gawk.sh create mode 100644 chapter6/gcc.sh create mode 100644 chapter6/grep.sh create mode 100644 chapter6/gzip.sh create mode 100644 chapter6/m4.sh create mode 100644 chapter6/make.sh create mode 100644 chapter6/ncurses.sh create mode 100644 chapter6/patch.sh create mode 100644 chapter6/sed.sh create mode 100644 chapter6/tar.sh create mode 100644 chapter6/xz.sh (limited to 'chapter6') diff --git a/chapter6/bash.sh b/chapter6/bash.sh new file mode 100644 index 0000000..c255260 --- /dev/null +++ b/chapter6/bash.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +./configure --prefix=/usr \ + --build=$(support/config.guess) \ + --host=${LFS_TGT} \ + --without-bash-malloc && +make && +make DESTDIR=${LFS} -j1 install && +mv ${LFS}/usr/bin/bash ${LFS}/bin/bash && +ln -sv bash ${LFS}/bin/sh \ No newline at end of file diff --git a/chapter6/binutils.sh b/chapter6/binutils.sh new file mode 100644 index 0000000..b04f731 --- /dev/null +++ b/chapter6/binutils.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +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 && +make DESTDIR=${LFS} -j1 install && +install -vm755 libctf/.libs/libctf.so.0.0.0 ${LFS}/usr/lib \ No newline at end of file diff --git a/chapter6/coreutils.sh b/chapter6/coreutils.sh new file mode 100644 index 0000000..3d221b4 --- /dev/null +++ b/chapter6/coreutils.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +./configure --prefix=/usr \ + --host=${LFS_TGT} \ + --build=$(build-aux/config.guess) \ + --enable-install-program=hostname \ + --enable-no-install-program=kill,uptime && +make && +make DESTDIR=${LFS} -j1 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 \ No newline at end of file diff --git a/chapter6/diffutils.sh b/chapter6/diffutils.sh new file mode 100644 index 0000000..aa4ddb8 --- /dev/null +++ b/chapter6/diffutils.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +sed 's/help2man -i/help2man --no-discard-stderr -i /' -i man/Makefile.in +HELP2MAN="help2man --no-discard-stderr" ./configure --prefix=/usr --host=${LFS_TGT} && +make && +make DESTDIR=${LFS} -j1 install diff --git a/chapter6/file.sh b/chapter6/file.sh new file mode 100644 index 0000000..bb13927 --- /dev/null +++ b/chapter6/file.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +mkdir build +pushd build > /dev/null + + ../configure --disable-bzlib \ + --disable-libseccomp \ + --disable-xzlib \ + --disable-zlib && + make && +popd > /dev/null + +./configure --prefix=/usr --host=${LFS_TGT} --build=$(./config.guess) && +make FILE_COMPILE=$(pwd)/build/src/file && +make DESTDIR=${LFS} -j1 install \ No newline at end of file diff --git a/chapter6/findutils.sh b/chapter6/findutils.sh new file mode 100644 index 0000000..a1a097e --- /dev/null +++ b/chapter6/findutils.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +./configure --prefix=/usr \ + --host=${LFS_TGT} \ + --build=$(build-aux/config.guess) && +make && +make DESTDIR=${LFS} -j1 install && + +mv -v ${LFS}/usr/bin/find ${LFS}/bin && +sed -i 's|find:=${BINDIR}|find:=/bin|' ${LFS}/usr/bin/updatedb \ No newline at end of file diff --git a/chapter6/gawk.sh b/chapter6/gawk.sh new file mode 100644 index 0000000..b56e565 --- /dev/null +++ b/chapter6/gawk.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +sed -i 's/extras//' Makefile.in && +./configure --prefix=/usr \ + --host=${LFS_TGT} \ + --build=$(./config.guess) && +make && +make DESTDIR=${LFS} -j1 install \ No newline at end of file diff --git a/chapter6/gcc.sh b/chapter6/gcc.sh new file mode 100644 index 0000000..d13ef9f --- /dev/null +++ b/chapter6/gcc.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +mkdir -p isl mpfr gmp mpc +tar -xf ../isl-*.tar.xz -C isl --strip-components=1 +tar -xf ../mpfr-*.tar.xz -C mpfr --strip-components=1 +tar -xf ../gmp-*.tar.xz -C gmp --strip-components=1 +tar -xf ../mpc-*.tar.gz -C mpc --strip-components=1 + +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 && +make DESTDIR=${LFS} -j1 install && +ln -sv gcc ${LFS}/usr/bin/cc diff --git a/chapter6/grep.sh b/chapter6/grep.sh new file mode 100644 index 0000000..8d7d8a5 --- /dev/null +++ b/chapter6/grep.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +./configure --prefix=/usr \ + --host=${LFS_TGT} \ + --bindir=/bin && +make && +make DESTDIR=${LFS} -j1 install \ No newline at end of file diff --git a/chapter6/gzip.sh b/chapter6/gzip.sh new file mode 100644 index 0000000..6775502 --- /dev/null +++ b/chapter6/gzip.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +./configure --prefix=/usr --host=${LFS_TGT} && +make && +make DESTDIR=${LFS} -j1 install && +mv -v ${LFS}/usr/bin/gzip ${LFS}/bin \ No newline at end of file diff --git a/chapter6/m4.sh b/chapter6/m4.sh new file mode 100644 index 0000000..5949e11 --- /dev/null +++ b/chapter6/m4.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c && +echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h && + +export CFLAGS="-Wabi=11 -fpermissive" + +sed '/^HELP2MAN/s/$/ --no-discard-stderr/' -i doc/Makefile.in + +./configure --prefix=/usr \ + --host=${LFS_TGT} \ + --build=$(build-aux/config.guess) && +make && +make DESTDIR=${LFS} -j1 install diff --git a/chapter6/make.sh b/chapter6/make.sh new file mode 100644 index 0000000..805e61d --- /dev/null +++ b/chapter6/make.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +./configure --prefix=/usr \ + --without-guile \ + --host=${LFS_TGT} \ + --build=$(build-aux/config.guess) +make && +make DESTDIR=${LFS} -j1 install \ No newline at end of file diff --git a/chapter6/ncurses.sh b/chapter6/ncurses.sh new file mode 100644 index 0000000..b2721d3 --- /dev/null +++ b/chapter6/ncurses.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +sed -i s/mawk// configure && + +mkdir build +pushd build > /dev/null + ../configure && + make -C include && + make -C progs tic && +popd > /dev/null + +./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 && +make DESTDIR=${LFS} TIC_PATH=$(pwd)/build/progs/tic -j1 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 \ No newline at end of file diff --git a/chapter6/patch.sh b/chapter6/patch.sh new file mode 100644 index 0000000..128fa9f --- /dev/null +++ b/chapter6/patch.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +./configure --prefix=/usr \ + --host=${LFS_TGT} \ + --build=$(build-aux/config.guess) && +make && +make DESTDIR=${LFS} -j1 install \ No newline at end of file diff --git a/chapter6/sed.sh b/chapter6/sed.sh new file mode 100644 index 0000000..8d7d8a5 --- /dev/null +++ b/chapter6/sed.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +./configure --prefix=/usr \ + --host=${LFS_TGT} \ + --bindir=/bin && +make && +make DESTDIR=${LFS} -j1 install \ No newline at end of file diff --git a/chapter6/tar.sh b/chapter6/tar.sh new file mode 100644 index 0000000..1526a63 --- /dev/null +++ b/chapter6/tar.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +./configure --prefix=/usr \ + --host=${LFS_TGT} \ + --build=$(build-aux/config.guess) \ + --bindir=/bin && +make && +make DESTDIR=${LFS} -j1 install \ No newline at end of file diff --git a/chapter6/xz.sh b/chapter6/xz.sh new file mode 100644 index 0000000..64832ad --- /dev/null +++ b/chapter6/xz.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +./configure --prefix=/usr \ + --host=${LFS_TGT} \ + --build=$(build-aux/config.guess) \ + --disable-static \ + --docdir=/usr/share/doc/xz-5.2.5 && +make && +make DESTDIR=${LFS} -j1 install +mv -v ${LFS}/usr/bin/{lzma,unlzma,lzcat,xz,unxz,xzcat} ${LFS}/bin && +mv -v ${LFS}/usr/lib/liblzma.so.* ${LFS}/lib && +ln -svf ../../lib/$(readlink ${LFS}/usr/lib/liblzma.so) ${LFS}/usr/lib/liblzma.so \ No newline at end of file -- cgit v1.2.3-54-g00ecf