diff options
author | Elliott Hughes <enh@google.com> | 2015-02-05 18:47:23 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-02-05 18:47:23 +0000 |
commit | 05d8a22c2d75e8945e372ef0bb251fabb055a3df (patch) | |
tree | 142cb4409a5002ab3548fd64bb11608a58862052 | |
parent | b936dfcdbf0e5677593e3c2758180beb2d7078fb (diff) | |
parent | 051f369a14a405dc6dbaf708dc51a21c5629bf88 (diff) | |
download | system_core-05d8a22c2d75e8945e372ef0bb251fabb055a3df.zip system_core-05d8a22c2d75e8945e372ef0bb251fabb055a3df.tar.gz system_core-05d8a22c2d75e8945e372ef0bb251fabb055a3df.tar.bz2 |
am 051f369a: Merge "Build BSD grep separately from toolbox."
* commit '051f369a14a405dc6dbaf708dc51a21c5629bf88':
Build BSD grep separately from toolbox.
-rw-r--r-- | toolbox/Android.mk | 45 | ||||
-rw-r--r-- | toolbox/upstream-netbsd/usr.bin/grep/file.c | 2 |
2 files changed, 23 insertions, 24 deletions
diff --git a/toolbox/Android.mk b/toolbox/Android.mk index a0dcac1..205fadf 100644 --- a/toolbox/Android.mk +++ b/toolbox/Android.mk @@ -7,10 +7,6 @@ common_cflags := \ -I$(LOCAL_PATH)/upstream-netbsd/include/ \ -include bsd-compatibility.h \ -# Temporary, remove after cleanup. b/18632512 -common_cflags += -Wno-unused-variable \ - -Wno-unused-but-set-variable - include $(CLEAR_VARS) LOCAL_SRC_FILES := \ @@ -19,7 +15,12 @@ LOCAL_SRC_FILES := \ 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/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_MODULE := libtoolbox_dd LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk @@ -32,25 +33,12 @@ LOCAL_MODULE := libtoolbox_du LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk include $(BUILD_STATIC_LIBRARY) -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) -Dmain=grep_main -LOCAL_MODULE := libtoolbox_grep -LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk -include $(BUILD_STATIC_LIBRARY) - include $(CLEAR_VARS) BSD_TOOLS := \ dd \ du \ - grep \ OUR_TOOLS := \ df \ @@ -90,14 +78,9 @@ OUR_TOOLS := \ ALL_TOOLS = $(BSD_TOOLS) $(OUR_TOOLS) LOCAL_SRC_FILES := \ - 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 \ dynarray.c \ - $(patsubst %,%.c,$(OUR_TOOLS)) \ toolbox.c \ + $(patsubst %,%.c,$(OUR_TOOLS)) \ LOCAL_CFLAGS += $(common_cflags) @@ -135,3 +118,17 @@ LOCAL_MODULE := r LOCAL_MODULE_TAGS := debug LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk include $(BUILD_EXECUTABLE) + + +# 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_MODULE := grep +LOCAL_POST_INSTALL_CMD := $(hide) $(foreach t,egrep fgrep,ln -sf grep $(TARGET_OUT)/bin/$(t);) +include $(BUILD_EXECUTABLE) diff --git a/toolbox/upstream-netbsd/usr.bin/grep/file.c b/toolbox/upstream-netbsd/usr.bin/grep/file.c index da03d71..cf4a0fa 100644 --- a/toolbox/upstream-netbsd/usr.bin/grep/file.c +++ b/toolbox/upstream-netbsd/usr.bin/grep/file.c @@ -78,7 +78,9 @@ static inline int grep_refill(struct file *f) { ssize_t nr; +#ifndef __ANDROID__ int bzerr; +#endif bufpos = buffer; bufrem = 0; |