Skip to content

Commit

Permalink
Return ASDF module names to lowercase since ASDF insists on it.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcbeaudoin committed Dec 29, 2016
1 parent e9d92be commit 91b7d13
Show file tree
Hide file tree
Showing 13 changed files with 47 additions and 44 deletions.
6 changes: 4 additions & 2 deletions contrib/asdf/bundle.lisp
Expand Up @@ -538,8 +538,10 @@ for all the linkable object files associated with the system or its dependencies
#+clasp (compile-file-pathname (make-pathname :name name :defaults "sys:") :output-type :object)
#+ecl (compile-file-pathname (make-pathname :name name :defaults "sys:") :type :lib)
#+ecl (compile-file-pathname (make-pathname :name name :defaults "sys:") :type :object)
#+mkcl (make-pathname :name name :type (bundle-pathname-type :lib) :defaults #p"sys:")
#+mkcl (make-pathname :name name :type (bundle-pathname-type :lib) :defaults #p"sys:contrib;")))))
#+mkcl (make-pathname :name name :type (bundle-pathname-type :lib)
:defaults (translate-logical-pathname #p"sys:"))
#+mkcl (make-pathname :name name :type (bundle-pathname-type :lib)
:defaults (translate-logical-pathname #p"sys:contrib;"))))))

(defun make-library-system (name &optional (pathname (system-module-pathname name)))
"Creates a prebuilt-system if PATHNAME isn't NIL."
Expand Down
2 changes: 1 addition & 1 deletion contrib/asdf/footer.lisp
Expand Up @@ -60,7 +60,7 @@
(dolist (f '(:asdf :asdf2 :asdf3 :asdf3.1 :asdf-package-system)) (pushnew f *features*))

;; Provide both lowercase and uppercase, to satisfy more people, especially LispWorks users.
#-mkcl (provide "asdf") (provide "ASDF")
(provide "asdf") (provide "ASDF")

(cleanup-upgraded-asdf))

Expand Down
2 changes: 1 addition & 1 deletion contrib/asdf/test/test-program.script
Expand Up @@ -126,7 +126,7 @@
(progn
(DBG "Now create an program without UIOP")
(assert (probe-file (asdf/bundle::system-module-pathname "asdf")))
(assert (probe-file (asdf/bundle::system-module-pathname "cmp")))
(assert (probe-file (asdf/bundle::system-module-pathname "CMP")))
(def-test-system hello-no-uiop
:class program-system
:no-uiop t
Expand Down
2 changes: 1 addition & 1 deletion contrib/asdf/uiop/driver.lisp
Expand Up @@ -15,4 +15,4 @@
:uiop/run-program :uiop/lisp-build :uiop/configuration :uiop/backward-driver))

;; Provide both lowercase and uppercase, to satisfy more people.
#-mkcl (provide "uiop") (provide "UIOP")
(provide "uiop") (provide "UIOP")
36 changes: 18 additions & 18 deletions src/Makefile.in
Expand Up @@ -72,8 +72,8 @@ MKCL_HFILES = mkcl/config.h \
mkcl/stacks.h


ASDF2_FASLS = ext/ASDF2.fasb ../contrib/asdf2-bundle/asdf2-bundle.fas
ASDF_FASLS = ext/ASDF.fasb ext/ASDF3.fasb
ASDF2_FASLS = ext/asdf2.fasb ../contrib/asdf2-bundle/asdf2-bundle.fas
ASDF_FASLS = ext/asdf.fasb ext/asdf3.fasb

CONTRIB_FASLS = \
ext/BYTECMP.fasb \
Expand All @@ -84,7 +84,7 @@ CONTRIB_FASLS = \
ext/SOCKETS.fasb \
ext/WALKER.fasb \
ext/UNICODE-NAMES.fasb \
asdf-stage/UIOP.fasb \
asdf-stage/uiop.fasb \
asdf-stage/trivial-features.fasb \
asdf-stage/trivial-garbage.fasb \
asdf-stage/alexandria.fasb \
Expand All @@ -94,7 +94,7 @@ CONTRIB_FASLS = \
asdf-stage/fiveam.fasb \
asdf-stage/rt.fasb

CONTRIB_STATIC_LIBS = ext/ASDF.a ext/ASDF3.a ext/ASDF2.a $(CONTRIB_FASLS:%.fasb=%.a)
CONTRIB_STATIC_LIBS = ext/asdf.a ext/asdf3.a ext/asdf2.a $(CONTRIB_FASLS:%.fasb=%.a)

BUILTINS = asdf profile rt serve-event SOCKETS mk-unix

Expand Down Expand Up @@ -132,23 +132,23 @@ asdf-stage-dir-exists:
mkdir ./asdf-stage
touch asdf-stage-dir-exists

ext/ASDF2.fasb ext/ASDF2.a: bin/mkcl-small$(EXE) ext-dir-exists build-asdf2.lsp cmp/CMP.fasb compile-utils.lsp ../contrib/asdf2/*.lisp
ext/asdf2.fasb ext/asdf2.a: bin/mkcl-small$(EXE) ext-dir-exists build-asdf2.lsp cmp/CMP.fasb compile-utils.lsp ../contrib/asdf2/*.lisp
bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-asdf2.lsp

ext/ASDF3.fasb ext/ASDF3.a: bin/mkcl-small$(EXE) ext-dir-exists build-asdf3.lsp cmp/CMP.fasb compile-utils.lsp ../contrib/asdf3/*.lisp
ext/asdf3.fasb ext/asdf3.a: bin/mkcl-small$(EXE) ext-dir-exists build-asdf3.lsp cmp/CMP.fasb compile-utils.lsp ../contrib/asdf3/*.lisp
(cd ../contrib/asdf3/; $(MAKE) build/asdf.lisp; mv -f build/asdf.lisp build/asdf3.lisp)
bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-asdf3.lsp

ext/ASDF.fasb ext/ASDF.a: bin/mkcl-small$(EXE) ext-dir-exists build-asdf.lsp cmp/CMP.fasb compile-utils.lsp ../contrib/asdf/*.lisp
ext/asdf.fasb ext/asdf.a: bin/mkcl-small$(EXE) ext-dir-exists build-asdf.lsp cmp/CMP.fasb compile-utils.lsp ../contrib/asdf/*.lisp
(cd ../contrib/asdf/; $(MAKE) build/asdf.lisp)
bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-asdf.lsp

asdf-stage/UIOP.fasb asdf-stage/UIOP.a: bin/mkcl-small$(EXE) asdf-stage-dir-exists build-uiop.lsp cmp/CMP.fasb compile-utils.lsp ext/ASDF.fasb ../contrib/asdf/uiop/*.lisp
asdf-stage/uiop.fasb asdf-stage/uiop.a: bin/mkcl-small$(EXE) asdf-stage-dir-exists build-uiop.lsp cmp/CMP.fasb compile-utils.lsp ext/asdf.fasb ../contrib/asdf/uiop/*.lisp
bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-uiop.lsp
cp ./asdf-stage/asdf/uiop/UIOP.fasb ./asdf-stage/
cp ./asdf-stage/asdf/uiop/UIOP.a ./asdf-stage/
cp ./asdf-stage/asdf/uiop/UIOP.asd ./asdf-stage/
bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-asdf-contrib-as2.lsp -- UIOP ../contrib/asdf/uiop/ ./asdf-stage/
cp ./asdf-stage/asdf/uiop/uiop.fasb ./asdf-stage/
cp ./asdf-stage/asdf/uiop/uiop.a ./asdf-stage/
cp ./asdf-stage/asdf/uiop/uiop.asd ./asdf-stage/
bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-asdf-contrib-as2.lsp -- uiop ../contrib/asdf/uiop/ ./asdf-stage/

ext/BYTECMP.fasb ext/BYTECMP.a: bin/mkcl-small$(EXE) ext-dir-exists build-bytecmp.lsp cmp/CMP.fasb compile-utils.lsp ../contrib/bytecmp/bytecmp.lsp
bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-bytecmp.lsp
Expand Down Expand Up @@ -179,7 +179,7 @@ ext/UNICODE-NAMES.fasb ext/UNICODE-NAMES.a: bin/mkcl-small$(EXE) ext-dir-exists



../contrib/asdf2-bundle/asdf2-bundle.fas: bin/mkcl-small$(EXE) build-asdf2-bundle.lsp cmp/CMP.fasb compile-utils.lsp ext/ASDF2.fasb ../contrib/asdf2-bundle/*.lisp
../contrib/asdf2-bundle/asdf2-bundle.fas: bin/mkcl-small$(EXE) build-asdf2-bundle.lsp cmp/CMP.fasb compile-utils.lsp ext/asdf2.fasb ../contrib/asdf2-bundle/*.lisp
$(RM) ../contrib/asdf2-bundle/asdf2-bundle.fas # something said it had to be remade but ASDF may not agree, so force it.
bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-asdf2-bundle.lsp

Expand Down Expand Up @@ -216,7 +216,7 @@ asdf-stage/babel.fasb asdf-stage/babel.a: bin/mkcl-small$(EXE) asdf-stage-dir-ex
bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-asdf-contrib-as2.lsp -- babel ../contrib/babel*/ ./asdf-stage/


asdf-stage/cffi.fasb asdf-stage/cffi.a: bin/mkcl-small$(EXE) asdf-stage-dir-exists build-asdf-contrib*.lsp $(ASDF_FASLS) $(ASDF2_FASLS) asdf-stage/UIOP.fasb asdf-stage/babel.fasb ../contrib/cffi*/src/*.lisp
asdf-stage/cffi.fasb asdf-stage/cffi.a: bin/mkcl-small$(EXE) asdf-stage-dir-exists build-asdf-contrib*.lsp $(ASDF_FASLS) $(ASDF2_FASLS) asdf-stage/uiop.fasb asdf-stage/babel.fasb ../contrib/cffi*/src/*.lisp
bin/mkcl-small$(EXE) -norc -q --external-format "(:ascii :lf)" -load build-asdf-contrib.lsp -- cffi ../contrib/cffi*/
cp ./asdf-stage/cffi*/cffi.fasb ./asdf-stage/
cp ./asdf-stage/cffi*/cffi.a ./asdf-stage/
Expand Down Expand Up @@ -432,7 +432,7 @@ install-base: all
done
$(INSTALL_DATA) c/dpp$(EXE) $(mkcldir)
$(INSTALL_DATA) mkcl_min$(EXE) $(mkcldir)
$(INSTALL_DATA) cmp/CMP.asd cmp/CMP.as2 $(mkcldir)
$(INSTALL_DATA) cmp/cmp.asd cmp/cmp.as2 $(mkcldir)
if [ -f cmp/CMP.a ] ; then $(INSTALL_DATA) cmp/CMP.a $(mkcldir); fi
$(INSTALL_PROGRAM) cmp/CMP.fasb $(mkcldir)

Expand All @@ -443,7 +443,7 @@ install-contribs: $(ASDF_FASLS) $(ASDF2_FASLS) $(CONTRIB_FASLS) libmkcc1.a
$(INSTALL_LIBRARY) libmkcc1.a $(libdir)/mkcc/@build_cpu@
for i in ext/*.as2 ext/*.asd; do $(INSTALL_DATA) $${i} $(mkcldir)/contrib/; done
for i in asdf-stage/*.as2 asdf-stage/*.asd; do $(INSTALL_DATA) $${i} $(mkcldir)/contrib/; done
for i in ext/ASDF.fasb ext/ASDF3.fasb ext/ASDF2.fasb ../contrib/unicode/UnicodeData.txt $(CONTRIB_FASLS) $(CONTRIB_STATIC_LIBS); do \
for i in ext/asdf.fasb ext/asdf3.fasb ext/asdf2.fasb ../contrib/unicode/UnicodeData.txt $(CONTRIB_FASLS) $(CONTRIB_STATIC_LIBS); do \
if test -s $$i; then \
case $$i in \
*.fasb) $(INSTALL_PROGRAM) $$i $(mkcldir)/contrib/;; \
Expand Down Expand Up @@ -504,7 +504,7 @@ install-base-local: all
done
$(INSTALL_DATA) c/dpp$(EXE) $(localmkcldir)
$(INSTALL_DATA) mkcl_min$(EXE) $(localmkcldir)
$(INSTALL_DATA) cmp/CMP.asd cmp/CMP.as2 $(localmkcldir)
$(INSTALL_DATA) cmp/cmp.asd cmp/cmp.as2 $(localmkcldir)
if [ -f cmp/CMP.a ] ; then $(INSTALL_DATA) cmp/CMP.a $(localmkcldir); fi
$(INSTALL_PROGRAM) cmp/CMP.fasb $(localmkcldir)

Expand All @@ -513,7 +513,7 @@ install-contribs-local: $(ASDF_FASLS) $(ASDF2_FASLS) $(CONTRIB_FASLS) libmkcc1.a
$(INSTALL_LIBRARY) libmkcc1.a ./lib/mkcc/@build_cpu@
for i in ext/*.as2 ext/*.asd; do $(INSTALL_DATA) $${i} $(localmkcldir)/contrib/; done
for i in asdf-stage/*.as2 asdf-stage/*.asd; do $(INSTALL_DATA) $${i} $(localmkcldir)/contrib/; done
for i in ext/ASDF.fasb ext/ASDF3.fasb ext/ASDF2.fasb ../contrib/unicode/UnicodeData.txt $(CONTRIB_FASLS) $(CONTRIB_STATIC_LIBS); do \
for i in ext/asdf.fasb ext/asdf3.fasb ext/asdf2.fasb ../contrib/unicode/UnicodeData.txt $(CONTRIB_FASLS) $(CONTRIB_STATIC_LIBS); do \
if test -s $$i; then \
case $$i in \
*.fasb) $(INSTALL_PROGRAM) $$i $(localmkcldir)/contrib/;; \
Expand Down
6 changes: 3 additions & 3 deletions src/build-asdf-contrib-as2.lsp
Expand Up @@ -36,8 +36,8 @@

;;(format t "dest-dir = ~S~%" dest-dir)

;;(load "ext/ASDF2.fasb") ;; load the local one.
(load "ext/ASDF.fasb")
;;(load "ext/asdf2.fasb") ;; load the local one.
(load "ext/asdf.fasb")

;;(push '(mkcl:getcwd) asdf:*central-registry*) ;; ASDF 1 old style

Expand Down Expand Up @@ -103,7 +103,7 @@
(when maintainer (setq sys-attr (list* :maintainer maintainer sys-attr)))
(when licence (setq sys-attr (list* :licence licence sys-attr)))

(build-substitute-as2-file sys-name dest-dir sys-attr)
(build-substitute-as2-file sys-name sys-name dest-dir sys-attr)
)

(mkcl:quit :exit-code 0)
Expand Down
2 changes: 1 addition & 1 deletion src/build-asdf-contrib.lsp
Expand Up @@ -35,7 +35,7 @@
(mkcl:setenv "ASDF_OUTPUT_TRANSLATIONS" nil)
(mkcl:setenv "CL_SOURCE_REGISTRY" nil)

(load "ext/ASDF.fasb") ;; load the local one.
(load "ext/asdf.fasb") ;; load the local one.

;;(push '(mkcl:getcwd) asdf:*central-registry*) ;; ASDF 1 old style

Expand Down
2 changes: 1 addition & 1 deletion src/build-asdf.lsp
Expand Up @@ -23,7 +23,7 @@
;;;
;;; * ASDF
;;;
(build-module "ASDF"
(build-module "asdf"
'("../contrib/asdf/build/asdf.lisp")
:destdir "./ext/"
)
Expand Down
2 changes: 1 addition & 1 deletion src/build-asdf2-bundle.lsp
Expand Up @@ -24,7 +24,7 @@
;;(setq compiler::*trace-cc* t)

(multiple-value-bind (result bundling-error)
(ignore-errors (load "ext/ASDF2.fasb")) ;; load the local ASDF 2 which in turn load/build asdf2-bundle.
(ignore-errors (load "ext/asdf2.fasb")) ;; load the local ASDF 2 which in turn load/build asdf2-bundle.
(unless result
(format *error-output*
"~&ASDF failed to load package asdf2-bundle! Reason is: ~S ~A.~%"
Expand Down
2 changes: 1 addition & 1 deletion src/build-asdf2.lsp
Expand Up @@ -23,7 +23,7 @@
;;;
;;; * ASDF
;;;
(build-module "ASDF2"
(build-module "asdf2"
'("../contrib/asdf2/asdf2.lisp")
:destdir "./ext/"
)
Expand Down
2 changes: 1 addition & 1 deletion src/build-asdf3.lsp
Expand Up @@ -23,7 +23,7 @@
;;;
;;; * ASDF
;;;
(build-module "ASDF3"
(build-module "asdf3"
'("../contrib/asdf3/build/asdf3.lisp")
:destdir "./ext/"
)
Expand Down
4 changes: 2 additions & 2 deletions src/build-uiop.lsp
Expand Up @@ -20,7 +20,7 @@

;;(setq compiler::*trace-cc* t)

(load "ext/ASDF.fasb")
(load "ext/asdf.fasb")

#+asdf2
(let* ((current-dir (mkcl:getcwd))
Expand Down Expand Up @@ -51,7 +51,7 @@

(format t "~&About to build UIOP.~%")(finish-output)
(multiple-value-bind (result bundling-error)
(ignore-errors (asdf:bundle-system "UIOP"))
(ignore-errors (asdf:bundle-system "uiop"))
(unless result
(format t "~%asdf:bundle-system failed! Reason is: ~S ~A.~%" bundling-error bundling-error)
(finish-output)
Expand Down
23 changes: 12 additions & 11 deletions src/compile-utils.lsp
Expand Up @@ -126,24 +126,24 @@
sources)))


(defun build-substitute-as2-file (name destdir system-attribs) ;; This is for ASDF 2
(with-open-file (*standard-output* (make-pathname :name name :type "as2" :defaults destdir)
(defun build-substitute-as2-file (asdf-module-name name destdir system-attribs) ;; This is for ASDF 2
(with-open-file (*standard-output* (make-pathname :name asdf-module-name :type "as2" :defaults destdir)
:direction :output :if-exists :supersede :if-does-not-exist :create)
(pprint `(defsystem ,name
(pprint `(defsystem ,asdf-module-name
:components ((:bundle ,(string name)))
,@system-attribs
))
(terpri)))

(defun build-substitute-asd-file (name destdir system-attribs) ;; This is for ASDF 3 (and later hopefully)
(with-open-file (*standard-output* (make-pathname :name name :type "asd" :defaults destdir)
(defun build-substitute-asd-file (asdf-module-name name destdir system-attribs) ;; This is for ASDF 3 (and later hopefully)
(with-open-file (*standard-output* (make-pathname :name asdf-module-name :type "asd" :defaults destdir)
:direction :output :if-exists :supersede :if-does-not-exist :create)
(format *standard-output* "(defsystem ~S~:*~%~
(format *standard-output* "(defsystem ~S~%~
~12T:class ASDF/BUNDLE::PREBUILT-SYSTEM~%~
~12T:depends-on nil~%~
~12T:components ((:compiled-file ~S~:*))~%~
~12T:lib \"~A.a\"~%~
~12T~{ ~S~})~%" (string name) system-attribs)
~12T~{ ~S~})~%" asdf-module-name (string name) system-attribs)
(terpri)))

(defun build-module (name sources &key
Expand All @@ -161,10 +161,11 @@
(clean-up destdir sources)
(format t "~&Bailing out from build-module condition handler!~%") (finish-output)
(mkcl:quit :exit-code 1)))))
(let* ((destname (make-pathname :name name :defaults destdir)))
(unless (or (equalp name "asdf") (equalp name "asdf2"))
(build-substitute-as2-file name destdir nil)
(build-substitute-asd-file name destdir nil))
(let* ((asdf-module-name (string-downcase name)) ;; ASDF is hell-bent on downcasing system names by default.
(destname (make-pathname :name name :defaults destdir)))
(unless (find asdf-module-name '("asdf" "asdf2" "asdf3") :test #'equalp)
(build-substitute-as2-file asdf-module-name name destdir nil)
(build-substitute-asd-file asdf-module-name name destdir nil))
(if builtin
(let* ((objects (compile-if-old destdir sources)))
(unless (compiler::build-static-library destname :lisp-object-files objects)
Expand Down

0 comments on commit 91b7d13

Please sign in to comment.