diff options
author | Damjan Marion <damarion@cisco.com> | 2017-01-03 13:09:10 +0100 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2017-01-03 14:33:48 +0000 |
commit | 2fbd1ae1814834703a861ad4e4bb1996cc01e5b0 (patch) | |
tree | 1d0474364d8ef586c0937ffc4688f842f7877897 | |
parent | 5a68debd8173a487dbd67b3e574d962308c91bcc (diff) |
Improve Java 8 detection m4 script to deal with pre-set JAVA_HOME
Change-Id: I38685530634fd43d0a46ff43e5ef7d62b9ee4d9b
Signed-off-by: Damjan Marion <damarion@cisco.com>
-rw-r--r-- | src/m4/ax_vpp_find_jdk8.m4 | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/m4/ax_vpp_find_jdk8.m4 b/src/m4/ax_vpp_find_jdk8.m4 index 29459822fb7..382a6c80e8f 100644 --- a/src/m4/ax_vpp_find_jdk8.m4 +++ b/src/m4/ax_vpp_find_jdk8.m4 @@ -4,7 +4,21 @@ AC_DEFUN([AX_VPP_FIND_JDK8], [ while true do - test "${JAVA_HOME+set}" = set && break + if test "${JAVA_HOME+set}" = set ; then + AC_MSG_CHECKING([${JAVA_HOME} for Java 8 compiler]) + JAVAC=${JAVA_HOME}/bin/javac + JAVAH=${JAVA_HOME}/bin/javah + JAR=${JAVA_HOME}/bin/jar + JAVA_VERSION=$(${JAVA_HOME}/bin/javac -source 8 -version 2>&1) + if test 0 -eq "$?"; then + JAVA_VERSION=$(echo "${JAVA_VERSION}" | cut -d\ -f2) + AC_MSG_RESULT([ok]) + else + AC_MSG_RESULT([no]) + AC_MSG_ERROR([Java in ${JAVA_HOME} (path specified in JAVA_HOME) cannot compile Java 8 code]) + fi + break + fi for dir in $(find /usr/lib/jvm/* -maxdepth 0 -type d); do AC_MSG_CHECKING([${dir} for Java 8 compiler]) |