xref: /netbsd-src/crypto/external/bsd/heimdal/dist/cf/framework-security.m4 (revision ca1c9b0c534faa5fd4c7d36fd3c199a2a3d7b0e4)
1*ca1c9b0cSelricAC_DEFUN([rk_FRAMEWORK_SECURITY], [
2*ca1c9b0cSelric
3*ca1c9b0cSelricAC_MSG_CHECKING([for framework security])
4*ca1c9b0cSelricAC_CACHE_VAL(rk_cv_framework_security,
5*ca1c9b0cSelric[
6*ca1c9b0cSelricif test "$rk_cv_framework_security" != yes; then
7*ca1c9b0cSelric	ac_save_LIBS="$LIBS"
8*ca1c9b0cSelric	LIBS="$ac_save_LIBS -framework Security -framework CoreFoundation"
9*ca1c9b0cSelric	AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <Security/Security.h>
10*ca1c9b0cSelric]],
11*ca1c9b0cSelric[[SecKeychainSearchRef searchRef;
12*ca1c9b0cSelricSecKeychainSearchCreateFromAttributes(NULL,kSecCertificateItemClass,NULL, &searchRef);
13*ca1c9b0cSelricCFRelease(&searchRef);
14*ca1c9b0cSelric]])],[rk_cv_framework_security=yes])
15*ca1c9b0cSelric	LIBS="$ac_save_LIBS"
16*ca1c9b0cSelricfi
17*ca1c9b0cSelric])
18*ca1c9b0cSelric
19*ca1c9b0cSelricif test "$rk_cv_framework_security" = yes; then
20*ca1c9b0cSelric   AC_DEFINE(HAVE_FRAMEWORK_SECURITY, 1, [Have -framework Security])
21*ca1c9b0cSelric   AC_MSG_RESULT(yes)
22*ca1c9b0cSelricelse
23*ca1c9b0cSelric   AC_MSG_RESULT(no)
24*ca1c9b0cSelricfi
25*ca1c9b0cSelricAM_CONDITIONAL(FRAMEWORK_SECURITY, test "$rk_cv_framework_security" = yes)
26*ca1c9b0cSelric
27*ca1c9b0cSelricif test "$rk_cv_framework_security" = yes; then
28*ca1c9b0cSelric   AC_NEED_PROTO([#include <Security/Security.h>],SecKeyGetCSPHandle)
29*ca1c9b0cSelricfi
30*ca1c9b0cSelric
31*ca1c9b0cSelric])
32