No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configure.ac 46KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345
  1. dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
  2. AC_PREREQ([2.60])
  3. define(_CLIENT_VERSION_MAJOR, 0)
  4. define(_CLIENT_VERSION_MINOR, 16)
  5. define(_CLIENT_VERSION_REVISION, 1)
  6. define(_CLIENT_VERSION_BUILD, 0)
  7. define(_CLIENT_VERSION_IS_RELEASE, true)
  8. define(_COPYRIGHT_YEAR, 2018)
  9. define(_COPYRIGHT_HOLDERS,[The %s developers])
  10. define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[Starwels]])
  11. AC_INIT([Starwels],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/bitcoin/bitcoin/issues],[starwels],[https://github.com/starwels/])
  12. AC_CONFIG_SRCDIR([src/validation.cpp])
  13. AC_CONFIG_HEADERS([src/config/starwels-config.h])
  14. AC_CONFIG_AUX_DIR([build-aux])
  15. AC_CONFIG_MACRO_DIR([build-aux/m4])
  16. STARWELS_DAEMON_NAME=starwelsd
  17. STARWELS_GUI_NAME=starwels-qt
  18. STARWELS_CLI_NAME=starwels-cli
  19. STARWELS_TX_NAME=starwels-tx
  20. dnl Unless the user specified ARFLAGS, force it to be cr
  21. AC_ARG_VAR(ARFLAGS, [Flags for the archiver, defaults to <cr> if not set])
  22. if test "x${ARFLAGS+set}" != "xset"; then
  23. ARFLAGS="cr"
  24. fi
  25. AC_CANONICAL_HOST
  26. AH_TOP([#ifndef STARWELS_CONFIG_H])
  27. AH_TOP([#define STARWELS_CONFIG_H])
  28. AH_BOTTOM([#endif //STARWELS_CONFIG_H])
  29. dnl faketime breaks configure and is only needed for make. Disable it here.
  30. unset FAKETIME
  31. dnl Automake init set-up and checks
  32. AM_INIT_AUTOMAKE([no-define subdir-objects foreign])
  33. dnl faketime messes with timestamps and causes configure to be re-run.
  34. dnl --disable-maintainer-mode can be used to bypass this.
  35. AM_MAINTAINER_MODE([enable])
  36. dnl make the compilation flags quiet unless V=1 is used
  37. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  38. dnl Compiler checks (here before libtool).
  39. if test "x${CXXFLAGS+set}" = "xset"; then
  40. CXXFLAGS_overridden=yes
  41. else
  42. CXXFLAGS_overridden=no
  43. fi
  44. AC_PROG_CXX
  45. dnl By default, libtool for mingw refuses to link static libs into a dll for
  46. dnl fear of mixing pic/non-pic objects, and import/export complications. Since
  47. dnl we have those under control, re-enable that functionality.
  48. case $host in
  49. *mingw*)
  50. lt_cv_deplibs_check_method="pass_all"
  51. ;;
  52. esac
  53. dnl Require C++11 compiler (no GNU extensions)
  54. AX_CXX_COMPILE_STDCXX([11], [noext], [mandatory], [nodefault])
  55. dnl Check if -latomic is required for <std::atomic>
  56. CHECK_ATOMIC
  57. dnl Unless the user specified OBJCXX, force it to be the same as CXX. This ensures
  58. dnl that we get the same -std flags for both.
  59. m4_ifdef([AC_PROG_OBJCXX],[
  60. if test "x${OBJCXX+set}" = "x"; then
  61. OBJCXX="${CXX}"
  62. fi
  63. AC_PROG_OBJCXX
  64. ])
  65. dnl Libtool init checks.
  66. LT_INIT([pic-only])
  67. dnl Check/return PATH for base programs.
  68. AC_PATH_TOOL(AR, ar)
  69. AC_PATH_TOOL(RANLIB, ranlib)
  70. AC_PATH_TOOL(STRIP, strip)
  71. AC_PATH_TOOL(GCOV, gcov)
  72. AC_PATH_PROG(LCOV, lcov)
  73. dnl Python 3.x is supported from 3.4 on (see https://github.com/bitcoin/bitcoin/issues/7893)
  74. AC_PATH_PROGS([PYTHON], [python3.6 python3.5 python3.4 python3 python2.7 python2 python])
  75. AC_PATH_PROG(GENHTML, genhtml)
  76. AC_PATH_PROG([GIT], [git])
  77. AC_PATH_PROG(CCACHE,ccache)
  78. AC_PATH_PROG(XGETTEXT,xgettext)
  79. AC_PATH_PROG(HEXDUMP,hexdump)
  80. AC_PATH_TOOL(READELF, readelf)
  81. AC_PATH_TOOL(CPPFILT, c++filt)
  82. AC_PATH_TOOL(OBJCOPY, objcopy)
  83. AC_ARG_VAR(PYTHONPATH, Augments the default search path for python module files)
  84. # Enable wallet
  85. AC_ARG_ENABLE([wallet],
  86. [AS_HELP_STRING([--disable-wallet],
  87. [disable wallet (enabled by default)])],
  88. [enable_wallet=$enableval],
  89. [enable_wallet=yes])
  90. AC_ARG_WITH([miniupnpc],
  91. [AS_HELP_STRING([--with-miniupnpc],
  92. [enable UPNP (default is yes if libminiupnpc is found)])],
  93. [use_upnp=$withval],
  94. [use_upnp=auto])
  95. AC_ARG_ENABLE([upnp-default],
  96. [AS_HELP_STRING([--enable-upnp-default],
  97. [if UPNP is enabled, turn it on at startup (default is no)])],
  98. [use_upnp_default=$enableval],
  99. [use_upnp_default=no])
  100. AC_ARG_ENABLE(tests,
  101. AS_HELP_STRING([--disable-tests],[do not compile tests (default is to compile)]),
  102. [use_tests=$enableval],
  103. [use_tests=yes])
  104. AC_ARG_ENABLE(gui-tests,
  105. AS_HELP_STRING([--disable-gui-tests],[do not compile GUI tests (default is to compile if GUI and tests enabled)]),
  106. [use_gui_tests=$enableval],
  107. [use_gui_tests=$use_tests])
  108. AC_ARG_ENABLE(bench,
  109. AS_HELP_STRING([--disable-bench],[do not compile benchmarks (default is to compile)]),
  110. [use_bench=$enableval],
  111. [use_bench=yes])
  112. AC_ARG_ENABLE([extended-functional-tests],
  113. AS_HELP_STRING([--enable-extended-functional-tests],[enable expensive functional tests when using lcov (default no)]),
  114. [use_extended_functional_tests=$enableval],
  115. [use_extended_functional_tests=no])
  116. AC_ARG_WITH([qrencode],
  117. [AS_HELP_STRING([--with-qrencode],
  118. [enable QR code support (default is yes if qt is enabled and libqrencode is found)])],
  119. [use_qr=$withval],
  120. [use_qr=auto])
  121. AC_ARG_ENABLE([hardening],
  122. [AS_HELP_STRING([--disable-hardening],
  123. [do not attempt to harden the resulting executables (default is to harden)])],
  124. [use_hardening=$enableval],
  125. [use_hardening=yes])
  126. AC_ARG_ENABLE([reduce-exports],
  127. [AS_HELP_STRING([--enable-reduce-exports],
  128. [attempt to reduce exported symbols in the resulting executables (default is no)])],
  129. [use_reduce_exports=$enableval],
  130. [use_reduce_exports=no])
  131. AC_ARG_ENABLE([ccache],
  132. [AS_HELP_STRING([--disable-ccache],
  133. [do not use ccache for building (default is to use if found)])],
  134. [use_ccache=$enableval],
  135. [use_ccache=auto])
  136. AC_ARG_ENABLE([lcov],
  137. [AS_HELP_STRING([--enable-lcov],
  138. [enable lcov testing (default is no)])],
  139. [use_lcov=$enableval],
  140. [use_lcov=no])
  141. AC_ARG_ENABLE([lcov-branch-coverage],
  142. [AS_HELP_STRING([--enable-lcov-branch-coverage],
  143. [enable lcov testing branch coverage (default is no)])],
  144. [use_lcov_branch=yes],
  145. [use_lcov_branch=no])
  146. AC_ARG_ENABLE([glibc-back-compat],
  147. [AS_HELP_STRING([--enable-glibc-back-compat],
  148. [enable backwards compatibility with glibc])],
  149. [use_glibc_compat=$enableval],
  150. [use_glibc_compat=no])
  151. AC_ARG_ENABLE([asm],
  152. [AS_HELP_STRING([--enable-asm],
  153. [Enable assembly routines (default is yes)])],
  154. [use_asm=$enableval],
  155. [use_asm=yes])
  156. if test "x$use_asm" = xyes; then
  157. AC_DEFINE(USE_ASM, 1, [Define this symbol to build in assembly routines])
  158. fi
  159. AC_ARG_WITH([system-univalue],
  160. [AS_HELP_STRING([--with-system-univalue],
  161. [Build with system UniValue (default is no)])],
  162. [system_univalue=$withval],
  163. [system_univalue=no]
  164. )
  165. AC_ARG_ENABLE([zmq],
  166. [AS_HELP_STRING([--disable-zmq],
  167. [disable ZMQ notifications])],
  168. [use_zmq=$enableval],
  169. [use_zmq=yes])
  170. AC_ARG_WITH([protoc-bindir],[AS_HELP_STRING([--with-protoc-bindir=BIN_DIR],[specify protoc bin path])], [protoc_bin_path=$withval], [])
  171. AC_ARG_ENABLE(man,
  172. [AS_HELP_STRING([--disable-man],
  173. [do not install man pages (default is to install)])],,
  174. enable_man=yes)
  175. AM_CONDITIONAL(ENABLE_MAN, test "$enable_man" != no)
  176. # Enable debug
  177. AC_ARG_ENABLE([debug],
  178. [AS_HELP_STRING([--enable-debug],
  179. [use debug compiler flags and macros (default is no)])],
  180. [enable_debug=$enableval],
  181. [enable_debug=no])
  182. # Turn warnings into errors
  183. AC_ARG_ENABLE([werror],
  184. [AS_HELP_STRING([--enable-werror],
  185. [Treat certain compiler warnings as errors (default is no)])],
  186. [enable_werror=$enableval],
  187. [enable_werror=no])
  188. AC_LANG_PUSH([C++])
  189. AX_CHECK_COMPILE_FLAG([-Werror],[CXXFLAG_WERROR="-Werror"],[CXXFLAG_WERROR=""])
  190. if test "x$enable_debug" = xyes; then
  191. CPPFLAGS="$CPPFLAGS -DDEBUG -DDEBUG_LOCKORDER"
  192. if test "x$GCC" = xyes; then
  193. CFLAGS="$CFLAGS -g3 -O0"
  194. fi
  195. if test "x$GXX" = xyes; then
  196. CXXFLAGS="$CXXFLAGS -g3 -O0"
  197. fi
  198. fi
  199. ERROR_CXXFLAGS=
  200. if test "x$enable_werror" = "xyes"; then
  201. if test "x$CXXFLAG_WERROR" = "x"; then
  202. AC_MSG_ERROR("enable-werror set but -Werror is not usable")
  203. fi
  204. AX_CHECK_COMPILE_FLAG([-Werror=vla],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=vla"],,[[$CXXFLAG_WERROR]])
  205. AX_CHECK_COMPILE_FLAG([-Werror=thread-safety-analysis],[ERROR_CXXFLAGS="$ERROR_CXXFLAGS -Werror=thread-safety-analysis"],,[[$CXXFLAG_WERROR]])
  206. fi
  207. if test "x$CXXFLAGS_overridden" = "xno"; then
  208. AX_CHECK_COMPILE_FLAG([-Wall],[CXXFLAGS="$CXXFLAGS -Wall"],,[[$CXXFLAG_WERROR]])
  209. AX_CHECK_COMPILE_FLAG([-Wextra],[CXXFLAGS="$CXXFLAGS -Wextra"],,[[$CXXFLAG_WERROR]])
  210. AX_CHECK_COMPILE_FLAG([-Wformat],[CXXFLAGS="$CXXFLAGS -Wformat"],,[[$CXXFLAG_WERROR]])
  211. AX_CHECK_COMPILE_FLAG([-Wvla],[CXXFLAGS="$CXXFLAGS -Wvla"],,[[$CXXFLAG_WERROR]])
  212. AX_CHECK_COMPILE_FLAG([-Wformat-security],[CXXFLAGS="$CXXFLAGS -Wformat-security"],,[[$CXXFLAG_WERROR]])
  213. AX_CHECK_COMPILE_FLAG([-Wthread-safety-analysis],[CXXFLAGS="$CXXFLAGS -Wthread-safety-analysis"],,[[$CXXFLAG_WERROR]])
  214. ## Some compilers (gcc) ignore unknown -Wno-* options, but warn about all
  215. ## unknown options if any other warning is produced. Test the -Wfoo case, and
  216. ## set the -Wno-foo case if it works.
  217. AX_CHECK_COMPILE_FLAG([-Wunused-parameter],[CXXFLAGS="$CXXFLAGS -Wno-unused-parameter"],,[[$CXXFLAG_WERROR]])
  218. AX_CHECK_COMPILE_FLAG([-Wself-assign],[CXXFLAGS="$CXXFLAGS -Wno-self-assign"],,[[$CXXFLAG_WERROR]])
  219. AX_CHECK_COMPILE_FLAG([-Wunused-local-typedef],[CXXFLAGS="$CXXFLAGS -Wno-unused-local-typedef"],,[[$CXXFLAG_WERROR]])
  220. AX_CHECK_COMPILE_FLAG([-Wdeprecated-register],[CXXFLAGS="$CXXFLAGS -Wno-deprecated-register"],,[[$CXXFLAG_WERROR]])
  221. AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough],[CXXFLAGS="$CXXFLAGS -Wno-implicit-fallthrough"],,[[$CXXFLAG_WERROR]])
  222. fi
  223. # Check for optional instruction set support. Enabling these does _not_ imply that all code will
  224. # be compiled with them, rather that specific objects/libs may use them after checking for runtime
  225. # compatibility.
  226. AX_CHECK_COMPILE_FLAG([-msse4.2],[[SSE42_CXXFLAGS="-msse4.2"]],,[[$CXXFLAG_WERROR]])
  227. TEMP_CXXFLAGS="$CXXFLAGS"
  228. CXXFLAGS="$CXXFLAGS $SSE42_CXXFLAGS"
  229. AC_MSG_CHECKING(for assembler crc32 support)
  230. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  231. #include <stdint.h>
  232. #if defined(_MSC_VER)
  233. #include <intrin.h>
  234. #elif defined(__GNUC__) && defined(__SSE4_2__)
  235. #include <nmmintrin.h>
  236. #endif
  237. ]],[[
  238. uint64_t l = 0;
  239. l = _mm_crc32_u8(l, 0);
  240. l = _mm_crc32_u32(l, 0);
  241. l = _mm_crc32_u64(l, 0);
  242. return l;
  243. ]])],
  244. [ AC_MSG_RESULT(yes); enable_hwcrc32=yes],
  245. [ AC_MSG_RESULT(no)]
  246. )
  247. CXXFLAGS="$TEMP_CXXFLAGS"
  248. CPPFLAGS="$CPPFLAGS -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"
  249. AC_ARG_WITH([utils],
  250. [AS_HELP_STRING([--with-utils],
  251. [build starwels-cli starwels-tx (default=yes)])],
  252. [build_starwels_utils=$withval],
  253. [build_starwels_utils=yes])
  254. AC_ARG_WITH([libs],
  255. [AS_HELP_STRING([--with-libs],
  256. [build libraries (default=yes)])],
  257. [build_starwels_libs=$withval],
  258. [build_starwels_libs=yes])
  259. AC_ARG_WITH([daemon],
  260. [AS_HELP_STRING([--with-daemon],
  261. [build starwelsd daemon (default=yes)])],
  262. [build_starwelsd=$withval],
  263. [build_starwelsd=yes])
  264. use_pkgconfig=yes
  265. case $host in
  266. *mingw*)
  267. #pkgconfig does more harm than good with MinGW
  268. use_pkgconfig=no
  269. TARGET_OS=windows
  270. AC_CHECK_LIB([mingwthrd], [main],, AC_MSG_ERROR(lib missing))
  271. AC_CHECK_LIB([kernel32], [main],, AC_MSG_ERROR(lib missing))
  272. AC_CHECK_LIB([user32], [main],, AC_MSG_ERROR(lib missing))
  273. AC_CHECK_LIB([gdi32], [main],, AC_MSG_ERROR(lib missing))
  274. AC_CHECK_LIB([comdlg32], [main],, AC_MSG_ERROR(lib missing))
  275. AC_CHECK_LIB([winspool], [main],, AC_MSG_ERROR(lib missing))
  276. AC_CHECK_LIB([winmm], [main],, AC_MSG_ERROR(lib missing))
  277. AC_CHECK_LIB([shell32], [main],, AC_MSG_ERROR(lib missing))
  278. AC_CHECK_LIB([comctl32], [main],, AC_MSG_ERROR(lib missing))
  279. AC_CHECK_LIB([ole32], [main],, AC_MSG_ERROR(lib missing))
  280. AC_CHECK_LIB([oleaut32], [main],, AC_MSG_ERROR(lib missing))
  281. AC_CHECK_LIB([uuid], [main],, AC_MSG_ERROR(lib missing))
  282. AC_CHECK_LIB([rpcrt4], [main],, AC_MSG_ERROR(lib missing))
  283. AC_CHECK_LIB([advapi32], [main],, AC_MSG_ERROR(lib missing))
  284. AC_CHECK_LIB([ws2_32], [main],, AC_MSG_ERROR(lib missing))
  285. AC_CHECK_LIB([mswsock], [main],, AC_MSG_ERROR(lib missing))
  286. AC_CHECK_LIB([shlwapi], [main],, AC_MSG_ERROR(lib missing))
  287. AC_CHECK_LIB([iphlpapi], [main],, AC_MSG_ERROR(lib missing))
  288. AC_CHECK_LIB([crypt32], [main],, AC_MSG_ERROR(lib missing))
  289. # -static is interpreted by libtool, where it has a different meaning.
  290. # In libtool-speak, it's -all-static.
  291. AX_CHECK_LINK_FLAG([[-static]],[LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static"])
  292. AC_PATH_PROG([MAKENSIS], [makensis], none)
  293. if test x$MAKENSIS = xnone; then
  294. AC_MSG_WARN("makensis not found. Cannot create installer.")
  295. fi
  296. AC_PATH_TOOL(WINDRES, windres, none)
  297. if test x$WINDRES = xnone; then
  298. AC_MSG_ERROR("windres not found")
  299. fi
  300. CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB"
  301. LEVELDB_TARGET_FLAGS="-DOS_WINDOWS"
  302. if test "x$CXXFLAGS_overridden" = "xno"; then
  303. CXXFLAGS="$CXXFLAGS -w"
  304. fi
  305. case $host in
  306. i?86-*) WINDOWS_BITS=32 ;;
  307. x86_64-*) WINDOWS_BITS=64 ;;
  308. *) AC_MSG_ERROR("Could not determine win32/win64 for installer") ;;
  309. esac
  310. AC_SUBST(WINDOWS_BITS)
  311. dnl libtool insists upon adding -nostdlib and a list of objects/libs to link against.
  312. dnl That breaks our ability to build dll's with static libgcc/libstdc++/libssp. Override
  313. dnl its command here, with the predeps/postdeps removed, and -static inserted. Postdeps are
  314. dnl also overridden to prevent their insertion later.
  315. dnl This should only affect dll's.
  316. archive_cmds_CXX="\$CC -shared \$libobjs \$deplibs \$compiler_flags -static -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
  317. postdeps_CXX=
  318. ;;
  319. *darwin*)
  320. TARGET_OS=darwin
  321. LEVELDB_TARGET_FLAGS="-DOS_MACOSX"
  322. if test x$cross_compiling != xyes; then
  323. BUILD_OS=darwin
  324. AC_CHECK_PROG([PORT],port, port)
  325. if test x$PORT = xport; then
  326. dnl add default macports paths
  327. CPPFLAGS="$CPPFLAGS -isystem /opt/local/include"
  328. LIBS="$LIBS -L/opt/local/lib"
  329. if test -d /opt/local/include/db48; then
  330. CPPFLAGS="$CPPFLAGS -I/opt/local/include/db48"
  331. LIBS="$LIBS -L/opt/local/lib/db48"
  332. fi
  333. fi
  334. AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert)
  335. AC_CHECK_PROG([BREW],brew, brew)
  336. if test x$BREW = xbrew; then
  337. dnl These Homebrew packages may be keg-only, meaning that they won't be found
  338. dnl in expected paths because they may conflict with system files. Ask
  339. dnl Homebrew where each one is located, then adjust paths accordingly.
  340. dnl It's safe to add these paths even if the functionality is disabled by
  341. dnl the user (--without-wallet or --without-gui for example).
  342. openssl_prefix=`$BREW --prefix openssl 2>/dev/null`
  343. bdb_prefix=`$BREW --prefix berkeley-db4 2>/dev/null`
  344. qt5_prefix=`$BREW --prefix qt5 2>/dev/null`
  345. if test x$openssl_prefix != x; then
  346. PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
  347. export PKG_CONFIG_PATH
  348. fi
  349. if test x$bdb_prefix != x; then
  350. CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include"
  351. LIBS="$LIBS -L$bdb_prefix/lib"
  352. fi
  353. if test x$qt5_prefix != x; then
  354. PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
  355. export PKG_CONFIG_PATH
  356. fi
  357. fi
  358. else
  359. case $build_os in
  360. *darwin*)
  361. BUILD_OS=darwin
  362. ;;
  363. *)
  364. AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool)
  365. AC_PATH_TOOL([OTOOL], [otool], otool)
  366. AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage)
  367. AC_PATH_PROGS([RSVG_CONVERT], [rsvg-convert rsvg],rsvg-convert)
  368. AC_PATH_PROGS([IMAGEMAGICK_CONVERT], [convert],convert)
  369. AC_PATH_PROGS([TIFFCP], [tiffcp],tiffcp)
  370. dnl libtool will try to strip the static lib, which is a problem for
  371. dnl cross-builds because strip attempts to call a hard-coded ld,
  372. dnl which may not exist in the path. Stripping the .a is not
  373. dnl necessary, so just disable it.
  374. old_striplib=
  375. ;;
  376. esac
  377. fi
  378. AX_CHECK_LINK_FLAG([[-Wl,-headerpad_max_install_names]], [LDFLAGS="$LDFLAGS -Wl,-headerpad_max_install_names"])
  379. CPPFLAGS="$CPPFLAGS -DMAC_OSX"
  380. OBJCXXFLAGS="$CXXFLAGS"
  381. ;;
  382. *linux*)
  383. TARGET_OS=linux
  384. LEVELDB_TARGET_FLAGS="-DOS_LINUX"
  385. ;;
  386. *freebsd*)
  387. LEVELDB_TARGET_FLAGS="-DOS_FREEBSD"
  388. ;;
  389. *openbsd*)
  390. LEVELDB_TARGET_FLAGS="-DOS_OPENBSD"
  391. ;;
  392. *netbsd*)
  393. LEVELDB_TARGET_FLAGS="-DOS_NETBSD"
  394. ;;
  395. *)
  396. OTHER_OS=`echo ${host_os} | awk '{print toupper($0)}'`
  397. AC_MSG_WARN([Guessing LevelDB OS as OS_${OTHER_OS}, please check whether this is correct, if not add an entry to configure.ac.])
  398. LEVELDB_TARGET_FLAGS="-DOS_${OTHER_OS}"
  399. ;;
  400. esac
  401. if test x$use_pkgconfig = xyes; then
  402. m4_ifndef([PKG_PROG_PKG_CONFIG], [AC_MSG_ERROR(PKG_PROG_PKG_CONFIG macro not found. Please install pkg-config and re-run autogen.sh.)])
  403. m4_ifdef([PKG_PROG_PKG_CONFIG], [
  404. PKG_PROG_PKG_CONFIG
  405. if test x"$PKG_CONFIG" = "x"; then
  406. AC_MSG_ERROR(pkg-config not found.)
  407. fi
  408. ])
  409. fi
  410. if test x$use_extended_functional_tests != xno; then
  411. AC_SUBST(EXTENDED_FUNCTIONAL_TESTS, --extended)
  412. fi
  413. if test x$use_lcov = xyes; then
  414. if test x$LCOV = x; then
  415. AC_MSG_ERROR("lcov testing requested but lcov not found")
  416. fi
  417. if test x$GCOV = x; then
  418. AC_MSG_ERROR("lcov testing requested but gcov not found")
  419. fi
  420. if test x$PYTHON = x; then
  421. AC_MSG_ERROR("lcov testing requested but python not found")
  422. fi
  423. if test x$GENHTML = x; then
  424. AC_MSG_ERROR("lcov testing requested but genhtml not found")
  425. fi
  426. LCOV="$LCOV --gcov-tool=$GCOV"
  427. AX_CHECK_LINK_FLAG([[--coverage]], [LDFLAGS="$LDFLAGS --coverage"],
  428. [AC_MSG_ERROR("lcov testing requested but --coverage linker flag does not work")])
  429. AX_CHECK_COMPILE_FLAG([--coverage],[CXXFLAGS="$CXXFLAGS --coverage"],
  430. [AC_MSG_ERROR("lcov testing requested but --coverage flag does not work")])
  431. AC_DEFINE(USE_COVERAGE, 1, [Define this symbol if coverage is enabled])
  432. CXXFLAGS="$CXXFLAGS -Og"
  433. fi
  434. if test x$use_lcov_branch != xno; then
  435. AC_SUBST(LCOV_OPTS, "$LCOV_OPTS --rc lcov_branch_coverage=1")
  436. fi
  437. dnl Check for endianness
  438. AC_C_BIGENDIAN
  439. dnl Check for pthread compile/link requirements
  440. AX_PTHREAD
  441. # The following macro will add the necessary defines to starwels-config.h, but
  442. # they also need to be passed down to any subprojects. Pull the results out of
  443. # the cache and add them to CPPFLAGS.
  444. AC_SYS_LARGEFILE
  445. # detect POSIX or GNU variant of strerror_r
  446. AC_FUNC_STRERROR_R
  447. if test x$ac_cv_sys_file_offset_bits != x &&
  448. test x$ac_cv_sys_file_offset_bits != xno &&
  449. test x$ac_cv_sys_file_offset_bits != xunknown; then
  450. CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
  451. fi
  452. if test x$ac_cv_sys_large_files != x &&
  453. test x$ac_cv_sys_large_files != xno &&
  454. test x$ac_cv_sys_large_files != xunknown; then
  455. CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files"
  456. fi
  457. AX_CHECK_LINK_FLAG([[-Wl,--large-address-aware]], [LDFLAGS="$LDFLAGS -Wl,--large-address-aware"])
  458. AX_GCC_FUNC_ATTRIBUTE([visibility])
  459. AX_GCC_FUNC_ATTRIBUTE([dllexport])
  460. AX_GCC_FUNC_ATTRIBUTE([dllimport])
  461. if test x$use_glibc_compat != xno; then
  462. #glibc absorbed clock_gettime in 2.17. librt (its previous location) is safe to link
  463. #in anyway for back-compat.
  464. AC_CHECK_LIB([rt],[clock_gettime],, AC_MSG_ERROR(lib missing))
  465. #__fdelt_chk's params and return type have changed from long unsigned int to long int.
  466. # See which one is present here.
  467. AC_MSG_CHECKING(__fdelt_chk type)
  468. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef _FORTIFY_SOURCE
  469. #undef _FORTIFY_SOURCE
  470. #endif
  471. #define _FORTIFY_SOURCE 2
  472. #include <sys/select.h>
  473. extern "C" long unsigned int __fdelt_warn(long unsigned int);]],[[]])],
  474. [ fdelt_type="long unsigned int"],
  475. [ fdelt_type="long int"])
  476. AC_MSG_RESULT($fdelt_type)
  477. AC_DEFINE_UNQUOTED(FDELT_TYPE, $fdelt_type,[parameter and return value type for __fdelt_chk])
  478. else
  479. AC_SEARCH_LIBS([clock_gettime],[rt])
  480. fi
  481. if test x$TARGET_OS != xwindows; then
  482. # All windows code is PIC, forcing it on just adds useless compile warnings
  483. AX_CHECK_COMPILE_FLAG([-fPIC],[PIC_FLAGS="-fPIC"])
  484. fi
  485. if test x$use_hardening != xno; then
  486. AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"])
  487. AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"])
  488. AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[
  489. AX_CHECK_PREPROC_FLAG([-U_FORTIFY_SOURCE],[
  490. HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -U_FORTIFY_SOURCE"
  491. ])
  492. HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2"
  493. ])
  494. AX_CHECK_LINK_FLAG([[-Wl,--dynamicbase]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--dynamicbase"])
  495. AX_CHECK_LINK_FLAG([[-Wl,--nxcompat]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--nxcompat"])
  496. AX_CHECK_LINK_FLAG([[-Wl,--high-entropy-va]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--high-entropy-va"])
  497. AX_CHECK_LINK_FLAG([[-Wl,-z,relro]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"])
  498. AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"])
  499. if test x$TARGET_OS != xwindows; then
  500. AX_CHECK_COMPILE_FLAG([-fPIE],[PIE_FLAGS="-fPIE"])
  501. AX_CHECK_LINK_FLAG([[-pie]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"])
  502. fi
  503. case $host in
  504. *mingw*)
  505. AC_CHECK_LIB([ssp], [main],, AC_MSG_ERROR(lib missing))
  506. ;;
  507. esac
  508. fi
  509. dnl this flag screws up non-darwin gcc even when the check fails. special-case it.
  510. if test x$TARGET_OS = xdarwin; then
  511. AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"])
  512. fi
  513. AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h])
  514. AC_CHECK_DECLS([strnlen])
  515. # Check for daemon(3), unrelated to --with-daemon (although used by it)
  516. AC_CHECK_DECLS([daemon])
  517. AC_CHECK_DECLS([le16toh, le32toh, le64toh, htole16, htole32, htole64, be16toh, be32toh, be64toh, htobe16, htobe32, htobe64],,,
  518. [#if HAVE_ENDIAN_H
  519. #include <endian.h>
  520. #elif HAVE_SYS_ENDIAN_H
  521. #include <sys/endian.h>
  522. #endif])
  523. AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64],,,
  524. [#if HAVE_BYTESWAP_H
  525. #include <byteswap.h>
  526. #endif])
  527. AC_CHECK_DECLS([__builtin_clz, __builtin_clzl, __builtin_clzll])
  528. dnl Check for MSG_NOSIGNAL
  529. AC_MSG_CHECKING(for MSG_NOSIGNAL)
  530. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],
  531. [[ int f = MSG_NOSIGNAL; ]])],
  532. [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,[Define this symbol if you have MSG_NOSIGNAL]) ],
  533. [ AC_MSG_RESULT(no)]
  534. )
  535. dnl Check for MSG_DONTWAIT
  536. AC_MSG_CHECKING(for MSG_DONTWAIT)
  537. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],
  538. [[ int f = MSG_DONTWAIT; ]])],
  539. [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MSG_DONTWAIT, 1,[Define this symbol if you have MSG_DONTWAIT]) ],
  540. [ AC_MSG_RESULT(no)]
  541. )
  542. dnl Check for malloc_info (for memory statistics information in getmemoryinfo)
  543. AC_MSG_CHECKING(for getmemoryinfo)
  544. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]],
  545. [[ int f = malloc_info(0, NULL); ]])],
  546. [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MALLOC_INFO, 1,[Define this symbol if you have malloc_info]) ],
  547. [ AC_MSG_RESULT(no)]
  548. )
  549. dnl Check for mallopt(M_ARENA_MAX) (to set glibc arenas)
  550. AC_MSG_CHECKING(for mallopt M_ARENA_MAX)
  551. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]],
  552. [[ mallopt(M_ARENA_MAX, 1); ]])],
  553. [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MALLOPT_ARENA_MAX, 1,[Define this symbol if you have mallopt with M_ARENA_MAX]) ],
  554. [ AC_MSG_RESULT(no)]
  555. )
  556. AC_MSG_CHECKING([for visibility attribute])
  557. AC_LINK_IFELSE([AC_LANG_SOURCE([
  558. int foo_def( void ) __attribute__((visibility("default")));
  559. int main(){}
  560. ])],
  561. [
  562. AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE,1,[Define if the visibility attribute is supported.])
  563. AC_MSG_RESULT(yes)
  564. ],
  565. [
  566. AC_MSG_RESULT(no)
  567. if test x$use_reduce_exports = xyes; then
  568. AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduce-exports.])
  569. fi
  570. ]
  571. )
  572. TEMP_LDFLAGS="$LDFLAGS"
  573. LDFLAGS="$TEMP_LDFLAGS $PTHREAD_CFLAGS"
  574. AC_MSG_CHECKING([for thread_local support])
  575. AC_LINK_IFELSE([AC_LANG_SOURCE([
  576. #include <thread>
  577. static thread_local int foo = 0;
  578. static void run_thread() { foo++;}
  579. int main(){
  580. for(int i = 0; i < 10; i++) { std::thread(run_thread).detach();}
  581. return foo;
  582. }
  583. ])],
  584. [
  585. AC_DEFINE(HAVE_THREAD_LOCAL,1,[Define if thread_local is supported.])
  586. AC_MSG_RESULT(yes)
  587. ],
  588. [
  589. AC_MSG_RESULT(no)
  590. ]
  591. )
  592. LDFLAGS="$TEMP_LDFLAGS"
  593. # Check for different ways of gathering OS randomness
  594. AC_MSG_CHECKING(for Linux getrandom syscall)
  595. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
  596. #include <sys/syscall.h>
  597. #include <linux/random.h>]],
  598. [[ syscall(SYS_getrandom, nullptr, 32, 0); ]])],
  599. [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYS_GETRANDOM, 1,[Define this symbol if the Linux getrandom system call is available]) ],
  600. [ AC_MSG_RESULT(no)]
  601. )
  602. AC_MSG_CHECKING(for getentropy)
  603. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]],
  604. [[ getentropy(nullptr, 32) ]])],
  605. [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_GETENTROPY, 1,[Define this symbol if the BSD getentropy system call is available]) ],
  606. [ AC_MSG_RESULT(no)]
  607. )
  608. AC_MSG_CHECKING(for getentropy via random.h)
  609. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
  610. #include <sys/random.h>]],
  611. [[ getentropy(nullptr, 32) ]])],
  612. [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_GETENTROPY_RAND, 1,[Define this symbol if the BSD getentropy system call is available with sys/random.h]) ],
  613. [ AC_MSG_RESULT(no)]
  614. )
  615. AC_MSG_CHECKING(for sysctl KERN_ARND)
  616. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
  617. #include <sys/sysctl.h>]],
  618. [[ static const int name[2] = {CTL_KERN, KERN_ARND};
  619. sysctl(name, 2, nullptr, nullptr, nullptr, 0); ]])],
  620. [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSCTL_ARND, 1,[Define this symbol if the BSD sysctl(KERN_ARND) is available]) ],
  621. [ AC_MSG_RESULT(no)]
  622. )
  623. # Check for reduced exports
  624. if test x$use_reduce_exports = xyes; then
  625. AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"],
  626. [AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])
  627. fi
  628. LEVELDB_CPPFLAGS=
  629. LIBLEVELDB=
  630. LIBMEMENV=
  631. AM_CONDITIONAL([EMBEDDED_LEVELDB],[true])
  632. AC_SUBST(LEVELDB_CPPFLAGS)
  633. AC_SUBST(LIBLEVELDB)
  634. AC_SUBST(LIBMEMENV)
  635. if test x$enable_wallet != xno; then
  636. dnl Check for libdb_cxx only if wallet enabled
  637. STARWELS_FIND_BDB48
  638. fi
  639. dnl Check for libminiupnpc (optional)
  640. if test x$use_upnp != xno; then
  641. AC_CHECK_HEADERS(
  642. [miniupnpc/miniwget.h miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h],
  643. [AC_CHECK_LIB([miniupnpc], [main],[MINIUPNPC_LIBS=-lminiupnpc], [have_miniupnpc=no])],
  644. [have_miniupnpc=no]
  645. )
  646. fi
  647. STARWELS_QT_INIT
  648. dnl sets $starwels_enable_qt, $starwels_enable_qt_test, $starwels_enable_qt_dbus
  649. STARWELS_QT_CONFIGURE([$use_pkgconfig], [qt5])
  650. if test x$build_starwels_utils$build_starwelsd$starwels_enable_qt$use_tests$use_bench = xnonononono; then
  651. use_boost=no
  652. else
  653. use_boost=yes
  654. fi
  655. if test x$use_boost = xyes; then
  656. dnl Minimum required Boost version
  657. define(MINIMUM_REQUIRED_BOOST, 1.47.0)
  658. dnl Check for boost libs
  659. AX_BOOST_BASE([MINIMUM_REQUIRED_BOOST])
  660. if test x$want_boost = xno; then
  661. AC_MSG_ERROR([[only libstarwelsconsensus can be built without boost]])
  662. fi
  663. AX_BOOST_SYSTEM
  664. AX_BOOST_FILESYSTEM
  665. AX_BOOST_PROGRAM_OPTIONS
  666. AX_BOOST_THREAD
  667. AX_BOOST_CHRONO
  668. dnl Boost 1.56 through 1.62 allow using std::atomic instead of its own atomic
  669. dnl counter implementations. In 1.63 and later the std::atomic approach is default.
  670. m4_pattern_allow(DBOOST_AC_USE_STD_ATOMIC) dnl otherwise it's treated like a macro
  671. BOOST_CPPFLAGS="-DBOOST_SP_USE_STD_ATOMIC -DBOOST_AC_USE_STD_ATOMIC $BOOST_CPPFLAGS"
  672. if test x$use_reduce_exports = xyes; then
  673. AC_MSG_CHECKING([for working boost reduced exports])
  674. TEMP_CPPFLAGS="$CPPFLAGS"
  675. CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
  676. AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
  677. @%:@include <boost/version.hpp>
  678. ]], [[
  679. #if BOOST_VERSION >= 104900
  680. // Everything is okay
  681. #else
  682. # error Boost version is too old
  683. #endif
  684. ]])],[
  685. AC_MSG_RESULT(yes)
  686. ],[
  687. AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduce-exports.])
  688. ])
  689. CPPFLAGS="$TEMP_CPPFLAGS"
  690. fi
  691. fi
  692. if test x$use_reduce_exports = xyes; then
  693. CXXFLAGS="$CXXFLAGS $RE_CXXFLAGS"
  694. AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS="-Wl,--exclude-libs,ALL"])
  695. fi
  696. if test x$use_tests = xyes; then
  697. if test x$HEXDUMP = x; then
  698. AC_MSG_ERROR(hexdump is required for tests)
  699. fi
  700. if test x$use_boost = xyes; then
  701. AX_BOOST_UNIT_TEST_FRAMEWORK
  702. dnl Determine if -DBOOST_TEST_DYN_LINK is needed
  703. AC_MSG_CHECKING([for dynamic linked boost test])
  704. TEMP_LIBS="$LIBS"
  705. LIBS="$LIBS $BOOST_LDFLAGS $BOOST_UNIT_TEST_FRAMEWORK_LIB"
  706. TEMP_CPPFLAGS="$CPPFLAGS"
  707. CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  708. AC_LINK_IFELSE([AC_LANG_SOURCE([
  709. #define BOOST_TEST_DYN_LINK
  710. #define BOOST_TEST_MAIN
  711. #include <boost/test/unit_test.hpp>
  712. ])],
  713. [AC_MSG_RESULT(yes)]
  714. [TESTDEFS="$TESTDEFS -DBOOST_TEST_DYN_LINK"],
  715. [AC_MSG_RESULT(no)])
  716. LIBS="$TEMP_LIBS"
  717. CPPFLAGS="$TEMP_CPPFLAGS"
  718. fi
  719. fi
  720. if test x$use_boost = xyes; then
  721. BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB $BOOST_CHRONO_LIB"
  722. dnl If boost (prior to 1.57) was built without c++11, it emulated scoped enums
  723. dnl using c++98 constructs. Unfortunately, this implementation detail leaked into
  724. dnl the abi. This was fixed in 1.57.
  725. dnl When building against that installed version using c++11, the headers pick up
  726. dnl on the native c++11 scoped enum support and enable it, however it will fail to
  727. dnl link. This can be worked around by disabling c++11 scoped enums if linking will
  728. dnl fail.
  729. dnl BOOST_NO_SCOPED_ENUMS was changed to BOOST_NO_CXX11_SCOPED_ENUMS in 1.51.
  730. TEMP_LIBS="$LIBS"
  731. LIBS="$BOOST_LIBS $LIBS"
  732. TEMP_CPPFLAGS="$CPPFLAGS"
  733. CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  734. AC_MSG_CHECKING([for mismatched boost c++11 scoped enums])
  735. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  736. #include <boost/config.hpp>
  737. #include <boost/version.hpp>
  738. #if !defined(BOOST_NO_SCOPED_ENUMS) && !defined(BOOST_NO_CXX11_SCOPED_ENUMS) && BOOST_VERSION < 105700
  739. #define BOOST_NO_SCOPED_ENUMS
  740. #define BOOST_NO_CXX11_SCOPED_ENUMS
  741. #define CHECK
  742. #endif
  743. #include <boost/filesystem.hpp>
  744. ]],[[
  745. #if defined(CHECK)
  746. boost::filesystem::copy_file("foo", "bar");
  747. #else
  748. choke;
  749. #endif
  750. ]])],
  751. [AC_MSG_RESULT(mismatched); BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_NO_SCOPED_ENUMS -DBOOST_NO_CXX11_SCOPED_ENUMS"], [AC_MSG_RESULT(ok)])
  752. LIBS="$TEMP_LIBS"
  753. CPPFLAGS="$TEMP_CPPFLAGS"
  754. dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep, however
  755. dnl it was broken from 1.50 to 1.52 when backed by nanosleep. Use sleep_for if
  756. dnl a working version is available, else fall back to sleep. sleep was removed
  757. dnl after 1.56.
  758. dnl If neither is available, abort.
  759. TEMP_LIBS="$LIBS"
  760. LIBS="$BOOST_LIBS $LIBS"
  761. TEMP_CPPFLAGS="$CPPFLAGS"
  762. CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  763. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  764. #include <boost/thread/thread.hpp>
  765. #include <boost/version.hpp>
  766. ]],[[
  767. #if BOOST_VERSION >= 105000 && (!defined(BOOST_HAS_NANOSLEEP) || BOOST_VERSION >= 105200)
  768. boost::this_thread::sleep_for(boost::chrono::milliseconds(0));
  769. #else
  770. choke me
  771. #endif
  772. ]])],
  773. [boost_sleep=yes;
  774. AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])],
  775. [boost_sleep=no])
  776. LIBS="$TEMP_LIBS"
  777. CPPFLAGS="$TEMP_CPPFLAGS"
  778. if test x$boost_sleep != xyes; then
  779. TEMP_LIBS="$LIBS"
  780. LIBS="$BOOST_LIBS $LIBS"
  781. TEMP_CPPFLAGS="$CPPFLAGS"
  782. CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  783. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  784. #include <boost/version.hpp>
  785. #include <boost/thread.hpp>
  786. #include <boost/date_time/posix_time/posix_time_types.hpp>
  787. ]],[[
  788. #if BOOST_VERSION <= 105600
  789. boost::this_thread::sleep(boost::posix_time::milliseconds(0));
  790. #else
  791. choke me
  792. #endif
  793. ]])],
  794. [boost_sleep=yes; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP, 1, [Define this symbol if boost sleep works])],
  795. [boost_sleep=no])
  796. LIBS="$TEMP_LIBS"
  797. CPPFLAGS="$TEMP_CPPFLAGS"
  798. fi
  799. if test x$boost_sleep != xyes; then
  800. AC_MSG_ERROR(No working boost sleep implementation found.)
  801. fi
  802. fi
  803. if test x$use_pkgconfig = xyes; then
  804. : dnl
  805. m4_ifdef(
  806. [PKG_CHECK_MODULES],
  807. [
  808. PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)])
  809. PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)])
  810. STARWELS_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [STARWELS_QT_FAIL(libprotobuf not found)])])
  811. if test x$use_qr != xno; then
  812. STARWELS_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])
  813. fi
  814. if test x$build_starwels_utils$build_starwelsd$starwels_enable_qt$use_tests != xnononono; then
  815. PKG_CHECK_MODULES([EVENT], [libevent],, [AC_MSG_ERROR(libevent not found.)])
  816. if test x$TARGET_OS != xwindows; then
  817. PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads],, [AC_MSG_ERROR(libevent_pthreads not found.)])
  818. fi
  819. fi
  820. if test "x$use_zmq" = "xyes"; then
  821. PKG_CHECK_MODULES([ZMQ],[libzmq >= 4],
  822. [AC_DEFINE([ENABLE_ZMQ],[1],[Define to 1 to enable ZMQ functions])],
  823. [AC_DEFINE([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])
  824. AC_MSG_WARN([libzmq version 4.x or greater not found, disabling])
  825. use_zmq=no])
  826. else
  827. AC_DEFINE_UNQUOTED([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])
  828. fi
  829. ]
  830. )
  831. else
  832. AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing))
  833. AC_CHECK_LIB([crypto], [main],CRYPTO_LIBS=-lcrypto, AC_MSG_ERROR(libcrypto missing))
  834. AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),)
  835. AC_CHECK_LIB([ssl], [main],SSL_LIBS=-lssl, AC_MSG_ERROR(libssl missing))
  836. if test x$build_starwels_utils$build_starwelsd$starwels_enable_qt$use_tests != xnononono; then
  837. AC_CHECK_HEADER([event2/event.h],, AC_MSG_ERROR(libevent headers missing),)
  838. AC_CHECK_LIB([event],[main],EVENT_LIBS=-levent,AC_MSG_ERROR(libevent missing))
  839. if test x$TARGET_OS != xwindows; then
  840. AC_CHECK_LIB([event_pthreads],[main],EVENT_PTHREADS_LIBS=-levent_pthreads,AC_MSG_ERROR(libevent_pthreads missing))
  841. fi
  842. fi
  843. if test "x$use_zmq" = "xyes"; then
  844. AC_CHECK_HEADER([zmq.h],
  845. [AC_DEFINE([ENABLE_ZMQ],[1],[Define to 1 to enable ZMQ functions])],
  846. [AC_MSG_WARN([zmq.h not found, disabling zmq support])
  847. use_zmq=no
  848. AC_DEFINE([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])])
  849. AC_CHECK_LIB([zmq],[zmq_ctx_shutdown],ZMQ_LIBS=-lzmq,
  850. [AC_MSG_WARN([libzmq >= 4.0 not found, disabling zmq support])
  851. use_zmq=no
  852. AC_DEFINE([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])])
  853. else
  854. AC_DEFINE_UNQUOTED([ENABLE_ZMQ],[0],[Define to 1 to enable ZMQ functions])
  855. fi
  856. if test "x$use_zmq" = "xyes"; then
  857. dnl Assume libzmq was built for static linking
  858. case $host in
  859. *mingw*)
  860. ZMQ_CFLAGS="$ZMQ_CFLAGS -DZMQ_STATIC"
  861. ;;
  862. esac
  863. fi
  864. STARWELS_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],[PROTOBUF_LIBS=-lprotobuf], STARWELS_QT_FAIL(libprotobuf not found)))
  865. if test x$use_qr != xno; then
  866. STARWELS_QT_CHECK([AC_CHECK_LIB([qrencode], [main],[QR_LIBS=-lqrencode], [have_qrencode=no])])
  867. STARWELS_QT_CHECK([AC_CHECK_HEADER([qrencode.h],, have_qrencode=no)])
  868. fi
  869. fi
  870. save_CXXFLAGS="${CXXFLAGS}"
  871. CXXFLAGS="${CXXFLAGS} ${CRYPTO_CFLAGS} ${SSL_CFLAGS}"
  872. AC_CHECK_DECLS([EVP_MD_CTX_new],,,[AC_INCLUDES_DEFAULT
  873. #include <openssl/x509_vfy.h>
  874. ])
  875. CXXFLAGS="${save_CXXFLAGS}"
  876. dnl univalue check
  877. need_bundled_univalue=yes
  878. if test x$build_starwels_utils$build_starwelsd$starwels_enable_qt$use_tests$use_bench = xnonononono; then
  879. need_bundled_univalue=no
  880. else
  881. if test x$system_univalue != xno ; then
  882. found_univalue=no
  883. if test x$use_pkgconfig = xyes; then
  884. : #NOP
  885. m4_ifdef(
  886. [PKG_CHECK_MODULES],
  887. [
  888. PKG_CHECK_MODULES([UNIVALUE],[libunivalue],[found_univalue=yes],[true])
  889. ]
  890. )
  891. else
  892. AC_CHECK_HEADER([univalue.h],[
  893. AC_CHECK_LIB([univalue], [main],[
  894. UNIVALUE_LIBS=-lunivalue
  895. found_univalue=yes
  896. ],[true])
  897. ],[true])
  898. fi
  899. if test x$found_univalue = xyes ; then
  900. system_univalue=yes
  901. need_bundled_univalue=no
  902. elif test x$system_univalue = xyes ; then
  903. AC_MSG_ERROR([univalue not found])
  904. else
  905. system_univalue=no
  906. fi
  907. fi
  908. if test x$need_bundled_univalue = xyes ; then
  909. UNIVALUE_CFLAGS='-I$(srcdir)/univalue/include'
  910. UNIVALUE_LIBS='univalue/libunivalue.la'
  911. fi
  912. fi
  913. AM_CONDITIONAL([EMBEDDED_UNIVALUE],[test x$need_bundled_univalue = xyes])
  914. AC_SUBST(UNIVALUE_CFLAGS)
  915. AC_SUBST(UNIVALUE_LIBS)
  916. STARWELS_QT_PATH_PROGS([PROTOC], [protoc],$protoc_bin_path)
  917. AC_MSG_CHECKING([whether to build starwelsd])
  918. AM_CONDITIONAL([BUILD_STARWELSD], [test x$build_starwelsd = xyes])
  919. AC_MSG_RESULT($build_starwelsd)
  920. AC_MSG_CHECKING([whether to build utils (starwels-cli starwels-tx)])
  921. AM_CONDITIONAL([BUILD_STARWELS_UTILS], [test x$build_starwels_utils = xyes])
  922. AC_MSG_RESULT($build_starwels_utils)
  923. AC_MSG_CHECKING([whether to build libraries])
  924. AM_CONDITIONAL([BUILD_STARWELS_LIBS], [test x$build_starwels_libs = xyes])
  925. if test x$build_starwels_libs = xyes; then
  926. AC_DEFINE(HAVE_CONSENSUS_LIB, 1, [Define this symbol if the consensus lib has been built])
  927. AC_CONFIG_FILES([libstarwelsconsensus.pc:libstarwelsconsensus.pc.in])
  928. fi
  929. AC_MSG_RESULT($build_starwels_libs)
  930. AC_LANG_POP
  931. if test "x$use_ccache" != "xno"; then
  932. AC_MSG_CHECKING(if ccache should be used)
  933. if test x$CCACHE = x; then
  934. if test "x$use_ccache" = "xyes"; then
  935. AC_MSG_ERROR([ccache not found.]);
  936. else
  937. use_ccache=no
  938. fi
  939. else
  940. use_ccache=yes
  941. CC="$ac_cv_path_CCACHE $CC"
  942. CXX="$ac_cv_path_CCACHE $CXX"
  943. fi
  944. AC_MSG_RESULT($use_ccache)
  945. fi
  946. if test "x$use_ccache" = "xyes"; then
  947. AX_CHECK_PREPROC_FLAG([-Qunused-arguments],[CPPFLAGS="-Qunused-arguments $CPPFLAGS"])
  948. fi
  949. dnl enable wallet
  950. AC_MSG_CHECKING([if wallet should be enabled])
  951. if test x$enable_wallet != xno; then
  952. AC_MSG_RESULT(yes)
  953. AC_DEFINE_UNQUOTED([ENABLE_WALLET],[1],[Define to 1 to enable wallet functions])
  954. else
  955. AC_MSG_RESULT(no)
  956. fi
  957. dnl enable upnp support
  958. AC_MSG_CHECKING([whether to build with support for UPnP])
  959. if test x$have_miniupnpc = xno; then
  960. if test x$use_upnp = xyes; then
  961. AC_MSG_ERROR("UPnP requested but cannot be built. use --without-miniupnpc")
  962. fi
  963. AC_MSG_RESULT(no)
  964. else
  965. if test x$use_upnp != xno; then
  966. AC_MSG_RESULT(yes)
  967. AC_MSG_CHECKING([whether to build with UPnP enabled by default])
  968. use_upnp=yes
  969. upnp_setting=0
  970. if test x$use_upnp_default != xno; then
  971. use_upnp_default=yes
  972. upnp_setting=1
  973. fi
  974. AC_MSG_RESULT($use_upnp_default)
  975. AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state])
  976. if test x$TARGET_OS = xwindows; then
  977. MINIUPNPC_CPPFLAGS="-DSTATICLIB -DMINIUPNP_STATICLIB"
  978. fi
  979. else
  980. AC_MSG_RESULT(no)
  981. fi
  982. fi
  983. dnl these are only used when qt is enabled
  984. BUILD_TEST_QT=""
  985. if test x$starwels_enable_qt != xno; then
  986. dnl enable dbus support
  987. AC_MSG_CHECKING([whether to build GUI with support for D-Bus])
  988. if test x$starwels_enable_qt_dbus != xno; then
  989. AC_DEFINE([USE_DBUS],[1],[Define if dbus support should be compiled in])
  990. fi
  991. AC_MSG_RESULT($starwels_enable_qt_dbus)
  992. dnl enable qr support
  993. AC_MSG_CHECKING([whether to build GUI with support for QR codes])
  994. if test x$have_qrencode = xno; then
  995. if test x$use_qr = xyes; then
  996. AC_MSG_ERROR("QR support requested but cannot be built. use --without-qrencode")
  997. fi
  998. AC_MSG_RESULT(no)
  999. else
  1000. if test x$use_qr != xno; then
  1001. AC_MSG_RESULT(yes)
  1002. AC_DEFINE([USE_QRCODE],[1],[Define if QR support should be compiled in])
  1003. use_qr=yes
  1004. else
  1005. AC_MSG_RESULT(no)
  1006. fi
  1007. fi
  1008. if test x$XGETTEXT = x; then
  1009. AC_MSG_WARN("xgettext is required to update qt translations")
  1010. fi
  1011. AC_MSG_CHECKING([whether to build test_starwels-qt])
  1012. if test x$use_gui_tests$starwels_enable_qt_test = xyesyes; then
  1013. AC_MSG_RESULT([yes])
  1014. BUILD_TEST_QT="yes"
  1015. else
  1016. AC_MSG_RESULT([no])
  1017. fi
  1018. fi
  1019. AM_CONDITIONAL([ENABLE_ZMQ], [test "x$use_zmq" = "xyes"])
  1020. AC_MSG_CHECKING([whether to build test_starwels])
  1021. if test x$use_tests = xyes; then
  1022. AC_MSG_RESULT([yes])
  1023. BUILD_TEST="yes"
  1024. else
  1025. AC_MSG_RESULT([no])
  1026. BUILD_TEST=""
  1027. fi
  1028. AC_MSG_CHECKING([whether to reduce exports])
  1029. if test x$use_reduce_exports = xyes; then
  1030. AC_MSG_RESULT([yes])
  1031. else
  1032. AC_MSG_RESULT([no])
  1033. fi
  1034. if test x$build_starwels_utils$build_starwels_libs$build_starwelsd$starwels_enable_qt$use_bench$use_tests = xnononononono; then
  1035. AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui --enable-bench or --enable-tests])
  1036. fi
  1037. AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin])
  1038. AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin])
  1039. AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])
  1040. AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes])
  1041. AM_CONDITIONAL([ENABLE_TESTS],[test x$BUILD_TEST = xyes])
  1042. AM_CONDITIONAL([ENABLE_QT],[test x$starwels_enable_qt = xyes])
  1043. AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$BUILD_TEST_QT = xyes])
  1044. AM_CONDITIONAL([ENABLE_BENCH],[test x$use_bench = xyes])
  1045. AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
  1046. AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
  1047. AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
  1048. AM_CONDITIONAL([HARDEN],[test x$use_hardening = xyes])
  1049. AM_CONDITIONAL([ENABLE_HWCRC32],[test x$enable_hwcrc32 = xyes])
  1050. AM_CONDITIONAL([USE_ASM],[test x$use_asm = xyes])
  1051. AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
  1052. AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
  1053. AC_DEFINE(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION, [Build revision])
  1054. AC_DEFINE(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD, [Version Build])
  1055. AC_DEFINE(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE, [Version is release])
  1056. AC_DEFINE(COPYRIGHT_YEAR, _COPYRIGHT_YEAR, [Copyright year])
  1057. AC_DEFINE(COPYRIGHT_HOLDERS, "_COPYRIGHT_HOLDERS", [Copyright holder(s) before %s replacement])
  1058. AC_DEFINE(COPYRIGHT_HOLDERS_SUBSTITUTION, "_COPYRIGHT_HOLDERS_SUBSTITUTION", [Replacement for %s in copyright holders string])
  1059. define(_COPYRIGHT_HOLDERS_FINAL, [patsubst(_COPYRIGHT_HOLDERS, [%s], [_COPYRIGHT_HOLDERS_SUBSTITUTION])])
  1060. AC_DEFINE(COPYRIGHT_HOLDERS_FINAL, "_COPYRIGHT_HOLDERS_FINAL", [Copyright holder(s)])
  1061. AC_SUBST(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR)
  1062. AC_SUBST(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR)
  1063. AC_SUBST(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION)
  1064. AC_SUBST(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD)
  1065. AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE)
  1066. AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR)
  1067. AC_SUBST(COPYRIGHT_HOLDERS, "_COPYRIGHT_HOLDERS")
  1068. AC_SUBST(COPYRIGHT_HOLDERS_SUBSTITUTION, "_COPYRIGHT_HOLDERS_SUBSTITUTION")
  1069. AC_SUBST(COPYRIGHT_HOLDERS_FINAL, "_COPYRIGHT_HOLDERS_FINAL")
  1070. AC_SUBST(STARWELS_DAEMON_NAME)
  1071. AC_SUBST(STARWELS_GUI_NAME)
  1072. AC_SUBST(STARWELS_CLI_NAME)
  1073. AC_SUBST(STARWELS_TX_NAME)
  1074. AC_SUBST(RELDFLAGS)
  1075. AC_SUBST(ERROR_CXXFLAGS)
  1076. AC_SUBST(HARDENED_CXXFLAGS)
  1077. AC_SUBST(HARDENED_CPPFLAGS)
  1078. AC_SUBST(HARDENED_LDFLAGS)
  1079. AC_SUBST(PIC_FLAGS)
  1080. AC_SUBST(PIE_FLAGS)
  1081. AC_SUBST(SSE42_CXXFLAGS)
  1082. AC_SUBST(LIBTOOL_APP_LDFLAGS)
  1083. AC_SUBST(USE_UPNP)
  1084. AC_SUBST(USE_QRCODE)
  1085. AC_SUBST(BOOST_LIBS)
  1086. AC_SUBST(TESTDEFS)
  1087. AC_SUBST(LEVELDB_TARGET_FLAGS)
  1088. AC_SUBST(MINIUPNPC_CPPFLAGS)
  1089. AC_SUBST(MINIUPNPC_LIBS)
  1090. AC_SUBST(CRYPTO_LIBS)
  1091. AC_SUBST(SSL_LIBS)
  1092. AC_SUBST(EVENT_LIBS)
  1093. AC_SUBST(EVENT_PTHREADS_LIBS)
  1094. AC_SUBST(ZMQ_LIBS)
  1095. AC_SUBST(PROTOBUF_LIBS)
  1096. AC_SUBST(QR_LIBS)
  1097. AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini])
  1098. AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh])
  1099. AC_CONFIG_FILES([doc/Doxyfile])
  1100. AC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py])
  1101. AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py])
  1102. AC_CONFIG_LINKS([test/util/starwels-util-test.py:test/util/starwels-util-test.py])
  1103. dnl boost's m4 checks do something really nasty: they export these vars. As a
  1104. dnl result, they leak into secp256k1's configure and crazy things happen.
  1105. dnl Until this is fixed upstream and we've synced, we'll just un-export them.
  1106. CPPFLAGS_TEMP="$CPPFLAGS"
  1107. unset CPPFLAGS
  1108. CPPFLAGS="$CPPFLAGS_TEMP"
  1109. LDFLAGS_TEMP="$LDFLAGS"
  1110. unset LDFLAGS
  1111. LDFLAGS="$LDFLAGS_TEMP"
  1112. LIBS_TEMP="$LIBS"
  1113. unset LIBS
  1114. LIBS="$LIBS_TEMP"
  1115. PKGCONFIG_PATH_TEMP="$PKG_CONFIG_PATH"
  1116. unset PKG_CONFIG_PATH
  1117. PKG_CONFIG_PATH="$PKGCONFIG_PATH_TEMP"
  1118. PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
  1119. unset PKG_CONFIG_LIBDIR
  1120. PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
  1121. if test x$need_bundled_univalue = xyes; then
  1122. AC_CONFIG_SUBDIRS([src/univalue])
  1123. fi
  1124. ac_configure_args="${ac_configure_args} --disable-shared --with-pic --with-bignum=no --enable-module-recovery --disable-jni"
  1125. AC_CONFIG_SUBDIRS([src/secp256k1])
  1126. AC_OUTPUT
  1127. dnl Taken from https://wiki.debian.org/RpathIssue
  1128. case $host in
  1129. *-*-linux-gnu)
  1130. AC_MSG_RESULT([Fixing libtool for -rpath problems.])
  1131. sed < libtool > libtool-2 \
  1132. 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/'
  1133. mv libtool-2 libtool
  1134. chmod 755 libtool
  1135. ;;
  1136. esac
  1137. dnl Replace the BUILDDIR path with the correct Windows path if compiling on Native Windows
  1138. case ${OS} in
  1139. *Windows*)
  1140. sed 's/BUILDDIR="\/\([[a-z]]\)/BUILDDIR="\1:/' test/config.ini > test/config-2.ini
  1141. mv test/config-2.ini test/config.ini
  1142. ;;
  1143. esac
  1144. echo
  1145. echo "Options used to compile and link:"
  1146. echo " with wallet = $enable_wallet"
  1147. echo " with gui / qt = $starwels_enable_qt"
  1148. if test x$starwels_enable_qt != xno; then
  1149. echo " qt version = $starwels_qt_got_major_vers"
  1150. echo " with qr = $use_qr"
  1151. fi
  1152. echo " with zmq = $use_zmq"
  1153. echo " with test = $use_tests"
  1154. echo " with bench = $use_bench"
  1155. echo " with upnp = $use_upnp"
  1156. echo " use asm = $use_asm"
  1157. echo " debug enabled = $enable_debug"
  1158. echo " werror = $enable_werror"
  1159. echo
  1160. echo " target os = $TARGET_OS"
  1161. echo " build os = $BUILD_OS"
  1162. echo
  1163. echo " CC = $CC"
  1164. echo " CFLAGS = $CFLAGS"
  1165. echo " CPPFLAGS = $CPPFLAGS"
  1166. echo " CXX = $CXX"
  1167. echo " CXXFLAGS = $CXXFLAGS"
  1168. echo " LDFLAGS = $LDFLAGS"
  1169. echo " ARFLAGS = $ARFLAGS"
  1170. echo