Make libjpeg built against NDK

Change-Id: I2570cfe1360af6eb0dcbb14bcc70f1dc6f2b5fe0
diff --git a/Android.mk b/Android.mk
index 6861006..db469b5 100644
--- a/Android.mk
+++ b/Android.mk
@@ -13,15 +13,23 @@
 	jfdctint.c jidctflt.c jidctfst.c jidctint.c jidctred.c jquant1.c \
 	jquant2.c jutils.c jmemmgr.c armv6_idct.S
 
+ifeq (,$(TARGET_BUILD_APPS))
+# building against master
 # use ashmem as libjpeg decoder's backing store
 LOCAL_CFLAGS += -DUSE_ANDROID_ASHMEM
 LOCAL_SRC_FILES += \
 	jmem-ashmem.c
 
+LOCAL_SHARED_LIBRARIES := \
+	libcutils
+else
+# unbundled branch, built against NDK.
+LOCAL_SDK_VERSION := 17
 # the original android memory manager.
 # use sdcard as libjpeg decoder's backing store
-#LOCAL_SRC_FILES += \
-#	jmem-android.c
+LOCAL_SRC_FILES += \
+	jmem-android.c
+endif
 
 LOCAL_CFLAGS += -DAVOID_TABLES 
 LOCAL_CFLAGS += -O3 -fstrict-aliasing -fprefetch-loop-arrays
@@ -40,7 +48,4 @@
 
 LOCAL_MODULE:= libjpeg
 
-LOCAL_SHARED_LIBRARIES := \
-	libcutils
-
 include $(BUILD_SHARED_LIBRARY)