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