1 |
#!/bin/sh |
2 |
# Run this to generate all the initial makefiles, etc. |
3 |
# Shamelessly stolen from lighttpd - which is licensed under the GPL |
4 |
|
5 |
LIBTOOLIZE_FLAGS="--automake --ltdl" |
6 |
AUTOMAKE_FLAGS="--add-missing" |
7 |
|
8 |
ARGV0=$0 |
9 |
ARGS="$@" |
10 |
|
11 |
run() { |
12 |
echo "$ARGV0: running \`$@' $ARGS" |
13 |
$@ $ARGS |
14 |
} |
15 |
|
16 |
## jump out if one of the programs returns 'false' |
17 |
set -e |
18 |
|
19 |
## on macosx glibtoolize, others have libtool |
20 |
if test x$LIBTOOLIZE = x; then |
21 |
if test \! x`which glibtoolize` = x; then |
22 |
LIBTOOLIZE=glibtoolize |
23 |
elif test \! x`which libtoolize-1.5` = x; then |
24 |
LIBTOOLIZE=libtoolize-1.5 |
25 |
elif test \! x`which libtoolize` = x; then |
26 |
LIBTOOLIZE=libtoolize |
27 |
fi |
28 |
fi |
29 |
|
30 |
## suse has aclocal and aclocal-1.9 |
31 |
if test x$ACLOCAL = x; then |
32 |
if test \! x`which aclocal-1.9` = x; then |
33 |
ACLOCAL=aclocal-1.9 |
34 |
AUTOMAKE=automake-1.9 |
35 |
elif test \! x`which aclocal` = x; then |
36 |
ACLOCAL=aclocal |
37 |
AUTOMAKE=automake |
38 |
fi |
39 |
fi |
40 |
|
41 |
if test x$AUTOMAKE = x; then |
42 |
if test \! x`which automake-1.9` = x; then |
43 |
AUTOMAKE=automake-1.9 |
44 |
elif test \! x`which automake` = x; then |
45 |
AUTOMAKE=automake |
46 |
fi |
47 |
fi |
48 |
|
49 |
|
50 |
## macosx has autoconf-2.59 and autoconf-2.60 |
51 |
if test x$AUTOCONF = x; then |
52 |
if test \! x`which autoconf-2.59` = x; then |
53 |
AUTOCONF=autoconf-2.59 |
54 |
elif test \! x`which autoconf` = x; then |
55 |
AUTOCONF=autoconf |
56 |
fi |
57 |
fi |
58 |
|
59 |
if test x$AUTOHEADER = x; then |
60 |
if test \! x`which autoheader-2.59` = x; then |
61 |
AUTOHEADER=autoheader-2.59 |
62 |
elif test \! x`which autoheader` = x; then |
63 |
AUTOHEADER=autoheader |
64 |
fi |
65 |
fi |
66 |
|
67 |
|
68 |
run $LIBTOOLIZE $LIBTOOLIZE_FLAGS |
69 |
run $ACLOCAL $ACLOCAL_FLAGS |
70 |
run $AUTOHEADER |
71 |
run $AUTOMAKE $AUTOMAKE_FLAGS |
72 |
run $AUTOCONF |
73 |
test "$ARGS" = "" && echo "Now type './configure ...' and 'make' to compile." |