configure.ac 16 KB

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