X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=autoconf%2Fm4%2Fsanity_check.m4;h=639fccca2464058e84c3b14cf9217731b2ce5e3d;hb=09aa3f0ef35d9241c92439d74b8d5e9a81d814c2;hp=5c4d1904fc7d62c4358844209621f457bb50fa49;hpb=a5e26077edb9611a0ea366c9f098a6e080f6da6b;p=oota-llvm.git diff --git a/autoconf/m4/sanity_check.m4 b/autoconf/m4/sanity_check.m4 index 5c4d1904fc7..639fccca246 100644 --- a/autoconf/m4/sanity_check.m4 +++ b/autoconf/m4/sanity_check.m4 @@ -5,17 +5,26 @@ dnl passes the sanity check. dnl $1 - Name or full path of the program to run dnl $2 - Argument to pass to print out identification string dnl $3 - grep RE to match identification string +dnl $4 - set to 1 to make errors only a warning AC_DEFUN([CHECK_PROGRAM_SANITY], [ AC_MSG_CHECKING([sanity for program ]$1) +sanity="0" sanity_path=`which $1 2>/dev/null` if test "$?" -eq 0 -a -x "$sanity_path" ; then sanity=`$1 $2 2>&1 | grep "$3"` if test -z "$sanity" ; then AC_MSG_RESULT([no]) - AC_MSG_ERROR([Program ]$1[ failed to pass sanity check.]) + sanity="0" + if test "$4" -eq 1 ; then + AC_MSG_WARN([Program ]$1[ failed to pass sanity check.]) + else + AC_MSG_ERROR([Program ]$1[ failed to pass sanity check.]) + fi + else + AC_MSG_RESULT([yes]) + sanity="1" fi - AC_MSG_RESULT([yes]) else AC_MSG_RESULT([not found]) fi