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