Extend multilib

Allow multilib to be set to "prefer32", which will compile as 32-bit if
available, otherwise as 64-bit.

Add target.device.compile_multilib and target.host.compile_multilib.  If
set, they override the top-level compile_multlib property.

Change-Id: If658a035b5f441547bc74526feb1d34f773776ff
diff --git a/android/module.go b/android/module.go
index 45afec1..aaaa2fb 100644
--- a/android/module.go
+++ b/android/module.go
@@ -118,7 +118,18 @@
 	// are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
 	// architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
 	// platform
-	Compile_multilib string
+	Compile_multilib string `android:"arch_variant"`
+
+	Target struct {
+		Host struct {
+			Compile_multilib string
+		}
+		Android struct {
+			Compile_multilib string
+		}
+	}
+
+	Default_multilib string `blueprint:"mutated"`
 
 	// whether this is a proprietary vendor module, and should be installed into /vendor
 	Proprietary bool
@@ -182,7 +193,7 @@
 
 	base := m.base()
 	base.commonProperties.HostOrDeviceSupported = hod
-	base.commonProperties.Compile_multilib = string(defaultMultilib)
+	base.commonProperties.Default_multilib = string(defaultMultilib)
 
 	switch hod {
 	case HostAndDeviceSupported: