summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2018-04-29 16:48:11 +0200
committerSlávek Banko <[email protected]>2018-04-29 16:48:11 +0200
commit0e86934fc8d6ffab9867f67859c33ef33e83478f (patch)
tree5685f1d4849a4d380f0ff12732ca9d136f4a139c
parent04c35f89e0b556b38fa0ba19a8af6db426e59686 (diff)
downloadadmin-0e86934fc8d6ffab9867f67859c33ef33e83478f.tar.gz
admin-0e86934fc8d6ffab9867f67859c33ef33e83478f.zip
Add check if Java is >= 8
With Java >= 8 instead of javah, it is preferred to use javac with option -h. In later Java versions, javah is removed. Signed-off-by: Slávek Banko <[email protected]>
-rw-r--r--acinclude.m4.in23
1 files changed, 21 insertions, 2 deletions
diff --git a/acinclude.m4.in b/acinclude.m4.in
index d85b119..e4bdd59 100644
--- a/acinclude.m4.in
+++ b/acinclude.m4.in
@@ -5766,8 +5766,11 @@ if test "x$kde_java_bindir" != "xno"; then
if test ! -x "$kde_java_bindir/javac"; then
AC_MSG_ERROR([javac not found under $kde_java_bindir - it seems you passed a wrong --with-java.])
fi
- if test ! -x "$kde_java_bindir/javah"; then
- AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
+ kde_javac_h=`$kde_java_bindir/javac -h 2>&1 | grep "invalid flag"`
+ if test -n "$kde_javac_h"; then
+ if test ! -x "$kde_java_bindir/javah"; then
+ AC_MSG_ERROR([javah not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
+ fi
fi
if test ! -x "$kde_java_bindir/jar"; then
AC_MSG_ERROR([jar not found under $kde_java_bindir. javac was found though! Use --with-java or --without-java.])
@@ -5875,7 +5878,23 @@ else
AC_MSG_RESULT([none found])
fi
+AC_MSG_CHECKING([if Java is >= 8])
+JAVA8=false
+if test -x "$kde_java_bindir/javac"; then
+ kde_javac_h=`$kde_java_bindir/javac -h 2>&1 | grep "invalid flag"`
+ if test -z "$kde_javac_h"; then
+ JAVA8=true
+ JAVAH=
+ fi
+fi
+if $JAVA8; then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi
+
AC_SUBST(JAVAC)
+AC_SUBST(JAVA8)
AC_SUBST(JAVAH)
AC_SUBST(JAR)
AC_SUBST(JVMLIBS)