immutable: Add tests.
[gnulib.git] / m4 / gc-sm3.m4
blobdd0f0ad88e6c28bf74f17ffe935ca2cb61ab5cf1
1 # gc-sm3.m4 serial 2
2 dnl Copyright (C) 2017-2021 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 AC_DEFUN([gl_GC_SM3],
9   AC_REQUIRE([gl_GC])
10   AC_CACHE_CHECK([whether libgcrypt supports SM3],
11     [gl_cv_libcrypt_md_sm3],
12     [AC_COMPILE_IFELSE(
13        [AC_LANG_PROGRAM([[
14           #include <gcrypt.h>
15           int a = GCRY_MD_SM3;
16           ]], [[]])
17        ],
18        [gl_cv_libcrypt_md_sm3=yes],
19        [gl_cv_libcrypt_md_sm3=no])
20     ])
21   if test $gl_cv_libcrypt_md_sm3 = yes; then
22     AC_DEFINE([LIBGCRYPT_HAS_MD_SM3], [1],
23       [Define if libgcrypt supports the MD algorithm SM3.])
24   fi