2
# Taken from lighthttpd server (BSD). Thanks Jan!
3
# Run this to generate all the initial makefiles, etc.
2
# Create MySQL autotools infrastructure
5
4
die() { echo "$@"; exit 1; }
7
# LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
8
LIBTOOLIZE_FLAGS=" --automake --copy --force"
9
# ACLOCAL=${ACLOCAL:-aclocal}
11
# AUTOHEADER=${AUTOHEADER:-autoheader}
12
# AUTOMAKE=${AUTOMAKE:-automake}
13
AUTOMAKE_FLAGS="--add-missing --copy --force"
14
# AUTOCONF=${AUTOCONF:-autoconf}
21
echo "$ARGV0: running \`$@' $ARGS"
25
## jump out if one of the programs returns 'false'
28
if test -d ".bzr" ; then
29
bzr log --short > ChangeLog || touch ChangeLog
34
if test x$LIBTOOLIZE = x; then
35
if test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
36
LIBTOOLIZE=glibtoolize
37
elif test \! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x; then
38
LIBTOOLIZE=libtoolize-1.5
39
elif test \! "x`which libtoolize 2> /dev/null | grep -v '^no'`" = x; then
41
elif test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
42
LIBTOOLIZE=glibtoolize
44
echo "libtoolize 1.5.x wasn't found, exiting"; exit 1
48
if test x$ACLOCAL = x; then
49
if test \! "x`which aclocal-1.10 2> /dev/null | grep -v '^no'`" = x; then
51
elif test \! "x`which aclocal110 2> /dev/null | grep -v '^no'`" = x; then
53
elif test \! "x`which aclocal 2> /dev/null | grep -v '^no'`" = x; then
56
echo "automake 1.10.x (aclocal) wasn't found, exiting"; exit 1
60
if test x$AUTOMAKE = x; then
61
if test \! "x`which automake-1.10 2> /dev/null | grep -v '^no'`" = x; then
62
AUTOMAKE=automake-1.10
63
elif test \! "x`which automake110 2> /dev/null | grep -v '^no'`" = x; then
65
elif test \! "x`which automake 2> /dev/null | grep -v '^no'`" = x; then
68
echo "automake 1.10.x wasn't found, exiting"; exit 1
73
## macosx has autoconf-2.59 and autoconf-2.60
74
if test x$AUTOCONF = x; then
75
if test \! "x`which autoconf-2.59 2> /dev/null | grep -v '^no'`" = x; then
76
AUTOCONF=autoconf-2.59
77
elif test \! "x`which autoconf259 2> /dev/null | grep -v '^no'`" = x; then
79
elif test \! "x`which autoconf 2> /dev/null | grep -v '^no'`" = x; then
82
echo "autoconf 2.59+ wasn't found, exiting"; exit 1
86
if test x$AUTOHEADER = x; then
87
if test \! "x`which autoheader-2.59 2> /dev/null | grep -v '^no'`" = x; then
88
AUTOHEADER=autoheader-2.59
89
elif test \! "x`which autoheader259 2> /dev/null | grep -v '^no'`" = x; then
90
AUTOHEADER=autoheader259
91
elif test \! "x`which autoheader 2> /dev/null | grep -v '^no'`" = x; then
94
echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 1
99
run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal"
100
run $AUTOHEADER || die "Can't execute autoheader"
6
# Handle "glibtoolize" (e.g., for native OS X autotools) as another
7
# name for "libtoolize". Use the first one, either name, found in PATH.
8
LIBTOOLIZE=libtoolize # Default
9
IFS="${IFS= }"; save_ifs="$IFS"; IFS=':'
12
if test -x $dir/glibtoolize
14
LIBTOOLIZE=glibtoolize
16
elif test -x $dir/libtoolize
23
aclocal || die "Can't execute aclocal"
24
autoheader || die "Can't execute autoheader"
102
25
# --force means overwrite ltmain.sh script if it already exists
103
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize"
26
$LIBTOOLIZE --automake --force --copy || die "Can't execute libtoolize"
105
28
# --add-missing instructs automake to install missing auxiliary files
106
29
# and --force to overwrite them if they already exist
107
run $AUTOMAKE $AUTOMAKE_FLAGS || die "Can't execute automake"
108
run $AUTOCONF || die "Can't execute autoconf"
109
echo -n "Automade with: "
110
$AUTOMAKE --version | head -1
111
echo -n "Configured with: "
112
$AUTOCONF --version | head -1
30
automake --add-missing --force --copy || die "Can't execute automake"
31
autoconf || die "Can't execute autoconf"