How to pass additional options to boot jdk during configure, _JAVA_OPTIONS does not work

Ao Qi aoqi at loongson.cn
Thu Sep 20 07:26:54 UTC 2018


Hi,

Is there any options or methods that I can pass additional jdk options
to the boot jdk when I configure jdk/jdk? I found
--with-boot-jdk-jvmargs, but I think it is effective during building
the jdk, not configuring the jdk.

I used _JAVA_OPTIONS, but it failed to configure (fail to detect jdk
version). I made a patch:

$ hg diff
diff -r feb4c9e03aed make/autoconf/basics.m4
--- a/make/autoconf/basics.m4 Tue Sep 18 19:44:27 2018 -0700
+++ b/make/autoconf/basics.m4 Wed Sep 19 11:44:54 2018 +0800
@@ -168,7 +168,7 @@
 [
   $ECHO "Check if jvm arg is ok: $1" >&AS_MESSAGE_LOG_FD
   $ECHO "Command: $3 $1 -version" >&AS_MESSAGE_LOG_FD
-  OUTPUT=`$3 $1 -version 2>&1`
+  OUTPUT=`$3 $1 -version 2>&1 | $GREP -v "^Picked up _JAVA_OPTIONS:"`
   FOUND_WARN=`$ECHO "$OUTPUT" | $GREP -i warn`
   FOUND_VERSION=`$ECHO $OUTPUT | $GREP " version \""`
   if test "x$FOUND_VERSION" != x && test "x$FOUND_WARN" = x; then
diff -r feb4c9e03aed make/autoconf/boot-jdk.m4
--- a/make/autoconf/boot-jdk.m4 Tue Sep 18 19:44:27 2018 -0700
+++ b/make/autoconf/boot-jdk.m4 Wed Sep 19 11:44:54 2018 +0800
@@ -74,7 +74,7 @@
           BOOT_JDK_FOUND=no
         else
           # Oh, this is looking good! We probably have found a proper
JDK. Is it the correct version?
-          BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
+          BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 |
$GREP -v "^Picked up _JAVA_OPTIONS:" | $HEAD -n 1`

           # Extra M4 quote needed to protect [] in grep expression.
           [FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION \
@@ -90,7 +90,7 @@
             AC_MSG_CHECKING([for Boot JDK])
             AC_MSG_RESULT([$BOOT_JDK])
             AC_MSG_CHECKING([Boot JDK version])
-            BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 |
$TR '\n\r' '  '`
+            BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 |
$GREP -v "^Picked up _JAVA_OPTIONS:" | $TR '\n\r' '  '`
             AC_MSG_RESULT([$BOOT_JDK_VERSION])
           fi # end check jdk version
         fi # end check javac



This works for me. The _JAVA_OPTIONS is effective during configure. Is
there some other way to do that (without changing the code)? Or
otherwise is it possible to accept this patch?

Cheers,
Ao Qi



More information about the build-dev mailing list