Skip to content
Snippets Groups Projects
configure.ac 63.4 KiB
Newer Older
  • Learn to ignore specific revisions
  •          dnl verify that a sufficient c-ares is here if we have pointed one
             dnl out and don't use the "embedded" ares dir (in which case we don't
             dnl check it because it might not have been built yet)
             AC_MSG_CHECKING([that c-ares is good and recent enough])
             AC_LINK_IFELSE( [
    #include <ares.h>
    /* provide a set of dummy functions in case c-ares was built with debug */
    void curl_dofree() { }
    void curl_sclose() { }
    void curl_domalloc() { }
    
    int main(void)
    {
      ares_channel channel;
      ares_cancel(channel);
      return 0;
    }
    ],
              AC_MSG_RESULT(yes),
              AC_MSG_RESULT(no)
              AC_MSG_ERROR([c-ares library defective or too old])
              )
           fi
           ;;
      esac ],
           AC_MSG_RESULT(no)
    )
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    
    
    dnl ************************************************************
    dnl disable verbose text strings
    dnl
    AC_MSG_CHECKING([whether to enable verbose strings])
    AC_ARG_ENABLE(verbose,
    AC_HELP_STRING([--enable-verbose],[Enable verbose strings])
    AC_HELP_STRING([--disable-verbose],[Disable verbose strings]),
    [ case "$enableval" in
      no)
           AC_MSG_RESULT(no)
           AC_DEFINE(CURL_DISABLE_VERBOSE_STRINGS, 1, [to disable verbose strings])
           AC_SUBST(CURL_DISABLE_VERBOSE_STRINGS)
           curl_verbose_msg="no"
           ;;
      *)   AC_MSG_RESULT(yes)
           ;;
      esac ],
           AC_MSG_RESULT(yes)
    )
    
    
    dnl ************************************************************
    dnl enable SSPI support
    dnl
    AC_MSG_CHECKING([whether to enable SSPI support (win32 builds only)])
    AC_ARG_ENABLE(sspi,
    AC_HELP_STRING([--enable-sspi],[Enable SSPI])
    AC_HELP_STRING([--disable-sspi],[Disable SSPI]),
    [ case "$enableval" in
      yes)
           AC_MSG_RESULT(yes)
           AC_DEFINE(USE_WINDOWS_SSPI, 1, [to enable SSPI support])
           AC_SUBST(USE_WINDOWS_SSPI)
           curl_sspi_msg="yes"
           ;;
      *)
           AC_MSG_RESULT(no)
           ;;
      esac ],
           AC_MSG_RESULT(no)
    )
    
    
    dnl ************************************************************
    dnl lame option to switch on debug options
    dnl
    AC_MSG_CHECKING([whether to enable debug options])
    AC_ARG_ENABLE(debug,
    
    AC_HELP_STRING([--enable-debug],[Enable pedantic debug options])
    AC_HELP_STRING([--disable-debug],[Disable debug options]),
    
    [ case "$enableval" in
      no)
           AC_MSG_RESULT(no)
           ;;
      *)   AC_MSG_RESULT(yes)
    
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
        CPPFLAGS="$CPPFLAGS -DCURLDEBUG"
    
        dnl set compiler "debug" options to become more picky, and remove
        dnl optimize options from CFLAGS
        CURL_CC_DEBUG_OPTS
    
    dnl ************************************************************
    dnl disable cryptographic authentication
    dnl
    AC_MSG_CHECKING([whether to enable cryptographic authentication methods])
    AC_ARG_ENABLE(crypto-auth,
    AC_HELP_STRING([--enable-crypto-auth],[Enable cryptographic authentication])
    AC_HELP_STRING([--disable-crypto-auth],[Disable cryptographic authentication]),
    [ case "$enableval" in
      no)
           AC_MSG_RESULT(no)
           AC_DEFINE(CURL_DISABLE_CRYPTO_AUTH, 1, [to disable cryptographic authentication])
           AC_SUBST(CURL_DISABLE_CRYPTO_AUTH)
           ;;
      *)   AC_MSG_RESULT(yes)
           ;;
      esac ],
           AC_MSG_RESULT(yes)
    )
    
    
    dnl ************************************************************
    dnl disable cookies support
    dnl
    AC_MSG_CHECKING([whether to enable support for cookies])
    AC_ARG_ENABLE(cookies,
    AC_HELP_STRING([--enable-cookies],[Enable cookies support])
    AC_HELP_STRING([--disable-cookies],[Disable cookies support]),
    [ case "$enableval" in
      no)
           AC_MSG_RESULT(no)
           AC_DEFINE(CURL_DISABLE_COOKIES, 1, [to disable cookies support])
           AC_SUBST(CURL_DISABLE_COOKIES)
           ;;
      *)   AC_MSG_RESULT(yes)
           ;;
      esac ],
           AC_MSG_RESULT(yes)
    )
    
    
    dnl ************************************************************
    dnl Enable hiding of internal symbols in library to reduce its size and
    dnl speed dynamic linking of applications.  This currently is only supported
    
    dnl on gcc >= 4.0 and SunPro C.
    
    dnl
    AC_MSG_CHECKING([whether to enable hidden symbols in the library])
    AC_ARG_ENABLE(hidden-symbols,
    
    AC_HELP_STRING([--enable-hidden-symbols],[Hide internal symbols in library])
    
    AC_HELP_STRING([--disable-hidden-symbols],[Leave all symbols with default visibility in library]),
    [ case "$enableval" in
      no)
           AC_MSG_RESULT(no)
           ;;
    
           AC_MSG_CHECKING([whether $CC supports it])
    
           if test "$GCC" = yes ; then
             if $CC --help --verbose 2>&1 | grep fvisibility= > /dev/null ; then
    	   AC_MSG_RESULT(yes)
    	   AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
    	   AC_SUBST(CURL_HIDDEN_SYMBOLS)
    
    	   AC_DEFINE(CURL_EXTERN_SYMBOL, [__attribute__ ((visibility ("default")))], [to make a symbol visible])
    	   AC_SUBST(CURL_EXTERN_SYMBOL)
    
    	   CFLAGS="$CFLAGS -fvisibility=hidden"
             else
                AC_MSG_RESULT(no)
              fi
    
           	 dnl Test for SunPro cc
           	 if $CC 2>&1 | grep flags >/dev/null && $CC -flags | grep xldscope= >/dev/null ; then
               AC_MSG_RESULT(yes)
    	   AC_DEFINE(CURL_HIDDEN_SYMBOLS, 1, [to enable hidden symbols])
    	   AC_SUBST(CURL_HIDDEN_SYMBOLS)
    	   AC_DEFINE(CURL_EXTERN_SYMBOL, [__global], [to make a symbol visible])
    	   AC_SUBST(CURL_EXTERN_SYMBOL)
    	   CFLAGS="$CFLAGS -xldscope=hidden"
             else
               AC_MSG_RESULT(no)
             fi
    
           ;;
      esac ],
           AC_MSG_RESULT(no)
    )
    
    dnl ************************************************************
    
    if test "x$ws2" = "xyes"; then
    
      dnl If ws2_32 is wanted, make sure it is the _last_ lib in LIBS (makes
      dnl things work when built with c-ares). But we can't just move it last
      dnl since then other stuff (SSL) won't build. So we simply append it to the
      dnl end.
    
      LIBS="$LIBS -lws2_32"
    
    fi
    
    
    AM_CONDITIONAL(CROSSCOMPILING, test x$cross_compiling = xyes)
    
    
    AC_CONFIG_FILES([Makefile \
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    	   docs/Makefile \
    
               docs/examples/Makefile \
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
               docs/libcurl/Makefile \
    
    	   include/Makefile \
    	   include/curl/Makefile \
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    	   src/Makefile \
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
               lib/Makefile \
    
               tests/Makefile \
    
               tests/data/Makefile \
    
               tests/server/Makefile \
    
               tests/libtest/Makefile \
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    	   packages/Makefile \
    	   packages/Win32/Makefile \
    
    	   packages/Win32/cygwin/Makefile \
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    	   packages/Linux/Makefile \
    	   packages/Linux/RPM/Makefile \
    
    	   packages/Linux/RPM/curl.spec \
    
    	   packages/Linux/RPM/curl-ssl.spec \
    
               packages/DOS/Makefile \
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
               packages/EPM/curl.list \
               packages/EPM/Makefile \
    
               packages/vms/Makefile \
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
               packages/AIX/Makefile \
               packages/AIX/RPM/Makefile \
    
               packages/AIX/RPM/curl.spec \
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
               curl-config \
               libcurl.pc
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    
    AC_MSG_NOTICE([Configured to build curl/libcurl:
    
      curl version:    ${VERSION}
      Host setup:      ${host}
      Install prefix:  ${prefix}
      Compiler:        ${CC}
      SSL support:     ${curl_ssl_msg}
    
      SSH support:     ${curl_ssh_msg}
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
      zlib support:    ${curl_zlib_msg}
      krb4 support:    ${curl_krb4_msg}
      GSSAPI support:  ${curl_gss_msg}
    
      SPNEGO support:  ${curl_spnego_msg}
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
      c-ares support:  ${curl_ares_msg}
      ipv6 support:    ${curl_ipv6_msg}
    
      IDN support:     ${curl_idn_msg}
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
      Build libcurl:   Shared=${enable_shared}, Static=${enable_static} 
      Built-in manual: ${curl_manual_msg}
    
      Verbose errors:  ${curl_verbose_msg}
    
    Daniel Stenberg's avatar
    Daniel Stenberg committed
    ])