
Raymond Toy pushed to branch issue-363-add-version-number at cmucl / cmucl Commits: 9588b50e by Raymond Toy at 2025-02-08T16:23:26-08:00 Set *lisp-implementation-version* from cmucl_version Make `lisp::*lisp-implementation-version*` have the value of the C string `cmucl_version` that contains the actual version. To do this, we need to make `lisp::*lisp-implementation-version*` a static symbol. Fortunately, there are spare static symbols so we stole `spare-9` for this. Currently only done for x86, but the other OSes have spare symbols too. - - - - - 6d93dd02 by Raymond Toy at 2025-02-08T17:03:48-08:00 Add -print-version commandline switch so -help shows it. Add defswitch for print-version so that -help prints it out to inform the user of it's existence. The switch is never actually run because main() handles it and exits before lisp ever gets a chance to start. Update pot file for the new docstring. - - - - - 4 changed files: - src/code/commandline.lisp - src/compiler/x86/parms.lisp - src/i18n/locale/cmucl.pot - src/lisp/lisp.c Changes: ===================================== src/code/commandline.lisp ===================================== @@ -408,3 +408,10 @@ (defswitch "-version" #'version-switch-demon "Prints the cmucl version and exits; same as -version") +;; This is never actually called from lisp because main() handles it +;; and returns before the lisp initial function is ever run. It's +;; here so that -help will print it out so the user knows about it. +(defswitch "print-version" #'version-switch-demon + "Like -version, but a core file doesn't have to loaded first. The + version is printed and lisp exits immediately before doing any of the + core startup code.") ===================================== src/compiler/x86/parms.lisp ===================================== @@ -380,9 +380,9 @@ :key-or-value lisp::*unidata-path* + lisp::*lisp-implementation-version* ;; Spare symbols. Rename these when you need to add some static ;; symbols and don't want to do a cross-compile. - spare-9 spare-8 spare-7 spare-6 ===================================== src/i18n/locale/cmucl.pot ===================================== @@ -6216,6 +6216,13 @@ msgstr "" msgid "Prints the cmucl version and exits; same as -version" msgstr "" +#: src/code/commandline.lisp +msgid "" +"Like -version, but a core file doesn't have to loaded first. The\n" +" version is printed and lisp exits immediately before doing any of the\n" +" core startup code." +msgstr "" + #: src/code/env-access.lisp msgid "" "Returns information about the symbol VAR in the lexical environment ENV.\n" ===================================== src/lisp/lisp.c ===================================== @@ -913,6 +913,10 @@ main(int argc, const char *argv[], const char *envp[]) } #endif +#ifdef LISP_IMPLEMENTATION_VERSION + SetSymbolValue(LISP_IMPLEMENTATION_VERSION, alloc_string(cmucl_version)); +#endif + /* * Pick off sigint until the lisp system gets far enough along to * install it's own. View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/a460d05ff6c4dbfff7bf6ea... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/a460d05ff6c4dbfff7bf6ea... You're receiving this email because of your account on gitlab.common-lisp.net.
participants (1)
-
Raymond Toy (@rtoy)