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