summaryrefslogtreecommitdiffstats
path: root/extras/japi/m4/ax_vpp_find_jdk8.m4
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-07-30 16:10:14 +0200
committerDave Barach <openvpp@barachs.net>2018-08-01 20:28:53 +0000
commitcc4a5e8089967f0c266e9c5ed319c38c111004cd (patch)
treebc290e03e12a0a02c3fc274740c96eef9e1707c6 /extras/japi/m4/ax_vpp_find_jdk8.m4
parenta14c16674023bd6672ca49e3551c707702711050 (diff)
Move java api to extras/
Change-Id: Ibd5cbbdfb22a235442cddaebc9eae9a3c4e35ec9 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'extras/japi/m4/ax_vpp_find_jdk8.m4')
-rw-r--r--extras/japi/m4/ax_vpp_find_jdk8.m443
1 files changed, 43 insertions, 0 deletions
diff --git a/extras/japi/m4/ax_vpp_find_jdk8.m4 b/extras/japi/m4/ax_vpp_find_jdk8.m4
new file mode 100644
index 00000000000..94b785038f7
--- /dev/null
+++ b/extras/japi/m4/ax_vpp_find_jdk8.m4
@@ -0,0 +1,43 @@
+
+
+AC_DEFUN([AX_VPP_FIND_JDK8],
+[
+while true
+do
+ 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])
+ JAVA_VERSION=$(${dir}/bin/javac -source 8 -version 2>&1)
+ if test 0 -eq "$?"; then
+ JAVA_VERSION=$(echo "${JAVA_VERSION}" | cut -d\ -f2)
+ JAVA_HOME=${dir}
+ JAVAC=${dir}/bin/javac
+ JAVAH=${dir}/bin/javah
+ JAR=${dir}/bin/jar
+ AC_MSG_RESULT([found version $JAVA_VERSION])
+ break
+ else
+ JAVA_VERSION=""
+ AC_MSG_RESULT([no])
+ fi
+ done
+
+ test "${JAVA_HOME}set" = set && AC_MSG_ERROR([Could not find Java 8 compiler])
+ break
+done
+])