Merge bitcoin-core/secp256k1#1079: configure: Add hidden --enable-dev-mode to enable all the stuff
e0838d663d
configure: Add hidden --enable-dev-mode to enable all the stuff (Tim Ruffing)fabd579dfa
configure: Remove redundant code that sets _enable variables (Tim Ruffing)0d4226c051
configure: Use canonical variable prefix _enable consistently (Tim Ruffing) Pull request description: ACKs for top commit: elichai: tACKe0838d663d
jonasnick: ACKe0838d663d
Tree-SHA512: dfa1977f8844b8c93c6e72e81845166b47892a0169d931413587ce4ca6b0516b38214635ccfcc008f657d49a07d00574bf9b2c3d40a6d538cc7493b8716219aa
This commit is contained in:
commit
ac83be33d0
|
@ -38,3 +38,16 @@ AC_DEFUN([SECP_TRY_APPEND_CFLAGS], [
|
||||||
unset flag_works
|
unset flag_works
|
||||||
AC_SUBST($2)
|
AC_SUBST($2)
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl SECP_SET_DEFAULT(VAR, default, default-dev-mode)
|
||||||
|
dnl Set VAR to default or default-dev-mode, depending on whether dev mode is enabled
|
||||||
|
AC_DEFUN([SECP_SET_DEFAULT], [
|
||||||
|
if test "${enable_dev_mode+set}" != set; then
|
||||||
|
AC_MSG_ERROR([[Set enable_dev_mode before calling SECP_SET_DEFAULT]])
|
||||||
|
fi
|
||||||
|
if test x"$enable_dev_mode" = x"yes"; then
|
||||||
|
$1="$3"
|
||||||
|
else
|
||||||
|
$1="$2"
|
||||||
|
fi
|
||||||
|
])
|
||||||
|
|
86
configure.ac
86
configure.ac
|
@ -114,60 +114,54 @@ SECP_TRY_APPEND_DEFAULT_CFLAGS(SECP_CFLAGS)
|
||||||
### Define config arguments
|
### Define config arguments
|
||||||
###
|
###
|
||||||
|
|
||||||
|
# In dev mode, we enable all binaries and modules by default but individual options can still be overridden explicitly.
|
||||||
|
# Check for dev mode first because SECP_SET_DEFAULT needs enable_dev_mode set.
|
||||||
|
AC_ARG_ENABLE(dev_mode, [], [],
|
||||||
|
[enable_dev_mode=no])
|
||||||
|
|
||||||
AC_ARG_ENABLE(benchmark,
|
AC_ARG_ENABLE(benchmark,
|
||||||
AS_HELP_STRING([--enable-benchmark],[compile benchmark [default=yes]]),
|
AS_HELP_STRING([--enable-benchmark],[compile benchmark [default=yes]]), [],
|
||||||
[use_benchmark=$enableval],
|
[SECP_SET_DEFAULT([enable_benchmark], [yes], [yes])])
|
||||||
[use_benchmark=yes])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(coverage,
|
AC_ARG_ENABLE(coverage,
|
||||||
AS_HELP_STRING([--enable-coverage],[enable compiler flags to support kcov coverage analysis [default=no]]),
|
AS_HELP_STRING([--enable-coverage],[enable compiler flags to support kcov coverage analysis [default=no]]), [],
|
||||||
[enable_coverage=$enableval],
|
[SECP_SET_DEFAULT([enable_coverage], [no], [no])])
|
||||||
[enable_coverage=no])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(tests,
|
AC_ARG_ENABLE(tests,
|
||||||
AS_HELP_STRING([--enable-tests],[compile tests [default=yes]]),
|
AS_HELP_STRING([--enable-tests],[compile tests [default=yes]]), [],
|
||||||
[use_tests=$enableval],
|
[SECP_SET_DEFAULT([enable_tests], [yes], [yes])])
|
||||||
[use_tests=yes])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(experimental,
|
AC_ARG_ENABLE(experimental,
|
||||||
AS_HELP_STRING([--enable-experimental],[allow experimental configure options [default=no]]),
|
AS_HELP_STRING([--enable-experimental],[allow experimental configure options [default=no]]), [],
|
||||||
[use_experimental=$enableval],
|
[SECP_SET_DEFAULT([enable_experimental], [no], [yes])])
|
||||||
[use_experimental=no])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(exhaustive_tests,
|
AC_ARG_ENABLE(exhaustive_tests,
|
||||||
AS_HELP_STRING([--enable-exhaustive-tests],[compile exhaustive tests [default=yes]]),
|
AS_HELP_STRING([--enable-exhaustive-tests],[compile exhaustive tests [default=yes]]), [],
|
||||||
[use_exhaustive_tests=$enableval],
|
[SECP_SET_DEFAULT([enable_exhaustive_tests], [yes], [yes])])
|
||||||
[use_exhaustive_tests=yes])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(examples,
|
AC_ARG_ENABLE(examples,
|
||||||
AS_HELP_STRING([--enable-examples],[compile the examples [default=no]]),
|
AS_HELP_STRING([--enable-examples],[compile the examples [default=no]]), [],
|
||||||
[use_examples=$enableval],
|
[SECP_SET_DEFAULT([enable_examples], [no], [yes])])
|
||||||
[use_examples=no])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(module_ecdh,
|
AC_ARG_ENABLE(module_ecdh,
|
||||||
AS_HELP_STRING([--enable-module-ecdh],[enable ECDH shared secret computation]),
|
AS_HELP_STRING([--enable-module-ecdh],[enable ECDH shared secret computation]), [],
|
||||||
[enable_module_ecdh=$enableval],
|
[SECP_SET_DEFAULT([enable_module_ecdh], [no], [yes])])
|
||||||
[enable_module_ecdh=no])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(module_recovery,
|
AC_ARG_ENABLE(module_recovery,
|
||||||
AS_HELP_STRING([--enable-module-recovery],[enable ECDSA pubkey recovery module [default=no]]),
|
AS_HELP_STRING([--enable-module-recovery],[enable ECDSA pubkey recovery module [default=no]]), [],
|
||||||
[enable_module_recovery=$enableval],
|
[SECP_SET_DEFAULT([enable_module_recovery], [no], [yes])])
|
||||||
[enable_module_recovery=no])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(module_extrakeys,
|
AC_ARG_ENABLE(module_extrakeys,
|
||||||
AS_HELP_STRING([--enable-module-extrakeys],[enable extrakeys module (experimental)]),
|
AS_HELP_STRING([--enable-module-extrakeys],[enable extrakeys module (experimental)]), [],
|
||||||
[enable_module_extrakeys=$enableval],
|
[SECP_SET_DEFAULT([enable_module_extrakeys], [no], [yes])])
|
||||||
[enable_module_extrakeys=no])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(module_schnorrsig,
|
AC_ARG_ENABLE(module_schnorrsig,
|
||||||
AS_HELP_STRING([--enable-module-schnorrsig],[enable schnorrsig module (experimental)]),
|
AS_HELP_STRING([--enable-module-schnorrsig],[enable schnorrsig module (experimental)]), [],
|
||||||
[enable_module_schnorrsig=$enableval],
|
[SECP_SET_DEFAULT([enable_module_schnorrsig], [no], [yes])])
|
||||||
[enable_module_schnorrsig=no])
|
|
||||||
|
|
||||||
AC_ARG_ENABLE(external_default_callbacks,
|
AC_ARG_ENABLE(external_default_callbacks,
|
||||||
AS_HELP_STRING([--enable-external-default-callbacks],[enable external default callback functions [default=no]]),
|
AS_HELP_STRING([--enable-external-default-callbacks],[enable external default callback functions [default=no]]), [],
|
||||||
[use_external_default_callbacks=$enableval],
|
[SECP_SET_DEFAULT([enable_external_default_callbacks], [no], [no])])
|
||||||
[use_external_default_callbacks=no])
|
|
||||||
|
|
||||||
# Test-only override of the (autodetected by the C code) "widemul" setting.
|
# Test-only override of the (autodetected by the C code) "widemul" setting.
|
||||||
# Legal values are int64 (for [u]int64_t), int128 (for [unsigned] __int128), and auto (the default).
|
# Legal values are int64 (for [u]int64_t), int128 (for [unsigned] __int128), and auto (the default).
|
||||||
|
@ -257,14 +251,14 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Select assembly optimization
|
# Select assembly optimization
|
||||||
use_external_asm=no
|
enable_external_asm=no
|
||||||
|
|
||||||
case $set_asm in
|
case $set_asm in
|
||||||
x86_64)
|
x86_64)
|
||||||
AC_DEFINE(USE_ASM_X86_64, 1, [Define this symbol to enable x86_64 assembly optimizations])
|
AC_DEFINE(USE_ASM_X86_64, 1, [Define this symbol to enable x86_64 assembly optimizations])
|
||||||
;;
|
;;
|
||||||
arm)
|
arm)
|
||||||
use_external_asm=yes
|
enable_external_asm=yes
|
||||||
;;
|
;;
|
||||||
no)
|
no)
|
||||||
;;
|
;;
|
||||||
|
@ -273,7 +267,7 @@ no)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if test x"$use_external_asm" = x"yes"; then
|
if test x"$enable_external_asm" = x"yes"; then
|
||||||
AC_DEFINE(USE_EXTERNAL_ASM, 1, [Define this symbol if an external (non-inline) assembly implementation is used])
|
AC_DEFINE(USE_EXTERNAL_ASM, 1, [Define this symbol if an external (non-inline) assembly implementation is used])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -361,7 +355,7 @@ if test x"$enable_module_extrakeys" = x"yes"; then
|
||||||
AC_DEFINE(ENABLE_MODULE_EXTRAKEYS, 1, [Define this symbol to enable the extrakeys module])
|
AC_DEFINE(ENABLE_MODULE_EXTRAKEYS, 1, [Define this symbol to enable the extrakeys module])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test x"$use_external_default_callbacks" = x"yes"; then
|
if test x"$enable_external_default_callbacks" = x"yes"; then
|
||||||
AC_DEFINE(USE_EXTERNAL_DEFAULT_CALLBACKS, 1, [Define this symbol if an external implementation of the default callbacks is used])
|
AC_DEFINE(USE_EXTERNAL_DEFAULT_CALLBACKS, 1, [Define this symbol if an external implementation of the default callbacks is used])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -400,15 +394,15 @@ AC_SUBST(SECP_TEST_LIBS)
|
||||||
AC_SUBST(SECP_TEST_INCLUDES)
|
AC_SUBST(SECP_TEST_INCLUDES)
|
||||||
AC_SUBST(SECP_CFLAGS)
|
AC_SUBST(SECP_CFLAGS)
|
||||||
AM_CONDITIONAL([ENABLE_COVERAGE], [test x"$enable_coverage" = x"yes"])
|
AM_CONDITIONAL([ENABLE_COVERAGE], [test x"$enable_coverage" = x"yes"])
|
||||||
AM_CONDITIONAL([USE_TESTS], [test x"$use_tests" != x"no"])
|
AM_CONDITIONAL([USE_TESTS], [test x"$enable_tests" != x"no"])
|
||||||
AM_CONDITIONAL([USE_EXHAUSTIVE_TESTS], [test x"$use_exhaustive_tests" != x"no"])
|
AM_CONDITIONAL([USE_EXHAUSTIVE_TESTS], [test x"$enable_exhaustive_tests" != x"no"])
|
||||||
AM_CONDITIONAL([USE_EXAMPLES], [test x"$use_examples" != x"no"])
|
AM_CONDITIONAL([USE_EXAMPLES], [test x"$enable_examples" != x"no"])
|
||||||
AM_CONDITIONAL([USE_BENCHMARK], [test x"$use_benchmark" = x"yes"])
|
AM_CONDITIONAL([USE_BENCHMARK], [test x"$enable_benchmark" = x"yes"])
|
||||||
AM_CONDITIONAL([ENABLE_MODULE_ECDH], [test x"$enable_module_ecdh" = x"yes"])
|
AM_CONDITIONAL([ENABLE_MODULE_ECDH], [test x"$enable_module_ecdh" = x"yes"])
|
||||||
AM_CONDITIONAL([ENABLE_MODULE_RECOVERY], [test x"$enable_module_recovery" = x"yes"])
|
AM_CONDITIONAL([ENABLE_MODULE_RECOVERY], [test x"$enable_module_recovery" = x"yes"])
|
||||||
AM_CONDITIONAL([ENABLE_MODULE_EXTRAKEYS], [test x"$enable_module_extrakeys" = x"yes"])
|
AM_CONDITIONAL([ENABLE_MODULE_EXTRAKEYS], [test x"$enable_module_extrakeys" = x"yes"])
|
||||||
AM_CONDITIONAL([ENABLE_MODULE_SCHNORRSIG], [test x"$enable_module_schnorrsig" = x"yes"])
|
AM_CONDITIONAL([ENABLE_MODULE_SCHNORRSIG], [test x"$enable_module_schnorrsig" = x"yes"])
|
||||||
AM_CONDITIONAL([USE_EXTERNAL_ASM], [test x"$use_external_asm" = x"yes"])
|
AM_CONDITIONAL([USE_EXTERNAL_ASM], [test x"$enable_external_asm" = x"yes"])
|
||||||
AM_CONDITIONAL([USE_ASM_ARM], [test x"$set_asm" = x"arm"])
|
AM_CONDITIONAL([USE_ASM_ARM], [test x"$set_asm" = x"arm"])
|
||||||
AM_CONDITIONAL([BUILD_WINDOWS], [test "$build_windows" = "yes"])
|
AM_CONDITIONAL([BUILD_WINDOWS], [test "$build_windows" = "yes"])
|
||||||
AC_SUBST(LIB_VERSION_CURRENT, _LIB_VERSION_CURRENT)
|
AC_SUBST(LIB_VERSION_CURRENT, _LIB_VERSION_CURRENT)
|
||||||
|
@ -424,11 +418,11 @@ AC_OUTPUT
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "Build Options:"
|
echo "Build Options:"
|
||||||
echo " with external callbacks = $use_external_default_callbacks"
|
echo " with external callbacks = $enable_external_default_callbacks"
|
||||||
echo " with benchmarks = $use_benchmark"
|
echo " with benchmarks = $enable_benchmark"
|
||||||
echo " with tests = $use_tests"
|
echo " with tests = $enable_tests"
|
||||||
echo " with coverage = $enable_coverage"
|
echo " with coverage = $enable_coverage"
|
||||||
echo " with examples = $use_examples"
|
echo " with examples = $enable_examples"
|
||||||
echo " module ecdh = $enable_module_ecdh"
|
echo " module ecdh = $enable_module_ecdh"
|
||||||
echo " module recovery = $enable_module_recovery"
|
echo " module recovery = $enable_module_recovery"
|
||||||
echo " module extrakeys = $enable_module_extrakeys"
|
echo " module extrakeys = $enable_module_extrakeys"
|
||||||
|
|
Loading…
Reference in New Issue