MantisBT - CMake
View Issue Details
0009611CMakeModulespublic2009-09-28 15:222010-11-09 22:57
Modestas Vainius 
Mathieu Malaterre 
normalminoralways
closedfixed 
CMake-2-8 
CMake 2.8.3CMake 2.8.3 
0009611: Arch independent FindJNI.cmake on Linux (supports Sun Java, OpenJDK, Kaffe and GCJ paths)
This bug is an attempt to solve the same problem as in Bug 0009476 but in an arch-independent way. Rather than hardcoding numerous arches in the search path, the libarch is determined automatically. The JAVA_APPEND_LIBRARY_DIRECTORIES macro is mostly based on the OpenJDK code for Linux with additional subdirectories for kaffe. GCJ does not use libarch subdir at all. In addition, the patch adds /usr/lib/jvm/default-java/ to the search path which is a Debian specific symlink for default JVM. The patch is against current CMake CVS HEAD (2.8).
Feel free to make necessary adjustments to coding style etc. or implement it in a cleaner way (though I couldn't think of one as {libarch} might expand to multiple subdirs).
No tags attached.
related to 0009777closed Mathieu Malaterre FindJNI update not found in FindJava / CMakeDetermineJavaCompiler 
diff FindJNI.cmake-arch-indep.diff (4,726) 2009-09-28 15:22
https://public.kitware.com/Bug/file/2495/*
diff FindJNI.cmake-includes-openjdk.diff (1,679) 2009-09-30 14:02
https://public.kitware.com/Bug/file/2502/*
Issue History
2009-09-28 15:22Modestas VainiusNew Issue
2009-09-28 15:22Modestas VainiusFile Added: FindJNI.cmake-arch-indep.diff
2009-09-30 09:59Bill HoffmanNote Added: 0017841
2009-09-30 09:59Bill HoffmanStatusnew => assigned
2009-09-30 09:59Bill HoffmanAssigned To => Bill Hoffman
2009-09-30 09:59Bill HoffmanNote Added: 0017842
2009-09-30 14:01Modestas VainiusNote Added: 0017850
2009-09-30 14:02Modestas VainiusFile Added: FindJNI.cmake-includes-openjdk.diff
2009-09-30 14:15Bill HoffmanNote Added: 0017851
2009-09-30 14:15Bill HoffmanStatusassigned => closed
2009-09-30 14:15Bill HoffmanResolutionopen => fixed
2009-10-26 05:01Mathieu MalaterreRelationship addedrelated to 0009777
2010-06-22 18:06Modestas VainiusNote Added: 0021140
2010-06-22 18:06Modestas VainiusStatusclosed => feedback
2010-06-22 18:06Modestas VainiusResolutionfixed => reopened
2010-06-22 22:13Mathieu MalaterreNote Added: 0021142
2010-07-29 11:36Brad KingStatusfeedback => assigned
2010-07-29 11:36Brad KingAssigned ToBill Hoffman => Mathieu Malaterre
2010-07-30 04:28Mathieu MalaterreNote Added: 0021570
2010-08-28 10:19Kovarththanan RajaratnamCategoryCMake => Modules
2010-09-09 23:53David ColeFixed in Version => CMake 2.8.3
2010-09-09 23:53David ColeTarget Version => CMake 2.8.3
2010-09-09 23:53David ColeNote Added: 0022174
2010-09-09 23:53David ColeStatusassigned => resolved
2010-09-09 23:53David ColeResolutionreopened => fixed
2010-11-09 22:57Philip LowmanStatusresolved => closed

Notes
(0017841)
Bill Hoffman   
2009-09-30 09:59   
cvs commit -m "Fix for bug 0009611 do not hard code archs for search paths of java, look at the machine type." FindJNI.cmake
Committer: Bill Hoffman <bill.hoffman@kitware.com>
/cvsroot/CMake/CMake/Modules/FindJNI.cmake,v <-- FindJNI.cmake
new revision: 1.43; previous revision: 1.42

Let me know if this works for you folks and I will close the bug. Thanks.
(0017842)
Bill Hoffman   
2009-09-30 09:59   
Either of you want to be the maintainer for this module?
(0017850)
Modestas Vainius   
2009-09-30 14:01   
I have no particular interest in Java. OpenJDK is available for many architectures on Debian and I had to fix FindJNI.cmake to support them. And I typically try to make fixes as portable as possible.

What is more, I attach another patch which adds a few paths to include search and really adds OpenJDK 6 paths this time. Once you commit it, feel free to close the bug. I'll reopen if a problem on a "weird" arch arises.
(0017851)
Bill Hoffman   
2009-09-30 14:15   
cvs commit -m "Fix for bug 0009611, some more paths for OpenJDK." FindJNI.cmake
Committer: Bill Hoffman <bill.hoffman@kitware.com>
/cvsroot/CMake/CMake/Modules/FindJNI.cmake,v <-- FindJNI.cmake
new revision: 1.44; previous revision: 1.43
(0021140)
Modestas Vainius   
2010-06-22 18:06   
I reopen the issue because apparently my previous patch was not complete. Here I link [1] another attempt which has finally worked on all debian architectures after many trail & error cases. The patch applies cleanly against 2.8.2-rc3. It has been in debian in its current state for a month without any reported regressions.

[1] http://git.debian.org/?p=collab-maint/cmake.git;a=blob;f=debian/patches/FindJNI_fix_libarch_determination.diff [^]
(0021142)
Mathieu Malaterre   
2010-06-22 22:13   
I volonteer to merge the change in cmake in case Modestas is not a cmake developer. The proposed changes works nicely in GDCM.
(0021570)
Mathieu Malaterre   
2010-07-30 04:28   
Fixed in next:

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=963921f2a86a6cfa78c86dc7127ca117f540f199 [^]
(0022174)
David Cole   
2010-09-09 23:53   
also merged into master... expect fix in 2.8.3