configure.ac 32 KB

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