2
2
# Taken from lighthttpd server (BSD). Thanks Jan!
3
3
# Run this to generate all the initial makefiles, etc.
5
5
die() { echo "$@"; exit 1; }
7
# LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
7
# --force means overwrite ltmain.sh script if it already exists
8
8
LIBTOOLIZE_FLAGS=" --automake --copy --force"
9
# ACLOCAL=${ACLOCAL:-aclocal}
11
# AUTOHEADER=${AUTOHEADER:-autoheader}
12
# AUTOMAKE=${AUTOMAKE:-automake}
13
9
# --add-missing instructs automake to install missing auxiliary files
14
# --copy tells it to make copies and not symlinks
10
# and --force to overwrite them if they already exist
15
11
AUTOMAKE_FLAGS="--add-missing --copy --force"
16
# AUTOCONF=${AUTOCONF:-autoconf}
23
18
echo "$ARGV0: running \`$@' $ARGS"
27
## jump out if one of the programs returns 'false'
30
RELEASE_DATE=`date +%Y.%m`
31
RELEASE_DATE_NODOTS=`date +%Y%m`
32
if test -d ".bzr" ; then
33
echo "Grabbing changelog and version information from bzr"
34
bzr log --short > ChangeLog || touch ChangeLog
36
BZR_REVID=`bzr log -r-1 --show-ids | grep revision-id | awk '{print $2}' | head -1`
42
BZR_BRANCH="bzr-export"
44
RELEASE_VERSION="${RELEASE_DATE}.${BZR_REVNO}"
45
RELEASE_ID="${RELEASE_DATE_NODOTS}${BZR_REVNO}"
46
if test "x${BZR_BRANCH}" != "xdrizzle" ; then
47
RELEASE_COMMENT="${BZR_BRANCH}"
49
RELEASE_COMMENT="trunk"
52
if test -f m4/bzr_version.m4.in
54
sed -e "s/@BZR_REVNO@/${BZR_REVNO}/" \
55
-e "s/@BZR_REVID@/${BZR_REVID}/" \
56
-e "s/@BZR_BRANCH@/${BZR_BRANCH}/" \
57
-e "s/@RELEASE_DATE@/${RELEASE_DATE}/" \
58
-e "s/@RELEASE_ID@/${RELEASE_ID}/" \
59
-e "s/@RELEASE_VERSION@/${RELEASE_VERSION}/" \
60
-e "s/@RELEASE_COMMENT@/${RELEASE_COMMENT}/" \
61
m4/bzr_version.m4.in > m4/bzr_version.m4.new
63
if ! diff m4/bzr_version.m4.new m4/bzr_version.m4 >/dev/null 2>&1 ; then
64
mv m4/bzr_version.m4.new m4/bzr_version.m4
66
rm m4/bzr_version.m4.new
71
if test "x$EGREP" != "x" -a -d po
73
echo "# This file is auto-generated from configure. Do not edit directly" > po/POTFILES.in.in
74
# The grep -v 'drizzle-' is to exclude any distcheck leftovers
75
for f in `find . | grep -v 'drizzle-' | ${EGREP} '\.(cc|c|h|yy)$' | cut -c3- | sort`
22
# Try to locate a program by using which, and verify that the file is an
77
if grep gettext.h "$f" | grep include >/dev/null 2>&1
79
echo "$f" >> po/POTFILES.in.in
27
file=`which $f 2>/dev/null | grep -v '^no '`
28
if test -n "$file" -a -x "$file"; then
82
if ! diff po/POTFILES.in.in po/POTFILES.in >/dev/null 2>&1
84
mv po/POTFILES.in.in po/POTFILES.in
39
if test -f config/pre_hook.sh
44
# Try to detect the supported binaries if the user didn't
45
# override that by pushing the environment variable
92
46
if test x$LIBTOOLIZE = x; then
93
if test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
94
LIBTOOLIZE=glibtoolize
95
elif test \! "x`which libtoolize-2.2 2> /dev/null | grep -v '^no'`" = x; then
96
LIBTOOLIZE=libtoolize-2.2
97
elif test \! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x; then
98
LIBTOOLIZE=libtoolize-1.5
99
elif test \! "x`which libtoolize 2> /dev/null | grep -v '^no'`" = x; then
100
LIBTOOLIZE=libtoolize
101
elif test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
102
LIBTOOLIZE=glibtoolize
104
echo "libtoolize wasn't found, exiting"; exit 1
47
LIBTOOLIZE=`locate_binary glibtoolize libtoolize-1.5 libtoolize`
48
if test x$LIBTOOLIZE = x; then
49
die "Did not find a supported libtoolize"
108
53
if test x$ACLOCAL = x; then
109
if test \! "x`which aclocal-1.10 2> /dev/null | grep -v '^no'`" = x; then
111
elif test \! "x`which aclocal110 2> /dev/null | grep -v '^no'`" = x; then
113
elif test \! "x`which aclocal 2> /dev/null | grep -v '^no'`" = x; then
116
echo "automake 1.10.x (aclocal) wasn't found, exiting"; exit 1
54
ACLOCAL=`locate_binary aclocal-1.10 aclocal-1.9 aclocal19 aclocal`
55
if test x$ACLOCAL = x; then
56
die "Did not find a supported aclocal"
120
60
if test x$AUTOMAKE = x; then
121
if test \! "x`which automake-1.10 2> /dev/null | grep -v '^no'`" = x; then
122
AUTOMAKE=automake-1.10
123
elif test \! "x`which automake110 2> /dev/null | grep -v '^no'`" = x; then
125
elif test \! "x`which automake 2> /dev/null | grep -v '^no'`" = x; then
128
echo "automake 1.10.x wasn't found, exiting"; exit 1
61
AUTOMAKE=`locate_binary automake-1.10 automake-1.9 automake19 automake`
62
if test x$AUTOMAKE = x; then
63
die "Did not find a supported automake"
133
## macosx has autoconf-2.59 and autoconf-2.60
134
67
if test x$AUTOCONF = x; then
135
if test \! "x`which autoconf-2.63 2> /dev/null | grep -v '^no'`" = x; then
136
AUTOCONF=autoconf-2.63
137
elif test \! "x`which autoconf263 2> /dev/null | grep -v '^no'`" = x; then
139
elif test \! "x`which autoconf-2.60 2> /dev/null | grep -v '^no'`" = x; then
140
AUTOCONF=autoconf-2.60
141
elif test \! "x`which autoconf260 2> /dev/null | grep -v '^no'`" = x; then
143
elif test \! "x`which autoconf-2.59 2> /dev/null | grep -v '^no'`" = x; then
144
AUTOCONF=autoconf-2.59
145
elif test \! "x`which autoconf259 2> /dev/null | grep -v '^no'`" = x; then
147
elif test \! "x`which autoconf 2> /dev/null | grep -v '^no'`" = x; then
150
echo "autoconf 2.59+ wasn't found, exiting"; exit 1
68
AUTOCONF=`locate_binary autoconf-2.59 autoconf259 autoconf`
69
if test x$AUTOCONF = x; then
70
die "Did not find a supported autoconf"
154
74
if test x$AUTOHEADER = x; then
155
if test \! "x`which autoheader-2.63 2> /dev/null | grep -v '^no'`" = x; then
156
AUTOHEADER=autoheader-2.63
157
elif test \! "x`which autoheader263 2> /dev/null | grep -v '^no'`" = x; then
158
AUTOHEADER=autoheader263
159
elif test \! "x`which autoheader-2.60 2> /dev/null | grep -v '^no'`" = x; then
160
AUTOHEADER=autoheader-2.60
161
elif test \! "x`which autoheader260 2> /dev/null | grep -v '^no'`" = x; then
162
AUTOHEADER=autoheader260
163
elif test \! "x`which autoheader-2.59 2> /dev/null | grep -v '^no'`" = x; then
164
AUTOHEADER=autoheader-2.59
165
elif test \! "x`which autoheader259 2> /dev/null | grep -v '^no'`" = x; then
166
AUTOHEADER=autoheader259
167
elif test \! "x`which autoheader 2> /dev/null | grep -v '^no'`" = x; then
168
AUTOHEADER=autoheader
170
echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 1
75
AUTOHEADER=`locate_binary autoheader-2.59 autoheader259 autoheader`
76
if test x$AUTOHEADER = x; then
77
die "Did not find a supported autoheader"
175
# --force means overwrite ltmain.sh script if it already exists
176
run python config/register_plugins.py || die "Can't execute register_plugins"
177
81
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize"
179
82
run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal"
180
83
run $AUTOHEADER || die "Can't execute autoheader"
181
84
run $AUTOMAKE $AUTOMAKE_FLAGS || die "Can't execute automake"
182
85
run $AUTOCONF || die "Can't execute autoconf"
183
echo -n "Automade with: "
184
$AUTOMAKE --version | head -1
185
echo -n "Configured with: "
186
$AUTOCONF --version | head -1
87
if test -f config/post_hook.sh
93
echo "Configured with the following tools:"
94
echo " * `$LIBTOOLIZE --version | head -1`"
95
echo " * `$ACLOCAL --version | head -1`"
96
echo " * `$AUTOHEADER --version | head -1`"
97
echo " * `$AUTOMAKE --version | head -1`"
98
echo " * `$AUTOCONF --version | head -1`"