From d66ff13f9c62c49aa8cd77ad3512a9c7e78be345 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Wed, 19 Oct 2011 12:40:20 +0000 Subject: [PATCH] gost detect works. git-svn-id: file:///svn/unbound/trunk@2516 be551aaa-1e26-0410-a405-d3ace91eadb9 --- configure.ac | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 0ac8094ea..00c15dfa2 100644 --- a/configure.ac +++ b/configure.ac @@ -496,6 +496,22 @@ case "$enable_sha2" in ;; esac +# check wether gost also works +AC_DEFUN([AC_CHECK_GOST_WORKS], +[AC_REQUIRE([AC_PROG_CC]) +AC_MSG_CHECKING(whether gost works) +if test c${cross_compiling} = cno; then +AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include +int main(void) { +return 0; } +]])] , [eval "ac_cv_c_gost_works=yes"], [eval "ac_cv_c_gost_works=no"]) +else +eval "ac_cv_c_gost_works=maybe" +fi +AC_MSG_RESULT($ac_cv_c_gost_works) +])dnl + AC_ARG_ENABLE(gost, AC_HELP_STRING([--disable-gost], [Disable GOST support])) use_gost="no" case "$enable_gost" in @@ -504,8 +520,11 @@ case "$enable_gost" in *) AC_CHECK_FUNC(EVP_PKEY_set_type_str, [:],[AC_MSG_ERROR([OpenSSL 1.0.0 is needed for GOST support])]) AC_CHECK_FUNC(EC_KEY_new, [], [AC_MSG_ERROR([OpenSSL does not support ECC, needed for GOST support])]) - use_gost="yes" - AC_DEFINE([USE_GOST], [1], [Define this to enable GOST support.]) + AC_CHECK_GOST_WORKS + if test $ac_cv_c_gost_works != no; then + use_gost="yes" + AC_DEFINE([USE_GOST], [1], [Define this to enable GOST support.]) + fi ;; esac -- 2.47.2