From a3a5203b3605c9ed8c4f89dc97704415d0557359 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Mon, 24 Sep 2007 10:45:31 +0000 Subject: * config/setup-dep.mk ($(top_builddir)/libtool): Regenerate when out of date. src/algebra/ * Makefile.pamphlet (DEPSYS): Remove. (COMPILE_LISP): New. (strap/%.o): Use it to compile cached Lisp files. src/interp/ * bookvol5.pamphlet (restart): Simplify. Handle command line arguments. src/lisp/ * core.lisp.in (|handleCommandLine|): Return truthvalue on success. Don't call $originalLispTopLevel. (|compileLispHandler|): Rename file to in-file. (|topLevel|): Exit only whne handleCommandLine indicates so. --- ChangeLog | 5 ++++ config/setup-dep.mk | 3 ++ src/algebra/ChangeLog | 6 ++++ src/algebra/Makefile.in | 8 +++--- src/algebra/Makefile.pamphlet | 13 +++------ src/interp/ChangeLog | 5 ++++ src/interp/bookvol5.pamphlet | 21 ++++---------- src/lisp/ChangeLog | 7 +++++ src/lisp/core.lisp.in | 64 ++++++++++++++++++++----------------------- 9 files changed, 69 insertions(+), 63 deletions(-) diff --git a/ChangeLog b/ChangeLog index fc5b4e6e..866744ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-09-23 Gabriel Dos Reis + + * config/setup-dep.mk ($(top_builddir)/libtool): Regenerate when + out of date. + 2007-09-10 Gabriel Dos Reis * Makefile.pamphlet (all-noweb): Depend only on one target, diff --git a/config/setup-dep.mk b/config/setup-dep.mk index d16f2960..a99fb901 100644 --- a/config/setup-dep.mk +++ b/config/setup-dep.mk @@ -118,6 +118,9 @@ $(top_srcdir)/configure: $(top_srcdir)/configure.ac \ $(top_srcdir)/config/axiom.m4 cd $(top_srcdir) && $(AUTOCONF) +$(top_builddir)/libtool: $(LIBTOOL_DEPS) + cd $(top_builddir) && $(SHELL) ./config.status --recheck + ## Rules for regenerating Makefile.in from pamphlets. $(srcdir)/Makefile.in: $(srcdir)/Makefile.pamphlet diff --git a/src/algebra/ChangeLog b/src/algebra/ChangeLog index af89aa97..9b180d13 100644 --- a/src/algebra/ChangeLog +++ b/src/algebra/ChangeLog @@ -1,3 +1,9 @@ +2007-09-24 Gabriel Dos Reis + + * Makefile.pamphlet (DEPSYS): Remove. + (COMPILE_LISP): New. + (strap/%.o): Use it to compile cached Lisp files. + 2007-09-16 Alfredo Portes Alasdair McAndrew diff --git a/src/algebra/Makefile.in b/src/algebra/Makefile.in index ff37dad4..9fdcb0ea 100644 --- a/src/algebra/Makefile.in +++ b/src/algebra/Makefile.in @@ -8,8 +8,9 @@ INPUT=../input EXTRACT_BOOTSTRAP_FILE = \ $(axiom_build_document) --output=$@ --tangle="$@ BOOTSTRAP" $< - -DEPSYS= ../interp/depsys$(EXEEXT) +## We use interpsys, built from previous stage, to bootstrap the algebra +## files. In fact, we use interpsys to build everything. +COMPILE_LISP = ../interp/interpsys$(EXEEXT) -- --compile --output=$@ $< INTERPSYS = \ @@ -866,8 +867,7 @@ ${OUT}/%.o: %.NRLIB/code.o # Compile bootstrap file to machine object code, and the result # immediately available for AXIOMsys consumption. strap/%.o: %.lsp - $(DEPSYS) -- --compile --output=$@ $< - cp $@ ${OUT} + $(COMPILE_LISP) && $(INSTALL) $@ $(OUT) $(OUTSRC)/%.spad: mk-target-src-algabra-dir diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet index 7e36a81e..4eb64bb1 100644 --- a/src/algebra/Makefile.pamphlet +++ b/src/algebra/Makefile.pamphlet @@ -1313,14 +1313,10 @@ EXTRACT_BOOTSTRAP_FILE = \ @ -\subsection{The depsys variable} - -The {\bf depsys} image is the compile-time environment for boot and lisp -files. - <>= - -DEPSYS= ../interp/depsys$(EXEEXT) +## We use interpsys, built from previous stage, to bootstrap the algebra +## files. In fact, we use interpsys to build everything. +COMPILE_LISP = ../interp/interpsys$(EXEEXT) -- --compile --output=$@ $< @ @@ -1811,8 +1807,7 @@ ${OUT}/%.o: %.NRLIB/code.o # Compile bootstrap file to machine object code, and the result # immediately available for AXIOMsys consumption. strap/%.o: %.lsp - $(DEPSYS) -- --compile --output=$@ $< - cp $@ ${OUT} + $(COMPILE_LISP) && $(INSTALL) $@ $(OUT) @ <>= diff --git a/src/interp/ChangeLog b/src/interp/ChangeLog index 7651ebe6..2079573a 100644 --- a/src/interp/ChangeLog +++ b/src/interp/ChangeLog @@ -1,3 +1,8 @@ +2007-09-24 Gabriel Dos Reis + + * bookvol5.pamphlet (restart): Simplify. Handle command line + arguments. + 2007-09-19 Gabriel Dos Reis * Makefile.pamphlet (${DEPSYS}): Now depend on the compiled form diff --git a/src/interp/bookvol5.pamphlet b/src/interp/bookvol5.pamphlet index 74304b87..8ed64eba 100644 --- a/src/interp/bookvol5.pamphlet +++ b/src/interp/bookvol5.pamphlet @@ -657,12 +657,12 @@ We do not care that tail recursion occurs. #+:akcl (setq compiler::*suppress-compiler-notes* t) #-:CCL (in-package "BOOT") -#+:CCL - (setq *package* (find-package "BOOT")) -#+:CCL (setpchar "") ;; Turn off CCL read prompts -#+(OR :akcl :CCL) (initroot) + + ;; Do any command-line processing that may be needed + (|AxiomCore|::|topLevel|) + (initroot) #+:akcl (system:gbc-time 0) -#+:akcl + (when (and $openServerIfTrue (fboundp '|openServer|)) (prog (os) (setq os (|openServer| $SpadServerName)) @@ -670,17 +670,6 @@ We do not care that tail recursion occurs. (progn (setq $openServerIfTrue nil) (setq |$SpadServer| t))))) -;; We do the following test at runtime to allow us to use the same images -;; with Saturn and Sman. MCD 30-11-95 -#+:CCL - (when - (and (memq :unix *features*) $openServerIfTrue (fboundp '|openServer|)) - (prog (os) - (setq os (|openServer| $SpadServerName)) - (if (zerop os) - (progn - (setq $openServerIfTrue nil) - (setq |$SpadServer| t))))) (setq |$IOindex| 1) (setq |$InteractiveFrame| (|makeInitialModemapFrame|)) (|loadExposureGroupData|) diff --git a/src/lisp/ChangeLog b/src/lisp/ChangeLog index 72e17d56..10c3a1ee 100644 --- a/src/lisp/ChangeLog +++ b/src/lisp/ChangeLog @@ -1,3 +1,10 @@ +2007-09-24 Gabriel Dos Reis + + * core.lisp.in (|handleCommandLine|): Return truthvalue on success. + Don't call $originalLispTopLevel. + (|compileLispHandler|): Rename file to in-file. + (|topLevel|): Exit only whne handleCommandLine indicates so. + 2007-09-13 Gabriel Dos Reis * Makefile.pamphlet (core.lisp): Fix thinko. diff --git a/src/lisp/core.lisp.in b/src/lisp/core.lisp.in index 68016d3e..1cdf990c 100644 --- a/src/lisp/core.lisp.in +++ b/src/lisp/core.lisp.in @@ -436,7 +436,7 @@ (when (null driver) (|fatalError| (format nil "invalid option ~S" request))) (funcall driver prog-name options args))) - + (defun |hasHandler?| (request) (|getDriver| request)) @@ -444,42 +444,38 @@ (get request 'use-file-type)) (defun |handleCommandLine| (prog-name options args) - ;; If no argument was specified on command line, then pretend - ;; we must act as the underlying Lisp system's REPL. This is hard - ;; to do portabl and correctly, for obvious reasons So what follows - ;; is an approximation, good enough for now. FIXME: revisit this - ;; gorss hack. - (unless (or options args) - ;; GCL called us through system::*top-level-hook* which we set - ;; in a previous life. Now unset it, otherwise, it will call - ;; us again, and we will find ourselves in the same place - ;; again, again, until death follows. - #+:gcl (setq system::*top-level-hook* nil) - (funcall |$originalLispTopLevel|)) - - (dolist (opt options) + (when (or options args) + (dolist (opt options t) (cond ((eq (car opt) (|Option| "help")) ; print help, get out of here (|helpHandler| prog-name)) - - ((null args) ; we must have at least one arg - (|printUsage| prog-name) - (|coreQuit| 1)) - - ((|useFileType?| (car opt)) ; process based on file type + + ;; If we need to do an action based on the extension of + ;; input file, make sure we have at least one. + ((|useFileType?| (car opt)) + (unless args + (|coreError| "missing input files") + (return t)) (dolist (f args) (let* ((file-type (|getFileType| f)) (opt-name (car opt)) (request (cons opt-name file-type))) - (|handleRequest| prog-name request options f)))) - - ((stringp (cdr opt)) ; option value - (when (|hasHandler?| (car opt)) - (|handleRequest| prog-name (car opt) options args))) + (unless (|handleRequest| prog-name request options f) + (return nil))))) + + ;; In general, nothing is to be done for option value + ;; specification. However, some specifications may require + ;; some special handlers. + ((stringp (cdr opt)) + (when (|hasHandler?| (car opt)) + (unless (|handleRequest| prog-name (car opt) options args) + (return nil)))) - (t ; assume we must execute this - (|handleRequest| prog-name (car opt) options args))))) - + ;; By now, we are assumed to execute a driver associated + ;; with the option. Hope one is installed... + (t (unless (|handleRequest| prog-name (car opt) options args) + (return nil)))))) +) ;; ;; -*- --help Handler -*- @@ -608,11 +604,11 @@ (|warn| "Lisp code contained warnings"))) result)) -(defun |compileLispHandler| (prog-name options file) +(defun |compileLispHandler| (prog-name options in-file) (declare (ignore prog-name)) (let ((out-file (|getOutputPathname| options - (|compileFilePathname| file)))) - (|compileLispFile| file out-file))) + (|compileFilePathname| in-file)))) + (|compileLispFile| in-file out-file))) (|associateRequestWithFileType| (|Option| "compile") |$LispFileType| #'|compileLispHandler|) @@ -645,8 +641,8 @@ (when (boundp '|$sysScope|) (setq *package* (find-package (symbol-value '|$sysScope|)))) - (|handleCommandLine| (car command-args) options args) - (|coreQuit| (if (> (|errorCount|) 0) 1 0))))) + (when (|handleCommandLine| (car command-args) options args) + (|coreQuit| (if (> (|errorCount|) 0) 1 0)))))) ;; -- cgit v1.2.3