Merge branch 'collectd-4.5'
[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                 if ! which "$PROG" >/dev/null 2>&1; then
10                         cat >&2 <<EOF
11 WARNING: \`$PROG' not found!
12     Please make sure that \`$PROG' is installed and is in one of the
13     directories listed in the PATH environment variable.
14 EOF
15                         GLOBAL_ERROR_INDICATOR=1
16                 fi
17         done
18 }
19
20 check_for_application lex yacc autoheader aclocal automake autoconf
21
22 # Actually we don't need the pkg-config executable, but we need the M4 macros.
23 # We check for `pkg-config' here and hope that M4 macros will then be
24 # available, too.
25 check_for_application pkg-config
26
27 libtoolize=""
28 libtoolize --version >/dev/null 2>/dev/null
29 if test $? -eq 0
30 then
31         libtoolize=libtoolize
32 else
33         glibtoolize --version >/dev/null 2>/dev/null
34         if test $? -eq 0
35         then
36                 libtoolize=glibtoolize
37         else
38                 cat >&2 <<EOF
39 WARNING: Neither \`libtoolize' nor \`glibtoolize' have been found!
40     Please make sure that one of them is installed and is in one of the
41     directories listed in the PATH environment variable.
42 EOF
43                 GLOBAL_ERROR_INDICATOR=1
44         fi
45  fi
46
47 if test "$GLOBAL_ERROR_INDICATOR" != "0"
48 then
49         exit 1
50 fi
51
52 set -x
53
54 autoheader \
55 && aclocal \
56 && $libtoolize --ltdl --copy --force \
57 && automake --add-missing --copy \
58 && autoconf