Bug 885951 - Find jarsigner and keytool during configure. r=gps

This commit is contained in:
Nick Alexander 2013-06-26 11:49:27 -07:00
parent 4403f2bc90
commit 72e9d59e80
3 changed files with 34 additions and 7 deletions

View File

@ -18,7 +18,10 @@ AIDL=$(ANDROID_BUILD_TOOLS)/aidl
ADB=$(ANDROID_PLATFORM_TOOLS)/adb
ZIPALIGN=$(ANDROID_SDK)/../../tools/zipalign
# DEBUG_JARSIGNER always debug signs.
DEBUG_JARSIGNER=$(PYTHON) $(call core_abspath,$(topsrcdir)/mobile/android/debug_sign_tool.py)
DEBUG_JARSIGNER=$(PYTHON) $(call core_abspath,$(topsrcdir)/mobile/android/debug_sign_tool.py) \
--keytool=$(KEYTOOL) \
--jarsigner=$(JARSIGNER) \
$(NULL)
# For Android, this defaults to $(ANDROID_SDK)/android.jar
ifndef JAVA_BOOTCLASSPATH

View File

@ -5872,11 +5872,28 @@ MOZ_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
MOZ_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
MOZ_PATH_PROG(JAVAH, javah, :, [$JAVA_PATH])
MOZ_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
MOZ_PATH_PROG(JARSIGNER, jarsigner, :, [$JAVA_PATH])
MOZ_PATH_PROG(KEYTOOL, keytool, :, [$JAVA_PATH])
if test -n "${JAVA_BIN_PATH}" -o \
\( "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk" \); then
if test -z "$JAVA" -o "$JAVA" = ":" -o -z "$JAVAC" -o "$JAVAC" = ":" -o -z "$JAVAH" -o "$JAVAH" = ":" -o -z "$JAR" -o "$JAR" = ":"; then
AC_MSG_ERROR([The programs java, javac, javah and jar were not found. Set \$JAVA_HOME to your java sdk directory or use --with-java-bin-path={java-bin-dir}])
if test -z "$JAVA" -o "$JAVA" = ":"; then
AC_MSG_ERROR([The program java was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}])
fi
if test -z "$JAVAC" -o "$JAVAC" = ":"; then
AC_MSG_ERROR([The program javac was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}])
fi
if test -z "$JAVAH" -o "$JAVAH" = ":"; then
AC_MSG_ERROR([The program javah was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}])
fi
if test -z "$JAR" -o "$JAR" = ":"; then
AC_MSG_ERROR([The program jar was not found. Set \$JAVA_HOME to your Java SDK directory or use --with-java-bin-path={java-bin-dir}])
fi
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
@ -8615,6 +8632,8 @@ AC_SUBST(JAVA)
AC_SUBST(JAVAC)
AC_SUBST(JAVAH)
AC_SUBST(JAR)
AC_SUBST(JARSIGNER)
AC_SUBST(KEYTOOL)
AC_SUBST(MOZ_PROFILELOCKING)

View File

@ -50,10 +50,15 @@ class DebugKeystore:
return self._alias
def _check(self, args):
if self.verbose:
subprocess.check_call(args)
else:
subprocess.check_output(args)
try:
if self.verbose:
subprocess.check_call(args)
else:
subprocess.check_output(args)
except OSError as ex:
if ex.errno != errno.ENOENT:
raise
raise Exception("Could not find executable '%s'" % args[0])
def keystore_contains_alias(self):
args = [ self.keytool,