;;
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
*)
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