configure.ac 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052
  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([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. AC_CHECK_FUNCS([__gmpz_powm_sec], [have_mpz_powm_sec=yes])
  388. if test "x$have_mpz_powm_sec" = "xyes"; then
  389. AC_DEFINE([HAVE_GMP_SEC], [1], [Define to 1 if you have a GMP with sec functions.])
  390. fi
  391. else
  392. AC_MSG_WARN([libgmp not found])
  393. if test "x$with_libgmp_requested" = "xyes"; then
  394. ARIA2_DEP_NOT_MET([libgmp])
  395. fi
  396. fi
  397. fi
  398. if test "x$with_libgcrypt" = "xyes" &&
  399. test "x$have_libnettle" != "xyes"; then
  400. AM_PATH_LIBGCRYPT([1.2.4], [have_libgcrypt=yes])
  401. if test "x$have_libgcrypt" = "xyes"; then
  402. AC_DEFINE([HAVE_LIBGCRYPT], [1], [Define to 1 if you have libgcrypt.])
  403. LIBS="$LIBGCRYPT_LIBS $LIBS"
  404. CPPFLAGS="$LIBGCRYPT_CFLAGS $CPPFLAGS"
  405. fi
  406. fi
  407. fi
  408. if test "x$with_libcares" = "xyes"; then
  409. PKG_CHECK_MODULES([LIBCARES], [libcares >= 1.7.0], [have_libcares=yes],
  410. [have_libcares=no])
  411. if test "x$have_libcares" = "xyes"; then
  412. AC_DEFINE([HAVE_LIBCARES], [1], [Define to 1 if you have libcares.])
  413. LIBS="$LIBCARES_LIBS $LIBS"
  414. CPPFLAGS="$LIBCARES_CFLAGS $CPPFLAGS"
  415. AC_CHECK_TYPES([ares_addr_node], [], [], [[#include <ares.h>]])
  416. AC_CHECK_FUNCS([ares_set_servers])
  417. if test "x$ARIA2_STATIC" = "xyes"; then
  418. CPPFLAGS="-DCARES_STATICLIB $CPPFLAGS"
  419. fi
  420. else
  421. AC_MSG_WARN([$LIBCARES_PKG_ERRORS])
  422. if test "x$with_libcares_requested" = "xyes"; then
  423. ARIA2_DEP_NOT_MET([libcares])
  424. fi
  425. fi
  426. fi
  427. use_md=""
  428. if test "x$have_appletls" = "xyes"; then
  429. use_md="apple"
  430. AC_DEFINE([USE_APPLE_MD], [1], [What message digest implementation to use])
  431. else
  432. if test "x$have_wintls" = "xyes"; then
  433. use_md="windows"
  434. AC_DEFINE([USE_WINDOWS_MD], [1], [What message digest implementation to use])
  435. else
  436. if test "x$have_libnettle" = "xyes"; then
  437. AC_DEFINE([USE_LIBNETTLE_MD], [1], [What message digest implementation to use])
  438. use_md="libnettle"
  439. else
  440. if test "x$have_libgcrypt" = "xyes"; then
  441. AC_DEFINE([USE_LIBGCRYPT_MD], [1], [What message digest implementation to use])
  442. use_md="libgcrypt"
  443. else
  444. if test "x$have_openssl" = "xyes"; then
  445. AC_DEFINE([USE_OPENSSL_MD], [1], [What message digest implementation to use])
  446. use_md="openssl"
  447. else
  448. AC_DEFINE([USE_INTERNAL_MD], [1], [What message digest implementation to use])
  449. use_md="internal"
  450. fi
  451. fi
  452. fi
  453. fi
  454. fi
  455. # Define variables based on the result of the checks for libraries.
  456. if test "x$have_appletls" = "xyes" || test "x$have_wintls" = "xyes" || test "x$have_libgnutls" = "xyes" || test "x$have_openssl" = "xyes"; then
  457. have_ssl="yes"
  458. AC_DEFINE([ENABLE_SSL], [1], [Define to 1 if ssl support is enabled.])
  459. AM_CONDITIONAL([ENABLE_SSL], true)
  460. else
  461. have_ssl="no"
  462. AM_CONDITIONAL([ENABLE_SSL], false)
  463. fi
  464. AM_CONDITIONAL([HAVE_OSX], [ test "x$have_osx" = "xyes" ])
  465. AM_CONDITIONAL([HAVE_APPLETLS], [ test "x$have_appletls" = "xyes" ])
  466. AM_CONDITIONAL([HAVE_WINTLS], [ test "x$have_wintls" = "xyes" ])
  467. AM_CONDITIONAL([USE_APPLE_MD], [ test "x$use_md" = "xapple" ])
  468. AM_CONDITIONAL([USE_WINDOWS_MD], [ test "x$use_md" = "xwindows" ])
  469. AM_CONDITIONAL([HAVE_LIBGNUTLS], [ test "x$have_libgnutls" = "xyes" ])
  470. AM_CONDITIONAL([HAVE_LIBNETTLE], [ test "x$have_libnettle" = "xyes" ])
  471. AM_CONDITIONAL([USE_LIBNETTLE_MD], [ test "x$use_md" = "xlibnettle"])
  472. AM_CONDITIONAL([HAVE_LIBGMP], [ test "x$have_libgmp" = "xyes" ])
  473. AM_CONDITIONAL([HAVE_LIBGCRYPT], [ test "x$have_libgcrypt" = "xyes" ])
  474. AM_CONDITIONAL([USE_LIBGCRYPT_MD], [ test "x$use_md" = "xlibgcrypt"])
  475. AM_CONDITIONAL([HAVE_OPENSSL], [ test "x$have_openssl" = "xyes" ])
  476. AM_CONDITIONAL([USE_OPENSSL_MD], [ test "x$use_md" = "xopenssl"])
  477. AM_CONDITIONAL([USE_INTERNAL_MD], [ test "x$use_md" = "xinternal"])
  478. if test "x$use_md" != "x"; then
  479. AC_DEFINE([ENABLE_MESSAGE_DIGEST], [1],
  480. [Define to 1 if message digest support is enabled.])
  481. AM_CONDITIONAL([ENABLE_MESSAGE_DIGEST], true)
  482. enable_message_digest=yes
  483. else
  484. AM_CONDITIONAL([ENABLE_MESSAGE_DIGEST], false)
  485. fi
  486. if test "x$have_libgmp" = "xyes" ||
  487. test "x$have_libgcrypt" = "xyes" ||
  488. test "x$have_openssl" = "xyes"; then
  489. AM_CONDITIONAL([USE_INTERNAL_BIGNUM], false)
  490. else
  491. AC_DEFINE([USE_INTERNAL_BIGNUM], [1], [Define to 1 if internal BIGNUM support is enabled.])
  492. AM_CONDITIONAL([USE_INTERNAL_BIGNUM], true)
  493. fi
  494. if test "x$have_libnettle" = "xyes" ||
  495. test "x$have_libgcrypt" = "xyes" ||
  496. test "x$have_openssl" = "xyes"; then
  497. AM_CONDITIONAL([USE_INTERNAL_ARC4], false)
  498. else
  499. AC_DEFINE([USE_INTERNAL_ARC4], [1], [Define to 1 if internal ARC4 support is enabled.])
  500. AM_CONDITIONAL([USE_INTERNAL_ARC4], true)
  501. fi
  502. if test "x$enable_bittorrent" = "xyes" &&
  503. test "x$enable_message_digest" = "xyes"; then
  504. AC_DEFINE([ENABLE_BITTORRENT], [1],
  505. [Define to 1 if BitTorrent support is enabled.])
  506. AM_CONDITIONAL([ENABLE_BITTORRENT], true)
  507. else
  508. if test "x$enable_bittorrent_requested" = "xyes"; then
  509. ARIA2_FET_NOT_SUPPORTED([bittorrent])
  510. fi
  511. enable_bittorrent=no
  512. AM_CONDITIONAL([ENABLE_BITTORRENT], false)
  513. fi
  514. if (test "x$have_libxml2" = "xyes" || test "x$have_libexpat" = "xyes") &&
  515. test "x$enable_metalink" = "xyes"; then
  516. AC_DEFINE([ENABLE_METALINK], [1],
  517. [Define to 1 if Metalink support is enabled.])
  518. AM_CONDITIONAL([ENABLE_METALINK], true)
  519. else
  520. if test "x$enable_metalink_requested" = "xyes"; then
  521. ARIA2_FET_NOT_SUPPORTED([metalink])
  522. fi
  523. enable_metalink=no
  524. AM_CONDITIONAL([ENABLE_METALINK], false)
  525. fi
  526. AM_CONDITIONAL([HAVE_SOME_XMLLIB],
  527. [test "x$have_libxml2" = "xyes" || test "x$have_libexpat" = "xyes"])
  528. if test "x$have_libxml2" = "xyes" || test "x$have_libexpat" = "xyes"; then
  529. enable_xml_rpc=yes
  530. fi
  531. if test "x$enable_xml_rpc" = "xyes"; then
  532. AC_DEFINE([ENABLE_XML_RPC], [1],
  533. [Define to 1 if XML-RPC support is enabled.])
  534. fi
  535. AM_CONDITIONAL([ENABLE_XML_RPC], [test "x$enable_xml_rpc" = "xyes"])
  536. AM_CONDITIONAL([HAVE_LIBXML2], [test "x$have_libxml2" = "xyes"])
  537. AM_CONDITIONAL([HAVE_LIBEXPAT], [test "x$have_libexpat" = "xyes"])
  538. if test "x$have_libcares" = "xyes"; then
  539. AC_DEFINE([ENABLE_ASYNC_DNS], [1],
  540. [Define to 1 if asynchronous DNS support is enabled.])
  541. AM_CONDITIONAL([ENABLE_ASYNC_DNS], true)
  542. else
  543. AM_CONDITIONAL([ENABLE_ASYNC_DNS], false)
  544. fi
  545. # Set conditional for libz
  546. AM_CONDITIONAL([HAVE_ZLIB], [test "x$have_zlib" = "xyes"])
  547. # Set conditional for sqlite3
  548. AM_CONDITIONAL([HAVE_SQLITE3], [test "x$have_sqlite3" = "xyes"])
  549. AC_SEARCH_LIBS([clock_gettime], [rt])
  550. case "$host" in
  551. *solaris*)
  552. AC_SEARCH_LIBS([getaddrinfo], [nsl socket])
  553. ;;
  554. esac
  555. # Checks for header files.
  556. AC_FUNC_ALLOCA
  557. AC_HEADER_STDC
  558. AC_CHECK_HEADERS([argz.h \
  559. arpa/inet.h \
  560. fcntl.h \
  561. float.h \
  562. inttypes.h \
  563. langinfo.h \
  564. libintl.h \
  565. limits.h \
  566. locale.h \
  567. malloc.h \
  568. netdb.h \
  569. netinet/in.h \
  570. netinet/tcp.h \
  571. poll.h \
  572. port.h \
  573. signal.h \
  574. stddef.h \
  575. stdint.h \
  576. stdio_ext.h \
  577. stdlib.h \
  578. string.h \
  579. strings.h \
  580. sys/ioctl.h \
  581. sys/param.h \
  582. sys/signal.h \
  583. sys/socket.h \
  584. sys/time.h \
  585. sys/types.h \
  586. sys/uio.h \
  587. termios.h \
  588. unistd.h \
  589. utime.h \
  590. wchar.h \
  591. ifaddrs.h \
  592. pwd.h])
  593. # Checks for typedefs, structures, and compiler characteristics.
  594. AC_HEADER_STDBOOL
  595. AC_C_CONST
  596. AC_C_INLINE
  597. AC_TYPE_INT16_T
  598. AC_TYPE_INT32_T
  599. AC_TYPE_INT64_T
  600. AC_TYPE_INT8_T
  601. AC_TYPE_MODE_T
  602. AC_TYPE_OFF_T
  603. AC_TYPE_SIZE_T
  604. AC_TYPE_SSIZE_T
  605. AC_HEADER_TIME
  606. AC_STRUCT_TM
  607. AC_TYPE_UINT16_T
  608. AC_TYPE_UINT32_T
  609. AC_TYPE_UINT64_T
  610. AC_TYPE_UINT8_T
  611. AC_TYPE_PID_T
  612. AC_C_VOLATILE
  613. AC_CHECK_TYPES([ptrdiff_t])
  614. AC_CHECK_TYPE([struct timespec], [have_timespec=yes], [have_timespec=no])
  615. AC_C_BIGENDIAN
  616. AC_SYS_LARGEFILE
  617. if test "x$have_timespec" = "xyes"; then
  618. AC_DEFINE([HAVE_A2_STRUCT_TIMESPEC], [1],
  619. [Define to 1 if the system has the type `struct timespec'.])
  620. fi
  621. # Checks for library functions.
  622. AM_GNU_GETTEXT([external])
  623. AM_GNU_GETTEXT_VERSION([0.18])
  624. AC_FUNC_ERROR_AT_LINE
  625. AC_PROG_GCC_TRADITIONAL
  626. AC_FUNC_MEMCMP
  627. AC_FUNC_MKTIME
  628. AC_FUNC_SELECT_ARGTYPES
  629. AC_FUNC_STAT
  630. AC_FUNC_STRFTIME
  631. AC_FUNC_VPRINTF
  632. AC_FUNC_FORK
  633. AC_FUNC_STRTOD
  634. # Don't use AC_FUNC_MMAP becaue it fails on some platforms (e.g.,
  635. # OpenWRT) which have mmap and it works in the way we use in aria2.
  636. # Instead use mmap in AC_CHECK_FUNCS list.
  637. AC_CHECK_FUNCS([__argz_count \
  638. __argz_next \
  639. __argz_stringify \
  640. atexit \
  641. ftruncate \
  642. getcwd \
  643. gethostbyaddr \
  644. gethostbyname \
  645. getifaddrs \
  646. getpagesize \
  647. memchr \
  648. memmove \
  649. mempcpy \
  650. memset \
  651. mkdir \
  652. mmap \
  653. munmap \
  654. nl_langinfo \
  655. posix_memalign \
  656. pow \
  657. putenv \
  658. rmdir \
  659. select \
  660. setlocale \
  661. sigaction \
  662. sleep \
  663. socket \
  664. stpcpy \
  665. strcasecmp \
  666. strchr \
  667. strcspn \
  668. strdup \
  669. strerror \
  670. strncasecmp \
  671. strstr \
  672. strtol \
  673. strtoul \
  674. strtoull \
  675. tzset \
  676. unsetenv \
  677. usleep \
  678. utime \
  679. utimes])
  680. dnl Put tcmalloc/jemalloc checks after the posix_memalign check.
  681. dnl These libraries may implement posix_memalign, while the usual CRT may not
  682. dnl (e.g. mingw). Since we aren't including the corresponding library headers
  683. dnl this will lead to undefined posix_memalign() errors when compiling
  684. if test "x$with_tcmalloc_requested" = "xyes" &&
  685. test "x$with_jemalloc_requested" = "xyes"; then
  686. AC_MSG_FAILURE([Cannot use both, tcmalloc and jemalloc!])
  687. fi
  688. if test "x$with_tcmalloc" = "xyes"; then
  689. dnl Important: put malloc libs at the very end.
  690. dnl Only newish versions have a .pc, thus try CHECK_LIB as well.
  691. PKG_CHECK_MODULES([TCMALLOC], [libtcmalloc_minimal], [have_tcmalloc=yes], [have_tcmalloc=no])
  692. if test "x$have_tcmalloc" = "xyes"; then
  693. CPPFLAGS="$TCMALLOC_CFLAGS $CPPFLAGS"
  694. LIBS="$LIBS $TCMALLOC_LIBS"
  695. else
  696. AC_CHECK_LIB([tcmalloc_minimal], [malloc], [have_tcmalloc=yes], [have_tcmalloc=no])
  697. if test "x$have_tcmalloc" = "xyes"; then
  698. LIBS="$LIBS -ltcmalloc_minimal"
  699. else
  700. if test "x$with_tcmalloc_requested" = "xyes"; then
  701. ARIA2_DEP_NOT_MET([tcmalloc_minimal])
  702. fi
  703. fi
  704. fi
  705. fi
  706. if test "x$have_tcmalloc" != "xyes" && test "x$with_jemalloc" = "xyes"; then
  707. dnl Important: put malloc libs at the very end.
  708. dnl Usually jemalloc does not come with a .pc, as the official source does not
  709. dnl generate one.
  710. PKG_CHECK_MODULES([JEMALLOC], [jemalloc], [have_jemalloc=yes], [have_jemalloc=no])
  711. if test "x$have_jemalloc" = "xyes"; then
  712. CPPFLAGS="$JEMALLOC_CFLAGS $CPPFLAGS"
  713. LIBS="$LIBS $JEMALLOC_LIBS"
  714. else
  715. AC_CHECK_LIB([jemalloc], [malloc], [have_jemalloc=yes], [have_jemalloc=no])
  716. if test "x$have_jemalloc" = "xyes"; then
  717. LIBS="$LIBS -ljemalloc"
  718. else
  719. if test "x$with_jemalloc_requested" = "xyes"; then
  720. ARIA2_DEP_NOT_MET([jemalloc (unprefixed)])
  721. fi
  722. fi
  723. fi
  724. fi
  725. if test "x$enable_epoll" = "xyes"; then
  726. AC_CHECK_FUNCS([epoll_create], [have_epoll=yes])
  727. if test "x$have_epoll" = "xyes"; then
  728. AC_DEFINE([HAVE_EPOLL], [1], [Define to 1 if epoll is available.])
  729. fi
  730. fi
  731. AM_CONDITIONAL([HAVE_EPOLL], [test "x$have_epoll" = "xyes"])
  732. AC_CHECK_FUNCS([posix_fallocate],[have_posix_fallocate=yes])
  733. ARIA2_CHECK_FALLOCATE
  734. if test "x$have_posix_fallocate" = "xyes" ||
  735. test "x$have_fallocate" = "xyes" ||
  736. test "x$have_osx" = "xyes" ||
  737. test "x$win_build" = "xyes"; then
  738. AC_DEFINE([HAVE_SOME_FALLOCATE], [1],
  739. [Define to 1 if *_fallocate is available.])
  740. fi
  741. AM_CONDITIONAL([HAVE_SOME_FALLOCATE],
  742. [test "x$have_posix_fallocate" = "xyes" || test "x$have_fallocate" = "xyes" \
  743. || test "x$have_osx" = "xyes" || test "x$win_build" = "xyes"])
  744. AC_CHECK_FUNCS([asctime_r],
  745. [AM_CONDITIONAL([HAVE_ASCTIME_R], true)],
  746. [AM_CONDITIONAL([HAVE_ASCTIME_R], false)])
  747. AC_CHECK_FUNCS([basename],
  748. [AM_CONDITIONAL([HAVE_BASENAME], true)],
  749. [AM_CONDITIONAL([HAVE_BASENAME], false)])
  750. AC_CHECK_FUNCS([gai_strerror],
  751. [AM_CONDITIONAL([HAVE_GAI_STRERROR], true)],
  752. [AM_CONDITIONAL([HAVE_GAI_STRERROR], false)])
  753. AC_CHECK_FUNCS([getaddrinfo],
  754. [AM_CONDITIONAL([HAVE_GETADDRINFO], true)],
  755. [AM_CONDITIONAL([HAVE_GETADDRINFO], false)])
  756. AC_CHECK_FUNCS([gettimeofday],
  757. [AM_CONDITIONAL([HAVE_GETTIMEOFDAY], true)],
  758. [AM_CONDITIONAL([HAVE_GETTIMEOFDAY], false)])
  759. AC_CHECK_FUNCS([localtime_r],
  760. [AM_CONDITIONAL([HAVE_LOCALTIME_R], true)],
  761. [AM_CONDITIONAL([HAVE_LOCALTIME_R], false)])
  762. AC_CHECK_FUNCS([strptime],
  763. [AM_CONDITIONAL([HAVE_STRPTIME], true)],
  764. [AM_CONDITIONAL([HAVE_STRPTIME], false)])
  765. AC_CHECK_FUNCS([timegm],
  766. [AM_CONDITIONAL([HAVE_TIMEGM], true)],
  767. [AM_CONDITIONAL([HAVE_TIMEGM], false)])
  768. AC_CHECK_FUNCS([daemon], [have_daemon=yes])
  769. AM_CONDITIONAL([HAVE_DAEMON], [test "x$have_daemon" = "xyes"])
  770. AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes])
  771. if test "x$have_clock_gettime" != "xyes"; then
  772. AC_CHECK_FUNCS([mach_absolute_time], [have_mach_absolute_time=yes])
  773. fi
  774. AM_CONDITIONAL([HAVE_MACH_ABSOLUTE_TIME],
  775. [test "x$have_mach_absolute_time" = "xyes"])
  776. AC_CHECK_FUNCS([poll], [have_poll=yes])
  777. AM_CONDITIONAL([HAVE_POLL], [test "x$have_poll" = "xyes"])
  778. case "$host" in
  779. *mingw*)
  780. AM_CONDITIONAL([MINGW_BUILD], true)
  781. dnl defined in ws2tcpip.h, but only if _WIN32_WINNT >= 0x0501
  782. AM_CONDITIONAL([HAVE_GETADDRINFO], true)
  783. dnl defined in ws2tcpip.h, but missing in C:\mingw\lib\libws2_32.a
  784. AM_CONDITIONAL([HAVE_GAI_STRERROR], false)
  785. AM_CONDITIONAL([HAVE_TIMEGETTIME], [test "x$have_clock_gettime" != "xyes"])
  786. ;;
  787. *)
  788. AM_CONDITIONAL([MINGW_BUILD], false)
  789. AM_CONDITIONAL([HAVE_TIMEGETTIME], false)
  790. ;;
  791. esac
  792. AC_CHECK_FUNCS([port_associate], [have_port_associate=yes])
  793. AM_CONDITIONAL([HAVE_PORT_ASSOCIATE], [test "x$have_port_associate" = "xyes"])
  794. AC_CHECK_FUNCS([kqueue], [have_kqueue=yes])
  795. AM_CONDITIONAL([HAVE_KQUEUE], [test "x$have_kqueue" = "xyes"])
  796. if test "x$have_kqueue" = "xyes"; then
  797. AC_MSG_CHECKING([whether struct kevent.udata is intptr_t])
  798. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  799. #include <sys/types.h>
  800. #include <sys/event.h>
  801. #include <sys/time.h>
  802. ]],
  803. [[
  804. struct kevent event;
  805. event.udata = reinterpret_cast<intptr_t>(&event);
  806. ]])],
  807. [kevent_udata_intptr_t=yes], [kevent_udata_intptr_t=no])
  808. AC_MSG_RESULT([$kevent_udata_intptr_t])
  809. if test "x$kevent_udata_intptr_t" = "xyes"; then
  810. AC_DEFINE([KEVENT_UDATA_INTPTR_T], [1], [Define to 1 if struct kevent.udata is intptr_t])
  811. fi
  812. fi
  813. AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
  814. [AC_DEFINE([HAVE_SOCKADDR_IN_SIN_LEN],[1],
  815. [Define to 1 if struct sockaddr_in has sin_len member.])],
  816. [],
  817. [[
  818. #include <sys/types.h>
  819. #include <sys/socket.h>
  820. #include <netinet/in.h>
  821. ]])
  822. AC_CHECK_MEMBER([struct sockaddr_in6.sin6_len],
  823. [AC_DEFINE([HAVE_SOCKADDR_IN6_SIN6_LEN],[1],
  824. [Define to 1 if struct sockaddr_in6 has sin6_len member.])],
  825. [],
  826. [[
  827. #include <sys/types.h>
  828. #include <sys/socket.h>
  829. #include <netinet/in.h>
  830. ]])
  831. # Check struct option.name is assignable from const char*. struct
  832. # option.name in opensolaris is of type char*. In Linux, it is const
  833. # char*
  834. AC_MSG_CHECKING([whether struct option.name is assignable from const char*])
  835. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  836. #include <unistd.h>
  837. #include <getopt.h>
  838. ]],
  839. [[
  840. const char* s = "const char";
  841. option op;
  842. op.name = s;
  843. ]])],
  844. [have_option_const_name=yes], [have_option_const_name=no])
  845. AC_MSG_RESULT([$have_option_const_name])
  846. if test "x$have_option_const_name" = "xyes"; then
  847. AC_DEFINE([HAVE_OPTION_CONST_NAME], [1], [Define 1 if struct option.name is const char*])
  848. fi
  849. AC_CONFIG_SUBDIRS([deps/wslay])
  850. if test "x$enable_message_digest" = "xyes"; then
  851. enable_websocket=yes
  852. AC_DEFINE([ENABLE_WEBSOCKET], [1],
  853. [Define 1 if WebSocket support is enabled.])
  854. WSLAY_LIBS="\$(top_builddir)/deps/wslay/lib/libwslay.la"
  855. AC_SUBST([WSLAY_LIBS])
  856. # $(top_srcdir) for `make distcheck`
  857. CPPFLAGS="-I\$(top_builddir)/deps/wslay/lib/includes -I\$(top_srcdir)/deps/wslay/lib/includes $CPPFLAGS"
  858. fi
  859. AM_CONDITIONAL([ENABLE_WEBSOCKET], [test "x$enable_websocket" = "xyes"])
  860. AM_CONDITIONAL([ENABLE_LIBARIA2], [test "x$enable_libaria2" = "xyes"])
  861. AC_SUBST([bashcompletiondir])
  862. case "$host" in
  863. *android*)
  864. android=yes
  865. LIBS="$LIBS -lstdc++ -lsupc++"
  866. case "$host" in
  867. arm-*)
  868. android_arm=yes
  869. ;;
  870. mipsel-*)
  871. android_mips=yes
  872. ;;
  873. i686-*)
  874. android_x86=yes
  875. ;;
  876. esac
  877. ;;
  878. *)
  879. ;;
  880. esac
  881. AM_CONDITIONAL([ANDROID], [test "x$android" = "xyes"])
  882. AM_CONDITIONAL([ANDROID_ARM], [test "x$android_arm" = "xyes"])
  883. AM_CONDITIONAL([ANDROID_MIPS], [test "x$android_mips" = "xyes"])
  884. AM_CONDITIONAL([ANDROID_X86], [test "x$android_x86" = "xyes"])
  885. if test "x$ARIA2_STATIC" = "xyes"; then
  886. # -static-libgcc and -static-libstdc++ are linker flags and not for
  887. # libtool.
  888. LDFLAGS="$LDFLAGS -all-static"
  889. dnl For non-MinGW build, we need additional libs for static build.
  890. case "$host" in
  891. *mingw*|*msvc*|*darwin*)
  892. ;;
  893. *)
  894. LIBS="$LIBS -lpthread -ldl -lrt"
  895. ;;
  896. esac
  897. fi
  898. if test "x$win_build" = "xyes" && test "x$enable_libaria2" = "xyes"; then
  899. # Creating dll needs this
  900. LDFLAGS="$LDFLAGS -no-undefined"
  901. fi
  902. AC_CONFIG_FILES([Makefile
  903. src/Makefile
  904. src/libaria2.pc
  905. src/includes/Makefile
  906. test/Makefile
  907. po/Makefile.in
  908. lib/Makefile
  909. doc/Makefile
  910. doc/manual-src/Makefile
  911. doc/manual-src/en/Makefile
  912. doc/manual-src/en/conf.py
  913. doc/manual-src/ru/Makefile
  914. doc/manual-src/ru/conf.py
  915. doc/manual-src/pt/Makefile
  916. doc/manual-src/pt/conf.py
  917. deps/Makefile])
  918. AC_OUTPUT
  919. echo " "
  920. echo "Build: $build"
  921. echo "Host: $host"
  922. echo "Target: $target"
  923. echo "Install prefix: $prefix"
  924. echo "CC: $CC"
  925. echo "CXX: $CXX"
  926. echo "CPP: $CPP"
  927. echo "CXXFLAGS: $CXXFLAGS"
  928. echo "CFLAGS: $CFLAGS"
  929. echo "CPPFLAGS: $CPPFLAGS"
  930. echo "LDFLAGS: $LDFLAGS"
  931. echo "LIBS: $LIBS"
  932. echo "DEFS: $DEFS"
  933. echo "LibUV: $have_libuv"
  934. echo "SQLite3: $have_sqlite3"
  935. echo "SSL Support: $have_ssl"
  936. echo "AppleTLS: $have_appletls"
  937. echo "WinTLS: $have_wintls"
  938. echo "GnuTLS: $have_libgnutls"
  939. echo "OpenSSL: $have_openssl"
  940. echo "CA Bundle: $ca_bundle"
  941. echo "LibXML2: $have_libxml2"
  942. echo "LibExpat: $have_libexpat"
  943. echo "LibCares: $have_libcares"
  944. echo "Zlib: $have_zlib"
  945. echo "Epoll: $have_epoll"
  946. echo "Bittorrent: $enable_bittorrent"
  947. echo "Metalink: $enable_metalink"
  948. echo "XML-RPC: $enable_xml_rpc"
  949. echo "Message Digest: $use_md"
  950. echo "WebSocket: $enable_websocket"
  951. echo "Libaria2: $enable_libaria2"
  952. if test "x$enable_libaria2" = "xyes"; then
  953. echo "Library types: Shared=${enable_shared}, Static=${enable_static}"
  954. fi
  955. echo "bash_completion dir: $bashcompletiondir"
  956. echo "Static build: $ARIA2_STATIC"