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