[fedora-java] libvirt-java bindings

David Walluck david at zarb.org
Thu Jul 3 09:05:52 UTC 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Daniel Veillard wrote:
| - use the $JAVA_HOME as the user provided environment variable to point to
|   the top of the JDK tree
| - in configure.in provide an option --with-java-home allowing to
override it
| - if still not defined try with /usr/lib/jvm/java

Sounds good so far. You may also want to try other values for JAVA_HOME.
I don't have an exhaustive list of these, but /usr/lib/jvm/java should
be fine for any Linux distro that has jpackage-utils, so I think that
should be sufficient.

| - then check that $JAVA_HOME/bin contains the binaries for
|   javah/javac/javah/javadoc/jar to be used when building the binaries
| - then look under $JAVA_HOME/include and $JAVA_HOME/include/$system for
|   the JNI includes

I think you want something like

CPPFLAGS="-I$JAVA_HOME/include -I$JAVA_HOME/include/linux".

But if it's not linux, I don't know how standard the existence of
$system is.

| - we should look for the %{java_home} macro

This is only good for the RPM build. If you depend on jpackage-utils you
may assume it is defined.

| - if found it should be passed as the --with-java-home value when running
|   configure

In the RPM-build case, you can pass explicitly the default (or desired)
Java home directory .

You have already laid out the three basic steps for configure above:

1.) Use --with-java-home if set.

2.) If this isn't set, then you would read $JAVA_HOME from the environment.

3.) If that isn't set then you would check some pre-defined list of
directories. At the very least /usr/lib/jvm/java.

| - keep
|   Requires: java [ >= 1.5 ]
|   Requires: jpackage-utils
|   and
|   BuildRequires: java-devel [ >= 1.5 ]
|   BuildRequires: jpackage-utils
|   as the Java RPM dependancies

Yes, since these are virtual provides specified by several vendors (GCJ,
IBM, BEA, Sun) as long as they follow the JPackage standard.

| - Indicates that when rebuilding manually, overriding %{java_home} on the
|   rpmbuild command line allows to pick a different JDK

The switch happens for the end-user of the RPM spec file simply by
redefining %java_home, e.g.

rpmbuild --define 'java_home /usr/lib/jvm/java-gcj'

or

JAVA_HOME=/usr/lib/jvm/java-gcj rpmbuild

| If yes can this be written directly somewhere in
|   http://fedoraproject.org/wiki/Packaging/Java#Specfile_Template
| in a "configure" section along ant/maven

it's hard to say how to standardize this process, since no one has
written the canonical set of autoconf macros for this. Some macros exist
in the autoconf macro archive, but they try to support many layouts (not
just the linux standard layout).

Sure, we can try to specify what a call to configure would look like and
have each author write his own code to do it. A better approach might be
to write a set of canonical m4 code that might be used to satisfy those
requirements.

Minimally all that is required is to read the value of $JAVA_HOME since
you can assume a monolithic layout for the rest of the binaries and
directories used for building.

- --
Sincerely,

David Walluck
<david at zarb.org>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iEYEARECAAYFAkhslm8ACgkQItObMyg2XCUmVgCgjfbVRjxcJbnCJuzD2swSFtDh
f+EAoIMKT8U9yvuw7H0Qu2oXDE7Wv42N
=2H0n
-----END PGP SIGNATURE-----




More information about the fedora-devel-java-list mailing list