Generally bring up-to-date.
[cfd] / mdw-setup
CommitLineData
30a4312c
MW
1#! /bin/sh
2
3set -e
4
5### Basic setup stuff
6ego=$(echo "$0" | sed 's:^.*[/\\]::; s:\.*$::')
7usage="Usage: $ego [--debian]"
8
9### Parse options
10debian=no
11while [ $# -gt 0 ]; do
12 case "$1" in
13 --help | -h | --usage | -u)
14 echo "$usage"
15 exit
16 ;;
17 --debian)
18 debian=yes
19 ;;
20 --)
21 shift
22 break
23 ;;
24 -*)
25 echo >&2 "$ego: unknown option \`$1'"
26 exit 1
27 ;;
28 esac
29 shift
30done
31if [ $# -ne 0 ]; then
32 echo >&2 "$usage"
33 exit 1
34fi
35
36### Link any strange common files we need
37[ -f .links ] && mklinks
38
1f79a056
MW
39### Do any local stuff
40[ -x build-setup ] && ./build-setup start
41
30a4312c
MW
42### Grind through the Autoconf machinery
43configure=
44for i in configure.ac configure.in; do
45 [ -f $i ] && configure=$i
46done
47if [ "$configure" ]; then
48 grep >/dev/null AM_PROG_LIBTOOL $configure && libtoolize
49 find . -name Makefile.m4 -print | while read m4; do
3dc9c14b
MW
50 dir=$(echo $m4 | sed 's:/[^/]*$::')
51 (cd $dir &&
52 m4 Makefile.m4 >Makefile.am.new &&
53 mv Makefile.am.new Makefile.am)
30a4312c 54 done
1f79a056
MW
55 aclocalargs=
56 for i in config m4; do [ -d $i ] && aclocalargs="$aclocalargs -I $i"; done
57 aclocal $aclocalargs
30a4312c
MW
58 autoconf
59 grep >/dev/null AM_CONFIG_HEADER $configure && autoheader
60 [ -f Makefile.am ] && automake -a
61fi
62
1f79a056
MW
63### Do any local stuff
64[ -x build-setup ] && ./build-setup end