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