Commit | Line | Data |
---|---|---|
2304df62 AD |
1 | #! /bin/sh |
2 | # | |
3 | # If these # comments don't work, trim them. Don't worry about any other | |
4 | # shell scripts, Configure will trim # comments from them for you. | |
5 | # | |
6 | # (If you are trying to port this package to a machine without sh, | |
7 | # I would suggest you have a look at the prototypical config_h.SH file | |
8 | # and edit it to reflect your system. Some packages may include samples | |
9 | # of config.h for certain machines, so you might look for one of those.) | |
10 | # | |
11 | # Yes, you may rip this off to use in other distribution packages. This | |
12 | # script belongs to the public domain and cannot be copyrighted. | |
13 | # | |
14 | # (Note: this Configure script was generated automatically. Rather than | |
15 | # working with this copy of Configure, you may wish to get metaconfig. | |
16 | # The dist-3.0 package (which contains metaconfig) was posted in | |
dfe9444c AD |
17 | # comp.sources.misc and is available on CPAN under authors/id/RAM so |
18 | # you may fetch it yourself from your nearest archive site.) | |
2304df62 AD |
19 | # |
20 | ||
dfe9444c | 21 | # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ |
2304df62 | 22 | # |
a7fea17f | 23 | # Generated on Tue Dec 19 20:00:06 EET 2000 [metaconfig 3.0 PL70] |
7f2de2d2 | 24 | # (with additional metaconfig patches by perlbug@perl.org) |
2304df62 | 25 | |
283fdd21 | 26 | cat >c1$$ <<EOF |
2304df62 AD |
27 | ARGGGHHHH!!!!! |
28 | ||
29 | SCO csh still thinks true is false. Write to SCO today and tell them that next | |
30 | year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-) | |
31 | ||
32 | (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All | |
33 | we'd have to do is go in and swap the && and || tokens, wherever they are.) | |
34 | ||
35 | [End of diatribe. We now return you to your regularly scheduled programming...] | |
36 | EOF | |
283fdd21 | 37 | cat >c2$$ <<EOF |
2304df62 AD |
38 | |
39 | OOPS! You naughty creature! You didn't run Configure with sh! | |
40 | I will attempt to remedy the situation by running sh for you... | |
41 | EOF | |
42 | ||
283fdd21 | 43 | true || cat c1$$ c2$$ |
2304df62 AD |
44 | true || exec sh $0 $argv:q |
45 | ||
283fdd21 | 46 | (exit $?0) || cat c2$$ |
2304df62 | 47 | (exit $?0) || exec sh $0 $argv:q |
283fdd21 | 48 | rm -f c1$$ c2$$ |
2304df62 | 49 | |
a0d0e21e LW |
50 | : compute my invocation name |
51 | me=$0 | |
52 | case "$0" in | |
53 | */*) | |
54 | me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null` | |
55 | test "$me" || me=$0 | |
56 | ;; | |
57 | esac | |
58 | ||
dfe9444c | 59 | : Proper separator for the PATH environment variable |
8e07c86e AD |
60 | p_=: |
61 | : On OS/2 this directory should exist if this is not floppy only system :-] | |
dfe9444c AD |
62 | if test -d c:/. ; then |
63 | if test -n "$OS2_SHELL"; then | |
64 | p_=\; | |
65 | PATH=`cmd /c "echo %PATH%" | tr '\\\\' / ` | |
66 | OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'` | |
c4f23d77 | 67 | elif test -n "$DJGPP"; then |
dfe9444c AD |
68 | p_=\; |
69 | fi | |
39e571d4 | 70 | fi |
a0d0e21e LW |
71 | |
72 | : Proper PATH setting | |
73 | paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin' | |
16d20bd9 | 74 | paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin" |
232e078e | 75 | paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin" |
16d20bd9 | 76 | paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin" |
232e078e AD |
77 | paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb" |
78 | paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin" | |
79 | paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib" | |
80 | paths="$paths /sbin /usr/sbin /usr/libexec" | |
a0d0e21e LW |
81 | |
82 | for p in $paths | |
83 | do | |
8e07c86e AD |
84 | case "$p_$PATH$p_" in |
85 | *$p_$p$p_*) ;; | |
86 | *) test -d $p && PATH=$PATH$p_$p ;; | |
a0d0e21e LW |
87 | esac |
88 | done | |
89 | ||
8e07c86e | 90 | PATH=.$p_$PATH |
2304df62 AD |
91 | export PATH |
92 | ||
dfe9444c AD |
93 | : shall we be using ksh? |
94 | inksh='' | |
95 | needksh='' | |
96 | avoidksh='' | |
97 | newsh=/bin/ksh | |
98 | changesh='' | |
ff0cee69 | 99 | if (PATH=.; alias -x) >/dev/null 2>&1; then |
dfe9444c AD |
100 | inksh=true |
101 | fi | |
102 | if test -f /hp-ux -a -f /bin/ksh; then | |
103 | needksh='to avoid sh bug in "here document" expansion' | |
104 | fi | |
105 | if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then | |
106 | if test X`/usr/bin/uname -v` = X4; then | |
107 | avoidksh="to avoid AIX 4's /bin/sh" | |
108 | newsh=/usr/bin/bsh | |
2304df62 | 109 | fi |
dfe9444c | 110 | fi |
cf04f91f JH |
111 | if test -f /osf_boot -a -f /usr/sbin/setld; then |
112 | if test X`/usr/bin/uname -s` = XOSF1; then | |
113 | avoidksh="to avoid Digital UNIX' ksh" | |
114 | newsh=/bin/sh | |
115 | unset BIN_SH # if this is 'xpg4' sh will start up ksh | |
116 | fi | |
117 | fi | |
dfe9444c AD |
118 | case "$inksh/$needksh" in |
119 | /[a-z]*) | |
c4f23d77 | 120 | ENV='' |
dfe9444c AD |
121 | changesh=true |
122 | reason="$needksh" | |
123 | ;; | |
124 | esac | |
125 | case "$inksh/$avoidksh" in | |
126 | true/[a-z]*) | |
127 | changesh=true | |
128 | reason="$avoidksh" | |
129 | ;; | |
130 | esac | |
131 | case "$inksh/$needksh-$avoidksh-" in | |
132 | true/--) | |
a0d0e21e LW |
133 | cat <<EOM |
134 | (I see you are using the Korn shell. Some ksh's blow up on $me, | |
dfe9444c | 135 | mainly on older exotic systems. If yours does, try the Bourne shell instead.) |
ff0cee69 | 136 | EOM |
dfe9444c AD |
137 | ;; |
138 | esac | |
139 | case "$changesh" in | |
140 | true) | |
141 | echo "(Feeding myself to $newsh $reason.)" | |
142 | case "$0" in | |
143 | Configure|*/Configure) exec $newsh $0 "$@";; | |
144 | *) exec $newsh Configure "$@";; | |
145 | esac | |
146 | ;; | |
147 | esac | |
2304df62 | 148 | |
bfb7748a AD |
149 | : if needed set CDPATH to a harmless value that is not chatty |
150 | : avoid bash 2.02 problems with empty CDPATH. | |
151 | case "$CDPATH" in | |
152 | '') ;; | |
153 | *) case "$SHELL" in | |
154 | *bash*) CDPATH='.' ;; | |
155 | *) CDPATH='' ;; | |
156 | esac | |
157 | ;; | |
158 | esac | |
2304df62 AD |
159 | : Configure runs within the UU subdirectory |
160 | test -d UU || mkdir UU | |
8e07c86e | 161 | cd UU && rm -f ./* |
2304df62 | 162 | |
6b356c8e JH |
163 | ccname='' |
164 | ccversion='' | |
b4eb6b3d JH |
165 | ccsymbols='' |
166 | cppccsymbols='' | |
167 | cppsymbols='' | |
9c839522 | 168 | perllibs='' |
b4eb6b3d JH |
169 | dynamic_ext='' |
170 | extensions='' | |
171 | known_extensions='' | |
172 | nonxs_ext='' | |
173 | static_ext='' | |
174 | useopcode='' | |
175 | useposix='' | |
ecfc5424 | 176 | d_bsd='' |
40a7a20a | 177 | d_eunice='' |
2304df62 AD |
178 | d_xenix='' |
179 | eunicefix='' | |
180 | Mcc='' | |
dfe9444c | 181 | ar='' |
2304df62 AD |
182 | awk='' |
183 | bash='' | |
184 | bison='' | |
185 | byacc='' | |
186 | cat='' | |
187 | chgrp='' | |
188 | chmod='' | |
189 | chown='' | |
ecfc5424 | 190 | comm='' |
2304df62 AD |
191 | compress='' |
192 | cp='' | |
193 | cpio='' | |
194 | cpp='' | |
195 | csh='' | |
196 | date='' | |
197 | echo='' | |
198 | egrep='' | |
199 | emacs='' | |
200 | expr='' | |
201 | find='' | |
202 | flex='' | |
2304df62 | 203 | grep='' |
8ff267be | 204 | gzip='' |
2304df62 AD |
205 | inews='' |
206 | ksh='' | |
207 | less='' | |
208 | line='' | |
209 | lint='' | |
210 | ln='' | |
211 | lp='' | |
212 | lpr='' | |
213 | ls='' | |
214 | mail='' | |
215 | mailx='' | |
dfe9444c | 216 | make='' |
2304df62 AD |
217 | mkdir='' |
218 | more='' | |
219 | mv='' | |
693762b4 | 220 | nm='' |
2304df62 AD |
221 | nroff='' |
222 | perl='' | |
223 | pg='' | |
224 | pmake='' | |
225 | pr='' | |
226 | rm='' | |
227 | rmail='' | |
228 | sed='' | |
229 | sendmail='' | |
2304df62 AD |
230 | shar='' |
231 | sleep='' | |
232 | smail='' | |
233 | sort='' | |
234 | submit='' | |
235 | tail='' | |
236 | tar='' | |
237 | tbl='' | |
693762b4 | 238 | tee='' |
2304df62 AD |
239 | test='' |
240 | touch='' | |
241 | tr='' | |
242 | troff='' | |
243 | uname='' | |
244 | uniq='' | |
245 | uuname='' | |
246 | vi='' | |
247 | zcat='' | |
8ff267be | 248 | zip='' |
b4eb6b3d JH |
249 | full_ar='' |
250 | full_sed='' | |
a0d0e21e | 251 | libswanted='' |
2304df62 AD |
252 | hint='' |
253 | myuname='' | |
85e6fe83 LW |
254 | osname='' |
255 | osvers='' | |
2304df62 AD |
256 | Author='' |
257 | Date='' | |
258 | Header='' | |
259 | Id='' | |
260 | Locker='' | |
261 | Log='' | |
262 | RCSfile='' | |
263 | Revision='' | |
264 | Source='' | |
265 | State='' | |
dfe9444c AD |
266 | _a='' |
267 | _exe='' | |
268 | _o='' | |
4633a7c4 LW |
269 | archobjs='' |
270 | exe_ext='' | |
271 | firstmakefile='' | |
272 | lib_ext='' | |
273 | obj_ext='' | |
274 | path_sep='' | |
b4eb6b3d JH |
275 | afs='' |
276 | alignbytes='' | |
277 | ansi2knr='' | |
278 | archlib='' | |
279 | archlibexp='' | |
280 | d_archlib='' | |
281 | installarchlib='' | |
282 | archname='' | |
283 | myarchname='' | |
284 | d_atolf='' | |
285 | d_atoll='' | |
286 | baserev='' | |
287 | bin='' | |
288 | binexp='' | |
289 | installbin='' | |
290 | bincompat5005='' | |
291 | d_bincompat5005='' | |
292 | byteorder='' | |
2304df62 | 293 | cc='' |
2304df62 AD |
294 | ccflags='' |
295 | cppflags='' | |
296 | ldflags='' | |
297 | lkflags='' | |
8e07c86e | 298 | locincpth='' |
2304df62 | 299 | optimize='' |
b4eb6b3d | 300 | cf_email='' |
2304df62 AD |
301 | cf_by='' |
302 | cf_time='' | |
b4eb6b3d | 303 | charsize='' |
2304df62 | 304 | contains='' |
b4eb6b3d | 305 | cpp_stuff='' |
2304df62 AD |
306 | cpplast='' |
307 | cppminus='' | |
308 | cpprun='' | |
309 | cppstdin='' | |
b4eb6b3d | 310 | crosscompile='' |
74cac757 | 311 | d__fwalk='' |
b4eb6b3d JH |
312 | d_access='' |
313 | d_accessx='' | |
314 | d_alarm='' | |
315 | d_attribut='' | |
316 | d_bcmp='' | |
317 | d_bcopy='' | |
318 | d_bzero='' | |
319 | d_casti32='' | |
320 | castflags='' | |
321 | d_castneg='' | |
322 | d_chown='' | |
323 | d_chroot='' | |
324 | d_chsize='' | |
325 | d_closedir='' | |
326 | d_void_closedir='' | |
327 | d_const='' | |
328 | cryptlib='' | |
329 | d_crypt='' | |
330 | d_csh='' | |
331 | full_csh='' | |
332 | d_cuserid='' | |
333 | d_dbl_dig='' | |
334 | d_difftime='' | |
335 | d_dlerror='' | |
a0d0e21e | 336 | d_dlopen='' |
b4eb6b3d JH |
337 | d_dlsymun='' |
338 | d_dosuid='' | |
339 | d_suidsafe='' | |
340 | d_drand48proto='' | |
341 | d_dup2='' | |
342 | d_eaccess='' | |
343 | d_endgrent='' | |
344 | d_endhent='' | |
345 | d_endnent='' | |
346 | d_endpent='' | |
347 | d_endpwent='' | |
348 | d_endsent='' | |
349 | d_fchmod='' | |
350 | d_fchown='' | |
351 | d_fcntl='' | |
9d9004a9 | 352 | d_fcntl_can_lock='' |
b4eb6b3d JH |
353 | d_fd_macros='' |
354 | d_fd_set='' | |
355 | d_fds_bits='' | |
356 | d_fgetpos='' | |
357 | d_flexfnam='' | |
358 | d_flock='' | |
359 | d_fork='' | |
360 | d_fpos64_t='' | |
361 | d_frexpl='' | |
362 | d_fs_data_s='' | |
363 | d_fseeko='' | |
364 | d_fsetpos='' | |
365 | d_fstatfs='' | |
411ab01c | 366 | d_fsync='' |
b4eb6b3d JH |
367 | d_ftello='' |
368 | d_ftime='' | |
369 | d_gettimeod='' | |
370 | d_Gconvert='' | |
371 | d_getcwd='' | |
372 | d_getespwnam='' | |
373 | d_getfsstat='' | |
374 | d_getgrent='' | |
375 | d_getgrps='' | |
376 | d_gethbyaddr='' | |
377 | d_gethbyname='' | |
378 | d_gethent='' | |
379 | aphostname='' | |
380 | d_gethname='' | |
381 | d_phostname='' | |
382 | d_uname='' | |
383 | d_gethostprotos='' | |
384 | d_getlogin='' | |
385 | d_getmnt='' | |
386 | d_getmntent='' | |
387 | d_getnbyaddr='' | |
388 | d_getnbyname='' | |
389 | d_getnent='' | |
390 | d_getnetprotos='' | |
0c0643d0 | 391 | d_getpagsz='' |
b4eb6b3d JH |
392 | d_getpent='' |
393 | d_getpgid='' | |
394 | d_getpgrp2='' | |
395 | d_bsdgetpgrp='' | |
396 | d_getpgrp='' | |
397 | d_getppid='' | |
398 | d_getprior='' | |
399 | d_getpbyname='' | |
400 | d_getpbynumber='' | |
401 | d_getprotoprotos='' | |
402 | d_getprpwnam='' | |
403 | d_getpwent='' | |
404 | d_getsent='' | |
405 | d_getservprotos='' | |
406 | d_getspnam='' | |
407 | d_getsbyname='' | |
408 | d_getsbyport='' | |
a4f3eea9 | 409 | d_gnulibc='' |
b4eb6b3d JH |
410 | d_hasmntopt='' |
411 | d_htonl='' | |
412 | d_iconv='' | |
413 | d_inetaton='' | |
414 | d_int64_t='' | |
415 | d_isascii='' | |
416 | d_isnan='' | |
417 | d_isnanl='' | |
418 | d_killpg='' | |
419 | d_lchown='' | |
420 | d_ldbl_dig='' | |
421 | d_link='' | |
422 | d_locconv='' | |
423 | d_lockf='' | |
424 | d_longdbl='' | |
425 | longdblsize='' | |
426 | d_longlong='' | |
427 | longlongsize='' | |
428 | d_lseekproto='' | |
429 | d_lstat='' | |
430 | d_madvise='' | |
431 | d_mblen='' | |
432 | d_mbstowcs='' | |
433 | d_mbtowc='' | |
434 | d_memchr='' | |
435 | d_memcmp='' | |
436 | d_memcpy='' | |
437 | d_memmove='' | |
438 | d_memset='' | |
439 | d_mkdir='' | |
440 | d_mkdtemp='' | |
441 | d_mkfifo='' | |
442 | d_mkstemp='' | |
443 | d_mkstemps='' | |
444 | d_mktime='' | |
445 | d_mmap='' | |
446 | mmaptype='' | |
447 | d_modfl='' | |
448 | d_mprotect='' | |
449 | d_msg='' | |
450 | d_msgctl='' | |
451 | d_msgget='' | |
452 | d_msgrcv='' | |
453 | d_msgsnd='' | |
454 | d_msync='' | |
455 | d_munmap='' | |
456 | d_nice='' | |
457 | d_off64_t='' | |
458 | d_open3='' | |
459 | d_fpathconf='' | |
460 | d_pathconf='' | |
461 | d_pause='' | |
462 | d_pipe='' | |
463 | d_poll='' | |
2304df62 | 464 | d_portable='' |
b4eb6b3d JH |
465 | d_old_pthread_create_joinable='' |
466 | old_pthread_create_joinable='' | |
467 | d_pthread_yield='' | |
468 | d_sched_yield='' | |
469 | sched_yield='' | |
470 | d_qgcvt='' | |
471 | d_readdir='' | |
472 | d_rewinddir='' | |
473 | d_seekdir='' | |
474 | d_telldir='' | |
475 | d_readlink='' | |
476 | d_rename='' | |
477 | d_rmdir='' | |
478 | d_safebcpy='' | |
479 | d_safemcpy='' | |
480 | d_sanemcmp='' | |
ef9f17be | 481 | d_sbrkproto='' |
b4eb6b3d JH |
482 | d_select='' |
483 | d_sem='' | |
484 | d_semctl='' | |
485 | d_semget='' | |
486 | d_semop='' | |
487 | d_setegid='' | |
488 | d_seteuid='' | |
489 | d_setgrent='' | |
490 | d_setgrps='' | |
491 | d_sethent='' | |
492 | d_setlinebuf='' | |
493 | d_setlocale='' | |
494 | d_setnent='' | |
495 | d_setpent='' | |
496 | d_setpgid='' | |
497 | d_setpgrp2='' | |
498 | d_bsdsetpgrp='' | |
499 | d_setpgrp='' | |
500 | d_setprior='' | |
501 | d_setproctitle='' | |
502 | d_setpwent='' | |
503 | d_setregid='' | |
504 | d_setresgid='' | |
505 | d_setresuid='' | |
506 | d_setreuid='' | |
507 | d_setrgid='' | |
508 | d_setruid='' | |
509 | d_setsent='' | |
510 | d_setsid='' | |
511 | d_setvbuf='' | |
512 | d_sfio='' | |
513 | usesfio='' | |
514 | d_shm='' | |
515 | d_shmat='' | |
516 | d_shmatprototype='' | |
517 | shmattype='' | |
518 | d_shmctl='' | |
519 | d_shmdt='' | |
520 | d_shmget='' | |
521 | d_sigaction='' | |
522 | d_sigsetjmp='' | |
523 | d_msg_ctrunc='' | |
524 | d_msg_dontroute='' | |
525 | d_msg_oob='' | |
526 | d_msg_peek='' | |
527 | d_msg_proxy='' | |
528 | d_oldsock='' | |
529 | d_scm_rights='' | |
530 | d_socket='' | |
531 | d_sockpair='' | |
532 | sockethdr='' | |
533 | socketlib='' | |
534 | d_socklen_t='' | |
535 | d_socks5_init='' | |
536 | d_sqrtl='' | |
537 | d_statblks='' | |
538 | d_statfs_f_flags='' | |
539 | d_statfs_s='' | |
540 | d_fstatvfs='' | |
541 | d_statvfs='' | |
542 | d_stdio_cnt_lval='' | |
543 | d_stdio_ptr_lval='' | |
a7ffa9b9 NC |
544 | d_stdio_ptr_lval_nochange_cnt='' |
545 | d_stdio_ptr_lval_sets_cnt='' | |
b4eb6b3d JH |
546 | d_stdiobase='' |
547 | d_stdstdio='' | |
548 | stdio_base='' | |
549 | stdio_bufsiz='' | |
550 | stdio_cnt='' | |
551 | stdio_filbuf='' | |
552 | stdio_ptr='' | |
553 | d_index='' | |
554 | d_strchr='' | |
555 | d_strcoll='' | |
556 | d_strctcpy='' | |
557 | d_strerrm='' | |
558 | d_strerror='' | |
559 | d_sysernlst='' | |
560 | d_syserrlst='' | |
561 | d_strtod='' | |
562 | d_strtol='' | |
563 | d_strtold='' | |
564 | d_strtoll='' | |
28e5dec8 | 565 | d_strtoq='' |
b4eb6b3d JH |
566 | d_strtoul='' |
567 | d_strtoull='' | |
568 | d_strtouq='' | |
569 | d_strxfrm='' | |
570 | d_symlink='' | |
571 | d_syscall='' | |
572 | d_sysconf='' | |
573 | d_system='' | |
574 | d_tcgetpgrp='' | |
575 | d_tcsetpgrp='' | |
576 | d_telldirproto='' | |
577 | d_time='' | |
578 | timetype='' | |
579 | clocktype='' | |
580 | d_times='' | |
581 | d_truncate='' | |
582 | d_tzname='' | |
583 | d_umask='' | |
584 | d_semctl_semid_ds='' | |
585 | d_semctl_semun='' | |
586 | d_union_semun='' | |
587 | d_ustat='' | |
588 | d_vfork='' | |
589 | usevfork='' | |
590 | d_voidsig='' | |
591 | signal_t='' | |
592 | d_volatile='' | |
593 | d_charvspr='' | |
594 | d_vprintf='' | |
595 | d_wait4='' | |
596 | d_waitpid='' | |
597 | d_wcstombs='' | |
598 | d_wctomb='' | |
599 | dlext='' | |
85e6fe83 LW |
600 | cccdlflags='' |
601 | ccdlflags='' | |
2304df62 | 602 | dlsrc='' |
232e078e | 603 | ld='' |
85e6fe83 | 604 | lddlflags='' |
2304df62 | 605 | usedl='' |
b4eb6b3d JH |
606 | doublesize='' |
607 | ebcdic='' | |
608 | fflushNULL='' | |
609 | fflushall='' | |
610 | fpossize='' | |
611 | fpostype='' | |
5b463ca7 | 612 | gccosandvers='' |
8a27cf78 | 613 | gccversion='' |
b4eb6b3d JH |
614 | gidformat='' |
615 | gidsign='' | |
616 | gidsize='' | |
617 | gidtype='' | |
618 | groupstype='' | |
619 | h_fcntl='' | |
620 | h_sysfile='' | |
621 | i_arpainet='' | |
622 | db_hashtype='' | |
623 | db_prefixtype='' | |
624 | i_db='' | |
625 | i_dbm='' | |
626 | i_rpcsvcdbm='' | |
627 | d_dirnamlen='' | |
628 | direntrytype='' | |
629 | i_dirent='' | |
a0d0e21e | 630 | i_dld='' |
b4eb6b3d JH |
631 | i_dlfcn='' |
632 | i_fcntl='' | |
633 | i_float='' | |
634 | i_gdbm='' | |
635 | d_grpasswd='' | |
636 | i_grp='' | |
637 | i_iconv='' | |
638 | i_ieeefp='' | |
639 | i_inttypes='' | |
640 | i_libutil='' | |
641 | i_limits='' | |
642 | i_locale='' | |
643 | i_machcthr='' | |
644 | i_malloc='' | |
645 | i_math='' | |
646 | i_memory='' | |
647 | i_mntent='' | |
648 | i_ndbm='' | |
649 | i_netdb='' | |
650 | i_neterrno='' | |
651 | i_netinettcp='' | |
652 | i_niin='' | |
653 | i_sysin='' | |
654 | i_poll='' | |
655 | i_prot='' | |
656 | i_pthread='' | |
657 | d_pwage='' | |
658 | d_pwchange='' | |
659 | d_pwclass='' | |
660 | d_pwcomment='' | |
661 | d_pwexpire='' | |
662 | d_pwgecos='' | |
663 | d_pwpasswd='' | |
664 | d_pwquota='' | |
665 | i_pwd='' | |
666 | i_sfio='' | |
667 | i_shadow='' | |
668 | i_socks='' | |
669 | i_stddef='' | |
670 | i_stdlib='' | |
671 | i_string='' | |
672 | strings='' | |
673 | i_sunmath='' | |
674 | i_sysaccess='' | |
675 | i_sysdir='' | |
676 | i_sysfile='' | |
677 | d_voidtty='' | |
678 | i_bsdioctl='' | |
679 | i_sysfilio='' | |
680 | i_sysioctl='' | |
681 | i_syssockio='' | |
682 | i_syslog='' | |
683 | i_sysmman='' | |
684 | i_sysmode='' | |
685 | i_sysmount='' | |
686 | i_sysndir='' | |
687 | i_sysparam='' | |
688 | i_sysresrc='' | |
689 | i_syssecrt='' | |
690 | i_sysselct='' | |
691 | i_sysstat='' | |
692 | i_sysstatfs='' | |
693 | i_sysstatvfs='' | |
694 | i_systimes='' | |
695 | i_systypes='' | |
696 | i_sysuio='' | |
697 | i_sysun='' | |
698 | i_sysutsname='' | |
699 | i_sysvfs='' | |
700 | i_syswait='' | |
701 | i_sgtty='' | |
702 | i_termio='' | |
703 | i_termios='' | |
704 | i_systime='' | |
705 | i_systimek='' | |
706 | i_time='' | |
707 | timeincl='' | |
708 | i_unistd='' | |
709 | i_ustat='' | |
710 | i_utime='' | |
711 | i_values='' | |
712 | i_stdarg='' | |
713 | i_varargs='' | |
714 | i_varhdr='' | |
715 | i_vfork='' | |
716 | inc_version_list='' | |
717 | inc_version_list_init='' | |
718 | installprefix='' | |
719 | installprefixexp='' | |
720 | installstyle='' | |
721 | installusrbinperl='' | |
722 | intsize='' | |
723 | longsize='' | |
724 | shortsize='' | |
2304df62 | 725 | libc='' |
b4eb6b3d JH |
726 | ldlibpthname='' |
727 | libperl='' | |
728 | shrpenv='' | |
729 | useshrplib='' | |
a0d0e21e | 730 | glibpth='' |
2304df62 | 731 | libpth='' |
8e07c86e | 732 | loclibpth='' |
2304df62 AD |
733 | plibpth='' |
734 | xlibpth='' | |
1cfa4ec7 | 735 | ignore_versioned_solibs='' |
2304df62 | 736 | libs='' |
43999f95 JH |
737 | libsdirs='' |
738 | libsfiles='' | |
739 | libsfound='' | |
13b3f787 | 740 | libspath='' |
85e6fe83 | 741 | lns='' |
b4eb6b3d JH |
742 | d_PRIEUldbl='' |
743 | d_PRIFUldbl='' | |
744 | d_PRIGUldbl='' | |
745 | d_PRIeldbl='' | |
746 | d_PRIfldbl='' | |
747 | d_PRIgldbl='' | |
748 | d_SCNfldbl='' | |
749 | sPRIEUldbl='' | |
750 | sPRIFUldbl='' | |
751 | sPRIGUldbl='' | |
752 | sPRIeldbl='' | |
753 | sPRIfldbl='' | |
754 | sPRIgldbl='' | |
755 | sSCNfldbl='' | |
756 | lseeksize='' | |
757 | lseektype='' | |
8ff267be | 758 | make_set_make='' |
b4eb6b3d JH |
759 | d_mymalloc='' |
760 | freetype='' | |
761 | mallocobj='' | |
762 | mallocsrc='' | |
763 | malloctype='' | |
764 | usemymalloc='' | |
765 | installman1dir='' | |
766 | man1dir='' | |
767 | man1direxp='' | |
768 | man1ext='' | |
769 | installman3dir='' | |
770 | man3dir='' | |
771 | man3direxp='' | |
772 | man3ext='' | |
773 | modetype='' | |
774 | multiarch='' | |
775 | mydomain='' | |
776 | myhostname='' | |
777 | phostname='' | |
2304df62 AD |
778 | c='' |
779 | n='' | |
b4eb6b3d JH |
780 | d_eofnblk='' |
781 | eagain='' | |
782 | o_nonblock='' | |
783 | rd_nodata='' | |
2cc61e15 | 784 | need_va_copy='' |
b4eb6b3d JH |
785 | netdb_hlen_type='' |
786 | netdb_host_type='' | |
787 | netdb_name_type='' | |
788 | netdb_net_type='' | |
789 | groupcat='' | |
790 | hostcat='' | |
791 | passcat='' | |
792 | orderlib='' | |
793 | ranlib='' | |
794 | d_perl_otherlibdirs='' | |
795 | otherlibdirs='' | |
2304df62 AD |
796 | package='' |
797 | spackage='' | |
b4eb6b3d JH |
798 | pager='' |
799 | api_revision='' | |
800 | api_subversion='' | |
801 | api_version='' | |
802 | api_versionstring='' | |
803 | patchlevel='' | |
804 | revision='' | |
805 | subversion='' | |
806 | version='' | |
807 | perl5='' | |
808 | perladmin='' | |
809 | perlpath='' | |
810 | d_nv_preserves_uv='' | |
811 | d_nv_preserves_uv_bits='' | |
812 | i16size='' | |
813 | i16type='' | |
814 | i32size='' | |
815 | i32type='' | |
816 | i64size='' | |
817 | i64type='' | |
818 | i8size='' | |
819 | i8type='' | |
820 | ivsize='' | |
821 | ivtype='' | |
822 | nvsize='' | |
823 | nvtype='' | |
824 | u16size='' | |
825 | u16type='' | |
826 | u32size='' | |
827 | u32type='' | |
828 | u64size='' | |
829 | u64type='' | |
830 | u8size='' | |
831 | u8type='' | |
832 | uvsize='' | |
833 | uvtype='' | |
834 | ivdformat='' | |
835 | nvEUformat='' | |
836 | nvFUformat='' | |
837 | nvGUformat='' | |
838 | nveformat='' | |
839 | nvfformat='' | |
840 | nvgformat='' | |
841 | uvXUformat='' | |
842 | uvoformat='' | |
843 | uvuformat='' | |
844 | uvxformat='' | |
845 | pidtype='' | |
846 | prefix='' | |
847 | prefixexp='' | |
848 | installprivlib='' | |
849 | privlib='' | |
850 | privlibexp='' | |
851 | prototype='' | |
852 | ptrsize='' | |
853 | d_PRIXU64='' | |
854 | d_PRId64='' | |
855 | d_PRIi64='' | |
856 | d_PRIo64='' | |
857 | d_PRIu64='' | |
858 | d_PRIx64='' | |
859 | sPRIXU64='' | |
860 | sPRId64='' | |
861 | sPRIi64='' | |
862 | sPRIo64='' | |
863 | sPRIu64='' | |
864 | sPRIx64='' | |
865 | d_quad='' | |
866 | quadkind='' | |
867 | quadtype='' | |
868 | uquadtype='' | |
869 | drand01='' | |
870 | randbits='' | |
871 | randfunc='' | |
872 | randseedtype='' | |
873 | seedfunc='' | |
874 | installscript='' | |
875 | scriptdir='' | |
876 | scriptdirexp='' | |
877 | selectminbits='' | |
878 | selecttype='' | |
8ff267be | 879 | sh='' |
b4eb6b3d JH |
880 | sig_count='' |
881 | sig_name='' | |
882 | sig_name_init='' | |
883 | sig_num='' | |
884 | sig_num_init='' | |
885 | installsitearch='' | |
886 | sitearch='' | |
887 | sitearchexp='' | |
888 | installsitebin='' | |
889 | sitebin='' | |
890 | sitebinexp='' | |
891 | installsitelib='' | |
892 | sitelib='' | |
893 | sitelib_stem='' | |
894 | sitelibexp='' | |
895 | siteprefix='' | |
896 | siteprefixexp='' | |
897 | sizesize='' | |
898 | sizetype='' | |
a0d0e21e | 899 | so='' |
b4eb6b3d | 900 | socksizetype='' |
2304df62 AD |
901 | sharpbang='' |
902 | shsharp='' | |
903 | spitshell='' | |
dfe9444c | 904 | src='' |
b4eb6b3d JH |
905 | ssizetype='' |
906 | startperl='' | |
2304df62 | 907 | startsh='' |
b4eb6b3d JH |
908 | stdchar='' |
909 | d_stdio_stream_array='' | |
910 | stdio_stream_array='' | |
911 | sysman='' | |
5ff3f7a4 | 912 | trnl='' |
b4eb6b3d JH |
913 | uidformat='' |
914 | uidsign='' | |
915 | uidsize='' | |
916 | uidtype='' | |
917 | archname64='' | |
918 | use64bitall='' | |
919 | use64bitint='' | |
920 | ccflags_uselargefiles='' | |
921 | ldflags_uselargefiles='' | |
922 | libswanted_uselargefiles='' | |
923 | uselargefiles='' | |
924 | uselongdouble='' | |
925 | usemorebits='' | |
926 | usemultiplicity='' | |
2304df62 | 927 | nm_opt='' |
40a7a20a | 928 | nm_so_opt='' |
2304df62 AD |
929 | runnm='' |
930 | usenm='' | |
b4eb6b3d | 931 | useperlio='' |
29209bc5 | 932 | usesocks='' |
b4eb6b3d JH |
933 | d_oldpthreads='' |
934 | use5005threads='' | |
935 | useithreads='' | |
936 | usethreads='' | |
2304df62 | 937 | incpath='' |
2304df62 AD |
938 | mips_type='' |
939 | usrinc='' | |
b4eb6b3d JH |
940 | d_vendorarch='' |
941 | installvendorarch='' | |
942 | vendorarch='' | |
943 | vendorarchexp='' | |
944 | d_vendorbin='' | |
945 | installvendorbin='' | |
946 | vendorbin='' | |
947 | vendorbinexp='' | |
948 | d_vendorlib='' | |
949 | installvendorlib='' | |
950 | vendorlib='' | |
951 | vendorlib_stem='' | |
952 | vendorlibexp='' | |
953 | usevendorprefix='' | |
954 | vendorprefix='' | |
955 | vendorprefixexp='' | |
d56c5707 | 956 | versiononly='' |
b4eb6b3d JH |
957 | defvoidused='' |
958 | voidflags='' | |
959 | pm_apiversion='' | |
960 | xs_apiversion='' | |
2304df62 AD |
961 | CONFIG='' |
962 | ||
ecfc5424 AD |
963 | define='define' |
964 | undef='undef' | |
965 | smallmach='pdp11 i8086 z8000 i80286 iAPX286' | |
966 | rmlist='' | |
967 | ||
968 | : We must find out about Eunice early | |
969 | eunicefix=':' | |
970 | if test -f /etc/unixtovms; then | |
971 | eunicefix=/etc/unixtovms | |
972 | fi | |
973 | if test -f /etc/unixtovms.exe; then | |
974 | eunicefix=/etc/unixtovms.exe | |
975 | fi | |
976 | ||
b4eb6b3d | 977 | i_whoami='' |
6b356c8e JH |
978 | ccname='' |
979 | ccversion='' | |
9c839522 | 980 | perllibs='' |
b4eb6b3d JH |
981 | : set useposix=false in your hint file to disable the POSIX extension. |
982 | useposix=true | |
983 | : set useopcode=false in your hint file to disable the Opcode extension. | |
984 | useopcode=true | |
dfe9444c | 985 | : Trailing extension. Override this in a hint file, if needed. |
4e2a5f63 | 986 | _exe='' |
dfe9444c AD |
987 | : Extra object files, if any, needed on this platform. |
988 | archobjs='' | |
b4eb6b3d | 989 | archname='' |
ff935051 JH |
990 | : Possible local include directories to search. |
991 | : Set locincpth to "" in a hint file to defeat local include searches. | |
992 | locincpth="/usr/local/include /opt/local/include /usr/gnu/include" | |
993 | locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include" | |
994 | : | |
995 | : no include file wanted by default | |
996 | inclwanted='' | |
997 | ||
b4eb6b3d | 998 | groupstype='' |
732c9516 JH |
999 | : change the next line if compiling for Xenix/286 on Xenix/386 |
1000 | xlibpth='/usr/lib/386 /lib/386' | |
732c9516 JH |
1001 | : Possible local library directories to search. |
1002 | loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" | |
1003 | loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" | |
1004 | ||
1005 | : general looking path for locating libraries | |
5869b1f1 | 1006 | glibpth="/lib /usr/lib $xlibpth" |
732c9516 | 1007 | glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib" |
f7dd4e7f JH |
1008 | test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth" |
1009 | test -f /shlib/libc.so && glibpth="/shlib $glibpth" | |
732c9516 JH |
1010 | |
1011 | : Private path used by Configure to find libraries. Its value | |
1012 | : is prepended to libpth. This variable takes care of special | |
1013 | : machines, like the mips. Usually, it should be empty. | |
1014 | plibpth='' | |
1015 | ||
1cfa4ec7 GS |
1016 | : default library list |
1017 | libswanted='' | |
921b2963 | 1018 | : some systems want to use only the non-versioned libso:s |
1cfa4ec7 | 1019 | ignore_versioned_solibs='' |
b4eb6b3d JH |
1020 | archname64='' |
1021 | ccflags_uselargefiles='' | |
1022 | ldflags_uselargefiles='' | |
1023 | libswanted_uselargefiles='' | |
1024 | : set usemultiplicity on the Configure command line to enable multiplicity. | |
29209bc5 | 1025 | : set usesocks on the Configure command line to enable socks. |
b4eb6b3d JH |
1026 | : set usethreads on the Configure command line to enable threads. |
1027 | : full support for void wanted by default | |
1028 | defvoidused=15 | |
1029 | ||
ecfc5424 | 1030 | : List of libraries we want. |
693762b4 | 1031 | : If anyone needs -lnet, put it in a hint file. |
997d70a2 | 1032 | libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl' |
69e84d1d | 1033 | libswanted="$libswanted dld ld sun m c cposix posix" |
f1066039 | 1034 | libswanted="$libswanted ndir dir crypt sec" |
0c9177ab | 1035 | libswanted="$libswanted ucb bsd BSD PW x iconv util" |
1aef975c | 1036 | : We probably want to search /usr/shlib before most other libraries. |
94b6baf5 | 1037 | : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. |
ecfc5424 AD |
1038 | glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` |
1039 | glibpth="/usr/shlib $glibpth" | |
1040 | : Do not use vfork unless overridden by a hint file. | |
1041 | usevfork=false | |
1042 | ||
8ff267be | 1043 | : Find the basic shell for Bourne shell scripts |
1044 | case "$sh" in | |
1045 | '') | |
8ff267be | 1046 | case "$SYSTYPE" in |
1047 | *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";; | |
1048 | *) xxx='/bin/sh';; | |
1049 | esac | |
1050 | if test -f "$xxx"; then | |
1051 | sh="$xxx" | |
1052 | else | |
1053 | : Build up a list and do a single loop so we can 'break' out. | |
1054 | pth=`echo $PATH | sed -e "s/$p_/ /g"` | |
1055 | for xxx in sh bash ksh pdksh ash; do | |
1056 | for p in $pth; do | |
1057 | try="$try ${p}/${xxx}" | |
1058 | done | |
1059 | done | |
1060 | for xxx in $try; do | |
1061 | if test -f "$xxx"; then | |
1062 | sh="$xxx"; | |
8ff267be | 1063 | break |
1064 | elif test -f "$xxx.exe"; then | |
1065 | sh="$xxx"; | |
8ff267be | 1066 | break |
1067 | fi | |
1068 | done | |
1069 | fi | |
1070 | ;; | |
1071 | esac | |
1072 | ||
1073 | case "$sh" in | |
1074 | '') cat <<EOM >&2 | |
1075 | $me: Fatal Error: I can't find a Bourne Shell anywhere. | |
dfe9444c | 1076 | |
8ff267be | 1077 | Usually it's in /bin/sh. How did you even get this far? |
7f2de2d2 | 1078 | Please contact me (Perl Maintainers) at perlbug@perl.org and |
dfe9444c | 1079 | we'll try to straighten this all out. |
8ff267be | 1080 | EOM |
1081 | exit 1 | |
1082 | ;; | |
1083 | esac | |
1084 | ||
760ac839 | 1085 | : see if sh knows # comments |
8ff267be | 1086 | if `$sh -c '#' >/dev/null 2>&1`; then |
760ac839 LW |
1087 | shsharp=true |
1088 | spitshell=cat | |
760ac839 LW |
1089 | xcat=/bin/cat |
1090 | test -f $xcat || xcat=/usr/bin/cat | |
1091 | echo "#!$xcat" >try | |
1092 | $eunicefix try | |
1093 | chmod +x try | |
1094 | ./try > today | |
1095 | if test -s today; then | |
760ac839 LW |
1096 | sharpbang='#!' |
1097 | else | |
1098 | echo "#! $xcat" > try | |
1099 | $eunicefix try | |
1100 | chmod +x try | |
1101 | ./try > today | |
1102 | if test -s today; then | |
760ac839 LW |
1103 | sharpbang='#! ' |
1104 | else | |
760ac839 LW |
1105 | sharpbang=': use ' |
1106 | fi | |
1107 | fi | |
1108 | else | |
dfe9444c | 1109 | echo " " |
8ff267be | 1110 | echo "Your $sh doesn't grok # comments--I will strip them later on." |
760ac839 LW |
1111 | shsharp=false |
1112 | cd .. | |
1113 | echo "exec grep -v '^[ ]*#'" >spitshell | |
1114 | chmod +x spitshell | |
1115 | $eunicefix spitshell | |
1116 | spitshell=`pwd`/spitshell | |
1117 | cd UU | |
1118 | echo "I presume that if # doesn't work, #! won't work either!" | |
1119 | sharpbang=': use ' | |
1120 | fi | |
1121 | rm -f try today | |
1122 | ||
1123 | : figure out how to guarantee sh startup | |
8ff267be | 1124 | case "$startsh" in |
1125 | '') startsh=${sharpbang}${sh} ;; | |
1126 | *) | |
760ac839 | 1127 | esac |
760ac839 LW |
1128 | cat >try <<EOSS |
1129 | $startsh | |
1130 | set abc | |
1131 | test "$?abc" != 1 | |
1132 | EOSS | |
1133 | ||
1134 | chmod +x try | |
1135 | $eunicefix try | |
1136 | if ./try; then | |
8ff267be | 1137 | : echo "Yup, it does." |
760ac839 | 1138 | else |
dfe9444c AD |
1139 | echo "Hmm... '$startsh' does not guarantee sh startup..." |
1140 | echo "You may have to fix up the shell scripts to make sure $sh runs them." | |
760ac839 LW |
1141 | fi |
1142 | rm -f try | |
1143 | ||
aebf16e7 AD |
1144 | |
1145 | : Save command line options in file UU/cmdline.opt for later use in | |
1146 | : generating config.sh. | |
1147 | cat > cmdline.opt <<EOSH | |
1148 | # Configure command line arguments. | |
1149 | config_arg0='$0' | |
1150 | config_args='$*' | |
1151 | config_argc=$# | |
1152 | EOSH | |
1153 | argn=1 | |
1154 | for arg in "$@"; do | |
1155 | cat >>cmdline.opt <<EOSH | |
1156 | config_arg$argn='$arg' | |
1157 | EOSH | |
1158 | argn=`expr $argn + 1` | |
1159 | done | |
1160 | ||
2304df62 AD |
1161 | : produce awk script to parse command line options |
1162 | cat >options.awk <<'EOF' | |
1163 | BEGIN { | |
02e93a22 | 1164 | optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification |
2304df62 AD |
1165 | |
1166 | len = length(optstr); | |
1167 | for (i = 1; i <= len; i++) { | |
1168 | c = substr(optstr, i, 1); | |
1169 | if (i < len) a = substr(optstr, i + 1, 1); else a = ""; | |
1170 | if (a == ":") { | |
1171 | arg[c] = 1; | |
1172 | i++; | |
1173 | } | |
1174 | opt[c] = 1; | |
1175 | } | |
1176 | } | |
1177 | { | |
1178 | expect = 0; | |
1179 | str = $0; | |
1180 | if (substr(str, 1, 1) != "-") { | |
1181 | printf("'%s'\n", str); | |
1182 | next; | |
1183 | } | |
1184 | len = length($0); | |
1185 | for (i = 2; i <= len; i++) { | |
1186 | c = substr(str, i, 1); | |
1187 | if (!opt[c]) { | |
1188 | printf("-%s\n", substr(str, i)); | |
1189 | next; | |
1190 | } | |
1191 | printf("-%s\n", c); | |
1192 | if (arg[c]) { | |
1193 | if (i < len) | |
1194 | printf("'%s'\n", substr(str, i + 1)); | |
1195 | else | |
1196 | expect = 1; | |
1197 | next; | |
1198 | } | |
1199 | } | |
1200 | } | |
1201 | END { | |
1202 | if (expect) | |
1203 | print "?"; | |
1204 | } | |
1205 | EOF | |
1206 | ||
1207 | : process the command line options | |
4633a7c4 LW |
1208 | set X `for arg in "$@"; do echo "X$arg"; done | |
1209 | sed -e s/X// | awk -f options.awk` | |
2304df62 AD |
1210 | eval "set $*" |
1211 | shift | |
1212 | rm -f options.awk | |
1213 | ||
1214 | : set up default values | |
1215 | fastread='' | |
1216 | reuseval=false | |
1217 | config_sh='' | |
1218 | alldone='' | |
1219 | error='' | |
1220 | silent='' | |
1221 | extractsh='' | |
ecfc5424 | 1222 | override='' |
16d20bd9 | 1223 | knowitall='' |
02e93a22 | 1224 | rm -f optdef.sh posthint.sh |
28757baa | 1225 | cat >optdef.sh <<EOS |
1226 | $startsh | |
1227 | EOS | |
2304df62 | 1228 | |
dfe9444c | 1229 | |
2304df62 AD |
1230 | : option parsing |
1231 | while test $# -gt 0; do | |
1232 | case "$1" in | |
1233 | -d) shift; fastread=yes;; | |
1234 | -e) shift; alldone=cont;; | |
1235 | -f) | |
1236 | shift | |
1237 | cd .. | |
1238 | if test -r "$1"; then | |
1239 | config_sh="$1" | |
1240 | else | |
a0d0e21e | 1241 | echo "$me: cannot read config file $1." >&2 |
2304df62 AD |
1242 | error=true |
1243 | fi | |
1244 | cd UU | |
1245 | shift;; | |
1246 | -h) shift; error=true;; | |
1247 | -r) shift; reuseval=true;; | |
dfe9444c | 1248 | -s) shift; silent=true; realsilent=true;; |
2304df62 | 1249 | -E) shift; alldone=exit;; |
16d20bd9 | 1250 | -K) shift; knowitall=true;; |
ecfc5424 | 1251 | -O) shift; override=true;; |
dfe9444c | 1252 | -S) shift; silent=true; extractsh=true;; |
a0d0e21e LW |
1253 | -D) |
1254 | shift | |
1255 | case "$1" in | |
1256 | *=) | |
1257 | echo "$me: use '-U symbol=', not '-D symbol='." >&2 | |
1258 | echo "$me: ignoring -D $1" >&2 | |
1259 | ;; | |
ecfc5424 | 1260 | *=*) echo "$1" | \ |
1aef975c AD |
1261 | sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;; |
1262 | *) echo "$1='define'" >> optdef.sh;; | |
a0d0e21e LW |
1263 | esac |
1264 | shift | |
1265 | ;; | |
1266 | -U) | |
1267 | shift | |
1268 | case "$1" in | |
1aef975c | 1269 | *=) echo "$1" >> optdef.sh;; |
a0d0e21e LW |
1270 | *=*) |
1271 | echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2 | |
1272 | echo "$me: ignoring -U $1" >&2 | |
1273 | ;; | |
1aef975c | 1274 | *) echo "$1='undef'" >> optdef.sh;; |
a0d0e21e LW |
1275 | esac |
1276 | shift | |
1277 | ;; | |
02e93a22 JH |
1278 | -A) |
1279 | shift | |
1280 | xxx='' | |
1281 | yyy="$1" | |
02e93a22 | 1282 | zzz='' |
5f83a3e9 | 1283 | uuu=undef |
02e93a22 | 1284 | case "$yyy" in |
5f83a3e9 JH |
1285 | *=*) zzz=`echo $yyy|sed 's!=.*!!'` |
1286 | case "$zzz" in | |
1287 | *:*) zzz='' ;; | |
1288 | *) xxx=append | |
1289 | zzz=" "`echo $yyy|sed 's!^[^=]*=!!'` | |
1290 | yyy=`echo $yyy|sed 's!=.*!!'` ;; | |
1291 | esac | |
1292 | ;; | |
1293 | esac | |
1294 | case "$xxx" in | |
1295 | '') case "$yyy" in | |
1296 | *:*) xxx=`echo $yyy|sed 's!:.*!!'` | |
1297 | yyy=`echo $yyy|sed 's!^[^:]*:!!'` | |
1298 | zzz=`echo $yyy|sed 's!^[^=]*=!!'` | |
1299 | yyy=`echo $yyy|sed 's!=.*!!'` ;; | |
1300 | *) xxx=`echo $yyy|sed 's!:.*!!'` | |
1301 | yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;; | |
1302 | esac | |
1303 | ;; | |
1304 | esac | |
02e93a22 JH |
1305 | case "$xxx" in |
1306 | append) | |
5f83a3e9 | 1307 | echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;; |
02e93a22 | 1308 | clear) |
5f83a3e9 | 1309 | echo "$yyy=''" >> posthint.sh ;; |
02e93a22 JH |
1310 | define) |
1311 | case "$zzz" in | |
1312 | '') zzz=define ;; | |
1313 | esac | |
5f83a3e9 | 1314 | echo "$yyy='$zzz'" >> posthint.sh ;; |
02e93a22 | 1315 | eval) |
5f83a3e9 | 1316 | echo "eval \"$yyy=$zzz\"" >> posthint.sh ;; |
02e93a22 | 1317 | prepend) |
5f83a3e9 | 1318 | echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;; |
02e93a22 JH |
1319 | undef) |
1320 | case "$zzz" in | |
1321 | '') zzz="$uuu" ;; | |
1322 | esac | |
5f83a3e9 JH |
1323 | echo "$yyy=$zzz" >> posthint.sh ;; |
1324 | *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;; | |
02e93a22 | 1325 | esac |
bde6b06b | 1326 | shift |
02e93a22 | 1327 | ;; |
dfe9444c | 1328 | -V) echo "$me generated by metaconfig 3.0 PL70." >&2 |
5f83a3e9 | 1329 | exit 0;; |
2304df62 | 1330 | --) break;; |
a0d0e21e | 1331 | -*) echo "$me: unknown option $1" >&2; shift; error=true;; |
2304df62 AD |
1332 | *) break;; |
1333 | esac | |
1334 | done | |
1335 | ||
1336 | case "$error" in | |
1337 | true) | |
1338 | cat >&2 <<EOM | |
2afac517 | 1339 | Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value] |
02e93a22 | 1340 | [-U symbol] [-U symbol=] [-A command:symbol...] |
2304df62 AD |
1341 | -d : use defaults for all answers. |
1342 | -e : go on without questioning past the production of config.sh. | |
1343 | -f : specify an alternate default configuration file. | |
1344 | -h : print this help message and exit (with an error status). | |
1345 | -r : reuse C symbols value if possible (skips costly nm extraction). | |
1346 | -s : silent mode, only echoes questions and essential information. | |
a0d0e21e LW |
1347 | -D : define symbol to have some value: |
1348 | -D symbol symbol gets the value 'define' | |
1349 | -D symbol=value symbol gets the value 'value' | |
2304df62 | 1350 | -E : stop at the end of questions, after having produced config.sh. |
16d20bd9 | 1351 | -K : do not use unless you know what you are doing. |
ecfc5424 | 1352 | -O : let -D and -U override definitions from loaded configuration file. |
2304df62 | 1353 | -S : perform variable substitutions on all .SH files (can mix with -f) |
a0d0e21e LW |
1354 | -U : undefine symbol: |
1355 | -U symbol symbol gets the value 'undef' | |
1356 | -U symbol= symbol gets completely empty | |
02e93a22 | 1357 | -A : manipulate symbol after the platform specific hints have been applied: |
5f83a3e9 | 1358 | -A symbol=value append " "value to symbol |
02e93a22 JH |
1359 | -A append:symbol=value append value to symbol |
1360 | -A define:symbol=value define symbol to have value | |
02e93a22 JH |
1361 | -A clear:symbol define symbol to be '' |
1362 | -A define:symbol define symbol to be 'define' | |
1363 | -A eval:symbol=value define symbol to be eval of value | |
1364 | -A prepend:symbol=value prepend value to symbol | |
1365 | -A undef:symbol define symbol to be 'undef' | |
1366 | -A undef:symbol= define symbol to be '' | |
2304df62 AD |
1367 | -V : print version number and exit (with a zero status). |
1368 | EOM | |
1369 | exit 1 | |
1370 | ;; | |
1371 | esac | |
1372 | ||
dfe9444c AD |
1373 | : Sanity checks |
1374 | case "$fastread$alldone" in | |
1375 | yescont|yesexit) ;; | |
1376 | *) | |
aaeb8e51 GS |
1377 | case "$extractsh" in |
1378 | true) ;; | |
1379 | *) | |
1380 | if test ! -t 0; then | |
1381 | echo "Say 'sh Configure', not 'sh <Configure'" | |
1382 | exit 1 | |
1383 | fi | |
1384 | ;; | |
1385 | esac | |
dfe9444c AD |
1386 | ;; |
1387 | esac | |
1388 | ||
2304df62 AD |
1389 | exec 4>&1 |
1390 | case "$silent" in | |
1391 | true) exec 1>/dev/null;; | |
1392 | esac | |
1393 | ||
ecfc5424 | 1394 | : run the defines and the undefines, if any, but leave the file out there... |
1aef975c AD |
1395 | touch optdef.sh |
1396 | . ./optdef.sh | |
02e93a22 JH |
1397 | : create the posthint manipulation script and leave the file out there... |
1398 | touch posthint.sh | |
a0d0e21e | 1399 | |
2304df62 | 1400 | : set package name |
85e6fe83 | 1401 | package=perl5 |
b4eb6b3d JH |
1402 | first=`echo $package | sed -e 's/^\(.\).*/\1/'` |
1403 | last=`echo $package | sed -e 's/^.\(.*\)/\1/'` | |
1404 | case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in | |
1405 | ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;; | |
1406 | *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;; | |
1407 | esac | |
2304df62 | 1408 | |
2304df62 AD |
1409 | : Some greps do not return status, grrr. |
1410 | echo "grimblepritz" >grimble | |
1411 | if grep blurfldyick grimble >/dev/null 2>&1 ; then | |
1412 | contains=contains | |
1413 | elif grep grimblepritz grimble >/dev/null 2>&1 ; then | |
1414 | contains=grep | |
1415 | else | |
1416 | contains=contains | |
1417 | fi | |
1418 | rm -f grimble | |
1419 | : the following should work in any shell | |
1420 | case "$contains" in | |
1421 | contains*) | |
1422 | echo " " | |
1423 | echo "AGH! Grep doesn't return a status. Attempting remedial action." | |
1424 | cat >contains <<'EOSS' | |
1425 | grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp | |
1426 | EOSS | |
1427 | chmod +x contains | |
1428 | esac | |
1429 | ||
dfe9444c AD |
1430 | : Find the path to the source tree |
1431 | case "$src" in | |
1432 | '') case "$0" in | |
b233458b JH |
1433 | */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'` |
1434 | case "$src" in | |
1435 | /*) ;; | |
1436 | *) src=`cd ../$src && pwd` ;; | |
1437 | esac | |
1438 | ;; | |
dfe9444c AD |
1439 | *) src='.';; |
1440 | esac;; | |
1441 | esac | |
1442 | case "$src" in | |
1443 | '') src=/ | |
1444 | rsrc=/ | |
1445 | ;; | |
1446 | /*) rsrc="$src";; | |
1447 | *) rsrc="../$src";; | |
1448 | esac | |
1449 | if test -f $rsrc/Configure && \ | |
1450 | $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1 | |
1451 | then | |
1452 | : found it, so we are ok. | |
1453 | else | |
1454 | rsrc='' | |
1455 | for src in . .. ../.. ../../.. ../../../..; do | |
1456 | if test -f ../$src/Configure && \ | |
1457 | $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1 | |
1458 | then | |
1459 | rsrc=../$src | |
1460 | break | |
1461 | fi | |
1462 | done | |
1463 | fi | |
1464 | case "$rsrc" in | |
1465 | '') | |
1466 | cat <<EOM >&4 | |
1467 | ||
1468 | Sorry, I can't seem to locate the source dir for $package. Please start | |
1469 | Configure with an explicit path -- i.e. /some/path/Configure. | |
1470 | ||
1471 | EOM | |
1472 | exit 1 | |
1473 | ;; | |
1474 | ../.) rsrc='..';; | |
1475 | *) | |
1476 | echo " " | |
1477 | echo "Sources for $package found in \"$src\"." >&4 | |
1478 | ;; | |
1479 | esac | |
1480 | ||
1481 | : script used to extract .SH files with variable substitutions | |
1482 | cat >extract <<'EOS' | |
2000072c | 1483 | CONFIGDOTSH=true |
dfe9444c AD |
1484 | echo "Doing variable substitutions on .SH files..." |
1485 | if test -f $src/MANIFEST; then | |
f7ab18e9 | 1486 | set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'` |
dfe9444c AD |
1487 | else |
1488 | echo "(Looking for .SH files under the source directory.)" | |
1489 | set x `(cd $src; find . -name "*.SH" -print)` | |
1490 | fi | |
1491 | shift | |
1492 | case $# in | |
1493 | 0) set x `(cd $src; echo *.SH)`; shift;; | |
1494 | esac | |
1495 | if test ! -f $src/$1; then | |
1496 | shift | |
1497 | fi | |
1498 | mkdir_p=' | |
1499 | name=$1; | |
1500 | create=""; | |
1501 | while test $name; do | |
1502 | if test ! -d "$name"; then | |
1503 | create="$name $create"; | |
1504 | name=`echo $name | sed -e "s|^[^/]*$||"`; | |
1505 | name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`; | |
1506 | else | |
1507 | name=""; | |
1508 | fi; | |
1509 | done; | |
1510 | for file in $create; do | |
1511 | mkdir $file; | |
1512 | done | |
1513 | ' | |
1514 | for file in $*; do | |
1515 | case "$src" in | |
1516 | ".") | |
1517 | case "$file" in | |
1518 | */*) | |
1519 | dir=`expr X$file : 'X\(.*\)/'` | |
1520 | file=`expr X$file : 'X.*/\(.*\)'` | |
1521 | (cd $dir && . ./$file) | |
1522 | ;; | |
1523 | *) | |
1524 | . ./$file | |
1525 | ;; | |
1526 | esac | |
1527 | ;; | |
1528 | *) | |
1529 | case "$file" in | |
1530 | */*) | |
1531 | dir=`expr X$file : 'X\(.*\)/'` | |
1532 | file=`expr X$file : 'X.*/\(.*\)'` | |
1533 | (set x $dir; shift; eval $mkdir_p) | |
1534 | sh <$src/$dir/$file | |
1535 | ;; | |
1536 | *) | |
1537 | sh <$src/$file | |
1538 | ;; | |
1539 | esac | |
1540 | ;; | |
1541 | esac | |
1542 | done | |
1543 | if test -f $src/config_h.SH; then | |
1544 | if test ! -f config.h; then | |
1545 | : oops, they left it out of MANIFEST, probably, so do it anyway. | |
1546 | . $src/config_h.SH | |
1547 | fi | |
1548 | fi | |
1549 | EOS | |
1550 | ||
1551 | : extract files and exit if asked to do so | |
1552 | case "$extractsh" in | |
1553 | true) | |
1554 | case "$realsilent" in | |
1555 | true) ;; | |
1556 | *) exec 1>&4;; | |
1557 | esac | |
1558 | case "$config_sh" in | |
1559 | '') config_sh='config.sh';; | |
1560 | esac | |
1561 | echo " " | |
1562 | echo "Fetching answers from $config_sh..." | |
1563 | cd .. | |
1564 | . $config_sh | |
1565 | test "$override" && . ./optdef.sh | |
1566 | echo " " | |
1567 | . UU/extract | |
1568 | rm -rf UU | |
1569 | echo "Done." | |
1570 | exit 0 | |
1571 | ;; | |
1572 | esac | |
1573 | ||
1574 | : Eunice requires " " instead of "", can you believe it | |
1575 | echo " " | |
1576 | : Here we go... | |
1577 | echo "Beginning of configuration questions for $package." | |
1578 | ||
1579 | trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15 | |
1580 | ||
2304df62 AD |
1581 | : first determine how to suppress newline on echo command |
1582 | echo " " | |
1583 | echo "Checking echo to see how to suppress newlines..." | |
1584 | (echo "hi there\c" ; echo " ") >.echotmp | |
1585 | if $contains c .echotmp >/dev/null 2>&1 ; then | |
1586 | echo "...using -n." | |
1587 | n='-n' | |
1588 | c='' | |
1589 | else | |
1590 | cat <<'EOM' | |
1591 | ...using \c | |
1592 | EOM | |
1593 | n='' | |
1594 | c='\c' | |
1595 | fi | |
1596 | echo $n "The star should be here-->$c" | |
1597 | echo '*' | |
1598 | rm -f .echotmp | |
1599 | ||
1600 | : Now test for existence of everything in MANIFEST | |
1601 | echo " " | |
dfe9444c | 1602 | if test -f $rsrc/MANIFEST; then |
2304df62 | 1603 | echo "First let's make sure your kit is complete. Checking..." >&4 |
dfe9444c | 1604 | awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50 |
2304df62 | 1605 | rm -f missing |
dfe9444c | 1606 | tmppwd=`pwd` |
2304df62 | 1607 | for filelist in x??; do |
dfe9444c | 1608 | (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing) |
2304df62 AD |
1609 | done |
1610 | if test -s missing; then | |
1611 | cat missing >&4 | |
1612 | cat >&4 <<'EOM' | |
1613 | ||
1614 | THIS PACKAGE SEEMS TO BE INCOMPLETE. | |
1615 | ||
1616 | You have the option of continuing the configuration process, despite the | |
1617 | distinct possibility that your kit is damaged, by typing 'y'es. If you | |
1618 | do, don't blame me if something goes wrong. I advise you to type 'n'o | |
7f2de2d2 | 1619 | and contact the author (perlbug@perl.org). |
2304df62 AD |
1620 | |
1621 | EOM | |
1622 | echo $n "Continue? [n] $c" >&4 | |
1623 | read ans | |
1624 | case "$ans" in | |
1625 | y*) | |
1626 | echo "Continuing..." >&4 | |
1627 | rm -f missing | |
1628 | ;; | |
1629 | *) | |
1630 | echo "ABORTING..." >&4 | |
1631 | kill $$ | |
1632 | ;; | |
1633 | esac | |
1634 | else | |
dfe9444c | 1635 | echo "Looks good..." |
2304df62 AD |
1636 | fi |
1637 | else | |
1638 | echo "There is no MANIFEST file. I hope your kit is complete !" | |
1639 | fi | |
1640 | rm -f missing x?? | |
1641 | ||
5ff3f7a4 GS |
1642 | echo " " |
1643 | : Find the appropriate value for a newline for tr | |
1644 | if test -n "$DJGPP"; then | |
1645 | trnl='\012' | |
1646 | fi | |
1647 | if test X"$trnl" = X; then | |
1648 | case "`echo foo|tr '\n' x 2>/dev/null`" in | |
1649 | foox) trnl='\n' ;; | |
1650 | esac | |
1651 | fi | |
1652 | if test X"$trnl" = X; then | |
1653 | case "`echo foo|tr '\012' x 2>/dev/null`" in | |
1654 | foox) trnl='\012' ;; | |
1655 | esac | |
1656 | fi | |
1657 | if test X"$trnl" = X; then | |
1658 | cat <<EOM >&2 | |
1659 | ||
1660 | $me: Fatal Error: cannot figure out how to translate newlines with 'tr'. | |
1661 | ||
1662 | EOM | |
1663 | exit 1 | |
1664 | fi | |
1665 | ||
2304df62 AD |
1666 | : compute the number of columns on the terminal for proper question formatting |
1667 | case "$COLUMNS" in | |
1668 | '') COLUMNS='80';; | |
1669 | esac | |
1670 | ||
1671 | : set up the echo used in my read | |
1672 | myecho="case \"\$xxxm\" in | |
1673 | '') echo $n \"\$rp $c\" >&4;; | |
1674 | *) case \"\$rp\" in | |
1675 | '') echo $n \"[\$xxxm] $c\";; | |
1676 | *) | |
1677 | if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then | |
1678 | echo \"\$rp\" >&4 | |
1679 | echo $n \"[\$xxxm] $c\" >&4 | |
1680 | else | |
1681 | echo $n \"\$rp [\$xxxm] $c\" >&4 | |
1682 | fi | |
1683 | ;; | |
1684 | esac;; | |
1685 | esac" | |
1686 | ||
1687 | : now set up to do reads with possible shell escape and default assignment | |
1688 | cat <<EOSC >myread | |
28757baa | 1689 | $startsh |
2304df62 AD |
1690 | xxxm=\$dflt |
1691 | $myecho | |
1692 | ans='!' | |
1693 | case "\$fastread" in | |
1694 | yes) case "\$dflt" in | |
1695 | '') ;; | |
1696 | *) ans=''; | |
1697 | case "\$silent-\$rp" in | |
1698 | true-) ;; | |
1699 | *) echo " " >&4;; | |
1700 | esac;; | |
1701 | esac;; | |
1702 | *) case "\$silent" in | |
1703 | true) case "\$rp" in | |
1704 | '') ans='';; | |
1705 | esac;; | |
1706 | esac;; | |
1707 | esac | |
1708 | while expr "X\$ans" : "X!" >/dev/null; do | |
1709 | read answ | |
1710 | set x \$xxxm | |
1711 | shift | |
dfe9444c | 1712 | aok=''; eval "ans=\\"\$answ\\"" && aok=y |
2304df62 | 1713 | case "\$answ" in |
dfe9444c AD |
1714 | "!") |
1715 | sh 1>&4 | |
1716 | echo " " | |
1717 | $myecho | |
1718 | ;; | |
1719 | !*) | |
1720 | set x \`expr "X\$ans" : "X!\(.*\)\$"\` | |
1721 | shift | |
1722 | sh 1>&4 -c "\$*" | |
1723 | echo " " | |
1724 | $myecho | |
1725 | ;; | |
2304df62 AD |
1726 | "\$ans") |
1727 | case "\$ans" in | |
ecfc5424 AD |
1728 | \\&*) |
1729 | set x \`expr "X\$ans" : "X&\(.*\)\$"\` | |
1730 | shift | |
1731 | case "\$1" in | |
1732 | -d) | |
1733 | fastread=yes | |
40a7a20a | 1734 | echo "(OK, I'll run with -d after this question.)" >&4 |
ecfc5424 AD |
1735 | ;; |
1736 | -*) | |
40a7a20a | 1737 | echo "*** Sorry, \$1 not supported yet." >&4 |
ecfc5424 AD |
1738 | ;; |
1739 | esac | |
1740 | $myecho | |
1741 | ans=! | |
1742 | ;; | |
2304df62 AD |
1743 | esac;; |
1744 | *) | |
1745 | case "\$aok" in | |
1746 | y) | |
1747 | echo "*** Substitution done -- please confirm." | |
1748 | xxxm="\$ans" | |
c9795ab7 | 1749 | ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\` |
2304df62 AD |
1750 | xxxm="\$ans" |
1751 | ans=! | |
1752 | ;; | |
1753 | *) | |
1754 | echo "*** Error -- try again." | |
1755 | ans=! | |
1756 | ;; | |
1757 | esac | |
1758 | $myecho | |
1759 | ;; | |
1760 | esac | |
1761 | case "\$ans\$xxxm\$nostick" in | |
1762 | '') | |
1763 | ans=! | |
1764 | $myecho | |
1765 | ;; | |
1766 | esac | |
1767 | done | |
1768 | case "\$ans" in | |
1769 | '') ans="\$xxxm";; | |
1770 | esac | |
1771 | EOSC | |
1772 | ||
1773 | : create .config dir to save info across Configure sessions | |
1774 | test -d ../.config || mkdir ../.config | |
1775 | cat >../.config/README <<EOF | |
1776 | This directory created by Configure to save information that should | |
dfe9444c | 1777 | persist across sessions for $package. |
2304df62 AD |
1778 | |
1779 | You may safely delete it if you wish. | |
1780 | EOF | |
1781 | ||
9507cadf | 1782 | xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h` |
af960fef | 1783 | case "$usedevel" in |
0107c034 | 1784 | $define|true|[yY]*) ;; |
9507cadf | 1785 | *) case "$xversion" in |
0107c034 JH |
1786 | *[13579]) |
1787 | cat >&4 <<EOH | |
1788 | *** WHOA THERE!!! *** | |
1789 | ||
1790 | This is an UNSTABLE DEVELOPMENT release. | |
9507cadf JH |
1791 | The version of this $package distribution is $xversion, that is, odd, |
1792 | (as opposed to even) and that signifies a development release. | |
3d5d58b1 | 1793 | If you want a maintenance release, you want an even-numbered version. |
0107c034 JH |
1794 | |
1795 | Do ***NOT*** install this into production use. | |
1796 | Data corruption and crashes are possible. | |
1797 | ||
1798 | It is most seriously suggested that you do not continue any further | |
1799 | unless you want to help in developing and debugging Perl. | |
1800 | ||
1801 | EOH | |
1802 | rp='Do you really want to continue?' | |
1803 | dflt='n' | |
1804 | . ./myread | |
1805 | case "$ans" in | |
1806 | [yY]) echo >&4 "Okay, continuing." ;; | |
1807 | *) echo >&4 "Okay, bye." | |
1808 | exit 1 | |
1809 | ;; | |
1810 | esac | |
1811 | ;; | |
1812 | esac | |
1813 | ;; | |
1814 | esac | |
1815 | ||
2304df62 AD |
1816 | : general instructions |
1817 | needman=true | |
1818 | firsttime=true | |
760ac839 | 1819 | user=`(logname) 2>/dev/null` |
dfe9444c AD |
1820 | case "$user" in |
1821 | '') user=`whoami 2>&1`;; | |
760ac839 | 1822 | esac |
2304df62 AD |
1823 | if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then |
1824 | firsttime=false | |
1825 | echo " " | |
1826 | rp='Would you like to see the instructions?' | |
1827 | dflt=n | |
1828 | . ./myread | |
1829 | case "$ans" in | |
1830 | [yY]*) ;; | |
1831 | *) needman=false;; | |
1832 | esac | |
1833 | fi | |
1834 | if $needman; then | |
1835 | cat <<EOH | |
4e2a5f63 | 1836 | |
2304df62 | 1837 | This installation shell script will examine your system and ask you questions |
a0d0e21e | 1838 | to determine how the perl5 package should be installed. If you get |
2304df62 AD |
1839 | stuck on a question, you may use a ! shell escape to start a subshell or |
1840 | execute a command. Many of the questions will have default answers in square | |
1841 | brackets; typing carriage return will give you the default. | |
1842 | ||
1843 | On some of the questions which ask for file or directory names you are allowed | |
1844 | to use the ~name construct to specify the login directory belonging to "name", | |
1845 | even if you don't have a shell which knows about that. Questions where this is | |
1846 | allowed will be marked "(~name ok)". | |
1847 | ||
1848 | EOH | |
1849 | rp='' | |
1850 | dflt='Type carriage return to continue' | |
1851 | . ./myread | |
1852 | cat <<'EOH' | |
1853 | ||
1854 | The prompter used in this script allows you to use shell variables and | |
1855 | backticks in your answers. You may use $1, $2, etc... to refer to the words | |
1856 | in the default answer, as if the default line was a set of arguments given to a | |
1857 | script shell. This means you may also use $* to repeat the whole default line, | |
1858 | so you do not have to re-type everything to add something to the default. | |
1859 | ||
1860 | Everytime there is a substitution, you will have to confirm. If there is an | |
1861 | error (e.g. an unmatched backtick), the default answer will remain unchanged | |
1862 | and you will be prompted again. | |
1863 | ||
1864 | If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all | |
1865 | the questions and use the computed defaults (or the previous answers if there | |
1866 | was already a config.sh file). Type 'Configure -h' for a list of options. | |
ecfc5424 | 1867 | You may also start interactively and then answer '& -d' at any prompt to turn |
dfe9444c | 1868 | on the non-interactive behaviour for the remainder of the execution. |
2304df62 AD |
1869 | |
1870 | EOH | |
1871 | . ./myread | |
1872 | cat <<EOH | |
1873 | ||
1874 | Much effort has been expended to ensure that this shell script will run on any | |
1875 | Unix system. If despite that it blows up on yours, your best bet is to edit | |
40000a8c AD |
1876 | Configure and run it again. If you can't run Configure for some reason, |
1877 | you'll have to generate a config.sh file by hand. Whatever problems you | |
7f2de2d2 | 1878 | have, let me (perlbug@perl.org) know how I blew it. |
2304df62 AD |
1879 | |
1880 | This installation script affects things in two ways: | |
1881 | ||
1882 | 1) it may do direct variable substitutions on some of the files included | |
1883 | in this kit. | |
1884 | 2) it builds a config.h file for inclusion in C programs. You may edit | |
1885 | any of these files as the need arises after running this script. | |
1886 | ||
1887 | If you make a mistake on a question, there is no easy way to back up to it | |
1888 | currently. The easiest thing to do is to edit config.sh and rerun all the SH | |
1889 | files. Configure will offer to let you do this before it runs the SH files. | |
1890 | ||
1891 | EOH | |
1892 | dflt='Type carriage return to continue' | |
1893 | . ./myread | |
1894 | case "$firsttime" in | |
1895 | true) echo $user >>../.config/instruct;; | |
1896 | esac | |
1897 | fi | |
1898 | ||
2304df62 AD |
1899 | : find out where common programs are |
1900 | echo " " | |
1901 | echo "Locating common programs..." >&4 | |
1902 | cat <<EOSC >loc | |
1903 | $startsh | |
1904 | case \$# in | |
1905 | 0) exit 1;; | |
1906 | esac | |
1907 | thing=\$1 | |
1908 | shift | |
1909 | dflt=\$1 | |
1910 | shift | |
1911 | for dir in \$*; do | |
1912 | case "\$thing" in | |
1913 | .) | |
1914 | if test -d \$dir/\$thing; then | |
1915 | echo \$dir | |
1916 | exit 0 | |
1917 | fi | |
1918 | ;; | |
1919 | *) | |
a0d0e21e | 1920 | for thisthing in \$dir/\$thing; do |
ecfc5424 | 1921 | : just loop through to pick last item |
a0d0e21e | 1922 | done |
25f94b33 | 1923 | if test -f \$thisthing; then |
a0d0e21e | 1924 | echo \$thisthing |
2304df62 AD |
1925 | exit 0 |
1926 | elif test -f \$dir/\$thing.exe; then | |
c4f23d77 AD |
1927 | if test -n "$DJGPP"; then |
1928 | echo \$dir/\$thing.exe | |
1929 | else | |
1930 | : on Eunice apparently | |
1931 | echo \$dir/\$thing | |
1932 | fi | |
2304df62 AD |
1933 | exit 0 |
1934 | fi | |
1935 | ;; | |
1936 | esac | |
1937 | done | |
1938 | echo \$dflt | |
1939 | exit 1 | |
1940 | EOSC | |
1941 | chmod +x loc | |
1942 | $eunicefix loc | |
1943 | loclist=" | |
1944 | awk | |
1945 | cat | |
b4eb6b3d JH |
1946 | comm |
1947 | cp | |
2304df62 AD |
1948 | echo |
1949 | expr | |
1950 | grep | |
a0d0e21e | 1951 | ls |
dfe9444c | 1952 | make |
b4eb6b3d | 1953 | mkdir |
2304df62 AD |
1954 | rm |
1955 | sed | |
b4eb6b3d | 1956 | sort |
85e6fe83 | 1957 | touch |
2304df62 | 1958 | tr |
b4eb6b3d | 1959 | uniq |
2304df62 AD |
1960 | " |
1961 | trylist=" | |
1962 | Mcc | |
dfe9444c | 1963 | ar |
b4eb6b3d | 1964 | byacc |
2304df62 | 1965 | cpp |
b4eb6b3d | 1966 | csh |
2304df62 AD |
1967 | date |
1968 | egrep | |
8ff267be | 1969 | gzip |
b4eb6b3d | 1970 | less |
8ff267be | 1971 | ln |
b4eb6b3d | 1972 | more |
693762b4 | 1973 | nm |
b4eb6b3d JH |
1974 | nroff |
1975 | pg | |
2304df62 AD |
1976 | test |
1977 | uname | |
8ff267be | 1978 | zip |
2304df62 | 1979 | " |
8e07c86e | 1980 | pth=`echo $PATH | sed -e "s/$p_/ /g"` |
2304df62 AD |
1981 | pth="$pth /lib /usr/lib" |
1982 | for file in $loclist; do | |
dfe9444c AD |
1983 | eval xxx=\$$file |
1984 | case "$xxx" in | |
1985 | /*|?:[\\/]*) | |
1986 | if test -f "$xxx"; then | |
1987 | : ok | |
1988 | else | |
1989 | echo "WARNING: no $xxx -- ignoring your setting for $file." >&4 | |
1990 | xxx=`./loc $file $file $pth` | |
1991 | fi | |
1992 | ;; | |
1993 | '') xxx=`./loc $file $file $pth`;; | |
1994 | *) xxx=`./loc $xxx $xxx $pth`;; | |
1995 | esac | |
2304df62 AD |
1996 | eval $file=$xxx |
1997 | eval _$file=$xxx | |
1998 | case "$xxx" in | |
1999 | /*) | |
2000 | echo $file is in $xxx. | |
2001 | ;; | |
8e07c86e AD |
2002 | ?:[\\/]*) |
2003 | echo $file is in $xxx. | |
2004 | ;; | |
2304df62 | 2005 | *) |
25f94b33 AD |
2006 | echo "I don't know where '$file' is, and my life depends on it." >&4 |
2007 | echo "Go find a public domain implementation or fix your PATH setting!" >&4 | |
4633a7c4 | 2008 | exit 1 |
2304df62 AD |
2009 | ;; |
2010 | esac | |
2011 | done | |
2012 | echo " " | |
2013 | echo "Don't worry if any of the following aren't found..." | |
2014 | say=offhand | |
2015 | for file in $trylist; do | |
dfe9444c AD |
2016 | eval xxx=\$$file |
2017 | case "$xxx" in | |
2018 | /*|?:[\\/]*) | |
2019 | if test -f "$xxx"; then | |
2020 | : ok | |
2021 | else | |
2022 | echo "WARNING: no $xxx -- ignoring your setting for $file." >&4 | |
2023 | xxx=`./loc $file $file $pth` | |
2024 | fi | |
2025 | ;; | |
2026 | '') xxx=`./loc $file $file $pth`;; | |
2027 | *) xxx=`./loc $xxx $xxx $pth`;; | |
2028 | esac | |
2304df62 AD |
2029 | eval $file=$xxx |
2030 | eval _$file=$xxx | |
2031 | case "$xxx" in | |
2032 | /*) | |
2033 | echo $file is in $xxx. | |
2034 | ;; | |
8e07c86e AD |
2035 | ?:[\\/]*) |
2036 | echo $file is in $xxx. | |
2037 | ;; | |
2304df62 AD |
2038 | *) |
2039 | echo "I don't see $file out there, $say." | |
2040 | say=either | |
2041 | ;; | |
2042 | esac | |
2043 | done | |
2044 | case "$egrep" in | |
2045 | egrep) | |
2046 | echo "Substituting grep for egrep." | |
2047 | egrep=$grep | |
2048 | ;; | |
2049 | esac | |
8ff267be | 2050 | case "$ln" in |
2051 | ln) | |
2052 | echo "Substituting cp for ln." | |
2053 | ln=$cp | |
2054 | ;; | |
2055 | esac | |
2304df62 AD |
2056 | case "$test" in |
2057 | test) | |
2058 | echo "Hopefully test is built into your sh." | |
2059 | ;; | |
2060 | *) | |
ecfc5424 | 2061 | if `sh -c "PATH= test true" >/dev/null 2>&1`; then |
2304df62 AD |
2062 | echo "Using the test built into your sh." |
2063 | test=test | |
2064 | _test=test | |
2065 | fi | |
2066 | ;; | |
2067 | esac | |
2068 | case "$echo" in | |
2069 | echo) | |
2070 | echo "Hopefully echo is built into your sh." | |
2071 | ;; | |
2072 | '') ;; | |
2073 | *) | |
2074 | echo " " | |
2075 | echo "Checking compatibility between $echo and builtin echo (if any)..." >&4 | |
2076 | $echo $n "hi there$c" >foo1 | |
2077 | echo $n "hi there$c" >foo2 | |
2078 | if cmp foo1 foo2 >/dev/null 2>&1; then | |
2079 | echo "They are compatible. In fact, they may be identical." | |
2080 | else | |
2081 | case "$n" in | |
2082 | '-n') n='' c='\c';; | |
2083 | *) n='-n' c='';; | |
2084 | esac | |
2085 | cat <<FOO | |
2086 | They are not compatible! You are probably running ksh on a non-USG system. | |
2087 | I'll have to use $echo instead of the builtin, since Bourne shell doesn't | |
2088 | have echo built in and we may have to run some Bourne shell scripts. That | |
2089 | means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous. | |
2090 | ||
2091 | FOO | |
2092 | $echo $n "The star should be here-->$c" | |
2093 | $echo "*" | |
2094 | fi | |
2095 | $rm -f foo1 foo2 | |
2096 | ;; | |
2097 | esac | |
2098 | ||
2573c5f9 JH |
2099 | cat <<EOS >checkcc |
2100 | $startsh | |
2101 | EOS | |
2102 | cat <<'EOSC' >>checkcc | |
2103 | case "$cc" in | |
2104 | '') ;; | |
2105 | *) $rm -f try try.* | |
2106 | $cat >try.c <<EOM | |
2107 | int main(int argc, char *argv[]) { | |
2108 | return 0; | |
2109 | } | |
2110 | EOM | |
7a282f6d | 2111 | if $cc -o try $ccflags try.c; then |
2573c5f9 JH |
2112 | : |
2113 | else | |
2114 | echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4 | |
2115 | despair=yes | |
2116 | trygcc=yes | |
2117 | case "$cc" in | |
2118 | *gcc*) trygcc=no ;; | |
2119 | esac | |
2120 | case "`$cc -v -c try.c 2>&1`" in | |
2121 | *gcc*) trygcc=no ;; | |
2122 | esac | |
2123 | if $test X"$trygcc" = Xyes; then | |
2124 | if gcc -o try -c try.c; then | |
2125 | echo " " | |
2126 | echo "You seem to have a working gcc, though." >&4 | |
2127 | rp="Would you like to use it?" | |
2128 | dflt=y | |
2129 | if $test -f myread; then | |
2130 | . ./myread | |
2131 | else | |
2132 | if $test -f UU/myread; then | |
2133 | . ./UU/myread | |
2134 | else | |
2135 | echo "Cannot find myread, sorry. Aborting." >&2 | |
2136 | exit 1 | |
2137 | fi | |
2138 | fi | |
2139 | case "$ans" in | |
e723fc21 | 2140 | [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;; |
2573c5f9 JH |
2141 | esac |
2142 | fi | |
2143 | fi | |
2144 | if $test X"$despair" = Xyes; then | |
5dd4fbdf MB |
2145 | $cat >&4 <<EOM |
2146 | You need to find a working C compiler. | |
2147 | Either (purchase and) install the C compiler supplied by your OS vendor, | |
2148 | or for a free C compiler try http://gcc.gnu.org/ | |
2149 | I cannot continue any further, aborting. | |
2150 | EOM | |
2573c5f9 JH |
2151 | exit 1 |
2152 | fi | |
2153 | fi | |
2154 | $rm -f try try.* | |
2155 | ;; | |
2156 | esac | |
2157 | EOSC | |
2158 | ||
a0d0e21e LW |
2159 | : determine whether symbolic links are supported |
2160 | echo " " | |
2161 | $touch blurfl | |
2162 | if $ln -s blurfl sym > /dev/null 2>&1 ; then | |
2163 | echo "Symbolic links are supported." >&4 | |
2164 | lns="$ln -s" | |
2165 | else | |
2166 | echo "Symbolic links are NOT supported." >&4 | |
2167 | lns="$ln" | |
2168 | fi | |
2169 | $rm -f blurfl sym | |
2170 | ||
ecfc5424 AD |
2171 | : see whether [:lower:] and [:upper:] are supported character classes |
2172 | echo " " | |
ecfc5424 AD |
2173 | case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in |
2174 | ABYZ) | |
2175 | echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4 | |
2176 | up='[:upper:]' | |
2177 | low='[:lower:]' | |
2178 | ;; | |
28e8609d JH |
2179 | *) # There is a discontinuity in EBCDIC between 'I' and 'J' |
2180 | # (0xc9 and 0xd1), therefore that is a nice testing point. | |
2181 | if test "X$up" = X -o "X$low" = X; then | |
3eaeeeae | 2182 | case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in |
28e8609d JH |
2183 | ij) up='[A-Z]' |
2184 | low='[a-z]' | |
2185 | ;; | |
2186 | esac | |
2187 | fi | |
2188 | if test "X$up" = X -o "X$low" = X; then | |
3eaeeeae | 2189 | case "`echo IJ | $tr I-J i-j 2>/dev/null`" in |
28e8609d JH |
2190 | ij) up='A-Z' |
2191 | low='a-z' | |
2192 | ;; | |
2193 | esac | |
2194 | fi | |
2195 | if test "X$up" = X -o "X$low" = X; then | |
2196 | case "`echo IJ | od -x 2>/dev/null`" in | |
2197 | *C9D1*|*c9d1*) | |
2198 | echo "Hey, this might be EBCDIC." >&4 | |
2199 | if test "X$up" = X -o "X$low" = X; then | |
5ff3f7a4 | 2200 | case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in |
28e8609d JH |
2201 | ij) up='[A-IJ-RS-Z]' |
2202 | low='[a-ij-rs-z]' | |
2203 | ;; | |
2204 | esac | |
2205 | fi | |
2206 | if test "X$up" = X -o "X$low" = X; then | |
5ff3f7a4 | 2207 | case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in |
28e8609d JH |
2208 | ij) up='A-IJ-RS-Z' |
2209 | low='a-ij-rs-z' | |
2210 | ;; | |
2211 | esac | |
2212 | fi | |
2213 | ;; | |
2214 | esac | |
2215 | fi | |
2216 | esac | |
3eaeeeae | 2217 | case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in |
28e8609d JH |
2218 | ij) |
2219 | echo "Using $up and $low to convert case." >&4 | |
2220 | ;; | |
ecfc5424 | 2221 | *) |
28e8609d JH |
2222 | echo "I don't know how to translate letters from upper to lower case." >&4 |
2223 | echo "Your tr is not acting any way I know of." >&4 | |
2224 | exit 1 | |
2225 | ;; | |
ecfc5424 AD |
2226 | esac |
2227 | : set up the translation script tr, must be called with ./tr of course | |
2228 | cat >tr <<EOSC | |
2229 | $startsh | |
2230 | case "\$1\$2" in | |
2231 | '[A-Z][a-z]') exec $tr '$up' '$low';; | |
2232 | '[a-z][A-Z]') exec $tr '$low' '$up';; | |
2233 | esac | |
2234 | exec $tr "\$@" | |
2235 | EOSC | |
2236 | chmod +x tr | |
2237 | $eunicefix tr | |
2238 | ||
2304df62 AD |
2239 | : Try to determine whether config.sh was made on this system |
2240 | case "$config_sh" in | |
2241 | '') | |
43999f95 JH |
2242 | myuname=`$uname -a 2>/dev/null` |
2243 | $test -z "$myuname" && myuname=`hostname 2>/dev/null` | |
28e8609d JH |
2244 | # tr '[A-Z]' '[a-z]' would not work in EBCDIC |
2245 | # because the A-Z/a-z are not consecutive. | |
a0d0e21e | 2246 | myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \ |
3eaeeeae | 2247 | ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '` |
1aef975c | 2248 | newmyuname="$myuname" |
2304df62 | 2249 | dflt=n |
16d20bd9 AD |
2250 | case "$knowitall" in |
2251 | '') | |
2252 | if test -f ../config.sh; then | |
2253 | if $contains myuname= ../config.sh >/dev/null 2>&1; then | |
2254 | eval "`grep myuname= ../config.sh`" | |
2255 | fi | |
2256 | if test "X$myuname" = "X$newmyuname"; then | |
2257 | dflt=y | |
2258 | fi | |
2304df62 | 2259 | fi |
16d20bd9 AD |
2260 | ;; |
2261 | *) dflt=y;; | |
2262 | esac | |
2304df62 AD |
2263 | |
2264 | : Get old answers from old config file if Configure was run on the | |
2265 | : same system, otherwise use the hints. | |
2266 | hint=default | |
2267 | cd .. | |
2268 | if test -f config.sh; then | |
16d20bd9 AD |
2269 | echo " " |
2270 | rp="I see a config.sh file. Shall I use it to set the defaults?" | |
2304df62 AD |
2271 | . UU/myread |
2272 | case "$ans" in | |
f83701cd AD |
2273 | n*|N*) echo "OK, I'll ignore it." |
2274 | mv config.sh config.sh.old | |
2275 | myuname="$newmyuname" | |
2276 | ;; | |
2304df62 | 2277 | *) echo "Fetching default answers from your old config.sh file..." >&4 |
ecfc5424 AD |
2278 | tmp_n="$n" |
2279 | tmp_c="$c" | |
85cad39c | 2280 | tmp_sh="$sh" |
2304df62 AD |
2281 | . ./config.sh |
2282 | cp config.sh UU | |
ecfc5424 AD |
2283 | n="$tmp_n" |
2284 | c="$tmp_c" | |
85cad39c | 2285 | : Older versions did not always set $sh. Catch re-use of such |
2286 | : an old config.sh. | |
2287 | case "$sh" in | |
2288 | '') sh="$tmp_sh" ;; | |
2289 | esac | |
2304df62 AD |
2290 | hint=previous |
2291 | ;; | |
2292 | esac | |
2293 | fi | |
2573c5f9 | 2294 | . ./UU/checkcc |
2304df62 AD |
2295 | if test ! -f config.sh; then |
2296 | $cat <<EOM | |
2297 | ||
4e2a5f63 AD |
2298 | First time through, eh? I have some defaults handy for some systems |
2299 | that need some extra help getting the Configure answers right: | |
2304df62 AD |
2300 | |
2301 | EOM | |
dfe9444c | 2302 | (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4 |
2304df62 AD |
2303 | dflt='' |
2304 | : Half the following guesses are probably wrong... If you have better | |
7f2de2d2 | 2305 | : tests or hints, please send them to perlbug@perl.org |
2304df62 | 2306 | : The metaconfig authors would also appreciate a copy... |
a0d0e21e | 2307 | $test -f /irix && osname=irix |
85e6fe83 LW |
2308 | $test -f /xenix && osname=sco_xenix |
2309 | $test -f /dynix && osname=dynix | |
2310 | $test -f /dnix && osname=dnix | |
5f05dabc | 2311 | $test -f /lynx.os && osname=lynxos |
2312 | $test -f /unicos && osname=unicos && osvers=`$uname -r` | |
c71a9cee | 2313 | $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r` |
7a4c00b4 | 2314 | $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r` |
85e6fe83 | 2315 | $test -f /bin/mips && /bin/mips && osname=mips |
ecfc5424 AD |
2316 | $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \ |
2317 | $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4 | |
a0d0e21e LW |
2318 | $test -d /usr/apollo/bin && osname=apollo |
2319 | $test -f /etc/saf/_sactab && osname=svr4 | |
85e6fe83 | 2320 | $test -d /usr/include/minix && osname=minix |
e060872b | 2321 | if $test -d /MachTen -o -d /MachTen_Folder; then |
dfe9444c | 2322 | osname=machten |
4633a7c4 | 2323 | if $test -x /sbin/version; then |
dfe9444c | 2324 | osvers=`/sbin/version | $awk '{print $2}' | |
4633a7c4 LW |
2325 | $sed -e 's/[A-Za-z]$//'` |
2326 | elif $test -x /usr/etc/version; then | |
dfe9444c | 2327 | osvers=`/usr/etc/version | $awk '{print $2}' | |
4633a7c4 LW |
2328 | $sed -e 's/[A-Za-z]$//'` |
2329 | else | |
2330 | osvers="$2.$3" | |
2331 | fi | |
2332 | fi | |
aaacdc8b GS |
2333 | |
2334 | $test -f /sys/posix.dll && | |
2335 | $test -f /usr/bin/what && | |
2336 | set X `/usr/bin/what /sys/posix.dll` && | |
2337 | $test "$3" = UWIN && | |
2338 | osname=uwin && | |
2339 | osvers="$5" | |
2340 | ||
2304df62 AD |
2341 | if $test -f $uname; then |
2342 | set X $myuname | |
2343 | shift | |
2344 | ||
2304df62 | 2345 | case "$5" in |
85e6fe83 | 2346 | fps*) osname=fps ;; |
2304df62 AD |
2347 | mips*) |
2348 | case "$4" in | |
85e6fe83 LW |
2349 | umips) osname=umips ;; |
2350 | *) osname=mips ;; | |
2304df62 | 2351 | esac;; |
85e6fe83 LW |
2352 | [23]100) osname=mips ;; |
2353 | next*) osname=next ;; | |
ecfc5424 | 2354 | i386*) |
c6912327 JH |
2355 | tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'` |
2356 | if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then | |
619ffc2b JH |
2357 | osname='sco' |
2358 | osvers=$tmp | |
2359 | elif $test -f /etc/kconfig; then | |
ecfc5424 | 2360 | osname=isc |
bd628c73 | 2361 | if test "$lns" = "$ln -s"; then |
a0d0e21e LW |
2362 | osvers=4 |
2363 | elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then | |
2364 | osvers=3 | |
2304df62 | 2365 | elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then |
a0d0e21e | 2366 | osvers=2 |
ecfc5424 AD |
2367 | fi |
2368 | fi | |
2000072c | 2369 | tmp='' |
ecfc5424 | 2370 | ;; |
c4f23d77 AD |
2371 | pc*) |
2372 | if test -n "$DJGPP"; then | |
2373 | osname=dos | |
2374 | osvers=djgpp | |
2375 | fi | |
2376 | ;; | |
2304df62 AD |
2377 | esac |
2378 | ||
2379 | case "$1" in | |
a0d0e21e LW |
2380 | aix) osname=aix |
2381 | tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1` | |
2382 | case "$tmp" in | |
1aef975c | 2383 | 'not found') osvers="$4"."$3" ;; |
a0d0e21e LW |
2384 | '<3240'|'<>3240') osvers=3.2.0 ;; |
2385 | '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;; | |
2386 | '=3250'|'>3250') osvers=3.2.5 ;; | |
1aef975c | 2387 | *) osvers=$tmp;; |
a0d0e21e LW |
2388 | esac |
2389 | ;; | |
aaacdc8b GS |
2390 | bsd386) osname=bsd386 |
2391 | osvers=`$uname -r` | |
2392 | ;; | |
2393 | cygwin*) osname=cygwin | |
2394 | osvers="$3" | |
2395 | ;; | |
23f87696 SZ |
2396 | *dc.osx) osname=dcosx |
2397 | osvers="$3" | |
2398 | ;; | |
a0d0e21e LW |
2399 | dnix) osname=dnix |
2400 | osvers="$3" | |
2401 | ;; | |
2402 | domainos) osname=apollo | |
2403 | osvers="$3" | |
2404 | ;; | |
2405 | dgux) osname=dgux | |
2406 | osvers="$3" | |
2407 | ;; | |
760ac839 | 2408 | dynixptx*) osname=dynixptx |
e58e581d | 2409 | osvers=`echo "$4"|sed 's/^v//'` |
760ac839 | 2410 | ;; |
a0d0e21e LW |
2411 | freebsd) osname=freebsd |
2412 | osvers="$3" ;; | |
2413 | genix) osname=genix ;; | |
2414 | hp*) osname=hpux | |
bfb7748a | 2415 | osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'` |
a0d0e21e | 2416 | ;; |
a78b0d02 | 2417 | irix*) osname=irix |
a0d0e21e LW |
2418 | case "$3" in |
2419 | 4*) osvers=4 ;; | |
2420 | 5*) osvers=5 ;; | |
ecfc5424 | 2421 | *) osvers="$3" ;; |
a0d0e21e LW |
2422 | esac |
2423 | ;; | |
2424 | linux) osname=linux | |
2425 | case "$3" in | |
a0d0e21e LW |
2426 | *) osvers="$3" ;; |
2427 | esac | |
2428 | ;; | |
28e8609d JH |
2429 | MiNT) osname=mint |
2430 | ;; | |
2431 | netbsd*) osname=netbsd | |
ecfc5424 AD |
2432 | osvers="$3" |
2433 | ;; | |
4e81affe MM |
2434 | news-os) osvers="$3" |
2435 | case "$3" in | |
2436 | 4*) osname=newsos4 ;; | |
2437 | *) osname=newsos ;; | |
2438 | esac | |
2439 | ;; | |
aaacdc8b | 2440 | next*) osname=next ;; |
28bb1e2c | 2441 | nonstop-ux) osname=nonstopux ;; |
aaacdc8b GS |
2442 | POSIX-BC | posix-bc ) osname=posix-bc |
2443 | osvers="$3" | |
a0d0e21e | 2444 | ;; |
ae3afa4e TH |
2445 | powerux | power_ux | powermax_os | powermaxos | \ |
2446 | powerunix | power_unix) osname=powerux | |
2447 | osvers="$3" | |
2448 | ;; | |
aaacdc8b GS |
2449 | qnx) osname=qnx |
2450 | osvers="$4" | |
2451 | ;; | |
a0d0e21e LW |
2452 | solaris) osname=solaris |
2453 | case "$3" in | |
2454 | 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; | |
ecfc5424 | 2455 | *) osvers="$3" ;; |
a0d0e21e LW |
2456 | esac |
2457 | ;; | |
85e6fe83 LW |
2458 | sunos) osname=sunos |
2459 | case "$3" in | |
85e6fe83 LW |
2460 | 5*) osname=solaris |
2461 | osvers=`echo $3 | $sed 's/^5/2/g'` ;; | |
a0d0e21e | 2462 | *) osvers="$3" ;; |
2304df62 AD |
2463 | esac |
2464 | ;; | |
a0d0e21e | 2465 | titanos) osname=titanos |
85e6fe83 | 2466 | case "$3" in |
a0d0e21e LW |
2467 | 1*) osvers=1 ;; |
2468 | 2*) osvers=2 ;; | |
2469 | 3*) osvers=3 ;; | |
2470 | 4*) osvers=4 ;; | |
ecfc5424 | 2471 | *) osvers="$3" ;; |
2304df62 AD |
2472 | esac |
2473 | ;; | |
85e6fe83 | 2474 | ultrix) osname=ultrix |
ecfc5424 | 2475 | osvers="$3" |
2304df62 | 2476 | ;; |
28757baa | 2477 | osf1|mls+) case "$5" in |
fed7345c AD |
2478 | alpha) |
2479 | osname=dec_osf | |
2aa76180 JH |
2480 | osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'` |
2481 | case "$osvers" in | |
2482 | [1-9].[0-9]*) ;; | |
2483 | *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;; | |
2484 | esac | |
ecfc5424 AD |
2485 | ;; |
2486 | hp*) osname=hp_osf1 ;; | |
2487 | mips) osname=mips_osf1 ;; | |
85e6fe83 LW |
2488 | esac |
2489 | ;; | |
0337d152 BG |
2490 | unixware) osname=svr5 |
2491 | osvers="$4" | |
2492 | ;; | |
2493 | uts) osname=uts | |
a0d0e21e LW |
2494 | osvers="$3" |
2495 | ;; | |
85e6fe83 | 2496 | $2) case "$osname" in |
2304df62 | 2497 | *isc*) ;; |
a0d0e21e | 2498 | *freebsd*) ;; |
5f05dabc | 2499 | svr*) |
a0d0e21e LW |
2500 | : svr4.x or possibly later |
2501 | case "svr$3" in | |
2502 | ${osname}*) | |
2503 | osname=svr$3 | |
2504 | osvers=$4 | |
2505 | ;; | |
2506 | esac | |
2507 | case "$osname" in | |
2508 | svr4.0) | |
2509 | : Check for ESIX | |
2510 | if test -f /stand/boot ; then | |
2511 | eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot` | |
ecfc5424 AD |
2512 | if test -n "$INITPROG" -a -f "$INITPROG"; then |
2513 | isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'` | |
2514 | if test -n "$isesix"; then | |
a0d0e21e LW |
2515 | osname=esix4 |
2516 | fi | |
2517 | fi | |
2518 | fi | |
2519 | ;; | |
2520 | esac | |
2521 | ;; | |
2304df62 | 2522 | *) if test -f /etc/systemid; then |
a0d0e21e LW |
2523 | osname=sco |
2524 | set `echo $3 | $sed 's/\./ /g'` $4 | |
c4f23d77 | 2525 | if $test -f $src/hints/sco_$1_$2_$3.sh; then |
85e6fe83 | 2526 | osvers=$1.$2.$3 |
c4f23d77 | 2527 | elif $test -f $src/hints/sco_$1_$2.sh; then |
85e6fe83 | 2528 | osvers=$1.$2 |
c4f23d77 | 2529 | elif $test -f $src/hints/sco_$1.sh; then |
85e6fe83 | 2530 | osvers=$1 |
2304df62 | 2531 | fi |
a0d0e21e LW |
2532 | else |
2533 | case "$osname" in | |
2534 | '') : Still unknown. Probably a generic Sys V. | |
2535 | osname="sysv" | |
2536 | osvers="$3" | |
2537 | ;; | |
2538 | esac | |
2304df62 AD |
2539 | fi |
2540 | ;; | |
2541 | esac | |
2542 | ;; | |
a0d0e21e LW |
2543 | *) case "$osname" in |
2544 | '') : Still unknown. Probably a generic BSD. | |
2545 | osname="$1" | |
2546 | osvers="$3" | |
2547 | ;; | |
2548 | esac | |
2549 | ;; | |
2304df62 AD |
2550 | esac |
2551 | else | |
dfe9444c AD |
2552 | if test -f /vmunix -a -f $src/hints/news_os.sh; then |
2553 | (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1 | |
2554 | if $contains news-os UU/kernel.what >/dev/null 2>&1; then | |
2555 | osname=news_os | |
2304df62 | 2556 | fi |
dfe9444c | 2557 | $rm -f UU/kernel.what |
8e07c86e AD |
2558 | elif test -d c:/.; then |
2559 | set X $myuname | |
2560 | osname=os2 | |
2561 | osvers="$5" | |
2304df62 AD |
2562 | fi |
2563 | fi | |
85e6fe83 | 2564 | |
a0d0e21e LW |
2565 | : Now look for a hint file osname_osvers, unless one has been |
2566 | : specified already. | |
2567 | case "$hintfile" in | |
2568 | ''|' ') | |
1e127011 | 2569 | file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'` |
a0d0e21e | 2570 | : Also try without trailing minor version numbers. |
1e127011 DD |
2571 | xfile=`echo $file | $sed -e 's%_[^_]*$%%'` |
2572 | xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'` | |
2573 | xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'` | |
2574 | xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'` | |
a0d0e21e LW |
2575 | case "$file" in |
2576 | '') dflt=none ;; | |
2577 | *) case "$osvers" in | |
2578 | '') dflt=$file | |
2579 | ;; | |
dfe9444c | 2580 | *) if $test -f $src/hints/$file.sh ; then |
a0d0e21e | 2581 | dflt=$file |
dfe9444c | 2582 | elif $test -f $src/hints/$xfile.sh ; then |
a0d0e21e | 2583 | dflt=$xfile |
dfe9444c | 2584 | elif $test -f $src/hints/$xxfile.sh ; then |
a0d0e21e | 2585 | dflt=$xxfile |
dfe9444c | 2586 | elif $test -f $src/hints/$xxxfile.sh ; then |
a0d0e21e | 2587 | dflt=$xxxfile |
dfe9444c | 2588 | elif $test -f $src/hints/$xxxxfile.sh ; then |
a0d0e21e | 2589 | dflt=$xxxxfile |
dfe9444c | 2590 | elif $test -f "$src/hints/${osname}.sh" ; then |
a0d0e21e LW |
2591 | dflt="${osname}" |
2592 | else | |
2593 | dflt=none | |
2594 | fi | |
2595 | ;; | |
2596 | esac | |
85e6fe83 LW |
2597 | ;; |
2598 | esac | |
4e2a5f63 AD |
2599 | if $test -f Policy.sh ; then |
2600 | case "$dflt" in | |
2601 | *Policy*) ;; | |
2602 | none) dflt="Policy" ;; | |
2603 | *) dflt="Policy $dflt" ;; | |
2604 | esac | |
2605 | fi | |
85e6fe83 | 2606 | ;; |
a0d0e21e | 2607 | *) |
ecfc5424 | 2608 | dflt=`echo $hintfile | $sed 's/\.sh$//'` |
a0d0e21e | 2609 | ;; |
2304df62 | 2610 | esac |
1aef975c | 2611 | |
4e2a5f63 AD |
2612 | if $test -f Policy.sh ; then |
2613 | $cat <<EOM | |
2614 | ||
2615 | There's also a Policy hint file available, which should make the | |
2616 | site-specific (policy) questions easier to answer. | |
2617 | EOM | |
2618 | ||
2619 | fi | |
2620 | ||
2304df62 AD |
2621 | $cat <<EOM |
2622 | ||
2623 | You may give one or more space-separated answers, or "none" if appropriate. | |
4e2a5f63 | 2624 | A well-behaved OS will have no hints, so answering "none" or just "Policy" |
a3635516 | 2625 | is a good thing. DO NOT give a wrong version or a wrong OS. |
2304df62 AD |
2626 | |
2627 | EOM | |
4e2a5f63 | 2628 | |
2304df62 | 2629 | rp="Which of these apply, if any?" |
dfe9444c | 2630 | . UU/myread |
85e6fe83 LW |
2631 | tans=$ans |
2632 | for file in $tans; do | |
4e2a5f63 AD |
2633 | if $test X$file = XPolicy -a -f Policy.sh; then |
2634 | . Policy.sh | |
2635 | $cat Policy.sh >> UU/config.sh | |
2636 | elif $test -f $src/hints/$file.sh; then | |
dfe9444c AD |
2637 | . $src/hints/$file.sh |
2638 | $cat $src/hints/$file.sh >> UU/config.sh | |
85e6fe83 | 2639 | elif $test X$tans = X -o X$tans = Xnone ; then |
2304df62 AD |
2640 | : nothing |
2641 | else | |
85e6fe83 LW |
2642 | : Give one chance to correct a possible typo. |
2643 | echo "$file.sh does not exist" | |
2644 | dflt=$file | |
2645 | rp="hint to use instead?" | |
dfe9444c | 2646 | . UU/myread |
85e6fe83 | 2647 | for file in $ans; do |
dfe9444c AD |
2648 | if $test -f "$src/hints/$file.sh"; then |
2649 | . $src/hints/$file.sh | |
2650 | $cat $src/hints/$file.sh >> UU/config.sh | |
85e6fe83 LW |
2651 | elif $test X$ans = X -o X$ans = Xnone ; then |
2652 | : nothing | |
2653 | else | |
2654 | echo "$file.sh does not exist -- ignored." | |
2655 | fi | |
2656 | done | |
2304df62 AD |
2657 | fi |
2658 | done | |
85e6fe83 | 2659 | |
2304df62 | 2660 | hint=recommended |
85e6fe83 | 2661 | : Remember our hint file for later. |
dfe9444c | 2662 | if $test -f "$src/hints/$file.sh" ; then |
a0d0e21e | 2663 | hintfile="$file" |
85e6fe83 | 2664 | else |
a0d0e21e | 2665 | hintfile='' |
85e6fe83 | 2666 | fi |
2304df62 AD |
2667 | fi |
2668 | cd UU | |
2669 | ;; | |
2670 | *) | |
2671 | echo " " | |
2672 | echo "Fetching default answers from $config_sh..." >&4 | |
ecfc5424 AD |
2673 | tmp_n="$n" |
2674 | tmp_c="$c" | |
2304df62 AD |
2675 | cd .. |
2676 | cp $config_sh config.sh 2>/dev/null | |
a78b0d02 | 2677 | chmod +w config.sh |
2304df62 AD |
2678 | . ./config.sh |
2679 | cd UU | |
2680 | cp ../config.sh . | |
ecfc5424 AD |
2681 | n="$tmp_n" |
2682 | c="$tmp_c" | |
2304df62 AD |
2683 | hint=previous |
2684 | ;; | |
2685 | esac | |
1aef975c | 2686 | test "$override" && . ./optdef.sh |
2304df62 AD |
2687 | |
2688 | : Restore computed paths | |
2689 | for file in $loclist $trylist; do | |
2690 | eval $file="\$_$file" | |
2691 | done | |
2692 | ||
85e6fe83 | 2693 | cat << EOM |
a0d0e21e | 2694 | |
85e6fe83 | 2695 | Configure uses the operating system name and version to set some defaults. |
ecfc5424 AD |
2696 | The default value is probably right if the name rings a bell. Otherwise, |
2697 | since spelling matters for me, either accept the default or answer "none" | |
2698 | to leave it blank. | |
a0d0e21e | 2699 | |
85e6fe83 | 2700 | EOM |
85e6fe83 | 2701 | case "$osname" in |
a0d0e21e | 2702 | ''|' ') |
85e6fe83 | 2703 | case "$hintfile" in |
a0d0e21e | 2704 | ''|' '|none) dflt=none ;; |
ecfc5424 | 2705 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;; |
85e6fe83 LW |
2706 | esac |
2707 | ;; | |
2708 | *) dflt="$osname" ;; | |
2709 | esac | |
2710 | rp="Operating system name?" | |
2711 | . ./myread | |
2712 | case "$ans" in | |
ecfc5424 AD |
2713 | none) osname='' ;; |
2714 | *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;; | |
85e6fe83 | 2715 | esac |
8ff267be | 2716 | echo " " |
2717 | case "$osvers" in | |
2718 | ''|' ') | |
2719 | case "$hintfile" in | |
2720 | ''|' '|none) dflt=none ;; | |
2721 | *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'` | |
2722 | dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'` | |
2723 | case "$dflt" in | |
2724 | ''|' ') dflt=none ;; | |
2725 | esac | |
2726 | ;; | |
2727 | esac | |
2728 | ;; | |
2729 | *) dflt="$osvers" ;; | |
2730 | esac | |
2731 | rp="Operating system version?" | |
2732 | . ./myread | |
2733 | case "$ans" in | |
2734 | none) osvers='' ;; | |
2735 | *) osvers="$ans" ;; | |
2736 | esac | |
2737 | ||
02e93a22 JH |
2738 | |
2739 | . ./posthint.sh | |
2740 | ||
2304df62 | 2741 | : who configured the system |
59b83a6f | 2742 | cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1` |
8ff267be | 2743 | cf_by=`(logname) 2>/dev/null` |
dfe9444c AD |
2744 | case "$cf_by" in |
2745 | "") | |
8ff267be | 2746 | cf_by=`(whoami) 2>/dev/null` |
dfe9444c AD |
2747 | case "$cf_by" in |
2748 | "") cf_by=unknown ;; | |
8ff267be | 2749 | esac ;; |
2750 | esac | |
2304df62 | 2751 | |
b4eb6b3d JH |
2752 | : set up the script used to warn in case of inconsistency |
2753 | cat <<EOS >whoa | |
2754 | $startsh | |
2755 | EOS | |
2756 | cat <<'EOSC' >>whoa | |
2757 | dflt=y | |
2758 | echo " " | |
2759 | echo "*** WHOA THERE!!! ***" >&4 | |
2760 | echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 | |
2761 | rp=" Keep the $hint value?" | |
2762 | . ./myread | |
2763 | case "$ans" in | |
2764 | y) td=$was; tu=$was;; | |
2765 | esac | |
2766 | EOSC | |
2767 | ||
2768 | : function used to set $1 to $val | |
2769 | setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef; | |
2770 | case "$val$was" in | |
2771 | $define$undef) . ./whoa; eval "$var=\$td";; | |
2772 | $undef$define) . ./whoa; eval "$var=\$tu";; | |
2773 | *) eval "$var=$val";; | |
2774 | esac' | |
2775 | ||
2776 | case "$usethreads" in | |
2777 | $define|true|[yY]*) dflt='y';; | |
2778 | *) dflt='n';; | |
2779 | esac | |
2780 | cat <<EOM | |
2781 | ||
2782 | Perl can be built to take advantage of threads on some systems. | |
2783 | To do so, Configure can be run with -Dusethreads. | |
2784 | ||
2785 | Note that threading is a highly experimental feature, and | |
2786 | some known race conditions still remain. If you choose to try | |
2787 | it, be very sure to not actually deploy it for production | |
2788 | purposes. README.threads has more details, and is required | |
2789 | reading if you enable threads. | |
2790 | ||
2791 | If this doesn't make any sense to you, just accept the default '$dflt'. | |
2792 | EOM | |
2793 | rp='Build a threading Perl?' | |
2794 | . ./myread | |
2795 | case "$ans" in | |
2796 | y|Y) val="$define" ;; | |
2797 | *) val="$undef" ;; | |
2798 | esac | |
2799 | set usethreads | |
2800 | eval $setvar | |
2801 | ||
2802 | case "$usethreads" in | |
2803 | $define) | |
2804 | $cat <<EOM | |
2805 | ||
2806 | As of 5.5.640, Perl has two different internal threading implementations, | |
2807 | the 5.005 version (5005threads) and an interpreter-based version | |
2808 | (ithreads) that has one interpreter per thread. Both are very | |
2809 | experimental. This arrangement exists to help developers work out | |
2810 | which one is better. | |
2811 | ||
2812 | If you're a casual user, you probably don't want interpreter-threads | |
2813 | at this time. There doesn't yet exist a way to create threads from | |
2814 | within Perl in this model, i.e., "use Thread;" will NOT work. | |
2815 | EOM | |
2816 | : Default to ithreads unless overridden on command line or with | |
2817 | : old config.sh | |
2818 | dflt='y' | |
2819 | case "$use5005threads" in | |
2820 | $define|true|[yY]*) dflt='n';; | |
2821 | esac | |
2822 | case "$useithreads" in | |
2823 | $undef|false|[nN]*) dflt='n';; | |
2824 | esac | |
2825 | rp='Use interpreter-based ithreads?' | |
2826 | . ./myread | |
2827 | case "$ans" in | |
2828 | y|Y) val="$define" ;; | |
2829 | *) val="$undef" ;; | |
2830 | esac | |
2831 | set useithreads | |
2832 | eval $setvar | |
2833 | : Now set use5005threads to the opposite value. | |
2834 | case "$useithreads" in | |
2835 | $define) val="$undef" ;; | |
2836 | *) val="$define" ;; | |
2837 | esac | |
2838 | set use5005threads | |
2839 | eval $setvar | |
2840 | ;; | |
2841 | *) | |
2842 | useithreads="$undef" | |
2843 | use5005threads="$undef" | |
2844 | ;; | |
2845 | esac | |
2846 | ||
2847 | case "$d_oldpthreads" in | |
2848 | '') : Configure tests would be welcome here. For now, assume undef. | |
2849 | val="$undef" ;; | |
2850 | *) val="$d_oldpthreads" ;; | |
2851 | esac | |
2852 | set d_oldpthreads | |
2853 | eval $setvar | |
2854 | ||
2855 | ||
2856 | case "$usethreads" in | |
2857 | "$define"|true|[yY]*) | |
2858 | : Look for a hint-file generated 'call-back-unit'. If the | |
2859 | : user has specified that a threading perl is to be built, | |
2860 | : we may need to set or change some other defaults. | |
2861 | if $test -f usethreads.cbu; then | |
2862 | echo "Your platform has some specific hints for threaded builds, using them..." | |
2863 | . ./usethreads.cbu | |
2864 | else | |
2865 | $cat <<EOM | |
2866 | (Your platform doesn't have any specific hints for threaded builds. | |
2867 | Assuming POSIX threads, then.) | |
2868 | EOM | |
2869 | fi | |
2870 | ;; | |
2871 | esac | |
2872 | ||
2873 | cat <<EOM | |
2874 | ||
2875 | Perl can be built so that multiple Perl interpreters can coexist | |
2876 | within the same Perl executable. | |
2877 | EOM | |
2878 | ||
2879 | case "$useithreads" in | |
2880 | $define) | |
2881 | cat <<EOM | |
2882 | This multiple interpreter support is required for interpreter-based threads. | |
2883 | EOM | |
2884 | val="$define" | |
2885 | ;; | |
2886 | *) case "$usemultiplicity" in | |
2887 | $define|true|[yY]*) dflt='y';; | |
2888 | *) dflt='n';; | |
2889 | esac | |
2890 | echo " " | |
2891 | echo "If this doesn't make any sense to you, just accept the default '$dflt'." | |
2892 | rp='Build Perl for multiplicity?' | |
2893 | . ./myread | |
2894 | case "$ans" in | |
2895 | y|Y) val="$define" ;; | |
2896 | *) val="$undef" ;; | |
2897 | esac | |
2898 | ;; | |
2899 | esac | |
2900 | set usemultiplicity | |
2901 | eval $setvar | |
2902 | ||
e5e20432 JH |
2903 | : make some quick guesses about what we are up against |
2904 | echo " " | |
2905 | $echo $n "Hmm... $c" | |
2906 | echo exit 1 >bsd | |
2907 | echo exit 1 >usg | |
2908 | echo exit 1 >v7 | |
2909 | echo exit 1 >osf1 | |
2910 | echo exit 1 >eunice | |
2911 | echo exit 1 >xenix | |
2912 | echo exit 1 >venix | |
2913 | echo exit 1 >os2 | |
2914 | d_bsd="$undef" | |
2915 | $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null | |
2916 | if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1 | |
2917 | then | |
2918 | echo "Looks kind of like an OSF/1 system, but we'll see..." | |
2919 | echo exit 0 >osf1 | |
381aa1ff | 2920 | elif test `echo abc | $tr a-z A-Z` = Abc ; then |
e5e20432 JH |
2921 | xxx=`./loc addbib blurfl $pth` |
2922 | if $test -f $xxx; then | |
2923 | echo "Looks kind of like a USG system with BSD features, but we'll see..." | |
2924 | echo exit 0 >bsd | |
2925 | echo exit 0 >usg | |
2926 | else | |
2927 | if $contains SIGTSTP foo >/dev/null 2>&1 ; then | |
2928 | echo "Looks kind of like an extended USG system, but we'll see..." | |
2929 | else | |
2930 | echo "Looks kind of like a USG system, but we'll see..." | |
2931 | fi | |
2932 | echo exit 0 >usg | |
2933 | fi | |
2934 | elif $contains SIGTSTP foo >/dev/null 2>&1 ; then | |
2935 | echo "Looks kind of like a BSD system, but we'll see..." | |
2936 | d_bsd="$define" | |
2937 | echo exit 0 >bsd | |
2938 | else | |
2939 | echo "Looks kind of like a Version 7 system, but we'll see..." | |
2940 | echo exit 0 >v7 | |
2941 | fi | |
2942 | case "$eunicefix" in | |
2943 | *unixtovms*) | |
2944 | $cat <<'EOI' | |
2945 | There is, however, a strange, musty smell in the air that reminds me of | |
2946 | something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit. | |
2947 | EOI | |
2948 | echo exit 0 >eunice | |
2949 | d_eunice="$define" | |
2950 | : it so happens the Eunice I know will not run shell scripts in Unix format | |
2951 | ;; | |
2952 | *) | |
2953 | echo " " | |
2954 | echo "Congratulations. You aren't running Eunice." | |
2955 | d_eunice="$undef" | |
2956 | ;; | |
2957 | esac | |
2958 | : Detect OS2. The p_ variable is set above in the Head.U unit. | |
3d5d58b1 JH |
2959 | : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses |
2960 | : semicolon as a patch separator | |
e5e20432 JH |
2961 | case "$p_" in |
2962 | :) ;; | |
2963 | *) | |
2964 | $cat <<'EOI' | |
2965 | I have the feeling something is not exactly right, however...don't tell me... | |
2966 | lemme think...does HAL ring a bell?...no, of course, you're only running OS/2! | |
3d5d58b1 | 2967 | (Or you may be running DOS with DJGPP.) |
e5e20432 JH |
2968 | EOI |
2969 | echo exit 0 >os2 | |
2970 | ;; | |
2971 | esac | |
2972 | if test -f /xenix; then | |
2973 | echo "Actually, this looks more like a XENIX system..." | |
2974 | echo exit 0 >xenix | |
2975 | d_xenix="$define" | |
2976 | else | |
2977 | echo " " | |
2978 | echo "It's not Xenix..." | |
2979 | d_xenix="$undef" | |
2980 | fi | |
2981 | chmod +x xenix | |
2982 | $eunicefix xenix | |
2983 | if test -f /venix; then | |
2984 | echo "Actually, this looks more like a VENIX system..." | |
2985 | echo exit 0 >venix | |
2986 | else | |
2987 | echo " " | |
2988 | if ./xenix; then | |
2989 | : null | |
2990 | else | |
2991 | echo "Nor is it Venix..." | |
2992 | fi | |
2993 | fi | |
2994 | chmod +x bsd usg v7 osf1 eunice xenix venix os2 | |
2995 | $eunicefix bsd usg v7 osf1 eunice xenix venix os2 | |
2996 | $rm -f foo | |
2997 | ||
5869b1f1 JH |
2998 | case "$cc" in |
2999 | '') dflt=cc;; | |
3000 | *) dflt="$cc";; | |
3001 | esac | |
3002 | rp="Use which C compiler?" | |
3003 | . ./myread | |
3004 | cc="$ans" | |
e5e20432 JH |
3005 | : Look for a hint-file generated 'call-back-unit'. Now that the |
3006 | : user has specified the compiler, we may need to set or change some | |
3007 | : other defaults. | |
3008 | if $test -f cc.cbu; then | |
3009 | . ./cc.cbu | |
3010 | fi | |
2573c5f9 | 3011 | . ./checkcc |
8a27cf78 | 3012 | |
e5e20432 JH |
3013 | echo " " |
3014 | echo "Checking for GNU cc in disguise and/or its version number..." >&4 | |
3015 | $cat >gccvers.c <<EOM | |
3016 | #include <stdio.h> | |
3017 | int main() { | |
3018 | #ifdef __GNUC__ | |
3019 | #ifdef __VERSION__ | |
3020 | printf("%s\n", __VERSION__); | |
3021 | #else | |
3022 | printf("%s\n", "1"); | |
3023 | #endif | |
3024 | #endif | |
3025 | exit(0); | |
3026 | } | |
3027 | EOM | |
7a282f6d | 3028 | if $cc -o gccvers $ldflags gccvers.c; then |
e5e20432 JH |
3029 | gccversion=`./gccvers` |
3030 | case "$gccversion" in | |
3031 | '') echo "You are not using GNU cc." ;; | |
fc68435e | 3032 | *) echo "You are using GNU cc $gccversion." |
e723fc21 | 3033 | ccname=gcc |
fc68435e | 3034 | ;; |
e5e20432 JH |
3035 | esac |
3036 | else | |
3037 | echo " " | |
3038 | echo "*** WHOA THERE!!! ***" >&4 | |
3039 | echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4 | |
3040 | case "$knowitall" in | |
3041 | '') | |
3042 | echo " You'd better start hunting for one and let me know about it." >&4 | |
3043 | exit 1 | |
3044 | ;; | |
3045 | esac | |
3046 | fi | |
3047 | $rm -f gccvers* | |
3048 | case "$gccversion" in | |
3049 | 1*) cpp=`./loc gcc-cpp $cpp $pth` ;; | |
3050 | esac | |
5b463ca7 KS |
3051 | case "$gccversion" in |
3052 | '') gccosandvers='' ;; | |
10b4ebb5 JH |
3053 | *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'` |
3054 | gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"` | |
3055 | gccshortvers='' | |
5b463ca7 | 3056 | case "$gccosandvers" in |
02903077 JH |
3057 | $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr |
3058 | $osname$osvers) ;; # looking good | |
5b463ca7 KS |
3059 | $osname*) cat <<EOM >&4 |
3060 | ||
3061 | *** WHOA THERE!!! *** | |
3062 | ||
3063 | Your gcc has not been compiled for the exact release of | |
3064 | your operating system ($gccosandvers versus $osname$osvers). | |
3065 | ||
3066 | In general it is a good idea to keep gcc synchronized with | |
3067 | the operating system because otherwise serious problems | |
3068 | may ensue when trying to compile software, like Perl. | |
3069 | ||
3070 | I'm trying to be optimistic here, though, and will continue. | |
3071 | If later during the configuration and build icky compilation | |
02903077 JH |
3072 | problems appear (headerfile conflicts being the most common |
3073 | manifestation), I suggest reinstalling the gcc to match | |
5b463ca7 KS |
3074 | your operating system release. |
3075 | ||
3076 | EOM | |
3077 | ;; | |
81575342 | 3078 | *) gccosandvers='' ;; # failed to parse, better be silent |
5b463ca7 KS |
3079 | esac |
3080 | ;; | |
3081 | esac | |
e723fc21 JH |
3082 | case "$ccname" in |
3083 | '') ccname="$cc" ;; | |
3084 | esac | |
e5e20432 | 3085 | |
8a27cf78 JH |
3086 | : see how we invoke the C preprocessor |
3087 | echo " " | |
3088 | echo "Now, how can we feed standard input to your C preprocessor..." >&4 | |
3089 | cat <<'EOT' >testcpp.c | |
3090 | #define ABC abc | |
3091 | #define XYZ xyz | |
3092 | ABC.XYZ | |
3093 | EOT | |
3094 | cd .. | |
3095 | if test ! -f cppstdin; then | |
3096 | if test "X$osname" = "Xaix" -a "X$gccversion" = X; then | |
3097 | # AIX cc -E doesn't show the absolute headerfile | |
3098 | # locations but we'll cheat by using the -M flag. | |
3099 | echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin | |
3100 | else | |
3101 | echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin | |
3102 | fi | |
3103 | else | |
3104 | echo "Keeping your $hint cppstdin wrapper." | |
3105 | fi | |
3106 | chmod 755 cppstdin | |
3107 | wrapper=`pwd`/cppstdin | |
3108 | ok='false' | |
3109 | cd UU | |
3110 | ||
3111 | if $test "X$cppstdin" != "X" && \ | |
3112 | $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \ | |
3113 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
3114 | then | |
3115 | echo "You used to use $cppstdin $cppminus so we'll use that again." | |
3116 | case "$cpprun" in | |
3117 | '') echo "But let's see if we can live without a wrapper..." ;; | |
3118 | *) | |
3119 | if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \ | |
3120 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
3121 | then | |
3122 | echo "(And we'll use $cpprun $cpplast to preprocess directly.)" | |
3123 | ok='true' | |
3124 | else | |
3125 | echo "(However, $cpprun $cpplast does not work, let's see...)" | |
3126 | fi | |
3127 | ;; | |
3128 | esac | |
3129 | else | |
3130 | case "$cppstdin" in | |
3131 | '') ;; | |
3132 | *) | |
3133 | echo "Good old $cppstdin $cppminus does not seem to be of any help..." | |
3134 | ;; | |
3135 | esac | |
3136 | fi | |
3137 | ||
3138 | if $ok; then | |
3139 | : nothing | |
3140 | elif echo 'Maybe "'"$cc"' -E" will work...'; \ | |
3141 | $cc -E <testcpp.c >testcpp.out 2>&1; \ | |
3142 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3143 | echo "Yup, it does." | |
3144 | x_cpp="$cc -E" | |
3145 | x_minus=''; | |
3146 | elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \ | |
3147 | $cc -E - <testcpp.c >testcpp.out 2>&1; \ | |
3148 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3149 | echo "Yup, it does." | |
3150 | x_cpp="$cc -E" | |
3151 | x_minus='-'; | |
3152 | elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \ | |
3153 | $cc -P <testcpp.c >testcpp.out 2>&1; \ | |
3154 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3155 | echo "Yipee, that works!" | |
3156 | x_cpp="$cc -P" | |
3157 | x_minus=''; | |
3158 | elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \ | |
3159 | $cc -P - <testcpp.c >testcpp.out 2>&1; \ | |
3160 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3161 | echo "At long last!" | |
3162 | x_cpp="$cc -P" | |
3163 | x_minus='-'; | |
3164 | elif echo 'No such luck, maybe "'$cpp'" will work...'; \ | |
3165 | $cpp <testcpp.c >testcpp.out 2>&1; \ | |
3166 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3167 | echo "It works!" | |
3168 | x_cpp="$cpp" | |
3169 | x_minus=''; | |
3170 | elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \ | |
3171 | $cpp - <testcpp.c >testcpp.out 2>&1; \ | |
3172 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3173 | echo "Hooray, it works! I was beginning to wonder." | |
3174 | x_cpp="$cpp" | |
3175 | x_minus='-'; | |
3176 | elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \ | |
3177 | $wrapper <testcpp.c >testcpp.out 2>&1; \ | |
3178 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3179 | x_cpp="$wrapper" | |
3180 | x_minus='' | |
3181 | echo "Eureka!" | |
3182 | else | |
3183 | dflt='' | |
3184 | rp="No dice. I can't find a C preprocessor. Name one:" | |
3185 | . ./myread | |
3186 | x_cpp="$ans" | |
3187 | x_minus='' | |
3188 | $x_cpp <testcpp.c >testcpp.out 2>&1 | |
3189 | if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then | |
3190 | echo "OK, that will do." >&4 | |
3191 | else | |
3192 | echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4 | |
3193 | exit 1 | |
3194 | fi | |
3195 | fi | |
3196 | ||
3197 | case "$ok" in | |
3198 | false) | |
3199 | cppstdin="$x_cpp" | |
3200 | cppminus="$x_minus" | |
3201 | cpprun="$x_cpp" | |
3202 | cpplast="$x_minus" | |
3203 | set X $x_cpp | |
3204 | shift | |
3205 | case "$1" in | |
3206 | "$cpp") | |
3207 | echo "Perhaps can we force $cc -E using a wrapper..." | |
3208 | if $wrapper <testcpp.c >testcpp.out 2>&1; \ | |
3209 | $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 | |
3210 | then | |
3211 | echo "Yup, we can." | |
3212 | cppstdin="$wrapper" | |
3213 | cppminus=''; | |
3214 | else | |
3215 | echo "Nope, we'll have to live without it..." | |
3216 | fi | |
3217 | ;; | |
3218 | esac | |
3219 | case "$cpprun" in | |
3220 | "$wrapper") | |
3221 | cpprun='' | |
3222 | cpplast='' | |
3223 | ;; | |
3224 | esac | |
3225 | ;; | |
3226 | esac | |
3227 | ||
3228 | case "$cppstdin" in | |
3229 | "$wrapper"|'cppstdin') ;; | |
3230 | *) $rm -f $wrapper;; | |
3231 | esac | |
3232 | $rm -f testcpp.c testcpp.out | |
3233 | ||
bd9b35c9 JH |
3234 | : decide how portable to be. Allow command line overrides. |
3235 | case "$d_portable" in | |
3236 | "$undef") ;; | |
3237 | *) d_portable="$define" ;; | |
104d25b7 | 3238 | esac |
85ab1d1d | 3239 | |
bd9b35c9 JH |
3240 | : set up shell script to do ~ expansion |
3241 | cat >filexp <<EOSS | |
3242 | $startsh | |
3243 | : expand filename | |
3244 | case "\$1" in | |
3245 | ~/*|~) | |
3246 | echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|" | |
3247 | ;; | |
3248 | ~*) | |
3249 | if $test -f /bin/csh; then | |
3250 | /bin/csh -f -c "glob \$1" | |
3251 | failed=\$? | |
3252 | echo "" | |
3253 | exit \$failed | |
e5e20432 | 3254 | else |
bd9b35c9 JH |
3255 | name=\`$expr x\$1 : '..\([^/]*\)'\` |
3256 | dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\` | |
3257 | if $test ! -d "\$dir"; then | |
3258 | me=\`basename \$0\` | |
3259 | echo "\$me: can't locate home directory for: \$name" >&2 | |
3260 | exit 1 | |
3261 | fi | |
3262 | case "\$1" in | |
3263 | */*) | |
3264 | echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\` | |
3265 | ;; | |
3266 | *) | |
3267 | echo \$dir | |
e5e20432 JH |
3268 | ;; |
3269 | esac | |
3270 | fi | |
b691c02f | 3271 | ;; |
4633a7c4 | 3272 | *) |
bd9b35c9 | 3273 | echo \$1 |
2304df62 AD |
3274 | ;; |
3275 | esac | |
4633a7c4 LW |
3276 | EOSS |
3277 | chmod +x filexp | |
3278 | $eunicefix filexp | |
2304df62 AD |
3279 | |
3280 | : now set up to get a file name | |
28757baa | 3281 | cat <<EOS >getfile |
3282 | $startsh | |
3283 | EOS | |
3284 | cat <<'EOSC' >>getfile | |
2304df62 AD |
3285 | tilde='' |
3286 | fullpath='' | |
3287 | already='' | |
3288 | skip='' | |
3289 | none_ok='' | |
3290 | exp_file='' | |
a0d0e21e | 3291 | nopath_ok='' |
2304df62 AD |
3292 | orig_rp="$rp" |
3293 | orig_dflt="$dflt" | |
b233458b JH |
3294 | case "$gfpth" in |
3295 | '') gfpth='.' ;; | |
3296 | esac | |
2304df62 AD |
3297 | |
3298 | case "$fn" in | |
ecfc5424 | 3299 | *\(*) |
381aa1ff | 3300 | expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok |
ecfc5424 AD |
3301 | fn=`echo $fn | sed 's/(.*)//'` |
3302 | ;; | |
3303 | esac | |
3304 | ||
3305 | case "$fn" in | |
a0d0e21e LW |
3306 | *:*) |
3307 | loc_file=`expr $fn : '.*:\(.*\)'` | |
3308 | fn=`expr $fn : '\(.*\):.*'` | |
3309 | ;; | |
3310 | esac | |
3311 | ||
3312 | case "$fn" in | |
2304df62 AD |
3313 | *~*) tilde=true;; |
3314 | esac | |
3315 | case "$fn" in | |
3316 | */*) fullpath=true;; | |
3317 | esac | |
3318 | case "$fn" in | |
3319 | *+*) skip=true;; | |
3320 | esac | |
3321 | case "$fn" in | |
3322 | *n*) none_ok=true;; | |
3323 | esac | |
3324 | case "$fn" in | |
3325 | *e*) exp_file=true;; | |
3326 | esac | |
a0d0e21e LW |
3327 | case "$fn" in |
3328 | *p*) nopath_ok=true;; | |
3329 | esac | |
2304df62 AD |
3330 | |
3331 | case "$fn" in | |
3332 | *f*) type='File';; | |
3333 | *d*) type='Directory';; | |
a0d0e21e | 3334 | *l*) type='Locate';; |
2304df62 AD |
3335 | esac |
3336 | ||
3337 | what="$type" | |
3338 | case "$what" in | |
3339 | Locate) what='File';; | |
3340 | esac | |
3341 | ||
3342 | case "$exp_file" in | |
3343 | '') | |
3344 | case "$d_portable" in | |
3345 | "$define") ;; | |
3346 | *) exp_file=true;; | |
3347 | esac | |
3348 | ;; | |
3349 | esac | |
3350 | ||
3351 | cd .. | |
3352 | while test "$type"; do | |
3353 | redo='' | |
3354 | rp="$orig_rp" | |
3355 | dflt="$orig_dflt" | |
3356 | case "$tilde" in | |
3357 | true) rp="$rp (~name ok)";; | |
3358 | esac | |
3359 | . UU/myread | |
ecfc5424 AD |
3360 | if test -f UU/getfile.ok && \ |
3361 | $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1 | |
3362 | then | |
3363 | value="$ans" | |
3364 | ansexp="$ans" | |
3365 | break | |
3366 | fi | |
2304df62 AD |
3367 | case "$ans" in |
3368 | none) | |
3369 | value='' | |
3370 | ansexp='' | |
3371 | case "$none_ok" in | |
3372 | true) type='';; | |
3373 | esac | |
3374 | ;; | |
3375 | *) | |
3376 | case "$tilde" in | |
3377 | '') value="$ans" | |
3378 | ansexp="$ans";; | |
3379 | *) | |
3380 | value=`UU/filexp $ans` | |
3381 | case $? in | |
3382 | 0) | |
3383 | if test "$ans" != "$value"; then | |
ecfc5424 | 3384 | echo "(That expands to $value on this system.)" |
2304df62 AD |
3385 | fi |
3386 | ;; | |
3387 | *) value="$ans";; | |
3388 | esac | |
3389 | ansexp="$value" | |
3390 | case "$exp_file" in | |
3391 | '') value="$ans";; | |
3392 | esac | |
3393 | ;; | |
3394 | esac | |
3395 | case "$fullpath" in | |
3396 | true) | |
3397 | case "$ansexp" in | |
3398 | /*) value="$ansexp" ;; | |
23da6c43 | 3399 | [a-zA-Z]:/*) value="$ansexp" ;; |
2304df62 AD |
3400 | *) |
3401 | redo=true | |
3402 | case "$already" in | |
3403 | true) | |
3404 | echo "I shall only accept a full path name, as in /bin/ls." >&4 | |
3405 | echo "Use a ! shell escape if you wish to check pathnames." >&4 | |
3406 | ;; | |
3407 | *) | |
3408 | echo "Please give a full path name, starting with slash." >&4 | |
3409 | case "$tilde" in | |
3410 | true) | |
3411 | echo "Note that using ~name is ok provided it expands well." >&4 | |
3412 | already=true | |
3413 | ;; | |
3414 | esac | |
3415 | esac | |
3416 | ;; | |
3417 | esac | |
3418 | ;; | |
3419 | esac | |
3420 | case "$redo" in | |
3421 | '') | |
3422 | case "$type" in | |
3423 | File) | |
b233458b JH |
3424 | for fp in $gfpth; do |
3425 | if test "X$fp" = X.; then | |
3426 | pf="$ansexp" | |
3427 | else | |
3428 | pf="$fp/$ansexp" | |
3429 | fi | |
3430 | if test -f "$pf"; then | |
3431 | type='' | |
3432 | elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1 | |
3433 | then | |
3434 | echo "($value is not a plain file, but that's ok.)" | |
3435 | type='' | |
3436 | fi | |
3437 | if test X"$type" = X; then | |
3438 | value="$pf" | |
3439 | break | |
3440 | fi | |
3441 | done | |
2304df62 AD |
3442 | ;; |
3443 | Directory) | |
b233458b JH |
3444 | for fp in $gfpth; do |
3445 | if test "X$fp" = X.; then | |
f78bfc9c JH |
3446 | dir="$ans" |
3447 | direxp="$ansexp" | |
b233458b | 3448 | else |
dd858076 | 3449 | dir="$fp/$ansexp" |
f78bfc9c | 3450 | direxp="$fp/$ansexp" |
b233458b | 3451 | fi |
f78bfc9c | 3452 | if test -d "$direxp"; then |
b233458b | 3453 | type='' |
f78bfc9c | 3454 | value="$dir" |
b233458b JH |
3455 | break |
3456 | fi | |
3457 | done | |
2304df62 AD |
3458 | ;; |
3459 | Locate) | |
40000a8c | 3460 | if test -d "$ansexp"; then |
a0d0e21e LW |
3461 | echo "(Looking for $loc_file in directory $value.)" |
3462 | value="$value/$loc_file" | |
40000a8c | 3463 | ansexp="$ansexp/$loc_file" |
2304df62 | 3464 | fi |
40000a8c | 3465 | if test -f "$ansexp"; then |
2304df62 AD |
3466 | type='' |
3467 | fi | |
a0d0e21e LW |
3468 | case "$nopath_ok" in |
3469 | true) case "$value" in | |
3470 | */*) ;; | |
3471 | *) echo "Assuming $value will be in people's path." | |
3472 | type='' | |
3473 | ;; | |
3474 | esac | |
3475 | ;; | |
3476 | esac | |
2304df62 AD |
3477 | ;; |
3478 | esac | |
3479 | ||
3480 | case "$skip" in | |
3481 | true) type=''; | |
3482 | esac | |
3483 | ||
3484 | case "$type" in | |
3485 | '') ;; | |
3486 | *) | |
3487 | if test "$fastread" = yes; then | |
3488 | dflt=y | |
3489 | else | |
3490 | dflt=n | |
3491 | fi | |
3492 | rp="$what $value doesn't exist. Use that name anyway?" | |
3493 | . UU/myread | |
3494 | dflt='' | |
3495 | case "$ans" in | |
3496 | y*) type='';; | |
3497 | *) echo " ";; | |
3498 | esac | |
3499 | ;; | |
3500 | esac | |
3501 | ;; | |
3502 | esac | |
3503 | ;; | |
3504 | esac | |
3505 | done | |
3506 | cd UU | |
3507 | ans="$value" | |
3508 | rp="$orig_rp" | |
3509 | dflt="$orig_dflt" | |
ecfc5424 | 3510 | rm -f getfile.ok |
b233458b | 3511 | test "X$gfpthkeep" != Xy && gfpth="" |
2304df62 AD |
3512 | EOSC |
3513 | ||
bd9b35c9 JH |
3514 | : What should the include directory be ? |
3515 | echo " " | |
3516 | $echo $n "Hmm... $c" | |
3517 | dflt='/usr/include' | |
3518 | incpath='' | |
3519 | mips_type='' | |
3520 | if $test -f /bin/mips && /bin/mips; then | |
3521 | echo "Looks like a MIPS system..." | |
3522 | $cat >usr.c <<'EOCP' | |
3523 | #ifdef SYSTYPE_BSD43 | |
3524 | /bsd43 | |
3525 | #endif | |
3526 | EOCP | |
8a27cf78 | 3527 | if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then |
bd9b35c9 JH |
3528 | dflt='/bsd43/usr/include' |
3529 | incpath='/bsd43' | |
3530 | mips_type='BSD 4.3' | |
3531 | else | |
3532 | mips_type='System V' | |
3533 | fi | |
3534 | $rm -f usr.c usr.out | |
3535 | echo "and you're compiling with the $mips_type compiler and libraries." | |
3536 | xxx_prompt=y | |
3537 | echo "exit 0" >mips | |
3538 | else | |
3539 | echo "Doesn't look like a MIPS system." | |
3540 | xxx_prompt=n | |
3541 | echo "exit 1" >mips | |
3542 | fi | |
3543 | chmod +x mips | |
3544 | $eunicefix mips | |
3545 | case "$usrinc" in | |
3546 | '') ;; | |
3547 | *) dflt="$usrinc";; | |
3548 | esac | |
3549 | case "$xxx_prompt" in | |
3550 | y) fn=d/ | |
3551 | echo " " | |
3552 | rp='Where are the include files you want to use?' | |
3553 | . ./getfile | |
3554 | usrinc="$ans" | |
8e07c86e | 3555 | ;; |
bd9b35c9 | 3556 | *) usrinc="$dflt" |
8e07c86e AD |
3557 | ;; |
3558 | esac | |
2304df62 | 3559 | |
bd9b35c9 JH |
3560 | : Set private lib path |
3561 | case "$plibpth" in | |
3562 | '') if ./mips; then | |
3563 | plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib" | |
3564 | fi;; | |
3565 | esac | |
3566 | case "$libpth" in | |
3567 | ' ') dlist='';; | |
3568 | '') dlist="$loclibpth $plibpth $glibpth";; | |
3569 | *) dlist="$libpth";; | |
3570 | esac | |
3571 | ||
3572 | : Now check and see which directories actually exist, avoiding duplicates | |
3573 | libpth='' | |
3574 | for xxx in $dlist | |
3575 | do | |
3576 | if $test -d $xxx; then | |
3577 | case " $libpth " in | |
3578 | *" $xxx "*) ;; | |
3579 | *) libpth="$libpth $xxx";; | |
3580 | esac | |
3581 | fi | |
3582 | done | |
3583 | $cat <<'EOM' | |
3584 | ||
3585 | Some systems have incompatible or broken versions of libraries. Among | |
3586 | the directories listed in the question below, please remove any you | |
3587 | know not to be holding relevant libraries, and add any that are needed. | |
3588 | Say "none" for none. | |
8e07c86e AD |
3589 | |
3590 | EOM | |
bd9b35c9 JH |
3591 | case "$libpth" in |
3592 | '') dflt='none';; | |
8e07c86e | 3593 | *) |
bd9b35c9 JH |
3594 | set X $libpth |
3595 | shift | |
3596 | dflt=${1+"$@"} | |
8e07c86e | 3597 | ;; |
a0d0e21e | 3598 | esac |
bd9b35c9 JH |
3599 | rp="Directories to use for library searches?" |
3600 | . ./myread | |
3601 | case "$ans" in | |
3602 | none) libpth=' ';; | |
3603 | *) libpth="$ans";; | |
3604 | esac | |
a0d0e21e | 3605 | |
bd9b35c9 JH |
3606 | : compute shared library extension |
3607 | case "$so" in | |
3608 | '') | |
3609 | if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then | |
3610 | dflt='sl' | |
dd4e71fd | 3611 | else |
bd9b35c9 | 3612 | dflt='so' |
dd4e71fd JH |
3613 | fi |
3614 | ;; | |
bd9b35c9 | 3615 | *) dflt="$so";; |
dd4e71fd | 3616 | esac |
dd4e71fd JH |
3617 | $cat <<EOM |
3618 | ||
bd9b35c9 | 3619 | On some systems, shared libraries may be available. Answer 'none' if |
7f95ee77 | 3620 | you want to suppress searching of shared libraries for the remainder |
bd9b35c9 | 3621 | of this configuration. |
dd4e71fd JH |
3622 | |
3623 | EOM | |
bd9b35c9 JH |
3624 | rp='What is the file extension used for shared libraries?' |
3625 | . ./myread | |
3626 | so="$ans" | |
dd4e71fd | 3627 | |
bd9b35c9 JH |
3628 | : Define several unixisms. |
3629 | : Hints files or command line option can be used to override them. | |
3630 | : The convoluted testing is in case hints files set either the old | |
3631 | : or the new name. | |
3632 | case "$_exe" in | |
3633 | '') case "$exe_ext" in | |
3634 | '') ;; | |
3635 | *) _exe="$exe_ext" ;; | |
dd4e71fd | 3636 | esac |
bd9b35c9 | 3637 | ;; |
bfb7748a | 3638 | esac |
bd9b35c9 JH |
3639 | case "$_a" in |
3640 | '') case "$lib_ext" in | |
3641 | '') _a='.a';; | |
3642 | *) _a="$lib_ext" ;; | |
dd4e71fd JH |
3643 | esac |
3644 | ;; | |
dd4e71fd | 3645 | esac |
bd9b35c9 JH |
3646 | case "$_o" in |
3647 | '') case "$obj_ext" in | |
3648 | '') _o='.o';; | |
3649 | *) _o="$obj_ext";; | |
3650 | esac | |
3651 | ;; | |
3652 | esac | |
3653 | case "$p_" in | |
3654 | '') case "$path_sep" in | |
3655 | '') p_=':';; | |
3656 | *) p_="$path_sep";; | |
3657 | esac | |
3658 | ;; | |
3659 | esac | |
3660 | exe_ext=$_exe | |
3661 | lib_ext=$_a | |
3662 | obj_ext=$_o | |
3663 | path_sep=$p_ | |
dd4e71fd | 3664 | |
b4eb6b3d JH |
3665 | : Which makefile gets called first. This is used by make depend. |
3666 | case "$firstmakefile" in | |
3667 | '') firstmakefile='makefile';; | |
4633a7c4 | 3668 | esac |
4633a7c4 | 3669 | |
0f0995ae JH |
3670 | case "$usesocks" in |
3671 | $define|true|[yY]*) dflt='y';; | |
3672 | *) dflt='n';; | |
3673 | esac | |
bd9b35c9 | 3674 | cat <<EOM |
4633a7c4 | 3675 | |
bd9b35c9 | 3676 | Perl can be built to use the SOCKS proxy protocol library. To do so, |
cf829ab0 JH |
3677 | Configure must be run with -Dusesocks. If you use SOCKS you also need |
3678 | to use the PerlIO abstraction layer, this will be implicitly selected. | |
4633a7c4 | 3679 | |
0f0995ae | 3680 | If this doesn't make any sense to you, just accept the default '$dflt'. |
bd9b35c9 | 3681 | EOM |
bd9b35c9 JH |
3682 | rp='Build Perl for SOCKS?' |
3683 | . ./myread | |
3684 | case "$ans" in | |
3685 | y|Y) val="$define" ;; | |
3686 | *) val="$undef" ;; | |
3687 | esac | |
3688 | set usesocks | |
3689 | eval $setvar | |
3690 | ||
cf829ab0 JH |
3691 | case "$usesocks" in |
3692 | $define|true|[yY]*) useperlio="$define";; | |
3693 | esac | |
3694 | ||
bd9b35c9 JH |
3695 | : Looking for optional libraries |
3696 | echo " " | |
3697 | echo "Checking for optional libraries..." >&4 | |
3698 | case "$libs" in | |
3699 | ' '|'') dflt='';; | |
3700 | *) dflt="$libs";; | |
3701 | esac | |
3702 | case "$libswanted" in | |
3703 | '') libswanted='c_s';; | |
3704 | esac | |
3705 | case "$usesocks" in | |
923fc586 | 3706 | "$define") libswanted="$libswanted socks5 socks5_sh" ;; |
8e07c86e | 3707 | esac |
68435ea7 JH |
3708 | libsfound='' |
3709 | libsfiles='' | |
3710 | libsdirs='' | |
13b3f787 JH |
3711 | libspath='' |
3712 | for thisdir in $libpth $xlibpth; do | |
3713 | test -d $thisdir && libspath="$libspath $thisdir" | |
3714 | done | |
bd9b35c9 | 3715 | for thislib in $libswanted; do |
13b3f787 | 3716 | for thisdir in $libspath; do |
f7dd4e7f JH |
3717 | xxx='' |
3718 | if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then | |
3719 | xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1` | |
3720 | $test -f "$xxx" && eval $libscheck | |
3721 | $test -f "$xxx" && libstyle=shared | |
3722 | fi | |
3723 | if test ! -f "$xxx"; then | |
3724 | xxx=$thisdir/lib$thislib.$so | |
3725 | $test -f "$xxx" && eval $libscheck | |
3726 | $test -f "$xxx" && libstyle=shared | |
3727 | fi | |
3728 | if test ! -f "$xxx"; then | |
3729 | xxx=$thisdir/lib$thislib$_a | |
3730 | $test -f "$xxx" && eval $libscheck | |
3731 | $test -f "$xxx" && libstyle=static | |
3732 | fi | |
3733 | if test ! -f "$xxx"; then | |
3734 | xxx=$thisdir/$thislib$_a | |
3735 | $test -f "$xxx" && eval $libscheck | |
3736 | $test -f "$xxx" && libstyle=static | |
3737 | fi | |
3738 | if test ! -f "$xxx"; then | |
3739 | xxx=$thisdir/lib${thislib}_s$_a | |
3740 | $test -f "$xxx" && eval $libscheck | |
3741 | $test -f "$xxx" && libstyle=static | |
09ea5ba9 | 3742 | $test -f "$xxx" && thislib=${thislib}_s |
f7dd4e7f JH |
3743 | fi |
3744 | if test ! -f "$xxx"; then | |
3745 | xxx=$thisdir/Slib$thislib$_a | |
3746 | $test -f "$xxx" && eval $libscheck | |
3747 | $test -f "$xxx" && libstyle=static | |
3748 | fi | |
3749 | if $test -f "$xxx"; then | |
43999f95 | 3750 | case "$libstyle" in |
f7dd4e7f JH |
3751 | shared) echo "Found -l$thislib (shared)." ;; |
3752 | static) echo "Found -l$thislib." ;; | |
3753 | *) echo "Found -l$thislib ($libstyle)." ;; | |
43999f95 | 3754 | esac |
bd9b35c9 JH |
3755 | case " $dflt " in |
3756 | *"-l$thislib "*);; | |
f7dd4e7f | 3757 | *) dflt="$dflt -l$thislib" |
43999f95 JH |
3758 | libsfound="$libsfound $xxx" |
3759 | yyy=`basename $xxx` | |
3760 | libsfiles="$libsfiles $yyy" | |
1e127011 | 3761 | yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"` |
43999f95 JH |
3762 | case " $libsdirs " in |
3763 | *" $yyy "*) ;; | |
3764 | *) libsdirs="$libsdirs $yyy" ;; | |
3765 | esac | |
3766 | ;; | |
bd9b35c9 | 3767 | esac |
f7dd4e7f JH |
3768 | break |
3769 | fi | |
3770 | done | |
3771 | if $test ! -f "$xxx"; then | |
3772 | echo "No -l$thislib." | |
bd9b35c9 JH |
3773 | fi |
3774 | done | |
3775 | set X $dflt | |
3776 | shift | |
3777 | dflt="$*" | |
3778 | case "$libs" in | |
3779 | '') dflt="$dflt";; | |
3780 | *) dflt="$libs";; | |
3781 | esac | |
3782 | case "$dflt" in | |
3783 | ' '|'') dflt='none';; | |
3784 | esac | |
4633a7c4 | 3785 | |
bd9b35c9 | 3786 | $cat <<EOM |
4633a7c4 | 3787 | |
bd9b35c9 JH |
3788 | In order to compile $package on your machine, a number of libraries |
3789 | are usually needed. Include any other special libraries here as well. | |
3790 | Say "none" for none. The default list is almost always right. | |
8e07c86e | 3791 | EOM |
8e07c86e | 3792 | |
bd9b35c9 JH |
3793 | echo " " |
3794 | rp="What libraries to use?" | |
3795 | . ./myread | |
3796 | case "$ans" in | |
3797 | none) libs=' ';; | |
3798 | *) libs="$ans";; | |
3799 | esac | |
d71b2b6b | 3800 | |
bd9b35c9 JH |
3801 | : determine optimization, if desired, or use for debug flag also |
3802 | case "$optimize" in | |
3803 | ' '|$undef) dflt='none';; | |
3804 | '') dflt='-O';; | |
3805 | *) dflt="$optimize";; | |
3806 | esac | |
3807 | $cat <<EOH | |
d71b2b6b | 3808 | |
bd9b35c9 JH |
3809 | By default, $package compiles with the -O flag to use the optimizer. |
3810 | Alternately, you might want to use the symbolic debugger, which uses | |
3811 | the -g flag (on traditional Unix systems). Either flag can be | |
3812 | specified here. To use neither flag, specify the word "none". | |
d71b2b6b | 3813 | |
bd9b35c9 JH |
3814 | EOH |
3815 | rp="What optimizer/debugger flag should be used?" | |
3816 | . ./myread | |
3817 | optimize="$ans" | |
3818 | case "$optimize" in | |
3819 | 'none') optimize=" ";; | |
3820 | esac | |
3821 | ||
3822 | dflt='' | |
3823 | : We will not override a previous value, but we might want to | |
3824 | : augment a hint file | |
3825 | case "$hint" in | |
3826 | default|recommended) | |
3827 | case "$gccversion" in | |
3828 | 1*) dflt='-fpcc-struct-return' ;; | |
d71b2b6b | 3829 | esac |
bd9b35c9 JH |
3830 | case "$optimize" in |
3831 | *-g*) dflt="$dflt -DDEBUGGING";; | |
d71b2b6b | 3832 | esac |
bd9b35c9 JH |
3833 | case "$gccversion" in |
3834 | 2*) if test -d /etc/conf/kconfig.d && | |
3835 | $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1 | |
3836 | then | |
3837 | dflt="$dflt -posix" | |
3838 | fi | |
f0d04425 | 3839 | ;; |
bd9b35c9 JH |
3840 | esac |
3841 | case "$gccversion" in | |
3842 | 1*) ;; | |
3843 | 2.[0-8]*) ;; | |
3844 | ?*) echo " " | |
3845 | echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1 | |
3846 | echo 'int main(void) { return 0; }' > gcctest.c | |
3847 | if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then | |
3848 | echo "Yes, it does." 2>&1 | |
3849 | case "$ccflags" in | |
3850 | *strict-aliasing*) | |
3851 | echo "Leaving current flags $ccflags alone." 2>&1 | |
3852 | ;; | |
3853 | *) dflt="$dflt -fno-strict-aliasing" ;; | |
3854 | esac | |
3855 | else | |
3856 | echo "Nope, it doesn't, but that's ok." 2>&1 | |
3857 | fi | |
f0d04425 | 3858 | ;; |
e5e20432 JH |
3859 | esac |
3860 | ;; | |
3861 | esac | |
3862 | ||
bd9b35c9 JH |
3863 | case "$mips_type" in |
3864 | *BSD*|'') inclwanted="$locincpth $usrinc";; | |
3865 | *) inclwanted="$locincpth $inclwanted $usrinc/bsd";; | |
3866 | esac | |
3867 | for thisincl in $inclwanted; do | |
3868 | if $test -d $thisincl; then | |
3869 | if $test x$thisincl != x$usrinc; then | |
3870 | case "$dflt" in | |
422af00a LC |
3871 | *" -I$thisincl "*);; |
3872 | *) dflt="$dflt -I$thisincl ";; | |
bd9b35c9 JH |
3873 | esac |
3874 | fi | |
3875 | fi | |
3876 | done | |
40a7a20a | 3877 | |
bd9b35c9 JH |
3878 | inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then |
3879 | xxx=true; | |
3880 | elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then | |
3881 | xxx=true; | |
3882 | else | |
3883 | xxx=false; | |
3884 | fi; | |
3885 | if $xxx; then | |
3886 | case "$dflt" in | |
3887 | *$2*);; | |
3888 | *) dflt="$dflt -D$2";; | |
3889 | esac; | |
3890 | fi' | |
40a7a20a | 3891 | |
bd9b35c9 | 3892 | set signal.h LANGUAGE_C; eval $inctest |
40a7a20a | 3893 | |
bd9b35c9 JH |
3894 | case "$usesocks" in |
3895 | $define) | |
3896 | ccflags="$ccflags -DSOCKS" | |
3897 | ;; | |
3898 | esac | |
40a7a20a | 3899 | |
bd9b35c9 JH |
3900 | case "$hint" in |
3901 | default|recommended) dflt="$ccflags $dflt" ;; | |
3902 | *) dflt="$ccflags";; | |
3903 | esac | |
40a7a20a | 3904 | |
bd9b35c9 JH |
3905 | case "$dflt" in |
3906 | ''|' ') dflt=none;; | |
3907 | esac | |
422af00a | 3908 | |
bd9b35c9 | 3909 | $cat <<EOH |
40a7a20a | 3910 | |
bd9b35c9 JH |
3911 | Your C compiler may want other flags. For this question you should include |
3912 | -I/whatever and -DWHATEVER flags and any other flags used by the C compiler, | |
3913 | but you should NOT include libraries or ld flags like -lwhatever. If you | |
3914 | want $package to honor its debug switch, you should include -DDEBUGGING here. | |
3915 | Your C compiler might also need additional flags, such as -D_POSIX_SOURCE. | |
40a7a20a | 3916 | |
bd9b35c9 | 3917 | To use no flags, specify the word "none". |
40a7a20a | 3918 | |
bd9b35c9 JH |
3919 | EOH |
3920 | set X $dflt | |
3921 | shift | |
3922 | dflt=${1+"$@"} | |
3923 | rp="Any additional cc flags?" | |
3924 | . ./myread | |
3925 | case "$ans" in | |
3926 | none) ccflags='';; | |
3927 | *) ccflags="$ans";; | |
3928 | esac | |
8e07c86e | 3929 | |
bd9b35c9 JH |
3930 | : the following weeds options from ccflags that are of no interest to cpp |
3931 | cppflags="$ccflags" | |
3932 | case "$gccversion" in | |
3933 | 1*) cppflags="$cppflags -D__GNUC__" | |
4633a7c4 | 3934 | esac |
bd9b35c9 JH |
3935 | case "$mips_type" in |
3936 | '');; | |
3937 | *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";; | |
3938 | esac | |
3939 | case "$cppflags" in | |
3940 | '');; | |
3941 | *) | |
3942 | echo " " | |
3943 | echo "Let me guess what the preprocessor flags are..." >&4 | |
3944 | set X $cppflags | |
3945 | shift | |
3946 | cppflags='' | |
3947 | $cat >cpp.c <<'EOM' | |
3948 | #define BLURFL foo | |
8e07c86e | 3949 | |
bd9b35c9 JH |
3950 | BLURFL xx LFRULB |
3951 | EOM | |
3952 | previous='' | |
3953 | for flag in $* | |
3954 | do | |
3955 | case "$flag" in | |
3956 | -*) ftry="$flag";; | |
3957 | *) ftry="$previous $flag";; | |
3958 | esac | |
3959 | if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \ | |
3960 | >cpp1.out 2>/dev/null && \ | |
3961 | $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \ | |
3962 | >cpp2.out 2>/dev/null && \ | |
3963 | $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \ | |
3964 | $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1 | |
3965 | then | |
3966 | cppflags="$cppflags $ftry" | |
3967 | previous='' | |
3968 | else | |
3969 | previous="$flag" | |
3970 | fi | |
3971 | done | |
3972 | set X $cppflags | |
3973 | shift | |
3974 | cppflags=${1+"$@"} | |
3975 | case "$cppflags" in | |
3976 | *-*) echo "They appear to be: $cppflags";; | |
3977 | esac | |
3978 | $rm -f cpp.c cpp?.out | |
2afac517 | 3979 | ;; |
3980 | esac | |
8e07c86e | 3981 | |
bd9b35c9 JH |
3982 | : flags used in final linking phase |
3983 | case "$ldflags" in | |
3984 | '') if ./venix; then | |
3985 | dflt='-i -z' | |
10a23457 | 3986 | else |
bd9b35c9 | 3987 | dflt='' |
10a23457 | 3988 | fi |
bd9b35c9 JH |
3989 | case "$ccflags" in |
3990 | *-posix*) dflt="$dflt -posix" ;; | |
c4f23d77 | 3991 | esac |
bd9b35c9 JH |
3992 | ;; |
3993 | *) dflt="$ldflags";; | |
3994 | esac | |
3995 | ||
3996 | : Try to guess additional flags to pick up local libraries. | |
3997 | for thislibdir in $libpth; do | |
3998 | case " $loclibpth " in | |
3999 | *" $thislibdir "*) | |
4000 | case "$dflt " in | |
4001 | *"-L$thislibdir "*) ;; | |
4002 | *) dflt="$dflt -L$thislibdir" ;; | |
4003 | esac | |
c4f23d77 AD |
4004 | ;; |
4005 | esac | |
bd9b35c9 | 4006 | done |
c4f23d77 | 4007 | |
bd9b35c9 JH |
4008 | case "$dflt" in |
4009 | '') dflt='none' ;; | |
4010 | esac | |
c4f23d77 | 4011 | |
bd9b35c9 JH |
4012 | $cat <<EOH |
4013 | ||
4014 | Your C linker may need flags. For this question you should | |
4015 | include -L/whatever and any other flags used by the C linker, but you | |
4016 | should NOT include libraries like -lwhatever. | |
4017 | ||
4018 | Make sure you include the appropriate -L/path flags if your C linker | |
4019 | does not normally search all of the directories you specified above, | |
4020 | namely | |
4021 | $libpth | |
4022 | To use no flags, specify the word "none". | |
4023 | ||
4024 | EOH | |
4025 | ||
4026 | rp="Any additional ld flags (NOT including libraries)?" | |
4027 | . ./myread | |
4028 | case "$ans" in | |
4029 | none) ldflags='';; | |
4030 | *) ldflags="$ans";; | |
4031 | esac | |
4032 | rmlist="$rmlist pdp11" | |
4033 | ||
4034 | : coherency check | |
4035 | echo " " | |
4036 | echo "Checking your choice of C compiler and flags for coherency..." >&4 | |
4037 | $cat > try.c <<'EOF' | |
4038 | #include <stdio.h> | |
4039 | int main() { printf("Ok\n"); exit(0); } | |
4040 | EOF | |
7a282f6d | 4041 | set X $cc -o try $optimize $ccflags $ldflags try.c $libs |
bd9b35c9 JH |
4042 | shift |
4043 | $cat >try.msg <<'EOM' | |
4044 | I've tried to compile and run the following simple program: | |
4045 | ||
4046 | EOM | |
4047 | $cat try.c >> try.msg | |
4048 | ||
4049 | $cat >> try.msg <<EOM | |
4050 | ||
4051 | I used the command: | |
4052 | ||
4053 | $* | |
4054 | ./try | |
4055 | ||
4056 | and I got the following output: | |
4057 | ||
4058 | EOM | |
4059 | dflt=y | |
7a282f6d | 4060 | if sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then |
bd9b35c9 JH |
4061 | if sh -c './try' >>try.msg 2>&1; then |
4062 | xxx=`./try` | |
4063 | case "$xxx" in | |
4064 | "Ok") dflt=n ;; | |
4065 | *) echo 'The program compiled OK, but produced no output.' >> try.msg | |
4066 | case " $libs " in | |
4067 | *" -lsfio "*) | |
4068 | cat >> try.msg <<'EOQS' | |
4069 | If $libs contains -lsfio, and sfio is mis-configured, then it | |
4070 | sometimes (apparently) runs and exits with a 0 status, but with no | |
4071 | output! It may have to do with sfio's use of _exit vs. exit. | |
4072 | ||
4073 | EOQS | |
4074 | rp="You have a big problem. Shall I abort Configure" | |
4075 | dflt=y | |
4076 | ;; | |
4077 | esac | |
4078 | ;; | |
4079 | esac | |
4080 | else | |
4081 | echo "The program compiled OK, but exited with status $?." >>try.msg | |
4082 | rp="You have a problem. Shall I abort Configure" | |
4083 | dflt=y | |
4084 | fi | |
4085 | else | |
4086 | echo "I can't compile the test program." >>try.msg | |
4087 | rp="You have a BIG problem. Shall I abort Configure" | |
4088 | dflt=y | |
4089 | fi | |
4090 | case "$dflt" in | |
4091 | y) | |
4092 | $cat try.msg >&4 | |
4093 | case "$knowitall" in | |
4094 | '') | |
4095 | echo "(The supplied flags or libraries might be incorrect.)" | |
c4f23d77 | 4096 | ;; |
bd9b35c9 | 4097 | *) dflt=n;; |
c4f23d77 | 4098 | esac |
bd9b35c9 JH |
4099 | echo " " |
4100 | . ./myread | |
4101 | case "$ans" in | |
4102 | n*|N*) ;; | |
4103 | *) echo "Ok. Stopping Configure." >&4 | |
4104 | exit 1 | |
c4f23d77 AD |
4105 | ;; |
4106 | esac | |
4107 | ;; | |
bd9b35c9 | 4108 | n) echo "OK, that should do.";; |
c4f23d77 | 4109 | esac |
bd9b35c9 | 4110 | $rm -f try try.* core |
c4f23d77 | 4111 | |
b4eb6b3d JH |
4112 | : define an is-a-typedef? function |
4113 | typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; | |
4114 | case "$inclist" in | |
4115 | "") inclist="sys/types.h";; | |
4116 | esac; | |
4117 | eval "varval=\$$var"; | |
4118 | case "$varval" in | |
4119 | "") | |
4120 | $rm -f temp.c; | |
4121 | for inc in $inclist; do | |
4122 | echo "#include <$inc>" >>temp.c; | |
4123 | done; | |
4124 | echo "#ifdef $type" >> temp.c; | |
4125 | echo "printf(\"We have $type\");" >> temp.c; | |
4126 | echo "#endif" >> temp.c; | |
4127 | $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null; | |
4128 | if $contains $type temp.E >/dev/null 2>&1; then | |
4129 | eval "$var=\$type"; | |
4130 | else | |
4131 | eval "$var=\$def"; | |
4132 | fi; | |
4133 | $rm -f temp.?;; | |
4134 | *) eval "$var=\$varval";; | |
4135 | esac' | |
4136 | ||
4137 | : define an is-a-typedef? function that prompts if the type is not available. | |
4138 | typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@; | |
4139 | case "$inclist" in | |
4140 | "") inclist="sys/types.h";; | |
4141 | esac; | |
4142 | eval "varval=\$$var"; | |