blob: f05ef7a162028c264e63ea75247440bc4a5bc655 [file] [log] [blame]
Philip Tricca154b81d2018-07-06 12:41:07 -07001dnl ERROR_IF_NO_PROG
2dnl A quick / dirty macro to ensure that a required program / executable
3dnl is on PATH. If it is not we display an error message using AC_MSG_ERROR.
4dnl $1: program name
5AC_DEFUN([ERROR_IF_NO_PROG],[
Jonas Witschel30afabf2019-11-01 14:05:12 +01006 AC_CHECK_PROG(AS_TR_SH([result_$1]), [$1], [yes], [no])
7 AS_VAR_PUSHDEF([result], [result_$1])
8 AS_IF([test "x$result" != "xyes"], [
Philip Tricca154b81d2018-07-06 12:41:07 -07009 AC_MSG_ERROR([Missing required program '$1': ensure it is installed and on PATH.])
10 ])
Jonas Witschel30afabf2019-11-01 14:05:12 +010011 AS_VAR_POPDEF([result])
Philip Tricca154b81d2018-07-06 12:41:07 -070012])