Changeset 13319
- Timestamp:
- 06/10/11 09:28:30 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/asdf.lisp
r13318 r13319 1 1 ;;; -*- mode: common-lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*- 2 ;;; This is ASDF 2.016 : Another System Definition Facility.2 ;;; This is ASDF 2.016.1: Another System Definition Facility. 3 3 ;;; 4 4 ;;; Feedback, bug reports, and patches are all welcome: … … 63 63 :test 'equalp :key 'car)) ; need that BEFORE any mention of package ASDF as below 64 64 #+(and ecl (not ecl-bytecmp)) (require :cmp) 65 #+gcl 66 (when (or (< system::*gcl-major-version* 2) 67 (and (= system::*gcl-major-version* 2) 68 (< system::*gcl-minor-version* 7))) 69 (pushnew :gcl-pre2.7 *features*)) 65 70 #+(and (or win32 windows mswindows mingw32) (not cygwin)) (pushnew :asdf-windows *features*) 66 71 #+(or unix cygwin) (pushnew :asdf-unix *features*) … … 85 90 ;; Has to be inside the eval-when to make Lispworks happy (!) 86 91 (defmacro compatfmt (format) 87 #- generaformat88 #+ genera92 #-(or gcl genera) format 93 #+(or gcl genera) 89 94 (loop :for (unsupported . replacement) :in 90 '(("~@<" . "") 91 ("; ~@;" . "; ") 92 ("~3i~_" . "") 93 ("~@:>" . "") 94 ("~:>" . "")) :do 95 `(("~3i~_" . "") 96 #+genera 97 ,@(("~@<" . "") 98 ("; ~@;" . "; ") 99 ("~@:>" . "") 100 ("~:>" . ""))) :do 95 101 (loop :for found = (search unsupported format) :while found :do 96 102 (setf format … … 107 113 ;; "2.345.0.7" would be your seventh local modification of official release 2.345 108 114 ;; "2.345.6.7" would be your seventh local modification of development version 2.345.6 109 (asdf-version "2.016 ")115 (asdf-version "2.016.1") 110 116 (existing-asdf (find-class 'component nil)) 111 117 (existing-version *asdf-version*) … … 368 374 ;;;; User-visible parameters 369 375 ;;;; 370 (defun asdf-version ()371 "Exported interface to the version of ASDF currently installed. A string.372 You can compare this string with e.g.:373 (ASDF:VERSION-SATISFIES (ASDF:ASDF-VERSION) \"2.345.67\")."374 *asdf-version*)375 376 376 (defvar *resolve-symlinks* t 377 377 "Determine whether or not ASDF resolves symlinks when defining systems. … … 416 416 condition-format condition-location 417 417 coerce-name) 418 #- cormanlisp418 #-(or cormanlisp gcl-pre2.7) 419 419 (ftype (function (t t) t) (setf module-components-by-name))) 420 420 … … 424 424 (progn 425 425 (deftype logical-pathname () nil) 426 (defun make-broadcast-stream () *error-output*)427 (defun file-namestring (p)426 (defun* make-broadcast-stream () *error-output*) 427 (defun* file-namestring (p) 428 428 (setf p (pathname p)) 429 (format nil "~@[~A~]~@[.~A~]" (pathname-name p) (pathname-type p))) 430 (defparameter *count* 3) 431 (defun dbg (&rest x) 432 (format *error-output* "~S~%" x))) 433 #+cormanlisp 434 (defun maybe-break () 435 (decf *count*) 436 (unless (plusp *count*) 437 (setf *count* 3) 438 (break))) 429 (format nil "~@[~A~]~@[.~A~]" (pathname-name p) (pathname-type p)))) 439 430 440 431 ;;;; ------------------------------------------------------------------------- … … 445 436 `(defmacro ,def* (name formals &rest rest) 446 437 `(progn 447 #+(or ecl gcl) (fmakunbound ',name)438 #+(or ecl (and gcl (not gcl-pre2.7))) (fmakunbound ',name) 448 439 #-gcl ; gcl 2.7.0 notinline functions lose secondary return values :-( 449 440 ,(when (and #+ecl (symbolp name)) ; fails for setf functions on ecl … … 516 507 517 508 (defun* merge-pathnames* (specified &optional (defaults *default-pathname-defaults*)) 518 "MERGE-PATHNAMES* is like MERGE-PATHNAMES except that if the SPECIFIED pathname 519 does not have an absolute directory, then the HOST and DEVICE come from the DEFAULTS. 509 "MERGE-PATHNAMES* is like MERGE-PATHNAMES except that 510 if the SPECIFIED pathname does not have an absolute directory, 511 then the HOST and DEVICE both come from the DEFAULTS, whereas 512 if the SPECIFIED pathname does have an absolute directory, 513 then the HOST and DEVICE both come from the SPECIFIED. 520 514 Also, if either argument is NIL, then the other argument is returned unmodified." 521 515 (when (null specified) (return-from merge-pathnames* defaults)) … … 731 725 #+genera 732 726 (unless (fboundp 'ensure-directories-exist) 733 (defun ensure-directories-exist (path)727 (defun* ensure-directories-exist (path) 734 728 (fs:create-directories-recursively (pathname path)))) 735 729 … … 799 793 (string (probe-file* (parse-namestring p))) 800 794 (pathname (unless (wild-pathname-p p) 801 #.(or #+(or allegro clozure cmu cormanlisp ecl sbcl scl) '(probe-file p) 795 #.(or #+(or allegro clozure cmu cormanlisp ecl lispworks sbcl scl) 796 '(probe-file p) 802 797 #+clisp (aif (find-symbol* '#:probe-pathname :ext) 803 798 `(ignore-errors (,it p))) 804 799 '(ignore-errors (truename p))))))) 805 800 806 (defun* truenamize (p )801 (defun* truenamize (pathname &optional (defaults *default-pathname-defaults*)) 807 802 "Resolve as much of a pathname as possible" 808 803 (block nil 809 (when (typep p '(or null logical-pathname)) (return p)) 810 (let* ((p (merge-pathnames* p)) 811 (directory (pathname-directory p))) 804 (when (typep pathname '(or null logical-pathname)) (return pathname)) 805 (let ((p (merge-pathnames* pathname defaults))) 812 806 (when (typep p 'logical-pathname) (return p)) 813 807 (let ((found (probe-file* p))) 814 808 (when found (return found))) 815 #-(or cmu sbcl scl) (when (stringp directory) (return p)) 816 (when (not (eq :absolute (car directory))) (return p)) 809 (unless (absolute-pathname-p p) 810 (let ((true-defaults (ignore-errors (truename defaults)))) 811 (when true-defaults 812 (setf p (merge-pathnames pathname true-defaults))))) 813 (unless (absolute-pathname-p p) (return p)) 817 814 (let ((sofar (probe-file* (pathname-root p)))) 818 815 (unless sofar (return p)) … … 825 822 :version (pathname-version p)) 826 823 sofar))) 827 (loop :for component :in (cdr directory) 824 (loop :with directory = (normalize-pathname-directory-component 825 (pathname-directory p)) 826 :for component :in (cdr directory) 828 827 :for rest :on (cdr directory) 829 828 :for more = (probe-file* … … 848 847 path)) 849 848 850 (defun ensure-pathname-absolute (path)849 (defun* ensure-pathname-absolute (path) 851 850 (cond 852 851 ((absolute-pathname-p path) path) … … 878 877 879 878 #-scl 880 (defun directory-separator-for-host (&optional (pathname *default-pathname-defaults*))879 (defun* directory-separator-for-host (&optional (pathname *default-pathname-defaults*)) 881 880 (let ((foo (make-pathname :directory '(:absolute "FOO") :defaults pathname))) 882 881 (last-char (namestring foo)))) … … 962 961 (defgeneric* (setf component-property) (new-value component property)) 963 962 964 (eval-when ( :compile-toplevel :load-toplevel :execute)963 (eval-when (#-gcl :compile-toplevel :load-toplevel :execute) 965 964 (defgeneric* (setf module-components-by-name) (new-value module))) 966 965 … … 1271 1270 (let ((pathname 1272 1271 (merge-pathnames* 1273 (component-relative-pathname component)1274 (pathname-directory-pathname (component-parent-pathname component)))))1272 (component-relative-pathname component) 1273 (pathname-directory-pathname (component-parent-pathname component))))) 1275 1274 (unless (or (null pathname) (absolute-pathname-p pathname)) 1276 1275 (error (compatfmt "~@<Invalid relative pathname ~S for component ~S~@:>") … … 1313 1312 (version-satisfies (component-version c) version)) 1314 1313 1315 (defun parse-version (string &optional on-error) 1314 (defun* asdf-version () 1315 "Exported interface to the version of ASDF currently installed. A string. 1316 You can compare this string with e.g.: 1317 (ASDF:VERSION-SATISFIES (ASDF:ASDF-VERSION) \"2.345.67\")." 1318 *asdf-version*) 1319 1320 (defun* parse-version (string &optional on-error) 1316 1321 "Parse a version string as a series of natural integers separated by dots. 1317 1322 Return a (non-null) list of integers if the string is valid, NIL otherwise. … … 1532 1537 (funcall thunk)))) 1533 1538 1534 (defmacro with-system-definitions (( ) &body body)1539 (defmacro with-system-definitions ((&optional) &body body) 1535 1540 `(call-with-system-definitions #'(lambda () ,@body))) 1536 1541 … … 2114 2119 :initform nil))) 2115 2120 2116 (defun output-file (operation component)2121 (defun* output-file (operation component) 2117 2122 "The unique output file of performing OPERATION on COMPONENT" 2118 2123 (let ((files (output-files operation component))) … … 2145 2150 (*compile-file-failure-behaviour* (operation-on-failure operation))) 2146 2151 (multiple-value-bind (output warnings-p failure-p) 2147 (apply *compile-op-compile-file-function* source-file :output-file output-file2148 (compile-op-flags operation))2152 (apply *compile-op-compile-file-function* source-file 2153 :output-file output-file (compile-op-flags operation)) 2149 2154 (unless output 2150 2155 (error 'compile-error :component c :operation operation)) … … 3524 3529 (defun* compile-file-pathname* (input-file &rest keys &key output-file &allow-other-keys) 3525 3530 (if (absolute-pathname-p output-file) 3526 ;;; If the default ABCL rules for translating from a jar path to 3527 ;;; a non-jar path have been affected, no further computation of 3528 ;;; the output location is necessary. 3529 ;; (if (and (find :abcl *features*) 3530 ;; (pathname-device input-file) ; input-file is in a jar 3531 ;; (not (pathname-device output-file)) ; output-file is not in a jar 3532 ;; (equal (pathname-type input-file) "lisp") 3533 ;; (equal (pathname-type output-file) "abcl")) 3534 ;; output-file 3535 (apply 'compile-file-pathname (lispize-pathname input-file) keys);) 3531 ;; what cfp should be doing, w/ mp* instead of mp 3532 (let* ((type (pathname-type (apply 'compile-file-pathname "x.lisp" keys))) 3533 (defaults (make-pathname 3534 :type type :defaults (merge-pathnames* input-file)))) 3535 (merge-pathnames* output-file defaults)) 3536 3536 (apply-output-translations 3537 (apply 'compile-file-pathname 3538 (truenamize (lispize-pathname input-file)) 3539 keys)))) 3537 (apply 'compile-file-pathname input-file keys)))) 3540 3538 3541 3539 (defun* tmpize-pathname (x) … … 3738 3736 (make-pathname :directory nil :name *wild* :type "asd" :version :newest)) 3739 3737 3740 (defun directory-asd-files (directory)3738 (defun* directory-asd-files (directory) 3741 3739 (ignore-errors 3742 3740 (directory* (merge-pathnames* *wild-asd* directory)))) 3743 3741 3744 (defun subdirectories (directory)3742 (defun* subdirectories (directory) 3745 3743 (let* ((directory (ensure-directory-pathname directory)) 3746 3744 #-(or abcl cormanlisp genera xcl) … … 3770 3768 dirs)) 3771 3769 3772 (defun collect-asds-in-directory (directory collect)3770 (defun* collect-asds-in-directory (directory collect) 3773 3771 (map () collect (directory-asd-files directory))) 3774 3772 3775 (defun collect-sub*directories (directory collectp recursep collector)3773 (defun* collect-sub*directories (directory collectp recursep collector) 3776 3774 (when (funcall collectp directory) 3777 3775 (funcall collector directory)) … … 3780 3778 (collect-sub*directories subdir collectp recursep collector)))) 3781 3779 3782 (defun collect-sub*directories-asd-files3780 (defun* collect-sub*directories-asd-files 3783 3781 (directory &key 3784 3782 (exclude *default-source-registry-exclusions*)
Note: See TracChangeset
for help on using the changeset viewer.