60 # Now execute the test
61 $1
62
63 # If previous step claimed to have found a JDK, check it to see if it seems to be valid.
64 if test "x$BOOT_JDK_FOUND" = xmaybe; then
65 # Do we have a bin/java?
66 if test ! -x "$BOOT_JDK/bin/java"; then
67 AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring])
68 BOOT_JDK_FOUND=no
69 else
70 # Do we have a bin/javac?
71 if test ! -x "$BOOT_JDK/bin/javac"; then
72 AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring])
73 AC_MSG_NOTICE([(This might be an JRE instead of an JDK)])
74 BOOT_JDK_FOUND=no
75 else
76 # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
77 BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
78
79 # Extra M4 quote needed to protect [] in grep expression.
80 [FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"|(1\.[89]\.)'`]
81 if test "x$FOUND_CORRECT_VERSION" = x; then
82 AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring])
83 AC_MSG_NOTICE([(Your Boot JDK must be version 8, 9 or 10)])
84 BOOT_JDK_FOUND=no
85 else
86 # We're done! :-)
87 BOOT_JDK_FOUND=yes
88 BASIC_FIXUP_PATH(BOOT_JDK)
89 AC_MSG_CHECKING([for Boot JDK])
90 AC_MSG_RESULT([$BOOT_JDK])
91 AC_MSG_CHECKING([Boot JDK version])
92 BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
93 AC_MSG_RESULT([$BOOT_JDK_VERSION])
94 fi # end check jdk version
95 fi # end check javac
96 fi # end check java
97 fi # end check boot jdk found
98 fi
99 ])
100
101 # Test: Is bootjdk explicitly set by command line arguments?
102 AC_DEFUN([BOOTJDK_CHECK_ARGUMENTS],
103 [
285 # If we haven't found anything yet, we've truly lost. Give up.
286 if test "x$BOOT_JDK_FOUND" = xno; then
287 HELP_MSG_MISSING_DEPENDENCY([openjdk])
288 AC_MSG_NOTICE([Could not find a valid Boot JDK. $HELP_MSG])
289 AC_MSG_NOTICE([This might be fixed by explicitly setting --with-boot-jdk])
290 AC_MSG_ERROR([Cannot continue])
291 fi
292
293 AC_SUBST(BOOT_JDK)
294
295 # Setup tools from the Boot JDK.
296 BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVA, java)
297 BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAC, javac)
298 BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAH, javah)
299 BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAR, jar)
300 BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JARSIGNER, jarsigner)
301
302 # Finally, set some other options...
303
304 # When compiling code to be executed by the Boot JDK, force jdk8 compatibility.
305 BOOT_JDK_SOURCETARGET="-source 8 -target 8"
306 AC_SUBST(BOOT_JDK_SOURCETARGET)
307
308 AC_MSG_CHECKING([if Boot JDK supports modules])
309 if "$JAVA" --list-modules > /dev/null 2>&1; then
310 AC_MSG_RESULT([yes])
311 BOOT_JDK_MODULAR="true"
312 else
313 AC_MSG_RESULT([no])
314 BOOT_JDK_MODULAR="false"
315 fi
316 AC_SUBST(BOOT_JDK_MODULAR)
317
318 AC_SUBST(JAVAC_FLAGS)
319
320 # Check if the boot jdk is 32 or 64 bit
321 if "$JAVA" -version 2>&1 | $GREP -q "64-Bit"; then
322 BOOT_JDK_BITS="64"
323 else
324 BOOT_JDK_BITS="32"
325 fi
326 AC_MSG_CHECKING([if Boot JDK is 32 or 64 bits])
327 AC_MSG_RESULT([$BOOT_JDK_BITS])
328 ])
329
330 AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
331 [
332 ##############################################################################
333 #
334 # Specify jvm options for anything that is run with the Boot JDK.
335 # Not all JVM:s accept the same arguments on the command line.
336 #
|
60 # Now execute the test
61 $1
62
63 # If previous step claimed to have found a JDK, check it to see if it seems to be valid.
64 if test "x$BOOT_JDK_FOUND" = xmaybe; then
65 # Do we have a bin/java?
66 if test ! -x "$BOOT_JDK/bin/java"; then
67 AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain bin/java; ignoring])
68 BOOT_JDK_FOUND=no
69 else
70 # Do we have a bin/javac?
71 if test ! -x "$BOOT_JDK/bin/javac"; then
72 AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK did not contain bin/javac; ignoring])
73 AC_MSG_NOTICE([(This might be an JRE instead of an JDK)])
74 BOOT_JDK_FOUND=no
75 else
76 # Oh, this is looking good! We probably have found a proper JDK. Is it the correct version?
77 BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $HEAD -n 1`
78
79 # Extra M4 quote needed to protect [] in grep expression.
80 [FOUND_CORRECT_VERSION=`$ECHO $BOOT_JDK_VERSION | $EGREP '\"10([\.+-].*)?\"|\"9([\.+-].*)?\"'`]
81 if test "x$FOUND_CORRECT_VERSION" = x; then
82 AC_MSG_NOTICE([Potential Boot JDK found at $BOOT_JDK is incorrect JDK version ($BOOT_JDK_VERSION); ignoring])
83 AC_MSG_NOTICE([(Your Boot JDK must be version 9 or 10)])
84 BOOT_JDK_FOUND=no
85 else
86 # We're done! :-)
87 BOOT_JDK_FOUND=yes
88 BASIC_FIXUP_PATH(BOOT_JDK)
89 AC_MSG_CHECKING([for Boot JDK])
90 AC_MSG_RESULT([$BOOT_JDK])
91 AC_MSG_CHECKING([Boot JDK version])
92 BOOT_JDK_VERSION=`"$BOOT_JDK/bin/java" -version 2>&1 | $TR '\n\r' ' '`
93 AC_MSG_RESULT([$BOOT_JDK_VERSION])
94 fi # end check jdk version
95 fi # end check javac
96 fi # end check java
97 fi # end check boot jdk found
98 fi
99 ])
100
101 # Test: Is bootjdk explicitly set by command line arguments?
102 AC_DEFUN([BOOTJDK_CHECK_ARGUMENTS],
103 [
285 # If we haven't found anything yet, we've truly lost. Give up.
286 if test "x$BOOT_JDK_FOUND" = xno; then
287 HELP_MSG_MISSING_DEPENDENCY([openjdk])
288 AC_MSG_NOTICE([Could not find a valid Boot JDK. $HELP_MSG])
289 AC_MSG_NOTICE([This might be fixed by explicitly setting --with-boot-jdk])
290 AC_MSG_ERROR([Cannot continue])
291 fi
292
293 AC_SUBST(BOOT_JDK)
294
295 # Setup tools from the Boot JDK.
296 BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVA, java)
297 BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAC, javac)
298 BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAVAH, javah)
299 BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JAR, jar)
300 BOOTJDK_CHECK_TOOL_IN_BOOTJDK(JARSIGNER, jarsigner)
301
302 # Finally, set some other options...
303
304 # When compiling code to be executed by the Boot JDK, force jdk8 compatibility.
305 BOOT_JDK_SOURCETARGET="-source 9 -target 9"
306 AC_SUBST(BOOT_JDK_SOURCETARGET)
307
308 AC_SUBST(JAVAC_FLAGS)
309
310 # Check if the boot jdk is 32 or 64 bit
311 if "$JAVA" -version 2>&1 | $GREP -q "64-Bit"; then
312 BOOT_JDK_BITS="64"
313 else
314 BOOT_JDK_BITS="32"
315 fi
316 AC_MSG_CHECKING([if Boot JDK is 32 or 64 bits])
317 AC_MSG_RESULT([$BOOT_JDK_BITS])
318 ])
319
320 AC_DEFUN_ONCE([BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS],
321 [
322 ##############################################################################
323 #
324 # Specify jvm options for anything that is run with the Boot JDK.
325 # Not all JVM:s accept the same arguments on the command line.
326 #
|