Switch some build tools to Soong

In preparation for including them in prebuilts/build-tools.

acp: We use a prebuilt in prebuilts/sdk, but it's not part of the sdk.

ijar: We use the host libstdc++ to workaround the lack of libc++ on
some unbundled branches.

ziptime: We disable this on unbundled builds, due to the lack of libc++.

Change-Id: Ib9766b1dbddd151c38ff27c529865200ab37fce1
This commit is contained in:
Dan Willemsen 2016-06-06 14:41:32 -07:00
parent 7353eabd14
commit 56eb2f9f54
8 changed files with 89 additions and 82 deletions

20
libs/host/Android.bp Normal file
View File

@ -0,0 +1,20 @@
cc_library_host_static {
srcs: ["CopyFile.c"],
cflags: [
"-Werror",
"-Wall",
],
name: "libhost",
target: {
windows: {
enabled: true,
},
},
local_include_dirs: ["include"],
export_include_dirs: ["include"],
stl: "none",
}

View File

@ -1,18 +0,0 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= \
CopyFile.c
LOCAL_CFLAGS := -Werror -Wall
LOCAL_MODULE:= libhost
LOCAL_MODULE_HOST_OS := darwin linux windows
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
LOCAL_CXX_STL := none
include $(BUILD_HOST_STATIC_LIBRARY)
# Include toolchain prebuilt modules if they exist.
-include $(TARGET_TOOLCHAIN_ROOT)/toolchain.mk

13
tools/acp/Android.bp Normal file
View File

@ -0,0 +1,13 @@
// Copyright 2005 The Android Open Source Project
//
// Custom version of cp.
cc_binary_host {
srcs: ["acp.c"],
static_libs: ["libhost"],
name: "acp",
stl: "none",
}

View File

@ -1,16 +0,0 @@
# Copyright 2005 The Android Open Source Project
#
# Custom version of cp.
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
acp.c
LOCAL_STATIC_LIBRARIES := libhost
LOCAL_MODULE := acp
LOCAL_CXX_STL := none
include $(BUILD_HOST_EXECUTABLE)

20
tools/ijar/Android.bp Normal file
View File

@ -0,0 +1,20 @@
// Copyright 2015 The Android Open Source Project
//
// The rest of files in this directory comes from
// https://github.com/bazelbuild/bazel/tree/master/third_party/ijar
cc_binary_host {
srcs: [
"classfile.cc",
"ijar.cc",
"zip.cc",
],
cflags: [
"-Wall",
"-Werror",
],
host_ldlibs: ["-lz"],
name: "ijar",
// libc++ is not supported for TARGET_BUILD_APPS builds
stl: "libstdc++",
}

View File

@ -1,16 +0,0 @@
# Copyright 2015 The Android Open Source Project
#
# The rest of files in this directory comes from
# https://github.com/bazelbuild/bazel/tree/master/third_party/ijar
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_CPP_EXTENSION := .cc
LOCAL_SRC_FILES := classfile.cc ijar.cc zip.cc
LOCAL_CFLAGS += -Wall -Werror
LOCAL_SHARED_LIBRARIES := libz-host
LOCAL_MODULE := ijar
# libc++ is not supported for TARGET_BUILD_APPS builds
LOCAL_CXX_STL := libstdc++
include $(BUILD_HOST_EXECUTABLE)

36
tools/ziptime/Android.bp Normal file
View File

@ -0,0 +1,36 @@
//
// Copyright 2015 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//
// Zip timestamp removal tool
//
cc_binary_host {
srcs: [
"ZipTime.cpp",
"ZipEntry.cpp",
"ZipFile.cpp",
],
name: "ziptime",
target: {
windows: {
enabled: true,
},
},
}

View File

@ -1,32 +0,0 @@
#
# Copyright 2015 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Zip timestamp removal tool
#
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
ZipTime.cpp \
ZipEntry.cpp \
ZipFile.cpp
LOCAL_MODULE := ziptime
LOCAL_MODULE_HOST_OS := darwin linux windows
include $(BUILD_HOST_EXECUTABLE)