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