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
|
|
908.1.3
by Monty Taylor
Updated build system to use new version numbering. Just remember to run ./config/autorun.sh before running make distcheck for release and all should be peachy. |
32 |
BZR_REVNO=`bzr revno` |
33 |
BZR_REVID=`bzr log -r-1 --show-ids | grep revision-id | awk '{print $2}' | head -1` |
|
34 |
BZR_BRANCH=`bzr nick` |
|
35 |
RELEASE_DATE=`date +%Y.%m` |
|
36 |
RELEASE_VERSION="${RELEASE_DATE}.${BZR_REVNO}" |
|
37 |
if test "x${BZR_BRANCH}" != "xdrizzle" ; then |
|
38 |
RELEASE_VERSION="${RELEASE_VERSION}-${BZR_BRANCH}" |
|
39 |
fi
|
|
40 |
sed -e "s/@BZR_REVNO@/${BZR_REVNO}/" \ |
|
41 |
-e "s/@BZR_REVID@/${BZR_REVID}/" \ |
|
42 |
-e "s/@BZR_BRANCH@/${BZR_BRANCH}/" \ |
|
43 |
-e "s/@RELEASE_DATE@/${RELEASE_DATE}/" \ |
|
44 |
-e "s/@RELEASE_VERSION@/${RELEASE_VERSION}/" \ |
|
45 |
m4/bzr_version.m4.in > m4/bzr_version.m4.new |
|
46 |
||
47 |
if ! diff m4/bzr_version.m4.new m4/bzr_version.m4 >/dev/null 2>&1 ; then |
|
48 |
mv m4/bzr_version.m4.new m4/bzr_version.m4 |
|
908.1.8
by Monty Taylor
Clean up after ourselves. |
49 |
else
|
50 |
rm m4/bzr_version.m4.new |
|
908.1.3
by Monty Taylor
Updated build system to use new version numbering. Just remember to run ./config/autorun.sh before running make distcheck for release and all should be peachy. |
51 |
fi
|
236.1.20
by Monty Taylor
If we aren't in a bzr checkout, touch ChangeLog so that automake will run. (Thanks ebergen) |
52 |
else
|
53 |
touch ChangeLog |
|
177.2.1
by Monty Taylor
Two fixes to autorun, based on guiseppe's build. |
54 |
fi
|
28.2.1
by Monty Taylor
Made system non-foreign. |
55 |
|
527
by Monty Taylor
Fixed the libtool crap. (maybe?) |
56 |
if test x$LIBTOOLIZE = x; then |
57 |
if test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then |
|
58 |
LIBTOOLIZE=glibtoolize |
|
59 |
elif test \! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x; then |
|
60 |
LIBTOOLIZE=libtoolize-1.5 |
|
61 |
elif test \! "x`which libtoolize 2> /dev/null | grep -v '^no'`" = x; then |
|
62 |
LIBTOOLIZE=libtoolize |
|
63 |
elif test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then |
|
64 |
LIBTOOLIZE=glibtoolize |
|
65 |
else
|
|
66 |
echo "libtoolize 1.5.x wasn't found, exiting"; exit 1 |
|
67 |
fi
|
|
68 |
fi
|
|
69 |
||
40
by Brian Aker
Updating to modern autorun |
70 |
if test x$ACLOCAL = x; then |
28.1.29
by Monty Taylor
Updated versions of autotools used by default. |
71 |
if test \! "x`which aclocal-1.10 2> /dev/null | grep -v '^no'`" = x; then |
72 |
ACLOCAL=aclocal-1.10 |
|
73 |
elif test \! "x`which aclocal110 2> /dev/null | grep -v '^no'`" = x; then |
|
74 |
ACLOCAL=aclocal110 |
|
40
by Brian Aker
Updating to modern autorun |
75 |
elif test \! "x`which aclocal 2> /dev/null | grep -v '^no'`" = x; then |
76 |
ACLOCAL=aclocal |
|
77 |
else
|
|
236.1.11
by Monty Taylor
Changed failure results in autorun.sh to exit 1 |
78 |
echo "automake 1.10.x (aclocal) wasn't found, exiting"; exit 1 |
40
by Brian Aker
Updating to modern autorun |
79 |
fi
|
80 |
fi
|
|
81 |
||
82 |
if test x$AUTOMAKE = x; then |
|
28.1.29
by Monty Taylor
Updated versions of autotools used by default. |
83 |
if test \! "x`which automake-1.10 2> /dev/null | grep -v '^no'`" = x; then |
84 |
AUTOMAKE=automake-1.10 |
|
85 |
elif test \! "x`which automake110 2> /dev/null | grep -v '^no'`" = x; then |
|
86 |
AUTOMAKE=automake110 |
|
40
by Brian Aker
Updating to modern autorun |
87 |
elif test \! "x`which automake 2> /dev/null | grep -v '^no'`" = x; then |
88 |
AUTOMAKE=automake |
|
89 |
else
|
|
236.1.11
by Monty Taylor
Changed failure results in autorun.sh to exit 1 |
90 |
echo "automake 1.10.x wasn't found, exiting"; exit 1 |
40
by Brian Aker
Updating to modern autorun |
91 |
fi
|
92 |
fi
|
|
93 |
||
94 |
||
95 |
## macosx has autoconf-2.59 and autoconf-2.60
|
|
96 |
if test x$AUTOCONF = x; then |
|
97 |
if test \! "x`which autoconf-2.59 2> /dev/null | grep -v '^no'`" = x; then |
|
98 |
AUTOCONF=autoconf-2.59 |
|
99 |
elif test \! "x`which autoconf259 2> /dev/null | grep -v '^no'`" = x; then |
|
100 |
AUTOCONF=autoconf259 |
|
101 |
elif test \! "x`which autoconf 2> /dev/null | grep -v '^no'`" = x; then |
|
102 |
AUTOCONF=autoconf |
|
103 |
else
|
|
236.1.11
by Monty Taylor
Changed failure results in autorun.sh to exit 1 |
104 |
echo "autoconf 2.59+ wasn't found, exiting"; exit 1 |
40
by Brian Aker
Updating to modern autorun |
105 |
fi
|
106 |
fi
|
|
107 |
||
108 |
if test x$AUTOHEADER = x; then |
|
109 |
if test \! "x`which autoheader-2.59 2> /dev/null | grep -v '^no'`" = x; then |
|
110 |
AUTOHEADER=autoheader-2.59 |
|
111 |
elif test \! "x`which autoheader259 2> /dev/null | grep -v '^no'`" = x; then |
|
112 |
AUTOHEADER=autoheader259 |
|
113 |
elif test \! "x`which autoheader 2> /dev/null | grep -v '^no'`" = x; then |
|
114 |
AUTOHEADER=autoheader |
|
115 |
else
|
|
236.1.11
by Monty Taylor
Changed failure results in autorun.sh to exit 1 |
116 |
echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 1 |
40
by Brian Aker
Updating to modern autorun |
117 |
fi
|
118 |
fi
|
|
119 |
||
120 |
||
527
by Monty Taylor
Fixed the libtool crap. (maybe?) |
121 |
# --force means overwrite ltmain.sh script if it already exists
|
122 |
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize" |
|
123 |
||
40
by Brian Aker
Updating to modern autorun |
124 |
run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal" |
125 |
run $AUTOHEADER || die "Can't execute autoheader" |
|
126 |
run $AUTOMAKE $AUTOMAKE_FLAGS || die "Can't execute automake" |
|
127 |
run $AUTOCONF || die "Can't execute autoconf" |
|
236.1.34
by Monty Taylor
Output automake version too. |
128 |
echo -n "Automade with: " |
129 |
$AUTOMAKE --version | head -1 |
|
236.1.33
by Monty Taylor
Added output of autoconf version to autorun.sh. |
130 |
echo -n "Configured with: " |
131 |
$AUTOCONF --version | head -1 |