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