diff options
author | Junio C Hamano <junkio@cox.net> | 2006-05-17 02:48:13 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-05-17 02:48:13 -0700 |
commit | 518920b764ee9150781e68217181b24d0712748e (patch) | |
tree | 55d06665f6d346b608c60c1229b27c9995cd35be /Makefile | |
parent | Remove old "git-grep.sh" remnants (diff) | |
download | tgif-518920b764ee9150781e68217181b24d0712748e.tar.xz |
builtin-grep: workaround for non GNU grep.
Some implementations do not know what to do with -H; define
NO_H_OPTION_IN_GREP when you build git if your grep lacks -H.
Most of the time, it can be worked around by prepending
/dev/null to the argument list, but that causes -L and -c to
slightly misbehave (they both expose /dev/null is given), so
when these options are given, do not run external grep that does
not understand -H.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -46,6 +46,8 @@ all: # # Define NO_MMAP if you want to avoid mmap. # +# Define NO_H_OPTION_IN_GREP if your grep does not understand -H. +# # Define WITH_OWN_SUBPROCESS_PY if you want to use with python 2.3. # # Define NO_IPV6 if you lack IPv6 support and getaddrinfo(). @@ -444,6 +446,12 @@ ifdef NO_ACCURATE_DIFF ALL_CFLAGS += -DNO_ACCURATE_DIFF endif +ifdef NO_H_OPTION_IN_GREP + NO_H_OPTION_IN_GREP=1 +else + NO_H_OPTION_IN_GREP=0 +endif + # Shell quote (do not use $(call) to accomodate ancient setups); SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER)) @@ -526,6 +534,9 @@ git$X git.spec \ %.o: %.S $(CC) -o $*.o -c $(ALL_CFLAGS) $< +builtin-grep.o: builtin-grep.c + $(CC) -o $*.o -c $(ALL_CFLAGS) -DNO_H_OPTION_IN_GREP=$(NO_H_OPTION_IN_GREP) $< + exec_cmd.o: exec_cmd.c $(CC) -o $*.o -c $(ALL_CFLAGS) '-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' $< |