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