You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@harmony.apache.org by Mark Hindess <ma...@googlemail.com> on 2007/01/25 16:33:15 UTC
Re: [classlib] libXmu-dev and libxtst-dev
On 25 January 2007 at 10:12, "Geir Magnusson Jr." <ge...@pobox.com> wrote:
>
> I recently started working again in ubuntu5 in parallels on the mac
> for real (tired of carrying the ubuntu laptop around too...), and I
> noticed that to get awt tests to run, I needed to install both libxmu-
> dev and libxtst-dev, even though the non-dev versions were around.
>
> Why do we need the -dev versions of these?
>
> And is this documented? I looked at the getting started docs and
> other things, and couldn't find anything.
The awt code attempts to load the unversioned, libXmu.so, rather than
the versioned, libXmu.so.6 (for X11R6). Debian-based distributions
don't include these unversioned files in their non-dev packages.
I think we decided that we should attempt to load the known-good
versioned .so files first and if that fails try to load the unversioned
.so.
Regards,
Mark.
Re: [classlib] libXmu-dev and libxtst-dev
Posted by "Geir Magnusson Jr." <ge...@pobox.com>.
thx
On Jan 26, 2007, at 5:15 PM, Tim Ellison wrote:
> Geir Magnusson Jr. wrote:
>> On Jan 25, 2007, at 10:33 AM, Mark Hindess wrote:
>>> The awt code attempts to load the unversioned, libXmu.so, rather
>>> than
>>> the versioned, libXmu.so.6 (for X11R6). Debian-based distributions
>>> don't include these unversioned files in their non-dev packages.
>>>
>>> I think we decided that we should attempt to load the known-good
>>> versioned .so files first and if that fails try to load the
>>> unversioned
>>> .so.
>>
>> Meaning "we have a plan, but not implemented"? If so, can you
>> point me
>> where to fix this?
>
> Take a look in .../modules/awt/src/main/native/x11wrapper/unix/
>
>
> For this particular case the file
> org_apache_harmony_awt_nativebridge_linux_X11.cpp
> has got a function
> Java_org_apache_harmony_awt_nativebridge_linux_X11_init(...)
> that uses the LOADLIB macro.
>
> Depending upon which 'known-good' versions you want to try loading the
> (untested) fix would be something like this in numerous places that
> load
> the libraries:
>
> Index: modules/awt/src/main/native/x11wrapper/unix/nativelib_common.h
> ===================================================================
> --- modules/awt/src/main/native/x11wrapper/unix/nativelib_common.h
> (revision 499041)
> +++ modules/awt/src/main/native/x11wrapper/unix/nativelib_common.h
> (working copy)
> @@ -30,6 +30,7 @@
>
>
> #define LOAD_LIB(res, name) res = dlopen(mkstr(lib##name.so),
> RTLD_LAZY)
> +#define LOAD_LIB(res, name, ver) res = dlopen(mkstr
> (lib##name.so##ver),
> RTLD_LAZY)
>
> #define FindFunction(lib, name) (void *)dlsym(lib, name)
>
> Index:
> modules/awt/src/main/native/x11wrapper/unix/
> org_apache_harmony_awt_nativebridge_linux_X11.cpp
> ===================================================================
> ---
> modules/awt/src/main/native/x11wrapper/unix/
> org_apache_harmony_awt_nativebridge_linux_X11.cpp
> (revision 499041)
> +++
> modules/awt/src/main/native/x11wrapper/unix/
> org_apache_harmony_awt_nativebridge_linux_X11.cpp
> (working copy)
> @@ -28,8 +28,11 @@
> static libHandler libXmu;
> static libHandler libXtst;
> JNIEXPORT void JNICALL
> Java_org_apache_harmony_awt_nativebridge_linux_X11_init (JNIEnv * env,
> jclass cls) {
> - LOAD_LIB(libX11, X11);
> + LOAD_LIB(libX11, X11, 6);
> if (libX11 == NULL) {
> + LOAD_LIB(libX11, X11);
> + }
> + if (libX11 == NULL) {
> throwNewExceptionByName(env, LINK_EXCEPTION, "Cannot load
> libX11.so library");
> return;
> }
>
Re: [classlib] libXmu-dev and libxtst-dev
Posted by Tim Ellison <t....@gmail.com>.
Mark Hindess wrote:
> And the reason nothing has been done is that the above .cpp file says:
>
> /* This file is based on X11 headers and was originally autogenerated by
> * nativebridge tool. It has since been modified by hand. */
>
> I think someone was trying to find out if the generator could be
> released so we could fix within the project??
I have tweaked this file already, and was the one that changed the
comment to say it had been modified by hand. While it would be great to
have the tool in the project, I don't think we should hold things up on
the hope it is contributed.
The changes are localized to the same area I modified last time. I'll
put them in and see if it helps people.
Right now it will just check for X11 version 6, or the development
(unversioned) libraries.
Oleg: should the AWT code also work with versions 4, 5 and 7 ... ?
Regards,
Tim
Re: [classlib] libXmu-dev and libxtst-dev
Posted by Mark Hindess <ma...@googlemail.com>.
On 26 January 2007 at 22:15, Tim Ellison <t....@gmail.com> wrote:
> Geir Magnusson Jr. wrote:
> > On Jan 25, 2007, at 10:33 AM, Mark Hindess wrote:
> >> The awt code attempts to load the unversioned, libXmu.so, rather than
> >> the versioned, libXmu.so.6 (for X11R6). Debian-based distributions
> >> don't include these unversioned files in their non-dev packages.
> >>
> >> I think we decided that we should attempt to load the known-good
> >> versioned .so files first and if that fails try to load the unversioned
> >> .so.
> >
> > Meaning "we have a plan, but not implemented"? If so, can you point me
> > where to fix this?
>
> Take a look in .../modules/awt/src/main/native/x11wrapper/unix/
>
>
> For this particular case the file
> org_apache_harmony_awt_nativebridge_linux_X11.cpp
> has got a function
> Java_org_apache_harmony_awt_nativebridge_linux_X11_init(...)
> that uses the LOADLIB macro.
>
> Depending upon which 'known-good' versions you want to try loading the
> (untested) fix would be something like this in numerous places that load
> the libraries:
>
> Index: modules/awt/src/main/native/x11wrapper/unix/nativelib_common.h
> ===================================================================
> --- modules/awt/src/main/native/x11wrapper/unix/nativelib_common.h
> (revision 499041)
> +++ modules/awt/src/main/native/x11wrapper/unix/nativelib_common.h
> (working copy)
> @@ -30,6 +30,7 @@
>
>
> #define LOAD_LIB(res, name) res = dlopen(mkstr(lib##name.so), RTLD_LAZY)
> +#define LOAD_LIB(res, name, ver) res = dlopen(mkstr(lib##name.so##ver),
> RTLD_LAZY)
>
> #define FindFunction(lib, name) (void *)dlsym(lib, name)
>
> Index:
> modules/awt/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebrid
> ge_linux_X11.cpp
> ===================================================================
> ---
> modules/awt/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebrid
> ge_linux_X11.cpp
> (revision 499041)
> +++
> modules/awt/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebrid
> ge_linux_X11.cpp
> (working copy)
> @@ -28,8 +28,11 @@
> static libHandler libXmu;
> static libHandler libXtst;
> JNIEXPORT void JNICALL
> Java_org_apache_harmony_awt_nativebridge_linux_X11_init (JNIEnv * env,
> jclass cls) {
> - LOAD_LIB(libX11, X11);
> + LOAD_LIB(libX11, X11, 6);
> if (libX11 == NULL) {
> + LOAD_LIB(libX11, X11);
> + }
> + if (libX11 == NULL) {
> throwNewExceptionByName(env, LINK_EXCEPTION, "Cannot load
> libX11.so library");
> return;
> }
And the reason nothing has been done is that the above .cpp file says:
/* This file is based on X11 headers and was originally autogenerated by
* nativebridge tool. It has since been modified by hand. */
I think someone was trying to find out if the generator could be
released so we could fix within the project??
Regards,
-Mark
Re: [classlib] libXmu-dev and libxtst-dev
Posted by Tim Ellison <t....@gmail.com>.
Geir Magnusson Jr. wrote:
> On Jan 25, 2007, at 10:33 AM, Mark Hindess wrote:
>> The awt code attempts to load the unversioned, libXmu.so, rather than
>> the versioned, libXmu.so.6 (for X11R6). Debian-based distributions
>> don't include these unversioned files in their non-dev packages.
>>
>> I think we decided that we should attempt to load the known-good
>> versioned .so files first and if that fails try to load the unversioned
>> .so.
>
> Meaning "we have a plan, but not implemented"? If so, can you point me
> where to fix this?
Take a look in .../modules/awt/src/main/native/x11wrapper/unix/
For this particular case the file
org_apache_harmony_awt_nativebridge_linux_X11.cpp
has got a function
Java_org_apache_harmony_awt_nativebridge_linux_X11_init(...)
that uses the LOADLIB macro.
Depending upon which 'known-good' versions you want to try loading the
(untested) fix would be something like this in numerous places that load
the libraries:
Index: modules/awt/src/main/native/x11wrapper/unix/nativelib_common.h
===================================================================
--- modules/awt/src/main/native/x11wrapper/unix/nativelib_common.h
(revision 499041)
+++ modules/awt/src/main/native/x11wrapper/unix/nativelib_common.h
(working copy)
@@ -30,6 +30,7 @@
#define LOAD_LIB(res, name) res = dlopen(mkstr(lib##name.so), RTLD_LAZY)
+#define LOAD_LIB(res, name, ver) res = dlopen(mkstr(lib##name.so##ver),
RTLD_LAZY)
#define FindFunction(lib, name) (void *)dlsym(lib, name)
Index:
modules/awt/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebridge_linux_X11.cpp
===================================================================
---
modules/awt/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebridge_linux_X11.cpp
(revision 499041)
+++
modules/awt/src/main/native/x11wrapper/unix/org_apache_harmony_awt_nativebridge_linux_X11.cpp
(working copy)
@@ -28,8 +28,11 @@
static libHandler libXmu;
static libHandler libXtst;
JNIEXPORT void JNICALL
Java_org_apache_harmony_awt_nativebridge_linux_X11_init (JNIEnv * env,
jclass cls) {
- LOAD_LIB(libX11, X11);
+ LOAD_LIB(libX11, X11, 6);
if (libX11 == NULL) {
+ LOAD_LIB(libX11, X11);
+ }
+ if (libX11 == NULL) {
throwNewExceptionByName(env, LINK_EXCEPTION, "Cannot load
libX11.so library");
return;
}
Re: [classlib] libXmu-dev and libxtst-dev
Posted by "Geir Magnusson Jr." <ge...@pobox.com>.
On Jan 25, 2007, at 10:33 AM, Mark Hindess wrote:
>
> On 25 January 2007 at 10:12, "Geir Magnusson Jr." <ge...@pobox.com>
> wrote:
>>
>> I recently started working again in ubuntu5 in parallels on the mac
>> for real (tired of carrying the ubuntu laptop around too...), and I
>> noticed that to get awt tests to run, I needed to install both
>> libxmu-
>> dev and libxtst-dev, even though the non-dev versions were around.
>>
>> Why do we need the -dev versions of these?
>>
>> And is this documented? I looked at the getting started docs and
>> other things, and couldn't find anything.
>
> The awt code attempts to load the unversioned, libXmu.so, rather than
> the versioned, libXmu.so.6 (for X11R6). Debian-based distributions
> don't include these unversioned files in their non-dev packages.
>
> I think we decided that we should attempt to load the known-good
> versioned .so files first and if that fails try to load the
> unversioned
> .so.
Meaning "we have a plan, but not implemented"? If so, can you point
me where to fix this?
geir
>
> Regards,
> Mark.
>
>