Hello, On ketvirtadienis 29 Spalis 2009 11:25:33 Mathieu Malaterre wrote:
>CMakeCache.txt:JAVA_INCLUDE_PATH:PATH=/usr/lib/jvm/java-1.5.0-gcj-4.4/includ
>e
>CMakeCache.txt:JAVA_INCLUDE_PATH2:PATH=/usr/lib/jvm/java-6-openjdk/include
> I did ! But you decided my patch was not as good (*), so you decided
> to write yours. I am not going to fix your code.
Ok. If you had thought about this more, you would have realized that it would
not be "my code" you would have to fix. You patched library directories, but
that's includes which are wrong! In addition, I added a openjdk-6 directory to
the include search (to be on par with library directories) thinking I made a
favour for everyone, but here we go, it exposed another "problem".
> If you are not going to fix your code, please revert to official cmake
> 2.6.4/FindJNI.cmake. VTK on debian is using my patch(*) and is working
> ok so far.
First of all, this is a huge mess with all those JVMs and their directory
naming schemes around. You see this issue because gcj-4.4-jdk does not provide
/usr/lib/jvm/java-1.5.0-gcj-4.4/include/jni_md.h compat symlink to
/usr/lib/jvm/java-1.5.0-gcj-4.4/include/linux/jni_md.h (provided by java-gcj-
compat-dev for gcj 4.3) which openjdk-6 does. Since
${JAVA_AWT_INCLUDE_DIRECTORIES} is first searched for JAVA_INCLUDE_PATH2 too,
openjdk-6 stuff is found first. So it is a messy scheme of gcj or yet another
bug in FindJNI (depends how you look at it) to blame.
IMHO, the most logical fix would be:
diff --git a/Modules/FindJNI.cmake b/Modules/FindJNI.cmake
index 8c9523a..6c8ff85 100644
--- a/Modules/FindJNI.cmake
+++ b/Modules/FindJNI.cmake
@@ -192,7 +192,7 @@ FIND_PATH(JAVA_INCLUDE_PATH jni.h
)
FIND_PATH(JAVA_INCLUDE_PATH2 jni_md.h
- ${JAVA_AWT_INCLUDE_DIRECTORIES}
+ ${JAVA_INCLUDE_PATH}
${JAVA_INCLUDE_PATH}/win32
${JAVA_INCLUDE_PATH}/linux
${JAVA_INCLUDE_PATH}/freebsd
But I don't really know if it breaks on older JVMs or other platforms. In
addition, I don't really know why it was done the way it was done. Ah, that's
not my code that I'm fixing (rings the bell, Mathieu?).
P.S. Mathieu, typically finger pointing does not lead you anywhere in open
source. All help is appreciated if you want your problem solved faster.
--
Modestas Vainius <[email protected]>
signature.asc
Description: This is a digitally signed message part.

