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