Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
251enable_valgrind=yes252fi253fi255if test x"$enable_ctime_tests" = x"auto"; then256enable_ctime_tests=$enable_valgrind257fi259print_msan_notice=no260if test x"$enable_ctime_tests" = x"yes"; then261SECP_MSAN_CHECK262# MSan on Clang >=16 reports uninitialized memory in function parameters and return values, even if263# the uninitialized variable is never actually "used". This is called "eager" checking, and it's264# sounds like good idea for normal use of MSan. However, it yields many false positives in the265# ctime_tests because many return values depend on secret (i.e., "uninitialized") values, and266# we're only interested in detecting branches (which count as "uses") on secret data.267if test x"$msan_enabled" = x"yes"; then268SECP_TRY_APPEND_CFLAGS([-fno-sanitize-memory-param-retval], SECP_CFLAGS)269print_msan_notice=yes270fi271fi273if test x"$enable_coverage" = x"yes"; then274SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DCOVERAGE=1"275SECP_CFLAGS="-O0 --coverage $SECP_CFLAGS"276# If coverage is enabled, and the user has not overridden CFLAGS,277# override Autoconf's value "-g -O2" with "-g". Otherwise we'd end up278# with "-O0 --coverage -g -O2".279if test "$CFLAGS_overridden" = "no"; then280CFLAGS="-g"281fi282LDFLAGS="--coverage $LDFLAGS"283else284# Most likely the CFLAGS already contain -O2 because that is autoconf's default.285# We still add it here because passing it twice is not an issue, and handling286# this case would just add unnecessary complexity (see #896).287SECP_CFLAGS="-O2 $SECP_CFLAGS"288fi290if test x"$req_asm" = x"auto"; then291SECP_X86_64_ASM_CHECK292if test x"$has_x86_64_asm" = x"yes"; then293set_asm=x86_64294fi295if test x"$set_asm" = x; then296set_asm=no297fi298else299set_asm=$req_asm300case $set_asm in301x86_64)302SECP_X86_64_ASM_CHECK303if test x"$has_x86_64_asm" != x"yes"; then304AC_MSG_ERROR([x86_64 assembly requested but not available])305fi306;;307arm32)308SECP_ARM32_ASM_CHECK309if test x"$has_arm32_asm" != x"yes"; then310AC_MSG_ERROR([ARM32 assembly requested but not available])311fi312;;313no)314;;315*)316AC_MSG_ERROR([invalid assembly selection])317;;318esac319fi321# Select assembly322enable_external_asm=no324case $set_asm in325x86_64)326SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DUSE_ASM_X86_64=1"327;;328arm32)329enable_external_asm=yes330;;331no)332;;333*)334AC_MSG_ERROR([invalid assembly selection])335;;336esac338if test x"$enable_external_asm" = x"yes"; then339SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DUSE_EXTERNAL_ASM=1"340fi343# Select wide multiplication implementation344case $set_widemul in345int128_struct)346SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DUSE_FORCE_WIDEMUL_INT128_STRUCT=1"347;;348int128)349SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DUSE_FORCE_WIDEMUL_INT128=1"350;;351int64)352SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DUSE_FORCE_WIDEMUL_INT64=1"353;;354auto)355;;356*)357AC_MSG_ERROR([invalid wide multiplication implementation])358;;359esac361error_window_size=['window size for ecmult precomputation not an integer in range [2..24]']362case $set_ecmult_window in363''|*[[!0-9]]*)364# no valid integer365AC_MSG_ERROR($error_window_size)366;;367*)368if test "$set_ecmult_window" -lt 2 -o "$set_ecmult_window" -gt 24 ; then369# not in range370AC_MSG_ERROR($error_window_size)371fi372SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DECMULT_WINDOW_SIZE=$set_ecmult_window"373;;374esac376case $set_ecmult_gen_kb in3772)378SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DCOMB_BLOCKS=2 -DCOMB_TEETH=5"379;;38022)381SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DCOMB_BLOCKS=11 -DCOMB_TEETH=6"382;;38386)384SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DCOMB_BLOCKS=43 -DCOMB_TEETH=6"385;;386*)387AC_MSG_ERROR(['ecmult gen table size not 2, 22 or 86'])388;;389esac391if test x"$enable_valgrind" = x"yes"; then392SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES $VALGRIND_CPPFLAGS -DVALGRIND"393fi395# Add -Werror and similar flags passed from the outside (for testing, e.g., in CI).396# We don't want to set the user variable CFLAGS in CI because this would disable397# autoconf's logic for setting default CFLAGS, which we would like to test in CI.398SECP_CFLAGS="$SECP_CFLAGS $WERROR_CFLAGS"400###401### Handle module options402###404# Processing must be done in a reverse topological sorting of the dependency graph405# (dependent module first).406if test x"$enable_module_silentpayments" = x"yes"; then407if test x"$enable_module_extrakeys" = x"no"; then408AC_MSG_ERROR([Module dependency error: You have disabled the extrakeys module explicitly, but it is required by the silentpayments module.])409fi410enable_module_extrakeys=yes411SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DENABLE_MODULE_SILENTPAYMENTS=1"412fi414if test x"$enable_module_ellswift" = x"yes"; then415SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DENABLE_MODULE_ELLSWIFT=1"416fi418if test x"$enable_module_musig" = x"yes"; then419if test x"$enable_module_schnorrsig" = x"no"; then420AC_MSG_ERROR([Module dependency error: You have disabled the schnorrsig module explicitly, but it is required by the musig module.])421fi422enable_module_schnorrsig=yes423SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DENABLE_MODULE_MUSIG=1"424fi426if test x"$enable_module_schnorrsig" = x"yes"; then427if test x"$enable_module_extrakeys" = x"no"; then428AC_MSG_ERROR([Module dependency error: You have disabled the extrakeys module explicitly, but it is required by the schnorrsig module.])429fi430enable_module_extrakeys=yes431SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DENABLE_MODULE_SCHNORRSIG=1"432fi434if test x"$enable_module_extrakeys" = x"yes"; then435SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DENABLE_MODULE_EXTRAKEYS=1"436fi438if test x"$enable_module_recovery" = x"yes"; then439SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DENABLE_MODULE_RECOVERY=1"440fi442if test x"$enable_module_ecdh" = x"yes"; then443SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DENABLE_MODULE_ECDH=1"444fi446if test x"$enable_external_default_callbacks" = x"yes"; then447SECP_CONFIG_DEFINES="$SECP_CONFIG_DEFINES -DUSE_EXTERNAL_DEFAULT_CALLBACKS=1"448fi450###451### Check for --enable-experimental if necessary452###454if test x"$enable_experimental" = x"no"; then455if test x"$set_asm" = x"arm32"; then456AC_MSG_ERROR([ARM32 assembly is experimental. Use --enable-experimental to allow.])457fi458fi460# Check for concurrency support (tests only)461if test "x$enable_tests" != x"no"; then462AC_CHECK_HEADERS([sys/types.h sys/wait.h unistd.h])463AS_IF([test "x$ac_cv_header_sys_types_h" = xyes && test "x$ac_cv_header_sys_wait_h" = xyes &&464test "x$ac_cv_header_unistd_h" = xyes], [TEST_DEFINES="-DSUPPORTS_CONCURRENCY=1"], TEST_DEFINES="")465AC_SUBST(TEST_DEFINES)466fi468###469### Generate output470###472AC_CONFIG_FILES([Makefile libsecp256k1.pc])473AC_SUBST(SECP_CFLAGS)474AC_SUBST(SECP_CONFIG_DEFINES)475AM_CONDITIONAL([ENABLE_COVERAGE], [test x"$enable_coverage" = x"yes"])476AM_CONDITIONAL([USE_TESTS], [test x"$enable_tests" != x"no"])477AM_CONDITIONAL([USE_CTIME_TESTS], [test x"$enable_ctime_tests" = x"yes"])478AM_CONDITIONAL([USE_EXHAUSTIVE_TESTS], [test x"$enable_exhaustive_tests" != x"no"])479AM_CONDITIONAL([USE_EXAMPLES], [test x"$enable_examples" != x"no"])480AM_CONDITIONAL([USE_BENCHMARK], [test x"$enable_benchmark" = x"yes"])481AM_CONDITIONAL([ENABLE_MODULE_ECDH], [test x"$enable_module_ecdh" = x"yes"])482AM_CONDITIONAL([ENABLE_MODULE_RECOVERY], [test x"$enable_module_recovery" = x"yes"])483AM_CONDITIONAL([ENABLE_MODULE_EXTRAKEYS], [test x"$enable_module_extrakeys" = x"yes"])484AM_CONDITIONAL([ENABLE_MODULE_SCHNORRSIG], [test x"$enable_module_schnorrsig" = x"yes"])485AM_CONDITIONAL([ENABLE_MODULE_MUSIG], [test x"$enable_module_musig" = x"yes"])486AM_CONDITIONAL([ENABLE_MODULE_ELLSWIFT], [test x"$enable_module_ellswift" = x"yes"])487AM_CONDITIONAL([ENABLE_MODULE_SILENTPAYMENTS], [test x"$enable_module_silentpayments" = x"yes"])488AM_CONDITIONAL([USE_EXTERNAL_ASM], [test x"$enable_external_asm" = x"yes"])489AM_CONDITIONAL([USE_ASM_ARM], [test x"$set_asm" = x"arm32"])490AM_CONDITIONAL([BUILD_WINDOWS], [test "$build_windows" = "yes"])491AC_SUBST(LIB_VERSION_CURRENT, _LIB_VERSION_CURRENT)492AC_SUBST(LIB_VERSION_REVISION, _LIB_VERSION_REVISION)493AC_SUBST(LIB_VERSION_AGE, _LIB_VERSION_AGE)495AC_OUTPUT497echo498echo "Build Options:"499echo " with external callbacks = $enable_external_default_callbacks"500echo " with benchmarks = $enable_benchmark"
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.