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