summaryrefslogtreecommitdiff
path: root/src/options/mkoptions
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2012-10-24 22:24:34 +0000
committerMorgan Deters <mdeters@gmail.com>2012-10-24 22:24:34 +0000
commit9c6f99513f27404fdd596217f3a438aee155851e (patch)
treed0da998e9f7fc72141a0db6ab3af18962afa1c3c /src/options/mkoptions
parenta6ac7fefed613c4d83e577361f98c28a8e18f3a9 (diff)
Includes many fixes to build system for Solaris (thanks Tim!), and also
just in general, and some documentation adjustments.
Diffstat (limited to 'src/options/mkoptions')
-rwxr-xr-xsrc/options/mkoptions32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/options/mkoptions b/src/options/mkoptions
index 9ef05c1b2..0632cb3f9 100755
--- a/src/options/mkoptions
+++ b/src/options/mkoptions
@@ -253,7 +253,7 @@ function handle_option {
# scan ahead to see where the type is
type_pos=2
- while [ $(($type_pos+1)) -lt ${#args[@]} ] && ! expr "${args[$(($type_pos+1))]}" : ":" &>/dev/null; do
+ while [ $(($type_pos+1)) -lt ${#args[@]} ] && ! expr "${args[$(($type_pos+1))]}" : '\:' &>/dev/null; do
let ++type_pos
done
@@ -270,13 +270,13 @@ function handle_option {
else
i=2
while [ $i -lt $type_pos ]; do
- if expr "${args[$i]}" : '--' &>/dev/null || expr "${args[$i]}" : '/--' &>/dev/null; then
+ if expr "${args[$i]}" : '\--' &>/dev/null || expr "${args[$i]}" : '/--' &>/dev/null; then
if [ -n "$long_option" -o -n "$long_option_alternate" ]; then
ERR "malformed option line for \`$internal': unexpected \`${args[$i]}'"
fi
long_option="$(echo "${args[$i]}" | sed 's,/.*,,')"
if [ -n "$long_option" ]; then
- if ! expr "$long_option" : '--.' &>/dev/null; then
+ if ! expr "$long_option" : '\--.' &>/dev/null; then
ERR "bad long option \`$long_option': expected something like \`--foo'"
fi
long_option="$(echo "$long_option" | sed 's,^--,,')"
@@ -285,27 +285,27 @@ function handle_option {
long_option_alternate="$(echo "${args[$i]}" | sed 's,[^/]*/,,')"
long_option_alternate_set=set
if [ -n "$long_option_alternate" ]; then
- if ! expr "$long_option_alternate" : '--.' &>/dev/null; then
+ if ! expr "$long_option_alternate" : '\--.' &>/dev/null; then
ERR "bad alternate long option \`$long_option_alternate': expected something like \`--foo'"
fi
long_option_alternate="$(echo "$long_option_alternate" | sed 's,^--,,')"
fi
fi
- elif expr "${args[$i]}" : '-' &>/dev/null || expr "${args[$i]}" : '/-' &>/dev/null; then
+ elif expr "${args[$i]}" : '\-' &>/dev/null || expr "${args[$i]}" : '/-' &>/dev/null; then
if [ -n "$short_option" -o -n "$short_option_alternate" -o -n "$long_option" -o -n "$long_option_alternate" ]; then
ERR "malformed option line for \`$internal': unexpected \`${args[$i]}'"
fi
short_option="$(echo "${args[$i]}" | sed 's,/.*,,')"
if [ -n "$short_option" ]; then
- if ! expr "$short_option" : '-.$' &>/dev/null; then
+ if ! expr "$short_option" : '\-.$' &>/dev/null; then
ERR "bad short option \`$short_option': expected something like \`-x'"
fi
short_option="$(echo "$short_option" | sed 's,^-,,')"
fi
if expr "${args[$i]}" : '.*/' &>/dev/null; then
short_option_alternate="$(echo "${args[$i]}" | sed 's,[^/]*/,,')"
- if expr "$short_option_alternate" : - &>/dev/null; then
- if ! expr "$short_option_alternate" : '-.$' &>/dev/null; then
+ if expr "$short_option_alternate" : '\-' &>/dev/null; then
+ if ! expr "$short_option_alternate" : '\-.$' &>/dev/null; then
ERR "bad alternate short option \`$short_option_alternate': expected something like \`-x'"
fi
short_option_alternate="$(echo "$short_option_alternate" | sed 's,^-,,')"
@@ -396,13 +396,13 @@ function handle_option {
handlers="${args[$i]}"
;;
:predicate)
- while [ $(($i+1)) -lt ${#args[@]} ] && ! expr "${args[$(($i+1))]}" : ":" &>/dev/null; do
+ while [ $(($i+1)) -lt ${#args[@]} ] && ! expr "${args[$(($i+1))]}" : '\:' &>/dev/null; do
let ++i
predicates="${predicates} ${args[$i]}"
done
;;
:link)
- while [ $(($i+1)) -lt ${#args[@]} ] && ! expr "${args[$(($i+1))]}" : ":" &>/dev/null; do
+ while [ $(($i+1)) -lt ${#args[@]} ] && ! expr "${args[$(($i+1))]}" : '\:' &>/dev/null; do
let ++i
link="${args[$i]}"
if expr "${args[$i]}" : '.*/' &>/dev/null; then
@@ -415,7 +415,7 @@ function handle_option {
done
;;
:include)
- while [ $(($i+1)) -lt ${#args[@]} ] && ! expr "${args[$(($i+1))]}" : ":" &>/dev/null; do
+ while [ $(($i+1)) -lt ${#args[@]} ] && ! expr "${args[$(($i+1))]}" : '\:' &>/dev/null; do
let ++i
module_includes="${module_includes}
#line $lineno \"$kf\"
@@ -423,7 +423,7 @@ function handle_option {
done
;;
:handler-include|:predicate-include)
- while [ $(($i+1)) -lt ${#args[@]} ] && ! expr "${args[$(($i+1))]}" : ":" &>/dev/null; do
+ while [ $(($i+1)) -lt ${#args[@]} ] && ! expr "${args[$(($i+1))]}" : '\:' &>/dev/null; do
let ++i
option_handler_includes="${option_handler_includes}
#line $lineno \"$kf\"
@@ -831,10 +831,10 @@ function handle_alias {
ERR "malformed \"alias\" command; expected more arguments"
fi
cases=
- if ! expr "$option" : - &>/dev/null; then
+ if ! expr "$option" : '\-' &>/dev/null; then
ERR "alias for SMT options not yet supported"
fi
- if expr "$option" : -- &>/dev/null; then
+ if expr "$option" : '\--' &>/dev/null; then
if expr "$option" : '.*=' &>/dev/null; then
expect_arg_long=required_argument
arg="$(echo "$option" | sed 's,[^=]*=\(.*\),\1,')"
@@ -851,8 +851,8 @@ function handle_alias {
let ++n_long
long_option="${long_option:+$long_option | --}$option"
else
- if ! expr "$option" : '-.$' &>/dev/null; then
- if ! expr "$option" : '-.=' &>/dev/null; then
+ if ! expr "$option" : '\-.$' &>/dev/null; then
+ if ! expr "$option" : '\-.=' &>/dev/null; then
ERR "expected short option specification, got \`$option'"
fi
expect_arg=:
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback