]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
gost detect works.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 19 Oct 2011 12:40:20 +0000 (12:40 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 19 Oct 2011 12:40:20 +0000 (12:40 +0000)
git-svn-id: file:///svn/unbound/trunk@2516 be551aaa-1e26-0410-a405-d3ace91eadb9

configure.ac

index 0ac8094eae19392e13c53789bb52905e96c0031b..00c15dfa2cc4ce423418e8c4135c569dcaab495b 100644 (file)
@@ -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 <openssl/engine.h>
+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