Add build guards for libmincrypt target

This introduces a build variable that lets us control whether mincrypt
will build from system/core or from the new external/libmincrypt
repository. Once both locations are prepared, we'll switch the
variable to build mincrypt from the new location and afterwards remove
the conditionals.

BUG: 27287913
Change-Id: I8360b9f296c8404b6352dc447faabaf31d6ffc9a
diff --git a/Android.mk b/Android.mk
index 09fbbb1..2d3e44c 100644
--- a/Android.mk
+++ b/Android.mk
@@ -2,6 +2,16 @@
 #
 LOCAL_PATH := $(call my-dir)
 
+# Determine whether to build mincrypt from system/core or from
+# external/libmincrypt. The mincrypt source is temporarily present in both
+# locations during the process of moving mincrypt to external/libmincrypt.
+# TODO(mnissler): Remove this after the transition is complete.
+ifndef MINCRYPT_STANDALONE
+MINCRYPT_STANDALONE := true
+endif
+
+ifeq ($(MINCRYPT_STANDALONE),true)
+
 include $(CLEAR_VARS)
 LOCAL_MODULE := libmincrypt
 LOCAL_SRC_FILES := dsa_sig.c p256.c p256_ec.c p256_ecdsa.c rsa.c sha.c sha256.c
@@ -15,3 +25,5 @@
 include $(BUILD_HOST_STATIC_LIBRARY)
 
 include $(LOCAL_PATH)/test/Android.mk
+
+endif  # MINCRYPT_STANDALONE == true