-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path37-binutils-gmp-mpfr-mpc.sh
executable file
·156 lines (141 loc) · 5.2 KB
/
37-binutils-gmp-mpfr-mpc.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#!/bin/bash
# QQ群:111601117、钉钉群:35948877
# 避免chroot后执行
id lfs >/dev/null 2>&1
if [ $? = 0 ]; then
source `dirname ${BASH_SOURCE[0]}`/lfs.sh
cp -v ${BASH_SOURCE[0]} $LFS/task.sh
sed "s/_LFS_VERSION/$(getConf LFS_VERSION)/g" -i $LFS/task.sh
sed "s/_LFS_BUILD_PROC/$LFS_BUILD_PROC/g" -i $LFS/task.sh
source `dirname ${BASH_SOURCE[0]}`/chroot.sh
rm -fv $LFS/task.sh
exit
fi
# 来自chroot之后的调用
pushd /sources/_LFS_VERSION
PKG_NAME=binutils
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
if [ -z $PKG_PATH ]; then
tar -xpvf $(find . -maxdepth 1 -type f -name "$PKG_NAME-*.tar.*") --directory stage4
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
fi
if [ ! -f $PKG_PATH/build/_BUILD_DONE ]; then
expect -c "spawn ls"
read -p "必须输出:spawn ls 才能继续"
mkdir -pv $PKG_PATH/build
pushd $PKG_PATH/build
../configure --prefix=/usr \
--sysconfdir=/etc \
--enable-gold \
--enable-ld=default \
--enable-plugins \
--enable-shared \
--disable-werror \
--enable-64-bit-bfd \
--with-system-zlib
[ $? = 0 ] && make tooldir=/usr
[ $? = 0 ] && make -k check
# https://www.linuxfromscratch.org/lfs/build-logs/11.2/i7-1065G7/test-logs/816-binutils-2.39
# ld 会报59个测试失败,check-host会退出,注意和官方日志对比
read -p "官方测试也失败,可继续,make -k check 退出代码:$?"
[ $? = 0 ] && make tooldir=/usr install
if [ $? = 0 ]; then
# 删除无用的静态库
rm -fv /usr/lib/lib{bfd,ctf,ctf-nobfd,opcodes}.a
read -p "$PKG_NAME ALL DONE..."
touch _BUILD_DONE
else
pwd
exit 1
fi
popd
fi
popd
pushd /sources/_LFS_VERSION
PKG_NAME=gmp
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
if [ -z $PKG_PATH ]; then
tar -xpvf $(find . -maxdepth 1 -type f -name "$PKG_NAME-*.tar.*") --directory stage4
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
fi
if [ ! -f $PKG_PATH/_BUILD_DONE ]; then
pushd $PKG_PATH
./configure --prefix=/usr \
--enable-cxx \
--disable-static \
--docdir=/usr/share/doc/gmp-6.2.1
make && make html && make check 2>&1 | tee gmp-check-log
[ $? = 0 ] && make && make html
[ $? = 0 ] && make check 2>&1 | tee gmp-check-log
if [ $? = 0 ]; then
# 务必确认测试全部通过
awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log
echo "务必确认 197 个测试全部通过"
read -p "$PKG_NAME CHECK DONE..."
fi
[ $? = 0 ] && make install && make install-html
if [ $? = 0 ]; then
read -p "$PKG_NAME ALL DONE..."
touch _BUILD_DONE
else
pwd
exit 1
fi
popd
fi
popd
pushd /sources/_LFS_VERSION
PKG_NAME=mpfr
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
if [ -z $PKG_PATH ]; then
tar -xpvf $(find . -maxdepth 1 -type f -name "$PKG_NAME-*.tar.*") --directory stage4
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
fi
if [ ! -f $PKG_PATH/_BUILD_DONE ]; then
pushd $PKG_PATH
./configure --prefix=/usr \
--disable-static \
--enable-thread-safe \
--docdir=/usr/share/doc/mpfr-4.1.0
[ $? = 0 ] && make && make html
[ $? = 0 ] && make check
if [ $? = 0 ]; then
echo "务必确认测试全部通过"
read -p "$PKG_NAME CHECK DONE..."
fi
[ $? = 0 ] && make install && make install-html
if [ $? = 0 ]; then
read -p "$PKG_NAME ALL DONE..."
touch _BUILD_DONE
else
pwd
exit 1
fi
popd
fi
popd
pushd /sources/_LFS_VERSION
PKG_NAME=mpc
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
if [ -z $PKG_PATH ]; then
tar -xpvf $(find . -maxdepth 1 -type f -name "$PKG_NAME-*.tar.*") --directory stage4
PKG_PATH=$(find stage4 -maxdepth 1 -type d -name "$PKG_NAME-*")
fi
if [ ! -f $PKG_PATH/_BUILD_DONE ]; then
pushd $PKG_PATH
./configure --prefix=/usr \
--disable-static \
--docdir=/usr/share/doc/mpc-1.2.1
[ $? = 0 ] && make && make html
[ $? = 0 ] && make check && read -p "$PKG_NAME CHECK DONE..."
[ $? = 0 ] && make install && make install-html
if [ $? = 0 ]; then
read -p "$PKG_NAME ALL DONE..."
touch _BUILD_DONE
else
pwd
exit 1
fi
popd
fi
popd