On Mon, 28 May 2007 02:05:24 +0200
pancake <[EMAIL PROTECTED]> wrote:

> Hi to everyone!
> 
> How can I set a new include path into the library loader of parrot?

There is a hook into init_library_paths in library.c on a C level. You
have to provide C code to append to the array.

On a PIR level I am not sure.

> A gcc-like '-I' flag would be desirable instead of the raw @INC like
> perl5 does.
> 
> Is the library path crosslanguage? How parrot handles these include
> paths for other languages than pasm/pir? I'm mixing concepts? How
> this is done/(going to be done) on parrot.

See [RFC] extension guessing on the ML. I am working on the design
for this right now.

> Why my parrot can't find the installed libraries on
> $prefix/lib/parrot/ ? library.c uses relative paths, does it means
> that parrot does not finds the libraries (on last instance) there?

If a path is relative in the path-list it will be prefixed with one of 
two possible values. The first is "prefix" which is set in config.pasm.
The environment variable PARROT_RUNTIME can override the iglobals[prefix].

> And more comments O:)
> 
> library.c:117 -- shouldn't this code must live inside a #if
> __Darwin__ clause? (refering to the comment)
> 
>     /* OS/X has .dylib and .bundle */ 
>     if (strcmp(PARROT_LOAD_EXT, PARROT_SHARE_EXT)) {
>         entry = const_string(interp, PARROT_SHARE_EXT);
>         VTABLE_push_string(interp, paths, entry);
>     }

I am re-factoring this. I want to get rid of it entirely and generate
this robotic C code from a configuration file of some sort.

> library.c:155 -- The XXX comment should not be there. This function
> only returns a boolean value. And it is fine for *NIX
> 
> library.c:260 -- set LOAD_EXT_CODE_LAST equal to 4.
>               - this change will drop a +1 on the following line
> and will make the for loop of library.c:321 more logical. (use <
> instead of <= comparisions)

there was a extension guessing part that was reverted while a more thorough
design is hashed out. In the extension guessing proposal there was a feature to
traverse the array in reverse order. That is why the array traversals are
[end] instead of [end + 1] as usual. The revert probably ripped out the 
comments that 
documented why this was.
 
>   --pancake

If you are really interested in this area please look at what I have been doing
so we do not collide. There are two patches in RT currently: one that hoists 
all of the
generic path handling routines into path.c/path.h , and one that cleans up 
Parrot_get_runtime_prefix.

Beyond that I have the RFC where a new design is hashed out and a prototype 
implementation.

Cheers,
Mike Mattie - [EMAIL PROTECTED]

Attachment: signature.asc
Description: PGP signature

Reply via email to