xref: /aosp_15_r20/external/tpm2-tss/m4/misc.m4 (revision 758e9fba6fc9adbf15340f70c73baee7b168b1c9)
1*758e9fbaSOystein Eftevaagdnl ERROR_IF_NO_PROG
2*758e9fbaSOystein Eftevaagdnl   A quick / dirty macro to ensure that a required program / executable
3*758e9fbaSOystein Eftevaagdnl   is on PATH. If it is not we display an error message using AC_MSG_ERROR.
4*758e9fbaSOystein Eftevaagdnl $1: program name
5*758e9fbaSOystein EftevaagAC_DEFUN([ERROR_IF_NO_PROG],[
6*758e9fbaSOystein Eftevaag    AC_CHECK_PROG(AS_TR_SH([result_$1]), [$1], [yes], [no])
7*758e9fbaSOystein Eftevaag    AS_VAR_PUSHDEF([result], [result_$1])
8*758e9fbaSOystein Eftevaag    AS_IF([test "x$result" != "xyes"], [
9*758e9fbaSOystein Eftevaag        AC_MSG_ERROR([Missing required program '$1': ensure it is installed and on PATH.])
10*758e9fbaSOystein Eftevaag    ])
11*758e9fbaSOystein Eftevaag    AS_VAR_POPDEF([result])
12*758e9fbaSOystein Eftevaag])
13