source: scripts/build-host.sh@ 638ad56

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 638ad56 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: 3.2 KB
Line 
1#!/bin/bash
2
3# build-host.sh
4# (was build-native-2.4.4.sh)
5#
6# Master script for building native tools on the build host
7# required for the creation of a cross-toolchain
8#
9# Authors: Ryan Oliver <ryan.oliver@pha.com.au
10# Finn Thain
11#
12# $LastChangedBy$
13# $LastChangedDate$
14# $LastChangedRevision$
15#
16
17# Set SELF to be name of script called, minus any path...
18SELF=`basename ${0}`
19echo "Running ${SELF}"
20VERSION="2.4.4"
21DATE=`date +'%Y%m%d'`
22export DATE
23
24# Read in build configuration information
25# plfs-config should reside in the same directory as this script.
26# We need to use dirname to determine where to find it as SCRIPTS
27# env var is not set yet (set in plfs-config itself)
28. `dirname ${0}`/plfs-config
29
30# Sanity check, are ${LFS}, ${HST_TOOLS} and ${TGT_TOOLS} set?
31if [ "X${LFS}" = "X" -o "X${HST_TOOLS}" = "X" -o "X${TGT_TOOLS}" = "X" ]; then
32 echo "Error: Not all required environment vars have been set." 1>&2
33 echo " Check plfs-config" 1>&2
34 exit 1
35fi
36
37# Get package version information
38. ${SCRIPTS}/plfs-packages
39
40# Source Functions and definitions
41. ${SCRIPTS}/build-init.sh
42
43# Setup PATH
44export PATH=${HST_TOOLS}/bin:${HST_TOOLS}/sbin:${PATH}
45
46set +x
47unset LD_LIBRARY_PATH
48unset LD_PRELOAD
49
50export LDFLAGS="-s"
51
52# If ${SRC} does not exist, create it
53test -d ${SRC} || mkdir -p ${SRC}
54
55# If ${LFS}${TOOLS} directory doesn't exist, create it
56test -d ${LFS}${TGT_TOOLS} || mkdir -p ${LFS}${TGT_TOOLS}
57
58# If ${TGT_TOOLS} symlink doesn't exist, create it
59test -L ${TGT_TOOLS} || ln -sf ${LFS}${TGT_TOOLS} ${TGT_TOOLS}
60echo ' o Checking for needed tarballs'
61
62mkdir -p ${CONFLOGS}
63mkdir -p ${BUILDLOGS}
64mkdir -p ${INSTLOGS}
65mkdir -p ${TESTLOGS}
66cd ${SRC}
67
68scripts_dir="host-scripts"
69
70# Ideally we'd have flex before make, but flex doesn't like being
71# built with sun's make...
72
73script_list="host-m4.sh
74host-bison.sh
75host-make.sh
76host-flex.sh
77host-gawk.sh
78host-grep.sh
79host-sed.sh
80host-coreutils-binaries.sh
81host-autoconf.sh
82host-automake.sh
83host-libtool.sh
84host-patch.sh
85host-binutils.sh
86host-gcc.sh
87host-gettext.sh
88host-ncurses.sh
89host-texinfo.sh"
90
91SCRIPTLIST=`echo "${script_list}" | \
92 sed "s@\(.*\)@${scripts_dir}/\1@"`
93
94# Check if we are resuming from a particular script
95test ! -z "${1}" &&
96{
97 SCRIPTLIST=`echo ${SCRIPTLIST} | sed "s@.*\(${1}.*\)@\1@g"`
98}
99
100echo ' o Checking for needed sources and tarballs'
101check_tarballs ${SCRIPTLIST}
102
103for script in ${SCRIPTLIST}; do
104 echo "Running ${SCRIPTS}/${script}"
105 # HACK: export SELF to be the script we are running
106 # (keeps logfile output correct)
107 export SELF=${script}
108 ${SCRIPTS}/${script}
109
110 test 0 = ${?} ||
111 {
112 echo
113 echo "Failed script was ${script}"
114 echo "Please fix the error above from"
115 echo " ${SCRIPTS}/${script}"
116 echo "and rerun the build with the command"
117 echo
118 echo " ${0} $script"
119 echo
120 echo "to resume the build."
121 exit 1
122 }
123done
Note: See TracBrowser for help on using the repository browser.