This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
maildomain to support /etc/mailname
[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 16# The dist package (which contains metaconfig) is available via SVN:
7c1269c3 17# svn co https://svn.code.sf.net/p/dist/code/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
7c1269c3 31# Generated on Tue May 7 23:44:53 CEST 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 853doublesize=''
9d1a8da0 854bootstrap_charset=''
b4eb6b3d
JH
855ebcdic=''
856fflushNULL=''
857fflushall=''
858fpossize=''
859fpostype=''
2d736872 860gccansipedantic=''
5b463ca7 861gccosandvers=''
8a27cf78 862gccversion=''
b4eb6b3d
JH
863gidformat=''
864gidsign=''
865gidsize=''
866gidtype=''
867groupstype=''
868h_fcntl=''
869h_sysfile=''
6e1038e0
MB
870html1dir=''
871html1direxp=''
872installhtml1dir=''
873html3dir=''
874html3direxp=''
875installhtml3dir=''
b4eb6b3d 876i_arpainet=''
c0bacbef 877i_assert=''
10bc17b6 878i_crypt=''
b4eb6b3d
JH
879db_hashtype=''
880db_prefixtype=''
640374d0
JH
881db_version_major=''
882db_version_minor=''
883db_version_patch=''
b4eb6b3d
JH
884i_db=''
885i_dbm=''
886i_rpcsvcdbm=''
887d_dirnamlen=''
888direntrytype=''
889i_dirent=''
a0d0e21e 890i_dld=''
b4eb6b3d
JH
891i_dlfcn=''
892i_fcntl=''
893i_float=''
758a5d79
JH
894i_fp=''
895i_fp_class=''
b4eb6b3d
JH
896i_gdbm=''
897d_grpasswd=''
898i_grp=''
b4eb6b3d
JH
899i_ieeefp=''
900i_inttypes=''
2765b840 901i_langinfo=''
b4eb6b3d
JH
902i_libutil=''
903i_limits=''
904i_locale=''
905i_machcthr=''
906i_malloc=''
1cd66f7c 907i_mallocmalloc=''
b4eb6b3d
JH
908i_math=''
909i_memory=''
910i_mntent=''
e74475c7
MHM
911d_gdbm_ndbm_h_uses_prototypes=''
912d_gdbmndbm_h_uses_prototypes=''
a33f2d9f 913d_ndbm=''
e74475c7 914d_ndbm_h_uses_prototypes=''
a33f2d9f
AD
915i_gdbm_ndbm=''
916i_gdbmndbm=''
b4eb6b3d
JH
917i_ndbm=''
918i_netdb=''
919i_neterrno=''
920i_netinettcp=''
921i_niin=''
922i_sysin=''
923i_poll=''
924i_prot=''
925i_pthread=''
926d_pwage=''
927d_pwchange=''
928d_pwclass=''
929d_pwcomment=''
930d_pwexpire=''
931d_pwgecos=''
932d_pwpasswd=''
933d_pwquota=''
934i_pwd=''
935i_sfio=''
936i_shadow=''
937i_socks=''
bd31be4b 938i_stdbool=''
b4eb6b3d
JH
939i_stddef=''
940i_stdlib=''
941i_string=''
942strings=''
943i_sunmath=''
944i_sysaccess=''
945i_sysdir=''
946i_sysfile=''
947d_voidtty=''
948i_bsdioctl=''
949i_sysfilio=''
950i_sysioctl=''
951i_syssockio=''
952i_syslog=''
953i_sysmman=''
954i_sysmode=''
955i_sysmount=''
956i_sysndir=''
957i_sysparam=''
216dac04 958i_syspoll=''
b4eb6b3d
JH
959i_sysresrc=''
960i_syssecrt=''
961i_sysselct=''
962i_sysstat=''
963i_sysstatfs=''
964i_sysstatvfs=''
965i_systimes=''
966i_systypes=''
967i_sysuio=''
968i_sysun=''
969i_sysutsname=''
970i_sysvfs=''
971i_syswait=''
972i_sgtty=''
973i_termio=''
974i_termios=''
14b90194
JH
975d_tm_tm_gmtoff=''
976d_tm_tm_zone=''
b4eb6b3d
JH
977i_systime=''
978i_systimek=''
979i_time=''
980timeincl=''
981i_unistd=''
982i_ustat=''
983i_utime=''
984i_values=''
985i_stdarg=''
986i_varargs=''
987i_varhdr=''
988i_vfork=''
f3f1a2d8 989d_inc_version_list=''
b4eb6b3d
JH
990inc_version_list=''
991inc_version_list_init=''
992installprefix=''
993installprefixexp=''
994installstyle=''
995installusrbinperl=''
996intsize=''
997longsize=''
998shortsize=''
4b661809 999issymlink=''
2304df62 1000libc=''
b4eb6b3d
JH
1001ldlibpthname=''
1002libperl=''
1003shrpenv=''
1004useshrplib=''
a0d0e21e 1005glibpth=''
2304df62 1006libpth=''
8e07c86e 1007loclibpth=''
2304df62
AD
1008plibpth=''
1009xlibpth=''
1cfa4ec7 1010ignore_versioned_solibs=''
2304df62 1011libs=''
43999f95
JH
1012libsdirs=''
1013libsfiles=''
1014libsfound=''
13b3f787 1015libspath=''
85e6fe83 1016lns=''
b4eb6b3d
JH
1017d_PRIEUldbl=''
1018d_PRIFUldbl=''
1019d_PRIGUldbl=''
1020d_PRIeldbl=''
1021d_PRIfldbl=''
1022d_PRIgldbl=''
1023d_SCNfldbl=''
1024sPRIEUldbl=''
1025sPRIFUldbl=''
1026sPRIGUldbl=''
1027sPRIeldbl=''
1028sPRIfldbl=''
1029sPRIgldbl=''
1030sSCNfldbl=''
1031lseeksize=''
1032lseektype=''
d620c7b3 1033mad=''
00e74f14
NC
1034madlyh=''
1035madlyobj=''
1036madlysrc=''
f3f1a2d8
MB
1037make_set_make=''
1038d_mymalloc=''
1039freetype=''
b4eb6b3d
JH
1040mallocobj=''
1041mallocsrc=''
1042malloctype=''
9df442c2 1043usemallocwrap=''
b4eb6b3d
JH
1044usemymalloc=''
1045installman1dir=''
1046man1dir=''
1047man1direxp=''
1048man1ext=''
1049installman3dir=''
1050man3dir=''
1051man3direxp=''
1052man3ext=''
1053modetype=''
1054multiarch=''
1055mydomain=''
1056myhostname=''
1057phostname=''
2304df62
AD
1058c=''
1059n=''
b4eb6b3d
JH
1060d_eofnblk=''
1061eagain=''
1062o_nonblock=''
1063rd_nodata=''
2cc61e15 1064need_va_copy=''
b4eb6b3d
JH
1065netdb_hlen_type=''
1066netdb_host_type=''
1067netdb_name_type=''
1068netdb_net_type=''
1069groupcat=''
1070hostcat=''
1071passcat=''
1072orderlib=''
1073ranlib=''
1074d_perl_otherlibdirs=''
1075otherlibdirs=''
2304df62
AD
1076package=''
1077spackage=''
b4eb6b3d
JH
1078pager=''
1079api_revision=''
1080api_subversion=''
1081api_version=''
1082api_versionstring=''
1083patchlevel=''
151e6568 1084perl_patchlevel=''
b4eb6b3d
JH
1085revision=''
1086subversion=''
1087version=''
861eb78d 1088version_patchlevel_string=''
b4eb6b3d
JH
1089perl5=''
1090perladmin=''
91f55cc7 1091perlpath=''
b4eb6b3d 1092d_nv_preserves_uv=''
f607920a 1093d_nv_zero_is_allbits_zero=''
b4eb6b3d
JH
1094i16size=''
1095i16type=''
1096i32size=''
1097i32type=''
1098i64size=''
1099i64type=''
1100i8size=''
1101i8type=''
1102ivsize=''
1103ivtype=''
b68c599a 1104nv_overflows_integers_at=''
4137585d 1105nv_preserves_uv_bits=''
b4eb6b3d
JH
1106nvsize=''
1107nvtype=''
1108u16size=''
1109u16type=''
1110u32size=''
1111u32type=''
1112u64size=''
1113u64type=''
1114u8size=''
1115u8type=''
1116uvsize=''
1117uvtype=''
1118ivdformat=''
1119nvEUformat=''
1120nvFUformat=''
1121nvGUformat=''
1122nveformat=''
1123nvfformat=''
1124nvgformat=''
1125uvXUformat=''
1126uvoformat=''
1127uvuformat=''
1128uvxformat=''
1129pidtype=''
1130prefix=''
1131prefixexp=''
1132installprivlib=''
1133privlib=''
1134privlibexp=''
1135prototype=''
1136ptrsize=''
1137d_PRIXU64=''
1138d_PRId64=''
1139d_PRIi64=''
1140d_PRIo64=''
1141d_PRIu64=''
1142d_PRIx64=''
1143sPRIXU64=''
1144sPRId64=''
1145sPRIi64=''
1146sPRIo64=''
1147sPRIu64=''
1148sPRIx64=''
1149d_quad=''
1150quadkind=''
1151quadtype=''
1152uquadtype=''
1153drand01=''
1154randbits=''
1155randfunc=''
1156randseedtype=''
1157seedfunc=''
1158installscript=''
1159scriptdir=''
1160scriptdirexp=''
1161selectminbits=''
1162selecttype=''
8ff267be 1163sh=''
b4eb6b3d
JH
1164sig_count=''
1165sig_name=''
1166sig_name_init=''
1167sig_num=''
1168sig_num_init=''
76d3c696 1169sig_size=''
f3f1a2d8 1170d_sitearch=''
b4eb6b3d
JH
1171installsitearch=''
1172sitearch=''
1173sitearchexp=''
1174installsitebin=''
1175sitebin=''
1176sitebinexp=''
8d2cbf27
JH
1177installsitehtml1dir=''
1178sitehtml1dir=''
1179sitehtml1direxp=''
1180installsitehtml3dir=''
1181sitehtml3dir=''
1182sitehtml3direxp=''
b4eb6b3d
JH
1183installsitelib=''
1184sitelib=''
1185sitelib_stem=''
1186sitelibexp=''
91e123a8
JH
1187installsiteman1dir=''
1188siteman1dir=''
1189siteman1direxp=''
1190installsiteman3dir=''
1191siteman3dir=''
1192siteman3direxp=''
b4eb6b3d
JH
1193siteprefix=''
1194siteprefixexp=''
6e1038e0
MB
1195installsitescript=''
1196sitescript=''
1197sitescriptexp=''
b4eb6b3d
JH
1198sizesize=''
1199sizetype=''
a0d0e21e 1200so=''
b4eb6b3d 1201socksizetype=''
2304df62
AD
1202sharpbang=''
1203shsharp=''
1204spitshell=''
dfe9444c 1205src=''
b4eb6b3d 1206ssizetype=''
668fdbe1
MB
1207st_ino_sign=''
1208st_ino_size=''
b4eb6b3d 1209startperl=''
2304df62 1210startsh=''
b4eb6b3d
JH
1211stdchar=''
1212d_stdio_stream_array=''
1213stdio_stream_array=''
1214sysman=''
81c4fd9e
MB
1215sGMTIME_max=''
1216sGMTIME_min=''
73e6e416
MB
1217sLOCALTIME_max=''
1218sLOCALTIME_min=''
5ff3f7a4 1219trnl=''
b4eb6b3d
JH
1220uidformat=''
1221uidsign=''
1222uidsize=''
1223uidtype=''
1224archname64=''
1225use64bitall=''
1226use64bitint=''
34f1896b
MB
1227dtrace=''
1228usedtrace=''
15b61c98 1229usefaststdio=''
d78f9ffa 1230usekernprocpathname=''
b4eb6b3d
JH
1231ccflags_uselargefiles=''
1232ldflags_uselargefiles=''
1233libswanted_uselargefiles=''
1234uselargefiles=''
1235uselongdouble=''
1236usemorebits=''
1237usemultiplicity=''
2304df62 1238nm_opt=''
40a7a20a 1239nm_so_opt=''
2304df62
AD
1240runnm=''
1241usenm=''
ae60cb46 1242usensgetexecutablepath=''
b4eb6b3d 1243useperlio=''
29209bc5 1244usesocks=''
b4eb6b3d
JH
1245d_oldpthreads=''
1246use5005threads=''
1247useithreads=''
9514c62b 1248usereentrant=''
b4eb6b3d 1249usethreads=''
2304df62 1250incpath=''
2304df62
AD
1251mips_type=''
1252usrinc=''
d03b3b00 1253vaproto=''
b4eb6b3d
JH
1254d_vendorarch=''
1255installvendorarch=''
1256vendorarch=''
1257vendorarchexp=''
1258d_vendorbin=''
1259installvendorbin=''
1260vendorbin=''
1261vendorbinexp=''
8d2cbf27
JH
1262installvendorhtml1dir=''
1263vendorhtml1dir=''
1264vendorhtml1direxp=''
1265installvendorhtml3dir=''
1266vendorhtml3dir=''
1267vendorhtml3direxp=''
b4eb6b3d
JH
1268d_vendorlib=''
1269installvendorlib=''
1270vendorlib=''
1271vendorlib_stem=''
1272vendorlibexp=''
91e123a8
JH
1273installvendorman1dir=''
1274vendorman1dir=''
1275vendorman1direxp=''
1276installvendorman3dir=''
1277vendorman3dir=''
1278vendorman3direxp=''
b4eb6b3d
JH
1279usevendorprefix=''
1280vendorprefix=''
1281vendorprefixexp=''
6e1038e0
MB
1282d_vendorscript=''
1283installvendorscript=''
1284vendorscript=''
1285vendorscriptexp=''
d56c5707 1286versiononly=''
b4eb6b3d
JH
1287defvoidused=''
1288voidflags=''
3659ebf1
JH
1289yacc=''
1290yaccflags=''
2304df62
AD
1291CONFIG=''
1292
34f1896b 1293: Detect odd OSs
ecfc5424
AD
1294define='define'
1295undef='undef'
1296smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1297rmlist=''
1298
1299: We must find out about Eunice early
1300eunicefix=':'
1301if test -f /etc/unixtovms; then
1302 eunicefix=/etc/unixtovms
1303fi
1304if test -f /etc/unixtovms.exe; then
1305 eunicefix=/etc/unixtovms.exe
1306fi
1307
cfb04860 1308: Set executable suffix now -- needed before hints available
6153ba32
PG
1309if test -f "/libs/version.library"; then
1310: Amiga OS
1311 _exe=""
1312elif test -f "/system/gnu_library/bin/ar.pm"; then
1313: Stratus VOS
cfb04860 1314 _exe=".pm"
6153ba32
PG
1315elif test -n "$DJGPP"; then
1316: DOS DJGPP
cfb04860 1317 _exe=".exe"
5c728af0 1318elif test -d c:/. -o -n "$is_os2" ; then
506faf56 1319: OS/2 or cygwin
ba863942
JH
1320 _exe=".exe"
1321fi
868439a2 1322
1d8eaf8c 1323groupstype=''
b4eb6b3d 1324i_whoami=''
06501368
MB
1325: Trailing extension. Override this in a hint file, if needed.
1326: Extra object files, if any, needed on this platform.
1327archobjs=''
b8677e3b
MB
1328archname=''
1329: Possible local include directories to search.
1330: Set locincpth to "" in a hint file to defeat local include searches.
1331locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1332locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1333:
1334: no include file wanted by default
1335inclwanted=''
1336
1337: Enable -DEBUGGING and -DDEBUGGING from the command line
1338EBUGGING=''
356123f1 1339DEBUGGING=''
b8677e3b 1340
64615a5e 1341libnames=''
732c9516
JH
1342: change the next line if compiling for Xenix/286 on Xenix/386
1343xlibpth='/usr/lib/386 /lib/386'
732c9516
JH
1344: Possible local library directories to search.
1345loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1346loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1347
1348: general looking path for locating libraries
5869b1f1 1349glibpth="/lib /usr/lib $xlibpth"
732c9516 1350glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
f7dd4e7f
JH
1351test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1352test -f /shlib/libc.so && glibpth="/shlib $glibpth"
faae14e6 1353test -d /usr/lib64 && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
732c9516
JH
1354
1355: Private path used by Configure to find libraries. Its value
1356: is prepended to libpth. This variable takes care of special
1357: machines, like the mips. Usually, it should be empty.
1358plibpth=''
1359
1cfa4ec7
GS
1360: default library list
1361libswanted=''
921b2963 1362: some systems want to use only the non-versioned libso:s
1cfa4ec7 1363ignore_versioned_solibs=''
06501368
MB
1364: set usethreads on the Configure command line to enable threads.
1365usereentrant='undef'
ed140128
AD
1366: full support for void wanted by default
1367defvoidused=15
1368
ed140128
AD
1369ccname=''
1370ccversion=''
1371perllibs=''
1372: set useposix=false in your hint file to disable the POSIX extension.
1373useposix=true
1374: set useopcode=false in your hint file to disable the Opcode extension.
1375useopcode=true
b4eb6b3d
JH
1376archname64=''
1377ccflags_uselargefiles=''
1378ldflags_uselargefiles=''
1379libswanted_uselargefiles=''
1380: set usemultiplicity on the Configure command line to enable multiplicity.
29209bc5 1381: set usesocks on the Configure command line to enable socks.
ecfc5424 1382: List of libraries we want.
15431986 1383: If anyone needs extra -lxxx, put those in a hint file.
6bdd71ef 1384libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
8119684f 1385libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1aef975c 1386: We probably want to search /usr/shlib before most other libraries.
94b6baf5 1387: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
ecfc5424
AD
1388glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1389glibpth="/usr/shlib $glibpth"
1390: Do not use vfork unless overridden by a hint file.
1391usevfork=false
1392
8ff267be
PP
1393: Find the basic shell for Bourne shell scripts
1394case "$sh" in
1395'')
8ff267be
PP
1396 case "$SYSTYPE" in
1397 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1398 *) xxx='/bin/sh';;
1399 esac
1400 if test -f "$xxx"; then
1401 sh="$xxx"
1402 else
1403 : Build up a list and do a single loop so we can 'break' out.
1404 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1405 for xxx in sh bash ksh pdksh ash; do
1406 for p in $pth; do
1407 try="$try ${p}/${xxx}"
1408 done
1409 done
1410 for xxx in $try; do
1411 if test -f "$xxx"; then
1412 sh="$xxx";
8ff267be 1413 break
a5a94ea5
JH
1414 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1415 sh="$xxx";
1416 break
8ff267be
PP
1417 elif test -f "$xxx.exe"; then
1418 sh="$xxx";
8ff267be
PP
1419 break
1420 fi
1421 done
1422 fi
1423 ;;
1424esac
1425
1426case "$sh" in
a33c94aa 1427'') cat >&2 <<EOM
8ff267be 1428$me: Fatal Error: I can't find a Bourne Shell anywhere.
dfe9444c 1429
8ff267be 1430Usually it's in /bin/sh. How did you even get this far?
7f2de2d2 1431Please contact me (Perl Maintainers) at perlbug@perl.org and
dfe9444c 1432we'll try to straighten this all out.
8ff267be
PP
1433EOM
1434 exit 1
1435 ;;
1436esac
1437
760ac839 1438: see if sh knows # comments
73614538 1439if `$sh -c '#' >/dev/null 2>&1`; then
760ac839
LW
1440 shsharp=true
1441 spitshell=cat
760ac839 1442 xcat=/bin/cat
a931254c
JH
1443 test -f $xcat$_exe || xcat=/usr/bin/cat
1444 if test ! -f $xcat$_exe; then
4bdb8fb5 1445 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
a931254c 1446 if test -f $p/cat$_exe; then
1deb0a86 1447 xcat=$p/cat
3c728e00
JH
1448 break
1449 fi
1450 done
1deb0a86
JH
1451 if test ! -f $xcat$_exe; then
1452 echo "Can't find cat anywhere!"
3c728e00
JH
1453 exit 1
1454 fi
1455 fi
5440bc8e
JH
1456 echo "#!$xcat" >sharp
1457 $eunicefix sharp
1458 chmod +x sharp
1d8eaf8c 1459 ./sharp > today 2>/dev/null
760ac839 1460 if test -s today; then
760ac839
LW
1461 sharpbang='#!'
1462 else
5440bc8e
JH
1463 echo "#! $xcat" > sharp
1464 $eunicefix sharp
1465 chmod +x sharp
1d8eaf8c 1466 ./sharp > today 2>/dev/null
760ac839 1467 if test -s today; then
760ac839
LW
1468 sharpbang='#! '
1469 else
760ac839
LW
1470 sharpbang=': use '
1471 fi
1472 fi
1473else
dfe9444c 1474 echo " "
8ff267be 1475 echo "Your $sh doesn't grok # comments--I will strip them later on."
760ac839
LW
1476 shsharp=false
1477 cd ..
1478 echo "exec grep -v '^[ ]*#'" >spitshell
1479 chmod +x spitshell
1480 $eunicefix spitshell
1481 spitshell=`pwd`/spitshell
1482 cd UU
1483 echo "I presume that if # doesn't work, #! won't work either!"
1484 sharpbang=': use '
1485fi
5440bc8e 1486rm -f sharp today
760ac839
LW
1487
1488: figure out how to guarantee sh startup
8ff267be
PP
1489case "$startsh" in
1490'') startsh=${sharpbang}${sh} ;;
1491*)
760ac839 1492esac
5440bc8e 1493cat >sharp <<EOSS
760ac839
LW
1494$startsh
1495set abc
1496test "$?abc" != 1
1497EOSS
1498
5440bc8e
JH
1499chmod +x sharp
1500$eunicefix sharp
1501if ./sharp; then
8ff267be 1502 : echo "Yup, it does."
760ac839 1503else
dfe9444c
AD
1504 echo "Hmm... '$startsh' does not guarantee sh startup..."
1505 echo "You may have to fix up the shell scripts to make sure $sh runs them."
760ac839 1506fi
5440bc8e 1507rm -f sharp
760ac839 1508
aebf16e7
AD
1509: Save command line options in file UU/cmdline.opt for later use in
1510: generating config.sh.
1511cat > cmdline.opt <<EOSH
613d6c3e 1512: Configure command line arguments.
aebf16e7
AD
1513config_arg0='$0'
1514config_args='$*'
1515config_argc=$#
1516EOSH
1517argn=1
ee45ea83
IZ
1518args_exp=''
1519args_sep=''
aebf16e7
AD
1520for arg in "$@"; do
1521 cat >>cmdline.opt <<EOSH
1522config_arg$argn='$arg'
1523EOSH
ee45ea83
IZ
1524 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1525$arg
1526EOC
1527 arg_exp=`cat cmdl.opt`
1528 args_exp="$args_exp$args_sep'$arg_exp'"
aebf16e7 1529 argn=`expr $argn + 1`
ee45ea83 1530 args_sep=' '
aebf16e7 1531done
ee45ea83 1532rm -f cmdl.opt
aebf16e7 1533
2304df62
AD
1534: produce awk script to parse command line options
1535cat >options.awk <<'EOF'
1536BEGIN {
02e93a22 1537 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
2304df62
AD
1538
1539 len = length(optstr);
1540 for (i = 1; i <= len; i++) {
1541 c = substr(optstr, i, 1);
1542 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1543 if (a == ":") {
1544 arg[c] = 1;
1545 i++;
1546 }
1547 opt[c] = 1;
1548 }
1549}
1550{
1551 expect = 0;
1552 str = $0;
1553 if (substr(str, 1, 1) != "-") {
1554 printf("'%s'\n", str);
1555 next;
1556 }
1557 len = length($0);
1558 for (i = 2; i <= len; i++) {
1559 c = substr(str, i, 1);
1560 if (!opt[c]) {
1561 printf("-%s\n", substr(str, i));
1562 next;
1563 }
1564 printf("-%s\n", c);
1565 if (arg[c]) {
1566 if (i < len)
1567 printf("'%s'\n", substr(str, i + 1));
1568 else
1569 expect = 1;
1570 next;
1571 }
1572 }
1573}
1574END {
1575 if (expect)
1576 print "?";
1577}
1578EOF
1579
1580: process the command line options
4633a7c4
LW
1581set X `for arg in "$@"; do echo "X$arg"; done |
1582 sed -e s/X// | awk -f options.awk`
2304df62
AD
1583eval "set $*"
1584shift
1585rm -f options.awk
1586
1587: set up default values
1588fastread=''
1589reuseval=false
1590config_sh=''
1591alldone=''
1592error=''
1593silent=''
1594extractsh=''
ecfc5424 1595override=''
16d20bd9 1596knowitall=''
02e93a22 1597rm -f optdef.sh posthint.sh
28757baa
PP
1598cat >optdef.sh <<EOS
1599$startsh
1600EOS
2304df62 1601
dfe9444c 1602
2304df62
AD
1603: option parsing
1604while test $# -gt 0; do
1605 case "$1" in
1606 -d) shift; fastread=yes;;
1607 -e) shift; alldone=cont;;
1608 -f)
1609 shift
1610 cd ..
1611 if test -r "$1"; then
1612 config_sh="$1"
1613 else
a0d0e21e 1614 echo "$me: cannot read config file $1." >&2
2304df62
AD
1615 error=true
1616 fi
1617 cd UU
1618 shift;;
3f30fabf 1619 --help|\
2304df62
AD
1620 -h) shift; error=true;;
1621 -r) shift; reuseval=true;;
dfe9444c 1622 -s) shift; silent=true; realsilent=true;;
2304df62 1623 -E) shift; alldone=exit;;
16d20bd9 1624 -K) shift; knowitall=true;;
ecfc5424 1625 -O) shift; override=true;;
dfe9444c 1626 -S) shift; silent=true; extractsh=true;;
a0d0e21e
LW
1627 -D)
1628 shift
1629 case "$1" in
1630 *=)
1631 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1632 echo "$me: ignoring -D $1" >&2
1633 ;;
ecfc5424 1634 *=*) echo "$1" | \
1aef975c
AD
1635 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1636 *) echo "$1='define'" >> optdef.sh;;
a0d0e21e
LW
1637 esac
1638 shift
1639 ;;
1640 -U)
1641 shift
1642 case "$1" in
1aef975c 1643 *=) echo "$1" >> optdef.sh;;
a0d0e21e
LW
1644 *=*)
1645 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1646 echo "$me: ignoring -U $1" >&2
1647 ;;
1aef975c 1648 *) echo "$1='undef'" >> optdef.sh;;
a0d0e21e
LW
1649 esac
1650 shift
1651 ;;
02e93a22
JH
1652 -A)
1653 shift
1654 xxx=''
1655 yyy="$1"
02e93a22 1656 zzz=''
5f83a3e9 1657 uuu=undef
02e93a22 1658 case "$yyy" in
f7c31117 1659 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
5f83a3e9
JH
1660 case "$zzz" in
1661 *:*) zzz='' ;;
1662 *) xxx=append
613d6c3e 1663 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
f7c31117 1664 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
5f83a3e9
JH
1665 esac
1666 ;;
1667 esac
1668 case "$xxx" in
1669 '') case "$yyy" in
f7c31117
JH
1670 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1671 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1672 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1673 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1674 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1675 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
5f83a3e9 1676 esac
613d6c3e 1677 ;;
5f83a3e9 1678 esac
02e93a22
JH
1679 case "$xxx" in
1680 append)
5f83a3e9 1681 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
02e93a22 1682 clear)
5f83a3e9 1683 echo "$yyy=''" >> posthint.sh ;;
02e93a22
JH
1684 define)
1685 case "$zzz" in
1686 '') zzz=define ;;
1687 esac
5f83a3e9 1688 echo "$yyy='$zzz'" >> posthint.sh ;;
02e93a22 1689 eval)
5f83a3e9 1690 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
02e93a22 1691 prepend)
5f83a3e9 1692 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
02e93a22
JH
1693 undef)
1694 case "$zzz" in
1695 '') zzz="$uuu" ;;
1696 esac
5f83a3e9
JH
1697 echo "$yyy=$zzz" >> posthint.sh ;;
1698 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
02e93a22 1699 esac
bde6b06b 1700 shift
02e93a22 1701 ;;
216dac04 1702 -V) echo "$me generated by metaconfig 3.5 PL0." >&2
5f83a3e9 1703 exit 0;;
2304df62 1704 --) break;;
a0d0e21e 1705 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
2304df62
AD
1706 *) break;;
1707 esac
1708done
1709
1710case "$error" in
1711true)
1712 cat >&2 <<EOM
2afac517 1713Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
02e93a22 1714 [-U symbol] [-U symbol=] [-A command:symbol...]
2304df62
AD
1715 -d : use defaults for all answers.
1716 -e : go on without questioning past the production of config.sh.
1717 -f : specify an alternate default configuration file.
1718 -h : print this help message and exit (with an error status).
1719 -r : reuse C symbols value if possible (skips costly nm extraction).
1720 -s : silent mode, only echoes questions and essential information.
a0d0e21e
LW
1721 -D : define symbol to have some value:
1722 -D symbol symbol gets the value 'define'
1723 -D symbol=value symbol gets the value 'value'
3f30fabf
MB
1724 common used examples (see INSTALL for more info):
1725 -Duse64bitint use 64bit integers
b79e0b55 1726 -Duse64bitall use 64bit integers and pointers
3f30fabf 1727 -Dusethreads use thread support
b79e0b55 1728 -Dinc_version_list=none do not include older perl trees in @INC
3f30fabf
MB
1729 -DEBUGGING=none DEBUGGING options
1730 -Dcc=gcc choose your compiler
1731 -Dprefix=/opt/perl5 choose your destination
2304df62 1732 -E : stop at the end of questions, after having produced config.sh.
16d20bd9 1733 -K : do not use unless you know what you are doing.
ecfc5424 1734 -O : let -D and -U override definitions from loaded configuration file.
2304df62 1735 -S : perform variable substitutions on all .SH files (can mix with -f)
a0d0e21e
LW
1736 -U : undefine symbol:
1737 -U symbol symbol gets the value 'undef'
1738 -U symbol= symbol gets completely empty
3f30fabf 1739 e.g.: -Uversiononly
02e93a22 1740 -A : manipulate symbol after the platform specific hints have been applied:
2ac814f3
MB
1741 -A append:symbol=value append value to symbol
1742 -A symbol=value like append:, but with a separating space
1743 -A define:symbol=value define symbol to have value
1744 -A clear:symbol define symbol to be ''
1745 -A define:symbol define symbol to be 'define'
1746 -A eval:symbol=value define symbol to be eval of value
1747 -A prepend:symbol=value prepend value to symbol
1748 -A undef:symbol define symbol to be 'undef'
1749 -A undef:symbol= define symbol to be ''
3f30fabf 1750 e.g.: -A prepend:libswanted='cl pthread '
2ac814f3 1751 -A ccflags=-DSOME_MACRO
2304df62
AD
1752 -V : print version number and exit (with a zero status).
1753EOM
1754 exit 1
1755 ;;
1756esac
1757
dfe9444c
AD
1758: Sanity checks
1759case "$fastread$alldone" in
1760yescont|yesexit) ;;
1761*)
aaeb8e51
GS
1762 case "$extractsh" in
1763 true) ;;
1764 *)
1765 if test ! -t 0; then
1766 echo "Say 'sh Configure', not 'sh <Configure'"
1767 exit 1
1768 fi
1769 ;;
1770 esac
dfe9444c
AD
1771 ;;
1772esac
1773
2304df62
AD
1774exec 4>&1
1775case "$silent" in
1776true) exec 1>/dev/null;;
1777esac
1778
ecfc5424 1779: run the defines and the undefines, if any, but leave the file out there...
1aef975c
AD
1780touch optdef.sh
1781. ./optdef.sh
02e93a22
JH
1782: create the posthint manipulation script and leave the file out there...
1783touch posthint.sh
a0d0e21e 1784
2304df62 1785: set package name
34f1896b 1786package='perl5'
b4eb6b3d
JH
1787first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1788last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1789case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1790ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1791*) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1792esac
2304df62 1793
2304df62
AD
1794: Some greps do not return status, grrr.
1795echo "grimblepritz" >grimble
1796if grep blurfldyick grimble >/dev/null 2>&1 ; then
1797 contains=contains
1798elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1799 contains=grep
1800else
1801 contains=contains
1802fi
1803rm -f grimble
1804: the following should work in any shell
1805case "$contains" in
1806contains*)
1807 echo " "
1808 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1809 cat >contains <<'EOSS'
1810grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1811EOSS
1812chmod +x contains
1813esac
1814
dfe9444c
AD
1815: Find the path to the source tree
1816case "$src" in
1817'') case "$0" in
b233458b
JH
1818 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1819 case "$src" in
1820 /*) ;;
8504afb7 1821 .) ;;
b233458b
JH
1822 *) src=`cd ../$src && pwd` ;;
1823 esac
1824 ;;
dfe9444c
AD
1825 *) src='.';;
1826 esac;;
1827esac
1828case "$src" in
1829'') src=/
1830 rsrc=/
1831 ;;
34f1896b
MB
1832/*) rsrc="$src";;
1833*) rsrc="../$src";;
dfe9444c
AD
1834esac
1835if test -f $rsrc/Configure && \
34f1896b 1836 $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
dfe9444c
AD
1837then
1838 : found it, so we are ok.
1839else
1840 rsrc=''
1841 for src in . .. ../.. ../../.. ../../../..; do
1842 if test -f ../$src/Configure && \
1843 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1844 then
1845 rsrc=../$src
1846 break
1847 fi
1848 done
1849fi
1850case "$rsrc" in
1851'')
1852 cat <<EOM >&4
1853
1854Sorry, I can't seem to locate the source dir for $package. Please start
1855Configure with an explicit path -- i.e. /some/path/Configure.
1856
1857EOM
1858 exit 1
1859 ;;
1860../.) rsrc='..';;
1861*)
1862 echo " "
1863 echo "Sources for $package found in \"$src\"." >&4
1864 ;;
1865esac
1866
1867: script used to extract .SH files with variable substitutions
1868cat >extract <<'EOS'
a02608de 1869PERL_CONFIG_SH=true
dfe9444c 1870echo "Doing variable substitutions on .SH files..."
24ccb310
JH
1871if test -f MANIFEST; then
1872 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
dfe9444c
AD
1873else
1874 echo "(Looking for .SH files under the source directory.)"
6904989c 1875 set x `(cd "$src"; find . -name "*.SH" -print)`
dfe9444c
AD
1876fi
1877shift
1878case $# in
6904989c 18790) set x `(cd "$src"; echo *.SH)`; shift;;
dfe9444c 1880esac
6904989c 1881if test ! -f "$src/$1"; then
dfe9444c
AD
1882 shift
1883fi
1884mkdir_p='
1885name=$1;
1886create="";
1887while test $name; do
1888 if test ! -d "$name"; then
1889 create="$name $create";
1890 name=`echo $name | sed -e "s|^[^/]*$||"`;
1891 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1892 else
1893 name="";
1894 fi;
1895done;
1896for file in $create; do
1897 mkdir $file;
1898done
1899'
1900for file in $*; do
1901 case "$src" in
1902 ".")
1903 case "$file" in
1904 */*)
1905 dir=`expr X$file : 'X\(.*\)/'`
1906 file=`expr X$file : 'X.*/\(.*\)'`
6904989c 1907 (cd "$dir" && . ./$file)
dfe9444c
AD
1908 ;;
1909 *)
1910 . ./$file
1911 ;;
1912 esac
1913 ;;
1914 *)
1915 case "$file" in
1916 */*)
1917 dir=`expr X$file : 'X\(.*\)/'`
1918 file=`expr X$file : 'X.*/\(.*\)'`
1919 (set x $dir; shift; eval $mkdir_p)
6904989c 1920 sh <"$src/$dir/$file"
dfe9444c
AD
1921 ;;
1922 *)
6904989c 1923 sh <"$src/$file"
dfe9444c
AD
1924 ;;
1925 esac
1926 ;;
1927 esac
1928done
6904989c 1929if test -f "$src/config_h.SH"; then
dfe9444c
AD
1930 if test ! -f config.h; then
1931 : oops, they left it out of MANIFEST, probably, so do it anyway.
6904989c 1932 . "$src/config_h.SH"
dfe9444c
AD
1933 fi
1934fi
1935EOS
1936
1937: extract files and exit if asked to do so
1938case "$extractsh" in
1939true)
1940 case "$realsilent" in
1941 true) ;;
1942 *) exec 1>&4;;
1943 esac
1944 case "$config_sh" in
1945 '') config_sh='config.sh';;
1946 esac
1947 echo " "
1948 echo "Fetching answers from $config_sh..."
1949 cd ..
1950 . $config_sh
1951 test "$override" && . ./optdef.sh
1952 echo " "
1953 . UU/extract
1954 rm -rf UU
24ccb310 1955 echo "Extraction done."
dfe9444c
AD
1956 exit 0
1957 ;;
1958esac
1959
1960: Eunice requires " " instead of "", can you believe it
1961echo " "
1962: Here we go...
1963echo "Beginning of configuration questions for $package."
1964
1965trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1966
2304df62
AD
1967: first determine how to suppress newline on echo command
1968echo " "
1969echo "Checking echo to see how to suppress newlines..."
1970(echo "hi there\c" ; echo " ") >.echotmp
1971if $contains c .echotmp >/dev/null 2>&1 ; then
1972 echo "...using -n."
1973 n='-n'
1974 c=''
1975else
1976 cat <<'EOM'
1977...using \c
1978EOM
1979 n=''
1980 c='\c'
1981fi
1982echo $n "The star should be here-->$c"
1983echo '*'
1984rm -f .echotmp
1985
1986: Now test for existence of everything in MANIFEST
1987echo " "
6904989c 1988if test -f "$rsrc/MANIFEST"; then
2304df62 1989 echo "First let's make sure your kit is complete. Checking..." >&4
1d8eaf8c 1990 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
776a38e3 1991 (split -l 50 2>/dev/null || split -50)
2304df62 1992 rm -f missing
dfe9444c 1993 tmppwd=`pwd`
2304df62 1994 for filelist in x??; do
776a38e3
MB
1995 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
1996 >/dev/null 2>>"$tmppwd/missing")
2304df62
AD
1997 done
1998 if test -s missing; then
1999 cat missing >&4
2000 cat >&4 <<'EOM'
2001
2002THIS PACKAGE SEEMS TO BE INCOMPLETE.
2003
2004You have the option of continuing the configuration process, despite the
2005distinct possibility that your kit is damaged, by typing 'y'es. If you
2006do, don't blame me if something goes wrong. I advise you to type 'n'o
7f2de2d2 2007and contact the author (perlbug@perl.org).
2304df62
AD
2008
2009EOM
2010 echo $n "Continue? [n] $c" >&4
2011 read ans
2012 case "$ans" in
2013 y*)
2014 echo "Continuing..." >&4
2015 rm -f missing
2016 ;;
2017 *)
2018 echo "ABORTING..." >&4
2019 kill $$
2020 ;;
2021 esac
2022 else
dfe9444c 2023 echo "Looks good..."
2304df62
AD
2024 fi
2025else
2026 echo "There is no MANIFEST file. I hope your kit is complete !"
2027fi
2028rm -f missing x??
2029
5ff3f7a4 2030: Find the appropriate value for a newline for tr
613d6c3e 2031echo " "
5ff3f7a4
GS
2032if test -n "$DJGPP"; then
2033 trnl='\012'
2034fi
2035if test X"$trnl" = X; then
2036 case "`echo foo|tr '\n' x 2>/dev/null`" in
2037 foox) trnl='\n' ;;
2038 esac
2039fi
2040if test X"$trnl" = X; then
2041 case "`echo foo|tr '\012' x 2>/dev/null`" in
2042 foox) trnl='\012' ;;
2043 esac
2044fi
2045if test X"$trnl" = X; then
8be2c24c
JH
2046 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
2047 fooxy) trnl='\n\r' ;;
2048 esac
2049fi
2050if test X"$trnl" = X; then
5ff3f7a4
GS
2051 cat <<EOM >&2
2052
2053$me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
2054
2055EOM
2056 exit 1
2057fi
2058
2304df62
AD
2059: compute the number of columns on the terminal for proper question formatting
2060case "$COLUMNS" in
2061'') COLUMNS='80';;
2062esac
2063
2064: set up the echo used in my read
2065myecho="case \"\$xxxm\" in
2066'') echo $n \"\$rp $c\" >&4;;
2067*) case \"\$rp\" in
2068 '') echo $n \"[\$xxxm] $c\";;
2069 *)
2070 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
2071 echo \"\$rp\" >&4
2072 echo $n \"[\$xxxm] $c\" >&4
2073 else
2074 echo $n \"\$rp [\$xxxm] $c\" >&4
2075 fi
2076 ;;
2077 esac;;
2078esac"
2079
2080: now set up to do reads with possible shell escape and default assignment
2081cat <<EOSC >myread
28757baa 2082$startsh
2304df62
AD
2083xxxm=\$dflt
2084$myecho
2085ans='!'
2086case "\$fastread" in
2087yes) case "\$dflt" in
2088 '') ;;
2089 *) ans='';
2090 case "\$silent-\$rp" in
2091 true-) ;;
2092 *) echo " " >&4;;
2093 esac;;
2094 esac;;
2095*) case "\$silent" in
2096 true) case "\$rp" in
2097 '') ans='';;
2098 esac;;
2099 esac;;
2100esac
2101while expr "X\$ans" : "X!" >/dev/null; do
2102 read answ
2103 set x \$xxxm
2104 shift
dfe9444c 2105 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2304df62 2106 case "\$answ" in
dfe9444c
AD
2107 "!")
2108 sh 1>&4
2109 echo " "
2110 $myecho
2111 ;;
2112 !*)
2113 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2114 shift
2115 sh 1>&4 -c "\$*"
2116 echo " "
2117 $myecho
2118 ;;
2304df62
AD
2119 "\$ans")
2120 case "\$ans" in
ecfc5424
AD
2121 \\&*)
2122 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2123 shift
2124 case "\$1" in
2125 -d)
2126 fastread=yes
40a7a20a 2127 echo "(OK, I'll run with -d after this question.)" >&4
ecfc5424
AD
2128 ;;
2129 -*)
40a7a20a 2130 echo "*** Sorry, \$1 not supported yet." >&4
ecfc5424
AD
2131 ;;
2132 esac
2133 $myecho
2134 ans=!
2135 ;;
2304df62
AD
2136 esac;;
2137 *)
2138 case "\$aok" in
2139 y)
2140 echo "*** Substitution done -- please confirm."
2141 xxxm="\$ans"
c9795ab7 2142 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2304df62
AD
2143 xxxm="\$ans"
2144 ans=!
2145 ;;
2146 *)
2147 echo "*** Error -- try again."
2148 ans=!
2149 ;;
2150 esac
2151 $myecho
2152 ;;
2153 esac
2154 case "\$ans\$xxxm\$nostick" in
2155 '')
2156 ans=!
2157 $myecho
2158 ;;
2159 esac
2160done
2161case "\$ans" in
2162'') ans="\$xxxm";;
2163esac
2164EOSC
2165
2166: create .config dir to save info across Configure sessions
2167test -d ../.config || mkdir ../.config
2168cat >../.config/README <<EOF
2169This directory created by Configure to save information that should
dfe9444c 2170persist across sessions for $package.
2304df62
AD
2171
2172You may safely delete it if you wish.
2173EOF
2174
613d6c3e 2175: See if we are using a devel version and want that
9507cadf 2176xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
af960fef 2177case "$usedevel" in
1be1b388
MB
2178$define|true|[yY]*)
2179 usedevel="$define" ;;
9507cadf 2180*) case "$xversion" in
0107c034
JH
2181 *[13579])
2182 cat >&4 <<EOH
2183*** WHOA THERE!!! ***
2184
2185 This is an UNSTABLE DEVELOPMENT release.
9507cadf
JH
2186 The version of this $package distribution is $xversion, that is, odd,
2187 (as opposed to even) and that signifies a development release.
3d5d58b1 2188 If you want a maintenance release, you want an even-numbered version.
0107c034
JH
2189
2190 Do ***NOT*** install this into production use.
2191 Data corruption and crashes are possible.
2192
2193 It is most seriously suggested that you do not continue any further
2194 unless you want to help in developing and debugging Perl.
2195
6adc6a45
JH
2196 If you *still* want to build perl, you can answer 'y' now,
2197 or pass -Dusedevel to Configure.
2198
0107c034
JH
2199EOH
2200 rp='Do you really want to continue?'
2201 dflt='n'
2202 . ./myread
2203 case "$ans" in
8feeef0e
JH
2204 [yY]) echo >&4 "Okay, continuing."
2205 usedevel="$define" ;;
0107c034
JH
2206 *) echo >&4 "Okay, bye."
2207 exit 1
2208 ;;
2209 esac
2210 ;;
2211 esac
1be1b388 2212 usedevel="$undef"
0107c034
JH
2213 ;;
2214esac
8feeef0e
JH
2215case "$usedevel" in
2216$define|true|[yY]*)
2217 case "$versiononly" in
2218 '') versiononly="$define" ;;
2219 esac
2220 case "$installusrbinperl" in
2221 '') installusrbinperl="$undef" ;;
2222 esac
2223 ;;
2224esac
0107c034 2225
2304df62
AD
2226: general instructions
2227needman=true
2228firsttime=true
760ac839 2229user=`(logname) 2>/dev/null`
dfe9444c
AD
2230case "$user" in
2231'') user=`whoami 2>&1`;;
760ac839 2232esac
2304df62
AD
2233if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2234 firsttime=false
2235 echo " "
2236 rp='Would you like to see the instructions?'
2237 dflt=n
2238 . ./myread
2239 case "$ans" in
2240 [yY]*) ;;
2241 *) needman=false;;
2242 esac
2243fi
2244if $needman; then
2245 cat <<EOH
4e2a5f63 2246
2304df62 2247This installation shell script will examine your system and ask you questions
a0d0e21e 2248to determine how the perl5 package should be installed. If you get
2304df62
AD
2249stuck on a question, you may use a ! shell escape to start a subshell or
2250execute a command. Many of the questions will have default answers in square
2251brackets; typing carriage return will give you the default.
2252
2253On some of the questions which ask for file or directory names you are allowed
2254to use the ~name construct to specify the login directory belonging to "name",
2255even if you don't have a shell which knows about that. Questions where this is
2256allowed will be marked "(~name ok)".
2257
2258EOH
2259 rp=''
2260 dflt='Type carriage return to continue'
2261 . ./myread
2262 cat <<'EOH'
2263
2264The prompter used in this script allows you to use shell variables and
2265backticks in your answers. You may use $1, $2, etc... to refer to the words
2266in the default answer, as if the default line was a set of arguments given to a
2267script shell. This means you may also use $* to repeat the whole default line,
2268so you do not have to re-type everything to add something to the default.
2269
cd95ead5 2270Every time there is a substitution, you will have to confirm. If there is an
2304df62
AD
2271error (e.g. an unmatched backtick), the default answer will remain unchanged
2272and you will be prompted again.
2273
2274If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2275the questions and use the computed defaults (or the previous answers if there
2276was already a config.sh file). Type 'Configure -h' for a list of options.
ecfc5424 2277You may also start interactively and then answer '& -d' at any prompt to turn
dfe9444c 2278on the non-interactive behaviour for the remainder of the execution.
2304df62
AD
2279
2280EOH
2281 . ./myread
2282 cat <<EOH
2283
2284Much effort has been expended to ensure that this shell script will run on any
2285Unix system. If despite that it blows up on yours, your best bet is to edit
40000a8c
AD
2286Configure and run it again. If you can't run Configure for some reason,
2287you'll have to generate a config.sh file by hand. Whatever problems you
7f2de2d2 2288have, let me (perlbug@perl.org) know how I blew it.
2304df62
AD
2289
2290This installation script affects things in two ways:
2291
22921) it may do direct variable substitutions on some of the files included
2293 in this kit.
22942) it builds a config.h file for inclusion in C programs. You may edit
2295 any of these files as the need arises after running this script.
2296
2297If you make a mistake on a question, there is no easy way to back up to it
2298currently. The easiest thing to do is to edit config.sh and rerun all the SH
2299files. Configure will offer to let you do this before it runs the SH files.
2300
2301EOH
2302 dflt='Type carriage return to continue'
2303 . ./myread
2304 case "$firsttime" in
2305 true) echo $user >>../.config/instruct;;
2306 esac
2307fi
2308
2304df62
AD
2309: find out where common programs are
2310echo " "
2311echo "Locating common programs..." >&4
2312cat <<EOSC >loc
2313$startsh
2314case \$# in
23150) exit 1;;
2316esac
2317thing=\$1
2318shift
2319dflt=\$1
2320shift
2321for dir in \$*; do
2322 case "\$thing" in
2323 .)
2324 if test -d \$dir/\$thing; then
2325 echo \$dir
2326 exit 0
2327 fi
2328 ;;
2329 *)
a0d0e21e 2330 for thisthing in \$dir/\$thing; do
ecfc5424 2331 : just loop through to pick last item
a0d0e21e 2332 done
25f94b33 2333 if test -f \$thisthing; then
a0d0e21e 2334 echo \$thisthing
2304df62 2335 exit 0
a5a94ea5
JH
2336 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2337 echo \$thisthing
776a38e3 2338 exit 0
2304df62 2339 elif test -f \$dir/\$thing.exe; then
c4f23d77
AD
2340 if test -n "$DJGPP"; then
2341 echo \$dir/\$thing.exe
b921d661 2342 elif test "$eunicefix" != ":"; then
c4f23d77
AD
2343 : on Eunice apparently
2344 echo \$dir/\$thing
2345 fi
2d736872 2346 exit 0
2304df62
AD
2347 fi
2348 ;;
2349 esac
2350done
2351echo \$dflt
2352exit 1
2353EOSC
2354chmod +x loc
2355$eunicefix loc
2356loclist="
2357awk
2358cat
f8006fac 2359chmod
b4eb6b3d
JH
2360comm
2361cp
2304df62
AD
2362echo
2363expr
2364grep
a0d0e21e 2365ls
b4eb6b3d 2366mkdir
2304df62
AD
2367rm
2368sed
b4eb6b3d 2369sort
85e6fe83 2370touch
2304df62 2371tr
b4eb6b3d 2372uniq
2304df62
AD
2373"
2374trylist="
dfe9444c 2375ar
3659ebf1 2376bison
b4eb6b3d 2377byacc
2304df62 2378cpp
b4eb6b3d 2379csh
2304df62
AD
2380date
2381egrep
1fef16b3 2382gmake
8ff267be 2383gzip
b4eb6b3d 2384less
8ff267be 2385ln
3c728e00 2386make
b4eb6b3d 2387more
693762b4 2388nm
b4eb6b3d 2389nroff
b8677e3b 2390perl
b4eb6b3d 2391pg
2304df62
AD
2392test
2393uname
8ff267be 2394zip
2304df62 2395"
8e07c86e 2396pth=`echo $PATH | sed -e "s/$p_/ /g"`
2304df62
AD
2397pth="$pth /lib /usr/lib"
2398for file in $loclist; do
dfe9444c
AD
2399 eval xxx=\$$file
2400 case "$xxx" in
2401 /*|?:[\\/]*)
2402 if test -f "$xxx"; then
2403 : ok
2404 else
2405 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2406 xxx=`./loc $file $file $pth`
2407 fi
2408 ;;
2409 '') xxx=`./loc $file $file $pth`;;
2410 *) xxx=`./loc $xxx $xxx $pth`;;
2411 esac
a5a94ea5 2412 eval $file=$xxx$_exe
2304df62
AD
2413 eval _$file=$xxx
2414 case "$xxx" in
2415 /*)
2416 echo $file is in $xxx.
2417 ;;
8e07c86e
AD
2418 ?:[\\/]*)
2419 echo $file is in $xxx.
2420 ;;
2304df62 2421 *)
25f94b33
AD
2422 echo "I don't know where '$file' is, and my life depends on it." >&4
2423 echo "Go find a public domain implementation or fix your PATH setting!" >&4
4633a7c4 2424 exit 1
2304df62
AD
2425 ;;
2426 esac
2427done
2428echo " "
2429echo "Don't worry if any of the following aren't found..."
2430say=offhand
2431for file in $trylist; do
dfe9444c
AD
2432 eval xxx=\$$file
2433 case "$xxx" in
2434 /*|?:[\\/]*)
2435 if test -f "$xxx"; then
2436 : ok
2437 else
2438 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2439 xxx=`./loc $file $file $pth`
2440 fi
2441 ;;
2442 '') xxx=`./loc $file $file $pth`;;
2443 *) xxx=`./loc $xxx $xxx $pth`;;
2444 esac
306a8474 2445 eval $file=$xxx$_exe
2304df62
AD
2446 eval _$file=$xxx
2447 case "$xxx" in
2448 /*)
2449 echo $file is in $xxx.
2450 ;;
8e07c86e
AD
2451 ?:[\\/]*)
2452 echo $file is in $xxx.
2453 ;;
2304df62
AD
2454 *)
2455 echo "I don't see $file out there, $say."
2456 say=either
2457 ;;
2458 esac
2459done
2460case "$egrep" in
1fef16b3 2461egrep)
2304df62
AD
2462 echo "Substituting grep for egrep."
2463 egrep=$grep
868439a2 2464 _egrep=$grep
2304df62
AD
2465 ;;
2466esac
3141af47
MB
2467case "$less" in
2468'') ;;
2469*) if $less -R </dev/null >/dev/null; then
2470 echo "Substituting less -R for less."
2471 less="$less -R"
2472 _less=$less
2473 fi
2474 ;;
2475esac
8ff267be 2476case "$ln" in
1fef16b3 2477ln)
8ff267be
PP
2478 echo "Substituting cp for ln."
2479 ln=$cp
868439a2 2480 _ln=$cp
8ff267be
PP
2481 ;;
2482esac
2e26f1d5 2483case "$make" in
613d6c3e 2484make)
2e26f1d5
JH
2485 case "$gmake" in
2486 gmake)
2487 echo "I can't find make or gmake, and my life depends on it." >&4
2488 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2489 exit 1
2490 ;;
2491 esac
2492 ;;
613d6c3e 2493esac
2e26f1d5
JH
2494case "$gmake" in
2495gmake) ;;
2496*) # We can't have osname yet.
1fef16b3
JH
2497 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2498 # Assume that gmake, if found, is definitely GNU make
2499 # and prefer it over the system make.
2500 echo "Substituting gmake for make."
2501 make=$gmake
868439a2 2502 _make=$gmake
1fef16b3
JH
2503 fi
2504 ;;
a5a94ea5 2505esac
2304df62
AD
2506case "$test" in
2507test)
2508 echo "Hopefully test is built into your sh."
2509 ;;
2510*)
73614538 2511 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
5d644a95 2512 echo "Using the test built into your sh."
2304df62
AD
2513 test=test
2514 _test=test
2515 fi
2516 ;;
2517esac
2518case "$echo" in
2519echo)
2520 echo "Hopefully echo is built into your sh."
2521 ;;
2522'') ;;
2523*)
2524 echo " "
2525echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2526 $echo $n "hi there$c" >foo1
2527 echo $n "hi there$c" >foo2
2528 if cmp foo1 foo2 >/dev/null 2>&1; then
2529 echo "They are compatible. In fact, they may be identical."
2530 else
2531 case "$n" in
2532 '-n') n='' c='\c';;
2533 *) n='-n' c='';;
2534 esac
2535 cat <<FOO
2536They are not compatible! You are probably running ksh on a non-USG system.
2537I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2538have echo built in and we may have to run some Bourne shell scripts. That
2539means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2540
2541FOO
2542 $echo $n "The star should be here-->$c"
2543 $echo "*"
2544 fi
2545 $rm -f foo1 foo2
2546 ;;
2547esac
2548
2f88d857
MB
2549# This question was auctioned at YAPC::Europe-2007 in Vienna
2550# I never promised you could answer it. I only auctioned the question.
2551cat <<FOO
2552The following message is sponsored by
2553
2554 Dresden.pm<--The stars should be here.
2555
2556Dear Perl user, system administrator or package
2557maintainer, the Perl community sends greetings to
2558you. Do you (emblematical) greet back [Y/n]? n
2559
2560FOO
2561
613d6c3e 2562: Check what type of C compiler we use
6b769f8f 2563cat <<EOS >trygcc
2573c5f9
JH
2564$startsh
2565EOS
6b769f8f 2566cat <<'EOSC' >>trygcc
2573c5f9
JH
2567case "$cc" in
2568'') ;;
2569*) $rm -f try try.*
2570 $cat >try.c <<EOM
2571int main(int argc, char *argv[]) {
2572 return 0;
2573}
2574EOM
e4778687 2575 if $cc -o try $ccflags $ldflags try.c; then
2573c5f9
JH
2576 :
2577 else
2578 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2579 despair=yes
2580 trygcc=yes
2581 case "$cc" in
2582 *gcc*) trygcc=no ;;
2583 esac
dce40316
AD
2584 # Skip this test because it gives a false match on output like:
2585 # ./trygcc: line 23: cc: command not found
2586 # case "`$cc -v -c try.c 2>&1`" in
2587 # *gcc*) trygcc=no ;;
2588 # esac
2573c5f9
JH
2589 if $test X"$trygcc" = Xyes; then
2590 if gcc -o try -c try.c; then
2591 echo " "
2592 echo "You seem to have a working gcc, though." >&4
dce40316
AD
2593 # Switching compilers may undo the work of hints files.
2594 # The most common problem is -D_REENTRANT for threads.
2595 # This heuristic catches that case, but gets false positives
2596 # if -Dusethreads was not actually specified. Better to
2597 # bail out here with a useful message than fail
2598 # mysteriously later. Should we perhaps just try to
2599 # re-invoke Configure -Dcc=gcc config_args ?
2600 if $test -f usethreads.cbu; then
2601 $cat >&4 <<EOM
2602
2603*** However, any setting of the C compiler flags (e.g. for thread support)
2604*** will be lost. It may be necessary for you to restart Configure and
2605*** add -Dcc=gcc to your Configure command line.
2606
2607EOM
2608 rp="Would you like to go ahead and try gcc anyway?"
2609 dflt=n
2610 else
2611 rp="Would you like to use it?"
2612 dflt=y
2613 fi
2573c5f9
JH
2614 if $test -f myread; then
2615 . ./myread
2616 else
2617 if $test -f UU/myread; then
2618 . ./UU/myread
2619 else
2620 echo "Cannot find myread, sorry. Aborting." >&2
2621 exit 1
2622 fi
2623 fi
2624 case "$ans" in
6371411c 2625 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2573c5f9
JH
2626 esac
2627 fi
2628 fi
6b769f8f
RB
2629 fi
2630 $rm -f try try.*
2631 ;;
2632esac
2633EOSC
2634
2635cat <<EOS >checkcc
2636$startsh
2637EOS
2638cat <<'EOSC' >>checkcc
2639case "$cc" in
2640'') ;;
2641*) $rm -f try try.*
2642 $cat >try.c <<EOM
2643int main(int argc, char *argv[]) {
2644 return 0;
2645}
2646EOM
2647 if $cc -o try $ccflags $ldflags try.c; then
2648 :
2649 else
2573c5f9 2650 if $test X"$despair" = Xyes; then
6b769f8f
RB
2651 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2652 fi
2653 $cat >&4 <<EOM
5dd4fbdf
MB
2654You need to find a working C compiler.
2655Either (purchase and) install the C compiler supplied by your OS vendor,
2656or for a free C compiler try http://gcc.gnu.org/
2657I cannot continue any further, aborting.
2658EOM
6b769f8f 2659 exit 1
2573c5f9
JH
2660 fi
2661 $rm -f try try.*
2662 ;;
2663esac
2664EOSC
2665
a0d0e21e
LW
2666: determine whether symbolic links are supported
2667echo " "
2668$touch blurfl
2669if $ln -s blurfl sym > /dev/null 2>&1 ; then
2670 echo "Symbolic links are supported." >&4
818f00be 2671 lns="$ln -s"
a0d0e21e
LW
2672else
2673 echo "Symbolic links are NOT supported." >&4
2674 lns="$ln"
2675fi
2676$rm -f blurfl sym
2677
dafca956
JH
2678: determine whether symbolic links are supported
2679echo " "
2680case "$lns" in
18ea2752 2681*"ln"*" -s")
dafca956
JH
2682 echo "Checking how to test for symbolic links..." >&4
2683 $lns blurfl sym
4b661809 2684 if $test "X$issymlink" = X; then
2e2a97a6
JH
2685 case "$newsh" in
2686 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2687 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2688 esac
5d644a95
MB
2689 if test $? = 0; then
2690 issymlink="test -h"
2e2a97a6
JH
2691 else
2692 echo "Your builtin 'test -h' may be broken." >&4
2693 case "$test" in
2694 /*) ;;
2695 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2696 for p in $pth
2697 do
2698 if test -f "$p/$test"; then
2699 test="$p/$test"
2700 break
2701 fi
2702 done
2703 ;;
2704 esac
2705 case "$test" in
2706 /*)
2707 echo "Trying external '$test -h'." >&4
2708 issymlink="$test -h"
2709 if $test ! -h sym >/dev/null 2>&1; then
3c728e00 2710 echo "External '$test -h' is broken, too." >&4
2e2a97a6
JH
2711 issymlink=''
2712 fi
2713 ;;
2714 *) issymlink='' ;;
2715 esac
5d644a95
MB
2716 fi
2717 fi
4b661809 2718 if $test "X$issymlink" = X; then
dafca956 2719 if $test -L sym 2>/dev/null; then
5d644a95 2720 issymlink="$test -L"
2e2a97a6 2721 echo "The builtin '$test -L' worked." >&4
dafca956
JH
2722 fi
2723 fi
4b661809 2724 if $test "X$issymlink" != X; then
5d644a95 2725 echo "You can test for symbolic links with '$issymlink'." >&4
dafca956
JH
2726 else
2727 echo "I do not know how you can test for symbolic links." >&4
2728 fi
2729 $rm -f blurfl sym
2730 ;;
2731*) echo "No symbolic links, so not testing for their testing..." >&4
2732 ;;
2733esac
2734echo " "
2735
34f1896b 2736: Make symlinks util
dafca956
JH
2737case "$mksymlinks" in
2738$define|true|[yY]*)
2739 case "$src" in
2740 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2741 exit 1
2742 ;;
4b661809 2743 *) case "$lns:$issymlink" in
f314eb9f 2744 *"ln"*" -s:"*"test -"?)
dafca956
JH
2745 echo "Creating the symbolic links..." >&4
2746 echo "(First creating the subdirectories...)" >&4
2747 cd ..
2748 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2749 read directory
2750 test -z "$directory" && break
2751 mkdir -p $directory
2752 done
2753 # Sanity check 1.
2754 if test ! -d t/base; then
2755 echo "Failed to create the subdirectories. Aborting." >&4
2756 exit 1
2757 fi
2758 echo "(Then creating the symlinks...)" >&4
2759 awk '{print $1}' $src/MANIFEST | while true; do
2760 read filename
2761 test -z "$filename" && break
2762 if test -f $filename; then
5d644a95 2763 if $issymlink $filename; then
dafca956
JH
2764 rm -f $filename
2765 fi
2766 fi
2767 if test -f $filename; then
2768 echo "$filename already exists, not symlinking."
2769 else
2770 ln -s $src/$filename $filename
2771 fi
2772 done
2773 # Sanity check 2.
a0d24b8a
JH
2774 if test ! -f t/base/lex.t; then
2775 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
dafca956
JH
2776 exit 1
2777 fi
2778 cd UU
2779 ;;
2780 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2781 ;;
2782 esac
2783 ;;
2784 esac
2785 ;;
2786esac
2787
613d6c3e 2788: Check for Cross-Compilation
5440bc8e
JH
2789case "$usecrosscompile" in
2790$define|true|[yY]*)
93bc48fa 2791 $echo "Cross-compiling..."
5440bc8e
JH
2792 croak=''
2793 case "$cc" in
2794 *-*-gcc) # A cross-compiling gcc, probably.
93bc48fa 2795 targetarch=`$echo $cc|$sed 's/-gcc$//'`
5440bc8e
JH
2796 ar=$targetarch-ar
2797 # leave out ld, choosing it is more complex
2798 nm=$targetarch-nm
2799 ranlib=$targetarch-ranlib
93bc48fa 2800 $echo 'extern int foo;' > try.c
f8006fac 2801 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
93bc48fa
JH
2802 shift
2803 if $test $# -gt 0; then
2804 incpth="$incpth $*"
f8006fac
JH
2805 incpth="`$echo $incpth|$sed 's/^ //'`"
2806 echo "Guessing incpth '$incpth'." >&4
93bc48fa 2807 for i in $*; do
f8006fac 2808 j="`$echo $i|$sed 's,/include$,/lib,'`"
93bc48fa
JH
2809 if $test -d $j; then
2810 libpth="$libpth $j"
2811 fi
2812 done
f8006fac
JH
2813 libpth="`$echo $libpth|$sed 's/^ //'`"
2814 echo "Guessing libpth '$libpth'." >&4
93bc48fa
JH
2815 fi
2816 $rm -f try.c
5440bc8e
JH
2817 ;;
2818 esac
2819 case "$targetarch" in
93bc48fa
JH
2820 '') echo "Targetarch not defined." >&4; croak=y ;;
2821 *) echo "Using targetarch $targetarch." >&4 ;;
5440bc8e
JH
2822 esac
2823 case "$incpth" in
93bc48fa 2824 '') echo "Incpth not defined." >&4; croak=y ;;
f8006fac 2825 *) echo "Using incpth '$incpth'." >&4 ;;
5440bc8e
JH
2826 esac
2827 case "$libpth" in
93bc48fa 2828 '') echo "Libpth not defined." >&4; croak=y ;;
f8006fac 2829 *) echo "Using libpth '$libpth'." >&4 ;;
5440bc8e 2830 esac
93bc48fa
JH
2831 case "$usrinc" in
2832 '') for i in $incpth; do
2833 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2834 usrinc=$i
2835 echo "Guessing usrinc $usrinc." >&4
2836 break
2837 fi
2838 done
2839 case "$usrinc" in
2840 '') echo "Usrinc not defined." >&4; croak=y ;;
2841 esac
2842 ;;
2843 *) echo "Using usrinc $usrinc." >&4 ;;
5440bc8e 2844 esac
93bc48fa
JH
2845 case "$targethost" in
2846 '') echo "Targethost not defined." >&4; croak=y ;;
2847 *) echo "Using targethost $targethost." >&4
5440bc8e 2848 esac
93bc48fa
JH
2849 locincpth=' '
2850 loclibpth=' '
5440bc8e 2851 case "$croak" in
93bc48fa 2852 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
5440bc8e
JH
2853 esac
2854 case "$src" in
2855 /*) run=$src/Cross/run
93c0359c 2856 targetmkdir=$src/Cross/mkdir
5440bc8e
JH
2857 to=$src/Cross/to
2858 from=$src/Cross/from
2859 ;;
93bc48fa 2860 *) pwd=`$test -f ../Configure & cd ..; pwd`
5440bc8e 2861 run=$pwd/Cross/run
f8006fac 2862 targetmkdir=$pwd/Cross/mkdir
5440bc8e
JH
2863 to=$pwd/Cross/to
2864 from=$pwd/Cross/from
2865 ;;
2866 esac
2867 case "$targetrun" in
2868 '') targetrun=ssh ;;
2869 esac
2870 case "$targetto" in
2871 '') targetto=scp ;;
2872 esac
2873 case "$targetfrom" in
2874 '') targetfrom=scp ;;
2875 esac
2876 run=$run-$targetrun
2877 to=$to-$targetto
2878 from=$from-$targetfrom
93bc48fa
JH
2879 case "$targetdir" in
2880 '') targetdir=/tmp
2881 echo "Guessing targetdir $targetdir." >&4
2882 ;;
2883 esac
5440bc8e 2884 case "$targetuser" in
93bc48fa
JH
2885 '') targetuser=root
2886 echo "Guessing targetuser $targetuser." >&4
2887 ;;
5440bc8e
JH
2888 esac
2889 case "$targetfrom" in
2890 scp) q=-q ;;
2891 *) q='' ;;
2892 esac
2893 case "$targetrun" in
2894 ssh|rsh)
2895 cat >$run <<EOF
2896#!/bin/sh
93c0359c
JH
2897case "\$1" in
2898-cwd)
2899 shift
2900 cwd=\$1
2901 shift
2902 ;;
2903esac
2904case "\$cwd" in
2905'') cwd=$targetdir ;;
2906esac
5440bc8e
JH
2907exe=\$1
2908shift
93c0359c
JH
2909if $test ! -f \$exe.xok; then
2910 $to \$exe
2911 $touch \$exe.xok
2912fi
2913$targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
5440bc8e
JH
2914EOF
2915 ;;
93bc48fa 2916 *) echo "Unknown targetrun '$targetrun'" >&4
5440bc8e
JH
2917 exit 1
2918 ;;
2919 esac
93c0359c
JH
2920 case "$targetmkdir" in
2921 */Cross/mkdir)
2922 cat >$targetmkdir <<EOF
2923#!/bin/sh
2924$targetrun -l $targetuser $targethost "mkdir -p \$@"
2925EOF
f8006fac 2926 $chmod a+rx $targetmkdir
93c0359c
JH
2927 ;;
2928 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2929 exit 1
2930 ;;
2931 esac
5440bc8e
JH
2932 case "$targetto" in
2933 scp|rcp)
2934 cat >$to <<EOF
2935#!/bin/sh
2936for f in \$@
2937do
93c0359c
JH
2938 case "\$f" in
2939 /*)
2940 $targetmkdir \`dirname \$f\`
2941 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2942 ;;
2943 *)
2944 $targetmkdir $targetdir/\`dirname \$f\`
2945 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2946 ;;
2947 esac
5440bc8e
JH
2948done
2949exit 0
2950EOF
2951 ;;
2952 cp) cat >$to <<EOF
2953#!/bin/sh
93c0359c
JH
2954for f in \$@
2955do
2956 case "\$f" in
2957 /*)
2958 $mkdir -p $targetdir/\`dirname \$f\`
2959 $cp \$f $targetdir/\$f || exit 1
2960 ;;
2961 *)
2962 $targetmkdir $targetdir/\`dirname \$f\`
2963 $cp \$f $targetdir/\$f || exit 1
2964 ;;
2965 esac
2966done
2967exit 0
5440bc8e
JH
2968EOF
2969 ;;
93bc48fa 2970 *) echo "Unknown targetto '$targetto'" >&4
5440bc8e
JH
2971 exit 1
2972 ;;
2973 esac
2974 case "$targetfrom" in
2975 scp|rcp)
2976 cat >$from <<EOF
2977#!/bin/sh
2978for f in \$@
2979do
93c0359c 2980 $rm -f \$f
5440bc8e
JH
2981 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2982done
2983exit 0
2984EOF
2985 ;;
2986 cp) cat >$from <<EOF
2987#!/bin/sh
2988for f in \$@
2989do
93c0359c 2990 $rm -f \$f
5440bc8e
JH
2991 cp $targetdir/\$f . || exit 1
2992done
2993exit 0
2994EOF
2995 ;;
93bc48fa 2996 *) echo "Unknown targetfrom '$targetfrom'" >&4
5440bc8e
JH
2997 exit 1
2998 ;;
2999 esac
93bc48fa
JH
3000 if $test ! -f $run; then
3001 echo "Target 'run' script '$run' not found." >&4
5440bc8e 3002 else
f8006fac 3003 $chmod a+rx $run
5440bc8e 3004 fi
93bc48fa
JH
3005 if $test ! -f $to; then
3006 echo "Target 'to' script '$to' not found." >&4
5440bc8e 3007 else
f8006fac 3008 $chmod a+rx $to
5440bc8e 3009 fi
93bc48fa
JH
3010 if $test ! -f $from; then
3011 echo "Target 'from' script '$from' not found." >&4
5440bc8e 3012 else
f8006fac 3013 $chmod a+rx $from
5440bc8e 3014 fi
93bc48fa 3015 if $test ! -f $run -o ! -f $to -o ! -f $from; then
5440bc8e
JH
3016 exit 1
3017 fi
3018 cat >&4 <<EOF
f8006fac
JH
3019Using '$run' for remote execution,
3020and '$from' and '$to'
93bc48fa 3021for remote file transfer.
5440bc8e
JH
3022EOF
3023 ;;
3024*) run=''
3025 to=:
3026 from=:
3027 usecrosscompile='undef'
3028 targetarch=''
3029 ;;
3030esac
3031
ecfc5424
AD
3032: see whether [:lower:] and [:upper:] are supported character classes
3033echo " "
ecfc5424
AD
3034case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
3035ABYZ)
3036 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
3037 up='[:upper:]'
3038 low='[:lower:]'
3039 ;;
416d0bea
MB
3040*) # There is a discontinuity in EBCDIC between 'R' and 'S'
3041 # (0xd9 and 0xe2), therefore that is a nice testing point.
3042 if test "X$up" = X -o "X$low" = X; then
3043 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
3044 rs) up='[A-Z]'
3045 low='[a-z]'
28e8609d
JH
3046 ;;
3047 esac
416d0bea 3048 fi
28e8609d 3049 if test "X$up" = X -o "X$low" = X; then
416d0bea
MB
3050 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
3051 rs) up='A-Z'
28e8609d
JH
3052 low='a-z'
3053 ;;
3054 esac
416d0bea 3055 fi
28e8609d 3056 if test "X$up" = X -o "X$low" = X; then
416d0bea
MB
3057 case "`echo RS | od -x 2>/dev/null`" in
3058 *D9E2*|*d9e2*)
28e8609d
JH
3059 echo "Hey, this might be EBCDIC." >&4
3060 if test "X$up" = X -o "X$low" = X; then
416d0bea
MB
3061 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
3062 rs) up='[A-IJ-RS-Z]'
3063 low='[a-ij-rs-z]'
28e8609d
JH
3064 ;;
3065 esac
3066 fi
3067 if test "X$up" = X -o "X$low" = X; then
416d0bea
MB
3068 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
3069 rs) up='A-IJ-RS-Z'
3070 low='a-ij-rs-z'
28e8609d
JH
3071 ;;
3072 esac
3073 fi
3074 ;;
3075 esac
3076 fi
3077esac
416d0bea
MB
3078case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
3079rs)
28e8609d
JH
3080 echo "Using $up and $low to convert case." >&4
3081 ;;
ecfc5424 3082*)
28e8609d
JH
3083 echo "I don't know how to translate letters from upper to lower case." >&4
3084 echo "Your tr is not acting any way I know of." >&4
3085 exit 1
3086 ;;
ecfc5424
AD
3087esac
3088: set up the translation script tr, must be called with ./tr of course
3089cat >tr <<EOSC
3090$startsh
3091case "\$1\$2" in
3092'[A-Z][a-z]') exec $tr '$up' '$low';;
3093'[a-z][A-Z]') exec $tr '$low' '$up';;
3094esac
3095exec $tr "\$@"
3096EOSC
3097chmod +x tr
3098$eunicefix tr
3099
2304df62
AD
3100: Try to determine whether config.sh was made on this system
3101case "$config_sh" in
3102'')
43999f95
JH
3103myuname=`$uname -a 2>/dev/null`
3104$test -z "$myuname" && myuname=`hostname 2>/dev/null`
f4dc174a
AD
3105# Downcase everything to avoid ambiguity.
3106# Remove slashes and single quotes so we can use parts of this in
3107# directory and file names.
3108# Remove newlines so myuname is sane to use elsewhere.
28e8609d
JH
3109# tr '[A-Z]' '[a-z]' would not work in EBCDIC
3110# because the A-Z/a-z are not consecutive.
f4dc174a 3111myuname=`echo $myuname | $sed -e "s,['/],,g" | \
3eaeeeae 3112 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
1aef975c 3113newmyuname="$myuname"
2304df62 3114dflt=n
16d20bd9
AD
3115case "$knowitall" in
3116'')
3117 if test -f ../config.sh; then
3118 if $contains myuname= ../config.sh >/dev/null 2>&1; then
3119 eval "`grep myuname= ../config.sh`"
3120 fi
3121 if test "X$myuname" = "X$newmyuname"; then
3122 dflt=y
3123 fi
2304df62 3124 fi
16d20bd9
AD
3125 ;;
3126*) dflt=y;;
3127esac
2304df62
AD
3128
3129: Get old answers from old config file if Configure was run on the
3130: same system, otherwise use the hints.
3131hint=default
3132cd ..
3133if test -f config.sh; then
16d20bd9
AD
3134 echo " "
3135 rp="I see a config.sh file. Shall I use it to set the defaults?"
2304df62
AD
3136 . UU/myread
3137 case "$ans" in
f83701cd
AD
3138 n*|N*) echo "OK, I'll ignore it."
3139 mv config.sh config.sh.old
3140 myuname="$newmyuname"
3141 ;;
2304df62 3142 *) echo "Fetching default answers from your old config.sh file..." >&4
ecfc5424
AD
3143 tmp_n="$n"
3144 tmp_c="$c"
85cad39c 3145 tmp_sh="$sh"
2304df62
AD
3146 . ./config.sh
3147 cp config.sh UU
ecfc5424
AD
3148 n="$tmp_n"
3149 c="$tmp_c"
85cad39c
PP
3150 : Older versions did not always set $sh. Catch re-use of such
3151 : an old config.sh.
3152 case "$sh" in
3153 '') sh="$tmp_sh" ;;
3154 esac
2304df62
AD
3155 hint=previous
3156 ;;
3157 esac
3158fi
2573c5f9 3159. ./UU/checkcc
2304df62
AD
3160if test ! -f config.sh; then
3161 $cat <<EOM
3162
4e2a5f63
AD
3163First time through, eh? I have some defaults handy for some systems
3164that need some extra help getting the Configure answers right:
2304df62
AD
3165
3166EOM
dfe9444c 3167 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2304df62
AD
3168 dflt=''
3169 : Half the following guesses are probably wrong... If you have better
7f2de2d2 3170 : tests or hints, please send them to perlbug@perl.org
2304df62 3171 : The metaconfig authors would also appreciate a copy...
a0d0e21e 3172 $test -f /irix && osname=irix
85e6fe83
LW
3173 $test -f /xenix && osname=sco_xenix
3174 $test -f /dynix && osname=dynix
3175 $test -f /dnix && osname=dnix
5f05dabc
PP
3176 $test -f /lynx.os && osname=lynxos
3177 $test -f /unicos && osname=unicos && osvers=`$uname -r`
c71a9cee 3178 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
7a4c00b4 3179 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
85e6fe83 3180 $test -f /bin/mips && /bin/mips && osname=mips
ecfc5424
AD
3181 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3182 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
a0d0e21e
LW
3183 $test -d /usr/apollo/bin && osname=apollo
3184 $test -f /etc/saf/_sactab && osname=svr4
85e6fe83 3185 $test -d /usr/include/minix && osname=minix
d54344fc 3186 $test -f /system/gnu_library/bin/ar.pm && osname=vos
e060872b 3187 if $test -d /MachTen -o -d /MachTen_Folder; then
dfe9444c 3188 osname=machten
4633a7c4 3189 if $test -x /sbin/version; then
dfe9444c 3190 osvers=`/sbin/version | $awk '{print $2}' |
4633a7c4
LW
3191 $sed -e 's/[A-Za-z]$//'`
3192 elif $test -x /usr/etc/version; then
dfe9444c 3193 osvers=`/usr/etc/version | $awk '{print $2}' |
4633a7c4
LW
3194 $sed -e 's/[A-Za-z]$//'`
3195 else
3196 osvers="$2.$3"
3197 fi
3198 fi
aaacdc8b
GS
3199
3200 $test -f /sys/posix.dll &&
3201 $test -f /usr/bin/what &&
3202 set X `/usr/bin/what /sys/posix.dll` &&
3203 $test "$3" = UWIN &&
3204 osname=uwin &&
3205 osvers="$5"
3206
2304df62
AD
3207 if $test -f $uname; then
3208 set X $myuname
3209 shift
3210
2304df62 3211 case "$5" in
85e6fe83 3212 fps*) osname=fps ;;
2304df62
AD
3213 mips*)
3214 case "$4" in
85e6fe83
LW
3215 umips) osname=umips ;;
3216 *) osname=mips ;;
2304df62 3217 esac;;
85e6fe83
LW
3218 [23]100) osname=mips ;;
3219 next*) osname=next ;;
ecfc5424 3220 i386*)
c6912327
JH
3221 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3222 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
619ffc2b
JH
3223 osname='sco'
3224 osvers=$tmp
3225 elif $test -f /etc/kconfig; then
ecfc5424 3226 osname=isc
bd628c73 3227 if test "$lns" = "$ln -s"; then
a0d0e21e
LW
3228 osvers=4
3229 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3230 osvers=3
2304df62 3231 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
a0d0e21e 3232 osvers=2
ecfc5424
AD
3233 fi
3234 fi
2000072c 3235 tmp=''
ecfc5424 3236 ;;
c4f23d77
AD
3237 pc*)
3238 if test -n "$DJGPP"; then
3239 osname=dos
3240 osvers=djgpp
3241 fi
3242 ;;
2304df62
AD
3243 esac
3244
3245 case "$1" in
a0d0e21e
LW
3246 aix) osname=aix
3247 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3248 case "$tmp" in
e81c5c2a
NC
3249 # oslevel can fail with:
3250 # oslevel: Unable to acquire lock.
3251 *not\ found) osvers="$4"."$3" ;;
a0d0e21e
LW
3252 '<3240'|'<>3240') osvers=3.2.0 ;;
3253 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3254 '=3250'|'>3250') osvers=3.2.5 ;;
1aef975c 3255 *) osvers=$tmp;;
a0d0e21e
LW
3256 esac
3257 ;;
aaacdc8b
GS
3258 bsd386) osname=bsd386
3259 osvers=`$uname -r`
3260 ;;
3261 cygwin*) osname=cygwin
3262 osvers="$3"
3263 ;;
23f87696
SZ
3264 *dc.osx) osname=dcosx
3265 osvers="$3"
3266 ;;
a0d0e21e
LW
3267 dnix) osname=dnix
3268 osvers="$3"
3269 ;;
3270 domainos) osname=apollo
3271 osvers="$3"
3272 ;;
a774dfe6
RSG
3273 dgux) osname=dgux
3274 osvers="$3"
3275 ;;
3276 dragonfly) osname=dragonfly
a0d0e21e
LW
3277 osvers="$3"
3278 ;;
760ac839 3279 dynixptx*) osname=dynixptx
e58e581d 3280 osvers=`echo "$4"|sed 's/^v//'`
760ac839 3281 ;;
a774dfe6 3282 freebsd) osname=freebsd
a0d0e21e 3283 osvers="$3" ;;
761ee4e8
BD
3284 genix) osname=genix ;;
3285 gnu) osname=gnu
3286 osvers="$3" ;;
a774dfe6 3287 hp*) osname=hpux
bfb7748a 3288 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
a0d0e21e 3289 ;;
761ee4e8 3290 irix*) osname=irix
a0d0e21e
LW
3291 case "$3" in
3292 4*) osvers=4 ;;
3293 5*) osvers=5 ;;
ecfc5424 3294 *) osvers="$3" ;;
a0d0e21e
LW
3295 esac
3296 ;;
761ee4e8 3297 linux) osname=linux
a0d0e21e 3298 case "$3" in
a0d0e21e
LW
3299 *) osvers="$3" ;;
3300 esac
3301 ;;
761ee4e8 3302 MiNT) osname=mint
28e8609d
JH
3303 ;;
3304 netbsd*) osname=netbsd
ecfc5424
AD
3305 osvers="$3"
3306 ;;
4e81affe
MMIJG
3307 news-os) osvers="$3"
3308 case "$3" in
3309 4*) osname=newsos4 ;;
3310 *) osname=newsos ;;
3311 esac
3312 ;;
aaacdc8b 3313 next*) osname=next ;;
28bb1e2c 3314 nonstop-ux) osname=nonstopux ;;
65dc58a1
TM
3315 openbsd) osname=openbsd
3316 osvers="$3"
3317 ;;
5c728af0
IZ
3318 os2) osname=os2
3319 osvers="$4"
3320 ;;
aaacdc8b
GS
3321 POSIX-BC | posix-bc ) osname=posix-bc
3322 osvers="$3"
a0d0e21e 3323 ;;
ae3afa4e
TH
3324 powerux | power_ux | powermax_os | powermaxos | \
3325 powerunix | power_unix) osname=powerux
3326 osvers="$3"
3327 ;;
aaacdc8b
GS
3328 qnx) osname=qnx
3329 osvers="$4"
3330 ;;
a0d0e21e
LW
3331 solaris) osname=solaris
3332 case "$3" in
3333 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
ecfc5424 3334 *) osvers="$3" ;;
a0d0e21e
LW
3335 esac
3336 ;;
85e6fe83
LW
3337 sunos) osname=sunos
3338 case "$3" in
85e6fe83
LW
3339 5*) osname=solaris
3340 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
a0d0e21e 3341 *) osvers="$3" ;;
2304df62
AD
3342 esac
3343 ;;
a0d0e21e 3344 titanos) osname=titanos
85e6fe83 3345 case "$3" in
a0d0e21e
LW
3346 1*) osvers=1 ;;
3347 2*) osvers=2 ;;
3348 3*) osvers=3 ;;
3349 4*) osvers=4 ;;
ecfc5424 3350 *) osvers="$3" ;;
2304df62
AD
3351 esac
3352 ;;
85e6fe83 3353 ultrix) osname=ultrix
ecfc5424 3354 osvers="$3"
2304df62 3355 ;;
28757baa 3356 osf1|mls+) case "$5" in
fed7345c
AD
3357 alpha)
3358 osname=dec_osf
fdd85a03 3359 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2aa76180
JH
3360 case "$osvers" in
3361 [1-9].[0-9]*) ;;
3362 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3363 esac
ecfc5424
AD
3364 ;;
3365 hp*) osname=hp_osf1 ;;
3366 mips) osname=mips_osf1 ;;
85e6fe83
LW
3367 esac
3368 ;;
af1ff193 3369 # UnixWare 7.1.2 is known as Open UNIX 8
381c1bae 3370 openunix|unixware) osname=svr5
0337d152
A
3371 osvers="$4"
3372 ;;
3c728e00 3373 uts) osname=uts
a0d0e21e
LW
3374 osvers="$3"
3375 ;;
3c728e00
JH
3376 vos) osvers="$3"
3377 ;;
85e6fe83 3378 $2) case "$osname" in
2304df62 3379 *isc*) ;;
a0d0e21e 3380 *freebsd*) ;;
5f05dabc 3381 svr*)
a0d0e21e 3382 : svr4.x or possibly later
a774dfe6 3383 case "svr$3" in
a0d0e21e
LW
3384 ${osname}*)
3385 osname=svr$3
3386 osvers=$4
3387 ;;
3388 esac
3389 case "$osname" in
3390 svr4.0)
3391 : Check for ESIX
3392 if test -f /stand/boot ; then
3393 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
ecfc5424
AD
3394 if test -n "$INITPROG" -a -f "$INITPROG"; then
3395 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3396 if test -n "$isesix"; then
a0d0e21e
LW
3397 osname=esix4
3398 fi
3399 fi
3400 fi
3401 ;;
3402 esac
3403 ;;
2304df62 3404 *) if test -f /etc/systemid; then
a0d0e21e
LW
3405 osname=sco
3406 set `echo $3 | $sed 's/\./ /g'` $4
c4f23d77 3407 if $test -f $src/hints/sco_$1_$2_$3.sh; then
85e6fe83 3408 osvers=$1.$2.$3
c4f23d77 3409 elif $test -f $src/hints/sco_$1_$2.sh; then
85e6fe83 3410 osvers=$1.$2
c4f23d77 3411 elif $test -f $src/hints/sco_$1.sh; then
85e6fe83 3412 osvers=$1
2304df62 3413 fi
a0d0e21e
LW
3414 else
3415 case "$osname" in
3416 '') : Still unknown. Probably a generic Sys V.
3417 osname="sysv"
3418 osvers="$3"
3419 ;;
3420 esac
2304df62
AD
3421 fi
3422 ;;
3423 esac
3424 ;;
a0d0e21e
LW
3425 *) case "$osname" in
3426 '') : Still unknown. Probably a generic BSD.
3427 osname="$1"
3428 osvers="$3"
3429 ;;
3430 esac
3431 ;;
2304df62
AD
3432 esac
3433 else
dfe9444c
AD
3434 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3435 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3436 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3437 osname=news_os
2304df62 3438 fi
dfe9444c 3439 $rm -f UU/kernel.what
5c728af0 3440 elif test -d c:/. -o -n "$is_os2" ; then
8e07c86e
AD
3441 set X $myuname
3442 osname=os2
3443 osvers="$5"
2304df62
AD
3444 fi
3445 fi
a774dfe6 3446
5440bc8e
JH
3447 case "$targetarch" in
3448 '') ;;
3449 *) hostarch=$osname
3450 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3451 osvers=''
3452 ;;
3453 esac
3454
a0d0e21e
LW
3455 : Now look for a hint file osname_osvers, unless one has been
3456 : specified already.
3457 case "$hintfile" in
3458 ''|' ')
1e127011 3459 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
a0d0e21e 3460 : Also try without trailing minor version numbers.
1e127011
DD
3461 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3462 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3463 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3464 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
a0d0e21e
LW
3465 case "$file" in
3466 '') dflt=none ;;
3467 *) case "$osvers" in
3468 '') dflt=$file
3469 ;;
dfe9444c 3470 *) if $test -f $src/hints/$file.sh ; then
a0d0e21e 3471 dflt=$file
dfe9444c 3472 elif $test -f $src/hints/$xfile.sh ; then
a0d0e21e 3473 dflt=$xfile
dfe9444c 3474 elif $test -f $src/hints/$xxfile.sh ; then
a0d0e21e 3475 dflt=$xxfile
dfe9444c 3476 elif $test -f $src/hints/$xxxfile.sh ; then
a0d0e21e 3477 dflt=$xxxfile
dfe9444c 3478 elif $test -f $src/hints/$xxxxfile.sh ; then
a0d0e21e 3479 dflt=$xxxxfile
dfe9444c 3480 elif $test -f "$src/hints/${osname}.sh" ; then
a0d0e21e
LW
3481 dflt="${osname}"
3482 else
3483 dflt=none
3484 fi
3485 ;;
3486 esac
85e6fe83
LW
3487 ;;
3488 esac
4e2a5f63
AD
3489 if $test -f Policy.sh ; then
3490 case "$dflt" in
3491 *Policy*) ;;
3492 none) dflt="Policy" ;;
3493 *) dflt="Policy $dflt" ;;
3494 esac
3495 fi
85e6fe83 3496 ;;
a0d0e21e 3497 *)
ecfc5424 3498 dflt=`echo $hintfile | $sed 's/\.sh$//'`
a0d0e21e 3499 ;;
2304df62 3500 esac
1aef975c 3501
4e2a5f63
AD
3502 if $test -f Policy.sh ; then
3503 $cat <<EOM
3504
3505There's also a Policy hint file available, which should make the
3506site-specific (policy) questions easier to answer.
3507EOM
3508
3509 fi
3510
2304df62
AD
3511 $cat <<EOM
3512
3513You may give one or more space-separated answers, or "none" if appropriate.
a2d23ec2
MB
3514If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3515previous run of Configure, you may specify it as well as or instead of
3516OS-specific hints. If hints are provided for your OS, you should use them:
3517although Perl can probably be built without hints on many platforms, using
3518hints often improve performance and may enable features that Configure can't
3519set up on its own. If there are no hints that match your OS, specify "none";
3520DO NOT give a wrong version or a wrong OS.
2304df62
AD
3521
3522EOM
4e2a5f63 3523
2304df62 3524 rp="Which of these apply, if any?"
dfe9444c 3525 . UU/myread
85e6fe83
LW
3526 tans=$ans
3527 for file in $tans; do
4e2a5f63
AD
3528 if $test X$file = XPolicy -a -f Policy.sh; then
3529 . Policy.sh
3530 $cat Policy.sh >> UU/config.sh
3531 elif $test -f $src/hints/$file.sh; then
dfe9444c
AD
3532 . $src/hints/$file.sh
3533 $cat $src/hints/$file.sh >> UU/config.sh
5440bc8e 3534 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
2304df62
AD
3535 : nothing
3536 else
85e6fe83
LW
3537 : Give one chance to correct a possible typo.
3538 echo "$file.sh does not exist"
3539 dflt=$file
3540 rp="hint to use instead?"
dfe9444c 3541 . UU/myread
85e6fe83 3542 for file in $ans; do
dfe9444c
AD
3543 if $test -f "$src/hints/$file.sh"; then
3544 . $src/hints/$file.sh
3545 $cat $src/hints/$file.sh >> UU/config.sh
85e6fe83
LW
3546 elif $test X$ans = X -o X$ans = Xnone ; then
3547 : nothing
3548 else
3549 echo "$file.sh does not exist -- ignored."
3550 fi
3551 done
2304df62
AD
3552 fi
3553 done
85e6fe83 3554
2304df62 3555 hint=recommended
85e6fe83 3556 : Remember our hint file for later.
dfe9444c 3557 if $test -f "$src/hints/$file.sh" ; then
a0d0e21e 3558 hintfile="$file"
85e6fe83 3559 else
a0d0e21e 3560 hintfile=''
85e6fe83 3561 fi
2304df62
AD
3562fi
3563cd UU
3564;;
3565*)
3566 echo " "
3567 echo "Fetching default answers from $config_sh..." >&4
ecfc5424
AD
3568 tmp_n="$n"
3569 tmp_c="$c"
2304df62
AD
3570 cd ..
3571 cp $config_sh config.sh 2>/dev/null
a78b0d02 3572 chmod +w config.sh
2304df62
AD
3573 . ./config.sh
3574 cd UU
3575 cp ../config.sh .
ecfc5424
AD
3576 n="$tmp_n"
3577 c="$tmp_c"
2304df62
AD
3578 hint=previous
3579 ;;
3580esac
1aef975c 3581test "$override" && . ./optdef.sh
2304df62
AD
3582
3583: Restore computed paths
3584for file in $loclist $trylist; do
3585 eval $file="\$_$file"
3586done
3587
85e6fe83 3588cat << EOM
a0d0e21e 3589
85e6fe83 3590Configure uses the operating system name and version to set some defaults.
ecfc5424
AD
3591The default value is probably right if the name rings a bell. Otherwise,
3592since spelling matters for me, either accept the default or answer "none"
3593to leave it blank.
a0d0e21e 3594
85e6fe83 3595EOM
85e6fe83 3596case "$osname" in
a0d0e21e 3597 ''|' ')
85e6fe83 3598 case "$hintfile" in
a0d0e21e 3599 ''|' '|none) dflt=none ;;
ecfc5424 3600 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
85e6fe83
LW
3601 esac
3602 ;;
3603 *) dflt="$osname" ;;
3604esac
3605rp="Operating system name?"
3606. ./myread
3607case "$ans" in
ecfc5424
AD
3608none) osname='' ;;
3609*) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
85e6fe83 3610esac
8ff267be
PP
3611echo " "
3612case "$osvers" in
3613 ''|' ')
3614 case "$hintfile" in
3615 ''|' '|none) dflt=none ;;
3616 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3617 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3618 case "$dflt" in
3619 ''|' ') dflt=none ;;
3620 esac
3621 ;;
3622 esac
3623 ;;
3624 *) dflt="$osvers" ;;
3625esac
3626rp="Operating system version?"
3627. ./myread
3628case "$ans" in
3629none) osvers='' ;;
3630*) osvers="$ans" ;;
3631esac
3632
02e93a22
JH
3633
3634. ./posthint.sh
3635
2304df62 3636: who configured the system
59b83a6f 3637cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
dfe9444c
AD
3638case "$cf_by" in
3639"")
7c04078e 3640 cf_by=`(logname) 2>/dev/null`
dfe9444c 3641 case "$cf_by" in
7c04078e
GA
3642 "")
3643 cf_by=`(whoami) 2>/dev/null`
3644 case "$cf_by" in
3645 "") cf_by=unknown ;;
3646 esac ;;
8ff267be
PP
3647 esac ;;
3648esac
2304df62 3649
f3f1a2d8
MB
3650: decide how portable to be. Allow command line overrides.
3651case "$d_portable" in
3652"$undef") ;;
3653*) d_portable="$define" ;;
b4eb6b3d 3654esac
b4eb6b3d 3655
f3f1a2d8
MB
3656: set up shell script to do ~ expansion
3657cat >filexp <<EOSS
3658$startsh
3659: expand filename
3660case "\$1" in
f16e9d76 3661 \~/*|\~)
f3f1a2d8
MB
3662 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3663 ;;
4137585d 3664 \~*)
f3f1a2d8
MB
3665 if $test -f /bin/csh; then
3666 /bin/csh -f -c "glob \$1"
3667 failed=\$?
3668 echo ""
3669 exit \$failed
3670 else
3671 name=\`$expr x\$1 : '..\([^/]*\)'\`
3672 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3673 if $test ! -d "\$dir"; then
3674 me=\`basename \$0\`
3675 echo "\$me: can't locate home directory for: \$name" >&2
3676 exit 1
3677 fi
3678 case "\$1" in
3679 */*)
3680 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3681 ;;
3682 *)
3683 echo \$dir
3684 ;;
3685 esac
3686 fi
3687 ;;
3688*)
3689 echo \$1
3690 ;;
b29b105d 3691esac
f3f1a2d8
MB
3692EOSS
3693chmod +x filexp
3694$eunicefix filexp
b29b105d 3695
f3f1a2d8
MB
3696: now set up to get a file name
3697cat <<EOS >getfile
3698$startsh
3699EOS
3700cat <<'EOSC' >>getfile
3701tilde=''
3702fullpath=''
3703already=''
3704skip=''
3705none_ok=''
3706exp_file=''
3707nopath_ok=''
3708orig_rp="$rp"
3709orig_dflt="$dflt"
3710case "$gfpth" in
3711'') gfpth='.' ;;
b29b105d 3712esac
b29b105d 3713
f3f1a2d8
MB
3714case "$fn" in
3715*\(*)
3716 : getfile will accept an answer from the comma-separated list
3717 : enclosed in parentheses even if it does not meet other criteria.
3718 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3719 fn=`echo $fn | sed 's/(.*)//'`
3720 ;;
b29b105d
JH
3721esac
3722
f3f1a2d8
MB
3723case "$fn" in
3724*:*)
3725 loc_file=`expr $fn : '.*:\(.*\)'`
3726 fn=`expr $fn : '\(.*\):.*'`
3727 ;;
b29b105d 3728esac
b29b105d 3729
f3f1a2d8
MB
3730case "$fn" in
3731*~*) tilde=true;;
3732esac
3733case "$fn" in
3734*/*) fullpath=true;;
3735esac
3736case "$fn" in
3737*+*) skip=true;;
3738esac
3739case "$fn" in
3740*n*) none_ok=true;;
3741esac
3742case "$fn" in
3743*e*) exp_file=true;;
3744esac
3745case "$fn" in
3746*p*) nopath_ok=true;;
b29b105d 3747esac
b29b105d 3748
f3f1a2d8
MB
3749case "$fn" in
3750*f*) type='File';;
3751*d*) type='Directory';;
3752*l*) type='Locate';;
3753esac
b29b105d 3754
f3f1a2d8
MB
3755what="$type"
3756case "$what" in
3757Locate) what='File';;
3758esac
b29b105d 3759
f3f1a2d8
MB
3760case "$exp_file" in
3761'')
3762 case "$d_portable" in
3763 "$define") ;;
3764 *) exp_file=true;;
b29b105d
JH
3765 esac
3766 ;;
3767esac
3768
f3f1a2d8
MB
3769cd ..
3770while test "$type"; do
3771 redo=''
3772 rp="$orig_rp"
3773 dflt="$orig_dflt"
3774 case "$tilde" in
3775 true) rp="$rp (~name ok)";;
3776 esac
3777 . UU/myread
3778 if test -f UU/getfile.ok && \
3779 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3780 then
3781 value="$ans"
3782 ansexp="$ans"
3783 break
3784 fi
3785 case "$ans" in
3786 none)
3787 value=''
3788 ansexp=''
3789 case "$none_ok" in
3790 true) type='';;
b29b105d
JH
3791 esac
3792 ;;
f3f1a2d8
MB
3793 *)
3794 case "$tilde" in
3795 '') value="$ans"
3796 ansexp="$ans";;
3797 *)
3798 value=`UU/filexp $ans`
3799 case $? in
3800 0)
3801 if test "$ans" != "$value"; then
3802 echo "(That expands to $value on this system.)"
3803 fi
3804 ;;
3805 *) value="$ans";;
3806 esac
3807 ansexp="$value"
3808 case "$exp_file" in
3809 '') value="$ans";;
3810 esac
3811 ;;
3812 esac
3813 case "$fullpath" in
3814 true)
3815 case "$ansexp" in
3816 /*) value="$ansexp" ;;
3817 [a-zA-Z]:/*) value="$ansexp" ;;
3818 *)
3819 redo=true
3820 case "$already" in
3821 true)
3822 echo "I shall only accept a full path name, as in /bin/ls." >&4
3823 echo "Use a ! shell escape if you wish to check pathnames." >&4
3824 ;;
3825 *)
3826 echo "Please give a full path name, starting with slash." >&4
3827 case "$tilde" in
3828 true)
3829 echo "Note that using ~name is ok provided it expands well." >&4
3830 already=true
3831 ;;
3832 esac
3833 esac
3834 ;;
3835 esac
3836 ;;
3837 esac
3838 case "$redo" in
3839 '')
3840 case "$type" in
3841 File)
3842 for fp in $gfpth; do
3843 if test "X$fp" = X.; then
3844 pf="$ansexp"
3845 else
3846 pf="$fp/$ansexp"
3847 fi
3848 if test -f "$pf"; then
3849 type=''
3850 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3851 then
3852 echo "($value is not a plain file, but that's ok.)"
3853 type=''
3854 fi
3855 if test X"$type" = X; then
3856 value="$pf"
3857 break
3858 fi
3859 done