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