diff options
author | Jim Blandy <jimb@redhat.com> | 1993-05-29 20:07:50 +0000 |
---|---|---|
committer | Jim Blandy <jimb@redhat.com> | 1993-05-29 20:07:50 +0000 |
commit | b91fb0a24f213821a972e7bdcc535e7ff8c3dd15 (patch) | |
tree | 01222c842a84403d8544bd9b8ea7722ee4a784b1 /configure1.in | |
parent | b3cffe673a312a4a0e0524d4eee44d87c6ae2ba4 (diff) | |
download | emacs-b91fb0a24f213821a972e7bdcc535e7ff8c3dd15.tar.gz |
* configure.in: Traverse the argument list without destroying it;
don't use shift. It turns out that "set - ${saved_arguments}"
doesn't work portably.
Diffstat (limited to 'configure1.in')
-rwxr-xr-x | configure1.in | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/configure1.in b/configure1.in index e248431b68c..6c23a7724c9 100755 --- a/configure1.in +++ b/configure1.in @@ -100,8 +100,13 @@ inst_paths='' prefix='/usr/local' exec_prefix='${prefix}' -while [ $# != 0 ]; do - arg="$1" +### Don't use shift -- that destroys the argument list, which autoconf needs +### to produce config.status. It turns out that "set - ${arguments}" doesn't +### work portably. +index=0 +while [ $index -lt $# ]; do + index=`expr $index + 1` + arg=`eval echo '$'$index` case "${arg}" in ## Anything starting with a hyphen we assume is an option. @@ -168,13 +173,14 @@ Set it to either \`yes' or \`no'." ## If the value was omitted, get it from the next argument. if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. - if [ $# = 1 ]; then + if [ $index = $# ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in \`--${optname}=FOO'." echo "${short_usage}") >&2 exit 1 fi - shift; val="$1" + index=`expr $index + 1` + val=`eval echo '$'$index` fi srcdir="${val}" ;; @@ -187,13 +193,14 @@ Set it to either \`yes' or \`no'." ## If the value was omitted, get it from the next argument. if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. - if [ $# = 1 ]; then + if [ $index = $# ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in \`--${optname}=FOO'." echo "${short_usage}") >&2 exit 1 fi - shift; val="$1" + index=`expr $index + 1` + val=`eval echo '$'$index` fi x_includes="${val}" C_SWITCH_X_SITE="-I${x_includes}" @@ -202,13 +209,14 @@ Set it to either \`yes' or \`no'." ## If the value was omitted, get it from the next argument. if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. - if [ $# = 1 ]; then + if [ $index = $# ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in \`--${optname}=FOO'." echo "${short_usage}") >&2 exit 1 fi - shift; val="$1" + index=`expr $index + 1` + val=`eval echo '$'$index` fi x_libraries="${val}" LD_SWITCH_X_SITE="-L${x_libraries}" @@ -225,13 +233,14 @@ Set it to either \`yes' or \`no'." ## If the value was omitted, get it from the next argument. if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. - if [ $# = 1 ]; then + if [ $index = $# ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in \`--${optname}=FOO'." echo "${short_usage}") >&2 exit 1 fi - shift; val="$1" + index=`expr $index + 1` + val=`eval echo '$'$index` fi prefix="${val}" ;; @@ -241,13 +250,14 @@ Set it to either \`yes' or \`no'." ## If the value was omitted, get it from the next argument. if [ "${valomitted}" = "yes" ]; then ## Get the next argument from the argument list, if there is one. - if [ $# = 1 ]; then + if [ $index = $# ]; then (echo "${progname}: You must give a value for the \`--${optname}' option, as in \`--${optname}=FOO'." echo "${short_usage}") >&2 exit 1 fi - shift; val="$1" + index=`expr $index + 1` + val=`eval echo '$'$index` fi exec_prefix="${val}" ;; @@ -269,7 +279,6 @@ Set it to either \`yes' or \`no'." ;; esac - shift done if [ "${configuration}" = "" ]; then @@ -1148,9 +1157,5 @@ Configured for \`${configuration}'. Where do we find X Windows libraries? }${x_libraries} " - -### Restore the arguments to this script, so autoconf can record them -### in the config.status file. -set -- ${arguments} ] AC_OUTPUT(Makefile) |