[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)))
- [shepherd] 03/32: Remove 'QUESTIONS' file., (continued)
- [shepherd] 03/32: Remove 'QUESTIONS' file., Ludovic Courtès, 2022/03/30
- [shepherd] 07/32: Use Fibers., Ludovic Courtès, 2022/03/30
- [shepherd] 13/32: shepherd: Encode log as UTF-8 unconditionally., Ludovic Courtès, 2022/03/30
- [shepherd] 14/32: service: 'make-forkexec-constructor' spawns a logging fiber., Ludovic Courtès, 2022/03/30
- [shepherd] 08/32: README: Update requirements., Ludovic Courtès, 2022/03/30
- [shepherd] 21/32: service: Add systemd constructor and destructor., Ludovic Courtès, 2022/03/30
- [shepherd] 22/32: service: Add 'start-in-the-background'., Ludovic Courtès, 2022/03/30
- [shepherd] 25/32: service: Add #:handle-termination slot., Ludovic Courtès, 2022/03/30
- [shepherd] 28/32: shepherd: Do not change to the client directory when executing a command., Ludovic Courtès, 2022/03/30
- [shepherd] 31/32: doc: Clarify which instance 'herd' talks to., Ludovic Courtès, 2022/03/30
- [shepherd] 09/32: build: Capture the source and object directories of Fibers.,
Ludovic Courtès <=
- [shepherd] 11/32: service: 'read-pid-file' no longer blocks., Ludovic Courtès, 2022/03/30
- [shepherd] 10/32: shepherd: Use one fiber for signal handling, and one for clients., Ludovic Courtès, 2022/03/30
- [shepherd] 15/32: doc: Fix inetutils cross-reference., Ludovic Courtès, 2022/03/30
- [shepherd] 12/32: service: 'read-pid-file' uses (@ (guile) sleep) when it's not suspendable., Ludovic Courtès, 2022/03/30
- [shepherd] 18/32: service: Add the #:transient? slot., Ludovic Courtès, 2022/03/30
- [shepherd] 17/32: service: Remove unused 'make-init.d-service'., Ludovic Courtès, 2022/03/30
- [shepherd] 24/32: shepherd: "shepherd -s -" replies to the current output port., Ludovic Courtès, 2022/03/30
- [shepherd] 26/32: service: Add #:max-connections to 'make-inetd-constructor'., Ludovic Courtès, 2022/03/30
- [shepherd] 16/32: support: 'l10n' accepts plural forms., Ludovic Courtès, 2022/03/30
- [shepherd] 23/32: shepherd: Remove half-baked readline support., Ludovic Courtès, 2022/03/30