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