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.
1AC_INIT([minisketch], [0.0.1], [http://github.com/bitcoin-core/minisketch/])3m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])5AC_PREREQ(2.60)6AC_CONFIG_SRCDIR([src/minisketch.cpp])7AC_CONFIG_AUX_DIR([build-aux])8AC_CONFIG_MACRO_DIR([build-aux/m4])9AM_INIT_AUTOMAKE([subdir-objects foreign])11LT_INIT12LT_LANG([C++])13AC_LANG([C++])15AC_PATH_PROG(CCACHE,ccache)17AC_ARG_ENABLE([ccache],18[AS_HELP_STRING([--disable-ccache],19[do not use ccache for building (default is to use if found)])],20[use_ccache=$enableval],21[use_ccache=auto])23AC_ARG_ENABLE(tests,24AS_HELP_STRING([--enable-tests],[compile tests (default is yes)]),25[use_tests=$enableval],26[use_tests=yes])28AC_ARG_ENABLE(benchmark,29AS_HELP_STRING([--enable-benchmark],[compile benchmark (default is no)]),30[use_benchmark=$enableval],31[use_benchmark=no])33m4_define([SUPPORTED_FIELDS], [2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64])35AC_MSG_CHECKING([which field sizes to build])36AC_ARG_ENABLE([fields], AS_HELP_STRING([--enable-fields=LIST], [Comma-separated list of field sizes to build. Default=all. Available sizes:] m4_translit(m4_defn([SUPPORTED_FIELDS]), [,], [ ])), [], [enable_fields=SUPPORTED_FIELDS])37have_disabled_fields=no38have_enabled_fields=no39m4_foreach([FIELD], [SUPPORTED_FIELDS], [40case ",$enable_fields," in41*,FIELD,*)42have_enabled_fields=yes43;;44*)45AC_DEFINE(DISABLE_FIELD_[]FIELD, [1],46[Define to 1 to remove support for field size] FIELD [.])47have_disabled_fields=yes48;;49esac50])51AC_MSG_RESULT([$enable_fields])52if test "x$have_enabled_fields" = xno; then53AC_MSG_ERROR([No field sizes are enabled.])54fi56AX_CHECK_COMPILE_FLAG([-Werror],[CXXFLAG_WERROR="-Werror"],[CXXFLAG_WERROR=""])58AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory])59enable_clmul=60AX_CHECK_COMPILE_FLAG([-mpclmul],[[enable_clmul=yes]],,[[$CXXFLAG_WERROR]],[AC_LANG_PROGRAM([61#include <stdint.h>62#include <x86intrin.h>63], [64__m128i a = _mm_cvtsi64_si128((uint64_t)7);65__m128i b = _mm_clmulepi64_si128(a, a, 37);66__m128i c = _mm_srli_epi64(b, 41);67__m128i d = _mm_xor_si128(b, c);68uint64_t e = _mm_cvtsi128_si64(d);69return e == 0;70])])71if test x$enable_clmul = xyes; then72CLMUL_CXXFLAGS="-mpclmul"73AC_DEFINE(HAVE_CLMUL, 1, [Define this symbol if clmul instructions can be used])74fi77AC_MSG_CHECKING(for working clz builtins)78AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [79unsigned a = __builtin_clz(1);80unsigned long b = __builtin_clzl(1);81unsigned long long c = __builtin_clzll(1);82])],83[84AC_DEFINE(HAVE_CLZ, 1, [Define this symbol if clz builtins are present and working])85AC_MSG_RESULT(yes)86],[87AC_MSG_RESULT(no)88]89)91AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]],[LDFLAGS="-Wl,--exclude-libs,ALL $LDFLAGS"])93case $host in94*mingw*)95dnl -static is interpreted by libtool, where it has a different meaning.96dnl In libtool-speak, it's -all-static.97AX_CHECK_LINK_FLAG([[-static]],[LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static"])98;;99*)100AX_CHECK_LINK_FLAG([[-static]],[LIBTOOL_APP_LDFLAGS="-static"])101;;102esac104AX_CHECK_COMPILE_FLAG([-Wall],[WARN_CXXFLAGS="$WARN_CXXFLAGS -Wall"],,[[$CXXFLAG_WERROR]])105AX_CHECK_COMPILE_FLAG([-Wundef], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wundef"], [], [$CXXFLAG_WERROR])106AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[CXXFLAGS="$CXXFLAGS -fvisibility=hidden"],[],[$CXXFLAG_WERROR])108if test "x$use_ccache" != "xno"; then109AC_MSG_CHECKING(if ccache should be used)110if test x$CCACHE = x; then111if test "x$use_ccache" = "xyes"; then112AC_MSG_ERROR([ccache not found.]);113else114use_ccache=no115fi116else117use_ccache=yes118CXX="$ac_cv_path_CCACHE $CXX"119fi120AC_MSG_RESULT($use_ccache)121fi123VERIFY_DEFINES=-DMINISKETCH_VERIFY124RELEASE_DEFINES=126AC_CONFIG_FILES([127Makefile128])130AC_SUBST(CLMUL_CXXFLAGS)131AC_SUBST(WARN_CXXFLAGS)132AC_SUBST(NOWARN_CXXFLAGS)133AC_SUBST(VERIFY_DEFINES)134AC_SUBST(RELEASE_DEFINES)135AC_SUBST(LIBTOOL_APP_LDFLAGS)136AM_CONDITIONAL([ENABLE_CLMUL],[test x$enable_clmul = xyes])137AM_CONDITIONAL([USE_BENCHMARK], [test x"$use_benchmark" = x"yes"])138AM_CONDITIONAL([USE_TESTS], [test x"$use_tests" != x"no"])139AC_OUTPUT141echo142echo "Build Options:"143echo " with benchmarks = $use_benchmark"144echo " with tests = $use_tests"145echo " enable clmul fields = $enable_clmul"146echo " CXX = $CXX"147echo " CXXFLAGS = $CXXFLAGS"148echo " CPPFLAGS = $CPPFLAGS"149echo " LDFLAGS = $LDFLAGS"150if test "$have_disabled_fields" = "yes"; then151echo152echo "Only compiling in support for field sizes: $enable_fields"153echo "WARNING: this means the library will lack support for other field sizes entirely"154fi
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.