source: scripts/build-cross-triarch.sh@ 10e90e4

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 10e90e4 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.0 KB
Line 
1#!/bin/bash
2
3# build-cross-2.4.4.sh
4#
5# Master script for cross building LFS chapter 5.
6#
7# Authors: Ryan Oliver <ryan.oliver@pha.com.au
8# Finn Thain
9#
10# $LastChangedBy$
11# $LastChangedDate$
12# $LastChangedRevision$
13
14# Set SELF to be name of script called, minus any path...
15
16# turn off bash command hash
17set +h
18
19SELF=$(basename ${0})
20echo "Running ${SELF}"
21VERSION="2.4.4"
22DATE=$(date +'%Y%m%d')
23export DATE
24
25# Read in build configuration information
26# plfs-config should reside in the same directory as this script.
27# We need to use dirname to determine where to find it as SCRIPTS
28# env var is not set yet (set in plfs-config itself)
29. `dirname ${0}`/plfs-config
30
31# Sanity check, are ${LFS}, ${HST_TOOLS} and ${TGT_TOOLS} set?
32if [ "X${LFS}" = "X" -o "X${HST_TOOLS}" = "X" -o "X${TGT_TOOLS}" = "X" ]; then
33 echo "Error: Not all required environment vars have been set." 1>&2
34 echo " Check plfs-config" 1>&2
35 exit 1
36fi
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
49export LDFLAGS="-s"
50
51# Setup PATH
52#export PATH=/bin:/sbin:/usr/bin:/usr/sbin
53export PATH=${HST_TOOLS}/bin:${HST_TOOLS}/sbin:${PATH}
54
55# If using distcc, expect that user has set up their own symlinks
56#export DISTCC_HOSTS="localhost sirius"
57#DISTCCDIR=/usr/distcc/bin
58#export PATH=${DISTCCDIR}:${PATH}
59
60# If ${SRC} does not exist, create it
61test -d ${SRC} || mkdir -p ${SRC}
62
63# If ${LFS} directory doesn't exist, create it
64test -d ${LFS} || mkdir -p ${LFS}
65
66if [ ! "${USE_SYSROOT}" = "Y" ]; then
67 # If ${LFS}${TGT_TOOLS} directory doesn't exist, create it
68 test -d ${LFS}${TGT_TOOLS} || mkdir -p ${LFS}${TGT_TOOLS}
69
70 # create it ${TGT_TOOLS} symlink
71 if [ ! -d `dirname ${TGT_TOOLS}` ]; then mkdir -p `dirname ${TGT_TOOLS}` ; fi
72 ln -sf ${LFS}${TGT_TOOLS} `dirname ${TGT_TOOLS}`
73fi
74
75mkdir -p ${CONFLOGS}
76mkdir -p ${BUILDLOGS}
77mkdir -p ${INSTLOGS}
78mkdir -p ${TESTLOGS}
79cd ${SRC}
80
81#scripts_dir="cross-scripts-${VERSION}"
82scripts_dir="cross-scripts"
83
84test "Y" = "${USE_SANITISED_HEADERS}" &&
85{
86 script_list="cross-kern-hdrs.sh
87cross-san-kern-hdrs.sh"
88} || {
89 script_list="cross-kern-hdrs.sh"
90}
91
92test "Y" = "${MULTIARCH}" &&
93{
94 script_list="${script_list}
95cross-binutils.sh
96cross-gcc-static-no-thread.sh
97cross-glibc-hdrs.sh
98cross-gcc-static.sh
99cross-glibc-crtobjs-32.sh
100cross-glibc-crtobjs-n32.sh
101cross-glibc-crtobjs-64.sh
102cross-gcc-shared.sh"
103
104 test "N" = "${DEFAULT_64}" &&
105 {
106 script_list="${script_list}
107cross-glibc-full-64.sh
108cross-glibc-full-32.sh
109cross-gcc-final.sh"
110 } || {
111 script_list="${script_list}
112cross-glibc-full-32.sh
113cross-glibc-full-n32.sh
114cross-glibc-full-64.sh
115cross-gcc-final.sh"
116 }
117
118} || {
119 script_list="${script_list}
120cross-binutils.sh
121cross-gcc-static-no-thread.sh
122cross-glibc-hdrs.sh
123cross-gcc-static.sh
124cross-glibc-crtobjs.sh
125cross-gcc-shared.sh
126cross-glibc-full.sh
127cross-gcc-final.sh"
128}
129
130SCRIPTLIST=`echo "${script_list}" | \
131 sed "s@\(.*\)@${scripts_dir}/\1@"`
132
133# Check if we are resuming from a particular script
134test ! -z "${1}" &&
135{
136 SCRIPTLIST=`echo ${SCRIPTLIST} | sed "s@.*\(${1}.*\)@\1@g"`
137}
138
139echo ' o Checking for needed sources and tarballs'
140check_tarballs ${SCRIPTLIST}
141
142for script in ${SCRIPTLIST}; do
143 echo "Running ${SCRIPTS}/${script}"
144 # HACK: export SELF to be the script we are running
145 # (keeps logfile output correct)
146 export SELF=${script}
147 ${SCRIPTS}/${script}
148
149 test 0 = ${?} ||
150 {
151 echo
152 echo "Failed script was ${script}"
153 echo "Please fix the error above from"
154 echo " ${SCRIPTS}/${script}"
155 echo "and rerun the build with the command"
156 echo
157 echo " ${0} $script"
158 echo
159 echo "to resume the build."
160 exit 1
161 }
162done
Note: See TracBrowser for help on using the repository browser.