guix-commits
[Top][All Lists]
Advanced

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

[shepherd] 09/32: build: Capture the source and object directories of Fi


From: Ludovic Courtès
Subject: [shepherd] 09/32: build: Capture the source and object directories of Fibers.
Date: Wed, 30 Mar 2022 11:01:28 -0400 (EDT)

civodul pushed a commit to branch master
in repository shepherd.

commit 6975f5ca84304aeb888a943553d841105dbb7283
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Mar 21 21:59:22 2022 +0100

    build: Capture the source and object directories of Fibers.
    
    This ensures Fibers modules are found when running 'herd' and
    'shepherd'.
    
    * configure.ac: Substitute 'FIBERS_SOURCE_DIRECTORY' and
    'FIBERS_OBJECT_DIRECTORY'.
    * Makefile.am (instantiate): Likewise.
    * herd.in: Add FIBERS_SOURCE_DIRECTORY to %LOAD-PATH and add
    FIBERS_OBJECT_DIRECTORY to %LOAD-COMPILED-PATH.
    * shepherd.in: Likewise.
---
 Makefile.am  | 4 +++-
 configure.ac | 8 ++++++++
 herd.in      | 7 +++++--
 shepherd.in  | 7 +++++--
 4 files changed, 21 insertions(+), 5 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index f8f9113..9a2f63d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
 # Makefile.am -- How to build and install the Shepherd.
 # Copyright © 2002, 2003 Wolfgang Jährling <wolfgang@pro-linux.de>
-# Copyright © 2013, 2014, 2015, 2016, 2018, 2019, 2020 Ludovic Courtès 
<ludo@gnu.org>
+# Copyright © 2013-2016, 2018-2020, 2022 Ludovic Courtès <ludo@gnu.org>
 # Copyright © 2018 Carlo Zancanaro <carlo@zancanaro.id.au>
 #
 # This file is part of the GNU Shepherd.
@@ -173,6 +173,8 @@ instantiate =                                               
\
   -e 's,%PACKAGE_BUGREPORT%,@PACKAGE_BUGREPORT@,g'     \
   -e 's,%PACKAGE_NAME%,@PACKAGE_NAME@,g'               \
   -e 's,%PACKAGE_URL%,@PACKAGE_URL@,g'                 \
+  -e 's,%FIBERS_SOURCE_DIRECTORY%,@FIBERS_SOURCE_DIRECTORY@,g' \
+  -e 's,%FIBERS_OBJECT_DIRECTORY%,@FIBERS_OBJECT_DIRECTORY@,g' \
   -e 's,%GUILE%,$(GUILE),g'
 
 # Instantiate templates.
diff --git a/configure.ac b/configure.ac
index f98dbb4..1b9676c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,6 +58,14 @@ if test "x$ac_cv_fibers_creates_pthreads" = "xyes"; then
   AC_MSG_ERROR([Fibers creates POSIX threads behind our back; aborting.])
 fi
 
+dnl Capture the location of Fibers' modules.
+FIBERS_SOURCE_DIRECTORY="`\
+  "$GUILE" -c '(display (dirname (search-path %load-path "fibers.scm")))'`"
+FIBERS_OBJECT_DIRECTORY="`\
+  "$GUILE" -c '(display (dirname (search-path %load-compiled-path 
"fibers.go")))'`"
+AC_SUBST([FIBERS_SOURCE_DIRECTORY])
+AC_SUBST([FIBERS_OBJECT_DIRECTORY])
+
 dnl
 dnl Low-level operating system interface.
 dnl
diff --git a/herd.in b/herd.in
index d190390..e61d26b 100644
--- a/herd.in
+++ b/herd.in
@@ -2,6 +2,9 @@
 -*- scheme -*-
 !#
 
-(set! %load-path (cons "%modsrcdir%" %load-path))
-(set! %load-compiled-path (cons "%modbuilddir%" %load-compiled-path))
+(set! %load-path
+      (append '("%modsrcdir%" "%FIBERS_SOURCE_DIRECTORY%") %load-path))
+(set! %load-compiled-path
+      (append '("%modbuilddir%" "%FIBERS_OBJECT_DIRECTORY%") 
%load-compiled-path))
+
 (apply (@ (shepherd scripts herd) main) (cdr (command-line)))
diff --git a/shepherd.in b/shepherd.in
index e47d9fd..4dfe101 100644
--- a/shepherd.in
+++ b/shepherd.in
@@ -2,6 +2,9 @@
 -*- scheme -*-
 !#
 
-(set! %load-path (cons "%modsrcdir%" %load-path))
-(set! %load-compiled-path (cons "%modbuilddir%" %load-compiled-path))
+(set! %load-path
+      (append '("%modsrcdir%" "%FIBERS_SOURCE_DIRECTORY%") %load-path))
+(set! %load-compiled-path
+      (append '("%modbuilddir%" "%FIBERS_OBJECT_DIRECTORY%") 
%load-compiled-path))
+
 (apply (@ (shepherd) main) (cdr (command-line)))



reply via email to

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