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