mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-18 12:29:21 +00:00
* FIND_STD_PROGRAM will find a program in the path or using --with options and verify that the path/bin/program is executable. Also allows checking for include files and libraries. If found, USE_PROGRAM is set, otherwise its not set. Also sets PROGRAM_BIN (bin directory), and PROGRAM_DIR (top level directory). If headers are found, sets PROGRAM_INC. If libraries are found, sets PROGRAM_LIB. * CHECK_PROGRAM_SANITY can be used to run a program with some option that only produces information output and requires no input. If the output matches a regular expression, the program passes the sanity check. Otherwise, an error occurs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22458 91177308-0d34-0410-b5e6-96231b3b80d8
23 lines
805 B
Plaintext
23 lines
805 B
Plaintext
dnl Check a program for version sanity. The test runs a program, passes it an
|
|
dnl argument to make it print out some identification string, and filters that
|
|
dnl output with a regular expression. If the output is non-empty, the program
|
|
dnl passes the sanity check.
|
|
dnl $1 - Name or full path of the program to run
|
|
dnl $2 - Argument to pass to print out identification string
|
|
dnl $3 - grep RE to match identification string
|
|
AC_DEFUN([CHECK_PROGRAM_SANITY],
|
|
[
|
|
AC_MSG_CHECKING([sanity for program ]$1)
|
|
sanity_path=`which $1 2>/dev/null`
|
|
if test "$?" -eq 0 -a -x "$sanity_path" ; then
|
|
sanity=`$1 $2 2>&1 | grep "$3"`
|
|
if test -z "$sanity" ; then
|
|
AC_MSG_RESULT([no])
|
|
AC_MSG_ERROR([Program ]$1[ failed to pass sanity check.])
|
|
fi
|
|
AC_MSG_RESULT([yes])
|
|
else
|
|
AC_MSG_RESULT([not found])
|
|
fi
|
|
])
|