Merge "Add OMX IL FLAC encoder library" into jb-dev
diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk
index 9e1d4bd..dc4afb8 100644
--- a/core/combo/TARGET_linux-x86.mk
+++ b/core/combo/TARGET_linux-x86.mk
@@ -139,6 +139,7 @@
 TARGET_GLOBAL_LDFLAGS += -m32
 
 TARGET_GLOBAL_LDFLAGS += -Wl,-z,noexecstack
+TARGET_GLOBAL_LDFLAGS += -Wl,-z,relro -Wl,-z,now
 TARGET_GLOBAL_LDFLAGS += -Wl,--gc-sections
 
 TARGET_C_INCLUDES := \
diff --git a/core/config.mk b/core/config.mk
index dabdfde..3c267d9 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -28,7 +28,7 @@
 	$(TOPDIR)hardware/libhardware/include \
 	$(TOPDIR)hardware/libhardware_legacy/include \
 	$(TOPDIR)hardware/ril/include \
-	$(TOPDIR)dalvik/libnativehelper/include \
+	$(TOPDIR)libnativehelper/include \
 	$(TOPDIR)frameworks/native/include \
 	$(TOPDIR)frameworks/native/opengl/include \
 	$(TOPDIR)frameworks/av/include \
@@ -303,7 +303,6 @@
 DX := $(HOST_OUT_EXECUTABLES)/dx
 ZIPALIGN := $(HOST_OUT_EXECUTABLES)/zipalign$(HOST_EXECUTABLE_SUFFIX)
 FINDBUGS := prebuilt/common/findbugs/bin/findbugs
-LOCALIZE := $(HOST_OUT_EXECUTABLES)/localize$(HOST_EXECUTABLE_SUFFIX)
 EMMA_JAR := external/emma/lib/emma$(COMMON_JAVA_PACKAGE_SUFFIX)
 
 # Deal with archaic version of bison on Mac OS X.
diff --git a/core/llvm_config.mk b/core/llvm_config.mk
index 966924e..bc90b95 100644
--- a/core/llvm_config.mk
+++ b/core/llvm_config.mk
@@ -1,5 +1,6 @@
 CLANG := $(HOST_OUT_EXECUTABLES)/clang$(HOST_EXECUTABLE_SUFFIX)
 CLANG_CXX := $(HOST_OUT_EXECUTABLES)/clang++$(HOST_EXECUTABLE_SUFFIX)
+LLVM_AS := $(HOST_OUT_EXECUTABLES)/llvm-as$(HOST_EXECUTABLE_SUFFIX)
 LLVM_LINK := $(HOST_OUT_EXECUTABLES)/llvm-link$(HOST_EXECUTABLE_SUFFIX)
 
 define do-clang-flags-subst
diff --git a/core/pathmap.mk b/core/pathmap.mk
index 581cf83..91a7fd4 100644
--- a/core/pathmap.mk
+++ b/core/pathmap.mk
@@ -43,7 +43,7 @@
     libhardware_legacy:hardware/libhardware_legacy/include \
     libhost:build/libs/host/include \
     libm:bionic/libm/include \
-    libnativehelper:dalvik/libnativehelper/include \
+    libnativehelper:libnativehelper/include \
     libpagemap:system/extras/libpagemap/include \
     libril:hardware/ril/include \
     libstdc++:bionic/libstdc++/include \
diff --git a/target/product/core.mk b/target/product/core.mk
index c8914e0..58002a7 100644
--- a/target/product/core.mk
+++ b/target/product/core.mk
@@ -75,6 +75,7 @@
     libaudiopreprocessing \
     libaudioutils \
     libcrypto \
+    libdownmix \
     libdvm \
     libdrmframework \
     libdrmframework_jni \
@@ -84,6 +85,7 @@
     libgabi++ \
     libicui18n \
     libicuuc \
+    libjavacore \
     libkeystore \
     libmdnssd \
     libnativehelper \
@@ -126,5 +128,12 @@
         apache-xml-hostdex \
         bouncycastle-hostdex \
         core-hostdex \
+        libcrypto \
+        libexpat \
+        libicui18n \
+        libicuuc \
+        libjavacore \
+        libssl \
+        libz-host \
         dalvik
 endif
diff --git a/target/product/generic_no_telephony.mk b/target/product/generic_no_telephony.mk
index e918772..5863435 100644
--- a/target/product/generic_no_telephony.mk
+++ b/target/product/generic_no_telephony.mk
@@ -27,8 +27,9 @@
     CertInstaller \
     DrmProvider \
     Email \
-    Exchange \
+    Exchange2 \
     Gallery2 \
+    InputDevices \
     LatinIME \
     Launcher2 \
     Music \
@@ -53,8 +54,7 @@
     librs_jni \
     libvideoeditor_jni \
     libvideoeditorplayer \
-    libvideoeditor_core \
-    libdownmix
+    libvideoeditor_core
 
 PRODUCT_PACKAGES += \
     audio.primary.default \
diff --git a/target/product/sdk.mk b/target/product/sdk.mk
index 8f29b8c..a5d941e 100644
--- a/target/product/sdk.mk
+++ b/target/product/sdk.mk
@@ -21,7 +21,7 @@
 	Calculator \
 	DeskClock \
 	Email \
-	Exchange \
+	Exchange2 \
 	Gallery \
 	Music \
 	Mms \
@@ -42,6 +42,7 @@
 	SdkSetup \
 	CustomLocale \
 	sqlite3 \
+	InputDevices \
 	LatinIME \
 	CertInstaller \
 	LiveWallpapersPicker \
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index 8196b3c..5e4055a 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -196,7 +196,7 @@
   for k, v in sorted(d.items()):
     print "%-25s = (%s) %s" % (k, type(v).__name__, v)
 
-def BuildBootableImage(sourcedir):
+def BuildBootableImage(sourcedir, fs_config_file):
   """Take a kernel, cmdline, and ramdisk directory from the input (in
   'sourcedir'), and turn them into a boot image.  Return the image
   data, or None if sourcedir does not appear to contains files for
@@ -209,8 +209,11 @@
   ramdisk_img = tempfile.NamedTemporaryFile()
   img = tempfile.NamedTemporaryFile()
 
-  p1 = Run(["mkbootfs", os.path.join(sourcedir, "RAMDISK")],
-           stdout=subprocess.PIPE)
+  if os.access(fs_config_file, os.F_OK):
+    cmd = ["mkbootfs", "-f", fs_config_file, os.path.join(sourcedir, "RAMDISK")]
+  else:
+    cmd = ["mkbootfs", os.path.join(sourcedir, "RAMDISK")]
+  p1 = Run(cmd, stdout=subprocess.PIPE)
   p2 = Run(["minigzip"],
            stdin=p1.stdout, stdout=ramdisk_img.file.fileno())
 
@@ -265,7 +268,9 @@
     return File.FromLocalFile(name, prebuilt_path)
   else:
     print "building image from target_files %s..." % (tree_subdir,)
-    return File(name, BuildBootableImage(os.path.join(unpack_dir, tree_subdir)))
+    fs_config = "META/" + tree_subdir.lower() + "_filesystem_config.txt"
+    return File(name, BuildBootableImage(os.path.join(unpack_dir, tree_subdir),
+                                         os.path.join(unpack_dir, fs_config)))
 
 
 def UnzipTemp(filename, pattern=None):