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 30KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902
  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, 10)
  5. define(_CLIENT_VERSION_REVISION, 99)
  6. define(_CLIENT_VERSION_BUILD, 0)
  7. define(_CLIENT_VERSION_IS_RELEASE, false)
  8. define(_COPYRIGHT_YEAR, 2015)
  9. AC_INIT([Bitcoin Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[https://github.com/bitcoin/bitcoin/issues],[bitcoin])
  10. AC_CONFIG_SRCDIR([src/main.cpp])
  11. AC_CONFIG_HEADERS([src/config/bitcoin-config.h])
  12. AC_CONFIG_AUX_DIR([build-aux])
  13. AC_CONFIG_MACRO_DIR([build-aux/m4])
  14. AC_CANONICAL_HOST
  15. AH_TOP([#ifndef BITCOIN_CONFIG_H])
  16. AH_TOP([#define BITCOIN_CONFIG_H])
  17. AH_BOTTOM([#endif //BITCOIN_CONFIG_H])
  18. dnl faketime breaks configure and is only needed for make. Disable it here.
  19. unset FAKETIME
  20. dnl Automake init set-up and checks
  21. AM_INIT_AUTOMAKE([no-define subdir-objects foreign])
  22. dnl faketime messes with timestamps and causes configure to be re-run.
  23. dnl --disable-maintainer-mode can be used to bypass this.
  24. AM_MAINTAINER_MODE([enable])
  25. dnl make the compilation flags quiet unless V=1 is used
  26. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  27. dnl Compiler checks (here before libtool).
  28. if test "x${CXXFLAGS+set}" = "xset"; then
  29. CXXFLAGS_overridden=yes
  30. else
  31. CXXFLAGS_overridden=no
  32. fi
  33. AC_PROG_CXX
  34. m4_ifdef([AC_PROG_OBJCXX],[AC_PROG_OBJCXX])
  35. dnl By default, libtool for mingw refuses to link static libs into a dll for
  36. dnl fear of mixing pic/non-pic objects, and import/export complications. Since
  37. dnl we have those under control, re-enable that functionality.
  38. case $host in
  39. *mingw*)
  40. lt_cv_deplibs_check_method="pass_all"
  41. ;;
  42. esac
  43. dnl Libtool init checks.
  44. LT_INIT([pic-only])
  45. dnl Check/return PATH for base programs.
  46. AC_PATH_TOOL(AR, ar)
  47. AC_PATH_TOOL(RANLIB, ranlib)
  48. AC_PATH_TOOL(STRIP, strip)
  49. AC_PATH_TOOL(GCOV, gcov)
  50. AC_PATH_PROG(LCOV, lcov)
  51. AC_PATH_PROG(JAVA, java)
  52. AC_PATH_PROG(GENHTML, genhtml)
  53. AC_PATH_PROG([GIT], [git])
  54. AC_PATH_PROG(CCACHE,ccache)
  55. AC_PATH_PROG(XGETTEXT,xgettext)
  56. AC_PATH_PROG(HEXDUMP,hexdump)
  57. dnl pkg-config check.
  58. PKG_PROG_PKG_CONFIG
  59. # Enable wallet
  60. AC_ARG_ENABLE([wallet],
  61. [AS_HELP_STRING([--enable-wallet],
  62. [enable wallet (default is yes)])],
  63. [enable_wallet=$enableval],
  64. [enable_wallet=yes])
  65. AC_ARG_WITH([miniupnpc],
  66. [AS_HELP_STRING([--with-miniupnpc],
  67. [enable UPNP (default is yes if libminiupnpc is found)])],
  68. [use_upnp=$withval],
  69. [use_upnp=auto])
  70. AC_ARG_ENABLE([upnp-default],
  71. [AS_HELP_STRING([--enable-upnp-default],
  72. [if UPNP is enabled, turn it on at startup (default is no)])],
  73. [use_upnp_default=$enableval],
  74. [use_upnp_default=no])
  75. AC_ARG_ENABLE(tests,
  76. AS_HELP_STRING([--enable-tests],[compile tests (default is yes)]),
  77. [use_tests=$enableval],
  78. [use_tests=yes])
  79. AC_ARG_WITH([comparison-tool],
  80. AS_HELP_STRING([--with-comparison-tool],[path to java comparison tool (requires --enable-tests)]),
  81. [use_comparison_tool=$withval],
  82. [use_comparison_tool=no])
  83. AC_ARG_ENABLE([comparison-tool-reorg-tests],
  84. AS_HELP_STRING([--enable-comparison-tool-reorg-tests],[enable expensive reorg tests in the comparison tool (default no)]),
  85. [use_comparison_tool_reorg_tests=$enableval],
  86. [use_comparison_tool_reorg_tests=no])
  87. AC_ARG_WITH([qrencode],
  88. [AS_HELP_STRING([--with-qrencode],
  89. [enable QR code support (default is yes if qt is enabled and libqrencode is found)])],
  90. [use_qr=$withval],
  91. [use_qr=auto])
  92. AC_ARG_ENABLE([hardening],
  93. [AS_HELP_STRING([--enable-hardening],
  94. [attempt to harden the resulting executables (default is yes)])],
  95. [use_hardening=$enableval],
  96. [use_hardening=yes])
  97. AC_ARG_ENABLE([reduce-exports],
  98. [AS_HELP_STRING([--enable-reduce-exports],
  99. [attempt to reduce exported symbols in the resulting executables (default is no)])],
  100. [use_reduce_exports=$enableval],
  101. [use_reduce_exports=no])
  102. AC_ARG_ENABLE([ccache],
  103. [AS_HELP_STRING([--enable-ccache],
  104. [use ccache for building (default is yes if ccache is found)])],
  105. [use_ccache=$enableval],
  106. [use_ccache=auto])
  107. AC_ARG_ENABLE([lcov],
  108. [AS_HELP_STRING([--enable-lcov],
  109. [enable lcov testing (default is no)])],
  110. [use_lcov=yes],
  111. [use_lcov=no])
  112. AC_ARG_ENABLE([glibc-back-compat],
  113. [AS_HELP_STRING([--enable-glibc-back-compat],
  114. [enable backwards compatibility with glibc])],
  115. [use_glibc_compat=$enableval],
  116. [use_glibc_compat=no])
  117. AC_ARG_WITH([protoc-bindir],[AS_HELP_STRING([--with-protoc-bindir=BIN_DIR],[specify protoc bin path])], [protoc_bin_path=$withval], [])
  118. # Enable debug
  119. AC_ARG_ENABLE([debug],
  120. [AS_HELP_STRING([--enable-debug],
  121. [use debug compiler flags and macros (default is no)])],
  122. [enable_debug=$enableval],
  123. [enable_debug=no])
  124. if test "x$enable_debug" = xyes; then
  125. if test "x$GCC" = xyes; then
  126. CFLAGS="-g3 -O0 -DDEBUG"
  127. fi
  128. if test "x$GXX" = xyes; then
  129. CXXFLAGS="-g3 -O0 -DDEBUG"
  130. fi
  131. fi
  132. ## TODO: Remove these hard-coded paths and flags. They are here for the sake of
  133. ## compatibility with the legacy buildsystem.
  134. ##
  135. if test "x$CXXFLAGS_overridden" = "xno"; then
  136. CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter"
  137. fi
  138. CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"
  139. AC_ARG_WITH([utils],
  140. [AS_HELP_STRING([--with-utils],
  141. [build bitcoin-cli bitcoin-tx (default=yes)])],
  142. [build_bitcoin_utils=$withval],
  143. [build_bitcoin_utils=yes])
  144. AC_ARG_WITH([libs],
  145. [AS_HELP_STRING([--with-libs],
  146. [build libraries (default=yes)])],
  147. [build_bitcoin_libs=$withval],
  148. [build_bitcoin_libs=yes])
  149. AC_ARG_WITH([daemon],
  150. [AS_HELP_STRING([--with-daemon],
  151. [build bitcoind daemon (default=yes)])],
  152. [build_bitcoind=$withval],
  153. [build_bitcoind=yes])
  154. AC_LANG_PUSH([C++])
  155. use_pkgconfig=yes
  156. case $host in
  157. *mingw*)
  158. #pkgconfig does more harm than good with MinGW
  159. use_pkgconfig=no
  160. TARGET_OS=windows
  161. AC_CHECK_LIB([mingwthrd], [main],, AC_MSG_ERROR(lib missing))
  162. AC_CHECK_LIB([kernel32], [main],, AC_MSG_ERROR(lib missing))
  163. AC_CHECK_LIB([user32], [main],, AC_MSG_ERROR(lib missing))
  164. AC_CHECK_LIB([gdi32], [main],, AC_MSG_ERROR(lib missing))
  165. AC_CHECK_LIB([comdlg32], [main],, AC_MSG_ERROR(lib missing))
  166. AC_CHECK_LIB([winspool], [main],, AC_MSG_ERROR(lib missing))
  167. AC_CHECK_LIB([winmm], [main],, AC_MSG_ERROR(lib missing))
  168. AC_CHECK_LIB([shell32], [main],, AC_MSG_ERROR(lib missing))
  169. AC_CHECK_LIB([comctl32], [main],, AC_MSG_ERROR(lib missing))
  170. AC_CHECK_LIB([ole32], [main],, AC_MSG_ERROR(lib missing))
  171. AC_CHECK_LIB([oleaut32], [main],, AC_MSG_ERROR(lib missing))
  172. AC_CHECK_LIB([uuid], [main],, AC_MSG_ERROR(lib missing))
  173. AC_CHECK_LIB([rpcrt4], [main],, AC_MSG_ERROR(lib missing))
  174. AC_CHECK_LIB([advapi32], [main],, AC_MSG_ERROR(lib missing))
  175. AC_CHECK_LIB([ws2_32], [main],, AC_MSG_ERROR(lib missing))
  176. AC_CHECK_LIB([mswsock], [main],, AC_MSG_ERROR(lib missing))
  177. AC_CHECK_LIB([shlwapi], [main],, AC_MSG_ERROR(lib missing))
  178. AC_CHECK_LIB([iphlpapi], [main],, AC_MSG_ERROR(lib missing))
  179. AC_CHECK_LIB([crypt32], [main],, AC_MSG_ERROR(lib missing))
  180. # -static is interpreted by libtool, where it has a different meaning.
  181. # In libtool-speak, it's -all-static.
  182. AX_CHECK_LINK_FLAG([[-static]],[LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static"])
  183. AC_PATH_PROG([MAKENSIS], [makensis], none)
  184. if test x$MAKENSIS = xnone; then
  185. AC_MSG_WARN("makensis not found. Cannot create installer.")
  186. fi
  187. AC_PATH_TOOL(WINDRES, windres, none)
  188. if test x$WINDRES = xnone; then
  189. AC_MSG_ERROR("windres not found")
  190. fi
  191. CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB"
  192. LEVELDB_TARGET_FLAGS="TARGET_OS=OS_WINDOWS_CROSSCOMPILE"
  193. if test "x$CXXFLAGS_overridden" = "xno"; then
  194. CXXFLAGS="$CXXFLAGS -w"
  195. fi
  196. case $host in
  197. i?86-*) WINDOWS_BITS=32 ;;
  198. x86_64-*) WINDOWS_BITS=64 ;;
  199. *) AC_MSG_ERROR("Could not determine win32/win64 for installer") ;;
  200. esac
  201. AC_SUBST(WINDOWS_BITS)
  202. dnl libtool insists upon adding -nostdlib and a list of objects/libs to link against.
  203. dnl That breaks our ability to build dll's with static libgcc/libstdc++/libssp. Override
  204. dnl its command here, with the predeps/postdeps removed, and -static inserted. Postdeps are
  205. dnl also overridden to prevent their insertion later.
  206. dnl This should only affect dll's.
  207. archive_cmds_CXX="\$CC -shared \$libobjs \$deplibs \$compiler_flags -static -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib"
  208. postdeps_CXX=
  209. ;;
  210. *darwin*)
  211. TARGET_OS=darwin
  212. LEVELDB_TARGET_FLAGS="TARGET_OS=Darwin"
  213. if test x$cross_compiling != xyes; then
  214. BUILD_OS=darwin
  215. AC_CHECK_PROG([PORT],port, port)
  216. if test x$PORT = xport; then
  217. dnl add default macports paths
  218. CPPFLAGS="$CPPFLAGS -isystem /opt/local/include"
  219. LIBS="$LIBS -L/opt/local/lib"
  220. if test -d /opt/local/include/db48; then
  221. CPPFLAGS="$CPPFLAGS -I/opt/local/include/db48"
  222. LIBS="$LIBS -L/opt/local/lib/db48"
  223. fi
  224. fi
  225. AC_CHECK_PROG([BREW],brew, brew)
  226. if test x$BREW = xbrew; then
  227. dnl These Homebrew packages may be keg-only, meaning that they won't be found
  228. dnl in expected paths because they may conflict with system files. Ask
  229. dnl Homebrew where each one is located, then adjust paths accordingly.
  230. dnl It's safe to add these paths even if the functionality is disabled by
  231. dnl the user (--without-wallet or --without-gui for example).
  232. openssl_prefix=`$BREW --prefix openssl 2>/dev/null`
  233. bdb_prefix=`$BREW --prefix berkeley-db4 2>/dev/null`
  234. qt5_prefix=`$BREW --prefix qt5 2>/dev/null`
  235. if test x$openssl_prefix != x; then
  236. PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
  237. export PKG_CONFIG_PATH
  238. fi
  239. if test x$bdb_prefix != x; then
  240. CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include"
  241. LIBS="$LIBS -L$bdb_prefix/lib"
  242. fi
  243. if test x$qt5_prefix != x; then
  244. PKG_CONFIG_PATH="$qt5_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
  245. export PKG_CONFIG_PATH
  246. fi
  247. fi
  248. else
  249. case $build_os in
  250. *darwin*)
  251. BUILD_OS=darwin
  252. ;;
  253. *)
  254. AC_PATH_TOOL([INSTALLNAMETOOL], [install_name_tool], install_name_tool)
  255. AC_PATH_TOOL([OTOOL], [otool], otool)
  256. AC_PATH_PROGS([GENISOIMAGE], [genisoimage mkisofs],genisoimage)
  257. dnl libtool will try to strip the static lib, which is a problem for
  258. dnl cross-builds because strip attempts to call a hard-coded ld,
  259. dnl which may not exist in the path. Stripping the .a is not
  260. dnl necessary, so just disable it.
  261. old_striplib=
  262. ;;
  263. esac
  264. fi
  265. AX_CHECK_LINK_FLAG([[-Wl,-headerpad_max_install_names]], [LDFLAGS="$LDFLAGS -Wl,-headerpad_max_install_names"])
  266. CPPFLAGS="$CPPFLAGS -DMAC_OSX"
  267. ;;
  268. *linux*)
  269. TARGET_OS=linux
  270. ;;
  271. *)
  272. ;;
  273. esac
  274. if test x$use_comparison_tool != xno; then
  275. AC_SUBST(JAVA_COMPARISON_TOOL, $use_comparison_tool)
  276. fi
  277. if test x$use_comparison_tool_reorg_tests != xno; then
  278. if test x$use_comparison_tool = x; then
  279. AC_MSG_ERROR("comparison tool reorg tests but comparison tool was not specified")
  280. fi
  281. AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 1)
  282. else
  283. AC_SUBST(COMPARISON_TOOL_REORG_TESTS, 0)
  284. fi
  285. if test x$use_lcov = xyes; then
  286. if test x$LCOV = x; then
  287. AC_MSG_ERROR("lcov testing requested but lcov not found")
  288. fi
  289. if test x$GCOV = x; then
  290. AC_MSG_ERROR("lcov testing requested but gcov not found")
  291. fi
  292. if test x$JAVA = x; then
  293. AC_MSG_ERROR("lcov testing requested but java not found")
  294. fi
  295. if test x$GENHTML = x; then
  296. AC_MSG_ERROR("lcov testing requested but genhtml not found")
  297. fi
  298. if test x$use_comparison_tool = x; then
  299. AC_MSG_ERROR("lcov testing requested but comparison tool was not specified")
  300. fi
  301. LCOV="$LCOV --gcov-tool=$GCOV"
  302. AX_CHECK_COMPILE_FLAG([--coverage],[CXXFLAGS="$CXXFLAGS --coverage"],
  303. [AC_MSG_ERROR("lcov testing requested but --coverage flag does not work")])
  304. fi
  305. dnl Check for endianness
  306. AC_C_BIGENDIAN
  307. dnl Check for pthread compile/link requirements
  308. AX_PTHREAD
  309. # The following macro will add the necessary defines to bitcoin-config.h, but
  310. # they also need to be passed down to any subprojects. Pull the results out of
  311. # the cache and add them to CPPFLAGS.
  312. AC_SYS_LARGEFILE
  313. # detect POSIX or GNU variant of strerror_r
  314. AC_FUNC_STRERROR_R
  315. if test x$ac_cv_sys_file_offset_bits != x &&
  316. test x$ac_cv_sys_file_offset_bits != xno &&
  317. test x$ac_cv_sys_file_offset_bits != xunknown; then
  318. CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
  319. fi
  320. if test x$ac_cv_sys_large_files != x &&
  321. test x$ac_cv_sys_large_files != xno &&
  322. test x$ac_cv_sys_large_files != xunknown; then
  323. CPPFLAGS="$CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files"
  324. fi
  325. AX_CHECK_LINK_FLAG([[-Wl,--large-address-aware]], [LDFLAGS="$LDFLAGS -Wl,--large-address-aware"])
  326. AX_GCC_FUNC_ATTRIBUTE([visibility])
  327. AX_GCC_FUNC_ATTRIBUTE([dllexport])
  328. AX_GCC_FUNC_ATTRIBUTE([dllimport])
  329. if test x$use_glibc_compat != xno; then
  330. #__fdelt_chk's params and return type have changed from long unsigned int to long int.
  331. # See which one is present here.
  332. AC_MSG_CHECKING(__fdelt_chk type)
  333. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef _FORTIFY_SOURCE
  334. #undef _FORTIFY_SOURCE
  335. #endif
  336. #define _FORTIFY_SOURCE 2
  337. #include <sys/select.h>
  338. extern "C" long unsigned int __fdelt_warn(long unsigned int);]],[[]])],
  339. [ fdelt_type="long unsigned int"],
  340. [ fdelt_type="long int"])
  341. AC_MSG_RESULT($fdelt_type)
  342. AC_DEFINE_UNQUOTED(FDELT_TYPE, $fdelt_type,[parameter and return value type for __fdelt_chk])
  343. fi
  344. if test x$use_hardening != xno; then
  345. AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"])
  346. AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"])
  347. AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[
  348. AX_CHECK_PREPROC_FLAG([-U_FORTIFY_SOURCE],[
  349. HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -U_FORTIFY_SOURCE"
  350. ])
  351. HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2"
  352. ])
  353. AX_CHECK_LINK_FLAG([[-Wl,--dynamicbase]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--dynamicbase"])
  354. AX_CHECK_LINK_FLAG([[-Wl,--nxcompat]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--nxcompat"])
  355. AX_CHECK_LINK_FLAG([[-Wl,-z,relro]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"])
  356. AX_CHECK_LINK_FLAG([[-Wl,-z,now]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"])
  357. if test x$TARGET_OS != xwindows; then
  358. # All windows code is PIC, forcing it on just adds useless compile warnings
  359. AX_CHECK_COMPILE_FLAG([-fPIE],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fPIE"])
  360. AX_CHECK_LINK_FLAG([[-pie]], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"])
  361. fi
  362. case $host in
  363. *mingw*)
  364. AC_CHECK_LIB([ssp], [main],, AC_MSG_ERROR(lib missing))
  365. ;;
  366. esac
  367. CXXFLAGS="$CXXFLAGS $HARDENED_CXXFLAGS"
  368. CPPFLAGS="$CPPFLAGS $HARDENED_CPPFLAGS"
  369. LDFLAGS="$LDFLAGS $HARDENED_LDFLAGS"
  370. OBJCXXFLAGS="$CXXFLAGS"
  371. fi
  372. dnl this flag screws up non-darwin gcc even when the check fails. special-case it.
  373. if test x$TARGET_OS = xdarwin; then
  374. AX_CHECK_LINK_FLAG([[-Wl,-dead_strip]], [LDFLAGS="$LDFLAGS -Wl,-dead_strip"])
  375. fi
  376. AC_CHECK_HEADERS([endian.h byteswap.h stdio.h stdlib.h unistd.h strings.h sys/types.h sys/stat.h sys/select.h sys/prctl.h])
  377. AC_SEARCH_LIBS([getaddrinfo_a], [anl], [AC_DEFINE(HAVE_GETADDRINFO_A, 1, [Define this symbol if you have getaddrinfo_a])])
  378. AC_SEARCH_LIBS([inet_pton], [nsl resolv], [AC_DEFINE(HAVE_INET_PTON, 1, [Define this symbol if you have inet_pton])])
  379. AC_CHECK_DECLS([strnlen])
  380. AC_CHECK_DECLS([le16toh, le32toh, le64toh, htole16, htole32, htole64, be16toh, be32toh, be64toh, htobe16, htobe32, htobe64],,,
  381. [#if HAVE_ENDIAN_H
  382. #include <endian.h>
  383. #endif])
  384. AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64],,,
  385. [#if HAVE_BYTESWAP_H
  386. #include <byteswap.h>
  387. #endif])
  388. dnl Check for MSG_NOSIGNAL
  389. AC_MSG_CHECKING(for MSG_NOSIGNAL)
  390. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],
  391. [[ int f = MSG_NOSIGNAL; ]])],
  392. [ AC_MSG_RESULT(yes); AC_DEFINE(HAVE_MSG_NOSIGNAL, 1,[Define this symbol if you have MSG_NOSIGNAL]) ],
  393. [ AC_MSG_RESULT(no)]
  394. )
  395. AC_SEARCH_LIBS([clock_gettime],[rt])
  396. AC_MSG_CHECKING([for visibility attribute])
  397. AC_LINK_IFELSE([AC_LANG_SOURCE([
  398. int foo_def( void ) __attribute__((visibility("default")));
  399. int main(){}
  400. ])],
  401. [
  402. AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE,1,[Define if the visibility attribute is supported.])
  403. AC_MSG_RESULT(yes)
  404. ],
  405. [
  406. AC_MSG_RESULT(no)
  407. if test x$use_reduce_exports = xyes; then
  408. AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduce-exports.])
  409. fi
  410. ]
  411. )
  412. if test x$use_reduce_exports = xyes; then
  413. AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],[RE_CXXFLAGS="-fvisibility=hidden"],
  414. [AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])
  415. fi
  416. LEVELDB_CPPFLAGS=
  417. LIBLEVELDB=
  418. LIBMEMENV=
  419. AM_CONDITIONAL([EMBEDDED_LEVELDB],[true])
  420. AC_SUBST(LEVELDB_CPPFLAGS)
  421. AC_SUBST(LIBLEVELDB)
  422. AC_SUBST(LIBMEMENV)
  423. if test x$enable_wallet != xno; then
  424. dnl Check for libdb_cxx only if wallet enabled
  425. BITCOIN_FIND_BDB48
  426. fi
  427. dnl Check for libminiupnpc (optional)
  428. if test x$use_upnp != xno; then
  429. AC_CHECK_HEADERS(
  430. [miniupnpc/miniwget.h miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h],
  431. [AC_CHECK_LIB([miniupnpc], [main],[MINIUPNPC_LIBS=-lminiupnpc], [have_miniupnpc=no])],
  432. [have_miniupnpc=no]
  433. )
  434. fi
  435. BITCOIN_QT_INIT
  436. dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus
  437. BITCOIN_QT_CONFIGURE([$use_pkgconfig], [qt4])
  438. if test x$build_bitcoin_utils$build_bitcoind$bitcoin_enable_qt$use_tests = xnononono; then
  439. use_boost=no
  440. else
  441. use_boost=yes
  442. fi
  443. if test x$use_boost = xyes; then
  444. dnl Check for boost libs
  445. AX_BOOST_BASE
  446. AX_BOOST_SYSTEM
  447. AX_BOOST_FILESYSTEM
  448. AX_BOOST_PROGRAM_OPTIONS
  449. AX_BOOST_THREAD
  450. AX_BOOST_CHRONO
  451. if test x$use_reduce_exports = xyes; then
  452. AC_MSG_CHECKING([for working boost reduced exports])
  453. TEMP_CPPFLAGS="$CPPFLAGS"
  454. CPPFLAGS="$BOOST_CPPFLAGS $CPPFLAGS"
  455. AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
  456. @%:@include <boost/version.hpp>
  457. ]], [[
  458. #if BOOST_VERSION >= 104900
  459. // Everything is okay
  460. #else
  461. # error Boost version is too old
  462. #endif
  463. ]])],[
  464. AC_MSG_RESULT(yes)
  465. ],[
  466. AC_MSG_ERROR([boost versions < 1.49 are known to be broken with reduced exports. Use --disable-reduce-exports.])
  467. ])
  468. CPPFLAGS="$TEMP_CPPFLAGS"
  469. fi
  470. fi
  471. if test x$use_reduce_exports = xyes; then
  472. CXXFLAGS="$CXXFLAGS $RE_CXXFLAGS"
  473. AX_CHECK_LINK_FLAG([[-Wl,--exclude-libs,ALL]], [RELDFLAGS="-Wl,--exclude-libs,ALL"])
  474. fi
  475. if test x$use_tests = xyes; then
  476. if test x$HEXDUMP = x; then
  477. AC_MSG_ERROR(hexdump is required for tests)
  478. fi
  479. if test x$use_boost = xyes; then
  480. AX_BOOST_UNIT_TEST_FRAMEWORK
  481. dnl Determine if -DBOOST_TEST_DYN_LINK is needed
  482. AC_MSG_CHECKING([for dynamic linked boost test])
  483. TEMP_LIBS="$LIBS"
  484. LIBS="$LIBS $BOOST_LDFLAGS $BOOST_UNIT_TEST_FRAMEWORK_LIB"
  485. TEMP_CPPFLAGS="$CPPFLAGS"
  486. CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  487. AC_LINK_IFELSE([AC_LANG_SOURCE([
  488. #define BOOST_TEST_DYN_LINK
  489. #define BOOST_TEST_MAIN
  490. #include <boost/test/unit_test.hpp>
  491. ])],
  492. [AC_MSG_RESULT(yes)]
  493. [TESTDEFS="$TESTDEFS -DBOOST_TEST_DYN_LINK"],
  494. [AC_MSG_RESULT(no)])
  495. LIBS="$TEMP_LIBS"
  496. CPPFLAGS="$TEMP_CPPFLAGS"
  497. fi
  498. fi
  499. if test x$use_boost = xyes; then
  500. BOOST_LIBS="$BOOST_LDFLAGS $BOOST_SYSTEM_LIB $BOOST_FILESYSTEM_LIB $BOOST_PROGRAM_OPTIONS_LIB $BOOST_THREAD_LIB $BOOST_CHRONO_LIB"
  501. dnl Boost >= 1.50 uses sleep_for rather than the now-deprecated sleep, however
  502. dnl it was broken from 1.50 to 1.52 when backed by nanosleep. Use sleep_for if
  503. dnl a working version is available, else fall back to sleep. sleep was removed
  504. dnl after 1.56.
  505. dnl If neither is available, abort.
  506. TEMP_LIBS="$LIBS"
  507. LIBS="$BOOST_LIBS $LIBS"
  508. TEMP_CPPFLAGS="$CPPFLAGS"
  509. CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  510. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  511. #include <boost/thread/thread.hpp>
  512. #include <boost/version.hpp>
  513. ]],[[
  514. #if BOOST_VERSION >= 105000 && (!defined(BOOST_HAS_NANOSLEEP) || BOOST_VERSION >= 105200)
  515. boost::this_thread::sleep_for(boost::chrono::milliseconds(0));
  516. #else
  517. choke me
  518. #endif
  519. ]])],
  520. [boost_sleep=yes;
  521. AC_DEFINE(HAVE_WORKING_BOOST_SLEEP_FOR, 1, [Define this symbol if boost sleep_for works])],
  522. [boost_sleep=no])
  523. LIBS="$TEMP_LIBS"
  524. CPPFLAGS="$TEMP_CPPFLAGS"
  525. if test x$boost_sleep != xyes; then
  526. TEMP_LIBS="$LIBS"
  527. LIBS="$BOOST_LIBS $LIBS"
  528. TEMP_CPPFLAGS="$CPPFLAGS"
  529. CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
  530. AC_LINK_IFELSE([AC_LANG_PROGRAM([[
  531. #include <boost/version.hpp>
  532. #include <boost/thread.hpp>
  533. #include <boost/date_time/posix_time/posix_time_types.hpp>
  534. ]],[[
  535. #if BOOST_VERSION <= 105600
  536. boost::this_thread::sleep(boost::posix_time::milliseconds(0));
  537. #else
  538. choke me
  539. #endif
  540. ]])],
  541. [boost_sleep=yes; AC_DEFINE(HAVE_WORKING_BOOST_SLEEP, 1, [Define this symbol if boost sleep works])],
  542. [boost_sleep=no])
  543. LIBS="$TEMP_LIBS"
  544. CPPFLAGS="$TEMP_CPPFLAGS"
  545. fi
  546. if test x$boost_sleep != xyes; then
  547. AC_MSG_ERROR(No working boost sleep implementation found.)
  548. fi
  549. fi
  550. if test x$use_pkgconfig = xyes; then
  551. if test x"$PKG_CONFIG" = "x"; then
  552. AC_MSG_ERROR(pkg-config not found.)
  553. fi
  554. : #NOP
  555. m4_ifdef(
  556. [PKG_CHECK_MODULES],
  557. [
  558. PKG_CHECK_MODULES([SSL], [libssl],, [AC_MSG_ERROR(openssl not found.)])
  559. PKG_CHECK_MODULES([CRYPTO], [libcrypto],,[AC_MSG_ERROR(libcrypto not found.)])
  560. BITCOIN_QT_CHECK([PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [BITCOIN_QT_FAIL(libprotobuf not found)])])
  561. if test x$use_qr != xno; then
  562. BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])])
  563. fi
  564. ]
  565. )
  566. else
  567. AC_CHECK_HEADER([openssl/crypto.h],,AC_MSG_ERROR(libcrypto headers missing))
  568. AC_CHECK_LIB([crypto], [main],CRYPTO_LIBS=-lcrypto, AC_MSG_ERROR(libcrypto missing))
  569. AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),)
  570. AC_CHECK_LIB([ssl], [main],SSL_LIBS=-lssl, AC_MSG_ERROR(libssl missing))
  571. BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],[PROTOBUF_LIBS=-lprotobuf], BITCOIN_QT_FAIL(libprotobuf not found)))
  572. if test x$use_qr != xno; then
  573. BITCOIN_QT_CHECK([AC_CHECK_LIB([qrencode], [main],[QR_LIBS=-lqrencode], [have_qrencode=no])])
  574. BITCOIN_QT_CHECK([AC_CHECK_HEADER([qrencode.h],, have_qrencode=no)])
  575. fi
  576. fi
  577. CFLAGS_TEMP="$CFLAGS"
  578. LIBS_TEMP="$LIBS"
  579. CFLAGS="$CFLAGS $SSL_CFLAGS $CRYPTO_CFLAGS"
  580. LIBS="$LIBS $SSL_LIBS $CRYPTO_LIBS"
  581. AC_CHECK_HEADER([openssl/ec.h],, AC_MSG_ERROR(OpenSSL ec header missing),)
  582. CFLAGS="$CFLAGS_TEMP"
  583. LIBS="$LIBS_TEMP"
  584. BITCOIN_QT_PATH_PROGS([PROTOC], [protoc],$protoc_bin_path)
  585. AC_MSG_CHECKING([whether to build bitcoind])
  586. AM_CONDITIONAL([BUILD_BITCOIND], [test x$build_bitcoind = xyes])
  587. AC_MSG_RESULT($build_bitcoind)
  588. AC_MSG_CHECKING([whether to build utils (bitcoin-cli bitcoin-tx)])
  589. AM_CONDITIONAL([BUILD_BITCOIN_UTILS], [test x$build_bitcoin_utils = xyes])
  590. AC_MSG_RESULT($build_bitcoin_utils)
  591. AC_MSG_CHECKING([whether to build libraries])
  592. AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test x$build_bitcoin_libs = xyes])
  593. if test x$build_bitcoin_libs = xyes; then
  594. AC_DEFINE(HAVE_CONSENSUS_LIB, 1, [Define this symbol if the consensus lib has been built])
  595. AC_CONFIG_FILES([libbitcoinconsensus.pc:libbitcoinconsensus.pc.in])
  596. fi
  597. AC_MSG_RESULT($build_bitcoin_libs)
  598. AC_LANG_POP
  599. if test "x$use_ccache" != "xno"; then
  600. AC_MSG_CHECKING(if ccache should be used)
  601. if test x$CCACHE = x; then
  602. if test "x$use_ccache" = "xyes"; then
  603. AC_MSG_ERROR([ccache not found.]);
  604. else
  605. use_ccache=no
  606. fi
  607. else
  608. use_ccache=yes
  609. CC="$ac_cv_path_CCACHE $CC"
  610. CXX="$ac_cv_path_CCACHE $CXX"
  611. fi
  612. AC_MSG_RESULT($use_ccache)
  613. fi
  614. if test "x$use_ccache" = "xyes"; then
  615. AX_CHECK_PREPROC_FLAG([-Qunused-arguments],[CPPFLAGS="-Qunused-arguments $CPPFLAGS"])
  616. fi
  617. dnl enable wallet
  618. AC_MSG_CHECKING([if wallet should be enabled])
  619. if test x$enable_wallet != xno; then
  620. AC_MSG_RESULT(yes)
  621. AC_DEFINE_UNQUOTED([ENABLE_WALLET],[1],[Define to 1 to enable wallet functions])
  622. else
  623. AC_MSG_RESULT(no)
  624. fi
  625. dnl enable upnp support
  626. AC_MSG_CHECKING([whether to build with support for UPnP])
  627. if test x$have_miniupnpc = xno; then
  628. if test x$use_upnp = xyes; then
  629. AC_MSG_ERROR("UPnP requested but cannot be built. use --without-miniupnpc")
  630. fi
  631. AC_MSG_RESULT(no)
  632. else
  633. if test x$use_upnp != xno; then
  634. AC_MSG_RESULT(yes)
  635. AC_MSG_CHECKING([whether to build with UPnP enabled by default])
  636. use_upnp=yes
  637. upnp_setting=0
  638. if test x$use_upnp_default != xno; then
  639. use_upnp_default=yes
  640. upnp_setting=1
  641. fi
  642. AC_MSG_RESULT($use_upnp_default)
  643. AC_DEFINE_UNQUOTED([USE_UPNP],[$upnp_setting],[UPnP support not compiled if undefined, otherwise value (0 or 1) determines default state])
  644. if test x$TARGET_OS = xwindows; then
  645. MINIUPNPC_CPPFLAGS="-DSTATICLIB -DMINIUPNP_STATICLIB"
  646. fi
  647. else
  648. AC_MSG_RESULT(no)
  649. fi
  650. fi
  651. dnl these are only used when qt is enabled
  652. if test x$bitcoin_enable_qt != xno; then
  653. BUILD_QT=qt
  654. dnl enable dbus support
  655. AC_MSG_CHECKING([whether to build GUI with support for D-Bus])
  656. if test x$bitcoin_enable_qt_dbus != xno; then
  657. AC_DEFINE([USE_DBUS],[1],[Define if dbus support should be compiled in])
  658. fi
  659. AC_MSG_RESULT($bitcoin_enable_qt_dbus)
  660. dnl enable qr support
  661. AC_MSG_CHECKING([whether to build GUI with support for QR codes])
  662. if test x$have_qrencode = xno; then
  663. if test x$use_qr = xyes; then
  664. AC_MSG_ERROR("QR support requested but cannot be built. use --without-qrencode")
  665. fi
  666. AC_MSG_RESULT(no)
  667. else
  668. if test x$use_qr != xno; then
  669. AC_MSG_RESULT(yes)
  670. AC_DEFINE([USE_QRCODE],[1],[Define if QR support should be compiled in])
  671. use_qr=yes
  672. else
  673. AC_MSG_RESULT(no)
  674. fi
  675. fi
  676. if test x$XGETTEXT = x; then
  677. AC_MSG_WARN("xgettext is required to update qt translations")
  678. fi
  679. AC_MSG_CHECKING([whether to build test_bitcoin-qt])
  680. if test x$use_tests$bitcoin_enable_qt_test = xyesyes; then
  681. AC_MSG_RESULT([yes])
  682. BUILD_TEST_QT="test"
  683. else
  684. AC_MSG_RESULT([no])
  685. fi
  686. fi
  687. AC_MSG_CHECKING([whether to build test_bitcoin])
  688. if test x$use_tests = xyes; then
  689. AC_MSG_RESULT([yes])
  690. BUILD_TEST="test"
  691. else
  692. AC_MSG_RESULT([no])
  693. fi
  694. AC_MSG_CHECKING([whether to reduce exports])
  695. if test x$use_reduce_exports = xyes; then
  696. AC_MSG_RESULT([yes])
  697. else
  698. AC_MSG_RESULT([no])
  699. fi
  700. if test x$build_bitcoin_utils$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$use_tests = xnonononono; then
  701. AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui or --enable-tests])
  702. fi
  703. AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin])
  704. AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin])
  705. AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])
  706. AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes])
  707. AM_CONDITIONAL([ENABLE_TESTS],[test x$use_tests = xyes])
  708. AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes])
  709. AM_CONDITIONAL([ENABLE_QT_TESTS],[test x$use_tests$bitcoin_enable_qt_test = xyesyes])
  710. AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
  711. AM_CONDITIONAL([USE_LCOV],[test x$use_lcov = xyes])
  712. AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno])
  713. AM_CONDITIONAL([USE_COMPARISON_TOOL_REORG_TESTS],[test x$use_comparison_tool_reorg_test != xno])
  714. AM_CONDITIONAL([GLIBC_BACK_COMPAT],[test x$use_glibc_compat = xyes])
  715. AC_DEFINE(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR, [Major version])
  716. AC_DEFINE(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR, [Minor version])
  717. AC_DEFINE(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION, [Build revision])
  718. AC_DEFINE(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD, [Version Build])
  719. AC_DEFINE(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE, [Version is release])
  720. AC_DEFINE(COPYRIGHT_YEAR, _COPYRIGHT_YEAR, [Version is release])
  721. AC_SUBST(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR)
  722. AC_SUBST(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR)
  723. AC_SUBST(CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION)
  724. AC_SUBST(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD)
  725. AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE)
  726. AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR)
  727. AC_SUBST(RELDFLAGS)
  728. AC_SUBST(LIBTOOL_APP_LDFLAGS)
  729. AC_SUBST(USE_UPNP)
  730. AC_SUBST(USE_QRCODE)
  731. AC_SUBST(BOOST_LIBS)
  732. AC_SUBST(TESTDEFS)
  733. AC_SUBST(LEVELDB_TARGET_FLAGS)
  734. AC_SUBST(BUILD_TEST)
  735. AC_SUBST(BUILD_QT)
  736. AC_SUBST(BUILD_TEST_QT)
  737. AC_SUBST(MINIUPNPC_CPPFLAGS)
  738. AC_SUBST(MINIUPNPC_LIBS)
  739. AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py])
  740. AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh])
  741. AC_CONFIG_FILES([qa/pull-tester/tests-config.sh],[chmod +x qa/pull-tester/tests-config.sh])
  742. dnl boost's m4 checks do something really nasty: they export these vars. As a
  743. dnl result, they leak into secp256k1's configure and crazy things happen.
  744. dnl Until this is fixed upstream and we've synced, we'll just un-export them.
  745. CPPFLAGS_TEMP="$CPPFLAGS"
  746. unset CPPFLAGS
  747. CPPFLAGS="$CPPFLAGS_TEMP"
  748. LDFLAGS_TEMP="$LDFLAGS"
  749. unset LDFLAGS
  750. LDFLAGS="$LDFLAGS_TEMP"
  751. LIBS_TEMP="$LIBS"
  752. unset LIBS
  753. LIBS="$LIBS_TEMP"
  754. PKGCONFIG_PATH_TEMP="$PKG_CONFIG_PATH"
  755. unset PKG_CONFIG_PATH
  756. PKG_CONFIG_PATH="$PKGCONFIG_PATH_TEMP"
  757. PKGCONFIG_LIBDIR_TEMP="$PKG_CONFIG_LIBDIR"
  758. unset PKG_CONFIG_LIBDIR
  759. PKG_CONFIG_LIBDIR="$PKGCONFIG_LIBDIR_TEMP"
  760. ac_configure_args="${ac_configure_args} --disable-shared --with-pic"
  761. AC_CONFIG_SUBDIRS([src/secp256k1])
  762. AC_OUTPUT
  763. dnl Taken from https://wiki.debian.org/RpathIssue
  764. case $host in
  765. *-*-linux-gnu)
  766. AC_MSG_RESULT([Fixing libtool for -rpath problems.])
  767. sed < libtool > libtool-2 \
  768. 's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/'
  769. mv libtool-2 libtool
  770. chmod 755 libtool
  771. ;;
  772. esac