From 3641b3318dc72ee4f560263778ae6b0bf2a3a267 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 19 Oct 2021 14:16:48 +0530 Subject: configure: Error out if required programs are not found. * configure.ac (CHECK_FOR_PROGRAM, REQUIRED_PROGRAM): New macros. Use REQUIRED_PROGRAM to check for dot, cwltool and skribilo. --- configure.ac | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 024b4a6..8f7d7ed 100644 --- a/configure.ac +++ b/configure.ac @@ -23,11 +23,26 @@ AM_SILENT_RULES([yes]) GUILE_PKG([3.0 2.2]) GUILE_PROGS + +# CHECK_FOR_PROGRAM(VARIABLE, PROGRAM-TO-CHECK-FOR, MESSAGE) +# ---------------------------------------------------------- +AC_DEFUN([CHECK_FOR_PROGRAM], [ + AC_PATH_PROG([$1], [$2], [no]) + AS_IF([test x"$$1" = xno], [$3]) +]) + +# REQUIRED_PROGRAM(VARIABLE, PROGRAM-TO-CHECK-FOR, PACKAGE-CONTAINING-PROGRAM) +# ---------------------------------------------------------------------------- +AC_DEFUN([REQUIRED_PROGRAM], [ + CHECK_FOR_PROGRAM([$1], [$2], [AC_MSG_ERROR([cannot find $2 m4_ifnblank([$3], [from the $3 package])])]) +]) +]) + AC_PROG_SED -AC_PATH_PROG([DOT], [dot]) -AC_PATH_PROG([CWLTOOL], [cwltool]) +REQUIRED_PROGRAM([DOT], [dot], [graphviz]) +REQUIRED_PROGRAM([CWLTOOL], [cwltool]) +REQUIRED_PROGRAM([SKRIBILO], [skribilo]) AC_PATH_PROG([EMACS], [emacs]) -AC_PATH_PROG([SKRIBILO], [skribilo]) AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([pre-inst-env], [chmod +x pre-inst-env]) -- cgit v1.2.3