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