lfs-buildscripts/CH6Build/CH06.16-binutils-pass2.sh

57 lines
979 B
Bash
Raw Normal View History

2024-10-02 13:07:47 +08:00
#!/bin/bash
2024-10-06 06:16:22 +08:00
source ../versions.sh
2024-10-02 13:07:47 +08:00
GLSOURCES="${LFS}/sources"
if [ "`whoami`" != "lfs" ]; then
myfail "Must run this script as lfs user"
fi
2024-10-08 15:33:13 +08:00
pushd ${GLSOURCES} > /dev/null 2>&1 || myfail "Failed to move to ${GLSOURCES}"
2024-10-02 13:07:47 +08:00
[ -d binutils-${binutils_version} ] && rm -rf binutils-${binutils_version}
tar -Jxf ${binutils_tarball}
cd binutils-${binutils_version}
sed '6009s/$add_dir//' -i ltmain.sh
mkdir build && cd build
../configure --prefix=/usr \
--build=$(../config.guess) \
--host=${LFS_TGT} \
--disable-nls \
--enable-shared \
--enable-gprofng=no \
--disable-werror \
--enable-64-bit-bfd \
--enable-new-dtags \
--enable-default-hash-style=gnu
make
if [ $? -ne 0 ]; then
myfail "Failed building binutils"
fi
make DESTDIR=${LFS} install
if [ $? -ne 0 ]; then
myfail "Failed installing binutils"
fi
2024-10-08 15:33:13 +08:00
rm ${LFS}/usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes,sframe}.{a,la}
2024-10-02 13:07:47 +08:00
2024-10-08 15:33:13 +08:00
popd
2024-10-02 13:07:47 +08:00
2024-10-08 15:33:13 +08:00
# cleanup
2024-10-02 13:07:47 +08:00
2024-10-08 15:33:13 +08:00
pushd ${GLSOURCES}
rm -rf binutils-${binutils_version}
popd