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