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