summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac17
1 files changed, 17 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index b1dbaa13155..d3effc0f4f3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -856,6 +856,7 @@ ANDROID_ABI=
WARN_JAVAFLAGS=
ANDROID_SHARED_USER_ID=
ANDROID_SHARED_USER_NAME=
+IS_D8_R8=
# This is a list of Makefiles that have alternative versions for
# Android.
@@ -1023,6 +1024,21 @@ Please verify that the path to the SDK build tools you specified is correct])
Please verify that the path to the SDK build tools you specified is correct])
fi
+ # Locate any d8.jar within the SDK build tools directory. The R8
+ # optimizing compiler is also present in this bundle, and it generates
+ # far superior code.
+ emacs_val=`which $D8`
+ emacs_val=`AS_DIRNAME([$emacs_val])`/lib/d8.jar
+ AS_IF([test -f "$emacs_val"],
+ [AC_CACHE_CHECK([whether d8.jar coresident with d8 binary provides r8],
+ [emacs_cv_d8_provides_r8],
+ [AS_IF([java -cp "$emacs_val" com.android.tools.r8.R8 --help &>/dev/null],
+ [emacs_cv_d8_provides_r8=yes], [emacs_cv_d8_provides_r8=no])])])
+ AS_IF([test "$emacs_cv_d8_provides_r8" = "yes"],
+ # And substitute it for D8 if present.
+ [D8="java -cp $emacs_val com.android.tools.r8.R8"
+ IS_D8_R8=yes])
+
AC_PATH_PROGS([ZIPALIGN], [zipalign], [], "${SDK_BUILD_TOOLS}:$PATH")
if test "ZIPALIGN" = ""; then
AC_MSG_ERROR([The Android ZIP archive alignment utility was not found.
@@ -1281,6 +1297,7 @@ AC_SUBST([D8])
AC_SUBST([ZIPALIGN])
AC_SUBST([ANDROID_JAR])
AC_SUBST([ANDROID_ABI])
+AC_SUBST([IS_D8_R8])
if test "$XCONFIGURE" = "android"; then
ANDROID=yes