guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/03: build: Do not build (guix build syscalls) if 'mount' is missing f


From: Ludovic Courtès
Subject: 02/03: build: Do not build (guix build syscalls) if 'mount' is missing from libc.
Date: Wed, 26 Aug 2015 22:49:34 +0000

civodul pushed a commit to branch master
in repository guix.

commit 12e5b26643e2269e8f30d8399886d4302c3c09d1
Author: Ludovic Courtès <address@hidden>
Date:   Wed Aug 26 14:07:31 2015 +0200

    build: Do not build (guix build syscalls) if 'mount' is missing from libc.
    
    This disables compilation of this module on GNU/Hurd.
    Reported by Manolis Ragkousis <address@hidden>.
    
    * m4/guix.m4 (GUIX_CHECK_LIBC_MOUNT): New variable.
    * configure.ac: Use it.  Define 'BUILD_SYSCALLS_MODULE' conditional.
    * Makefile.am (MODULES, EXTRA_DIST): Make 'guix/build/syscalls.scm'
      conditional on BUILD_SYSCALLS_MODULE.
---
 Makefile.am  |   15 ++++++++++++++-
 configure.ac |    5 +++++
 m4/guix.m4   |   13 +++++++++++++
 3 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index ada4cbe..76d505a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -88,7 +88,6 @@ MODULES =                                     \
   guix/build/rpath.scm                         \
   guix/build/cvs.scm                           \
   guix/build/svn.scm                           \
-  guix/build/syscalls.scm                      \
   guix/build/gremlin.scm                       \
   guix/build/emacs-utils.scm                   \
   guix/build/graft.scm                         \
@@ -124,6 +123,13 @@ MODULES =                                  \
   guix.scm                                     \
   $(GNU_SYSTEM_MODULES)
 
+if BUILD_SYSCALLS_MODULE
+
+MODULES +=                                     \
+  guix/build/syscalls.scm
+
+endif
+
 if BUILD_DAEMON_OFFLOAD
 
 MODULES +=                                     \
@@ -298,6 +304,13 @@ EXTRA_DIST +=                                      \
 
 endif !BUILD_DAEMON_OFFLOAD
 
+if !BUILD_SYSCALLS_MODULE
+
+EXTRA_DIST +=                                  \
+  guix/build/syscalls.scm
+
+endif !BUILD_SYSCALLS_MODULE
+
 
 CLEANFILES =                                   \
   $(GOBJECTS)                                  \
diff --git a/configure.ac b/configure.ac
index 2c8b9f0..247a9d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -85,6 +85,11 @@ dnl Check whether (srfi srfi-37) works, and provide our own 
if it doesn't.
 GUIX_CHECK_SRFI_37
 AM_CONDITIONAL([INSTALL_SRFI_37], [test "x$ac_cv_guix_srfi_37_broken" = xyes])
 
+dnl Check whether (guix build syscalls) can be built.
+GUIX_CHECK_LIBC_MOUNT
+AM_CONDITIONAL([BUILD_SYSCALLS_MODULE],
+  [test "x$guix_cv_libc_has_mount" = "xyes"])
+
 AC_ARG_WITH([nix-prefix],
   [AS_HELP_STRING([--with-nix-prefix=DIR],
     [search for Nix in DIR (for testing purposes and '--disable-daemon' 
builds)])],
diff --git a/m4/guix.m4 b/m4/guix.m4
index fa5a402..2113383 100644
--- a/m4/guix.m4
+++ b/m4/guix.m4
@@ -257,3 +257,16 @@ AC_DEFUN([GUIX_ASSERT_CXX11], [
     AC_MSG_ERROR([C++ compiler '$CXX' does not support the C++11 standard])
   fi
 ])
+
+dnl GUIX_CHECK_LIBC_MOUNT
+dnl
+dnl Check whether libc provides 'mount'.  On GNU/Hurd it doesn't (yet).
+AC_DEFUN([GUIX_CHECK_LIBC_MOUNT], [
+  AC_CACHE_CHECK([whether libc provides 'mount'], [guix_cv_libc_has_mount],
+    [GUILE_CHECK([retval], [(dynamic-func \"mount\" (dynamic-link))])
+     if test "$retval" = 0; then
+       guix_cv_libc_has_mount="yes"
+     else
+       guix_cv_libc_has_mount="no"
+     fi])
+])



reply via email to

[Prev in Thread] Current Thread [Next in Thread]