1 # man-check-progs.m4 serial 3
2 dnl MAN_CHECK_PROGS(VARIABLE, WITH-ARG, HELP-STRING, PROGS-TO-CHECK-FOR)
3 dnl Look for a program to use as VARIABLE. If --with-VARIABLE is given, then
4 dnl set VARIABLE to the path provided there (WITH-ARG and HELP-STRING are
5 dnl used for --help output). Otherwise, set VARIABLE to the first of
6 dnl PROGS-TO-CHECK-FOR on the path; if none of those is found, leave
7 dnl VARIABLE unchanged.
8 dnl If the program was found, define HAVE_WITH-ARG.
9 AC_DEFUN([MAN_CHECK_PROGS],
10 [AC_ARG_WITH([$1], [AS_HELP_STRING([--with-$1=$2], [$3])],
11 [AS_IF([test "$withval" = yes || test "$withval" = no],
12 [AC_MSG_ERROR([--with-$1 requires an argument])],
13 [AC_MSG_CHECKING([for $1])
14 AC_MSG_RESULT([$withval])
16 [AC_CHECK_PROGS([$1], [$4])])
17 if test -n "$$1"; then
18 AC_DEFINE([HAVE_$2], [1], [Define if you have $1.])
19 fi]) # MAN_CHECK_PROGS