诸暨麻将添加redis
您不能選擇超過 %s 個話題 話題必須以字母或數字為開頭,可包含連接號 ('-') 且最長為 35 個字
 
 
 
 
 
 

3577 行
102 KiB

  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
  9. #
  10. # This software is licensed as described in the file COPYING, which
  11. # you should have received as part of this distribution. The terms
  12. # are also available at http://curl.haxx.se/docs/copyright.html.
  13. #
  14. # You may opt to use, copy, modify, merge, publish, distribute and/or sell
  15. # copies of the Software, and permit persons to whom the Software is
  16. # furnished to do so, under the terms of the COPYING file.
  17. #
  18. # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  19. # KIND, either express or implied.
  20. #
  21. #***************************************************************************
  22. dnl Process this file with autoconf to produce a configure script.
  23. AC_PREREQ(2.57)
  24. dnl We don't know the version number "statically" so we use a dash here
  25. AC_INIT([curl], [-], [a suitable curl mailing list: http://curl.haxx.se/mail/])
  26. XC_OVR_ZZ50
  27. XC_OVR_ZZ60
  28. CURL_OVERRIDE_AUTOCONF
  29. dnl configure script copyright
  30. AC_COPYRIGHT([Copyright (c) 1998 - 2013 Daniel Stenberg, <daniel@haxx.se>
  31. This configure script may be copied, distributed and modified under the
  32. terms of the curl license; see COPYING for more details])
  33. AC_CONFIG_SRCDIR([lib/urldata.h])
  34. AC_CONFIG_HEADERS(lib/curl_config.h include/curl/curlbuild.h)
  35. AC_CONFIG_MACRO_DIR([m4])
  36. AM_MAINTAINER_MODE
  37. CURL_CHECK_OPTION_DEBUG
  38. CURL_CHECK_OPTION_OPTIMIZE
  39. CURL_CHECK_OPTION_WARNINGS
  40. CURL_CHECK_OPTION_WERROR
  41. CURL_CHECK_OPTION_CURLDEBUG
  42. CURL_CHECK_OPTION_SYMBOL_HIDING
  43. CURL_CHECK_OPTION_ARES
  44. XC_CHECK_PATH_SEPARATOR
  45. #
  46. # save the configure arguments
  47. #
  48. CONFIGURE_OPTIONS="\"$ac_configure_args\""
  49. AC_SUBST(CONFIGURE_OPTIONS)
  50. CURL_CFLAG_EXTRAS=""
  51. if test X"$want_werror" = Xyes; then
  52. CURL_CFLAG_EXTRAS="-Werror"
  53. fi
  54. AC_SUBST(CURL_CFLAG_EXTRAS)
  55. dnl SED is mandatory for configure process and libtool.
  56. dnl Set it now, allowing it to be changed later.
  57. if test -z "$SED"; then
  58. dnl allow it to be overridden
  59. AC_PATH_PROG([SED], [sed], [not_found],
  60. [$PATH:/usr/bin:/usr/local/bin])
  61. if test -z "$SED" || test "$SED" = "not_found"; then
  62. AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
  63. fi
  64. fi
  65. AC_SUBST([SED])
  66. dnl GREP is mandatory for configure process and libtool.
  67. dnl Set it now, allowing it to be changed later.
  68. if test -z "$GREP"; then
  69. dnl allow it to be overridden
  70. AC_PATH_PROG([GREP], [grep], [not_found],
  71. [$PATH:/usr/bin:/usr/local/bin])
  72. if test -z "$GREP" || test "$GREP" = "not_found"; then
  73. AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
  74. fi
  75. fi
  76. AC_SUBST([GREP])
  77. dnl EGREP is mandatory for configure process and libtool.
  78. dnl Set it now, allowing it to be changed later.
  79. if test -z "$EGREP"; then
  80. dnl allow it to be overridden
  81. if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
  82. AC_MSG_CHECKING([for egrep])
  83. EGREP="$GREP -E"
  84. AC_MSG_RESULT([$EGREP])
  85. else
  86. AC_PATH_PROG([EGREP], [egrep], [not_found],
  87. [$PATH:/usr/bin:/usr/local/bin])
  88. fi
  89. fi
  90. if test -z "$EGREP" || test "$EGREP" = "not_found"; then
  91. AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
  92. fi
  93. AC_SUBST([EGREP])
  94. dnl AR is mandatory for configure process and libtool.
  95. dnl This is target dependent, so check it as a tool.
  96. if test -z "$AR"; then
  97. dnl allow it to be overridden
  98. AC_PATH_TOOL([AR], [ar], [not_found],
  99. [$PATH:/usr/bin:/usr/local/bin])
  100. if test -z "$AR" || test "$AR" = "not_found"; then
  101. AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
  102. fi
  103. fi
  104. AC_SUBST([AR])
  105. AC_SUBST(libext)
  106. dnl Remove non-configure distributed curlbuild.h
  107. if test -f ${srcdir}/include/curl/curlbuild.h; then
  108. rm -f ${srcdir}/include/curl/curlbuild.h
  109. fi
  110. dnl figure out the libcurl version
  111. CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)"/\1/p' ${srcdir}/include/curl/curlver.h`
  112. XC_CHECK_PROG_CC
  113. XC_AUTOMAKE
  114. AC_MSG_CHECKING([curl version])
  115. AC_MSG_RESULT($CURLVERSION)
  116. AC_SUBST(CURLVERSION)
  117. dnl
  118. dnl we extract the numerical version for curl-config only
  119. VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\(.*\)/\1/p' ${srcdir}/include/curl/curlver.h`
  120. AC_SUBST(VERSIONNUM)
  121. dnl Solaris pkgadd support definitions
  122. PKGADD_PKG="HAXXcurl"
  123. PKGADD_NAME="cURL - a client that groks URLs"
  124. PKGADD_VENDOR="curl.haxx.se"
  125. AC_SUBST(PKGADD_PKG)
  126. AC_SUBST(PKGADD_NAME)
  127. AC_SUBST(PKGADD_VENDOR)
  128. dnl
  129. dnl initialize all the info variables
  130. curl_ssl_msg="no (--with-{ssl,gnutls,nss,polarssl,cyassl,axtls,winssl,darwinssl} )"
  131. curl_ssh_msg="no (--with-libssh2)"
  132. curl_zlib_msg="no (--with-zlib)"
  133. curl_krb4_msg="no (--with-krb4*)"
  134. curl_gss_msg="no (--with-gssapi)"
  135. curl_spnego_msg="no (--with-spnego)"
  136. curl_tls_srp_msg="no (--enable-tls-srp)"
  137. curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
  138. curl_ipv6_msg="no (--enable-ipv6)"
  139. curl_idn_msg="no (--with-{libidn,winidn})"
  140. curl_manual_msg="no (--enable-manual)"
  141. curl_libcurl_msg="enabled (--disable-libcurl-option)"
  142. curl_verbose_msg="enabled (--disable-verbose)"
  143. curl_sspi_msg="no (--enable-sspi)"
  144. curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
  145. curl_ldaps_msg="no (--enable-ldaps)"
  146. curl_rtsp_msg="no (--enable-rtsp)"
  147. curl_rtmp_msg="no (--with-librtmp)"
  148. curl_mtlnk_msg="no (--with-libmetalink)"
  149. init_ssl_msg=${curl_ssl_msg}
  150. dnl
  151. dnl Save some initial values the user might have provided
  152. dnl
  153. INITIAL_LDFLAGS=$LDFLAGS
  154. INITIAL_LIBS=$LIBS
  155. dnl
  156. dnl Detect the canonical host and target build environment
  157. dnl
  158. AC_CANONICAL_HOST
  159. dnl Get system canonical name
  160. AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
  161. dnl Checks for programs.
  162. dnl Our curl_off_t internal and external configure settings
  163. CURL_CONFIGURE_CURL_OFF_T
  164. dnl This defines _ALL_SOURCE for AIX
  165. CURL_CHECK_AIX_ALL_SOURCE
  166. dnl Our configure and build reentrant settings
  167. CURL_CONFIGURE_THREAD_SAFE
  168. CURL_CONFIGURE_REENTRANT
  169. dnl check for how to do large files
  170. AC_SYS_LARGEFILE
  171. XC_LIBTOOL
  172. #
  173. # Automake conditionals based on libtool related checks
  174. #
  175. AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO],
  176. [test "x$xc_lt_shlib_use_version_info" = 'xyes'])
  177. AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED],
  178. [test "x$xc_lt_shlib_use_no_undefined" = 'xyes'])
  179. AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT],
  180. [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes'])
  181. #
  182. # Due to libtool and automake machinery limitations of not allowing
  183. # specifying separate CPPFLAGS or CFLAGS when compiling objects for
  184. # inclusion of these in shared or static libraries, we are forced to
  185. # build using separate configure runs for shared and static libraries
  186. # on systems where different CPPFLAGS or CFLAGS are mandatory in order
  187. # to compile objects for each kind of library. Notice that relying on
  188. # the '-DPIC' CFLAG that libtool provides is not valid given that the
  189. # user might for example choose to build static libraries with PIC.
  190. #
  191. #
  192. # Make our Makefile.am files use the staticlib CPPFLAG only when strictly
  193. # targeting a static library and not building its shared counterpart.
  194. #
  195. AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB],
  196. [test "x$xc_lt_build_static_only" = 'xyes'])
  197. #
  198. # Make staticlib CPPFLAG variable and its definition visible in output
  199. # files unconditionally, providing an empty definition unless strictly
  200. # targeting a static library and not building its shared counterpart.
  201. #
  202. CPPFLAG_CURL_STATICLIB=
  203. if test "x$xc_lt_build_static_only" = 'xyes'; then
  204. CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB'
  205. fi
  206. AC_SUBST([CPPFLAG_CURL_STATICLIB])
  207. # Determine whether all dependent libraries must be specified when linking
  208. if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno"
  209. then
  210. REQUIRE_LIB_DEPS=no
  211. else
  212. REQUIRE_LIB_DEPS=yes
  213. fi
  214. AC_SUBST(REQUIRE_LIB_DEPS)
  215. AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes)
  216. dnl check if there's a way to force code inline
  217. AC_C_INLINE
  218. dnl **********************************************************************
  219. dnl platform/compiler/architecture specific checks/flags
  220. dnl **********************************************************************
  221. CURL_CHECK_COMPILER
  222. CURL_SET_COMPILER_BASIC_OPTS
  223. CURL_SET_COMPILER_DEBUG_OPTS
  224. CURL_SET_COMPILER_OPTIMIZE_OPTS
  225. CURL_SET_COMPILER_WARNING_OPTS
  226. if test "$compiler_id" = "INTEL_UNIX_C"; then
  227. #
  228. if test "$compiler_num" -ge "1000"; then
  229. dnl icc 10.X or later
  230. CFLAGS="$CFLAGS -shared-intel"
  231. elif test "$compiler_num" -ge "900"; then
  232. dnl icc 9.X specific
  233. CFLAGS="$CFLAGS -i-dynamic"
  234. fi
  235. #
  236. fi
  237. CURL_CHECK_COMPILER_HALT_ON_ERROR
  238. CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
  239. CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
  240. CURL_CHECK_COMPILER_SYMBOL_HIDING
  241. CURL_CHECK_CURLDEBUG
  242. AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes)
  243. supports_unittests=yes
  244. # cross-compilation of unit tests static library/programs fails when
  245. # libcurl shared library is built. This might be due to a libtool or
  246. # automake issue. In this case we disable unit tests.
  247. if test "x$cross_compiling" != "xno" &&
  248. test "x$enable_shared" != "xno"; then
  249. supports_unittests=no
  250. fi
  251. # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to
  252. # a problem related with OpenSSL headers and library versions not matching.
  253. # Disable unit tests while time to further investigate this is found.
  254. case $host in
  255. mips-sgi-irix6.5)
  256. if test "$compiler_id" = "GNU_C"; then
  257. supports_unittests=no
  258. fi
  259. ;;
  260. esac
  261. # All AIX autobuilds fails unit tests linking against unittests library
  262. # due to unittests library being built with no symbols or members. Libtool ?
  263. # Disable unit tests while time to further investigate this is found.
  264. case $host_os in
  265. aix*)
  266. supports_unittests=no
  267. ;;
  268. esac
  269. dnl Build unit tests when option --enable-debug is given.
  270. if test "x$want_debug" = "xyes" &&
  271. test "x$supports_unittests" = "xyes"; then
  272. want_unittests=yes
  273. else
  274. want_unittests=no
  275. fi
  276. AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes)
  277. dnl **********************************************************************
  278. dnl Compilation based checks should not be done before this point.
  279. dnl **********************************************************************
  280. dnl **********************************************************************
  281. dnl Make sure that our checks for headers windows.h winsock.h winsock2.h
  282. dnl and ws2tcpip.h take precedence over any other further checks which
  283. dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for
  284. dnl this specific header files. And do them before its results are used.
  285. dnl **********************************************************************
  286. CURL_CHECK_HEADER_WINDOWS
  287. CURL_CHECK_NATIVE_WINDOWS
  288. case X-"$ac_cv_native_windows" in
  289. X-yes)
  290. CURL_CHECK_HEADER_WINSOCK
  291. CURL_CHECK_HEADER_WINSOCK2
  292. CURL_CHECK_HEADER_WS2TCPIP
  293. CURL_CHECK_HEADER_WINLDAP
  294. CURL_CHECK_HEADER_WINBER
  295. ;;
  296. *)
  297. ac_cv_header_winsock_h="no"
  298. ac_cv_header_winsock2_h="no"
  299. ac_cv_header_ws2tcpip_h="no"
  300. ac_cv_header_winldap_h="no"
  301. ac_cv_header_winber_h="no"
  302. ;;
  303. esac
  304. CURL_CHECK_WIN32_LARGEFILE
  305. dnl ************************************************************
  306. dnl switch off particular protocols
  307. dnl
  308. AC_MSG_CHECKING([whether to support http])
  309. AC_ARG_ENABLE(http,
  310. AC_HELP_STRING([--enable-http],[Enable HTTP support])
  311. AC_HELP_STRING([--disable-http],[Disable HTTP support]),
  312. [ case "$enableval" in
  313. no)
  314. AC_MSG_RESULT(no)
  315. AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP])
  316. AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP])
  317. AC_SUBST(CURL_DISABLE_HTTP, [1])
  318. AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
  319. AC_SUBST(CURL_DISABLE_RTSP, [1])
  320. ;;
  321. *) AC_MSG_RESULT(yes)
  322. ;;
  323. esac ],
  324. AC_MSG_RESULT(yes)
  325. )
  326. AC_MSG_CHECKING([whether to support ftp])
  327. AC_ARG_ENABLE(ftp,
  328. AC_HELP_STRING([--enable-ftp],[Enable FTP support])
  329. AC_HELP_STRING([--disable-ftp],[Disable FTP support]),
  330. [ case "$enableval" in
  331. no)
  332. AC_MSG_RESULT(no)
  333. AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP])
  334. AC_SUBST(CURL_DISABLE_FTP, [1])
  335. ;;
  336. *) AC_MSG_RESULT(yes)
  337. ;;
  338. esac ],
  339. AC_MSG_RESULT(yes)
  340. )
  341. AC_MSG_CHECKING([whether to support file])
  342. AC_ARG_ENABLE(file,
  343. AC_HELP_STRING([--enable-file],[Enable FILE support])
  344. AC_HELP_STRING([--disable-file],[Disable FILE support]),
  345. [ case "$enableval" in
  346. no)
  347. AC_MSG_RESULT(no)
  348. AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE])
  349. AC_SUBST(CURL_DISABLE_FILE, [1])
  350. ;;
  351. *) AC_MSG_RESULT(yes)
  352. ;;
  353. esac ],
  354. AC_MSG_RESULT(yes)
  355. )
  356. AC_MSG_CHECKING([whether to support ldap])
  357. AC_ARG_ENABLE(ldap,
  358. AC_HELP_STRING([--enable-ldap],[Enable LDAP support])
  359. AC_HELP_STRING([--disable-ldap],[Disable LDAP support]),
  360. [ case "$enableval" in
  361. no)
  362. AC_MSG_RESULT(no)
  363. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  364. AC_SUBST(CURL_DISABLE_LDAP, [1])
  365. ;;
  366. *)
  367. AC_MSG_RESULT(yes)
  368. ;;
  369. esac ],[
  370. AC_MSG_RESULT(yes) ]
  371. )
  372. AC_MSG_CHECKING([whether to support ldaps])
  373. AC_ARG_ENABLE(ldaps,
  374. AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support])
  375. AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]),
  376. [ case "$enableval" in
  377. no)
  378. AC_MSG_RESULT(no)
  379. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  380. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  381. ;;
  382. *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then
  383. AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS)
  384. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  385. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  386. else
  387. AC_MSG_RESULT(yes)
  388. AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
  389. AC_SUBST(HAVE_LDAP_SSL, [1])
  390. fi
  391. ;;
  392. esac ],[
  393. if test "x$CURL_DISABLE_LDAP" = "x1" ; then
  394. AC_MSG_RESULT(no)
  395. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  396. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  397. else
  398. AC_MSG_RESULT(yes)
  399. AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation])
  400. AC_SUBST(HAVE_LDAP_SSL, [1])
  401. fi ]
  402. )
  403. AC_MSG_CHECKING([whether to support rtsp])
  404. AC_ARG_ENABLE(rtsp,
  405. AC_HELP_STRING([--enable-rtsp],[Enable RTSP support])
  406. AC_HELP_STRING([--disable-rtsp],[Disable RTSP support]),
  407. [ case "$enableval" in
  408. no)
  409. AC_MSG_RESULT(no)
  410. AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP])
  411. AC_SUBST(CURL_DISABLE_RTSP, [1])
  412. ;;
  413. *) if test x$CURL_DISABLE_HTTP = x1 ; then
  414. AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!)
  415. else
  416. AC_MSG_RESULT(yes)
  417. curl_rtsp_msg="enabled"
  418. fi
  419. ;;
  420. esac ],
  421. if test "x$CURL_DISABLE_HTTP" != "x1"; then
  422. AC_MSG_RESULT(yes)
  423. curl_rtsp_msg="enabled"
  424. else
  425. AC_MSG_RESULT(no)
  426. fi
  427. )
  428. AC_MSG_CHECKING([whether to support proxies])
  429. AC_ARG_ENABLE(proxy,
  430. AC_HELP_STRING([--enable-proxy],[Enable proxy support])
  431. AC_HELP_STRING([--disable-proxy],[Disable proxy support]),
  432. [ case "$enableval" in
  433. no)
  434. AC_MSG_RESULT(no)
  435. AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies])
  436. AC_SUBST(CURL_DISABLE_PROXY, [1])
  437. ;;
  438. *) AC_MSG_RESULT(yes)
  439. ;;
  440. esac ],
  441. AC_MSG_RESULT(yes)
  442. )
  443. AC_MSG_CHECKING([whether to support dict])
  444. AC_ARG_ENABLE(dict,
  445. AC_HELP_STRING([--enable-dict],[Enable DICT support])
  446. AC_HELP_STRING([--disable-dict],[Disable DICT support]),
  447. [ case "$enableval" in
  448. no)
  449. AC_MSG_RESULT(no)
  450. AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT])
  451. AC_SUBST(CURL_DISABLE_DICT, [1])
  452. ;;
  453. *) AC_MSG_RESULT(yes)
  454. ;;
  455. esac ],
  456. AC_MSG_RESULT(yes)
  457. )
  458. AC_MSG_CHECKING([whether to support telnet])
  459. AC_ARG_ENABLE(telnet,
  460. AC_HELP_STRING([--enable-telnet],[Enable TELNET support])
  461. AC_HELP_STRING([--disable-telnet],[Disable TELNET support]),
  462. [ case "$enableval" in
  463. no)
  464. AC_MSG_RESULT(no)
  465. AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET])
  466. AC_SUBST(CURL_DISABLE_TELNET, [1])
  467. ;;
  468. *) AC_MSG_RESULT(yes)
  469. ;;
  470. esac ],
  471. AC_MSG_RESULT(yes)
  472. )
  473. AC_MSG_CHECKING([whether to support tftp])
  474. AC_ARG_ENABLE(tftp,
  475. AC_HELP_STRING([--enable-tftp],[Enable TFTP support])
  476. AC_HELP_STRING([--disable-tftp],[Disable TFTP support]),
  477. [ case "$enableval" in
  478. no)
  479. AC_MSG_RESULT(no)
  480. AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP])
  481. AC_SUBST(CURL_DISABLE_TFTP, [1])
  482. ;;
  483. *) AC_MSG_RESULT(yes)
  484. ;;
  485. esac ],
  486. AC_MSG_RESULT(yes)
  487. )
  488. AC_MSG_CHECKING([whether to support pop3])
  489. AC_ARG_ENABLE(pop3,
  490. AC_HELP_STRING([--enable-pop3],[Enable POP3 support])
  491. AC_HELP_STRING([--disable-pop3],[Disable POP3 support]),
  492. [ case "$enableval" in
  493. no)
  494. AC_MSG_RESULT(no)
  495. AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3])
  496. AC_SUBST(CURL_DISABLE_POP3, [1])
  497. ;;
  498. *) AC_MSG_RESULT(yes)
  499. ;;
  500. esac ],
  501. AC_MSG_RESULT(yes)
  502. )
  503. AC_MSG_CHECKING([whether to support imap])
  504. AC_ARG_ENABLE(imap,
  505. AC_HELP_STRING([--enable-imap],[Enable IMAP support])
  506. AC_HELP_STRING([--disable-imap],[Disable IMAP support]),
  507. [ case "$enableval" in
  508. no)
  509. AC_MSG_RESULT(no)
  510. AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP])
  511. AC_SUBST(CURL_DISABLE_IMAP, [1])
  512. ;;
  513. *) AC_MSG_RESULT(yes)
  514. ;;
  515. esac ],
  516. AC_MSG_RESULT(yes)
  517. )
  518. AC_MSG_CHECKING([whether to support smtp])
  519. AC_ARG_ENABLE(smtp,
  520. AC_HELP_STRING([--enable-smtp],[Enable SMTP support])
  521. AC_HELP_STRING([--disable-smtp],[Disable SMTP support]),
  522. [ case "$enableval" in
  523. no)
  524. AC_MSG_RESULT(no)
  525. AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP])
  526. AC_SUBST(CURL_DISABLE_SMTP, [1])
  527. ;;
  528. *) AC_MSG_RESULT(yes)
  529. ;;
  530. esac ],
  531. AC_MSG_RESULT(yes)
  532. )
  533. AC_MSG_CHECKING([whether to support gopher])
  534. AC_ARG_ENABLE(gopher,
  535. AC_HELP_STRING([--enable-gopher],[Enable Gopher support])
  536. AC_HELP_STRING([--disable-gopher],[Disable Gopher support]),
  537. [ case "$enableval" in
  538. no)
  539. AC_MSG_RESULT(no)
  540. AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher])
  541. AC_SUBST(CURL_DISABLE_GOPHER, [1])
  542. ;;
  543. *) AC_MSG_RESULT(yes)
  544. ;;
  545. esac ],
  546. AC_MSG_RESULT(yes)
  547. )
  548. dnl **********************************************************************
  549. dnl Check for built-in manual
  550. dnl **********************************************************************
  551. AC_MSG_CHECKING([whether to provide built-in manual])
  552. AC_ARG_ENABLE(manual,
  553. AC_HELP_STRING([--enable-manual],[Enable built-in manual])
  554. AC_HELP_STRING([--disable-manual],[Disable built-in manual]),
  555. [ case "$enableval" in
  556. no)
  557. AC_MSG_RESULT(no)
  558. ;;
  559. *) AC_MSG_RESULT(yes)
  560. USE_MANUAL="1"
  561. ;;
  562. esac ],
  563. AC_MSG_RESULT(yes)
  564. USE_MANUAL="1"
  565. )
  566. dnl The actual use of the USE_MANUAL variable is done much later in this
  567. dnl script to allow other actions to disable it as well.
  568. dnl ************************************************************
  569. dnl disable C code generation support
  570. dnl
  571. AC_MSG_CHECKING([whether to enable generation of C code])
  572. AC_ARG_ENABLE(libcurl_option,
  573. AC_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support])
  574. AC_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]),
  575. [ case "$enableval" in
  576. no)
  577. AC_MSG_RESULT(no)
  578. AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option])
  579. curl_libcurl_msg="no"
  580. ;;
  581. *) AC_MSG_RESULT(yes)
  582. ;;
  583. esac ],
  584. AC_MSG_RESULT(yes)
  585. )
  586. dnl **********************************************************************
  587. dnl Checks for libraries.
  588. dnl **********************************************************************
  589. AC_MSG_CHECKING([whether to use libgcc])
  590. AC_ARG_ENABLE(libgcc,
  591. AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]),
  592. [ case "$enableval" in
  593. yes)
  594. LIBS="-lgcc $LIBS"
  595. AC_MSG_RESULT(yes)
  596. ;;
  597. *) AC_MSG_RESULT(no)
  598. ;;
  599. esac ],
  600. AC_MSG_RESULT(no)
  601. )
  602. CURL_CHECK_LIB_XNET
  603. dnl gethostbyname without lib or in the nsl lib?
  604. AC_CHECK_FUNC(gethostbyname,
  605. [HAVE_GETHOSTBYNAME="1"
  606. ],
  607. [ AC_CHECK_LIB(nsl, gethostbyname,
  608. [HAVE_GETHOSTBYNAME="1"
  609. LIBS="-lnsl $LIBS"
  610. ])
  611. ])
  612. if test "$HAVE_GETHOSTBYNAME" != "1"
  613. then
  614. dnl gethostbyname in the socket lib?
  615. AC_CHECK_LIB(socket, gethostbyname,
  616. [HAVE_GETHOSTBYNAME="1"
  617. LIBS="-lsocket $LIBS"
  618. ])
  619. fi
  620. if test "$HAVE_GETHOSTBYNAME" != "1"
  621. then
  622. dnl gethostbyname in the watt lib?
  623. AC_CHECK_LIB(watt, gethostbyname,
  624. [HAVE_GETHOSTBYNAME="1"
  625. CPPFLAGS="-I/dev/env/WATT_ROOT/inc"
  626. LDFLAGS="-L/dev/env/WATT_ROOT/lib"
  627. LIBS="-lwatt $LIBS"
  628. ])
  629. fi
  630. dnl At least one system has been identified to require BOTH nsl and socket
  631. dnl libs at the same time to link properly.
  632. if test "$HAVE_GETHOSTBYNAME" != "1"
  633. then
  634. AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs])
  635. my_ac_save_LIBS=$LIBS
  636. LIBS="-lnsl -lsocket $LIBS"
  637. AC_LINK_IFELSE([
  638. AC_LANG_PROGRAM([[
  639. ]],[[
  640. gethostbyname();
  641. ]])
  642. ],[
  643. AC_MSG_RESULT([yes])
  644. HAVE_GETHOSTBYNAME="1"
  645. ],[
  646. AC_MSG_RESULT([no])
  647. LIBS=$my_ac_save_LIBS
  648. ])
  649. fi
  650. if test "$HAVE_GETHOSTBYNAME" != "1"
  651. then
  652. dnl This is for winsock systems
  653. if test "$ac_cv_header_windows_h" = "yes"; then
  654. if test "$ac_cv_header_winsock_h" = "yes"; then
  655. case $host in
  656. *-*-mingw32ce*)
  657. winsock_LIB="-lwinsock"
  658. ;;
  659. *)
  660. winsock_LIB="-lwsock32"
  661. ;;
  662. esac
  663. fi
  664. if test "$ac_cv_header_winsock2_h" = "yes"; then
  665. winsock_LIB="-lws2_32"
  666. fi
  667. if test ! -z "$winsock_LIB"; then
  668. my_ac_save_LIBS=$LIBS
  669. LIBS="$winsock_LIB $LIBS"
  670. AC_MSG_CHECKING([for gethostbyname in $winsock_LIB])
  671. AC_LINK_IFELSE([
  672. AC_LANG_PROGRAM([[
  673. #ifdef HAVE_WINDOWS_H
  674. #ifndef WIN32_LEAN_AND_MEAN
  675. #define WIN32_LEAN_AND_MEAN
  676. #endif
  677. #include <windows.h>
  678. #ifdef HAVE_WINSOCK2_H
  679. #include <winsock2.h>
  680. #else
  681. #ifdef HAVE_WINSOCK_H
  682. #include <winsock.h>
  683. #endif
  684. #endif
  685. #endif
  686. ]],[[
  687. gethostbyname("www.dummysite.com");
  688. ]])
  689. ],[
  690. AC_MSG_RESULT([yes])
  691. HAVE_GETHOSTBYNAME="1"
  692. ],[
  693. AC_MSG_RESULT([no])
  694. winsock_LIB=""
  695. LIBS=$my_ac_save_LIBS
  696. ])
  697. fi
  698. fi
  699. fi
  700. if test "$HAVE_GETHOSTBYNAME" != "1"
  701. then
  702. dnl This is for Minix 3.1
  703. AC_MSG_CHECKING([for gethostbyname for Minix 3])
  704. AC_LINK_IFELSE([
  705. AC_LANG_PROGRAM([[
  706. /* Older Minix versions may need <net/gen/netdb.h> here instead */
  707. #include <netdb.h>
  708. ]],[[
  709. gethostbyname("www.dummysite.com");
  710. ]])
  711. ],[
  712. AC_MSG_RESULT([yes])
  713. HAVE_GETHOSTBYNAME="1"
  714. ],[
  715. AC_MSG_RESULT([no])
  716. ])
  717. fi
  718. if test "$HAVE_GETHOSTBYNAME" != "1"
  719. then
  720. dnl This is for eCos with a stubbed DNS implementation
  721. AC_MSG_CHECKING([for gethostbyname for eCos])
  722. AC_LINK_IFELSE([
  723. AC_LANG_PROGRAM([[
  724. #include <stdio.h>
  725. #include <netdb.h>
  726. ]],[[
  727. gethostbyname("www.dummysite.com");
  728. ]])
  729. ],[
  730. AC_MSG_RESULT([yes])
  731. HAVE_GETHOSTBYNAME="1"
  732. ],[
  733. AC_MSG_RESULT([no])
  734. ])
  735. fi
  736. if test "$HAVE_GETHOSTBYNAME" != "1"
  737. then
  738. dnl gethostbyname in the network lib - for Haiku OS
  739. AC_CHECK_LIB(network, gethostbyname,
  740. [HAVE_GETHOSTBYNAME="1"
  741. LIBS="-lnetwork $LIBS"
  742. ])
  743. fi
  744. if test "$HAVE_GETHOSTBYNAME" != "1"
  745. then
  746. dnl gethostbyname in the net lib - for BeOS
  747. AC_CHECK_LIB(net, gethostbyname,
  748. [HAVE_GETHOSTBYNAME="1"
  749. LIBS="-lnet $LIBS"
  750. ])
  751. fi
  752. if test "$HAVE_GETHOSTBYNAME" != "1"; then
  753. AC_MSG_ERROR([couldn't find libraries for gethostbyname()])
  754. fi
  755. dnl resolve lib?
  756. AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ])
  757. if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then
  758. AC_CHECK_LIB(resolve, strcasecmp,
  759. [LIBS="-lresolve $LIBS"],
  760. ,
  761. -lnsl)
  762. fi
  763. ac_cv_func_strcasecmp="no"
  764. CURL_CHECK_LIBS_CONNECT
  765. CURL_NETWORK_LIBS=$LIBS
  766. dnl **********************************************************************
  767. dnl In case that function clock_gettime with monotonic timer is available,
  768. dnl check for additional required libraries.
  769. dnl **********************************************************************
  770. CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC
  771. dnl **********************************************************************
  772. dnl The preceding library checks are all potentially useful for test
  773. dnl servers and libtest cases which require networking and clock_gettime
  774. dnl support. Save the list of required libraries at this point for use
  775. dnl while linking those test servers and programs.
  776. dnl **********************************************************************
  777. CURL_NETWORK_AND_TIME_LIBS=$LIBS
  778. dnl **********************************************************************
  779. dnl Check for the presence of ZLIB libraries and headers
  780. dnl **********************************************************************
  781. dnl Check for & handle argument to --with-zlib.
  782. clean_CPPFLAGS=$CPPFLAGS
  783. clean_LDFLAGS=$LDFLAGS
  784. clean_LIBS=$LIBS
  785. ZLIB_LIBS=""
  786. AC_ARG_WITH(zlib,
  787. AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH])
  788. AC_HELP_STRING([--without-zlib],[disable use of zlib]),
  789. [OPT_ZLIB="$withval"])
  790. if test "$OPT_ZLIB" = "no" ; then
  791. AC_MSG_WARN([zlib disabled])
  792. else
  793. if test "$OPT_ZLIB" = "yes" ; then
  794. OPT_ZLIB=""
  795. fi
  796. if test -z "$OPT_ZLIB" ; then
  797. dnl check for the lib first without setting any new path, since many
  798. dnl people have it in the default path
  799. AC_CHECK_LIB(z, inflateEnd,
  800. dnl libz found, set the variable
  801. [HAVE_LIBZ="1"
  802. LIBS="-lz $LIBS"],
  803. dnl if no lib found, try /usr/local
  804. [OPT_ZLIB="/usr/local"])
  805. fi
  806. dnl Add a nonempty path to the compiler flags
  807. if test -n "$OPT_ZLIB"; then
  808. CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include"
  809. LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff"
  810. fi
  811. AC_CHECK_HEADER(zlib.h,
  812. [
  813. dnl zlib.h was found
  814. HAVE_ZLIB_H="1"
  815. dnl if the lib wasn't found already, try again with the new paths
  816. if test "$HAVE_LIBZ" != "1"; then
  817. AC_CHECK_LIB(z, gzread,
  818. [
  819. dnl the lib was found!
  820. HAVE_LIBZ="1"
  821. LIBS="-lz $LIBS"
  822. ],
  823. [ CPPFLAGS=$clean_CPPFLAGS
  824. LDFLAGS=$clean_LDFLAGS])
  825. fi
  826. ],
  827. [
  828. dnl zlib.h was not found, restore the flags
  829. CPPFLAGS=$clean_CPPFLAGS
  830. LDFLAGS=$clean_LDFLAGS]
  831. )
  832. if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1"
  833. then
  834. AC_MSG_WARN([configure found only the libz lib, not the header file!])
  835. HAVE_LIBZ=""
  836. CPPFLAGS=$clean_CPPFLAGS
  837. LDFLAGS=$clean_LDFLAGS
  838. LIBS=$clean_LIBS
  839. elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1"
  840. then
  841. AC_MSG_WARN([configure found only the libz header file, not the lib!])
  842. CPPFLAGS=$clean_CPPFLAGS
  843. LDFLAGS=$clean_LDFLAGS
  844. LIBS=$clean_LIBS
  845. elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1"
  846. then
  847. dnl both header and lib were found!
  848. AC_SUBST(HAVE_LIBZ)
  849. AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file])
  850. AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available])
  851. ZLIB_LIBS="-lz"
  852. LIBS="-lz $clean_LIBS"
  853. dnl replace 'HAVE_LIBZ' in the automake makefile.ams
  854. AMFIXLIB="1"
  855. AC_MSG_NOTICE([found both libz and libz.h header])
  856. curl_zlib_msg="enabled"
  857. fi
  858. fi
  859. dnl set variable for use in automakefile(s)
  860. AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1)
  861. AC_SUBST(ZLIB_LIBS)
  862. dnl **********************************************************************
  863. dnl Check for LDAP
  864. dnl **********************************************************************
  865. LDAPLIBNAME=""
  866. AC_ARG_WITH(ldap-lib,
  867. AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]),
  868. [LDAPLIBNAME="$withval"])
  869. LBERLIBNAME=""
  870. AC_ARG_WITH(lber-lib,
  871. AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]),
  872. [LBERLIBNAME="$withval"])
  873. if test x$CURL_DISABLE_LDAP != x1 ; then
  874. CURL_CHECK_HEADER_LBER
  875. CURL_CHECK_HEADER_LDAP
  876. CURL_CHECK_HEADER_LDAPSSL
  877. CURL_CHECK_HEADER_LDAP_SSL
  878. if test -z "$LDAPLIBNAME" ; then
  879. if test "$ac_cv_native_windows" = "yes"; then
  880. dnl Windows uses a single and unique LDAP library name
  881. LDAPLIBNAME="wldap32"
  882. LBERLIBNAME="no"
  883. fi
  884. fi
  885. if test "$LDAPLIBNAME" ; then
  886. AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [
  887. AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled])
  888. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  889. AC_SUBST(CURL_DISABLE_LDAP, [1])
  890. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  891. AC_SUBST(CURL_DISABLE_LDAPS, [1])])
  892. else
  893. dnl Try to find the right ldap libraries for this system
  894. CURL_CHECK_LIBS_LDAP
  895. case X-"$curl_cv_ldap_LIBS" in
  896. X-unknown)
  897. AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled])
  898. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  899. AC_SUBST(CURL_DISABLE_LDAP, [1])
  900. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  901. AC_SUBST(CURL_DISABLE_LDAPS, [1])
  902. ;;
  903. esac
  904. fi
  905. fi
  906. if test x$CURL_DISABLE_LDAP != x1 ; then
  907. if test "$LBERLIBNAME" ; then
  908. dnl If name is "no" then don't define this library at all
  909. dnl (it's only needed if libldap.so's dependencies are broken).
  910. if test "$LBERLIBNAME" != "no" ; then
  911. AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [
  912. AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled])
  913. AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP])
  914. AC_SUBST(CURL_DISABLE_LDAP, [1])
  915. AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS])
  916. AC_SUBST(CURL_DISABLE_LDAPS, [1])])
  917. fi
  918. fi
  919. fi
  920. if test x$CURL_DISABLE_LDAP != x1 ; then
  921. AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd])
  922. if test "$LDAPLIBNAME" = "wldap32"; then
  923. curl_ldap_msg="enabled (winldap)"
  924. AC_DEFINE(CURL_LDAP_WIN, 1, [Use Windows LDAP implementation])
  925. else
  926. curl_ldap_msg="enabled (OpenLDAP)"
  927. if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then
  928. AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code])
  929. AC_SUBST(USE_OPENLDAP, [1])
  930. fi
  931. fi
  932. fi
  933. if test x$CURL_DISABLE_LDAPS != x1 ; then
  934. curl_ldaps_msg="enabled"
  935. fi
  936. dnl **********************************************************************
  937. dnl Checks for IPv6
  938. dnl **********************************************************************
  939. AC_MSG_CHECKING([whether to enable ipv6])
  940. AC_ARG_ENABLE(ipv6,
  941. AC_HELP_STRING([--enable-ipv6],[Enable ipv6 (with ipv4) support])
  942. AC_HELP_STRING([--disable-ipv6],[Disable ipv6 support]),
  943. [ case "$enableval" in
  944. no)
  945. AC_MSG_RESULT(no)
  946. ipv6=no
  947. ;;
  948. *) AC_MSG_RESULT(yes)
  949. ipv6=yes
  950. ;;
  951. esac ],
  952. AC_TRY_RUN([ /* is AF_INET6 available? */
  953. #include <sys/types.h>
  954. #include <sys/socket.h>
  955. main()
  956. {
  957. if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
  958. exit(1);
  959. else
  960. exit(0);
  961. }
  962. ],
  963. AC_MSG_RESULT(yes)
  964. ipv6=yes,
  965. AC_MSG_RESULT(no)
  966. ipv6=no,
  967. AC_MSG_RESULT(no)
  968. ipv6=no
  969. ))
  970. if test "$ipv6" = "yes"; then
  971. curl_ipv6_msg="enabled"
  972. fi
  973. # Check if struct sockaddr_in6 have sin6_scope_id member
  974. if test "$ipv6" = yes; then
  975. AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member])
  976. AC_TRY_COMPILE([
  977. #include <sys/types.h>
  978. #include <netinet/in.h>] ,
  979. struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes)
  980. if test "$have_sin6_scope_id" = yes; then
  981. AC_MSG_RESULT([yes])
  982. AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member])
  983. else
  984. AC_MSG_RESULT([no])
  985. fi
  986. fi
  987. dnl **********************************************************************
  988. dnl Check if the operating system allows programs to write to their own argv[]
  989. dnl **********************************************************************
  990. AC_MSG_CHECKING([if argv can be written to])
  991. AC_RUN_IFELSE([
  992. AC_LANG_SOURCE([[
  993. int main(int argc, char ** argv) {
  994. argv[0][0] = ' ';
  995. return (argv[0][0] == ' ')?0:1;
  996. }
  997. ]])
  998. ],[
  999. curl_cv_writable_argv=yes
  1000. ],[
  1001. curl_cv_writable_argv=no
  1002. ],[
  1003. curl_cv_writable_argv=cross
  1004. ])
  1005. case $curl_cv_writable_argv in
  1006. yes)
  1007. AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv])
  1008. AC_MSG_RESULT(yes)
  1009. ;;
  1010. no)
  1011. AC_MSG_RESULT(no)
  1012. ;;
  1013. *)
  1014. AC_MSG_RESULT(no)
  1015. AC_MSG_WARN([the previous check could not be made default was used])
  1016. ;;
  1017. esac
  1018. dnl **********************************************************************
  1019. dnl Check for the presence of Kerberos4 libraries and headers
  1020. dnl **********************************************************************
  1021. AC_ARG_WITH(krb4-includes,
  1022. AC_HELP_STRING([--with-krb4-includes=DIR],
  1023. [Specify location of kerberos4 headers]),[
  1024. CPPFLAGS="$CPPFLAGS -I$withval"
  1025. KRB4INC="$withval"
  1026. want_krb4=yes
  1027. ])
  1028. AC_ARG_WITH(krb4-libs,
  1029. AC_HELP_STRING([--with-krb4-libs=DIR],[Specify location of kerberos4 libs]),[
  1030. LDFLAGS="$LDFLAGS -L$withval"
  1031. KRB4LIB="$withval"
  1032. want_krb4=yes
  1033. ])
  1034. OPT_KRB4=off
  1035. AC_ARG_WITH(krb4,dnl
  1036. AC_HELP_STRING([--with-krb4=DIR],[where to look for Kerberos4]),[
  1037. OPT_KRB4="$withval"
  1038. if test X"$OPT_KRB4" != Xno; then
  1039. want_krb4="yes"
  1040. if test X"$OPT_KRB4" != Xyes; then
  1041. LDFLAGS="$LDFLAGS -L$OPT_KRB4/lib$libsuff"
  1042. KRB4LIB="$OPT_KRB4/lib$libsuff"
  1043. CPPFLAGS="$CPPFLAGS -I$OPT_KRB4/include"
  1044. KRB4INC="$OPT_KRB4/include"
  1045. fi
  1046. fi
  1047. ])
  1048. AC_MSG_CHECKING([if Kerberos4 support is requested])
  1049. if test "$want_krb4" = yes
  1050. then
  1051. if test "$ipv6" = "yes"; then
  1052. echo krb4 is not compatible with IPv6
  1053. exit 1
  1054. fi
  1055. AC_MSG_RESULT(yes)
  1056. dnl Check for & handle argument to --with-krb4
  1057. AC_MSG_CHECKING(where to look for Kerberos4)
  1058. if test X"$OPT_KRB4" = Xyes
  1059. then
  1060. AC_MSG_RESULT([defaults])
  1061. else
  1062. AC_MSG_RESULT([libs in $KRB4LIB, headers in $KRB4INC])
  1063. fi
  1064. dnl Check for DES library
  1065. AC_CHECK_LIB(des, des_pcbc_encrypt,
  1066. [
  1067. AC_CHECK_HEADERS(des.h)
  1068. dnl resolv lib?
  1069. AC_CHECK_FUNC(res_search, , [AC_CHECK_LIB(resolv, res_search)])
  1070. dnl Check for the Kerberos4 library
  1071. AC_CHECK_LIB(krb, krb_net_read,
  1072. [
  1073. dnl Check for header files
  1074. AC_CHECK_HEADERS(krb.h)
  1075. dnl we found the required libraries, add to LIBS
  1076. LIBS="-lkrb -lcom_err -ldes $LIBS"
  1077. dnl Check for function krb_get_our_ip_for_realm
  1078. dnl this is needed for NAT networks
  1079. AC_CHECK_FUNCS(krb_get_our_ip_for_realm)
  1080. dnl add define KRB4
  1081. AC_DEFINE(HAVE_KRB4, 1,
  1082. [if you have the Kerberos4 libraries (including -ldes)])
  1083. dnl substitute it too!
  1084. KRB4_ENABLED=1
  1085. AC_SUBST(KRB4_ENABLED)
  1086. curl_krb4_msg="enabled"
  1087. dnl the krb4 stuff needs a strlcpy()
  1088. AC_CHECK_FUNCS(strlcpy)
  1089. ])
  1090. ])
  1091. else
  1092. AC_MSG_RESULT(no)
  1093. fi
  1094. dnl **********************************************************************
  1095. dnl Check for FBopenssl(SPNEGO) libraries
  1096. dnl **********************************************************************
  1097. AC_ARG_WITH(spnego,
  1098. AC_HELP_STRING([--with-spnego=DIR],
  1099. [Specify location of SPNEGO library fbopenssl]), [
  1100. SPNEGO_ROOT="$withval"
  1101. if test x"$SPNEGO_ROOT" != xno; then
  1102. want_spnego="yes"
  1103. fi
  1104. ])
  1105. AC_MSG_CHECKING([if SPNEGO support is requested])
  1106. if test x"$want_spnego" = xyes; then
  1107. if test X"$SPNEGO_ROOT" = Xyes; then
  1108. AC_MSG_ERROR([FBOpenSSL libs and/or directories were not found where specified!])
  1109. AC_MSG_RESULT(no)
  1110. else
  1111. if test -z "$SPNEGO_LIB_DIR"; then
  1112. LDFLAGS="$LDFLAGS -L$SPNEGO_ROOT -lfbopenssl"
  1113. else
  1114. LDFLAGS="$LDFLAGS $SPNEGO_LIB_DIR"
  1115. fi
  1116. AC_MSG_RESULT(yes)
  1117. AC_DEFINE(HAVE_SPNEGO, 1,
  1118. [Define this if you have the SPNEGO library fbopenssl])
  1119. curl_spnego_msg="enabled"
  1120. fi
  1121. else
  1122. AC_MSG_RESULT(no)
  1123. fi
  1124. dnl **********************************************************************
  1125. dnl Check for GSS-API libraries
  1126. dnl **********************************************************************
  1127. dnl check for gss stuff in the /usr as default
  1128. GSSAPI_ROOT="/usr"
  1129. AC_ARG_WITH(gssapi-includes,
  1130. AC_HELP_STRING([--with-gssapi-includes=DIR],
  1131. [Specify location of GSSAPI header]),
  1132. [ GSSAPI_INCS="-I$withval"
  1133. want_gss="yes" ]
  1134. )
  1135. AC_ARG_WITH(gssapi-libs,
  1136. AC_HELP_STRING([--with-gssapi-libs=DIR],
  1137. [Specify location of GSSAPI libs]),
  1138. [ GSSAPI_LIB_DIR="-L$withval"
  1139. want_gss="yes" ]
  1140. )
  1141. AC_ARG_WITH(gssapi,
  1142. AC_HELP_STRING([--with-gssapi=DIR],
  1143. [Where to look for GSSAPI]), [
  1144. GSSAPI_ROOT="$withval"
  1145. if test x"$GSSAPI_ROOT" != xno; then
  1146. want_gss="yes"
  1147. if test x"$GSSAPI_ROOT" = xyes; then
  1148. dnl if yes, then use default root
  1149. GSSAPI_ROOT="/usr"
  1150. fi
  1151. fi
  1152. ])
  1153. save_CPPFLAGS="$CPPFLAGS"
  1154. AC_MSG_CHECKING([if GSSAPI support is requested])
  1155. if test x"$want_gss" = xyes; then
  1156. AC_MSG_RESULT(yes)
  1157. if test -z "$GSSAPI_INCS"; then
  1158. if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
  1159. GSSAPI_INCS=`$GSSAPI_ROOT/bin/krb5-config --cflags gssapi`
  1160. elif test "$GSSAPI_ROOT" != "yes"; then
  1161. GSSAPI_INCS="-I$GSSAPI_ROOT/include"
  1162. fi
  1163. fi
  1164. CPPFLAGS="$CPPFLAGS $GSSAPI_INCS"
  1165. AC_CHECK_HEADER(gss.h,
  1166. [
  1167. dnl found in the given dirs
  1168. AC_DEFINE(HAVE_GSSGNU, 1, [if you have the GNU gssapi libraries])
  1169. gnu_gss=yes
  1170. ],
  1171. [
  1172. dnl not found, check Heimdal or MIT
  1173. AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1])
  1174. AC_CHECK_HEADERS(
  1175. [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h],
  1176. [],
  1177. [not_mit=1],
  1178. [
  1179. AC_INCLUDES_DEFAULT
  1180. #ifdef HAVE_GSSAPI_GSSAPI_H
  1181. #include <gssapi/gssapi.h>
  1182. #endif
  1183. ])
  1184. if test "x$not_mit" = "x1"; then
  1185. dnl MIT not found, check for Heimdal
  1186. AC_CHECK_HEADER(gssapi.h,
  1187. [
  1188. dnl found
  1189. AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have the Heimdal gssapi libraries])
  1190. ],
  1191. [
  1192. dnl no header found, disabling GSS
  1193. want_gss=no
  1194. AC_MSG_WARN(disabling GSSAPI since no header files was found)
  1195. ]
  1196. )
  1197. else
  1198. dnl MIT found
  1199. AC_DEFINE(HAVE_GSSMIT, 1, [if you have the MIT gssapi libraries])
  1200. dnl check if we have a really old MIT kerberos (<= 1.2)
  1201. AC_MSG_CHECKING([if gssapi headers declare GSS_C_NT_HOSTBASED_SERVICE])
  1202. AC_COMPILE_IFELSE([
  1203. AC_LANG_PROGRAM([[
  1204. #include <gssapi/gssapi.h>
  1205. #include <gssapi/gssapi_generic.h>
  1206. #include <gssapi/gssapi_krb5.h>
  1207. ]],[[
  1208. gss_import_name(
  1209. (OM_uint32 *)0,
  1210. (gss_buffer_t)0,
  1211. GSS_C_NT_HOSTBASED_SERVICE,
  1212. (gss_name_t *)0);
  1213. ]])
  1214. ],[
  1215. AC_MSG_RESULT([yes])
  1216. ],[
  1217. AC_MSG_RESULT([no])
  1218. AC_DEFINE(HAVE_OLD_GSSMIT, 1,
  1219. [if you have an old MIT gssapi library, lacking GSS_C_NT_HOSTBASED_SERVICE])
  1220. ])
  1221. fi
  1222. ]
  1223. )
  1224. else
  1225. AC_MSG_RESULT(no)
  1226. fi
  1227. if test x"$want_gss" = xyes; then
  1228. AC_DEFINE(HAVE_GSSAPI, 1, [if you have the gssapi libraries])
  1229. curl_gss_msg="enabled (MIT/Heimdal)"
  1230. if test -n "$gnu_gss"; then
  1231. curl_gss_msg="enabled (GNU GSS)"
  1232. LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
  1233. LIBS="-lgss $LIBS"
  1234. elif test -z "$GSSAPI_LIB_DIR"; then
  1235. case $host in
  1236. *-*-darwin*)
  1237. LIBS="-lgssapi_krb5 -lresolv $LIBS"
  1238. ;;
  1239. *)
  1240. if test -f "$GSSAPI_ROOT/bin/krb5-config"; then
  1241. dnl krb5-config doesn't have --libs-only-L or similar, put everything
  1242. dnl into LIBS
  1243. gss_libs=`$GSSAPI_ROOT/bin/krb5-config --libs gssapi`
  1244. LIBS="$gss_libs $LIBS"
  1245. elif test "$GSSAPI_ROOT" != "yes"; then
  1246. LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff"
  1247. LIBS="-lgssapi $LIBS"
  1248. else
  1249. LIBS="-lgssapi $LIBS"
  1250. fi
  1251. ;;
  1252. esac
  1253. else
  1254. LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR"
  1255. LIBS="-lgssapi $LIBS"
  1256. fi
  1257. else
  1258. CPPFLAGS="$save_CPPFLAGS"
  1259. fi
  1260. dnl -------------------------------------------------
  1261. dnl check winssl option before other SSL libraries
  1262. dnl -------------------------------------------------
  1263. OPT_WINSSL=no
  1264. AC_ARG_WITH(winssl,dnl
  1265. AC_HELP_STRING([--with-winssl],[enable Windows native SSL/TLS])
  1266. AC_HELP_STRING([--without-winssl], [disable Windows native SSL/TLS]),
  1267. OPT_WINSSL=$withval)
  1268. AC_MSG_CHECKING([whether to enable Windows native SSL/TLS (Windows native builds only)])
  1269. if test "$curl_ssl_msg" = "$init_ssl_msg"; then
  1270. if test "x$OPT_WINSSL" != "xno" &&
  1271. test "x$ac_cv_native_windows" = "xyes"; then
  1272. AC_MSG_RESULT(yes)
  1273. AC_DEFINE(USE_SCHANNEL, 1, [to enable Windows native SSL/TLS support])
  1274. AC_SUBST(USE_SCHANNEL, [1])
  1275. curl_ssl_msg="enabled (Windows-native)"
  1276. WINSSL_ENABLED=1
  1277. # --with-winssl implies --enable-sspi
  1278. AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
  1279. AC_SUBST(USE_WINDOWS_SSPI, [1])
  1280. curl_sspi_msg="enabled"
  1281. else
  1282. AC_MSG_RESULT(no)
  1283. fi
  1284. else
  1285. AC_MSG_RESULT(no)
  1286. fi
  1287. OPT_DARWINSSL=no
  1288. AC_ARG_WITH(darwinssl,dnl
  1289. AC_HELP_STRING([--with-darwinssl],[enable iOS/Mac OS X native SSL/TLS])
  1290. AC_HELP_STRING([--without-darwinssl], [disable iOS/Mac OS X native SSL/TLS]),
  1291. OPT_DARWINSSL=$withval)
  1292. AC_MSG_CHECKING([whether to enable iOS/Mac OS X native SSL/TLS])
  1293. if test "$curl_ssl_msg" = "$init_ssl_msg"; then
  1294. if test "x$OPT_DARWINSSL" != "xno" &&
  1295. test -d "/System/Library/Frameworks/Security.framework"; then
  1296. AC_MSG_RESULT(yes)
  1297. AC_DEFINE(USE_DARWINSSL, 1, [to enable iOS/Mac OS X native SSL/TLS support])
  1298. AC_SUBST(USE_DARWINSSL, [1])
  1299. curl_ssl_msg="enabled (iOS/Mac OS X-native)"
  1300. DARWINSSL_ENABLED=1
  1301. LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security"
  1302. else
  1303. AC_MSG_RESULT(no)
  1304. fi
  1305. else
  1306. AC_MSG_RESULT(no)
  1307. fi
  1308. dnl **********************************************************************
  1309. dnl Check for the presence of SSL libraries and headers
  1310. dnl **********************************************************************
  1311. dnl Default to compiler & linker defaults for SSL files & libraries.
  1312. OPT_SSL=off
  1313. dnl Default to no CA bundle
  1314. ca="no"
  1315. AC_ARG_WITH(ssl,dnl
  1316. AC_HELP_STRING([--with-ssl=PATH],[Where to look for OpenSSL, PATH points to the SSL installation (default: /usr/local/ssl); when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
  1317. AC_HELP_STRING([--without-ssl], [disable OpenSSL]),
  1318. OPT_SSL=$withval)
  1319. if test "$curl_ssl_msg" = "$init_ssl_msg" && test X"$OPT_SSL" != Xno; then
  1320. dnl backup the pre-ssl variables
  1321. CLEANLDFLAGS="$LDFLAGS"
  1322. CLEANCPPFLAGS="$CPPFLAGS"
  1323. CLEANLIBS="$LIBS"
  1324. case "$OPT_SSL" in
  1325. yes)
  1326. dnl --with-ssl (without path) used
  1327. if test x$cross_compiling != xyes; then
  1328. dnl only do pkg-config magic when not cross-compiling
  1329. PKGTEST="yes"
  1330. fi
  1331. PREFIX_OPENSSL=/usr/local/ssl
  1332. LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
  1333. ;;
  1334. off)
  1335. dnl no --with-ssl option given, just check default places
  1336. if test x$cross_compiling != xyes; then
  1337. dnl only do pkg-config magic when not cross-compiling
  1338. PKGTEST="yes"
  1339. fi
  1340. PREFIX_OPENSSL=
  1341. ;;
  1342. *)
  1343. dnl check the given --with-ssl spot
  1344. PKGTEST="no"
  1345. PREFIX_OPENSSL=$OPT_SSL
  1346. dnl Try pkg-config even when cross-compiling. Since we
  1347. dnl specify PKG_CONFIG_LIBDIR we're only looking where
  1348. dnl the user told us to look
  1349. OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig"
  1350. AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"])
  1351. if test -f "$OPENSSL_PCDIR/openssl.pc"; then
  1352. PKGTEST="yes"
  1353. fi
  1354. dnl in case pkg-config comes up empty, use what we got
  1355. dnl via --with-ssl
  1356. LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff"
  1357. if test "$PREFIX_OPENSSL" != "/usr" ; then
  1358. SSL_LDFLAGS="-L$LIB_OPENSSL"
  1359. SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include"
  1360. fi
  1361. SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl"
  1362. ;;
  1363. esac
  1364. if test "$PKGTEST" = "yes"; then
  1365. CURL_CHECK_PKGCONFIG(openssl, [$OPENSSL_PCDIR])
  1366. if test "$PKGCONFIG" != "no" ; then
  1367. SSL_LIBS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
  1368. $PKGCONFIG --libs-only-l openssl 2>/dev/null`
  1369. SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
  1370. $PKGCONFIG --libs-only-L openssl 2>/dev/null`
  1371. SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl
  1372. $PKGCONFIG --cflags-only-I openssl 2>/dev/null`
  1373. AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"])
  1374. AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"])
  1375. AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"])
  1376. LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'`
  1377. dnl use the values pkg-config reported. This is here
  1378. dnl instead of below with CPPFLAGS and LDFLAGS because we only
  1379. dnl learn about this via pkg-config. If we only have
  1380. dnl the argument to --with-ssl we don't know what
  1381. dnl additional libs may be necessary. Hope that we
  1382. dnl don't need any.
  1383. LIBS="$SSL_LIBS $LIBS"
  1384. fi
  1385. fi
  1386. dnl finally, set flags to use SSL
  1387. CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS"
  1388. LDFLAGS="$LDFLAGS $SSL_LDFLAGS"
  1389. dnl This is for Msys/Mingw
  1390. case $host in
  1391. *-*-msys* | *-*-mingw*)
  1392. AC_MSG_CHECKING([for gdi32])
  1393. my_ac_save_LIBS=$LIBS
  1394. LIBS="-lgdi32 $LIBS"
  1395. AC_TRY_LINK([#include <windef.h>
  1396. #include <wingdi.h>],
  1397. [GdiFlush();],
  1398. [ dnl worked!
  1399. AC_MSG_RESULT([yes])],
  1400. [ dnl failed, restore LIBS
  1401. LIBS=$my_ac_save_LIBS
  1402. AC_MSG_RESULT(no)]
  1403. )
  1404. ;;
  1405. esac
  1406. AC_CHECK_LIB(crypto, CRYPTO_lock,[
  1407. HAVECRYPTO="yes"
  1408. LIBS="-lcrypto $LIBS"
  1409. ],[
  1410. LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL"
  1411. CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include"
  1412. AC_CHECK_LIB(crypto, CRYPTO_add_lock,[
  1413. HAVECRYPTO="yes"
  1414. LIBS="-lcrypto $LIBS"], [
  1415. LDFLAGS="$CLEANLDFLAGS"
  1416. CPPFLAGS="$CLEANCPPFLAGS"
  1417. LIBS="$CLEANLIBS"
  1418. ])
  1419. ])
  1420. if test X"$HAVECRYPTO" = X"yes"; then
  1421. dnl This is only reasonable to do if crypto actually is there: check for
  1422. dnl SSL libs NOTE: it is important to do this AFTER the crypto lib
  1423. AC_CHECK_LIB(ssl, SSL_connect)
  1424. if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
  1425. dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff
  1426. AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use);
  1427. OLIBS=$LIBS
  1428. LIBS="-lRSAglue -lrsaref $LIBS"
  1429. AC_CHECK_LIB(ssl, SSL_connect)
  1430. if test "$ac_cv_lib_ssl_SSL_connect" != yes; then
  1431. dnl still no SSL_connect
  1432. AC_MSG_RESULT(no)
  1433. LIBS=$OLIBS
  1434. else
  1435. AC_MSG_RESULT(yes)
  1436. fi
  1437. else
  1438. dnl Have the libraries--check for SSLeay/OpenSSL headers
  1439. AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \
  1440. openssl/pem.h openssl/ssl.h openssl/err.h,
  1441. curl_ssl_msg="enabled (OpenSSL)"
  1442. OPENSSL_ENABLED=1
  1443. AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]))
  1444. if test $ac_cv_header_openssl_x509_h = no; then
  1445. dnl we don't use the "action" part of the AC_CHECK_HEADERS macro
  1446. dnl since 'err.h' might in fact find a krb4 header with the same
  1447. dnl name
  1448. AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h)
  1449. if test $ac_cv_header_x509_h = yes &&
  1450. test $ac_cv_header_crypto_h = yes &&
  1451. test $ac_cv_header_ssl_h = yes; then
  1452. dnl three matches
  1453. curl_ssl_msg="enabled (OpenSSL)"
  1454. OPENSSL_ENABLED=1
  1455. fi
  1456. fi
  1457. fi
  1458. if test X"$OPENSSL_ENABLED" = X"1"; then
  1459. AC_DEFINE(USE_SSLEAY, 1, [if SSL is enabled])
  1460. dnl is there a pkcs12.h header present?
  1461. AC_CHECK_HEADERS(openssl/pkcs12.h)
  1462. else
  1463. LIBS="$CLEANLIBS"
  1464. fi
  1465. dnl USE_SSLEAY is the historical name for what configure calls
  1466. dnl OPENSSL_ENABLED; the names should really be unified
  1467. USE_SSLEAY="$OPENSSL_ENABLED"
  1468. AC_SUBST(USE_SSLEAY)
  1469. if test X"$OPT_SSL" != Xoff &&
  1470. test "$OPENSSL_ENABLED" != "1"; then
  1471. AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!])
  1472. fi
  1473. fi
  1474. if test X"$OPENSSL_ENABLED" = X"1"; then
  1475. dnl If the ENGINE library seems to be around, check for the OpenSSL engine
  1476. dnl stuff, it is kind of "separated" from the main SSL check
  1477. AC_CHECK_FUNC(ENGINE_init,
  1478. [
  1479. AC_CHECK_HEADERS(openssl/engine.h)
  1480. AC_CHECK_FUNCS( ENGINE_load_builtin_engines )
  1481. ])
  1482. dnl these can only exist if openssl exists
  1483. dnl yassl doesn't have SSL_get_shutdown
  1484. AC_CHECK_FUNCS( RAND_status \
  1485. RAND_screen \
  1486. RAND_egd \
  1487. ENGINE_cleanup \
  1488. CRYPTO_cleanup_all_ex_data \
  1489. SSL_get_shutdown \
  1490. SSLv2_client_method )
  1491. dnl Make an attempt to detect if this is actually yassl's headers and
  1492. dnl OpenSSL emulation layer. We still leave everything else believing
  1493. dnl and acting like OpenSSL.
  1494. AC_MSG_CHECKING([for yaSSL using OpenSSL compatibility mode])
  1495. AC_COMPILE_IFELSE([
  1496. AC_LANG_PROGRAM([[
  1497. #include <openssl/ssl.h>
  1498. ]],[[
  1499. #if defined(YASSL_VERSION) && defined(OPENSSL_VERSION_NUMBER)
  1500. int dummy = SSL_ERROR_NONE;
  1501. #else
  1502. Not the yaSSL OpenSSL compatibility header.
  1503. #endif
  1504. ]])
  1505. ],[
  1506. AC_MSG_RESULT([yes])
  1507. AC_DEFINE_UNQUOTED(USE_YASSLEMUL, 1,
  1508. [Define to 1 if using yaSSL in OpenSSL compatibility mode.])
  1509. curl_ssl_msg="enabled (OpenSSL emulation by yaSSL)"
  1510. ],[
  1511. AC_MSG_RESULT([no])
  1512. ])
  1513. fi
  1514. if test "$OPENSSL_ENABLED" = "1"; then
  1515. if test -n "$LIB_OPENSSL"; then
  1516. dnl when the ssl shared libs were found in a path that the run-time
  1517. dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
  1518. dnl to prevent further configure tests to fail due to this
  1519. if test "x$cross_compiling" != "xyes"; then
  1520. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_OPENSSL"
  1521. export LD_LIBRARY_PATH
  1522. AC_MSG_NOTICE([Added $LIB_OPENSSL to LD_LIBRARY_PATH])
  1523. fi
  1524. fi
  1525. CURL_CHECK_OPENSSL_API
  1526. fi
  1527. fi
  1528. dnl **********************************************************************
  1529. dnl Check for the random seed preferences
  1530. dnl **********************************************************************
  1531. if test X"$OPENSSL_ENABLED" = X"1"; then
  1532. AC_ARG_WITH(egd-socket,
  1533. AC_HELP_STRING([--with-egd-socket=FILE],
  1534. [Entropy Gathering Daemon socket pathname]),
  1535. [ EGD_SOCKET="$withval" ]
  1536. )
  1537. if test -n "$EGD_SOCKET" ; then
  1538. AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET",
  1539. [your Entropy Gathering Daemon socket pathname] )
  1540. fi
  1541. dnl Check for user-specified random device
  1542. AC_ARG_WITH(random,
  1543. AC_HELP_STRING([--with-random=FILE],
  1544. [read randomness from FILE (default=/dev/urandom)]),
  1545. [ RANDOM_FILE="$withval" ],
  1546. [
  1547. if test x$cross_compiling != xyes; then
  1548. dnl Check for random device
  1549. AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] )
  1550. else
  1551. AC_MSG_WARN([skipped the /dev/urandom detection when cross-compiling])
  1552. fi
  1553. ]
  1554. )
  1555. if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then
  1556. AC_SUBST(RANDOM_FILE)
  1557. AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE",
  1558. [a suitable file to read random data from])
  1559. fi
  1560. fi
  1561. dnl ---
  1562. dnl We require OpenSSL with SRP support.
  1563. dnl ---
  1564. if test "$OPENSSL_ENABLED" = "1"; then
  1565. AC_CHECK_LIB(crypto, SRP_Calc_client_key,
  1566. [
  1567. AC_DEFINE(HAVE_SSLEAY_SRP, 1, [if you have the function SRP_Calc_client_key])
  1568. AC_SUBST(HAVE_SSLEAY_SRP, [1])
  1569. ])
  1570. fi
  1571. dnl ----------------------------------------------------
  1572. dnl check for GnuTLS
  1573. dnl ----------------------------------------------------
  1574. dnl Default to compiler & linker defaults for GnuTLS files & libraries.
  1575. OPT_GNUTLS=no
  1576. AC_ARG_WITH(gnutls,dnl
  1577. AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root])
  1578. AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]),
  1579. OPT_GNUTLS=$withval)
  1580. if test "$curl_ssl_msg" = "$init_ssl_msg"; then
  1581. if test X"$OPT_GNUTLS" != Xno; then
  1582. addld=""
  1583. addlib=""
  1584. gtlslib=""
  1585. version=""
  1586. addcflags=""
  1587. if test "x$OPT_GNUTLS" = "xyes"; then
  1588. dnl this is with no partiular path given
  1589. CURL_CHECK_PKGCONFIG(gnutls)
  1590. if test "$PKGCONFIG" != "no" ; then
  1591. addlib=`$PKGCONFIG --libs-only-l gnutls`
  1592. addld=`$PKGCONFIG --libs-only-L gnutls`
  1593. addcflags=`$PKGCONFIG --cflags-only-I gnutls`
  1594. version=`$PKGCONFIG --modversion gnutls`
  1595. gtlslib=`echo $addld | $SED -e 's/-L//'`
  1596. else
  1597. dnl without pkg-config, we try libgnutls-config as that was how it
  1598. dnl used to be done
  1599. check=`libgnutls-config --version 2>/dev/null`
  1600. if test -n "$check"; then
  1601. addlib=`libgnutls-config --libs`
  1602. addcflags=`libgnutls-config --cflags`
  1603. version=`libgnutls-config --version`
  1604. gtlslib=`libgnutls-config --prefix`/lib$libsuff
  1605. fi
  1606. fi
  1607. else
  1608. dnl this is with a given path, first check if there's a libgnutls-config
  1609. dnl there and if not, make an educated guess
  1610. cfg=$OPT_GNUTLS/bin/libgnutls-config
  1611. check=`$cfg --version 2>/dev/null`
  1612. if test -n "$check"; then
  1613. addlib=`$cfg --libs`
  1614. addcflags=`$cfg --cflags`
  1615. version=`$cfg --version`
  1616. gtlslib=`$cfg --prefix`/lib$libsuff
  1617. else
  1618. dnl without pkg-config and libgnutls-config, we guess a lot!
  1619. addlib=-lgnutls
  1620. addld=-L$OPT_GNUTLS/lib$libsuff
  1621. addcflags=-I$OPT_GNUTLS/include
  1622. version="" # we just don't know
  1623. gtlslib=$OPT_GNUTLS/lib$libsuff
  1624. fi
  1625. fi
  1626. if test -z "$version"; then
  1627. dnl lots of efforts, still no go
  1628. version="unknown"
  1629. fi
  1630. if test -n "$addlib"; then
  1631. CLEANLIBS="$LIBS"
  1632. CLEANCPPFLAGS="$CPPFLAGS"
  1633. CLEANLDFLAGS="$LDFLAGS"
  1634. LIBS="$addlib $LIBS"
  1635. LDFLAGS="$LDFLAGS $addld"
  1636. if test "$addcflags" != "-I/usr/include"; then
  1637. CPPFLAGS="$CPPFLAGS $addcflags"
  1638. fi
  1639. AC_CHECK_LIB(gnutls, gnutls_check_version,
  1640. [
  1641. AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled])
  1642. AC_SUBST(USE_GNUTLS, [1])
  1643. GNUTLS_ENABLED=1
  1644. USE_GNUTLS="yes"
  1645. curl_ssl_msg="enabled (GnuTLS)"
  1646. ],
  1647. [
  1648. LIBS="$CLEANLIBS"
  1649. CPPFLAGS="$CLEANCPPFLAGS"
  1650. ])
  1651. if test "x$USE_GNUTLS" = "xyes"; then
  1652. AC_MSG_NOTICE([detected GnuTLS version $version])
  1653. if test -n "$gtlslib"; then
  1654. dnl when shared libs were found in a path that the run-time
  1655. dnl linker doesn't search through, we need to add it to
  1656. dnl LD_LIBRARY_PATH to prevent further configure tests to fail
  1657. dnl due to this
  1658. if test "x$cross_compiling" != "xyes"; then
  1659. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$gtlslib"
  1660. export LD_LIBRARY_PATH
  1661. AC_MSG_NOTICE([Added $gtlslib to LD_LIBRARY_PATH])
  1662. fi
  1663. fi
  1664. fi
  1665. fi
  1666. fi dnl GNUTLS not disabled
  1667. fi
  1668. dnl ---
  1669. dnl Check which crypto backend GnuTLS uses
  1670. dnl ---
  1671. if test "$GNUTLS_ENABLED" = "1"; then
  1672. USE_GNUTLS_NETTLE=
  1673. # First check if we can detect either crypto library via transitive linking
  1674. AC_CHECK_LIB(gnutls, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
  1675. if test "$USE_GNUTLS_NETTLE" = ""; then
  1676. AC_CHECK_LIB(gnutls, gcry_control, [ USE_GNUTLS_NETTLE=0 ])
  1677. fi
  1678. # If not, try linking directly to both of them to see if they are available
  1679. if test "$USE_GNUTLS_NETTLE" = ""; then
  1680. AC_CHECK_LIB(nettle, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ])
  1681. fi
  1682. if test "$USE_GNUTLS_NETTLE" = ""; then
  1683. AC_CHECK_LIB(gcrypt, gcry_control, [ USE_GNUTLS_NETTLE=0 ])
  1684. fi
  1685. if test "$USE_GNUTLS_NETTLE" = ""; then
  1686. AC_MSG_ERROR([GnuTLS found, but neither gcrypt nor nettle found])
  1687. fi
  1688. if test "$USE_GNUTLS_NETTLE" = "1"; then
  1689. AC_DEFINE(USE_GNUTLS_NETTLE, 1, [if GnuTLS uses nettle as crypto backend])
  1690. AC_SUBST(USE_GNUTLS_NETTLE, [1])
  1691. LIBS="-lnettle $LIBS"
  1692. else
  1693. LIBS="-lgcrypt $LIBS"
  1694. fi
  1695. fi
  1696. dnl ---
  1697. dnl We require GnuTLS with SRP support.
  1698. dnl ---
  1699. if test "$GNUTLS_ENABLED" = "1"; then
  1700. AC_CHECK_LIB(gnutls, gnutls_srp_verifier,
  1701. [
  1702. AC_DEFINE(HAVE_GNUTLS_SRP, 1, [if you have the function gnutls_srp_verifier])
  1703. AC_SUBST(HAVE_GNUTLS_SRP, [1])
  1704. ])
  1705. fi
  1706. dnl ----------------------------------------------------
  1707. dnl check for PolarSSL
  1708. dnl ----------------------------------------------------
  1709. dnl Default to compiler & linker defaults for PolarSSL files & libraries.
  1710. OPT_POLARSSL=no
  1711. _cppflags=$CPPFLAGS
  1712. _ldflags=$LDFLAGS
  1713. AC_ARG_WITH(polarssl,dnl
  1714. AC_HELP_STRING([--with-polarssl=PATH],[where to look for PolarSSL, PATH points to the installation root])
  1715. AC_HELP_STRING([--without-polarssl], [disable PolarSSL detection]),
  1716. OPT_POLARSSL=$withval)
  1717. if test "$curl_ssl_msg" = "$init_ssl_msg"; then
  1718. if test X"$OPT_POLARSSL" != Xno; then
  1719. if test "$OPT_POLARSSL" = "yes"; then
  1720. OPT_POLARSSL=""
  1721. fi
  1722. if test -z "$OPT_POLARSSL" ; then
  1723. dnl check for lib first without setting any new path
  1724. AC_CHECK_LIB(polarssl, havege_init,
  1725. dnl libpolarssl found, set the variable
  1726. [
  1727. AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
  1728. AC_SUBST(USE_POLARSSL, [1])
  1729. POLARSSL_ENABLED=1
  1730. USE_POLARSSL="yes"
  1731. curl_ssl_msg="enabled (PolarSSL)"
  1732. ])
  1733. fi
  1734. addld=""
  1735. addlib=""
  1736. addcflags=""
  1737. polarssllib=""
  1738. if test "x$USE_POLARSSL" != "xyes"; then
  1739. dnl add the path and test again
  1740. addld=-L$OPT_POLARSSL/lib$libsuff
  1741. addcflags=-I$OPT_POLARSSL/include
  1742. polarssllib=$OPT_POLARSSL/lib$libsuff
  1743. LDFLAGS="$LDFLAGS $addld"
  1744. if test "$addcflags" != "-I/usr/include"; then
  1745. CPPFLAGS="$CPPFLAGS $addcflags"
  1746. fi
  1747. AC_CHECK_LIB(polarssl, ssl_init,
  1748. [
  1749. AC_DEFINE(USE_POLARSSL, 1, [if PolarSSL is enabled])
  1750. AC_SUBST(USE_POLARSSL, [1])
  1751. POLARSSL_ENABLED=1
  1752. USE_POLARSSL="yes"
  1753. curl_ssl_msg="enabled (PolarSSL)"
  1754. ],
  1755. [
  1756. CPPFLAGS=$_cppflags
  1757. LDFLAGS=$_ldflags
  1758. ])
  1759. fi
  1760. if test "x$USE_POLARSSL" = "xyes"; then
  1761. AC_MSG_NOTICE([detected PolarSSL])
  1762. LIBS="-lpolarssl $LIBS"
  1763. if test -n "$polarssllib"; then
  1764. dnl when shared libs were found in a path that the run-time
  1765. dnl linker doesn't search through, we need to add it to
  1766. dnl LD_LIBRARY_PATH to prevent further configure tests to fail
  1767. dnl due to this
  1768. if test "x$cross_compiling" != "xyes"; then
  1769. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$polarssllib"
  1770. export LD_LIBRARY_PATH
  1771. AC_MSG_NOTICE([Added $polarssllib to LD_LIBRARY_PATH])
  1772. fi
  1773. fi
  1774. fi
  1775. fi dnl PolarSSL not disabled
  1776. fi
  1777. dnl ----------------------------------------------------
  1778. dnl check for CyaSSL
  1779. dnl ----------------------------------------------------
  1780. dnl Default to compiler & linker defaults for CyaSSL files & libraries.
  1781. OPT_CYASSL=no
  1782. _cppflags=$CPPFLAGS
  1783. _ldflags=$LDFLAGS
  1784. AC_ARG_WITH(cyassl,dnl
  1785. AC_HELP_STRING([--with-cyassl=PATH],[where to look for CyaSSL, PATH points to the installation root (default: system lib default)])
  1786. AC_HELP_STRING([--without-cyassl], [disable CyaSSL detection]),
  1787. OPT_CYASSL=$withval)
  1788. if test "$curl_ssl_msg" = "$init_ssl_msg"; then
  1789. if test X"$OPT_CYASSL" != Xno; then
  1790. if test "$OPT_CYASSL" = "yes"; then
  1791. OPT_CYASSL=""
  1792. fi
  1793. if test -z "$OPT_CYASSL" ; then
  1794. dnl check for lib in system default first
  1795. AC_CHECK_LIB(cyassl, CyaSSL_Init,
  1796. dnl libcyassl found, set the variable
  1797. [
  1798. AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
  1799. AC_SUBST(USE_CYASSL, [1])
  1800. CYASSL_ENABLED=1
  1801. USE_CYASSL="yes"
  1802. curl_ssl_msg="enabled (CyaSSL)"
  1803. ])
  1804. fi
  1805. addld=""
  1806. addlib=""
  1807. addcflags=""
  1808. cyassllib=""
  1809. if test "x$USE_CYASSL" != "xyes"; then
  1810. dnl add the path and test again
  1811. addld=-L$OPT_CYASSL/lib$libsuff
  1812. addcflags=-I$OPT_CYASSL/include
  1813. cyassllib=$OPT_CYASSL/lib$libsuff
  1814. LDFLAGS="$LDFLAGS $addld"
  1815. if test "$addcflags" != "-I/usr/include"; then
  1816. CPPFLAGS="$CPPFLAGS $addcflags"
  1817. fi
  1818. AC_CHECK_LIB(cyassl, CyaSSL_Init,
  1819. [
  1820. AC_DEFINE(USE_CYASSL, 1, [if CyaSSL is enabled])
  1821. AC_SUBST(USE_CYASSL, [1])
  1822. CYASSL_ENABLED=1
  1823. USE_CYASSL="yes"
  1824. curl_ssl_msg="enabled (CyaSSL)"
  1825. ],
  1826. [
  1827. CPPFLAGS=$_cppflags
  1828. LDFLAGS=$_ldflags
  1829. ])
  1830. fi
  1831. if test "x$USE_CYASSL" = "xyes"; then
  1832. AC_MSG_NOTICE([detected CyaSSL])
  1833. LIBS="-lcyassl -lm $LIBS"
  1834. if test -n "$cyassllib"; then
  1835. dnl when shared libs were found in a path that the run-time
  1836. dnl linker doesn't search through, we need to add it to
  1837. dnl LD_LIBRARY_PATH to prevent further configure tests to fail
  1838. dnl due to this
  1839. if test "x$cross_compiling" != "xyes"; then
  1840. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$cyassllib"
  1841. export LD_LIBRARY_PATH
  1842. AC_MSG_NOTICE([Added $cyassllib to LD_LIBRARY_PATH])
  1843. fi
  1844. fi
  1845. fi
  1846. fi dnl CyaSSL not disabled
  1847. fi
  1848. dnl ----------------------------------------------------
  1849. dnl NSS. Only check if GnuTLS and OpenSSL are not enabled
  1850. dnl ----------------------------------------------------
  1851. dnl Default to compiler & linker defaults for NSS files & libraries.
  1852. OPT_NSS=no
  1853. AC_ARG_WITH(nss,dnl
  1854. AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root])
  1855. AC_HELP_STRING([--without-nss], [disable NSS detection]),
  1856. OPT_NSS=$withval)
  1857. if test "$curl_ssl_msg" = "$init_ssl_msg"; then
  1858. if test X"$OPT_NSS" != Xno; then
  1859. addld=""
  1860. addlib=""
  1861. addcflags=""
  1862. nssprefix=""
  1863. version=""
  1864. if test "x$OPT_NSS" = "xyes"; then
  1865. CURL_CHECK_PKGCONFIG(nss)
  1866. if test "$PKGCONFIG" != "no" ; then
  1867. addlib=`$PKGCONFIG --libs nss`
  1868. addcflags=`$PKGCONFIG --cflags nss`
  1869. version=`$PKGCONFIG --modversion nss`
  1870. nssprefix=`$PKGCONFIG --variable=prefix nss`
  1871. else
  1872. dnl Without pkg-config, we check for nss-config
  1873. check=`nss-config --version 2>/dev/null`
  1874. if test -n "$check"; then
  1875. addlib=`nss-config --libs`
  1876. addcflags=`nss-config --cflags`
  1877. version=`nss-config --version`
  1878. nssprefix=`nss-config --prefix`
  1879. else
  1880. addlib="-lnss3"
  1881. addcflags=""
  1882. version="unknown"
  1883. fi
  1884. fi
  1885. else
  1886. # Without pkg-config, we'll kludge in some defaults
  1887. addlib="-L$OPT_NSS/lib -lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4 -lpthread -ldl"
  1888. addcflags="-I$OPT_NSS/include"
  1889. version="unknown"
  1890. nssprefix=$OPT_NSS
  1891. fi
  1892. if test -n "$addlib"; then
  1893. CLEANLIBS="$LIBS"
  1894. CLEANCPPFLAGS="$CPPFLAGS"
  1895. LIBS="$addlib $LIBS"
  1896. if test "$addcflags" != "-I/usr/include"; then
  1897. CPPFLAGS="$CPPFLAGS $addcflags"
  1898. fi
  1899. dnl The function PK11_CreateGenericObject is needed to load libnsspem.so
  1900. AC_CHECK_LIB(nss3, PK11_CreateGenericObject,
  1901. [
  1902. AC_DEFINE(USE_NSS, 1, [if NSS is enabled])
  1903. AC_SUBST(USE_NSS, [1])
  1904. USE_NSS="yes"
  1905. NSS_ENABLED=1
  1906. curl_ssl_msg="enabled (NSS)"
  1907. ],
  1908. [
  1909. LIBS="$CLEANLIBS"
  1910. CPPFLAGS="$CLEANCPPFLAGS"
  1911. ])
  1912. if test "x$USE_NSS" = "xyes"; then
  1913. AC_MSG_NOTICE([detected NSS version $version])
  1914. dnl NSS_InitContext() was introduced in NSS 3.12.5 and helps to prevent
  1915. dnl collisions on NSS initialization/shutdown with other libraries
  1916. AC_CHECK_FUNC(NSS_InitContext,
  1917. [
  1918. AC_DEFINE(HAVE_NSS_INITCONTEXT, 1, [if you have the NSS_InitContext function])
  1919. AC_SUBST(HAVE_NSS_INITCONTEXT, [1])
  1920. ])
  1921. dnl when shared libs were found in a path that the run-time
  1922. dnl linker doesn't search through, we need to add it to
  1923. dnl LD_LIBRARY_PATH to prevent further configure tests to fail
  1924. dnl due to this
  1925. if test "x$cross_compiling" != "xyes"; then
  1926. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$nssprefix/lib$libsuff"
  1927. export LD_LIBRARY_PATH
  1928. AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to LD_LIBRARY_PATH])
  1929. fi
  1930. fi
  1931. fi
  1932. fi dnl NSS not disabled
  1933. fi dnl curl_ssl_msg = init_ssl_msg
  1934. OPT_AXTLS=off
  1935. AC_ARG_WITH(axtls,dnl
  1936. AC_HELP_STRING([--with-axtls=PATH],[Where to look for axTLS, PATH points to the axTLS installation prefix (default: /usr/local). Ignored if another SSL engine is selected.])
  1937. AC_HELP_STRING([--without-axtls], [disable axTLS]),
  1938. OPT_AXTLS=$withval)
  1939. if test "$curl_ssl_msg" = "$init_ssl_msg"; then
  1940. if test X"$OPT_AXTLS" != Xno; then
  1941. dnl backup the pre-axtls variables
  1942. CLEANLDFLAGS="$LDFLAGS"
  1943. CLEANCPPFLAGS="$CPPFLAGS"
  1944. CLEANLIBS="$LIBS"
  1945. case "$OPT_AXTLS" in
  1946. yes)
  1947. dnl --with-axtls (without path) used
  1948. PREFIX_AXTLS=/usr/local
  1949. LIB_AXTLS="$PREFIX_AXTLS/lib"
  1950. LDFLAGS="$LDFLAGS -L$LIB_AXTLS"
  1951. CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include"
  1952. ;;
  1953. off)
  1954. dnl no --with-axtls option given, just check default places
  1955. PREFIX_AXTLS=
  1956. ;;
  1957. *)
  1958. dnl check the given --with-axtls spot
  1959. PREFIX_AXTLS=$OPT_AXTLS
  1960. LIB_AXTLS="$PREFIX_AXTLS/lib"
  1961. LDFLAGS="$LDFLAGS -L$LIB_AXTLS"
  1962. CPPFLAGS="$CPPFLAGS -I$PREFIX_AXTLS/include"
  1963. ;;
  1964. esac
  1965. AC_CHECK_LIB(axtls, ssl_version,[
  1966. LIBS="-laxtls $LIBS"
  1967. AC_DEFINE(USE_AXTLS, 1, [if axTLS is enabled])
  1968. AC_SUBST(USE_AXTLS, [1])
  1969. AXTLS_ENABLED=1
  1970. USE_AXTLS="yes"
  1971. curl_ssl_msg="enabled (axTLS)"
  1972. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIB_AXTLS"
  1973. export LD_LIBRARY_PATH
  1974. AC_MSG_NOTICE([Added $LIB_AXTLS to LD_LIBRARY_PATH])
  1975. ],[
  1976. LDFLAGS="$CLEANLDFLAGS"
  1977. CPPFLAGS="$CLEANCPPFLAGS"
  1978. LIBS="$CLEANLIBS"
  1979. ])
  1980. fi
  1981. fi
  1982. if test "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$POLARSSL_ENABLED$AXTLS_ENABLED$CYASSL_ENABLED$WINSSL_ENABLED$DARWINSSL_ENABLED" = "x"; then
  1983. AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.])
  1984. AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-polarssl, --with-cyassl, --with-nss, --with-axtls, --with-winssl, or --with-darwinssl to address this.])
  1985. else
  1986. # SSL is enabled, genericly
  1987. AC_SUBST(SSL_ENABLED)
  1988. SSL_ENABLED="1"
  1989. fi
  1990. dnl **********************************************************************
  1991. dnl Check for the CA bundle
  1992. dnl **********************************************************************
  1993. CURL_CHECK_CA_BUNDLE
  1994. dnl **********************************************************************
  1995. dnl Check for libmetalink
  1996. dnl **********************************************************************
  1997. OPT_LIBMETALINK=no
  1998. AC_ARG_WITH(libmetalink,dnl
  1999. AC_HELP_STRING([--with-libmetalink=PATH],[where to look for libmetalink, PATH points to the installation root])
  2000. AC_HELP_STRING([--without-libmetalink], [disable libmetalink detection]),
  2001. OPT_LIBMETALINK=$withval)
  2002. if test X"$OPT_LIBMETALINK" != Xno; then
  2003. addld=""
  2004. addlib=""
  2005. addcflags=""
  2006. version=""
  2007. libmetalinklib=""
  2008. PKGTEST="no"
  2009. if test "x$OPT_LIBMETALINK" = "xyes"; then
  2010. dnl this is with no partiular path given
  2011. PKGTEST="yes"
  2012. CURL_CHECK_PKGCONFIG(libmetalink)
  2013. else
  2014. dnl When particular path is given, set PKG_CONFIG_LIBDIR using the path.
  2015. LIBMETALINK_PCDIR="$OPT_LIBMETALINK/lib/pkgconfig"
  2016. AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$LIBMETALINK_PCDIR"])
  2017. if test -f "$LIBMETALINK_PCDIR/libmetalink.pc"; then
  2018. PKGTEST="yes"
  2019. fi
  2020. if test "$PKGTEST" = "yes"; then
  2021. CURL_CHECK_PKGCONFIG(libmetalink, [$LIBMETALINK_PCDIR])
  2022. fi
  2023. fi
  2024. if test "$PKGTEST" = "yes" && test "$PKGCONFIG" != "no"; then
  2025. addlib=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
  2026. $PKGCONFIG --libs-only-l libmetalink`
  2027. addld=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
  2028. $PKGCONFIG --libs-only-L libmetalink`
  2029. addcflags=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
  2030. $PKGCONFIG --cflags-only-I libmetalink`
  2031. version=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl
  2032. $PKGCONFIG --modversion libmetalink`
  2033. libmetalinklib=`echo $addld | $SED -e 's/-L//'`
  2034. fi
  2035. if test -n "$addlib"; then
  2036. clean_CPPFLAGS="$CPPFLAGS"
  2037. clean_LDFLAGS="$LDFLAGS"
  2038. clean_LIBS="$LIBS"
  2039. CPPFLAGS="$addcflags $clean_CPPFLAGS"
  2040. LDFLAGS="$addld $clean_LDFLAGS"
  2041. LIBS="$addlib $clean_LIBS"
  2042. AC_MSG_CHECKING([if libmetalink is recent enough])
  2043. AC_LINK_IFELSE([
  2044. AC_LANG_PROGRAM([[
  2045. # include <metalink/metalink.h>
  2046. ]],[[
  2047. if(0 != metalink_strerror(0)) /* added in 0.1.0 */
  2048. return 1;
  2049. ]])
  2050. ],[
  2051. AC_MSG_RESULT([yes ($version)])
  2052. want_metalink="yes"
  2053. ],[
  2054. AC_MSG_RESULT([no ($version)])
  2055. AC_MSG_NOTICE([libmetalink library defective or too old])
  2056. want_metalink="no"
  2057. ])
  2058. CPPFLAGS="$clean_CPPFLAGS"
  2059. LDFLAGS="$clean_LDFLAGS"
  2060. LIBS="$clean_LIBS"
  2061. if test "$want_metalink" = "yes"; then
  2062. dnl finally libmetalink will be used
  2063. AC_DEFINE(USE_METALINK, 1, [Define to enable metalink support])
  2064. LIBMETALINK_LIBS=$addlib
  2065. LIBMETALINK_LDFLAGS=$addld
  2066. LIBMETALINK_CPPFLAGS=$addcflags
  2067. AC_SUBST([LIBMETALINK_LIBS])
  2068. AC_SUBST([LIBMETALINK_LDFLAGS])
  2069. AC_SUBST([LIBMETALINK_CPPFLAGS])
  2070. curl_mtlnk_msg="enabled"
  2071. fi
  2072. fi
  2073. fi
  2074. dnl **********************************************************************
  2075. dnl Check for the presence of LIBSSH2 libraries and headers
  2076. dnl **********************************************************************
  2077. dnl Default to compiler & linker defaults for LIBSSH2 files & libraries.
  2078. OPT_LIBSSH2=off
  2079. AC_ARG_WITH(libssh2,dnl
  2080. AC_HELP_STRING([--with-libssh2=PATH],[Where to look for libssh2, PATH points to the LIBSSH2 installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
  2081. AC_HELP_STRING([--without-libssh2], [disable LIBSSH2]),
  2082. OPT_LIBSSH2=$withval)
  2083. if test X"$OPT_LIBSSH2" != Xno; then
  2084. dnl backup the pre-libssh2 variables
  2085. CLEANLDFLAGS="$LDFLAGS"
  2086. CLEANCPPFLAGS="$CPPFLAGS"
  2087. CLEANLIBS="$LIBS"
  2088. case "$OPT_LIBSSH2" in
  2089. yes)
  2090. dnl --with-libssh2 (without path) used
  2091. CURL_CHECK_PKGCONFIG(libssh2)
  2092. if test "$PKGCONFIG" != "no" ; then
  2093. LIB_SSH2=`$PKGCONFIG --libs-only-l libssh2`
  2094. LD_SSH2=`$PKGCONFIG --libs-only-L libssh2`
  2095. CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2`
  2096. version=`$PKGCONFIG --modversion libssh2`
  2097. DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/-L//'`
  2098. fi
  2099. ;;
  2100. off)
  2101. dnl no --with-libssh2 option given, just check default places
  2102. ;;
  2103. *)
  2104. dnl use the given --with-libssh2 spot
  2105. PREFIX_SSH2=$OPT_LIBSSH2
  2106. ;;
  2107. esac
  2108. dnl if given with a prefix, we set -L and -I based on that
  2109. if test -n "$PREFIX_SSH2"; then
  2110. LIB_SSH2="-lssh2"
  2111. LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff
  2112. CPP_SSH2=-I${PREFIX_SSH2}/include
  2113. DIR_SSH2=${PREFIX_SSH2}/lib$libsuff
  2114. fi
  2115. LDFLAGS="$LDFLAGS $LD_SSH2"
  2116. CPPFLAGS="$CPPFLAGS $CPP_SSH2"
  2117. LIBS="$LIB_SSH2 $LIBS"
  2118. AC_CHECK_LIB(ssh2, libssh2_channel_open_ex)
  2119. AC_CHECK_HEADERS(libssh2.h,
  2120. curl_ssh_msg="enabled (libSSH2)"
  2121. LIBSSH2_ENABLED=1
  2122. AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use])
  2123. AC_SUBST(USE_LIBSSH2, [1])
  2124. )
  2125. if test X"$OPT_LIBSSH2" != Xoff &&
  2126. test "$LIBSSH2_ENABLED" != "1"; then
  2127. AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!])
  2128. fi
  2129. if test "$LIBSSH2_ENABLED" = "1"; then
  2130. if test -n "$DIR_SSH2"; then
  2131. dnl when the libssh2 shared libs were found in a path that the run-time
  2132. dnl linker doesn't search through, we need to add it to LD_LIBRARY_PATH
  2133. dnl to prevent further configure tests to fail due to this
  2134. dnl libssh2_version is a post 1.0 addition
  2135. dnl libssh2_init and libssh2_exit were added in 1.2.5
  2136. dnl libssh2_scp_send64 was added in 1.2.6
  2137. dnl libssh2_session_handshake was added in 1.2.8
  2138. AC_CHECK_FUNCS( libssh2_version libssh2_init libssh2_exit \
  2139. libssh2_scp_send64 libssh2_session_handshake)
  2140. if test "x$cross_compiling" != "xyes"; then
  2141. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$DIR_SSH2"
  2142. export LD_LIBRARY_PATH
  2143. AC_MSG_NOTICE([Added $DIR_SSH2 to LD_LIBRARY_PATH])
  2144. fi
  2145. fi
  2146. else
  2147. dnl no libssh2, revert back to clean variables
  2148. LDFLAGS=$CLEANLDFLAGS
  2149. CPPFLAGS=$CLEANCPPFLAGS
  2150. LIBS=$CLEANLIBS
  2151. fi
  2152. fi
  2153. dnl **********************************************************************
  2154. dnl Check for the presence of LIBRTMP libraries and headers
  2155. dnl **********************************************************************
  2156. dnl Default to compiler & linker defaults for LIBRTMP files & libraries.
  2157. OPT_LIBRTMP=off
  2158. AC_ARG_WITH(librtmp,dnl
  2159. AC_HELP_STRING([--with-librtmp=PATH],[Where to look for librtmp, PATH points to the LIBRTMP installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option])
  2160. AC_HELP_STRING([--without-librtmp], [disable LIBRTMP]),
  2161. OPT_LIBRTMP=$withval)
  2162. if test X"$OPT_LIBRTMP" != Xno; then
  2163. dnl backup the pre-librtmp variables
  2164. CLEANLDFLAGS="$LDFLAGS"
  2165. CLEANCPPFLAGS="$CPPFLAGS"
  2166. CLEANLIBS="$LIBS"
  2167. case "$OPT_LIBRTMP" in
  2168. yes)
  2169. dnl --with-librtmp (without path) used
  2170. CURL_CHECK_PKGCONFIG(librtmp)
  2171. if test "$PKGCONFIG" != "no" ; then
  2172. LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp`
  2173. LD_RTMP=`$PKGCONFIG --libs-only-L librtmp`
  2174. CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp`
  2175. version=`$PKGCONFIG --modversion librtmp`
  2176. DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'`
  2177. else
  2178. dnl To avoid link errors, we do not allow --librtmp without
  2179. dnl a pkgconfig file
  2180. AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.])
  2181. fi
  2182. ;;
  2183. off)
  2184. dnl no --with-librtmp option given, just check default places
  2185. LIB_RTMP="-lrtmp"
  2186. ;;
  2187. *)
  2188. dnl use the given --with-librtmp spot
  2189. PREFIX_RTMP=$OPT_LIBRTMP
  2190. ;;
  2191. esac
  2192. dnl if given with a prefix, we set -L and -I based on that
  2193. if test -n "$PREFIX_RTMP"; then
  2194. LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff
  2195. CPP_RTMP=-I${PREFIX_RTMP}/include
  2196. DIR_RTMP=${PREFIX_RTMP}/lib$libsuff
  2197. fi
  2198. LDFLAGS="$LDFLAGS $LD_RTMP"
  2199. CPPFLAGS="$CPPFLAGS $CPP_RTMP"
  2200. LIBS="$LIB_RTMP $LIBS"
  2201. AC_CHECK_LIB(rtmp, RTMP_Init,
  2202. [
  2203. AC_CHECK_HEADERS(librtmp/rtmp.h,
  2204. curl_rtmp_msg="enabled (librtmp)"
  2205. LIBRTMP_ENABLED=1
  2206. AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use])
  2207. AC_SUBST(USE_LIBRTMP, [1])
  2208. )
  2209. ],
  2210. dnl not found, revert back to clean variables
  2211. LDFLAGS=$CLEANLDFLAGS
  2212. CPPFLAGS=$CLEANCPPFLAGS
  2213. LIBS=$CLEANLIBS
  2214. )
  2215. if test X"$OPT_LIBRTMP" != Xoff &&
  2216. test "$LIBRTMP_ENABLED" != "1"; then
  2217. AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!])
  2218. fi
  2219. fi
  2220. dnl **********************************************************************
  2221. dnl Check for linker switch for versioned symbols
  2222. dnl **********************************************************************
  2223. versioned_symbols_flavour=
  2224. AC_MSG_CHECKING([whether versioned symbols are wanted])
  2225. AC_ARG_ENABLE(versioned-symbols,
  2226. AC_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library])
  2227. AC_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]),
  2228. [ case "$enableval" in
  2229. yes) AC_MSG_RESULT(yes)
  2230. AC_MSG_CHECKING([if libraries can be versioned])
  2231. GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script`
  2232. if test -z "$GLD"; then
  2233. AC_MSG_RESULT(no)
  2234. AC_MSG_WARN([You need an ld version supporting the --version-script option])
  2235. else
  2236. AC_MSG_RESULT(yes)
  2237. if test "x$OPENSSL_ENABLED" = "x1"; then
  2238. versioned_symbols_flavour="OPENSSL_"
  2239. elif test "x$GNUTLS_ENABLED" == "x1"; then
  2240. versioned_symbols_flavour="GNUTLS_"
  2241. elif test "x$NSS_ENABLED" == "x1"; then
  2242. versioned_symbols_flavour="NSS_"
  2243. elif test "x$POLARSSL_ENABLED" == "x1"; then
  2244. versioned_symbols_flavour="POLARSSL_"
  2245. elif test "x$CYASSL_ENABLED" == "x1"; then
  2246. versioned_symbols_flavour="CYASSL_"
  2247. elif test "x$AXTLS_ENABLED" == "x1"; then
  2248. versioned_symbols_flavour="AXTLS_"
  2249. elif test "x$WINSSL_ENABLED" == "x1"; then
  2250. versioned_symbols_flavour="WINSSL_"
  2251. elif test "x$DARWINSSL_ENABLED" == "x1"; then
  2252. versioned_symbols_flavour="DARWINSSL_"
  2253. else
  2254. versioned_symbols_flavour=""
  2255. fi
  2256. versioned_symbols="yes"
  2257. fi
  2258. ;;
  2259. *) AC_MSG_RESULT(no)
  2260. ;;
  2261. esac
  2262. ], [
  2263. AC_MSG_RESULT(no)
  2264. ]
  2265. )
  2266. AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR],
  2267. ["$versioned_symbols_flavour"])
  2268. AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS],
  2269. [test "x$versioned_symbols" = 'xyes'])
  2270. dnl -------------------------------------------------
  2271. dnl check winidn option before other IDN libraries
  2272. dnl -------------------------------------------------
  2273. AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)])
  2274. OPT_WINIDN="default"
  2275. AC_ARG_WITH(winidn,
  2276. AC_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN])
  2277. AC_HELP_STRING([--without-winidn], [disable Windows native IDN]),
  2278. OPT_WINIDN=$withval)
  2279. case "$OPT_WINIDN" in
  2280. no|default)
  2281. dnl --without-winidn option used or configure option not specified
  2282. want_winidn="no"
  2283. AC_MSG_RESULT([no])
  2284. ;;
  2285. yes)
  2286. dnl --with-winidn option used without path
  2287. want_winidn="yes"
  2288. want_winidn_path="default"
  2289. AC_MSG_RESULT([yes])
  2290. ;;
  2291. *)
  2292. dnl --with-winidn option used with path
  2293. want_winidn="yes"
  2294. want_winidn_path="$withval"
  2295. AC_MSG_RESULT([yes ($withval)])
  2296. ;;
  2297. esac
  2298. if test "$want_winidn" = "yes"; then
  2299. dnl winidn library support has been requested
  2300. clean_CPPFLAGS="$CPPFLAGS"
  2301. clean_LDFLAGS="$LDFLAGS"
  2302. clean_LIBS="$LIBS"
  2303. WINIDN_LIBS="-lnormaliz"
  2304. #
  2305. if test "$want_winidn_path" != "default"; then
  2306. dnl path has been specified
  2307. dnl pkg-config not available or provides no info
  2308. WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff"
  2309. WINIDN_CPPFLAGS="-I$want_winidn_path/include"
  2310. WINIDN_DIR="$want_winidn_path/lib$libsuff"
  2311. fi
  2312. #
  2313. CPPFLAGS="$WINIDN_CPPFLAGS $CPPFLAGS"
  2314. LDFLAGS="$WINIDN_LDFLAGS $LDFLAGS"
  2315. LIBS="$WINIDN_LIBS $LIBS"
  2316. #
  2317. AC_MSG_CHECKING([if IdnToUnicode can be linked])
  2318. AC_LINK_IFELSE([
  2319. AC_LANG_FUNC_LINK_TRY([IdnToUnicode])
  2320. ],[
  2321. AC_MSG_RESULT([yes])
  2322. tst_links_winidn="yes"
  2323. ],[
  2324. AC_MSG_RESULT([no])
  2325. tst_links_winidn="no"
  2326. ])
  2327. #
  2328. if test "$tst_links_winidn" = "yes"; then
  2329. AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).])
  2330. AC_DEFINE(WANT_IDN_PROTOTYPES, 1, [Define to 1 to provide own prototypes.])
  2331. AC_SUBST([IDN_ENABLED], [1])
  2332. curl_idn_msg="enabled (Windows-native)"
  2333. else
  2334. AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
  2335. CPPFLAGS="$clean_CPPFLAGS"
  2336. LDFLAGS="$clean_LDFLAGS"
  2337. LIBS="$clean_LIBS"
  2338. fi
  2339. fi
  2340. dnl **********************************************************************
  2341. dnl Check for the presence of IDN libraries and headers
  2342. dnl **********************************************************************
  2343. AC_MSG_CHECKING([whether to build with libidn])
  2344. OPT_IDN="default"
  2345. AC_ARG_WITH(libidn,
  2346. AC_HELP_STRING([--with-libidn=PATH],[Enable libidn usage])
  2347. AC_HELP_STRING([--without-libidn],[Disable libidn usage]),
  2348. [OPT_IDN=$withval])
  2349. case "$OPT_IDN" in
  2350. no)
  2351. dnl --without-libidn option used
  2352. want_idn="no"
  2353. AC_MSG_RESULT([no])
  2354. ;;
  2355. default)
  2356. dnl configure option not specified
  2357. want_idn="yes"
  2358. want_idn_path="default"
  2359. AC_MSG_RESULT([(assumed) yes])
  2360. ;;
  2361. yes)
  2362. dnl --with-libidn option used without path
  2363. want_idn="yes"
  2364. want_idn_path="default"
  2365. AC_MSG_RESULT([yes])
  2366. ;;
  2367. *)
  2368. dnl --with-libidn option used with path
  2369. want_idn="yes"
  2370. want_idn_path="$withval"
  2371. AC_MSG_RESULT([yes ($withval)])
  2372. ;;
  2373. esac
  2374. if test "$want_idn" = "yes"; then
  2375. dnl idn library support has been requested
  2376. clean_CPPFLAGS="$CPPFLAGS"
  2377. clean_LDFLAGS="$LDFLAGS"
  2378. clean_LIBS="$LIBS"
  2379. PKGCONFIG="no"
  2380. #
  2381. if test "$want_idn_path" != "default"; then
  2382. dnl path has been specified
  2383. IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
  2384. CURL_CHECK_PKGCONFIG(libidn, [$IDN_PCDIR])
  2385. if test "$PKGCONFIG" != "no"; then
  2386. IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
  2387. $PKGCONFIG --libs-only-l libidn 2>/dev/null`
  2388. IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
  2389. $PKGCONFIG --libs-only-L libidn 2>/dev/null`
  2390. IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
  2391. $PKGCONFIG --cflags-only-I libidn 2>/dev/null`
  2392. IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
  2393. else
  2394. dnl pkg-config not available or provides no info
  2395. IDN_LIBS="-lidn"
  2396. IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
  2397. IDN_CPPFLAGS="-I$want_idn_path/include"
  2398. IDN_DIR="$want_idn_path/lib$libsuff"
  2399. fi
  2400. else
  2401. dnl path not specified
  2402. CURL_CHECK_PKGCONFIG(libidn)
  2403. if test "$PKGCONFIG" != "no"; then
  2404. IDN_LIBS=`$PKGCONFIG --libs-only-l libidn 2>/dev/null`
  2405. IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn 2>/dev/null`
  2406. IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn 2>/dev/null`
  2407. IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
  2408. else
  2409. dnl pkg-config not available or provides no info
  2410. IDN_LIBS="-lidn"
  2411. fi
  2412. fi
  2413. #
  2414. if test "$PKGCONFIG" != "no"; then
  2415. AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"])
  2416. AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"])
  2417. AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
  2418. AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"])
  2419. else
  2420. AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"])
  2421. AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"])
  2422. AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"])
  2423. AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"])
  2424. fi
  2425. #
  2426. CPPFLAGS="$IDN_CPPFLAGS $CPPFLAGS"
  2427. LDFLAGS="$IDN_LDFLAGS $LDFLAGS"
  2428. LIBS="$IDN_LIBS $LIBS"
  2429. #
  2430. AC_MSG_CHECKING([if idna_to_ascii_4i can be linked])
  2431. AC_LINK_IFELSE([
  2432. AC_LANG_FUNC_LINK_TRY([idna_to_ascii_4i])
  2433. ],[
  2434. AC_MSG_RESULT([yes])
  2435. tst_links_libidn="yes"
  2436. ],[
  2437. AC_MSG_RESULT([no])
  2438. tst_links_libidn="no"
  2439. ])
  2440. if test "$tst_links_libidn" = "no"; then
  2441. AC_MSG_CHECKING([if idna_to_ascii_lz can be linked])
  2442. AC_LINK_IFELSE([
  2443. AC_LANG_FUNC_LINK_TRY([idna_to_ascii_lz])
  2444. ],[
  2445. AC_MSG_RESULT([yes])
  2446. tst_links_libidn="yes"
  2447. ],[
  2448. AC_MSG_RESULT([no])
  2449. tst_links_libidn="no"
  2450. ])
  2451. fi
  2452. #
  2453. if test "$tst_links_libidn" = "yes"; then
  2454. AC_DEFINE(HAVE_LIBIDN, 1, [Define to 1 if you have the `idn' library (-lidn).])
  2455. dnl different versions of libidn have different setups of these:
  2456. AC_CHECK_FUNCS( idn_free idna_strerror tld_strerror )
  2457. AC_CHECK_HEADERS( idn-free.h tld.h )
  2458. if test "x$ac_cv_header_tld_h" = "xyes"; then
  2459. AC_SUBST([IDN_ENABLED], [1])
  2460. curl_idn_msg="enabled"
  2461. if test -n "$IDN_DIR"; then
  2462. LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
  2463. export LD_LIBRARY_PATH
  2464. AC_MSG_NOTICE([Added $IDN_DIR to LD_LIBRARY_PATH])
  2465. fi
  2466. else
  2467. AC_MSG_WARN([Libraries for IDN support too old: IDN disabled])
  2468. CPPFLAGS="$clean_CPPFLAGS"
  2469. LDFLAGS="$clean_LDFLAGS"
  2470. LIBS="$clean_LIBS"
  2471. fi
  2472. else
  2473. AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled])
  2474. CPPFLAGS="$clean_CPPFLAGS"
  2475. LDFLAGS="$clean_LDFLAGS"
  2476. LIBS="$clean_LIBS"
  2477. fi
  2478. fi
  2479. dnl Let's hope this split URL remains working:
  2480. dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
  2481. dnl genprogc/thread_quick_ref.htm
  2482. dnl **********************************************************************
  2483. dnl Back to "normal" configuring
  2484. dnl **********************************************************************
  2485. dnl Checks for header files.
  2486. AC_HEADER_STDC
  2487. CURL_CHECK_HEADER_MALLOC
  2488. CURL_CHECK_HEADER_MEMORY
  2489. dnl Now check for the very most basic headers. Then we can use these
  2490. dnl ones as default-headers when checking for the rest!
  2491. AC_CHECK_HEADERS(
  2492. sys/types.h \
  2493. sys/time.h \
  2494. sys/select.h \
  2495. sys/socket.h \
  2496. sys/ioctl.h \
  2497. sys/uio.h \
  2498. assert.h \
  2499. unistd.h \
  2500. stdlib.h \
  2501. limits.h \
  2502. arpa/inet.h \
  2503. net/if.h \
  2504. netinet/in.h \
  2505. sys/un.h \
  2506. netinet/tcp.h \
  2507. netdb.h \
  2508. sys/sockio.h \
  2509. sys/stat.h \
  2510. sys/param.h \
  2511. termios.h \
  2512. termio.h \
  2513. sgtty.h \
  2514. fcntl.h \
  2515. alloca.h \
  2516. time.h \
  2517. io.h \
  2518. pwd.h \
  2519. utime.h \
  2520. sys/utime.h \
  2521. sys/poll.h \
  2522. poll.h \
  2523. socket.h \
  2524. sys/resource.h \
  2525. libgen.h \
  2526. locale.h \
  2527. errno.h \
  2528. stdbool.h \
  2529. arpa/tftp.h \
  2530. sys/filio.h \
  2531. sys/wait.h \
  2532. setjmp.h,
  2533. dnl to do if not found
  2534. [],
  2535. dnl to do if found
  2536. [],
  2537. dnl default includes
  2538. [
  2539. #ifdef HAVE_SYS_TYPES_H
  2540. #include <sys/types.h>
  2541. #endif
  2542. #ifdef HAVE_SYS_TIME_H
  2543. #include <sys/time.h>
  2544. #endif
  2545. #ifdef HAVE_SYS_SELECT_H
  2546. #include <sys/select.h>
  2547. #endif
  2548. #ifdef HAVE_SYS_SOCKET_H
  2549. #include <sys/socket.h>
  2550. #endif
  2551. #ifdef HAVE_NETINET_IN_H
  2552. #include <netinet/in.h>
  2553. #endif
  2554. #ifdef HAVE_SYS_UN_H
  2555. #include <sys/un.h>
  2556. #endif
  2557. ]
  2558. )
  2559. dnl Checks for typedefs, structures, and compiler characteristics.
  2560. AC_C_CONST
  2561. CURL_CHECK_VARIADIC_MACROS
  2562. AC_TYPE_SIZE_T
  2563. AC_HEADER_TIME
  2564. CURL_CHECK_STRUCT_TIMEVAL
  2565. CURL_VERIFY_RUNTIMELIBS
  2566. AC_CHECK_SIZEOF(size_t)
  2567. AC_CHECK_SIZEOF(long)
  2568. AC_CHECK_SIZEOF(int)
  2569. AC_CHECK_SIZEOF(short)
  2570. CURL_CONFIGURE_LONG
  2571. AC_CHECK_SIZEOF(time_t)
  2572. AC_CHECK_SIZEOF(off_t)
  2573. soname_bump=no
  2574. if test x"$ac_cv_native_windows" != "xyes" &&
  2575. test $ac_cv_sizeof_off_t -ne $curl_sizeof_curl_off_t; then
  2576. AC_MSG_WARN([This libcurl built is probably not ABI compatible with previous])
  2577. AC_MSG_WARN([builds! You MUST read lib/README.curl_off_t to figure it out.])
  2578. soname_bump=yes
  2579. fi
  2580. AC_CHECK_TYPE(long long,
  2581. [AC_DEFINE(HAVE_LONGLONG, 1,
  2582. [Define to 1 if the compiler supports the 'long long' data type.])]
  2583. longlong="yes"
  2584. )
  2585. if test "xyes" = "x$longlong"; then
  2586. AC_MSG_CHECKING([if numberLL works])
  2587. AC_COMPILE_IFELSE([
  2588. AC_LANG_PROGRAM([[
  2589. ]],[[
  2590. long long val = 1000LL;
  2591. ]])
  2592. ],[
  2593. AC_MSG_RESULT([yes])
  2594. AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])
  2595. ],[
  2596. AC_MSG_RESULT([no])
  2597. ])
  2598. fi
  2599. # check for ssize_t
  2600. AC_CHECK_TYPE(ssize_t, ,
  2601. AC_DEFINE(ssize_t, int, [the signed version of size_t]))
  2602. # check for bool type
  2603. AC_CHECK_TYPE([bool],[
  2604. AC_DEFINE(HAVE_BOOL_T, 1,
  2605. [Define to 1 if bool is an available type.])
  2606. ], ,[
  2607. #ifdef HAVE_SYS_TYPES_H
  2608. #include <sys/types.h>
  2609. #endif
  2610. #ifdef HAVE_STDBOOL_H
  2611. #include <stdbool.h>
  2612. #endif
  2613. ])
  2614. CURL_CONFIGURE_CURL_SOCKLEN_T
  2615. CURL_CONFIGURE_PULL_SYS_POLL
  2616. TYPE_IN_ADDR_T
  2617. TYPE_SOCKADDR_STORAGE
  2618. TYPE_SIG_ATOMIC_T
  2619. AC_TYPE_SIGNAL
  2620. CURL_CHECK_FUNC_SELECT
  2621. CURL_CHECK_FUNC_RECV
  2622. CURL_CHECK_FUNC_SEND
  2623. CURL_CHECK_MSG_NOSIGNAL
  2624. CURL_CHECK_FUNC_ALARM
  2625. CURL_CHECK_FUNC_BASENAME
  2626. CURL_CHECK_FUNC_CLOSESOCKET
  2627. CURL_CHECK_FUNC_CLOSESOCKET_CAMEL
  2628. CURL_CHECK_FUNC_CONNECT
  2629. CURL_CHECK_FUNC_FCNTL
  2630. CURL_CHECK_FUNC_FDOPEN
  2631. CURL_CHECK_FUNC_FREEADDRINFO
  2632. CURL_CHECK_FUNC_FREEIFADDRS
  2633. CURL_CHECK_FUNC_FSETXATTR
  2634. CURL_CHECK_FUNC_FTRUNCATE
  2635. CURL_CHECK_FUNC_GETADDRINFO
  2636. CURL_CHECK_FUNC_GAI_STRERROR
  2637. CURL_CHECK_FUNC_GETHOSTBYADDR
  2638. CURL_CHECK_FUNC_GETHOSTBYADDR_R
  2639. CURL_CHECK_FUNC_GETHOSTBYNAME
  2640. CURL_CHECK_FUNC_GETHOSTBYNAME_R
  2641. CURL_CHECK_FUNC_GETHOSTNAME
  2642. CURL_CHECK_FUNC_GETIFADDRS
  2643. CURL_CHECK_FUNC_GETSERVBYPORT_R
  2644. CURL_CHECK_FUNC_GMTIME_R
  2645. CURL_CHECK_FUNC_INET_NTOA_R
  2646. CURL_CHECK_FUNC_INET_NTOP
  2647. CURL_CHECK_FUNC_INET_PTON
  2648. CURL_CHECK_FUNC_IOCTL
  2649. CURL_CHECK_FUNC_IOCTLSOCKET
  2650. CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL
  2651. CURL_CHECK_FUNC_LOCALTIME_R
  2652. CURL_CHECK_FUNC_MEMRCHR
  2653. CURL_CHECK_FUNC_POLL
  2654. CURL_CHECK_FUNC_SETSOCKOPT
  2655. CURL_CHECK_FUNC_SIGACTION
  2656. CURL_CHECK_FUNC_SIGINTERRUPT
  2657. CURL_CHECK_FUNC_SIGNAL
  2658. CURL_CHECK_FUNC_SIGSETJMP
  2659. CURL_CHECK_FUNC_SOCKET
  2660. CURL_CHECK_FUNC_SOCKETPAIR
  2661. CURL_CHECK_FUNC_STRCASECMP
  2662. CURL_CHECK_FUNC_STRCMPI
  2663. CURL_CHECK_FUNC_STRDUP
  2664. CURL_CHECK_FUNC_STRERROR_R
  2665. CURL_CHECK_FUNC_STRICMP
  2666. CURL_CHECK_FUNC_STRNCASECMP
  2667. CURL_CHECK_FUNC_STRNCMPI
  2668. CURL_CHECK_FUNC_STRNICMP
  2669. CURL_CHECK_FUNC_STRSTR
  2670. CURL_CHECK_FUNC_STRTOK_R
  2671. CURL_CHECK_FUNC_STRTOLL
  2672. CURL_CHECK_FUNC_WRITEV
  2673. case $host in
  2674. *msdosdjgpp)
  2675. ac_cv_func_pipe=no
  2676. skipcheck_pipe=yes
  2677. AC_MSG_NOTICE([skip check for pipe on msdosdjgpp])
  2678. ;;
  2679. esac
  2680. AC_CHECK_FUNCS([fork \
  2681. geteuid \
  2682. getpass_r \
  2683. getppid \
  2684. getprotobyname \
  2685. getpwuid \
  2686. getrlimit \
  2687. gettimeofday \
  2688. inet_addr \
  2689. perror \
  2690. pipe \
  2691. setlocale \
  2692. setmode \
  2693. setrlimit \
  2694. uname \
  2695. utime
  2696. ],[
  2697. ],[
  2698. func="$ac_func"
  2699. eval skipcheck=\$skipcheck_$func
  2700. if test "x$skipcheck" != "xyes"; then
  2701. AC_MSG_CHECKING([deeper for $func])
  2702. AC_LINK_IFELSE([
  2703. AC_LANG_PROGRAM([[
  2704. ]],[[
  2705. $func ();
  2706. ]])
  2707. ],[
  2708. AC_MSG_RESULT([yes])
  2709. eval "ac_cv_func_$func=yes"
  2710. AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1],
  2711. [Define to 1 if you have the $func function.])
  2712. ],[
  2713. AC_MSG_RESULT([but still no])
  2714. ])
  2715. fi
  2716. ])
  2717. dnl Check if the getnameinfo function is available
  2718. dnl and get the types of five of its arguments.
  2719. CURL_CHECK_FUNC_GETNAMEINFO
  2720. if test "$ipv6" = "yes"; then
  2721. if test "$ac_cv_func_getaddrinfo" = "yes"; then
  2722. AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support])
  2723. IPV6_ENABLED=1
  2724. AC_SUBST(IPV6_ENABLED)
  2725. fi
  2726. CURL_CHECK_NI_WITHSCOPEID
  2727. fi
  2728. CURL_CHECK_NONBLOCKING_SOCKET
  2729. dnl ************************************************************
  2730. dnl nroff tool stuff
  2731. dnl
  2732. AC_PATH_PROG( PERL, perl, ,
  2733. $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin )
  2734. AC_SUBST(PERL)
  2735. AC_PATH_PROGS( NROFF, gnroff nroff, ,
  2736. $PATH:/usr/bin/:/usr/local/bin )
  2737. AC_SUBST(NROFF)
  2738. if test -n "$NROFF"; then
  2739. dnl only check for nroff options if an nroff command was found
  2740. AC_MSG_CHECKING([how to use *nroff to get plain text from man pages])
  2741. MANOPT="-man"
  2742. mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
  2743. if test -z "$mancheck"; then
  2744. MANOPT="-mandoc"
  2745. mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null`
  2746. if test -z "$mancheck"; then
  2747. MANOPT=""
  2748. AC_MSG_RESULT([failed])
  2749. AC_MSG_WARN([found no *nroff option to get plaintext from man pages])
  2750. else
  2751. AC_MSG_RESULT([$MANOPT])
  2752. fi
  2753. else
  2754. AC_MSG_RESULT([$MANOPT])
  2755. fi
  2756. AC_SUBST(MANOPT)
  2757. fi
  2758. if test -z "$MANOPT"
  2759. then
  2760. dnl if no nroff tool was found, or no option that could convert man pages
  2761. dnl was found, then disable the built-in manual stuff
  2762. AC_MSG_WARN([disabling built-in manual])
  2763. USE_MANUAL="no";
  2764. fi
  2765. dnl *************************************************************************
  2766. dnl If the manual variable still is set, then we go with providing a built-in
  2767. dnl manual
  2768. if test "$USE_MANUAL" = "1"; then
  2769. AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual])
  2770. curl_manual_msg="enabled"
  2771. fi
  2772. dnl set variable for use in automakefile(s)
  2773. AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1)
  2774. CURL_CHECK_LIB_ARES
  2775. AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes)
  2776. if test "x$ac_cv_native_windows" != "xyes" &&
  2777. test "x$enable_shared" = "xyes"; then
  2778. build_libhostname=yes
  2779. else
  2780. build_libhostname=no
  2781. fi
  2782. AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes)
  2783. CURL_CHECK_OPTION_THREADED_RESOLVER
  2784. if test "x$want_thres" = xyes && test "x$want_ares" = xyes; then
  2785. AC_MSG_ERROR(
  2786. [Options --enable-threaded-resolver and --enable-ares are mutually exclusive])
  2787. fi
  2788. if test "$want_thres" = "yes"; then
  2789. AC_CHECK_HEADER(pthread.h,
  2790. [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>])
  2791. save_CFLAGS="$CFLAGS"
  2792. dnl first check for function without lib
  2793. AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] )
  2794. dnl if it wasn't found without lib, search for it in pthread lib
  2795. if test "$USE_THREADS_POSIX" != "1"
  2796. then
  2797. CFLAGS="$CFLAGS -pthread"
  2798. AC_CHECK_LIB(pthread, pthread_create,
  2799. [USE_THREADS_POSIX=1],
  2800. [ CFLAGS="$save_CFLAGS"])
  2801. fi
  2802. if test "x$USE_THREADS_POSIX" = "x1"
  2803. then
  2804. AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup])
  2805. curl_res_msg="POSIX threaded"
  2806. fi
  2807. ])
  2808. fi
  2809. dnl ************************************************************
  2810. dnl disable verbose text strings
  2811. dnl
  2812. AC_MSG_CHECKING([whether to enable verbose strings])
  2813. AC_ARG_ENABLE(verbose,
  2814. AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
  2815. AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
  2816. [ case "$enableval" in
  2817. no)
  2818. AC_MSG_RESULT(no)
  2819. AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
  2820. curl_verbose_msg="no"
  2821. ;;
  2822. *) AC_MSG_RESULT(yes)
  2823. ;;
  2824. esac ],
  2825. AC_MSG_RESULT(yes)
  2826. )
  2827. dnl ************************************************************
  2828. dnl enable SSPI support
  2829. dnl
  2830. AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)])
  2831. AC_ARG_ENABLE(sspi,
  2832. AC_HELP_STRING([--enable-sspi],[Enable SSPI])
  2833. AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
  2834. [ case "$enableval" in
  2835. yes)
  2836. if test "$ac_cv_native_windows" = "yes"; then
  2837. AC_MSG_RESULT(yes)
  2838. AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
  2839. AC_SUBST(USE_WINDOWS_SSPI, [1])
  2840. curl_sspi_msg="enabled"
  2841. else
  2842. AC_MSG_RESULT(no)
  2843. AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.])
  2844. fi
  2845. ;;
  2846. *)
  2847. if test "x$WINSSL_ENABLED" = "x1"; then
  2848. # --with-winssl implies --enable-sspi
  2849. AC_MSG_RESULT(yes)
  2850. else
  2851. AC_MSG_RESULT(no)
  2852. fi
  2853. ;;
  2854. esac ],
  2855. if test "x$WINSSL_ENABLED" = "x1"; then
  2856. # --with-winssl implies --enable-sspi
  2857. AC_MSG_RESULT(yes)
  2858. else
  2859. AC_MSG_RESULT(no)
  2860. fi
  2861. )
  2862. dnl ************************************************************
  2863. dnl disable cryptographic authentication
  2864. dnl
  2865. AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
  2866. AC_ARG_ENABLE(crypto-auth,
  2867. AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
  2868. AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
  2869. [ case "$enableval" in
  2870. no)
  2871. AC_MSG_RESULT(no)
  2872. AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
  2873. ;;
  2874. *) AC_MSG_RESULT(yes)
  2875. ;;
  2876. esac ],
  2877. AC_MSG_RESULT(yes)
  2878. )
  2879. CURL_CHECK_OPTION_NTLM_WB
  2880. CURL_CHECK_NTLM_WB
  2881. dnl ************************************************************
  2882. dnl disable TLS-SRP authentication
  2883. dnl
  2884. AC_MSG_CHECKING([whether to enable TLS-SRP authentication])
  2885. AC_ARG_ENABLE(tls-srp,
  2886. AC_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication])
  2887. AC_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]),
  2888. [ case "$enableval" in
  2889. no)
  2890. AC_MSG_RESULT(no)
  2891. AC_DEFINE(CURL_DISABLE_TLS_SRP, 1, [to disable TLS-SRP authentication])
  2892. want_tls_srp=no
  2893. ;;
  2894. *) AC_MSG_RESULT(yes)
  2895. want_tls_srp=yes
  2896. ;;
  2897. esac ],
  2898. AC_MSG_RESULT(yes)
  2899. want_tls_srp=yes
  2900. )
  2901. if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_SSLEAY_SRP" = "x1") ; then
  2902. AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication])
  2903. USE_TLS_SRP=1
  2904. curl_tls_srp_msg="enabled"
  2905. fi
  2906. dnl ************************************************************
  2907. dnl disable cookies support
  2908. dnl
  2909. AC_MSG_CHECKING([whether to enable support for cookies])
  2910. AC_ARG_ENABLE(cookies,
  2911. AC_HELP_STRING([--enable-cookies],[Enable cookies support])
  2912. AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
  2913. [ case "$enableval" in
  2914. no)
  2915. AC_MSG_RESULT(no)
  2916. AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
  2917. ;;
  2918. *) AC_MSG_RESULT(yes)
  2919. ;;
  2920. esac ],
  2921. AC_MSG_RESULT(yes)
  2922. )
  2923. dnl ************************************************************
  2924. dnl hiding of library internal symbols
  2925. dnl
  2926. CURL_CONFIGURE_SYMBOL_HIDING
  2927. dnl ************************************************************
  2928. dnl enforce SONAME bump
  2929. dnl
  2930. AC_MSG_CHECKING([whether to enforce SONAME bump])
  2931. AC_ARG_ENABLE(soname-bump,
  2932. AC_HELP_STRING([--enable-soname-bump],[Enable enforced SONAME bump])
  2933. AC_HELP_STRING([--disable-soname-bump],[Disable enforced SONAME bump]),
  2934. [ case "$enableval" in
  2935. yes) AC_MSG_RESULT(yes)
  2936. soname_bump=yes
  2937. ;;
  2938. *)
  2939. AC_MSG_RESULT(no)
  2940. ;;
  2941. esac ],
  2942. AC_MSG_RESULT($soname_bump)
  2943. )
  2944. AM_CONDITIONAL(SONAME_BUMP, test x$soname_bump = xyes)
  2945. dnl
  2946. dnl All the library dependencies put into $LIB apply to libcurl only.
  2947. dnl
  2948. LIBCURL_LIBS=$LIBS
  2949. AC_SUBST(LIBCURL_LIBS)
  2950. AC_SUBST(CURL_NETWORK_LIBS)
  2951. AC_SUBST(CURL_NETWORK_AND_TIME_LIBS)
  2952. dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank
  2953. dnl LIBS variable used in generated makefile at makefile processing
  2954. dnl time. Doing this functionally prevents LIBS from being used for
  2955. dnl all link targets in given makefile.
  2956. BLANK_AT_MAKETIME=
  2957. AC_SUBST(BLANK_AT_MAKETIME)
  2958. AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
  2959. dnl yes or no
  2960. ENABLE_SHARED="$enable_shared"
  2961. AC_SUBST(ENABLE_SHARED)
  2962. dnl to let curl-config output the static libraries correctly
  2963. ENABLE_STATIC="$enable_static"
  2964. AC_SUBST(ENABLE_STATIC)
  2965. dnl
  2966. dnl For keeping supported features and protocols also in pkg-config file
  2967. dnl since it is more cross-compile friendly than curl-config
  2968. dnl
  2969. if test "x$USE_SSLEAY" = "x1"; then
  2970. SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
  2971. elif test -n "$SSL_ENABLED"; then
  2972. SUPPORT_FEATURES="$SUPPORT_FEATURES SSL"
  2973. fi
  2974. if test "@KRB4_ENABLED@" = "x1"; then
  2975. SUPPORT_FEATURES="$SUPPORT_FEATURES KRB4"
  2976. fi
  2977. if test "x$IPV6_ENABLED" = "x1"; then
  2978. SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6"
  2979. fi
  2980. if test "x$HAVE_LIBZ" = "x1"; then
  2981. SUPPORT_FEATURES="$SUPPORT_FEATURES libz"
  2982. fi
  2983. if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1"; then
  2984. SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS"
  2985. fi
  2986. if test "x$IDN_ENABLED" = "x1"; then
  2987. SUPPORT_FEATURES="$SUPPORT_FEATURES IDN"
  2988. fi
  2989. if test "x$USE_WINDOWS_SSPI" = "x1"; then
  2990. SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI"
  2991. fi
  2992. if test "x$CURL_DISABLE_HTTP" != "x1"; then
  2993. if test "x$USE_SSLEAY" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \
  2994. -o "x$GNUTLS_ENABLED" = "x1" -o "x$NSS_ENABLED" = "x1" \
  2995. -o "x$DARWINSSL_ENABLED" = "x1"; then
  2996. SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM"
  2997. if test "x$NTLM_WB_ENABLED" = "x1"; then
  2998. SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB"
  2999. fi
  3000. fi
  3001. fi
  3002. if test "x$USE_TLS_SRP" = "x1"; then
  3003. SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP"
  3004. fi
  3005. AC_SUBST(SUPPORT_FEATURES)
  3006. dnl For supported protocols in pkg-config file
  3007. if test "x$CURL_DISABLE_HTTP" != "x1"; then
  3008. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP"
  3009. if test "x$SSL_ENABLED" = "x1"; then
  3010. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS"
  3011. fi
  3012. fi
  3013. if test "x$CURL_DISABLE_FTP" != "x1"; then
  3014. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP"
  3015. if test "x$SSL_ENABLED" = "x1"; then
  3016. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS"
  3017. fi
  3018. fi
  3019. if test "x$CURL_DISABLE_FILE" != "x1"; then
  3020. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE"
  3021. fi
  3022. if test "x$CURL_DISABLE_TELNET" != "x1"; then
  3023. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET"
  3024. fi
  3025. if test "x$CURL_DISABLE_LDAP" != "x1"; then
  3026. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP"
  3027. if test "x$CURL_DISABLE_LDAPS" != "x1"; then
  3028. if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") ||
  3029. (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then
  3030. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS"
  3031. fi
  3032. fi
  3033. fi
  3034. if test "x$CURL_DISABLE_DICT" != "x1"; then
  3035. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT"
  3036. fi
  3037. if test "x$CURL_DISABLE_TFTP" != "x1"; then
  3038. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP"
  3039. fi
  3040. if test "x$CURL_DISABLE_GOPHER" != "x1"; then
  3041. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER"
  3042. fi
  3043. if test "x$CURL_DISABLE_POP3" != "x1"; then
  3044. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3"
  3045. if test "x$SSL_ENABLED" = "x1"; then
  3046. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S"
  3047. fi
  3048. fi
  3049. if test "x$CURL_DISABLE_IMAP" != "x1"; then
  3050. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP"
  3051. if test "x$SSL_ENABLED" = "x1"; then
  3052. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS"
  3053. fi
  3054. fi
  3055. if test "x$CURL_DISABLE_SMTP" != "x1"; then
  3056. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP"
  3057. if test "x$SSL_ENABLED" = "x1"; then
  3058. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS"
  3059. fi
  3060. fi
  3061. if test "x$USE_LIBSSH2" = "x1"; then
  3062. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP"
  3063. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP"
  3064. fi
  3065. if test "x$CURL_DISABLE_RTSP" != "x1"; then
  3066. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP"
  3067. fi
  3068. if test "x$USE_LIBRTMP" = "x1"; then
  3069. SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP"
  3070. fi
  3071. dnl replace spaces with newlines
  3072. dnl sort the lines
  3073. dnl replace the newlines back to spaces
  3074. SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '`
  3075. AC_SUBST(SUPPORT_PROTOCOLS)
  3076. dnl squeeze whitespace out of some variables
  3077. squeeze CFLAGS
  3078. squeeze CPPFLAGS
  3079. squeeze DEFS
  3080. squeeze LDFLAGS
  3081. squeeze LIBS
  3082. squeeze LIBCURL_LIBS
  3083. squeeze CURL_NETWORK_LIBS
  3084. squeeze CURL_NETWORK_AND_TIME_LIBS
  3085. squeeze SUPPORT_FEATURES
  3086. squeeze SUPPORT_PROTOCOLS
  3087. XC_CHECK_BUILD_FLAGS
  3088. if test "x$want_curldebug_assumed" = "xyes" &&
  3089. test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then
  3090. ac_configure_args="$ac_configure_args --enable-curldebug"
  3091. fi
  3092. AC_CONFIG_FILES([Makefile \
  3093. docs/Makefile \
  3094. docs/examples/Makefile \
  3095. docs/libcurl/Makefile \
  3096. include/Makefile \
  3097. include/curl/Makefile \
  3098. src/Makefile \
  3099. lib/Makefile \
  3100. lib/libcurl.vers \
  3101. tests/Makefile \
  3102. tests/certs/Makefile \
  3103. tests/certs/scripts/Makefile \
  3104. tests/data/Makefile \
  3105. tests/server/Makefile \
  3106. tests/libtest/Makefile \
  3107. tests/unit/Makefile \
  3108. packages/Makefile \
  3109. packages/Win32/Makefile \
  3110. packages/Win32/cygwin/Makefile \
  3111. packages/Linux/Makefile \
  3112. packages/Linux/RPM/Makefile \
  3113. packages/Linux/RPM/curl.spec \
  3114. packages/Linux/RPM/curl-ssl.spec \
  3115. packages/Solaris/Makefile \
  3116. packages/EPM/curl.list \
  3117. packages/EPM/Makefile \
  3118. packages/vms/Makefile \
  3119. packages/AIX/Makefile \
  3120. packages/AIX/RPM/Makefile \
  3121. packages/AIX/RPM/curl.spec \
  3122. curl-config \
  3123. libcurl.pc
  3124. ])
  3125. AC_OUTPUT
  3126. CURL_GENERATE_CONFIGUREHELP_PM
  3127. XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples])
  3128. AC_MSG_NOTICE([Configured to build curl/libcurl:
  3129. curl version: ${CURLVERSION}
  3130. Host setup: ${host}
  3131. Install prefix: ${prefix}
  3132. Compiler: ${CC}
  3133. SSL support: ${curl_ssl_msg}
  3134. SSH support: ${curl_ssh_msg}
  3135. zlib support: ${curl_zlib_msg}
  3136. krb4 support: ${curl_krb4_msg}
  3137. GSSAPI support: ${curl_gss_msg}
  3138. SPNEGO support: ${curl_spnego_msg}
  3139. TLS-SRP support: ${curl_tls_srp_msg}
  3140. resolver: ${curl_res_msg}
  3141. ipv6 support: ${curl_ipv6_msg}
  3142. IDN support: ${curl_idn_msg}
  3143. Build libcurl: Shared=${enable_shared}, Static=${enable_static}
  3144. Built-in manual: ${curl_manual_msg}
  3145. --libcurl option: ${curl_libcurl_msg}
  3146. Verbose errors: ${curl_verbose_msg}
  3147. SSPI support: ${curl_sspi_msg}
  3148. ca cert bundle: ${ca}
  3149. ca cert path: ${capath}
  3150. LDAP support: ${curl_ldap_msg}
  3151. LDAPS support: ${curl_ldaps_msg}
  3152. RTSP support: ${curl_rtsp_msg}
  3153. RTMP support: ${curl_rtmp_msg}
  3154. metalink support: ${curl_mtlnk_msg}
  3155. Protocols: ${SUPPORT_PROTOCOLS}
  3156. ])
  3157. if test "x$soname_bump" = "xyes"; then
  3158. cat <<EOM
  3159. SONAME bump: yes - WARNING: this library will be built with the SONAME
  3160. number bumped due to (a detected) ABI breakage.
  3161. See lib/README.curl_off_t for details on this.
  3162. EOM
  3163. fi