From 3f0c9ede6ddd1da33ed0072646a07f36628f2d3e Mon Sep 17 00:00:00 2001 From: Tim Kilbourn Date: Thu, 19 Mar 2015 17:25:29 -0700 Subject: [PATCH] Add support for LOCAL_ARM_MODE in androidmk Uses a hack to nest it inside of an arch-arm block. Change-Id: Id36c7398e4a91fc8dd69fa7d1f78c9d30258281a --- androidmk/cmd/androidmk/android.go | 13 +++++++------ androidmk/cmd/androidmk/androidmk.go | 6 ++++++ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/androidmk/cmd/androidmk/android.go b/androidmk/cmd/androidmk/android.go index 5544dfdea..b79e821ff 100644 --- a/androidmk/cmd/androidmk/android.go +++ b/androidmk/cmd/androidmk/android.go @@ -17,12 +17,13 @@ const ( ) var stringProperties = map[string]string{ - "LOCAL_MODULE": "name", - "LOCAL_MODULE_STEM": "stem", - "LOCAL_MODULE_CLASS": "class", - "LOCAL_CXX_STL": "stl", - "LOCAL_STRIP_MODULE": "strip", - "LOCAL_MULTILIB": "compile_multilib", + "LOCAL_MODULE": "name", + "LOCAL_MODULE_STEM": "stem", + "LOCAL_MODULE_CLASS": "class", + "LOCAL_CXX_STL": "stl", + "LOCAL_STRIP_MODULE": "strip", + "LOCAL_MULTILIB": "compile_multilib", + "LOCAL_ARM_MODE_HACK": "instruction_set", } var listProperties = map[string]string{ diff --git a/androidmk/cmd/androidmk/androidmk.go b/androidmk/cmd/androidmk/androidmk.go index fd31a138d..eca597eb5 100644 --- a/androidmk/cmd/androidmk/androidmk.go +++ b/androidmk/cmd/androidmk/androidmk.go @@ -246,6 +246,12 @@ func handleAssignment(file *bpFile, assignment mkparser.Assignment, c *condition } else { if name == "LOCAL_PATH" { // Nothing to do, except maybe avoid the "./" in paths? + } else if name == "LOCAL_ARM_MODE" { + // This is a hack to get the LOCAL_ARM_MODE value inside + // of an arch: { arm: {} } block. + armModeAssign := assignment + armModeAssign.Name = mkparser.SimpleMakeString("LOCAL_ARM_MODE_HACK_arm", assignment.Name.Pos) + handleAssignment(file, armModeAssign, c) } else if strings.HasPrefix(name, "LOCAL_") { //setVariable(file, assignment, name, bpparser.String, true) switch name {