From fa225349d274cc235054aba854e4d22412dd64b2 Mon Sep 17 00:00:00 2001 From: Francois-Rene Rideau Date: Tue, 7 Jul 2015 02:44:54 -0400 Subject: [PATCH] Tweak the asdf-tools script some more. Use CCL by default, which will be more portable. More tweaking of system loading configuration. --- tools/asdf-tools | 52 +++++++++++++++++++++++++------------------- tools/load-asdf.lisp | 4 ++-- 2 files changed, 32 insertions(+), 24 deletions(-) diff --git a/tools/asdf-tools b/tools/asdf-tools index 794f01e4..1d96bd3c 100755 --- a/tools/asdf-tools +++ b/tools/asdf-tools @@ -1,7 +1,11 @@ -":" ; exec sbcl --script "$0" "$@" ; exit # -*- Lisp -*- -;;;;; Really runs on any decent Common Lisp implementation -;;;;; Can also be invoked by cl-launch 4: -;;;;; cl-launch -sp asdf-tools -r entry-point -- "$@" +":" ; exec ${CCL:-ccl} --load "$0" -- "$@" ; exit # -*- Lisp -*- +#| +asdf-tools could also run on SBCL, or on any decent Common Lisp implementation, +including using cl-launch, but CCL is the single implementation that has decent +portable support on all of Windows, Linux (x64, x86, ARM), MacOS X +":" ; exec ${SBCL:-sbcl} --script "$0" "$@" ; exit +":" ; cl-launch -l ccl -Q -sp asdf-tools -r entry-point -- "$@" +|# (in-package :cl-user) ;; That may be default, but let's make double sure and tell SLIME. @@ -13,24 +17,28 @@ (or *compile-file-truename* *load-truename* (truename *default-pathname-defaults*)))))) ;;; ASDF3 is loaded, now use it! +(in-package :asdf) + (eval-when (:compile-toplevel :load-toplevel :execute) ;; For bootstrap purposes, avoid having to extract cl-launch.asd into ext/cl-launch/ - (let ((cl-launch-dir (uiop:subpathname (uiop:current-lisp-file-pathname) "../ext/cl-launch/"))) - (when (uiop:probe-file* (uiop:subpathname cl-launch-dir "dispatch.lisp")) - (asdf:register-preloaded-system - :cl-launch/dispatch - :class :package-inferred-system - :source-file nil - :pathname cl-launch-dir - :components '((cl-source-file "lisp" :pathname "dispatch.lisp"))))) - ;; Load either with or without quicklisp - #-quicklisp - (asdf:load-system :asdf-tools :verbose nil) - #+quicklisp - (let ((*standard-output* (make-broadcast-stream))) - (ql:quickload :asdf-tools))) - -(in-package :asdf-tools) + (let* ((asdf-dir (pathname-parent-directory-pathname + (ensure-absolute-pathname (current-lisp-file-pathname) 'getcwd))) + (cl-launch-dir (subpathname asdf-dir "ext/cl-launch/"))) + (when (and (not (find-system "cl-launch/dispatch" nil)) + (probe-file* (subpathname cl-launch-dir "dispatch.lisp"))) + (eval `(defsystem "cl-launch/dispatch" + :class :package-inferred-system + :source-file nil + :pathname ,cl-launch-dir + :components ((cl-source-file "lisp" :pathname "dispatch.lisp")))))) + ;; Depending on whether Quicklisp was loaded or not, either use it or use regular load-system + (defun load-sys (system) + (if (featurep :quicklisp) + (let ((*standard-output* (make-broadcast-stream))) ;; be quiet + (ql:quickload system)) + (load-system system :verbose nil))) + ;; Finally, load asdf-tools + (load-sys "asdf-tools")) -;;; Actually run the stuff! -(restore-image :entry-point 'entry-point :lisp-interaction nil) +;;; asdf-tools is loaded, now actually run it! +(restore-image :entry-point 'asdf-tools::entry-point :lisp-interaction nil) diff --git a/tools/load-asdf.lisp b/tools/load-asdf.lisp index 0b408302..13806b9a 100644 --- a/tools/load-asdf.lisp +++ b/tools/load-asdf.lisp @@ -75,7 +75,7 @@ ;; we'd move this form right below the (funcall 'require "asdf") above. ;; See also notes in try-load-quicklisp. (try-load-quicklisp)) - ;; User-configurable parts + ;; ****** User-configurable parts ****** (required-asdf-version () "3.1.2") ;; In the end, we want at least ASDF 3.1.2 (asdf-lisp () ;; Here, define where your Lisp source code hierarchy stores its copy of ASDF. @@ -129,7 +129,7 @@ ;; The above should already cover all paths that we use; ;; we don't want user configuration to interfere with the build. :ignore-inherited-configuration))) - ;; No more user-configurable parts below. + ;; ****** No more user-configurable parts below. ****** (asdf-call 'initialize-source-registry source-registry) (asdf-call 'initialize-output-translations output-translations)))) ;; Configure the printer -- GitLab