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