build: Make sure the user's Guile has all the required features.
* m4/guix.m4 (GUIX_ASSERT_GUILE_FEATURES): New macro. * configure.ac: Use it.master
parent
cf8f58b2af
commit
9c7dd33a48
|
@ -47,6 +47,9 @@ if test "x$GUILD" = "x"; then
|
||||||
AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
|
AC_MSG_ERROR(['guild' binary not found; please check your guile-2.x installation.])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
dnl Make sure we have a full-fledged Guile.
|
||||||
|
GUIX_ASSERT_GUILE_FEATURES([regex posix socket net-db threads])
|
||||||
|
|
||||||
AC_ARG_WITH([nix-prefix],
|
AC_ARG_WITH([nix-prefix],
|
||||||
[AS_HELP_STRING([--with-nix-prefix=DIR], [search for Nix in DIR])],
|
[AS_HELP_STRING([--with-nix-prefix=DIR], [search for Nix in DIR])],
|
||||||
[case "$withval" in
|
[case "$withval" in
|
||||||
|
|
17
m4/guix.m4
17
m4/guix.m4
|
@ -67,3 +67,20 @@ AC_DEFUN([GUIX_SYSTEM_TYPE], [
|
||||||
|
|
||||||
AC_SUBST([guix_system])
|
AC_SUBST([guix_system])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl GUIX_ASSERT_GUILE_FEATURES FEATURES
|
||||||
|
dnl
|
||||||
|
dnl Assert that FEATURES are provided by $GUILE.
|
||||||
|
AC_DEFUN([GUIX_ASSERT_GUILE_FEATURES], [
|
||||||
|
for guix_guile_feature in $1
|
||||||
|
do
|
||||||
|
AC_MSG_CHECKING([whether $GUILE provides feature '$guix_guile_feature'])
|
||||||
|
if "$GUILE" -c "(exit (provided? '$guix_guile_feature))"
|
||||||
|
then
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
else
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
AC_MSG_ERROR([$GUILE does not support feature '$guix_guile_feature', which is required.])
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
])
|
||||||
|
|
Reference in New Issue