|
@ -13,6 +13,7 @@ EXPERIMENTAL_FEATURES=${EXPERIMENTAL_FEATURES:-0} |
|
|
COMPAT=${COMPAT:-1} |
|
|
COMPAT=${COMPAT:-1} |
|
|
STATIC=${STATIC:-0} |
|
|
STATIC=${STATIC:-0} |
|
|
CONFIGURATOR_CC=${CONFIGURATOR_CC:-$CC} |
|
|
CONFIGURATOR_CC=${CONFIGURATOR_CC:-$CC} |
|
|
|
|
|
ASAN=${ASAN:-0} |
|
|
|
|
|
|
|
|
CONFIGURATOR=ccan/tools/configurator/configurator |
|
|
CONFIGURATOR=ccan/tools/configurator/configurator |
|
|
CONFIG_VAR_FILE=config.vars |
|
|
CONFIG_VAR_FILE=config.vars |
|
@ -57,6 +58,8 @@ usage() |
|
|
echo " Valgrind binary to use for tests" |
|
|
echo " Valgrind binary to use for tests" |
|
|
usage_with_default "--enable/disable-static" "$STATIC" "enable" "disable" |
|
|
usage_with_default "--enable/disable-static" "$STATIC" "enable" "disable" |
|
|
echo " Static link binary" |
|
|
echo " Static link binary" |
|
|
|
|
|
usage_with_default "--enable/disable-address-sanitizer" "$ASAN" "enable" "disable" |
|
|
|
|
|
echo " Compile with address-sanitizer" |
|
|
exit 1 |
|
|
exit 1 |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -119,6 +122,8 @@ for opt in "$@"; do |
|
|
--disable-valgrind) VALGRIND=0;; |
|
|
--disable-valgrind) VALGRIND=0;; |
|
|
--enable-static) STATIC=1;; |
|
|
--enable-static) STATIC=1;; |
|
|
--disable-static) STATIC=0;; |
|
|
--disable-static) STATIC=0;; |
|
|
|
|
|
--enable-address-sanitizer) ASAN=1;; |
|
|
|
|
|
--disable-address-sanitizer) ASAN=0;; |
|
|
--help|-h) usage;; |
|
|
--help|-h) usage;; |
|
|
*) |
|
|
*) |
|
|
echo "Unknown option '$opt'" >&2 |
|
|
echo "Unknown option '$opt'" >&2 |
|
@ -139,6 +144,17 @@ if [ -z "$VALGRIND" ]; then |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
if [ "$ASAN" = "1" ]; then |
|
|
|
|
|
if [ "$CC" != "gcc" ] && [ "$CC" != "cc" ]; then |
|
|
|
|
|
echo "Address sanitizer (ASAN) is currently only supported with gcc" |
|
|
|
|
|
exit 1 |
|
|
|
|
|
fi |
|
|
|
|
|
if [ "$VALGRIND" = "1" ]; then |
|
|
|
|
|
echo "Address sanitizer (ASAN) and valgrind cannot be enabled at the same time" |
|
|
|
|
|
exit 1 |
|
|
|
|
|
fi |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
rm -f $CONFIG_VAR_FILE.$$ |
|
|
rm -f $CONFIG_VAR_FILE.$$ |
|
|
$CONFIGURATOR --autotools-style --var-file=$CONFIG_VAR_FILE.$$ --header-file=$CONFIG_HEADER --configurator-cc="$CONFIGURATOR_CC" "$CC" $CWARNFLAGS $CDEBUGFLAGS |
|
|
$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 |
|
|
mv $CONFIG_VAR_FILE.$$ $CONFIG_VAR_FILE |
|
@ -154,6 +170,7 @@ add_var EXPERIMENTAL_FEATURES "$EXPERIMENTAL_FEATURES" $CONFIG_HEADER |
|
|
add_var COMPAT "$COMPAT" $CONFIG_HEADER |
|
|
add_var COMPAT "$COMPAT" $CONFIG_HEADER |
|
|
add_var PYTEST "$PYTEST" |
|
|
add_var PYTEST "$PYTEST" |
|
|
add_var STATIC "$STATIC" |
|
|
add_var STATIC "$STATIC" |
|
|
|
|
|
add_var ASAN "$ASAN" |
|
|
|
|
|
|
|
|
# Hack to avoid sha256 name clash with libwally: will be fixed when that |
|
|
# Hack to avoid sha256 name clash with libwally: will be fixed when that |
|
|
# becomes a standalone shared lib. |
|
|
# becomes a standalone shared lib. |
|
|