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