Mono.Zeroconf – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | #!/bin/bash |
2 | |||
3 | PROJECT=Mono.Zeroconf |
||
4 | |||
5 | function error () { |
||
6 | echo "Error: $1" 1>&2 |
||
7 | exit 1 |
||
8 | } |
||
9 | |||
10 | function check_autotool_version () { |
||
11 | which $1 &>/dev/null || { |
||
12 | error "$1 is not installed, and is required to configure $PACKAGE" |
||
13 | } |
||
14 | |||
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 | major_check=$(echo $2 | cut -f1 -d.) |
||
19 | minor_check=$(echo $2 | cut -f2 -d.) |
||
20 | |||
21 | if [ $major -lt $major_check ]; then |
||
22 | do_bail=yes |
||
23 | elif [[ $minor -lt $minor_check && $major = $major_check ]]; then |
||
24 | do_bail=yes |
||
25 | fi |
||
26 | |||
27 | if [ x"$do_bail" = x"yes" ]; then |
||
28 | error "$1 version $2 or better is required to configure $PROJECT" |
||
29 | fi |
||
30 | } |
||
31 | |||
32 | function run () { |
||
33 | echo "Running $@ ..." |
||
34 | $@ 2>.autogen.log || { |
||
35 | cat .autogen.log 1>&2 |
||
36 | rm .autogen.log |
||
37 | error "Could not run $1, which is required to configure $PROJECT" |
||
38 | } |
||
39 | rm .autogen.log |
||
40 | } |
||
41 | |||
42 | srcdir=$(dirname $0) |
||
43 | test -z "$srcdir" && srcdir=. |
||
44 | |||
45 | (test -f $srcdir/configure.ac) || { |
||
46 | error "Directory \"$srcdir\" does not look like the top-level $PROJECT directory" |
||
47 | } |
||
48 | |||
49 | check_autotool_version aclocal 1.9 |
||
50 | check_autotool_version automake 1.9 |
||
51 | check_autotool_version autoconf 2.13 |
||
52 | |||
53 | run aclocal -I . $ACLOCAL_FLAGS |
||
54 | run autoconf |
||
55 | run automake -a --gnu |
||
56 | |||
57 | if [ $# = 0 ]; then |
||
58 | echo "WARNING: I am going to run configure without any arguments." |
||
59 | fi |
||
60 | |||
61 | run ./configure --enable-maintainer-mode $@ |
||
62 |