From a873fe3d8c2843c3a9c16e0e7c15540dbfede030 Mon Sep 17 00:00:00 2001
From: Francois-Rene Rideau <tunes@google.com>
Date: Sun, 4 Sep 2011 19:08:27 -0400
Subject: [PATCH] Merging ECL patches by Juan Jose Garcia Ripoll <jjgarcia@users.sourceforge.net>
 Fix copyright notice for asdf-ecl.lisp
 Add again a comment that was missing in asdf-ecl.lisp
 In asdf-ecl.lisp, lib-op do not use :ld-flags (they call 'ar', not the linker)
 In asdf.lisp, distinguish between the two compilers that ECL offers:
 bytecodes compiler and lisp->C translator: only the later produces two files.
 Export *require-asdf-operator* so users can customize (e.g., in ECL, FASL-OP).

---
 asdf-ecl.lisp |   18 ++++++++++++++++--
 asdf.asd      |    2 +-
 asdf.lisp     |   36 ++++++++++++++++++++----------------
 3 files changed, 37 insertions(+), 19 deletions(-)

diff --git a/asdf-ecl.lisp b/asdf-ecl.lisp
index 90642e3..bbf9ffc 100644
--- a/asdf-ecl.lisp
+++ b/asdf-ecl.lisp
@@ -1,4 +1,5 @@
-;;; Copyright (c) 2005-2011 Michael Goffioul (michael dot goffioul at swing dot be)
+;;; Copyright (c) 2005 - 2007, Michael Goffioul (michael dot goffioul at swing dot be)
+;;; Copyright (c) 2008, Juan Jose Garcia Ripoll
 ;;;
 ;;;   This program is free software; you can redistribute it and/or
 ;;;   modify it under the terms of the GNU Library General Public
@@ -14,6 +15,15 @@
 (in-package :asdf)
 
 ;;;
+;;; COMPILE-OP / LOAD-OP (in asdf.lisp)
+;;;
+;;; In ECL, these operations produce both FASL files and the
+;;; object files that they are built from. Having both of them allows
+;;; us to later on reuse the object files for bundles, libraries,
+;;; standalone executables, etc.
+;;;
+
+;;;
 ;;; BUNDLE-OP
 ;;;
 ;;; This operation takes all components from one or more systems and
@@ -72,6 +82,11 @@
         (remove-keys '(type monolithic name-suffix)
                      (slot-value instance 'original-initargs))))
 
+(defmethod bundle-op-build-args :around ((op lib-op))
+  (let ((args (call-next-method)))
+    (remf args :ld-flags)
+    args))
+
 (defvar *force-load-p* nil)
 
 (defmethod operation-done-p :around ((operation load-op) c)
@@ -413,7 +428,6 @@
                        (and (first l) (register-pre-built-system name))
                        (values-list l)))))
 #+win32 (push '("asd" . si::load-source) si::*load-hooks*)
-(pushnew 'module-provide-asdf si:*module-provider-functions*)
 (pushnew (translate-logical-pathname "SYS:") *central-registry*)
 
 (provide :asdf)
diff --git a/asdf.asd b/asdf.asd
index 8fcdbcc..7b7e4d5 100644
--- a/asdf.asd
+++ b/asdf.asd
@@ -14,7 +14,7 @@
   :licence "MIT"
   :description "Another System Definition Facility"
   :long-description "ASDF builds Common Lisp software organized into defined systems."
-  :version "2.017.1" ;; to be automatically updated by bin/bump-revision
+  :version "2.017.2" ;; to be automatically updated by bin/bump-revision
   :depends-on ()
   :components
   ((:file "asdf")
diff --git a/asdf.lisp b/asdf.lisp
index c3b8561..bdbacff 100755
--- a/asdf.lisp
+++ b/asdf.lisp
@@ -1,5 +1,5 @@
 ;; -*- mode: common-lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*-
-;;; This is ASDF 2.017.1: Another System Definition Facility.
+;;; This is ASDF 2.017.2: Another System Definition Facility.
 ;;;
 ;;; Feedback, bug reports, and patches are all welcome:
 ;;; please mail to <asdf-devel@common-lisp.net>.
@@ -61,7 +61,7 @@
   (setf excl::*autoload-package-name-alist*
         (remove "asdf" excl::*autoload-package-name-alist*
                 :test 'equalp :key 'car)) ; need that BEFORE any mention of package ASDF as below
-  #+(and ecl (not ecl-bytecmp)) (require :cmp)
+  #+ecl (unless (member :ecl-bytecmp *features*) (require :cmp))
   #+gcl ;; Debian's GCL 2.7 has bugs with compiling multiple-value stuff, but can run ASDF 2.011
   (when (or (< system::*gcl-major-version* 2) ;; GCL 2.6 fails to fully compile ASDF at all
             (and (= system::*gcl-major-version* 2)
@@ -112,7 +112,7 @@
          ;; "2.345.6" would be a development version in the official upstream
          ;; "2.345.0.7" would be your seventh local modification of official release 2.345
          ;; "2.345.6.7" would be your seventh local modification of development version 2.345.6
-         (asdf-version "2.017.1")
+         (asdf-version "2.017.2")
          (existing-asdf (find-class 'component nil))
          (existing-version *asdf-version*)
          (already-there (equal asdf-version existing-version)))
@@ -298,6 +298,7 @@
             #:*compile-file-warnings-behaviour*
             #:*compile-file-failure-behaviour*
             #:*resolve-symlinks*
+            #:*require-asdf-operator*
             #:*asdf-verbose*
 
             #:asdf-version
@@ -4121,22 +4122,25 @@ with a different configuration, so the configuration would be re-read then."
 #+ecl
 (progn
   (setf *compile-op-compile-file-function*
-        (lambda (input-file &rest keys &key output-file &allow-other-keys)
-          (declare (ignore output-file))
-          (multiple-value-bind (object-file flags1 flags2)
-              (apply 'compile-file* input-file :system-p t keys)
-            (values (and object-file
-                         (c::build-fasl (compile-file-pathname object-file :type :fasl)
-                                        :lisp-files (list object-file))
-                         object-file)
-                    flags1
-                    flags2))))
+        (lambda (input-file &rest keys &key &allow-other-keys)
+          (if (member :ecl-bytecmp *features*)
+              (apply 'compile-file input-file keys)
+              (multiple-value-bind (object-file flags1 flags2)
+                  (apply 'compile-file* input-file :system-p t keys)
+                (values (and object-file
+                             (c::build-fasl (compile-file-pathname object-file :type :fasl)
+                                            :lisp-files (list object-file))
+                             object-file)
+                        flags1
+                        flags2)))))
 
   (defmethod output-files ((operation compile-op) (c cl-source-file))
     (declare (ignorable operation))
-    (let ((p (lispize-pathname (component-pathname c))))
-      (list (compile-file-pathname p :type :object)
-            (compile-file-pathname p :type :fasl))))
+    (let* ((p (lispize-pathname (component-pathname c)))
+           (f (compile-file-pathname p :type :fasl)))
+      (if (member :ecl-bytecmp *features*)
+          (list f)
+          (list (compile-file-pathname p :type :object) f))))
 
   (defmethod perform ((o load-op) (c cl-source-file))
     (map () #'load
-- 
1.7.3.4

