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