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