source: trunk/packs/build/do.sh @ 11045

Revision 11045, 2.6 KB checked in by ghudson, 26 years ago (diff)
From nathanw: document -c and -n options.
  • Property svn:executable set to *
Line 
1#!/bin/sh
2# $Id: do.sh,v 1.17 1998-01-17 03:09:47 ghudson Exp $
3
4source="/mit/source"
5srvd="/srvd"
6contained=false
7n=""
8maybe=""
9usage="do [-cn] [-s srcdir] [-d destdir] [prepare|clean|all|check|install]"
10
11while getopts cd:ns: opt; do
12        case "$opt" in
13        c)
14                contained=true
15                ;;
16        d)
17                srvd="$OPTARG"
18                ;;
19        n)
20                n="-n"
21                maybe="echo"
22                ;;
23        s)
24                source="$OPTARG"
25                ;;
26        \?)
27                echo "$usage"
28                exit 1
29                ;;
30        esac
31done
32shift `expr $OPTIND - 1`
33operation=${1-all}
34
35case "$contained" in
36true)
37        athtoolroot="$srvd"
38        ;;
39false)
40        athtoolroot=""
41        ;;
42esac
43
44# Set up the build environment.
45umask 022
46export ATHENA_SYS HOSTTYPE CONFIG_SITE PATH
47CONFIG_SITE=$source/packs/build/config.site
48
49# Determine proper ATHENA_SYS value.
50case "`uname -srm`" in
51SunOS*5.5*sun4*)        ATHENA_SYS=sun4x_55     ;;
52SunOS*5.4*sun4*)        ATHENA_SYS=sun4m_54     ;;
53IRIX*5.3*)              ATHENA_SYS=sgi_53       ;;
54IRIX*6.2*)              ATHENA_SYS=sgi_62       ;;
55IRIX*6.3*)              ATHENA_SYS=sgi_63       ;;
56esac
57
58# Determine platform type, appropriate path, and compiler for use with plain
59# Makefiles and some third-party packages.
60case "`uname -sm`" in
61SunOS*sun4*)
62        HOSTTYPE=sun4
63        LD_LIBRARY_PATH=/usr/openwin/lib export LD_LIBRARY_PATH
64        PATH=/usr/ccs/bin:$athtoolroot/usr/athena/bin:/usr/bin:/usr/ucb
65        PATH=${PATH}:/usr/openwin/bin
66        compiler="/usr/gcc/bin/gcc -DSOLARIS"
67        ;;
68IRIX*)
69        HOSTTYPE=sgi
70        PATH=$athtoolroot/usr/athena/bin:/usr/bsd:/usr/bin:/usr/bin/X11
71        compiler=cc
72        ;;
73esac
74
75if [ -r Makefile.athena ]; then
76        export SRVD SOURCE COMPILER CONFIGDIR XCONFIGDIR ATHTOOLROOT
77        SRVD="$srvd"
78        SOURCE="$source"
79        COMPILER="$compiler"
80        CONFIGDIR="$source/packs/build/config"
81        XCONFIGDIR="$source/packs/build/xconfig"
82        ATHTOOLROOT="$athtoolroot"
83        make $n -f Makefile.athena "$operation"
84elif [ -x ./configure ]; then
85        export ATHTOOLROOT
86        ATHTOOLROOT="$athtoolroot"
87        case "$operation" in
88                prepare)        $maybe rm -f config.cache
89                                $maybe ./configure ;;
90                clean)          make $n clean ;;
91                all)            make $n all ;;
92                check)          ;;
93                install)        make $n install "DESTDIR=$srvd" ;;
94        esac
95elif [ -r Imakefile ]; then
96        case "$operation" in
97                prepare)
98                        $maybe imake "-I$source/packs/build/config" \
99                                -DUseInstalled "-DTOPDIR=$source/packs/build" \
100                                "-DTOOLROOT=$athtoolroot"
101                        $maybe make Makefiles
102                        $maybe make depend
103                        ;;
104                clean)          make $n clean ;;
105                all)            make $n all ;;
106                check)          ;;
107                install)        make $n install install.man "DESTDIR=$srvd" ;;
108        esac
109elif [ -r Makefile ]; then
110        case "$operation" in
111                prepare)        ;;
112                clean)          make $n clean "ATHTOOLROOT=$athtoolroot";;
113                all)            make $n all CC="$compiler" \
114                                        "ATHTOOLROOT=$athtoolroot";;
115                check)          ;;
116                install)        make $n install "DESTDIR=$srvd" \
117                                        "ATHTOOLROOT=$athtoolroot";;
118        esac
119fi
Note: See TracBrowser for help on using the repository browser.