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