1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

* syncase.scm (psyncomp): Removed, it is now in compile-psyntax.scm.

* Makefile.am (psyntax.pp): Enable rule for psyntax.pp only in
maintainer mode.  Use compile-psyntax.scm for actual compilation.
Make sure the uninstalled guile is used.
(EXTRA_DIST): Distribute compile-psyntax.scm
* compile-psyntax.scm: New file.
This commit is contained in:
Marius Vollmer 2001-07-23 22:09:42 +00:00
parent d95744e986
commit 9d198c1b17
3 changed files with 30 additions and 18 deletions

View file

@ -43,7 +43,10 @@ install-data-local:
$(subpkgdatadir)/'and-let*.scm'
## test.scm is not currently installed.
EXTRA_DIST = $(ice9_sources) test.scm and-let-star-compat.scm
EXTRA_DIST = $(ice9_sources) test.scm and-let-star-compat.scm \
compile-psyntax.scm
if MAINTAINER_MODE
psyntax.pp: psyntax.ss
cd $(srcdir) && guile -c '(load-from-path "ice-9/syncase") (define-module (ice-9 syncase)) (psyncomp)'
GUILE_LOAD_PATH=$(srcdir)/..:.. ../libguile/guile -s compile-psyntax.scm $(srcdir)/psyntax.ss $(srcdir)/psyntax.pp
endif

25
ice-9/compile-psyntax.scm Normal file
View file

@ -0,0 +1,25 @@
(use-modules (ice-9 syncase))
;; XXX - We need to be inside (ice-9 syncase) since psyntax.ss calls
;; `eval' int he `interaction-environment' aka the current module and
;; it expects to have `andmap' there. The reason for this escapes me
;; at the moment.
;;
(define-module (ice-9 syncase))
(define source (list-ref (command-line) 1))
(define target (list-ref (command-line) 2))
(let ((in (open-input-file source))
(out (open-output-file (string-append target ".tmp"))))
(let loop ((x (read in)))
(if (eof-object? x)
(begin
(close-port out)
(close-port in))
(begin
(write (sc-expand3 x 'c '(compile load eval)) out)
(newline out)
(loop (read in))))))
(system (format #f "mv -f ~s.tmp ~s" target target))

View file

@ -139,22 +139,6 @@
(define generated-symbols (make-weak-key-hash-table 1019))
;;; Utilities
(define (psyncomp)
(system "mv -f psyntax.pp psyntax.pp~")
(let ((in (open-input-file "psyntax.ss"))
(out (open-output-file "psyntax.pp")))
(let loop ((x (read in)))
(if (eof-object? x)
(begin
(close-port out)
(close-port in))
(begin
(write (sc-expand3 x 'c '(compile load eval)) out)
(newline out)
(loop (read in)))))))
;;; Load the preprocessed code
(let ((old-debug #f)