diff options
author | Jörg Mayer <jmayer@loplof.de> | 2013-11-03 12:22:39 +0000 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2013-11-03 12:22:39 +0000 |
commit | 117a59d7a2998077d5e5163ce1f8d11edd220944 (patch) | |
tree | 3354cb559c02db144cb687c6c0497b7be1de9b6d /tools/runlex.sh | |
parent | 7054372c261ac92233707cfd49851b5e6213826f (diff) |
Pass the name of the sed executable as an explicit argurment to
runlex.sh (like it is done with LEX already). May fix a problem
on Windows with cmake.
svn path=/trunk/; revision=53059
Diffstat (limited to 'tools/runlex.sh')
-rwxr-xr-x | tools/runlex.sh | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/runlex.sh b/tools/runlex.sh index 266b07fd7e..1e58c50f8b 100755 --- a/tools/runlex.sh +++ b/tools/runlex.sh @@ -38,7 +38,6 @@ then fi LEX="$1" shift - # # Check whether we have it. # @@ -48,6 +47,17 @@ then exit 1 fi +SED="$1" +shift +# +# Check whether we have it. +# +if [ -z "${SED}" ] +then + echo "Sed was not found" 1>&2 + exit 1 +fi + # # Process the flags. We don't use getopt because we don't want to # embed complete knowledge of what options are supported by Lex/Flex. @@ -62,7 +72,7 @@ do # # Set the output file name. # - outfile=`echo "$1" | sed 's/-o\(.*\)/\1/'` + outfile=`echo "$1" | ${SED} 's/-o\(.*\)/\1/'` ;; -*) @@ -141,7 +151,7 @@ echo "Wrote $outfile" # line. We use the last one. # echo "Getting prefix" -prefix=`sed -n 's/%option[ ][ ]*prefix="\(.*\)".*/\1/p' "$@" | tail -1` +prefix=`${SED} -n 's/%option[ ][ ]*prefix="\(.*\)".*/\1/p' "$@" | tail -1` if [ ! -z "$prefix" ] then prefixline="#define yylex ${prefix}lex" |