~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
527 by Monty Taylor
Fixed the libtool crap. (maybe?)
7
# LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
520.1.4 by Brian Aker
Merging Monty's work
8
LIBTOOLIZE_FLAGS=" --automake --copy --force"
40 by Brian Aker
Updating to modern autorun
9
# ACLOCAL=${ACLOCAL:-aclocal}
755.1.5 by Monty Taylor
Reverted stupid change.
10
ACLOCAL_FLAGS="-I m4"
40 by Brian Aker
Updating to modern autorun
11
# AUTOHEADER=${AUTOHEADER:-autoheader}
12
# AUTOMAKE=${AUTOMAKE:-automake}
524 by Monty
Removed --force from automake to prevent older automakes from copying in older versions of config.guess and config.sub.
13
# --add-missing instructs automake to install missing auxiliary files
14
# --copy tells it to make copies and not symlinks
520.1.4 by Brian Aker
Merging Monty's work
15
AUTOMAKE_FLAGS="--add-missing --copy --force"
40 by Brian Aker
Updating to modern autorun
16
# AUTOCONF=${AUTOCONF:-autoconf}
17
18
ARGV0=$0
19
ARGS="$@"
20
21
22
run() {
23
	echo "$ARGV0: running \`$@' $ARGS"
24
	$@ $ARGS
25
}
26
27
## jump out if one of the programs returns 'false'
28
set -e
29
177.2.1 by Monty Taylor
Two fixes to autorun, based on guiseppe's build.
30
if test -d ".bzr" ; then
31
  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)
32
else
33
  touch ChangeLog
177.2.1 by Monty Taylor
Two fixes to autorun, based on guiseppe's build.
34
fi
28.2.1 by Monty Taylor
Made system non-foreign.
35
527 by Monty Taylor
Fixed the libtool crap. (maybe?)
36
if test x$LIBTOOLIZE = x; then
37
  if test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
38
    LIBTOOLIZE=glibtoolize
39
  elif test \! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x; then
40
    LIBTOOLIZE=libtoolize-1.5
41
  elif test \! "x`which libtoolize 2> /dev/null | grep -v '^no'`" = x; then
42
    LIBTOOLIZE=libtoolize
43
  elif test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
44
    LIBTOOLIZE=glibtoolize
45
  else
46
    echo "libtoolize 1.5.x wasn't found, exiting"; exit 1
47
  fi
48
fi
49
40 by Brian Aker
Updating to modern autorun
50
if test x$ACLOCAL = x; then
28.1.29 by Monty Taylor
Updated versions of autotools used by default.
51
  if test \! "x`which aclocal-1.10 2> /dev/null | grep -v '^no'`" = x; then
52
    ACLOCAL=aclocal-1.10
53
  elif test \! "x`which aclocal110 2> /dev/null | grep -v '^no'`" = x; then
54
    ACLOCAL=aclocal110
40 by Brian Aker
Updating to modern autorun
55
  elif test \! "x`which aclocal 2> /dev/null | grep -v '^no'`" = x; then
56
    ACLOCAL=aclocal
57
  else 
236.1.11 by Monty Taylor
Changed failure results in autorun.sh to exit 1
58
    echo "automake 1.10.x (aclocal) wasn't found, exiting"; exit 1
40 by Brian Aker
Updating to modern autorun
59
  fi
60
fi
61
62
if test x$AUTOMAKE = x; then
28.1.29 by Monty Taylor
Updated versions of autotools used by default.
63
  if test \! "x`which automake-1.10 2> /dev/null | grep -v '^no'`" = x; then
64
    AUTOMAKE=automake-1.10
65
  elif test \! "x`which automake110 2> /dev/null | grep -v '^no'`" = x; then
66
    AUTOMAKE=automake110
40 by Brian Aker
Updating to modern autorun
67
  elif test \! "x`which automake 2> /dev/null | grep -v '^no'`" = x; then
68
    AUTOMAKE=automake
69
  else 
236.1.11 by Monty Taylor
Changed failure results in autorun.sh to exit 1
70
    echo "automake 1.10.x wasn't found, exiting"; exit 1
40 by Brian Aker
Updating to modern autorun
71
  fi
72
fi
73
74
75
## macosx has autoconf-2.59 and autoconf-2.60
76
if test x$AUTOCONF = x; then
77
  if test \! "x`which autoconf-2.59 2> /dev/null | grep -v '^no'`" = x; then
78
    AUTOCONF=autoconf-2.59
79
  elif test \! "x`which autoconf259 2> /dev/null | grep -v '^no'`" = x; then
80
    AUTOCONF=autoconf259
81
  elif test \! "x`which autoconf 2> /dev/null | grep -v '^no'`" = x; then
82
    AUTOCONF=autoconf
83
  else 
236.1.11 by Monty Taylor
Changed failure results in autorun.sh to exit 1
84
    echo "autoconf 2.59+ wasn't found, exiting"; exit 1
40 by Brian Aker
Updating to modern autorun
85
  fi
86
fi
87
88
if test x$AUTOHEADER = x; then
89
  if test \! "x`which autoheader-2.59 2> /dev/null | grep -v '^no'`" = x; then
90
    AUTOHEADER=autoheader-2.59
91
  elif test \! "x`which autoheader259 2> /dev/null | grep -v '^no'`" = x; then
92
    AUTOHEADER=autoheader259
93
  elif test \! "x`which autoheader 2> /dev/null | grep -v '^no'`" = x; then
94
    AUTOHEADER=autoheader
95
  else 
236.1.11 by Monty Taylor
Changed failure results in autorun.sh to exit 1
96
    echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 1
40 by Brian Aker
Updating to modern autorun
97
  fi
98
fi
99
100
527 by Monty Taylor
Fixed the libtool crap. (maybe?)
101
# --force means overwrite ltmain.sh script if it already exists 
102
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize"
103
40 by Brian Aker
Updating to modern autorun
104
run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal"
105
run $AUTOHEADER || die "Can't execute autoheader"
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