Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/configure.ac
Show First 20 Lines • Show All 145 Lines • ▼ Show 20 Lines | AC_ARG_ENABLE(module_schnorr, | ||||
[enable_module_schnorr=$enableval], | [enable_module_schnorr=$enableval], | ||||
[enable_module_schnorr=yes]) | [enable_module_schnorr=yes]) | ||||
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], | [use_external_default_callbacks=$enableval], | ||||
[use_external_default_callbacks=no]) | [use_external_default_callbacks=no]) | ||||
dnl Test-only override of the (autodetected by the C code) "widemul" setting. | |||||
dnl Legal values are int64 (for [u]int64_t), int128 (for [unsigned] __int128), and auto (the default). | |||||
AC_ARG_WITH([test-override-wide-multiply], [] ,[set_widemul=$withval], [set_widemul=auto]) | |||||
AC_ARG_ENABLE(jni, | AC_ARG_ENABLE(jni, | ||||
AS_HELP_STRING([--enable-jni],[enable libsecp256k1_jni [default=no]]), | AS_HELP_STRING([--enable-jni],[enable libsecp256k1_jni [default=no]]), | ||||
[use_jni=$enableval], | [use_jni=$enableval], | ||||
[use_jni=no]) | [use_jni=no]) | ||||
AC_ARG_WITH([field], [AS_HELP_STRING([--with-field=64bit|32bit|auto], | |||||
[finite field implementation to use [default=auto]])],[req_field=$withval], [req_field=auto]) | |||||
AC_ARG_WITH([bignum], [AS_HELP_STRING([--with-bignum=gmp|no|auto], | AC_ARG_WITH([bignum], [AS_HELP_STRING([--with-bignum=gmp|no|auto], | ||||
[bignum implementation to use [default=auto]])],[req_bignum=$withval], [req_bignum=auto]) | [bignum implementation to use [default=auto]])],[req_bignum=$withval], [req_bignum=auto]) | ||||
AC_ARG_WITH([scalar], [AS_HELP_STRING([--with-scalar=64bit|32bit|auto], | |||||
[scalar implementation to use [default=auto]])],[req_scalar=$withval], [req_scalar=auto]) | |||||
AC_ARG_WITH([asm], [AS_HELP_STRING([--with-asm=x86_64|arm|no|auto], | AC_ARG_WITH([asm], [AS_HELP_STRING([--with-asm=x86_64|arm|no|auto], | ||||
[assembly optimizations to use (experimental: arm) [default=auto]])],[req_asm=$withval], [req_asm=auto]) | [assembly optimizations to use (experimental: arm) [default=auto]])],[req_asm=$withval], [req_asm=auto]) | ||||
AC_ARG_WITH([ecmult-window], [AS_HELP_STRING([--with-ecmult-window=SIZE|auto], | AC_ARG_WITH([ecmult-window], [AS_HELP_STRING([--with-ecmult-window=SIZE|auto], | ||||
[window size for ecmult precomputation for verification, specified as integer in range [2..24].] | [window size for ecmult precomputation for verification, specified as integer in range [2..24].] | ||||
[Larger values result in possibly better performance at the cost of an exponentially larger precomputed table.] | [Larger values result in possibly better performance at the cost of an exponentially larger precomputed table.] | ||||
[The table will store 2^(SIZE-2) * 64 bytes of data but can be larger in memory due to platform-specific padding and alignment.] | [The table will store 2^(SIZE-2) * 64 bytes of data but can be larger in memory due to platform-specific padding and alignment.] | ||||
[If the endomorphism optimization is enabled, two tables of this size are used instead of only one.] | [If the endomorphism optimization is enabled, two tables of this size are used instead of only one.] | ||||
["auto" is a reasonable setting for desktop machines (currently 15). [default=auto]] | ["auto" is a reasonable setting for desktop machines (currently 15). [default=auto]] | ||||
)], | )], | ||||
[req_ecmult_window=$withval], [req_ecmult_window=auto]) | [req_ecmult_window=$withval], [req_ecmult_window=auto]) | ||||
AC_ARG_WITH([ecmult-gen-precision], [AS_HELP_STRING([--with-ecmult-gen-precision=2|4|8|auto], | AC_ARG_WITH([ecmult-gen-precision], [AS_HELP_STRING([--with-ecmult-gen-precision=2|4|8|auto], | ||||
[Precision bits to tune the precomputed table size for signing.] | [Precision bits to tune the precomputed table size for signing.] | ||||
[The size of the table is 32kB for 2 bits, 64kB for 4 bits, 512kB for 8 bits of precision.] | [The size of the table is 32kB for 2 bits, 64kB for 4 bits, 512kB for 8 bits of precision.] | ||||
[A larger table size usually results in possible faster signing.] | [A larger table size usually results in possible faster signing.] | ||||
["auto" is a reasonable setting for desktop machines (currently 4). [default=auto]] | ["auto" is a reasonable setting for desktop machines (currently 4). [default=auto]] | ||||
)], | )], | ||||
[req_ecmult_gen_precision=$withval], [req_ecmult_gen_precision=auto]) | [req_ecmult_gen_precision=$withval], [req_ecmult_gen_precision=auto]) | ||||
AC_CHECK_TYPES([__int128]) | |||||
AC_ARG_WITH([valgrind], [AS_HELP_STRING([--with-valgrind=yes|no|auto], | AC_ARG_WITH([valgrind], [AS_HELP_STRING([--with-valgrind=yes|no|auto], | ||||
[Build with extra checks for running inside Valgrind [default=auto]] | [Build with extra checks for running inside Valgrind [default=auto]] | ||||
)], | )], | ||||
[req_valgrind=$withval], [req_valgrind=auto]) | [req_valgrind=$withval], [req_valgrind=auto]) | ||||
if test x"$req_valgrind" = x"no"; then | if test x"$req_valgrind" = x"no"; then | ||||
enable_valgrind=no | enable_valgrind=no | ||||
else | else | ||||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | else | ||||
no) | no) | ||||
;; | ;; | ||||
*) | *) | ||||
AC_MSG_ERROR([invalid assembly optimization selection]) | AC_MSG_ERROR([invalid assembly optimization selection]) | ||||
;; | ;; | ||||
esac | esac | ||||
fi | fi | ||||
if test x"$req_field" = x"auto"; then | |||||
if test x"set_asm" = x"x86_64"; then | |||||
set_field=64bit | |||||
fi | |||||
if test x"$set_field" = x; then | |||||
SECP_INT128_CHECK | |||||
if test x"$has_int128" = x"yes"; then | |||||
set_field=64bit | |||||
fi | |||||
fi | |||||
if test x"$set_field" = x; then | |||||
set_field=32bit | |||||
fi | |||||
else | |||||
set_field=$req_field | |||||
case $set_field in | |||||
64bit) | |||||
if test x"$set_asm" != x"x86_64"; then | |||||
SECP_INT128_CHECK | |||||
if test x"$has_int128" != x"yes"; then | |||||
AC_MSG_ERROR([64bit field explicitly requested but neither __int128 support or x86_64 assembly available]) | |||||
fi | |||||
fi | |||||
;; | |||||
32bit) | |||||
;; | |||||
*) | |||||
AC_MSG_ERROR([invalid field implementation selection]) | |||||
;; | |||||
esac | |||||
fi | |||||
if test x"$req_scalar" = x"auto"; then | |||||
SECP_INT128_CHECK | |||||
if test x"$has_int128" = x"yes"; then | |||||
set_scalar=64bit | |||||
fi | |||||
if test x"$set_scalar" = x; then | |||||
set_scalar=32bit | |||||
fi | |||||
else | |||||
set_scalar=$req_scalar | |||||
case $set_scalar in | |||||
64bit) | |||||
SECP_INT128_CHECK | |||||
if test x"$has_int128" != x"yes"; then | |||||
AC_MSG_ERROR([64bit scalar explicitly requested but __int128 support not available]) | |||||
fi | |||||
;; | |||||
32bit) | |||||
;; | |||||
*) | |||||
AC_MSG_ERROR([invalid scalar implementation selected]) | |||||
;; | |||||
esac | |||||
fi | |||||
if test x"$req_bignum" = x"auto"; then | if test x"$req_bignum" = x"auto"; then | ||||
SECP_GMP_CHECK | SECP_GMP_CHECK | ||||
if test x"$has_gmp" = x"yes"; then | if test x"$has_gmp" = x"yes"; then | ||||
set_bignum=gmp | set_bignum=gmp | ||||
fi | fi | ||||
if test x"$set_bignum" = x; then | if test x"$set_bignum" = x; then | ||||
set_bignum=no | set_bignum=no | ||||
Show All 27 Lines | arm) | ||||
;; | ;; | ||||
no) | no) | ||||
;; | ;; | ||||
*) | *) | ||||
AC_MSG_ERROR([invalid assembly optimizations]) | AC_MSG_ERROR([invalid assembly optimizations]) | ||||
;; | ;; | ||||
esac | esac | ||||
# select field implementation | # select wide multiplication implementation | ||||
case $set_field in | case $set_widemul in | ||||
64bit) | int128) | ||||
AC_DEFINE(USE_FIELD_5X52, 1, [Define this symbol to use the FIELD_5X52 implementation]) | AC_DEFINE(USE_FORCE_WIDEMUL_INT128, 1, [Define this symbol to force the use of the (unsigned) __int128 based wide multiplication implementation]) | ||||
;; | |||||
int64) | |||||
AC_DEFINE(USE_FORCE_WIDEMUL_INT64, 1, [Define this symbol to force the use of the (u)int64_t based wide multiplication implementation]) | |||||
;; | ;; | ||||
32bit) | auto) | ||||
AC_DEFINE(USE_FIELD_10X26, 1, [Define this symbol to use the FIELD_10X26 implementation]) | |||||
;; | ;; | ||||
*) | *) | ||||
AC_MSG_ERROR([invalid field implementation]) | AC_MSG_ERROR([invalid wide multiplication implementation]) | ||||
;; | ;; | ||||
esac | esac | ||||
# select bignum implementation | # select bignum implementation | ||||
case $set_bignum in | case $set_bignum in | ||||
gmp) | gmp) | ||||
AC_DEFINE(HAVE_LIBGMP, 1, [Define this symbol if libgmp is installed]) | AC_DEFINE(HAVE_LIBGMP, 1, [Define this symbol if libgmp is installed]) | ||||
AC_DEFINE(USE_NUM_GMP, 1, [Define this symbol to use the gmp implementation for num]) | AC_DEFINE(USE_NUM_GMP, 1, [Define this symbol to use the gmp implementation for num]) | ||||
AC_DEFINE(USE_FIELD_INV_NUM, 1, [Define this symbol to use the num-based field inverse implementation]) | AC_DEFINE(USE_FIELD_INV_NUM, 1, [Define this symbol to use the num-based field inverse implementation]) | ||||
AC_DEFINE(USE_SCALAR_INV_NUM, 1, [Define this symbol to use the num-based scalar inverse implementation]) | AC_DEFINE(USE_SCALAR_INV_NUM, 1, [Define this symbol to use the num-based scalar inverse implementation]) | ||||
;; | ;; | ||||
no) | no) | ||||
AC_DEFINE(USE_NUM_NONE, 1, [Define this symbol to use no num implementation]) | AC_DEFINE(USE_NUM_NONE, 1, [Define this symbol to use no num implementation]) | ||||
AC_DEFINE(USE_FIELD_INV_BUILTIN, 1, [Define this symbol to use the native field inverse implementation]) | AC_DEFINE(USE_FIELD_INV_BUILTIN, 1, [Define this symbol to use the native field inverse implementation]) | ||||
AC_DEFINE(USE_SCALAR_INV_BUILTIN, 1, [Define this symbol to use the native scalar inverse implementation]) | AC_DEFINE(USE_SCALAR_INV_BUILTIN, 1, [Define this symbol to use the native scalar inverse implementation]) | ||||
;; | ;; | ||||
*) | *) | ||||
AC_MSG_ERROR([invalid bignum implementation]) | AC_MSG_ERROR([invalid bignum implementation]) | ||||
;; | ;; | ||||
esac | esac | ||||
#select scalar implementation | |||||
case $set_scalar in | |||||
64bit) | |||||
AC_DEFINE(USE_SCALAR_4X64, 1, [Define this symbol to use the 4x64 scalar implementation]) | |||||
;; | |||||
32bit) | |||||
AC_DEFINE(USE_SCALAR_8X32, 1, [Define this symbol to use the 8x32 scalar implementation]) | |||||
;; | |||||
*) | |||||
AC_MSG_ERROR([invalid scalar implementation]) | |||||
;; | |||||
esac | |||||
#set ecmult window size | #set ecmult window size | ||||
if test x"$req_ecmult_window" = x"auto"; then | if test x"$req_ecmult_window" = x"auto"; then | ||||
set_ecmult_window=15 | set_ecmult_window=15 | ||||
else | else | ||||
set_ecmult_window=$req_ecmult_window | set_ecmult_window=$req_ecmult_window | ||||
fi | fi | ||||
error_window_size=['window size for ecmult precomputation not an integer in range [2..24] or "auto"'] | error_window_size=['window size for ecmult precomputation not an integer in range [2..24] or "auto"'] | ||||
▲ Show 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | |||||
echo " with coverage = $enable_coverage" | echo " with coverage = $enable_coverage" | ||||
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 multiset = $enable_module_multiset" | echo " module multiset = $enable_module_multiset" | ||||
echo " module schnorr = $enable_module_schnorr" | echo " module schnorr = $enable_module_schnorr" | ||||
echo | echo | ||||
echo " asm = $set_asm" | echo " asm = $set_asm" | ||||
echo " bignum = $set_bignum" | echo " bignum = $set_bignum" | ||||
echo " field = $set_field" | |||||
echo " scalar = $set_scalar" | |||||
echo " ecmult window size = $set_ecmult_window" | echo " ecmult window size = $set_ecmult_window" | ||||
echo " ecmult gen prec. bits = $set_ecmult_gen_precision" | echo " ecmult gen prec. bits = $set_ecmult_gen_precision" | ||||
dnl Hide test-only options unless they're used. | |||||
if test x"$set_widemul" != xauto; then | |||||
echo " wide multiplication = $set_widemul" | |||||
fi | |||||
echo | echo | ||||
echo " valgrind = $enable_valgrind" | echo " valgrind = $enable_valgrind" | ||||
echo " CC = $CC" | echo " CC = $CC" | ||||
echo " CFLAGS = $CFLAGS" | echo " CFLAGS = $CFLAGS" | ||||
echo " CPPFLAGS = $CPPFLAGS" | echo " CPPFLAGS = $CPPFLAGS" | ||||
echo " LDFLAGS = $LDFLAGS" | echo " LDFLAGS = $LDFLAGS" | ||||
echo | echo |