From ac99c69f0cb661f7ef0ee5c1b0c837919c768412 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Thu, 20 Jan 2011 19:44:39 -0700 Subject: [PATCH] fix a `raco exe' problem with finding shared-library paths --- collects/compiler/embed-unit.rkt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/collects/compiler/embed-unit.rkt b/collects/compiler/embed-unit.rkt index fb327e833d..6d7121b59c 100644 --- a/collects/compiler/embed-unit.rkt +++ b/collects/compiler/embed-unit.rkt @@ -811,6 +811,16 @@ p2 path)))] [else path])) + + (define (path-extra-suffix p sfx) + ;; Library names may have a version number preceded + ;; by a ".", which looks like a suffix, so add the + ;; shared-library suffix using plain-old bytes append: + (let-values ([(base name dir?) (split-path p)]) + (let ([name (bytes->path (bytes-append (path->bytes name) sfx))]) + (if (path? base) + (build-path base name) + name)))) ;; Write a module bundle that can be loaded with 'load' (do not embed it ;; into an executable). The bundle is written to the current output port. @@ -946,8 +956,8 @@ (eq? 'so (car p))) (let ([fs (list (cadr p) - (path-replace-suffix (cadr p) - (system-type 'so-suffix)))]) + (path-extra-suffix (cadr p) + (system-type 'so-suffix)))]) (ormap (lambda (f) (ormap (lambda (p) (let ([p (build-path p f)])