~drizzle-trunk/drizzle/development

40 by Brian Aker
Updating to modern autorun
1
#!/usr/bin/env bash
2
# Taken from lighthttpd server (BSD). Thanks Jan!
3
# Run this to generate all the initial makefiles, etc.
14 by brian
Adding autorun statement
4
5
die() { echo "$@"; exit 1; }
6
40 by Brian Aker
Updating to modern autorun
7
# LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
8
LIBTOOLIZE_FLAGS=" --automake --copy --force"
9
# ACLOCAL=${ACLOCAL:-aclocal}
10
# AUTOHEADER=${AUTOHEADER:-autoheader}
11
# AUTOMAKE=${AUTOMAKE:-automake}
28.1.29 by Monty Taylor
Updated versions of autotools used by default.
12
AUTOMAKE_FLAGS="--add-missing --copy --force -W all"
40 by Brian Aker
Updating to modern autorun
13
# AUTOCONF=${AUTOCONF:-autoconf}
14
15
ARGV0=$0
16
ARGS="$@"
17
18
19
run() {
20
	echo "$ARGV0: running \`$@' $ARGS"
21
	$@ $ARGS
22
}
23
24
## jump out if one of the programs returns 'false'
25
set -e
26
177.2.1 by Monty Taylor
Two fixes to autorun, based on guiseppe's build.
27
if test -d ".bzr" ; then
28
  bzr log --short > ChangeLog || touch ChangeLog
29
fi
28.2.1 by Monty Taylor
Made system non-foreign.
30
40 by Brian Aker
Updating to modern autorun
31
if test x$LIBTOOLIZE = x; then
32
  if test \! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x; then
33
    LIBTOOLIZE=libtoolize-1.5
34
  elif test \! "x`which libtoolize 2> /dev/null | grep -v '^no'`" = x; then
35
    LIBTOOLIZE=libtoolize
177.2.1 by Monty Taylor
Two fixes to autorun, based on guiseppe's build.
36
  elif test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
37
    LIBTOOLIZE=glibtoolize
40 by Brian Aker
Updating to modern autorun
38
  else 
39
    echo "libtoolize 1.5.x wasn't found, exiting"; exit 0
40
  fi
41
fi
42
43
if test x$ACLOCAL = x; then
28.1.29 by Monty Taylor
Updated versions of autotools used by default.
44
  if test \! "x`which aclocal-1.10 2> /dev/null | grep -v '^no'`" = x; then
45
    ACLOCAL=aclocal-1.10
46
  elif test \! "x`which aclocal110 2> /dev/null | grep -v '^no'`" = x; then
47
    ACLOCAL=aclocal110
40 by Brian Aker
Updating to modern autorun
48
  elif test \! "x`which aclocal 2> /dev/null | grep -v '^no'`" = x; then
49
    ACLOCAL=aclocal
50
  else 
28.1.29 by Monty Taylor
Updated versions of autotools used by default.
51
    echo "automake 1.10.x (aclocal) wasn't found, exiting"; exit 0
40 by Brian Aker
Updating to modern autorun
52
  fi
53
fi
54
55
if test x$AUTOMAKE = x; then
28.1.29 by Monty Taylor
Updated versions of autotools used by default.
56
  if test \! "x`which automake-1.10 2> /dev/null | grep -v '^no'`" = x; then
57
    AUTOMAKE=automake-1.10
58
  elif test \! "x`which automake110 2> /dev/null | grep -v '^no'`" = x; then
59
    AUTOMAKE=automake110
40 by Brian Aker
Updating to modern autorun
60
  elif test \! "x`which automake 2> /dev/null | grep -v '^no'`" = x; then
61
    AUTOMAKE=automake
62
  else 
28.1.29 by Monty Taylor
Updated versions of autotools used by default.
63
    echo "automake 1.10.x wasn't found, exiting"; exit 0
40 by Brian Aker
Updating to modern autorun
64
  fi
65
fi
66
67
68
## macosx has autoconf-2.59 and autoconf-2.60
69
if test x$AUTOCONF = x; then
70
  if test \! "x`which autoconf-2.59 2> /dev/null | grep -v '^no'`" = x; then
71
    AUTOCONF=autoconf-2.59
72
  elif test \! "x`which autoconf259 2> /dev/null | grep -v '^no'`" = x; then
73
    AUTOCONF=autoconf259
74
  elif test \! "x`which autoconf 2> /dev/null | grep -v '^no'`" = x; then
75
    AUTOCONF=autoconf
76
  else 
77
    echo "autoconf 2.59+ wasn't found, exiting"; exit 0
78
  fi
79
fi
80
81
if test x$AUTOHEADER = x; then
82
  if test \! "x`which autoheader-2.59 2> /dev/null | grep -v '^no'`" = x; then
83
    AUTOHEADER=autoheader-2.59
84
  elif test \! "x`which autoheader259 2> /dev/null | grep -v '^no'`" = x; then
85
    AUTOHEADER=autoheader259
86
  elif test \! "x`which autoheader 2> /dev/null | grep -v '^no'`" = x; then
87
    AUTOHEADER=autoheader
88
  else 
89
    echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 0
90
  fi
91
fi
92
93
94
run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal"
95
run $AUTOHEADER || die "Can't execute autoheader"
96
14 by brian
Adding autorun statement
97
# --force means overwrite ltmain.sh script if it already exists 
40 by Brian Aker
Updating to modern autorun
98
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize"
99
14 by brian
Adding autorun statement
100
# --add-missing instructs automake to install missing auxiliary files
101
# and --force to overwrite them if they already exist
40 by Brian Aker
Updating to modern autorun
102
run $AUTOMAKE $AUTOMAKE_FLAGS  || die "Can't execute automake"
103
run $AUTOCONF || die "Can't execute autoconf"