[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 04/13: build: Capture the source and object directories of Fi
From: |
Ludovic Courtès |
Subject: |
[shepherd] 04/13: build: Capture the source and object directories of Fibers. |
Date: |
Fri, 25 Mar 2022 17:59:00 -0400 (EDT) |
civodul pushed a commit to branch wip-fibers
in repository shepherd.
commit 01742a4967c4a9b63a12faba1432302bd62d1128
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.
* 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 | 8 ++++++--
shepherd.in | 8 ++++++--
4 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 774ebba..408c68e 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.
@@ -174,6 +174,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..a1d27b8 100644
--- a/herd.in
+++ b/herd.in
@@ -2,6 +2,10 @@
-*- 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..1cccf6e 100644
--- a/shepherd.in
+++ b/shepherd.in
@@ -2,6 +2,10 @@
-*- 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] branch wip-fibers created (now 69ea4bd), Ludovic Courtès, 2022/03/25
- [shepherd] 04/13: build: Capture the source and object directories of Fibers.,
Ludovic Courtès <=
- [shepherd] 09/13: service: 'make-forkexec-constructor' spawns a logging fiber., Ludovic Courtès, 2022/03/25
- [shepherd] 10/13: doc: Fix inetutils cross-reference., Ludovic Courtès, 2022/03/25
- [shepherd] 12/13: service: Add the #:transient? slot., Ludovic Courtès, 2022/03/25
- [shepherd] 01/13: shepherd: Factorize out the main loop., Ludovic Courtès, 2022/03/25
- [shepherd] 02/13: build: Drop support for Guile 2.0., Ludovic Courtès, 2022/03/25
- [shepherd] 03/13: Use Fibers., Ludovic Courtès, 2022/03/25
- [shepherd] 05/13: shepherd: Use one fiber for signal handling, and one for clients., Ludovic Courtès, 2022/03/25
- [shepherd] 06/13: service: 'read-pid-file' no longer blocks., Ludovic Courtès, 2022/03/25
- [shepherd] 07/13: service: 'read-pid-file' uses (@ (guile) sleep) when it's not suspendable., Ludovic Courtès, 2022/03/25
- [shepherd] 08/13: shepherd: Encode log as UTF-8 unconditionally., Ludovic Courtès, 2022/03/25