From f138b6deaee08d8224e26b17f823a42cc7d2385c Mon Sep 17 00:00:00 2001
From: Francois-Rene Rideau <fare@tunes.org>
Date: Sat, 19 Nov 2016 21:02:11 -0500
Subject: [PATCH 1/2] Fix asdf-tools for Windows

---
 README.md            |  2 +-
 make-asdf.bat        | 12 ++++++------
 tools/asdf-tools.asd |  3 +--
 tools/asdf-tools.bat | 10 +++++-----
 tools/release.lisp   |  8 ++++++--
 5 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/README.md b/README.md
index cd014a0..8658869 100644
--- a/README.md
+++ b/README.md
@@ -109,7 +109,7 @@ as in for instance:
 
 Or you can make that your local default (assuming GNU make) using:
 
-    ln -s Makefile-lisp-scripting GNUmakefile
+    echo "include Makefile-lisp-scripting" > GNUmakefile
 
 These Lisp tools by default use Clozure Common Lisp (CCL) to build and run a binary
 `build/asdf-tools` that will orchestrate the tests.
diff --git a/make-asdf.bat b/make-asdf.bat
index 8c6d1cd..07661c1 100644
--- a/make-asdf.bat
+++ b/make-asdf.bat
@@ -8,7 +8,7 @@ set driver_lisp=uiop\package.lisp + uiop\common-lisp.lisp + uiop\utility.lisp +
 set defsystem_lisp=upgrade.lisp + cache.lisp + component.lisp + system.lisp + find-system.lisp + find-component.lisp + operation.lisp + action.lisp + lisp-action.lisp + plan.lisp + operate.lisp + parse-defsystem.lisp + bundle.lisp + concatenate-source.lisp + output-translations.lisp + source-registry.lisp + package-inferred-system.lisp + backward-interface.lisp + backward-internals.lisp + interface.lisp + user.lisp + footer.lisp
 
 %~d0
-cd %~p0
+cd "%~p0"
 
 if "%~1"=="" goto all
 if "%~1"=="all" goto all
@@ -19,8 +19,8 @@ if "%~1"=="noext" goto noext
 if "%~1"=="driver_files" goto driver_files
 if "%~1"=="defsystem_files" goto defsystem_files
 
-call %0 build_asdf_tools
-%here%\build\asdf-tools.exe env %*
+call "%0" build_asdf_tools
+"%here%\build\asdf-tools.exe" env %*
 goto end
 
 
@@ -40,9 +40,9 @@ goto end
 
 :build_asdf_tools
 :: Building a binary for asdf-tools
- if exists build\asdf-tools.exe goto end
- call %0 build_asdf
- %here%\tools\asdf-tools.bat build-asdf-tools
+ if exist build\asdf-tools.exe goto end
+ call "%0" build_asdf
+ "%here%\tools\asdf-tools.bat" build-asdf-tools
  goto end
 
 :clobber
diff --git a/tools/asdf-tools.asd b/tools/asdf-tools.asd
index 6f12341..212f988 100644
--- a/tools/asdf-tools.asd
+++ b/tools/asdf-tools.asd
@@ -8,8 +8,7 @@
                (:version "cl-scripting" "0.2")
                (:feature :sbcl (:require "sb-introspect")))
   :build-operation program-op
-  :build-pathname #.(format nil "../build/asdf-tools~@[.~A~]"
-                            (asdf/bundle:bundle-pathname-type :program))
+  :build-pathname "../build/asdf-tools"
   :entry-point "asdf-tools::entry-point"
   :components
   ((:file "package")
diff --git a/tools/asdf-tools.bat b/tools/asdf-tools.bat
index f79dd6d..fbff8f2 100644
--- a/tools/asdf-tools.bat
+++ b/tools/asdf-tools.bat
@@ -1,4 +1,4 @@
-@echo off
+::@echo off
 
 ::: By default. We use CCL, because SBCL doesn't have a good enough run-program on Windows.
 if "%LISP%" == "" goto ccl
@@ -9,22 +9,22 @@ if "%LISP%" == "sbcl" goto sbcl
 
 :ccl
 if "%CCL%" == "" set CCL=ccl
-%CCL% --no-init --load %~dp0asdf-tools -- %*
+"%CCL%" --no-init --load "%~dp0asdf-tools" -- %*
 goto end
 
 
 :sbcl
 ::: As of SBCL 1.2.13, SBCL's run-program fails to call CMD.EXE directly, so can't fully run asdf-tools
 if "%SBCL%" == "" set SBCL=sbcl
-%SBCL% --noinform --no-userinit --no-sysinit --script %~dp0asdf-tools %*
+"%SBCL%" --noinform --no-userinit --no-sysinit --script "%~dp0asdf-tools" %*
 goto end
 
 
 :allegro
 if "%ALLEGRO%" == "" set ALLEGRO=alisp.exe
 if "%~1" == "get_allegro_dir" goto get_allegro_dir
-call %0 get_allegro_dir %ALLEGRO% %ALLEGRO%.exe
-%ALLEGRODIR%buildi.exe -I %ALLEGRODIR%alisp.dxl -qq -e "(setf *load-verbose* nil)" -L %~dp0asdf-tools. -- %*
+call %0 get_allegro_dir "%ALLEGRO%" "%ALLEGRO%.exe"
+"%ALLEGRODIR%buildi.exe" -I "%ALLEGRODIR%alisp.dxl" -qq -e "(setf *load-verbose* nil)" -L "%~dp0asdf-tools." -- %*
 goto end
 :get_allegro_dir
 if not "%~dp$PATH:2" == "" ( set ALLEGRODIR=%~dp$PATH:2& goto end )
diff --git a/tools/release.lisp b/tools/release.lisp
index 2766158..bf0ad8b 100644
--- a/tools/release.lisp
+++ b/tools/release.lisp
@@ -14,8 +14,12 @@
 
 (defun system-source-files (system &key monolithic)
   (let ((system (find-system system)))
-    (enough-namestrings (system-source-directory system)
-                        (input-files 'concatenate-source-op system))))
+    (enough-namestrings
+     (system-source-directory system)
+     (input-files (if monolithic
+		      'monolithic-concatenate-source-op
+		      'concatenate-source-op)
+		  system))))
 
 
 ;;; Making release tarballs for asdf, asdf/defsystem, uiop.
-- 
2.8.3

