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.
1dnl escape "$0x" below using the m4 quadrigaph @S|@, and escape it again with a \ for the shell.2AC_DEFUN([SECP_X86_64_ASM_CHECK],[3AC_MSG_CHECKING(for x86_64 assembly availability)4AC_LINK_IFELSE([AC_LANG_PROGRAM([[5#include <stdint.h>]],[[6uint64_t a = 11, tmp = 0;7__asm__ __volatile__("movq \@S|@0x100000000,%1; mulq %%rsi" : "+a"(a) : "S"(tmp) : "cc", "%rdx");8]])], [has_x86_64_asm=yes], [has_x86_64_asm=no])9AC_MSG_RESULT([$has_x86_64_asm])10])12AC_DEFUN([SECP_ARM32_ASM_CHECK], [13AC_MSG_CHECKING(for ARM32 assembly availability)14SECP_ARM32_ASM_CHECK_CFLAGS_saved_CFLAGS="$CFLAGS"15CFLAGS="-x assembler"16AC_LINK_IFELSE([AC_LANG_SOURCE([[17.syntax unified18.eabi_attribute 24, 119.eabi_attribute 25, 120.text21.global main22main:23ldr r0, =0x002A24mov r7, #125swi 026]])], [has_arm32_asm=yes], [has_arm32_asm=no])27AC_MSG_RESULT([$has_arm32_asm])28CFLAGS="$SECP_ARM32_ASM_CHECK_CFLAGS_saved_CFLAGS"29])31AC_DEFUN([SECP_VALGRIND_CHECK],[32AC_MSG_CHECKING([for valgrind support])33if test x"$has_valgrind" != x"yes"; then34CPPFLAGS_TEMP="$CPPFLAGS"35CPPFLAGS="$VALGRIND_CPPFLAGS $CPPFLAGS"36AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[37#include <valgrind/memcheck.h>38]], [[39#if defined(NVALGRIND)40# error "Valgrind does not support this platform."41#endif42]])], [has_valgrind=yes])43CPPFLAGS="$CPPFLAGS_TEMP"44fi45AC_MSG_RESULT($has_valgrind)46])48AC_DEFUN([SECP_MSAN_CHECK], [49AC_MSG_CHECKING(whether MemorySanitizer is enabled)50AC_COMPILE_IFELSE([AC_LANG_SOURCE([[51#if defined(__has_feature)52# if __has_feature(memory_sanitizer)53/* MemorySanitizer is enabled. */54# elif55# error "MemorySanitizer is disabled."56# endif57#else58# error "__has_feature is not defined."59#endif60]])], [msan_enabled=yes], [msan_enabled=no])61AC_MSG_RESULT([$msan_enabled])62])64dnl SECP_TRY_APPEND_CFLAGS(flags, VAR)65dnl Append flags to VAR if CC accepts them.66AC_DEFUN([SECP_TRY_APPEND_CFLAGS], [67AC_MSG_CHECKING([if ${CC} supports $1])68SECP_TRY_APPEND_CFLAGS_saved_CFLAGS="$CFLAGS"69CFLAGS="$1 $CFLAGS"70AC_COMPILE_IFELSE([AC_LANG_SOURCE([[char foo;]])], [flag_works=yes], [flag_works=no])71AC_MSG_RESULT($flag_works)72CFLAGS="$SECP_TRY_APPEND_CFLAGS_saved_CFLAGS"73if test x"$flag_works" = x"yes"; then74$2="$$2 $1"75fi76unset flag_works77AC_SUBST($2)78])80dnl SECP_SET_DEFAULT(VAR, default, default-dev-mode)81dnl Set VAR to default or default-dev-mode, depending on whether dev mode is enabled82AC_DEFUN([SECP_SET_DEFAULT], [83if test "${enable_dev_mode+set}" != set; then84AC_MSG_ERROR([[Set enable_dev_mode before calling SECP_SET_DEFAULT]])85fi86if test x"$enable_dev_mode" = x"yes"; then87$1="$3"88else89$1="$2"90fi91])
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.