1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
#!/bin/sh
# Shell script for automation of autotools.
run_command()
{
# show message; run command; if unsuccessful, show error message and exit
echo $0: Running \"$@\" ...
"$@" || { status=$?; echo $0: Error in \"$@\"!; exit $status; }
}
# change to the directory where the script is located
# (in case it was started from somewhere else)
cd $(dirname $0)
# TODO: find a way to move aclocal.m4 from the root directory to somewhere else
#ACLOCAL_FLAGS="--output=autotools/aclocal.m4"
# Preferring autoreconf for a more transparent configuration/debugging process.
if test -f autotools/config/depcomp; then
if test x$1 != x--no-auto; then
# TODO: check if autoreconf is available?
echo $0: Using \"autoreconf\" from now on.
echo Use \"$0 --no-auto\" to override this behaviour.
run_command autoreconf
echo $0: Done!
exit
fi
fi
# on OS X, which(1) returns 0 even when it can't find a program
if type libtoolize >/dev/null 2>&1; then
LIBTOOLIZE=libtoolize
else
if which glibtoolize >/dev/null; then
# on the Mac it's called glibtoolize for some reason
LIBTOOLIZE=glibtoolize
else
echo $0: Error: libtoolize not found!
exit 127
fi
fi
run_command $LIBTOOLIZE --force
# in most cases, "libtoolize" is used like this:
#
# libtoolize --force 2>&1 | sed '/^You should/d' || {
# echo "libtool failed, exiting..."
# exit 1
# }
#
# This just removes all lines starting with "You should" from the output
run_command aclocal $ACLOCAL_FLAGS
run_command autoheader
run_command automake --add-missing --foreign
run_command autoconf
echo $0: Done!
# Settings for Vim (http://www.vim.org/), please do not remove:
# vim:softtabstop=2:shiftwidth=2:expandtab:textwidth=80
|