Browse Source

configure: Use the ./configure step to find pytest

Fixes #1544

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
parent
commit
3cf1581d6d
  1. 1
      Makefile
  2. 13
      configure

1
Makefile

@ -36,7 +36,6 @@ ifneq ($(NO_COMPAT),1)
COMPAT_CFLAGS=-DCOMPAT_V052=1
endif
PYTEST := $(shell command -v pytest 2> /dev/null)
PYTEST_OPTS := -v -x
# This is where we add new features as bitcoin adds them.

13
configure

@ -60,6 +60,16 @@ add_var()
[ -z "$3" ] || echo "#define $1 $2" >> "$3"
}
find_pytest()
{
PYTEST_BINS="pytest-3 pytest3 pytest py.test"
for PYTEST in $PYTEST_BINS; do
if [ "$(which $PYTEST)" != "" ] ; then
break
fi
done
}
for opt in "$@"; do
case "$opt" in
--reconfigure)
@ -102,6 +112,8 @@ rm -f $CONFIG_VAR_FILE.$$
$CONFIGURATOR --autotools-style --var-file=$CONFIG_VAR_FILE.$$ --header-file=$CONFIG_HEADER --configurator-cc="$CONFIGURATOR_CC" "$CC" $CWARNFLAGS $CDEBUGFLAGS
mv $CONFIG_VAR_FILE.$$ $CONFIG_VAR_FILE
find_pytest
add_var PREFIX "$PREFIX"
add_var CC "$CC"
add_var CONFIGURATOR_CC "$CONFIGURATOR_CC"
@ -110,3 +122,4 @@ add_var CDEBUGFLAGS "$CDEBUGFLAGS"
add_var VALGRIND "$VALGRIND"
add_var DEVELOPER "$DEVELOPER" $CONFIG_HEADER
add_var COMPAT "$COMPAT" $CONFIG_HEADER
add_var PYTEST "$(which $PYTEST)"

Loading…
Cancel
Save