X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=build.sh;h=57f3d4449a99bef83b75b50f425dc548bc9ead60;hp=cede2e48f2fc8cf3725ae04c9928e7862f1dd864;hb=db35efb33e81d0a013e09a8a6ffa362ad5962f7c;hpb=62430c784cf53c7dccb6fec021f9bb4c0d790a0f diff --git a/build.sh b/build.sh index cede2e48..57f3d444 100755 --- a/build.sh +++ b/build.sh @@ -1,19 +1,53 @@ #! /bin/sh -if ! which lex > /dev/null 2>&1; then - echo "WARNING: lex not found!" >&2 - echo "Make sure that you have a flex compatible tool available." >&2 -fi +GLOBAL_ERROR_INDICATOR=0 -if ! which yacc > /dev/null 2>&1; then - echo "WARNING: yacc not found!" >&2 - echo "Make sure that you have a GNU bison compatible tool available." >&2 -fi +check_for_application () +{ + for PROG in "$@" + do + which "$PROG" >/dev/null 2>&1 + if test $? -ne 0; then + cat >&2 </dev/null 2>/dev/null +if test $? -eq 0 +then + libtoolize=libtoolize +else + glibtoolize --version >/dev/null 2>/dev/null + if test $? -eq 0 + then + libtoolize=glibtoolize + else + cat >&2 < /dev/null 2>&1; then - libtoolize=glibtoolize +if test "$GLOBAL_ERROR_INDICATOR" != "0" +then + exit 1 fi set -x