[plt-scheme] cstartup.inc

From: Ben Cornett (acornet at emory.edu)
Date: Thu Apr 3 12:35:24 EST 2003

Hi,

I'm working on an ebuild for Gentoo linux and I'm playing around with
the idea of installing the collects to
/usr/share/plt/<PLT_VERSION>/collects, similar to the way one does for
Guile.  What I'd like to do is change the default list of locations that
mzscheme checks when its trying to find its collects directory (without
having to set PLTCOLLECTS).  I'm not sure, but it looks like this is
initialized in plt/src/mzscheme/src/startup.ss as follows:


(define (find-library-collection-paths)
  (path-list-string->path-list
   (or (getenv "PLTCOLLECTS") "")
   (or (ormap
        (lambda (f) (let ([p (f)]) (and p (directory-exists? p) (list p))))
        (list
         (lambda () (let ((v (getenv "PLTHOME")))
                      (and v (build-path v "collects"))))
         (lambda () (find-executable-path (find-system-path 'exec-file) "collects"))
         ;; When binary is in bin/ subdir:
         (lambda () (find-executable-path (find-system-path 'exec-file)
                                          (build-path 'up "collects")))
         ;; When binary is in .bin/<platform> subdir:
         (lambda () (find-executable-path (find-system-path 'exec-file)
                                          (build-path 'up 'up "collects")))
         ;; When binary is in bin/<appname>.app/Contents/Macos subdir:
         (lambda () (find-executable-path (find-system-path 'exec-file)
                                          (build-path 'up 'up 'up "collects")))))
       null)))

which I thought I could change to something like

(define (find-library-collection-paths)
  (path-list-string->path-list
   (or (getenv "PLTCOLLECTS") "")
   (list "/usr/share/<PLT_VERSION>/collects")))

First I tried simply making this change and recompiling, but that didn't
work --- then I figured out that I needed to regenerate `cstartup.inc'
from `startup.ss'.  I tried doing so using `sstoinc.ss' from the same
directory, but the resulting mzscheme binary has problems:


ben $ mzscheme
Welcome to MzScheme version 203, Copyright (c) 1995-2002 PLT
STRING: read (compiled): ill-formed code (bad count: 8544 != 8545,
started at 12)
Segmentation fault


So I guess I have two questions: (1) Am I modifying the right code
(find-library-collection-paths) and (2) what do I need to do to get the
modifications into the mzscheme binary ?

Thanks.

Best Regards,

Ben




Posted on the users mailing list.