~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}
261.2.4 by Monty Taylor
Updated to more modern AC_INIT and AM_INIT_AUTOMAKE invocations.
12
AUTOMAKE_FLAGS="--add-missing --copy --force"
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
236.1.20 by Monty Taylor
If we aren't in a bzr checkout, touch ChangeLog so that automake will run. (Thanks ebergen)
29
else
30
  touch ChangeLog
177.2.1 by Monty Taylor
Two fixes to autorun, based on guiseppe's build.
31
fi
28.2.1 by Monty Taylor
Made system non-foreign.
32
40 by Brian Aker
Updating to modern autorun
33
if test x$LIBTOOLIZE = x; then
182.1.2 by Jim Winstead
Various fixes to enable compilation on Mac OS X, and remove the glib dependency.
34
  if test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
35
    LIBTOOLIZE=glibtoolize
36
  elif test \! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x; then
40 by Brian Aker
Updating to modern autorun
37
    LIBTOOLIZE=libtoolize-1.5
38
  elif test \! "x`which libtoolize 2> /dev/null | grep -v '^no'`" = x; then
39
    LIBTOOLIZE=libtoolize
177.2.1 by Monty Taylor
Two fixes to autorun, based on guiseppe's build.
40
  elif test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
41
    LIBTOOLIZE=glibtoolize
40 by Brian Aker
Updating to modern autorun
42
  else 
236.1.11 by Monty Taylor
Changed failure results in autorun.sh to exit 1
43
    echo "libtoolize 1.5.x wasn't found, exiting"; exit 1
40 by Brian Aker
Updating to modern autorun
44
  fi
45
fi
46
47
if test x$ACLOCAL = x; then
28.1.29 by Monty Taylor
Updated versions of autotools used by default.
48
  if test \! "x`which aclocal-1.10 2> /dev/null | grep -v '^no'`" = x; then
49
    ACLOCAL=aclocal-1.10
50
  elif test \! "x`which aclocal110 2> /dev/null | grep -v '^no'`" = x; then
51
    ACLOCAL=aclocal110
40 by Brian Aker
Updating to modern autorun
52
  elif test \! "x`which aclocal 2> /dev/null | grep -v '^no'`" = x; then
53
    ACLOCAL=aclocal
54
  else 
236.1.11 by Monty Taylor
Changed failure results in autorun.sh to exit 1
55
    echo "automake 1.10.x (aclocal) wasn't found, exiting"; exit 1
40 by Brian Aker
Updating to modern autorun
56
  fi
57
fi
58
59
if test x$AUTOMAKE = x; then
28.1.29 by Monty Taylor
Updated versions of autotools used by default.
60
  if test \! "x`which automake-1.10 2> /dev/null | grep -v '^no'`" = x; then
61
    AUTOMAKE=automake-1.10
62
  elif test \! "x`which automake110 2> /dev/null | grep -v '^no'`" = x; then
63
    AUTOMAKE=automake110
40 by Brian Aker
Updating to modern autorun
64
  elif test \! "x`which automake 2> /dev/null | grep -v '^no'`" = x; then
65
    AUTOMAKE=automake
66
  else 
236.1.11 by Monty Taylor
Changed failure results in autorun.sh to exit 1
67
    echo "automake 1.10.x wasn't found, exiting"; exit 1
40 by Brian Aker
Updating to modern autorun
68
  fi
69
fi
70
71
72
## macosx has autoconf-2.59 and autoconf-2.60
73
if test x$AUTOCONF = x; then
74
  if test \! "x`which autoconf-2.59 2> /dev/null | grep -v '^no'`" = x; then
75
    AUTOCONF=autoconf-2.59
76
  elif test \! "x`which autoconf259 2> /dev/null | grep -v '^no'`" = x; then
77
    AUTOCONF=autoconf259
78
  elif test \! "x`which autoconf 2> /dev/null | grep -v '^no'`" = x; then
79
    AUTOCONF=autoconf
80
  else 
236.1.11 by Monty Taylor
Changed failure results in autorun.sh to exit 1
81
    echo "autoconf 2.59+ wasn't found, exiting"; exit 1
40 by Brian Aker
Updating to modern autorun
82
  fi
83
fi
84
85
if test x$AUTOHEADER = x; then
86
  if test \! "x`which autoheader-2.59 2> /dev/null | grep -v '^no'`" = x; then
87
    AUTOHEADER=autoheader-2.59
88
  elif test \! "x`which autoheader259 2> /dev/null | grep -v '^no'`" = x; then
89
    AUTOHEADER=autoheader259
90
  elif test \! "x`which autoheader 2> /dev/null | grep -v '^no'`" = x; then
91
    AUTOHEADER=autoheader
92
  else 
236.1.11 by Monty Taylor
Changed failure results in autorun.sh to exit 1
93
    echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 1
40 by Brian Aker
Updating to modern autorun
94
  fi
95
fi
96
97
98
run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal"
99
run $AUTOHEADER || die "Can't execute autoheader"
100
14 by brian
Adding autorun statement
101
# --force means overwrite ltmain.sh script if it already exists 
40 by Brian Aker
Updating to modern autorun
102
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize"
103
14 by brian
Adding autorun statement
104
# --add-missing instructs automake to install missing auxiliary files
105
# and --force to overwrite them if they already exist
40 by Brian Aker
Updating to modern autorun
106
run $AUTOMAKE $AUTOMAKE_FLAGS  || die "Can't execute automake"
107
run $AUTOCONF || die "Can't execute autoconf"
236.1.34 by Monty Taylor
Output automake version too.
108
echo -n "Automade with: "
109
$AUTOMAKE --version | head -1
236.1.33 by Monty Taylor
Added output of autoconf version to autorun.sh.
110
echo -n "Configured with: "
111
$AUTOCONF --version | head -1