Mercurial > emacs
comparison configure1.in @ 3262:4ece9a6d1f37
* configure.in: Traverse the argument list without destroying it;
don't use shift. It turns out that "set - ${saved_arguments}"
doesn't work portably.
author | Jim Blandy <jimb@redhat.com> |
---|---|
date | Sat, 29 May 1993 20:07:50 +0000 |
parents | de18f95a692c |
children | eff921d7bde6 |
comparison
equal
deleted
inserted
replaced
3261:50b8f8d5f932 | 3262:4ece9a6d1f37 |
---|---|
98 | 98 |
99 ### Establish some default values. | 99 ### Establish some default values. |
100 prefix='/usr/local' | 100 prefix='/usr/local' |
101 exec_prefix='${prefix}' | 101 exec_prefix='${prefix}' |
102 | 102 |
103 while [ $# != 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. | |
106 index=0 | |
107 while [ $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. |
108 -* ) | 113 -* ) |
109 | 114 |
166 ## Has the user specified a source directory? | 171 ## Has the user specified a source directory? |
167 "srcdir" ) | 172 "srcdir" ) |
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 ;; |
181 | 187 |
182 ## Has the user tried to tell us where the X files are? | 188 ## Has the user tried to tell us where the X files are? |
185 ## installed in odd places. | 191 ## installed in odd places. |
186 "x_includes" ) | 192 "x_includes" ) |
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}" |
200 ;; | 207 ;; |
201 "x_libraries" ) | 208 "x_libraries" ) |
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}" |
215 ;; | 223 ;; |
216 | 224 |
223 ## Has the user specifiec an installation prefix? | 231 ## Has the user specifiec an installation prefix? |
224 "prefix" ) | 232 "prefix" ) |
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 ;; |
238 | 247 |
239 ## Has the user specifiec an installation prefix? | 248 ## Has the user specifiec an installation prefix? |
240 "exec_prefix" ) | 249 "exec_prefix" ) |
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 ;; |
254 | 264 |
255 ## Has the user asked for some help? | 265 ## Has the user asked for some help? |
267 *) | 277 *) |
268 configuration=${arg} | 278 configuration=${arg} |
269 ;; | 279 ;; |
270 | 280 |
271 esac | 281 esac |
272 shift | |
273 done | 282 done |
274 | 283 |
275 if [ "${configuration}" = "" ]; then | 284 if [ "${configuration}" = "" ]; then |
276 echo '- You did not tell me what kind of host system you want to configure. | 285 echo '- You did not tell me what kind of host system you want to configure. |
277 - I will attempt to guess the kind of system this is.' 1>&2 | 286 - I will attempt to guess the kind of system this is.' 1>&2 |
1146 What window system should Emacs use? ${window_system}${x_includes+ | 1155 What window system should Emacs use? ${window_system}${x_includes+ |
1147 Where do we find X Windows header files? }${x_includes}${x_libraries+ | 1156 Where do we find X Windows header files? }${x_includes}${x_libraries+ |
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. | |
1154 set -- ${arguments} | |
1155 ] | 1160 ] |
1156 AC_OUTPUT(Makefile) | 1161 AC_OUTPUT(Makefile) |