Add --with-errorprone option. ihse-errorprone-branch
authorihse
Wed, 01 Aug 2018 22:43:18 -0700
branchihse-errorprone-branch
changeset 56844 16c07e1567e7
parent 56843 599974a7c6b8
child 56846 1186bac4e290
Add --with-errorprone option.
make/autoconf/configure.ac
make/autoconf/jdk-options.m4
make/autoconf/spec.gmk.in
--- a/make/autoconf/configure.ac	Wed Aug 01 18:56:00 2018 -0700
+++ b/make/autoconf/configure.ac	Wed Aug 01 22:43:18 2018 -0700
@@ -198,8 +198,9 @@
 JDKOPT_SETUP_DEBUG_SYMBOLS
 JDKOPT_SETUP_CODE_COVERAGE
 
-# AddressSanitizer
+# AddressSanitizer and errorprone
 JDKOPT_SETUP_ADDRESS_SANITIZER
+JDKOPT_SETUP_ERRORPRONE
 
 # Need toolchain to setup dtrace
 HOTSPOT_SETUP_DTRACE
--- a/make/autoconf/jdk-options.m4	Wed Aug 01 18:56:00 2018 -0700
+++ b/make/autoconf/jdk-options.m4	Wed Aug 01 22:43:18 2018 -0700
@@ -442,6 +442,37 @@
   AC_SUBST(ASAN_ENABLED)
 ])
 
+###############################################################################
+#
+# Setup errorprone jar (used for optional static analysis).
+#
+AC_DEFUN_ONCE([JDKOPT_SETUP_ERRORPRONE],
+[
+  AC_ARG_WITH(errorprone, [AS_HELP_STRING([--with-errorprone],
+      [specify the location of the errorprone jar file [none]])])
+
+  ERRORPRONE_JAR=""
+  AC_MSG_CHECKING([for errorprone jar file])
+
+  if test "x$with_errorprone" = "x"; then
+    AC_MSG_RESULT([no])
+  else
+    if test "x$with_errorprone" = "xyes"; then
+      AC_MSG_RESULT([no])
+      AC_MSG_ERROR([Must specify a JAR file as argument to --with-errorprone])
+    elif test "x$with_errorprone" != "xno"; then
+      ERRORPRONE_JAR="$with_errorprone"
+      AC_MSG_RESULT([$ERRORPRONE_JAR])
+      if ! test -e "$ERRORPRONE_JAR"; then
+        AC_MSG_ERROR([JAR file "$ERRORPRONE_JAR" specified using --with-errorprone does not exist])
+      fi
+    fi
+  fi
+
+  AC_SUBST(ERRORPRONE_JAR)
+])
+
+
 ################################################################################
 #
 # Static build support.  When enabled will generate static
--- a/make/autoconf/spec.gmk.in	Wed Aug 01 18:56:00 2018 -0700
+++ b/make/autoconf/spec.gmk.in	Wed Aug 01 22:43:18 2018 -0700
@@ -313,6 +313,8 @@
 
 BUILD_MANPAGES := @BUILD_MANPAGES@
 
+ERRORPRONE_JAR := @ERRORPRONE_JAR@
+
 # The boot jdk to use. This is overridden in bootcycle-spec.gmk. Make sure to keep
 # it in sync.
 BOOT_JDK:=@BOOT_JDK@