configure.ac 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. # -*- Autoconf -*-
  2. # Process this file with autoconf to produce a configure script.
  3. #
  4. AC_PREREQ([2.67])
  5. AC_INIT([aria2],[1.13.0],[t-tujikawa@users.sourceforge.net],[aria2],[http://aria2.sourceforge.net/])
  6. AC_CANONICAL_HOST
  7. AC_CANONICAL_TARGET
  8. AM_INIT_AUTOMAKE()
  9. AM_PATH_CPPUNIT(1.10.2)
  10. AC_CONFIG_SRCDIR([src/a2io.h])
  11. AC_CONFIG_HEADERS([config.h])
  12. case "$target" in
  13. *mingw*|*cygwin*)
  14. win_build=yes
  15. LIBS="-lws2_32 -lcrypto -lwsock32 -lgdi32 -lwinmm $LIBS"
  16. ;;
  17. esac
  18. AC_DEFINE_UNQUOTED([TARGET], ["$target"], [Define target-type])
  19. # Checks for arguments.
  20. ARIA2_ARG_WITH([gnutls])
  21. ARIA2_ARG_WITH([libnettle])
  22. ARIA2_ARG_WITH([libgmp])
  23. ARIA2_ARG_WITH([libgcrypt])
  24. ARIA2_ARG_WITH([openssl])
  25. ARIA2_ARG_WITH([sqlite3])
  26. ARIA2_ARG_WITH([libxml2])
  27. ARIA2_ARG_WITH([libexpat])
  28. ARIA2_ARG_WITH([libcares])
  29. ARIA2_ARG_WITH([libz])
  30. ARIA2_ARG_ENABLE([bittorrent])
  31. ARIA2_ARG_ENABLE([metalink])
  32. ARIA2_ARG_ENABLE([epoll])
  33. AC_ARG_WITH([ca-bundle],
  34. AS_HELP_STRING([--with-ca-bundle=FILE],[Use FILE as default CA bundle.]),
  35. [ca_bundle=$withval], [ca_bundle=""])
  36. # Checks for programs.
  37. AC_PROG_CXX
  38. AC_PROG_CC
  39. AC_PROG_INSTALL
  40. AC_PROG_MKDIR_P
  41. AC_PROG_RANLIB
  42. AC_PROG_YACC
  43. AC_CHECK_TOOL([AR], [ar], [:])
  44. if test "x$AR" = "x:"; then
  45. AC_MSG_FAILURE([ar is not found in the system.])
  46. fi
  47. AC_SUBST([AR])
  48. AC_PATH_PROG([A2X], [a2x])
  49. AC_SUBST([A2X])
  50. AM_CONDITIONAL([HAVE_A2X], [ test "x$A2X" != "x" ])
  51. AC_PATH_PROG([ASCIIDOC], [asciidoc])
  52. AC_SUBST([ASCIIDOC])
  53. AM_CONDITIONAL([HAVE_ASCIIDOC], [ test "x$ASCIIDOC" != "x" ])
  54. # Setting language choice
  55. AC_LANG([C++])
  56. # Enable system extensions
  57. AC_USE_SYSTEM_EXTENSIONS
  58. # Check pkg-config is available
  59. PKG_PROG_PKG_CONFIG([0.20])
  60. # Checks for libraries.
  61. if test "x$with_libxml2" = "xyes"; then
  62. AM_PATH_XML2([2.6.24], [have_libxml2=yes])
  63. if test "x$have_libxml2" = "xyes"; then
  64. AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if you have libxml2.])
  65. LIBS="$XML_LIBS $LIBS"
  66. CPPFLAGS="$XML_CPPFLAGS $CPPFLAGS"
  67. elif test "x$with_libxml2_requested" = "xyes"; then
  68. ARIA2_DEP_NOT_MET([libxml2])
  69. fi
  70. fi
  71. if test "x$with_libexpat" = "xyes" && test "x$have_libxml2" != "xyes"; then
  72. AM_PATH_LIBEXPAT
  73. if test "x$have_libexpat" = "xyes"; then
  74. LIBS="$LIBEXPAT_LIBS $LIBS"
  75. CPPFLAGS="$LIBEXPAT_CPPFLAGS $CPPFLAGS"
  76. elif test "x$with_libexpat_requested" = "xyes"; then
  77. ARIA2_DEP_NOT_MET([libexpat])
  78. fi
  79. fi
  80. if test "x$with_sqlite3" = "xyes"; then
  81. AM_PATH_SQLITE3
  82. if test "x$have_sqlite3" = "xyes"; then
  83. LIBS="$SQLITE3_LIBS $LIBS"
  84. CPPFLAGS="$SQLITE3_CFLAGS $CPPFLAGS"
  85. elif test "x$with_sqlite3_requested" = "xyes"; then
  86. ARIA2_DEP_NOT_MET([sqlite3])
  87. fi
  88. fi
  89. if test "x$with_gnutls" = "xyes"; then
  90. # gnutls >= 2.8 doesn't have libgnutls-config anymore. We require
  91. # 2.2.0 because we use gnutls_priority_set_direct()
  92. PKG_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.2.0],
  93. [have_libgnutls=yes], [have_libgnutls=no])
  94. if test "x$have_libgnutls" = "xyes"; then
  95. AC_DEFINE([HAVE_LIBGNUTLS], [1], [Define to 1 if you have libgnutls.])
  96. LIBS="$LIBGNUTLS_LIBS $LIBS"
  97. CPPFLAGS="$LIBGNUTLS_CFLAGS $CPPFLAGS"
  98. elif test "x$with_gnutls_requested" = "xyes"; then
  99. ARIA2_DEP_NOT_MET([gnutls])
  100. fi
  101. fi
  102. if test "x$with_openssl" = "xyes" && test "x$have_libgnutls" != "xyes"; then
  103. AM_PATH_OPENSSL
  104. if test "x$have_openssl" = "xyes"; then
  105. LIBS="$OPENSSL_LIBS $LIBS"
  106. CPPFLAGS="$OPENSSL_CFLAGS $CPPFLAGS"
  107. elif test "x$with_openssl_requested" = "xyes"; then
  108. ARIA2_DEP_NOT_MET([openssl])
  109. fi
  110. fi
  111. if test "x$have_openssl" != "xyes"; then
  112. if test "x$with_libnettle" = "xyes"; then
  113. AC_SEARCH_LIBS([nettle_sha1_init], [nettle],
  114. [have_libnettle=yes], [have_libnettle=no])
  115. if test "x$have_libnettle" = "xyes"; then
  116. AC_DEFINE([HAVE_LIBNETTLE], [1], [Define to 1 if you have libnettle.])
  117. fi
  118. fi
  119. if test "x$with_libgmp" = "xyes" &&
  120. test "x$have_libnettle" = "xyes" &&
  121. test "x$enable_bittorrent" = "xyes"; then
  122. AC_SEARCH_LIBS([__gmpz_init], [gmp], [have_libgmp=yes], [have_libgmp=no])
  123. if test "x$have_libgmp" = "xyes"; then
  124. AC_DEFINE([HAVE_LIBGMP], [1], [Define to 1 if you have libgmp.])
  125. fi
  126. fi
  127. if test "x$with_libgcrypt" = "xyes" &&
  128. test "x$have_libnettle" != "xyes"; then
  129. AM_PATH_LIBGCRYPT([1.2.4], [have_libgcrypt=yes])
  130. if test "x$have_libgcrypt" = "xyes"; then
  131. AC_DEFINE([HAVE_LIBGCRYPT], [1], [Define to 1 if you have libgcrypt.])
  132. LIBS="$LIBGCRYPT_LIBS $LIBS"
  133. CPPFLAGS="$LIBGCRYPT_CFLAGS $CPPFLAGS"
  134. fi
  135. fi
  136. fi
  137. if test "x$with_libcares" = "xyes"; then
  138. AM_PATH_LIBCARES
  139. if test "x$have_libcares" = "xyes"; then
  140. LIBS="$LIBCARES_LIBS $LIBS"
  141. CPPFLAGS="$LIBCARES_CFLAGS $CPPFLAGS"
  142. elif test "x$with_libcares_requested" = "xyes"; then
  143. ARIA2_DEP_NOT_MET([libcares])
  144. fi
  145. fi
  146. # Check availability of libz
  147. if test "x$with_libz" = "xyes"; then
  148. AM_PATH_LIBZ
  149. if test "x$have_zlib" = "xyes"; then
  150. LIBS="$ZLIB_LIBS $LIBS"
  151. CPPFLAGS="$ZLIB_CFLAGS $CPPFLAGS"
  152. elif test "x$with_libz_requested" = "xyes"; then
  153. ARIA2_DEP_NOT_MET([libz])
  154. fi
  155. fi
  156. # Define variables based on the result of the checks for libraries.
  157. if test "x$have_libgnutls" = "xyes" || test "x$have_openssl" = "xyes"; then
  158. AC_DEFINE([ENABLE_SSL], [1], [Define to 1 if ssl support is enabled.])
  159. AM_CONDITIONAL([ENABLE_SSL], true)
  160. AC_SUBST([ca_bundle])
  161. else
  162. AM_CONDITIONAL([ENABLE_SSL], false)
  163. fi
  164. AM_CONDITIONAL([HAVE_LIBGNUTLS], [ test "x$have_libgnutls" = "xyes" ])
  165. AM_CONDITIONAL([HAVE_LIBNETTLE], [ test "x$have_libnettle" = "xyes" ])
  166. AM_CONDITIONAL([HAVE_LIBGMP], [ test "x$have_libgmp" = "xyes" ])
  167. AM_CONDITIONAL([HAVE_LIBGCRYPT], [ test "x$have_libgcrypt" = "xyes" ])
  168. AM_CONDITIONAL([HAVE_OPENSSL], [ test "x$have_openssl" = "xyes" ])
  169. if test "x$have_libnettle" = "xyes" || test "x$have_libgcrypt" = "xyes" ||
  170. test "x$have_openssl" = "xyes"; then
  171. AC_DEFINE([ENABLE_MESSAGE_DIGEST], [1],
  172. [Define to 1 if message digest support is enabled.])
  173. AM_CONDITIONAL([ENABLE_MESSAGE_DIGEST], true)
  174. enable_message_digest=yes
  175. else
  176. AM_CONDITIONAL([ENABLE_MESSAGE_DIGEST], false)
  177. fi
  178. if test "x$have_libnettle" = "xyes" && test "x$have_libgmp" = "xyes" ||
  179. test "x$have_libgcrypt" = "xyes" || test "x$have_openssl" = "xyes"; then
  180. enable_bignum=yes
  181. fi
  182. if test "x$enable_bittorrent" = "xyes" &&
  183. test "x$enable_message_digest" = "xyes" &&
  184. test "x$enable_bignum" = "xyes"; then
  185. AC_DEFINE([ENABLE_BITTORRENT], [1],
  186. [Define to 1 if BitTorrent support is enabled.])
  187. AM_CONDITIONAL([ENABLE_BITTORRENT], true)
  188. else
  189. if test "x$enable_bittorrent_requested" = "xyes"; then
  190. ARIA2_FET_NOT_SUPPORTED([bittorrent])
  191. fi
  192. enable_bittorrent=no
  193. AM_CONDITIONAL([ENABLE_BITTORRENT], false)
  194. fi
  195. if (test "x$have_libxml2" = "xyes" || test "x$have_libexpat" = "xyes") &&
  196. test "x$enable_metalink" = "xyes"; then
  197. AC_DEFINE([ENABLE_METALINK], [1],
  198. [Define to 1 if Metalink support is enabled.])
  199. AM_CONDITIONAL([ENABLE_METALINK], true)
  200. else
  201. if test "x$enable_metalink_requested" = "xyes"; then
  202. ARIA2_FET_NOT_SUPPORTED([metalink])
  203. fi
  204. enable_metalink=no
  205. AM_CONDITIONAL([ENABLE_METALINK], false)
  206. fi
  207. AM_CONDITIONAL([HAVE_SOME_XMLLIB],
  208. [test "x$have_libxml2" = "xyes" || test "x$have_libexpat" = "xyes"])
  209. if test "x$have_libxml2" = "xyes" || test "x$have_libexpat" = "xyes"; then
  210. enable_xml_rpc=yes
  211. fi
  212. if test "x$enable_xml_rpc" = "xyes"; then
  213. AC_DEFINE([ENABLE_XML_RPC], [1],
  214. [Define to 1 if XML-RPC support is enabled.])
  215. fi
  216. AM_CONDITIONAL([ENABLE_XML_RPC], [test "x$enable_xml_rpc" = "xyes"])
  217. AM_CONDITIONAL([HAVE_LIBXML2], [test "x$have_libxml2" = "xyes"])
  218. AM_CONDITIONAL([HAVE_LIBEXPAT], [test "x$have_libexpat" = "xyes"])
  219. if test "x$have_libcares" = "xyes"; then
  220. AC_DEFINE([ENABLE_ASYNC_DNS], [1],
  221. [Define to 1 if asynchronous DNS support is enabled.])
  222. AM_CONDITIONAL([ENABLE_ASYNC_DNS], true)
  223. else
  224. AM_CONDITIONAL([ENABLE_ASYNC_DNS], false)
  225. fi
  226. # Set conditional for libz
  227. AM_CONDITIONAL([HAVE_ZLIB], [test "x$have_zlib" = "xyes"])
  228. # Set conditional for sqlite3
  229. AM_CONDITIONAL([HAVE_SQLITE3], [test "x$have_sqlite3" = "xyes"])
  230. AC_SEARCH_LIBS([clock_gettime], [rt])
  231. case "$target" in
  232. *solaris*)
  233. AC_SEARCH_LIBS([getaddrinfo], [nsl socket])
  234. AC_SEARCH_LIBS([inet_aton], [nsl socket])
  235. ;;
  236. esac
  237. # Checks for header files.
  238. AC_FUNC_ALLOCA
  239. AC_HEADER_STDC
  240. case "$target" in
  241. *mingw*)
  242. AC_CHECK_HEADERS([windows.h \
  243. winsock2.h \
  244. ws2tcpip.h \
  245. mmsystem.h], [], [],
  246. [[#ifdef HAVE_WINDOWS_H
  247. # include <windows.h>
  248. #endif
  249. ]])
  250. ;;
  251. esac
  252. AC_CHECK_HEADERS([argz.h \
  253. arpa/inet.h \
  254. fcntl.h \
  255. float.h \
  256. inttypes.h \
  257. io.h \
  258. langinfo.h \
  259. libintl.h \
  260. limits.h \
  261. locale.h \
  262. malloc.h \
  263. netdb.h \
  264. netinet/in.h \
  265. poll.h \
  266. port.h \
  267. stddef.h \
  268. stdint.h \
  269. stdio_ext.h \
  270. stdlib.h \
  271. string.h \
  272. strings.h \
  273. sys/ioctl.h \
  274. sys/param.h \
  275. sys/socket.h \
  276. sys/time.h \
  277. termios.h \
  278. unistd.h \
  279. utime.h \
  280. wchar.h \
  281. ifaddrs.h])
  282. # Checks for typedefs, structures, and compiler characteristics.
  283. AC_HEADER_STDBOOL
  284. AC_C_CONST
  285. AC_C_INLINE
  286. AC_TYPE_INT16_T
  287. AC_TYPE_INT32_T
  288. AC_TYPE_INT64_T
  289. AC_TYPE_INT8_T
  290. AC_TYPE_MODE_T
  291. AC_TYPE_OFF_T
  292. AC_TYPE_SIZE_T
  293. AC_TYPE_SSIZE_T
  294. AC_HEADER_TIME
  295. AC_STRUCT_TM
  296. AC_TYPE_UINT16_T
  297. AC_TYPE_UINT32_T
  298. AC_TYPE_UINT64_T
  299. AC_TYPE_UINT8_T
  300. AC_TYPE_PID_T
  301. AC_C_VOLATILE
  302. AC_CHECK_TYPES([ptrdiff_t, struct timespec])
  303. AC_C_BIGENDIAN
  304. AC_SYS_LARGEFILE
  305. # Checks for library functions.
  306. AM_GNU_GETTEXT
  307. AM_GNU_GETTEXT_VERSION([0.18])
  308. AC_FUNC_ERROR_AT_LINE
  309. AC_PROG_GCC_TRADITIONAL
  310. AC_FUNC_MEMCMP
  311. AC_FUNC_MKTIME
  312. AC_FUNC_MMAP
  313. AC_FUNC_SELECT_ARGTYPES
  314. AC_FUNC_STAT
  315. AC_FUNC_STRFTIME
  316. AC_FUNC_VPRINTF
  317. AC_FUNC_FORK
  318. AC_FUNC_STRTOD
  319. AC_CHECK_FUNCS([__argz_count \
  320. __argz_next \
  321. __argz_stringify \
  322. atexit \
  323. ftruncate \
  324. getcwd \
  325. gethostbyaddr \
  326. gethostbyname \
  327. getifaddrs \
  328. getpagesize \
  329. memchr \
  330. memmove \
  331. mempcpy \
  332. memset \
  333. mkdir \
  334. munmap \
  335. nl_langinfo \
  336. posix_memalign \
  337. pow \
  338. putenv \
  339. rmdir \
  340. select \
  341. setlocale \
  342. sleep \
  343. socket \
  344. stpcpy \
  345. strcasecmp \
  346. strchr \
  347. strcspn \
  348. strdup \
  349. strerror \
  350. strncasecmp \
  351. strstr \
  352. strtol \
  353. strtoul \
  354. strtoull \
  355. tzset \
  356. unsetenv \
  357. usleep \
  358. utime \
  359. utimes])
  360. if test "x$enable_epoll" = "xyes"; then
  361. AC_CHECK_FUNCS([epoll_create], [have_epoll=yes])
  362. if test "x$have_epoll" = "xyes"; then
  363. AC_DEFINE([HAVE_EPOLL], [1], [Define to 1 if epoll is available.])
  364. fi
  365. fi
  366. AM_CONDITIONAL([HAVE_EPOLL], [test "x$have_epoll" = "xyes"])
  367. AC_CHECK_FUNCS([posix_fallocate],[have_posix_fallocate=yes])
  368. ARIA2_CHECK_FALLOCATE
  369. if test "x$have_posix_fallocate" = "xyes" ||
  370. test "x$have_fallocate" = "xyes" ||
  371. test "x$win_build" = "xyes"; then
  372. AC_DEFINE([HAVE_SOME_FALLOCATE], [1],
  373. [Define to 1 if *_fallocate is available.])
  374. fi
  375. AM_CONDITIONAL([HAVE_SOME_FALLOCATE],
  376. [test "x$have_posix_fallocate" = "xyes" || test "x$have_fallocate" = "xyes" \
  377. || test "x$win_build" = "xyes"])
  378. AC_CHECK_FUNCS([asctime_r],
  379. [AM_CONDITIONAL([HAVE_ASCTIME_R], true)],
  380. [AM_CONDITIONAL([HAVE_ASCTIME_R], false)])
  381. AC_CHECK_FUNCS([basename],
  382. [AM_CONDITIONAL([HAVE_BASENAME], true)],
  383. [AM_CONDITIONAL([HAVE_BASENAME], false)])
  384. AC_CHECK_FUNCS([gai_strerror],
  385. [AM_CONDITIONAL([HAVE_GAI_STRERROR], true)],
  386. [AM_CONDITIONAL([HAVE_GAI_STRERROR], false)])
  387. AC_CHECK_FUNCS([getaddrinfo],
  388. [AM_CONDITIONAL([HAVE_GETADDRINFO], true)],
  389. [AM_CONDITIONAL([HAVE_GETADDRINFO], false)])
  390. AC_CHECK_FUNCS([gettimeofday],
  391. [AM_CONDITIONAL([HAVE_GETTIMEOFDAY], true)],
  392. [AM_CONDITIONAL([HAVE_GETTIMEOFDAY], false)])
  393. AC_CHECK_FUNCS([inet_aton],
  394. [AM_CONDITIONAL([HAVE_INET_ATON], true)],
  395. [AM_CONDITIONAL([HAVE_INET_ATON], false)])
  396. AC_CHECK_FUNCS([localtime_r],
  397. [AM_CONDITIONAL([HAVE_LOCALTIME_R], true)],
  398. [AM_CONDITIONAL([HAVE_LOCALTIME_R], false)])
  399. AC_CHECK_FUNCS([strptime],
  400. [AM_CONDITIONAL([HAVE_STRPTIME], true)],
  401. [AM_CONDITIONAL([HAVE_STRPTIME], false)])
  402. AC_CHECK_FUNCS([timegm],
  403. [AM_CONDITIONAL([HAVE_TIMEGM], true)],
  404. [AM_CONDITIONAL([HAVE_TIMEGM], false)])
  405. AC_CHECK_FUNCS([daemon], [have_daemon=yes])
  406. AM_CONDITIONAL([HAVE_DAEMON], [test "x$have_daemon" = "xyes"])
  407. AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes])
  408. if test "x$have_clock_gettime" != "xyes"; then
  409. AC_CHECK_FUNCS([mach_absolute_time], [have_mach_absolute_time=yes])
  410. fi
  411. AM_CONDITIONAL([HAVE_MACH_ABSOLUTE_TIME],
  412. [test "x$have_mach_absolute_time" = "xyes"])
  413. AC_CHECK_FUNCS([poll], [have_poll=yes])
  414. AM_CONDITIONAL([HAVE_POLL], [test "x$have_poll" = "xyes"])
  415. case "$target" in
  416. *mingw*)
  417. AM_CONDITIONAL([MINGW_BUILD], true)
  418. dnl defined in ws2tcpip.h, but only if _WIN32_WINNT >= 0x0501
  419. AM_CONDITIONAL([HAVE_GETADDRINFO], true)
  420. dnl defined in ws2tcpip.h, but missing in C:\mingw\lib\libws2_32.a
  421. AM_CONDITIONAL([HAVE_GAI_STRERROR], false)
  422. if test "x$have_clock_gettime" != "xyes"; then
  423. AM_CONDITIONAL([HAVE_TIMEGETTIME], true)
  424. fi
  425. ;;
  426. *)
  427. AM_CONDITIONAL([MINGW_BUILD], false)
  428. AM_CONDITIONAL([HAVE_TIMEGETTIME], false)
  429. ;;
  430. esac
  431. AC_CHECK_FUNCS([port_associate], [have_port_associate=yes])
  432. AM_CONDITIONAL([HAVE_PORT_ASSOCIATE], [test "x$have_port_associate" = "xyes"])
  433. AC_CHECK_FUNCS([kqueue], [have_kqueue=yes])
  434. AM_CONDITIONAL([HAVE_KQUEUE], [test "x$have_kqueue" = "xyes"])
  435. if test "x$have_kqueue" = "xyes"; then
  436. AC_MSG_CHECKING([whether struct kevent.udata is intptr_t])
  437. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  438. #include <sys/types.h>
  439. #include <sys/event.h>
  440. #include <sys/time.h>
  441. ]],
  442. [[
  443. struct kevent event;
  444. event.udata = reinterpret_cast<intptr_t>(&event);
  445. ]])],
  446. [kevent_udata_intptr_t=yes], [kevent_udata_intptr_t=no])
  447. AC_MSG_RESULT([$kevent_udata_intptr_t])
  448. if test "x$kevent_udata_intptr_t" = "xyes"; then
  449. AC_DEFINE([KEVENT_UDATA_INTPTR_T], [1], [Define to 1 if struct kevent.udata is intptr_t])
  450. fi
  451. fi
  452. AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
  453. [AC_DEFINE([HAVE_SOCKADDR_IN_SIN_LEN],[1],
  454. [Define to 1 if struct sockaddr_in has sin_len member.])],
  455. [],
  456. [[#include <netinet/in.h>]])
  457. # Check struct option.name is assignable from const char*. struct
  458. # option.name in opensolaris is of type char*. In Linux, it is const
  459. # char*
  460. AC_MSG_CHECKING([whether struct option.name is assignable from const char*])
  461. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  462. #include <unistd.h>
  463. #include <getopt.h>
  464. ]],
  465. [[
  466. const char* s = "const char";
  467. option op;
  468. op.name = s;
  469. ]])],
  470. [have_option_const_name=yes], [have_option_const_name=no])
  471. AC_MSG_RESULT([$have_option_const_name])
  472. if test "x$have_option_const_name" = "xyes"; then
  473. AC_DEFINE([HAVE_OPTION_CONST_NAME], [1], [Define 1 if struct option.name is const char*])
  474. fi
  475. AC_CONFIG_FILES([Makefile
  476. src/Makefile
  477. test/Makefile
  478. po/Makefile.in
  479. intl/Makefile
  480. lib/Makefile
  481. doc/Makefile
  482. doc/ru/Makefile])
  483. AC_OUTPUT
  484. echo " "
  485. echo "Build: $build"
  486. echo "Target: $target"
  487. echo "Install prefix: $prefix"
  488. echo "CXXFLAGS: $CXXFLAGS"
  489. echo "CFLAGS: $CFLAGS"
  490. echo "CPPFLAGS: $CPPFLAGS"
  491. echo "LDFLAGS: $LDFLAGS"
  492. echo "LIBS: $LIBS"
  493. echo "DEFS: $DEFS"
  494. echo "SQLite3: $have_sqlite3"
  495. echo "GnuTLS: $have_libgnutls"
  496. echo "OpenSSL: $have_openssl"
  497. echo "CA Bundle: $ca_bundle"
  498. echo "LibXML2: $have_libxml2"
  499. echo "LibExpat: $have_libexpat"
  500. echo "LibCares: $have_libcares"
  501. echo "Zlib: $have_zlib"
  502. echo "Epoll: $have_epoll"
  503. echo "Bittorrent: $enable_bittorrent"
  504. echo "Metalink: $enable_metalink"
  505. echo "XML-RPC: $enable_xml_rpc"