10 function check_autotool_version
() {
11 which $1 &>/dev
/null ||
{
12 error
"$1 is not installed, and is required to configure $PACKAGE"
15 version
=$
($1 --version |
head -n 1 | cut
-f4 -d' ')
16 major
=$
(echo $version | cut
-f1 -d.
)
17 minor
=$
(echo $version | cut
-f2 -d.
)
18 rev=$
(echo $version | cut
-f3 -d. |
sed 's/[^0-9].*$//')
19 major_check
=$
(echo $2 | cut
-f1 -d.
)
20 minor_check
=$
(echo $2 | cut
-f2 -d.
)
21 rev_check
=$
(echo $2 | cut
-f3 -d.
)
23 if [ $major -lt $major_check ]; then
25 elif [[ $minor -lt $minor_check && $major = $major_check ]]; then
27 elif [[ $rev -lt $rev_check && $minor = $minor_check && $major = $major_check ]]; then
31 if [ x
"$do_bail" = x
"yes" ]; then
32 error
"$1 version $2 or better is required to configure $PROJECT"
38 $@
2>.autogen.log ||
{
41 error
"Could not run $1, which is required to configure $PROJECT"
47 test -z "$srcdir" && srcdir
=.
49 (test -f $srcdir/configure.ac
) ||
{
50 error
"Directory \"$srcdir\" does not look like the top-level $PROJECT directory"
53 # MacPorts on OS X only seems to have glibtoolize
54 WHICHLIBTOOLIZE
=$
(which libtoolize ||
which glibtoolize
)
55 if [ x
"$WHICHLIBTOOLIZE" == x
"" ]; then
56 error
"libtool is required to configure $PROJECT"
58 LIBTOOLIZE
=$
(basename $WHICHLIBTOOLIZE)
60 check_autotool_version aclocal
1.9
61 check_autotool_version automake
1.10
62 check_autotool_version autoconf
2.53
63 check_autotool_version
$LIBTOOLIZE 1.4.3
64 check_autotool_version intltoolize
0.35.0
65 check_autotool_version pkg-config
0.14.0
67 if git
--help &>/dev
/null
; then
68 git submodule update
--init
71 run intltoolize
--force --copy
72 run
$LIBTOOLIZE --force --copy --automake
73 run aclocal
-I build
/m
4/banshee
-I build
/m
4/shamrock
-I build
/m
4/shave
$ACLOCAL_FLAGS
77 test -f config.h.
in && touch config.h.
in
78 run automake
--gnu --add-missing --force --copy \
79 -Wno-portability -Wno-portability
81 if [ ! -z "$NOCONFIGURE" ]; then
82 echo "Done. ./configure skipped."
87 echo "WARNING: I am going to run configure without any arguments."