diff options
author | Mats Wichmann <mats@linux.com> | 2021-11-05 07:30:46 -0600 |
---|---|---|
committer | Mats Wichmann <mats@linux.com> | 2021-11-05 07:35:48 -0600 |
commit | 1716ce554d4d072ba4fa0664f7a4e6aa53c83428 (patch) | |
tree | 1109c16e36561237a8cde1df4fe36ceebc79cf1a | |
parent | 027c15f002610eae38212fe282963553a86a66ef (diff) | |
download | scons-git-1716ce554d4d072ba4fa0664f7a4e6aa53c83428.tar.gz |
Add userguide update on javah as well
Also add more linux locations for Java headers (old saved patch)
Signed-off-by: Mats Wichmann <mats@linux.com>
-rwxr-xr-x | CHANGES.txt | 3 | ||||
-rw-r--r-- | SCons/Tool/JavaCommon.py | 7 | ||||
-rw-r--r-- | doc/user/java.xml | 35 |
3 files changed, 32 insertions, 13 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index b8946c486..77ac9d52e 100755 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -741,6 +741,9 @@ RELEASE 3.1.0 - Mon, 20 Jul 2019 16:59:23 -0700 From Lukas Schrangl: - Enable LaTeX scanner to find more than one include per line + From Sergey Torokhov: + - Recognize jdk on Gentoo systems. + From Mats Wichmann: - scons-time takes more care closing files and uses safer mkdtemp to avoid possible races on multi-job runs. diff --git a/SCons/Tool/JavaCommon.py b/SCons/Tool/JavaCommon.py index dac7d50e3..adec1d3a7 100644 --- a/SCons/Tool/JavaCommon.py +++ b/SCons/Tool/JavaCommon.py @@ -59,14 +59,17 @@ java_macos_version_include_dir_glob = '/System/Library/Frameworks/JavaVM.framewo java_linux_include_dirs_glob = [ '/usr/lib/jvm/default-java/include', - '/usr/lib/jvm/java-*/include' + '/usr/lib/jvm/java-*/include', + '/opt/oracle-jdk-bin-*/include', + '/opt/openjdk-bin-*/include', + '/usr/lib/openjdk-*/include', ] # Need to match path like below (from Centos 7) # /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-0.el7_5.x86_64/include/ java_linux_version_include_dirs_glob = [ '/usr/lib/jvm/java-*-sun-%s*/include', '/usr/lib/jvm/java-%s*-openjdk*/include', - '/usr/java/jdk%s*/include' + '/usr/java/jdk%s*/include', ] if java_parsing: diff --git a/doc/user/java.xml b/doc/user/java.xml index e3c55b126..8017159c1 100644 --- a/doc/user/java.xml +++ b/doc/user/java.xml @@ -270,7 +270,7 @@ Java('classes', 'src', JAVAVERSION='1.6') After building the class files, it's common to collect them into a Java archive (<filename>.jar</filename>) file, - which you do by calling the &b-link-Jar; Builder method. + which you do by calling the &b-link-Jar; Builder. If you want to just collect all of the class files within a subdirectory, you can just specify that subdirectory @@ -488,8 +488,8 @@ public class Example3 Although it's more convenient to use the list of class files returned by - the &b-Java; Builder - as the source of a call to the &b-JavaH; Builder, + the &b-link-Java; Builder + as the source of a call to the &b-link-JavaH; Builder, you <emphasis>can</emphasis> specify the list of class files by hand, if you prefer. @@ -502,11 +502,13 @@ public class Example3 <scons_example name="java_JAVACLASSDIR"> <file name="SConstruct" printme="1"> -Java(target = 'classes', source = 'src/pkg/sub') -class_file_list = ['classes/pkg/sub/Example1.class', - 'classes/pkg/sub/Example2.class', - 'classes/pkg/sub/Example3.class'] -JavaH(target = 'native', source = class_file_list, JAVACLASSDIR = 'classes') +Java(target='classes', source='src/pkg/sub') +class_file_list = [ + 'classes/pkg/sub/Example1.class', + 'classes/pkg/sub/Example2.class', + 'classes/pkg/sub/Example3.class', +] +JavaH(target='native', source=class_file_list, JAVACLASSDIR='classes') </file> <file name="src/pkg/sub/Example1.java"> package pkg.sub; @@ -560,8 +562,8 @@ public class Example3 <scons_example name="java_javah_file"> <file name="SConstruct" printme="1"> -classes = Java(target = 'classes', source = 'src/pkg/sub') -JavaH(target = File('native.h'), source = classes) +classes = Java(target='classes', source='src/pkg/sub') +JavaH(target=File('native.h'), source=classes) </file> <file name="src/pkg/sub/Example1.java"> package pkg.sub; @@ -595,7 +597,7 @@ public class Example3 <para> Because &SCons; assumes by default - that the target of the &b-JavaH; builder is a directory, + that the target of the &b-link-JavaH; builder is a directory, you need to use the &File; function to make sure that &SCons; doesn't create a directory named <filename>native.h</filename>. @@ -609,6 +611,17 @@ public class Example3 <scons_output_command>scons -Q</scons_output_command> </scons_output> + <para> + + Note that the the <command>javah</command> command was + removed from the JDK as of JDK 10, and the approved method + (available since JDK 8) is to use <command>javac</command> + to generate native headers at the same time as the Java source + code is compiled.. As such the &b-link-JavaH; builder + is of limited utility in later Java versions. + + </para> + </section> <section> |