1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00

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".
This commit is contained in:
Ludovic Courtès 2009-02-14 22:17:47 +01:00
parent 2cf1705c72
commit b96dac4d0e

View file

@ -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))