On Wed, Jul 02, 2008 at 11:30:09AM +0100, Andrew Haley wrote:
Mary Ellen Foster wrote:
> 2008/7/1 David Walluck <david(a)zarb.org>:
>> Mary Ellen Foster wrote:
>> | I have one recent package that does this (specifies openjdk on F9+ and
>> | icedtea on F8) and one that doesn't (just wants java >= 1.5). The
>> | first package uses JNI and needs a Sun-like JVM to work (or at least
>> | it took more autotools hacking than I cared to try to make it work),
>> | and if I just put Requires: java it tended to grab gcj. I guess I
>> | could also put java > 1.5, but the issue isn't the 1.5-ness, it's
the
>> | Sun-style JNI classes.
>>
>> This is not an issue with the java-devel packages, but rather an issue
>> with either the upstream configure or an issue with the GCJ packaging.
>>
>> If it is lack of JNI support in GCJ, that is one thing. If it is simply
>> that the package is expecting a differnt layout that is another.
>
> I just did a bit of hacking, and it is possible to build the package
> against gcj instead of openjdk. There were two things to fix:
> - the "configure" script followed symlinks from javac to find the JNI
> include dir. Since the symlinks for gcj ground out at /usr/bin/ecj, it
> ended up looking for /usr/include/jni.h.
Hmm. This package assumes that the chain of symlinks ends at the installed
binary, which must be in the jdk dir.
/usr/bin/javac -->
/etc/alternatives/javac -->
/usr/lib/jvm/java-1.4.2-gcj/bin/javac -->
/usr/bin/ecj
I changed libvirt-java configure.in to walk the chain of symlinks starting
from javah/javac to find the JDK location and its includes.
That seems to work pretty well in practice, and with that in place and the
-source 1.5 cleanup for ecj the package build and generates rpms without
problems on a variety of platforms:
RHEL-4: works with IBM 1.5.0
RHEL-5: works with IBM/SUN/BEA 1.5.0
fails with gcj because it's 1.4 and the bindings use enums
Fedora8: works with IcedTea-1.7 and java-1.5.0-gcj-devel
Fedora9: works with OpenJDK-1.6.0 and java-1.5.0-gcj-devel
thanks for the feedback !
Daniel
--
Red Hat Virtualization group
http://redhat.com/virtualization/
Daniel Veillard | virtualization library
http://libvirt.org/
veillard(a)redhat.com | libxml GNOME XML XSLT toolkit
http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine
http://rpmfind.net/