cross-compile more software

This commit is contained in:
Denis Benato 2024-12-07 20:01:35 +01:00
parent 16b3bc0dc8
commit ca870daf8d

183
build.sh
View file

@ -509,6 +509,185 @@ if [ ! -f "$STEPS_DIR/attr" ]; then
touch "$STEPS_DIR/attr" touch "$STEPS_DIR/attr"
fi fi
# build zlib
if [ ! -f "$STEPS_DIR/zlib" ]; then
if [ ! -d "$LFS_BUILD/zlib" ]; then
tar -xzf "$BASE_DIR/sources/zlib-1.3.1.tar.gz"
mv "zlib-1.3.1" "$LFS_BUILD/zlib"
fi
cd "$LFS_BUILD/zlib"
mkdir -vp build
cd build
"../configure" \
--prefix=$LFS
make -j 32
make install
cd "$BASE_DIR"
touch "$STEPS_DIR/zlib"
fi
# build ncurses
# TODO: fix symlink!!!
if [ ! -f "$STEPS_DIR/ncurses" ]; then
if [ ! -d "$LFS_BUILD/ncurses" ]; then
tar -xzf "$BASE_DIR/sources/ncurses.tar.gz"
mv "ncurses-6.3" "$LFS_BUILD/ncurses"
fi
cd "$LFS_BUILD/ncurses"
mkdir -vp build
cd build
# --build=${CLFS_HOST} \
"../configure" \
--prefix=$LFS/usr \
--with-shared \
--host=${LFS_TGT} \
--without-debug \
--disable-stripping \
--without-ada \
--enable-overwrite \
--with-build-cc=gcc \
--libdir=$LFS/usr/lib
make -j 32
make install
cd "$BASE_DIR"
touch "$STEPS_DIR/ncurses"
fi
# build bash
if [ ! -f "$STEPS_DIR/bash" ]; then
if [ ! -d "$LFS_BUILD/bash" ]; then
tar -xzf "$BASE_DIR/sources/bash-5.2.tar.gz"
mv "bash-5.2" "$LFS_BUILD/bash"
fi
cd "$LFS_BUILD/bash"
mkdir -vp build
cd build
# --build=${CLFS_HOST} \
"../configure" \
--prefix=$LFS \
--host=${LFS_TGT} \
--without-bash-malloc \
--enable-threads \
--with-curses
make -j 32
make install
cd "$BASE_DIR"
touch "$STEPS_DIR/bash"
fi
# build bzip2
if [ ! -f "$STEPS_DIR/bzip2" ]; then
if [ ! -d "$LFS_BUILD/bzip2" ]; then
tar -xzf "$BASE_DIR/sources/bzip2-1.0.8.tar.gz"
mv "bzip2-1.0.8" "$LFS_BUILD/bzip2"
fi
cd "$LFS_BUILD/bzip2"
#make
make CC="${CC}" AR="${AR}" RANLIB="${RANLIB}" -j 32 PREFIX=$LFS install
if [ -f "$LFS/bin/bzip2" ]; then
"$LFS_TGT-strip" --strip-unneeded "$LFS/bin/bzip2"
else
echo "Where is the bzip2 executable? It was there for bash 1.0.8!"
exit 1
fi
cd "$BASE_DIR"
touch "$STEPS_DIR/bzip2"
fi
# build check
if [ ! -f "$STEPS_DIR/check" ]; then
if [ ! -d "$LFS_BUILD/check" ]; then
tar -xzf "$BASE_DIR/sources/check-0.15.2.tar.gz"
mv "check-0.15.2" "$LFS_BUILD/check"
fi
cd "$LFS_BUILD/check"
mkdir -vp build
cd build
"../configure" \
--prefix=$LFS \
--host=${LFS_TGT} \
--libdir=$LFS/lib
make -j 32
make -j 32 install
cd "$BASE_DIR"
touch "$STEPS_DIR/check"
fi
# build coreutils
if [ ! -f "$STEPS_DIR/coreutils" ]; then
if [ ! -d "$LFS_BUILD/coreutils" ]; then
tar -xzf "$BASE_DIR/sources/coreutils-9.5.tar.gz"
mv "coreutils-9.5" "$LFS_BUILD/coreutils"
fi
cd "$LFS_BUILD/coreutils"
mkdir -vp build
cd build
"../configure" \
--prefix=$LFS \
--host=${LFS_TGT} \
--enable-install-program=hostname \
--cache-file=config.cache
make -j 32
make -j 32 install
cd "$BASE_DIR"
touch "$STEPS_DIR/coreutils"
fi
# build diffutils
if [ ! -f "$STEPS_DIR/diffutils" ]; then
if [ ! -d "$LFS_BUILD/diffutils" ]; then
tar -xf "$BASE_DIR/sources/diffutils-3.10.tar.xz"
mv "diffutils-3.10" "$LFS_BUILD/diffutils"
fi
cd "$LFS_BUILD/diffutils"
mkdir -vp build
cd build
"../configure" \
--prefix=$LFS \
--host=${LFS_TGT} \
--enable-install-program=hostname \
--cache-file=config.cache
make -j 32
make -j 32 install
cd "$BASE_DIR"
touch "$STEPS_DIR/diffutils"
fi
#"$LFS_TGT-strip" --strip-unneeded $LFS/bin/* #"$LFS_TGT-strip" --strip-unneeded $LFS/bin/*
# build libcap2 # build libcap2
@ -539,4 +718,8 @@ fi
# touch "$STEPS_DIR/libcap2" # touch "$STEPS_DIR/libcap2"
#fi #fi
# Remove man pages: totally useless
rm -rf "$LFS"/usr/share/man
rm -rf "$LFS"/man
# Right now I have no idea if g++ will build crap. # Right now I have no idea if g++ will build crap.