diff options
author | Ludovic Courtès <ludo@gnu.org> | 2009-02-14 22:17:47 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2009-02-14 22:17:47 +0100 |
commit | b96dac4d0ed1cea031b84966c2563c768180fd74 (patch) | |
tree | 4d216f29e7d302675300c29f63faa81f2038d7e8 | |
parent | 2cf1705c72212808532ba25cde19f30ce84118a2 (diff) | |
download | guile-b96dac4d0ed1cea031b84966c2563c768180fd74.tar.gz |
Change `compiled-file-name' to preserve the input file's directory.
* module/system/base/compile.scm (compiled-file-name): Prepend "(dirname
file)" so that "guile-tools compile foo/bar.scm" produces
"foo/bar.go", not "bar.go".
-rw-r--r-- | module/system/base/compile.scm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/module/system/base/compile.scm b/module/system/base/compile.scm index 4294daece..0d08064ac 100644 --- a/module/system/base/compile.scm +++ b/module/system/base/compile.scm @@ -1,6 +1,6 @@ ;;; High-level compiler interface -;; Copyright (C) 2001 Free Software Foundation, Inc. +;; Copyright (C) 2001, 2009 Free Software Foundation, Inc. ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -124,10 +124,11 @@ ".go") (else (car %load-compiled-extensions))))) (let lp ((exts %load-extensions)) - (cond ((null? exts) (string-append base cext)) + (cond ((null? exts) (string-append file cext)) ((string-null? (car exts)) (lp (cdr exts))) ((string-suffix? (car exts) base) (string-append + (dirname file) "/" (substring base 0 (- (string-length base) (string-length (car exts)))) cext)) |