source: scripts/build-target-triarch.sh@ d5e4fdc0

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

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

  • Property mode set to 100755
File size: 4.7 KB
Line 
1#!/bin/bash
2
3# build-target.sh
4#
5# Script for cross building target native tools
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="2.4.4"
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
36# Get package version information
37. ${SCRIPTS}/plfs-packages
38
39# Source Functions and definitions
40. ${SCRIPTS}/build-init.sh
41
42
43set +x
44unset LD_LIBRARY_PATH
45unset LD_PRELOAD
46
47# Configure uses these if set, and will not look for a cross-compiler
48unset CC CXX
49
50export LDFLAGS="-s"
51
52# Setup PATH
53#export PATH=/bin:/sbin:/usr/bin:/usr/sbin
54export PATH=${HST_TOOLS}/bin:${HST_TOOLS}/sbin:${PATH}
55
56# If ${SRC} does not exist, create it
57test -d ${SRC} || mkdir -p ${SRC}
58
59if [ ! "${USE_SYSROOT}" = "Y" ]; then
60 # If ${LFS}${TGT_TOOLS} directory doesn't exist, create it
61 test -d ${LFS}${TGT_TOOLS} || mkdir -p ${LFS}${TGT_TOOLS}
62
63 # create it ${TGT_TOOLS} symlink
64 if [ ! -d `dirname ${TGT_TOOLS}` ]; then mkdir -p `dirname ${TGT_TOOLS}` ; fi
65 ln -sf ${LFS}${TGT_TOOLS} `dirname ${TGT_TOOLS}`
66fi
67
68mkdir -p ${CONFLOGS}
69mkdir -p ${BUILDLOGS}
70mkdir -p ${INSTLOGS}
71mkdir -p ${TESTLOGS}
72cd ${SRC}
73
74#scripts_dir="cross-scripts-${VERSION}"
75scripts_dir="target-scripts"
76
77# scripts for building target tools
78test "Y" = "${MULTIARCH}" &&
79{
80script_list="target-binutils.sh
81target-gcc.sh
82target-zlib-32.sh
83target-zlib-n32.sh
84target-zlib-64.sh
85target-gawk.sh
86target-coreutils.sh
87target-bzip2-32.sh
88target-bzip2-n32.sh
89target-bzip2-64.sh
90target-gzip.sh
91target-diffutils.sh
92target-findutils.sh
93target-m4.sh
94target-bison.sh
95target-flex.sh
96target-make.sh
97target-grep.sh
98target-sed.sh
99target-gettext-32.sh
100target-gettext-n32.sh
101target-gettext-64.sh
102target-ncurses-32.sh
103target-ncurses-n32.sh
104target-ncurses-64.sh
105target-patch.sh
106target-tar.sh
107target-bash.sh"
108} || {
109script_list="target-binutils.sh
110target-gcc.sh
111target-zlib.sh
112target-gawk.sh
113target-coreutils.sh
114target-bzip2.sh
115target-gzip.sh
116target-diffutils.sh
117target-findutils.sh
118target-m4.sh
119target-bison.sh
120target-flex.sh
121target-make.sh
122target-grep.sh
123target-sed.sh
124target-gettext.sh
125target-ncurses.sh
126target-patch.sh
127target-tar.sh
128target-bash.sh"
129}
130
131# Packages common to both BIARCH and non-BIARCH
132script_list="${script_list}
133target-e2fsprogs.sh
134target-procps.sh
135target-sysvinit.sh
136target-module-init-tools.sh
137target-nettools.sh
138target-inetutils.sh
139target-util-linux.sh
140target-strace.sh
141target-sysklogd.sh"
142
143if [ "${USE_HOTPLUG}" = "Y" ]; then
144script_list="${script_list}
145target-hotplug.sh"
146fi
147
148script_list="${script_list}
149target-dev.sh
150target-lfs-bootscripts.sh
151target-kernel.sh
152target-iana-etc.sh"
153
154#target-modutils.sh
155# Lilo bootloader
156if [ "${USE_LILO}" = "Y" ]; then
157script_list="${script_list}
158host-nasm.sh
159host-bin86.sh
160host-lilo.sh
161target-nasm.sh
162target-bin86.sh
163target-lilo.sh"
164fi
165
166# TODO: add nfs client, tcpwrappers portmap etc scripts
167# ( to allow us to nfs mount root on target box )
168script_list="${script_list}
169target-nfsutils.sh
170target-tcp-wrappers.sh
171target-portmap.sh"
172
173script_list="${script_list}
174target-iproute2.sh
175target-final-prep-wrapper.sh"
176
177
178SCRIPTLIST=`echo "${script_list}" | \
179 sed "s@\(.*\)@${scripts_dir}/\1@"`
180
181# Check if we are resuming from a particular script
182test ! -z "${1}" &&
183{
184 SCRIPTLIST=`echo ${SCRIPTLIST} | sed "s@.*\(${1}.*\)@\1@g"`
185}
186
187echo ' o Checking for needed sources and tarballs'
188check_tarballs ${SCRIPTLIST}
189
190for script in ${SCRIPTLIST}; do
191 echo "Running ${SCRIPTS}/${script}"
192 # HACK: export SELF to be the script we are running
193 # (keeps logfile output correct)
194 export SELF=${script}
195 ${SCRIPTS}/${script}
196
197 test 0 = ${?} ||
198 {
199 echo
200 echo "Failed script was ${script}"
201 echo "Please fix the error above from"
202 echo " ${SCRIPTS}/${script}"
203 echo "and rerun the build with the command"
204 echo
205 echo " ${0} $script"
206 echo
207 echo "to resume the build."
208 exit 1
209 }
210done
Note: See TracBrowser for help on using the repository browser.