source: trunk/packs/build/build.sh @ 18513

Revision 18513, 2.6 KB checked in by ghudson, 21 years ago (diff)
Punt "clean" from the build sequence; all it does is expose third-party build system brokenness.
  • Property svn:executable set to *
Line 
1#!/bin/sh
2# $Id: build.sh,v 1.41 2003-01-26 06:18:20 ghudson Exp $
3
4# This is the script for building the Athena source tree, or pieces of
5# it.  It is less flexible than the do.sh script in this directory.
6# See doc/maintenance in the source tree for information about
7# building the tree.
8
9source="/mit/source"
10build="/build"
11srvd="/.srvd"
12ignore=false
13nobuild=false
14log=false
15target=
16usage="build [-s srcdir] [-b builddir] [-d destdir] [-k] [-n] [-l]"
17usage="$usage [package [endpackage]]"
18
19while getopts s:b:d:knl opt; do
20  case "$opt" in
21  s)
22    source="$OPTARG"
23    ;;
24  b)
25    build="$OPTARG"
26    ;;
27  d)
28    srvd="$OPTARG"
29    ;;
30  k)
31    ignore=true
32    ;;
33  n)
34    nobuild=true
35    ;;
36  l)
37    log=true
38    ;;
39  \?)
40    echo "$usage"
41    exit 1
42    ;;
43  esac
44done
45shift `expr $OPTIND - 1`
46start="$1"
47end="${2-$1}"
48
49# Determine the operating system.
50case `uname -s` in
51SunOS)
52  os=solaris
53  awk=nawk
54  ;;
55IRIX)
56  os=irix
57  awk=awk
58  ;;
59Linux)
60  os=linux
61  awk=awk
62  ;;
63*)
64  echo "Unrecognized system type, aborting." 1>&2
65  exit 1
66  ;;
67esac
68
69# Send all output from this point on to the build log file.
70if [ true = "$log" ]; then
71  mkdir -p "$build/logs" 2>/dev/null
72  now=`date '+%y.%m.%d.%H'`
73  logfile=$build/logs/washlog.$now
74  rm -f "$build/logs/current"
75  ln -s "washlog.$now" "$build/logs/current"
76  exec >> "$logfile" 2>&1
77fi
78
79# Read in the list of packages, filtering for operating system.
80packages=`$awk -f $source/packs/build/getpackages.awk \
81  os="$os" start="$start" end="$end" $source/packs/build/packages` || exit 1
82
83case $nobuild in
84true)
85  echo $packages
86  exit
87  ;;
88esac
89
90echo ========
91echo Starting at `date` on $os
92
93# Create the build directory if necessary.  Make this conditional
94# because the Solaris 8 mkdir -p errors out if $build is a symlink to
95# another directory.
96if [ ! -d $build ]; then
97  mkdir -p $build || exit 1
98fi
99
100# Build the packages.
101for package in $packages; do
102  cd $build || exit 1
103  if [ third/krb5/src/appl != "$package" ]; then
104    rm -rf $package
105    mkdir -p $package
106    cd $package || exit 1
107    (cd $source/$package && tar cf - .) | tar xfp -
108  else
109    cd $package || exit 1
110  fi
111  PWD=$build/$package
112  export PWD
113  echo "**********************"
114  for op in dist prepare all install; do
115    echo "***** ${package}: $op"
116    sh $source/packs/build/do.sh -s "$source" -d "$srvd" "$op"
117    if [ $? -ne 0 ]; then
118      echo "We bombed in $package"
119      if [ false = "$ignore" ]; then
120        exit 1
121      fi
122    fi
123
124    # Redo the output redirection command to flush the log file.
125    if [ true = "$log" ]; then
126      exec >> "$logfile" 2>&1
127    fi
128  done
129done
130
131echo "Ending at `date`"
Note: See TracBrowser for help on using the repository browser.