Changeset 14436 for trunk/configure.ac


Ignore:
Timestamp:
Jan 7, 2015, 2:04:08 AM (7 years ago)
Author:
mikedld
Message:

#4400: Add CyaSSL support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r14429 r14436  
    3838##
    3939##
     40
    4041CURL_MINIMUM=7.15.4
    4142AC_SUBST(CURL_MINIMUM)
    4243LIBEVENT_MINIMUM=2.0.10
    4344AC_SUBST(LIBEVENT_MINIMUM)
     45ZLIB_MINIMUM=1.2.3
     46AC_SUBST(ZLIB_MINIMUM)
     47
     48# crypto backends
    4449OPENSSL_MINIMUM=0.9.4
    4550AC_SUBST(OPENSSL_MINIMUM)
    46 ZLIB_MINIMUM=1.2.3
    47 AC_SUBST(ZLIB_MINIMUM)
     51CYASSL_MINIMUM=3.0
     52AC_SUBST(CYASSL_MINIMUM)
    4853
    4954##
     
    113118AC_SEARCH_LIBS([gethostbyname], [nsl bind])
    114119AC_SEARCH_LIBS([quotacursor_skipidtype], [quota])
    115 PKG_CHECK_MODULES(OPENSSL, [openssl >= $OPENSSL_MINIMUM], , [CHECK_SSL()])
    116120PKG_CHECK_MODULES(LIBCURL, [libcurl >= $CURL_MINIMUM])
    117121PKG_CHECK_MODULES(LIBEVENT, [libevent >= $LIBEVENT_MINIMUM])
    118122PKG_CHECK_MODULES(ZLIB, [zlib >= $ZLIB_MINIMUM])
     123
     124
     125AC_ARG_WITH([crypto], AS_HELP_STRING([--with-crypto=PKG],
     126            [Use specified crypto library: auto (default), openssl, cyassl]),
     127            [want_crypto=$withval], [want_crypto=auto])
     128
     129AS_IF([test "x$want_crypto" = "xauto" -o "x$want_crypto" = "xopenssl"], [
     130    PKG_CHECK_MODULES(OPENSSL, [openssl >= $OPENSSL_MINIMUM],
     131        [want_crypto="openssl"; CRYPTO_PKG="openssl"; CRYPTO_CFLAGS="$OPENSSL_CFLAGS"; CRYPTO_LIBS="$OPENSSL_LIBS"],
     132        [AS_IF([test "x$want_crypto" = "xopenssl"],
     133            [AC_MSG_ERROR([OpenSSL support requested, but library not found.])]
     134        )]
     135    )
     136])
     137AS_IF([test "x$want_crypto" = "xauto" -o "x$want_crypto" = "xcyassl"], [
     138    PKG_CHECK_MODULES(CYASSL, [cyassl >= $CYASSL_MINIMUM],
     139        [want_crypto="cyassl"; CRYPTO_PKG="cyassl"; CRYPTO_CFLAGS="$CYASSL_CFLAGS"; CRYPTO_LIBS="$CYASSL_LIBS"],
     140        [AS_IF([test "x$want_crypto" = "xcyassl"],
     141            [AC_MSG_ERROR([CyaSSL support requested, but library not found.])]
     142        )]
     143    )
     144])
     145# we should have found the library by now
     146AS_IF([test "x$CRYPTO_PKG" = "x"], [
     147    AS_IF([test "x$want_crypto" = "xauto"],
     148        [AC_MSG_ERROR([Unable to find any supported crypto library.])],
     149        [AC_MSG_ERROR([Requested crypto library "$want_crypto" is not supported.])],
     150    )
     151])
     152
     153AC_SUBST(CRYPTO_PKG)
     154AC_SUBST(CRYPTO_CFLAGS)
     155AC_SUBST(CRYPTO_LIBS)
     156
    119157
    120158AC_SYS_LARGEFILE
     
    620658      * optimized for low-resource systems:           ${enable_lightweight}
    621659      * µTP enabled:                                  ${build_utp}
     660      * crypto library:                               ${CRYPTO_PKG}
    622661
    623662   Build Command-Line client:                         ${build_cli}
Note: See TracChangeset for help on using the changeset viewer.