Bug 1056128: Enable JDK source level 1.7 for Android Java code. r=nalexander
☠☠ backed out by 4caf6e377db5 ☠ ☠
authorChris Kitching <chriskitching@linux.com>
Mon, 25 Aug 2014 17:54:23 -0700
changeset 223193 5af48430563eeb4f7a5de564afdd32c9b3f13816
parent 223192 be6073a0d24a2c504c0b137a1363e686b054c8ac
child 223194 356d27a0d25d82b39956aaed9d2da34e871e945d
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1056128
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1056128: Enable JDK source level 1.7 for Android Java code. r=nalexander
config/android-common.mk
configure.in
--- a/config/android-common.mk
+++ b/config/android-common.mk
@@ -14,19 +14,19 @@ DEBUG_JARSIGNER=$(PYTHON) $(abspath $(to
   --jarsigner=$(JARSIGNER) \
   $(NULL)
 
 # For Android, this defaults to $(ANDROID_SDK)/android.jar
 ifndef JAVA_BOOTCLASSPATH
   JAVA_BOOTCLASSPATH = $(ANDROID_SDK)/android.jar
 endif
 
-# For Android, we default to 1.5
+# For Android, we default to 1.7
 ifndef JAVA_VERSION
-  JAVA_VERSION = 1.5
+  JAVA_VERSION = 1.7
 endif
 
 JAVAC_FLAGS = \
   -target $(JAVA_VERSION) \
   -source $(JAVA_VERSION) \
   $(if $(JAVA_CLASSPATH),-classpath $(JAVA_CLASSPATH),) \
   -bootclasspath $(JAVA_BOOTCLASSPATH) \
   -encoding UTF8 \
--- a/configure.in
+++ b/configure.in
@@ -5602,16 +5602,34 @@ if test -n "${JAVA_BIN_PATH}" -o \
   if test -z "$JARSIGNER" -o "$JARSIGNER" = ":"; then
     AC_MSG_ERROR([The program jarsigner was not found.  Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}])
   fi
   if test -z "$KEYTOOL" -o "$KEYTOOL" = ":"; then
     AC_MSG_ERROR([The program keytool was not found.  Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}])
   fi
 fi
 
+AC_MSG_CHECKING([for minimum required javac version >= 1.7])
+
+dnl Javac spits out something like `javac 1.8.0`. This line cuts off the 'javac'
+_javac_version=$($JAVAC -version 2>&1 | cut -d ' ' -f 2)
+
+dnl Here, we extract the major (1) and minor (8) version numbers from the
+dnl acquired version string.
+_javac_major_version=$(echo $_javac_version | cut -d '.' -f 1)
+_javac_minor_version=$(echo $_javac_version | cut -d '.' -f 2)
+
+AC_MSG_RESULT([$_javac_version])
+
+dnl Fail if we have a version older than 1.7
+if test "$_javac_major_version" -lt "1" -o \
+    \( "$_javac_minor_version" -lt "7" \); then
+    AC_MSG_ERROR([javac 1.7 or higher is required.])
+fi
+
 dnl ========================================================
 dnl = ANGLE OpenGL->D3D translator for WebGL
 dnl = * only applies to win32
 dnl ========================================================
 
 MOZ_ANGLE_RENDERER=
 MOZ_D3D_CPU_SUFFIX=
 MOZ_HAS_WINSDK_WITH_D3D=