From fab5027d64e36ac6428b0999d6153b0aab33c99d Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 3 Dec 2018 09:34:06 +1030 Subject: [PATCH] configure: add --experimental-features flag (default: == DEVELOPER). This will be used for option_simplified_commitment and other still-being-specified options. Signed-off-by: Rusty Russell --- configure | 8 ++++++++ tests/utils.py | 1 + 2 files changed, 9 insertions(+) diff --git a/configure b/configure index eb43b59bf..ec5214f7e 100755 --- a/configure +++ b/configure @@ -47,6 +47,8 @@ usage() echo " Prefix for make install" usage_with_default "--enable/disable-developer" "$DEVELOPER" "enable" "disable" echo " Developer mode, good for testing" + usage_with_default "--enable/disable-experimental-features" "$EXPERIMENTAL_FEATURES" "enable" "disable (unless developer)" + echo " Developer mode, good for testing" usage_with_default "--enable/disable-compat" "$COMPAT" "enable" "disable" echo " Compatibility mode, good to disable to see if your software breaks" usage_with_default "--enable/disable-valgrind" "(autodetect)" @@ -101,6 +103,8 @@ for opt in "$@"; do --prefix=*) PREFIX="${opt#--prefix=}";; --enable-developer) DEVELOPER=1;; --disable-developer) DEVELOPER=0;; + --enable-experimental-features) EXPERIMENTAL_FEATURES=1;; + --disable-experimental-features) EXPERIMENTAL_FEATURES=0;; --enable-compat) COMPAT=1;; --disable-compat) COMPAT=0;; --enable-valgrind) VALGRIND=1;; @@ -113,6 +117,9 @@ for opt in "$@"; do esac done +# If EXPERIMENTAL_FEATURES not set, set it to same as DEVELOPER +EXPERIMENTAL_FEATURES=${EXPERIMENTAL_FEATURES:-$DEVELOPER} + echo -n "Compiling $CONFIGURATOR..." $CC $CWARNFLAGS $CDEBUGFLAGS -o $CONFIGURATOR $CONFIGURATOR.c echo "done" @@ -136,6 +143,7 @@ add_var CWARNFLAGS "$CWARNFLAGS" add_var CDEBUGFLAGS "$CDEBUGFLAGS" add_var VALGRIND "$VALGRIND" add_var DEVELOPER "$DEVELOPER" $CONFIG_HEADER +add_var EXPERIMENTAL_FEATURES "$EXPERIMENTAL_FEATURES" $CONFIG_HEADER add_var COMPAT "$COMPAT" $CONFIG_HEADER add_var PYTEST "$PYTEST" diff --git a/tests/utils.py b/tests/utils.py index cab3bcc4d..71af36bb9 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -37,6 +37,7 @@ with open('config.vars') as configfile: config = dict([(line.rstrip().split('=', 1)) for line in configfile]) DEVELOPER = os.getenv("DEVELOPER", config['DEVELOPER']) == "1" +EXPERIMENTAL_FEATURES = os.getenv("EXPERIMENTAL_FEATURES", config['EXPERIMENTAL_FEATURES']) == "1" TIMEOUT = int(os.getenv("TIMEOUT", "60")) VALGRIND = os.getenv("VALGRIND", config['VALGRIND']) == "1" SLOW_MACHINE = os.getenv("SLOW_MACHINE", "0") == "1"