Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] Improve Library Path Handling

6 views
Skip to first unread message

Chromatic

unread,
Aug 14, 2006, 12:05:31 AM8/14/06
to parrot-...@perl.org
It turns out that, if you use a magic number right now, you can modify the
paths Parrot uses to load libraries. I found two problems doing so, which
the attached test and code patch addresses.

First, Parrot assumed that all include paths were relative. That's no good,
but it was easy to fix.

Second, Parrot assumed that all include paths had a trailing path specifier --
that is, that concatening the include file/path would work correctly. I
fixed that too.

The test part of the patch explores both issues.

There's one remaining nit that I didn't address, that the enum_lib_paths
constants in F<include/parrot/library.h> are not available via iglobals.pasm.
I could use PARROT_LIB_PATH_LIBRARY for this. I browsed the constant
generator, but didn't find an easy way to generate this information. For
now, there's a hard-coded magic number.

If there are no objections, I'm happy to apply this patch.

-- c

$ diffstat add_lib_paths.patch
src/library.c | 9 ++++++-
t/compilers/imcc/syn/file.t | 56
+++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 63 insertions(+), 2 deletions(-)

add_lib_paths.patch
0 new messages