summaryrefslogtreecommitdiff
path: root/m4/gc-sm3.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/gc-sm3.m4')
-rw-r--r--m4/gc-sm3.m417
1 files changed, 16 insertions, 1 deletions
diff --git a/m4/gc-sm3.m4 b/m4/gc-sm3.m4
index 7eac44818d..992217d9fe 100644
--- a/m4/gc-sm3.m4
+++ b/m4/gc-sm3.m4
@@ -1,4 +1,4 @@
-# gc-sm3.m4 serial 1
+# gc-sm3.m4 serial 2
dnl Copyright (C) 2017-2019 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -7,4 +7,19 @@ dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_GC_SM3],
[
AC_REQUIRE([gl_GC])
+ AC_CACHE_CHECK([whether libgcrypt supports SM3],
+ [gl_cv_libcrypt_md_sm3],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #include <gcrypt.h>
+ int a = GCRY_MD_SM3;
+ ]], [[]])
+ ],
+ [gl_cv_libcrypt_md_sm3=yes],
+ [gl_cv_libcrypt_md_sm3=no])
+ ])
+ if test $gl_cv_libcrypt_md_sm3 = yes; then
+ AC_DEFINE([LIBGCRYPT_HAS_MD_SM3], [1],
+ [Define if libgcrypt supports the MD algorithm SM3.])
+ fi
])

Return to:

Send suggestions and report system problems to the System administrator.