diff --git a/Makefile b/Makefile index dc2d5ab4c..941a7a05e 100644 --- a/Makefile +++ b/Makefile @@ -271,13 +271,6 @@ check-hdr-include-order/%: % check-makefile: @if [ x"$(CCANDIR)/config.h `find $(CCANDIR)/ccan -name '*.h' | grep -v /test/ | LC_ALL=C sort | tr '\n' ' '`" != x"$(CCAN_HEADERS) " ]; then echo CCAN_HEADERS incorrect; exit 1; fi -# Check if they've installed 'mako' dependency, useful for -# keeping your build from clobbering itself -check-bolt-dependency: - @python3 -c "import mako" - -BOLT_DEPS += check-bolt-dependency - # Experimental quotes quote the exact version. ifeq ($(EXPERIMENTAL_FEATURES),1) CHECK_BOLT_PREFIX=--prefix="BOLT-$(BOLTVERSION)" diff --git a/configure b/configure index 7920f6f5f..3d5ae56d5 100755 --- a/configure +++ b/configure @@ -68,6 +68,22 @@ default_pytest() done } +require() +{ + name="$1" + resolution="$2" + shift 2 + + echo -n "checking for $name... " + if "$@" 2>/dev/null; then + echo 'found' + return + fi + echo 'not found' + echo "$resolution" >&2 + exit 1 +} + default_valgrind_setting() { # Valgrind must accept all these options (might exit with error 7 though @@ -209,6 +225,9 @@ if [ "$ASAN" = "1" ]; then fi fi +# Doesn't set a var, but makes sure it exists +require 'python3-mako' "You need the mako module for python3: see doc/INSTALL.md" python3 -c 'import mako' + rm -f $CONFIG_VAR_FILE.$$ $CONFIGURATOR --extra-tests --autotools-style --var-file=$CONFIG_VAR_FILE.$$ --header-file=$CONFIG_HEADER --configurator-cc="$CONFIGURATOR_CC" "$CC" ${CWARNFLAGS-$BASE_WARNFLAGS} $CDEBUGFLAGS $COPTFLAGS <