Generate NDK sysroots from the platform build.

The list of migrated libraries is currently empty. Libraries will be
migrated as follow up patches.

Test: Migrated libc to this system and everything still builds.
      build.ninja shows libraries being built and used and headers are
      collected for the sysroot.
Bug: http://b/27533932
Change-Id: Iaba00543c1390f432befe0eed768ed3fbb8a9b96
This commit is contained in:
Dan Albert
2016-06-17 16:45:24 -07:00
parent fb8f9a800e
commit 914449fca8
9 changed files with 1129 additions and 17 deletions

View File

@@ -18,6 +18,7 @@ import (
"fmt"
"io"
"path/filepath"
"strconv"
"strings"
"android/soong/android"
@@ -183,3 +184,22 @@ func (installer *baseInstaller) AndroidMk(ctx AndroidMkContext, ret *android.And
return nil
})
}
func (c *stubCompiler) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
ret.SubName = "." + strconv.Itoa(c.properties.ApiLevel)
}
func (installer *stubInstaller) AndroidMk(ctx AndroidMkContext, ret *android.AndroidMkData) {
ret.Extra = append(ret.Extra, func(w io.Writer, outputFile android.Path) error {
path, file := filepath.Split(installer.installPath)
stem := strings.TrimSuffix(file, filepath.Ext(file))
fmt.Fprintln(w, "LOCAL_MODULE_PATH := "+path)
fmt.Fprintln(w, "LOCAL_MODULE_STEM := "+stem)
// Prevent make from installing the libraries to obj/lib (since we have
// dozens of libraries with the same name, they'll clobber each other
// and the real versions of the libraries from the platform).
fmt.Fprintln(w, "LOCAL_COPY_TO_INTERMEDIATE_LIBRARIES := false")
return nil
})
}