X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=acinclude.m4;h=0af7fd0fc9ec7aaae5ee7dbfcfbf329123e245f7;hb=7507ec485f72c2ec56731ee5c9790a20d6d694fd;hp=f1322fa0e125532556b8fc9e037d0becd5b3918e;hpb=0f9fc40325e390f23ef46cb2b3588da6b97ad5b1;p=sliver-openvswitch.git diff --git a/acinclude.m4 b/acinclude.m4 index f1322fa0e..0af7fd0fc 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -108,21 +108,26 @@ dnl dnl Greps FILE for REGEX. If it matches, runs IF-MATCH, otherwise IF-NO-MATCH. AC_DEFUN([OVS_GREP_IFELSE], [ AC_MSG_CHECKING([whether $2 matches in $1]) - grep '$2' $1 >/dev/null 2>&1 - status=$? - case $status in - 0) - AC_MSG_RESULT([yes]) - $3 - ;; - 1) - AC_MSG_RESULT([no]) - $4 - ;; - *) - AC_MSG_ERROR([grep exited with status $status]) - ;; - esac + if test -f $1; then + grep '$2' $1 >/dev/null 2>&1 + status=$? + case $status in + 0) + AC_MSG_RESULT([yes]) + $3 + ;; + 1) + AC_MSG_RESULT([no]) + $4 + ;; + *) + AC_MSG_ERROR([grep exited with status $status]) + ;; + esac + else + AC_MSG_RESULT([file not found]) + $4 + fi ]) dnl OVS_DEFINE(NAME)