Merge "Added /frameworks/av/include to the default include search path"
diff --git a/core/Makefile b/core/Makefile
index 173932c..e005485 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -631,7 +631,7 @@
 # Recovery image
 
 # If neither TARGET_NO_KERNEL nor TARGET_NO_RECOVERY are true
-ifeq (,$(filter true, $(TARGET_NO_KERNEL) $(TARGET_NO_RECOVERY) $(BUILD_TINY_ANDROID) $(BUILD_PDK)))
+ifeq (,$(filter true, $(TARGET_NO_KERNEL) $(TARGET_NO_RECOVERY) $(BUILD_TINY_ANDROID) $(TARGET_BUILD_PDK)))
 
 INSTALLED_RECOVERYIMAGE_TARGET := $(PRODUCT_OUT)/recovery.img
 
diff --git a/core/config.mk b/core/config.mk
index 11c6751..7156b46 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -34,7 +34,6 @@
 	$(TOPDIR)frameworks/av/include \
 	$(TOPDIR)frameworks/base/include \
 	$(TOPDIR)frameworks/base/opengl/include \
-	$(TOPDIR)frameworks/base/native/include \
 	$(TOPDIR)external/skia/include
 SRC_HOST_HEADERS:=$(TOPDIR)tools/include
 SRC_LIBRARIES:= $(TOPDIR)libs
diff --git a/core/llvm_config.mk b/core/llvm_config.mk
index 103221c..ec6720a 100644
--- a/core/llvm_config.mk
+++ b/core/llvm_config.mk
@@ -22,6 +22,7 @@
 ifeq ($(TARGET_ARCH),arm)
   CLANG_CONFIG_EXTRA_CFLAGS += \
     -target arm-linux-androideabi \
+    -B$(TARGET_TOOLCHAIN_ROOT)/arm-linux-androideabi/bin \
     -mllvm -arm-enable-ehabi
   CLANG_CONFIG_EXTRA_LDFLAGS += \
     -target arm-linux-androideabi \
@@ -35,7 +36,8 @@
 endif
 ifeq ($(TARGET_ARCH),x86)
   CLANG_CONFIG_EXTRA_CFLAGS += \
-    -target i686-android-linux
+    -target i686-android-linux \
+    -B$(TARGET_TOOLCHAIN_ROOT)/i686-android-linux/bin
   CLANG_CONFIG_EXTRA_LDFLAGS += \
     -target i686-android-linux \
     -B$(TARGET_TOOLCHAIN_ROOT)/i686-android-linux/bin
diff --git a/core/main.mk b/core/main.mk
index ab9d52d..a038d5d 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -218,7 +218,8 @@
 endif
 ifneq ($(PDK_BUILD_TYPE),)
   $(info PDK build type $(PDK_BUILD_TYPE))
-  BUILD_PDK:= true
+  BUILD_PDK:=true
+  TARGET_BUILD_PDK:=true
   include pdk/build/pdk.mk
   # force droid target
   MAKECMDGOALS:= $(subst $(PDK_BUILD_TYPE),droid,$(MAKECMDGOALS))
@@ -729,7 +730,7 @@
 ifeq ($(BUILD_TINY_ANDROID), true)
 INSTALLED_RECOVERYIMAGE_TARGET :=
 endif
-ifneq ($(BUILD_PDK),)
+ifneq ($(TARGET_BUILD_PDK),)
 INSTALLED_RECOVERYIMAGE_TARGET :=
 endif
 
diff --git a/core/tasks/apicheck.mk b/core/tasks/apicheck.mk
index b3d800b..8d9928e 100644
--- a/core/tasks/apicheck.mk
+++ b/core/tasks/apicheck.mk
@@ -18,7 +18,7 @@
 #
 
 # skip api check for TINY_ANDROID and PDK buid
-ifeq (,$(filter true, $(BUILD_TINY_ANDROID) $(BUILD_PDK)))
+ifeq (,$(filter true, $(BUILD_TINY_ANDROID) $(TARGET_BUILD_PDK)))
 
 .PHONY: checkapi
 
diff --git a/core/tasks/factory_ramdisk.mk b/core/tasks/factory_ramdisk.mk
index 6757194..2cbea87 100644
--- a/core/tasks/factory_ramdisk.mk
+++ b/core/tasks/factory_ramdisk.mk
@@ -60,6 +60,10 @@
 
 ifneq (,$(INTERNAL_FACTORY_RAMDISK_EXTRA_MODULES_FILES)$(INTERNAL_FACTORY_RAMDISK_FILES))
 
+# These files are made by magic in build/core/Makefile so we need to explicitly include them
+$(eval $(call copy-one-file,$(TARGET_OUT)/build.prop,$(TARGET_FACTORY_RAMDISK_OUT)/system/build.prop))
+INTERNAL_FACTORY_RAMDISK_FILES += $(TARGET_FACTORY_RAMDISK_OUT)/system/build.prop
+
 BUILT_FACTORY_RAMDISK_FS := $(PRODUCT_OUT)/factory_ramdisk.gz
 BUILT_FACTORY_RAMDISK_TARGET := $(PRODUCT_OUT)/factory_ramdisk.img
 
diff --git a/target/product/sdk.mk b/target/product/sdk.mk
index 7287664..22e8b1d 100644
--- a/target/product/sdk.mk
+++ b/target/product/sdk.mk
@@ -140,6 +140,8 @@
 	frameworks/base/data/sounds/effects/camera_click.ogg:system/media/audio/ui/camera_click.ogg \
 	frameworks/base/data/sounds/effects/VideoRecord.ogg:system/media/audio/ui/VideoRecord.ogg \
 	frameworks/base/data/etc/handheld_core_hardware.xml:system/etc/permissions/handheld_core_hardware.xml \
+	development/tools/emulator/system/camera/media_profiles.xml:system/etc/media_profiles.xml \
+	development/tools/emulator/system/camera/media_codecs.xml:system/etc/media_codecs.xml \
 	frameworks/base/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \
 	frameworks/base/data/etc/android.hardware.camera.autofocus.xml:system/etc/permissions/android.hardware.camera.autofocus.xml
 
diff --git a/tools/zipalign/Android.mk b/tools/zipalign/Android.mk
index 8ed60df..9763bd2 100644
--- a/tools/zipalign/Android.mk
+++ b/tools/zipalign/Android.mk
@@ -15,7 +15,6 @@
 LOCAL_C_INCLUDES += external/zlib
 
 LOCAL_STATIC_LIBRARIES := \
-	libandroidfw \
 	libutils \
 	libcutils
 
diff --git a/tools/zipalign/ZipFile.cpp b/tools/zipalign/ZipFile.cpp
index 8057068..3994c31 100644
--- a/tools/zipalign/ZipFile.cpp
+++ b/tools/zipalign/ZipFile.cpp
@@ -20,8 +20,8 @@
 
 #define LOG_TAG "zip"
 
-#include <androidfw/ZipUtils.h>
 #include <utils/Log.h>
+#include <utils/ZipUtils.h>
 
 #include "ZipFile.h"