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