-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path05-binutils.sh
executable file
·51 lines (46 loc) · 1.58 KB
/
05-binutils.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# QQ群:111601117、钉钉群:35948877
source `dirname ${BASH_SOURCE[0]}`/lfs.sh
# 配置LFS用户编译任务
if [ "$USER" != "lfs" ]; then
cp "$LFS_PROJECT/`basename ${BASH_SOURCE[0]}`" /home/lfs/build.sh
cp "$LFS_PROJECT/lfs.sh" /home/lfs/
cp "$LFS_PROJECT/lfs.conf" /home/lfs/
chown lfs:lfs /home/lfs/build.sh
chown lfs:lfs /home/lfs/lfs.sh
chown lfs:lfs /home/lfs/lfs.conf
[ ! -e /etc/bash.bashrc ] || mv -v /etc/bash.bashrc /etc/bash.bashrc.NOUSE
su - lfs
[ ! -e /etc/bash.bashrc.NOUSE ] || mv -v /etc/bash.bashrc.NOUSE /etc/bash.bashrc
rm -f /home/lfs/build.sh
rm -f /home/lfs/lfs.sh
rm -f /home/lfs/lfs.conf
exit
fi
# 来自lfs用户的调用
pushd $LFS/sources/$(getConf LFS_VERSION)
PKG_NAME=binutils
PKG_PATH=$(find stage1 -maxdepth 1 -type d -name "$PKG_NAME-*")
if [ -z $PKG_PATH ]; then
tar -xpvf $(find . -maxdepth 1 -type f -name "$PKG_NAME-*.tar.*") --directory stage1
PKG_PATH=$(find stage1 -maxdepth 1 -type d -name "$PKG_NAME-*")
fi
if [ ! -f $PKG_PATH/build/_BUILD_DONE ]; then
mkdir -pv $PKG_PATH/build
pushd $PKG_PATH/build
../configure --prefix=$LFS/tools \
--with-sysroot=$LFS \
--target=$LFS_TGT \
--disable-nls \
--enable-gprofng=no \
--disable-werror
make -j$LFS_BUILD_PROC && make install
if [ $? = 0 ]; then
touch _BUILD_DONE
else
pwd
exit 1
fi
popd
fi
popd