[gambit-list] Gambit installer

Christian Jaeger christian at pflanze.mine.nu
Tue Sep 30 04:50:39 EDT 2008


Christian Jaeger wrote:
> What does it solve for you?
>   

My *guess* is that you want to make it possible to have several (binary) 
distribution packages of different versions of Gambit in 
FreeBSD/whatever, and create (binary) distribution packages depending on 
a particular one of them (like have a library foo-0.6 which works (i.e. 
is compiled) for Gambit 4.2.10 and a library foo-0.8 which works for 
Gambit 4.2.12; and you wouldn't want to depend on environment variables 
there but on fixed paths or postfixes. This kind of game is really 
usually being solved as you describe, by having a /usr/bin/python2.5 and 
a /usr/lib/python2.5/ alongside /usr/bin/python2.4 and 
/usr/lib/python2.4/, and then have a symlink /usr/bin/python -> python2.5 .

Note:

- with the current Gambit installation paths the same goal is still 
possible just as well (you'd refer to /usr/local/Gambit-C/v4.2.6/bin/gsc 
for example); I agree that it's not standard for binary distribution 
packages, though.

- choosing between Gambit versions by using an environment variable is 
having the aim in mind to try a program with several different Gambit's 
without having to change the program's source code or make files; i.e. 
it's something with developers in mind.

- so the art here is to keep the possibility to choose between Gambit 
versions by changing PATH and still be able to generate a FreeBSD / 
FHS[*] 'compatible' filesystem layout (and do this without using 
symlinks on Windows?).

[*] http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

(For me, the developer view is more important currently; also it's not 
clear yet how module systems might be coming into play here; so if in 
doubt, not changing might be the better option. In any case, be prepared 
to change again once module systems are here.)

>> from "~~", it seems one can only access either syntax-case or lib. 

I've checked the manual for "~~", and there are more uses to it than 
just syntax-case and lib.

«When the interpreter starts off it tries to execute a `(load
"~~/gambcext")' (for an explanation of how file names are interpreted
see Host environment). An error is not signaled when the file does not
exist. Interpreter extensions and patches that are meant to apply to
all users and all modes should go in that file.»

«The `-l' option is only meaningful when an incremental link file is
being generated (i.e. the `-link' option appears on the command line
and the `-flat' option is absent). The `-l' option specifies the link
file (without the `.c' extension) of the base library to use for the
incremental link. By default the link file of the Gambit runtime
library is used (i.e. `~~/lib/_gambc.c').»


You can get the current ~~ path with:

$ gsi -e '(display (path-expand "~~")) (newline)'
/usr/local/Gambit-C/v4.2.6/

This means that you can get the correct paths corresponding to the 
"gsi"/"gsc" binary being found in the current PATH. For example you 
could have an .emacs file which loads gambit.el directly for the current 
gsi/gsc from this location:

$ ls -l "$(gsi -e '(display (path-expand 
"~~/share/emacs/site-lisp/gambit.el"))')"
-rw-r--r-- 1 root staff 23948 2008-07-26 18:32 
/mnt/rootextend/usr/local/Gambit-C/v4.2.6/share/emacs/site-lisp/gambit.el

Or have a document viewer which shows the doc for the currently choosen 
gsi/gsc:

$ links "$(gsi -e '(display (path-expand "~~/doc/gambit-c.html"))')"

Or have makefiles which do the right things for the currently choosen 
gsi/gsc:

$ gcc ... -I"$(gsi -e '(display (path-expand "~~/include"))')" ...


It may be sensible to move ~~/syntax-case to ~~/lib/syntax-case, and 
since I'm not using syntax-case I won't object; for other people, maybe 
a symlink from the old to the new place would be helpful (but then 
again, what's the state of things on M$Windows regarding symlinks?).


(BTW, you can change what ~~ means by use of another environment variable:

«A path which starts with the characters `~~/' denotes a file in the
Gambit installation directory. This directory is normally
`/usr/local/Gambit-C/version' under UNIX and Mac OS X and
`C:/Gambit-C/version' under MSDOS and Microsoft Windows. To override
this binding under UNIX, Mac OS X, MSDOS and Microsoft Windows, use
the `-:=<dir>' runtime option or define the `GAMBCOPT' environment
variable.»

)

Christian.

(PS. for some reason your emails had a Reply-To header set to the gambit 
mailing list; so I guess you don't want to receive Cc's to your address.)




More information about the Gambit-list mailing list