build.sh: use consistent indentation
[collectd.git] / build.sh
1 #!/bin/sh
2
3 GLOBAL_ERROR_INDICATOR=0
4
5 check_for_application ()
6 {
7     for PROG in "$@"
8     do
9         which "$PROG" >/dev/null 2>&1
10         if test $? -ne 0; then
11             cat >&2 <<EOF
12 WARNING: \`$PROG' not found!
13     Please make sure that \`$PROG' is installed and is in one of the
14     directories listed in the PATH environment variable.
15 EOF
16             GLOBAL_ERROR_INDICATOR=1
17         fi
18     done
19 }
20
21 check_for_application lex bison autoheader aclocal automake autoconf pkg-config
22
23 libtoolize=""
24 libtoolize --version >/dev/null 2>/dev/null
25 if test $? -eq 0
26 then
27     libtoolize=libtoolize
28 else
29     glibtoolize --version >/dev/null 2>/dev/null
30     if test $? -eq 0
31     then
32         libtoolize=glibtoolize
33     else
34         cat >&2 <<EOF
35 WARNING: Neither \`libtoolize' nor \`glibtoolize' have been found!
36     Please make sure that one of them is installed and is in one of the
37     directories listed in the PATH environment variable.
38 EOF
39         GLOBAL_ERROR_INDICATOR=1
40     fi
41  fi
42
43 if test "$GLOBAL_ERROR_INDICATOR" != "0"
44 then
45     exit 1
46 fi
47
48 set -x
49
50 autoheader \
51 && aclocal -I m4 \
52 && $libtoolize --copy --force \
53 && automake --add-missing --copy \
54 && autoconf