Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1 | #*************************************************************************** |
| 2 | # _ _ ____ _ |
| 3 | # Project ___| | | | _ \| | |
| 4 | # / __| | | | |_) | | |
| 5 | # | (__| |_| | _ <| |___ |
| 6 | # \___|\___/|_| \_\_____| |
| 7 | # |
Haibo Huang | 51d9d88 | 2019-02-06 01:36:06 -0800 | [diff] [blame] | 8 | # Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al. |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 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 |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 12 | # are also available at https://curl.haxx.se/docs/copyright.html. |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 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 | |
| 24 | AC_PREREQ(2.57) |
| 25 | |
| 26 | dnl We don't know the version number "statically" so we use a dash here |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 27 | AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.haxx.se/mail/]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 28 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 29 | XC_OVR_ZZ50 |
| 30 | XC_OVR_ZZ60 |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 31 | CURL_OVERRIDE_AUTOCONF |
| 32 | |
| 33 | dnl configure script copyright |
Haibo Huang | 51d9d88 | 2019-02-06 01:36:06 -0800 | [diff] [blame] | 34 | AC_COPYRIGHT([Copyright (c) 1998 - 2019 Daniel Stenberg, <daniel@haxx.se> |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 35 | This configure script may be copied, distributed and modified under the |
| 36 | terms of the curl license; see COPYING for more details]) |
| 37 | |
| 38 | AC_CONFIG_SRCDIR([lib/urldata.h]) |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 39 | AC_CONFIG_HEADERS(lib/curl_config.h) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 40 | AC_CONFIG_MACRO_DIR([m4]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 41 | AM_MAINTAINER_MODE |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 42 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 43 | |
| 44 | CURL_CHECK_OPTION_DEBUG |
| 45 | CURL_CHECK_OPTION_OPTIMIZE |
| 46 | CURL_CHECK_OPTION_WARNINGS |
| 47 | CURL_CHECK_OPTION_WERROR |
| 48 | CURL_CHECK_OPTION_CURLDEBUG |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 49 | CURL_CHECK_OPTION_SYMBOL_HIDING |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 50 | CURL_CHECK_OPTION_ARES |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 51 | CURL_CHECK_OPTION_RT |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 52 | CURL_CHECK_OPTION_ESNI |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 53 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 54 | XC_CHECK_PATH_SEPARATOR |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 55 | |
| 56 | # |
| 57 | # save the configure arguments |
| 58 | # |
| 59 | CONFIGURE_OPTIONS="\"$ac_configure_args\"" |
| 60 | AC_SUBST(CONFIGURE_OPTIONS) |
| 61 | |
| 62 | CURL_CFLAG_EXTRAS="" |
| 63 | if test X"$want_werror" = Xyes; then |
| 64 | CURL_CFLAG_EXTRAS="-Werror" |
Elliott Hughes | b1ef70f | 2018-10-30 11:28:38 -0700 | [diff] [blame] | 65 | if test "$compiler_id" = "GNU_C"; then |
| 66 | dnl enable -pedantic-errors for GCC 5 and later, |
| 67 | dnl as before that it was the same as -Werror=pedantic |
| 68 | if test "$compiler_num" -ge "500"; then |
| 69 | CURL_CFLAG_EXTRAS="$CURL_CFLAG_EXTRAS -pedantic-errors" |
| 70 | fi |
| 71 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 72 | fi |
| 73 | AC_SUBST(CURL_CFLAG_EXTRAS) |
| 74 | |
| 75 | dnl SED is mandatory for configure process and libtool. |
| 76 | dnl Set it now, allowing it to be changed later. |
| 77 | if test -z "$SED"; then |
| 78 | dnl allow it to be overridden |
| 79 | AC_PATH_PROG([SED], [sed], [not_found], |
| 80 | [$PATH:/usr/bin:/usr/local/bin]) |
| 81 | if test -z "$SED" || test "$SED" = "not_found"; then |
| 82 | AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.]) |
| 83 | fi |
| 84 | fi |
| 85 | AC_SUBST([SED]) |
| 86 | |
| 87 | dnl GREP is mandatory for configure process and libtool. |
| 88 | dnl Set it now, allowing it to be changed later. |
| 89 | if test -z "$GREP"; then |
| 90 | dnl allow it to be overridden |
| 91 | AC_PATH_PROG([GREP], [grep], [not_found], |
| 92 | [$PATH:/usr/bin:/usr/local/bin]) |
| 93 | if test -z "$GREP" || test "$GREP" = "not_found"; then |
| 94 | AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.]) |
| 95 | fi |
| 96 | fi |
| 97 | AC_SUBST([GREP]) |
| 98 | |
| 99 | dnl EGREP is mandatory for configure process and libtool. |
| 100 | dnl Set it now, allowing it to be changed later. |
| 101 | if test -z "$EGREP"; then |
| 102 | dnl allow it to be overridden |
| 103 | if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then |
| 104 | AC_MSG_CHECKING([for egrep]) |
| 105 | EGREP="$GREP -E" |
| 106 | AC_MSG_RESULT([$EGREP]) |
| 107 | else |
| 108 | AC_PATH_PROG([EGREP], [egrep], [not_found], |
| 109 | [$PATH:/usr/bin:/usr/local/bin]) |
| 110 | fi |
| 111 | fi |
| 112 | if test -z "$EGREP" || test "$EGREP" = "not_found"; then |
| 113 | AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.]) |
| 114 | fi |
| 115 | AC_SUBST([EGREP]) |
| 116 | |
| 117 | dnl AR is mandatory for configure process and libtool. |
| 118 | dnl This is target dependent, so check it as a tool. |
| 119 | if test -z "$AR"; then |
| 120 | dnl allow it to be overridden |
| 121 | AC_PATH_TOOL([AR], [ar], [not_found], |
| 122 | [$PATH:/usr/bin:/usr/local/bin]) |
| 123 | if test -z "$AR" || test "$AR" = "not_found"; then |
| 124 | AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.]) |
| 125 | fi |
| 126 | fi |
| 127 | AC_SUBST([AR]) |
| 128 | |
| 129 | AC_SUBST(libext) |
| 130 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 131 | dnl figure out the libcurl version |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 132 | CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h` |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 133 | XC_CHECK_PROG_CC |
Elliott Hughes | 0128fe4 | 2018-02-27 14:57:55 -0800 | [diff] [blame] | 134 | |
Haibo Huang | 51d9d88 | 2019-02-06 01:36:06 -0800 | [diff] [blame] | 135 | dnl for --enable-code-coverage |
| 136 | CURL_COVERAGE |
Elliott Hughes | 0128fe4 | 2018-02-27 14:57:55 -0800 | [diff] [blame] | 137 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 138 | XC_AUTOMAKE |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 139 | AC_MSG_CHECKING([curl version]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 140 | AC_MSG_RESULT($CURLVERSION) |
| 141 | |
| 142 | AC_SUBST(CURLVERSION) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 143 | |
| 144 | dnl |
| 145 | dnl we extract the numerical version for curl-config only |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 146 | VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h` |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 147 | AC_SUBST(VERSIONNUM) |
| 148 | |
| 149 | dnl Solaris pkgadd support definitions |
| 150 | PKGADD_PKG="HAXXcurl" |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 151 | PKGADD_NAME="curl - a client that groks URLs" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 152 | PKGADD_VENDOR="curl.haxx.se" |
| 153 | AC_SUBST(PKGADD_PKG) |
| 154 | AC_SUBST(PKGADD_NAME) |
| 155 | AC_SUBST(PKGADD_VENDOR) |
| 156 | |
| 157 | dnl |
| 158 | dnl initialize all the info variables |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 159 | curl_ssl_msg="no (--with-{ssl,gnutls,nss,mbedtls,wolfssl,schannel,secure-transport,mesalink,amissl} )" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 160 | curl_ssh_msg="no (--with-libssh2)" |
| 161 | curl_zlib_msg="no (--with-zlib)" |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 162 | curl_brotli_msg="no (--with-brotli)" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 163 | curl_gss_msg="no (--with-gssapi)" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 164 | curl_tls_srp_msg="no (--enable-tls-srp)" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 165 | curl_res_msg="default (--enable-ares / --enable-threaded-resolver)" |
| 166 | curl_ipv6_msg="no (--enable-ipv6)" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 167 | curl_unix_sockets_msg="no (--enable-unix-sockets)" |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 168 | curl_idn_msg="no (--with-{libidn2,winidn})" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 169 | curl_manual_msg="no (--enable-manual)" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 170 | curl_libcurl_msg="enabled (--disable-libcurl-option)" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 171 | curl_verbose_msg="enabled (--disable-verbose)" |
| 172 | curl_sspi_msg="no (--enable-sspi)" |
| 173 | curl_ldap_msg="no (--enable-ldap / --with-ldap-lib / --with-lber-lib)" |
| 174 | curl_ldaps_msg="no (--enable-ldaps)" |
| 175 | curl_rtsp_msg="no (--enable-rtsp)" |
| 176 | curl_rtmp_msg="no (--with-librtmp)" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 177 | curl_mtlnk_msg="no (--with-libmetalink)" |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 178 | curl_psl_msg="no (--with-libpsl)" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 179 | |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 180 | ssl_backends= |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 181 | |
| 182 | dnl |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 183 | dnl Save some initial values the user might have provided |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 184 | dnl |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 185 | INITIAL_LDFLAGS=$LDFLAGS |
| 186 | INITIAL_LIBS=$LIBS |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 187 | |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 188 | dnl |
| 189 | dnl Detect the canonical host and target build environment |
| 190 | dnl |
| 191 | |
| 192 | AC_CANONICAL_HOST |
| 193 | dnl Get system canonical name |
| 194 | AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS]) |
| 195 | |
Elliott Hughes | 72d948d | 2018-08-03 14:37:21 -0700 | [diff] [blame] | 196 | # Silence warning: ar: 'u' modifier ignored since 'D' is the default |
| 197 | AC_SUBST(AR_FLAGS, [cr]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 198 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 199 | dnl This defines _ALL_SOURCE for AIX |
| 200 | CURL_CHECK_AIX_ALL_SOURCE |
| 201 | |
| 202 | dnl Our configure and build reentrant settings |
| 203 | CURL_CONFIGURE_THREAD_SAFE |
| 204 | CURL_CONFIGURE_REENTRANT |
| 205 | |
| 206 | dnl check for how to do large files |
| 207 | AC_SYS_LARGEFILE |
| 208 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 209 | XC_LIBTOOL |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 210 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 211 | # |
| 212 | # Automake conditionals based on libtool related checks |
| 213 | # |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 214 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 215 | AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSION_INFO], |
| 216 | [test "x$xc_lt_shlib_use_version_info" = 'xyes']) |
| 217 | AM_CONDITIONAL([CURL_LT_SHLIB_USE_NO_UNDEFINED], |
| 218 | [test "x$xc_lt_shlib_use_no_undefined" = 'xyes']) |
| 219 | AM_CONDITIONAL([CURL_LT_SHLIB_USE_MIMPURE_TEXT], |
| 220 | [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes']) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 221 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 222 | # |
| 223 | # Due to libtool and automake machinery limitations of not allowing |
| 224 | # specifying separate CPPFLAGS or CFLAGS when compiling objects for |
| 225 | # inclusion of these in shared or static libraries, we are forced to |
| 226 | # build using separate configure runs for shared and static libraries |
| 227 | # on systems where different CPPFLAGS or CFLAGS are mandatory in order |
| 228 | # to compile objects for each kind of library. Notice that relying on |
| 229 | # the '-DPIC' CFLAG that libtool provides is not valid given that the |
| 230 | # user might for example choose to build static libraries with PIC. |
| 231 | # |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 232 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 233 | # |
| 234 | # Make our Makefile.am files use the staticlib CPPFLAG only when strictly |
| 235 | # targeting a static library and not building its shared counterpart. |
| 236 | # |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 237 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 238 | AM_CONDITIONAL([USE_CPPFLAG_CURL_STATICLIB], |
| 239 | [test "x$xc_lt_build_static_only" = 'xyes']) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 240 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 241 | # |
| 242 | # Make staticlib CPPFLAG variable and its definition visible in output |
| 243 | # files unconditionally, providing an empty definition unless strictly |
| 244 | # targeting a static library and not building its shared counterpart. |
| 245 | # |
| 246 | |
| 247 | CPPFLAG_CURL_STATICLIB= |
| 248 | if test "x$xc_lt_build_static_only" = 'xyes'; then |
| 249 | CPPFLAG_CURL_STATICLIB='-DCURL_STATICLIB' |
| 250 | fi |
| 251 | AC_SUBST([CPPFLAG_CURL_STATICLIB]) |
| 252 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 253 | |
| 254 | # Determine whether all dependent libraries must be specified when linking |
| 255 | if test "X$enable_shared" = "Xyes" -a "X$link_all_deplibs" = "Xno" |
| 256 | then |
| 257 | REQUIRE_LIB_DEPS=no |
| 258 | else |
| 259 | REQUIRE_LIB_DEPS=yes |
| 260 | fi |
| 261 | AC_SUBST(REQUIRE_LIB_DEPS) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 262 | AM_CONDITIONAL(USE_EXPLICIT_LIB_DEPS, test x$REQUIRE_LIB_DEPS = xyes) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 263 | |
| 264 | dnl check if there's a way to force code inline |
| 265 | AC_C_INLINE |
| 266 | |
| 267 | dnl ********************************************************************** |
| 268 | dnl platform/compiler/architecture specific checks/flags |
| 269 | dnl ********************************************************************** |
| 270 | |
| 271 | CURL_CHECK_COMPILER |
| 272 | CURL_SET_COMPILER_BASIC_OPTS |
| 273 | CURL_SET_COMPILER_DEBUG_OPTS |
| 274 | CURL_SET_COMPILER_OPTIMIZE_OPTS |
| 275 | CURL_SET_COMPILER_WARNING_OPTS |
| 276 | |
| 277 | if test "$compiler_id" = "INTEL_UNIX_C"; then |
| 278 | # |
| 279 | if test "$compiler_num" -ge "1000"; then |
| 280 | dnl icc 10.X or later |
| 281 | CFLAGS="$CFLAGS -shared-intel" |
| 282 | elif test "$compiler_num" -ge "900"; then |
| 283 | dnl icc 9.X specific |
| 284 | CFLAGS="$CFLAGS -i-dynamic" |
| 285 | fi |
| 286 | # |
| 287 | fi |
| 288 | |
| 289 | CURL_CHECK_COMPILER_HALT_ON_ERROR |
| 290 | CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 291 | CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH |
| 292 | CURL_CHECK_COMPILER_SYMBOL_HIDING |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 293 | |
| 294 | CURL_CHECK_CURLDEBUG |
| 295 | AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes) |
| 296 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 297 | supports_unittests=yes |
| 298 | # cross-compilation of unit tests static library/programs fails when |
| 299 | # libcurl shared library is built. This might be due to a libtool or |
| 300 | # automake issue. In this case we disable unit tests. |
| 301 | if test "x$cross_compiling" != "xno" && |
| 302 | test "x$enable_shared" != "xno"; then |
| 303 | supports_unittests=no |
| 304 | fi |
| 305 | |
| 306 | # IRIX 6.5.24 gcc 3.3 autobuilds fail unittests library compilation due to |
| 307 | # a problem related with OpenSSL headers and library versions not matching. |
| 308 | # Disable unit tests while time to further investigate this is found. |
| 309 | case $host in |
| 310 | mips-sgi-irix6.5) |
| 311 | if test "$compiler_id" = "GNU_C"; then |
| 312 | supports_unittests=no |
| 313 | fi |
| 314 | ;; |
| 315 | esac |
| 316 | |
| 317 | # All AIX autobuilds fails unit tests linking against unittests library |
| 318 | # due to unittests library being built with no symbols or members. Libtool ? |
| 319 | # Disable unit tests while time to further investigate this is found. |
| 320 | case $host_os in |
| 321 | aix*) |
| 322 | supports_unittests=no |
| 323 | ;; |
| 324 | esac |
| 325 | |
| 326 | dnl Build unit tests when option --enable-debug is given. |
| 327 | if test "x$want_debug" = "xyes" && |
| 328 | test "x$supports_unittests" = "xyes"; then |
| 329 | want_unittests=yes |
| 330 | else |
| 331 | want_unittests=no |
| 332 | fi |
| 333 | AM_CONDITIONAL(BUILD_UNITTESTS, test x$want_unittests = xyes) |
| 334 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 335 | dnl ********************************************************************** |
| 336 | dnl Compilation based checks should not be done before this point. |
| 337 | dnl ********************************************************************** |
| 338 | |
| 339 | dnl ********************************************************************** |
| 340 | dnl Make sure that our checks for headers windows.h winsock.h winsock2.h |
| 341 | dnl and ws2tcpip.h take precedence over any other further checks which |
| 342 | dnl could be done later using AC_CHECK_HEADER or AC_CHECK_HEADERS for |
| 343 | dnl this specific header files. And do them before its results are used. |
| 344 | dnl ********************************************************************** |
| 345 | |
| 346 | CURL_CHECK_HEADER_WINDOWS |
| 347 | CURL_CHECK_NATIVE_WINDOWS |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 348 | case X-"$curl_cv_native_windows" in |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 349 | X-yes) |
| 350 | CURL_CHECK_HEADER_WINSOCK |
| 351 | CURL_CHECK_HEADER_WINSOCK2 |
| 352 | CURL_CHECK_HEADER_WS2TCPIP |
| 353 | CURL_CHECK_HEADER_WINLDAP |
| 354 | CURL_CHECK_HEADER_WINBER |
| 355 | ;; |
| 356 | *) |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 357 | curl_cv_header_winsock_h="no" |
| 358 | curl_cv_header_winsock2_h="no" |
| 359 | curl_cv_header_ws2tcpip_h="no" |
| 360 | curl_cv_header_winldap_h="no" |
| 361 | curl_cv_header_winber_h="no" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 362 | ;; |
| 363 | esac |
| 364 | CURL_CHECK_WIN32_LARGEFILE |
| 365 | |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 366 | CURL_MAC_CFLAGS |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 367 | CURL_SUPPORTS_BUILTIN_AVAILABLE |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 368 | |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 369 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 370 | dnl ************************************************************ |
| 371 | dnl switch off particular protocols |
| 372 | dnl |
| 373 | AC_MSG_CHECKING([whether to support http]) |
| 374 | AC_ARG_ENABLE(http, |
| 375 | AC_HELP_STRING([--enable-http],[Enable HTTP support]) |
| 376 | AC_HELP_STRING([--disable-http],[Disable HTTP support]), |
| 377 | [ case "$enableval" in |
| 378 | no) |
| 379 | AC_MSG_RESULT(no) |
| 380 | AC_DEFINE(CURL_DISABLE_HTTP, 1, [to disable HTTP]) |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 381 | disable_http="yes" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 382 | AC_MSG_WARN([disable HTTP disables FTP over proxy and RTSP]) |
| 383 | AC_SUBST(CURL_DISABLE_HTTP, [1]) |
| 384 | AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP]) |
| 385 | AC_SUBST(CURL_DISABLE_RTSP, [1]) |
| 386 | ;; |
| 387 | *) AC_MSG_RESULT(yes) |
| 388 | ;; |
| 389 | esac ], |
| 390 | AC_MSG_RESULT(yes) |
| 391 | ) |
| 392 | AC_MSG_CHECKING([whether to support ftp]) |
| 393 | AC_ARG_ENABLE(ftp, |
| 394 | AC_HELP_STRING([--enable-ftp],[Enable FTP support]) |
| 395 | AC_HELP_STRING([--disable-ftp],[Disable FTP support]), |
| 396 | [ case "$enableval" in |
| 397 | no) |
| 398 | AC_MSG_RESULT(no) |
| 399 | AC_DEFINE(CURL_DISABLE_FTP, 1, [to disable FTP]) |
| 400 | AC_SUBST(CURL_DISABLE_FTP, [1]) |
| 401 | ;; |
| 402 | *) AC_MSG_RESULT(yes) |
| 403 | ;; |
| 404 | esac ], |
| 405 | AC_MSG_RESULT(yes) |
| 406 | ) |
| 407 | AC_MSG_CHECKING([whether to support file]) |
| 408 | AC_ARG_ENABLE(file, |
| 409 | AC_HELP_STRING([--enable-file],[Enable FILE support]) |
| 410 | AC_HELP_STRING([--disable-file],[Disable FILE support]), |
| 411 | [ case "$enableval" in |
| 412 | no) |
| 413 | AC_MSG_RESULT(no) |
| 414 | AC_DEFINE(CURL_DISABLE_FILE, 1, [to disable FILE]) |
| 415 | AC_SUBST(CURL_DISABLE_FILE, [1]) |
| 416 | ;; |
| 417 | *) AC_MSG_RESULT(yes) |
| 418 | ;; |
| 419 | esac ], |
| 420 | AC_MSG_RESULT(yes) |
| 421 | ) |
| 422 | AC_MSG_CHECKING([whether to support ldap]) |
| 423 | AC_ARG_ENABLE(ldap, |
| 424 | AC_HELP_STRING([--enable-ldap],[Enable LDAP support]) |
| 425 | AC_HELP_STRING([--disable-ldap],[Disable LDAP support]), |
| 426 | [ case "$enableval" in |
| 427 | no) |
| 428 | AC_MSG_RESULT(no) |
| 429 | AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) |
| 430 | AC_SUBST(CURL_DISABLE_LDAP, [1]) |
| 431 | ;; |
| 432 | *) |
| 433 | AC_MSG_RESULT(yes) |
| 434 | ;; |
| 435 | esac ],[ |
| 436 | AC_MSG_RESULT(yes) ] |
| 437 | ) |
| 438 | AC_MSG_CHECKING([whether to support ldaps]) |
| 439 | AC_ARG_ENABLE(ldaps, |
| 440 | AC_HELP_STRING([--enable-ldaps],[Enable LDAPS support]) |
| 441 | AC_HELP_STRING([--disable-ldaps],[Disable LDAPS support]), |
| 442 | [ case "$enableval" in |
| 443 | no) |
| 444 | AC_MSG_RESULT(no) |
| 445 | AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) |
| 446 | AC_SUBST(CURL_DISABLE_LDAPS, [1]) |
| 447 | ;; |
| 448 | *) if test "x$CURL_DISABLE_LDAP" = "x1" ; then |
| 449 | AC_MSG_RESULT(LDAP needs to be enabled to support LDAPS) |
| 450 | AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) |
| 451 | AC_SUBST(CURL_DISABLE_LDAPS, [1]) |
| 452 | else |
| 453 | AC_MSG_RESULT(yes) |
| 454 | AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation]) |
| 455 | AC_SUBST(HAVE_LDAP_SSL, [1]) |
| 456 | fi |
| 457 | ;; |
| 458 | esac ],[ |
| 459 | if test "x$CURL_DISABLE_LDAP" = "x1" ; then |
| 460 | AC_MSG_RESULT(no) |
| 461 | AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) |
| 462 | AC_SUBST(CURL_DISABLE_LDAPS, [1]) |
| 463 | else |
| 464 | AC_MSG_RESULT(yes) |
| 465 | AC_DEFINE(HAVE_LDAP_SSL, 1, [Use LDAPS implementation]) |
| 466 | AC_SUBST(HAVE_LDAP_SSL, [1]) |
| 467 | fi ] |
| 468 | ) |
| 469 | |
| 470 | AC_MSG_CHECKING([whether to support rtsp]) |
| 471 | AC_ARG_ENABLE(rtsp, |
| 472 | AC_HELP_STRING([--enable-rtsp],[Enable RTSP support]) |
| 473 | AC_HELP_STRING([--disable-rtsp],[Disable RTSP support]), |
| 474 | [ case "$enableval" in |
| 475 | no) |
| 476 | AC_MSG_RESULT(no) |
| 477 | AC_DEFINE(CURL_DISABLE_RTSP, 1, [to disable RTSP]) |
| 478 | AC_SUBST(CURL_DISABLE_RTSP, [1]) |
| 479 | ;; |
| 480 | *) if test x$CURL_DISABLE_HTTP = x1 ; then |
| 481 | AC_MSG_ERROR(HTTP support needs to be enabled in order to enable RTSP support!) |
| 482 | else |
| 483 | AC_MSG_RESULT(yes) |
| 484 | curl_rtsp_msg="enabled" |
| 485 | fi |
| 486 | ;; |
| 487 | esac ], |
| 488 | if test "x$CURL_DISABLE_HTTP" != "x1"; then |
| 489 | AC_MSG_RESULT(yes) |
| 490 | curl_rtsp_msg="enabled" |
| 491 | else |
| 492 | AC_MSG_RESULT(no) |
| 493 | fi |
| 494 | ) |
| 495 | |
| 496 | AC_MSG_CHECKING([whether to support proxies]) |
| 497 | AC_ARG_ENABLE(proxy, |
| 498 | AC_HELP_STRING([--enable-proxy],[Enable proxy support]) |
| 499 | AC_HELP_STRING([--disable-proxy],[Disable proxy support]), |
| 500 | [ case "$enableval" in |
| 501 | no) |
| 502 | AC_MSG_RESULT(no) |
| 503 | AC_DEFINE(CURL_DISABLE_PROXY, 1, [to disable proxies]) |
| 504 | AC_SUBST(CURL_DISABLE_PROXY, [1]) |
| 505 | ;; |
| 506 | *) AC_MSG_RESULT(yes) |
| 507 | ;; |
| 508 | esac ], |
| 509 | AC_MSG_RESULT(yes) |
| 510 | ) |
| 511 | |
| 512 | AC_MSG_CHECKING([whether to support dict]) |
| 513 | AC_ARG_ENABLE(dict, |
| 514 | AC_HELP_STRING([--enable-dict],[Enable DICT support]) |
| 515 | AC_HELP_STRING([--disable-dict],[Disable DICT support]), |
| 516 | [ case "$enableval" in |
| 517 | no) |
| 518 | AC_MSG_RESULT(no) |
| 519 | AC_DEFINE(CURL_DISABLE_DICT, 1, [to disable DICT]) |
| 520 | AC_SUBST(CURL_DISABLE_DICT, [1]) |
| 521 | ;; |
| 522 | *) AC_MSG_RESULT(yes) |
| 523 | ;; |
| 524 | esac ], |
| 525 | AC_MSG_RESULT(yes) |
| 526 | ) |
| 527 | AC_MSG_CHECKING([whether to support telnet]) |
| 528 | AC_ARG_ENABLE(telnet, |
| 529 | AC_HELP_STRING([--enable-telnet],[Enable TELNET support]) |
| 530 | AC_HELP_STRING([--disable-telnet],[Disable TELNET support]), |
| 531 | [ case "$enableval" in |
| 532 | no) |
| 533 | AC_MSG_RESULT(no) |
| 534 | AC_DEFINE(CURL_DISABLE_TELNET, 1, [to disable TELNET]) |
| 535 | AC_SUBST(CURL_DISABLE_TELNET, [1]) |
| 536 | ;; |
| 537 | *) AC_MSG_RESULT(yes) |
| 538 | ;; |
| 539 | esac ], |
| 540 | AC_MSG_RESULT(yes) |
| 541 | ) |
| 542 | AC_MSG_CHECKING([whether to support tftp]) |
| 543 | AC_ARG_ENABLE(tftp, |
| 544 | AC_HELP_STRING([--enable-tftp],[Enable TFTP support]) |
| 545 | AC_HELP_STRING([--disable-tftp],[Disable TFTP support]), |
| 546 | [ case "$enableval" in |
| 547 | no) |
| 548 | AC_MSG_RESULT(no) |
| 549 | AC_DEFINE(CURL_DISABLE_TFTP, 1, [to disable TFTP]) |
| 550 | AC_SUBST(CURL_DISABLE_TFTP, [1]) |
| 551 | ;; |
| 552 | *) AC_MSG_RESULT(yes) |
| 553 | ;; |
| 554 | esac ], |
| 555 | AC_MSG_RESULT(yes) |
| 556 | ) |
| 557 | |
| 558 | AC_MSG_CHECKING([whether to support pop3]) |
| 559 | AC_ARG_ENABLE(pop3, |
| 560 | AC_HELP_STRING([--enable-pop3],[Enable POP3 support]) |
| 561 | AC_HELP_STRING([--disable-pop3],[Disable POP3 support]), |
| 562 | [ case "$enableval" in |
| 563 | no) |
| 564 | AC_MSG_RESULT(no) |
| 565 | AC_DEFINE(CURL_DISABLE_POP3, 1, [to disable POP3]) |
| 566 | AC_SUBST(CURL_DISABLE_POP3, [1]) |
| 567 | ;; |
| 568 | *) AC_MSG_RESULT(yes) |
| 569 | ;; |
| 570 | esac ], |
| 571 | AC_MSG_RESULT(yes) |
| 572 | ) |
| 573 | |
| 574 | |
| 575 | AC_MSG_CHECKING([whether to support imap]) |
| 576 | AC_ARG_ENABLE(imap, |
| 577 | AC_HELP_STRING([--enable-imap],[Enable IMAP support]) |
| 578 | AC_HELP_STRING([--disable-imap],[Disable IMAP support]), |
| 579 | [ case "$enableval" in |
| 580 | no) |
| 581 | AC_MSG_RESULT(no) |
| 582 | AC_DEFINE(CURL_DISABLE_IMAP, 1, [to disable IMAP]) |
| 583 | AC_SUBST(CURL_DISABLE_IMAP, [1]) |
| 584 | ;; |
| 585 | *) AC_MSG_RESULT(yes) |
| 586 | ;; |
| 587 | esac ], |
| 588 | AC_MSG_RESULT(yes) |
| 589 | ) |
| 590 | |
| 591 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 592 | AC_MSG_CHECKING([whether to support smb]) |
| 593 | AC_ARG_ENABLE(smb, |
| 594 | AC_HELP_STRING([--enable-smb],[Enable SMB/CIFS support]) |
| 595 | AC_HELP_STRING([--disable-smb],[Disable SMB/CIFS support]), |
| 596 | [ case "$enableval" in |
| 597 | no) |
| 598 | AC_MSG_RESULT(no) |
| 599 | AC_DEFINE(CURL_DISABLE_SMB, 1, [to disable SMB/CIFS]) |
| 600 | AC_SUBST(CURL_DISABLE_SMB, [1]) |
| 601 | ;; |
| 602 | *) AC_MSG_RESULT(yes) |
| 603 | ;; |
| 604 | esac ], |
| 605 | AC_MSG_RESULT(yes) |
| 606 | ) |
| 607 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 608 | AC_MSG_CHECKING([whether to support smtp]) |
| 609 | AC_ARG_ENABLE(smtp, |
| 610 | AC_HELP_STRING([--enable-smtp],[Enable SMTP support]) |
| 611 | AC_HELP_STRING([--disable-smtp],[Disable SMTP support]), |
| 612 | [ case "$enableval" in |
| 613 | no) |
| 614 | AC_MSG_RESULT(no) |
| 615 | AC_DEFINE(CURL_DISABLE_SMTP, 1, [to disable SMTP]) |
| 616 | AC_SUBST(CURL_DISABLE_SMTP, [1]) |
| 617 | ;; |
| 618 | *) AC_MSG_RESULT(yes) |
| 619 | ;; |
| 620 | esac ], |
| 621 | AC_MSG_RESULT(yes) |
| 622 | ) |
| 623 | |
| 624 | AC_MSG_CHECKING([whether to support gopher]) |
| 625 | AC_ARG_ENABLE(gopher, |
| 626 | AC_HELP_STRING([--enable-gopher],[Enable Gopher support]) |
| 627 | AC_HELP_STRING([--disable-gopher],[Disable Gopher support]), |
| 628 | [ case "$enableval" in |
| 629 | no) |
| 630 | AC_MSG_RESULT(no) |
| 631 | AC_DEFINE(CURL_DISABLE_GOPHER, 1, [to disable Gopher]) |
| 632 | AC_SUBST(CURL_DISABLE_GOPHER, [1]) |
| 633 | ;; |
| 634 | *) AC_MSG_RESULT(yes) |
| 635 | ;; |
| 636 | esac ], |
| 637 | AC_MSG_RESULT(yes) |
| 638 | ) |
| 639 | |
| 640 | |
| 641 | dnl ********************************************************************** |
| 642 | dnl Check for built-in manual |
| 643 | dnl ********************************************************************** |
| 644 | |
| 645 | AC_MSG_CHECKING([whether to provide built-in manual]) |
| 646 | AC_ARG_ENABLE(manual, |
| 647 | AC_HELP_STRING([--enable-manual],[Enable built-in manual]) |
| 648 | AC_HELP_STRING([--disable-manual],[Disable built-in manual]), |
| 649 | [ case "$enableval" in |
| 650 | no) |
| 651 | AC_MSG_RESULT(no) |
| 652 | ;; |
| 653 | *) AC_MSG_RESULT(yes) |
| 654 | USE_MANUAL="1" |
| 655 | ;; |
| 656 | esac ], |
| 657 | AC_MSG_RESULT(yes) |
| 658 | USE_MANUAL="1" |
| 659 | ) |
| 660 | dnl The actual use of the USE_MANUAL variable is done much later in this |
| 661 | dnl script to allow other actions to disable it as well. |
| 662 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 663 | dnl ************************************************************ |
| 664 | dnl disable C code generation support |
| 665 | dnl |
| 666 | AC_MSG_CHECKING([whether to enable generation of C code]) |
| 667 | AC_ARG_ENABLE(libcurl_option, |
| 668 | AC_HELP_STRING([--enable-libcurl-option],[Enable --libcurl C code generation support]) |
| 669 | AC_HELP_STRING([--disable-libcurl-option],[Disable --libcurl C code generation support]), |
| 670 | [ case "$enableval" in |
| 671 | no) |
| 672 | AC_MSG_RESULT(no) |
| 673 | AC_DEFINE(CURL_DISABLE_LIBCURL_OPTION, 1, [to disable --libcurl C code generation option]) |
| 674 | curl_libcurl_msg="no" |
| 675 | ;; |
| 676 | *) AC_MSG_RESULT(yes) |
| 677 | ;; |
| 678 | esac ], |
| 679 | AC_MSG_RESULT(yes) |
| 680 | ) |
| 681 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 682 | dnl ********************************************************************** |
| 683 | dnl Checks for libraries. |
| 684 | dnl ********************************************************************** |
| 685 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 686 | AC_MSG_CHECKING([whether to use libgcc]) |
| 687 | AC_ARG_ENABLE(libgcc, |
| 688 | AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]), |
| 689 | [ case "$enableval" in |
| 690 | yes) |
| 691 | LIBS="-lgcc $LIBS" |
| 692 | AC_MSG_RESULT(yes) |
| 693 | ;; |
| 694 | *) AC_MSG_RESULT(no) |
| 695 | ;; |
| 696 | esac ], |
| 697 | AC_MSG_RESULT(no) |
| 698 | ) |
| 699 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 700 | CURL_CHECK_LIB_XNET |
| 701 | |
| 702 | dnl gethostbyname without lib or in the nsl lib? |
| 703 | AC_CHECK_FUNC(gethostbyname, |
| 704 | [HAVE_GETHOSTBYNAME="1" |
| 705 | ], |
| 706 | [ AC_CHECK_LIB(nsl, gethostbyname, |
| 707 | [HAVE_GETHOSTBYNAME="1" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 708 | LIBS="-lnsl $LIBS" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 709 | ]) |
| 710 | ]) |
| 711 | |
| 712 | if test "$HAVE_GETHOSTBYNAME" != "1" |
| 713 | then |
| 714 | dnl gethostbyname in the socket lib? |
| 715 | AC_CHECK_LIB(socket, gethostbyname, |
| 716 | [HAVE_GETHOSTBYNAME="1" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 717 | LIBS="-lsocket $LIBS" |
| 718 | ]) |
| 719 | fi |
| 720 | |
| 721 | if test "$HAVE_GETHOSTBYNAME" != "1" |
| 722 | then |
| 723 | dnl gethostbyname in the watt lib? |
| 724 | AC_CHECK_LIB(watt, gethostbyname, |
| 725 | [HAVE_GETHOSTBYNAME="1" |
| 726 | CPPFLAGS="-I/dev/env/WATT_ROOT/inc" |
| 727 | LDFLAGS="-L/dev/env/WATT_ROOT/lib" |
| 728 | LIBS="-lwatt $LIBS" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 729 | ]) |
| 730 | fi |
| 731 | |
| 732 | dnl At least one system has been identified to require BOTH nsl and socket |
| 733 | dnl libs at the same time to link properly. |
| 734 | if test "$HAVE_GETHOSTBYNAME" != "1" |
| 735 | then |
| 736 | AC_MSG_CHECKING([for gethostbyname with both nsl and socket libs]) |
| 737 | my_ac_save_LIBS=$LIBS |
| 738 | LIBS="-lnsl -lsocket $LIBS" |
| 739 | AC_LINK_IFELSE([ |
| 740 | AC_LANG_PROGRAM([[ |
| 741 | ]],[[ |
| 742 | gethostbyname(); |
| 743 | ]]) |
| 744 | ],[ |
| 745 | AC_MSG_RESULT([yes]) |
| 746 | HAVE_GETHOSTBYNAME="1" |
| 747 | ],[ |
| 748 | AC_MSG_RESULT([no]) |
| 749 | LIBS=$my_ac_save_LIBS |
| 750 | ]) |
| 751 | fi |
| 752 | |
| 753 | if test "$HAVE_GETHOSTBYNAME" != "1" |
| 754 | then |
| 755 | dnl This is for winsock systems |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 756 | if test "$curl_cv_header_windows_h" = "yes"; then |
| 757 | if test "$curl_cv_header_winsock_h" = "yes"; then |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 758 | case $host in |
| 759 | *-*-mingw32ce*) |
| 760 | winsock_LIB="-lwinsock" |
| 761 | ;; |
| 762 | *) |
| 763 | winsock_LIB="-lwsock32" |
| 764 | ;; |
| 765 | esac |
| 766 | fi |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 767 | if test "$curl_cv_header_winsock2_h" = "yes"; then |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 768 | winsock_LIB="-lws2_32" |
| 769 | fi |
| 770 | if test ! -z "$winsock_LIB"; then |
| 771 | my_ac_save_LIBS=$LIBS |
| 772 | LIBS="$winsock_LIB $LIBS" |
| 773 | AC_MSG_CHECKING([for gethostbyname in $winsock_LIB]) |
| 774 | AC_LINK_IFELSE([ |
| 775 | AC_LANG_PROGRAM([[ |
| 776 | #ifdef HAVE_WINDOWS_H |
| 777 | #ifndef WIN32_LEAN_AND_MEAN |
| 778 | #define WIN32_LEAN_AND_MEAN |
| 779 | #endif |
| 780 | #include <windows.h> |
| 781 | #ifdef HAVE_WINSOCK2_H |
| 782 | #include <winsock2.h> |
| 783 | #else |
| 784 | #ifdef HAVE_WINSOCK_H |
| 785 | #include <winsock.h> |
| 786 | #endif |
| 787 | #endif |
| 788 | #endif |
| 789 | ]],[[ |
| 790 | gethostbyname("www.dummysite.com"); |
| 791 | ]]) |
| 792 | ],[ |
| 793 | AC_MSG_RESULT([yes]) |
| 794 | HAVE_GETHOSTBYNAME="1" |
| 795 | ],[ |
| 796 | AC_MSG_RESULT([no]) |
| 797 | winsock_LIB="" |
| 798 | LIBS=$my_ac_save_LIBS |
| 799 | ]) |
| 800 | fi |
| 801 | fi |
| 802 | fi |
| 803 | |
| 804 | if test "$HAVE_GETHOSTBYNAME" != "1" |
| 805 | then |
| 806 | dnl This is for Minix 3.1 |
| 807 | AC_MSG_CHECKING([for gethostbyname for Minix 3]) |
| 808 | AC_LINK_IFELSE([ |
| 809 | AC_LANG_PROGRAM([[ |
| 810 | /* Older Minix versions may need <net/gen/netdb.h> here instead */ |
| 811 | #include <netdb.h> |
| 812 | ]],[[ |
| 813 | gethostbyname("www.dummysite.com"); |
| 814 | ]]) |
| 815 | ],[ |
| 816 | AC_MSG_RESULT([yes]) |
| 817 | HAVE_GETHOSTBYNAME="1" |
| 818 | ],[ |
| 819 | AC_MSG_RESULT([no]) |
| 820 | ]) |
| 821 | fi |
| 822 | |
| 823 | if test "$HAVE_GETHOSTBYNAME" != "1" |
| 824 | then |
| 825 | dnl This is for eCos with a stubbed DNS implementation |
| 826 | AC_MSG_CHECKING([for gethostbyname for eCos]) |
| 827 | AC_LINK_IFELSE([ |
| 828 | AC_LANG_PROGRAM([[ |
| 829 | #include <stdio.h> |
| 830 | #include <netdb.h> |
| 831 | ]],[[ |
| 832 | gethostbyname("www.dummysite.com"); |
| 833 | ]]) |
| 834 | ],[ |
| 835 | AC_MSG_RESULT([yes]) |
| 836 | HAVE_GETHOSTBYNAME="1" |
| 837 | ],[ |
| 838 | AC_MSG_RESULT([no]) |
| 839 | ]) |
| 840 | fi |
| 841 | |
| 842 | if test "$HAVE_GETHOSTBYNAME" != "1" |
| 843 | then |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 844 | dnl This is for AmigaOS with bsdsocket.library - needs testing before -lnet |
| 845 | AC_MSG_CHECKING([for gethostbyname for AmigaOS bsdsocket.library]) |
| 846 | AC_LINK_IFELSE([ |
| 847 | AC_LANG_PROGRAM([[ |
| 848 | #include <proto/bsdsocket.h> |
| 849 | struct Library *SocketBase = NULL; |
| 850 | ]],[[ |
| 851 | gethostbyname("www.dummysite.com"); |
| 852 | ]]) |
| 853 | ],[ |
| 854 | AC_MSG_RESULT([yes]) |
| 855 | HAVE_GETHOSTBYNAME="1" |
| 856 | HAVE_PROTO_BSDSOCKET_H="1" |
| 857 | AC_DEFINE(HAVE_PROTO_BSDSOCKET_H, 1, [if Amiga bsdsocket.library is in use]) |
| 858 | AC_SUBST(HAVE_PROTO_BSDSOCKET_H, [1]) |
| 859 | ],[ |
| 860 | AC_MSG_RESULT([no]) |
| 861 | ]) |
| 862 | fi |
| 863 | |
| 864 | if test "$HAVE_GETHOSTBYNAME" != "1" |
| 865 | then |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 866 | dnl gethostbyname in the network lib - for Haiku OS |
| 867 | AC_CHECK_LIB(network, gethostbyname, |
| 868 | [HAVE_GETHOSTBYNAME="1" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 869 | LIBS="-lnetwork $LIBS" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 870 | ]) |
| 871 | fi |
| 872 | |
| 873 | if test "$HAVE_GETHOSTBYNAME" != "1" |
| 874 | then |
| 875 | dnl gethostbyname in the net lib - for BeOS |
| 876 | AC_CHECK_LIB(net, gethostbyname, |
| 877 | [HAVE_GETHOSTBYNAME="1" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 878 | LIBS="-lnet $LIBS" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 879 | ]) |
| 880 | fi |
| 881 | |
| 882 | |
| 883 | if test "$HAVE_GETHOSTBYNAME" != "1"; then |
| 884 | AC_MSG_ERROR([couldn't find libraries for gethostbyname()]) |
| 885 | fi |
| 886 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 887 | CURL_CHECK_LIBS_CONNECT |
| 888 | |
| 889 | CURL_NETWORK_LIBS=$LIBS |
| 890 | |
| 891 | dnl ********************************************************************** |
| 892 | dnl In case that function clock_gettime with monotonic timer is available, |
| 893 | dnl check for additional required libraries. |
| 894 | dnl ********************************************************************** |
| 895 | CURL_CHECK_LIBS_CLOCK_GETTIME_MONOTONIC |
| 896 | |
| 897 | dnl ********************************************************************** |
| 898 | dnl The preceding library checks are all potentially useful for test |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 899 | dnl servers and libtest cases which require networking and clock_gettime |
| 900 | dnl support. Save the list of required libraries at this point for use |
| 901 | dnl while linking those test servers and programs. |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 902 | dnl ********************************************************************** |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 903 | CURL_NETWORK_AND_TIME_LIBS=$LIBS |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 904 | |
| 905 | dnl ********************************************************************** |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 906 | dnl Check for the presence of ZLIB libraries and headers |
| 907 | dnl ********************************************************************** |
| 908 | |
| 909 | dnl Check for & handle argument to --with-zlib. |
| 910 | |
| 911 | clean_CPPFLAGS=$CPPFLAGS |
| 912 | clean_LDFLAGS=$LDFLAGS |
| 913 | clean_LIBS=$LIBS |
| 914 | ZLIB_LIBS="" |
| 915 | AC_ARG_WITH(zlib, |
| 916 | AC_HELP_STRING([--with-zlib=PATH],[search for zlib in PATH]) |
| 917 | AC_HELP_STRING([--without-zlib],[disable use of zlib]), |
| 918 | [OPT_ZLIB="$withval"]) |
| 919 | |
| 920 | if test "$OPT_ZLIB" = "no" ; then |
| 921 | AC_MSG_WARN([zlib disabled]) |
| 922 | else |
| 923 | if test "$OPT_ZLIB" = "yes" ; then |
| 924 | OPT_ZLIB="" |
| 925 | fi |
| 926 | |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 927 | if test -z "$OPT_ZLIB" ; then |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 928 | CURL_CHECK_PKGCONFIG(zlib) |
| 929 | |
| 930 | if test "$PKGCONFIG" != "no" ; then |
| 931 | LIBS="`$PKGCONFIG --libs-only-l zlib` $LIBS" |
| 932 | LDFLAGS="$LDFLAGS `$PKGCONFIG --libs-only-L zlib`" |
| 933 | CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags-only-I zlib`" |
| 934 | OPT_ZLIB="" |
| 935 | HAVE_LIBZ="1" |
| 936 | fi |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 937 | |
| 938 | if test -z "$HAVE_LIBZ"; then |
| 939 | |
| 940 | dnl Check for the lib without setting any new path, since many |
| 941 | dnl people have it in the default path |
| 942 | |
| 943 | AC_CHECK_LIB(z, inflateEnd, |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 944 | dnl libz found, set the variable |
| 945 | [HAVE_LIBZ="1" |
| 946 | LIBS="-lz $LIBS"], |
| 947 | dnl if no lib found, try /usr/local |
| 948 | [OPT_ZLIB="/usr/local"]) |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 949 | fi |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 950 | fi |
| 951 | |
| 952 | dnl Add a nonempty path to the compiler flags |
| 953 | if test -n "$OPT_ZLIB"; then |
| 954 | CPPFLAGS="$CPPFLAGS -I$OPT_ZLIB/include" |
| 955 | LDFLAGS="$LDFLAGS -L$OPT_ZLIB/lib$libsuff" |
| 956 | fi |
| 957 | |
| 958 | AC_CHECK_HEADER(zlib.h, |
| 959 | [ |
| 960 | dnl zlib.h was found |
| 961 | HAVE_ZLIB_H="1" |
| 962 | dnl if the lib wasn't found already, try again with the new paths |
| 963 | if test "$HAVE_LIBZ" != "1"; then |
| 964 | AC_CHECK_LIB(z, gzread, |
| 965 | [ |
| 966 | dnl the lib was found! |
| 967 | HAVE_LIBZ="1" |
| 968 | LIBS="-lz $LIBS" |
| 969 | ], |
| 970 | [ CPPFLAGS=$clean_CPPFLAGS |
| 971 | LDFLAGS=$clean_LDFLAGS]) |
| 972 | fi |
| 973 | ], |
| 974 | [ |
| 975 | dnl zlib.h was not found, restore the flags |
| 976 | CPPFLAGS=$clean_CPPFLAGS |
| 977 | LDFLAGS=$clean_LDFLAGS] |
| 978 | ) |
| 979 | |
| 980 | if test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" != "1" |
| 981 | then |
| 982 | AC_MSG_WARN([configure found only the libz lib, not the header file!]) |
| 983 | HAVE_LIBZ="" |
| 984 | CPPFLAGS=$clean_CPPFLAGS |
| 985 | LDFLAGS=$clean_LDFLAGS |
| 986 | LIBS=$clean_LIBS |
| 987 | elif test "$HAVE_LIBZ" != "1" && test "$HAVE_ZLIB_H" = "1" |
| 988 | then |
| 989 | AC_MSG_WARN([configure found only the libz header file, not the lib!]) |
| 990 | CPPFLAGS=$clean_CPPFLAGS |
| 991 | LDFLAGS=$clean_LDFLAGS |
| 992 | LIBS=$clean_LIBS |
| 993 | elif test "$HAVE_LIBZ" = "1" && test "$HAVE_ZLIB_H" = "1" |
| 994 | then |
| 995 | dnl both header and lib were found! |
| 996 | AC_SUBST(HAVE_LIBZ) |
| 997 | AC_DEFINE(HAVE_ZLIB_H, 1, [if you have the zlib.h header file]) |
| 998 | AC_DEFINE(HAVE_LIBZ, 1, [if zlib is available]) |
| 999 | |
| 1000 | ZLIB_LIBS="-lz" |
| 1001 | LIBS="-lz $clean_LIBS" |
| 1002 | |
| 1003 | dnl replace 'HAVE_LIBZ' in the automake makefile.ams |
| 1004 | AMFIXLIB="1" |
| 1005 | AC_MSG_NOTICE([found both libz and libz.h header]) |
| 1006 | curl_zlib_msg="enabled" |
| 1007 | fi |
| 1008 | fi |
| 1009 | |
| 1010 | dnl set variable for use in automakefile(s) |
| 1011 | AM_CONDITIONAL(HAVE_LIBZ, test x"$AMFIXLIB" = x1) |
| 1012 | AC_SUBST(ZLIB_LIBS) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1013 | |
| 1014 | dnl ********************************************************************** |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 1015 | dnl Check for the presence of BROTLI decoder libraries and headers |
| 1016 | dnl ********************************************************************** |
| 1017 | |
| 1018 | dnl Brotli project home page: https://github.com/google/brotli |
| 1019 | |
| 1020 | dnl Default to compiler & linker defaults for BROTLI files & libraries. |
| 1021 | OPT_BROTLI=off |
| 1022 | AC_ARG_WITH(brotli,dnl |
| 1023 | AC_HELP_STRING([--with-brotli=PATH],[Where to look for brotli, PATH points to the BROTLI installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) |
| 1024 | AC_HELP_STRING([--without-brotli], [disable BROTLI]), |
| 1025 | OPT_BROTLI=$withval) |
| 1026 | |
| 1027 | if test X"$OPT_BROTLI" != Xno; then |
| 1028 | dnl backup the pre-brotli variables |
| 1029 | CLEANLDFLAGS="$LDFLAGS" |
| 1030 | CLEANCPPFLAGS="$CPPFLAGS" |
| 1031 | CLEANLIBS="$LIBS" |
| 1032 | |
| 1033 | case "$OPT_BROTLI" in |
| 1034 | yes) |
| 1035 | dnl --with-brotli (without path) used |
| 1036 | CURL_CHECK_PKGCONFIG(libbrotlidec) |
| 1037 | |
| 1038 | if test "$PKGCONFIG" != "no" ; then |
| 1039 | LIB_BROTLI=`$PKGCONFIG --libs-only-l libbrotlidec` |
| 1040 | LD_BROTLI=`$PKGCONFIG --libs-only-L libbrotlidec` |
| 1041 | CPP_BROTLI=`$PKGCONFIG --cflags-only-I libbrotlidec` |
| 1042 | version=`$PKGCONFIG --modversion libbrotlidec` |
| 1043 | DIR_BROTLI=`echo $LD_BROTLI | $SED -e 's/-L//'` |
| 1044 | fi |
| 1045 | |
| 1046 | ;; |
| 1047 | off) |
| 1048 | dnl no --with-brotli option given, just check default places |
| 1049 | ;; |
| 1050 | *) |
| 1051 | dnl use the given --with-brotli spot |
| 1052 | PREFIX_BROTLI=$OPT_BROTLI |
| 1053 | ;; |
| 1054 | esac |
| 1055 | |
| 1056 | dnl if given with a prefix, we set -L and -I based on that |
| 1057 | if test -n "$PREFIX_BROTLI"; then |
| 1058 | LIB_BROTLI="-lbrotlidec" |
| 1059 | LD_BROTLI=-L${PREFIX_BROTLI}/lib$libsuff |
| 1060 | CPP_BROTLI=-I${PREFIX_BROTLI}/include |
| 1061 | DIR_BROTLI=${PREFIX_BROTLI}/lib$libsuff |
| 1062 | fi |
| 1063 | |
| 1064 | LDFLAGS="$LDFLAGS $LD_BROTLI" |
| 1065 | CPPFLAGS="$CPPFLAGS $CPP_BROTLI" |
| 1066 | LIBS="$LIB_BROTLI $LIBS" |
| 1067 | |
| 1068 | AC_CHECK_LIB(brotlidec, BrotliDecoderDecompress) |
| 1069 | |
| 1070 | AC_CHECK_HEADERS(brotli/decode.h, |
| 1071 | curl_brotli_msg="enabled (libbrotlidec)" |
| 1072 | HAVE_BROTLI=1 |
| 1073 | AC_DEFINE(HAVE_BROTLI, 1, [if BROTLI is in use]) |
| 1074 | AC_SUBST(HAVE_BROTLI, [1]) |
| 1075 | ) |
| 1076 | |
| 1077 | if test X"$OPT_BROTLI" != Xoff && |
| 1078 | test "$HAVE_BROTLI" != "1"; then |
| 1079 | AC_MSG_ERROR([BROTLI libs and/or directories were not found where specified!]) |
| 1080 | fi |
| 1081 | |
| 1082 | if test "$HAVE_BROTLI" = "1"; then |
| 1083 | if test -n "$DIR_BROTLI"; then |
| 1084 | dnl when the brotli shared libs were found in a path that the run-time |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 1085 | dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 1086 | dnl to prevent further configure tests to fail due to this |
| 1087 | |
| 1088 | if test "x$cross_compiling" != "xyes"; then |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 1089 | CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_BROTLI" |
| 1090 | export CURL_LIBRARY_PATH |
| 1091 | AC_MSG_NOTICE([Added $DIR_BROTLI to CURL_LIBRARY_PATH]) |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 1092 | fi |
| 1093 | fi |
| 1094 | else |
| 1095 | dnl no brotli, revert back to clean variables |
| 1096 | LDFLAGS=$CLEANLDFLAGS |
| 1097 | CPPFLAGS=$CLEANCPPFLAGS |
| 1098 | LIBS=$CLEANLIBS |
| 1099 | fi |
| 1100 | fi |
| 1101 | |
| 1102 | dnl ********************************************************************** |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1103 | dnl Check for LDAP |
| 1104 | dnl ********************************************************************** |
| 1105 | |
| 1106 | LDAPLIBNAME="" |
| 1107 | AC_ARG_WITH(ldap-lib, |
| 1108 | AC_HELP_STRING([--with-ldap-lib=libname],[Specify name of ldap lib file]), |
| 1109 | [LDAPLIBNAME="$withval"]) |
| 1110 | |
| 1111 | LBERLIBNAME="" |
| 1112 | AC_ARG_WITH(lber-lib, |
| 1113 | AC_HELP_STRING([--with-lber-lib=libname],[Specify name of lber lib file]), |
| 1114 | [LBERLIBNAME="$withval"]) |
| 1115 | |
| 1116 | if test x$CURL_DISABLE_LDAP != x1 ; then |
| 1117 | |
| 1118 | CURL_CHECK_HEADER_LBER |
| 1119 | CURL_CHECK_HEADER_LDAP |
| 1120 | CURL_CHECK_HEADER_LDAPSSL |
| 1121 | CURL_CHECK_HEADER_LDAP_SSL |
| 1122 | |
| 1123 | if test -z "$LDAPLIBNAME" ; then |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 1124 | if test "$curl_cv_native_windows" = "yes"; then |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1125 | dnl Windows uses a single and unique LDAP library name |
| 1126 | LDAPLIBNAME="wldap32" |
| 1127 | LBERLIBNAME="no" |
| 1128 | fi |
| 1129 | fi |
| 1130 | |
| 1131 | if test "$LDAPLIBNAME" ; then |
| 1132 | AC_CHECK_LIB("$LDAPLIBNAME", ldap_init,, [ |
| 1133 | AC_MSG_WARN(["$LDAPLIBNAME" is not an LDAP library: LDAP disabled]) |
| 1134 | AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1135 | AC_SUBST(CURL_DISABLE_LDAP, [1]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1136 | AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1137 | AC_SUBST(CURL_DISABLE_LDAPS, [1])]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1138 | else |
| 1139 | dnl Try to find the right ldap libraries for this system |
| 1140 | CURL_CHECK_LIBS_LDAP |
| 1141 | case X-"$curl_cv_ldap_LIBS" in |
| 1142 | X-unknown) |
| 1143 | AC_MSG_WARN([Cannot find libraries for LDAP support: LDAP disabled]) |
| 1144 | AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) |
| 1145 | AC_SUBST(CURL_DISABLE_LDAP, [1]) |
| 1146 | AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) |
| 1147 | AC_SUBST(CURL_DISABLE_LDAPS, [1]) |
| 1148 | ;; |
| 1149 | esac |
| 1150 | fi |
| 1151 | fi |
| 1152 | |
| 1153 | if test x$CURL_DISABLE_LDAP != x1 ; then |
| 1154 | |
| 1155 | if test "$LBERLIBNAME" ; then |
| 1156 | dnl If name is "no" then don't define this library at all |
| 1157 | dnl (it's only needed if libldap.so's dependencies are broken). |
| 1158 | if test "$LBERLIBNAME" != "no" ; then |
| 1159 | AC_CHECK_LIB("$LBERLIBNAME", ber_free,, [ |
| 1160 | AC_MSG_WARN(["$LBERLIBNAME" is not an LBER library: LDAP disabled]) |
| 1161 | AC_DEFINE(CURL_DISABLE_LDAP, 1, [to disable LDAP]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1162 | AC_SUBST(CURL_DISABLE_LDAP, [1]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1163 | AC_DEFINE(CURL_DISABLE_LDAPS, 1, [to disable LDAPS]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1164 | AC_SUBST(CURL_DISABLE_LDAPS, [1])]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1165 | fi |
| 1166 | fi |
| 1167 | fi |
| 1168 | |
| 1169 | if test x$CURL_DISABLE_LDAP != x1 ; then |
| 1170 | AC_CHECK_FUNCS([ldap_url_parse ldap_init_fd]) |
| 1171 | |
| 1172 | if test "$LDAPLIBNAME" = "wldap32"; then |
| 1173 | curl_ldap_msg="enabled (winldap)" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1174 | AC_DEFINE(USE_WIN32_LDAP, 1, [Use Windows LDAP implementation]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1175 | else |
| 1176 | curl_ldap_msg="enabled (OpenLDAP)" |
| 1177 | if test "x$ac_cv_func_ldap_init_fd" = "xyes"; then |
| 1178 | AC_DEFINE(USE_OPENLDAP, 1, [Use OpenLDAP-specific code]) |
| 1179 | AC_SUBST(USE_OPENLDAP, [1]) |
| 1180 | fi |
| 1181 | fi |
| 1182 | fi |
| 1183 | |
| 1184 | if test x$CURL_DISABLE_LDAPS != x1 ; then |
| 1185 | curl_ldaps_msg="enabled" |
| 1186 | fi |
| 1187 | |
| 1188 | dnl ********************************************************************** |
| 1189 | dnl Checks for IPv6 |
| 1190 | dnl ********************************************************************** |
| 1191 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1192 | AC_MSG_CHECKING([whether to enable IPv6]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1193 | AC_ARG_ENABLE(ipv6, |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1194 | AC_HELP_STRING([--enable-ipv6],[Enable IPv6 (with IPv4) support]) |
| 1195 | AC_HELP_STRING([--disable-ipv6],[Disable IPv6 support]), |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1196 | [ case "$enableval" in |
| 1197 | no) |
| 1198 | AC_MSG_RESULT(no) |
| 1199 | ipv6=no |
| 1200 | ;; |
| 1201 | *) AC_MSG_RESULT(yes) |
| 1202 | ipv6=yes |
| 1203 | ;; |
| 1204 | esac ], |
| 1205 | |
| 1206 | AC_TRY_RUN([ /* is AF_INET6 available? */ |
| 1207 | #include <sys/types.h> |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 1208 | #ifdef HAVE_WINSOCK2_H |
| 1209 | #include <winsock2.h> |
| 1210 | #else |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1211 | #include <sys/socket.h> |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 1212 | #endif |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1213 | #include <stdlib.h> /* for exit() */ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1214 | main() |
| 1215 | { |
| 1216 | if (socket(AF_INET6, SOCK_STREAM, 0) < 0) |
| 1217 | exit(1); |
| 1218 | else |
| 1219 | exit(0); |
| 1220 | } |
| 1221 | ], |
| 1222 | AC_MSG_RESULT(yes) |
| 1223 | ipv6=yes, |
| 1224 | AC_MSG_RESULT(no) |
| 1225 | ipv6=no, |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 1226 | AC_MSG_RESULT(yes) |
| 1227 | ipv6=yes |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1228 | )) |
| 1229 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1230 | # Check if struct sockaddr_in6 have sin6_scope_id member |
| 1231 | if test "$ipv6" = yes; then |
| 1232 | AC_MSG_CHECKING([if struct sockaddr_in6 has sin6_scope_id member]) |
| 1233 | AC_TRY_COMPILE([ |
| 1234 | #include <sys/types.h> |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 1235 | #ifdef HAVE_WINSOCK2_H |
| 1236 | #include <winsock2.h> |
| 1237 | #include <ws2tcpip.h> |
| 1238 | #else |
| 1239 | #include <netinet/in.h> |
Elliott Hughes | 0128fe4 | 2018-02-27 14:57:55 -0800 | [diff] [blame] | 1240 | #if defined (__TANDEM) |
| 1241 | # include <netinet/in6.h> |
| 1242 | #endif |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 1243 | #endif] , |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1244 | struct sockaddr_in6 s; s.sin6_scope_id = 0; , have_sin6_scope_id=yes) |
| 1245 | if test "$have_sin6_scope_id" = yes; then |
| 1246 | AC_MSG_RESULT([yes]) |
| 1247 | AC_DEFINE(HAVE_SOCKADDR_IN6_SIN6_SCOPE_ID, 1, [Define to 1 if struct sockaddr_in6 has the sin6_scope_id member]) |
| 1248 | else |
| 1249 | AC_MSG_RESULT([no]) |
| 1250 | fi |
| 1251 | fi |
| 1252 | |
| 1253 | dnl ********************************************************************** |
| 1254 | dnl Check if the operating system allows programs to write to their own argv[] |
| 1255 | dnl ********************************************************************** |
| 1256 | |
| 1257 | AC_MSG_CHECKING([if argv can be written to]) |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 1258 | CURL_RUN_IFELSE([ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1259 | int main(int argc, char ** argv) { |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1260 | argv[0][0] = ' '; |
| 1261 | return (argv[0][0] == ' ')?0:1; |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1262 | } |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1263 | ],[ |
| 1264 | curl_cv_writable_argv=yes |
| 1265 | ],[ |
| 1266 | curl_cv_writable_argv=no |
| 1267 | ],[ |
| 1268 | curl_cv_writable_argv=cross |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1269 | ]) |
| 1270 | case $curl_cv_writable_argv in |
| 1271 | yes) |
| 1272 | AC_DEFINE(HAVE_WRITABLE_ARGV, 1, [Define this symbol if your OS supports changing the contents of argv]) |
| 1273 | AC_MSG_RESULT(yes) |
| 1274 | ;; |
| 1275 | no) |
| 1276 | AC_MSG_RESULT(no) |
| 1277 | ;; |
| 1278 | *) |
| 1279 | AC_MSG_RESULT(no) |
| 1280 | AC_MSG_WARN([the previous check could not be made default was used]) |
| 1281 | ;; |
| 1282 | esac |
| 1283 | |
| 1284 | dnl ********************************************************************** |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1285 | dnl Check for GSS-API libraries |
| 1286 | dnl ********************************************************************** |
| 1287 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1288 | dnl check for GSS-API stuff in the /usr as default |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1289 | |
| 1290 | GSSAPI_ROOT="/usr" |
| 1291 | AC_ARG_WITH(gssapi-includes, |
| 1292 | AC_HELP_STRING([--with-gssapi-includes=DIR], |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1293 | [Specify location of GSS-API headers]), |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1294 | [ GSSAPI_INCS="-I$withval" |
| 1295 | want_gss="yes" ] |
| 1296 | ) |
| 1297 | |
| 1298 | AC_ARG_WITH(gssapi-libs, |
| 1299 | AC_HELP_STRING([--with-gssapi-libs=DIR], |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1300 | [Specify location of GSS-API libs]), |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1301 | [ GSSAPI_LIB_DIR="-L$withval" |
| 1302 | want_gss="yes" ] |
| 1303 | ) |
| 1304 | |
| 1305 | AC_ARG_WITH(gssapi, |
| 1306 | AC_HELP_STRING([--with-gssapi=DIR], |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1307 | [Where to look for GSS-API]), [ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1308 | GSSAPI_ROOT="$withval" |
| 1309 | if test x"$GSSAPI_ROOT" != xno; then |
| 1310 | want_gss="yes" |
| 1311 | if test x"$GSSAPI_ROOT" = xyes; then |
| 1312 | dnl if yes, then use default root |
| 1313 | GSSAPI_ROOT="/usr" |
| 1314 | fi |
| 1315 | fi |
| 1316 | ]) |
| 1317 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1318 | : ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"} |
| 1319 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1320 | save_CPPFLAGS="$CPPFLAGS" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1321 | AC_MSG_CHECKING([if GSS-API support is requested]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1322 | if test x"$want_gss" = xyes; then |
| 1323 | AC_MSG_RESULT(yes) |
| 1324 | |
| 1325 | if test -z "$GSSAPI_INCS"; then |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1326 | if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then |
| 1327 | GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi` |
| 1328 | elif test -f "$KRB5CONFIG"; then |
| 1329 | GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi` |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1330 | elif test "$GSSAPI_ROOT" != "yes"; then |
| 1331 | GSSAPI_INCS="-I$GSSAPI_ROOT/include" |
| 1332 | fi |
| 1333 | fi |
| 1334 | |
| 1335 | CPPFLAGS="$CPPFLAGS $GSSAPI_INCS" |
| 1336 | |
| 1337 | AC_CHECK_HEADER(gss.h, |
| 1338 | [ |
| 1339 | dnl found in the given dirs |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1340 | AC_DEFINE(HAVE_GSSGNU, 1, [if you have GNU GSS]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1341 | gnu_gss=yes |
| 1342 | ], |
| 1343 | [ |
| 1344 | dnl not found, check Heimdal or MIT |
| 1345 | AC_CHECK_HEADERS([gssapi/gssapi.h], [], [not_mit=1]) |
| 1346 | AC_CHECK_HEADERS( |
| 1347 | [gssapi/gssapi_generic.h gssapi/gssapi_krb5.h], |
| 1348 | [], |
| 1349 | [not_mit=1], |
| 1350 | [ |
| 1351 | AC_INCLUDES_DEFAULT |
| 1352 | #ifdef HAVE_GSSAPI_GSSAPI_H |
| 1353 | #include <gssapi/gssapi.h> |
| 1354 | #endif |
| 1355 | ]) |
| 1356 | if test "x$not_mit" = "x1"; then |
| 1357 | dnl MIT not found, check for Heimdal |
| 1358 | AC_CHECK_HEADER(gssapi.h, |
| 1359 | [ |
| 1360 | dnl found |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1361 | AC_DEFINE(HAVE_GSSHEIMDAL, 1, [if you have Heimdal]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1362 | ], |
| 1363 | [ |
| 1364 | dnl no header found, disabling GSS |
| 1365 | want_gss=no |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1366 | AC_MSG_WARN(disabling GSS-API support since no header files were found) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1367 | ] |
| 1368 | ) |
| 1369 | else |
| 1370 | dnl MIT found |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1371 | AC_DEFINE(HAVE_GSSMIT, 1, [if you have MIT Kerberos]) |
| 1372 | dnl check if we have a really old MIT Kerberos version (<= 1.2) |
| 1373 | AC_MSG_CHECKING([if GSS-API headers declare GSS_C_NT_HOSTBASED_SERVICE]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1374 | AC_COMPILE_IFELSE([ |
| 1375 | AC_LANG_PROGRAM([[ |
| 1376 | #include <gssapi/gssapi.h> |
| 1377 | #include <gssapi/gssapi_generic.h> |
| 1378 | #include <gssapi/gssapi_krb5.h> |
| 1379 | ]],[[ |
| 1380 | gss_import_name( |
| 1381 | (OM_uint32 *)0, |
| 1382 | (gss_buffer_t)0, |
| 1383 | GSS_C_NT_HOSTBASED_SERVICE, |
| 1384 | (gss_name_t *)0); |
| 1385 | ]]) |
| 1386 | ],[ |
| 1387 | AC_MSG_RESULT([yes]) |
| 1388 | ],[ |
| 1389 | AC_MSG_RESULT([no]) |
| 1390 | AC_DEFINE(HAVE_OLD_GSSMIT, 1, |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1391 | [if you have an old MIT Kerberos version, lacking GSS_C_NT_HOSTBASED_SERVICE]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1392 | ]) |
| 1393 | fi |
| 1394 | ] |
| 1395 | ) |
| 1396 | else |
| 1397 | AC_MSG_RESULT(no) |
| 1398 | fi |
| 1399 | if test x"$want_gss" = xyes; then |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1400 | AC_DEFINE(HAVE_GSSAPI, 1, [if you have GSS-API libraries]) |
| 1401 | HAVE_GSSAPI=1 |
| 1402 | curl_gss_msg="enabled (MIT Kerberos/Heimdal)" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1403 | |
| 1404 | if test -n "$gnu_gss"; then |
| 1405 | curl_gss_msg="enabled (GNU GSS)" |
| 1406 | LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1407 | LIBS="-lgss $LIBS" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1408 | elif test -z "$GSSAPI_LIB_DIR"; then |
| 1409 | case $host in |
| 1410 | *-*-darwin*) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1411 | LIBS="-lgssapi_krb5 -lresolv $LIBS" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1412 | ;; |
| 1413 | *) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1414 | if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1415 | dnl krb5-config doesn't have --libs-only-L or similar, put everything |
| 1416 | dnl into LIBS |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1417 | gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi` |
| 1418 | LIBS="$gss_libs $LIBS" |
| 1419 | elif test -f "$KRB5CONFIG"; then |
| 1420 | dnl krb5-config doesn't have --libs-only-L or similar, put everything |
| 1421 | dnl into LIBS |
| 1422 | gss_libs=`$KRB5CONFIG --libs gssapi` |
| 1423 | LIBS="$gss_libs $LIBS" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1424 | else |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1425 | case $host in |
| 1426 | *-hp-hpux*) |
| 1427 | gss_libname="gss" |
| 1428 | ;; |
| 1429 | *) |
| 1430 | gss_libname="gssapi" |
| 1431 | ;; |
| 1432 | esac |
| 1433 | |
| 1434 | if test "$GSSAPI_ROOT" != "yes"; then |
| 1435 | LDFLAGS="$LDFLAGS -L$GSSAPI_ROOT/lib$libsuff" |
| 1436 | LIBS="-l$gss_libname $LIBS" |
| 1437 | else |
| 1438 | LIBS="-l$gss_libname $LIBS" |
| 1439 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1440 | fi |
| 1441 | ;; |
| 1442 | esac |
| 1443 | else |
| 1444 | LDFLAGS="$LDFLAGS $GSSAPI_LIB_DIR" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1445 | case $host in |
| 1446 | *-hp-hpux*) |
| 1447 | LIBS="-lgss $LIBS" |
| 1448 | ;; |
| 1449 | *) |
| 1450 | LIBS="-lgssapi $LIBS" |
| 1451 | ;; |
| 1452 | esac |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1453 | fi |
| 1454 | else |
| 1455 | CPPFLAGS="$save_CPPFLAGS" |
| 1456 | fi |
| 1457 | |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 1458 | build_libstubgss=no |
| 1459 | if test x"$want_gss" = "xyes"; then |
| 1460 | build_libstubgss=yes |
| 1461 | fi |
| 1462 | |
| 1463 | AM_CONDITIONAL(BUILD_STUB_GSS, test "x$build_libstubgss" = "xyes") |
| 1464 | |
| 1465 | dnl ------------------------------------------------------------- |
| 1466 | dnl parse --with-default-ssl-backend so it can be validated below |
| 1467 | dnl ------------------------------------------------------------- |
| 1468 | |
| 1469 | DEFAULT_SSL_BACKEND=no |
| 1470 | VALID_DEFAULT_SSL_BACKEND= |
| 1471 | AC_ARG_WITH(default-ssl-backend, |
| 1472 | AC_HELP_STRING([--with-default-ssl-backend=NAME],[Use NAME as default SSL backend]) |
| 1473 | AC_HELP_STRING([--without-default-ssl-backend],[Use implicit default SSL backend]), |
| 1474 | [DEFAULT_SSL_BACKEND=$withval]) |
| 1475 | case "$DEFAULT_SSL_BACKEND" in |
| 1476 | no) |
| 1477 | dnl --without-default-ssl-backend option used |
| 1478 | ;; |
| 1479 | default|yes) |
| 1480 | dnl --with-default-ssl-backend option used without name |
| 1481 | AC_MSG_ERROR([The name of the default SSL backend is required.]) |
| 1482 | ;; |
| 1483 | *) |
| 1484 | dnl --with-default-ssl-backend option used with name |
| 1485 | AC_SUBST(DEFAULT_SSL_BACKEND) |
| 1486 | dnl needs to be validated below |
| 1487 | VALID_DEFAULT_SSL_BACKEND=no |
| 1488 | ;; |
| 1489 | esac |
| 1490 | |
| 1491 | dnl ********************************************************************** |
| 1492 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1493 | dnl ------------------------------------------------- |
| 1494 | dnl check winssl option before other SSL libraries |
| 1495 | dnl ------------------------------------------------- |
| 1496 | |
| 1497 | OPT_WINSSL=no |
| 1498 | AC_ARG_WITH(winssl,dnl |
| 1499 | AC_HELP_STRING([--with-winssl],[enable Windows native SSL/TLS]) |
| 1500 | AC_HELP_STRING([--without-winssl], [disable Windows native SSL/TLS]), |
| 1501 | OPT_WINSSL=$withval) |
| 1502 | |
Haibo Huang | 51d9d88 | 2019-02-06 01:36:06 -0800 | [diff] [blame] | 1503 | AC_ARG_WITH(schannel,dnl |
| 1504 | AC_HELP_STRING([--with-schannel],[enable Windows native SSL/TLS]) |
| 1505 | AC_HELP_STRING([--without-schannel], [disable Windows native SSL/TLS]), |
| 1506 | OPT_WINSSL=$withval) |
| 1507 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1508 | AC_MSG_CHECKING([whether to enable Windows native SSL/TLS (Windows native builds only)]) |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 1509 | if test -z "$ssl_backends" -o "x$OPT_WINSSL" != xno; then |
| 1510 | ssl_msg= |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1511 | if test "x$OPT_WINSSL" != "xno" && |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 1512 | test "x$curl_cv_native_windows" = "xyes"; then |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1513 | AC_MSG_RESULT(yes) |
| 1514 | AC_DEFINE(USE_SCHANNEL, 1, [to enable Windows native SSL/TLS support]) |
| 1515 | AC_SUBST(USE_SCHANNEL, [1]) |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 1516 | ssl_msg="Windows-native" |
| 1517 | test schannel != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1518 | WINSSL_ENABLED=1 |
| 1519 | # --with-winssl implies --enable-sspi |
| 1520 | AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support]) |
| 1521 | AC_SUBST(USE_WINDOWS_SSPI, [1]) |
| 1522 | curl_sspi_msg="enabled" |
Alex Deymo | e3149cc | 2016-10-05 11:18:42 -0700 | [diff] [blame] | 1523 | LIBS="-lcrypt32 $LIBS" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1524 | else |
| 1525 | AC_MSG_RESULT(no) |
| 1526 | fi |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 1527 | test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1528 | else |
| 1529 | AC_MSG_RESULT(no) |
| 1530 | fi |
| 1531 | |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 1532 | OPT_SECURETRANSPORT=no |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1533 | AC_ARG_WITH(darwinssl,dnl |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 1534 | AC_HELP_STRING([--with-darwinssl],[enable Apple OS native SSL/TLS]) |
| 1535 | AC_HELP_STRING([--without-darwinssl], [disable Apple OS native SSL/TLS]), |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 1536 | OPT_SECURETRANSPORT=$withval) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1537 | |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 1538 | AC_ARG_WITH(secure-transport,dnl |
| 1539 | AC_HELP_STRING([--with-secure-transport],[enable Apple OS native SSL/TLS]) |
| 1540 | AC_HELP_STRING([--without-secure-transport], [disable Apple OS native SSL/TLS]), |
| 1541 | OPT_SECURETRANSPORT=$withval) |
| 1542 | |
| 1543 | AC_MSG_CHECKING([whether to enable Secure Transport]) |
| 1544 | if test -z "$ssl_backends" -o "x$OPT_SECURETRANSPORT" != xno; then |
| 1545 | if test "x$OPT_SECURETRANSPORT" != "xno" && |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1546 | test -d "/System/Library/Frameworks/Security.framework"; then |
| 1547 | AC_MSG_RESULT(yes) |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 1548 | AC_DEFINE(USE_SECTRANSP, 1, [enable Secure Transport]) |
| 1549 | AC_SUBST(USE_SECTRANSP, [1]) |
| 1550 | ssl_msg="Secure Transport" |
| 1551 | test secure-transport != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes |
| 1552 | SECURETRANSPORT_ENABLED=1 |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1553 | LDFLAGS="$LDFLAGS -framework CoreFoundation -framework Security" |
| 1554 | else |
| 1555 | AC_MSG_RESULT(no) |
| 1556 | fi |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 1557 | test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1558 | else |
| 1559 | AC_MSG_RESULT(no) |
| 1560 | fi |
| 1561 | |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 1562 | OPT_AMISSL=no |
| 1563 | AC_ARG_WITH(amissl,dnl |
| 1564 | AC_HELP_STRING([--with-amissl],[enable Amiga native SSL/TLS (AmiSSL)]) |
| 1565 | AC_HELP_STRING([--without-amissl], [disable Amiga native SSL/TLS (AmiSSL)]), |
| 1566 | OPT_AMISSL=$withval) |
| 1567 | |
| 1568 | AC_MSG_CHECKING([whether to enable Amiga native SSL/TLS (AmiSSL)]) |
Haibo Huang | 34ab346 | 2019-05-22 00:50:27 -0700 | [diff] [blame] | 1569 | if test "$HAVE_PROTO_BSDSOCKET_H" = "1"; then |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 1570 | if test -z "$ssl_backends" -o "x$OPT_AMISSL" != xno; then |
| 1571 | ssl_msg= |
| 1572 | if test "x$OPT_AMISSL" != "xno"; then |
| 1573 | AC_MSG_RESULT(yes) |
| 1574 | ssl_msg="AmiSSL" |
| 1575 | test amissl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes |
| 1576 | AMISSL_ENABLED=1 |
| 1577 | LIBS="-lamisslauto $LIBS" |
| 1578 | AC_DEFINE(USE_AMISSL, 1, [if AmiSSL is in use]) |
| 1579 | AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use]) |
| 1580 | else |
| 1581 | AC_MSG_RESULT(no) |
| 1582 | fi |
| 1583 | test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" |
| 1584 | else |
| 1585 | AC_MSG_RESULT(no) |
| 1586 | fi |
| 1587 | else |
| 1588 | AC_MSG_RESULT(no) |
| 1589 | fi |
| 1590 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1591 | dnl ********************************************************************** |
| 1592 | dnl Check for the presence of SSL libraries and headers |
| 1593 | dnl ********************************************************************** |
| 1594 | |
| 1595 | dnl Default to compiler & linker defaults for SSL files & libraries. |
| 1596 | OPT_SSL=off |
| 1597 | dnl Default to no CA bundle |
| 1598 | ca="no" |
| 1599 | AC_ARG_WITH(ssl,dnl |
| 1600 | 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]) |
| 1601 | AC_HELP_STRING([--without-ssl], [disable OpenSSL]), |
| 1602 | OPT_SSL=$withval) |
| 1603 | |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 1604 | if test -z "$ssl_backends" -o "x$OPT_SSL" != xno && |
| 1605 | test X"$OPT_SSL" != Xno; then |
| 1606 | ssl_msg= |
| 1607 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1608 | dnl backup the pre-ssl variables |
| 1609 | CLEANLDFLAGS="$LDFLAGS" |
| 1610 | CLEANCPPFLAGS="$CPPFLAGS" |
| 1611 | CLEANLIBS="$LIBS" |
| 1612 | |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 1613 | dnl This is for Msys/Mingw |
| 1614 | case $host in |
| 1615 | *-*-msys* | *-*-mingw*) |
| 1616 | AC_MSG_CHECKING([for gdi32]) |
| 1617 | my_ac_save_LIBS=$LIBS |
| 1618 | LIBS="-lgdi32 $LIBS" |
| 1619 | AC_TRY_LINK([#include <windef.h> |
| 1620 | #include <wingdi.h>], |
| 1621 | [GdiFlush();], |
| 1622 | [ dnl worked! |
| 1623 | AC_MSG_RESULT([yes])], |
| 1624 | [ dnl failed, restore LIBS |
| 1625 | LIBS=$my_ac_save_LIBS |
| 1626 | AC_MSG_RESULT(no)] |
| 1627 | ) |
| 1628 | ;; |
| 1629 | esac |
| 1630 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1631 | case "$OPT_SSL" in |
| 1632 | yes) |
| 1633 | dnl --with-ssl (without path) used |
| 1634 | if test x$cross_compiling != xyes; then |
| 1635 | dnl only do pkg-config magic when not cross-compiling |
| 1636 | PKGTEST="yes" |
| 1637 | fi |
| 1638 | PREFIX_OPENSSL=/usr/local/ssl |
| 1639 | LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff" |
| 1640 | ;; |
| 1641 | off) |
| 1642 | dnl no --with-ssl option given, just check default places |
| 1643 | if test x$cross_compiling != xyes; then |
| 1644 | dnl only do pkg-config magic when not cross-compiling |
| 1645 | PKGTEST="yes" |
| 1646 | fi |
| 1647 | PREFIX_OPENSSL= |
| 1648 | ;; |
| 1649 | *) |
| 1650 | dnl check the given --with-ssl spot |
| 1651 | PKGTEST="no" |
| 1652 | PREFIX_OPENSSL=$OPT_SSL |
| 1653 | |
| 1654 | dnl Try pkg-config even when cross-compiling. Since we |
| 1655 | dnl specify PKG_CONFIG_LIBDIR we're only looking where |
| 1656 | dnl the user told us to look |
| 1657 | OPENSSL_PCDIR="$OPT_SSL/lib/pkgconfig" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1658 | if test -f "$OPENSSL_PCDIR/openssl.pc"; then |
Elliott Hughes | 72d948d | 2018-08-03 14:37:21 -0700 | [diff] [blame] | 1659 | AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$OPENSSL_PCDIR"]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1660 | PKGTEST="yes" |
Elliott Hughes | 72d948d | 2018-08-03 14:37:21 -0700 | [diff] [blame] | 1661 | elif test ! -f "$PREFIX_OPENSSL/include/openssl/ssl.h"; then |
| 1662 | AC_MSG_ERROR([$PREFIX_OPENSSL is a bad --with-ssl prefix!]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1663 | fi |
| 1664 | |
| 1665 | dnl in case pkg-config comes up empty, use what we got |
| 1666 | dnl via --with-ssl |
| 1667 | LIB_OPENSSL="$PREFIX_OPENSSL/lib$libsuff" |
| 1668 | if test "$PREFIX_OPENSSL" != "/usr" ; then |
| 1669 | SSL_LDFLAGS="-L$LIB_OPENSSL" |
| 1670 | SSL_CPPFLAGS="-I$PREFIX_OPENSSL/include" |
| 1671 | fi |
| 1672 | SSL_CPPFLAGS="$SSL_CPPFLAGS -I$PREFIX_OPENSSL/include/openssl" |
| 1673 | ;; |
| 1674 | esac |
| 1675 | |
| 1676 | if test "$PKGTEST" = "yes"; then |
| 1677 | |
| 1678 | CURL_CHECK_PKGCONFIG(openssl, [$OPENSSL_PCDIR]) |
| 1679 | |
| 1680 | if test "$PKGCONFIG" != "no" ; then |
| 1681 | SSL_LIBS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl |
Haibo Huang | 21926d5 | 2019-01-08 14:27:10 -0800 | [diff] [blame] | 1682 | $PKGCONFIG --libs-only-l --libs-only-other openssl 2>/dev/null` |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1683 | |
| 1684 | SSL_LDFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl |
| 1685 | $PKGCONFIG --libs-only-L openssl 2>/dev/null` |
| 1686 | |
| 1687 | SSL_CPPFLAGS=`CURL_EXPORT_PCDIR([$OPENSSL_PCDIR]) dnl |
| 1688 | $PKGCONFIG --cflags-only-I openssl 2>/dev/null` |
| 1689 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1690 | AC_SUBST(SSL_LIBS) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1691 | AC_MSG_NOTICE([pkg-config: SSL_LIBS: "$SSL_LIBS"]) |
| 1692 | AC_MSG_NOTICE([pkg-config: SSL_LDFLAGS: "$SSL_LDFLAGS"]) |
| 1693 | AC_MSG_NOTICE([pkg-config: SSL_CPPFLAGS: "$SSL_CPPFLAGS"]) |
| 1694 | |
| 1695 | LIB_OPENSSL=`echo $SSL_LDFLAGS | sed -e 's/-L//g'` |
| 1696 | |
| 1697 | dnl use the values pkg-config reported. This is here |
| 1698 | dnl instead of below with CPPFLAGS and LDFLAGS because we only |
| 1699 | dnl learn about this via pkg-config. If we only have |
| 1700 | dnl the argument to --with-ssl we don't know what |
| 1701 | dnl additional libs may be necessary. Hope that we |
| 1702 | dnl don't need any. |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1703 | LIBS="$SSL_LIBS $LIBS" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1704 | fi |
| 1705 | fi |
| 1706 | |
| 1707 | dnl finally, set flags to use SSL |
| 1708 | CPPFLAGS="$CPPFLAGS $SSL_CPPFLAGS" |
| 1709 | LDFLAGS="$LDFLAGS $SSL_LDFLAGS" |
| 1710 | |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 1711 | AC_CHECK_LIB(crypto, HMAC_Update,[ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1712 | HAVECRYPTO="yes" |
| 1713 | LIBS="-lcrypto $LIBS" |
| 1714 | ],[ |
| 1715 | LDFLAGS="$CLEANLDFLAGS -L$LIB_OPENSSL" |
Elliott Hughes | b1ef70f | 2018-10-30 11:28:38 -0700 | [diff] [blame] | 1716 | if test "$PKGCONFIG" = "no" ; then |
| 1717 | # only set this if pkg-config wasn't used |
| 1718 | CPPFLAGS="$CLEANCPPFLAGS -I$PREFIX_OPENSSL/include/openssl -I$PREFIX_OPENSSL/include" |
| 1719 | fi |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 1720 | AC_CHECK_LIB(crypto, HMAC_Init_ex,[ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1721 | HAVECRYPTO="yes" |
| 1722 | LIBS="-lcrypto $LIBS"], [ |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 1723 | |
| 1724 | dnl still no, but what about with -ldl? |
| 1725 | AC_MSG_CHECKING([OpenSSL linking with -ldl]) |
Elliott Hughes | 72d948d | 2018-08-03 14:37:21 -0700 | [diff] [blame] | 1726 | LIBS="$CLEANLIBS -lcrypto -ldl" |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 1727 | AC_TRY_LINK( |
| 1728 | [ |
| 1729 | #include <openssl/err.h> |
| 1730 | ], |
| 1731 | [ |
| 1732 | ERR_clear_error(); |
| 1733 | ], |
| 1734 | [ |
| 1735 | AC_MSG_RESULT(yes) |
| 1736 | HAVECRYPTO="yes" |
| 1737 | ], |
| 1738 | [ |
| 1739 | AC_MSG_RESULT(no) |
Elliott Hughes | 72d948d | 2018-08-03 14:37:21 -0700 | [diff] [blame] | 1740 | dnl ok, so what about both -ldl and -lpthread? |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 1741 | |
| 1742 | AC_MSG_CHECKING([OpenSSL linking with -ldl and -lpthread]) |
Elliott Hughes | 72d948d | 2018-08-03 14:37:21 -0700 | [diff] [blame] | 1743 | LIBS="$CLEANLIBS -lcrypto -ldl -lpthread" |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 1744 | AC_TRY_LINK( |
| 1745 | [ |
| 1746 | #include <openssl/err.h> |
| 1747 | ], |
| 1748 | [ |
| 1749 | ERR_clear_error(); |
| 1750 | ], |
| 1751 | [ |
| 1752 | AC_MSG_RESULT(yes) |
| 1753 | HAVECRYPTO="yes" |
| 1754 | ], |
| 1755 | [ |
| 1756 | AC_MSG_RESULT(no) |
| 1757 | LDFLAGS="$CLEANLDFLAGS" |
| 1758 | CPPFLAGS="$CLEANCPPFLAGS" |
| 1759 | LIBS="$CLEANLIBS" |
| 1760 | |
| 1761 | ]) |
| 1762 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1763 | ]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1764 | |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 1765 | ]) |
| 1766 | ]) |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 1767 | |
| 1768 | if test X"$HAVECRYPTO" = X"yes"; then |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1769 | dnl This is only reasonable to do if crypto actually is there: check for |
| 1770 | dnl SSL libs NOTE: it is important to do this AFTER the crypto lib |
| 1771 | |
| 1772 | AC_CHECK_LIB(ssl, SSL_connect) |
| 1773 | |
| 1774 | if test "$ac_cv_lib_ssl_SSL_connect" != yes; then |
| 1775 | dnl we didn't find the SSL lib, try the RSAglue/rsaref stuff |
| 1776 | AC_MSG_CHECKING(for ssl with RSAglue/rsaref libs in use); |
| 1777 | OLIBS=$LIBS |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1778 | LIBS="-lRSAglue -lrsaref $LIBS" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1779 | AC_CHECK_LIB(ssl, SSL_connect) |
| 1780 | if test "$ac_cv_lib_ssl_SSL_connect" != yes; then |
| 1781 | dnl still no SSL_connect |
| 1782 | AC_MSG_RESULT(no) |
| 1783 | LIBS=$OLIBS |
| 1784 | else |
| 1785 | AC_MSG_RESULT(yes) |
| 1786 | fi |
| 1787 | |
| 1788 | else |
| 1789 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1790 | dnl Have the libraries--check for OpenSSL headers |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1791 | AC_CHECK_HEADERS(openssl/x509.h openssl/rsa.h openssl/crypto.h \ |
| 1792 | openssl/pem.h openssl/ssl.h openssl/err.h, |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 1793 | ssl_msg="OpenSSL" |
| 1794 | test openssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1795 | OPENSSL_ENABLED=1 |
| 1796 | AC_DEFINE(USE_OPENSSL, 1, [if OpenSSL is in use])) |
| 1797 | |
| 1798 | if test $ac_cv_header_openssl_x509_h = no; then |
| 1799 | dnl we don't use the "action" part of the AC_CHECK_HEADERS macro |
| 1800 | dnl since 'err.h' might in fact find a krb4 header with the same |
| 1801 | dnl name |
| 1802 | AC_CHECK_HEADERS(x509.h rsa.h crypto.h pem.h ssl.h err.h) |
| 1803 | |
| 1804 | if test $ac_cv_header_x509_h = yes && |
| 1805 | test $ac_cv_header_crypto_h = yes && |
| 1806 | test $ac_cv_header_ssl_h = yes; then |
| 1807 | dnl three matches |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 1808 | ssl_msg="OpenSSL" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1809 | OPENSSL_ENABLED=1 |
| 1810 | fi |
| 1811 | fi |
| 1812 | fi |
| 1813 | |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 1814 | if test X"$OPENSSL_ENABLED" != X"1"; then |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1815 | LIBS="$CLEANLIBS" |
| 1816 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1817 | |
| 1818 | if test X"$OPT_SSL" != Xoff && |
| 1819 | test "$OPENSSL_ENABLED" != "1"; then |
| 1820 | AC_MSG_ERROR([OpenSSL libs and/or directories were not found where specified!]) |
| 1821 | fi |
| 1822 | fi |
| 1823 | |
| 1824 | if test X"$OPENSSL_ENABLED" = X"1"; then |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1825 | dnl These can only exist if OpenSSL exists |
Haibo Huang | 51d9d88 | 2019-02-06 01:36:06 -0800 | [diff] [blame] | 1826 | dnl OpenSSL_version is introduced in 3.0.0 |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1827 | |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 1828 | AC_CHECK_FUNCS( RAND_egd \ |
Haibo Huang | 51d9d88 | 2019-02-06 01:36:06 -0800 | [diff] [blame] | 1829 | SSLv2_client_method \ |
| 1830 | OpenSSL_version ) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1831 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1832 | AC_MSG_CHECKING([for BoringSSL]) |
Bertrand SIMONNET | f551028 | 2015-07-06 14:58:49 -0700 | [diff] [blame] | 1833 | AC_COMPILE_IFELSE([ |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 1834 | AC_LANG_PROGRAM([[ |
| 1835 | #include <openssl/base.h> |
| 1836 | ]],[[ |
| 1837 | #ifndef OPENSSL_IS_BORINGSSL |
| 1838 | #error not boringssl |
| 1839 | #endif |
| 1840 | ]]) |
Bertrand SIMONNET | f551028 | 2015-07-06 14:58:49 -0700 | [diff] [blame] | 1841 | ],[ |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 1842 | AC_MSG_RESULT([yes]) |
| 1843 | AC_DEFINE_UNQUOTED(HAVE_BORINGSSL, 1, |
| 1844 | [Define to 1 if using BoringSSL.]) |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 1845 | ssl_msg="BoringSSL" |
Bertrand SIMONNET | f551028 | 2015-07-06 14:58:49 -0700 | [diff] [blame] | 1846 | ],[ |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 1847 | AC_MSG_RESULT([no]) |
Bertrand SIMONNET | f551028 | 2015-07-06 14:58:49 -0700 | [diff] [blame] | 1848 | ]) |
| 1849 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1850 | AC_MSG_CHECKING([for libressl]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1851 | AC_COMPILE_IFELSE([ |
| 1852 | AC_LANG_PROGRAM([[ |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1853 | #include <openssl/opensslv.h> |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1854 | ]],[[ |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1855 | int dummy = LIBRESSL_VERSION_NUMBER; |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1856 | ]]) |
| 1857 | ],[ |
| 1858 | AC_MSG_RESULT([yes]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1859 | AC_DEFINE_UNQUOTED(HAVE_LIBRESSL, 1, |
| 1860 | [Define to 1 if using libressl.]) |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 1861 | ssl_msg="libressl" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1862 | ],[ |
| 1863 | AC_MSG_RESULT([no]) |
| 1864 | ]) |
| 1865 | fi |
| 1866 | |
| 1867 | if test "$OPENSSL_ENABLED" = "1"; then |
| 1868 | if test -n "$LIB_OPENSSL"; then |
| 1869 | dnl when the ssl shared libs were found in a path that the run-time |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 1870 | dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1871 | dnl to prevent further configure tests to fail due to this |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1872 | if test "x$cross_compiling" != "xyes"; then |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 1873 | CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$LIB_OPENSSL" |
| 1874 | export CURL_LIBRARY_PATH |
| 1875 | AC_MSG_NOTICE([Added $LIB_OPENSSL to CURL_LIBRARY_PATH]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1876 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1877 | fi |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1878 | CURL_CHECK_OPENSSL_API |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 1879 | check_for_ca_bundle=1 |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1880 | fi |
| 1881 | |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 1882 | test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1883 | fi |
| 1884 | |
Haibo Huang | 34ab346 | 2019-05-22 00:50:27 -0700 | [diff] [blame] | 1885 | if test X"$OPT_SSL" != Xoff && |
| 1886 | test X"$OPT_SSL" != Xno && |
| 1887 | test "$OPENSSL_ENABLED" != "1"; then |
| 1888 | AC_MSG_NOTICE([OPT_SSL: $OPT_SSL]) |
| 1889 | AC_MSG_NOTICE([OPENSSL_ENABLED: $OPENSSL_ENABLED]) |
| 1890 | AC_MSG_ERROR([--with-ssl was given but OpenSSL could not be detected]) |
| 1891 | fi |
| 1892 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1893 | dnl ********************************************************************** |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1894 | dnl Check for the random seed preferences |
| 1895 | dnl ********************************************************************** |
| 1896 | |
| 1897 | if test X"$OPENSSL_ENABLED" = X"1"; then |
| 1898 | AC_ARG_WITH(egd-socket, |
| 1899 | AC_HELP_STRING([--with-egd-socket=FILE], |
| 1900 | [Entropy Gathering Daemon socket pathname]), |
| 1901 | [ EGD_SOCKET="$withval" ] |
| 1902 | ) |
| 1903 | if test -n "$EGD_SOCKET" ; then |
| 1904 | AC_DEFINE_UNQUOTED(EGD_SOCKET, "$EGD_SOCKET", |
| 1905 | [your Entropy Gathering Daemon socket pathname] ) |
| 1906 | fi |
| 1907 | |
| 1908 | dnl Check for user-specified random device |
| 1909 | AC_ARG_WITH(random, |
| 1910 | AC_HELP_STRING([--with-random=FILE], |
| 1911 | [read randomness from FILE (default=/dev/urandom)]), |
| 1912 | [ RANDOM_FILE="$withval" ], |
| 1913 | [ |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1914 | if test x$cross_compiling != xyes; then |
| 1915 | dnl Check for random device |
| 1916 | AC_CHECK_FILE("/dev/urandom", [ RANDOM_FILE="/dev/urandom"] ) |
| 1917 | else |
| 1918 | AC_MSG_WARN([skipped the /dev/urandom detection when cross-compiling]) |
| 1919 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1920 | ] |
| 1921 | ) |
| 1922 | if test -n "$RANDOM_FILE" && test X"$RANDOM_FILE" != Xno ; then |
| 1923 | AC_SUBST(RANDOM_FILE) |
| 1924 | AC_DEFINE_UNQUOTED(RANDOM_FILE, "$RANDOM_FILE", |
| 1925 | [a suitable file to read random data from]) |
| 1926 | fi |
| 1927 | fi |
| 1928 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1929 | dnl --- |
| 1930 | dnl We require OpenSSL with SRP support. |
| 1931 | dnl --- |
| 1932 | if test "$OPENSSL_ENABLED" = "1"; then |
| 1933 | AC_CHECK_LIB(crypto, SRP_Calc_client_key, |
| 1934 | [ |
| 1935 | AC_DEFINE(HAVE_OPENSSL_SRP, 1, [if you have the function SRP_Calc_client_key]) |
| 1936 | AC_SUBST(HAVE_OPENSSL_SRP, [1]) |
| 1937 | ]) |
| 1938 | fi |
| 1939 | |
Elliott Hughes | a93fb05 | 2018-12-12 14:22:48 -0800 | [diff] [blame] | 1940 | dnl --- |
| 1941 | dnl Whether the OpenSSL configuration will be loaded automatically |
| 1942 | dnl --- |
| 1943 | if test X"$OPENSSL_ENABLED" = X"1"; then |
| 1944 | AC_ARG_ENABLE(openssl-auto-load-config, |
| 1945 | AC_HELP_STRING([--enable-openssl-auto-load-config],[Enable automatic loading of OpenSSL configuration]) |
| 1946 | AC_HELP_STRING([--disable-openssl-auto-load-config],[Disable automatic loading of OpenSSL configuration]), |
| 1947 | [ if test X"$enableval" = X"no"; then |
| 1948 | AC_MSG_NOTICE([automatic loading of OpenSSL configuration disabled]) |
| 1949 | AC_DEFINE(CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG, 1, [if the OpenSSL configuration won't be loaded automatically]) |
| 1950 | fi |
| 1951 | ]) |
| 1952 | fi |
| 1953 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1954 | dnl ---------------------------------------------------- |
| 1955 | dnl check for GnuTLS |
| 1956 | dnl ---------------------------------------------------- |
| 1957 | |
| 1958 | dnl Default to compiler & linker defaults for GnuTLS files & libraries. |
| 1959 | OPT_GNUTLS=no |
| 1960 | |
| 1961 | AC_ARG_WITH(gnutls,dnl |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1962 | AC_HELP_STRING([--with-gnutls=PATH],[where to look for GnuTLS, PATH points to the installation root]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1963 | AC_HELP_STRING([--without-gnutls], [disable GnuTLS detection]), |
| 1964 | OPT_GNUTLS=$withval) |
| 1965 | |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 1966 | if test -z "$ssl_backends" -o "x$OPT_GNUTLS" != xno; then |
| 1967 | ssl_msg= |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1968 | |
| 1969 | if test X"$OPT_GNUTLS" != Xno; then |
| 1970 | |
| 1971 | addld="" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 1972 | addlib="" |
| 1973 | gtlslib="" |
| 1974 | version="" |
| 1975 | addcflags="" |
| 1976 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 1977 | if test "x$OPT_GNUTLS" = "xyes"; then |
| 1978 | dnl this is with no partiular path given |
| 1979 | CURL_CHECK_PKGCONFIG(gnutls) |
| 1980 | |
| 1981 | if test "$PKGCONFIG" != "no" ; then |
| 1982 | addlib=`$PKGCONFIG --libs-only-l gnutls` |
| 1983 | addld=`$PKGCONFIG --libs-only-L gnutls` |
| 1984 | addcflags=`$PKGCONFIG --cflags-only-I gnutls` |
| 1985 | version=`$PKGCONFIG --modversion gnutls` |
| 1986 | gtlslib=`echo $addld | $SED -e 's/-L//'` |
| 1987 | else |
| 1988 | dnl without pkg-config, we try libgnutls-config as that was how it |
| 1989 | dnl used to be done |
| 1990 | check=`libgnutls-config --version 2>/dev/null` |
| 1991 | if test -n "$check"; then |
| 1992 | addlib=`libgnutls-config --libs` |
| 1993 | addcflags=`libgnutls-config --cflags` |
| 1994 | version=`libgnutls-config --version` |
| 1995 | gtlslib=`libgnutls-config --prefix`/lib$libsuff |
| 1996 | fi |
| 1997 | fi |
| 1998 | else |
| 1999 | dnl this is with a given path, first check if there's a libgnutls-config |
| 2000 | dnl there and if not, make an educated guess |
| 2001 | cfg=$OPT_GNUTLS/bin/libgnutls-config |
| 2002 | check=`$cfg --version 2>/dev/null` |
| 2003 | if test -n "$check"; then |
| 2004 | addlib=`$cfg --libs` |
| 2005 | addcflags=`$cfg --cflags` |
| 2006 | version=`$cfg --version` |
| 2007 | gtlslib=`$cfg --prefix`/lib$libsuff |
| 2008 | else |
| 2009 | dnl without pkg-config and libgnutls-config, we guess a lot! |
| 2010 | addlib=-lgnutls |
| 2011 | addld=-L$OPT_GNUTLS/lib$libsuff |
| 2012 | addcflags=-I$OPT_GNUTLS/include |
| 2013 | version="" # we just don't know |
| 2014 | gtlslib=$OPT_GNUTLS/lib$libsuff |
| 2015 | fi |
| 2016 | fi |
| 2017 | |
| 2018 | if test -z "$version"; then |
| 2019 | dnl lots of efforts, still no go |
| 2020 | version="unknown" |
| 2021 | fi |
| 2022 | |
| 2023 | if test -n "$addlib"; then |
| 2024 | |
| 2025 | CLEANLIBS="$LIBS" |
| 2026 | CLEANCPPFLAGS="$CPPFLAGS" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2027 | CLEANLDFLAGS="$LDFLAGS" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2028 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2029 | LIBS="$addlib $LIBS" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2030 | LDFLAGS="$LDFLAGS $addld" |
| 2031 | if test "$addcflags" != "-I/usr/include"; then |
| 2032 | CPPFLAGS="$CPPFLAGS $addcflags" |
| 2033 | fi |
| 2034 | |
| 2035 | AC_CHECK_LIB(gnutls, gnutls_check_version, |
| 2036 | [ |
| 2037 | AC_DEFINE(USE_GNUTLS, 1, [if GnuTLS is enabled]) |
| 2038 | AC_SUBST(USE_GNUTLS, [1]) |
| 2039 | GNUTLS_ENABLED=1 |
| 2040 | USE_GNUTLS="yes" |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2041 | ssl_msg="GnuTLS" |
| 2042 | test gnutls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2043 | ], |
| 2044 | [ |
| 2045 | LIBS="$CLEANLIBS" |
| 2046 | CPPFLAGS="$CLEANCPPFLAGS" |
| 2047 | ]) |
| 2048 | |
| 2049 | if test "x$USE_GNUTLS" = "xyes"; then |
| 2050 | AC_MSG_NOTICE([detected GnuTLS version $version]) |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2051 | check_for_ca_bundle=1 |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2052 | if test -n "$gtlslib"; then |
| 2053 | dnl when shared libs were found in a path that the run-time |
| 2054 | dnl linker doesn't search through, we need to add it to |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2055 | dnl CURL_LIBRARY_PATH to prevent further configure tests to fail |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2056 | dnl due to this |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2057 | if test "x$cross_compiling" != "xyes"; then |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2058 | CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$gtlslib" |
| 2059 | export CURL_LIBRARY_PATH |
| 2060 | AC_MSG_NOTICE([Added $gtlslib to CURL_LIBRARY_PATH]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2061 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2062 | fi |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 2063 | AC_CHECK_FUNCS([gnutls_certificate_set_x509_key_file2 gnutls_alpn_set_protocols gnutls_ocsp_req_init]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2064 | fi |
| 2065 | |
| 2066 | fi |
| 2067 | |
| 2068 | fi dnl GNUTLS not disabled |
| 2069 | |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2070 | test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2071 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2072 | |
| 2073 | dnl --- |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2074 | dnl Check which crypto backend GnuTLS uses |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2075 | dnl --- |
| 2076 | |
| 2077 | if test "$GNUTLS_ENABLED" = "1"; then |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2078 | USE_GNUTLS_NETTLE= |
| 2079 | # First check if we can detect either crypto library via transitive linking |
| 2080 | AC_CHECK_LIB(gnutls, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ]) |
| 2081 | if test "$USE_GNUTLS_NETTLE" = ""; then |
| 2082 | AC_CHECK_LIB(gnutls, gcry_control, [ USE_GNUTLS_NETTLE=0 ]) |
| 2083 | fi |
| 2084 | # If not, try linking directly to both of them to see if they are available |
| 2085 | if test "$USE_GNUTLS_NETTLE" = ""; then |
| 2086 | AC_CHECK_LIB(nettle, nettle_MD5Init, [ USE_GNUTLS_NETTLE=1 ]) |
| 2087 | fi |
| 2088 | if test "$USE_GNUTLS_NETTLE" = ""; then |
| 2089 | AC_CHECK_LIB(gcrypt, gcry_control, [ USE_GNUTLS_NETTLE=0 ]) |
| 2090 | fi |
| 2091 | if test "$USE_GNUTLS_NETTLE" = ""; then |
| 2092 | AC_MSG_ERROR([GnuTLS found, but neither gcrypt nor nettle found]) |
| 2093 | fi |
| 2094 | if test "$USE_GNUTLS_NETTLE" = "1"; then |
| 2095 | AC_DEFINE(USE_GNUTLS_NETTLE, 1, [if GnuTLS uses nettle as crypto backend]) |
| 2096 | AC_SUBST(USE_GNUTLS_NETTLE, [1]) |
| 2097 | LIBS="-lnettle $LIBS" |
| 2098 | else |
| 2099 | LIBS="-lgcrypt $LIBS" |
| 2100 | fi |
| 2101 | fi |
| 2102 | |
| 2103 | dnl --- |
| 2104 | dnl We require GnuTLS with SRP support. |
| 2105 | dnl --- |
| 2106 | if test "$GNUTLS_ENABLED" = "1"; then |
| 2107 | AC_CHECK_LIB(gnutls, gnutls_srp_verifier, |
| 2108 | [ |
| 2109 | AC_DEFINE(HAVE_GNUTLS_SRP, 1, [if you have the function gnutls_srp_verifier]) |
| 2110 | AC_SUBST(HAVE_GNUTLS_SRP, [1]) |
| 2111 | ]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2112 | fi |
| 2113 | |
| 2114 | dnl ---------------------------------------------------- |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 2115 | dnl check for mbedTLS |
| 2116 | dnl ---------------------------------------------------- |
| 2117 | |
| 2118 | OPT_MBEDTLS=no |
| 2119 | |
| 2120 | _cppflags=$CPPFLAGS |
| 2121 | _ldflags=$LDFLAGS |
| 2122 | AC_ARG_WITH(mbedtls,dnl |
| 2123 | AC_HELP_STRING([--with-mbedtls=PATH],[where to look for mbedTLS, PATH points to the installation root]) |
| 2124 | AC_HELP_STRING([--without-mbedtls], [disable mbedTLS detection]), |
| 2125 | OPT_MBEDTLS=$withval) |
| 2126 | |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2127 | if test -z "$ssl_backends" -o "x$OPT_MBEDTLS" != xno; then |
| 2128 | ssl_msg= |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 2129 | |
| 2130 | if test X"$OPT_MBEDTLS" != Xno; then |
| 2131 | |
| 2132 | if test "$OPT_MBEDTLS" = "yes"; then |
| 2133 | OPT_MBEDTLS="" |
| 2134 | fi |
| 2135 | |
| 2136 | if test -z "$OPT_MBEDTLS" ; then |
| 2137 | dnl check for lib first without setting any new path |
| 2138 | |
| 2139 | AC_CHECK_LIB(mbedtls, mbedtls_havege_init, |
| 2140 | dnl libmbedtls found, set the variable |
| 2141 | [ |
| 2142 | AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled]) |
| 2143 | AC_SUBST(USE_MBEDTLS, [1]) |
| 2144 | MBEDTLS_ENABLED=1 |
| 2145 | USE_MBEDTLS="yes" |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2146 | ssl_msg="mbedTLS" |
| 2147 | test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 2148 | ], [], -lmbedx509 -lmbedcrypto) |
| 2149 | fi |
| 2150 | |
| 2151 | addld="" |
| 2152 | addlib="" |
| 2153 | addcflags="" |
| 2154 | mbedtlslib="" |
| 2155 | |
| 2156 | if test "x$USE_MBEDTLS" != "xyes"; then |
| 2157 | dnl add the path and test again |
| 2158 | addld=-L$OPT_MBEDTLS/lib$libsuff |
| 2159 | addcflags=-I$OPT_MBEDTLS/include |
| 2160 | mbedtlslib=$OPT_MBEDTLS/lib$libsuff |
| 2161 | |
| 2162 | LDFLAGS="$LDFLAGS $addld" |
| 2163 | if test "$addcflags" != "-I/usr/include"; then |
| 2164 | CPPFLAGS="$CPPFLAGS $addcflags" |
| 2165 | fi |
| 2166 | |
| 2167 | AC_CHECK_LIB(mbedtls, mbedtls_ssl_init, |
| 2168 | [ |
| 2169 | AC_DEFINE(USE_MBEDTLS, 1, [if mbedTLS is enabled]) |
| 2170 | AC_SUBST(USE_MBEDTLS, [1]) |
| 2171 | MBEDTLS_ENABLED=1 |
| 2172 | USE_MBEDTLS="yes" |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2173 | ssl_msg="mbedTLS" |
| 2174 | test mbedtls != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 2175 | ], |
| 2176 | [ |
| 2177 | CPPFLAGS=$_cppflags |
| 2178 | LDFLAGS=$_ldflags |
| 2179 | ], -lmbedx509 -lmbedcrypto) |
| 2180 | fi |
| 2181 | |
| 2182 | if test "x$USE_MBEDTLS" = "xyes"; then |
| 2183 | AC_MSG_NOTICE([detected mbedTLS]) |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2184 | check_for_ca_bundle=1 |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 2185 | |
| 2186 | LIBS="-lmbedtls -lmbedx509 -lmbedcrypto $LIBS" |
| 2187 | |
| 2188 | if test -n "$mbedtlslib"; then |
| 2189 | dnl when shared libs were found in a path that the run-time |
| 2190 | dnl linker doesn't search through, we need to add it to |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2191 | dnl CURL_LIBRARY_PATH to prevent further configure tests to fail |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 2192 | dnl due to this |
| 2193 | if test "x$cross_compiling" != "xyes"; then |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2194 | CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$mbedtlslib" |
| 2195 | export CURL_LIBRARY_PATH |
| 2196 | AC_MSG_NOTICE([Added $mbedtlslib to CURL_LIBRARY_PATH]) |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 2197 | fi |
| 2198 | fi |
| 2199 | fi |
| 2200 | |
| 2201 | fi dnl mbedTLS not disabled |
| 2202 | |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2203 | test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 2204 | fi |
| 2205 | |
| 2206 | dnl ---------------------------------------------------- |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 2207 | dnl check for wolfSSL |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2208 | dnl ---------------------------------------------------- |
| 2209 | |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 2210 | dnl Default to compiler & linker defaults for wolfSSL files & libraries. |
| 2211 | OPT_WOLFSSL=no |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2212 | |
| 2213 | _cppflags=$CPPFLAGS |
| 2214 | _ldflags=$LDFLAGS |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2215 | |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2216 | AC_ARG_WITH(wolfssl,dnl |
| 2217 | AC_HELP_STRING([--with-wolfssl=PATH],[where to look for WolfSSL, PATH points to the installation root (default: system lib default)]) |
| 2218 | AC_HELP_STRING([--without-wolfssl], [disable WolfSSL detection]), |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 2219 | OPT_WOLFSSL=$withval) |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2220 | |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 2221 | if test -z "$ssl_backends" -o "x$OPT_WOLFSSL" != xno; then |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2222 | ssl_msg= |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2223 | |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 2224 | if test X"$OPT_WOLFSSL" != Xno; then |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2225 | |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 2226 | if test "$OPT_WOLFSSL" = "yes"; then |
| 2227 | OPT_WOLFSSL="" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2228 | fi |
| 2229 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2230 | addld="" |
| 2231 | addlib="" |
| 2232 | addcflags="" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2233 | |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 2234 | if test "x$USE_WOLFSSL" != "xyes"; then |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 2235 | addld=-L$OPT_WOLFSSL/lib$libsuff |
| 2236 | addcflags=-I$OPT_WOLFSSL/include |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 2237 | wolfssllibpath=$OPT_WOLFSSL/lib$libsuff |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2238 | |
| 2239 | LDFLAGS="$LDFLAGS $addld" |
| 2240 | if test "$addcflags" != "-I/usr/include"; then |
| 2241 | CPPFLAGS="$CPPFLAGS $addcflags" |
| 2242 | fi |
| 2243 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2244 | my_ac_save_LIBS="$LIBS" |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 2245 | LIBS="-lwolfssl -lm $LIBS" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2246 | |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 2247 | AC_MSG_CHECKING([for wolfSSL_Init in -lwolfssl]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2248 | AC_LINK_IFELSE([ |
| 2249 | AC_LANG_PROGRAM([[ |
| 2250 | /* These aren't needed for detection and confuse WolfSSL. |
| 2251 | They are set up properly later if it is detected. */ |
| 2252 | #undef SIZEOF_LONG |
| 2253 | #undef SIZEOF_LONG_LONG |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 2254 | #include <wolfssl/ssl.h> |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2255 | ]],[[ |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 2256 | return wolfSSL_Init(); |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2257 | ]]) |
| 2258 | ],[ |
| 2259 | AC_MSG_RESULT(yes) |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 2260 | AC_DEFINE(USE_WOLFSSL, 1, [if wolfSSL is enabled]) |
| 2261 | AC_SUBST(USE_WOLFSSL, [1]) |
| 2262 | WOLFSSL_ENABLED=1 |
| 2263 | USE_WOLFSSL="yes" |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2264 | ssl_msg="WolfSSL" |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 2265 | test wolfssl != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2266 | ], |
| 2267 | [ |
| 2268 | AC_MSG_RESULT(no) |
| 2269 | CPPFLAGS=$_cppflags |
| 2270 | LDFLAGS=$_ldflags |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 2271 | wolfssllibpath="" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2272 | ]) |
| 2273 | LIBS="$my_ac_save_LIBS" |
| 2274 | fi |
| 2275 | |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 2276 | if test "x$USE_WOLFSSL" = "xyes"; then |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 2277 | AC_MSG_NOTICE([detected wolfSSL]) |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2278 | check_for_ca_bundle=1 |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2279 | |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 2280 | dnl wolfssl/ctaocrypt/types.h needs SIZEOF_LONG_LONG defined! |
Elliott Hughes | 72d948d | 2018-08-03 14:37:21 -0700 | [diff] [blame] | 2281 | AX_COMPILE_CHECK_SIZEOF(long long) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2282 | |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 2283 | LIBS="-lwolfssl -lm $LIBS" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2284 | |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 2285 | dnl Recent WolfSSL versions build without SSLv3 by default |
| 2286 | dnl WolfSSL needs configure --enable-opensslextra to have *get_peer* |
| 2287 | AC_CHECK_FUNCS(wolfSSLv3_client_method \ |
| 2288 | wolfSSL_get_peer_certificate \ |
| 2289 | wolfSSL_UseALPN) |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 2290 | |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 2291 | if test -n "$wolfssllibpath"; then |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2292 | dnl when shared libs were found in a path that the run-time |
| 2293 | dnl linker doesn't search through, we need to add it to |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2294 | dnl CURL_LIBRARY_PATH to prevent further configure tests to fail |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2295 | dnl due to this |
| 2296 | if test "x$cross_compiling" != "xyes"; then |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 2297 | CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$wolfssllibpath" |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2298 | export CURL_LIBRARY_PATH |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 2299 | AC_MSG_NOTICE([Added $wolfssllibpath to CURL_LIBRARY_PATH]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2300 | fi |
| 2301 | fi |
| 2302 | |
| 2303 | fi |
| 2304 | |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 2305 | fi dnl wolfSSL not disabled |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2306 | |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2307 | test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2308 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2309 | |
| 2310 | dnl ---------------------------------------------------- |
Elliott Hughes | a93fb05 | 2018-12-12 14:22:48 -0800 | [diff] [blame] | 2311 | dnl check for MesaLink |
| 2312 | dnl ---------------------------------------------------- |
| 2313 | |
| 2314 | dnl Default to compiler & linker defaults for MesaLink files & libraries. |
| 2315 | OPT_MESALINK=no |
| 2316 | |
| 2317 | _cppflags=$CPPFLAGS |
| 2318 | _ldflags=$LDFLAGS |
| 2319 | AC_ARG_WITH(mesalink,dnl |
| 2320 | AC_HELP_STRING([--with-mesalink=PATH],[where to look for MesaLink, PATH points to the installation root]) |
| 2321 | AC_HELP_STRING([--without-mesalink], [disable MesaLink detection]), |
| 2322 | OPT_MESALINK=$withval) |
| 2323 | |
| 2324 | if test -z "$ssl_backends" -o "x$OPT_MESALINK" != xno; then |
| 2325 | ssl_msg= |
| 2326 | |
| 2327 | if test X"$OPT_MESALINK" != Xno; then |
| 2328 | |
| 2329 | if test "$OPT_MESALINK" = "yes"; then |
| 2330 | OPT_MESALINK="" |
| 2331 | fi |
| 2332 | |
| 2333 | if test -z "$OPT_MESALINK" ; then |
| 2334 | dnl check for lib first without setting any new path |
| 2335 | |
| 2336 | AC_CHECK_LIB(mesalink, mesalink_library_init, |
| 2337 | dnl libmesalink found, set the variable |
| 2338 | [ |
| 2339 | AC_DEFINE(USE_MESALINK, 1, [if MesaLink is enabled]) |
| 2340 | AC_SUBST(USE_MESALINK, [1]) |
| 2341 | MESALINK_ENABLED=1 |
| 2342 | USE_MESALINK="yes" |
| 2343 | ssl_msg="MesaLink" |
| 2344 | test mesalink != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes |
| 2345 | ]) |
| 2346 | fi |
| 2347 | |
| 2348 | addld="" |
| 2349 | addlib="" |
| 2350 | addcflags="" |
| 2351 | mesalinklib="" |
| 2352 | |
| 2353 | if test "x$USE_MESALINK" != "xyes"; then |
| 2354 | dnl add the path and test again |
| 2355 | addld=-L$OPT_MESALINK/lib$libsuff |
| 2356 | addcflags=-I$OPT_MESALINK/include |
| 2357 | mesalinklib=$OPT_MESALINK/lib$libsuff |
| 2358 | |
| 2359 | LDFLAGS="$LDFLAGS $addld" |
| 2360 | if test "$addcflags" != "-I/usr/include"; then |
| 2361 | CPPFLAGS="$CPPFLAGS $addcflags" |
| 2362 | fi |
| 2363 | |
| 2364 | AC_CHECK_LIB(mesalink, mesalink_library_init, |
| 2365 | [ |
| 2366 | AC_DEFINE(USE_MESALINK, 1, [if MesaLink is enabled]) |
| 2367 | AC_SUBST(USE_MESALINK, [1]) |
| 2368 | MESALINK_ENABLED=1 |
| 2369 | USE_MESALINK="yes" |
| 2370 | ssl_msg="MesaLink" |
| 2371 | test mesalink != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes |
| 2372 | ], |
| 2373 | [ |
| 2374 | CPPFLAGS=$_cppflags |
| 2375 | LDFLAGS=$_ldflags |
| 2376 | ]) |
| 2377 | fi |
| 2378 | |
| 2379 | if test "x$USE_MESALINK" = "xyes"; then |
| 2380 | AC_MSG_NOTICE([detected MesaLink]) |
| 2381 | |
| 2382 | LIBS="-lmesalink $LIBS" |
| 2383 | |
| 2384 | if test -n "$mesalinklib"; then |
| 2385 | dnl when shared libs were found in a path that the run-time |
| 2386 | dnl linker doesn't search through, we need to add it to |
| 2387 | dnl LD_LIBRARY_PATH to prevent further configure tests to fail |
| 2388 | dnl due to this |
| 2389 | if test "x$cross_compiling" != "xyes"; then |
| 2390 | LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$mesalinklib" |
| 2391 | export LD_LIBRARY_PATH |
| 2392 | AC_MSG_NOTICE([Added $mesalinklib to LD_LIBRARY_PATH]) |
| 2393 | fi |
| 2394 | fi |
| 2395 | fi |
| 2396 | |
| 2397 | fi dnl MesaLink not disabled |
| 2398 | |
| 2399 | test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" |
| 2400 | fi |
| 2401 | |
| 2402 | dnl ---------------------------------------------------- |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2403 | dnl NSS. Only check if GnuTLS and OpenSSL are not enabled |
| 2404 | dnl ---------------------------------------------------- |
| 2405 | |
| 2406 | dnl Default to compiler & linker defaults for NSS files & libraries. |
| 2407 | OPT_NSS=no |
| 2408 | |
| 2409 | AC_ARG_WITH(nss,dnl |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2410 | AC_HELP_STRING([--with-nss=PATH],[where to look for NSS, PATH points to the installation root]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2411 | AC_HELP_STRING([--without-nss], [disable NSS detection]), |
| 2412 | OPT_NSS=$withval) |
| 2413 | |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2414 | if test -z "$ssl_backends" -o "x$OPT_NSS" != xno; then |
| 2415 | ssl_msg= |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2416 | |
| 2417 | if test X"$OPT_NSS" != Xno; then |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2418 | |
| 2419 | addld="" |
| 2420 | addlib="" |
| 2421 | addcflags="" |
| 2422 | nssprefix="" |
| 2423 | version="" |
| 2424 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2425 | if test "x$OPT_NSS" = "xyes"; then |
| 2426 | |
| 2427 | CURL_CHECK_PKGCONFIG(nss) |
| 2428 | |
| 2429 | if test "$PKGCONFIG" != "no" ; then |
| 2430 | addlib=`$PKGCONFIG --libs nss` |
| 2431 | addcflags=`$PKGCONFIG --cflags nss` |
| 2432 | version=`$PKGCONFIG --modversion nss` |
| 2433 | nssprefix=`$PKGCONFIG --variable=prefix nss` |
| 2434 | else |
| 2435 | dnl Without pkg-config, we check for nss-config |
| 2436 | |
| 2437 | check=`nss-config --version 2>/dev/null` |
| 2438 | if test -n "$check"; then |
| 2439 | addlib=`nss-config --libs` |
| 2440 | addcflags=`nss-config --cflags` |
| 2441 | version=`nss-config --version` |
| 2442 | nssprefix=`nss-config --prefix` |
| 2443 | else |
| 2444 | addlib="-lnss3" |
| 2445 | addcflags="" |
| 2446 | version="unknown" |
| 2447 | fi |
| 2448 | fi |
| 2449 | else |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2450 | NSS_PCDIR="$OPT_NSS/lib/pkgconfig" |
| 2451 | if test -f "$NSS_PCDIR/nss.pc"; then |
| 2452 | CURL_CHECK_PKGCONFIG(nss, [$NSS_PCDIR]) |
| 2453 | if test "$PKGCONFIG" != "no" ; then |
| 2454 | addld=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-L nss` |
| 2455 | addlib=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --libs-only-l nss` |
| 2456 | addcflags=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --cflags nss` |
| 2457 | version=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --modversion nss` |
| 2458 | nssprefix=`CURL_EXPORT_PCDIR([$NSS_PCDIR]) $PKGCONFIG --variable=prefix nss` |
| 2459 | fi |
| 2460 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2461 | fi |
| 2462 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2463 | if test -z "$addlib"; then |
| 2464 | # Without pkg-config, we'll kludge in some defaults |
| 2465 | AC_MSG_WARN([Using hard-wired libraries and compilation flags for NSS.]) |
| 2466 | addld="-L$OPT_NSS/lib" |
| 2467 | addlib="-lssl3 -lsmime3 -lnss3 -lplds4 -lplc4 -lnspr4" |
| 2468 | addcflags="-I$OPT_NSS/include" |
| 2469 | version="unknown" |
| 2470 | nssprefix=$OPT_NSS |
| 2471 | fi |
| 2472 | |
| 2473 | CLEANLDFLAGS="$LDFLAGS" |
| 2474 | CLEANLIBS="$LIBS" |
| 2475 | CLEANCPPFLAGS="$CPPFLAGS" |
| 2476 | |
| 2477 | LDFLAGS="$addld $LDFLAGS" |
| 2478 | LIBS="$addlib $LIBS" |
| 2479 | if test "$addcflags" != "-I/usr/include"; then |
| 2480 | CPPFLAGS="$CPPFLAGS $addcflags" |
| 2481 | fi |
| 2482 | |
| 2483 | dnl The function SSL_VersionRangeSet() is needed to enable TLS > 1.0 |
| 2484 | AC_CHECK_LIB(nss3, SSL_VersionRangeSet, |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2485 | [ |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2486 | AC_DEFINE(USE_NSS, 1, [if NSS is enabled]) |
| 2487 | AC_SUBST(USE_NSS, [1]) |
| 2488 | USE_NSS="yes" |
| 2489 | NSS_ENABLED=1 |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2490 | ssl_msg="NSS" |
| 2491 | test nss != "$DEFAULT_SSL_BACKEND" || VALID_DEFAULT_SSL_BACKEND=yes |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2492 | ], |
| 2493 | [ |
| 2494 | LDFLAGS="$CLEANLDFLAGS" |
| 2495 | LIBS="$CLEANLIBS" |
| 2496 | CPPFLAGS="$CLEANCPPFLAGS" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2497 | ]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2498 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2499 | if test "x$USE_NSS" = "xyes"; then |
| 2500 | AC_MSG_NOTICE([detected NSS version $version]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2501 | |
Elliott Hughes | cac3980 | 2018-04-27 16:19:43 -0700 | [diff] [blame] | 2502 | dnl PK11_CreateManagedGenericObject() was introduced in NSS 3.34 because |
| 2503 | dnl PK11_DestroyGenericObject() does not release resources allocated by |
| 2504 | dnl PK11_CreateGenericObject() early enough. |
| 2505 | AC_CHECK_FUNC(PK11_CreateManagedGenericObject, |
| 2506 | [ |
| 2507 | AC_DEFINE(HAVE_PK11_CREATEMANAGEDGENERICOBJECT, 1, |
| 2508 | [if you have the PK11_CreateManagedGenericObject function]) |
| 2509 | ]) |
| 2510 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2511 | dnl needed when linking the curl tool without USE_EXPLICIT_LIB_DEPS |
| 2512 | NSS_LIBS=$addlib |
| 2513 | AC_SUBST([NSS_LIBS]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2514 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2515 | dnl when shared libs were found in a path that the run-time |
| 2516 | dnl linker doesn't search through, we need to add it to |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2517 | dnl CURL_LIBRARY_PATH to prevent further configure tests to fail |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2518 | dnl due to this |
| 2519 | if test "x$cross_compiling" != "xyes"; then |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2520 | CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$nssprefix/lib$libsuff" |
| 2521 | export CURL_LIBRARY_PATH |
| 2522 | AC_MSG_NOTICE([Added $nssprefix/lib$libsuff to CURL_LIBRARY_PATH]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2523 | fi |
| 2524 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2525 | fi dnl NSS found |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2526 | |
| 2527 | fi dnl NSS not disabled |
| 2528 | |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2529 | test -z "$ssl_msg" || ssl_backends="${ssl_backends:+$ssl_backends, }$ssl_msg" |
| 2530 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2531 | |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 2532 | case "x$OPENSSL_ENABLED$GNUTLS_ENABLED$NSS_ENABLED$MBEDTLS_ENABLED$WOLFSSL_ENABLED$WINSSL_ENABLED$SECURETRANSPORT_ENABLED$MESALINK_ENABLED$AMISSL_ENABLED" in |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2533 | x) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2534 | AC_MSG_WARN([SSL disabled, you will not be able to use HTTPS, FTPS, NTLM and more.]) |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 2535 | AC_MSG_WARN([Use --with-ssl, --with-gnutls, --with-wolfssl, --with-mbedtls, --with-nss, --with-schannel, --with-secure-transport, --with-mesalink or --with-amissl to address this.]) |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2536 | ;; |
| 2537 | x1) |
| 2538 | # one SSL backend is enabled |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2539 | AC_SUBST(SSL_ENABLED) |
| 2540 | SSL_ENABLED="1" |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2541 | AC_MSG_NOTICE([built with one SSL backend]) |
| 2542 | ;; |
| 2543 | *) |
| 2544 | # more than one SSL backend is enabled |
| 2545 | AC_SUBST(SSL_ENABLED) |
| 2546 | SSL_ENABLED="1" |
| 2547 | AC_SUBST(CURL_WITH_MULTI_SSL) |
| 2548 | CURL_WITH_MULTI_SSL="1" |
| 2549 | AC_DEFINE(CURL_WITH_MULTI_SSL, 1, [built with multiple SSL backends]) |
| 2550 | AC_MSG_NOTICE([built with multiple SSL backends]) |
| 2551 | ;; |
| 2552 | esac |
| 2553 | |
| 2554 | if test -n "$ssl_backends"; then |
| 2555 | curl_ssl_msg="enabled ($ssl_backends)" |
| 2556 | fi |
| 2557 | |
| 2558 | if test no = "$VALID_DEFAULT_SSL_BACKEND" |
| 2559 | then |
| 2560 | if test -n "$SSL_ENABLED" |
| 2561 | then |
| 2562 | AC_MSG_ERROR([Default SSL backend $DEFAULT_SSL_BACKEND not enabled!]) |
| 2563 | else |
| 2564 | AC_MSG_ERROR([Default SSL backend requires SSL!]) |
| 2565 | fi |
| 2566 | elif test yes = "$VALID_DEFAULT_SSL_BACKEND" |
| 2567 | then |
| 2568 | AC_DEFINE_UNQUOTED([CURL_DEFAULT_SSL_BACKEND], ["$DEFAULT_SSL_BACKEND"], [Default SSL backend]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2569 | fi |
| 2570 | |
| 2571 | dnl ********************************************************************** |
| 2572 | dnl Check for the CA bundle |
| 2573 | dnl ********************************************************************** |
| 2574 | |
Haibo Huang | 445085a | 2019-09-11 13:33:50 -0700 | [diff] [blame] | 2575 | if test -n "$check_for_ca_bundle"; then |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2576 | CURL_CHECK_CA_BUNDLE |
| 2577 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2578 | |
| 2579 | dnl ********************************************************************** |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 2580 | dnl Check for libpsl |
| 2581 | dnl ********************************************************************** |
| 2582 | |
| 2583 | AC_ARG_WITH(libpsl, |
| 2584 | AS_HELP_STRING([--without-libpsl], |
| 2585 | [disable support for libpsl cookie checking]), |
| 2586 | with_libpsl=$withval, |
| 2587 | with_libpsl=yes) |
| 2588 | if test $with_libpsl != "no"; then |
| 2589 | AC_SEARCH_LIBS(psl_builtin, psl, |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 2590 | [curl_psl_msg="enabled"; |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 2591 | AC_DEFINE([USE_LIBPSL], [1], [PSL support enabled]) |
| 2592 | ], |
| 2593 | [curl_psl_msg="no (libpsl not found)"; |
| 2594 | AC_MSG_WARN([libpsl was not found]) |
| 2595 | ] |
| 2596 | ) |
| 2597 | fi |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 2598 | AM_CONDITIONAL([USE_LIBPSL], [test "$curl_psl_msg" = "enabled"]) |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 2599 | |
| 2600 | dnl ********************************************************************** |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2601 | dnl Check for libmetalink |
| 2602 | dnl ********************************************************************** |
| 2603 | |
| 2604 | OPT_LIBMETALINK=no |
| 2605 | |
| 2606 | AC_ARG_WITH(libmetalink,dnl |
| 2607 | AC_HELP_STRING([--with-libmetalink=PATH],[where to look for libmetalink, PATH points to the installation root]) |
| 2608 | AC_HELP_STRING([--without-libmetalink], [disable libmetalink detection]), |
| 2609 | OPT_LIBMETALINK=$withval) |
| 2610 | |
| 2611 | if test X"$OPT_LIBMETALINK" != Xno; then |
| 2612 | |
| 2613 | addld="" |
| 2614 | addlib="" |
| 2615 | addcflags="" |
| 2616 | version="" |
| 2617 | libmetalinklib="" |
| 2618 | |
| 2619 | PKGTEST="no" |
| 2620 | if test "x$OPT_LIBMETALINK" = "xyes"; then |
| 2621 | dnl this is with no partiular path given |
| 2622 | PKGTEST="yes" |
| 2623 | CURL_CHECK_PKGCONFIG(libmetalink) |
| 2624 | else |
| 2625 | dnl When particular path is given, set PKG_CONFIG_LIBDIR using the path. |
| 2626 | LIBMETALINK_PCDIR="$OPT_LIBMETALINK/lib/pkgconfig" |
| 2627 | AC_MSG_NOTICE([PKG_CONFIG_LIBDIR will be set to "$LIBMETALINK_PCDIR"]) |
| 2628 | if test -f "$LIBMETALINK_PCDIR/libmetalink.pc"; then |
| 2629 | PKGTEST="yes" |
| 2630 | fi |
| 2631 | if test "$PKGTEST" = "yes"; then |
| 2632 | CURL_CHECK_PKGCONFIG(libmetalink, [$LIBMETALINK_PCDIR]) |
| 2633 | fi |
| 2634 | fi |
| 2635 | if test "$PKGTEST" = "yes" && test "$PKGCONFIG" != "no"; then |
| 2636 | addlib=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl |
| 2637 | $PKGCONFIG --libs-only-l libmetalink` |
| 2638 | addld=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl |
| 2639 | $PKGCONFIG --libs-only-L libmetalink` |
| 2640 | addcflags=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl |
| 2641 | $PKGCONFIG --cflags-only-I libmetalink` |
| 2642 | version=`CURL_EXPORT_PCDIR([$LIBMETALINK_PCDIR]) dnl |
| 2643 | $PKGCONFIG --modversion libmetalink` |
| 2644 | libmetalinklib=`echo $addld | $SED -e 's/-L//'` |
| 2645 | fi |
| 2646 | if test -n "$addlib"; then |
| 2647 | |
| 2648 | clean_CPPFLAGS="$CPPFLAGS" |
| 2649 | clean_LDFLAGS="$LDFLAGS" |
| 2650 | clean_LIBS="$LIBS" |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 2651 | CPPFLAGS="$clean_CPPFLAGS $addcflags" |
| 2652 | LDFLAGS="$clean_LDFLAGS $addld" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2653 | LIBS="$addlib $clean_LIBS" |
| 2654 | AC_MSG_CHECKING([if libmetalink is recent enough]) |
| 2655 | AC_LINK_IFELSE([ |
| 2656 | AC_LANG_PROGRAM([[ |
| 2657 | # include <metalink/metalink.h> |
| 2658 | ]],[[ |
| 2659 | if(0 != metalink_strerror(0)) /* added in 0.1.0 */ |
| 2660 | return 1; |
| 2661 | ]]) |
| 2662 | ],[ |
| 2663 | AC_MSG_RESULT([yes ($version)]) |
| 2664 | want_metalink="yes" |
| 2665 | ],[ |
| 2666 | AC_MSG_RESULT([no ($version)]) |
| 2667 | AC_MSG_NOTICE([libmetalink library defective or too old]) |
| 2668 | want_metalink="no" |
| 2669 | ]) |
| 2670 | CPPFLAGS="$clean_CPPFLAGS" |
| 2671 | LDFLAGS="$clean_LDFLAGS" |
| 2672 | LIBS="$clean_LIBS" |
| 2673 | if test "$want_metalink" = "yes"; then |
| 2674 | dnl finally libmetalink will be used |
| 2675 | AC_DEFINE(USE_METALINK, 1, [Define to enable metalink support]) |
| 2676 | LIBMETALINK_LIBS=$addlib |
| 2677 | LIBMETALINK_LDFLAGS=$addld |
| 2678 | LIBMETALINK_CPPFLAGS=$addcflags |
| 2679 | AC_SUBST([LIBMETALINK_LIBS]) |
| 2680 | AC_SUBST([LIBMETALINK_LDFLAGS]) |
| 2681 | AC_SUBST([LIBMETALINK_CPPFLAGS]) |
| 2682 | curl_mtlnk_msg="enabled" |
| 2683 | fi |
| 2684 | |
| 2685 | fi |
| 2686 | fi |
| 2687 | |
| 2688 | dnl ********************************************************************** |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2689 | dnl Check for the presence of LIBSSH2 libraries and headers |
| 2690 | dnl ********************************************************************** |
| 2691 | |
| 2692 | dnl Default to compiler & linker defaults for LIBSSH2 files & libraries. |
| 2693 | OPT_LIBSSH2=off |
| 2694 | AC_ARG_WITH(libssh2,dnl |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2695 | 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]) |
Elliott Hughes | 0128fe4 | 2018-02-27 14:57:55 -0800 | [diff] [blame] | 2696 | AC_HELP_STRING([--with-libssh2], [enable LIBSSH2]), |
| 2697 | OPT_LIBSSH2=$withval, OPT_LIBSSH2=no) |
| 2698 | |
| 2699 | |
| 2700 | OPT_LIBSSH=off |
| 2701 | AC_ARG_WITH(libssh,dnl |
| 2702 | AC_HELP_STRING([--with-libssh=PATH],[Where to look for libssh, PATH points to the LIBSSH installation; when possible, set the PKG_CONFIG_PATH environment variable instead of using this option]) |
| 2703 | AC_HELP_STRING([--with-libssh], [enable LIBSSH]), |
| 2704 | OPT_LIBSSH=$withval, OPT_LIBSSH=no) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2705 | |
| 2706 | if test X"$OPT_LIBSSH2" != Xno; then |
| 2707 | dnl backup the pre-libssh2 variables |
| 2708 | CLEANLDFLAGS="$LDFLAGS" |
| 2709 | CLEANCPPFLAGS="$CPPFLAGS" |
| 2710 | CLEANLIBS="$LIBS" |
| 2711 | |
| 2712 | case "$OPT_LIBSSH2" in |
| 2713 | yes) |
| 2714 | dnl --with-libssh2 (without path) used |
| 2715 | CURL_CHECK_PKGCONFIG(libssh2) |
| 2716 | |
| 2717 | if test "$PKGCONFIG" != "no" ; then |
Elliott Hughes | 72d948d | 2018-08-03 14:37:21 -0700 | [diff] [blame] | 2718 | LIB_SSH2=`$PKGCONFIG --libs libssh2` |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2719 | LD_SSH2=`$PKGCONFIG --libs-only-L libssh2` |
| 2720 | CPP_SSH2=`$PKGCONFIG --cflags-only-I libssh2` |
| 2721 | version=`$PKGCONFIG --modversion libssh2` |
| 2722 | DIR_SSH2=`echo $LD_SSH2 | $SED -e 's/-L//'` |
| 2723 | fi |
| 2724 | |
| 2725 | ;; |
| 2726 | off) |
| 2727 | dnl no --with-libssh2 option given, just check default places |
| 2728 | ;; |
| 2729 | *) |
| 2730 | dnl use the given --with-libssh2 spot |
| 2731 | PREFIX_SSH2=$OPT_LIBSSH2 |
| 2732 | ;; |
| 2733 | esac |
| 2734 | |
| 2735 | dnl if given with a prefix, we set -L and -I based on that |
| 2736 | if test -n "$PREFIX_SSH2"; then |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2737 | LIB_SSH2="-lssh2" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2738 | LD_SSH2=-L${PREFIX_SSH2}/lib$libsuff |
| 2739 | CPP_SSH2=-I${PREFIX_SSH2}/include |
| 2740 | DIR_SSH2=${PREFIX_SSH2}/lib$libsuff |
| 2741 | fi |
| 2742 | |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 2743 | LDFLAGS="$LDFLAGS $LD_SSH2" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2744 | CPPFLAGS="$CPPFLAGS $CPP_SSH2" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2745 | LIBS="$LIB_SSH2 $LIBS" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2746 | |
| 2747 | AC_CHECK_LIB(ssh2, libssh2_channel_open_ex) |
| 2748 | |
| 2749 | AC_CHECK_HEADERS(libssh2.h, |
| 2750 | curl_ssh_msg="enabled (libSSH2)" |
| 2751 | LIBSSH2_ENABLED=1 |
| 2752 | AC_DEFINE(USE_LIBSSH2, 1, [if libSSH2 is in use]) |
| 2753 | AC_SUBST(USE_LIBSSH2, [1]) |
| 2754 | ) |
| 2755 | |
| 2756 | if test X"$OPT_LIBSSH2" != Xoff && |
| 2757 | test "$LIBSSH2_ENABLED" != "1"; then |
| 2758 | AC_MSG_ERROR([libSSH2 libs and/or directories were not found where specified!]) |
| 2759 | fi |
| 2760 | |
| 2761 | if test "$LIBSSH2_ENABLED" = "1"; then |
| 2762 | if test -n "$DIR_SSH2"; then |
| 2763 | dnl when the libssh2 shared libs were found in a path that the run-time |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2764 | dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2765 | dnl to prevent further configure tests to fail due to this |
| 2766 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2767 | if test "x$cross_compiling" != "xyes"; then |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2768 | CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH2" |
| 2769 | export CURL_LIBRARY_PATH |
| 2770 | AC_MSG_NOTICE([Added $DIR_SSH2 to CURL_LIBRARY_PATH]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2771 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2772 | fi |
| 2773 | else |
| 2774 | dnl no libssh2, revert back to clean variables |
| 2775 | LDFLAGS=$CLEANLDFLAGS |
| 2776 | CPPFLAGS=$CLEANCPPFLAGS |
| 2777 | LIBS=$CLEANLIBS |
| 2778 | fi |
Elliott Hughes | 0128fe4 | 2018-02-27 14:57:55 -0800 | [diff] [blame] | 2779 | elif test X"$OPT_LIBSSH" != Xno; then |
| 2780 | dnl backup the pre-libssh variables |
| 2781 | CLEANLDFLAGS="$LDFLAGS" |
| 2782 | CLEANCPPFLAGS="$CPPFLAGS" |
| 2783 | CLEANLIBS="$LIBS" |
| 2784 | |
| 2785 | case "$OPT_LIBSSH" in |
| 2786 | yes) |
| 2787 | dnl --with-libssh (without path) used |
| 2788 | CURL_CHECK_PKGCONFIG(libssh) |
| 2789 | |
| 2790 | if test "$PKGCONFIG" != "no" ; then |
| 2791 | LIB_SSH=`$PKGCONFIG --libs-only-l libssh` |
| 2792 | LD_SSH=`$PKGCONFIG --libs-only-L libssh` |
| 2793 | CPP_SSH=`$PKGCONFIG --cflags-only-I libssh` |
| 2794 | version=`$PKGCONFIG --modversion libssh` |
| 2795 | DIR_SSH=`echo $LD_SSH | $SED -e 's/-L//'` |
| 2796 | fi |
| 2797 | |
| 2798 | ;; |
| 2799 | off) |
| 2800 | dnl no --with-libssh option given, just check default places |
| 2801 | ;; |
| 2802 | *) |
| 2803 | dnl use the given --with-libssh spot |
| 2804 | PREFIX_SSH=$OPT_LIBSSH |
| 2805 | ;; |
| 2806 | esac |
| 2807 | |
| 2808 | dnl if given with a prefix, we set -L and -I based on that |
| 2809 | if test -n "$PREFIX_SSH"; then |
| 2810 | LIB_SSH="-lssh" |
| 2811 | LD_SSH=-L${PREFIX_SSH}/lib$libsuff |
| 2812 | CPP_SSH=-I${PREFIX_SSH}/include |
| 2813 | DIR_SSH=${PREFIX_SSH}/lib$libsuff |
| 2814 | fi |
| 2815 | |
| 2816 | LDFLAGS="$LDFLAGS $LD_SSH" |
| 2817 | CPPFLAGS="$CPPFLAGS $CPP_SSH" |
| 2818 | LIBS="$LIB_SSH $LIBS" |
| 2819 | |
| 2820 | AC_CHECK_LIB(ssh, ssh_new) |
| 2821 | |
| 2822 | AC_CHECK_HEADERS(libssh/libssh.h, |
| 2823 | curl_ssh_msg="enabled (libSSH)" |
| 2824 | LIBSSH_ENABLED=1 |
| 2825 | AC_DEFINE(USE_LIBSSH, 1, [if libSSH is in use]) |
| 2826 | AC_SUBST(USE_LIBSSH, [1]) |
| 2827 | ) |
| 2828 | |
| 2829 | if test X"$OPT_LIBSSH" != Xoff && |
| 2830 | test "$LIBSSH_ENABLED" != "1"; then |
| 2831 | AC_MSG_ERROR([libSSH libs and/or directories were not found where specified!]) |
| 2832 | fi |
| 2833 | |
| 2834 | if test "$LIBSSH_ENABLED" = "1"; then |
| 2835 | if test -n "$DIR_SSH"; then |
| 2836 | dnl when the libssh shared libs were found in a path that the run-time |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2837 | dnl linker doesn't search through, we need to add it to CURL_LIBRARY_PATH |
Elliott Hughes | 0128fe4 | 2018-02-27 14:57:55 -0800 | [diff] [blame] | 2838 | dnl to prevent further configure tests to fail due to this |
| 2839 | |
| 2840 | if test "x$cross_compiling" != "xyes"; then |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 2841 | CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_SSH" |
| 2842 | export CURL_LIBRARY_PATH |
| 2843 | AC_MSG_NOTICE([Added $DIR_SSH to CURL_LIBRARY_PATH]) |
Elliott Hughes | 0128fe4 | 2018-02-27 14:57:55 -0800 | [diff] [blame] | 2844 | fi |
| 2845 | fi |
| 2846 | else |
| 2847 | dnl no libssh, revert back to clean variables |
| 2848 | LDFLAGS=$CLEANLDFLAGS |
| 2849 | CPPFLAGS=$CLEANCPPFLAGS |
| 2850 | LIBS=$CLEANLIBS |
| 2851 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2852 | fi |
| 2853 | |
| 2854 | dnl ********************************************************************** |
| 2855 | dnl Check for the presence of LIBRTMP libraries and headers |
| 2856 | dnl ********************************************************************** |
| 2857 | |
| 2858 | dnl Default to compiler & linker defaults for LIBRTMP files & libraries. |
| 2859 | OPT_LIBRTMP=off |
| 2860 | AC_ARG_WITH(librtmp,dnl |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2861 | 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]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2862 | AC_HELP_STRING([--without-librtmp], [disable LIBRTMP]), |
| 2863 | OPT_LIBRTMP=$withval) |
| 2864 | |
| 2865 | if test X"$OPT_LIBRTMP" != Xno; then |
| 2866 | dnl backup the pre-librtmp variables |
| 2867 | CLEANLDFLAGS="$LDFLAGS" |
| 2868 | CLEANCPPFLAGS="$CPPFLAGS" |
| 2869 | CLEANLIBS="$LIBS" |
| 2870 | |
| 2871 | case "$OPT_LIBRTMP" in |
| 2872 | yes) |
| 2873 | dnl --with-librtmp (without path) used |
| 2874 | CURL_CHECK_PKGCONFIG(librtmp) |
| 2875 | |
| 2876 | if test "$PKGCONFIG" != "no" ; then |
| 2877 | LIB_RTMP=`$PKGCONFIG --libs-only-l librtmp` |
| 2878 | LD_RTMP=`$PKGCONFIG --libs-only-L librtmp` |
| 2879 | CPP_RTMP=`$PKGCONFIG --cflags-only-I librtmp` |
| 2880 | version=`$PKGCONFIG --modversion librtmp` |
| 2881 | DIR_RTMP=`echo $LD_RTMP | $SED -e 's/-L//'` |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2882 | else |
| 2883 | dnl To avoid link errors, we do not allow --librtmp without |
| 2884 | dnl a pkgconfig file |
| 2885 | AC_MSG_ERROR([--librtmp was specified but could not find librtmp pkgconfig file.]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2886 | fi |
| 2887 | |
| 2888 | ;; |
| 2889 | off) |
| 2890 | dnl no --with-librtmp option given, just check default places |
| 2891 | LIB_RTMP="-lrtmp" |
| 2892 | ;; |
| 2893 | *) |
| 2894 | dnl use the given --with-librtmp spot |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 2895 | LIB_RTMP="-lrtmp" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2896 | PREFIX_RTMP=$OPT_LIBRTMP |
| 2897 | ;; |
| 2898 | esac |
| 2899 | |
| 2900 | dnl if given with a prefix, we set -L and -I based on that |
| 2901 | if test -n "$PREFIX_RTMP"; then |
| 2902 | LD_RTMP=-L${PREFIX_RTMP}/lib$libsuff |
| 2903 | CPP_RTMP=-I${PREFIX_RTMP}/include |
| 2904 | DIR_RTMP=${PREFIX_RTMP}/lib$libsuff |
| 2905 | fi |
| 2906 | |
| 2907 | LDFLAGS="$LDFLAGS $LD_RTMP" |
| 2908 | CPPFLAGS="$CPPFLAGS $CPP_RTMP" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2909 | LIBS="$LIB_RTMP $LIBS" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 2910 | |
| 2911 | AC_CHECK_LIB(rtmp, RTMP_Init, |
| 2912 | [ |
| 2913 | AC_CHECK_HEADERS(librtmp/rtmp.h, |
| 2914 | curl_rtmp_msg="enabled (librtmp)" |
| 2915 | LIBRTMP_ENABLED=1 |
| 2916 | AC_DEFINE(USE_LIBRTMP, 1, [if librtmp is in use]) |
| 2917 | AC_SUBST(USE_LIBRTMP, [1]) |
| 2918 | ) |
| 2919 | ], |
| 2920 | dnl not found, revert back to clean variables |
| 2921 | LDFLAGS=$CLEANLDFLAGS |
| 2922 | CPPFLAGS=$CLEANCPPFLAGS |
| 2923 | LIBS=$CLEANLIBS |
| 2924 | ) |
| 2925 | |
| 2926 | if test X"$OPT_LIBRTMP" != Xoff && |
| 2927 | test "$LIBRTMP_ENABLED" != "1"; then |
| 2928 | AC_MSG_ERROR([librtmp libs and/or directories were not found where specified!]) |
| 2929 | fi |
| 2930 | |
| 2931 | fi |
| 2932 | |
| 2933 | dnl ********************************************************************** |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2934 | dnl Check for linker switch for versioned symbols |
| 2935 | dnl ********************************************************************** |
| 2936 | |
| 2937 | versioned_symbols_flavour= |
| 2938 | AC_MSG_CHECKING([whether versioned symbols are wanted]) |
| 2939 | AC_ARG_ENABLE(versioned-symbols, |
| 2940 | AC_HELP_STRING([--enable-versioned-symbols], [Enable versioned symbols in shared library]) |
| 2941 | AC_HELP_STRING([--disable-versioned-symbols], [Disable versioned symbols in shared library]), |
| 2942 | [ case "$enableval" in |
| 2943 | yes) AC_MSG_RESULT(yes) |
| 2944 | AC_MSG_CHECKING([if libraries can be versioned]) |
| 2945 | GLD=`$LD --help < /dev/null 2>/dev/null | grep version-script` |
| 2946 | if test -z "$GLD"; then |
| 2947 | AC_MSG_RESULT(no) |
| 2948 | AC_MSG_WARN([You need an ld version supporting the --version-script option]) |
| 2949 | else |
| 2950 | AC_MSG_RESULT(yes) |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 2951 | if test "x$CURL_WITH_MULTI_SSL" = "x1"; then |
| 2952 | versioned_symbols_flavour="MULTISSL_" |
| 2953 | elif test "x$OPENSSL_ENABLED" = "x1"; then |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2954 | versioned_symbols_flavour="OPENSSL_" |
| 2955 | elif test "x$GNUTLS_ENABLED" = "x1"; then |
| 2956 | versioned_symbols_flavour="GNUTLS_" |
| 2957 | elif test "x$NSS_ENABLED" = "x1"; then |
| 2958 | versioned_symbols_flavour="NSS_" |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 2959 | elif test "x$WOLFSSL_ENABLED" = "x1"; then |
| 2960 | versioned_symbols_flavour="WOLFSSL_" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2961 | elif test "x$WINSSL_ENABLED" = "x1"; then |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 2962 | versioned_symbols_flavour="SCHANNEL_" |
| 2963 | elif test "x$SECURETRANSPORT_ENABLED" = "x1"; then |
| 2964 | versioned_symbols_flavour="SECURE_TRANSPORT_" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 2965 | else |
| 2966 | versioned_symbols_flavour="" |
| 2967 | fi |
| 2968 | versioned_symbols="yes" |
| 2969 | fi |
| 2970 | ;; |
| 2971 | |
| 2972 | *) AC_MSG_RESULT(no) |
| 2973 | ;; |
| 2974 | esac |
| 2975 | ], [ |
| 2976 | AC_MSG_RESULT(no) |
| 2977 | ] |
| 2978 | ) |
| 2979 | |
| 2980 | AC_SUBST([CURL_LT_SHLIB_VERSIONED_FLAVOUR], |
| 2981 | ["$versioned_symbols_flavour"]) |
| 2982 | AM_CONDITIONAL([CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS], |
| 2983 | [test "x$versioned_symbols" = 'xyes']) |
| 2984 | |
| 2985 | dnl ------------------------------------------------- |
| 2986 | dnl check winidn option before other IDN libraries |
| 2987 | dnl ------------------------------------------------- |
| 2988 | |
| 2989 | AC_MSG_CHECKING([whether to enable Windows native IDN (Windows native builds only)]) |
| 2990 | OPT_WINIDN="default" |
| 2991 | AC_ARG_WITH(winidn, |
| 2992 | AC_HELP_STRING([--with-winidn=PATH],[enable Windows native IDN]) |
| 2993 | AC_HELP_STRING([--without-winidn], [disable Windows native IDN]), |
| 2994 | OPT_WINIDN=$withval) |
| 2995 | case "$OPT_WINIDN" in |
| 2996 | no|default) |
| 2997 | dnl --without-winidn option used or configure option not specified |
| 2998 | want_winidn="no" |
| 2999 | AC_MSG_RESULT([no]) |
| 3000 | ;; |
| 3001 | yes) |
| 3002 | dnl --with-winidn option used without path |
| 3003 | want_winidn="yes" |
| 3004 | want_winidn_path="default" |
| 3005 | AC_MSG_RESULT([yes]) |
| 3006 | ;; |
| 3007 | *) |
| 3008 | dnl --with-winidn option used with path |
| 3009 | want_winidn="yes" |
| 3010 | want_winidn_path="$withval" |
| 3011 | AC_MSG_RESULT([yes ($withval)]) |
| 3012 | ;; |
| 3013 | esac |
| 3014 | |
| 3015 | if test "$want_winidn" = "yes"; then |
| 3016 | dnl winidn library support has been requested |
| 3017 | clean_CPPFLAGS="$CPPFLAGS" |
| 3018 | clean_LDFLAGS="$LDFLAGS" |
| 3019 | clean_LIBS="$LIBS" |
| 3020 | WINIDN_LIBS="-lnormaliz" |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 3021 | WINIDN_CPPFLAGS="-DWINVER=0x0600" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3022 | # |
| 3023 | if test "$want_winidn_path" != "default"; then |
| 3024 | dnl path has been specified |
| 3025 | dnl pkg-config not available or provides no info |
| 3026 | WINIDN_LDFLAGS="-L$want_winidn_path/lib$libsuff" |
| 3027 | WINIDN_CPPFLAGS="-I$want_winidn_path/include" |
| 3028 | WINIDN_DIR="$want_winidn_path/lib$libsuff" |
| 3029 | fi |
| 3030 | # |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 3031 | CPPFLAGS="$CPPFLAGS $WINIDN_CPPFLAGS" |
| 3032 | LDFLAGS="$LDFLAGS $WINIDN_LDFLAGS" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3033 | LIBS="$WINIDN_LIBS $LIBS" |
| 3034 | # |
| 3035 | AC_MSG_CHECKING([if IdnToUnicode can be linked]) |
| 3036 | AC_LINK_IFELSE([ |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 3037 | AC_LANG_PROGRAM([[ |
| 3038 | #include <windows.h> |
| 3039 | ]],[[ |
| 3040 | IdnToUnicode(0, NULL, 0, NULL, 0); |
| 3041 | ]]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3042 | ],[ |
| 3043 | AC_MSG_RESULT([yes]) |
| 3044 | tst_links_winidn="yes" |
| 3045 | ],[ |
| 3046 | AC_MSG_RESULT([no]) |
| 3047 | tst_links_winidn="no" |
| 3048 | ]) |
| 3049 | # |
| 3050 | if test "$tst_links_winidn" = "yes"; then |
| 3051 | AC_DEFINE(USE_WIN32_IDN, 1, [Define to 1 if you have the `normaliz' (WinIDN) library (-lnormaliz).]) |
| 3052 | AC_DEFINE(WANT_IDN_PROTOTYPES, 1, [Define to 1 to provide own prototypes.]) |
| 3053 | AC_SUBST([IDN_ENABLED], [1]) |
| 3054 | curl_idn_msg="enabled (Windows-native)" |
| 3055 | else |
| 3056 | AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled]) |
| 3057 | CPPFLAGS="$clean_CPPFLAGS" |
| 3058 | LDFLAGS="$clean_LDFLAGS" |
| 3059 | LIBS="$clean_LIBS" |
| 3060 | fi |
| 3061 | fi |
| 3062 | |
| 3063 | dnl ********************************************************************** |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3064 | dnl Check for the presence of IDN libraries and headers |
| 3065 | dnl ********************************************************************** |
| 3066 | |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3067 | AC_MSG_CHECKING([whether to build with libidn2]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3068 | OPT_IDN="default" |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 3069 | AC_ARG_WITH(libidn2, |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3070 | AC_HELP_STRING([--with-libidn2=PATH],[Enable libidn2 usage]) |
| 3071 | AC_HELP_STRING([--without-libidn2],[Disable libidn2 usage]), |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3072 | [OPT_IDN=$withval]) |
| 3073 | case "$OPT_IDN" in |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3074 | no) |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3075 | dnl --without-libidn2 option used |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3076 | want_idn="no" |
| 3077 | AC_MSG_RESULT([no]) |
| 3078 | ;; |
| 3079 | default) |
| 3080 | dnl configure option not specified |
| 3081 | want_idn="yes" |
| 3082 | want_idn_path="default" |
| 3083 | AC_MSG_RESULT([(assumed) yes]) |
| 3084 | ;; |
| 3085 | yes) |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3086 | dnl --with-libidn2 option used without path |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3087 | want_idn="yes" |
| 3088 | want_idn_path="default" |
| 3089 | AC_MSG_RESULT([yes]) |
| 3090 | ;; |
| 3091 | *) |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3092 | dnl --with-libidn2 option used with path |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3093 | want_idn="yes" |
| 3094 | want_idn_path="$withval" |
| 3095 | AC_MSG_RESULT([yes ($withval)]) |
| 3096 | ;; |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3097 | esac |
| 3098 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3099 | if test "$want_idn" = "yes"; then |
| 3100 | dnl idn library support has been requested |
| 3101 | clean_CPPFLAGS="$CPPFLAGS" |
| 3102 | clean_LDFLAGS="$LDFLAGS" |
| 3103 | clean_LIBS="$LIBS" |
| 3104 | PKGCONFIG="no" |
| 3105 | # |
| 3106 | if test "$want_idn_path" != "default"; then |
| 3107 | dnl path has been specified |
| 3108 | IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig" |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3109 | CURL_CHECK_PKGCONFIG(libidn2, [$IDN_PCDIR]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3110 | if test "$PKGCONFIG" != "no"; then |
| 3111 | IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3112 | $PKGCONFIG --libs-only-l libidn2 2>/dev/null` |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3113 | IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3114 | $PKGCONFIG --libs-only-L libidn2 2>/dev/null` |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3115 | IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3116 | $PKGCONFIG --cflags-only-I libidn2 2>/dev/null` |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3117 | IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'` |
| 3118 | else |
| 3119 | dnl pkg-config not available or provides no info |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3120 | IDN_LIBS="-lidn2" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3121 | IDN_LDFLAGS="-L$want_idn_path/lib$libsuff" |
| 3122 | IDN_CPPFLAGS="-I$want_idn_path/include" |
| 3123 | IDN_DIR="$want_idn_path/lib$libsuff" |
| 3124 | fi |
| 3125 | else |
| 3126 | dnl path not specified |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3127 | CURL_CHECK_PKGCONFIG(libidn2) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3128 | if test "$PKGCONFIG" != "no"; then |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3129 | IDN_LIBS=`$PKGCONFIG --libs-only-l libidn2 2>/dev/null` |
| 3130 | IDN_LDFLAGS=`$PKGCONFIG --libs-only-L libidn2 2>/dev/null` |
| 3131 | IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I libidn2 2>/dev/null` |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3132 | IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'` |
| 3133 | else |
| 3134 | dnl pkg-config not available or provides no info |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3135 | IDN_LIBS="-lidn2" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3136 | fi |
| 3137 | fi |
| 3138 | # |
| 3139 | if test "$PKGCONFIG" != "no"; then |
| 3140 | AC_MSG_NOTICE([pkg-config: IDN_LIBS: "$IDN_LIBS"]) |
| 3141 | AC_MSG_NOTICE([pkg-config: IDN_LDFLAGS: "$IDN_LDFLAGS"]) |
| 3142 | AC_MSG_NOTICE([pkg-config: IDN_CPPFLAGS: "$IDN_CPPFLAGS"]) |
| 3143 | AC_MSG_NOTICE([pkg-config: IDN_DIR: "$IDN_DIR"]) |
| 3144 | else |
| 3145 | AC_MSG_NOTICE([IDN_LIBS: "$IDN_LIBS"]) |
| 3146 | AC_MSG_NOTICE([IDN_LDFLAGS: "$IDN_LDFLAGS"]) |
| 3147 | AC_MSG_NOTICE([IDN_CPPFLAGS: "$IDN_CPPFLAGS"]) |
| 3148 | AC_MSG_NOTICE([IDN_DIR: "$IDN_DIR"]) |
| 3149 | fi |
| 3150 | # |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 3151 | CPPFLAGS="$CPPFLAGS $IDN_CPPFLAGS" |
| 3152 | LDFLAGS="$LDFLAGS $IDN_LDFLAGS" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3153 | LIBS="$IDN_LIBS $LIBS" |
| 3154 | # |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3155 | AC_MSG_CHECKING([if idn2_lookup_ul can be linked]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3156 | AC_LINK_IFELSE([ |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3157 | AC_LANG_FUNC_LINK_TRY([idn2_lookup_ul]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3158 | ],[ |
| 3159 | AC_MSG_RESULT([yes]) |
| 3160 | tst_links_libidn="yes" |
| 3161 | ],[ |
| 3162 | AC_MSG_RESULT([no]) |
| 3163 | tst_links_libidn="no" |
| 3164 | ]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3165 | # |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3166 | AC_CHECK_HEADERS( idn2.h ) |
| 3167 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3168 | if test "$tst_links_libidn" = "yes"; then |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3169 | AC_DEFINE(HAVE_LIBIDN2, 1, [Define to 1 if you have the `idn2' library (-lidn2).]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3170 | dnl different versions of libidn have different setups of these: |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 3171 | |
| 3172 | AC_SUBST([IDN_ENABLED], [1]) |
| 3173 | curl_idn_msg="enabled (libidn2)" |
| 3174 | if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 3175 | CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$IDN_DIR" |
| 3176 | export CURL_LIBRARY_PATH |
| 3177 | AC_MSG_NOTICE([Added $IDN_DIR to CURL_LIBRARY_PATH]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3178 | fi |
| 3179 | else |
| 3180 | AC_MSG_WARN([Cannot find libraries for IDN support: IDN disabled]) |
| 3181 | CPPFLAGS="$clean_CPPFLAGS" |
| 3182 | LDFLAGS="$clean_LDFLAGS" |
| 3183 | LIBS="$clean_LIBS" |
| 3184 | fi |
| 3185 | fi |
| 3186 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3187 | |
| 3188 | dnl Let's hope this split URL remains working: |
Elliott Hughes | a93fb05 | 2018-12-12 14:22:48 -0800 | [diff] [blame] | 3189 | dnl https://www15.software.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3190 | dnl genprogc/thread_quick_ref.htm |
| 3191 | |
| 3192 | |
| 3193 | dnl ********************************************************************** |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3194 | dnl Check for nghttp2 |
| 3195 | dnl ********************************************************************** |
| 3196 | |
| 3197 | OPT_H2="yes" |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 3198 | |
| 3199 | if test "x$disable_http" = "xyes"; then |
| 3200 | # without HTTP, nghttp2 is no use |
| 3201 | OPT_H2="no" |
| 3202 | fi |
| 3203 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3204 | AC_ARG_WITH(nghttp2, |
| 3205 | AC_HELP_STRING([--with-nghttp2=PATH],[Enable nghttp2 usage]) |
| 3206 | AC_HELP_STRING([--without-nghttp2],[Disable nghttp2 usage]), |
| 3207 | [OPT_H2=$withval]) |
| 3208 | case "$OPT_H2" in |
| 3209 | no) |
| 3210 | dnl --without-nghttp2 option used |
| 3211 | want_h2="no" |
| 3212 | ;; |
| 3213 | yes) |
| 3214 | dnl --with-nghttp2 option used without path |
| 3215 | want_h2="default" |
| 3216 | want_h2_path="" |
| 3217 | ;; |
| 3218 | *) |
| 3219 | dnl --with-nghttp2 option used with path |
| 3220 | want_h2="yes" |
| 3221 | want_h2_path="$withval/lib/pkgconfig" |
| 3222 | ;; |
| 3223 | esac |
| 3224 | |
| 3225 | curl_h2_msg="disabled (--with-nghttp2)" |
| 3226 | if test X"$want_h2" != Xno; then |
| 3227 | dnl backup the pre-nghttp2 variables |
| 3228 | CLEANLDFLAGS="$LDFLAGS" |
| 3229 | CLEANCPPFLAGS="$CPPFLAGS" |
| 3230 | CLEANLIBS="$LIBS" |
| 3231 | |
| 3232 | CURL_CHECK_PKGCONFIG(libnghttp2, $want_h2_path) |
| 3233 | |
| 3234 | if test "$PKGCONFIG" != "no" ; then |
| 3235 | LIB_H2=`CURL_EXPORT_PCDIR([$want_h2_path]) |
| 3236 | $PKGCONFIG --libs-only-l libnghttp2` |
| 3237 | AC_MSG_NOTICE([-l is $LIB_H2]) |
| 3238 | |
| 3239 | CPP_H2=`CURL_EXPORT_PCDIR([$want_h2_path]) dnl |
| 3240 | $PKGCONFIG --cflags-only-I libnghttp2` |
| 3241 | AC_MSG_NOTICE([-I is $CPP_H2]) |
| 3242 | |
| 3243 | LD_H2=`CURL_EXPORT_PCDIR([$want_h2_path]) |
| 3244 | $PKGCONFIG --libs-only-L libnghttp2` |
| 3245 | AC_MSG_NOTICE([-L is $LD_H2]) |
| 3246 | |
| 3247 | LDFLAGS="$LDFLAGS $LD_H2" |
| 3248 | CPPFLAGS="$CPPFLAGS $CPP_H2" |
| 3249 | LIBS="$LIB_H2 $LIBS" |
| 3250 | |
| 3251 | # use nghttp2_option_set_no_recv_client_magic to require nghttp2 |
| 3252 | # >= 1.0.0 |
| 3253 | AC_CHECK_LIB(nghttp2, nghttp2_option_set_no_recv_client_magic, |
| 3254 | [ |
| 3255 | AC_CHECK_HEADERS(nghttp2/nghttp2.h, |
| 3256 | curl_h2_msg="enabled (nghttp2)" |
| 3257 | NGHTTP2_ENABLED=1 |
| 3258 | AC_DEFINE(USE_NGHTTP2, 1, [if nghttp2 is in use]) |
| 3259 | AC_SUBST(USE_NGHTTP2, [1]) |
| 3260 | ) |
| 3261 | ], |
| 3262 | dnl not found, revert back to clean variables |
| 3263 | LDFLAGS=$CLEANLDFLAGS |
| 3264 | CPPFLAGS=$CLEANCPPFLAGS |
| 3265 | LIBS=$CLEANLIBS |
| 3266 | ) |
| 3267 | |
| 3268 | else |
| 3269 | dnl no nghttp2 pkg-config found, deal with it |
| 3270 | if test X"$want_h2" != Xdefault; then |
| 3271 | dnl To avoid link errors, we do not allow --with-nghttp2 without |
| 3272 | dnl a pkgconfig file |
| 3273 | AC_MSG_ERROR([--with-nghttp2 was specified but could not find libnghttp2 pkg-config file.]) |
| 3274 | fi |
| 3275 | fi |
| 3276 | |
| 3277 | fi |
| 3278 | |
| 3279 | dnl ********************************************************************** |
Haibo Huang | 445085a | 2019-09-11 13:33:50 -0700 | [diff] [blame] | 3280 | dnl Check for ngtcp2 (QUIC) |
| 3281 | dnl ********************************************************************** |
| 3282 | |
| 3283 | OPT_TCP2="yes" |
| 3284 | curl_h3_msg="disabled (--with-ngtcp2, --with-quiche)" |
| 3285 | |
| 3286 | if test "x$disable_http" = "xyes"; then |
| 3287 | # without HTTP, ngtcp2 is no use |
| 3288 | OPT_TCP2="no" |
| 3289 | fi |
| 3290 | |
| 3291 | AC_ARG_WITH(ngtcp2, |
| 3292 | AC_HELP_STRING([--with-ngtcp2=PATH],[Enable ngtcp2 usage]) |
| 3293 | AC_HELP_STRING([--without-ngtcp2],[Disable ngtcp2 usage]), |
| 3294 | [OPT_TCP2=$withval]) |
| 3295 | case "$OPT_TCP2" in |
| 3296 | no) |
| 3297 | dnl --without-ngtcp2 option used |
| 3298 | want_tcp2="no" |
| 3299 | ;; |
| 3300 | yes) |
| 3301 | dnl --with-ngtcp2 option used without path |
| 3302 | want_tcp2="default" |
| 3303 | want_tcp2_path="" |
| 3304 | ;; |
| 3305 | *) |
| 3306 | dnl --with-ngtcp2 option used with path |
| 3307 | want_tcp2="yes" |
| 3308 | want_tcp2_path="$withval/lib/pkgconfig" |
| 3309 | ;; |
| 3310 | esac |
| 3311 | |
| 3312 | curl_tcp2_msg="disabled (--with-ngtcp2)" |
| 3313 | if test X"$want_tcp2" != Xno; then |
| 3314 | dnl backup the pre-ngtcp2 variables |
| 3315 | CLEANLDFLAGS="$LDFLAGS" |
| 3316 | CLEANCPPFLAGS="$CPPFLAGS" |
| 3317 | CLEANLIBS="$LIBS" |
| 3318 | |
| 3319 | CURL_CHECK_PKGCONFIG(libngtcp2, $want_tcp2_path) |
| 3320 | |
| 3321 | if test "$PKGCONFIG" != "no" ; then |
| 3322 | LIB_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) |
| 3323 | $PKGCONFIG --libs-only-l libngtcp2` |
| 3324 | AC_MSG_NOTICE([-l is $LIB_TCP2]) |
| 3325 | |
| 3326 | CPP_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl |
| 3327 | $PKGCONFIG --cflags-only-I libngtcp2` |
| 3328 | AC_MSG_NOTICE([-I is $CPP_TCP2]) |
| 3329 | |
| 3330 | LD_TCP2=`CURL_EXPORT_PCDIR([$want_tcp2_path]) |
| 3331 | $PKGCONFIG --libs-only-L libngtcp2` |
| 3332 | AC_MSG_NOTICE([-L is $LD_TCP2]) |
| 3333 | |
| 3334 | LDFLAGS="$LDFLAGS $LD_TCP2" |
| 3335 | CPPFLAGS="$CPPFLAGS $CPP_TCP2" |
| 3336 | LIBS="$LIB_TCP2 $LIBS" |
| 3337 | |
| 3338 | if test "x$cross_compiling" != "xyes"; then |
| 3339 | DIR_TCP2=`echo $LD_TCP2 | $SED -e 's/-L//'` |
| 3340 | fi |
| 3341 | AC_CHECK_LIB(ngtcp2, ngtcp2_conn_client_new, |
| 3342 | [ |
| 3343 | AC_CHECK_HEADERS(ngtcp2/ngtcp2.h, |
| 3344 | NGTCP2_ENABLED=1 |
| 3345 | AC_DEFINE(USE_NGTCP2, 1, [if ngtcp2 is in use]) |
| 3346 | AC_SUBST(USE_NGTCP2, [1]) |
| 3347 | CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_TCP2" |
| 3348 | export CURL_LIBRARY_PATH |
| 3349 | AC_MSG_NOTICE([Added $DIR_TCP2 to CURL_LIBRARY_PATH]) |
| 3350 | ) |
| 3351 | ], |
| 3352 | dnl not found, revert back to clean variables |
| 3353 | LDFLAGS=$CLEANLDFLAGS |
| 3354 | CPPFLAGS=$CLEANCPPFLAGS |
| 3355 | LIBS=$CLEANLIBS |
| 3356 | ) |
| 3357 | |
| 3358 | else |
| 3359 | dnl no ngtcp2 pkg-config found, deal with it |
| 3360 | if test X"$want_tcp2" != Xdefault; then |
| 3361 | dnl To avoid link errors, we do not allow --with-ngtcp2 without |
| 3362 | dnl a pkgconfig file |
| 3363 | AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2 pkg-config file.]) |
| 3364 | fi |
| 3365 | fi |
| 3366 | |
| 3367 | fi |
| 3368 | |
| 3369 | if test "x$NGTCP2_ENABLED" = "x1"; then |
| 3370 | dnl backup the pre-ngtcp2_crypto_openssl variables |
| 3371 | CLEANLDFLAGS="$LDFLAGS" |
| 3372 | CLEANCPPFLAGS="$CPPFLAGS" |
| 3373 | CLEANLIBS="$LIBS" |
| 3374 | |
| 3375 | CURL_CHECK_PKGCONFIG(libngtcp2_crypto_openssl, $want_tcp2_path) |
| 3376 | |
| 3377 | if test "$PKGCONFIG" != "no" ; then |
| 3378 | LIB_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) |
| 3379 | $PKGCONFIG --libs-only-l libngtcp2_crypto_openssl` |
| 3380 | AC_MSG_NOTICE([-l is $LIB_NGTCP2_CRYPTO_OPENSSL]) |
| 3381 | |
| 3382 | CPP_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) dnl |
| 3383 | $PKGCONFIG --cflags-only-I libngtcp2_crypto_openssl` |
| 3384 | AC_MSG_NOTICE([-I is $CPP_NGTCP2_CRYPTO_OPENSSL]) |
| 3385 | |
| 3386 | LD_NGTCP2_CRYPTO_OPENSSL=`CURL_EXPORT_PCDIR([$want_tcp2_path]) |
| 3387 | $PKGCONFIG --libs-only-L libngtcp2_crypto_openssl` |
| 3388 | AC_MSG_NOTICE([-L is $LD_NGTCP2_CRYPTO_OPENSSL]) |
| 3389 | |
| 3390 | LDFLAGS="$LDFLAGS $LD_NGTCP2_CRYPTO_OPENSSL" |
| 3391 | CPPFLAGS="$CPPFLAGS $CPP_NGTCP2_CRYPTO_OPENSSL" |
| 3392 | LIBS="$LIB_NGTCP2_CRYPTO_OPENSSL $LIBS" |
| 3393 | |
| 3394 | if test "x$cross_compiling" != "xyes"; then |
| 3395 | DIR_NGTCP2_CRYPTO_OPENSSL=`echo $LD_NGTCP2_CRYPTO_OPENSSL | $SED -e 's/-L//'` |
| 3396 | fi |
| 3397 | AC_CHECK_LIB(ngtcp2_crypto_openssl, ngtcp2_crypto_ctx_initial, |
| 3398 | [ |
| 3399 | AC_CHECK_HEADERS(ngtcp2/ngtcp2_crypto.h, |
| 3400 | NGTCP2_ENABLED=1 |
| 3401 | AC_DEFINE(USE_NGTCP2_CRYPTO_OPENSSL, 1, [if ngtcp2_crypto_openssl is in use]) |
| 3402 | AC_SUBST(USE_NGTCP2_CRYPTO_OPENSSL, [1]) |
| 3403 | CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGTCP2_CRYPTO_OPENSSL" |
| 3404 | export CURL_LIBRARY_PATH |
| 3405 | AC_MSG_NOTICE([Added $DIR_NGTCP2_CRYPTO_OPENSSL to CURL_LIBRARY_PATH]) |
| 3406 | ) |
| 3407 | ], |
| 3408 | dnl not found, revert back to clean variables |
| 3409 | LDFLAGS=$CLEANLDFLAGS |
| 3410 | CPPFLAGS=$CLEANCPPFLAGS |
| 3411 | LIBS=$CLEANLIBS |
| 3412 | ) |
| 3413 | |
| 3414 | else |
| 3415 | dnl no ngtcp2_crypto_openssl pkg-config found, deal with it |
| 3416 | if test X"$want_tcp2" != Xdefault; then |
| 3417 | dnl To avoid link errors, we do not allow --with-ngtcp2 without |
| 3418 | dnl a pkgconfig file |
| 3419 | AC_MSG_ERROR([--with-ngtcp2 was specified but could not find ngtcp2_crypto_openssl pkg-config file.]) |
| 3420 | fi |
| 3421 | fi |
| 3422 | fi |
| 3423 | |
| 3424 | dnl ********************************************************************** |
| 3425 | dnl Check for nghttp3 (HTTP/3 with ngtcp2) |
| 3426 | dnl ********************************************************************** |
| 3427 | |
| 3428 | OPT_NGHTTP3="yes" |
| 3429 | |
| 3430 | if test "x$NGTCP2_ENABLED" = "x"; then |
| 3431 | # without ngtcp2, nghttp3 is of no use for us |
| 3432 | OPT_NGHTTP3="no" |
| 3433 | fi |
| 3434 | |
| 3435 | AC_ARG_WITH(nghttp3, |
| 3436 | AC_HELP_STRING([--with-nghttp3=PATH],[Enable nghttp3 usage]) |
| 3437 | AC_HELP_STRING([--without-nghttp3],[Disable nghttp3 usage]), |
| 3438 | [OPT_NGHTTP3=$withval]) |
| 3439 | case "$OPT_NGHTTP3" in |
| 3440 | no) |
| 3441 | dnl --without-nghttp3 option used |
| 3442 | want_nghttp3="no" |
| 3443 | ;; |
| 3444 | yes) |
| 3445 | dnl --with-nghttp3 option used without path |
| 3446 | want_nghttp3="default" |
| 3447 | want_nghttp3_path="" |
| 3448 | ;; |
| 3449 | *) |
| 3450 | dnl --with-nghttp3 option used with path |
| 3451 | want_nghttp3="yes" |
| 3452 | want_nghttp3_path="$withval/lib/pkgconfig" |
| 3453 | ;; |
| 3454 | esac |
| 3455 | |
| 3456 | curl_http3_msg="disabled (--with-nghttp3)" |
| 3457 | if test X"$want_nghttp3" != Xno; then |
| 3458 | dnl backup the pre-nghttp3 variables |
| 3459 | CLEANLDFLAGS="$LDFLAGS" |
| 3460 | CLEANCPPFLAGS="$CPPFLAGS" |
| 3461 | CLEANLIBS="$LIBS" |
| 3462 | |
| 3463 | CURL_CHECK_PKGCONFIG(libnghttp3, $want_nghttp3_path) |
| 3464 | |
| 3465 | if test "$PKGCONFIG" != "no" ; then |
| 3466 | LIB_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) |
| 3467 | $PKGCONFIG --libs-only-l libnghttp3` |
| 3468 | AC_MSG_NOTICE([-l is $LIB_NGHTTP3]) |
| 3469 | |
| 3470 | CPP_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) dnl |
| 3471 | $PKGCONFIG --cflags-only-I libnghttp3` |
| 3472 | AC_MSG_NOTICE([-I is $CPP_NGHTTP3]) |
| 3473 | |
| 3474 | LD_NGHTTP3=`CURL_EXPORT_PCDIR([$want_nghttp3_path]) |
| 3475 | $PKGCONFIG --libs-only-L libnghttp3` |
| 3476 | AC_MSG_NOTICE([-L is $LD_NGHTTP3]) |
| 3477 | |
| 3478 | LDFLAGS="$LDFLAGS $LD_NGHTTP3" |
| 3479 | CPPFLAGS="$CPPFLAGS $CPP_NGHTTP3" |
| 3480 | LIBS="$LIB_NGHTTP3 $LIBS" |
| 3481 | |
| 3482 | if test "x$cross_compiling" != "xyes"; then |
| 3483 | DIR_NGHTTP3=`echo $LD_NGHTTP3 | $SED -e 's/-L//'` |
| 3484 | fi |
| 3485 | AC_CHECK_LIB(nghttp3, nghttp3_conn_client_new, |
| 3486 | [ |
| 3487 | AC_CHECK_HEADERS(nghttp3/nghttp3.h, |
| 3488 | curl_h3_msg="enabled (ngtcp2 + nghttp3)" |
| 3489 | NGHTTP3_ENABLED=1 |
| 3490 | AC_DEFINE(USE_NGHTTP3, 1, [if nghttp3 is in use]) |
| 3491 | AC_SUBST(USE_NGHTTP3, [1]) |
| 3492 | CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_NGHTTP3" |
| 3493 | export CURL_LIBRARY_PATH |
| 3494 | AC_MSG_NOTICE([Added $DIR_NGHTTP3 to CURL_LIBRARY_PATH]) |
| 3495 | experimental="$experimental HTTP3" |
| 3496 | ) |
| 3497 | ], |
| 3498 | dnl not found, revert back to clean variables |
| 3499 | LDFLAGS=$CLEANLDFLAGS |
| 3500 | CPPFLAGS=$CLEANCPPFLAGS |
| 3501 | LIBS=$CLEANLIBS |
| 3502 | ) |
| 3503 | |
| 3504 | else |
| 3505 | dnl no nghttp3 pkg-config found, deal with it |
| 3506 | if test X"$want_nghttp3" != Xdefault; then |
| 3507 | dnl To avoid link errors, we do not allow --with-nghttp3 without |
| 3508 | dnl a pkgconfig file |
| 3509 | AC_MSG_ERROR([--with-nghttp3 was specified but could not find nghttp3 pkg-config file.]) |
| 3510 | fi |
| 3511 | fi |
| 3512 | |
| 3513 | fi |
| 3514 | |
| 3515 | dnl ********************************************************************** |
| 3516 | dnl Check for quiche (QUIC) |
| 3517 | dnl ********************************************************************** |
| 3518 | |
| 3519 | OPT_QUICHE="yes" |
| 3520 | |
| 3521 | if test "x$disable_http" = "xyes" -o "x$USE_NGTCP" = "x1"; then |
| 3522 | # without HTTP or with ngtcp2, quiche is no use |
| 3523 | OPT_QUICHE="no" |
| 3524 | fi |
| 3525 | |
| 3526 | AC_ARG_WITH(quiche, |
| 3527 | AC_HELP_STRING([--with-quiche=PATH],[Enable quiche usage]) |
| 3528 | AC_HELP_STRING([--without-quiche],[Disable quiche usage]), |
| 3529 | [OPT_QUICHE=$withval]) |
| 3530 | case "$OPT_QUICHE" in |
| 3531 | no) |
| 3532 | dnl --without-quiche option used |
| 3533 | want_quiche="no" |
| 3534 | ;; |
| 3535 | yes) |
| 3536 | dnl --with-quiche option used without path |
| 3537 | want_quiche="default" |
| 3538 | want_quiche_path="" |
| 3539 | ;; |
| 3540 | *) |
| 3541 | dnl --with-quiche option used with path |
| 3542 | want_quiche="yes" |
| 3543 | want_quiche_path="$withval" |
| 3544 | ;; |
| 3545 | esac |
| 3546 | |
| 3547 | if test X"$want_quiche" != Xno; then |
| 3548 | dnl backup the pre-quiche variables |
| 3549 | CLEANLDFLAGS="$LDFLAGS" |
| 3550 | CLEANCPPFLAGS="$CPPFLAGS" |
| 3551 | CLEANLIBS="$LIBS" |
| 3552 | |
| 3553 | CURL_CHECK_PKGCONFIG(quiche, $want_quiche_path) |
| 3554 | |
| 3555 | if test "$PKGCONFIG" != "no" ; then |
| 3556 | LIB_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) |
| 3557 | $PKGCONFIG --libs-only-l quiche` |
| 3558 | AC_MSG_NOTICE([-l is $LIB_QUICHE]) |
| 3559 | |
| 3560 | CPP_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) dnl |
| 3561 | $PKGCONFIG --cflags-only-I quiche` |
| 3562 | AC_MSG_NOTICE([-I is $CPP_QUICHE]) |
| 3563 | |
| 3564 | LD_QUICHE=`CURL_EXPORT_PCDIR([$want_quiche_path]) |
| 3565 | $PKGCONFIG --libs-only-L quiche` |
| 3566 | AC_MSG_NOTICE([-L is $LD_QUICHE]) |
| 3567 | |
| 3568 | LDFLAGS="$LDFLAGS $LD_QUICHE" |
| 3569 | CPPFLAGS="$CPPFLAGS $CPP_QUICHE" |
| 3570 | LIBS="$LIB_QUICHE $LIBS" |
| 3571 | |
| 3572 | if test "x$cross_compiling" != "xyes"; then |
| 3573 | DIR_QUICHE=`echo $LD_QUICHE | $SED -e 's/-L//'` |
| 3574 | fi |
| 3575 | AC_CHECK_LIB(quiche, quiche_connect, |
| 3576 | [ |
| 3577 | AC_CHECK_HEADERS(quiche.h, |
| 3578 | experimental="$experimental HTTP3" |
| 3579 | AC_MSG_NOTICE([HTTP3 support is experimental]) |
| 3580 | curl_h3_msg="enabled (quiche)" |
| 3581 | QUICHE_ENABLED=1 |
| 3582 | AC_DEFINE(USE_QUICHE, 1, [if quiche is in use]) |
| 3583 | AC_SUBST(USE_QUICHE, [1]) |
| 3584 | CURL_LIBRARY_PATH="$CURL_LIBRARY_PATH:$DIR_QUICHE" |
| 3585 | export CURL_LIBRARY_PATH |
| 3586 | AC_MSG_NOTICE([Added $DIR_QUICHE to CURL_LIBRARY_PATH]), |
| 3587 | ) |
| 3588 | ], |
| 3589 | dnl not found, revert back to clean variables |
| 3590 | LDFLAGS=$CLEANLDFLAGS |
| 3591 | CPPFLAGS=$CLEANCPPFLAGS |
| 3592 | LIBS=$CLEANLIBS |
| 3593 | ) |
| 3594 | else |
| 3595 | dnl no nghttp3 pkg-config found, deal with it |
| 3596 | if test X"$want_quiche" != Xdefault; then |
| 3597 | dnl To avoid link errors, we do not allow --with-nghttp3 without |
| 3598 | dnl a pkgconfig file |
| 3599 | AC_MSG_ERROR([--with-quiche was specified but could not find quiche pkg-config file.]) |
| 3600 | fi |
| 3601 | fi |
| 3602 | fi |
| 3603 | |
| 3604 | dnl ********************************************************************** |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 3605 | dnl Check for zsh completion path |
| 3606 | dnl ********************************************************************** |
| 3607 | |
| 3608 | OPT_ZSH_FPATH=default |
| 3609 | AC_ARG_WITH(zsh-functions-dir, |
| 3610 | AC_HELP_STRING([--with-zsh-functions-dir=PATH],[Install zsh completions to PATH]) |
| 3611 | AC_HELP_STRING([--without-zsh-functions-dir],[Do not install zsh completions]), |
| 3612 | [OPT_ZSH_FPATH=$withval]) |
| 3613 | case "$OPT_ZSH_FPATH" in |
| 3614 | no) |
| 3615 | dnl --without-zsh-functions-dir option used |
| 3616 | ;; |
| 3617 | default|yes) |
| 3618 | dnl --with-zsh-functions-dir option used without path |
| 3619 | ZSH_FUNCTIONS_DIR="$datarootdir/zsh/site-functions" |
| 3620 | AC_SUBST(ZSH_FUNCTIONS_DIR) |
| 3621 | ;; |
| 3622 | *) |
| 3623 | dnl --with-zsh-functions-dir option used with path |
| 3624 | ZSH_FUNCTIONS_DIR="$withval" |
| 3625 | AC_SUBST(ZSH_FUNCTIONS_DIR) |
| 3626 | ;; |
| 3627 | esac |
| 3628 | |
| 3629 | dnl ********************************************************************** |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 3630 | dnl Check for fish completion path |
| 3631 | dnl ********************************************************************** |
| 3632 | |
| 3633 | OPT_FISH_FPATH=default |
| 3634 | AC_ARG_WITH(fish-functions-dir, |
| 3635 | AC_HELP_STRING([--with-fish-functions-dir=PATH],[Install fish completions to PATH]) |
| 3636 | AC_HELP_STRING([--without-fish-functions-dir],[Do not install fish completions]), |
| 3637 | [OPT_FISH_FPATH=$withval]) |
| 3638 | case "$OPT_FISH_FPATH" in |
| 3639 | no) |
| 3640 | dnl --without-fish-functions-dir option used |
| 3641 | ;; |
| 3642 | default|yes) |
| 3643 | dnl --with-fish-functions-dir option used without path |
Haibo Huang | 34ab346 | 2019-05-22 00:50:27 -0700 | [diff] [blame] | 3644 | CURL_CHECK_PKGCONFIG(fish) |
| 3645 | if test "$PKGCONFIG" != "no" ; then |
| 3646 | FISH_FUNCTIONS_DIR="$($PKGCONFIG --variable completionsdir fish)" |
| 3647 | else |
| 3648 | FISH_FUNCTIONS_DIR="$datarootdir/fish/vendor_completions.d" |
| 3649 | fi |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 3650 | AC_SUBST(FISH_FUNCTIONS_DIR) |
| 3651 | ;; |
| 3652 | *) |
| 3653 | dnl --with-fish-functions-dir option used with path |
| 3654 | FISH_FUNCTIONS_DIR="$withval" |
| 3655 | AC_SUBST(FISH_FUNCTIONS_DIR) |
| 3656 | ;; |
| 3657 | esac |
| 3658 | |
| 3659 | dnl ********************************************************************** |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3660 | dnl Back to "normal" configuring |
| 3661 | dnl ********************************************************************** |
| 3662 | |
| 3663 | dnl Checks for header files. |
| 3664 | AC_HEADER_STDC |
| 3665 | |
| 3666 | CURL_CHECK_HEADER_MALLOC |
| 3667 | CURL_CHECK_HEADER_MEMORY |
| 3668 | |
| 3669 | dnl Now check for the very most basic headers. Then we can use these |
| 3670 | dnl ones as default-headers when checking for the rest! |
| 3671 | AC_CHECK_HEADERS( |
| 3672 | sys/types.h \ |
| 3673 | sys/time.h \ |
| 3674 | sys/select.h \ |
| 3675 | sys/socket.h \ |
| 3676 | sys/ioctl.h \ |
| 3677 | sys/uio.h \ |
| 3678 | assert.h \ |
| 3679 | unistd.h \ |
| 3680 | stdlib.h \ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3681 | arpa/inet.h \ |
| 3682 | net/if.h \ |
| 3683 | netinet/in.h \ |
Elliott Hughes | 0128fe4 | 2018-02-27 14:57:55 -0800 | [diff] [blame] | 3684 | netinet/in6.h \ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3685 | sys/un.h \ |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 3686 | linux/tcp.h \ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3687 | netinet/tcp.h \ |
| 3688 | netdb.h \ |
| 3689 | sys/sockio.h \ |
| 3690 | sys/stat.h \ |
| 3691 | sys/param.h \ |
| 3692 | termios.h \ |
| 3693 | termio.h \ |
| 3694 | sgtty.h \ |
| 3695 | fcntl.h \ |
| 3696 | alloca.h \ |
| 3697 | time.h \ |
| 3698 | io.h \ |
| 3699 | pwd.h \ |
| 3700 | utime.h \ |
| 3701 | sys/utime.h \ |
| 3702 | sys/poll.h \ |
| 3703 | poll.h \ |
| 3704 | socket.h \ |
| 3705 | sys/resource.h \ |
| 3706 | libgen.h \ |
| 3707 | locale.h \ |
| 3708 | errno.h \ |
| 3709 | stdbool.h \ |
| 3710 | arpa/tftp.h \ |
| 3711 | sys/filio.h \ |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3712 | sys/wait.h \ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3713 | setjmp.h, |
| 3714 | dnl to do if not found |
| 3715 | [], |
| 3716 | dnl to do if found |
| 3717 | [], |
| 3718 | dnl default includes |
| 3719 | [ |
| 3720 | #ifdef HAVE_SYS_TYPES_H |
| 3721 | #include <sys/types.h> |
| 3722 | #endif |
| 3723 | #ifdef HAVE_SYS_TIME_H |
| 3724 | #include <sys/time.h> |
| 3725 | #endif |
| 3726 | #ifdef HAVE_SYS_SELECT_H |
| 3727 | #include <sys/select.h> |
| 3728 | #endif |
| 3729 | #ifdef HAVE_SYS_SOCKET_H |
| 3730 | #include <sys/socket.h> |
| 3731 | #endif |
| 3732 | #ifdef HAVE_NETINET_IN_H |
| 3733 | #include <netinet/in.h> |
| 3734 | #endif |
Elliott Hughes | 0128fe4 | 2018-02-27 14:57:55 -0800 | [diff] [blame] | 3735 | #ifdef HAVE_NETINET_IN6_H |
| 3736 | #include <netinet/in6.h> |
| 3737 | #endif |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3738 | #ifdef HAVE_SYS_UN_H |
| 3739 | #include <sys/un.h> |
| 3740 | #endif |
| 3741 | ] |
| 3742 | ) |
| 3743 | |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 3744 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3745 | dnl Checks for typedefs, structures, and compiler characteristics. |
| 3746 | AC_C_CONST |
| 3747 | CURL_CHECK_VARIADIC_MACROS |
| 3748 | AC_TYPE_SIZE_T |
| 3749 | AC_HEADER_TIME |
| 3750 | CURL_CHECK_STRUCT_TIMEVAL |
| 3751 | CURL_VERIFY_RUNTIMELIBS |
| 3752 | |
Elliott Hughes | 72d948d | 2018-08-03 14:37:21 -0700 | [diff] [blame] | 3753 | AX_COMPILE_CHECK_SIZEOF(size_t) |
| 3754 | AX_COMPILE_CHECK_SIZEOF(long) |
| 3755 | AX_COMPILE_CHECK_SIZEOF(int) |
| 3756 | AX_COMPILE_CHECK_SIZEOF(short) |
| 3757 | AX_COMPILE_CHECK_SIZEOF(time_t) |
| 3758 | AX_COMPILE_CHECK_SIZEOF(off_t) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3759 | |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 3760 | o=$CPPFLAGS |
| 3761 | CPPFLAGS="-I$srcdir/include $CPPFLAGS" |
Elliott Hughes | 72d948d | 2018-08-03 14:37:21 -0700 | [diff] [blame] | 3762 | AX_COMPILE_CHECK_SIZEOF(curl_off_t, [ |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 3763 | #include <curl/system.h> |
| 3764 | ]) |
| 3765 | CPPFLAGS=$o |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3766 | |
| 3767 | AC_CHECK_TYPE(long long, |
| 3768 | [AC_DEFINE(HAVE_LONGLONG, 1, |
| 3769 | [Define to 1 if the compiler supports the 'long long' data type.])] |
| 3770 | longlong="yes" |
| 3771 | ) |
| 3772 | |
| 3773 | if test "xyes" = "x$longlong"; then |
| 3774 | AC_MSG_CHECKING([if numberLL works]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3775 | AC_COMPILE_IFELSE([ |
| 3776 | AC_LANG_PROGRAM([[ |
| 3777 | ]],[[ |
| 3778 | long long val = 1000LL; |
| 3779 | ]]) |
| 3780 | ],[ |
| 3781 | AC_MSG_RESULT([yes]) |
| 3782 | AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL]) |
| 3783 | ],[ |
| 3784 | AC_MSG_RESULT([no]) |
| 3785 | ]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3786 | fi |
| 3787 | |
| 3788 | |
| 3789 | # check for ssize_t |
| 3790 | AC_CHECK_TYPE(ssize_t, , |
| 3791 | AC_DEFINE(ssize_t, int, [the signed version of size_t])) |
| 3792 | |
| 3793 | # check for bool type |
| 3794 | AC_CHECK_TYPE([bool],[ |
| 3795 | AC_DEFINE(HAVE_BOOL_T, 1, |
| 3796 | [Define to 1 if bool is an available type.]) |
| 3797 | ], ,[ |
| 3798 | #ifdef HAVE_SYS_TYPES_H |
| 3799 | #include <sys/types.h> |
| 3800 | #endif |
| 3801 | #ifdef HAVE_STDBOOL_H |
| 3802 | #include <stdbool.h> |
| 3803 | #endif |
| 3804 | ]) |
| 3805 | |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 3806 | # check for sa_family_t |
| 3807 | AC_CHECK_TYPE(sa_family_t, |
| 3808 | AC_DEFINE(CURL_SA_FAMILY_T, sa_family_t, [IP address type in sockaddr]), |
| 3809 | [ |
| 3810 | # The windows name? |
| 3811 | AC_CHECK_TYPE(ADDRESS_FAMILY, |
| 3812 | AC_DEFINE(CURL_SA_FAMILY_T, ADDRESS_FAMILY, [IP address type in sockaddr]), |
| 3813 | AC_DEFINE(CURL_SA_FAMILY_T, unsigned short, [IP address type in sockaddr]), |
| 3814 | [ |
| 3815 | #ifdef HAVE_SYS_SOCKET_H |
| 3816 | #include <sys/socket.h> |
| 3817 | #endif |
| 3818 | ]) |
| 3819 | ], |
| 3820 | [ |
| 3821 | #ifdef HAVE_SYS_SOCKET_H |
| 3822 | #include <sys/socket.h> |
| 3823 | #endif |
| 3824 | ]) |
| 3825 | |
Elliott Hughes | cac3980 | 2018-04-27 16:19:43 -0700 | [diff] [blame] | 3826 | AC_MSG_CHECKING([if time_t is unsigned]) |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 3827 | CURL_RUN_IFELSE( |
| 3828 | [ |
Elliott Hughes | cac3980 | 2018-04-27 16:19:43 -0700 | [diff] [blame] | 3829 | #include <time.h> |
| 3830 | #include <limits.h> |
| 3831 | time_t t = -1; |
| 3832 | return (t > 0); |
Elliott Hughes | 1ef06ba | 2018-05-30 15:43:58 -0700 | [diff] [blame] | 3833 | ],[ |
Elliott Hughes | cac3980 | 2018-04-27 16:19:43 -0700 | [diff] [blame] | 3834 | AC_MSG_RESULT([yes]) |
| 3835 | AC_DEFINE(HAVE_TIME_T_UNSIGNED, 1, [Define this if time_t is unsigned]) |
| 3836 | ],[ |
| 3837 | AC_MSG_RESULT([no]) |
| 3838 | ],[ |
| 3839 | dnl cross-compiling, most systems are unsigned |
| 3840 | AC_MSG_RESULT([no]) |
| 3841 | ]) |
| 3842 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3843 | CURL_CONFIGURE_PULL_SYS_POLL |
| 3844 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3845 | TYPE_IN_ADDR_T |
| 3846 | |
| 3847 | TYPE_SOCKADDR_STORAGE |
| 3848 | |
| 3849 | TYPE_SIG_ATOMIC_T |
| 3850 | |
| 3851 | AC_TYPE_SIGNAL |
| 3852 | |
| 3853 | CURL_CHECK_FUNC_SELECT |
| 3854 | |
| 3855 | CURL_CHECK_FUNC_RECV |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3856 | CURL_CHECK_FUNC_SEND |
| 3857 | CURL_CHECK_MSG_NOSIGNAL |
| 3858 | |
| 3859 | CURL_CHECK_FUNC_ALARM |
| 3860 | CURL_CHECK_FUNC_BASENAME |
| 3861 | CURL_CHECK_FUNC_CLOSESOCKET |
| 3862 | CURL_CHECK_FUNC_CLOSESOCKET_CAMEL |
| 3863 | CURL_CHECK_FUNC_CONNECT |
| 3864 | CURL_CHECK_FUNC_FCNTL |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3865 | CURL_CHECK_FUNC_FREEADDRINFO |
| 3866 | CURL_CHECK_FUNC_FREEIFADDRS |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3867 | CURL_CHECK_FUNC_FSETXATTR |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3868 | CURL_CHECK_FUNC_FTRUNCATE |
| 3869 | CURL_CHECK_FUNC_GETADDRINFO |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3870 | CURL_CHECK_FUNC_GAI_STRERROR |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3871 | CURL_CHECK_FUNC_GETHOSTBYADDR |
| 3872 | CURL_CHECK_FUNC_GETHOSTBYADDR_R |
| 3873 | CURL_CHECK_FUNC_GETHOSTBYNAME |
| 3874 | CURL_CHECK_FUNC_GETHOSTBYNAME_R |
| 3875 | CURL_CHECK_FUNC_GETHOSTNAME |
Haibo Huang | 34ab346 | 2019-05-22 00:50:27 -0700 | [diff] [blame] | 3876 | CURL_CHECK_FUNC_GETPEERNAME |
| 3877 | CURL_CHECK_FUNC_GETSOCKNAME |
Haibo Huang | b6336c1 | 2019-06-05 01:34:44 -0700 | [diff] [blame] | 3878 | CURL_CHECK_FUNC_IF_NAMETOINDEX |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3879 | CURL_CHECK_FUNC_GETIFADDRS |
| 3880 | CURL_CHECK_FUNC_GETSERVBYPORT_R |
| 3881 | CURL_CHECK_FUNC_GMTIME_R |
| 3882 | CURL_CHECK_FUNC_INET_NTOA_R |
| 3883 | CURL_CHECK_FUNC_INET_NTOP |
| 3884 | CURL_CHECK_FUNC_INET_PTON |
| 3885 | CURL_CHECK_FUNC_IOCTL |
| 3886 | CURL_CHECK_FUNC_IOCTLSOCKET |
| 3887 | CURL_CHECK_FUNC_IOCTLSOCKET_CAMEL |
| 3888 | CURL_CHECK_FUNC_LOCALTIME_R |
| 3889 | CURL_CHECK_FUNC_MEMRCHR |
| 3890 | CURL_CHECK_FUNC_POLL |
| 3891 | CURL_CHECK_FUNC_SETSOCKOPT |
| 3892 | CURL_CHECK_FUNC_SIGACTION |
| 3893 | CURL_CHECK_FUNC_SIGINTERRUPT |
| 3894 | CURL_CHECK_FUNC_SIGNAL |
| 3895 | CURL_CHECK_FUNC_SIGSETJMP |
| 3896 | CURL_CHECK_FUNC_SOCKET |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3897 | CURL_CHECK_FUNC_SOCKETPAIR |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3898 | CURL_CHECK_FUNC_STRCASECMP |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3899 | CURL_CHECK_FUNC_STRCMPI |
| 3900 | CURL_CHECK_FUNC_STRDUP |
| 3901 | CURL_CHECK_FUNC_STRERROR_R |
| 3902 | CURL_CHECK_FUNC_STRICMP |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3903 | CURL_CHECK_FUNC_STRNCASECMP |
| 3904 | CURL_CHECK_FUNC_STRNCMPI |
| 3905 | CURL_CHECK_FUNC_STRNICMP |
| 3906 | CURL_CHECK_FUNC_STRSTR |
| 3907 | CURL_CHECK_FUNC_STRTOK_R |
| 3908 | CURL_CHECK_FUNC_STRTOLL |
| 3909 | CURL_CHECK_FUNC_WRITEV |
| 3910 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3911 | case $host in |
| 3912 | *msdosdjgpp) |
| 3913 | ac_cv_func_pipe=no |
| 3914 | skipcheck_pipe=yes |
| 3915 | AC_MSG_NOTICE([skip check for pipe on msdosdjgpp]) |
| 3916 | ;; |
| 3917 | esac |
| 3918 | |
Elliott Hughes | 72d948d | 2018-08-03 14:37:21 -0700 | [diff] [blame] | 3919 | AC_CHECK_DECLS([getpwuid_r], [], [AC_DEFINE(HAVE_DECL_GETPWUID_R_MISSING, 1, "Set if getpwuid_r() declaration is missing")], |
| 3920 | [[#include <pwd.h> |
| 3921 | #include <sys/types.h>]]) |
| 3922 | |
| 3923 | |
| 3924 | AC_CHECK_FUNCS([fnmatch \ |
| 3925 | geteuid \ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3926 | getpass_r \ |
| 3927 | getppid \ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3928 | getpwuid \ |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3929 | getpwuid_r \ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3930 | getrlimit \ |
| 3931 | gettimeofday \ |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3932 | if_nametoindex \ |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 3933 | mach_absolute_time \ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3934 | pipe \ |
| 3935 | setlocale \ |
| 3936 | setmode \ |
| 3937 | setrlimit \ |
Haibo Huang | 445085a | 2019-09-11 13:33:50 -0700 | [diff] [blame] | 3938 | usleep \ |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 3939 | utime \ |
| 3940 | utimes |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3941 | ],[ |
| 3942 | ],[ |
| 3943 | func="$ac_func" |
| 3944 | eval skipcheck=\$skipcheck_$func |
| 3945 | if test "x$skipcheck" != "xyes"; then |
| 3946 | AC_MSG_CHECKING([deeper for $func]) |
| 3947 | AC_LINK_IFELSE([ |
| 3948 | AC_LANG_PROGRAM([[ |
| 3949 | ]],[[ |
| 3950 | $func (); |
| 3951 | ]]) |
| 3952 | ],[ |
| 3953 | AC_MSG_RESULT([yes]) |
| 3954 | eval "ac_cv_func_$func=yes" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 3955 | AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1], |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3956 | [Define to 1 if you have the $func function.]) |
| 3957 | ],[ |
| 3958 | AC_MSG_RESULT([but still no]) |
| 3959 | ]) |
| 3960 | fi |
| 3961 | ]) |
| 3962 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3963 | if test "$ipv6" = "yes"; then |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 3964 | if test "$curl_cv_func_getaddrinfo" = "yes"; then |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3965 | AC_DEFINE(ENABLE_IPV6, 1, [Define if you want to enable IPv6 support]) |
| 3966 | IPV6_ENABLED=1 |
| 3967 | AC_SUBST(IPV6_ENABLED) |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 3968 | curl_ipv6_msg="enabled" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3969 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3970 | fi |
| 3971 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 3972 | CURL_CHECK_NONBLOCKING_SOCKET |
| 3973 | |
| 3974 | dnl ************************************************************ |
| 3975 | dnl nroff tool stuff |
| 3976 | dnl |
| 3977 | |
| 3978 | AC_PATH_PROG( PERL, perl, , |
| 3979 | $PATH:/usr/local/bin/perl:/usr/bin/:/usr/local/bin ) |
| 3980 | AC_SUBST(PERL) |
| 3981 | |
| 3982 | AC_PATH_PROGS( NROFF, gnroff nroff, , |
| 3983 | $PATH:/usr/bin/:/usr/local/bin ) |
| 3984 | AC_SUBST(NROFF) |
| 3985 | |
| 3986 | if test -n "$NROFF"; then |
| 3987 | dnl only check for nroff options if an nroff command was found |
| 3988 | |
| 3989 | AC_MSG_CHECKING([how to use *nroff to get plain text from man pages]) |
| 3990 | MANOPT="-man" |
| 3991 | mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null` |
| 3992 | if test -z "$mancheck"; then |
| 3993 | MANOPT="-mandoc" |
| 3994 | mancheck=`echo foo | $NROFF $MANOPT 2>/dev/null` |
| 3995 | if test -z "$mancheck"; then |
| 3996 | MANOPT="" |
| 3997 | AC_MSG_RESULT([failed]) |
| 3998 | AC_MSG_WARN([found no *nroff option to get plaintext from man pages]) |
| 3999 | else |
| 4000 | AC_MSG_RESULT([$MANOPT]) |
| 4001 | fi |
| 4002 | else |
| 4003 | AC_MSG_RESULT([$MANOPT]) |
| 4004 | fi |
| 4005 | AC_SUBST(MANOPT) |
| 4006 | fi |
| 4007 | |
| 4008 | if test -z "$MANOPT" |
| 4009 | then |
| 4010 | dnl if no nroff tool was found, or no option that could convert man pages |
| 4011 | dnl was found, then disable the built-in manual stuff |
| 4012 | AC_MSG_WARN([disabling built-in manual]) |
| 4013 | USE_MANUAL="no"; |
| 4014 | fi |
| 4015 | |
| 4016 | dnl ************************************************************************* |
| 4017 | dnl If the manual variable still is set, then we go with providing a built-in |
| 4018 | dnl manual |
| 4019 | |
| 4020 | if test "$USE_MANUAL" = "1"; then |
| 4021 | AC_DEFINE(USE_MANUAL, 1, [If you want to build curl with the built-in manual]) |
| 4022 | curl_manual_msg="enabled" |
| 4023 | fi |
| 4024 | |
| 4025 | dnl set variable for use in automakefile(s) |
| 4026 | AM_CONDITIONAL(USE_MANUAL, test x"$USE_MANUAL" = x1) |
| 4027 | |
| 4028 | CURL_CHECK_LIB_ARES |
| 4029 | AM_CONDITIONAL(USE_EMBEDDED_ARES, test x$embedded_ares = xyes) |
| 4030 | |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 4031 | if test "x$curl_cv_native_windows" != "xyes" && |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4032 | test "x$enable_shared" = "xyes"; then |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4033 | build_libhostname=yes |
| 4034 | else |
| 4035 | build_libhostname=no |
| 4036 | fi |
| 4037 | AM_CONDITIONAL(BUILD_LIBHOSTNAME, test x$build_libhostname = xyes) |
| 4038 | |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 4039 | if test "x$want_ares" != xyes; then |
| 4040 | CURL_CHECK_OPTION_THREADED_RESOLVER |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4041 | fi |
| 4042 | |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 4043 | dnl ************************************************************ |
| 4044 | dnl disable POSIX threads |
| 4045 | dnl |
| 4046 | AC_MSG_CHECKING([whether to use POSIX threads for threaded resolver]) |
| 4047 | AC_ARG_ENABLE(pthreads, |
| 4048 | AC_HELP_STRING([--enable-pthreads], |
| 4049 | [Enable POSIX threads (default for threaded resolver)]) |
| 4050 | AC_HELP_STRING([--disable-pthreads],[Disable POSIX threads]), |
| 4051 | [ case "$enableval" in |
| 4052 | no) AC_MSG_RESULT(no) |
| 4053 | want_pthreads=no |
| 4054 | ;; |
| 4055 | *) AC_MSG_RESULT(yes) |
| 4056 | want_pthreads=yes |
| 4057 | ;; |
| 4058 | esac ], [ |
| 4059 | AC_MSG_RESULT(auto) |
| 4060 | want_pthreads=auto |
| 4061 | ] |
| 4062 | ) |
| 4063 | |
| 4064 | dnl turn off pthreads if rt is disabled |
| 4065 | if test "$want_pthreads" != "no"; then |
| 4066 | if test "$want_pthreads" = "yes" && test "$dontwant_rt" = "yes"; then |
| 4067 | AC_MSG_ERROR([options --enable-pthreads and --disable-rt are mutually exclusive]) |
| 4068 | fi |
| 4069 | if test "$dontwant_rt" != "no"; then |
| 4070 | dnl if --enable-pthreads was explicit then warn it's being ignored |
| 4071 | if test "$want_pthreads" = "yes"; then |
| 4072 | AC_MSG_WARN([--enable-pthreads Ignored since librt is disabled.]) |
| 4073 | fi |
| 4074 | want_pthreads=no |
| 4075 | fi |
| 4076 | fi |
| 4077 | |
| 4078 | dnl turn off pthreads if no threaded resolver |
| 4079 | if test "$want_pthreads" != "no" && test "$want_thres" != "yes"; then |
| 4080 | want_pthreads=no |
| 4081 | fi |
| 4082 | |
| 4083 | dnl detect pthreads |
| 4084 | if test "$want_pthreads" != "no"; then |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4085 | AC_CHECK_HEADER(pthread.h, |
| 4086 | [ AC_DEFINE(HAVE_PTHREAD_H, 1, [if you have <pthread.h>]) |
| 4087 | save_CFLAGS="$CFLAGS" |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4088 | |
| 4089 | dnl first check for function without lib |
| 4090 | AC_CHECK_FUNC(pthread_create, [USE_THREADS_POSIX=1] ) |
| 4091 | |
Elliott Hughes | a93fb05 | 2018-12-12 14:22:48 -0800 | [diff] [blame] | 4092 | dnl on HPUX, life is more complicated... |
| 4093 | case $host in |
| 4094 | *-hp-hpux*) |
| 4095 | dnl it doesn't actually work without -lpthread |
| 4096 | USE_THREADS_POSIX="" |
| 4097 | ;; |
| 4098 | *) |
| 4099 | ;; |
| 4100 | esac |
| 4101 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4102 | dnl if it wasn't found without lib, search for it in pthread lib |
| 4103 | if test "$USE_THREADS_POSIX" != "1" |
| 4104 | then |
| 4105 | CFLAGS="$CFLAGS -pthread" |
| 4106 | AC_CHECK_LIB(pthread, pthread_create, |
| 4107 | [USE_THREADS_POSIX=1], |
| 4108 | [ CFLAGS="$save_CFLAGS"]) |
| 4109 | fi |
| 4110 | |
| 4111 | if test "x$USE_THREADS_POSIX" = "x1" |
| 4112 | then |
| 4113 | AC_DEFINE(USE_THREADS_POSIX, 1, [if you want POSIX threaded DNS lookup]) |
| 4114 | curl_res_msg="POSIX threaded" |
| 4115 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4116 | ]) |
| 4117 | fi |
| 4118 | |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 4119 | dnl threaded resolver check |
| 4120 | if test "$want_thres" = "yes" && test "x$USE_THREADS_POSIX" != "x1"; then |
| 4121 | if test "$want_pthreads" = "yes"; then |
| 4122 | AC_MSG_ERROR([--enable-pthreads but pthreads was not found]) |
| 4123 | fi |
| 4124 | dnl If native Windows fallback on Win32 threads since no POSIX threads |
| 4125 | if test "$curl_cv_native_windows" = "yes"; then |
| 4126 | USE_THREADS_WIN32=1 |
| 4127 | AC_DEFINE(USE_THREADS_WIN32, 1, [if you want Win32 threaded DNS lookup]) |
| 4128 | curl_res_msg="Win32 threaded" |
| 4129 | else |
| 4130 | AC_MSG_ERROR([Threaded resolver enabled but no thread library found]) |
| 4131 | fi |
| 4132 | fi |
| 4133 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4134 | dnl ************************************************************ |
| 4135 | dnl disable verbose text strings |
| 4136 | dnl |
| 4137 | AC_MSG_CHECKING([whether to enable verbose strings]) |
| 4138 | AC_ARG_ENABLE(verbose, |
| 4139 | AC_HELP_STRING([--enable-verbose],[Enable verbose strings]) |
| 4140 | AC_HELP_STRING([--disable-verbose],[Disable verbose strings]), |
| 4141 | [ case "$enableval" in |
| 4142 | no) |
| 4143 | AC_MSG_RESULT(no) |
| 4144 | AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings]) |
| 4145 | curl_verbose_msg="no" |
| 4146 | ;; |
| 4147 | *) AC_MSG_RESULT(yes) |
| 4148 | ;; |
| 4149 | esac ], |
| 4150 | AC_MSG_RESULT(yes) |
| 4151 | ) |
| 4152 | |
| 4153 | dnl ************************************************************ |
| 4154 | dnl enable SSPI support |
| 4155 | dnl |
| 4156 | AC_MSG_CHECKING([whether to enable SSPI support (Windows native builds only)]) |
| 4157 | AC_ARG_ENABLE(sspi, |
| 4158 | AC_HELP_STRING([--enable-sspi],[Enable SSPI]) |
| 4159 | AC_HELP_STRING([--disable-sspi],[Disable SSPI]), |
| 4160 | [ case "$enableval" in |
| 4161 | yes) |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 4162 | if test "$curl_cv_native_windows" = "yes"; then |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4163 | AC_MSG_RESULT(yes) |
| 4164 | AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support]) |
| 4165 | AC_SUBST(USE_WINDOWS_SSPI, [1]) |
| 4166 | curl_sspi_msg="enabled" |
| 4167 | else |
| 4168 | AC_MSG_RESULT(no) |
| 4169 | AC_MSG_WARN([--enable-sspi Ignored. Only supported on native Windows builds.]) |
| 4170 | fi |
| 4171 | ;; |
| 4172 | *) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4173 | if test "x$WINSSL_ENABLED" = "x1"; then |
| 4174 | # --with-winssl implies --enable-sspi |
| 4175 | AC_MSG_RESULT(yes) |
| 4176 | else |
| 4177 | AC_MSG_RESULT(no) |
| 4178 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4179 | ;; |
| 4180 | esac ], |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4181 | if test "x$WINSSL_ENABLED" = "x1"; then |
| 4182 | # --with-winssl implies --enable-sspi |
| 4183 | AC_MSG_RESULT(yes) |
| 4184 | else |
| 4185 | AC_MSG_RESULT(no) |
| 4186 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4187 | ) |
| 4188 | |
| 4189 | dnl ************************************************************ |
| 4190 | dnl disable cryptographic authentication |
| 4191 | dnl |
| 4192 | AC_MSG_CHECKING([whether to enable cryptographic authentication methods]) |
| 4193 | AC_ARG_ENABLE(crypto-auth, |
| 4194 | AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication]) |
| 4195 | AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]), |
| 4196 | [ case "$enableval" in |
| 4197 | no) |
| 4198 | AC_MSG_RESULT(no) |
| 4199 | AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication]) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4200 | CURL_DISABLE_CRYPTO_AUTH=1 |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4201 | ;; |
| 4202 | *) AC_MSG_RESULT(yes) |
| 4203 | ;; |
| 4204 | esac ], |
| 4205 | AC_MSG_RESULT(yes) |
| 4206 | ) |
| 4207 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4208 | CURL_CHECK_OPTION_NTLM_WB |
| 4209 | |
| 4210 | CURL_CHECK_NTLM_WB |
| 4211 | |
| 4212 | dnl ************************************************************ |
| 4213 | dnl disable TLS-SRP authentication |
| 4214 | dnl |
| 4215 | AC_MSG_CHECKING([whether to enable TLS-SRP authentication]) |
| 4216 | AC_ARG_ENABLE(tls-srp, |
| 4217 | AC_HELP_STRING([--enable-tls-srp],[Enable TLS-SRP authentication]) |
| 4218 | AC_HELP_STRING([--disable-tls-srp],[Disable TLS-SRP authentication]), |
| 4219 | [ case "$enableval" in |
| 4220 | no) |
| 4221 | AC_MSG_RESULT(no) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4222 | want_tls_srp=no |
| 4223 | ;; |
| 4224 | *) AC_MSG_RESULT(yes) |
| 4225 | want_tls_srp=yes |
| 4226 | ;; |
| 4227 | esac ], |
| 4228 | AC_MSG_RESULT(yes) |
| 4229 | want_tls_srp=yes |
| 4230 | ) |
| 4231 | |
| 4232 | if test "$want_tls_srp" = "yes" && ( test "x$HAVE_GNUTLS_SRP" = "x1" || test "x$HAVE_OPENSSL_SRP" = "x1") ; then |
| 4233 | AC_DEFINE(USE_TLS_SRP, 1, [Use TLS-SRP authentication]) |
| 4234 | USE_TLS_SRP=1 |
| 4235 | curl_tls_srp_msg="enabled" |
| 4236 | fi |
| 4237 | |
| 4238 | dnl ************************************************************ |
| 4239 | dnl disable Unix domain sockets support |
| 4240 | dnl |
| 4241 | AC_MSG_CHECKING([whether to enable Unix domain sockets]) |
| 4242 | AC_ARG_ENABLE(unix-sockets, |
| 4243 | AC_HELP_STRING([--enable-unix-sockets],[Enable Unix domain sockets]) |
| 4244 | AC_HELP_STRING([--disable-unix-sockets],[Disable Unix domain sockets]), |
| 4245 | [ case "$enableval" in |
| 4246 | no) AC_MSG_RESULT(no) |
| 4247 | want_unix_sockets=no |
| 4248 | ;; |
| 4249 | *) AC_MSG_RESULT(yes) |
| 4250 | want_unix_sockets=yes |
| 4251 | ;; |
| 4252 | esac ], [ |
| 4253 | AC_MSG_RESULT(auto) |
| 4254 | want_unix_sockets=auto |
| 4255 | ] |
| 4256 | ) |
| 4257 | if test "x$want_unix_sockets" != "xno"; then |
| 4258 | AC_CHECK_MEMBER([struct sockaddr_un.sun_path], [ |
| 4259 | AC_DEFINE(USE_UNIX_SOCKETS, 1, [Use Unix domain sockets]) |
| 4260 | AC_SUBST(USE_UNIX_SOCKETS, [1]) |
| 4261 | curl_unix_sockets_msg="enabled" |
| 4262 | ], [ |
| 4263 | if test "x$want_unix_sockets" = "xyes"; then |
| 4264 | AC_MSG_ERROR([--enable-unix-sockets is not available on this platform!]) |
| 4265 | fi |
| 4266 | ], [ |
| 4267 | #include <sys/un.h> |
| 4268 | ]) |
| 4269 | fi |
| 4270 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4271 | dnl ************************************************************ |
| 4272 | dnl disable cookies support |
| 4273 | dnl |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 4274 | AC_MSG_CHECKING([whether to support cookies]) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4275 | AC_ARG_ENABLE(cookies, |
| 4276 | AC_HELP_STRING([--enable-cookies],[Enable cookies support]) |
| 4277 | AC_HELP_STRING([--disable-cookies],[Disable cookies support]), |
| 4278 | [ case "$enableval" in |
| 4279 | no) |
| 4280 | AC_MSG_RESULT(no) |
| 4281 | AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support]) |
| 4282 | ;; |
| 4283 | *) AC_MSG_RESULT(yes) |
| 4284 | ;; |
| 4285 | esac ], |
| 4286 | AC_MSG_RESULT(yes) |
| 4287 | ) |
| 4288 | |
| 4289 | dnl ************************************************************ |
Haibo Huang | 001784b | 2019-07-19 05:27:28 -0700 | [diff] [blame] | 4290 | dnl disable HTTP authentication support |
| 4291 | dnl |
| 4292 | AC_MSG_CHECKING([whether to support HTTP authentication]) |
| 4293 | AC_ARG_ENABLE(http-auth, |
| 4294 | AC_HELP_STRING([--enable-http-auth],[Enable HTTP authentication support]) |
| 4295 | AC_HELP_STRING([--disable-http-auth],[Disable HTTP authentication support]), |
| 4296 | [ case "$enableval" in |
| 4297 | no) |
| 4298 | AC_MSG_RESULT(no) |
| 4299 | AC_DEFINE(CURL_DISABLE_HTTP_AUTH, 1, [disable HTTP authentication]) |
| 4300 | ;; |
| 4301 | *) AC_MSG_RESULT(yes) |
| 4302 | ;; |
| 4303 | esac ], |
| 4304 | AC_MSG_RESULT(yes) |
| 4305 | ) |
| 4306 | |
| 4307 | dnl ************************************************************ |
| 4308 | dnl disable DoH support |
| 4309 | dnl |
| 4310 | AC_MSG_CHECKING([whether to support DoH]) |
| 4311 | AC_ARG_ENABLE(doh, |
| 4312 | AC_HELP_STRING([--enable-doh],[Enable DoH support]) |
| 4313 | AC_HELP_STRING([--disable-doh],[Disable DoH support]), |
| 4314 | [ case "$enableval" in |
| 4315 | no) |
| 4316 | AC_MSG_RESULT(no) |
| 4317 | AC_DEFINE(CURL_DISABLE_DOH, 1, [disable DoH]) |
| 4318 | ;; |
| 4319 | *) AC_MSG_RESULT(yes) |
| 4320 | ;; |
| 4321 | esac ], |
| 4322 | AC_MSG_RESULT(yes) |
| 4323 | ) |
| 4324 | |
| 4325 | dnl ************************************************************ |
| 4326 | dnl disable mime API support |
| 4327 | dnl |
| 4328 | AC_MSG_CHECKING([whether to support the MIME API]) |
| 4329 | AC_ARG_ENABLE(mime, |
| 4330 | AC_HELP_STRING([--enable-mime],[Enable mime API support]) |
| 4331 | AC_HELP_STRING([--disable-mime],[Disable mime API support]), |
| 4332 | [ case "$enableval" in |
| 4333 | no) |
| 4334 | AC_MSG_RESULT(no) |
| 4335 | AC_DEFINE(CURL_DISABLE_MIME, 1, [disable mime API]) |
| 4336 | ;; |
| 4337 | *) AC_MSG_RESULT(yes) |
| 4338 | ;; |
| 4339 | esac ], |
| 4340 | AC_MSG_RESULT(yes) |
| 4341 | ) |
| 4342 | |
| 4343 | dnl ************************************************************ |
| 4344 | dnl disable date parsing |
| 4345 | dnl |
| 4346 | AC_MSG_CHECKING([whether to support date parsing]) |
| 4347 | AC_ARG_ENABLE(dateparse, |
| 4348 | AC_HELP_STRING([--enable-dateparse],[Enable date parsing]) |
| 4349 | AC_HELP_STRING([--disable-dateparse],[Disable date parsing]), |
| 4350 | [ case "$enableval" in |
| 4351 | no) |
| 4352 | AC_MSG_RESULT(no) |
| 4353 | AC_DEFINE(CURL_DISABLE_PARSEDATE, 1, [disable date parsing]) |
| 4354 | ;; |
| 4355 | *) AC_MSG_RESULT(yes) |
| 4356 | ;; |
| 4357 | esac ], |
| 4358 | AC_MSG_RESULT(yes) |
| 4359 | ) |
| 4360 | |
| 4361 | dnl ************************************************************ |
| 4362 | dnl disable netrc |
| 4363 | dnl |
| 4364 | AC_MSG_CHECKING([whether to support netrc parsing]) |
| 4365 | AC_ARG_ENABLE(netrc, |
| 4366 | AC_HELP_STRING([--enable-netrc],[Enable netrc parsing]) |
| 4367 | AC_HELP_STRING([--disable-netrc],[Disable netrc parsing]), |
| 4368 | [ case "$enableval" in |
| 4369 | no) |
| 4370 | AC_MSG_RESULT(no) |
| 4371 | AC_DEFINE(CURL_DISABLE_NETRC, 1, [disable netrc parsing]) |
| 4372 | ;; |
| 4373 | *) AC_MSG_RESULT(yes) |
| 4374 | ;; |
| 4375 | esac ], |
| 4376 | AC_MSG_RESULT(yes) |
| 4377 | ) |
| 4378 | |
| 4379 | dnl ************************************************************ |
| 4380 | dnl disable progress-meter |
| 4381 | dnl |
| 4382 | AC_MSG_CHECKING([whether to support progress-meter]) |
| 4383 | AC_ARG_ENABLE(progress-meter, |
| 4384 | AC_HELP_STRING([--enable-progress-meter],[Enable progress-meter]) |
| 4385 | AC_HELP_STRING([--disable-progress-meter],[Disable progress-meter]), |
| 4386 | [ case "$enableval" in |
| 4387 | no) |
| 4388 | AC_MSG_RESULT(no) |
| 4389 | AC_DEFINE(CURL_DISABLE_PROGRESS_METER, 1, [disable progress-meter]) |
| 4390 | ;; |
| 4391 | *) AC_MSG_RESULT(yes) |
| 4392 | ;; |
| 4393 | esac ], |
| 4394 | AC_MSG_RESULT(yes) |
| 4395 | ) |
| 4396 | |
| 4397 | dnl ************************************************************ |
| 4398 | dnl disable shuffle DNS support |
| 4399 | dnl |
| 4400 | AC_MSG_CHECKING([whether to support DNS shuffling]) |
| 4401 | AC_ARG_ENABLE(dnsshuffle, |
| 4402 | AC_HELP_STRING([--enable-dnsshuffle],[Enable DNS shuffling]) |
| 4403 | AC_HELP_STRING([--disable-dnsshuffle],[Disable DNS shufflinf]), |
| 4404 | [ case "$enableval" in |
| 4405 | no) |
| 4406 | AC_MSG_RESULT(no) |
| 4407 | AC_DEFINE(CURL_DISABLE_SHUFFLE_DNS, 1, [disable DNS shuffling]) |
| 4408 | ;; |
| 4409 | *) AC_MSG_RESULT(yes) |
| 4410 | ;; |
| 4411 | esac ], |
| 4412 | AC_MSG_RESULT(yes) |
| 4413 | ) |
| 4414 | |
| 4415 | dnl ************************************************************ |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 4416 | dnl switch on/off alt-svc |
| 4417 | dnl |
| 4418 | curl_altsvc_msg="no (--enable-alt-svc)"; |
| 4419 | AC_MSG_CHECKING([whether to support alt-svc]) |
| 4420 | AC_ARG_ENABLE(alt-svc, |
| 4421 | AC_HELP_STRING([--enable-alt-svc],[Enable alt-svc support]) |
| 4422 | AC_HELP_STRING([--disable-alt-svc],[Disable alt-svc support]), |
| 4423 | [ case "$enableval" in |
| 4424 | no) |
| 4425 | AC_MSG_RESULT(no) |
| 4426 | ;; |
| 4427 | *) AC_MSG_RESULT(yes) |
| 4428 | curl_altsvc_msg="enabled"; |
| 4429 | enable_altsvc="yes" |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 4430 | ;; |
| 4431 | esac ], |
| 4432 | AC_MSG_RESULT(no) |
| 4433 | ) |
| 4434 | |
| 4435 | if test "$enable_altsvc" = "yes"; then |
| 4436 | AC_DEFINE(USE_ALTSVC, 1, [to enable alt-svc]) |
Haibo Huang | 445085a | 2019-09-11 13:33:50 -0700 | [diff] [blame] | 4437 | experimental="$experimental alt-svc" |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 4438 | fi |
| 4439 | |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 4440 | dnl ************************************************************* |
| 4441 | dnl check whether ESNI support, if desired, is actually available |
| 4442 | dnl |
| 4443 | if test "x$want_esni" != "xno"; then |
| 4444 | AC_MSG_CHECKING([whether ESNI support is available]) |
| 4445 | |
| 4446 | dnl assume NOT and look for sufficient condition |
| 4447 | ESNI_ENABLED=0 |
| 4448 | ESNI_SUPPORT='' |
| 4449 | |
| 4450 | dnl OpenSSL with a chosen ESNI function should be enough |
| 4451 | dnl so more exhaustive checking seems unnecessary for now |
| 4452 | if test "x$OPENSSL_ENABLED" == "x1"; then |
| 4453 | AC_CHECK_FUNCS(SSL_get_esni_status, |
| 4454 | ESNI_SUPPORT="ESNI support available (OpenSSL with SSL_get_esni_status)" |
| 4455 | ESNI_ENABLED=1) |
| 4456 | |
| 4457 | dnl add 'elif' chain here for additional implementations |
| 4458 | fi |
| 4459 | |
| 4460 | dnl now deal with whatever we found |
| 4461 | if test "x$ESNI_ENABLED" == "x1"; then |
| 4462 | AC_DEFINE(USE_ESNI, 1, [if ESNI support is available]) |
| 4463 | AC_MSG_RESULT($ESNI_SUPPORT) |
| 4464 | experimental="$experimental ESNI" |
| 4465 | else |
| 4466 | AC_MSG_ERROR([--enable-esni ignored: No ESNI support found]) |
| 4467 | fi |
| 4468 | fi |
| 4469 | |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 4470 | dnl ************************************************************ |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4471 | dnl hiding of library internal symbols |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4472 | dnl |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4473 | CURL_CONFIGURE_SYMBOL_HIDING |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4474 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4475 | dnl |
| 4476 | dnl All the library dependencies put into $LIB apply to libcurl only. |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4477 | dnl |
| 4478 | LIBCURL_LIBS=$LIBS |
| 4479 | |
| 4480 | AC_SUBST(LIBCURL_LIBS) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4481 | AC_SUBST(CURL_NETWORK_LIBS) |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4482 | AC_SUBST(CURL_NETWORK_AND_TIME_LIBS) |
| 4483 | |
| 4484 | dnl BLANK_AT_MAKETIME may be used in our Makefile.am files to blank |
| 4485 | dnl LIBS variable used in generated makefile at makefile processing |
| 4486 | dnl time. Doing this functionally prevents LIBS from being used for |
| 4487 | dnl all link targets in given makefile. |
| 4488 | BLANK_AT_MAKETIME= |
| 4489 | AC_SUBST(BLANK_AT_MAKETIME) |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4490 | |
| 4491 | AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes) |
| 4492 | |
| 4493 | dnl yes or no |
| 4494 | ENABLE_SHARED="$enable_shared" |
| 4495 | AC_SUBST(ENABLE_SHARED) |
| 4496 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4497 | dnl to let curl-config output the static libraries correctly |
| 4498 | ENABLE_STATIC="$enable_static" |
| 4499 | AC_SUBST(ENABLE_STATIC) |
| 4500 | |
| 4501 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4502 | dnl |
| 4503 | dnl For keeping supported features and protocols also in pkg-config file |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4504 | dnl since it is more cross-compile friendly than curl-config |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4505 | dnl |
| 4506 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4507 | if test "x$OPENSSL_ENABLED" = "x1"; then |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4508 | SUPPORT_FEATURES="$SUPPORT_FEATURES SSL" |
| 4509 | elif test -n "$SSL_ENABLED"; then |
| 4510 | SUPPORT_FEATURES="$SUPPORT_FEATURES SSL" |
| 4511 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4512 | if test "x$IPV6_ENABLED" = "x1"; then |
| 4513 | SUPPORT_FEATURES="$SUPPORT_FEATURES IPv6" |
| 4514 | fi |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4515 | if test "x$USE_UNIX_SOCKETS" = "x1"; then |
| 4516 | SUPPORT_FEATURES="$SUPPORT_FEATURES UnixSockets" |
| 4517 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4518 | if test "x$HAVE_LIBZ" = "x1"; then |
| 4519 | SUPPORT_FEATURES="$SUPPORT_FEATURES libz" |
| 4520 | fi |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 4521 | if test "x$HAVE_BROTLI" = "x1"; then |
| 4522 | SUPPORT_FEATURES="$SUPPORT_FEATURES brotli" |
| 4523 | fi |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 4524 | if test "x$USE_ARES" = "x1" -o "x$USE_THREADS_POSIX" = "x1" \ |
| 4525 | -o "x$USE_THREADS_WIN32" = "x1"; then |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4526 | SUPPORT_FEATURES="$SUPPORT_FEATURES AsynchDNS" |
| 4527 | fi |
| 4528 | if test "x$IDN_ENABLED" = "x1"; then |
| 4529 | SUPPORT_FEATURES="$SUPPORT_FEATURES IDN" |
| 4530 | fi |
| 4531 | if test "x$USE_WINDOWS_SSPI" = "x1"; then |
| 4532 | SUPPORT_FEATURES="$SUPPORT_FEATURES SSPI" |
| 4533 | fi |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4534 | |
| 4535 | if test "x$HAVE_GSSAPI" = "x1"; then |
| 4536 | SUPPORT_FEATURES="$SUPPORT_FEATURES GSS-API" |
| 4537 | fi |
| 4538 | |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 4539 | if test "x$curl_psl_msg" = "xenabled"; then |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 4540 | SUPPORT_FEATURES="$SUPPORT_FEATURES PSL" |
| 4541 | fi |
| 4542 | |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 4543 | if test "x$enable_altsvc" = "xyes"; then |
| 4544 | SUPPORT_FEATURES="$SUPPORT_FEATURES alt-svc" |
| 4545 | fi |
| 4546 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4547 | if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \ |
| 4548 | \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then |
| 4549 | SUPPORT_FEATURES="$SUPPORT_FEATURES SPNEGO" |
| 4550 | fi |
| 4551 | |
| 4552 | if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" -a \ |
| 4553 | \( "x$HAVE_GSSAPI" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \); then |
| 4554 | SUPPORT_FEATURES="$SUPPORT_FEATURES Kerberos" |
| 4555 | fi |
| 4556 | |
| 4557 | if test "x$CURL_DISABLE_CRYPTO_AUTH" != "x1"; then |
| 4558 | if test "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \ |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 4559 | -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \ |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 4560 | -o "x$NSS_ENABLED" = "x1" -o "x$SECURETRANSPORT_ENABLED" = "x1"; then |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4561 | SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM" |
| 4562 | |
| 4563 | if test "x$CURL_DISABLE_HTTP" != "x1" -a \ |
| 4564 | "x$NTLM_WB_ENABLED" = "x1"; then |
| 4565 | SUPPORT_FEATURES="$SUPPORT_FEATURES NTLM_WB" |
| 4566 | fi |
| 4567 | fi |
| 4568 | fi |
| 4569 | |
| 4570 | if test "x$USE_TLS_SRP" = "x1"; then |
| 4571 | SUPPORT_FEATURES="$SUPPORT_FEATURES TLS-SRP" |
| 4572 | fi |
| 4573 | |
| 4574 | if test "x$USE_NGHTTP2" = "x1"; then |
| 4575 | SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP2" |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4576 | fi |
| 4577 | |
Haibo Huang | 445085a | 2019-09-11 13:33:50 -0700 | [diff] [blame] | 4578 | if test "x$USE_NGTCP2" = "x1" -o "x$USE_QUICHE" = "x1"; then |
| 4579 | SUPPORT_FEATURES="$SUPPORT_FEATURES HTTP3" |
| 4580 | fi |
| 4581 | |
Alex Deymo | 486467e | 2017-12-19 19:04:07 +0100 | [diff] [blame] | 4582 | if test "x$CURL_WITH_MULTI_SSL" = "x1"; then |
| 4583 | SUPPORT_FEATURES="$SUPPORT_FEATURES MultiSSL" |
| 4584 | fi |
| 4585 | |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 4586 | if test "x$OPENSSL_ENABLED" = "x1" -o "x$GNUTLS_ENABLED" = "x1" \ |
| 4587 | -o "x$NSS_ENABLED" = "x1"; then |
| 4588 | SUPPORT_FEATURES="$SUPPORT_FEATURES HTTPS-proxy" |
| 4589 | fi |
| 4590 | |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 4591 | if test "x$ESNI_ENABLED" = "x1"; then |
| 4592 | SUPPORT_FEATURES="$SUPPORT_FEATURES ESNI" |
| 4593 | fi |
| 4594 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4595 | AC_SUBST(SUPPORT_FEATURES) |
| 4596 | |
| 4597 | dnl For supported protocols in pkg-config file |
| 4598 | if test "x$CURL_DISABLE_HTTP" != "x1"; then |
| 4599 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTP" |
| 4600 | if test "x$SSL_ENABLED" = "x1"; then |
| 4601 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS HTTPS" |
| 4602 | fi |
| 4603 | fi |
| 4604 | if test "x$CURL_DISABLE_FTP" != "x1"; then |
| 4605 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTP" |
| 4606 | if test "x$SSL_ENABLED" = "x1"; then |
| 4607 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FTPS" |
| 4608 | fi |
| 4609 | fi |
| 4610 | if test "x$CURL_DISABLE_FILE" != "x1"; then |
| 4611 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS FILE" |
| 4612 | fi |
| 4613 | if test "x$CURL_DISABLE_TELNET" != "x1"; then |
| 4614 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TELNET" |
| 4615 | fi |
| 4616 | if test "x$CURL_DISABLE_LDAP" != "x1"; then |
| 4617 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAP" |
| 4618 | if test "x$CURL_DISABLE_LDAPS" != "x1"; then |
| 4619 | if (test "x$USE_OPENLDAP" = "x1" && test "x$SSL_ENABLED" = "x1") || |
| 4620 | (test "x$USE_OPENLDAP" != "x1" && test "x$HAVE_LDAP_SSL" = "x1"); then |
| 4621 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS LDAPS" |
| 4622 | fi |
| 4623 | fi |
| 4624 | fi |
| 4625 | if test "x$CURL_DISABLE_DICT" != "x1"; then |
| 4626 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS DICT" |
| 4627 | fi |
| 4628 | if test "x$CURL_DISABLE_TFTP" != "x1"; then |
| 4629 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS TFTP" |
| 4630 | fi |
| 4631 | if test "x$CURL_DISABLE_GOPHER" != "x1"; then |
| 4632 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS GOPHER" |
| 4633 | fi |
| 4634 | if test "x$CURL_DISABLE_POP3" != "x1"; then |
| 4635 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3" |
| 4636 | if test "x$SSL_ENABLED" = "x1"; then |
| 4637 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS POP3S" |
| 4638 | fi |
| 4639 | fi |
| 4640 | if test "x$CURL_DISABLE_IMAP" != "x1"; then |
| 4641 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAP" |
| 4642 | if test "x$SSL_ENABLED" = "x1"; then |
| 4643 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS IMAPS" |
| 4644 | fi |
| 4645 | fi |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4646 | if test "x$CURL_DISABLE_SMB" != "x1" \ |
| 4647 | -a "x$CURL_DISABLE_CRYPTO_AUTH" != "x1" \ |
| 4648 | -a \( "x$OPENSSL_ENABLED" = "x1" -o "x$USE_WINDOWS_SSPI" = "x1" \ |
Elliott Hughes | cee0338 | 2017-06-23 12:17:18 -0700 | [diff] [blame] | 4649 | -o "x$GNUTLS_ENABLED" = "x1" -o "x$MBEDTLS_ENABLED" = "x1" \ |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 4650 | -o "x$NSS_ENABLED" = "x1" -o "x$SECURETRANSPORT_ENABLED" = "x1" \); then |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4651 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMB" |
| 4652 | if test "x$SSL_ENABLED" = "x1"; then |
| 4653 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMBS" |
| 4654 | fi |
| 4655 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4656 | if test "x$CURL_DISABLE_SMTP" != "x1"; then |
| 4657 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTP" |
| 4658 | if test "x$SSL_ENABLED" = "x1"; then |
| 4659 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SMTPS" |
| 4660 | fi |
| 4661 | fi |
| 4662 | if test "x$USE_LIBSSH2" = "x1"; then |
| 4663 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP" |
| 4664 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" |
| 4665 | fi |
Elliott Hughes | 0128fe4 | 2018-02-27 14:57:55 -0800 | [diff] [blame] | 4666 | if test "x$USE_LIBSSH" = "x1"; then |
| 4667 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SCP" |
| 4668 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS SFTP" |
| 4669 | fi |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4670 | if test "x$CURL_DISABLE_RTSP" != "x1"; then |
| 4671 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTSP" |
| 4672 | fi |
| 4673 | if test "x$USE_LIBRTMP" = "x1"; then |
| 4674 | SUPPORT_PROTOCOLS="$SUPPORT_PROTOCOLS RTMP" |
| 4675 | fi |
| 4676 | |
| 4677 | dnl replace spaces with newlines |
| 4678 | dnl sort the lines |
| 4679 | dnl replace the newlines back to spaces |
| 4680 | SUPPORT_PROTOCOLS=`echo $SUPPORT_PROTOCOLS | tr ' ' '\012' | sort | tr '\012' ' '` |
| 4681 | |
| 4682 | AC_SUBST(SUPPORT_PROTOCOLS) |
| 4683 | |
| 4684 | dnl squeeze whitespace out of some variables |
| 4685 | |
| 4686 | squeeze CFLAGS |
| 4687 | squeeze CPPFLAGS |
| 4688 | squeeze DEFS |
| 4689 | squeeze LDFLAGS |
| 4690 | squeeze LIBS |
| 4691 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4692 | squeeze LIBCURL_LIBS |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4693 | squeeze CURL_NETWORK_LIBS |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4694 | squeeze CURL_NETWORK_AND_TIME_LIBS |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4695 | |
| 4696 | squeeze SUPPORT_FEATURES |
| 4697 | squeeze SUPPORT_PROTOCOLS |
| 4698 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4699 | XC_CHECK_BUILD_FLAGS |
| 4700 | |
Elliott Hughes | 0128fe4 | 2018-02-27 14:57:55 -0800 | [diff] [blame] | 4701 | SSL_BACKENDS=${ssl_backends} |
| 4702 | AC_SUBST(SSL_BACKENDS) |
| 4703 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4704 | if test "x$want_curldebug_assumed" = "xyes" && |
| 4705 | test "x$want_curldebug" = "xyes" && test "x$USE_ARES" = "x1"; then |
| 4706 | ac_configure_args="$ac_configure_args --enable-curldebug" |
| 4707 | fi |
| 4708 | |
| 4709 | AC_CONFIG_FILES([Makefile \ |
| 4710 | docs/Makefile \ |
| 4711 | docs/examples/Makefile \ |
| 4712 | docs/libcurl/Makefile \ |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4713 | docs/libcurl/opts/Makefile \ |
Elliott Hughes | 82be86d | 2017-09-20 17:00:17 -0700 | [diff] [blame] | 4714 | docs/cmdline-opts/Makefile \ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4715 | include/Makefile \ |
| 4716 | include/curl/Makefile \ |
| 4717 | src/Makefile \ |
| 4718 | lib/Makefile \ |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 4719 | scripts/Makefile \ |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4720 | lib/libcurl.vers \ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4721 | tests/Makefile \ |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4722 | tests/certs/Makefile \ |
| 4723 | tests/certs/scripts/Makefile \ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4724 | tests/data/Makefile \ |
| 4725 | tests/server/Makefile \ |
| 4726 | tests/libtest/Makefile \ |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4727 | tests/unit/Makefile \ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4728 | packages/Makefile \ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4729 | packages/vms/Makefile \ |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4730 | curl-config \ |
| 4731 | libcurl.pc |
| 4732 | ]) |
| 4733 | AC_OUTPUT |
| 4734 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4735 | CURL_GENERATE_CONFIGUREHELP_PM |
| 4736 | |
| 4737 | XC_AMEND_DISTCLEAN([lib src tests/unit tests/server tests/libtest docs/examples]) |
| 4738 | |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4739 | AC_MSG_NOTICE([Configured to build curl/libcurl: |
| 4740 | |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4741 | Host setup: ${host} |
| 4742 | Install prefix: ${prefix} |
| 4743 | Compiler: ${CC} |
Haibo Huang | 21926d5 | 2019-01-08 14:27:10 -0800 | [diff] [blame] | 4744 | CFLAGS: ${CFLAGS} |
| 4745 | CPPFLAGS: ${CPPFLAGS} |
| 4746 | LDFLAGS: ${LDFLAGS} |
| 4747 | LIBS: ${LIBS} |
| 4748 | |
| 4749 | curl version: ${CURLVERSION} |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 4750 | SSL: ${curl_ssl_msg} |
| 4751 | SSH: ${curl_ssh_msg} |
| 4752 | zlib: ${curl_zlib_msg} |
| 4753 | brotli: ${curl_brotli_msg} |
| 4754 | GSS-API: ${curl_gss_msg} |
| 4755 | TLS-SRP: ${curl_tls_srp_msg} |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4756 | resolver: ${curl_res_msg} |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 4757 | IPv6: ${curl_ipv6_msg} |
| 4758 | Unix sockets: ${curl_unix_sockets_msg} |
| 4759 | IDN: ${curl_idn_msg} |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4760 | Build libcurl: Shared=${enable_shared}, Static=${enable_static} |
| 4761 | Built-in manual: ${curl_manual_msg} |
| 4762 | --libcurl option: ${curl_libcurl_msg} |
| 4763 | Verbose errors: ${curl_verbose_msg} |
Haibo Huang | 51d9d88 | 2019-02-06 01:36:06 -0800 | [diff] [blame] | 4764 | Code coverage: ${curl_coverage_msg} |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 4765 | SSPI: ${curl_sspi_msg} |
Alex Deymo | d15eaac | 2016-06-28 14:49:26 -0700 | [diff] [blame] | 4766 | ca cert bundle: ${ca}${ca_warning} |
| 4767 | ca cert path: ${capath}${capath_warning} |
| 4768 | ca fallback: ${with_ca_fallback} |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 4769 | LDAP: ${curl_ldap_msg} |
| 4770 | LDAPS: ${curl_ldaps_msg} |
| 4771 | RTSP: ${curl_rtsp_msg} |
| 4772 | RTMP: ${curl_rtmp_msg} |
| 4773 | Metalink: ${curl_mtlnk_msg} |
| 4774 | PSL: ${curl_psl_msg} |
| 4775 | Alt-svc: ${curl_altsvc_msg} |
| 4776 | HTTP2: ${curl_h2_msg} |
Haibo Huang | 445085a | 2019-09-11 13:33:50 -0700 | [diff] [blame] | 4777 | HTTP3: ${curl_h3_msg} |
Haibo Huang | 3194407 | 2019-11-06 02:28:57 -0800 | [diff] [blame^] | 4778 | ESNI: ${curl_esni_msg} |
Bertrand SIMONNET | e6cd738 | 2015-07-01 15:39:44 -0700 | [diff] [blame] | 4779 | Protocols: ${SUPPORT_PROTOCOLS} |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 4780 | Features: ${SUPPORT_FEATURES} |
Lucas Eckels | 9bd90e6 | 2012-08-06 15:07:02 -0700 | [diff] [blame] | 4781 | ]) |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 4782 | if test -n "$experimental"; then |
| 4783 | cat >&2 << _EOF |
Haibo Huang | 445085a | 2019-09-11 13:33:50 -0700 | [diff] [blame] | 4784 | WARNING: $experimental enabled but marked EXPERIMENTAL. Use with caution! |
Haibo Huang | 65021c7 | 2019-03-27 15:37:23 -0700 | [diff] [blame] | 4785 | _EOF |
| 4786 | fi |