Changeset 36530


Ignore:
Timestamp:
2022-08-29T13:17:21+12:00 (20 months ago)
Author:
davidb
Message:

Changed to a more careful way of determining whether javah (used in older JDKs) should be used or not. Need to do this in a way that doesn't accidentally pick up on an older system-wide installed JDK (that has a javah), given that we use JAVA_HOME to precisely determine which java/javac that should be used

Location:
main/trunk/greenstone2/common-src/indexers
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/indexers/mg/java/org/greenstone/mg/Makefile.in

    r35313 r36530  
    1717# 'javah' existed until JDK 1.7, transitional in JDK 1.8, then removed by JDK 1.9 (use 'javac -h' instead)
    1818# Makefile rules below test for 'javah' and use it if it found, otherwise runs with 'javac -h' version
    19 JAVAH = javah
     19#
     20# Since we're committed to JAVA_HOME being set, so jni.h header files can be found,
     21# then we can lean on JAVA_HOME here to more precisely check for the existence of javah
     22# within JAVA_HOME, and not accidentally pick up on another (older) JDK that is also
     23# installed on the system, and does come with a 'javah' but is unlikely to be able
     24# to cope with newer (e.g. JDK 11) version class files
     25JAVAH = $(JAVA_HOME)/bin/javah
    2026JAR = jar
    2127CFLAGS = @CFLAGS@ -ansi -DSILENT -DSHORT_SUFFIX
     
    5460#   "$(JAVAC)" -h "$(MGHOME)/jni" -classpath "$(JAVACLASSPATH)" MGPassesWrapper.java
    5561#   $(eval found = $(shell which javah 2>/dev/null | wc -l))
    56     $(eval found = $(shell command -v javah | wc -l))
     62    $(eval found = $(shell command -v $(JAVAH) | wc -l))
    5763    if test "$(found)" = "1" ; then \
    5864      "$(JAVAH)" -classpath "$(JAVACLASSPATH)" -d "$(MGHOME)/jni" org.greenstone.mg.MGWrapper ; \
  • main/trunk/greenstone2/common-src/indexers/mgpp/java/org/greenstone/mgpp/Makefile.in

    r35313 r36530  
    1717# 'javah' existed until JDK 1.7, transitional in JDK 1.8, then removed by JDK 1.9 (use 'javac -h' instead)
    1818# Makefile rules below test for 'javah' and use it if it found, otherwise runs with 'javac -h' version
    19 JAVAH = javah
     19#
     20# Since we're committed to JAVA_HOME being set, so jni.h header files can be found,
     21# then we can lean on JAVA_HOME here to more precisely check for the existence of javah
     22# within JAVA_HOME, and not accidentally pick up on another (older) JDK that is also
     23# installed on the system, and does come with a 'javah' but is unlikely to be able
     24# to cope with newer (e.g. JDK 11) version class files
     25JAVAH = $(JAVA_HOME)/bin/javah
    2026JAR = jar
    2127CFLAGS = @CFLAGS@ -ansi -DSILENT -DSHORT_SUFFIX
     
    5965#   "$(JAVAC)" -classpath "$(JAVACLASSPATH)" -h "$(MGPPHOME)/jni" MGPPRetrieveWrapper.java
    6066#   $(eval found = $(shell which javah 2>/dev/null | wc -l))
    61     $(eval found = $(shell command -v javah | wc -l))
     67    $(eval found = $(shell command -v $(JAVAH) | wc -l))
    6268    if test "$(found)" = "1" ; then \
    6369      "$(JAVAH)" -classpath "$(JAVACLASSPATH)" -d "$(MGPPHOME)/jni" org.greenstone.mgpp.MGPPPassesWrapper ; \
Note: See TracChangeset for help on using the changeset viewer.