autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to exit if program is not found


From: Roger Pau Monné
Subject: Re: How to exit if program is not found
Date: Thu, 14 Jun 2012 17:07:25 +0100

On Thu, Jun 14, 2012 at 5:01 PM, Timothy Madden <address@hidden> wrote:
> Hello
>
> I see in the info pages that autoconf macros check for various programs and
> set a variable if found, but how do I get the behaviour I see in most
> configure programs to exit with an error if a program is not found ?

I usually use the following macro:

AC_DEFUN([AX_PATH_PROG_OR_FAIL],
[AC_PATH_PROG([$1], [$2], [no])
if test x"${$1}" == x"no"
then
    AC_MSG_ERROR([Unable to find $2, please install $2])
fi])

So on my configure.ac I make the following calls:

AX_PATH_PROG_OR_FAIL([PERL], [perl])

Where "PERL" is the name of the variable where to store the path, and
"perl" is the name of the program to search for.

Hope this helps, Roger.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]