diff options
Diffstat (limited to 'chapter5')
-rw-r--r-- | chapter5/binutils.sh | 10 | ||||
-rw-r--r-- | chapter5/gcc.sh | 12 | ||||
-rw-r--r-- | chapter5/glibc.sh | 22 | ||||
-rw-r--r-- | chapter5/libstdc++.sh | 12 | ||||
-rw-r--r-- | chapter5/linux-api-headers.sh | 4 |
5 files changed, 35 insertions, 25 deletions
diff --git a/chapter5/binutils.sh b/chapter5/binutils.sh index c77a576..2d9da5b 100644 --- a/chapter5/binutils.sh +++ b/chapter5/binutils.sh @@ -1,9 +1,11 @@ +#!/bin/bash + mkdir build -cd build +cd build || exit 1 -../configure --prefix=${LFS}/tools \ - --with-sysroot=${LFS} \ - --target=${LFS_TGT} \ +../configure --prefix="${LFS}"/tools \ + --with-sysroot="${LFS}" \ + --target="${LFS_TGT}" \ --disable-nls \ --disable-werror && make && diff --git a/chapter5/gcc.sh b/chapter5/gcc.sh index 6ef4ac6..ccc9630 100644 --- a/chapter5/gcc.sh +++ b/chapter5/gcc.sh @@ -1,3 +1,5 @@ +#!/bin/bash + mkdir -p mpfr gmp mpc tar -xf ../mpfr-*.tar.xz -C mpfr --strip-components=1 tar -xf ../gmp-*.tar.xz -C gmp --strip-components=1 @@ -11,13 +13,13 @@ case $(uname -m) in esac mkdir -v build -cd build +cd build || exit 1 ../configure \ - --target=${LFS_TGT} \ - --prefix=${LFS}/tools \ + --target="${LFS_TGT}" \ + --prefix="${LFS}"/tools \ --with-glibc-version=2.11 \ - --with-sysroot=${LFS} \ + --with-sysroot="${LFS}" \ --with-newlib \ --without-headers \ --enable-initfini-array \ @@ -39,4 +41,4 @@ make -j1 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 + "$(dirname "$("${LFS_TGT}"-gcc -print-libgcc-file-name)")"install-tools/include/limits.h diff --git a/chapter5/glibc.sh b/chapter5/glibc.sh index 875e633..54db90a 100644 --- a/chapter5/glibc.sh +++ b/chapter5/glibc.sh @@ -1,31 +1,33 @@ +#!/bin/bash + case $(uname -m) in - i?86) ln -sfv ld-linux.so.2 ${LFS}/lib/ld-lsb.so.3 + i?86) ln -sfv ld-linux.so.2 "${LFS}"/lib/ld-lsb.so.3 ;; - x86_64) ln -sfv ../lib/ld-linux-x86-64.so.2 ${LFS}/lib64 - ln -sfv ../lib/ld-linux-x86-64.so.2 ${LFS}/lib64/ld-lsb-x86-64.so.3 + x86_64) ln -sfv ../lib/ld-linux-x86-64.so.2 "${LFS}"/lib64 + ln -sfv ../lib/ld-linux-x86-64.so.2 "${LFS}"/lib64/ld-lsb-x86-64.so.3 ;; esac patch -Np1 -i ../glibc-2.33-fhs-1.patch && mkdir -v build -cd build +cd build || exit 1 ../configure \ --prefix=/usr \ - --host=${LFS_TGT} \ - --build=$(../scripts/config.guess) \ + --host="${LFS_TGT}" \ + --build="$(../scripts/config.guess)" \ --enable-kernel=4.10.0 \ - --with-headers=${LFS}/usr/include \ + --with-headers="${LFS}"/usr/include \ libc_cv_slibdir=/lib && make PARALLELMFLAGS="${MAKEFLAGS}" && -make DESTDIR=${LFS} install && +make DESTDIR="${LFS}" install && echo 'int main(){}' > dummy.c && -${LFS_TGT}-gcc dummy.c && +"${LFS_TGT}"-gcc dummy.c && readelf -l a.out | grep '/ld-linux' && rm -v dummy.c a.out && -${LFS}/tools/libexec/gcc/${LFS_TGT}/10.2.0/install-tools/mkheaders +"${LFS}"/tools/libexec/gcc/"${LFS_TGT}"/10.2.0/install-tools/mkheaders diff --git a/chapter5/libstdc++.sh b/chapter5/libstdc++.sh index 1e21f35..d1be7dd 100644 --- a/chapter5/libstdc++.sh +++ b/chapter5/libstdc++.sh @@ -1,14 +1,16 @@ +#!/bin/bash + mkdir -v build -cd build +cd build || exit 1 ../libstdc++-v3/configure \ - --host=${LFS_TGT} \ - --build=$(../config.guess) \ + --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} && + --with-gxx-include-dir=/tools/"${LFS_TGT}"/include/c++/"${VERSION}" && make && -make -j1 DESTDIR=${LFS} install +make -j1 DESTDIR="${LFS}" install diff --git a/chapter5/linux-api-headers.sh b/chapter5/linux-api-headers.sh index 3de6e81..3111625 100644 --- a/chapter5/linux-api-headers.sh +++ b/chapter5/linux-api-headers.sh @@ -1,5 +1,7 @@ +#!/bin/bash + make mrproper && make headers && find usr/include -name '.*' -delete && rm usr/include/Makefile && -cp -rv usr/include ${LFS}/usr +cp -rv usr/include "${LFS}"/usr |