From 079183eb6a16bbd41d01aaf2824e2ab8da3d6959 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 19 Oct 2015 17:24:34 -0600 Subject: [PATCH] fix cross-build for Windows to use `setup/winvers-change` Merge to v6.3 --- Makefile | 1 + racket/collects/setup/winvers-change.rkt | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 5c6d46272c..6feaba96e2 100644 --- a/Makefile +++ b/Makefile @@ -492,6 +492,7 @@ bundle-from-server: $(BUNDLE_RACO) pkg install $(REMOTE_INST_AUTO) $(PKG_SOURCE_MODE) $(REQUIRED_PKGS) $(BUNDLE_RACO) pkg install $(REMOTE_INST_AUTO) $(PKG_SOURCE_MODE) $(PKGS) $(RACKET) -l setup/unixstyle-install post-adjust "$(SOURCE_MODE)" "$(PKG_SOURCE_MODE)" racket bundle/racket + $(RACKET) -l setup/winvers-change bundle/racket UPLOAD_q = --readme "$(README)" --upload "$(UPLOAD)" --desc "$(DIST_DESC)" DIST_ARGS_q = $(UPLOAD_q) $(RELEASE_MODE) $(SOURCE_MODE) $(VERSIONLESS_MODE) $(MAC_PKG_MODE) \ diff --git a/racket/collects/setup/winvers-change.rkt b/racket/collects/setup/winvers-change.rkt index ab229abb05..c841f61bc7 100644 --- a/racket/collects/setup/winvers-change.rkt +++ b/racket/collects/setup/winvers-change.rkt @@ -9,6 +9,7 @@ ;; of the binary and restarting that copy for the actual change. #lang racket/base +(require setup/cross-system) (define verbose? #t) (define binary-extensions '("exe" "dll" "lib" "so" "def" "exp" #|"obj" "o"|#)) @@ -69,12 +70,13 @@ (close-input-port i) (close-output-port o))) -(let loop ([paths (if (zero? (vector-length (current-command-line-arguments))) - '(".") - (vector->list (current-command-line-arguments)))]) - (for ([path (in-list paths)]) - (cond [(file-exists? path) - (when (binary-file? path) (do-file path))] - [(directory-exists? path) - (parameterize ([current-directory path]) - (loop (map path->string (directory-list))))]))) +(when (eq? 'windows (cross-system-type)) + (let loop ([paths (if (zero? (vector-length (current-command-line-arguments))) + '(".") + (vector->list (current-command-line-arguments)))]) + (for ([path (in-list paths)]) + (cond [(file-exists? path) + (when (binary-file? path) (do-file path))] + [(directory-exists? path) + (parameterize ([current-directory path]) + (loop (map path->string (directory-list))))]))))