[VM][UNIX][CVS] Latest updates / FFI / ephemerons
Bert Freudenberg
bert at isg.cs.uni-magdeburg.de
Wed Aug 13 07:56:14 UTC 2003
Alexander Lazarevic' wrote:
> Am Sonntag, 10. August 2003 17:48 schrieb Alexander Lazarevic':
>
>>The FFI X11 examples fail because of a missing library path. Setting
>>LD_LIBRARY_PATH to /usr/X11R6/lib make these work again for me.
>
>
> Setting LD_LIBRARY_PATH everytime is a little cumbersome. The following patch
> removes the manual path checking in tryLoading() and enables dlopen again to
> find the libraries by itself (4.1-4). It also changes the search order for
> modules/libraries.
>
> 1. current working directory
> 2. every path in the environment variable SQUEAK_PLUGIN_PATH (colon-separated
> list of directories)
> 3. VM_LIBDIR (set at compile time)
> 4.1 LD_LIBRARY_PATH
> 4.2 list of libraries cached in ld.so.cache
> 4.3 /usr/lib
> 4.4 /lib
>
> I don't know if this patch breaks things on other unices where the manual path
> checking might be necessary.
I sent a fix similar to this to Ian a while a go. Croquet was broken
because it could not find the OpenGL library. Didn't that make it into
the sources? Anyway, see my attachment, which preserves the stat() call.
-- Bert
-------------- next part --------------
*** platforms/unix/vm/sqUnixExternalPrims.c.351 Thu Jun 5 16:18:00 2003
--- platforms/unix/vm/sqUnixExternalPrims.c Thu Jun 5 16:21:23 2003
***************
*** 127,135 ****
char libName[NAME_MAX + 32]; /* headroom for prefix/suffix */
struct stat buf;
sprintf(libName, "%s%s%s%s", dirName, *prefix, moduleName, *suffix);
! if (stat(libName, &buf))
dprintf((stderr, "not found: %s\n", libName));
! else if (S_ISDIR(buf.st_mode))
dprintf((stderr, "ignoring directory: %s\n", libName));
else
{
--- 127,136 ----
char libName[NAME_MAX + 32]; /* headroom for prefix/suffix */
struct stat buf;
sprintf(libName, "%s%s%s%s", dirName, *prefix, moduleName, *suffix);
! /* only stat() if a dirName was given - we cannot search the default path */
! if (*dirName && stat(libName, &buf))
dprintf((stderr, "not found: %s\n", libName));
! else if (*dirName && S_ISDIR(buf.st_mode))
dprintf((stderr, "ignoring directory: %s\n", libName));
else
{
More information about the Squeak-dev
mailing list
|