Script cleanup

This commit is contained in:
Denis Benato 2024-12-07 21:48:14 +01:00
parent 589c219e38
commit 82c3bad5ad

150
build.sh
View file

@ -341,10 +341,6 @@ if [ ! -f "$STEPS_DIR/gcc-step2" ]; then
--disable-libsanitizer \ --disable-libsanitizer \
--enable-languages=c --enable-languages=c
# Repeat this
#make -j 32 all-gcc
#make -j 32 install-gcc
#exit 0
make -j 32 # if build fails add --disable-libsanitizer make -j 32 # if build fails add --disable-libsanitizer
make -j 32 install make -j 32 install
@ -381,7 +377,7 @@ if [ ! -f "$STEPS_DIR/glibc-step2" ]; then
make -j 32 install_root=$LFS install make -j 32 install_root=$LFS install
cd "$BASE_DIR" cd "$BASE_DIR"
#rm -rf "$LFS_BUILD/glibc" rm -rf "$LFS_BUILD/glibc"
touch "$STEPS_DIR/glibc-step2" touch "$STEPS_DIR/glibc-step2"
fi fi
@ -426,16 +422,16 @@ if [ ! -f "$STEPS_DIR/gcc-step3" ]; then
make -j 32 install make -j 32 install
cd "$BASE_DIR" cd "$BASE_DIR"
#rm -rf "$LFS_BUILD/gcc" rm -rf "$LFS_BUILD/gcc"
touch "$STEPS_DIR/gcc-step3" touch "$STEPS_DIR/gcc-step3"
fi fi
# Use the new toolchain # Use the new toolchain
export BUILD_CC=gcc export BUILD_CC=gcc
export CC="$LFS_TGT-gcc" export CC="$LFS_TGT-gcc -L$LFS_TOOLS/usr/lib -I$LFS_TOOLS/include -I$LFS_TOOLS/$LFS_TGT/include"
export CXX="$LFS_TGT-g++" export CXX="$LFS_TGT-g++ -L$LFS_TOOLS/usr/lib -I$LFS_TOOLS/include -I$LFS_TOOLS/$LFS_TGT/include"
export AS="$LFS_TGT-as" export AS="$LFS_TGT-as"
export LD="$LFS_TGT-ld" export LD="$LFS_TGT-ld -L$LFS_TOOLS/usr/lib"
export AR="$LFS_TGT-ar" export AR="$LFS_TGT-ar"
export RANLIB="$LFS_TGT-ranlib" export RANLIB="$LFS_TGT-ranlib"
export STRIP="$LFS_TGT-strip" export STRIP="$LFS_TGT-strip"
@ -509,7 +505,7 @@ if [ ! -f "$STEPS_DIR/attr" ]; then
make DESTDIR=$LFS install make DESTDIR=$LFS install
cd "$BASE_DIR" cd "$BASE_DIR"
rm -rf "$LFS_BUILD/attr"
touch "$STEPS_DIR/attr" touch "$STEPS_DIR/attr"
fi fi
@ -531,7 +527,7 @@ if [ ! -f "$STEPS_DIR/zlib" ]; then
make install make install
cd "$BASE_DIR" cd "$BASE_DIR"
rm -rf "$LFS_BUILD/zlib"
touch "$STEPS_DIR/zlib" touch "$STEPS_DIR/zlib"
fi fi
@ -564,7 +560,7 @@ if [ ! -f "$STEPS_DIR/ncurses" ]; then
make install make install
cd "$BASE_DIR" cd "$BASE_DIR"
rm -rf "$LFS_BUILD/ncurses"
touch "$STEPS_DIR/ncurses" touch "$STEPS_DIR/ncurses"
fi fi
@ -592,7 +588,7 @@ if [ ! -f "$STEPS_DIR/bash" ]; then
make install make install
cd "$BASE_DIR" cd "$BASE_DIR"
rm -rf "$LFS_BUILD/bash"
touch "$STEPS_DIR/bash" touch "$STEPS_DIR/bash"
fi fi
@ -615,7 +611,7 @@ if [ ! -f "$STEPS_DIR/bzip2" ]; then
fi fi
cd "$BASE_DIR" cd "$BASE_DIR"
rm -rf "$LFS_BUILD/bzip2"
touch "$STEPS_DIR/bzip2" touch "$STEPS_DIR/bzip2"
fi fi
@ -640,7 +636,7 @@ if [ ! -f "$STEPS_DIR/check" ]; then
make -j 32 install make -j 32 install
cd "$BASE_DIR" cd "$BASE_DIR"
rm -rf "$LFS_BUILD/check"
touch "$STEPS_DIR/check" touch "$STEPS_DIR/check"
fi fi
@ -666,7 +662,7 @@ if [ ! -f "$STEPS_DIR/coreutils" ]; then
make -j 32 install make -j 32 install
cd "$BASE_DIR" cd "$BASE_DIR"
rm -rf "$LFS_BUILD/coreutils"
touch "$STEPS_DIR/coreutils" touch "$STEPS_DIR/coreutils"
fi fi
@ -692,7 +688,7 @@ if [ ! -f "$STEPS_DIR/diffutils" ]; then
make -j 32 install make -j 32 install
cd "$BASE_DIR" cd "$BASE_DIR"
rm -rf "$LFS_BUILD/diffutils"
touch "$STEPS_DIR/diffutils" touch "$STEPS_DIR/diffutils"
fi fi
@ -717,7 +713,7 @@ if [ ! -f "$STEPS_DIR/file" ]; then
make -j 32 install make -j 32 install
cd "$BASE_DIR" cd "$BASE_DIR"
rm -rf "$LFS_BUILD/file"
touch "$STEPS_DIR/file" touch "$STEPS_DIR/file"
fi fi
@ -745,7 +741,7 @@ if [ ! -f "$STEPS_DIR/findutils" ]; then
make -j 32 install make -j 32 install
cd "$BASE_DIR" cd "$BASE_DIR"
rm -rf "$LFS_BUILD/findutils"
touch "$STEPS_DIR/findutils" touch "$STEPS_DIR/findutils"
fi fi
@ -760,10 +756,61 @@ if [ ! -f "$STEPS_DIR/gawk" ]; then
mkdir -vp build mkdir -vp build
cd build cd build
"../configure" \ "../configure" \
--prefix=$LFS \ --prefix=$LFS \
--host=${LFS_TGT} \ --host=${LFS_TGT} \
--build=${BUILD_MACHINE_TRIPLET} \ --build=${BUILD_MACHINE_TRIPLET} \
--cache-file=config.cache
make -j 32
make -j 32 install
cd "$BASE_DIR"
rm -rf "$STEPS_DIR/gawk"
touch "$STEPS_DIR/gawk"
fi
# build grep
if [ ! -f "$STEPS_DIR/grep" ]; then
if [ ! -d "$LFS_BUILD/grep" ]; then
tar -xf "$BASE_DIR/sources/grep-3.11.tar.xz"
mv "grep-3.11" "$LFS_BUILD/grep"
fi
cd "$LFS_BUILD/grep"
mkdir -vp build
cd build
"../configure" \
--prefix=$LFS \
--host=${LFS_TGT} \
--build=${BUILD_MACHINE_TRIPLET} \
--without-included-regex \
--cache-file=config.cache
make -j 32
make -j 32 install
cd "$BASE_DIR"
rm -rf "$LFS_BUILD/grep"
touch "$STEPS_DIR/grep"
fi
# build gzip
if [ ! -f "$STEPS_DIR/gzip" ]; then
if [ ! -d "$LFS_BUILD/gzip" ]; then
tar -xf "$BASE_DIR/sources/gzip-1.13.tar.xz"
mv "gzip-1.13" "$LFS_BUILD/gzip"
fi
cd "$LFS_BUILD/gzip"
mkdir -vp build
cd build
"../configure" \
--prefix=$LFS \
--host=${LFS_TGT} \
--build=${BUILD_MACHINE_TRIPLET} \
--cache-file=config.cache --cache-file=config.cache
make -j 32 make -j 32
@ -771,9 +818,64 @@ if [ ! -f "$STEPS_DIR/gawk" ]; then
cd "$BASE_DIR" cd "$BASE_DIR"
touch "$STEPS_DIR/gawk" touch "$STEPS_DIR/gzip"
fi fi
# build make
if [ ! -f "$STEPS_DIR/make" ]; then
if [ ! -d "$LFS_BUILD/make" ]; then
tar -xf "$BASE_DIR/sources/make-4.4.1.tar.gz"
mv "make-4.4.1" "$LFS_BUILD/make"
fi
cd "$LFS_BUILD/make"
mkdir -vp build
cd build
"../configure" \
--prefix=$LFS \
--host=${LFS_TGT} \
--build=${BUILD_MACHINE_TRIPLET} \
--cache-file=config.cache
make -j 32
make -j 32 install
cd "$BASE_DIR"
touch "$STEPS_DIR/make"
fi
## build gettext
#if [ ! -f "$STEPS_DIR/gettext" ]; then
# if [ ! -d "$LFS_BUILD/gettext" ]; then
# tar -xf "$BASE_DIR/sources/gettext-0.23.tar.gz"
# mv "gettext-0.23" "$LFS_BUILD/gettext"
# fi
# cd "$LFS_BUILD/gettext"
#
# EMACS="no" autoreconf -fi
#
# mkdir -vp build
# cd build
#
# EMACS="no" "../configure" \
# --prefix=$LFS \
# --host=${LFS_TGT} \
# --build=${BUILD_MACHINE_TRIPLET} \
# --disable-shared \
# --libdir=$LFS/usr/lib \
# --cache-file=config.cache
#
#
# make -j 32
# make -j 32 install
#
# cd "$BASE_DIR"
#
# touch "$STEPS_DIR/gettext"
#fi
#"$LFS_TGT-strip" --strip-unneeded $LFS/bin/* #"$LFS_TGT-strip" --strip-unneeded $LFS/bin/*
# build libcap2 # build libcap2