Commit | Line | Data |
---|---|---|
7ebe6c76 JB |
1 | ;;;; slib.scm --- definitions needed to get SLIB to work with Guile |
2 | ;;;; | |
b194b59f | 3 | ;;;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2006, 2007, 2013 Free Software Foundation, Inc. |
a482f2cc | 4 | ;;;; |
73be1d9e MV |
5 | ;;;; This library is free software; you can redistribute it and/or |
6 | ;;;; modify it under the terms of the GNU Lesser General Public | |
7 | ;;;; License as published by the Free Software Foundation; either | |
53befeb7 NJ |
8 | ;;;; version 3 of the License, or (at your option) any later version. |
9 | ;;;; | |
73be1d9e MV |
10 | ;;;; This library is distributed in the hope that it will be useful, |
11 | ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
a482f2cc | 12 | ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
73be1d9e | 13 | ;;;; Lesser General Public License for more details. |
53befeb7 | 14 | ;;;; |
73be1d9e MV |
15 | ;;;; You should have received a copy of the GNU Lesser General Public |
16 | ;;;; License along with this library; if not, write to the Free Software | |
92205699 | 17 | ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
7ebe6c76 | 18 | ;;;; |
1a179b03 | 19 | |
b194b59f AW |
20 | ;;; Look for slib.init in the $datadir, in /usr/share, and finally in |
21 | ;;; the load path. It's not usually in the load path on common distros, | |
22 | ;;; but it could be if the user put it there. The init file takes care | |
23 | ;;; of defining the module. | |
dc061a74 | 24 | |
b194b59f AW |
25 | (let ((try-load (lambda (dir) |
26 | (let ((init (string-append dir "/slib/guile.init"))) | |
27 | (and (file-exists? init) | |
28 | (begin | |
29 | (load init) | |
30 | #t)))))) | |
31 | (or (try-load (assq-ref %guile-build-info 'datadir)) | |
32 | (try-load "/usr/share") | |
33 | (load-from-path "slib/guile.init"))) |