configure.ac 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567
  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.15.0],[t-tujikawa@users.sourceforge.net],[aria2],[http://aria2.sourceforge.net/])
  7. AC_USE_SYSTEM_EXTENSIONS
  8. LT_INIT()
  9. AC_CONFIG_MACRO_DIR([m4])
  10. AC_CANONICAL_HOST
  11. AC_CANONICAL_TARGET
  12. AM_INIT_AUTOMAKE()
  13. AM_PATH_CPPUNIT(1.10.2)
  14. AC_CONFIG_SRCDIR([src/a2io.h])
  15. AC_CONFIG_HEADERS([config.h])
  16. case "$target" in
  17. *mingw*|*cygwin*)
  18. win_build=yes
  19. LIBS="-lws2_32 -lcrypto -lwsock32 -lgdi32 -lwinmm $LIBS"
  20. ;;
  21. esac
  22. AC_DEFINE_UNQUOTED([TARGET], ["$target"], [Define target-type])
  23. # Checks for arguments.
  24. ARIA2_ARG_WITH([gnutls])
  25. ARIA2_ARG_WITH([libnettle])
  26. ARIA2_ARG_WITH([libgmp])
  27. ARIA2_ARG_WITH([libgcrypt])
  28. ARIA2_ARG_WITH([openssl])
  29. ARIA2_ARG_WITH([sqlite3])
  30. ARIA2_ARG_WITH([libxml2])
  31. ARIA2_ARG_WITH([libexpat])
  32. ARIA2_ARG_WITH([libcares])
  33. ARIA2_ARG_WITH([libz])
  34. ARIA2_ARG_ENABLE([bittorrent])
  35. ARIA2_ARG_ENABLE([metalink])
  36. ARIA2_ARG_ENABLE([epoll])
  37. AC_ARG_WITH([ca-bundle],
  38. AS_HELP_STRING([--with-ca-bundle=FILE],[Use FILE as default CA bundle.]),
  39. [ca_bundle=$withval], [ca_bundle=""])
  40. # Checks for programs.
  41. AC_PROG_CXX
  42. AC_PROG_CC
  43. AC_PROG_INSTALL
  44. AC_PROG_MKDIR_P
  45. AC_PROG_YACC
  46. AC_CHECK_TOOL([AR], [ar], [:])
  47. if test "x$AR" = "x:"; then
  48. AC_MSG_FAILURE([ar is not found in the system.])
  49. fi
  50. AC_SUBST([AR])
  51. AC_PATH_PROG([A2X], [a2x])
  52. AC_SUBST([A2X])
  53. AM_CONDITIONAL([HAVE_A2X], [ test "x$A2X" != "x" ])
  54. AC_PATH_PROG([ASCIIDOC], [asciidoc])
  55. AC_SUBST([ASCIIDOC])
  56. AM_CONDITIONAL([HAVE_ASCIIDOC], [ test "x$ASCIIDOC" != "x" ])
  57. # Setting language choice
  58. AC_LANG([C++])
  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. netinet/tcp.h \
  267. poll.h \
  268. port.h \
  269. stddef.h \
  270. stdint.h \
  271. stdio_ext.h \
  272. stdlib.h \
  273. string.h \
  274. strings.h \
  275. sys/ioctl.h \
  276. sys/param.h \
  277. sys/socket.h \
  278. sys/time.h \
  279. termios.h \
  280. unistd.h \
  281. utime.h \
  282. wchar.h \
  283. ifaddrs.h])
  284. # Checks for typedefs, structures, and compiler characteristics.
  285. AC_HEADER_STDBOOL
  286. AC_C_CONST
  287. AC_C_INLINE
  288. AC_TYPE_INT16_T
  289. AC_TYPE_INT32_T
  290. AC_TYPE_INT64_T
  291. AC_TYPE_INT8_T
  292. AC_TYPE_MODE_T
  293. AC_TYPE_OFF_T
  294. AC_TYPE_SIZE_T
  295. AC_TYPE_SSIZE_T
  296. AC_HEADER_TIME
  297. AC_STRUCT_TM
  298. AC_TYPE_UINT16_T
  299. AC_TYPE_UINT32_T
  300. AC_TYPE_UINT64_T
  301. AC_TYPE_UINT8_T
  302. AC_TYPE_PID_T
  303. AC_C_VOLATILE
  304. AC_CHECK_TYPES([ptrdiff_t, struct timespec])
  305. AC_C_BIGENDIAN
  306. AC_SYS_LARGEFILE
  307. # Checks for library functions.
  308. AM_GNU_GETTEXT
  309. AM_GNU_GETTEXT_VERSION([0.18])
  310. AC_FUNC_ERROR_AT_LINE
  311. AC_PROG_GCC_TRADITIONAL
  312. AC_FUNC_MEMCMP
  313. AC_FUNC_MKTIME
  314. AC_FUNC_MMAP
  315. AC_FUNC_SELECT_ARGTYPES
  316. AC_FUNC_STAT
  317. AC_FUNC_STRFTIME
  318. AC_FUNC_VPRINTF
  319. AC_FUNC_FORK
  320. AC_FUNC_STRTOD
  321. AC_CHECK_FUNCS([__argz_count \
  322. __argz_next \
  323. __argz_stringify \
  324. atexit \
  325. ftruncate \
  326. getcwd \
  327. gethostbyaddr \
  328. gethostbyname \
  329. getifaddrs \
  330. getpagesize \
  331. memchr \
  332. memmove \
  333. mempcpy \
  334. memset \
  335. mkdir \
  336. munmap \
  337. nl_langinfo \
  338. posix_memalign \
  339. pow \
  340. putenv \
  341. rmdir \
  342. select \
  343. setlocale \
  344. sleep \
  345. socket \
  346. stpcpy \
  347. strcasecmp \
  348. strchr \
  349. strcspn \
  350. strdup \
  351. strerror \
  352. strncasecmp \
  353. strstr \
  354. strtol \
  355. strtoul \
  356. strtoull \
  357. tzset \
  358. unsetenv \
  359. usleep \
  360. utime \
  361. utimes])
  362. if test "x$enable_epoll" = "xyes"; then
  363. AC_CHECK_FUNCS([epoll_create], [have_epoll=yes])
  364. if test "x$have_epoll" = "xyes"; then
  365. AC_DEFINE([HAVE_EPOLL], [1], [Define to 1 if epoll is available.])
  366. fi
  367. fi
  368. AM_CONDITIONAL([HAVE_EPOLL], [test "x$have_epoll" = "xyes"])
  369. AC_CHECK_FUNCS([posix_fallocate],[have_posix_fallocate=yes])
  370. ARIA2_CHECK_FALLOCATE
  371. if test "x$have_posix_fallocate" = "xyes" ||
  372. test "x$have_fallocate" = "xyes" ||
  373. test "x$win_build" = "xyes"; then
  374. AC_DEFINE([HAVE_SOME_FALLOCATE], [1],
  375. [Define to 1 if *_fallocate is available.])
  376. fi
  377. AM_CONDITIONAL([HAVE_SOME_FALLOCATE],
  378. [test "x$have_posix_fallocate" = "xyes" || test "x$have_fallocate" = "xyes" \
  379. || test "x$win_build" = "xyes"])
  380. AC_CHECK_FUNCS([asctime_r],
  381. [AM_CONDITIONAL([HAVE_ASCTIME_R], true)],
  382. [AM_CONDITIONAL([HAVE_ASCTIME_R], false)])
  383. AC_CHECK_FUNCS([basename],
  384. [AM_CONDITIONAL([HAVE_BASENAME], true)],
  385. [AM_CONDITIONAL([HAVE_BASENAME], false)])
  386. AC_CHECK_FUNCS([gai_strerror],
  387. [AM_CONDITIONAL([HAVE_GAI_STRERROR], true)],
  388. [AM_CONDITIONAL([HAVE_GAI_STRERROR], false)])
  389. AC_CHECK_FUNCS([getaddrinfo],
  390. [AM_CONDITIONAL([HAVE_GETADDRINFO], true)],
  391. [AM_CONDITIONAL([HAVE_GETADDRINFO], false)])
  392. AC_CHECK_FUNCS([gettimeofday],
  393. [AM_CONDITIONAL([HAVE_GETTIMEOFDAY], true)],
  394. [AM_CONDITIONAL([HAVE_GETTIMEOFDAY], false)])
  395. AC_CHECK_FUNCS([inet_aton],
  396. [AM_CONDITIONAL([HAVE_INET_ATON], true)],
  397. [AM_CONDITIONAL([HAVE_INET_ATON], false)])
  398. AC_CHECK_FUNCS([localtime_r],
  399. [AM_CONDITIONAL([HAVE_LOCALTIME_R], true)],
  400. [AM_CONDITIONAL([HAVE_LOCALTIME_R], false)])
  401. AC_CHECK_FUNCS([strptime],
  402. [AM_CONDITIONAL([HAVE_STRPTIME], true)],
  403. [AM_CONDITIONAL([HAVE_STRPTIME], false)])
  404. AC_CHECK_FUNCS([timegm],
  405. [AM_CONDITIONAL([HAVE_TIMEGM], true)],
  406. [AM_CONDITIONAL([HAVE_TIMEGM], false)])
  407. AC_CHECK_FUNCS([daemon], [have_daemon=yes])
  408. AM_CONDITIONAL([HAVE_DAEMON], [test "x$have_daemon" = "xyes"])
  409. AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes])
  410. if test "x$have_clock_gettime" != "xyes"; then
  411. AC_CHECK_FUNCS([mach_absolute_time], [have_mach_absolute_time=yes])
  412. fi
  413. AM_CONDITIONAL([HAVE_MACH_ABSOLUTE_TIME],
  414. [test "x$have_mach_absolute_time" = "xyes"])
  415. AC_CHECK_FUNCS([poll], [have_poll=yes])
  416. AM_CONDITIONAL([HAVE_POLL], [test "x$have_poll" = "xyes"])
  417. case "$target" in
  418. *mingw*)
  419. AM_CONDITIONAL([MINGW_BUILD], true)
  420. dnl defined in ws2tcpip.h, but only if _WIN32_WINNT >= 0x0501
  421. AM_CONDITIONAL([HAVE_GETADDRINFO], true)
  422. dnl defined in ws2tcpip.h, but missing in C:\mingw\lib\libws2_32.a
  423. AM_CONDITIONAL([HAVE_GAI_STRERROR], false)
  424. if test "x$have_clock_gettime" != "xyes"; then
  425. AM_CONDITIONAL([HAVE_TIMEGETTIME], true)
  426. fi
  427. ;;
  428. *)
  429. AM_CONDITIONAL([MINGW_BUILD], false)
  430. AM_CONDITIONAL([HAVE_TIMEGETTIME], false)
  431. ;;
  432. esac
  433. AC_CHECK_FUNCS([port_associate], [have_port_associate=yes])
  434. AM_CONDITIONAL([HAVE_PORT_ASSOCIATE], [test "x$have_port_associate" = "xyes"])
  435. AC_CHECK_FUNCS([kqueue], [have_kqueue=yes])
  436. AM_CONDITIONAL([HAVE_KQUEUE], [test "x$have_kqueue" = "xyes"])
  437. if test "x$have_kqueue" = "xyes"; then
  438. AC_MSG_CHECKING([whether struct kevent.udata is intptr_t])
  439. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  440. #include <sys/types.h>
  441. #include <sys/event.h>
  442. #include <sys/time.h>
  443. ]],
  444. [[
  445. struct kevent event;
  446. event.udata = reinterpret_cast<intptr_t>(&event);
  447. ]])],
  448. [kevent_udata_intptr_t=yes], [kevent_udata_intptr_t=no])
  449. AC_MSG_RESULT([$kevent_udata_intptr_t])
  450. if test "x$kevent_udata_intptr_t" = "xyes"; then
  451. AC_DEFINE([KEVENT_UDATA_INTPTR_T], [1], [Define to 1 if struct kevent.udata is intptr_t])
  452. fi
  453. fi
  454. AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
  455. [AC_DEFINE([HAVE_SOCKADDR_IN_SIN_LEN],[1],
  456. [Define to 1 if struct sockaddr_in has sin_len member.])],
  457. [],
  458. [[#include <netinet/in.h>]])
  459. # Check struct option.name is assignable from const char*. struct
  460. # option.name in opensolaris is of type char*. In Linux, it is const
  461. # char*
  462. AC_MSG_CHECKING([whether struct option.name is assignable from const char*])
  463. AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
  464. #include <unistd.h>
  465. #include <getopt.h>
  466. ]],
  467. [[
  468. const char* s = "const char";
  469. option op;
  470. op.name = s;
  471. ]])],
  472. [have_option_const_name=yes], [have_option_const_name=no])
  473. AC_MSG_RESULT([$have_option_const_name])
  474. if test "x$have_option_const_name" = "xyes"; then
  475. AC_DEFINE([HAVE_OPTION_CONST_NAME], [1], [Define 1 if struct option.name is const char*])
  476. fi
  477. AC_CONFIG_SUBDIRS([deps/wslay])
  478. LIBS="\$(top_builddir)/deps/wslay/lib/libwslay.la $LIBS"
  479. # $(top_srcdir) for `make distcheck`
  480. CPPFLAGS="-I\$(top_builddir)/deps/wslay/lib/includes -I\$(top_srcdir)/deps/wslay/lib/includes $CPPFLAGS"
  481. AC_CONFIG_FILES([Makefile
  482. src/Makefile
  483. test/Makefile
  484. po/Makefile.in
  485. intl/Makefile
  486. lib/Makefile
  487. doc/Makefile
  488. doc/ru/Makefile
  489. deps/Makefile])
  490. AC_OUTPUT
  491. echo " "
  492. echo "Build: $build"
  493. echo "Target: $target"
  494. echo "Install prefix: $prefix"
  495. echo "CXXFLAGS: $CXXFLAGS"
  496. echo "CFLAGS: $CFLAGS"
  497. echo "CPPFLAGS: $CPPFLAGS"
  498. echo "LDFLAGS: $LDFLAGS"
  499. echo "LIBS: $LIBS"
  500. echo "DEFS: $DEFS"
  501. echo "SQLite3: $have_sqlite3"
  502. echo "GnuTLS: $have_libgnutls"
  503. echo "OpenSSL: $have_openssl"
  504. echo "CA Bundle: $ca_bundle"
  505. echo "LibXML2: $have_libxml2"
  506. echo "LibExpat: $have_libexpat"
  507. echo "LibCares: $have_libcares"
  508. echo "Zlib: $have_zlib"
  509. echo "Epoll: $have_epoll"
  510. echo "Bittorrent: $enable_bittorrent"
  511. echo "Metalink: $enable_metalink"
  512. echo "XML-RPC: $enable_xml_rpc"