Bug 759041 - Bring in Android compatibility libraries. r=blassey
authorWes Johnston <wjohnston@mozilla.com>
Thu, 08 Nov 2012 07:45:29 -0800
changeset 120626 258b1c1d0d20c851f5706d916e911812674e6b85
parent 120625 e252b7ccec6ef5ef4c4563b2b12f8797a2187556
child 120627 3566ba4296f76f07755c5becf3ff1536c2832dd0
push id1997
push userakeybl@mozilla.com
push dateMon, 07 Jan 2013 21:25:26 +0000
treeherdermozilla-beta@4baf45cdcf21 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey
bugs759041
milestone19.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 759041 - Bring in Android compatibility libraries. r=blassey
build/autoconf/android.m4
build/mobile/robocop/Makefile.in
config/android-common.mk
js/src/build/autoconf/android.m4
mobile/android/base/Makefile.in
--- a/build/autoconf/android.m4
+++ b/build/autoconf/android.m4
@@ -238,15 +238,24 @@ case "$target" in
         fi
     fi
 
     android_platform_tools="$android_sdk"/../../platform-tools
     if test ! -d "$android_platform_tools" ; then
         android_platform_tools="$android_sdk"/tools # SDK Tools < r8
     fi
     ANDROID_SDK="${android_sdk}"
+    if test -e "${android_sdk}/../../extras/android/compatibility/v4/android-support-v4.jar" ; then
+        ANDROID_COMPAT_LIB="${android_sdk}/../../extras/android/compatibility/v4/android-support-v4.jar"
+    else
+        ANDROID_COMPAT_LIB="${android_sdk}/../../extras/android/support/v4/android-support-v4.jar";
+    fi
     ANDROID_PLATFORM_TOOLS="${android_platform_tools}"
     AC_SUBST(ANDROID_SDK)
+    AC_SUBST(ANDROID_COMPAT_LIB)
+    if ! test -e $ANDROID_COMPAT_LIB ; then
+        AC_MSG_ERROR([You must download the andrioid compatibility library when targeting Android. (found $ANDROID_COMPAT_LIB)])
+    fi
     AC_SUBST(ANDROID_PLATFORM_TOOLS)
     ;;
 esac
 
 ])
--- a/build/mobile/robocop/Makefile.in
+++ b/build/mobile/robocop/Makefile.in
@@ -88,17 +88,17 @@ libs:: $(_TEST_FILES)
 tools:: robocop.apk
 
 classes.dex: robocop.ap_
 classes.dex: $(_ROBOCOP_TOOLS)
 classes.dex: $(_JAVA_HARNESS)
 classes.dex: $(_JAVA_TESTS)
 	$(NSINSTALL) -D classes
 	$(JAVAC) $(JAVAC_FLAGS) -d classes $(JAVAFILES) $(_JAVA_HARNESS) $(addprefix $(DEPTH)/mobile/android/base/tests/,$(_JAVA_TESTS))
-	$(DX) --dex --output=$@ classes $(ROBOTIUM_PATH)
+	$(DX) --dex --output=$@ classes $(ROBOTIUM_PATH) $(ANDROID_COMPT_LIB)
 
 robocop.ap_: AndroidManifest.xml $(TESTPATH)/assets/*
 	$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -I . -S res -A $(TESTPATH)/assets -F $@ -J ./
 
 robocop.apk: robocop.ap_ classes.dex
 	cp $(TESTPATH)/robocop.ini robocop.ini
 	cp $(srcdir)/parse_ids.py parse_ids.py
 
--- a/config/android-common.mk
+++ b/config/android-common.mk
@@ -18,17 +18,17 @@ APKBUILDER=$(ANDROID_SDK)/../../tools/ap
 ZIPALIGN=$(ANDROID_SDK)/../../tools/zipalign
 
 ifdef JARSIGNER
   APKBUILDER_FLAGS += -u
 endif
 
 # For Android, this defaults to $(ANDROID_SDK)/android.jar
 ifndef JAVA_BOOTCLASSPATH
-  JAVA_BOOTCLASSPATH = $(ANDROID_SDK)/android.jar
+  JAVA_BOOTCLASSPATH = $(ANDROID_SDK)/android.jar:$(ANDROID_COMPAT_LIB)
 endif
 
 # For Android, we default to 1.5
 ifndef JAVA_VERSION
   JAVA_VERSION = 1.5
 endif
 
 JAVAC_FLAGS = \
--- a/js/src/build/autoconf/android.m4
+++ b/js/src/build/autoconf/android.m4
@@ -238,15 +238,24 @@ case "$target" in
         fi
     fi
 
     android_platform_tools="$android_sdk"/../../platform-tools
     if test ! -d "$android_platform_tools" ; then
         android_platform_tools="$android_sdk"/tools # SDK Tools < r8
     fi
     ANDROID_SDK="${android_sdk}"
+    if test -e "${android_sdk}/../../extras/android/compatibility/v4/android-support-v4.jar" ; then
+        ANDROID_COMPAT_LIB="${android_sdk}/../../extras/android/compatibility/v4/android-support-v4.jar"
+    else
+        ANDROID_COMPAT_LIB="${android_sdk}/../../extras/android/support/v4/android-support-v4.jar";
+    fi
     ANDROID_PLATFORM_TOOLS="${android_platform_tools}"
     AC_SUBST(ANDROID_SDK)
+    AC_SUBST(ANDROID_COMPAT_LIB)
+    if ! test -e $ANDROID_COMPAT_LIB ; then
+        AC_MSG_ERROR([You must download the andrioid compatibility library when targeting Android. (found $ANDROID_COMPAT_LIB)])
+    fi
     AC_SUBST(ANDROID_PLATFORM_TOOLS)
     ;;
 esac
 
 ])
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -1038,17 +1038,17 @@ include $(topsrcdir)/config/android-comm
 
 # Note that we're going to set up a dependency directly between embed_android.dex and the java files
 # Instead of on the .class files, since more than one .class file might be produced per .java file
 # Sync dependencies are provided in a single jar. Sync classes themselves are delivered as source,
 # because Android resource classes must be compiled together in order to avoid overlapping resource
 # indices.
 classes.dex: jars/gecko-browser.jar
 	@echo "DX classes.dex"
-	$(DX) --dex --output=classes.dex jars
+	$(DX) --dex --output=classes.dex jars $(ANDROID_COMPAT_LIB)
 
 jars/gecko-browser.jar: jars/gecko-mozglue.jar jars/gecko-util.jar jars/sync-thirdparty.jar $(addprefix $(srcdir)/,$(FENNEC_JAVA_FILES)) $(FENNEC_PP_JAVA_FILES) $(addprefix $(srcdir)/,$(SYNC_JAVA_FILES)) $(SYNC_PP_JAVA_FILES) R.java
 	@echo "JAR gecko-browser.jar"
 	$(NSINSTALL) -D classes/gecko-browser
 	$(JAVAC) $(JAVAC_FLAGS) -Xlint:all,-deprecation,-fallthrough -d classes/gecko-browser -classpath "jars/gecko-mozglue.jar:jars/gecko-util.jar:jars/sync-thirdparty.jar" $(addprefix $(srcdir)/,$(FENNEC_JAVA_FILES)) $(FENNEC_PP_JAVA_FILES) $(addprefix $(srcdir)/,$(SYNC_JAVA_FILES)) $(SYNC_PP_JAVA_FILES) R.java
 	$(JAR) cMf jars/gecko-browser.jar -C classes/gecko-browser .
 
 jars/gecko-mozglue.jar: $(addprefix $(srcdir)/,$(MOZGLUE_JAVA_FILES)) jars