2
# Create MySQL autotools infrastructure
2
# Taken from lighthttpd server (BSD). Thanks Jan!
3
# Run this to generate all the initial makefiles, etc.
4
5
die() { echo "$@"; exit 1; }
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"
7
# LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
8
LIBTOOLIZE_FLAGS=" --automake --copy --force"
9
# ACLOCAL=${ACLOCAL:-aclocal}
10
# AUTOHEADER=${AUTOHEADER:-autoheader}
11
# AUTOMAKE=${AUTOMAKE:-automake}
12
AUTOMAKE_FLAGS="--add-missing --copy --force"
13
# AUTOCONF=${AUTOCONF:-autoconf}
20
echo "$ARGV0: running \`$@' $ARGS"
24
## jump out if one of the programs returns 'false'
27
## We do not currently support glibtoolize
28
if test x$LIBTOOLIZE = x; then
29
# if test \! "x`which glibtoolize 2> /dev/null | grep -v '^no'`" = x; then
30
# LIBTOOLIZE=glibtoolize
31
if test \! "x`which libtoolize-1.5 2> /dev/null | grep -v '^no'`" = x; then
32
LIBTOOLIZE=libtoolize-1.5
33
elif test \! "x`which libtoolize 2> /dev/null | grep -v '^no'`" = x; then
36
echo "libtoolize 1.5.x wasn't found, exiting"; exit 0
40
## suse has aclocal and aclocal-1.9
41
if test x$ACLOCAL = x; then
42
if test \! "x`which aclocal-1.9 2> /dev/null | grep -v '^no'`" = x; then
44
elif test \! "x`which aclocal19 2> /dev/null | grep -v '^no'`" = x; then
46
elif test \! "x`which aclocal 2> /dev/null | grep -v '^no'`" = x; then
49
echo "automake 1.9.x (aclocal) wasn't found, exiting"; exit 0
53
if test x$AUTOMAKE = x; then
54
if test \! "x`which automake-1.9 2> /dev/null | grep -v '^no'`" = x; then
56
elif test \! "x`which automake19 2> /dev/null | grep -v '^no'`" = x; then
58
elif test \! "x`which automake 2> /dev/null | grep -v '^no'`" = x; then
61
echo "automake 1.9.x wasn't found, exiting"; exit 0
66
## macosx has autoconf-2.59 and autoconf-2.60
67
if test x$AUTOCONF = x; then
68
if test \! "x`which autoconf-2.59 2> /dev/null | grep -v '^no'`" = x; then
69
AUTOCONF=autoconf-2.59
70
elif test \! "x`which autoconf259 2> /dev/null | grep -v '^no'`" = x; then
72
elif test \! "x`which autoconf 2> /dev/null | grep -v '^no'`" = x; then
75
echo "autoconf 2.59+ wasn't found, exiting"; exit 0
79
if test x$AUTOHEADER = x; then
80
if test \! "x`which autoheader-2.59 2> /dev/null | grep -v '^no'`" = x; then
81
AUTOHEADER=autoheader-2.59
82
elif test \! "x`which autoheader259 2> /dev/null | grep -v '^no'`" = x; then
83
AUTOHEADER=autoheader259
84
elif test \! "x`which autoheader 2> /dev/null | grep -v '^no'`" = x; then
87
echo "autoconf 2.59+ (autoheader) wasn't found, exiting"; exit 0
92
run $ACLOCAL $ACLOCAL_FLAGS || die "Can't execute aclocal"
93
run $AUTOHEADER || die "Can't execute autoheader"
25
95
# --force means overwrite ltmain.sh script if it already exists
26
$LIBTOOLIZE --automake --force --copy || die "Can't execute libtoolize"
96
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Can't execute libtoolize"
28
98
# --add-missing instructs automake to install missing auxiliary files
29
99
# and --force to overwrite them if they already exist
30
automake --add-missing --force --copy --gnu -Wall || die "Can't execute automake"
31
autoconf || die "Can't execute autoconf"
100
run $AUTOMAKE $AUTOMAKE_FLAGS || die "Can't execute automake"
101
run $AUTOCONF || die "Can't execute autoconf"