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