Merge "The builders project is gone. Remove it from main.mk"
diff --git a/cleanspec.mk b/cleanspec.mk
index d63f3bb..6bb7283 100644
--- a/cleanspec.mk
+++ b/cleanspec.mk
@@ -151,6 +151,8 @@
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libdvm*)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libgtest_main_intermediates)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libgtest_intermediates)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/APPS/Music*)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/app/Music*)
 
 # ************************************************
 # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
diff --git a/core/combo/HOST_linux-x86.mk b/core/combo/HOST_linux-x86.mk
index ec443ae..26052d6 100644
--- a/core/combo/HOST_linux-x86.mk
+++ b/core/combo/HOST_linux-x86.mk
@@ -22,9 +22,12 @@
 stat --format "%s" "$(1)" | tr -d '\n'
 endef
 
-# The emulator is 32-bit-only. Force host tools to be built
-# in 32-bit when the emulator is involved.
-# Why we don't also force simulator builds to be 32-bit is a mystery.
+# We build everything in 32-bit, because some host tools are
+# 32-bit-only anyway (emulator, acc), and because it gives us
+# more consistency between the host tools and the target.
+# The exception is the host side of the simulator, which
+# requires to use the default size, as wxWidgets code otherwise
+# fails to build.
 ifneq ($(TARGET_SIMULATOR),true)
 HOST_GLOBAL_CFLAGS += -m32
 HOST_GLOBAL_LDFLAGS += -m32
diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk
index 80adbcf..b8f770f 100644
--- a/core/combo/TARGET_linux-x86.mk
+++ b/core/combo/TARGET_linux-x86.mk
@@ -22,9 +22,10 @@
 TARGET_CC := $(HOST_CC)
 TARGET_CXX := $(HOST_CXX)
 TARGET_AR := $(HOST_AR)
-TARGET_GLOBAL_CFLAGS := $(HOST_GLOBAL_CFLAGS)
-TARGET_GLOBAL_LDFLAGS := $(HOST_GLOBAL_LDFLAGS)
+TARGET_GLOBAL_CFLAGS := $(HOST_GLOBAL_CFLAGS) -m32
+TARGET_GLOBAL_LDFLAGS := $(HOST_GLOBAL_LDFLAGS) -m32
 TARGET_NO_UNDEFINED_LDFLAGS := $(HOST_NO_UNDEFINED_LDFLAGS)
+TARGET_ARCH_VARIANT := x86
 else #simulator
 
 # Provide a default variant.
diff --git a/core/pathmap.mk b/core/pathmap.mk
index bc2fcb4..25de0ea 100644
--- a/core/pathmap.mk
+++ b/core/pathmap.mk
@@ -89,7 +89,6 @@
 	    wifi \
 	    vpn \
 	    keystore \
-	    common \
 	 )
 
 #
diff --git a/envsetup.sh b/envsetup.sh
index bb346de..a76deb9 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -625,7 +625,8 @@
             if [ -f $DIR/Android.mk ]; then
                 TO_CHOP=`echo $T | wc -c | tr -d ' '`
                 TO_CHOP=`expr $TO_CHOP + 1`
-                MFILE=`echo $PWD | cut -c${TO_CHOP}-`
+                START=`PWD= /bin/pwd`
+                MFILE=`echo $START | cut -c${TO_CHOP}-`
                 if [ "$MFILE" = "" ] ; then
                     MFILE=$DIR/Android.mk
                 else
diff --git a/target/product/AndroidProducts.mk b/target/product/AndroidProducts.mk
index c435177..94b0e24 100644
--- a/target/product/AndroidProducts.mk
+++ b/target/product/AndroidProducts.mk
@@ -26,6 +26,7 @@
 #
 
 PRODUCT_MAKEFILES := \
+    $(LOCAL_DIR)/core.mk \
     $(LOCAL_DIR)/generic.mk \
     $(LOCAL_DIR)/sdk.mk \
     $(LOCAL_DIR)/sim.mk
diff --git a/target/product/core.mk b/target/product/core.mk
index a6a70df..2eb1030 100644
--- a/target/product/core.mk
+++ b/target/product/core.mk
@@ -1,7 +1,25 @@
-PRODUCT_BRAND :=
-PRODUCT_NAME :=
-PRODUCT_DEVICE :=
+#
+# Copyright (C) 2007 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+PRODUCT_BRAND := generic
+PRODUCT_DEVICE := generic
+PRODUCT_NAME := core
+
 PRODUCT_POLICY := android.policy_phone
+
 PRODUCT_PROPERTY_OVERRIDES := \
     ro.config.notification_sound=OnTheHunt.ogg \
     ro.config.alarm_alert=Alarm_Classic.ogg
diff --git a/target/product/generic.mk b/target/product/generic.mk
index 4b1ea2e..ee125e4 100644
--- a/target/product/generic.mk
+++ b/target/product/generic.mk
@@ -1,3 +1,19 @@
+#
+# Copyright (C) 2007 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 # This is a generic product that isn't specialized for a specific device.
 # It includes the base Android platform.
 
diff --git a/target/product/sdk.mk b/target/product/sdk.mk
index e571f9e..3923019 100644
--- a/target/product/sdk.mk
+++ b/target/product/sdk.mk
@@ -1,3 +1,19 @@
+#
+# Copyright (C) 2007 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
 PRODUCT_PROPERTY_OVERRIDES :=
 
 PRODUCT_PACKAGES := \
diff --git a/tools/dexpreopt/dexpreopt.py b/tools/dexpreopt/dexpreopt.py
index 5dde642..376f135 100755
--- a/tools/dexpreopt/dexpreopt.py
+++ b/tools/dexpreopt/dexpreopt.py
@@ -125,6 +125,10 @@
   else:
     args += ['-shell']
 
+  # This is a work-around for the ARMv7 emulation bug.
+  # XXX: It only works by chance, if any ! A real emulation fix is on the way
+  args += ['-qemu', '-singlestep']
+
   # Ensure that this environment variable isn't set;
   # if it is, the emulator will print the log to stdout.
   if os.environ.get('ANDROID_LOG_TAGS'):