Merge branch 'collectd-5.8'
[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; then
26     libtoolize=libtoolize
27 else
28     glibtoolize --version >/dev/null 2>/dev/null
29     if test $? -eq 0; then
30         libtoolize=glibtoolize
31     else
32         cat >&2 <<EOF
33 WARNING: Neither \`libtoolize' nor \`glibtoolize' have been found!
34     Please make sure that one of them is installed and is in one of the
35     directories listed in the PATH environment variable.
36 EOF
37         GLOBAL_ERROR_INDICATOR=1
38     fi
39  fi
40
41 if test "$GLOBAL_ERROR_INDICATOR" != "0"; then
42     exit 1
43 fi
44
45 set -x
46
47 autoheader \
48 && aclocal -I m4 \
49 && $libtoolize --copy --force \
50 && automake --add-missing --copy \
51 && autoconf