summary refs log tree commit diff
path: root/m4/guix.m4
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2019-07-31 14:28:56 +0200
committerMarius Bakke <mbakke@fastmail.com>2019-07-31 14:28:56 +0200
commit6a2e54236e1b2c428c8fd478ee0f3bd8130703fa (patch)
treeaf70155a2f474d35d90d003f8584b2d9ee0bbaa8 /m4/guix.m4
parent2cf1e37c109c8d03fae75bc84f7012f3afa956e5 (diff)
parent3d88855dfdcc4c8ce11f494fdf9f0ac1d8eef530 (diff)
downloadguix-6a2e54236e1b2c428c8fd478ee0f3bd8130703fa.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'm4/guix.m4')
-rw-r--r--m4/guix.m421
1 files changed, 21 insertions, 0 deletions
diff --git a/m4/guix.m4 b/m4/guix.m4
index d0c5ec0f08..716bfb08ec 100644
--- a/m4/guix.m4
+++ b/m4/guix.m4
@@ -174,6 +174,27 @@ AC_DEFUN([GUIX_CHECK_GUILE_SQLITE3], [
      fi])
 ])
 
+dnl GUIX_CHECK_GUILE_JSON
+dnl
+dnl Check whether a recent-enough Guile-JSON is available.
+AC_DEFUN([GUIX_CHECK_GUILE_JSON], [
+  dnl Check whether we're using Guile-JSON 3.x, which uses a JSON-to-Scheme
+  dnl mapping different from that of earlier versions.
+  AC_CACHE_CHECK([whether Guile-JSON is available and recent enough],
+    [guix_cv_have_recent_guile_json],
+    [GUILE_CHECK([retval],
+      [(use-modules (json) (ice-9 match))
+       (match (json-string->scm \"[[] { \\\"a\\\": 42 } []]\")
+         (#(("a" . 42)) #t)
+	 (_ #f))])
+     if test "$retval" = 0; then
+       guix_cv_have_recent_guile_json="yes"
+     else
+       guix_cv_have_recent_guile_json="no"
+     fi])
+])
+
+
 dnl GUIX_TEST_ROOT_DIRECTORY
 AC_DEFUN([GUIX_TEST_ROOT_DIRECTORY], [
   AC_CACHE_CHECK([for unit test root directory],