[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Libtool API suggestion: LTDL_SHLIB_PRE and/or char* ltdl_map_shared_name

From: Dalibor Topic
Subject: Libtool API suggestion: LTDL_SHLIB_PRE and/or char* ltdl_map_shared_name(const char* name)
Date: Tue, 23 Aug 2005 20:20:42 +0200
User-agent: Debian Thunderbird 1.0.2 (X11/20050331)

Hi libtoolers,

I've just re-implemented a part of kaffe's native shared library loading
mechanism to use LTDL_SHLIB_EXT when possible with libtool in GNU
Classpath. That was fun, and actually seems to work fine now. So, I
figured I could maybe offload a larger part of that onto libtool:

The Java API spec includes a method that allows programs written in the
java programming language to map shared library names to
system-dependant full library names, and get that name back. So
'something' would be mapped to '' or 'cygsomething.dll',
depending on the environment.

Some larger free software applications written in the Java programming
language, like Eclipse 3.1, depend on correctly mapping the library
names to load their plugins, that in turn contain native shared
libraries. (That was the reason why Eclipse 3.1 had refused to start up
properly on Kaffe for a while, and thanks to Tom Tromey, I hunted down
the cause and fixed it.)

It would be nice if libtool provided a way to either map a short dynamic
library name to a full name (say, something -> or
offered an autoconfish way to get the platform-specifc shared library
prefix, like it does for the suffix.

I've seen that a similar problem occured for GNU readline on cygwin[1],
and they went for a platform-specific set of properties in the
makefiles. I guess it would be more efficient if libtool provided a
central API for that, rather than to see projects reinventing the wheel.

It also seems that ltdl.c uses the "lib" prefix specifically in one case
[2] , where it may or may not make sense to use a hypothetical

dalibor topic


[2] ltdl.c from HEAD:
    812               if (strncmp(p, "-l", 2) == 0)
    813                 {
    814                   size_t name_len = 3+ /* "lib" */ LT_STRLEN (p
+ 2);
    815                   name = MALLOC (char, 1+ name_len);
    816                   if (name)
    817                     sprintf (name, "lib%s", p+2);
    818                 }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]