source: scripts/scripts/build-native.sh@ e0507947

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since e0507947 was 7f65c0e, checked in by Jim Gifford <clfs@…>, 19 years ago

r625@server (orig r623): jim | 2005-10-31 12:43:24 -0800
Final Move

  • Property mode set to 100755
File size: 5.2 KB
Line 
1#!/bin/bash
2
3# build-native.sh
4#
5# Script to finish build for target natively
6#
7# Authors: Ryan Oliver <ryan.oliver@pha.com.au
8# Finn Thain
9#
10# $LastChangedBy$
11# $LastChangedDate$
12# $LastChangedRevision$
13
14set +h
15
16# Set SELF to be name of script called, minus any path...
17SELF=$(basename ${0})
18echo "Running ${SELF}"
19VERSION="3.0.1"
20DATE=$(date +'%Y%m%d')
21export DATE
22
23# Read in build configuration information
24# plfs-config should reside in the same directory as this script.
25# We need to use dirname to determine where to find it as SCRIPTS
26# env var is not set yet (set in plfs-config itself)
27. `dirname ${0}`/plfs-config
28
29# Sanity check, are ${LFS}, ${HST_TOOLS} and ${TGT_TOOLS} set?
30if [ "X${LFS}" = "X" -o "X${HST_TOOLS}" = "X" -o "X${TGT_TOOLS}" = "X" ]; then
31 echo "Error: Not all required environment vars have been set." 1>&2
32 echo " Check plfs-config" 1>&2
33 exit 1
34fi
35
36export LFS=""
37
38# Get package version information
39. ${SCRIPTS}/plfs-packages
40
41# Source Functions and definitions
42. ${SCRIPTS}/build-init.sh
43
44
45set +x
46unset LD_LIBRARY_PATH
47unset LD_PRELOAD
48
49# Configure uses these if set, and will not look for a cross-compiler
50unset CC CXX
51
52export LDFLAGS="-s"
53
54# Setup PATH
55export PATH=/bin:/sbin:/usr/bin:/usr/sbin
56export PATH=${PATH}:${TGT_TOOLS}/bin:${TGT_TOOLS}/sbin
57
58# If ${SRC} does not exist, create it
59test -d ${SRC} || mkdir -p ${SRC}
60
61mkdir -p ${CONFLOGS}
62mkdir -p ${BUILDLOGS}
63mkdir -p ${INSTLOGS}
64mkdir -p ${TESTLOGS}
65cd ${SRC}
66
67#scripts_dir="cross-scripts-${VERSION}"
68scripts_dir="native-scripts"
69
70# scripts for building target tools
71test "Y" = "${MULTIARCH}" &&
72{
73script_list="temp-tcl-32.sh
74temp-tcl-64.sh
75temp-expect-32.sh
76temp-expect-64.sh
77temp-dejagnu.sh
78temp-texinfo.sh
79temp-perl-32.sh
80temp-perl-64.sh
81copy-kern-hdrs.sh
82native-glibc-32.sh
83native-glibc-64.sh"
84} || {
85script_list="temp-tcl.sh
86temp-expect.sh
87temp-dejagnu.sh
88temp-texinfo.sh
89temp-perl.sh
90copy-kern-hdrs.sh
91native-glibc.sh"
92}
93
94script_list="${script_list}
95temp-binutils.sh
96specs-mod.sh
97native-binutils.sh
98native-gcc.sh"
99
100test Y = "${MULTIARCH}" &&
101{
102script_list="${script_list}
103native-zlib-32.sh
104native-zlib-64.sh"
105} || {
106script_list="${script_list}
107native-zlib.sh"
108}
109
110script_list="${script_list}
111native-mktemp.sh
112native-findutils.sh
113native-gawk.sh"
114
115test Y = "${MULTIARCH}" &&
116{
117script_list="${script_list}
118native-ncurses-32.sh
119native-ncurses-64.sh"
120} || {
121script_list="${script_list}
122native-ncurses.sh"
123}
124
125test Y = "${USE_READLINE}" &&
126{
127test Y = "${MULTIARCH}" &&
128{
129script_list="${script_list}
130native-readline-32.sh
131native-readline-64.sh"
132} || {
133script_list="${script_list}
134native-readline.sh"
135}
136}
137
138script_list="${script_list}
139native-vim.sh
140native-m4.sh
141native-bison.sh
142native-less.sh
143native-groff.sh
144native-coreutils.sh
145native-sed.sh"
146
147test Y = "${MULTIARCH}" &&
148{
149script_list="${script_list}
150native-flex-32.sh
151native-flex-64.sh
152native-gettext-32.sh
153native-gettext-64.sh
154native-nettools.sh
155native-inetutils.sh
156native-iproute2.sh
157native-perl-32.sh
158native-perl-64.sh
159native-texinfo.sh
160native-autoconf.sh
161native-automake.sh
162native-bash.sh
163native-file-32.sh
164native-file-64.sh"
165} || {
166script_list="${script_list}
167native-flex.sh
168native-gettext.sh
169native-nettools.sh
170native-inetutils.sh
171native-iproute2.sh
172native-perl.sh
173native-texinfo.sh
174native-autoconf.sh
175native-automake.sh
176native-bash.sh
177native-file.sh"
178}
179
180# ARGH libtool.. gonna have to do some
181# thinking about how to handle this for bi-arch...
182test Y = "${MULTIARCH}" &&
183{
184script_list="${script_list}
185native-libtool-32.sh
186native-libtool-64.sh"
187} || {
188script_list="${script_list}
189native-libtool.sh"
190}
191
192test Y = "${MULTIARCH}" &&
193{
194script_list="${script_list}
195native-bzip2-32.sh
196native-bzip2-64.sh"
197} || {
198script_list="${script_list}
199native-bzip2.sh"
200}
201
202script_list="${script_list}
203native-diffutils.sh
204native-ed.sh
205native-kbd.sh
206native-e2fsprogs.sh
207native-grep.sh
208native-gzip.sh
209native-man.sh
210native-make.sh
211native-module-init-tools.sh
212native-patch.sh
213native-procinfo.sh"
214
215test Y = "${MULTIARCH}" &&
216{
217script_list="${script_list}
218native-procps-32.sh
219native-procps-64.sh
220native-shadow-32.sh
221native-shadow-64.sh"
222} || {
223script_list="${script_list}
224native-procps.sh
225native-shadow.sh"
226}
227
228script_list="${script_list}
229native-sysklogd.sh
230native-sysvinit.sh
231native-tar.sh
232native-util-linux.sh
233native-dev.sh"
234
235# Final setup of profile/bashrc scripts etc
236script_list="${script_list}
237post-lfs-configuration.sh"
238
239SCRIPTLIST=`echo "${script_list}" | \
240 sed "s@\(.*\)@${scripts_dir}/\1@"`
241
242# Check if we are resuming from a particular script
243test ! -z "${1}" &&
244{
245 SCRIPTLIST=`echo ${SCRIPTLIST} | sed "s@.*\(${1}.*\)@\1@g"`
246}
247
248echo ' o Checking for needed sources and tarballs'
249check_tarballs ${SCRIPTLIST}
250
251for script in ${SCRIPTLIST}; do
252 echo "Running ${SCRIPTS}/${script}"
253 # HACK: export SELF to be the script we are running
254 # (keeps logfile output correct)
255 export SELF=${script}
256 ${SCRIPTS}/${script}
257
258 test 0 = ${?} ||
259 {
260 echo
261 echo "Failed script was ${script}"
262 echo "Please fix the error above from"
263 echo " ${SCRIPTS}/${script}"
264 echo "and rerun the build with the command"
265 echo
266 echo " ${0} $script"
267 echo
268 echo "to resume the build."
269 exit 1
270 }
271done
Note: See TracBrowser for help on using the repository browser.