Pino Toscano
2016-Mar-07 16:25 UTC
[Libguestfs] [PATCH] build: fix reading of the java version
Update the check for the first line (the one containing the version) to match also the message with OpenJDK; switch to awk so it is easier to extract the version inside the double quotes. --- m4/guestfs_java.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/guestfs_java.m4 b/m4/guestfs_java.m4 index f9bec94..649e21f 100644 --- a/m4/guestfs_java.m4 +++ b/m4/guestfs_java.m4 @@ -84,7 +84,7 @@ if test "x$with_java" != "xno"; then else JAR="$JAVA/bin/jar" fi - java_version=`$JAVA_EXE -version 2>&1 | grep "java version"` + java_version=`$JAVA_EXE -version 2>&1 | $AWK -F '"' '/^(java|openjdk) version/ {print $2;}'` AC_MSG_RESULT(found $java_version in $JAVA) dnl Find jni.h. -- 2.5.0
Apparently Analagous Threads
- [PATCH 2/2] configure: output paths where java is searched in
- [PATCH] java: Don't try to set -source 1.5 in options.
- [PATCH 1/2] configure: visually split the blocks of checks
- [PATCH] java: support OpenJDK 10+
- [PATCH] configure: Move language binding detection to separate files.