configure.ac 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. #
  4. AC_PREREQ([2.67])
  5. AC_INIT([aria2],[1.18.5],[t-tujikawa@users.sourceforge.net],[aria2],[http://aria2.sourceforge.net/])
  6. AC_CANONICAL_HOST
  7. AC_CANONICAL_TARGET
  8. AM_INIT_AUTOMAKE([subdir-objects])
  9. m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  10. AC_USE_SYSTEM_EXTENSIONS
  11. LT_PREREQ([2.2.6])
  12. LT_INIT([disable-static])
  13. dnl See versioning rule:
  14. dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
  15. AC_SUBST(LT_CURRENT, 0)
  16. AC_SUBST(LT_REVISION, 0)
  17. AC_SUBST(LT_AGE, 0)
  18. AC_CONFIG_MACRO_DIR([m4])
  19. AM_PATH_CPPUNIT(1.10.2)
  20. AC_CONFIG_SRCDIR([src/a2io.h])
  21. AC_CONFIG_HEADERS([config.h])
  22. case "$host" in
  23. *mingw*)
  24. win_build=yes
  25. LIBS="$LIBS -lws2_32 -lwsock32 -lgdi32 -lwinmm -liphlpapi -lpsapi"
  26. # C++ headers defines __USE_MINGW_ANSI_STDIO to 1 unconditionally.
  27. # We have to use it as well nonetheless.
  28. CPPFLAGS="-D__USE_MINGW_ANSI_STDIO=1 $CPPFLAGS"
  29. ;;
  30. esac
  31. AC_DEFINE_UNQUOTED([TARGET], ["$target"], [Define target-type])
  32. # Checks for arguments.
  33. ARIA2_ARG_WITHOUT([libuv])
  34. ARIA2_ARG_WITHOUT([appletls])
  35. ARIA2_ARG_WITH([wintls])
  36. ARIA2_ARG_WITHOUT([gnutls])
  37. ARIA2_ARG_WITHOUT([libnettle])
  38. ARIA2_ARG_WITHOUT([libgmp])
  39. ARIA2_ARG_WITHOUT([libgcrypt])
  40. ARIA2_ARG_WITHOUT([openssl])
  41. ARIA2_ARG_WITHOUT([sqlite3])
  42. ARIA2_ARG_WITHOUT([libxml2])
  43. ARIA2_ARG_WITHOUT([libexpat])
  44. ARIA2_ARG_WITHOUT([libcares])
  45. ARIA2_ARG_WITHOUT([libz])
  46. ARIA2_ARG_WITH([tcmalloc])
  47. ARIA2_ARG_WITH([jemalloc])
  48. ARIA2_ARG_DISABLE([ssl])
  49. ARIA2_ARG_DISABLE([bittorrent])
  50. ARIA2_ARG_DISABLE([metalink])
  51. ARIA2_ARG_DISABLE([epoll])
  52. ARIA2_ARG_ENABLE([libaria2])
  53. AC_ARG_WITH([ca-bundle],
  54. AS_HELP_STRING([--with-ca-bundle=FILE],[Use FILE as default CA bundle.]),
  55. [AC_DEFINE_UNQUOTED([CA_BUNDLE], ["$withval"], [Define to choose default CA bundle.])
  56. ca_bundle=$withval
  57. ], [])
  58. AC_ARG_WITH([disk-cache],
  59. AS_HELP_STRING([--with-disk-cache=SIZE],[Use SIZE as the default disk-cache size.]),
  60. [AC_DEFINE_UNQUOTED([DEFAULT_DISK_CACHE], ["$withval"], [Define to choose default disk-cache size])],
  61. [])
  62. AC_ARG_WITH([bashcompletiondir],
  63. AS_HELP_STRING([--with-bashcompletiondir=DIR],
  64. [Directory to install bash_completion file]),
  65. [bashcompletiondir=$withval], [bashcompletiondir=$docdir/bash_completion])
  66. AC_ARG_VAR([ARIA2_STATIC], [Set 'yes' to build a statically linked aria2])
  67. # Checks for programs.
  68. AC_PROG_CXX
  69. AC_PROG_CC
  70. AC_PROG_INSTALL
  71. AC_PROG_MKDIR_P
  72. AC_PROG_YACC
  73. AM_PROG_AS
  74. AC_CHECK_TOOL([AR], [ar], [:])
  75. if test "x$AR" = "x:"; then
  76. AC_MSG_FAILURE([ar is not found in the system.])
  77. fi
  78. AC_SUBST([AR])
  79. AC_PATH_PROG([A2X], [a2x])
  80. AC_SUBST([A2X])
  81. AM_CONDITIONAL([HAVE_A2X], [ test "x$A2X" != "x" ])
  82. AC_PATH_PROG([ASCIIDOC], [asciidoc])
  83. AC_SUBST([ASCIIDOC])
  84. AM_CONDITIONAL([HAVE_ASCIIDOC], [ test "x$ASCIIDOC" != "x" ])
  85. AC_PATH_PROGS([SPHINXBUILD], [sphinx-build])
  86. AC_SUBST([SPHINXBUILD])
  87. AM_CONDITIONAL([HAVE_SPHINXBUILD], [ test "x$SPHINXBUILD" != "x" ])
  88. AC_PATH_PROGS([RST2HTML], [rst2html.py rst2html])
  89. AC_SUBST([RST2HTML])
  90. AM_CONDITIONAL([HAVE_RST2HTML], [ test "x$RST2HTML" != "x" ])
  91. # Setting language choice
  92. AC_LANG([C++])
  93. # Check pkg-config is available
  94. PKG_PROG_PKG_CONFIG([0.20])
  95. # Check C++ compiler supports C++0x/C++11 feature
  96. AX_CXX_COMPILE_STDCXX_11([noext], [mandatory])
  97. # i686-w64-mingw32-g++ 4.6 does not support override keyword. For
  98. # those compilers, define CXX11_OVERRIDE to empty string. Otherwise
  99. # define it as override. Use CXX11_OVERRIDE instead of override.
  100. AC_MSG_CHECKING([whether the C++ compiler supports `override` keyword])
  101. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  102. struct Base {
  103. virtual void f() = 0;
  104. };
  105. struct Derived : Base {
  106. virtual void f() override {}
  107. };
  108. ]],
  109. [[
  110. Derived x;
  111. ]])],
  112. [cxx11_override=override
  113. AC_MSG_RESULT([yes])],
  114. [AC_MSG_RESULT([no])])
  115. AC_DEFINE_UNQUOTED([CXX11_OVERRIDE], [$cxx11_override],
  116. [Define `override` keyword if the compiler supports it])
  117. # Check static build is requested
  118. if test "x$ARIA2_STATIC" = "xyes"; then
  119. case "$host" in
  120. i686*mingw*)
  121. dnl Define _USE_32BIT_TIME_T because 32bit library of MinGW-w64
  122. dnl does not implement many 64bit version functions.
  123. CPPFLAGS="-D_USE_32BIT_TIME_T $CPPFLAGS"
  124. ;;
  125. esac
  126. # Make pkg-config produce static linking variables
  127. PKG_CONFIG="$PKG_CONFIG --static"
  128. else
  129. dnl Make variable empty to avoid confusion
  130. ARIA2_STATIC=
  131. fi
  132. # Checks for libraries.
  133. # Check availability of libz
  134. if test "x$with_libz" = "xyes"; then
  135. PKG_CHECK_MODULES([ZLIB], [zlib >= 1.2.3], [have_zlib=yes], [have_zlib=no])
  136. if test "x$have_zlib" = "xyes"; then
  137. LIBS="$ZLIB_LIBS $LIBS"
  138. CPPFLAGS="$ZLIB_CFLAGS $CPPFLAGS"
  139. else
  140. AC_MSG_WARN([$ZLIB_PKG_ERRORS])
  141. AC_CHECK_LIB([z], [zlibVersion], [have_zlib=yes], [have_zlib=no])
  142. if test "x$have_zlib" = "xyes"; then
  143. LIBS="-lz $LIBS"
  144. elif test "x$with_libz_requested" = "xyes"; then
  145. ARIA2_DEP_NOT_MET([libz])
  146. fi
  147. fi
  148. if test "x$have_zlib" = "xyes"; then
  149. AC_DEFINE([HAVE_ZLIB], [1], [Define to 1 if you have zlib.])
  150. # Android NDK arch-mips contains gzbuffer symbol but it is missing
  151. # in zlib.h
  152. AC_CHECK_DECL([gzbuffer], [have_decl_gzbuffer=yes], [],
  153. [[#include <zlib.h>]])
  154. if test "x$have_decl_gzbuffer" = "xyes"; then
  155. AC_CHECK_FUNC([gzbuffer])
  156. fi
  157. AC_CHECK_FUNCS([gzsetparams])
  158. fi
  159. fi
  160. if test "x$with_libuv" = "xyes"; then
  161. case "$host" in
  162. *mingw*|*msvc*)
  163. old_CPPFLAGS=$CPPFLAGS
  164. CPPFLAGS="$CPPFLAGS -D_WIN32_WINNT=0x0600"
  165. AC_SEARCH_LIBS([uv_poll_init_socket], [uv], [
  166. AC_CHECK_HEADER([uv.h], [have_libuv=yes], [have_libuv=no])
  167. break;
  168. ], [have_libuv=no])
  169. if test "x$have_libuv" != "xyes"; then
  170. CPPFLAGS=$old_CPPFLAGS
  171. fi
  172. ;;
  173. *darwin*)
  174. old_LDFLAGS=$LDFLAGS
  175. LDFLAGS="$LDFLAGS -framework Foundation -framework CoreServices -framework ApplicationServices"
  176. old_LIBS=$LIBS
  177. LIBS="$LIBS -lm"
  178. AC_SEARCH_LIBS([uv_poll_init_socket], [uv], [
  179. AC_CHECK_HEADER([uv.h], [have_libuv=yes], [have_libuv=no])
  180. break;
  181. ], [have_libuv=no])
  182. if test "x$have_libuv" != "xyes"; then
  183. LDFLAGS=$old_LDFLAGS
  184. LIBS=$old_LIBS
  185. fi
  186. ;;
  187. *)
  188. dnl Yeah, sucks that luv does not bring a pkg-config or config-tool
  189. AC_MSG_CHECKING([for libuv])
  190. for combo in "" "-lrt" "-ldl -lrt" "-ldl -lrt -lpthread" "-lkvm"; do
  191. old_LIBS=$LIBS
  192. LIBS="-luv $combo $LIBS -lm"
  193. AC_LINK_IFELSE([AC_LANG_SOURCE([
  194. extern "C" int uv_poll_init_socket(void);
  195. int main() { return uv_poll_init_socket(); }
  196. ])], [
  197. AC_MSG_RESULT(-luv $combo -lm)
  198. AC_CHECK_HEADER([uv.h], [have_libuv=yes], [have_libuv=no])
  199. break;
  200. ], [have_libuv=no])
  201. if test "x$have_libuv" = "xyes"; then
  202. break;
  203. else
  204. LIBS=$old_LIBS
  205. fi
  206. done
  207. if test "x$have_libuv" != "xyes"; then
  208. AC_MSG_RESULT("no")
  209. fi
  210. ;;
  211. esac
  212. if test "x$have_libuv" = "xyes"; then
  213. AC_DEFINE([HAVE_LIBUV], [1], [Define to 1 if you have libuv.])
  214. AC_CHECK_FUNCS([uv_last_error])
  215. elif test "x$with_libuv_requested" = "xyes"; then
  216. ARIA2_DEP_NOT_MET([libuv])
  217. fi
  218. fi
  219. AM_CONDITIONAL([HAVE_LIBUV], [test "x$have_libuv" = "xyes"])
  220. if test "x$with_libxml2" = "xyes"; then
  221. AM_PATH_XML2([2.6.24], [have_libxml2=yes])
  222. if test "x$have_libxml2" = "xyes"; then
  223. AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if you have libxml2.])
  224. LIBS="$XML_LIBS $LIBS"
  225. CPPFLAGS="$XML_CPPFLAGS $CPPFLAGS"
  226. elif test "x$with_libxml2_requested" = "xyes"; then
  227. ARIA2_DEP_NOT_MET([libxml2])
  228. fi
  229. fi
  230. if test "x$with_libexpat" = "xyes" && test "x$have_libxml2" != "xyes"; then
  231. AM_PATH_LIBEXPAT
  232. if test "x$have_libexpat" = "xyes"; then
  233. LIBS="$EXPAT_LIBS $LIBS"
  234. CPPFLAGS="$EXPAT_CFLAGS $CPPFLAGS"
  235. elif test "x$with_libexpat_requested" = "xyes"; then
  236. ARIA2_DEP_NOT_MET([libexpat])
  237. fi
  238. fi
  239. if test "x$with_sqlite3" = "xyes"; then
  240. PKG_CHECK_MODULES([SQLITE3],[sqlite3],[have_sqlite3=yes],[have_sqlite3=no])
  241. if test "x$have_sqlite3" = "xyes"; then
  242. AC_DEFINE([HAVE_SQLITE3], [1], [Define to 1 if you have sqlite3.])
  243. LIBS="$SQLITE3_LIBS $LIBS"
  244. CPPFLAGS="$SQLITE3_CFLAGS $CPPFLAGS"
  245. AC_CHECK_FUNCS([sqlite3_open_v2])
  246. else
  247. AC_MSG_WARN([$SQLITE3_PKG_ERRORS])
  248. if test "x$with_sqlite3_requested" = "xyes"; then
  249. ARIA2_DEP_NOT_MET([sqlite3])
  250. fi
  251. fi
  252. fi
  253. case "$host" in
  254. *darwin*)
  255. have_osx="yes"
  256. ;;
  257. *mingw*)
  258. AC_CHECK_HEADERS([windows.h \
  259. winsock2.h \
  260. ws2tcpip.h \
  261. mmsystem.h \
  262. io.h \
  263. iphlpapi.h\
  264. winioctl.h \
  265. share.h], [], [],
  266. [[
  267. #ifdef HAVE_WS2TCPIP_H
  268. # include <ws2tcpip.h>
  269. #endif
  270. #ifdef HAVE_WINSOCK2_H
  271. # include <winsock2.h>
  272. #endif
  273. #ifdef HAVE_WINDOWS_H
  274. # include <windows.h>
  275. #endif
  276. ]])
  277. ;;
  278. esac
  279. if test "x$enable_ssl" != "xyes"; then
  280. with_appletls=no
  281. with_wintls=no
  282. with_libnettle=no
  283. with_libgcrypt=no
  284. with_gnutls=no
  285. with_openssl=no
  286. fi
  287. if test "x$with_appletls" = "xyes"; then
  288. AC_MSG_CHECKING([whether to enable Mac OS X native SSL/TLS])
  289. if test "x$have_osx" = "xyes"; then
  290. AC_DEFINE([HAVE_APPLETLS], [1], [Define to 1 if you have Apple TLS])
  291. LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security"
  292. have_appletls="yes"
  293. AC_MSG_RESULT(yes)
  294. else
  295. AC_MSG_RESULT(no)
  296. if test "x$with_appletls_requested" = "xyes"; then
  297. ARIA2_DEP_NOT_MET([appletls])
  298. fi
  299. fi
  300. fi
  301. if test "x$with_wintls" = "xyes"; then
  302. AC_HAVE_LIBRARY([crypt32],[have_wintls_libs=yes],[have_wintls_libs=no])
  303. AC_HAVE_LIBRARY([secur32],[have_wintls_libs=$have_wintls_libs],[have_wintls_libs=no])
  304. AC_HAVE_LIBRARY([advapi32],[have_wintls_libs=$have_wintls_libs],[have_wintls_libs=no])
  305. AC_CHECK_HEADER([wincrypt.h], [have_wintls_headers=yes], [have_wintls_headers=no], [[
  306. #ifdef HAVE_WINDOWS_H
  307. # include <windows.h>
  308. #endif
  309. ]])
  310. AC_CHECK_HEADER([security.h], [have_wintls_headers=$have_wintls_headers], [have_wintls_headers=no], [[
  311. #ifdef HAVE_WINDOWS_H
  312. # include <windows.h>
  313. #endif
  314. #ifndef SECURITY_WIN32
  315. #define SECURITY_WIN32 1
  316. #endif
  317. ]])
  318. if test "x$have_wintls_libs" = "xyes" &&
  319. test "x$have_wintls_headers" = "xyes"; then
  320. AC_DEFINE([SECURITY_WIN32], [1], [Use security.h in WIN32 mode])
  321. LIBS="$LIBS -lcrypt32 -lsecur32 -ladvapi32"
  322. have_wintls=yes
  323. else
  324. have_wintls=no
  325. fi
  326. if test "x$have_wintls" != "xyes"; then
  327. if test "x$with_wintls_requested" = "xyes"; then
  328. ARIA2_DEP_NOT_MET([wintls])
  329. fi
  330. fi
  331. fi
  332. if test "x$with_gnutls" = "xyes" && test "x$have_appletls" != "xyes" && test "x$have_wintls" != "xyes"; then
  333. # gnutls >= 2.8 doesn't have libgnutls-config anymore. We require
  334. # 2.2.0 because we use gnutls_priority_set_direct()
  335. PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.2.0],
  336. [have_libgnutls=yes], [have_libgnutls=no])
  337. if test "x$have_libgnutls" = "xyes"; then
  338. AC_DEFINE([HAVE_LIBGNUTLS], [1], [Define to 1 if you have libgnutls.])
  339. LIBS="$LIBGNUTLS_LIBS $LIBS"
  340. CPPFLAGS="$LIBGNUTLS_CFLAGS $CPPFLAGS"
  341. AC_CHECK_FUNCS([gnutls_certificate_set_x509_system_trust])
  342. else
  343. AC_MSG_WARN([$LIBGNUTLS_PKG_ERRORS])
  344. if test "x$with_gnutls_requested" = "xyes"; then
  345. ARIA2_DEP_NOT_MET([gnutls])
  346. fi
  347. fi
  348. fi
  349. if test "x$with_openssl" = "xyes" && test "x$have_appletls" != "xyes" && test "x$have_wintls" != "xyes" && test "x$have_libgnutls" != "xyes"; then
  350. PKG_CHECK_MODULES([OPENSSL], [openssl >= 0.9.8],
  351. [have_openssl=yes], [have_openssl=no])
  352. if test "x$have_openssl" = "xyes"; then
  353. AC_DEFINE([HAVE_OPENSSL], [1], [Define to 1 if you have openssl.])
  354. LIBS="$OPENSSL_LIBS $LIBS"
  355. CPPFLAGS="$OPENSSL_CFLAGS $CPPFLAGS"
  356. AC_CHECK_FUNCS([EVP_DigestInit_ex], [have_digestinit_ex=yes])
  357. if test "x$have_digestinit_ex" = "x"; then
  358. AC_DEFINE([HAVE_OLD_OPENSSL], [1], [Define to 1 if you have old openssl.])
  359. fi
  360. AC_CHECK_FUNCS([EVP_sha224])
  361. AC_CHECK_FUNCS([EVP_sha256])
  362. AC_CHECK_FUNCS([EVP_sha384])
  363. AC_CHECK_FUNCS([EVP_sha512])
  364. else
  365. AC_MSG_WARN([$OPENSSL_PKG_ERRORS])
  366. if test "x$with_openssl_requested" = "xyes"; then
  367. ARIA2_DEP_NOT_MET([openssl])
  368. fi
  369. fi
  370. fi
  371. if test "x$have_openssl" != "xyes"; then
  372. if test "x$with_libnettle" = "xyes"; then
  373. AC_SEARCH_LIBS([nettle_sha1_init], [nettle],
  374. [have_libnettle=yes], [have_libnettle=no])
  375. if test "x$have_libnettle" = "xyes"; then
  376. AC_DEFINE([HAVE_LIBNETTLE], [1], [Define to 1 if you have libnettle.])
  377. fi
  378. fi
  379. if test "x$with_libgmp" = "xyes" &&
  380. (test "x$have_libnettle" = "xyes" ||
  381. test "x$have_appletls" = "xyes" ||
  382. test "x$have_wintls" = "xyes") &&
  383. test "x$enable_bittorrent" = "xyes"; then
  384. AC_SEARCH_LIBS([__gmpz_init], [gmp], [have_libgmp=yes], [have_libgmp=no])
  385. if test "x$have_libgmp" = "xyes"; then
  386. AC_DEFINE([HAVE_LIBGMP], [1], [Define to 1 if you have libgmp.])
  387. else
  388. AC_MSG_WARN([libgmp not found])
  389. if test "x$with_libgmp_requested" = "xyes"; then
  390. ARIA2_DEP_NOT_MET([libgmp])
  391. fi
  392. fi
  393. fi
  394. if test "x$with_libgcrypt" = "xyes" &&
  395. test "x$have_libnettle" != "xyes"; then
  396. AM_PATH_LIBGCRYPT([1.2.4], [have_libgcrypt=yes])
  397. if test "x$have_libgcrypt" = "xyes"; then
  398. AC_DEFINE([HAVE_LIBGCRYPT], [1], [Define to 1 if you have libgcrypt.])
  399. LIBS="$LIBGCRYPT_LIBS $LIBS"
  400. CPPFLAGS="$LIBGCRYPT_CFLAGS $CPPFLAGS"
  401. fi
  402. fi
  403. fi
  404. if test "x$with_libcares" = "xyes"; then
  405. PKG_CHECK_MODULES([LIBCARES], [libcares >= 1.7.0], [have_libcares=yes],
  406. [have_libcares=no])
  407. if test "x$have_libcares" = "xyes"; then
  408. AC_DEFINE([HAVE_LIBCARES], [1], [Define to 1 if you have libcares.])
  409. LIBS="$LIBCARES_LIBS $LIBS"
  410. CPPFLAGS="$LIBCARES_CFLAGS $CPPFLAGS"
  411. AC_CHECK_TYPES([ares_addr_node], [], [], [[#include <ares.h>]])
  412. AC_CHECK_FUNCS([ares_set_servers])
  413. if test "x$ARIA2_STATIC" = "xyes"; then
  414. CPPFLAGS="-DCARES_STATICLIB $CPPFLAGS"
  415. fi
  416. else
  417. AC_MSG_WARN([$LIBCARES_PKG_ERRORS])
  418. if test "x$with_libcares_requested" = "xyes"; then
  419. ARIA2_DEP_NOT_MET([libcares])
  420. fi
  421. fi
  422. fi
  423. use_md=""
  424. if test "x$have_appletls" = "xyes"; then
  425. use_md="apple"
  426. AC_DEFINE([USE_APPLE_MD], [1], [What message digest implementation to use])
  427. else
  428. if test "x$have_wintls" = "xyes"; then
  429. use_md="windows"
  430. AC_DEFINE([USE_WINDOWS_MD], [1], [What message digest implementation to use])
  431. else
  432. if test "x$have_libnettle" = "xyes"; then
  433. AC_DEFINE([USE_LIBNETTLE_MD], [1], [What message digest implementation to use])
  434. use_md="libnettle"
  435. else
  436. if test "x$have_libgcrypt" = "xyes"; then
  437. AC_DEFINE([USE_LIBGCRYPT_MD], [1], [What message digest implementation to use])
  438. use_md="libgcrypt"
  439. else
  440. if test "x$have_openssl" = "xyes"; then
  441. AC_DEFINE([USE_OPENSSL_MD], [1], [What message digest implementation to use])
  442. use_md="openssl"
  443. else
  444. AC_DEFINE([USE_INTERNAL_MD], [1], [What message digest implementation to use])
  445. use_md="internal"
  446. fi
  447. fi
  448. fi
  449. fi
  450. fi
  451. # Define variables based on the result of the checks for libraries.
  452. if test "x$have_appletls" = "xyes" || test "x$have_wintls" = "xyes" || test "x$have_libgnutls" = "xyes" || test "x$have_openssl" = "xyes"; then
  453. have_ssl="yes"
  454. AC_DEFINE([ENABLE_SSL], [1], [Define to 1 if ssl support is enabled.])
  455. AM_CONDITIONAL([ENABLE_SSL], true)
  456. else
  457. have_ssl="no"
  458. AM_CONDITIONAL([ENABLE_SSL], false)
  459. fi
  460. AM_CONDITIONAL([HAVE_OSX], [ test "x$have_osx" = "xyes" ])
  461. AM_CONDITIONAL([HAVE_APPLETLS], [ test "x$have_appletls" = "xyes" ])
  462. AM_CONDITIONAL([HAVE_WINTLS], [ test "x$have_wintls" = "xyes" ])
  463. AM_CONDITIONAL([USE_APPLE_MD], [ test "x$use_md" = "xapple" ])
  464. AM_CONDITIONAL([USE_WINDOWS_MD], [ test "x$use_md" = "xwindows" ])
  465. AM_CONDITIONAL([HAVE_LIBGNUTLS], [ test "x$have_libgnutls" = "xyes" ])
  466. AM_CONDITIONAL([HAVE_LIBNETTLE], [ test "x$have_libnettle" = "xyes" ])
  467. AM_CONDITIONAL([USE_LIBNETTLE_MD], [ test "x$use_md" = "xlibnettle"])
  468. AM_CONDITIONAL([HAVE_LIBGMP], [ test "x$have_libgmp" = "xyes" ])
  469. AM_CONDITIONAL([HAVE_LIBGCRYPT], [ test "x$have_libgcrypt" = "xyes" ])
  470. AM_CONDITIONAL([USE_LIBGCRYPT_MD], [ test "x$use_md" = "xlibgcrypt"])
  471. AM_CONDITIONAL([HAVE_OPENSSL], [ test "x$have_openssl" = "xyes" ])
  472. AM_CONDITIONAL([USE_OPENSSL_MD], [ test "x$use_md" = "xopenssl"])
  473. AM_CONDITIONAL([USE_INTERNAL_MD], [ test "x$use_md" = "xinternal"])
  474. if test "x$use_md" != "x"; then
  475. AC_DEFINE([ENABLE_MESSAGE_DIGEST], [1],
  476. [Define to 1 if message digest support is enabled.])
  477. AM_CONDITIONAL([ENABLE_MESSAGE_DIGEST], true)
  478. enable_message_digest=yes
  479. else
  480. AM_CONDITIONAL([ENABLE_MESSAGE_DIGEST], false)
  481. fi
  482. if test "x$have_libgmp" = "xyes" ||
  483. test "x$have_libgcrypt" = "xyes" ||
  484. test "x$have_openssl" = "xyes"; then
  485. AM_CONDITIONAL([USE_INTERNAL_BIGNUM], false)
  486. else
  487. AC_DEFINE([USE_INTERNAL_BIGNUM], [1], [Define to 1 if internal BIGNUM support is enabled.])
  488. AM_CONDITIONAL([USE_INTERNAL_BIGNUM], true)
  489. fi
  490. if test "x$have_libnettle" = "xyes" ||
  491. test "x$have_libgcrypt" = "xyes" ||
  492. test "x$have_openssl" = "xyes"; then
  493. AM_CONDITIONAL([USE_INTERNAL_ARC4], false)
  494. else
  495. AC_DEFINE([USE_INTERNAL_ARC4], [1], [Define to 1 if internal ARC4 support is enabled.])
  496. AM_CONDITIONAL([USE_INTERNAL_ARC4], true)
  497. fi
  498. if test "x$enable_bittorrent" = "xyes" &&
  499. test "x$enable_message_digest" = "xyes"; then
  500. AC_DEFINE([ENABLE_BITTORRENT], [1],
  501. [Define to 1 if BitTorrent support is enabled.])
  502. AM_CONDITIONAL([ENABLE_BITTORRENT], true)
  503. else
  504. if test "x$enable_bittorrent_requested" = "xyes"; then
  505. ARIA2_FET_NOT_SUPPORTED([bittorrent])
  506. fi
  507. enable_bittorrent=no
  508. AM_CONDITIONAL([ENABLE_BITTORRENT], false)
  509. fi
  510. if (test "x$have_libxml2" = "xyes" || test "x$have_libexpat" = "xyes") &&
  511. test "x$enable_metalink" = "xyes"; then
  512. AC_DEFINE([ENABLE_METALINK], [1],
  513. [Define to 1 if Metalink support is enabled.])
  514. AM_CONDITIONAL([ENABLE_METALINK], true)
  515. else
  516. if test "x$enable_metalink_requested" = "xyes"; then
  517. ARIA2_FET_NOT_SUPPORTED([metalink])
  518. fi
  519. enable_metalink=no
  520. AM_CONDITIONAL([ENABLE_METALINK], false)
  521. fi
  522. AM_CONDITIONAL([HAVE_SOME_XMLLIB],
  523. [test "x$have_libxml2" = "xyes" || test "x$have_libexpat" = "xyes"])
  524. if test "x$have_libxml2" = "xyes" || test "x$have_libexpat" = "xyes"; then
  525. enable_xml_rpc=yes
  526. fi
  527. if test "x$enable_xml_rpc" = "xyes"; then
  528. AC_DEFINE([ENABLE_XML_RPC], [1],
  529. [Define to 1 if XML-RPC support is enabled.])
  530. fi
  531. AM_CONDITIONAL([ENABLE_XML_RPC], [test "x$enable_xml_rpc" = "xyes"])
  532. AM_CONDITIONAL([HAVE_LIBXML2], [test "x$have_libxml2" = "xyes"])
  533. AM_CONDITIONAL([HAVE_LIBEXPAT], [test "x$have_libexpat" = "xyes"])
  534. if test "x$have_libcares" = "xyes"; then
  535. AC_DEFINE([ENABLE_ASYNC_DNS], [1],
  536. [Define to 1 if asynchronous DNS support is enabled.])
  537. AM_CONDITIONAL([ENABLE_ASYNC_DNS], true)
  538. else
  539. AM_CONDITIONAL([ENABLE_ASYNC_DNS], false)
  540. fi
  541. # Set conditional for libz
  542. AM_CONDITIONAL([HAVE_ZLIB], [test "x$have_zlib" = "xyes"])
  543. # Set conditional for sqlite3
  544. AM_CONDITIONAL([HAVE_SQLITE3], [test "x$have_sqlite3" = "xyes"])
  545. AC_SEARCH_LIBS([clock_gettime], [rt])
  546. case "$host" in
  547. *solaris*)
  548. AC_SEARCH_LIBS([getaddrinfo], [nsl socket])
  549. ;;
  550. esac
  551. # Checks for header files.
  552. AC_FUNC_ALLOCA
  553. AC_HEADER_STDC
  554. AC_CHECK_HEADERS([argz.h \
  555. arpa/inet.h \
  556. fcntl.h \
  557. float.h \
  558. inttypes.h \
  559. langinfo.h \
  560. libintl.h \
  561. limits.h \
  562. locale.h \
  563. malloc.h \
  564. netdb.h \
  565. netinet/in.h \
  566. netinet/tcp.h \
  567. poll.h \
  568. port.h \
  569. signal.h \
  570. stddef.h \
  571. stdint.h \
  572. stdio_ext.h \
  573. stdlib.h \
  574. string.h \
  575. strings.h \
  576. sys/ioctl.h \
  577. sys/param.h \
  578. sys/signal.h \
  579. sys/socket.h \
  580. sys/time.h \
  581. sys/types.h \
  582. sys/uio.h \
  583. termios.h \
  584. unistd.h \
  585. utime.h \
  586. wchar.h \
  587. ifaddrs.h \
  588. pwd.h])
  589. # Checks for typedefs, structures, and compiler characteristics.
  590. AC_HEADER_STDBOOL
  591. AC_C_CONST
  592. AC_C_INLINE
  593. AC_TYPE_INT16_T
  594. AC_TYPE_INT32_T
  595. AC_TYPE_INT64_T
  596. AC_TYPE_INT8_T
  597. AC_TYPE_MODE_T
  598. AC_TYPE_OFF_T
  599. AC_TYPE_SIZE_T
  600. AC_TYPE_SSIZE_T
  601. AC_HEADER_TIME
  602. AC_STRUCT_TM
  603. AC_TYPE_UINT16_T
  604. AC_TYPE_UINT32_T
  605. AC_TYPE_UINT64_T
  606. AC_TYPE_UINT8_T
  607. AC_TYPE_PID_T
  608. AC_C_VOLATILE
  609. AC_CHECK_TYPES([ptrdiff_t])
  610. AC_CHECK_TYPE([struct timespec], [have_timespec=yes], [have_timespec=no])
  611. AC_C_BIGENDIAN
  612. AC_SYS_LARGEFILE
  613. if test "x$have_timespec" = "xyes"; then
  614. AC_DEFINE([HAVE_A2_STRUCT_TIMESPEC], [1],
  615. [Define to 1 if the system has the type `struct timespec'.])
  616. fi
  617. # Checks for library functions.
  618. AM_GNU_GETTEXT([external])
  619. AM_GNU_GETTEXT_VERSION([0.18])
  620. AC_FUNC_ERROR_AT_LINE
  621. AC_PROG_GCC_TRADITIONAL
  622. AC_FUNC_MEMCMP
  623. AC_FUNC_MKTIME
  624. AC_FUNC_SELECT_ARGTYPES
  625. AC_FUNC_STAT
  626. AC_FUNC_STRFTIME
  627. AC_FUNC_VPRINTF
  628. AC_FUNC_FORK
  629. AC_FUNC_STRTOD
  630. # Don't use AC_FUNC_MMAP becaue it fails on some platforms (e.g.,
  631. # OpenWRT) which have mmap and it works in the way we use in aria2.
  632. # Instead use mmap in AC_CHECK_FUNCS list.
  633. AC_CHECK_FUNCS([__argz_count \
  634. __argz_next \
  635. __argz_stringify \
  636. atexit \
  637. ftruncate \
  638. getcwd \
  639. gethostbyaddr \
  640. gethostbyname \
  641. getifaddrs \
  642. getpagesize \
  643. memchr \
  644. memmove \
  645. mempcpy \
  646. memset \
  647. mkdir \
  648. mmap \
  649. munmap \
  650. nl_langinfo \
  651. posix_memalign \
  652. pow \
  653. putenv \
  654. rmdir \
  655. select \
  656. setlocale \
  657. sigaction \
  658. sleep \
  659. socket \
  660. stpcpy \
  661. strcasecmp \
  662. strchr \
  663. strcspn \
  664. strdup \
  665. strerror \
  666. strncasecmp \
  667. strstr \
  668. strtol \
  669. strtoul \
  670. strtoull \
  671. tzset \
  672. unsetenv \
  673. usleep \
  674. utime \
  675. utimes])
  676. dnl Put tcmalloc/jemalloc checks after the posix_memalign check.
  677. dnl These libraries may implement posix_memalign, while the usual CRT may not
  678. dnl (e.g. mingw). Since we aren't including the corresponding library headers
  679. dnl this will lead to undefined posix_memalign() errors when compiling
  680. if test "x$with_tcmalloc_requested" = "xyes" &&
  681. test "x$with_jemalloc_requested" = "xyes"; then
  682. AC_MSG_FAILURE([Cannot use both, tcmalloc and jemalloc!])
  683. fi
  684. if test "x$with_tcmalloc" = "xyes"; then
  685. dnl Important: put malloc libs at the very end.
  686. dnl Only newish versions have a .pc, thus try CHECK_LIB as well.
  687. PKG_CHECK_MODULES([TCMALLOC], [libtcmalloc_minimal], [have_tcmalloc=yes], [have_tcmalloc=no])
  688. if test "x$have_tcmalloc" = "xyes"; then
  689. CPPFLAGS="$TCMALLOC_CFLAGS $CPPFLAGS"
  690. LIBS="$LIBS $TCMALLOC_LIBS"
  691. else
  692. AC_CHECK_LIB([tcmalloc_minimal], [malloc], [have_tcmalloc=yes], [have_tcmalloc=no])
  693. if test "x$have_tcmalloc" = "xyes"; then
  694. LIBS="$LIBS -ltcmalloc_minimal"
  695. else
  696. if test "x$with_tcmalloc_requested" = "xyes"; then
  697. ARIA2_DEP_NOT_MET([tcmalloc_minimal])
  698. fi
  699. fi
  700. fi
  701. fi
  702. if test "x$have_tcmalloc" != "xyes" && test "x$with_jemalloc" = "xyes"; then
  703. dnl Important: put malloc libs at the very end.
  704. dnl Usually jemalloc does not come with a .pc, as the official source does not
  705. dnl generate one.
  706. PKG_CHECK_MODULES([JEMALLOC], [jemalloc], [have_jemalloc=yes], [have_jemalloc=no])
  707. if test "x$have_jemalloc" = "xyes"; then
  708. CPPFLAGS="$JEMALLOC_CFLAGS $CPPFLAGS"
  709. LIBS="$LIBS $JEMALLOC_LIBS"
  710. else
  711. AC_CHECK_LIB([jemalloc], [malloc], [have_jemalloc=yes], [have_jemalloc=no])
  712. if test "x$have_jemalloc" = "xyes"; then
  713. LIBS="$LIBS -ljemalloc"
  714. else
  715. if test "x$with_jemalloc_requested" = "xyes"; then
  716. ARIA2_DEP_NOT_MET([jemalloc (unprefixed)])
  717. fi
  718. fi
  719. fi
  720. fi
  721. if test "x$enable_epoll" = "xyes"; then
  722. AC_CHECK_FUNCS([epoll_create], [have_epoll=yes])
  723. if test "x$have_epoll" = "xyes"; then
  724. AC_DEFINE([HAVE_EPOLL], [1], [Define to 1 if epoll is available.])
  725. fi
  726. fi
  727. AM_CONDITIONAL([HAVE_EPOLL], [test "x$have_epoll" = "xyes"])
  728. AC_CHECK_FUNCS([posix_fallocate],[have_posix_fallocate=yes])
  729. ARIA2_CHECK_FALLOCATE
  730. if test "x$have_posix_fallocate" = "xyes" ||
  731. test "x$have_fallocate" = "xyes" ||
  732. test "x$have_osx" = "xyes" ||
  733. test "x$win_build" = "xyes"; then
  734. AC_DEFINE([HAVE_SOME_FALLOCATE], [1],
  735. [Define to 1 if *_fallocate is available.])
  736. fi
  737. AM_CONDITIONAL([HAVE_SOME_FALLOCATE],
  738. [test "x$have_posix_fallocate" = "xyes" || test "x$have_fallocate" = "xyes" \
  739. || test "x$have_osx" = "xyes" || test "x$win_build" = "xyes"])
  740. AC_CHECK_FUNCS([asctime_r],
  741. [AM_CONDITIONAL([HAVE_ASCTIME_R], true)],
  742. [AM_CONDITIONAL([HAVE_ASCTIME_R], false)])
  743. AC_CHECK_FUNCS([basename],
  744. [AM_CONDITIONAL([HAVE_BASENAME], true)],
  745. [AM_CONDITIONAL([HAVE_BASENAME], false)])
  746. AC_CHECK_FUNCS([gai_strerror],
  747. [AM_CONDITIONAL([HAVE_GAI_STRERROR], true)],
  748. [AM_CONDITIONAL([HAVE_GAI_STRERROR], false)])
  749. AC_CHECK_FUNCS([getaddrinfo],
  750. [AM_CONDITIONAL([HAVE_GETADDRINFO], true)],
  751. [AM_CONDITIONAL([HAVE_GETADDRINFO], false)])
  752. AC_CHECK_FUNCS([gettimeofday],
  753. [AM_CONDITIONAL([HAVE_GETTIMEOFDAY], true)],
  754. [AM_CONDITIONAL([HAVE_GETTIMEOFDAY], false)])
  755. AC_CHECK_FUNCS([localtime_r],
  756. [AM_CONDITIONAL([HAVE_LOCALTIME_R], true)],
  757. [AM_CONDITIONAL([HAVE_LOCALTIME_R], false)])
  758. AC_CHECK_FUNCS([strptime],
  759. [AM_CONDITIONAL([HAVE_STRPTIME], true)],
  760. [AM_CONDITIONAL([HAVE_STRPTIME], false)])
  761. AC_CHECK_FUNCS([timegm],
  762. [AM_CONDITIONAL([HAVE_TIMEGM], true)],
  763. [AM_CONDITIONAL([HAVE_TIMEGM], false)])
  764. AC_CHECK_FUNCS([daemon], [have_daemon=yes])
  765. AM_CONDITIONAL([HAVE_DAEMON], [test "x$have_daemon" = "xyes"])
  766. AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes])
  767. if test "x$have_clock_gettime" != "xyes"; then
  768. AC_CHECK_FUNCS([mach_absolute_time], [have_mach_absolute_time=yes])
  769. fi
  770. AM_CONDITIONAL([HAVE_MACH_ABSOLUTE_TIME],
  771. [test "x$have_mach_absolute_time" = "xyes"])
  772. AC_CHECK_FUNCS([poll], [have_poll=yes])
  773. AM_CONDITIONAL([HAVE_POLL], [test "x$have_poll" = "xyes"])
  774. case "$host" in
  775. *mingw*)
  776. AM_CONDITIONAL([MINGW_BUILD], true)
  777. dnl defined in ws2tcpip.h, but only if _WIN32_WINNT >= 0x0501
  778. AM_CONDITIONAL([HAVE_GETADDRINFO], true)
  779. dnl defined in ws2tcpip.h, but missing in C:\mingw\lib\libws2_32.a
  780. AM_CONDITIONAL([HAVE_GAI_STRERROR], false)
  781. AM_CONDITIONAL([HAVE_TIMEGETTIME], [test "x$have_clock_gettime" != "xyes"])
  782. ;;
  783. *)
  784. AM_CONDITIONAL([MINGW_BUILD], false)
  785. AM_CONDITIONAL([HAVE_TIMEGETTIME], false)
  786. ;;
  787. esac
  788. AC_CHECK_FUNCS([port_associate], [have_port_associate=yes])
  789. AM_CONDITIONAL([HAVE_PORT_ASSOCIATE], [test "x$have_port_associate" = "xyes"])
  790. AC_CHECK_FUNCS([kqueue], [have_kqueue=yes])
  791. AM_CONDITIONAL([HAVE_KQUEUE], [test "x$have_kqueue" = "xyes"])
  792. if test "x$have_kqueue" = "xyes"; then
  793. AC_MSG_CHECKING([whether struct kevent.udata is intptr_t])
  794. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  795. #include <sys/types.h>
  796. #include <sys/event.h>
  797. #include <sys/time.h>
  798. ]],
  799. [[
  800. struct kevent event;
  801. event.udata = reinterpret_cast<intptr_t>(&event);
  802. ]])],
  803. [kevent_udata_intptr_t=yes], [kevent_udata_intptr_t=no])
  804. AC_MSG_RESULT([$kevent_udata_intptr_t])
  805. if test "x$kevent_udata_intptr_t" = "xyes"; then
  806. AC_DEFINE([KEVENT_UDATA_INTPTR_T], [1], [Define to 1 if struct kevent.udata is intptr_t])
  807. fi
  808. fi
  809. AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
  810. [AC_DEFINE([HAVE_SOCKADDR_IN_SIN_LEN],[1],
  811. [Define to 1 if struct sockaddr_in has sin_len member.])],
  812. [],
  813. [[
  814. #include <sys/types.h>
  815. #include <sys/socket.h>
  816. #include <netinet/in.h>
  817. ]])
  818. AC_CHECK_MEMBER([struct sockaddr_in6.sin6_len],
  819. [AC_DEFINE([HAVE_SOCKADDR_IN6_SIN6_LEN],[1],
  820. [Define to 1 if struct sockaddr_in6 has sin6_len member.])],
  821. [],
  822. [[
  823. #include <sys/types.h>
  824. #include <sys/socket.h>
  825. #include <netinet/in.h>
  826. ]])
  827. # Check struct option.name is assignable from const char*. struct
  828. # option.name in opensolaris is of type char*. In Linux, it is const
  829. # char*
  830. AC_MSG_CHECKING([whether struct option.name is assignable from const char*])
  831. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  832. #include <unistd.h>
  833. #include <getopt.h>
  834. ]],
  835. [[
  836. const char* s = "const char";
  837. option op;
  838. op.name = s;
  839. ]])],
  840. [have_option_const_name=yes], [have_option_const_name=no])
  841. AC_MSG_RESULT([$have_option_const_name])
  842. if test "x$have_option_const_name" = "xyes"; then
  843. AC_DEFINE([HAVE_OPTION_CONST_NAME], [1], [Define 1 if struct option.name is const char*])
  844. fi
  845. AC_CONFIG_SUBDIRS([deps/wslay])
  846. if test "x$enable_message_digest" = "xyes"; then
  847. enable_websocket=yes
  848. AC_DEFINE([ENABLE_WEBSOCKET], [1],
  849. [Define 1 if WebSocket support is enabled.])
  850. WSLAY_LIBS="\$(top_builddir)/deps/wslay/lib/libwslay.la"
  851. AC_SUBST([WSLAY_LIBS])
  852. # $(top_srcdir) for `make distcheck`
  853. CPPFLAGS="-I\$(top_builddir)/deps/wslay/lib/includes -I\$(top_srcdir)/deps/wslay/lib/includes $CPPFLAGS"
  854. fi
  855. AM_CONDITIONAL([ENABLE_WEBSOCKET], [test "x$enable_websocket" = "xyes"])
  856. AM_CONDITIONAL([ENABLE_LIBARIA2], [test "x$enable_libaria2" = "xyes"])
  857. AC_SUBST([bashcompletiondir])
  858. case "$host" in
  859. *android*)
  860. android=yes
  861. LIBS="$LIBS -lstdc++ -lsupc++"
  862. case "$host" in
  863. arm-*)
  864. android_arm=yes
  865. ;;
  866. mipsel-*)
  867. android_mips=yes
  868. ;;
  869. i686-*)
  870. android_x86=yes
  871. ;;
  872. esac
  873. ;;
  874. *)
  875. ;;
  876. esac
  877. AM_CONDITIONAL([ANDROID], [test "x$android" = "xyes"])
  878. AM_CONDITIONAL([ANDROID_ARM], [test "x$android_arm" = "xyes"])
  879. AM_CONDITIONAL([ANDROID_MIPS], [test "x$android_mips" = "xyes"])
  880. AM_CONDITIONAL([ANDROID_X86], [test "x$android_x86" = "xyes"])
  881. if test "x$ARIA2_STATIC" = "xyes"; then
  882. # -static-libgcc and -static-libstdc++ are linker flags and not for
  883. # libtool.
  884. LDFLAGS="$LDFLAGS -all-static"
  885. dnl For non-MinGW build, we need additional libs for static build.
  886. case "$host" in
  887. *mingw*|*msvc*|*darwin*)
  888. ;;
  889. *)
  890. LIBS="$LIBS -lpthread -ldl -lrt"
  891. ;;
  892. esac
  893. fi
  894. if test "x$win_build" = "xyes" && test "x$enable_libaria2" = "xyes"; then
  895. # Creating dll needs this
  896. LDFLAGS="$LDFLAGS -no-undefined"
  897. fi
  898. AC_CONFIG_FILES([Makefile
  899. src/Makefile
  900. src/libaria2.pc
  901. src/includes/Makefile
  902. test/Makefile
  903. po/Makefile.in
  904. lib/Makefile
  905. doc/Makefile
  906. doc/manual-src/Makefile
  907. doc/manual-src/en/Makefile
  908. doc/manual-src/en/conf.py
  909. doc/manual-src/ru/Makefile
  910. doc/manual-src/ru/conf.py
  911. doc/manual-src/pt/Makefile
  912. doc/manual-src/pt/conf.py
  913. deps/Makefile])
  914. AC_OUTPUT
  915. echo " "
  916. echo "Build: $build"
  917. echo "Host: $host"
  918. echo "Target: $target"
  919. echo "Install prefix: $prefix"
  920. echo "CC: $CC"
  921. echo "CXX: $CXX"
  922. echo "CPP: $CPP"
  923. echo "CXXFLAGS: $CXXFLAGS"
  924. echo "CFLAGS: $CFLAGS"
  925. echo "CPPFLAGS: $CPPFLAGS"
  926. echo "LDFLAGS: $LDFLAGS"
  927. echo "LIBS: $LIBS"
  928. echo "DEFS: $DEFS"
  929. echo "LibUV: $have_libuv"
  930. echo "SQLite3: $have_sqlite3"
  931. echo "SSL Support: $have_ssl"
  932. echo "AppleTLS: $have_appletls"
  933. echo "WinTLS: $have_wintls"
  934. echo "GnuTLS: $have_libgnutls"
  935. echo "OpenSSL: $have_openssl"
  936. echo "CA Bundle: $ca_bundle"
  937. echo "LibXML2: $have_libxml2"
  938. echo "LibExpat: $have_libexpat"
  939. echo "LibCares: $have_libcares"
  940. echo "Zlib: $have_zlib"
  941. echo "Epoll: $have_epoll"
  942. echo "Bittorrent: $enable_bittorrent"
  943. echo "Metalink: $enable_metalink"
  944. echo "XML-RPC: $enable_xml_rpc"
  945. echo "Message Digest: $use_md"
  946. echo "WebSocket: $enable_websocket"
  947. echo "Libaria2: $enable_libaria2"
  948. if test "x$enable_libaria2" = "xyes"; then
  949. echo "Library types: Shared=${enable_shared}, Static=${enable_static}"
  950. fi
  951. echo "bash_completion dir: $bashcompletiondir"
  952. echo "Static build: $ARIA2_STATIC"