source: scripts/build-native.sh @ 99e4712

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since 99e4712 was 617118d, checked in by Jim Gifford <clfs@…>, 18 years ago

r561@server (orig r559): root | 2005-06-05 02:38:49 -0700
Fixed Directory Structure

  • 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-findutils.sh
112native-gawk.sh"
113
114test Y = "${MULTIARCH}" && 
115{
116script_list="${script_list}
117native-ncurses-32.sh
118native-ncurses-64.sh"
119} || {
120script_list="${script_list}
121native-ncurses.sh"
122}
123
124test Y = "${USE_READLINE}" && 
125{
126test Y = "${MULTIARCH}" && 
127{
128script_list="${script_list}
129native-readline-32.sh
130native-readline-64.sh"
131} || {
132script_list="${script_list}
133native-readline.sh"
134}
135}
136
137script_list="${script_list}
138native-vim.sh
139native-m4.sh
140native-bison.sh
141native-less.sh
142native-groff.sh
143native-coreutils.sh
144native-sed.sh"
145
146test Y = "${MULTIARCH}" && 
147{
148script_list="${script_list}
149native-flex-32.sh
150native-flex-64.sh
151native-gettext-32.sh
152native-gettext-64.sh
153native-nettools.sh
154native-inetutils.sh
155native-iproute2.sh
156native-perl-32.sh
157native-perl-64.sh
158native-texinfo.sh
159native-autoconf.sh
160native-automake.sh
161native-bash.sh
162native-file-32.sh
163native-file-64.sh"
164} || {
165script_list="${script_list}
166native-flex.sh
167native-gettext.sh
168native-nettools.sh
169native-inetutils.sh
170native-iproute2.sh
171native-perl.sh
172native-texinfo.sh
173native-autoconf.sh
174native-automake.sh
175native-bash.sh
176native-file.sh"
177}
178
179# ARGH libtool.. gonna have to do some
180# thinking about how to handle this for bi-arch...
181test Y = "${MULTIARCH}" && 
182{
183script_list="${script_list}
184native-libtool-32.sh
185native-libtool-64.sh"
186} || {
187script_list="${script_list}
188native-libtool.sh"
189}
190
191test Y = "${MULTIARCH}" && 
192{
193script_list="${script_list}
194native-bzip2-32.sh
195native-bzip2-64.sh"
196} || {
197script_list="${script_list}
198native-bzip2.sh"
199}
200
201script_list="${script_list}
202native-diffutils.sh
203native-ed.sh
204native-kbd.sh
205native-e2fsprogs.sh
206native-grep.sh
207native-gzip.sh
208native-man.sh
209native-make.sh
210native-module-init-tools.sh
211native-patch.sh
212native-procinfo.sh"
213
214test Y = "${MULTIARCH}" && 
215{
216script_list="${script_list}
217native-procps-32.sh
218native-procps-64.sh
219native-shadow-32.sh
220native-shadow-64.sh"
221} || {
222script_list="${script_list}
223native-procps.sh
224native-shadow.sh"
225}
226
227script_list="${script_list}
228native-sysklogd.sh
229native-sysvinit.sh
230native-tar.sh
231native-util-linux.sh
232native-dev.sh"
233
234# Final setup of profile/bashrc scripts etc
235script_list="${script_list}
236post-lfs-configuration.sh"
237
238SCRIPTLIST=`echo "${script_list}" | \
239  sed "s@\(.*\)@${scripts_dir}/\1@"`
240
241# Check if we are resuming from a particular script
242test ! -z "${1}" &&
243{
244   SCRIPTLIST=`echo ${SCRIPTLIST} | sed "s@.*\(${1}.*\)@\1@g"`
245}
246                                                                               
247echo ' o Checking for needed sources and tarballs'
248check_tarballs ${SCRIPTLIST}
249                                                                               
250for script in ${SCRIPTLIST}; do
251   echo "Running ${SCRIPTS}/${script}"
252   # HACK: export SELF to be the script we are running
253   #       (keeps logfile output correct)
254   export SELF=${script}
255   ${SCRIPTS}/${script}
256
257   test 0 = ${?} ||
258   {
259      echo
260      echo "Failed script was ${script}"
261      echo "Please fix the error above from"
262      echo "   ${SCRIPTS}/${script}"
263      echo "and rerun the build with the command"
264      echo
265      echo "   ${0} $script"
266      echo
267      echo "to resume the build."
268      exit 1
269   }
270done
Note: See TracBrowser for help on using the repository browser.