From 2365c1b81d99c8e8e34665052f5b47be5cd6cd74 Mon Sep 17 00:00:00 2001 From: Rudi Schlatte Date: Wed, 5 Apr 2006 07:46:56 +0000 Subject: [PATCH] 0.9.11.12 new toplevel options --no-sysinit, --no-userinit to inhibit loading the corresponding init files ... also fixes the win32 build failure that motivated this change --- NEWS | 2 ++ doc/manual/start-stop.texinfo | 17 ++++++++++------- doc/sbcl.1 | 16 ++++++++++------ make-target-2.sh | 2 +- make-target-contrib.sh | 2 +- make.sh | 6 +++++- src/code/toplevel.lisp | 14 ++++++++++++-- src/runtime/runtime.c | 2 +- version.lisp-expr | 2 +- 9 files changed, 43 insertions(+), 20 deletions(-) diff --git a/NEWS b/NEWS index 35e72ee..92abfb2 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,7 @@ ;;;; -*- coding: utf-8; -*- changes in sbcl-0.9.12 relative to sbcl-0.9.11: + * new feature: command line options --no-sysinit, --no-userinit to + inhibit loading the corresponding init files * bug fix: LISTEN sometimes returned T even in cases where no data was immediately available from the stream * fixed bug: types of the last two arguments to SET-SYNTAX-FROM-CHAR diff --git a/doc/manual/start-stop.texinfo b/doc/manual/start-stop.texinfo index 86c1956..1e4811f 100644 --- a/doc/manual/start-stop.texinfo +++ b/doc/manual/start-stop.texinfo @@ -208,16 +208,19 @@ chance to see it. @item --sysinit @var{filename} Load filename instead of the default system initialization file -(@pxref{System Initialization File}.) There is no special option to -cause no system initialization file to be read, but on a Unix -system ``@code{"--sysinit /dev/null}'' can be used to achieve the same -effect. +(@pxref{System Initialization File}.) + +@item --no-sysinit +Don't load a system-wide initialization file. If this option is given, +the @code{--sysinit} option is ignored. @item --userinit @var{filename} Load filename instead of the default user initialization file -(@pxref{User Initialization File}.) There is no special option to -cause no user initialization file to be read, but ``@code{--userinit -/dev/null}'' can be used to achieve the same effect. +(@pxref{User Initialization File}.) + +@item --no-userinit +Don't load a user initialization file. If this option is given, +the @code{--userinit} option is ignored. @item --eval @var{command} After executing any initialization file, but before starting the diff --git a/doc/sbcl.1 b/doc/sbcl.1 index cd50ff2..32eae83 100644 --- a/doc/sbcl.1 +++ b/doc/sbcl.1 @@ -289,15 +289,19 @@ The toplevel options supported by the standard SBCL core are .TP 3 .B \-\-sysinit Load filename instead of the default system-wide initialization file. -(See the FILES section.) There is no special option to cause no -system-wide initialization file to be read, but on a Unix system -"\-\-sysinit /dev/null" can be used to achieve the same effect. +(See the FILES section.) +.TP 3 +.B \-\-no\-sysinit +Do not load a system-wide initialization file. If this option is +given, the \-\-sysinit option is ignored. .TP 3 .B \-\-userinit Load filename instead of the default user initialization file. (See -the FILES section.) There is no special option to cause no user -initialization file to be read, but on a Unix system "\-\-userinit -/dev/null" can be used to achieve the same effect. +the FILES section.) +.TP 3 +.B \-\-no\-userinit +Do not load a user initialization file. If this option is +given, the \-\-userinit option is ignored. .TP 3 .B \-\-eval After executing any initialization file, but before starting the diff --git a/make-target-2.sh b/make-target-2.sh index 998bffe..803c44e 100644 --- a/make-target-2.sh +++ b/make-target-2.sh @@ -32,4 +32,4 @@ export LANG LC_ALL echo //doing warm init ./src/runtime/sbcl \ --core output/cold-sbcl.core \ ---sysinit /dev/null --userinit /dev/null < make-target-2.lisp +--no-sysinit --no-userinit < make-target-2.lisp diff --git a/make-target-contrib.sh b/make-target-contrib.sh index 3e96449..6d10ca3 100644 --- a/make-target-contrib.sh +++ b/make-target-contrib.sh @@ -34,7 +34,7 @@ SBCL_HOME=$SBCL_BASE/contrib export SBCL_HOME -SBCL="$SBCL_BASE/src/runtime/sbcl --noinform --core $SBCL_BASE/output/sbcl.core --disable-debugger" +SBCL="$SBCL_BASE/src/runtime/sbcl --noinform --core $SBCL_BASE/output/sbcl.core --disable-debugger --no-sysinit --no-userinit" SBCL_BUILDING_CONTRIB=1 export SBCL SBCL_BUILDING_CONTRIB diff --git a/make.sh b/make.sh index 58907b8..3de7b11 100755 --- a/make.sh +++ b/make.sh @@ -60,7 +60,11 @@ export LANG LC_ALL build_started=`date` echo "//starting build: $build_started" -SBCL_XC_HOST="${1:-sbcl --disable-debugger --userinit /dev/null --sysinit /dev/null}" +if [ "$OSTYPE" = "cygwin" -o "$OSTYPE" = "msys" ] ; then + SBCL_XC_HOST="${1:-sbcl --disable-debugger --userinit NUL --sysinit NUL}" +else + SBCL_XC_HOST="${1:-sbcl --disable-debugger --userinit /dev/null --sysinit /dev/null}" +fi export SBCL_XC_HOST echo //SBCL_XC_HOST=\"$SBCL_XC_HOST\" diff --git a/src/code/toplevel.lisp b/src/code/toplevel.lisp index 274b03d..f2147a6 100644 --- a/src/code/toplevel.lisp +++ b/src/code/toplevel.lisp @@ -360,8 +360,12 @@ steppers to maintain contextual information.") (/show0 "entering TOPLEVEL-INIT") (let (;; value of --sysinit option (sysinit nil) + ;; t if --no-sysinit option given + (no-sysinit nil) ;; value of --userinit option (userinit nil) + ;; t if --no-userinit option given + (no-userinit nil) ;; values of --eval options, in reverse order; and also any ;; other options (like --load) which're translated into --eval ;; @@ -412,11 +416,17 @@ steppers to maintain contextual information.") (if sysinit (startup-error "multiple --sysinit options") (setf sysinit (pop-option)))) + ((string= option "--no-sysinit") + (pop-option) + (setf no-sysinit t)) ((string= option "--userinit") (pop-option) (if userinit (startup-error "multiple --userinit options") (setf userinit (pop-option)))) + ((string= option "--no-userinit") + (pop-option) + (setf no-userinit t)) ((string= option "--eval") (pop-option) (push (pop-option) reversed-evals)) @@ -502,8 +512,8 @@ steppers to maintain contextual information.") ;; figure out what's going on.) (restart-case (progn - (process-init-file sysinit-truename) - (process-init-file userinit-truename) + (unless no-sysinit (process-init-file sysinit-truename)) + (unless no-userinit (process-init-file userinit-truename)) (process-eval-options (reverse reversed-evals))) (abort () :report "Skip to toplevel READ/EVAL/PRINT loop." diff --git a/src/runtime/runtime.c b/src/runtime/runtime.c index 4c5434e..cba2f73 100644 --- a/src/runtime/runtime.c +++ b/src/runtime/runtime.c @@ -148,7 +148,7 @@ start it and work with the customary Lisp READ-EVAL-PRINT loop.\n\ \n\ One option idiom which is sometimes useful interactively (e.g. when\n\ exercising a test case for a bug report) is\n\ - sbcl --sysinit /dev/null --userinit /dev/null\n\ + sbcl --no-sysinit --no-userinit\n\ to keep SBCL from reading any initialization files at startup. And some\n\ people like to suppress the default startup message:\n\ sbcl --noinform\n\ diff --git a/version.lisp-expr b/version.lisp-expr index 1e0cf6d..6390dc1 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.9.11.11" +"0.9.11.12" -- 1.7.10.4