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