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 |
||
77.1.61
by Monty Taylor
Shift language to c++ before PCRE test. |
27 |
bzr log --short > ChangeLog || touch ChangeLog
|
28.2.1
by Monty Taylor
Made system non-foreign. |
28 |
|
40
by Brian Aker
Updating to modern autorun |
29 |
## We do not currently support glibtoolize
|
30 |
if test x$LIBTOOLIZE = x; then |
|
31 |
# if test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
|
|
32 |
# LIBTOOLIZE=glibtoolize
|
|
33 |
if test \! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x; then |
|
34 |
LIBTOOLIZE=libtoolize-1.5 |
|
35 |
elif test \! "x`which libtoolize 2> /dev/null | grep -v '^no'`" = x; then |
|
36 |
LIBTOOLIZE=libtoolize |
|
37 |
else
|
|
38 |
echo "libtoolize 1.5.x wasn't found, exiting"; exit 0 |
|
39 |
fi
|
|
40 |
fi
|
|
41 |
||
42 |
if test x$ACLOCAL = x; then |
|
28.1.29
by Monty Taylor
Updated versions of autotools used by default. |
43 |
if test \! "x`which aclocal-1.10 2> /dev/null | grep -v '^no'`" = x; then |
44 |
ACLOCAL=aclocal-1.10 |
|
45 |
elif test \! "x`which aclocal110 2> /dev/null | grep -v '^no'`" = x; then |
|
46 |
ACLOCAL=aclocal110 |
|
40
by Brian Aker
Updating to modern autorun |
47 |
elif test \! "x`which aclocal 2> /dev/null | grep -v '^no'`" = x; then |
48 |
ACLOCAL=aclocal |
|
49 |
else
|
|
28.1.29
by Monty Taylor
Updated versions of autotools used by default. |
50 |
echo "automake 1.10.x (aclocal) wasn't found, exiting"; exit 0 |
40
by Brian Aker
Updating to modern autorun |
51 |
fi
|
52 |
fi
|
|
53 |
||
54 |
if test x$AUTOMAKE = x; then |
|
28.1.29
by Monty Taylor
Updated versions of autotools used by default. |
55 |
if test \! "x`which automake-1.10 2> /dev/null | grep -v '^no'`" = x; then |
56 |
AUTOMAKE=automake-1.10 |
|
57 |
elif test \! "x`which automake110 2> /dev/null | grep -v '^no'`" = x; then |
|
58 |
AUTOMAKE=automake110 |
|
40
by Brian Aker
Updating to modern autorun |
59 |
elif test \! "x`which automake 2> /dev/null | grep -v '^no'`" = x; then |
60 |
AUTOMAKE=automake |
|
61 |
else
|
|
28.1.29
by Monty Taylor
Updated versions of autotools used by default. |
62 |
echo "automake 1.10.x wasn't found, exiting"; exit 0 |
40
by Brian Aker
Updating to modern autorun |
63 |
fi
|
64 |
fi
|
|
65 |
||
66 |
||
67 |
## macosx has autoconf-2.59 and autoconf-2.60
|
|
68 |
if test x$AUTOCONF = x; then |
|
69 |
if test \! "x`which autoconf-2.59 2> /dev/null | grep -v '^no'`" = x; then |
|
70 |
AUTOCONF=autoconf-2.59 |
|
71 |
elif test \! "x`which autoconf259 2> /dev/null | grep -v '^no'`" = x; then |
|
72 |
AUTOCONF=autoconf259 |
|
73 |
elif test \! "x`which autoconf 2> /dev/null | grep -v '^no'`" = x; then |
|
74 |
AUTOCONF=autoconf |
|
75 |
else
|
|
76 |
echo "autoconf 2.59+ wasn't found, exiting"; exit 0 |
|
77 |
fi
|
|
78 |
fi
|
|
79 |
||
80 |
if test x$AUTOHEADER = x; then |
|
81 |
if test \! "x`which autoheader-2.59 2> /dev/null | grep -v '^no'`" = x; then |
|
82 |
AUTOHEADER=autoheader-2.59 |
|
83 |
elif test \! "x`which autoheader259 2> /dev/null | grep -v '^no'`" = x; then |
|
84 |
AUTOHEADER=autoheader259 |
|
85 |
elif test \! "x`which autoheader 2> /dev/null | grep -v '^no'`" = x; then |
|
86 |
AUTOHEADER=autoheader |
|
87 |
else
|
|
88 |
echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 0 |
|
89 |
fi
|
|
90 |
fi
|
|
91 |
||
92 |
||
93 |
run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal" |
|
94 |
run $AUTOHEADER || die "Can't execute autoheader" |
|
95 |
||
14
by brian
Adding autorun statement |
96 |
# --force means overwrite ltmain.sh script if it already exists
|
40
by Brian Aker
Updating to modern autorun |
97 |
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize" |
98 |
||
14
by brian
Adding autorun statement |
99 |
# --add-missing instructs automake to install missing auxiliary files
|
100 |
# and --force to overwrite them if they already exist
|
|
40
by Brian Aker
Updating to modern autorun |
101 |
run $AUTOMAKE $AUTOMAKE_FLAGS || die "Can't execute automake" |
102 |
run $AUTOCONF || die "Can't execute autoconf" |