Skip to content
configure.ac 117 KiB
Newer Older
#***************************************************************************
#                                  _   _ ____  _
#  Project                     ___| | | |  _ \| |
#                             / __| | | | |_) | |
#                            | (__| |_| |  _ <| |___
#                             \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.haxx.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
#***************************************************************************
Daniel Stenberg's avatar
Daniel Stenberg committed
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.57)
Dan Fandrich's avatar
Dan Fandrich committed
dnl We don't know the version number "statically" so we use a dash here
AC_INIT([curl], [-], [a suitable curl mailing list: https://curl.haxx.se/mail/])
Yang Tse's avatar
Yang Tse committed
XC_OVR_ZZ50
XC_OVR_ZZ60
CURL_OVERRIDE_AUTOCONF

AC_COPYRIGHT([Copyright (c) 1998 - 2017 Daniel Stenberg, <daniel@haxx.se>
Guenter Knauf's avatar
Guenter Knauf committed
This configure script may be copied, distributed and modified under the
terms of the curl license; see COPYING for more details])

AC_CONFIG_SRCDIR([lib/urldata.h])
AC_CONFIG_HEADERS(lib/curl_config.h)
Yang Tse's avatar
Yang Tse committed
AC_CONFIG_MACRO_DIR([m4])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
CURL_CHECK_OPTION_OPTIMIZE
CURL_CHECK_OPTION_WARNINGS
CURL_CHECK_OPTION_WERROR
CURL_CHECK_OPTION_SYMBOL_HIDING
CURL_CHECK_OPTION_ARES
CURL_CHECK_OPTION_RT
XC_CHECK_PATH_SEPARATOR
AX_CODE_COVERAGE
AC_PROG_CXX
#
# save the configure arguments
#
CONFIGURE_OPTIONS="\"$ac_configure_args\""
AC_SUBST(CONFIGURE_OPTIONS)

CURL_CFLAG_EXTRAS=""
if test X"$want_werror" = Xyes; then
  CURL_CFLAG_EXTRAS="-Werror"
fi
AC_SUBST(CURL_CFLAG_EXTRAS)

dnl SED is mandatory for configure process and libtool.
dnl Set it now, allowing it to be changed later.
if test -z "$SED"; then
  dnl allow it to be overridden
  AC_PATH_PROG([SED], [sed], [not_found],
    [$PATH:/usr/bin:/usr/local/bin])
  if test -z "$SED" || test "$SED" = "not_found"; then
    AC_MSG_ERROR([sed not found in PATH. Cannot continue without sed.])
  fi
dnl GREP is mandatory for configure process and libtool.
dnl Set it now, allowing it to be changed later.
if test -z "$GREP"; then
  dnl allow it to be overridden
  AC_PATH_PROG([GREP], [grep], [not_found],
    [$PATH:/usr/bin:/usr/local/bin])
  if test -z "$GREP" || test "$GREP" = "not_found"; then
    AC_MSG_ERROR([grep not found in PATH. Cannot continue without grep.])
  fi

dnl EGREP is mandatory for configure process and libtool.
dnl Set it now, allowing it to be changed later.
if test -z "$EGREP"; then
  dnl allow it to be overridden
  if echo a | ($GREP -E '(a|b)') >/dev/null 2>&1; then
    AC_MSG_CHECKING([for egrep])
    EGREP="$GREP -E"
    AC_MSG_RESULT([$EGREP])
  else
    AC_PATH_PROG([EGREP], [egrep], [not_found],
      [$PATH:/usr/bin:/usr/local/bin])
  fi
if test -z "$EGREP" || test "$EGREP" = "not_found"; then
  AC_MSG_ERROR([egrep not found in PATH. Cannot continue without egrep.])
fi
dnl AR is mandatory for configure process and libtool.
Yang Tse's avatar
Yang Tse committed
dnl This is target dependent, so check it as a tool.
if test -z "$AR"; then
  dnl allow it to be overridden
  AC_PATH_TOOL([AR], [ar], [not_found],
    [$PATH:/usr/bin:/usr/local/bin])
  if test -z "$AR" || test "$AR" = "not_found"; then
    AC_MSG_ERROR([ar not found in PATH. Cannot continue without ar.])
  fi
AC_SUBST(libext)
dnl figure out the libcurl version
CURLVERSION=`$SED -ne 's/^#define LIBCURL_VERSION "\(.*\)".*/\1/p' ${srcdir}/include/curl/curlver.h`
XC_CHECK_PROG_CC
AC_MSG_CHECKING([curl version])
AC_MSG_RESULT($CURLVERSION)
AC_SUBST(CURLVERSION)

dnl
dnl we extract the numerical version for curl-config only
VERSIONNUM=`$SED -ne 's/^#define LIBCURL_VERSION_NUM 0x\([0-9A-Fa-f]*\).*/\1/p' ${srcdir}/include/curl/curlver.h`
dnl Solaris pkgadd support definitions
PKGADD_PKG="HAXXcurl"
Daniel Stenberg's avatar
Daniel Stenberg committed
PKGADD_NAME="curl - a client that groks URLs"
PKGADD_VENDOR="curl.haxx.se"
AC_SUBST(PKGADD_PKG)
AC_SUBST(PKGADD_NAME)
AC_SUBST(PKGADD_VENDOR)

Daniel Stenberg's avatar
Daniel Stenberg committed
dnl
dnl initialize all the info variables
    curl_ssl_msg="no      (--with-{ssl,gnutls,nss,polarssl,mbedtls,cyassl,axtls,winssl,darwinssl} )"
    curl_ssh_msg="no      (--with-libssh2)"
   curl_zlib_msg="no      (--with-zlib)"
    curl_gss_msg="no      (--with-gssapi)"
curl_tls_srp_msg="no      (--enable-tls-srp)"
    curl_res_msg="default (--enable-ares / --enable-threaded-resolver)"
   curl_ipv6_msg="no      (--enable-ipv6)"
curl_unix_sockets_msg="no      (--enable-unix-sockets)"
    curl_idn_msg="no      (--with-{libidn2,winidn})"
 curl_manual_msg="no      (--enable-manual)"
curl_libcurl_msg="enabled (--disable-libcurl-option)"
curl_verbose_msg="enabled (--disable-verbose)"
   curl_ldap_msg="no      (--enable-ldap / --with-ldap-lib / --with-lber-lib)"
  curl_ldaps_msg="no      (--enable-ldaps)"
   curl_rtmp_msg="no      (--with-librtmp)"
  curl_mtlnk_msg="no      (--with-libmetalink)"
    curl_psl_msg="no      (--with-libpsl)"
dnl Save some initial values the user might have provided
INITIAL_LDFLAGS=$LDFLAGS
INITIAL_LIBS=$LIBS
dnl
dnl Detect the canonical host and target build environment
dnl
Daniel Stenberg's avatar
Daniel Stenberg committed

AC_CANONICAL_HOST
dnl Get system canonical name
AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS])
dnl This defines _ALL_SOURCE for AIX
CURL_CHECK_AIX_ALL_SOURCE

dnl Our configure and build reentrant settings
Yang Tse's avatar
 
Yang Tse committed
CURL_CONFIGURE_THREAD_SAFE
dnl check for how to do large files
AC_SYS_LARGEFILE
#
# Automake conditionals based on libtool related checks
Loading
Loading full blame…