From 75e1c60ffccda0c81bd08d70401a2446842f8743 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Thu, 8 May 2014 10:58:47 -0700 Subject: [PATCH] elisp: Make this a separately buildable subsystem. Remove changes outside src/elisp/. Replace Makefile-fragment with a simple Makefile. Replace compile-system with many calls to compile-file. --- src/README.txt | 2 -- src/TAGS | 2 -- src/elisp/Makefile | 43 +++++++++++++++++++++++++ src/elisp/Makefile-fragment | 13 -------- src/elisp/compile.scm | 62 ++++++++++++++++++++++++------------- src/elisp/process.scm | 2 +- src/etc/compile.scm | 2 +- src/etc/create-makefiles.sh | 3 +- src/etc/optiondb.scm | 3 -- 9 files changed, 86 insertions(+), 46 deletions(-) create mode 100644 src/elisp/Makefile delete mode 100644 src/elisp/Makefile-fragment diff --git a/src/README.txt b/src/README.txt index f1b0a6007..1ec888fbd 100644 --- a/src/README.txt +++ b/src/README.txt @@ -88,8 +88,6 @@ These are miscellaneous extras: version of this code that is no longer in use (and probably no longer works). -* "elisp" contains a GNU Emacs emulator for Edwin. - * "etc" contains miscellaneous files for building the program. * "rcs" is a parser for RCS files. It also contains a program for diff --git a/src/TAGS b/src/TAGS index 6422eaa03..e0668593b 100644 --- a/src/TAGS +++ b/src/TAGS @@ -16,5 +16,3 @@ cref/TAGS,include rcs/TAGS,include ffi/TAGS,include - -elisp/TAGS,include diff --git a/src/elisp/Makefile b/src/elisp/Makefile new file mode 100644 index 000000000..fec830cd4 --- /dev/null +++ b/src/elisp/Makefile @@ -0,0 +1,43 @@ +# Copyright (C) 2011, 2012, 2013 Matthew Birkholz +# +# This file is part of an extension to MIT/GNU Scheme. +# +# MIT/GNU Scheme is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# MIT/GNU Scheme is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with MIT/GNU Scheme; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301, USA. + +MIT_SCHEME_EXE = mit-scheme +exe = '$(MIT_SCHEME_EXE)' --batch-mode + +all: + echo '(load "compile")' | $(exe) + @if [ -s elisp-unx.crf ]; then \ + echo "elisp-unx.crf:0: warning: non-empty"; exit 1; fi + +check: + @echo "Warning: no tests!" +# echo '(load "check")' | $(exe) + +install: + @echo "Warning: not installable!" +# echo '(install-load-option "$(DESTDIR)" "elisp")' \ +# | $(exe) -- *.com *.bci *.pkd make.scm load-up.el + +clean distclean maintainer-clean: + rm -f *.bin *.ext *.com *.bci *.moc *.fni *.crf *.fre *.pkd + +tags: + etags *.scm + +.PHONY: all check install clean distclean maintainer-clean tags diff --git a/src/elisp/Makefile-fragment b/src/elisp/Makefile-fragment deleted file mode 100644 index dec2fcedd..000000000 --- a/src/elisp/Makefile-fragment +++ /dev/null @@ -1,13 +0,0 @@ -#-*-Makefile-*- -# elisp/Makefile-fragment - -TARGET_DIR = $(AUXDIR)/elisp - -install: - rm -rf $(DESTDIR)$(TARGET_DIR) - $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR) - $(INSTALL_COM) *.com $(DESTDIR)$(TARGET_DIR)/. - $(INSTALL_DATA) *.bci $(DESTDIR)$(TARGET_DIR)/. - $(INSTALL_DATA) elisp-*.pkd $(DESTDIR)$(TARGET_DIR)/. - $(INSTALL_DATA) $(srcdir)/load.scm $(DESTDIR)$(TARGET_DIR)/. - $(INSTALL_DATA) $(srcdir)/load-up.el $(DESTDIR)$(TARGET_DIR)/. diff --git a/src/elisp/compile.scm b/src/elisp/compile.scm index 8c417aa4d..fd51c8a80 100644 --- a/src/elisp/compile.scm +++ b/src/elisp/compile.scm @@ -5,25 +5,43 @@ (fluid-let ((load/suppress-loading-message? #t)) (load-option 'CREF)) -(fluid-let ((compile-file:sf-only? #t)) - (compile-system - "elisp" (directory-pathname (current-load-pathname)) - 'dependencies - (let* ((deps-edwin (map (lambda (base) (string-append "../edwin/" base)) - '("struct" "comman" "modes" "buffer" "edtstr"))) - (deps-Buffers (cons "Buffers" deps-edwin)) - (deps-Symbols (cons "Symbols" deps-Buffers)) - (deps-all (cons* "lisp" "Subrs" deps-Symbols))) - `(("Buffers" . ,deps-edwin) ;uses lots of Edwin stuff - ("Symbols" . ,deps-Buffers) ;uses Edwin and %current-buffer... - ("Reader" . ,deps-Symbols) ;uses ... and ... and %symbol-*... - ("lisp" . ,deps-Symbols) ;ditto - ;; Assume everything else wants to integrate whatnot from Edwin - ;; and the emulator. Also assume no cross-file integrables - ;; amongst them. - . ,(map (lambda (file) `(,file . ,deps-all)) - '("Misc" - "data" "eval" "fns" "lread" "buffer" "editfns" "fileio" - "alloc" "minibuf" "search" "callint" "syntax" "cmds" "marker" - "window" "keymap" "print" "indent" "process" "dired" "abbrev" - "bytecode")))))) \ No newline at end of file +(with-working-directory-pathname (directory-pathname (current-load-pathname)) + (lambda () + (if (name->package '(ELISP)) + (error "The ELisp package already exists.") + (let ((package-set (package-set-pathname "elisp"))) + (if (not (file-modification-timeenvironment env-name)))) + + (cf "Buffers" deps-edwin '(elisp buffers)) ;uses lots of Edwin stuff + (cf "Symbols" deps-Buffers '(elisp symbols)) ;uses Edwin and %current-buffer... + (cf "Reader" deps-Symbols '(elisp reader)) ;uses ... and ... and %symbol-*... + (cf "Subrs" '() '(elisp subrs)) + (cf "lisp" deps-Symbols '(elisp)) ;ditto + (cf "Macros" '() '(elisp)) ;ditto + (load "Macros" (->environment '(elisp))) + + ;; Assume everything else wants to integrate whatnot from Edwin + ;; and the emulator. Also assume no cross-file integrables + ;; amongst them. + (for-each + (lambda (file) + (cf file deps-all '(elisp))) + '("Misc" + "data" "eval" "fns" "lread" "buffer" "editfns" "fileio" + "alloc" "minibuf" "search" "callint" "syntax" "cmds" "marker" + "window" "keymap" "print" "indent" "process" "dired" "abbrev" + "bytecode"))) + + (cref/generate-constructors "elisp" 'ALL))) \ No newline at end of file diff --git a/src/elisp/process.scm b/src/elisp/process.scm index 7762b5dec..c8f157e13 100644 --- a/src/elisp/process.scm +++ b/src/elisp/process.scm @@ -326,7 +326,7 @@ from PROCESS." (not (eq? 'RUN (process-status process))) (poll-process-for-output process))))) (begin - (outf-console ";Loop looking for output from "process".\n") + (outf-error ";Loop looking for output from "process".\n") ;; Is this necessary? #;(block-on-input-descriptor (channel-descriptor-for-select diff --git a/src/etc/compile.scm b/src/etc/compile.scm index 38dc27c0b..f5eca8a40 100644 --- a/src/etc/compile.scm +++ b/src/etc/compile.scm @@ -41,7 +41,7 @@ USA. (with-working-directory-pathname "sos" (lambda () (load "load"))) - (for-each compile-dir '("xml" "win32" "edwin" "imail" "ssp" "ffi" "elisp"))) + (for-each compile-dir '("xml" "win32" "edwin" "imail" "ssp" "ffi"))) (define (compile-boot-dirs compile-dir) (compile-cref compile-dir) diff --git a/src/etc/create-makefiles.sh b/src/etc/create-makefiles.sh index 30861ff5d..8fe46f1c5 100755 --- a/src/etc/create-makefiles.sh +++ b/src/etc/create-makefiles.sh @@ -47,8 +47,7 @@ run_cmd rm -f compiler/machine compiler/compiler.pkg run_cmd ln -s machines/"${MDIR}" compiler/machine run_cmd ln -s machine/compiler.pkg compiler/. -BUNDLES="6001 compiler cref edwin elisp ffi imail sf sos ssp star-parser" -BUNDLES="$BUNDLES xdoc xml" +BUNDLES="6001 compiler cref edwin ffi imail sf sos ssp star-parser xdoc xml" run_cmd ${HOST_SCHEME_EXE} --batch-mode --heap 4000 <