Skip to content
Snippets Groups Projects
Commit a47dbed7 authored by Raymond Toy's avatar Raymond Toy
Browse files

Merge branch 'issue-113-prefer-cmucl-modules' into 'master'

Fix #113:  Search cmucl modules and libraries first

Closes #113

See merge request cmucl/cmucl!78
parents a2dfe20d 3824d74a
No related branches found
No related tags found
No related merge requests found
...@@ -37,8 +37,13 @@ ...@@ -37,8 +37,13 @@
(defvar *require-verbose* t (defvar *require-verbose* t
"*load-verbose* is bound to this before loading files.") "*load-verbose* is bound to this before loading files.")
(defvar *cmucl-provider-functions*
'(module-provide-cmucl-defmodule module-provide-cmucl-library)
"Provider functions for cmucl modules and libraries. These are
searched first before trying *module-provider-functions*")
(defvar *module-provider-functions* (defvar *module-provider-functions*
'(module-provide-cmucl-defmodule module-provide-cmucl-library) nil
"See function documentation for REQUIRE") "See function documentation for REQUIRE")
;;;; Defmodule. ;;;; Defmodule.
...@@ -102,11 +107,6 @@ ...@@ -102,11 +107,6 @@
\"contrib-games-feebs\", \"contrib-hist\", \"contrib-psgraph\", \"contrib-games-feebs\", \"contrib-hist\", \"contrib-psgraph\",
\"contrib-ops\", \"contrib-embedded-c\", \"contrib-sprof\", and \"contrib-ops\", \"contrib-embedded-c\", \"contrib-sprof\", and
\"contrib-packed-sse2\". " \"contrib-packed-sse2\". "
;; First, load asdf if it's not already loaded. This is needed to
;; load easily the contribs that use asdf. There are no contribs
;; that use defsystem, so we won't autoload defsystem.
(unless (featurep :asdf)
(load "modules:asdf/asdf"))
(let ((saved-modules (copy-list *modules*)) (let ((saved-modules (copy-list *modules*))
(module-name (module-name-string module-name))) (module-name (module-name-string module-name)))
(unless (member module-name *modules* :test #'string=) (unless (member module-name *modules* :test #'string=)
...@@ -114,9 +114,20 @@ ...@@ -114,9 +114,20 @@
(if pathname (if pathname
(dolist (file (if (consp pathname) pathname (list pathname)) t) (dolist (file (if (consp pathname) pathname (list pathname)) t)
(load file)) (load file))
(unless (some (lambda (p) (funcall p module-name)) ;; Search *cmucl-provider-functions* first so that we'll
*module-provider-functions*) ;; load our version of clx (and friends) before loading
(error (intl:gettext "Don't know how to load ~A") module-name))))) ;; any asdf version, if asdf is loaded.
(or (some (lambda (p) (funcall p module-name))
*cmucl-provider-functions*)
(progn
;; Load asdf if it's not already loaded. This is needed to
;; load easily the contribs that use asdf. There are no contribs
;; that use defsystem, so we won't autoload defsystem.
(unless (featurep :asdf)
(load "modules:asdf/asdf"))
(some (lambda (p) (funcall p module-name))
*module-provider-functions*))
(error (intl:gettext "Don't know how to load ~A") module-name)))))
(set-difference *modules* saved-modules))) (set-difference *modules* saved-modules)))
;;;; Default module providers ;;;; Default module providers
......
...@@ -10397,6 +10397,12 @@ msgstr "" ...@@ -10397,6 +10397,12 @@ msgstr ""
msgid "*load-verbose* is bound to this before loading files." msgid "*load-verbose* is bound to this before loading files."
msgstr "" msgstr ""
   
#: src/code/module.lisp
msgid ""
"Provider functions for cmucl modules and libraries. These are\n"
" searched first before trying *module-provider-functions*"
msgstr ""
#: src/code/module.lisp #: src/code/module.lisp
msgid "See function documentation for REQUIRE" msgid "See function documentation for REQUIRE"
msgstr "" msgstr ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment