Merge "libtoolbox_dd / grep: Android.mk -> bp" am: 2306272142 am: c33edda9c4 am: 44c5363f81

am: bb2dd7cb87

Change-Id: I2757c49330ac75055428666b4c905dbe530e2bb3
This commit is contained in:
Yifan Hong 2017-05-23 02:55:48 +00:00 committed by android-build-merger
commit 87c95ac5bd
2 changed files with 44 additions and 36 deletions

44
toolbox/Android.bp Normal file
View file

@ -0,0 +1,44 @@
common_cflags = [
"-Werror",
"-Wno-unused-parameter",
"-Wno-unused-const-variable",
"-include bsd-compatibility.h"
]
cc_library_static {
srcs: [
"upstream-netbsd/bin/dd/args.c",
"upstream-netbsd/bin/dd/conv.c",
"upstream-netbsd/bin/dd/dd.c",
"upstream-netbsd/bin/dd/dd_hostops.c",
"upstream-netbsd/bin/dd/misc.c",
"upstream-netbsd/bin/dd/position.c",
"upstream-netbsd/lib/libc/gen/getbsize.c",
"upstream-netbsd/lib/libc/gen/humanize_number.c",
"upstream-netbsd/lib/libc/stdlib/strsuftoll.c",
"upstream-netbsd/lib/libc/string/swab.c",
"upstream-netbsd/lib/libutil/raise_default_signal.c",
],
cflags: common_cflags + [
"-Dmain=dd_main",
"-DNO_CONV",
],
local_include_dirs: ["upstream-netbsd/include/"],
name: "libtoolbox_dd",
}
// We build BSD grep separately, so it can provide egrep and fgrep too.
cc_binary {
name: "grep",
srcs: [
"upstream-netbsd/usr.bin/grep/fastgrep.c",
"upstream-netbsd/usr.bin/grep/file.c",
"upstream-netbsd/usr.bin/grep/grep.c",
"upstream-netbsd/usr.bin/grep/queue.c",
"upstream-netbsd/usr.bin/grep/util.c",
],
cflags: common_cflags,
local_include_dirs: ["upstream-netbsd/include/"],
symlinks: ["egrep", "fgrep"],
}

View file

@ -1,30 +1,9 @@
LOCAL_PATH:= $(call my-dir)
common_cflags := \
-Werror -Wno-unused-parameter -Wno-unused-const-variable \
-include bsd-compatibility.h \
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
upstream-netbsd/bin/dd/args.c \
upstream-netbsd/bin/dd/conv.c \
upstream-netbsd/bin/dd/dd.c \
upstream-netbsd/bin/dd/dd_hostops.c \
upstream-netbsd/bin/dd/misc.c \
upstream-netbsd/bin/dd/position.c \
upstream-netbsd/lib/libc/gen/getbsize.c \
upstream-netbsd/lib/libc/gen/humanize_number.c \
upstream-netbsd/lib/libc/stdlib/strsuftoll.c \
upstream-netbsd/lib/libc/string/swab.c \
upstream-netbsd/lib/libutil/raise_default_signal.c
LOCAL_CFLAGS += $(common_cflags) -Dmain=dd_main -DNO_CONV
LOCAL_C_INCLUDES += $(LOCAL_PATH)/upstream-netbsd/include/
LOCAL_MODULE := libtoolbox_dd
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
BSD_TOOLS := \
@ -80,18 +59,3 @@ $(INPUT_H_LABELS_H): PRIVATE_CUSTOM_TOOL = $(PRIVATE_LOCAL_PATH)/generate-input.
$(INPUT_H_LABELS_H): $(LOCAL_PATH)/Android.mk $(LOCAL_PATH)/generate-input.h-labels.py $(UAPI_INPUT_EVENT_CODES_H)
$(INPUT_H_LABELS_H):
$(transform-generated-source)
# We build BSD grep separately, so it can provide egrep and fgrep too.
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
upstream-netbsd/usr.bin/grep/fastgrep.c \
upstream-netbsd/usr.bin/grep/file.c \
upstream-netbsd/usr.bin/grep/grep.c \
upstream-netbsd/usr.bin/grep/queue.c \
upstream-netbsd/usr.bin/grep/util.c
LOCAL_CFLAGS += $(common_cflags)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/upstream-netbsd/include/
LOCAL_MODULE := grep
LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,egrep fgrep,ln -sf grep $(TARGET_OUT)/bin/$(t);)
include $(BUILD_EXECUTABLE)