Use less heap space for dex on 32-bit build hosts

Run dex with -JXmx1024M instead of 2048M if running on a 32-bit host.
Surprisingly this appears to also work for framework and services; if
not, a little fine-tuning will be needed.

This does not change anything for non-32-bit hosts.

Change-Id: I1d87c3e394acc934af6f7770ea54ba265a1df838
update ota_from_target_files to handle mounting/unmounting for backupscript

backupscript should not be mounting/unmounting itself as it makes other
scripts have unexpected results (such as modelid_cfg, which expects /system
to be mounted)

instead have the ota script handle the mounting/unmounting

Change-Id: I94511f4147c624d975cb3ecbeaa8b0e98f63437c
envsetup: Add some more commands

 * mmp: Like mm but pushes the built files afterward.

 * mmmp: Like mmm but pushes the built files afterward.

These may be useful when doing debugging on a individual library,
since it builds the library and pushes the new library to the device.

Examples:

mmmp -B device/samsung/vibrantmtd/libgps
mmmp -B packages/apps/Torch

Thanks: tpruvot for revisions

Change-Id: Ia6bdd2b63797ea86e164af69496b70ea6d7c5156
build: Add Qualcomm's helper macros

 * This is used everywhere in Qualcomm's code. There's no reason we need
   to constantly replace it with uglier stuff in our Makefiles.

Change-Id: I0183a338470ec96a38f356a47bae65a0d3fb2c95
build: Remove wallpapers from full_base.

They are already in the cm common config for the full phone.

Change-Id: I02fc0ea73e92ae8b19931d05e6783e3cfa166af2
envsetup.sh: Fix the `reposync` function

It seems ionice can't find `repo` if it's in ~/bin, even if ~/bin
is in the user's $PATH.  Placing repo into /usr/bin or /usr/local/
bin works, but is undesirable (build instructions from both AOSP
and CM tell users to put repo into ~/bin, and repo likes to update
itself from time to time).

This forces the reposync function to use the full path to the repo
binary.

Change-Id: I9dc4a3d4ec3f39563e3a84de7321189700079c2e
build: Pass OTAPACKAGE location to squisher

Pass the OTAPACKAGE location so we don't have to guess what
the package name will be. This fixes an issue when
BUILD_NUMBER is defined in an environment with automated
builds.

Change-Id: Iab18b541de37c99d237aabc3cb7b2e9ab076617b
build: Add "installboot" command to install boot images

 * For devices that lack fastboot, this command will copy the boot image
   to a running device, write it out to the correct partition with dd,
   copy the modules and set the correct permissions.
 * Field surveys have discovered that a specific CM device maintainer is
   handling two devices, one with boot partition p7 and one at p8.
 * Extensive research has unveiled the fact that mixing up these
   partitions across these two specific devices will cause
   corruption of the TZ firmware, which cannot be restored and results
   in an unrecoverable brick.
 * Automate the process so this idiot (me) stops breaking shit.

Change-Id: I0dc5449daf128181e2e349ea26ad5741cc87bfe7

Conflicts:
	envsetup.sh
envsetup: set OUT_DIR to an absolute path always

OUT_DIR was set to $(TOPDIR)out previously,
but $(TOPDIR) was null, so it was a relative path.
This broke releasetools, inline kernel building, etc
since they require absolute paths.
Fix it so that it is set to $(shell readlink -f .)/out
if $(TOPDIR) is null.

Also remove hacks which checked if (OUT_DIR) was out
and changed it to $(ANDROID_BUILD_TOP)/out to workaround
the aforementioned problem.

Change-Id: I459a3b1325a1bbea0565cd73f6acf160d4ed9b39
build: work around missing readlink -f on Mac

Change-Id: I5d56366cf33a2b02f1886c87815d00cff279779d
dopush: improvements

- use $OUT instead of replacing device name with a new line
  and then "tail"ing it.
- adb shell stop/start if file is SystemUI.apk or framework/*
- and some cleanup.

Change-Id: I49278406dc53285b4919f7d41116ad849ec38250
cleanbuild: add *.zip.md5sum to installclean_files

Change-Id: I4b68bb9a8d421a54b008c5318fa82ed230bd6441
build: Add "installrecovery" command

 * Similar to "installboot", add an "installrecovery" command which
   writes the recovery image to the correct partition of a running
   device.

Change-Id: I1dcca44fd0d8afa08ece9e99cd914547acb99c83
omnom (brunch + eat) command

Change-Id: I524e5a1450de7ea9c93512eebcb10f320e68fa82
mka: change how make is called

in some environments make -j N xxx results in compiling target 'N' instead of 'xxx'
make -jN xxx will always make 'xxx' with N number of threads
Signed-off-by: Arnav Gupta <championswimmer@gmail.com>

Change-Id: I77f17c9286a5ef1d61163d8f978900fb4c24e2e7
build: Add board platforms to qcom_utils

Change-Id: I85458167bf2b9c04b029d09b87bf791ff4cfd04d

build: Use common name for QCOM 7K boards.

This is needed to build QCOM HAL without external modifications. The
device would now have to specify msm7x27 or msm7x30 instead of
specifying the full name.

Patch Set 2: Add msm7x27a into the list.

Change-Id: I25018e397b5aad27fab5244731a574ae86752e17

Add new version to qcom_utils.mk

Change-Id: I1ca1532fd4968450715ecd0cca7729e0e6d507ef

Build: update qcom_utils.mk

Add build macro to determine Android Release

Adding platform sdk version 18 for JB MR2.

Change-Id: I79aa831ddd335bd14bd777506c210acc5d9960f1
envsetup: Don't tread on my $PROMPT_COMMAND

 * I want my own PROMPT_COMMAND to coexist with Android's, so stash it
   in the environment and add it to the new command.

Change-Id: I200902f135d0c5c620a8eb3ce9cefdba318cf9d3

envsetup: Fix $PROMPT_COMMAND

Change I200902f135d0c5c620a8eb3ce9cefdba318cf9d3 broke the android
PROMPT_COMMAND on scenarios where the existing prompt already had
a hardstatus adjustment, since appending it to Android's just clobbered
Android's in favor of the original.

So instead of appending them, inject android's at the beggining of the
existing one (and create a default if none exists)

Change-Id: I1fbcbfdb6220d886dda3662da498d1759a4c195b

envsetup: Really fix PROMPT_COMMAND handling

 * Add ANDROID_NO_PROMPT_COMMAND to not change it at all.
 * Export ANDROID_PROMPT_PREFIX so it can be used elsewhere.

Change-Id: Ib2a487404d3b8a367a21582e8a0ce69c2d212a9a

envsetup: More PROMPT_COMMAND

* Get rid of ANDROID_NO_PROMPT_COMMAND, the pre-existing STAY_OFF_MY_LAWN
does the same thing
* Remove any pre-existing android prefixes to avoid accumulation
scenarios in consecutive builds (i.e., multiple build identification
strings in hardstatus)

Change-Id: I86661e066e18ea6ad0c742fa1dc6555780fa5441

envsetup: add quotes around PROMPT_COMMAND

Better compatibility for zsh.

Change-Id: Ie010c30580e67e3b5357e3cc869114a525762677
bacon: get rid of squisher

Change-Id: I3cece868e56f85bfa0b31a62a51e6eab2070ab06