[cello-devel] Logical pathnames. Workaround suggestion.

Frank Goenninger frank_goenninger at t-online.de
Wed Mar 10 20:52:03 UTC 2004


On Wed, 2004-03-10 at 21:21, Thomas F. Burdick wrote:
> Kenny Tilton writes:
>  > 
>  > 
>  > Frank Goenninger wrote:
>  > 
>  > >Hi all:
>  > >
>  > >I wanted to let you know that this is the first time I really have a 
>  > >running CELLO (based on PortaCello 2.0) with animation and all...
>  > >
>  > Fantastic. Thanks so much for pulling this off. Did the light-panel demo 
>  > work? That does not challenge the system further (famous last words) but 
>  > it is fun. I plan to show it off at the Lisp NYC meeting tonight.
>  > 
>  > Did you run into any nasty technical problems? I am sure the hard-coded 
>  > paths and fonts continue to be an aggravation. Thomas mentioned he had 
>  > moved that stuff into a config file, which would certainly help by 
>  > giving folks one place to go to make changes. A nice enhancement on top 
>  > of that would be to tackle the insane world of logical pathnames so that 
>  > the config file has a bare minimum of entries. But logicals would be 
>  > gravy and maybe not worth the pain and suffering.
> 
> Nope, logical pathnames won't work.  Dan Barlow has a nice rant on the
> subject here:
> 
>   http://ww.telent.net/diary/2002/8/#26.82823
> 
> To summarize:
> 
>   (translate-logical-pathname #p"lib:libGL.dynlib")
>     => #p"/usr/X11R6/lib/libgl.dynlyb"
> 

Hehe. One of the weaknesses of ANSI CL. So, yeah, I chose to implement
a few little functions that allow for setting the "home directory" of
a library location (sth like "/opt/opengl/freeglut/") and for setting
the library name ("GLUT_SHLIB", sth like "libfreeglut.so" for Linux).

Then the helper function for lib handling goes along a simple path:

Is ???_SHLIB an absolute path ? (is the first char a "/")

YES: Ok. So load just using this path.

NO: Is the environment variable ???_HOME set ? 

    YES: Ok. So take it and add "lib/" at the end.
         Now take that ???_SHLIB value and add it also to the 
         end of wha you just got. This is the thing to load then.

    NO:  OK. So let's see if the special var ???-home-dir is set.
         
         YES: Oh, ok. So use it like the ???_HOME var is set and do
              the rest as described under YES.

         NO:  Hm, bad. Now this is an error. And we shout it out.

Simple. But good enough? Don't know. Works simple for me here, on Linux.
And what I see from the paths in Kenny's Win32 code this should be ok 
there, too.

Any comments? Thx.

Regards,
   Frank

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <https://mailman.common-lisp.net/pipermail/cello-devel/attachments/20040310/021a1a01/attachment.sig>


More information about the cello-devel mailing list