summaryrefslogtreecommitdiff
path: root/fibers
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2017-01-19 04:18:36 +0100
committerAndy Wingo <wingo@pobox.com>2017-01-19 04:39:59 +0100
commitaacd628cdd3903226a5822b3feed212741dbde04 (patch)
treeac9fd51ea7aaccd346bff3f49ef8c3cee7cb54bc /fibers
parentRandomized round-robin work sharing/stealing (diff)
downloadguile-fibers-aacd628cdd3903226a5822b3feed212741dbde04.tar.gz
Better findability for epoll extension.
* fibers/config.scm.in: New file. * Makefile.am: Wire up new file. * env.in: Define FIBERS_BUILD_DIR. * fibers/epoll.scm: Use (fibers config) to get dir for epoll extension.
Diffstat (limited to 'fibers')
-rw-r--r--fibers/config.scm.in30
-rw-r--r--fibers/epoll.scm4
2 files changed, 33 insertions, 1 deletions
diff --git a/fibers/config.scm.in b/fibers/config.scm.in
new file mode 100644
index 0000000..a330339
--- /dev/null
+++ b/fibers/config.scm.in
@@ -0,0 +1,30 @@
+;; fibers
+
+;;;; Copyright (C) 2017 Andy Wingo <wingo@pobox.com>
+;;;;
+;;;; This library is free software; you can redistribute it and/or
+;;;; modify it under the terms of the GNU Lesser General Public
+;;;; License as published by the Free Software Foundation; either
+;;;; version 3 of the License, or (at your option) any later version.
+;;;;
+;;;; This library is distributed in the hope that it will be useful,
+;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+;;;; Lesser General Public License for more details.
+;;;;
+;;;; You should have received a copy of the GNU Lesser General Public
+;;;; License along with this library; if not, write to the Free Software
+;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+;;;;
+
+(define-module (fibers config)
+ #:export (extension-library))
+
+(define *extlibdir*
+ (cond
+ ((getenv "FIBERS_BUILD_DIR")
+ => (lambda (builddir) (in-vicinity builddir ".libs")))
+ (else "@extlibdir@")))
+
+(define (extension-library lib)
+ (in-vicinity *extlibdir* lib))
diff --git a/fibers/epoll.scm b/fibers/epoll.scm
index 83a0a63..20d92ae 100644
--- a/fibers/epoll.scm
+++ b/fibers/epoll.scm
@@ -25,6 +25,7 @@
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-9 gnu)
#:use-module (rnrs bytevectors)
+ #:use-module (fibers config)
#:export (epoll-create
epoll-destroy
epoll?
@@ -37,7 +38,8 @@
EPOLLIN EPOLLOUT EPOLLPRO EPOLLERR EPOLLHUP EPOLLET))
(eval-when (eval load compile)
- (load-extension "epoll" "init_fibers_epoll"))
+ (dynamic-call "init_fibers_epoll"
+ (dynamic-link (extension-library "epoll"))))
(when (defined? 'EPOLLRDHUP)
(export EPOLLRDHUP))