aboutsummaryrefslogtreecommitdiff
path: root/cf/framework-security.m4
diff options
context:
space:
mode:
authorStanislav Sedov <stas@FreeBSD.org>2011-09-29 05:23:57 +0000
committerStanislav Sedov <stas@FreeBSD.org>2011-09-29 05:23:57 +0000
commit31f1e9c17ffae440059e8cc532fa26b92d534f7b (patch)
treecf5b65423910d126fddaaf04b885d0de3507d692 /cf/framework-security.m4
parentc19800e8cd5640693f36f2040db4ab5e8d738146 (diff)
Notes
Diffstat (limited to 'cf/framework-security.m4')
-rw-r--r--cf/framework-security.m431
1 files changed, 31 insertions, 0 deletions
diff --git a/cf/framework-security.m4 b/cf/framework-security.m4
new file mode 100644
index 0000000000000..3358292f4e6b2
--- /dev/null
+++ b/cf/framework-security.m4
@@ -0,0 +1,31 @@
+AC_DEFUN([rk_FRAMEWORK_SECURITY], [
+
+AC_MSG_CHECKING([for framework security])
+AC_CACHE_VAL(rk_cv_framework_security,
+[
+if test "$rk_cv_framework_security" != yes; then
+ ac_save_LIBS="$LIBS"
+ LIBS="$ac_save_LIBS -framework Security -framework CoreFoundation"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <Security/Security.h>
+]],
+[[SecKeychainSearchRef searchRef;
+SecKeychainSearchCreateFromAttributes(NULL,kSecCertificateItemClass,NULL, &searchRef);
+CFRelease(&searchRef);
+]])],[rk_cv_framework_security=yes])
+ LIBS="$ac_save_LIBS"
+fi
+])
+
+if test "$rk_cv_framework_security" = yes; then
+ AC_DEFINE(HAVE_FRAMEWORK_SECURITY, 1, [Have -framework Security])
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+AM_CONDITIONAL(FRAMEWORK_SECURITY, test "$rk_cv_framework_security" = yes)
+
+if test "$rk_cv_framework_security" = yes; then
+ AC_NEED_PROTO([#include <Security/Security.h>],SecKeyGetCSPHandle)
+fi
+
+])