On Sep 23, 2005, at 12:47 AM, Leopold Toetsch wrote:


On Sep 23, 2005, at 7:51, Ross McFarland wrote:


i was playing around with NCI stuff tonight and ran across a problem in loadlib. the following code does not work:

    .local pmc lib_gtk
    lib_gtk = loadlib "libgtk-x11-2.0"


The need for such libnames arises typically on debian and alikes, where not all -devel packages are installed. I see two possibilities here: 1) demand from user to either install the -devel pkg or symlink the shortname
2) Parrot stops trying to  ...


    ext_start = strrchr(*lib_name, '.');


... strip extensions.

as my original email mentioned i think all of this try everything possible permutation is hacky and not a good idea. i think the real solution is to require that loadlib only gets the stem of the library. we can then reliably put on the appropriate extension for the platform and go about the normal searching stuff. if we know we always get the prefix we can also safely and correctly do the win32. if you look at the doc for loadlib it talks about library names, not files with paths with and without extensions. all of the examples are name only as well.

i think that library name (without extension and with or without lib on the front) is the best route. the doc almost already says as much, and i can extend it to be more explicit. we could cleanly handle all of the cases then. i don't want to make the decision for everyone.

-rm

Reply via email to