aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Blandy1993-05-29 20:07:50 +0000
committerJim Blandy1993-05-29 20:07:50 +0000
commit3517b2e9e10ae252f8563b483cfebe0bcdfd5da6 (patch)
tree78bd710ddf97e865da569789087844a0b846fa0c
parentafb89aea69a969185068fd5dba327b9808fa08c2 (diff)
downloademacs-3517b2e9e10ae252f8563b483cfebe0bcdfd5da6.tar.gz
emacs-3517b2e9e10ae252f8563b483cfebe0bcdfd5da6.zip
* configure.in: Traverse the argument list without destroying it;
don't use shift. It turns out that "set - ${saved_arguments}" doesn't work portably.
-rwxr-xr-xconfigure1.in39
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=''
100prefix='/usr/local' 100prefix='/usr/local'
101exec_prefix='${prefix}' 101exec_prefix='${prefix}'
102 102
103while [ $# != 0 ]; do 103### Don't use shift -- that destroys the argument list, which autoconf needs
104 arg="$1" 104### to produce config.status. It turns out that "set - ${arguments}" doesn't
105### work portably.
106index=0
107while [ $index -lt $# ]; do
108 index=`expr $index + 1`
109 arg=`eval echo '$'$index`
105 case "${arg}" in 110 case "${arg}" in
106 111
107 ## Anything starting with a hyphen we assume is an option. 112 ## Anything starting with a hyphen we assume is an option.
@@ -168,13 +173,14 @@ Set it to either \`yes' or \`no'."
168 ## If the value was omitted, get it from the next argument. 173 ## If the value was omitted, get it from the next argument.
169 if [ "${valomitted}" = "yes" ]; then 174 if [ "${valomitted}" = "yes" ]; then
170 ## Get the next argument from the argument list, if there is one. 175 ## Get the next argument from the argument list, if there is one.
171 if [ $# = 1 ]; then 176 if [ $index = $# ]; then
172 (echo "${progname}: You must give a value for the \`--${optname}' option, as in 177 (echo "${progname}: You must give a value for the \`--${optname}' option, as in
173 \`--${optname}=FOO'." 178 \`--${optname}=FOO'."
174 echo "${short_usage}") >&2 179 echo "${short_usage}") >&2
175 exit 1 180 exit 1
176 fi 181 fi
177 shift; val="$1" 182 index=`expr $index + 1`
183 val=`eval echo '$'$index`
178 fi 184 fi
179 srcdir="${val}" 185 srcdir="${val}"
180 ;; 186 ;;
@@ -187,13 +193,14 @@ Set it to either \`yes' or \`no'."
187 ## If the value was omitted, get it from the next argument. 193 ## If the value was omitted, get it from the next argument.
188 if [ "${valomitted}" = "yes" ]; then 194 if [ "${valomitted}" = "yes" ]; then
189 ## Get the next argument from the argument list, if there is one. 195 ## Get the next argument from the argument list, if there is one.
190 if [ $# = 1 ]; then 196 if [ $index = $# ]; then
191 (echo "${progname}: You must give a value for the \`--${optname}' option, as in 197 (echo "${progname}: You must give a value for the \`--${optname}' option, as in
192 \`--${optname}=FOO'." 198 \`--${optname}=FOO'."
193 echo "${short_usage}") >&2 199 echo "${short_usage}") >&2
194 exit 1 200 exit 1
195 fi 201 fi
196 shift; val="$1" 202 index=`expr $index + 1`
203 val=`eval echo '$'$index`
197 fi 204 fi
198 x_includes="${val}" 205 x_includes="${val}"
199 C_SWITCH_X_SITE="-I${x_includes}" 206 C_SWITCH_X_SITE="-I${x_includes}"
@@ -202,13 +209,14 @@ Set it to either \`yes' or \`no'."
202 ## If the value was omitted, get it from the next argument. 209 ## If the value was omitted, get it from the next argument.
203 if [ "${valomitted}" = "yes" ]; then 210 if [ "${valomitted}" = "yes" ]; then
204 ## Get the next argument from the argument list, if there is one. 211 ## Get the next argument from the argument list, if there is one.
205 if [ $# = 1 ]; then 212 if [ $index = $# ]; then
206 (echo "${progname}: You must give a value for the \`--${optname}' option, as in 213 (echo "${progname}: You must give a value for the \`--${optname}' option, as in
207 \`--${optname}=FOO'." 214 \`--${optname}=FOO'."
208 echo "${short_usage}") >&2 215 echo "${short_usage}") >&2
209 exit 1 216 exit 1
210 fi 217 fi
211 shift; val="$1" 218 index=`expr $index + 1`
219 val=`eval echo '$'$index`
212 fi 220 fi
213 x_libraries="${val}" 221 x_libraries="${val}"
214 LD_SWITCH_X_SITE="-L${x_libraries}" 222 LD_SWITCH_X_SITE="-L${x_libraries}"
@@ -225,13 +233,14 @@ Set it to either \`yes' or \`no'."
225 ## If the value was omitted, get it from the next argument. 233 ## If the value was omitted, get it from the next argument.
226 if [ "${valomitted}" = "yes" ]; then 234 if [ "${valomitted}" = "yes" ]; then
227 ## Get the next argument from the argument list, if there is one. 235 ## Get the next argument from the argument list, if there is one.
228 if [ $# = 1 ]; then 236 if [ $index = $# ]; then
229 (echo "${progname}: You must give a value for the \`--${optname}' option, as in 237 (echo "${progname}: You must give a value for the \`--${optname}' option, as in
230 \`--${optname}=FOO'." 238 \`--${optname}=FOO'."
231 echo "${short_usage}") >&2 239 echo "${short_usage}") >&2
232 exit 1 240 exit 1
233 fi 241 fi
234 shift; val="$1" 242 index=`expr $index + 1`
243 val=`eval echo '$'$index`
235 fi 244 fi
236 prefix="${val}" 245 prefix="${val}"
237 ;; 246 ;;
@@ -241,13 +250,14 @@ Set it to either \`yes' or \`no'."
241 ## If the value was omitted, get it from the next argument. 250 ## If the value was omitted, get it from the next argument.
242 if [ "${valomitted}" = "yes" ]; then 251 if [ "${valomitted}" = "yes" ]; then
243 ## Get the next argument from the argument list, if there is one. 252 ## Get the next argument from the argument list, if there is one.
244 if [ $# = 1 ]; then 253 if [ $index = $# ]; then
245 (echo "${progname}: You must give a value for the \`--${optname}' option, as in 254 (echo "${progname}: You must give a value for the \`--${optname}' option, as in
246 \`--${optname}=FOO'." 255 \`--${optname}=FOO'."
247 echo "${short_usage}") >&2 256 echo "${short_usage}") >&2
248 exit 1 257 exit 1
249 fi 258 fi
250 shift; val="$1" 259 index=`expr $index + 1`
260 val=`eval echo '$'$index`
251 fi 261 fi
252 exec_prefix="${val}" 262 exec_prefix="${val}"
253 ;; 263 ;;
@@ -269,7 +279,6 @@ Set it to either \`yes' or \`no'."
269 ;; 279 ;;
270 280
271 esac 281 esac
272 shift
273done 282done
274 283
275if [ "${configuration}" = "" ]; then 284if [ "${configuration}" = "" ]; then
@@ -1148,9 +1157,5 @@ Configured for \`${configuration}'.
1148 Where do we find X Windows libraries? }${x_libraries} 1157 Where do we find X Windows libraries? }${x_libraries}
1149 1158
1150" 1159"
1151
1152### Restore the arguments to this script, so autoconf can record them
1153### in the config.status file.
1154set -- ${arguments}
1155] 1160]
1156AC_OUTPUT(Makefile) 1161AC_OUTPUT(Makefile)