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