From b96dac4d0ed1cea031b84966c2563c768180fd74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 14 Feb 2009 22:17:47 +0100 Subject: [PATCH] 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". --- module/system/base/compile.scm | 5 +++-- 1 file 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))