summaryrefslogtreecommitdiff
path: root/src/Makefile.am
diff options
context:
space:
mode:
authorStepan Kasal <kasal@ucw.cz>2004-11-23 12:49:36 +0000
committerStepan Kasal <kasal@ucw.cz>2004-11-23 12:49:36 +0000
commitde90358fb7a0aa0097a8fd8f14920e240b983aba (patch)
tree68d9c1dc0b4a777490781284509d91a8c1899e40 /src/Makefile.am
parentebf56907343852f6cd755c64a6095d03c0fe3131 (diff)
downloadgrep-de90358fb7a0aa0097a8fd8f14920e240b983aba.tar.gz
use the path of the script
* src/Makefile.am: The egrep and fgrep script now use their own path to construct the full pathname of grep.
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 14c29685..3b4b8a48 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,6 +23,10 @@ OPTION_for_egrep = -E
OPTION_for_fgrep = -F
egrep fgrep: Makefile
- echo '#!/bin/sh' >$@
- echo 'exec grep $(OPTION_for_$@) $${1+"$$@"}' >>$@
+ (echo '#!/bin/sh'; \
+ echo 'case $$0 in' ; \
+ echo ' */*) dir=$${0%/*}/ ;;' ; \
+ echo ' *) dir="" ;;' ; \
+ echo 'esac' ; \
+ echo 'exec $${dir}grep $(OPTION_for_$@) $${1+"$$@"}' ) >$@
chmod a+x $@