octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Success: core Java support in MXE build


From: John W. Eaton
Subject: Re: Success: core Java support in MXE build
Date: Tue, 24 Sep 2013 13:37:41 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

On 07/11/2013 12:15 PM, PhilipNienhuis wrote:

A few days ago I succeeded both with building Octave with built-in java
support on MinGW and cross-compiling it (MXE) on my Linux box.
Cross-compiling is as follows: (beware it's a bit of a kludge just meant as
a proof-of-concept)


1. Patch configure.ac to add "-Wl,--export-all-symbols" to the load flags in
the mingw section (bug# 39454). This is required for any mingw Octave build.
(There's some discussion whether this is the best fix - for including core
Java support it is OK but other MinGW packages may need another place for
this fix.)


2. Make sure the platform-dependent jni_md.h can be found.
## Kludge warning:
## I copied<Windows><jdk>/include/win32/ subdir + contents over to my
##   Linux<jdk>/include subdir.
## I also did a "touch jvm.dll" somewhere (actually in
##<Linux_JDK>/jre/lib/i386/client) to comfort configure that
##   complained it couldn't find jvm.dll.
##   (I think this is a bug in configure)
Add the following in<mxe-octave>/src/octave.mk in the configure section:
--with-java-includedir=</full/path/to/linux/jdk>    ## Omit include/ subdir
in this path!
--with-java-libdir=</full/path/to/some/place/with/dummy/jvm.dll>
(maybe on MingW/native build:)
--with-java-homedir=</full/path/to/jdk>      ## Not sure if this is needed


(3. If you want the latest dev version, build a "make all dist"
octave-<version>.tar.gz, copy it over to<mxe-octave>/pkg, do "openssl sha1
octave-<version>.tar.gz" and substitute the checksum in
<mxe-octave>/src/octave.mk)


4. Run ./mk-dist<options>
When cross-compiling on Linux Octave's configure will probably find the
javac and jar executables from the build platform.
When building on MinGW, JAVA_HOME should be set properly.


Things to improve:

A. Find out if we could just dld/copy the contents of<jdk>/include&
<jdk>/include/win32, or download them from theURLs Michael gave above, and
point --with-java-includedir=  to it.

Which header files do we actually need? What does Octave include directly? Is it just jni.h or are more files required? What (if any) other header files are included from those files?

B. Fix configure / configure.ac so that it doesn't try to find jvm.dll for
MinGW builds, so that the dummy jvm.dll can be avoided. I'll enter a bug
report for this.

To make it easier to find, it looks like the report is here: https://savannah.gnu.org/bugs/?func=detailitem&item_id=39465

So to have java support built-in with mxe-octave for a Windows Octave
binary, I conclude the following tools and files are needed:

- A Java JDK. Or more precise, javac and jar executables + their possible
implicit dependencies.

For cross compiling can we use the javac and jar executables for the build system to generate the files for the host system (i.e., run the Debian javac and jar programs to generate files for MinGW)?

- jni.h + win32/jni_md.h

I guess this answers my question above. Are these files distributed under terms that would allow us to include fallback copies in the Octave or mxe-octave sources if they aren't installed on the build system?

Thanks for working on this issue. Has there been any other progress? I'd like to try to fix Octave's configure.ac file and also revise the mxe-octave makefile and scripts so that things work properly and without a lot of things needing to be done manually.

jwe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]