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