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