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