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

Revision 18512, 6.2 KB checked in by ghudson, 21 years ago (diff)
Disable GConf schema installs from "make install" rules.
  • Property svn:executable set to *
Line 
1#!/bin/sh
2# $Id: do.sh,v 1.77 2003-01-26 05:56:25 ghudson Exp $
3
4source=/mit/source
5srvd=/.srvd
6contained=false
7mungepath=true
8n=""
9maybe=""
10
11usage() {
12  echo "Usage: do [-np] [-s srcdir] [-d destdir]" 1>&2
13  echo "        [dist|prepare|clean|all|check|install]" 1>&2
14  exit 1
15}
16
17while getopts pd:ns: opt; do
18  case "$opt" in
19  p)
20    mungepath=false
21    ;;
22  d)
23    srvd=$OPTARG
24    ;;
25  n)
26    n=-n
27    maybe=echo
28    ;;
29  s)
30    source=$OPTARG
31    ;;
32  \?)
33    usage
34    ;;
35  esac
36done
37shift `expr "$OPTIND" - 1`
38operation=${1-all}
39
40case "$operation" in
41dist|prepare|clean|all|check|install)
42  ;;
43*)
44  echo Unknown operation \"$operation\" 1>&2
45  usage
46  ;;
47esac
48
49# Set up the build environment.
50umask 022
51export ATHENA_SYS ATHENA_SYS_COMPAT ATHENA_HOSTTYPE OS PATH
52
53# Determine proper ATHENA_SYS and ATHENA_SYS_COMPAT value.
54case `uname -srm` in
55"SunOS 5.8 sun4"*)
56  ATHENA_SYS=sun4x_58
57  ATHENA_SYS_COMPAT=sun4x_57:sun4x_56:sun4x_55:sun4m_54:sun4m_53:sun4m_412
58  ;;
59"SunOS 5.7 sun4"*)
60  ATHENA_SYS=sun4x_57
61  ATHENA_SYS_COMPAT=sun4x_56:sun4x_55:sun4m_54:sun4m_53:sun4m_412
62  ;;
63"SunOS 5.6 sun4"*)
64  ATHENA_SYS=sun4x_56
65  ATHENA_SYS_COMPAT=sun4x_55:sun4m_54:sun4m_53:sun4m_412
66  ;;
67"SunOS 5.5 sun4"*)
68  ATHENA_SYS=sun4x_55
69  ATHENA_SYS_COMPAT=sun4m_54:sun4m_53:sun4m_412
70  ;;
71"SunOS 5.4 sun4"*)
72  ATHENA_SYS=sun4m_54
73  ATHENA_SYS_COMPAT=sun4m_53:sun4m_412
74  ;;
75Linux\ 2.2.*\ i?86)
76  ATHENA_SYS=i386_linux22
77  ATHENA_SYS_COMPAT=i386_linux3:i386_linux2:i386_linux1
78  ;;
79Linux\ 2.4.*\ i?86)
80  ATHENA_SYS=i386_linux24
81  ATHENA_SYS_COMPAT=i386_linux22:i386_linux3:i386_linux2:i386_linux1
82  ;;
83*)
84  echo "Unrecognized system type, aborting." 1>&2
85  exit 1
86  ;;
87esac
88
89# Determine platform name.
90case `uname -sm` in
91"SunOS sun4"*)
92  ATHENA_HOSTTYPE=sun4
93  ;;
94"Linux "i?86)
95  ATHENA_HOSTTYPE=linux
96  ;;
97esac
98
99savepath=$PATH
100
101# Determine operating system, appropriate path, and compiler for use
102# with plain Makefiles and some third-party packages.
103case `uname -s` in
104SunOS)
105  OS=solaris
106  LD_LIBRARY_PATH=/usr/openwin/lib export LD_LIBRARY_PATH
107  LD_RUN_PATH=/usr/athena/lib:/usr/openwin/lib export LD_RUN_PATH
108  PATH=/usr/ccs/bin:/usr/bin:/usr/ucb:/usr/openwin/bin
109  ;;
110Linux)
111  OS=linux
112  LD_RUN_PATH=/usr/athena/lib export LD_RUN_PATH
113  PATH=/usr/bin:/bin:/usr/X11R6/bin
114  ;;
115esac
116CC=gcc
117CXX=g++
118WARN_CFLAGS="-Wall -Wstrict-prototypes -Wmissing-prototypes"
119ERROR_CFLAGS=-Werror
120PATH=/usr/athena/bin:$PATH
121
122if [ false = "$mungepath" ]; then
123  PATH=$savepath
124fi
125
126if [ dist = "$operation" ]; then
127  # Copy in the version file, for the few packages which need to know
128  # the Athena version.
129  cp $source/packs/build/version athena-version
130
131  # Force all source files to the same timestamp, to prevent third-party
132  # build systems from thinking some are out of date with respect to others.
133  find . ! -type l -exec touch -t `date +%Y%m%d%H%M.%S` {} \;
134fi
135
136# Determine the Athena version and set variables for the build system.
137. ./athena-version
138ATHENA_MAJOR_VERSION=$major
139ATHENA_MINOR_VERSION=$minor
140if [ -z "$ATHENA_PATCH_VERSION" ]; then
141  ATHENA_PATCH_VERSION=$patch
142fi
143export ATHENA_MAJOR_VERSION ATHENA_MINOR_VERSION ATHENA_PATCH_VERSION
144
145# Determine if gmake is available. (It should be, unless this is a
146# full build and we haven't built it yet.)
147if [ -x /usr/athena/bin/gmake ]; then
148  MAKE=gmake
149else
150  MAKE=make
151fi
152
153export WARN_CFLAGS ERROR_CFLAGS CC CXX MAKE
154
155# GConf schemas need to be installed from RPM %post scriptlets, not
156# make install rules.
157GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL=1
158export GCONF_DISABLE_MAKEFILE_SCHEMA_INSTALL
159
160if [ -r Makefile.athena ]; then
161  export SRVD SOURCE COMPILER
162  SRVD=$srvd
163  SOURCE=$source
164  COMPILER=$CC
165  if [ dist = "$operation" ]; then
166    export CONFIG_SITE XCONFIGDIR
167    CONFIG_SITE=$source/packs/build/config.site
168    XCONFIGDIR=$source/packs/build/xconfig
169  fi
170  $MAKE $n -f Makefile.athena "$operation"
171elif [ -f configure.in -o -f configure.ac -o -f configure ]; then
172  if [ -f configure.athena ]; then
173    configure=configure.athena
174  else
175    configure=configure
176  fi
177  case $operation in
178  dist)
179    # Copy in support files and run autoconf if this is a directory using the
180    # Athena build system.
181    if [ -f config.do -o ! -f configure ]; then
182      $maybe touch config.do
183      $maybe rm -f mkinstalldirs install-sh config.guess
184      $maybe rm -f config.sub aclocal.m4
185      $maybe cp "$source/packs/build/autoconf/mkinstalldirs" .
186      $maybe cp "$source/packs/build/autoconf/install-sh" .
187      $maybe cp "$source/packs/build/autoconf/config.guess" .
188      $maybe cp "$source/packs/build/autoconf/config.sub" .
189      $maybe cp "$source/packs/build/aclocal.m4" .
190      $maybe cat "$source/packs/build/libtool/libtool.m4" >> aclocal.m4
191      $maybe cp "$source/packs/build/libtool/ltmain.sh" .
192      $maybe autoconf || exit 1
193    fi
194    $maybe cp "$source/packs/build/config.site" config.site.athena
195    ;;
196  prepare)
197    $maybe rm -f config.cache
198    CONFIG_SITE=`pwd`/config.site.athena $maybe "./$configure"
199  ;;
200  clean)
201    $MAKE $n clean
202    ;;
203  all)
204    $MAKE $n all
205    ;;
206  check)
207    $MAKE -n check >/dev/null 2>&1 && $MAKE $n check || true
208    ;;
209  install)
210    $MAKE $n install "DESTDIR=$srvd"
211    ;;
212  esac
213elif [ -r Imakefile ]; then
214  case $operation in
215  dist)
216    $maybe mkdir -p config
217    $maybe cp $source/packs/build/xconfig/README config
218    $maybe cp $source/packs/build/xconfig/mkdirhier.sh config
219    $maybe cp $source/packs/build/xconfig/rtcchack.bac config
220    $maybe cp $source/packs/build/xconfig/site.def config
221    $maybe cp $source/packs/build/xconfig/*.cf config
222    $maybe cp $source/packs/build/xconfig/*.rules config
223    $maybe cp $source/packs/build/xconfig/*.tmpl config
224    ;;
225  prepare)
226    $maybe imake "-Iconfig" -DUseInstalled "-DTOPDIR=`pwd`" \
227      "-DXCONFIGDIR=`pwd`/config"
228    $maybe $MAKE Makefiles
229    ;;
230  clean)
231    $MAKE $n clean
232    ;;
233  all)
234    $MAKE $n includes depend all TOP=`pwd` MAKE="$MAKE TOP=`pwd`"
235    ;;
236  check)
237    ;;
238  install)
239    $MAKE $n install install.man "DESTDIR=$srvd" TOP=`pwd` \
240      MAKE="$MAKE TOP=`pwd`"
241    ;;
242  esac
243elif [ -r Makefile ]; then
244  case $operation in
245  dist|prepare)
246    ;;
247  clean)
248    $MAKE $n clean
249    ;;
250  all)
251    $MAKE $n all CC="$CC"
252    ;;
253  check)
254    $MAKE $n check
255    ;;
256  install)
257    $MAKE $n install "DESTDIR=$srvd"
258    ;;
259  esac
260else
261  echo Nothing to do in `pwd` 1>&2
262  exit 1
263fi
Note: See TracBrowser for help on using the repository browser.