Blame configure.d/config_os_misc2

Packit fcad23
# -*- autoconf -*-
Packit fcad23
#########################################
Packit fcad23
##
Packit fcad23
# Miscellaneous checks
Packit fcad23
##
Packit fcad23
#########################################
Packit fcad23
Packit fcad23
##
Packit fcad23
#   Package characteristics
Packit fcad23
#       Authentication/Encryption support
Packit fcad23
##
Packit fcad23
Packit fcad23
#       Check for PKCS11
Packit fcad23
#
Packit fcad23
AC_MSG_CHECKING([for authentication support])
Packit fcad23
useopenssl=no
Packit fcad23
usepkcs=no
Packit fcad23
if test "x$ac_cv_lib_pkcs11_C_Initialize" != "xyes" -o "x$ac_cv_header_security_cryptoki_h" != "xyes"; then
Packit fcad23
    if test "x$askedpkcs" = "xyes"; then
Packit fcad23
        AC_MSG_ERROR(Asked to use PKCS11 but I couldn't find it.)
Packit fcad23
    fi
Packit fcad23
else
Packit fcad23
    if test "x$askedpkcs" = "xyes"; then
Packit fcad23
        usepkcs=yes
Packit fcad23
    fi
Packit fcad23
fi
Packit fcad23
Packit fcad23
#       Check for OpenSSL
Packit fcad23
#
Packit fcad23
if test "x$ac_cv_lib_crypto_EVP_md5" != "xyes" -a "x$ac_cv_lib_eay32_EVP_md5" != "xyes" -o "x$ac_cv_header_openssl_hmac_h" != "xyes"; then
Packit fcad23
    if test "x$askedopenssl" = "xyes"; then
Packit fcad23
        AC_MSG_ERROR(Asked to use OpenSSL but I couldn't find it.)
Packit fcad23
    fi
Packit fcad23
else
Packit fcad23
    if test "x$askedopenssl" = "xyes"; then
Packit fcad23
        useopenssl=yes
Packit fcad23
    elif test "x$tryopenssl" = "xyes"; then
Packit fcad23
        if test "x$usepkcs" != "xyes"; then
Packit fcad23
            useopenssl=yes
Packit fcad23
        fi
Packit fcad23
    fi
Packit fcad23
fi
Packit fcad23
Packit fcad23
#       Available authentication/encryption modes
Packit fcad23
#
Packit fcad23
if test "x$CRYPTO" = "xinternal" ; then
Packit fcad23
    authmodes="MD5 SHA1"
Packit fcad23
    if test "x$enable_privacy" != "xno" ; then
Packit fcad23
        encrmodes="DES AES"
Packit fcad23
    else
Packit fcad23
        encrmodes="[disabled]"
Packit fcad23
    fi
Packit fcad23
    AC_DEFINE(NETSNMP_USE_INTERNAL_CRYPTO, 1, "Define if internal cryptography code should be used")
Packit fcad23
    AC_MSG_RESULT(Internal Crypto Support)
Packit fcad23
elif test "x$useopenssl" != "xno" ; then
Packit Service 2ea24e
    authmodes="MD5 SHA1"
Packit Service 2ea24e
    if test "x$ac_cv_func_EVP_sha224" = xyes; then
Packit Service 2ea24e
        authmodes="$authmodes SHA224 SHA256"
Packit Service 2ea24e
    fi
Packit Service 2ea24e
    if test "x$ac_cv_func_EVP_sha384" = xyes; then
Packit Service 2ea24e
        authmodes="$authmodes SHA384 SHA512"
Packit Service 2ea24e
    fi
Packit fcad23
    if test "x$enable_privacy" != "xno" ; then
Packit fcad23
        if test "x$ac_cv_header_openssl_aes_h" = "xyes" ; then
Packit fcad23
            encrmodes="DES AES"
Packit fcad23
	else
Packit fcad23
	    encrmodes="DES"
Packit fcad23
	fi
Packit fcad23
    else
Packit fcad23
        encrmodes="[disabled]"
Packit fcad23
    fi
Packit fcad23
    AC_DEFINE(NETSNMP_USE_OPENSSL)
Packit fcad23
    LNETSNMPLIBS="$LNETSNMPLIBS $LIBCRYPTO"
Packit fcad23
    AC_MSG_RESULT(OpenSSL Support)
Packit fcad23
elif test "x$usepkcs" != "xno" ; then
Packit fcad23
    authmodes="MD5 SHA1"
Packit fcad23
    if test "x$enable_privacy" != "xno" ; then
Packit fcad23
        encrmodes="DES"
Packit fcad23
    else
Packit fcad23
        encrmodes="[disabled]"
Packit fcad23
    fi
Packit fcad23
    AC_DEFINE(NETSNMP_USE_PKCS11, 1,
Packit fcad23
      [Define if you are using the codeS11 library ...])
Packit fcad23
    LNETSNMPLIBS="$LNETSNMPLIBS $LIBPKCS11"
Packit fcad23
    AC_MSG_RESULT(PKCS11 Support)
Packit fcad23
elif test "x$enable_md5" != "xno"; then
Packit fcad23
    authmodes="MD5"
Packit fcad23
    encrmodes=""
Packit fcad23
    AC_DEFINE(NETSNMP_USE_INTERNAL_MD5)
Packit fcad23
    AC_MSG_RESULT(Internal MD5 Support)
Packit fcad23
fi
Packit fcad23
if test "x$enable_md5" = "xno"; then
Packit fcad23
    authmodes=`echo $authmodes | $SED 's/MD5 *//;'`
Packit fcad23
fi
Packit Service 2ea24e
if test "x$ac_cv_func_AES_cfb128_encrypt" = xyes ||
Packit Service 2ea24e
   test "x$CRYPTO" = xinternal; then
Packit Service 2ea24e
    encrmodes="$encrmodes AES128"
Packit Service 2ea24e
    if test "x$aes_capable" = "xyes"; then
Packit Service 2ea24e
        encrmodes="$encrmodes AES192 AES192C AES256 AES256C"
Packit Service 2ea24e
    fi
Packit Service 2ea24e
fi
Packit fcad23
AC_SUBST(LNETSNMPLIBS)
Packit fcad23
AC_SUBST(LAGENTLIBS)
Packit fcad23
Packit fcad23
AC_MSG_CACHE_ADD(Crypto support from:        $CRYPTO)
Packit fcad23
AC_MSG_CACHE_ADD(Authentication support:     $authmodes)
Packit fcad23
AC_MSG_CACHE_ADD(Encryption support:         $encrmodes)
Packit fcad23
Packit fcad23
if test "x$all_warnings" != "x"; then
Packit fcad23
    AC_MSG_CACHE_ADD(WARNING: $all_warnings)
Packit fcad23
fi
Packit fcad23
Packit fcad23
#
Packit fcad23
# Check whether user wants DNSSEC local validation support
Packit fcad23
#
Packit fcad23
_libs=${LIBS}
Packit fcad23
if ! test "x-$want_dnssec" = "x-no" ; then
Packit fcad23
    AC_CHECK_HEADERS([validator/validator-config.h])
Packit fcad23
    if test "$ac_cv_header_validator_validator_config_h" != yes; then
Packit fcad23
        AC_MSG_ERROR(Can't find validator.h)
Packit fcad23
    fi
Packit fcad23
    if test "x$ac_cv_lib_crypto_EVP_md5" != "xyes" -a \
Packit fcad23
            "x$ac_cv_lib_eay32_EVP_md5" != "xyes" -o \
Packit fcad23
            "x$ac_cv_header_openssl_hmac_h" != "xyes"; then
Packit fcad23
        AC_MSG_ERROR(Couldn't find OpenSSL for local DNSSEC validation support.)
Packit fcad23
    fi
Packit fcad23
    LIBS="$LIBS $LIBCRYPTO"
Packit fcad23
    AC_CHECK_LIB(sres, query_send,,AC_MSG_ERROR([Can't find libsres]))
Packit fcad23
    VAL_LIBS="-lsres $LIBCRYPTO"
Packit fcad23
    LIBS="$LIBS -lsres"
Packit fcad23
    AC_CHECK_LIB(val, p_val_status,
Packit fcad23
                 LIBS="$LIBS -lval"
Packit fcad23
                 VAL_LIBS="$VAL_LIBS -lval"
Packit fcad23
                 have_val_res_query=yes,
Packit fcad23
                 [ AC_CHECK_LIB(pthread, pthread_rwlock_init)
Packit fcad23
		   AC_CHECK_LIB(val-threads, p_val_status,
Packit fcad23
                   have_val_res_query=yes
Packit fcad23
                   LIBS="-lval-threads $LIBS"
Packit fcad23
                   VAL_LIBS="-lval-threads -lpthread $VAL_LIBS"
Packit fcad23
                   LIBVAL_SUFFIX="-threads",
Packit fcad23
                   AC_MSG_ERROR(Can't find libval or libval-threads))
Packit fcad23
                 ])
Packit fcad23
    AC_DEFINE(DNSSEC_LOCAL_VALIDATION, 1,
Packit fcad23
              [Define if you want local DNSSEC validation support])
Packit fcad23
    DNSSEC="enabled"
Packit fcad23
else
Packit fcad23
    DNSSEC="disabled"
Packit fcad23
fi
Packit fcad23
Packit fcad23
LIBS=${_libs}
Packit fcad23
Packit fcad23
AC_SUBST(VAL_LIBS)
Packit fcad23
AC_MSG_CACHE_ADD(Local DNSSEC validation:    $DNSSEC)
Packit fcad23
Packit fcad23