This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to threads-shared-1.03
[perl5.git] / Configure
... / ...
CommitLineData
1#! /bin/sh
2#
3# If these # comments don't work, trim them. Don't worry about any other
4# shell scripts, Configure will trim # comments from them for you.
5#
6# (If you are trying to port this package to a machine without sh,
7# I would suggest you have a look at the prototypical config_h.SH file
8# and edit it to reflect your system. Some packages may include samples
9# of config.h for certain machines, so you might look for one of those.)
10#
11# Yes, you may rip this off to use in other distribution packages. This
12# script belongs to the public domain and cannot be copyrighted.
13#
14# (Note: this Configure script was generated automatically. Rather than
15# working with this copy of Configure, you may wish to get metaconfig.
16# The dist-3.0 package (which contains metaconfig) was posted in
17# comp.sources.misc and is available on CPAN under authors/id/RAM so
18# you may fetch it yourself from your nearest archive site.)
19#
20#
21# Though this script was generated by metaconfig, it is OK to send
22# patches against it. It's up to the Configure pumpkin to backport
23# the patch to the metaunits if it is accepted.
24# See Porting/pumpkin.pod for more information on metaconfig.
25#
26
27# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
28#
29# Generated on Wed Sep 13 08:48:56 CEST 2006 [metaconfig 3.0 PL70]
30# (with additional metaconfig patches by perlbug@perl.org)
31
32cat >c1$$ <<EOF
33ARGGGHHHH!!!!!
34
35SCO csh still thinks true is false. Write to SCO today and tell them that next
36year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
37
38(Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
39we'd have to do is go in and swap the && and || tokens, wherever they are.)
40
41[End of diatribe. We now return you to your regularly scheduled programming...]
42EOF
43cat >c2$$ <<EOF
44
45OOPS! You naughty creature! You didn't run Configure with sh!
46I will attempt to remedy the situation by running sh for you...
47EOF
48
49true || cat c1$$ c2$$
50true || exec sh $0 $argv:q
51
52(exit $?0) || cat c2$$
53(exit $?0) || exec sh $0 $argv:q
54rm -f c1$$ c2$$
55
56if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
57 cat >&4 <<EOF
58***
59*** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
60*** Configure that well. (Plan 9 is close to UNIX but not close enough.)
61*** Please read the README.plan9 for further instructions.
62*** Cannot continue, aborting.
63***
64EOF
65 exit 1
66fi
67
68: compute my invocation name
69me=$0
70case "$0" in
71*/*)
72 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
73 test "$me" || me=$0
74 ;;
75esac
76
77: Proper separator for the PATH environment variable
78p_=:
79: On OS/2 this directory should exist if this is not floppy only system :-]
80if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
81 if test -n "$OS2_SHELL"; then
82 p_=\;
83 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
84 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
85 is_os2=yes
86 elif test -n "$DJGPP"; then
87 case "X${MACHTYPE:-nonesuchmach}" in
88 *cygwin) ;;
89 *) p_=\; ;;
90 esac
91 fi
92fi
93
94: Proper PATH setting
95paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
96paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
97paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
98paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
99paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
100paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
101paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
102paths="$paths /sbin /usr/sbin /usr/libexec"
103paths="$paths /system/gnu_library/bin"
104
105for p in $paths
106do
107 case "$p_$PATH$p_" in
108 *$p_$p$p_*) ;;
109 *) test -d $p && PATH=$PATH$p_$p ;;
110 esac
111done
112
113PATH=.$p_$PATH
114export PATH
115
116: shall we be using ksh?
117inksh=''
118needksh=''
119avoidksh=''
120newsh=/bin/ksh
121changesh=''
122if (PATH=.; alias -x) >/dev/null 2>&1; then
123 inksh=true
124fi
125if test -f /hp-ux -a -f /bin/ksh; then
126 needksh='to avoid sh bug in "here document" expansion'
127fi
128if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
129 if test X`/usr/bin/uname -v` = X4; then
130 avoidksh="to avoid AIX 4's /bin/sh"
131 newsh=/usr/bin/bsh
132 fi
133fi
134if test -f /osf_boot -a -f /usr/sbin/setld; then
135 if test X`/usr/bin/uname -s` = XOSF1; then
136 avoidksh="to avoid Digital UNIX' ksh"
137 newsh=/bin/sh
138 unset BIN_SH # if this is 'xpg4' sh will start up ksh
139 fi
140fi
141case "$inksh/$needksh" in
142/[a-z]*)
143 ENV=''
144 changesh=true
145 reason="$needksh"
146 ;;
147esac
148case "$inksh/$avoidksh" in
149true/[a-z]*)
150 changesh=true
151 reason="$avoidksh"
152 ;;
153esac
154case "$inksh/$needksh-$avoidksh-" in
155true/--)
156 cat <<EOM
157(I see you are using the Korn shell. Some ksh's blow up on $me,
158mainly on older exotic systems. If yours does, try the Bourne shell instead.)
159EOM
160 ;;
161esac
162case "$changesh" in
163true)
164 export newsh
165 echo "(Feeding myself to $newsh $reason.)"
166 case "$0" in
167 Configure|*/Configure) exec $newsh $0 "$@";;
168 *) exec $newsh Configure "$@";;
169 esac
170 ;;
171esac
172
173: if needed set CDPATH to a harmless value that is not chatty
174: avoid bash 2.02 problems with empty CDPATH.
175case "$CDPATH" in
176'') ;;
177*) case "$SHELL" in
178 *bash*) CDPATH='.' ;;
179 *) CDPATH='' ;;
180 esac
181 ;;
182esac
183: Configure runs within the UU subdirectory
184test -d UU || mkdir UU
185cd UU && rm -f ./*
186
187ccname=''
188ccversion=''
189ccsymbols=''
190cppccsymbols=''
191cppsymbols=''
192from=''
193run=''
194targetarch=''
195to=''
196usecrosscompile=''
197mistrustnm=''
198perllibs=''
199dynamic_ext=''
200extensions=''
201known_extensions=''
202nonxs_ext=''
203static_ext=''
204useopcode=''
205useposix=''
206extras=''
207d_bsd=''
208d_eunice=''
209d_xenix=''
210eunicefix=''
211Mcc=''
212ar=''
213awk=''
214bash=''
215bison=''
216byacc=''
217cat=''
218chgrp=''
219chmod=''
220chown=''
221comm=''
222compress=''
223cp=''
224cpio=''
225cpp=''
226csh=''
227date=''
228echo=''
229egrep=''
230emacs=''
231expr=''
232find=''
233flex=''
234gmake=''
235grep=''
236gzip=''
237inews=''
238ksh=''
239less=''
240line=''
241lint=''
242ln=''
243lp=''
244lpr=''
245ls=''
246mail=''
247mailx=''
248make=''
249mkdir=''
250more=''
251mv=''
252nm=''
253nroff=''
254perl=''
255pg=''
256pmake=''
257pr=''
258rm=''
259rmail=''
260sed=''
261sendmail=''
262shar=''
263sleep=''
264smail=''
265sort=''
266submit=''
267tail=''
268tar=''
269tbl=''
270tee=''
271test=''
272touch=''
273tr=''
274troff=''
275uname=''
276uniq=''
277uuname=''
278vi=''
279zcat=''
280zip=''
281full_ar=''
282full_sed=''
283libswanted=''
284hint=''
285myuname=''
286osname=''
287osvers=''
288Author=''
289Date=''
290Header=''
291Id=''
292Locker=''
293Log=''
294RCSfile=''
295Revision=''
296Source=''
297State=''
298_a=''
299_exe=''
300_o=''
301archobjs=''
302exe_ext=''
303firstmakefile=''
304lib_ext=''
305obj_ext=''
306path_sep=''
307afs=''
308afsroot=''
309alignbytes=''
310ansi2knr=''
311archlib=''
312archlibexp=''
313d_archlib=''
314installarchlib=''
315archname=''
316myarchname=''
317d_atolf=''
318d_atoll=''
319baserev=''
320bin=''
321binexp=''
322initialinstalllocation=''
323installbin=''
324userelocatableinc=''
325byteorder=''
326cc=''
327ccflags=''
328cppflags=''
329ldflags=''
330lkflags=''
331locincpth=''
332optimize=''
333cf_email=''
334cf_by=''
335cf_time=''
336charsize=''
337contains=''
338cpp_stuff=''
339cpplast=''
340cppminus=''
341cpprun=''
342cppstdin=''
343d__fwalk=''
344d_access=''
345d_accessx=''
346d_aintl=''
347d_alarm=''
348asctime_r_proto=''
349d_asctime_r=''
350d_attribute_format=''
351d_attribute_malloc=''
352d_attribute_nonnull=''
353d_attribute_noreturn=''
354d_attribute_pure=''
355d_attribute_unused=''
356d_attribute_warn_unused_result=''
357d_bcmp=''
358d_bcopy=''
359d_builtin_choose_expr=''
360d_builtin_expect=''
361d_bzero=''
362d_c99_variadic_macros=''
363d_casti32=''
364castflags=''
365d_castneg=''
366d_chown=''
367d_chroot=''
368d_chsize=''
369d_class=''
370d_clearenv=''
371d_closedir=''
372d_void_closedir=''
373d_cmsghdr_s=''
374d_const=''
375d_copysignl=''
376d_cplusplus=''
377cryptlib=''
378d_crypt=''
379crypt_r_proto=''
380d_crypt_r=''
381d_csh=''
382full_csh=''
383ctermid_r_proto=''
384d_ctermid_r=''
385ctime_r_proto=''
386d_ctime_r=''
387d_cuserid=''
388d_dbl_dig=''
389d_dbminitproto=''
390d_difftime=''
391d_dirfd=''
392d_dlerror=''
393d_dlopen=''
394d_dlsymun=''
395d_dosuid=''
396d_suidsafe=''
397d_drand48_r=''
398drand48_r_proto=''
399d_drand48proto=''
400d_dup2=''
401d_eaccess=''
402d_endgrent=''
403d_endgrent_r=''
404endgrent_r_proto=''
405d_endhent=''
406d_endhostent_r=''
407endhostent_r_proto=''
408d_endnent=''
409d_endnetent_r=''
410endnetent_r_proto=''
411d_endpent=''
412d_endprotoent_r=''
413endprotoent_r_proto=''
414d_endpwent=''
415d_endpwent_r=''
416endpwent_r_proto=''
417d_endsent=''
418d_endservent_r=''
419endservent_r_proto=''
420d_faststdio=''
421d_fchdir=''
422d_fchmod=''
423d_fchown=''
424d_fcntl=''
425d_fcntl_can_lock=''
426d_fd_macros=''
427d_fd_set=''
428d_fds_bits=''
429d_fgetpos=''
430d_finite=''
431d_finitel=''
432d_flexfnam=''
433d_flock=''
434d_flockproto=''
435d_fork=''
436d_fp_class=''
437d_fpclass=''
438d_fpclassify=''
439d_fpclassl=''
440d_fpos64_t=''
441d_frexpl=''
442d_fs_data_s=''
443d_fseeko=''
444d_fsetpos=''
445d_fstatfs=''
446d_fsync=''
447d_ftello=''
448d_ftime=''
449d_gettimeod=''
450d_futimes=''
451d_Gconvert=''
452d_getcwd=''
453d_getespwnam=''
454d_getfsstat=''
455d_getgrent=''
456d_getgrent_r=''
457getgrent_r_proto=''
458d_getgrgid_r=''
459getgrgid_r_proto=''
460d_getgrnam_r=''
461getgrnam_r_proto=''
462d_getgrps=''
463d_gethbyaddr=''
464d_gethbyname=''
465d_gethent=''
466aphostname=''
467d_gethname=''
468d_phostname=''
469d_uname=''
470d_gethostbyaddr_r=''
471gethostbyaddr_r_proto=''
472d_gethostbyname_r=''
473gethostbyname_r_proto=''
474d_gethostent_r=''
475gethostent_r_proto=''
476d_gethostprotos=''
477d_getitimer=''
478d_getlogin=''
479d_getlogin_r=''
480getlogin_r_proto=''
481d_getmnt=''
482d_getmntent=''
483d_getnbyaddr=''
484d_getnbyname=''
485d_getnent=''
486d_getnetbyaddr_r=''
487getnetbyaddr_r_proto=''
488d_getnetbyname_r=''
489getnetbyname_r_proto=''
490d_getnetent_r=''
491getnetent_r_proto=''
492d_getnetprotos=''
493d_getpagsz=''
494d_getpent=''
495d_getpgid=''
496d_getpgrp2=''
497d_bsdgetpgrp=''
498d_getpgrp=''
499d_getppid=''
500d_getprior=''
501d_getpbyname=''
502d_getpbynumber=''
503d_getprotobyname_r=''
504getprotobyname_r_proto=''
505d_getprotobynumber_r=''
506getprotobynumber_r_proto=''
507d_getprotoent_r=''
508getprotoent_r_proto=''
509d_getprotoprotos=''
510d_getprpwnam=''
511d_getpwent=''
512d_getpwent_r=''
513getpwent_r_proto=''
514d_getpwnam_r=''
515getpwnam_r_proto=''
516d_getpwuid_r=''
517getpwuid_r_proto=''
518d_getsent=''
519d_getservbyname_r=''
520getservbyname_r_proto=''
521d_getservbyport_r=''
522getservbyport_r_proto=''
523d_getservent_r=''
524getservent_r_proto=''
525d_getservprotos=''
526d_getspnam=''
527d_getspnam_r=''
528getspnam_r_proto=''
529d_getsbyname=''
530d_getsbyport=''
531d_gmtime_r=''
532gmtime_r_proto=''
533d_gnulibc=''
534gnulibc_version=''
535d_hasmntopt=''
536d_htonl=''
537d_ilogbl=''
538d_inetaton=''
539d_int64_t=''
540d_isascii=''
541d_isfinite=''
542d_isinf=''
543d_isnan=''
544d_isnanl=''
545d_killpg=''
546d_lchown=''
547d_ldbl_dig=''
548d_libm_lib_version=''
549d_link=''
550d_localtime_r=''
551localtime_r_proto=''
552d_locconv=''
553d_lockf=''
554d_longdbl=''
555longdblsize=''
556d_longlong=''
557longlongsize=''
558d_lseekproto=''
559d_lstat=''
560d_madvise=''
561d_malloc_good_size=''
562d_malloc_size=''
563d_mblen=''
564d_mbstowcs=''
565d_mbtowc=''
566d_memchr=''
567d_memcmp=''
568d_memcpy=''
569d_memmove=''
570d_memset=''
571d_mkdir=''
572d_mkdtemp=''
573d_mkfifo=''
574d_mkstemp=''
575d_mkstemps=''
576d_mktime=''
577d_mmap=''
578mmaptype=''
579d_modfl=''
580d_modfl_pow32_bug=''
581d_modflproto=''
582d_mprotect=''
583d_msg=''
584d_msgctl=''
585d_msgget=''
586d_msghdr_s=''
587d_msgrcv=''
588d_msgsnd=''
589d_msync=''
590d_munmap=''
591d_nice=''
592d_nl_langinfo=''
593d_off64_t=''
594d_open3=''
595d_fpathconf=''
596d_pathconf=''
597d_pause=''
598d_pipe=''
599d_poll=''
600d_portable=''
601d_procselfexe=''
602procselfexe=''
603d_old_pthread_create_joinable=''
604old_pthread_create_joinable=''
605d_pthread_atfork=''
606d_pthread_attr_setscope=''
607d_pthread_yield=''
608d_sched_yield=''
609sched_yield=''
610d_qgcvt=''
611d_random_r=''
612random_r_proto=''
613d_readdir64_r=''
614readdir64_r_proto=''
615d_readdir=''
616d_rewinddir=''
617d_seekdir=''
618d_telldir=''
619d_readdir_r=''
620readdir_r_proto=''
621d_readlink=''
622d_readv=''
623d_recvmsg=''
624d_rename=''
625d_rmdir=''
626d_safebcpy=''
627d_safemcpy=''
628d_sanemcmp=''
629d_sbrkproto=''
630d_scalbnl=''
631d_select=''
632d_sem=''
633d_semctl=''
634d_semget=''
635d_semop=''
636d_sendmsg=''
637d_setegid=''
638d_seteuid=''
639d_setgrent=''
640d_setgrent_r=''
641setgrent_r_proto=''
642d_setgrps=''
643d_sethent=''
644d_sethostent_r=''
645sethostent_r_proto=''
646d_setitimer=''
647d_setlinebuf=''
648d_setlocale=''
649d_setlocale_r=''
650setlocale_r_proto=''
651d_setnent=''
652d_setnetent_r=''
653setnetent_r_proto=''
654d_setpent=''
655d_setpgid=''
656d_setpgrp2=''
657d_bsdsetpgrp=''
658d_setpgrp=''
659d_setprior=''
660d_setproctitle=''
661d_setprotoent_r=''
662setprotoent_r_proto=''
663d_setpwent=''
664d_setpwent_r=''
665setpwent_r_proto=''
666d_setregid=''
667d_setresgid=''
668d_setresuid=''
669d_setreuid=''
670d_setrgid=''
671d_setruid=''
672d_setsent=''
673d_setservent_r=''
674setservent_r_proto=''
675d_setsid=''
676d_setvbuf=''
677d_sfio=''
678usesfio=''
679d_shm=''
680d_shmat=''
681d_shmatprototype=''
682shmattype=''
683d_shmctl=''
684d_shmdt=''
685d_shmget=''
686d_sigaction=''
687d_sigprocmask=''
688d_sigsetjmp=''
689usesitecustomize=''
690d_snprintf=''
691d_vsnprintf=''
692d_sockatmark=''
693d_sockatmarkproto=''
694d_msg_ctrunc=''
695d_msg_dontroute=''
696d_msg_oob=''
697d_msg_peek=''
698d_msg_proxy=''
699d_oldsock=''
700d_scm_rights=''
701d_socket=''
702d_sockpair=''
703sockethdr=''
704socketlib=''
705d_socklen_t=''
706d_socks5_init=''
707d_sprintf_returns_strlen=''
708d_sqrtl=''
709d_srand48_r=''
710srand48_r_proto=''
711d_srandom_r=''
712srandom_r_proto=''
713d_sresgproto=''
714d_sresuproto=''
715d_statblks=''
716d_statfs_f_flags=''
717d_statfs_s=''
718d_fstatvfs=''
719d_statvfs=''
720d_stdio_cnt_lval=''
721d_stdio_ptr_lval=''
722d_stdio_ptr_lval_nochange_cnt=''
723d_stdio_ptr_lval_sets_cnt=''
724d_stdiobase=''
725d_stdstdio=''
726stdio_base=''
727stdio_bufsiz=''
728stdio_cnt=''
729stdio_filbuf=''
730stdio_ptr=''
731d_index=''
732d_strchr=''
733d_strcoll=''
734d_strctcpy=''
735d_strerrm=''
736d_strerror=''
737d_sysernlst=''
738d_syserrlst=''
739d_strerror_r=''
740strerror_r_proto=''
741d_strftime=''
742d_strlcat=''
743d_strlcpy=''
744d_strtod=''
745d_strtol=''
746d_strtold=''
747d_strtoll=''
748d_strtoq=''
749d_strtoul=''
750d_strtoull=''
751d_strtouq=''
752d_strxfrm=''
753d_symlink=''
754d_syscall=''
755d_syscallproto=''
756d_sysconf=''
757d_system=''
758d_tcgetpgrp=''
759d_tcsetpgrp=''
760d_telldirproto=''
761d_time=''
762timetype=''
763clocktype=''
764d_times=''
765d_tmpnam_r=''
766tmpnam_r_proto=''
767d_truncate=''
768d_ttyname_r=''
769ttyname_r_proto=''
770d_tzname=''
771d_u32align=''
772d_ualarm=''
773d_umask=''
774d_semctl_semid_ds=''
775d_semctl_semun=''
776d_union_semun=''
777d_unordered=''
778d_unsetenv=''
779d_usleep=''
780d_usleepproto=''
781d_ustat=''
782d_vfork=''
783usevfork=''
784d_voidsig=''
785signal_t=''
786d_volatile=''
787d_charvspr=''
788d_vprintf=''
789d_wait4=''
790d_waitpid=''
791d_wcstombs=''
792d_wctomb=''
793d_writev=''
794dlext=''
795cccdlflags=''
796ccdlflags=''
797dlsrc=''
798ld=''
799lddlflags=''
800usedl=''
801doublesize=''
802ebcdic=''
803fflushNULL=''
804fflushall=''
805fpossize=''
806fpostype=''
807gccansipedantic=''
808gccosandvers=''
809gccversion=''
810gidformat=''
811gidsign=''
812gidsize=''
813gidtype=''
814groupstype=''
815h_fcntl=''
816h_sysfile=''
817html1dir=''
818html1direxp=''
819installhtml1dir=''
820html3dir=''
821html3direxp=''
822installhtml3dir=''
823i_arpainet=''
824i_crypt=''
825db_hashtype=''
826db_prefixtype=''
827db_version_major=''
828db_version_minor=''
829db_version_patch=''
830i_db=''
831i_dbm=''
832i_rpcsvcdbm=''
833d_dirnamlen=''
834direntrytype=''
835i_dirent=''
836i_dld=''
837i_dlfcn=''
838i_fcntl=''
839i_float=''
840i_fp=''
841i_fp_class=''
842i_gdbm=''
843d_grpasswd=''
844i_grp=''
845i_ieeefp=''
846i_inttypes=''
847i_langinfo=''
848i_libutil=''
849i_limits=''
850i_locale=''
851i_machcthr=''
852i_malloc=''
853i_math=''
854i_memory=''
855i_mntent=''
856i_ndbm=''
857i_netdb=''
858i_neterrno=''
859i_netinettcp=''
860i_niin=''
861i_sysin=''
862i_poll=''
863i_prot=''
864i_pthread=''
865d_pwage=''
866d_pwchange=''
867d_pwclass=''
868d_pwcomment=''
869d_pwexpire=''
870d_pwgecos=''
871d_pwpasswd=''
872d_pwquota=''
873i_pwd=''
874i_sfio=''
875i_shadow=''
876i_socks=''
877i_stddef=''
878i_stdlib=''
879i_string=''
880strings=''
881i_sunmath=''
882i_sysaccess=''
883i_sysdir=''
884i_sysfile=''
885d_voidtty=''
886i_bsdioctl=''
887i_sysfilio=''
888i_sysioctl=''
889i_syssockio=''
890i_syslog=''
891i_sysmman=''
892i_sysmode=''
893i_sysmount=''
894i_sysndir=''
895i_sysparam=''
896i_sysresrc=''
897i_syssecrt=''
898i_sysselct=''
899i_sysstat=''
900i_sysstatfs=''
901i_sysstatvfs=''
902i_systimes=''
903i_systypes=''
904i_sysuio=''
905i_sysun=''
906i_sysutsname=''
907i_sysvfs=''
908i_syswait=''
909i_sgtty=''
910i_termio=''
911i_termios=''
912d_tm_tm_gmtoff=''
913d_tm_tm_zone=''
914i_systime=''
915i_systimek=''
916i_time=''
917timeincl=''
918i_unistd=''
919i_ustat=''
920i_utime=''
921i_values=''
922i_stdarg=''
923i_varargs=''
924i_varhdr=''
925i_vfork=''
926d_inc_version_list=''
927inc_version_list=''
928inc_version_list_init=''
929installprefix=''
930installprefixexp=''
931installstyle=''
932installusrbinperl=''
933intsize=''
934longsize=''
935shortsize=''
936issymlink=''
937libc=''
938ldlibpthname=''
939libperl=''
940shrpenv=''
941useshrplib=''
942glibpth=''
943libpth=''
944loclibpth=''
945plibpth=''
946xlibpth=''
947ignore_versioned_solibs=''
948libs=''
949libsdirs=''
950libsfiles=''
951libsfound=''
952libspath=''
953lns=''
954d_PRIEUldbl=''
955d_PRIFUldbl=''
956d_PRIGUldbl=''
957d_PRIeldbl=''
958d_PRIfldbl=''
959d_PRIgldbl=''
960d_SCNfldbl=''
961sPRIEUldbl=''
962sPRIFUldbl=''
963sPRIGUldbl=''
964sPRIeldbl=''
965sPRIfldbl=''
966sPRIgldbl=''
967sSCNfldbl=''
968lseeksize=''
969lseektype=''
970mad=''
971madlyh=''
972madlyobj=''
973madlysrc=''
974make_set_make=''
975d_mymalloc=''
976freetype=''
977mallocobj=''
978mallocsrc=''
979malloctype=''
980usemallocwrap=''
981usemymalloc=''
982installman1dir=''
983man1dir=''
984man1direxp=''
985man1ext=''
986installman3dir=''
987man3dir=''
988man3direxp=''
989man3ext=''
990modetype=''
991multiarch=''
992mydomain=''
993myhostname=''
994phostname=''
995c=''
996n=''
997d_eofnblk=''
998eagain=''
999o_nonblock=''
1000rd_nodata=''
1001need_va_copy=''
1002netdb_hlen_type=''
1003netdb_host_type=''
1004netdb_name_type=''
1005netdb_net_type=''
1006groupcat=''
1007hostcat=''
1008passcat=''
1009orderlib=''
1010ranlib=''
1011d_perl_otherlibdirs=''
1012otherlibdirs=''
1013package=''
1014spackage=''
1015pager=''
1016api_revision=''
1017api_subversion=''
1018api_version=''
1019api_versionstring=''
1020patchlevel=''
1021perl_patchlevel=''
1022revision=''
1023subversion=''
1024version=''
1025version_patchlevel_string=''
1026perl5=''
1027perladmin=''
1028perlpath=''
1029d_nv_preserves_uv=''
1030d_nv_zero_is_allbits_zero=''
1031i16size=''
1032i16type=''
1033i32size=''
1034i32type=''
1035i64size=''
1036i64type=''
1037i8size=''
1038i8type=''
1039ivsize=''
1040ivtype=''
1041nv_preserves_uv_bits=''
1042nvsize=''
1043nvtype=''
1044u16size=''
1045u16type=''
1046u32size=''
1047u32type=''
1048u64size=''
1049u64type=''
1050u8size=''
1051u8type=''
1052uvsize=''
1053uvtype=''
1054ivdformat=''
1055nvEUformat=''
1056nvFUformat=''
1057nvGUformat=''
1058nveformat=''
1059nvfformat=''
1060nvgformat=''
1061uvXUformat=''
1062uvoformat=''
1063uvuformat=''
1064uvxformat=''
1065pidtype=''
1066prefix=''
1067prefixexp=''
1068installprivlib=''
1069privlib=''
1070privlibexp=''
1071prototype=''
1072ptrsize=''
1073d_PRIXU64=''
1074d_PRId64=''
1075d_PRIi64=''
1076d_PRIo64=''
1077d_PRIu64=''
1078d_PRIx64=''
1079sPRIXU64=''
1080sPRId64=''
1081sPRIi64=''
1082sPRIo64=''
1083sPRIu64=''
1084sPRIx64=''
1085d_quad=''
1086quadkind=''
1087quadtype=''
1088uquadtype=''
1089drand01=''
1090randbits=''
1091randfunc=''
1092randseedtype=''
1093seedfunc=''
1094installscript=''
1095scriptdir=''
1096scriptdirexp=''
1097selectminbits=''
1098selecttype=''
1099sh=''
1100sig_count=''
1101sig_name=''
1102sig_name_init=''
1103sig_num=''
1104sig_num_init=''
1105sig_size=''
1106d_sitearch=''
1107installsitearch=''
1108sitearch=''
1109sitearchexp=''
1110installsitebin=''
1111sitebin=''
1112sitebinexp=''
1113installsitehtml1dir=''
1114sitehtml1dir=''
1115sitehtml1direxp=''
1116installsitehtml3dir=''
1117sitehtml3dir=''
1118sitehtml3direxp=''
1119installsitelib=''
1120sitelib=''
1121sitelib_stem=''
1122sitelibexp=''
1123installsiteman1dir=''
1124siteman1dir=''
1125siteman1direxp=''
1126installsiteman3dir=''
1127siteman3dir=''
1128siteman3direxp=''
1129siteprefix=''
1130siteprefixexp=''
1131installsitescript=''
1132sitescript=''
1133sitescriptexp=''
1134sizesize=''
1135sizetype=''
1136so=''
1137socksizetype=''
1138sharpbang=''
1139shsharp=''
1140spitshell=''
1141src=''
1142ssizetype=''
1143startperl=''
1144startsh=''
1145stdchar=''
1146d_stdio_stream_array=''
1147stdio_stream_array=''
1148sysman=''
1149trnl=''
1150uidformat=''
1151uidsign=''
1152uidsize=''
1153uidtype=''
1154archname64=''
1155use64bitall=''
1156use64bitint=''
1157usefaststdio=''
1158ccflags_uselargefiles=''
1159ldflags_uselargefiles=''
1160libswanted_uselargefiles=''
1161uselargefiles=''
1162uselongdouble=''
1163usemorebits=''
1164usemultiplicity=''
1165nm_opt=''
1166nm_so_opt=''
1167runnm=''
1168usenm=''
1169useperlio=''
1170usesocks=''
1171d_oldpthreads=''
1172use5005threads=''
1173useithreads=''
1174usereentrant=''
1175usethreads=''
1176incpath=''
1177mips_type=''
1178usrinc=''
1179d_vendorarch=''
1180installvendorarch=''
1181vendorarch=''
1182vendorarchexp=''
1183d_vendorbin=''
1184installvendorbin=''
1185vendorbin=''
1186vendorbinexp=''
1187installvendorhtml1dir=''
1188vendorhtml1dir=''
1189vendorhtml1direxp=''
1190installvendorhtml3dir=''
1191vendorhtml3dir=''
1192vendorhtml3direxp=''
1193d_vendorlib=''
1194installvendorlib=''
1195vendorlib=''
1196vendorlib_stem=''
1197vendorlibexp=''
1198installvendorman1dir=''
1199vendorman1dir=''
1200vendorman1direxp=''
1201installvendorman3dir=''
1202vendorman3dir=''
1203vendorman3direxp=''
1204usevendorprefix=''
1205vendorprefix=''
1206vendorprefixexp=''
1207d_vendorscript=''
1208installvendorscript=''
1209vendorscript=''
1210vendorscriptexp=''
1211versiononly=''
1212defvoidused=''
1213voidflags=''
1214yacc=''
1215yaccflags=''
1216CONFIG=''
1217
1218define='define'
1219undef='undef'
1220smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1221rmlist=''
1222
1223: We must find out about Eunice early
1224eunicefix=':'
1225if test -f /etc/unixtovms; then
1226 eunicefix=/etc/unixtovms
1227fi
1228if test -f /etc/unixtovms.exe; then
1229 eunicefix=/etc/unixtovms.exe
1230fi
1231
1232: Set executable suffix now -- needed before hints available
1233if test -f "/libs/version.library"; then
1234: Amiga OS
1235 _exe=""
1236elif test -f "/system/gnu_library/bin/ar.pm"; then
1237: Stratus VOS
1238 _exe=".pm"
1239elif test -n "$DJGPP"; then
1240: DOS DJGPP
1241 _exe=".exe"
1242elif test -d c:/. -o -n "$is_os2" ; then
1243: OS/2 or cygwin
1244 _exe=".exe"
1245fi
1246
1247i_whoami=''
1248ccname=''
1249ccversion=''
1250perllibs=''
1251: set useposix=false in your hint file to disable the POSIX extension.
1252useposix=true
1253: set useopcode=false in your hint file to disable the Opcode extension.
1254useopcode=true
1255: Trailing extension. Override this in a hint file, if needed.
1256: Extra object files, if any, needed on this platform.
1257archobjs=''
1258archname=''
1259: Possible local include directories to search.
1260: Set locincpth to "" in a hint file to defeat local include searches.
1261locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1262locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1263:
1264: no include file wanted by default
1265inclwanted=''
1266
1267: Enable -DEBUGGING and -DDEBUGGING from the command line
1268EBUGGING=''
1269DEBUGGING=old
1270
1271groupstype=''
1272libnames=''
1273: change the next line if compiling for Xenix/286 on Xenix/386
1274xlibpth='/usr/lib/386 /lib/386'
1275: Possible local library directories to search.
1276loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1277loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1278
1279: general looking path for locating libraries
1280glibpth="/lib /usr/lib $xlibpth"
1281glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1282test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1283test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1284
1285: Private path used by Configure to find libraries. Its value
1286: is prepended to libpth. This variable takes care of special
1287: machines, like the mips. Usually, it should be empty.
1288plibpth=''
1289
1290: default library list
1291libswanted=''
1292: some systems want to use only the non-versioned libso:s
1293ignore_versioned_solibs=''
1294siteman1dir=''
1295siteman3dir=''
1296sitescript=''
1297archname64=''
1298ccflags_uselargefiles=''
1299ldflags_uselargefiles=''
1300libswanted_uselargefiles=''
1301: set usemultiplicity on the Configure command line to enable multiplicity.
1302: set usesocks on the Configure command line to enable socks.
1303: set usethreads on the Configure command line to enable threads.
1304usereentrant='undef'
1305: full support for void wanted by default
1306defvoidused=15
1307
1308: List of libraries we want.
1309: If anyone needs extra -lxxx, put those in a hint file.
1310libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1311libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1312: We probably want to search /usr/shlib before most other libraries.
1313: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1314glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1315glibpth="/usr/shlib $glibpth"
1316: Do not use vfork unless overridden by a hint file.
1317usevfork=false
1318
1319: Find the basic shell for Bourne shell scripts
1320case "$sh" in
1321'')
1322 case "$SYSTYPE" in
1323 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1324 *) xxx='/bin/sh';;
1325 esac
1326 if test -f "$xxx"; then
1327 sh="$xxx"
1328 else
1329 : Build up a list and do a single loop so we can 'break' out.
1330 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1331 for xxx in sh bash ksh pdksh ash; do
1332 for p in $pth; do
1333 try="$try ${p}/${xxx}"
1334 done
1335 done
1336 for xxx in $try; do
1337 if test -f "$xxx"; then
1338 sh="$xxx";
1339 break
1340 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1341 sh="$xxx";
1342 break
1343 elif test -f "$xxx.exe"; then
1344 sh="$xxx";
1345 break
1346 fi
1347 done
1348 fi
1349 ;;
1350esac
1351
1352case "$sh" in
1353'') cat >&2 <<EOM
1354$me: Fatal Error: I can't find a Bourne Shell anywhere.
1355
1356Usually it's in /bin/sh. How did you even get this far?
1357Please contact me (Perl Maintainers) at perlbug@perl.org and
1358we'll try to straighten this all out.
1359EOM
1360 exit 1
1361 ;;
1362esac
1363
1364: see if sh knows # comments
1365if `$sh -c '#' >/dev/null 2>&1`; then
1366 shsharp=true
1367 spitshell=cat
1368 xcat=/bin/cat
1369 test -f $xcat$_exe || xcat=/usr/bin/cat
1370 if test ! -f $xcat$_exe; then
1371 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1372 if test -f $p/cat$_exe; then
1373 xcat=$p/cat
1374 break
1375 fi
1376 done
1377 if test ! -f $xcat$_exe; then
1378 echo "Can't find cat anywhere!"
1379 exit 1
1380 fi
1381 fi
1382 echo "#!$xcat" >sharp
1383 $eunicefix sharp
1384 chmod +x sharp
1385 ./sharp > today
1386 if test -s today; then
1387 sharpbang='#!'
1388 else
1389 echo "#! $xcat" > sharp
1390 $eunicefix sharp
1391 chmod +x sharp
1392 ./sharp > today
1393 if test -s today; then
1394 sharpbang='#! '
1395 else
1396 sharpbang=': use '
1397 fi
1398 fi
1399else
1400 echo " "
1401 echo "Your $sh doesn't grok # comments--I will strip them later on."
1402 shsharp=false
1403 cd ..
1404 echo "exec grep -v '^[ ]*#'" >spitshell
1405 chmod +x spitshell
1406 $eunicefix spitshell
1407 spitshell=`pwd`/spitshell
1408 cd UU
1409 echo "I presume that if # doesn't work, #! won't work either!"
1410 sharpbang=': use '
1411fi
1412rm -f sharp today
1413
1414: figure out how to guarantee sh startup
1415case "$startsh" in
1416'') startsh=${sharpbang}${sh} ;;
1417*)
1418esac
1419cat >sharp <<EOSS
1420$startsh
1421set abc
1422test "$?abc" != 1
1423EOSS
1424
1425chmod +x sharp
1426$eunicefix sharp
1427if ./sharp; then
1428 : echo "Yup, it does."
1429else
1430 echo "Hmm... '$startsh' does not guarantee sh startup..."
1431 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1432fi
1433rm -f sharp
1434
1435
1436: Save command line options in file UU/cmdline.opt for later use in
1437: generating config.sh.
1438cat > cmdline.opt <<EOSH
1439# Configure command line arguments.
1440config_arg0='$0'
1441config_args='$*'
1442config_argc=$#
1443EOSH
1444argn=1
1445args_exp=''
1446args_sep=''
1447for arg in "$@"; do
1448 cat >>cmdline.opt <<EOSH
1449config_arg$argn='$arg'
1450EOSH
1451 # Extreme backslashitis: replace each ' by '"'"'
1452 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1453$arg
1454EOC
1455 arg_exp=`cat cmdl.opt`
1456 args_exp="$args_exp$args_sep'$arg_exp'"
1457 argn=`expr $argn + 1`
1458 args_sep=' '
1459done
1460# args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1461# used by ./hints/os2.sh
1462rm -f cmdl.opt
1463
1464: produce awk script to parse command line options
1465cat >options.awk <<'EOF'
1466BEGIN {
1467 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1468
1469 len = length(optstr);
1470 for (i = 1; i <= len; i++) {
1471 c = substr(optstr, i, 1);
1472 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1473 if (a == ":") {
1474 arg[c] = 1;
1475 i++;
1476 }
1477 opt[c] = 1;
1478 }
1479}
1480{
1481 expect = 0;
1482 str = $0;
1483 if (substr(str, 1, 1) != "-") {
1484 printf("'%s'\n", str);
1485 next;
1486 }
1487 len = length($0);
1488 for (i = 2; i <= len; i++) {
1489 c = substr(str, i, 1);
1490 if (!opt[c]) {
1491 printf("-%s\n", substr(str, i));
1492 next;
1493 }
1494 printf("-%s\n", c);
1495 if (arg[c]) {
1496 if (i < len)
1497 printf("'%s'\n", substr(str, i + 1));
1498 else
1499 expect = 1;
1500 next;
1501 }
1502 }
1503}
1504END {
1505 if (expect)
1506 print "?";
1507}
1508EOF
1509
1510: process the command line options
1511set X `for arg in "$@"; do echo "X$arg"; done |
1512 sed -e s/X// | awk -f options.awk`
1513eval "set $*"
1514shift
1515rm -f options.awk
1516
1517: set up default values
1518fastread=''
1519reuseval=false
1520config_sh=''
1521alldone=''
1522error=''
1523silent=''
1524extractsh=''
1525override=''
1526knowitall=''
1527rm -f optdef.sh posthint.sh
1528cat >optdef.sh <<EOS
1529$startsh
1530EOS
1531
1532
1533: option parsing
1534while test $# -gt 0; do
1535 case "$1" in
1536 -d) shift; fastread=yes;;
1537 -e) shift; alldone=cont;;
1538 -f)
1539 shift
1540 cd ..
1541 if test -r "$1"; then
1542 config_sh="$1"
1543 else
1544 echo "$me: cannot read config file $1." >&2
1545 error=true
1546 fi
1547 cd UU
1548 shift;;
1549 -h) shift; error=true;;
1550 -r) shift; reuseval=true;;
1551 -s) shift; silent=true; realsilent=true;;
1552 -E) shift; alldone=exit;;
1553 -K) shift; knowitall=true;;
1554 -O) shift; override=true;;
1555 -S) shift; silent=true; extractsh=true;;
1556 -D)
1557 shift
1558 case "$1" in
1559 *=)
1560 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1561 echo "$me: ignoring -D $1" >&2
1562 ;;
1563 *=*) echo "$1" | \
1564 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1565 *) echo "$1='define'" >> optdef.sh;;
1566 esac
1567 shift
1568 ;;
1569 -U)
1570 shift
1571 case "$1" in
1572 *=) echo "$1" >> optdef.sh;;
1573 *=*)
1574 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1575 echo "$me: ignoring -U $1" >&2
1576 ;;
1577 *) echo "$1='undef'" >> optdef.sh;;
1578 esac
1579 shift
1580 ;;
1581 -A)
1582 shift
1583 xxx=''
1584 yyy="$1"
1585 zzz=''
1586 uuu=undef
1587 case "$yyy" in
1588 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1589 case "$zzz" in
1590 *:*) zzz='' ;;
1591 *) xxx=append
1592 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1593 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1594 esac
1595 ;;
1596 esac
1597 case "$xxx" in
1598 '') case "$yyy" in
1599 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1600 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1601 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1602 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1603 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1604 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1605 esac
1606 ;;
1607 esac
1608 case "$xxx" in
1609 append)
1610 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1611 clear)
1612 echo "$yyy=''" >> posthint.sh ;;
1613 define)
1614 case "$zzz" in
1615 '') zzz=define ;;
1616 esac
1617 echo "$yyy='$zzz'" >> posthint.sh ;;
1618 eval)
1619 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1620 prepend)
1621 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1622 undef)
1623 case "$zzz" in
1624 '') zzz="$uuu" ;;
1625 esac
1626 echo "$yyy=$zzz" >> posthint.sh ;;
1627 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1628 esac
1629 shift
1630 ;;
1631 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1632 exit 0;;
1633 --) break;;
1634 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1635 *) break;;
1636 esac
1637done
1638
1639case "$error" in
1640true)
1641 cat >&2 <<EOM
1642Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1643 [-U symbol] [-U symbol=] [-A command:symbol...]
1644 -d : use defaults for all answers.
1645 -e : go on without questioning past the production of config.sh.
1646 -f : specify an alternate default configuration file.
1647 -h : print this help message and exit (with an error status).
1648 -r : reuse C symbols value if possible (skips costly nm extraction).
1649 -s : silent mode, only echoes questions and essential information.
1650 -D : define symbol to have some value:
1651 -D symbol symbol gets the value 'define'
1652 -D symbol=value symbol gets the value 'value'
1653 -E : stop at the end of questions, after having produced config.sh.
1654 -K : do not use unless you know what you are doing.
1655 -O : let -D and -U override definitions from loaded configuration file.
1656 -S : perform variable substitutions on all .SH files (can mix with -f)
1657 -U : undefine symbol:
1658 -U symbol symbol gets the value 'undef'
1659 -U symbol= symbol gets completely empty
1660 -A : manipulate symbol after the platform specific hints have been applied:
1661 -A symbol=value append " "value to symbol
1662 -A append:symbol=value append value to symbol
1663 -A define:symbol=value define symbol to have value
1664 -A clear:symbol define symbol to be ''
1665 -A define:symbol define symbol to be 'define'
1666 -A eval:symbol=value define symbol to be eval of value
1667 -A prepend:symbol=value prepend value to symbol
1668 -A undef:symbol define symbol to be 'undef'
1669 -A undef:symbol= define symbol to be ''
1670 -V : print version number and exit (with a zero status).
1671EOM
1672 exit 1
1673 ;;
1674esac
1675
1676: Sanity checks
1677case "$fastread$alldone" in
1678yescont|yesexit) ;;
1679*)
1680 case "$extractsh" in
1681 true) ;;
1682 *)
1683 if test ! -t 0; then
1684 echo "Say 'sh Configure', not 'sh <Configure'"
1685 exit 1
1686 fi
1687 ;;
1688 esac
1689 ;;
1690esac
1691
1692exec 4>&1
1693case "$silent" in
1694true) exec 1>/dev/null;;
1695esac
1696
1697: run the defines and the undefines, if any, but leave the file out there...
1698touch optdef.sh
1699. ./optdef.sh
1700: create the posthint manipulation script and leave the file out there...
1701touch posthint.sh
1702
1703: set package name
1704package=perl5
1705first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1706last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1707case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1708ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1709*) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1710esac
1711
1712: Some greps do not return status, grrr.
1713echo "grimblepritz" >grimble
1714if grep blurfldyick grimble >/dev/null 2>&1 ; then
1715 contains=contains
1716elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1717 contains=grep
1718else
1719 contains=contains
1720fi
1721rm -f grimble
1722: the following should work in any shell
1723case "$contains" in
1724contains*)
1725 echo " "
1726 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1727 cat >contains <<'EOSS'
1728grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1729EOSS
1730chmod +x contains
1731esac
1732
1733: Find the path to the source tree
1734case "$src" in
1735'') case "$0" in
1736 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1737 case "$src" in
1738 /*) ;;
1739 .) ;;
1740 *) src=`cd ../$src && pwd` ;;
1741 esac
1742 ;;
1743 *) src='.';;
1744 esac;;
1745esac
1746case "$src" in
1747'') src=/
1748 rsrc=/
1749 ;;
1750/*) rsrc="$src";;
1751*) rsrc="../$src";;
1752esac
1753if test -f $rsrc/Configure && \
1754 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1755then
1756 : found it, so we are ok.
1757else
1758 rsrc=''
1759 for src in . .. ../.. ../../.. ../../../..; do
1760 if test -f ../$src/Configure && \
1761 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1762 then
1763 rsrc=../$src
1764 break
1765 fi
1766 done
1767fi
1768case "$rsrc" in
1769'')
1770 cat <<EOM >&4
1771
1772Sorry, I can't seem to locate the source dir for $package. Please start
1773Configure with an explicit path -- i.e. /some/path/Configure.
1774
1775EOM
1776 exit 1
1777 ;;
1778../.) rsrc='..';;
1779*)
1780 echo " "
1781 echo "Sources for $package found in \"$src\"." >&4
1782 ;;
1783esac
1784
1785: script used to extract .SH files with variable substitutions
1786cat >extract <<'EOS'
1787PERL_CONFIG_SH=true
1788echo "Doing variable substitutions on .SH files..."
1789if test -f MANIFEST; then
1790 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1791else
1792 echo "(Looking for .SH files under the source directory.)"
1793 set x `(cd "$src"; find . -name "*.SH" -print)`
1794fi
1795shift
1796case $# in
17970) set x `(cd "$src"; echo *.SH)`; shift;;
1798esac
1799if test ! -f "$src/$1"; then
1800 shift
1801fi
1802mkdir_p='
1803name=$1;
1804create="";
1805while test $name; do
1806 if test ! -d "$name"; then
1807 create="$name $create";
1808 name=`echo $name | sed -e "s|^[^/]*$||"`;
1809 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1810 else
1811 name="";
1812 fi;
1813done;
1814for file in $create; do
1815 mkdir $file;
1816done
1817'
1818for file in $*; do
1819 case "$src" in
1820 ".")
1821 case "$file" in
1822 */*)
1823 dir=`expr X$file : 'X\(.*\)/'`
1824 file=`expr X$file : 'X.*/\(.*\)'`
1825 (cd "$dir" && . ./$file)
1826 ;;
1827 *)
1828 . ./$file
1829 ;;
1830 esac
1831 ;;
1832 *)
1833 case "$file" in
1834 */*)
1835 dir=`expr X$file : 'X\(.*\)/'`
1836 file=`expr X$file : 'X.*/\(.*\)'`
1837 (set x $dir; shift; eval $mkdir_p)
1838 sh <"$src/$dir/$file"
1839 ;;
1840 *)
1841 sh <"$src/$file"
1842 ;;
1843 esac
1844 ;;
1845 esac
1846done
1847if test -f "$src/config_h.SH"; then
1848 if test ! -f config.h; then
1849 : oops, they left it out of MANIFEST, probably, so do it anyway.
1850 . "$src/config_h.SH"
1851 fi
1852fi
1853EOS
1854
1855: extract files and exit if asked to do so
1856case "$extractsh" in
1857true)
1858 case "$realsilent" in
1859 true) ;;
1860 *) exec 1>&4;;
1861 esac
1862 case "$config_sh" in
1863 '') config_sh='config.sh';;
1864 esac
1865 echo " "
1866 echo "Fetching answers from $config_sh..."
1867 cd ..
1868 . $config_sh
1869 test "$override" && . ./optdef.sh
1870 echo " "
1871 . UU/extract
1872 rm -rf UU
1873 echo "Extraction done."
1874 exit 0
1875 ;;
1876esac
1877
1878: Eunice requires " " instead of "", can you believe it
1879echo " "
1880: Here we go...
1881echo "Beginning of configuration questions for $package."
1882
1883trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1884
1885: first determine how to suppress newline on echo command
1886echo " "
1887echo "Checking echo to see how to suppress newlines..."
1888(echo "hi there\c" ; echo " ") >.echotmp
1889if $contains c .echotmp >/dev/null 2>&1 ; then
1890 echo "...using -n."
1891 n='-n'
1892 c=''
1893else
1894 cat <<'EOM'
1895...using \c
1896EOM
1897 n=''
1898 c='\c'
1899fi
1900echo $n "The star should be here-->$c"
1901echo '*'
1902rm -f .echotmp
1903
1904: Now test for existence of everything in MANIFEST
1905echo " "
1906if test -f "$rsrc/MANIFEST"; then
1907 echo "First let's make sure your kit is complete. Checking..." >&4
1908 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1909 rm -f missing
1910 tmppwd=`pwd`
1911 for filelist in x??; do
1912 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1913 done
1914 if test -s missing; then
1915 cat missing >&4
1916 cat >&4 <<'EOM'
1917
1918THIS PACKAGE SEEMS TO BE INCOMPLETE.
1919
1920You have the option of continuing the configuration process, despite the
1921distinct possibility that your kit is damaged, by typing 'y'es. If you
1922do, don't blame me if something goes wrong. I advise you to type 'n'o
1923and contact the author (perlbug@perl.org).
1924
1925EOM
1926 echo $n "Continue? [n] $c" >&4
1927 read ans
1928 case "$ans" in
1929 y*)
1930 echo "Continuing..." >&4
1931 rm -f missing
1932 ;;
1933 *)
1934 echo "ABORTING..." >&4
1935 kill $$
1936 ;;
1937 esac
1938 else
1939 echo "Looks good..."
1940 fi
1941else
1942 echo "There is no MANIFEST file. I hope your kit is complete !"
1943fi
1944rm -f missing x??
1945
1946echo " "
1947: Find the appropriate value for a newline for tr
1948if test -n "$DJGPP"; then
1949 trnl='\012'
1950fi
1951if test X"$trnl" = X; then
1952 case "`echo foo|tr '\n' x 2>/dev/null`" in
1953 foox) trnl='\n' ;;
1954 esac
1955fi
1956if test X"$trnl" = X; then
1957 case "`echo foo|tr '\012' x 2>/dev/null`" in
1958 foox) trnl='\012' ;;
1959 esac
1960fi
1961if test X"$trnl" = X; then
1962 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1963 fooxy) trnl='\n\r' ;;
1964 esac
1965fi
1966if test X"$trnl" = X; then
1967 cat <<EOM >&2
1968
1969$me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1970
1971EOM
1972 exit 1
1973fi
1974
1975: compute the number of columns on the terminal for proper question formatting
1976case "$COLUMNS" in
1977'') COLUMNS='80';;
1978esac
1979
1980: set up the echo used in my read
1981myecho="case \"\$xxxm\" in
1982'') echo $n \"\$rp $c\" >&4;;
1983*) case \"\$rp\" in
1984 '') echo $n \"[\$xxxm] $c\";;
1985 *)
1986 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1987 echo \"\$rp\" >&4
1988 echo $n \"[\$xxxm] $c\" >&4
1989 else
1990 echo $n \"\$rp [\$xxxm] $c\" >&4
1991 fi
1992 ;;
1993 esac;;
1994esac"
1995
1996: now set up to do reads with possible shell escape and default assignment
1997cat <<EOSC >myread
1998$startsh
1999xxxm=\$dflt
2000$myecho
2001ans='!'
2002case "\$fastread" in
2003yes) case "\$dflt" in
2004 '') ;;
2005 *) ans='';
2006 case "\$silent-\$rp" in
2007 true-) ;;
2008 *) echo " " >&4;;
2009 esac;;
2010 esac;;
2011*) case "\$silent" in
2012 true) case "\$rp" in
2013 '') ans='';;
2014 esac;;
2015 esac;;
2016esac
2017while expr "X\$ans" : "X!" >/dev/null; do
2018 read answ
2019 set x \$xxxm
2020 shift
2021 aok=''; eval "ans=\\"\$answ\\"" && aok=y
2022 case "\$answ" in
2023 "!")
2024 sh 1>&4
2025 echo " "
2026 $myecho
2027 ;;
2028 !*)
2029 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2030 shift
2031 sh 1>&4 -c "\$*"
2032 echo " "
2033 $myecho
2034 ;;
2035 "\$ans")
2036 case "\$ans" in
2037 \\&*)
2038 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2039 shift
2040 case "\$1" in
2041 -d)
2042 fastread=yes
2043 echo "(OK, I'll run with -d after this question.)" >&4
2044 ;;
2045 -*)
2046 echo "*** Sorry, \$1 not supported yet." >&4
2047 ;;
2048 esac
2049 $myecho
2050 ans=!
2051 ;;
2052 esac;;
2053 *)
2054 case "\$aok" in
2055 y)
2056 echo "*** Substitution done -- please confirm."
2057 xxxm="\$ans"
2058 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2059 xxxm="\$ans"
2060 ans=!
2061 ;;
2062 *)
2063 echo "*** Error -- try again."
2064 ans=!
2065 ;;
2066 esac
2067 $myecho
2068 ;;
2069 esac
2070 case "\$ans\$xxxm\$nostick" in
2071 '')
2072 ans=!
2073 $myecho
2074 ;;
2075 esac
2076done
2077case "\$ans" in
2078'') ans="\$xxxm";;
2079esac
2080EOSC
2081
2082: create .config dir to save info across Configure sessions
2083test -d ../.config || mkdir ../.config
2084cat >../.config/README <<EOF
2085This directory created by Configure to save information that should
2086persist across sessions for $package.
2087
2088You may safely delete it if you wish.
2089EOF
2090
2091xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2092case "$usedevel" in
2093$define|true|[yY]*) ;;
2094*) case "$xversion" in
2095 *[13579])
2096 cat >&4 <<EOH
2097*** WHOA THERE!!! ***
2098
2099 This is an UNSTABLE DEVELOPMENT release.
2100 The version of this $package distribution is $xversion, that is, odd,
2101 (as opposed to even) and that signifies a development release.
2102 If you want a maintenance release, you want an even-numbered version.
2103
2104 Do ***NOT*** install this into production use.
2105 Data corruption and crashes are possible.
2106
2107 It is most seriously suggested that you do not continue any further
2108 unless you want to help in developing and debugging Perl.
2109
2110 If you *still* want to build perl, you can answer 'y' now,
2111 or pass -Dusedevel to Configure.
2112
2113EOH
2114 rp='Do you really want to continue?'
2115 dflt='n'
2116 . ./myread
2117 case "$ans" in
2118 [yY]) echo >&4 "Okay, continuing."
2119 usedevel="$define" ;;
2120 *) echo >&4 "Okay, bye."
2121 exit 1
2122 ;;
2123 esac
2124 ;;
2125 esac
2126 ;;
2127esac
2128case "$usedevel" in
2129$define|true|[yY]*)
2130 case "$versiononly" in
2131 '') versiononly="$define" ;;
2132 esac
2133 case "$installusrbinperl" in
2134 '') installusrbinperl="$undef" ;;
2135 esac
2136 ;;
2137esac
2138
2139: general instructions
2140needman=true
2141firsttime=true
2142user=`(logname) 2>/dev/null`
2143case "$user" in
2144'') user=`whoami 2>&1`;;
2145esac
2146if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2147 firsttime=false
2148 echo " "
2149 rp='Would you like to see the instructions?'
2150 dflt=n
2151 . ./myread
2152 case "$ans" in
2153 [yY]*) ;;
2154 *) needman=false;;
2155 esac
2156fi
2157if $needman; then
2158 cat <<EOH
2159
2160This installation shell script will examine your system and ask you questions
2161to determine how the perl5 package should be installed. If you get
2162stuck on a question, you may use a ! shell escape to start a subshell or
2163execute a command. Many of the questions will have default answers in square
2164brackets; typing carriage return will give you the default.
2165
2166On some of the questions which ask for file or directory names you are allowed
2167to use the ~name construct to specify the login directory belonging to "name",
2168even if you don't have a shell which knows about that. Questions where this is
2169allowed will be marked "(~name ok)".
2170
2171EOH
2172 rp=''
2173 dflt='Type carriage return to continue'
2174 . ./myread
2175 cat <<'EOH'
2176
2177The prompter used in this script allows you to use shell variables and
2178backticks in your answers. You may use $1, $2, etc... to refer to the words
2179in the default answer, as if the default line was a set of arguments given to a
2180script shell. This means you may also use $* to repeat the whole default line,
2181so you do not have to re-type everything to add something to the default.
2182
2183Everytime there is a substitution, you will have to confirm. If there is an
2184error (e.g. an unmatched backtick), the default answer will remain unchanged
2185and you will be prompted again.
2186
2187If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2188the questions and use the computed defaults (or the previous answers if there
2189was already a config.sh file). Type 'Configure -h' for a list of options.
2190You may also start interactively and then answer '& -d' at any prompt to turn
2191on the non-interactive behaviour for the remainder of the execution.
2192
2193EOH
2194 . ./myread
2195 cat <<EOH
2196
2197Much effort has been expended to ensure that this shell script will run on any
2198Unix system. If despite that it blows up on yours, your best bet is to edit
2199Configure and run it again. If you can't run Configure for some reason,
2200you'll have to generate a config.sh file by hand. Whatever problems you
2201have, let me (perlbug@perl.org) know how I blew it.
2202
2203This installation script affects things in two ways:
2204
22051) it may do direct variable substitutions on some of the files included
2206 in this kit.
22072) it builds a config.h file for inclusion in C programs. You may edit
2208 any of these files as the need arises after running this script.
2209
2210If you make a mistake on a question, there is no easy way to back up to it
2211currently. The easiest thing to do is to edit config.sh and rerun all the SH
2212files. Configure will offer to let you do this before it runs the SH files.
2213
2214EOH
2215 dflt='Type carriage return to continue'
2216 . ./myread
2217 case "$firsttime" in
2218 true) echo $user >>../.config/instruct;;
2219 esac
2220fi
2221
2222: find out where common programs are
2223echo " "
2224echo "Locating common programs..." >&4
2225cat <<EOSC >loc
2226$startsh
2227case \$# in
22280) exit 1;;
2229esac
2230thing=\$1
2231shift
2232dflt=\$1
2233shift
2234for dir in \$*; do
2235 case "\$thing" in
2236 .)
2237 if test -d \$dir/\$thing; then
2238 echo \$dir
2239 exit 0
2240 fi
2241 ;;
2242 *)
2243 for thisthing in \$dir/\$thing; do
2244 : just loop through to pick last item
2245 done
2246 if test -f \$thisthing; then
2247 echo \$thisthing
2248 exit 0
2249 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2250 echo \$thisthing
2251 exit 0
2252 elif test -f \$dir/\$thing.exe; then
2253 if test -n "$DJGPP"; then
2254 echo \$dir/\$thing.exe
2255 elif test "$eunicefix" != ":"; then
2256 : on Eunice apparently
2257 echo \$dir/\$thing
2258 exit 0
2259 fi
2260 exit 0
2261 fi
2262 ;;
2263 esac
2264done
2265echo \$dflt
2266exit 1
2267EOSC
2268chmod +x loc
2269$eunicefix loc
2270loclist="
2271awk
2272cat
2273chmod
2274comm
2275cp
2276echo
2277expr
2278grep
2279ls
2280mkdir
2281rm
2282sed
2283sort
2284touch
2285tr
2286uniq
2287"
2288trylist="
2289Mcc
2290ar
2291bison
2292byacc
2293cpp
2294csh
2295date
2296egrep
2297gmake
2298gzip
2299less
2300ln
2301make
2302more
2303nm
2304nroff
2305pg
2306test
2307uname
2308zip
2309"
2310pth=`echo $PATH | sed -e "s/$p_/ /g"`
2311pth="$pth /lib /usr/lib"
2312for file in $loclist; do
2313 eval xxx=\$$file
2314 case "$xxx" in
2315 /*|?:[\\/]*)
2316 if test -f "$xxx"; then
2317 : ok
2318 else
2319 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2320 xxx=`./loc $file $file $pth`
2321 fi
2322 ;;
2323 '') xxx=`./loc $file $file $pth`;;
2324 *) xxx=`./loc $xxx $xxx $pth`;;
2325 esac
2326 eval $file=$xxx$_exe
2327 eval _$file=$xxx
2328 case "$xxx" in
2329 /*)
2330 echo $file is in $xxx.
2331 ;;
2332 ?:[\\/]*)
2333 echo $file is in $xxx.
2334 ;;
2335 *)
2336 echo "I don't know where '$file' is, and my life depends on it." >&4
2337 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2338 exit 1
2339 ;;
2340 esac
2341done
2342echo " "
2343echo "Don't worry if any of the following aren't found..."
2344say=offhand
2345for file in $trylist; do
2346 eval xxx=\$$file
2347 case "$xxx" in
2348 /*|?:[\\/]*)
2349 if test -f "$xxx"; then
2350 : ok
2351 else
2352 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2353 xxx=`./loc $file $file $pth`
2354 fi
2355 ;;
2356 '') xxx=`./loc $file $file $pth`;;
2357 *) xxx=`./loc $xxx $xxx $pth`;;
2358 esac
2359 eval $file=$xxx$_exe
2360 eval _$file=$xxx
2361 case "$xxx" in
2362 /*)
2363 echo $file is in $xxx.
2364 ;;
2365 ?:[\\/]*)
2366 echo $file is in $xxx.
2367 ;;
2368 *)
2369 echo "I don't see $file out there, $say."
2370 say=either
2371 ;;
2372 esac
2373done
2374case "$egrep" in
2375egrep)
2376 echo "Substituting grep for egrep."
2377 egrep=$grep
2378 _egrep=$grep
2379 ;;
2380esac
2381case "$ln" in
2382ln)
2383 echo "Substituting cp for ln."
2384 ln=$cp
2385 _ln=$cp
2386 ;;
2387esac
2388case "$make" in
2389make)
2390 case "$gmake" in
2391 gmake)
2392 echo "I can't find make or gmake, and my life depends on it." >&4
2393 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2394 exit 1
2395 ;;
2396 esac
2397 ;;
2398esac
2399case "$gmake" in
2400gmake) ;;
2401*) # We can't have osname yet.
2402 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2403 # Assume that gmake, if found, is definitely GNU make
2404 # and prefer it over the system make.
2405 echo "Substituting gmake for make."
2406 make=$gmake
2407 _make=$gmake
2408 fi
2409 ;;
2410esac
2411case "$test" in
2412test)
2413 echo "Hopefully test is built into your sh."
2414 ;;
2415*)
2416 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2417 echo "Using the test built into your sh."
2418 test=test
2419 _test=test
2420 fi
2421 ;;
2422esac
2423case "$echo" in
2424echo)
2425 echo "Hopefully echo is built into your sh."
2426 ;;
2427'') ;;
2428*)
2429 echo " "
2430echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2431 $echo $n "hi there$c" >foo1
2432 echo $n "hi there$c" >foo2
2433 if cmp foo1 foo2 >/dev/null 2>&1; then
2434 echo "They are compatible. In fact, they may be identical."
2435 else
2436 case "$n" in
2437 '-n') n='' c='\c';;
2438 *) n='-n' c='';;
2439 esac
2440 cat <<FOO
2441They are not compatible! You are probably running ksh on a non-USG system.
2442I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2443have echo built in and we may have to run some Bourne shell scripts. That
2444means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2445
2446FOO
2447 $echo $n "The star should be here-->$c"
2448 $echo "*"
2449 fi
2450 $rm -f foo1 foo2
2451 ;;
2452esac
2453
2454cat <<EOS >trygcc
2455$startsh
2456EOS
2457cat <<'EOSC' >>trygcc
2458case "$cc" in
2459'') ;;
2460*) $rm -f try try.*
2461 $cat >try.c <<EOM
2462int main(int argc, char *argv[]) {
2463 return 0;
2464}
2465EOM
2466 if $cc -o try $ccflags $ldflags try.c; then
2467 :
2468 else
2469 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2470 despair=yes
2471 trygcc=yes
2472 case "$cc" in
2473 *gcc*) trygcc=no ;;
2474 esac
2475 case "`$cc -v -c try.c 2>&1`" in
2476 *gcc*) trygcc=no ;;
2477 esac
2478 if $test X"$trygcc" = Xyes; then
2479 if gcc -o try -c try.c; then
2480 echo " "
2481 echo "You seem to have a working gcc, though." >&4
2482 rp="Would you like to use it?"
2483 dflt=y
2484 if $test -f myread; then
2485 . ./myread
2486 else
2487 if $test -f UU/myread; then
2488 . ./UU/myread
2489 else
2490 echo "Cannot find myread, sorry. Aborting." >&2
2491 exit 1
2492 fi
2493 fi
2494 case "$ans" in
2495 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2496 if $test -f usethreads.cbu; then
2497 $cat >&4 <<EOM
2498
2499*** However, any setting of the C compiler flags (e.g. for thread support)
2500*** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2501*** (together with e.g. -Dusethreads).
2502
2503EOM
2504 fi;;
2505 esac
2506 fi
2507 fi
2508 fi
2509 $rm -f try try.*
2510 ;;
2511esac
2512EOSC
2513
2514cat <<EOS >checkcc
2515$startsh
2516EOS
2517cat <<'EOSC' >>checkcc
2518case "$cc" in
2519'') ;;
2520*) $rm -f try try.*
2521 $cat >try.c <<EOM
2522int main(int argc, char *argv[]) {
2523 return 0;
2524}
2525EOM
2526 if $cc -o try $ccflags $ldflags try.c; then
2527 :
2528 else
2529 if $test X"$despair" = Xyes; then
2530 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2531 fi
2532 $cat >&4 <<EOM
2533You need to find a working C compiler.
2534Either (purchase and) install the C compiler supplied by your OS vendor,
2535or for a free C compiler try http://gcc.gnu.org/
2536I cannot continue any further, aborting.
2537EOM
2538 exit 1
2539 fi
2540 $rm -f try try.*
2541 ;;
2542esac
2543EOSC
2544
2545: determine whether symbolic links are supported
2546echo " "
2547$touch blurfl
2548if $ln -s blurfl sym > /dev/null 2>&1 ; then
2549 echo "Symbolic links are supported." >&4
2550 lns="$ln -s"
2551else
2552 echo "Symbolic links are NOT supported." >&4
2553 lns="$ln"
2554fi
2555$rm -f blurfl sym
2556
2557: determine whether symbolic links are supported
2558echo " "
2559case "$lns" in
2560*"ln"*" -s")
2561 echo "Checking how to test for symbolic links..." >&4
2562 $lns blurfl sym
2563 if $test "X$issymlink" = X; then
2564 case "$newsh" in
2565 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2566 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2567 esac
2568 if test $? = 0; then
2569 issymlink="test -h"
2570 else
2571 echo "Your builtin 'test -h' may be broken." >&4
2572 case "$test" in
2573 /*) ;;
2574 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2575 for p in $pth
2576 do
2577 if test -f "$p/$test"; then
2578 test="$p/$test"
2579 break
2580 fi
2581 done
2582 ;;
2583 esac
2584 case "$test" in
2585 /*)
2586 echo "Trying external '$test -h'." >&4
2587 issymlink="$test -h"
2588 if $test ! -h sym >/dev/null 2>&1; then
2589 echo "External '$test -h' is broken, too." >&4
2590 issymlink=''
2591 fi
2592 ;;
2593 *) issymlink='' ;;
2594 esac
2595 fi
2596 fi
2597 if $test "X$issymlink" = X; then
2598 if $test -L sym 2>/dev/null; then
2599 issymlink="$test -L"
2600 echo "The builtin '$test -L' worked." >&4
2601 fi
2602 fi
2603 if $test "X$issymlink" != X; then
2604 echo "You can test for symbolic links with '$issymlink'." >&4
2605 else
2606 echo "I do not know how you can test for symbolic links." >&4
2607 fi
2608 $rm -f blurfl sym
2609 ;;
2610*) echo "No symbolic links, so not testing for their testing..." >&4
2611 ;;
2612esac
2613echo " "
2614
2615
2616case "$mksymlinks" in
2617$define|true|[yY]*)
2618 case "$src" in
2619 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2620 exit 1
2621 ;;
2622 *) case "$lns:$issymlink" in
2623 *"ln"*" -s:"*"test -"?)
2624 echo "Creating the symbolic links..." >&4
2625 echo "(First creating the subdirectories...)" >&4
2626 cd ..
2627 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2628 read directory
2629 test -z "$directory" && break
2630 mkdir -p $directory
2631 done
2632 # Sanity check 1.
2633 if test ! -d t/base; then
2634 echo "Failed to create the subdirectories. Aborting." >&4
2635 exit 1
2636 fi
2637 echo "(Then creating the symlinks...)" >&4
2638 awk '{print $1}' $src/MANIFEST | while true; do
2639 read filename
2640 test -z "$filename" && break
2641 if test -f $filename; then
2642 if $issymlink $filename; then
2643 rm -f $filename
2644 fi
2645 fi
2646 if test -f $filename; then
2647 echo "$filename already exists, not symlinking."
2648 else
2649 ln -s $src/$filename $filename
2650 fi
2651 done
2652 # Sanity check 2.
2653 if test ! -f t/base/lex.t; then
2654 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2655 exit 1
2656 fi
2657 cd UU
2658 ;;
2659 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2660 ;;
2661 esac
2662 ;;
2663 esac
2664 ;;
2665esac
2666
2667
2668case "$usecrosscompile" in
2669$define|true|[yY]*)
2670 $echo "Cross-compiling..."
2671 croak=''
2672 case "$cc" in
2673 *-*-gcc) # A cross-compiling gcc, probably.
2674 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2675 ar=$targetarch-ar
2676 # leave out ld, choosing it is more complex
2677 nm=$targetarch-nm
2678 ranlib=$targetarch-ranlib
2679 $echo 'extern int foo;' > try.c
2680 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2681 shift
2682 if $test $# -gt 0; then
2683 incpth="$incpth $*"
2684 incpth="`$echo $incpth|$sed 's/^ //'`"
2685 echo "Guessing incpth '$incpth'." >&4
2686 for i in $*; do
2687 j="`$echo $i|$sed 's,/include$,/lib,'`"
2688 if $test -d $j; then
2689 libpth="$libpth $j"
2690 fi
2691 done
2692 libpth="`$echo $libpth|$sed 's/^ //'`"
2693 echo "Guessing libpth '$libpth'." >&4
2694 fi
2695 $rm -f try.c
2696 ;;
2697 esac
2698 case "$targetarch" in
2699 '') echo "Targetarch not defined." >&4; croak=y ;;
2700 *) echo "Using targetarch $targetarch." >&4 ;;
2701 esac
2702 case "$incpth" in
2703 '') echo "Incpth not defined." >&4; croak=y ;;
2704 *) echo "Using incpth '$incpth'." >&4 ;;
2705 esac
2706 case "$libpth" in
2707 '') echo "Libpth not defined." >&4; croak=y ;;
2708 *) echo "Using libpth '$libpth'." >&4 ;;
2709 esac
2710 case "$usrinc" in
2711 '') for i in $incpth; do
2712 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2713 usrinc=$i
2714 echo "Guessing usrinc $usrinc." >&4
2715 break
2716 fi
2717 done
2718 case "$usrinc" in
2719 '') echo "Usrinc not defined." >&4; croak=y ;;
2720 esac
2721 ;;
2722 *) echo "Using usrinc $usrinc." >&4 ;;
2723 esac
2724 case "$targethost" in
2725 '') echo "Targethost not defined." >&4; croak=y ;;
2726 *) echo "Using targethost $targethost." >&4
2727 esac
2728 locincpth=' '
2729 loclibpth=' '
2730 case "$croak" in
2731 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2732 esac
2733 case "$src" in
2734 /*) run=$src/Cross/run
2735 targetmkdir=$src/Cross/mkdir
2736 to=$src/Cross/to
2737 from=$src/Cross/from
2738 ;;
2739 *) pwd=`$test -f ../Configure & cd ..; pwd`
2740 run=$pwd/Cross/run
2741 targetmkdir=$pwd/Cross/mkdir
2742 to=$pwd/Cross/to
2743 from=$pwd/Cross/from
2744 ;;
2745 esac
2746 case "$targetrun" in
2747 '') targetrun=ssh ;;
2748 esac
2749 case "$targetto" in
2750 '') targetto=scp ;;
2751 esac
2752 case "$targetfrom" in
2753 '') targetfrom=scp ;;
2754 esac
2755 run=$run-$targetrun
2756 to=$to-$targetto
2757 from=$from-$targetfrom
2758 case "$targetdir" in
2759 '') targetdir=/tmp
2760 echo "Guessing targetdir $targetdir." >&4
2761 ;;
2762 esac
2763 case "$targetuser" in
2764 '') targetuser=root
2765 echo "Guessing targetuser $targetuser." >&4
2766 ;;
2767 esac
2768 case "$targetfrom" in
2769 scp) q=-q ;;
2770 *) q='' ;;
2771 esac
2772 case "$targetrun" in
2773 ssh|rsh)
2774 cat >$run <<EOF
2775#!/bin/sh
2776case "\$1" in
2777-cwd)
2778 shift
2779 cwd=\$1
2780 shift
2781 ;;
2782esac
2783case "\$cwd" in
2784'') cwd=$targetdir ;;
2785esac
2786exe=\$1
2787shift
2788if $test ! -f \$exe.xok; then
2789 $to \$exe
2790 $touch \$exe.xok
2791fi
2792$targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2793EOF
2794 ;;
2795 *) echo "Unknown targetrun '$targetrun'" >&4
2796 exit 1
2797 ;;
2798 esac
2799 case "$targetmkdir" in
2800 */Cross/mkdir)
2801 cat >$targetmkdir <<EOF
2802#!/bin/sh
2803$targetrun -l $targetuser $targethost "mkdir -p \$@"
2804EOF
2805 $chmod a+rx $targetmkdir
2806 ;;
2807 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2808 exit 1
2809 ;;
2810 esac
2811 case "$targetto" in
2812 scp|rcp)
2813 cat >$to <<EOF
2814#!/bin/sh
2815for f in \$@
2816do
2817 case "\$f" in
2818 /*)
2819 $targetmkdir \`dirname \$f\`
2820 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2821 ;;
2822 *)
2823 $targetmkdir $targetdir/\`dirname \$f\`
2824 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2825 ;;
2826 esac
2827done
2828exit 0
2829EOF
2830 ;;
2831 cp) cat >$to <<EOF
2832#!/bin/sh
2833for f in \$@
2834do
2835 case "\$f" in
2836 /*)
2837 $mkdir -p $targetdir/\`dirname \$f\`
2838 $cp \$f $targetdir/\$f || exit 1
2839 ;;
2840 *)
2841 $targetmkdir $targetdir/\`dirname \$f\`
2842 $cp \$f $targetdir/\$f || exit 1
2843 ;;
2844 esac
2845done
2846exit 0
2847EOF
2848 ;;
2849 *) echo "Unknown targetto '$targetto'" >&4
2850 exit 1
2851 ;;
2852 esac
2853 case "$targetfrom" in
2854 scp|rcp)
2855 cat >$from <<EOF
2856#!/bin/sh
2857for f in \$@
2858do
2859 $rm -f \$f
2860 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2861done
2862exit 0
2863EOF
2864 ;;
2865 cp) cat >$from <<EOF
2866#!/bin/sh
2867for f in \$@
2868do
2869 $rm -f \$f
2870 cp $targetdir/\$f . || exit 1
2871done
2872exit 0
2873EOF
2874 ;;
2875 *) echo "Unknown targetfrom '$targetfrom'" >&4
2876 exit 1
2877 ;;
2878 esac
2879 if $test ! -f $run; then
2880 echo "Target 'run' script '$run' not found." >&4
2881 else
2882 $chmod a+rx $run
2883 fi
2884 if $test ! -f $to; then
2885 echo "Target 'to' script '$to' not found." >&4
2886 else
2887 $chmod a+rx $to
2888 fi
2889 if $test ! -f $from; then
2890 echo "Target 'from' script '$from' not found." >&4
2891 else
2892 $chmod a+rx $from
2893 fi
2894 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2895 exit 1
2896 fi
2897 cat >&4 <<EOF
2898Using '$run' for remote execution,
2899and '$from' and '$to'
2900for remote file transfer.
2901EOF
2902 ;;
2903*) run=''
2904 to=:
2905 from=:
2906 usecrosscompile='undef'
2907 targetarch=''
2908 ;;
2909esac
2910
2911: see whether [:lower:] and [:upper:] are supported character classes
2912echo " "
2913case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2914ABYZ)
2915 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2916 up='[:upper:]'
2917 low='[:lower:]'
2918 ;;
2919*) # There is a discontinuity in EBCDIC between 'R' and 'S'
2920 # (0xd9 and 0xe2), therefore that is a nice testing point.
2921 if test "X$up" = X -o "X$low" = X; then
2922 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2923 rs) up='[A-Z]'
2924 low='[a-z]'
2925 ;;
2926 esac
2927 fi
2928 if test "X$up" = X -o "X$low" = X; then
2929 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2930 rs) up='A-Z'
2931 low='a-z'
2932 ;;
2933 esac
2934 fi
2935 if test "X$up" = X -o "X$low" = X; then
2936 case "`echo RS | od -x 2>/dev/null`" in
2937 *D9E2*|*d9e2*)
2938 echo "Hey, this might be EBCDIC." >&4
2939 if test "X$up" = X -o "X$low" = X; then
2940 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2941 rs) up='[A-IJ-RS-Z]'
2942 low='[a-ij-rs-z]'
2943 ;;
2944 esac
2945 fi
2946 if test "X$up" = X -o "X$low" = X; then
2947 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2948 rs) up='A-IJ-RS-Z'
2949 low='a-ij-rs-z'
2950 ;;
2951 esac
2952 fi
2953 ;;
2954 esac
2955 fi
2956esac
2957case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2958rs)
2959 echo "Using $up and $low to convert case." >&4
2960 ;;
2961*)
2962 echo "I don't know how to translate letters from upper to lower case." >&4
2963 echo "Your tr is not acting any way I know of." >&4
2964 exit 1
2965 ;;
2966esac
2967: set up the translation script tr, must be called with ./tr of course
2968cat >tr <<EOSC
2969$startsh
2970case "\$1\$2" in
2971'[A-Z][a-z]') exec $tr '$up' '$low';;
2972'[a-z][A-Z]') exec $tr '$low' '$up';;
2973esac
2974exec $tr "\$@"
2975EOSC
2976chmod +x tr
2977$eunicefix tr
2978
2979: Try to determine whether config.sh was made on this system
2980case "$config_sh" in
2981'')
2982myuname=`$uname -a 2>/dev/null`
2983$test -z "$myuname" && myuname=`hostname 2>/dev/null`
2984# tr '[A-Z]' '[a-z]' would not work in EBCDIC
2985# because the A-Z/a-z are not consecutive.
2986myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2987 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2988newmyuname="$myuname"
2989dflt=n
2990case "$knowitall" in
2991'')
2992 if test -f ../config.sh; then
2993 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2994 eval "`grep myuname= ../config.sh`"
2995 fi
2996 if test "X$myuname" = "X$newmyuname"; then
2997 dflt=y
2998 fi
2999 fi
3000 ;;
3001*) dflt=y;;
3002esac
3003
3004: Get old answers from old config file if Configure was run on the
3005: same system, otherwise use the hints.
3006hint=default
3007cd ..
3008if test -f config.sh; then
3009 echo " "
3010 rp="I see a config.sh file. Shall I use it to set the defaults?"
3011 . UU/myread
3012 case "$ans" in
3013 n*|N*) echo "OK, I'll ignore it."
3014 mv config.sh config.sh.old
3015 myuname="$newmyuname"
3016 ;;
3017 *) echo "Fetching default answers from your old config.sh file..." >&4
3018 tmp_n="$n"
3019 tmp_c="$c"
3020 tmp_sh="$sh"
3021 . ./config.sh
3022 cp config.sh UU
3023 n="$tmp_n"
3024 c="$tmp_c"
3025 : Older versions did not always set $sh. Catch re-use of such
3026 : an old config.sh.
3027 case "$sh" in
3028 '') sh="$tmp_sh" ;;
3029 esac
3030 hint=previous
3031 ;;
3032 esac
3033fi
3034. ./UU/checkcc
3035if test ! -f config.sh; then
3036 $cat <<EOM
3037
3038First time through, eh? I have some defaults handy for some systems
3039that need some extra help getting the Configure answers right:
3040
3041EOM
3042 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3043 dflt=''
3044 : Half the following guesses are probably wrong... If you have better
3045 : tests or hints, please send them to perlbug@perl.org
3046 : The metaconfig authors would also appreciate a copy...
3047 $test -f /irix && osname=irix
3048 $test -f /xenix && osname=sco_xenix
3049 $test -f /dynix && osname=dynix
3050 $test -f /dnix && osname=dnix
3051 $test -f /lynx.os && osname=lynxos
3052 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3053 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3054 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3055 $test -f /bin/mips && /bin/mips && osname=mips
3056 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3057 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3058 $test -d /usr/apollo/bin && osname=apollo
3059 $test -f /etc/saf/_sactab && osname=svr4
3060 $test -d /usr/include/minix && osname=minix
3061 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3062 if $test -d /MachTen -o -d /MachTen_Folder; then
3063 osname=machten
3064 if $test -x /sbin/version; then
3065 osvers=`/sbin/version | $awk '{print $2}' |
3066 $sed -e 's/[A-Za-z]$//'`
3067 elif $test -x /usr/etc/version; then
3068 osvers=`/usr/etc/version | $awk '{print $2}' |
3069 $sed -e 's/[A-Za-z]$//'`
3070 else
3071 osvers="$2.$3"
3072 fi
3073 fi
3074
3075 $test -f /sys/posix.dll &&
3076 $test -f /usr/bin/what &&
3077 set X `/usr/bin/what /sys/posix.dll` &&
3078 $test "$3" = UWIN &&
3079 osname=uwin &&
3080 osvers="$5"
3081
3082 if $test -f $uname; then
3083 set X $myuname
3084 shift
3085
3086 case "$5" in
3087 fps*) osname=fps ;;
3088 mips*)
3089 case "$4" in
3090 umips) osname=umips ;;
3091 *) osname=mips ;;
3092 esac;;
3093 [23]100) osname=mips ;;
3094 next*) osname=next ;;
3095 i386*)
3096 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3097 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3098 osname='sco'
3099 osvers=$tmp
3100 elif $test -f /etc/kconfig; then
3101 osname=isc
3102 if test "$lns" = "$ln -s"; then
3103 osvers=4
3104 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3105 osvers=3
3106 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3107 osvers=2
3108 fi
3109 fi
3110 tmp=''
3111 ;;
3112 pc*)
3113 if test -n "$DJGPP"; then
3114 osname=dos
3115 osvers=djgpp
3116 fi
3117 ;;
3118 esac
3119
3120 case "$1" in
3121 aix) osname=aix
3122 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3123 case "$tmp" in
3124 # oslevel can fail with:
3125 # oslevel: Unable to acquire lock.
3126 *not\ found) osvers="$4"."$3" ;;
3127 '<3240'|'<>3240') osvers=3.2.0 ;;
3128 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3129 '=3250'|'>3250') osvers=3.2.5 ;;
3130 *) osvers=$tmp;;
3131 esac
3132 ;;
3133 bsd386) osname=bsd386
3134 osvers=`$uname -r`
3135 ;;
3136 cygwin*) osname=cygwin
3137 osvers="$3"
3138 ;;
3139 *dc.osx) osname=dcosx
3140 osvers="$3"
3141 ;;
3142 dnix) osname=dnix
3143 osvers="$3"
3144 ;;
3145 domainos) osname=apollo
3146 osvers="$3"
3147 ;;
3148 dgux) osname=dgux
3149 osvers="$3"
3150 ;;
3151 dragonfly) osname=dragonfly
3152 osvers="$3"
3153 ;;
3154 dynixptx*) osname=dynixptx
3155 osvers=`echo "$4"|sed 's/^v//'`
3156 ;;
3157 freebsd) osname=freebsd
3158 osvers="$3" ;;
3159 genix) osname=genix ;;
3160 gnu) osname=gnu
3161 osvers="$3" ;;
3162 hp*) osname=hpux
3163 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3164 ;;
3165 irix*) osname=irix
3166 case "$3" in
3167 4*) osvers=4 ;;
3168 5*) osvers=5 ;;
3169 *) osvers="$3" ;;
3170 esac
3171 ;;
3172 linux) osname=linux
3173 case "$3" in
3174 *) osvers="$3" ;;
3175 esac
3176 ;;
3177 MiNT) osname=mint
3178 ;;
3179 netbsd*) osname=netbsd
3180 osvers="$3"
3181 ;;
3182 news-os) osvers="$3"
3183 case "$3" in
3184 4*) osname=newsos4 ;;
3185 *) osname=newsos ;;
3186 esac
3187 ;;
3188 next*) osname=next ;;
3189 nonstop-ux) osname=nonstopux ;;
3190 openbsd) osname=openbsd
3191 osvers="$3"
3192 ;;
3193 os2) osname=os2
3194 osvers="$4"
3195 ;;
3196 POSIX-BC | posix-bc ) osname=posix-bc
3197 osvers="$3"
3198 ;;
3199 powerux | power_ux | powermax_os | powermaxos | \
3200 powerunix | power_unix) osname=powerux
3201 osvers="$3"
3202 ;;
3203 qnx) osname=qnx
3204 osvers="$4"
3205 ;;
3206 solaris) osname=solaris
3207 case "$3" in
3208 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3209 *) osvers="$3" ;;
3210 esac
3211 ;;
3212 sunos) osname=sunos
3213 case "$3" in
3214 5*) osname=solaris
3215 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3216 *) osvers="$3" ;;
3217 esac
3218 ;;
3219 titanos) osname=titanos
3220 case "$3" in
3221 1*) osvers=1 ;;
3222 2*) osvers=2 ;;
3223 3*) osvers=3 ;;
3224 4*) osvers=4 ;;
3225 *) osvers="$3" ;;
3226 esac
3227 ;;
3228 ultrix) osname=ultrix
3229 osvers="$3"
3230 ;;
3231 osf1|mls+) case "$5" in
3232 alpha)
3233 osname=dec_osf
3234 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3235 case "$osvers" in
3236 [1-9].[0-9]*) ;;
3237 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3238 esac
3239 ;;
3240 hp*) osname=hp_osf1 ;;
3241 mips) osname=mips_osf1 ;;
3242 esac
3243 ;;
3244 # UnixWare 7.1.2 is known as Open UNIX 8
3245 openunix|unixware) osname=svr5
3246 osvers="$4"
3247 ;;
3248 uts) osname=uts
3249 osvers="$3"
3250 ;;
3251 vos) osvers="$3"
3252 ;;
3253 $2) case "$osname" in
3254 *isc*) ;;
3255 *freebsd*) ;;
3256 svr*)
3257 : svr4.x or possibly later
3258 case "svr$3" in
3259 ${osname}*)
3260 osname=svr$3
3261 osvers=$4
3262 ;;
3263 esac
3264 case "$osname" in
3265 svr4.0)
3266 : Check for ESIX
3267 if test -f /stand/boot ; then
3268 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3269 if test -n "$INITPROG" -a -f "$INITPROG"; then
3270 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3271 if test -n "$isesix"; then
3272 osname=esix4
3273 fi
3274 fi
3275 fi
3276 ;;
3277 esac
3278 ;;
3279 *) if test -f /etc/systemid; then
3280 osname=sco
3281 set `echo $3 | $sed 's/\./ /g'` $4
3282 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3283 osvers=$1.$2.$3
3284 elif $test -f $src/hints/sco_$1_$2.sh; then
3285 osvers=$1.$2
3286 elif $test -f $src/hints/sco_$1.sh; then
3287 osvers=$1
3288 fi
3289 else
3290 case "$osname" in
3291 '') : Still unknown. Probably a generic Sys V.
3292 osname="sysv"
3293 osvers="$3"
3294 ;;
3295 esac
3296 fi
3297 ;;
3298 esac
3299 ;;
3300 *) case "$osname" in
3301 '') : Still unknown. Probably a generic BSD.
3302 osname="$1"
3303 osvers="$3"
3304 ;;
3305 esac
3306 ;;
3307 esac
3308 else
3309 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3310 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3311 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3312 osname=news_os
3313 fi
3314 $rm -f UU/kernel.what
3315 elif test -d c:/. -o -n "$is_os2" ; then
3316 set X $myuname
3317 osname=os2
3318 osvers="$5"
3319 fi
3320 fi
3321
3322 case "$targetarch" in
3323 '') ;;
3324 *) hostarch=$osname
3325 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3326 osvers=''
3327 ;;
3328 esac
3329
3330 : Now look for a hint file osname_osvers, unless one has been
3331 : specified already.
3332 case "$hintfile" in
3333 ''|' ')
3334 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3335 : Also try without trailing minor version numbers.
3336 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3337 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3338 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3339 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3340 case "$file" in
3341 '') dflt=none ;;
3342 *) case "$osvers" in
3343 '') dflt=$file
3344 ;;
3345 *) if $test -f $src/hints/$file.sh ; then
3346 dflt=$file
3347 elif $test -f $src/hints/$xfile.sh ; then
3348 dflt=$xfile
3349 elif $test -f $src/hints/$xxfile.sh ; then
3350 dflt=$xxfile
3351 elif $test -f $src/hints/$xxxfile.sh ; then
3352 dflt=$xxxfile
3353 elif $test -f $src/hints/$xxxxfile.sh ; then
3354 dflt=$xxxxfile
3355 elif $test -f "$src/hints/${osname}.sh" ; then
3356 dflt="${osname}"
3357 else
3358 dflt=none
3359 fi
3360 ;;
3361 esac
3362 ;;
3363 esac
3364 if $test -f Policy.sh ; then
3365 case "$dflt" in
3366 *Policy*) ;;
3367 none) dflt="Policy" ;;
3368 *) dflt="Policy $dflt" ;;
3369 esac
3370 fi
3371 ;;
3372 *)
3373 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3374 ;;
3375 esac
3376
3377 if $test -f Policy.sh ; then
3378 $cat <<EOM
3379
3380There's also a Policy hint file available, which should make the
3381site-specific (policy) questions easier to answer.
3382EOM
3383
3384 fi
3385
3386 $cat <<EOM
3387
3388You may give one or more space-separated answers, or "none" if appropriate.
3389If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
3390previous run of Configure, you may specify it as well as or instead of
3391OS-specific hints. If hints are provided for your OS, you should use them:
3392although Perl can probably be built without hints on many platforms, using
3393hints often improve performance and may enable features that Configure can't
3394set up on its own. If there are no hints that match your OS, specify "none";
3395DO NOT give a wrong version or a wrong OS.
3396
3397EOM
3398
3399 rp="Which of these apply, if any?"
3400 . UU/myread
3401 tans=$ans
3402 for file in $tans; do
3403 if $test X$file = XPolicy -a -f Policy.sh; then
3404 . Policy.sh
3405 $cat Policy.sh >> UU/config.sh
3406 elif $test -f $src/hints/$file.sh; then
3407 . $src/hints/$file.sh
3408 $cat $src/hints/$file.sh >> UU/config.sh
3409 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3410 : nothing
3411 else
3412 : Give one chance to correct a possible typo.
3413 echo "$file.sh does not exist"
3414 dflt=$file
3415 rp="hint to use instead?"
3416 . UU/myread
3417 for file in $ans; do
3418 if $test -f "$src/hints/$file.sh"; then
3419 . $src/hints/$file.sh
3420 $cat $src/hints/$file.sh >> UU/config.sh
3421 elif $test X$ans = X -o X$ans = Xnone ; then
3422 : nothing
3423 else
3424 echo "$file.sh does not exist -- ignored."
3425 fi
3426 done
3427 fi
3428 done
3429
3430 hint=recommended
3431 : Remember our hint file for later.
3432 if $test -f "$src/hints/$file.sh" ; then
3433 hintfile="$file"
3434 else
3435 hintfile=''
3436 fi
3437fi
3438cd UU
3439;;
3440*)
3441 echo " "
3442 echo "Fetching default answers from $config_sh..." >&4
3443 tmp_n="$n"
3444 tmp_c="$c"
3445 cd ..
3446 cp $config_sh config.sh 2>/dev/null
3447 chmod +w config.sh
3448 . ./config.sh
3449 cd UU
3450 cp ../config.sh .
3451 n="$tmp_n"
3452 c="$tmp_c"
3453 hint=previous
3454 ;;
3455esac
3456test "$override" && . ./optdef.sh
3457
3458: Restore computed paths
3459for file in $loclist $trylist; do
3460 eval $file="\$_$file"
3461done
3462
3463cat << EOM
3464
3465Configure uses the operating system name and version to set some defaults.
3466The default value is probably right if the name rings a bell. Otherwise,
3467since spelling matters for me, either accept the default or answer "none"
3468to leave it blank.
3469
3470EOM
3471case "$osname" in
3472 ''|' ')
3473 case "$hintfile" in
3474 ''|' '|none) dflt=none ;;
3475 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3476 esac
3477 ;;
3478 *) dflt="$osname" ;;
3479esac
3480rp="Operating system name?"
3481. ./myread
3482case "$ans" in
3483none) osname='' ;;
3484*) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3485esac
3486echo " "
3487case "$osvers" in
3488 ''|' ')
3489 case "$hintfile" in
3490 ''|' '|none) dflt=none ;;
3491 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3492 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3493 case "$dflt" in
3494 ''|' ') dflt=none ;;
3495 esac
3496 ;;
3497 esac
3498 ;;
3499 *) dflt="$osvers" ;;
3500esac
3501rp="Operating system version?"
3502. ./myread
3503case "$ans" in
3504none) osvers='' ;;
3505*) osvers="$ans" ;;
3506esac
3507
3508
3509. ./posthint.sh
3510
3511: who configured the system
3512cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3513case "$cf_by" in
3514"")
3515 cf_by=`(logname) 2>/dev/null`
3516 case "$cf_by" in
3517 "")
3518 cf_by=`(whoami) 2>/dev/null`
3519 case "$cf_by" in
3520 "") cf_by=unknown ;;
3521 esac ;;
3522 esac ;;
3523esac
3524
3525: decide how portable to be. Allow command line overrides.
3526case "$d_portable" in
3527"$undef") ;;
3528*) d_portable="$define" ;;
3529esac
3530
3531: set up shell script to do ~ expansion
3532cat >filexp <<EOSS
3533$startsh
3534: expand filename
3535case "\$1" in
3536 ~/*|~)
3537 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3538 ;;
3539 ~*)
3540 if $test -f /bin/csh; then
3541 /bin/csh -f -c "glob \$1"
3542 failed=\$?
3543 echo ""
3544 exit \$failed
3545 else
3546 name=\`$expr x\$1 : '..\([^/]*\)'\`
3547 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3548 if $test ! -d "\$dir"; then
3549 me=\`basename \$0\`
3550 echo "\$me: can't locate home directory for: \$name" >&2
3551 exit 1
3552 fi
3553 case "\$1" in
3554 */*)
3555 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3556 ;;
3557 *)
3558 echo \$dir
3559 ;;
3560 esac
3561 fi
3562 ;;
3563*)
3564 echo \$1
3565 ;;
3566esac
3567EOSS
3568chmod +x filexp
3569$eunicefix filexp
3570
3571: now set up to get a file name
3572cat <<EOS >getfile
3573$startsh
3574EOS
3575cat <<'EOSC' >>getfile
3576tilde=''
3577fullpath=''
3578already=''
3579skip=''
3580none_ok=''
3581exp_file=''
3582nopath_ok=''
3583orig_rp="$rp"
3584orig_dflt="$dflt"
3585case "$gfpth" in
3586'') gfpth='.' ;;
3587esac
3588
3589case "$fn" in
3590*\(*)
3591 : getfile will accept an answer from the comma-separated list
3592 : enclosed in parentheses even if it does not meet other criteria.
3593 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3594 fn=`echo $fn | sed 's/(.*)//'`
3595 ;;
3596esac
3597
3598case "$fn" in
3599*:*)
3600 loc_file=`expr $fn : '.*:\(.*\)'`
3601 fn=`expr $fn : '\(.*\):.*'`
3602 ;;
3603esac
3604
3605case "$fn" in
3606*~*) tilde=true;;
3607esac
3608case "$fn" in
3609*/*) fullpath=true;;
3610esac
3611case "$fn" in
3612*+*) skip=true;;
3613esac
3614case "$fn" in
3615*n*) none_ok=true;;
3616esac
3617case "$fn" in
3618*e*) exp_file=true;;
3619esac
3620case "$fn" in
3621*p*) nopath_ok=true;;
3622esac
3623
3624case "$fn" in
3625*f*) type='File';;
3626*d*) type='Directory';;
3627*l*) type='Locate';;
3628esac
3629
3630what="$type"
3631case "$what" in
3632Locate) what='File';;
3633esac
3634
3635case "$exp_file" in
3636'')
3637 case "$d_portable" in
3638 "$define") ;;
3639 *) exp_file=true;;
3640 esac
3641 ;;
3642esac
3643
3644cd ..
3645while test "$type"; do
3646 redo=''
3647 rp="$orig_rp"
3648 dflt="$orig_dflt"
3649 case "$tilde" in
3650 true) rp="$rp (~name ok)";;
3651 esac
3652 . UU/myread
3653 if test -f UU/getfile.ok && \
3654 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3655 then
3656 value="$ans"
3657 ansexp="$ans"
3658 break
3659 fi
3660 case "$ans" in
3661 none)
3662 value=''
3663 ansexp=''
3664 case "$none_ok" in
3665 true) type='';;
3666 esac
3667 ;;
3668 *)
3669 case "$tilde" in
3670 '') value="$ans"
3671 ansexp="$ans";;
3672 *)
3673 value=`UU/filexp $ans`
3674 case $? in
3675 0)
3676 if test "$ans" != "$value"; then
3677 echo "(That expands to $value on this system.)"
3678 fi
3679 ;;
3680 *) value="$ans";;
3681 esac
3682 ansexp="$value"
3683 case "$exp_file" in
3684 '') value="$ans";;
3685 esac
3686 ;;
3687 esac
3688 case "$fullpath" in
3689 true)
3690 case "$ansexp" in
3691 /*) value="$ansexp" ;;
3692 [a-zA-Z]:/*) value="$ansexp" ;;
3693 *)
3694 redo=true
3695 case "$already" in
3696 true)
3697 echo "I shall only accept a full path name, as in /bin/ls." >&4
3698 echo "Use a ! shell escape if you wish to check pathnames." >&4
3699 ;;
3700 *)
3701 echo "Please give a full path name, starting with slash." >&4
3702 case "$tilde" in
3703 true)
3704 echo "Note that using ~name is ok provided it expands well." >&4
3705 already=true
3706 ;;
3707 esac
3708 esac
3709 ;;
3710 esac
3711 ;;
3712 esac
3713 case "$redo" in
3714 '')
3715 case "$type" in
3716 File)
3717 for fp in $gfpth; do
3718 if test "X$fp" = X.; then
3719 pf="$ansexp"
3720 else
3721 pf="$fp/$ansexp"
3722 fi
3723 if test -f "$pf"; then
3724 type=''
3725 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3726 then
3727 echo "($value is not a plain file, but that's ok.)"
3728 type=''
3729 fi
3730 if test X"$type" = X; then
3731 value="$pf"
3732 break
3733 fi
3734 done
3735 ;;
3736 Directory)
3737 for fp in $gfpth; do
3738 if test "X$fp" = X.; then
3739 dir="$ans"
3740 direxp="$ansexp"
3741 else
3742 dir="$fp/$ansexp"
3743 direxp="$fp/$ansexp"
3744 fi
3745 if test -d "$direxp"; then
3746 type=''
3747 value="$dir"
3748 break
3749 fi
3750 done
3751 ;;
3752 Locate)
3753 if test -d "$ansexp"; then
3754 echo "(Looking for $loc_file in directory $value.)"
3755 value="$value/$loc_file"
3756 ansexp="$ansexp/$loc_file"
3757 fi
3758 if test -f "$ansexp"; then
3759 type=''
3760 fi
3761 case "$nopath_ok" in
3762 true) case "$value" in
3763 */*) ;;
3764 *) echo "Assuming $value will be in people's path."
3765 type=''
3766 ;;
3767 esac
3768 ;;
3769 esac
3770 ;;
3771 esac
3772
3773 case "$skip" in
3774 true) type='';
3775 esac
3776
3777 case "$type" in
3778 '') ;;
3779 *)
3780 if test "$fastread" = yes; then
3781 dflt=y
3782 else
3783 dflt=n
3784 fi
3785 rp="$what $value doesn't exist. Use that name anyway?"
3786 . UU/myread
3787 dflt=''
3788 case "$ans" in
3789 y*) type='';;
3790 *) echo " ";;
3791 esac
3792 ;;
3793 esac
3794 ;;
3795 esac
3796 ;;
3797 esac
3798done
3799cd UU
3800ans="$value"
3801rp="$orig_rp"
3802dflt="$orig_dflt"
3803rm -f getfile.ok
3804test "X$gfpthkeep" != Xy && gfpth=""
3805EOSC
3806
3807: determine root of directory hierarchy where package will be installed.
3808case "$prefix" in
3809'')
3810 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
3811 ;;
3812*?/)
3813 dflt=`echo "$prefix" | sed 's/.$//'`
3814 ;;
3815*)
3816 dflt="$prefix"
3817 ;;
3818esac
3819$cat <<EOM
3820
3821By default, $package will be installed in $dflt/bin, manual pages
3822under $dflt/man, etc..., i.e. with $dflt as prefix for all
3823installation directories. Typically this is something like /usr/local.
3824If you wish to have binaries under /usr/bin but other parts of the
3825installation under /usr/local, that's ok: you will be prompted
3826separately for each of the installation directories, the prefix being
3827only used to set the defaults.
3828
3829EOM
3830fn=d~
3831rp='Installation prefix to use?'
3832. ./getfile
3833oldprefix=''
3834case "$prefix" in
3835'') ;;
3836*)
3837 case "$ans" in
3838 "$prefix") ;;
3839 *) oldprefix="$prefix";;
3840 esac
3841 ;;
3842esac
3843prefix="$ans"
3844prefixexp="$ansexp"
3845
3846case "$afsroot" in
3847'') afsroot=/afs ;;
3848*) afsroot=$afsroot ;;
3849esac
3850
3851: is AFS running?
3852echo " "
3853case "$afs" in
3854$define|true) afs=true ;;
3855$undef|false) afs=false ;;
3856*) if test -d $afsroot; then
3857 afs=true
3858 else
3859 afs=false
3860 fi
3861 ;;
3862esac
3863if $afs; then
3864 echo "AFS may be running... I'll be extra cautious then..." >&4
3865else
3866 echo "AFS does not seem to be running..." >&4
3867fi
3868
3869: determine installation prefix for where package is to be installed.
3870if $afs; then
3871$cat <<EOM
3872
3873Since you are running AFS, I need to distinguish the directory in which
3874files will reside from the directory in which they are installed (and from
3875which they are presumably copied to the former directory by occult means).
3876
3877EOM
3878 case "$installprefix" in
3879 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
3880 *) dflt="$installprefix";;
3881 esac
3882else
3883$cat <<EOM
3884
3885In some special cases, particularly when building $package for distribution,
3886it is convenient to distinguish the directory in which files should be
3887installed from the directory ($prefix) in which they will
3888eventually reside. For most users, these two directories are the same.
3889
3890EOM
3891 case "$installprefix" in
3892 '') dflt=$prefix ;;
3893 *) dflt=$installprefix;;
3894 esac
3895fi
3896fn=d~
3897rp='What installation prefix should I use for installing files?'
3898. ./getfile
3899installprefix="$ans"
3900installprefixexp="$ansexp"
3901
3902: Perform the prefixexp/installprefixexp correction if necessary
3903cat <<EOS >installprefix
3904$startsh
3905EOS
3906cat <<'EOSC' >>installprefix
3907: Change installation prefix, if necessary.
3908if $test X"$prefix" != X"$installprefix"; then
3909 eval "install${prefixvar}=\`echo \$${prefixvar}exp | sed \"s#^\$prefixexp#\$installprefixexp#\"\`"
3910else
3911 eval "install${prefixvar}=\"\$${prefixvar}exp\""
3912fi
3913EOSC
3914chmod +x installprefix
3915$eunicefix installprefix
3916
3917: Set variables such as privlib and privlibexp from the output of ./getfile
3918: performing the prefixexp/installprefixexp correction if necessary.
3919cat <<EOS >setprefixvar
3920$startsh
3921EOS
3922cat <<'EOSC' >>setprefixvar
3923eval "${prefixvar}=\"\$ans\""
3924eval "${prefixvar}exp=\"\$ansexp\""
3925. ./installprefix
3926EOSC
3927chmod +x setprefixvar
3928$eunicefix setprefixvar
3929
3930: set up the script used to warn in case of inconsistency
3931cat <<EOS >whoa
3932$startsh
3933EOS
3934cat <<'EOSC' >>whoa
3935dflt=y
3936echo " "
3937echo "*** WHOA THERE!!! ***" >&4
3938echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3939rp=" Keep the $hint value?"
3940. ./myread
3941case "$ans" in
3942y) td=$was; tu=$was;;
3943esac
3944EOSC
3945
3946: function used to set $1 to $val
3947setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3948case "$val$was" in
3949$define$undef) . ./whoa; eval "$var=\$td";;
3950$undef$define) . ./whoa; eval "$var=\$tu";;
3951*) eval "$var=$val";;
3952esac'
3953
3954case "$usesocks" in
3955$define|true|[yY]*) dflt='y';;
3956*) dflt='n';;
3957esac
3958cat <<EOM
3959
3960Perl can be built to use the SOCKS proxy protocol library. To do so,
3961Configure must be run with -Dusesocks. If you use SOCKS you also need
3962to use the PerlIO abstraction layer, this will be implicitly selected.
3963
3964If this doesn't make any sense to you, just accept the default '$dflt'.
3965EOM
3966rp='Build Perl for SOCKS?'
3967. ./myread
3968case "$ans" in
3969y|Y) val="$define" ;;
3970*) val="$undef" ;;
3971esac
3972set usesocks
3973eval $setvar
3974
3975case "$usesocks" in
3976$define|true|[yY]*) useperlio="$define";;
3977esac
3978
3979case "$useperlio" in
3980$define|true|[yY]*|'') dflt='y';;
3981*) dflt='n';;
3982esac
3983cat <<EOM
3984
3985Previous version of $package used the standard IO mechanisms as
3986defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3987alternate IO mechanisms via the PerlIO abstraction layer, but the
3988stdio mechanism is still available if needed. The abstraction layer
3989can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3990Using PerlIO with sfio may cause problems with some extension modules.
3991
3992If this doesn't make any sense to you, just accept the default '$dflt'.
3993EOM
3994rp='Use the PerlIO abstraction layer?'
3995. ./myread
3996case "$ans" in
3997y|Y)
3998 val="$define"
3999 ;;
4000*)
4001 echo "Ok, doing things the stdio way."
4002 val="$undef"
4003 ;;
4004esac
4005set useperlio
4006eval $setvar
4007
4008case "$usesocks" in
4009$define|true|[yY]*)
4010 case "$useperlio" in
4011 $define|true|[yY]*) ;;
4012 *) cat >&4 <<EOM
4013
4014You are using the SOCKS proxy protocol library which means that you
4015should also use the PerlIO layer. You may be headed for trouble.
4016
4017EOM
4018 ;;
4019 esac
4020 ;;
4021esac
4022
4023
4024case "$usethreads" in
4025$define|true|[yY]*) dflt='y';;
4026*) # Catch case where user specified ithreads or 5005threads but
4027 # forgot -Dusethreads (A.D. 4/2002)
4028 case "$useithreads$use5005threads" in
4029 *$define*)
4030 case "$useperlio" in
4031 "$define") dflt='y' ;;
4032 *) dflt='n' ;;
4033 esac
4034 ;;
4035 *) dflt='n';;
4036 esac
4037 ;;
4038esac
4039cat <<EOM
4040
4041Perl can be built to take advantage of threads on some systems.
4042To do so, Configure can be run with -Dusethreads.
4043
4044Note that Perl built with threading support runs slightly slower
4045and uses more memory than plain Perl. The current implementation
4046is believed to be stable, but it is fairly new, and so should be
4047treated with caution.
4048
4049If this doesn't make any sense to you, just accept the default '$dflt'.
4050EOM
4051rp='Build a threading Perl?'
4052. ./myread
4053case "$ans" in
4054y|Y) val="$define" ;;
4055*) val="$undef" ;;
4056esac
4057set usethreads
4058eval $setvar
4059
4060case "$usethreads" in
4061$define)
4062 $cat <<EOM
4063
4064Since release 5.6, Perl has had two different threading implementations,
4065the newer interpreter-based version (ithreads) with one interpreter per
4066thread, and the older 5.005 version (5005threads).
4067The 5005threads version is effectively unmaintained and will probably be
4068removed in Perl 5.10, so there should be no need to build a Perl using it
4069unless needed for backwards compatibility with some existing 5.005threads
4070code.
4071
4072EOM
4073 : Default to ithreads unless overridden on command line or with
4074 : old config.sh
4075 dflt='y'
4076 case "$use5005threads" in
4077 $define|true|[yY]*) dflt='n';;
4078 esac
4079 case "$useithreads" in
4080 $undef|false|[nN]*) dflt='n';;
4081 esac
4082 rp='Use the newer interpreter-based ithreads?'
4083 . ./myread
4084 case "$ans" in
4085 y|Y) val="$define" ;;
4086 *) val="$undef" ;;
4087 esac
4088 set useithreads
4089 eval $setvar
4090 : Now set use5005threads to the opposite value.
4091 case "$useithreads" in
4092 $define) val="$undef" ;;
4093 *) val="$define" ;;
4094 esac
4095 set use5005threads
4096 eval $setvar
4097 ;;
4098*)
4099 useithreads="$undef"
4100 use5005threads="$undef"
4101 ;;
4102esac
4103
4104case "$useithreads$use5005threads" in
4105"$define$define")
4106 $cat >&4 <<EOM
4107
4108You cannot have both the ithreads and the 5.005 threads enabled
4109at the same time. Disabling the 5.005 threads since they are
4110much less stable than the ithreads.
4111
4112EOM
4113 use5005threads="$undef"
4114 ;;
4115esac
4116
4117if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
4118 cat >&4 <<EOF
4119***
4120*** To build with ithreads you must also use the PerlIO layer.
4121*** Cannot continue, aborting.
4122***
4123EOF
4124 exit 1
4125fi
4126
4127case "$d_oldpthreads" in
4128'') : Configure tests would be welcome here. For now, assume undef.
4129 val="$undef" ;;
4130*) val="$d_oldpthreads" ;;
4131esac
4132set d_oldpthreads
4133eval $setvar
4134
4135
4136: Look for a hint-file generated 'call-back-unit'. If the
4137: user has specified that a threading perl is to be built,
4138: we may need to set or change some other defaults.
4139if $test -f usethreads.cbu; then
4140 echo "Your platform has some specific hints regarding threaded builds, using them..."
4141 . ./usethreads.cbu
4142else
4143 case "$usethreads" in
4144 "$define"|true|[yY]*)
4145 $cat <<EOM
4146(Your platform does not have any specific hints for threaded builds.
4147 Assuming POSIX threads, then.)
4148EOM
4149 ;;
4150 esac
4151fi
4152
4153cat <<EOM
4154
4155Perl can be built so that multiple Perl interpreters can coexist
4156within the same Perl executable.
4157EOM
4158
4159case "$useithreads" in
4160$define)
4161 cat <<EOM
4162This multiple interpreter support is required for interpreter-based threads.
4163EOM
4164 val="$define"
4165 ;;
4166*) case "$usemultiplicity" in
4167 $define|true|[yY]*) dflt='y';;
4168 *) dflt='n';;
4169 esac
4170 echo " "
4171 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
4172 rp='Build Perl for multiplicity?'
4173 . ./myread
4174 case "$ans" in
4175 y|Y) val="$define" ;;
4176 *) val="$undef" ;;
4177 esac
4178 ;;
4179esac
4180set usemultiplicity
4181eval $setvar
4182
4183
4184case "$usemorebits" in
4185"$define"|true|[yY]*)
4186 use64bitint="$define"
4187 uselongdouble="$define"
4188 usemorebits="$define"
4189 ;;
4190*) usemorebits="$undef"
4191 ;;
4192esac
4193
4194: make some quick guesses about what we are up against
4195echo " "
4196$echo $n "Hmm... $c"
4197echo exit 1 >bsd
4198echo exit 1 >usg
4199echo exit 1 >v7
4200echo exit 1 >osf1
4201echo exit 1 >eunice
4202echo exit 1 >xenix
4203echo exit 1 >venix
4204echo exit 1 >os2
4205d_bsd="$undef"
4206$cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
4207if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
4208then
4209 echo "Looks kind of like an OSF/1 system, but we'll see..."
4210 echo exit 0 >osf1
4211elif test `echo abc | $tr a-z A-Z` = Abc ; then
4212 xxx=`./loc addbib blurfl $pth`
4213 if $test -f $xxx; then
4214 echo "Looks kind of like a USG system with BSD features, but we'll see..."
4215 echo exit 0 >bsd
4216 echo exit 0 >usg
4217 else
4218 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
4219 echo "Looks kind of like an extended USG system, but we'll see..."
4220 else
4221 echo "Looks kind of like a USG system, but we'll see..."
4222 fi
4223 echo exit 0 >usg
4224 fi
4225elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
4226 echo "Looks kind of like a BSD system, but we'll see..."
4227 d_bsd="$define"
4228 echo exit 0 >bsd
4229else
4230 echo "Looks kind of like a Version 7 system, but we'll see..."
4231 echo exit 0 >v7
4232fi
4233case "$eunicefix" in
4234*unixtovms*)
4235 $cat <<'EOI'
4236There is, however, a strange, musty smell in the air that reminds me of
4237something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
4238EOI
4239 echo exit 0 >eunice
4240 d_eunice="$define"
4241: it so happens the Eunice I know will not run shell scripts in Unix format
4242 ;;
4243*)
4244 echo " "
4245 echo "Congratulations. You aren't running Eunice."
4246 d_eunice="$undef"
4247 ;;
4248esac
4249: Detect OS2. The p_ variable is set above in the Head.U unit.
4250: Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
4251: semicolon as a patch separator
4252case "$p_" in
4253:) ;;
4254*)
4255 $cat <<'EOI'
4256I have the feeling something is not exactly right, however...don't tell me...
4257lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
4258(Or you may be running DOS with DJGPP.)
4259EOI
4260 echo exit 0 >os2
4261 ;;
4262esac
4263if test -f /xenix; then
4264 echo "Actually, this looks more like a XENIX system..."
4265 echo exit 0 >xenix
4266 d_xenix="$define"
4267else
4268 echo " "
4269 echo "It's not Xenix..."
4270 d_xenix="$undef"
4271fi
4272chmod +x xenix
4273$eunicefix xenix
4274if test -f /venix; then
4275 echo "Actually, this looks more like a VENIX system..."
4276 echo exit 0 >venix
4277else
4278 echo " "
4279 if ./xenix; then
4280 : null
4281 else
4282 echo "Nor is it Venix..."
4283 fi
4284fi
4285chmod +x bsd usg v7 osf1 eunice xenix venix os2
4286$eunicefix bsd usg v7 osf1 eunice xenix venix os2
4287$rm -f foo
4288
4289case "$cc" in
4290'') dflt=cc;;
4291*) dflt="$cc";;
4292esac
4293rp="Use which C compiler?"
4294. ./myread
4295cc="$ans"
4296
4297: See if they have not cc but they do have gcc
4298. ./trygcc
4299: Look for a hint-file generated 'call-back-unit'. Now that the
4300: user has specified the compiler, we may need to set or change some
4301: other defaults.
4302if $test -f cc.cbu; then
4303 . ./cc.cbu
4304fi
4305. ./checkcc
4306
4307echo " "
4308echo "Checking for GNU cc in disguise and/or its version number..." >&4
4309$cat >try.c <<EOM
4310#include <stdio.h>
4311int main() {
4312#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
4313#ifdef __VERSION__
4314 printf("%s\n", __VERSION__);
4315#else
4316 printf("%s\n", "1");
4317#endif
4318#endif
4319 return(0);
4320}
4321EOM
4322if $cc -o try $ccflags $ldflags try.c; then
4323 gccversion=`$run ./try`
4324 case "$gccversion" in
4325 '') echo "You are not using GNU cc." ;;
4326 *) echo "You are using GNU cc $gccversion."
4327 ccname=gcc
4328 ;;
4329 esac
4330else
4331 echo " "
4332 echo "*** WHOA THERE!!! ***" >&4
4333 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
4334 case "$knowitall" in
4335 '')
4336 echo " You'd better start hunting for one and let me know about it." >&4
4337 exit 1
4338 ;;
4339 esac
4340fi
4341$rm -f try try.*
4342case "$gccversion" in
43431*) cpp=`./loc gcc-cpp $cpp $pth` ;;
4344esac
4345case "$gccversion" in
4346'') gccosandvers='' ;;
4347*) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
4348 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
4349 gccshortvers=''
4350 case "$gccosandvers" in
4351 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
4352 $osname$osvers) ;; # looking good
4353 $osname*) cat <<EOM >&4
4354
4355*** WHOA THERE!!! ***
4356
4357 Your gcc has not been compiled for the exact release of
4358 your operating system ($gccosandvers versus $osname$osvers).
4359
4360 In general it is a good idea to keep gcc synchronized with
4361 the operating system because otherwise serious problems
4362 may ensue when trying to compile software, like Perl.
4363
4364 I'm trying to be optimistic here, though, and will continue.
4365 If later during the configuration and build icky compilation
4366 problems appear (headerfile conflicts being the most common
4367 manifestation), I suggest reinstalling the gcc to match
4368 your operating system release.
4369
4370EOM
4371 ;;
4372 *) gccosandvers='' ;; # failed to parse, better be silent
4373 esac
4374 ;;
4375esac
4376case "$ccname" in
4377'') ccname="$cc" ;;
4378esac
4379
4380# gcc 3.* complain about adding -Idirectories that they already know about,
4381# so we will take those off from locincpth.
4382case "$gccversion" in
43833*)
4384 echo "main(){}">try.c
4385 for incdir in $locincpth; do
4386 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
4387 grep '^c[cp]p*[01]: warning: changing search order '`
4388 if test "X$warn" != X; then
4389 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
4390 fi
4391 done
4392 $rm -f try try.*
4393esac
4394
4395: What should the include directory be ?
4396echo " "
4397$echo $n "Hmm... $c"
4398dflt='/usr/include'
4399incpath=''
4400mips_type=''
4401if $test -f /bin/mips && /bin/mips; then
4402 echo "Looks like a MIPS system..."
4403 $cat >usr.c <<'EOCP'
4404#ifdef SYSTYPE_BSD43
4405/bsd43
4406#endif
4407EOCP
4408 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4409 dflt='/bsd43/usr/include'
4410 incpath='/bsd43'
4411 mips_type='BSD 4.3'
4412 else
4413 mips_type='System V'
4414 fi
4415 $rm -f usr.c usr.out
4416 echo "and you're compiling with the $mips_type compiler and libraries."
4417 xxx_prompt=y
4418 echo "exit 0" >mips
4419else
4420 echo "Doesn't look like a MIPS system."
4421 xxx_prompt=n
4422 echo "exit 1" >mips
4423fi
4424chmod +x mips
4425$eunicefix mips
4426case "$usrinc" in
4427'') ;;
4428*) dflt="$usrinc";;
4429esac
4430case "$xxx_prompt" in
4431y) fn=d/
4432 echo " "
4433 rp='Where are the include files you want to use?'
4434 . ./getfile
4435 usrinc="$ans"
4436 ;;
4437*) usrinc="$dflt"
4438 ;;
4439esac
4440
4441: see how we invoke the C preprocessor
4442echo " "
4443echo "Now, how can we feed standard input to your C preprocessor..." >&4
4444cat <<'EOT' >testcpp.c
4445#define ABC abc
4446#define XYZ xyz
4447ABC.XYZ
4448EOT
4449cd ..
4450if test ! -f cppstdin; then
4451 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4452 # AIX cc -E doesn't show the absolute headerfile
4453 # locations but we'll cheat by using the -M flag.
4454 echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
4455 else
4456 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4457 fi
4458else
4459 echo "Keeping your $hint cppstdin wrapper."
4460fi
4461chmod 755 cppstdin
4462wrapper=`pwd`/cppstdin
4463ok='false'
4464cd UU
4465
4466if $test "X$cppstdin" != "X" && \
4467 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4468 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4469then
4470 echo "You used to use $cppstdin $cppminus so we'll use that again."
4471 case "$cpprun" in
4472 '') echo "But let's see if we can live without a wrapper..." ;;
4473 *)
4474 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4475 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4476 then
4477 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4478 ok='true'
4479 else
4480 echo "(However, $cpprun $cpplast does not work, let's see...)"
4481 fi
4482 ;;
4483 esac
4484else
4485 case "$cppstdin" in
4486 '') ;;
4487 *)
4488 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4489 ;;
4490 esac
4491fi
4492
4493if $ok; then
4494 : nothing
4495elif echo 'Maybe "'"$cc"' -E" will work...'; \
4496 $cc -E <testcpp.c >testcpp.out 2>&1; \
4497 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4498 echo "Yup, it does."
4499 x_cpp="$cc -E"
4500 x_minus='';
4501elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4502 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4503 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4504 echo "Yup, it does."
4505 x_cpp="$cc -E"
4506 x_minus='-';
4507elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4508 $cc -P <testcpp.c >testcpp.out 2>&1; \
4509 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4510 echo "Yipee, that works!"
4511 x_cpp="$cc -P"
4512 x_minus='';
4513elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4514 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4515 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4516 echo "At long last!"
4517 x_cpp="$cc -P"
4518 x_minus='-';
4519elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4520 $cpp <testcpp.c >testcpp.out 2>&1; \
4521 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4522 echo "It works!"
4523 x_cpp="$cpp"
4524 x_minus='';
4525elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4526 $cpp - <testcpp.c >testcpp.out 2>&1; \
4527 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4528 echo "Hooray, it works! I was beginning to wonder."
4529 x_cpp="$cpp"
4530 x_minus='-';
4531elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4532 $wrapper <testcpp.c >testcpp.out 2>&1; \
4533 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4534 x_cpp="$wrapper"
4535 x_minus=''
4536 echo "Eureka!"
4537else
4538 dflt=''
4539 rp="No dice. I can't find a C preprocessor. Name one:"
4540 . ./myread
4541 x_cpp="$ans"
4542 x_minus=''
4543 $x_cpp <testcpp.c >testcpp.out 2>&1
4544 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4545 echo "OK, that will do." >&4
4546 else
4547echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4548 exit 1
4549 fi
4550fi
4551
4552case "$ok" in
4553false)
4554 cppstdin="$x_cpp"
4555 cppminus="$x_minus"
4556 cpprun="$x_cpp"
4557 cpplast="$x_minus"
4558 set X $x_cpp
4559 shift
4560 case "$1" in
4561 "$cpp")
4562 echo "Perhaps can we force $cc -E using a wrapper..."
4563 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4564 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4565 then
4566 echo "Yup, we can."
4567 cppstdin="$wrapper"
4568 cppminus='';
4569 else
4570 echo "Nope, we'll have to live without it..."
4571 fi
4572 ;;
4573 esac
4574 case "$cpprun" in
4575 "$wrapper")
4576 cpprun=''
4577 cpplast=''
4578 ;;
4579 esac
4580 ;;
4581esac
4582
4583case "$cppstdin" in
4584"$wrapper"|'cppstdin') ;;
4585*) $rm -f $wrapper;;
4586esac
4587$rm -f testcpp.c testcpp.out
4588
4589: Set private lib path
4590case "$plibpth" in
4591'') if ./mips; then
4592 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4593 fi;;
4594esac
4595case "$libpth" in
4596' ') dlist='';;
4597'') dlist="$loclibpth $plibpth $glibpth";;
4598*) dlist="$libpth";;
4599esac
4600
4601: Now check and see which directories actually exist, avoiding duplicates
4602libpth=''
4603for xxx in $dlist
4604do
4605 if $test -d $xxx; then
4606 case " $libpth " in
4607 *" $xxx "*) ;;
4608 *) libpth="$libpth $xxx";;
4609 esac
4610 fi
4611done
4612$cat <<'EOM'
4613
4614Some systems have incompatible or broken versions of libraries. Among
4615the directories listed in the question below, please remove any you
4616know not to be holding relevant libraries, and add any that are needed.
4617Say "none" for none.
4618
4619EOM
4620case "$libpth" in
4621'') dflt='none';;
4622*)
4623 set X $libpth
4624 shift
4625 dflt=${1+"$@"}
4626 ;;
4627esac
4628rp="Directories to use for library searches?"
4629. ./myread
4630case "$ans" in
4631none) libpth=' ';;
4632*) libpth="$ans";;
4633esac
4634
4635: compute shared library extension
4636case "$so" in
4637'')
4638 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4639 dflt='sl'
4640 else
4641 dflt='so'
4642 fi
4643 ;;
4644*) dflt="$so";;
4645esac
4646$cat <<EOM
4647
4648On some systems, shared libraries may be available. Answer 'none' if
4649you want to suppress searching of shared libraries for the remainder
4650of this configuration.
4651
4652EOM
4653rp='What is the file extension used for shared libraries?'
4654. ./myread
4655so="$ans"
4656
4657: Define several unixisms.
4658: Hints files or command line option can be used to override them.
4659: The convoluted testing is in case hints files set either the old
4660: or the new name.
4661case "$_exe" in
4662'') case "$exe_ext" in
4663 '') ;;
4664 *) _exe="$exe_ext" ;;
4665 esac
4666 ;;
4667esac
4668case "$_a" in
4669'') case "$lib_ext" in
4670 '') _a='.a';;
4671 *) _a="$lib_ext" ;;
4672 esac
4673 ;;
4674esac
4675case "$_o" in
4676'') case "$obj_ext" in
4677 '') _o='.o';;
4678 *) _o="$obj_ext";;
4679 esac
4680 ;;
4681esac
4682case "$p_" in
4683'') case "$path_sep" in
4684 '') p_=':';;
4685 *) p_="$path_sep";;
4686 esac
4687 ;;
4688esac
4689exe_ext=$_exe
4690lib_ext=$_a
4691obj_ext=$_o
4692path_sep=$p_
4693
4694: Which makefile gets called first. This is used by make depend.
4695case "$firstmakefile" in
4696'') firstmakefile='makefile';;
4697esac
4698
4699case "$ccflags" in
4700*-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4701esac
4702
4703case "$uselongdouble" in
4704$define|true|[yY]*) dflt='y';;
4705*) dflt='n';;
4706esac
4707cat <<EOM
4708
4709Perl can be built to take advantage of long doubles which
4710(if available) may give more accuracy and range for floating point numbers.
4711
4712If this doesn't make any sense to you, just accept the default '$dflt'.
4713EOM
4714rp='Try to use long doubles if available?'
4715. ./myread
4716case "$ans" in
4717y|Y) val="$define" ;;
4718*) val="$undef" ;;
4719esac
4720set uselongdouble
4721eval $setvar
4722
4723case "$uselongdouble" in
4724true|[yY]*) uselongdouble="$define" ;;
4725esac
4726
4727: Look for a hint-file generated 'call-back-unit'. If the
4728: user has specified that long doubles should be used,
4729: we may need to set or change some other defaults.
4730if $test -f uselongdouble.cbu; then
4731 echo "Your platform has some specific hints regarding long doubles, using them..."
4732 . ./uselongdouble.cbu
4733else
4734 case "$uselongdouble" in
4735 $define)
4736 $cat <<EOM
4737(Your platform does not have any specific hints for long doubles.)
4738EOM
4739 ;;
4740 esac
4741fi
4742
4743: Looking for optional libraries
4744echo " "
4745echo "Checking for optional libraries..." >&4
4746case "$libs" in
4747' '|'') dflt='';;
4748*) dflt="$libs";;
4749esac
4750case "$libswanted" in
4751'') libswanted='c_s';;
4752esac
4753case "$usesocks" in
4754"$define") libswanted="$libswanted socks5 socks5_sh" ;;
4755esac
4756libsfound=''
4757libsfiles=''
4758libsdirs=''
4759libspath=''
4760for thisdir in $libpth $xlibpth; do
4761 test -d $thisdir && libspath="$libspath $thisdir"
4762done
4763for thislib in $libswanted; do
4764 for thisdir in $libspath; do
4765 xxx=''
4766 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4767 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4768 $test -f "$xxx" && eval $libscheck
4769 $test -f "$xxx" && libstyle=shared
4770 fi
4771 if test ! -f "$xxx"; then
4772 xxx=$thisdir/lib$thislib.$so
4773 $test -f "$xxx" && eval $libscheck
4774 $test -f "$xxx" && libstyle=shared
4775 fi
4776 if test ! -f "$xxx"; then
4777 xxx=$thisdir/lib$thislib$_a
4778 $test -f "$xxx" && eval $libscheck
4779 $test -f "$xxx" && libstyle=static
4780 fi
4781 if test ! -f "$xxx"; then
4782 xxx=$thisdir/$thislib$_a
4783 $test -f "$xxx" && eval $libscheck
4784 $test -f "$xxx" && libstyle=static
4785 fi
4786 if test ! -f "$xxx"; then
4787 xxx=$thisdir/lib${thislib}_s$_a
4788 $test -f "$xxx" && eval $libscheck
4789 $test -f "$xxx" && libstyle=static
4790 $test -f "$xxx" && thislib=${thislib}_s
4791 fi
4792 if test ! -f "$xxx"; then
4793 xxx=$thisdir/Slib$thislib$_a
4794 $test -f "$xxx" && eval $libscheck
4795 $test -f "$xxx" && libstyle=static
4796 fi
4797 if $test -f "$xxx"; then
4798 case "$libstyle" in
4799 shared) echo "Found -l$thislib (shared)." ;;
4800 static) echo "Found -l$thislib." ;;
4801 *) echo "Found -l$thislib ($libstyle)." ;;
4802 esac
4803 case " $dflt " in
4804 *"-l$thislib "*);;
4805 *) dflt="$dflt -l$thislib"
4806 libsfound="$libsfound $xxx"
4807 yyy=`basename $xxx`
4808 libsfiles="$libsfiles $yyy"
4809 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4810 case " $libsdirs " in
4811 *" $yyy "*) ;;
4812 *) libsdirs="$libsdirs $yyy" ;;
4813 esac
4814 ;;
4815 esac
4816 break
4817 fi
4818 done
4819 if $test ! -f "$xxx"; then
4820 echo "No -l$thislib."
4821 fi
4822done
4823set X $dflt
4824shift
4825dflt="$*"
4826case "$libs" in
4827'') dflt="$dflt";;
4828*) dflt="$libs";;
4829esac
4830case "$dflt" in
4831' '|'') dflt='none';;
4832esac
4833
4834$cat <<EOM
4835
4836In order to compile $package on your machine, a number of libraries
4837are usually needed. Include any other special libraries here as well.
4838Say "none" for none. The default list is almost always right.
4839EOM
4840
4841echo " "
4842rp="What libraries to use?"
4843. ./myread
4844case "$ans" in
4845none) libs=' ';;
4846*) libs="$ans";;
4847esac
4848
4849: determine optimization, if desired, or use for debug flag also
4850case "$optimize" in
4851' '|$undef) dflt='none';;
4852'') dflt='-O';;
4853*) dflt="$optimize";;
4854esac
4855$cat <<EOH
4856
4857By default, $package compiles with the -O flag to use the optimizer.
4858Alternately, you might want to use the symbolic debugger, which uses
4859the -g flag (on traditional Unix systems). Either flag can be
4860specified here. To use neither flag, specify the word "none".
4861
4862EOH
4863rp="What optimizer/debugger flag should be used?"
4864. ./myread
4865optimize="$ans"
4866case "$optimize" in
4867'none') optimize=" ";;
4868esac
4869
4870: Check what DEBUGGING is required from the command line
4871: -DEBUGGING or -DDEBUGGING or
4872: -DEBUGGING=both = -g + -DDEBUGGING
4873: -DEBUGGING=-g or -Doptimize=-g = -g
4874: -DEBUGGING=none or -UDEBUGGING =
4875: -DEBUGGING=old or -DEBUGGING=default = ? $optimize
4876case "$EBUGGING" in
4877'') ;;
4878*) DEBUGGING=$EBUGGING ;;
4879esac
4880
4881case "$DEBUGGING" in
4882-g|$define)
4883 case "$optimize" in
4884 *-g*) ;;
4885 *) optimize="$optimize -g" ;;
4886 esac ;;
4887none|$undef)
4888 case "$optimize" in
4889 *-g*) set `echo "X $optimize " | sed 's/ -g / /'`
4890 shift
4891 optimize="$*"
4892 ;;
4893 esac ;;
4894esac
4895
4896dflt=''
4897case "$DEBUGGING" in
4898both|$define) dflt='-DDEBUGGING'
4899esac
4900
4901: We will not override a previous value, but we might want to
4902: augment a hint file
4903case "$hint" in
4904default|recommended)
4905 case "$gccversion" in
4906 1*) dflt="$dflt -fpcc-struct-return" ;;
4907 esac
4908 case "$optimize:$DEBUGGING" in
4909 *-g*:old) dflt="$dflt -DDEBUGGING";;
4910 esac
4911 case "$gccversion" in
4912 2*) if test -d /etc/conf/kconfig.d &&
4913 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4914 then
4915 # Interactive Systems (ISC) POSIX mode.
4916 dflt="$dflt -posix"
4917 fi
4918 ;;
4919 esac
4920 case "$gccversion" in
4921 1*) ;;
4922 2.[0-8]*) ;;
4923 ?*) echo " "
4924 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4925 echo 'int main(void) { return 0; }' > gcctest.c
4926 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4927 echo "Yes, it does." 2>&1
4928 case "$ccflags" in
4929 *strict-aliasing*)
4930 echo "Leaving current flags $ccflags alone." 2>&1
4931 ;;
4932 *) dflt="$dflt -fno-strict-aliasing" ;;
4933 esac
4934 else
4935 echo "Nope, it doesn't, but that's ok." 2>&1
4936 fi
4937 ;;
4938 esac
4939 # For gcc, adding -pipe speeds up compilations for some, but apparently
4940 # some assemblers can't read from stdin. (It also slows down compilations
4941 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4942 case "$gccversion" in
4943 ?*) echo " "
4944 echo "Checking if your compiler accepts -pipe" 2>&1
4945 echo 'int main(void) { return 0; }' > gcctest.c
4946 if $cc -pipe -o gcctest gcctest.c; then
4947 echo "Yes, it does." 2>&1
4948 case "$ccflags" in
4949 *-pipe*)
4950 echo "Leaving current flags $ccflags alone." 2>&1
4951 ;;
4952 *) dflt="$dflt -pipe" ;;
4953 esac
4954 else
4955 echo "Nope, it doesn't, but that's ok." 2>&1
4956 fi
4957 ;;
4958 esac
4959 ;;
4960esac
4961
4962case "$mips_type" in
4963*BSD*|'') inclwanted="$locincpth $usrinc";;
4964*) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4965esac
4966for thisincl in $inclwanted; do
4967 if $test -d $thisincl; then
4968 if $test x$thisincl != x$usrinc; then
4969 case "$dflt" in
4970 *" -I$thisincl "*);;
4971 *) dflt="$dflt -I$thisincl ";;
4972 esac
4973 fi
4974 fi
4975done
4976
4977inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4978 xxx=true;
4979elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4980 xxx=true;
4981else
4982 xxx=false;
4983fi;
4984if $xxx; then
4985 case "$dflt" in
4986 *$2*);;
4987 *) dflt="$dflt -D$2";;
4988 esac;
4989fi'
4990
4991set signal.h LANGUAGE_C; eval $inctest
4992
4993case "$usesocks" in
4994$define)
4995 ccflags="$ccflags -DSOCKS"
4996 ;;
4997esac
4998
4999case "$hint" in
5000default|recommended) dflt="$ccflags $dflt" ;;
5001*) dflt="$ccflags";;
5002esac
5003
5004case "$dflt" in
5005''|' ') dflt=none;;
5006esac
5007
5008$cat <<EOH
5009
5010Your C compiler may want other flags. For this question you should include
5011-I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
5012but you should NOT include libraries or ld flags like -lwhatever. If you
5013want $package to honor its debug switch, you should include -DDEBUGGING here.
5014Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
5015
5016To use no flags, specify the word "none".
5017
5018EOH
5019set X $dflt
5020shift
5021dflt=${1+"$@"}
5022rp="Any additional cc flags?"
5023. ./myread
5024case "$ans" in
5025none) ccflags='';;
5026*) ccflags="$ans";;
5027esac
5028
5029: the following weeds options from ccflags that are of no interest to cpp
5030case "$cppflags" in
5031'') cppflags="$ccflags" ;;
5032*) cppflags="$cppflags $ccflags" ;;
5033esac
5034case "$gccversion" in
50351*) cppflags="$cppflags -D__GNUC__"
5036esac
5037case "$mips_type" in
5038'');;
5039*BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
5040esac
5041case "$cppflags" in
5042'');;
5043*)
5044 echo " "
5045 echo "Let me guess what the preprocessor flags are..." >&4
5046 set X $cppflags
5047 shift
5048 cppflags=''
5049 $cat >cpp.c <<'EOM'
5050#define BLURFL foo
5051
5052BLURFL xx LFRULB
5053EOM
5054 previous=''
5055 for flag in $*
5056 do
5057 case "$flag" in
5058 -*) ftry="$flag";;
5059 *) ftry="$previous $flag";;
5060 esac
5061 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
5062 >cpp1.out 2>/dev/null && \
5063 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
5064 >cpp2.out 2>/dev/null && \
5065 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
5066 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
5067 then
5068 cppflags="$cppflags $ftry"
5069 previous=''
5070 else
5071 previous="$flag"
5072 fi
5073 done
5074 set X $cppflags
5075 shift
5076 cppflags=${1+"$@"}
5077 case "$cppflags" in
5078 *-*) echo "They appear to be: $cppflags";;
5079 esac
5080 $rm -f cpp.c cpp?.out
5081 ;;
5082esac
5083
5084: flags used in final linking phase
5085case "$ldflags" in
5086'') if ./venix; then
5087 dflt='-i -z'
5088 else
5089 dflt=''
5090 fi
5091 case "$ccflags" in
5092 *-posix*) dflt="$dflt -posix" ;;
5093 esac
5094 ;;
5095*) dflt="$ldflags";;
5096esac
5097
5098: Try to guess additional flags to pick up local libraries.
5099for thislibdir in $libpth; do
5100 case " $loclibpth " in
5101 *" $thislibdir "*)
5102 case "$dflt " in
5103 *"-L$thislibdir "*) ;;
5104 *) dflt="$dflt -L$thislibdir" ;;
5105 esac
5106 ;;
5107 esac
5108done
5109
5110case "$dflt" in
5111'') dflt='none' ;;
5112esac
5113
5114$cat <<EOH
5115
5116Your C linker may need flags. For this question you should
5117include -L/whatever and any other flags used by the C linker, but you
5118should NOT include libraries like -lwhatever.
5119
5120Make sure you include the appropriate -L/path flags if your C linker
5121does not normally search all of the directories you specified above,
5122namely
5123 $libpth
5124To use no flags, specify the word "none".
5125
5126EOH
5127
5128rp="Any additional ld flags (NOT including libraries)?"
5129. ./myread
5130case "$ans" in
5131none) ldflags='';;
5132*) ldflags="$ans";;
5133esac
5134rmlist="$rmlist pdp11"
5135
5136: coherency check
5137echo " "
5138echo "Checking your choice of C compiler and flags for coherency..." >&4
5139$cat > try.c <<'EOF'
5140#include <stdio.h>
5141int main() { printf("Ok\n"); return(0); }
5142EOF
5143set X $cc -o try $optimize $ccflags $ldflags try.c $libs
5144shift
5145$cat >try.msg <<'EOM'
5146I've tried to compile and run the following simple program:
5147
5148EOM
5149$cat try.c >> try.msg
5150
5151$cat >> try.msg <<EOM
5152
5153I used the command:
5154
5155 $*
5156 $run ./try
5157
5158and I got the following output:
5159
5160EOM
5161dflt=y
5162if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
5163 if $sh -c "$run ./try" >>try.msg 2>&1; then
5164 xxx=`$run ./try`
5165 case "$xxx" in
5166 "Ok") dflt=n ;;
5167 *) echo 'The program compiled OK, but produced no output.' >> try.msg
5168 case " $libs " in
5169 *" -lsfio "*)
5170 cat >> try.msg <<'EOQS'
5171If $libs contains -lsfio, and sfio is mis-configured, then it
5172sometimes (apparently) runs and exits with a 0 status, but with no
5173output! It may have to do with sfio's use of _exit vs. exit.
5174
5175EOQS
5176 rp="You have a big problem. Shall I abort Configure"
5177 dflt=y
5178 ;;
5179 esac
5180 ;;
5181 esac
5182 else
5183 echo "The program compiled OK, but exited with status $?." >>try.msg
5184 rp="You have a problem. Shall I abort Configure"
5185 dflt=y
5186 fi
5187else
5188 echo "I can't compile the test program." >>try.msg
5189 rp="You have a BIG problem. Shall I abort Configure"
5190 dflt=y
5191fi
5192case "$dflt" in
5193y)
5194 $cat try.msg >&4
5195 case "$knowitall" in
5196 '')
5197 echo "(The supplied flags or libraries might be incorrect.)"
5198 ;;
5199 *) dflt=n;;
5200 esac
5201 echo " "
5202 . ./myread
5203 case "$ans" in
5204 n*|N*) ;;
5205 *) echo "Ok. Stopping Configure." >&4
5206 exit 1
5207 ;;
5208 esac
5209 ;;
5210n) echo "OK, that should do.";;
5211esac
5212$rm -f try try.* core
5213
5214: define a shorthand compile call
5215compile='
5216mc_file=$1;
5217shift;
5218$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5219: define a shorthand compile call for compilations that should be ok.
5220compile_ok='
5221mc_file=$1;
5222shift;
5223$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5224
5225: determine filename position in cpp output
5226echo " "
5227echo "Computing filename position in cpp output for #include directives..." >&4
5228case "$osname" in
5229vos) testaccess=-e ;;
5230*) testaccess=-r ;;
5231esac
5232echo '#include <stdio.h>' > foo.c
5233$cat >fieldn <<EOF
5234$startsh
5235$cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5236$grep '^[ ]*#.*stdio\.h' | \
5237while read cline; do
5238 pos=1
5239 set \$cline
5240 while $test \$# -gt 0; do
5241 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5242 echo "\$pos"
5243 exit 0
5244 fi
5245 shift
5246 pos=\`expr \$pos + 1\`
5247 done
5248done
5249EOF
5250chmod +x fieldn
5251fieldn=`./fieldn`
5252$rm -f foo.c fieldn
5253case $fieldn in
5254'') pos='???';;
52551) pos=first;;
52562) pos=second;;
52573) pos=third;;
5258*) pos="${fieldn}th";;
5259esac
5260echo "Your cpp writes the filename in the $pos field of the line."
5261
5262case "$osname" in
5263vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5264os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5265*) cppfilter='' ;;
5266esac
5267: locate header file
5268$cat >findhdr <<EOF
5269$startsh
5270wanted=\$1
5271name=''
5272for usrincdir in $usrinc
5273do
5274 if test -f \$usrincdir/\$wanted; then
5275 echo "\$usrincdir/\$wanted"
5276 exit 0
5277 fi
5278done
5279awkprg='{ print \$$fieldn }'
5280echo "#include <\$wanted>" > foo\$\$.c
5281$cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5282$cppfilter $grep "^[ ]*#.*\$wanted" | \
5283while read cline; do
5284 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5285 case "\$name" in
5286 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5287 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5288 *) exit 2;;
5289 esac;
5290done;
5291#
5292# status = 0: grep returned 0 lines, case statement not executed
5293# status = 1: headerfile found
5294# status = 2: while loop executed, no headerfile found
5295#
5296status=\$?
5297$rm -f foo\$\$.c;
5298if test \$status -eq 1; then
5299 exit 0;
5300fi
5301exit 1
5302EOF
5303chmod +x findhdr
5304
5305: define an alternate in-header-list? function
5306inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5307cont=true; xxf="echo \"<\$1> found.\" >&4";
5308case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5309*) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5310esac;
5311case $# in 4) instead=instead;; *) instead="at last";; esac;
5312while $test "$cont"; do
5313 xxx=`./findhdr $1`
5314 var=$2; eval "was=\$$2";
5315 if $test "$xxx" && $test -r "$xxx";
5316 then eval $xxf;
5317 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5318 cont="";
5319 else eval $xxnf;
5320 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5321 set $yyy; shift; shift; yyy=$@;
5322 case $# in 0) cont="";;
5323 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5324 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5325 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5326 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5327 esac;
5328done;
5329while $test "$yyy";
5330do set $yyy; var=$2; eval "was=\$$2";
5331 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5332 set $yyy; shift; shift; yyy=$@;
5333done'
5334
5335: see if stdlib is available
5336set stdlib.h i_stdlib
5337eval $inhdr
5338
5339: check for lengths of integral types
5340echo " "
5341case "$intsize" in
5342'')
5343 echo "Checking to see how big your integers are..." >&4
5344 $cat >try.c <<EOCP
5345#include <stdio.h>
5346#$i_stdlib I_STDLIB
5347#ifdef I_STDLIB
5348#include <stdlib.h>
5349#endif
5350int main()
5351{
5352 printf("intsize=%d;\n", (int)sizeof(int));
5353 printf("longsize=%d;\n", (int)sizeof(long));
5354 printf("shortsize=%d;\n", (int)sizeof(short));
5355 exit(0);
5356}
5357EOCP
5358 set try
5359 if eval $compile_ok && $run ./try > /dev/null; then
5360 eval `$run ./try`
5361 echo "Your integers are $intsize bytes long."
5362 echo "Your long integers are $longsize bytes long."
5363 echo "Your short integers are $shortsize bytes long."
5364 else
5365 $cat >&4 <<EOM
5366!
5367Help! I can't compile and run the intsize test program: please enlighten me!
5368(This is probably a misconfiguration in your system or libraries, and
5369you really ought to fix it. Still, I'll try anyway.)
5370!
5371EOM
5372 dflt=4
5373 rp="What is the size of an integer (in bytes)?"
5374 . ./myread
5375 intsize="$ans"
5376 dflt=$intsize
5377 rp="What is the size of a long integer (in bytes)?"
5378 . ./myread
5379 longsize="$ans"
5380 dflt=2
5381 rp="What is the size of a short integer (in bytes)?"
5382 . ./myread
5383 shortsize="$ans"
5384 fi
5385 ;;
5386esac
5387$rm -f try try.*
5388
5389: check for long long
5390echo " "
5391echo "Checking to see if you have long long..." >&4
5392echo 'int main() { long long x = 7; return 0; }' > try.c
5393set try
5394if eval $compile; then
5395 val="$define"
5396 echo "You have long long."
5397else
5398 val="$undef"
5399 echo "You do not have long long."
5400fi
5401$rm try.*
5402set d_longlong
5403eval $setvar
5404
5405: check for length of long long
5406case "${d_longlong}${longlongsize}" in
5407$define)
5408 echo " "
5409 echo "Checking to see how big your long longs are..." >&4
5410 $cat >try.c <<'EOCP'
5411#include <stdio.h>
5412int main()
5413{
5414 printf("%d\n", (int)sizeof(long long));
5415 return(0);
5416}
5417EOCP
5418 set try
5419 if eval $compile_ok; then
5420 longlongsize=`$run ./try`
5421 echo "Your long longs are $longlongsize bytes long."
5422 else
5423 dflt='8'
5424 echo " "
5425 echo "(I can't seem to compile the test program. Guessing...)"
5426 rp="What is the size of a long long (in bytes)?"
5427 . ./myread
5428 longlongsize="$ans"
5429 fi
5430 if $test "X$longsize" = "X$longlongsize"; then
5431 echo "(That isn't any different from an ordinary long.)"
5432 fi
5433 ;;
5434esac
5435$rm -f try.* try
5436
5437: see if inttypes.h is available
5438: we want a real compile instead of Inhdr because some systems
5439: have an inttypes.h which includes non-existent headers
5440echo " "
5441$cat >try.c <<EOCP
5442#include <inttypes.h>
5443int main() {
5444 static int32_t foo32 = 0x12345678;
5445}
5446EOCP
5447set try
5448if eval $compile; then
5449 echo "<inttypes.h> found." >&4
5450 val="$define"
5451else
5452 echo "<inttypes.h> NOT found." >&4
5453 val="$undef"
5454fi
5455$rm -f try.c try
5456set i_inttypes
5457eval $setvar
5458
5459: check for int64_t
5460echo " "
5461echo "Checking to see if you have int64_t..." >&4
5462$cat >try.c <<EOCP
5463#include <sys/types.h>
5464#$i_inttypes I_INTTYPES
5465#ifdef I_INTTYPES
5466#include <inttypes.h>
5467#endif
5468int main() { int64_t x = 7; }
5469EOCP
5470set try
5471if eval $compile; then
5472 val="$define"
5473 echo "You have int64_t."
5474else
5475 val="$undef"
5476 echo "You do not have int64_t."
5477fi
5478$rm -f try try.*
5479set d_int64_t
5480eval $setvar
5481
5482
5483echo " "
5484echo "Checking which 64-bit integer type we could use..." >&4
5485
5486case "$intsize" in
54878) val=int
5488 set quadtype
5489 eval $setvar
5490 val='"unsigned int"'
5491 set uquadtype
5492 eval $setvar
5493 quadkind=1
5494 ;;
5495*) case "$longsize" in
5496 8) val=long
5497 set quadtype
5498 eval $setvar
5499 val='"unsigned long"'
5500 set uquadtype
5501 eval $setvar
5502 quadkind=2
5503 ;;
5504 *) case "$d_longlong:$longlongsize" in
5505 define:8)
5506 val='"long long"'
5507 set quadtype
5508 eval $setvar
5509 val='"unsigned long long"'
5510 set uquadtype
5511 eval $setvar
5512 quadkind=3
5513 ;;
5514 *) case "$d_int64_t" in
5515 define)
5516 val=int64_t
5517 set quadtype
5518 eval $setvar
5519 val=uint64_t
5520 set uquadtype
5521 eval $setvar
5522 quadkind=4
5523 ;;
5524 esac
5525 ;;
5526 esac
5527 ;;
5528 esac
5529 ;;
5530esac
5531
5532case "$quadtype" in
5533'') echo "Alas, no 64-bit integer types in sight." >&4
5534 d_quad="$undef"
5535 ;;
5536*) echo "We could use '$quadtype' for 64-bit integers." >&4
5537 d_quad="$define"
5538 ;;
5539esac
5540
5541
5542case "$uselonglong" in
5543"$define"|true|[yY]*)
5544 cat <<EOM >&4
5545
5546*** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5547EOM
5548 use64bitint="$define"
5549 ;;
5550esac
5551case "$use64bits" in
5552"$define"|true|[yY]*)
5553 cat <<EOM >&4
5554
5555*** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5556EOM
5557 use64bitint="$define"
5558 ;;
5559esac
5560case "$use64bitints" in
5561"$define"|true|[yY]*)
5562 cat <<EOM >&4
5563
5564*** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5565EOM
5566 use64bitint="$define"
5567 ;;
5568esac
5569case "$use64bitsint" in
5570"$define"|true|[yY]*)
5571 cat <<EOM >&4
5572
5573*** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5574EOM
5575 use64bitint="$define"
5576 ;;
5577esac
5578case "$uselonglongs" in
5579"$define"|true|[yY]*)
5580 cat <<EOM >&4
5581
5582*** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5583EOM
5584 use64bitint="$define"
5585 ;;
5586esac
5587case "$use64bitsall" in
5588"$define"|true|[yY]*)
5589 cat <<EOM >&4
5590
5591*** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5592EOM
5593 use64bitall="$define"
5594 ;;
5595esac
5596
5597case "$ccflags" in
5598*-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5599esac
5600case "$use64bitall" in
5601"$define"|true|[yY]*) use64bitint="$define" ;;
5602esac
5603
5604case "$longsize" in
56058) cat <<EOM
5606
5607You have natively 64-bit long integers.
5608EOM
5609 val="$define"
5610 ;;
5611*) case "$use64bitint" in
5612 "$define"|true|[yY]*) dflt='y';;
5613 *) dflt='n';;
5614 esac
5615 case "$d_quad" in
5616 "$define") ;;
5617 *) dflt='n' ;;
5618 esac
5619 cat <<EOM
5620
5621Perl can be built to take advantage of 64-bit integer types
5622on some systems. To do so, Configure can be run with -Duse64bitint.
5623Choosing this option will most probably introduce binary incompatibilities.
5624
5625If this doesn't make any sense to you, just accept the default '$dflt'.
5626(The default has been chosen based on your configuration.)
5627EOM
5628 rp='Try to use 64-bit integers, if available?'
5629 . ./myread
5630 case "$ans" in
5631 [yY]*) val="$define" ;;
5632 *) val="$undef" ;;
5633 esac
5634 ;;
5635esac
5636set use64bitint
5637eval $setvar
5638
5639case "$use64bitall" in
5640"$define"|true|[yY]*) dflt='y' ;;
5641*) case "$longsize" in
5642 8) dflt='y' ;;
5643 *) dflt='n' ;;
5644 esac
5645 ;;
5646esac
5647cat <<EOM
5648
5649You may also choose to try maximal 64-bitness. It means using as much
565064-bitness as possible on the platform. This in turn means even more
5651binary incompatibilities. On the other hand, your platform may not
5652have any more 64-bitness available than what you already have chosen.
5653
5654If this doesn't make any sense to you, just accept the default '$dflt'.
5655(The default has been chosen based on your configuration.)
5656EOM
5657rp='Try to use maximal 64-bit support, if available?'
5658. ./myread
5659case "$ans" in
5660[yY]*) val="$define" ;;
5661*) val="$undef" ;;
5662esac
5663set use64bitall
5664eval $setvar
5665case "$use64bitall" in
5666"$define")
5667 case "$use64bitint" in
5668 "$undef")
5669 cat <<EOM
5670
5671Since you have chosen a maximally 64-bit build, I'm also turning on
5672the use of 64-bit integers.
5673EOM
5674 use64bitint="$define" ;;
5675 esac
5676 ;;
5677esac
5678
5679: Look for a hint-file generated 'call-back-unit'. If the
5680: user has specified that a 64-bit perl is to be built,
5681: we may need to set or change some other defaults.
5682if $test -f use64bitint.cbu; then
5683 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5684 . ./use64bitint.cbu
5685fi
5686case "$use64bitint" in
5687"$define"|true|[yY]*)
5688 case "$longsize" in
5689 4) case "$archname64" in
5690 '') archname64=64int ;;
5691 esac
5692 ;;
5693 esac
5694 ;;
5695esac
5696
5697: Look for a hint-file generated 'call-back-unit'. If the
5698: user has specified that a maximally 64-bit perl is to be built,
5699: we may need to set or change some other defaults.
5700if $test -f use64bitall.cbu; then
5701 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5702 . ./use64bitall.cbu
5703fi
5704case "$use64bitall" in
5705"$define"|true|[yY]*)
5706 case "$longsize" in
5707 4) case "$archname64" in
5708 ''|64int) archname64=64all ;;
5709 esac
5710 ;;
5711 esac
5712 ;;
5713esac
5714
5715case "$d_quad:$use64bitint" in
5716$undef:$define)
5717 cat >&4 <<EOF
5718
5719*** You have chosen to use 64-bit integers,
5720*** but none can be found.
5721*** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5722*** Cannot continue, aborting.
5723
5724EOF
5725 exit 1
5726 ;;
5727esac
5728
5729: check for length of double
5730echo " "
5731case "$doublesize" in
5732'')
5733 echo "Checking to see how big your double precision numbers are..." >&4
5734 $cat >try.c <<EOCP
5735#include <stdio.h>
5736#$i_stdlib I_STDLIB
5737#ifdef I_STDLIB
5738#include <stdlib.h>
5739#endif
5740int main()
5741{
5742 printf("%d\n", (int)sizeof(double));
5743 exit(0);
5744}
5745EOCP
5746 set try
5747 if eval $compile_ok; then
5748 doublesize=`$run ./try`
5749 echo "Your double is $doublesize bytes long."
5750 else
5751 dflt='8'
5752 echo "(I can't seem to compile the test program. Guessing...)"
5753 rp="What is the size of a double precision number (in bytes)?"
5754 . ./myread
5755 doublesize="$ans"
5756 fi
5757 ;;
5758esac
5759$rm -f try.c try
5760
5761: check for long doubles
5762echo " "
5763echo "Checking to see if you have long double..." >&4
5764echo 'int main() { long double x = 7.0; }' > try.c
5765set try
5766if eval $compile; then
5767 val="$define"
5768 echo "You have long double."
5769else
5770 val="$undef"
5771 echo "You do not have long double."
5772fi
5773$rm try.*
5774set d_longdbl
5775eval $setvar
5776
5777: check for length of long double
5778case "${d_longdbl}${longdblsize}" in
5779$define)
5780 echo " "
5781 echo "Checking to see how big your long doubles are..." >&4
5782 $cat >try.c <<'EOCP'
5783#include <stdio.h>
5784int main()
5785{
5786 printf("%d\n", sizeof(long double));
5787}
5788EOCP
5789 set try
5790 set try
5791 if eval $compile; then
5792 longdblsize=`$run ./try`
5793 echo "Your long doubles are $longdblsize bytes long."
5794 else
5795 dflt='8'
5796 echo " "
5797 echo "(I can't seem to compile the test program. Guessing...)" >&4
5798 rp="What is the size of a long double (in bytes)?"
5799 . ./myread
5800 longdblsize="$ans"
5801 fi
5802 if $test "X$doublesize" = "X$longdblsize"; then
5803 echo "That isn't any different from an ordinary double."
5804 echo "I'll keep your setting anyway, but you may see some"
5805 echo "harmless compilation warnings."
5806 fi
5807 ;;
5808esac
5809$rm -f try.* try
5810
5811: determine the architecture name
5812echo " "
5813if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5814 tarch=`arch`"-$osname"
5815elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5816 if uname -m > tmparch 2>&1 ; then
5817 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5818 -e 's/$/'"-$osname/" tmparch`
5819 else
5820 tarch="$osname"
5821 fi
5822 $rm -f tmparch
5823else
5824 tarch="$osname"
5825fi
5826case "$myarchname" in
5827''|"$tarch") ;;
5828*)
5829 echo "(Your architecture name used to be $myarchname.)"
5830 archname=''
5831 ;;
5832esac
5833case "$targetarch" in
5834'') ;;
5835*) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5836esac
5837myarchname="$tarch"
5838case "$archname" in
5839'') dflt="$tarch";;
5840*) dflt="$archname";;
5841esac
5842rp='What is your architecture name'
5843. ./myread
5844archname="$ans"
5845case "$usethreads" in
5846$define)
5847 echo "Threads selected." >&4
5848 case "$archname" in
5849 *-thread*) echo "...and architecture name already has -thread." >&4
5850 ;;
5851 *) archname="$archname-thread"
5852 echo "...setting architecture name to $archname." >&4
5853 ;;
5854 esac
5855 ;;
5856esac
5857case "$usemultiplicity" in
5858$define)
5859 echo "Multiplicity selected." >&4
5860 case "$archname" in
5861 *-multi*) echo "...and architecture name already has -multi." >&4
5862 ;;
5863 *) archname="$archname-multi"
5864 echo "...setting architecture name to $archname." >&4
5865 ;;
5866 esac
5867 ;;
5868esac
5869case "$use64bitint$use64bitall" in
5870*"$define"*)
5871 case "$archname64" in
5872 '')
5873 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5874 ;;
5875 *)
5876 case "$use64bitint" in
5877 "$define") echo "64 bit integers selected." >&4 ;;
5878 esac
5879 case "$use64bitall" in
5880 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5881 esac
5882 case "$archname" in
5883 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5884 ;;
5885 *) archname="$archname-$archname64"
5886 echo "...setting architecture name to $archname." >&4
5887 ;;
5888 esac
5889 ;;
5890 esac
5891esac
5892case "$uselongdouble" in
5893$define)
5894 echo "Long doubles selected." >&4
5895 case "$longdblsize" in
5896 $doublesize)
5897 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5898 ;;
5899 *)
5900 case "$archname" in
5901 *-ld*) echo "...and architecture name already has -ld." >&4
5902 ;;
5903 *) archname="$archname-ld"
5904 echo "...setting architecture name to $archname." >&4
5905 ;;
5906 esac
5907 ;;
5908 esac
5909 ;;
5910esac
5911case "$useperlio" in
5912$define)
5913 echo "Perlio selected." >&4
5914 ;;
5915*)
5916 echo "Perlio not selected, using stdio." >&4
5917 case "$archname" in
5918 *-stdio*) echo "...and architecture name already has -stdio." >&4
5919 ;;
5920 *) archname="$archname-stdio"
5921 echo "...setting architecture name to $archname." >&4
5922 ;;
5923 esac
5924 ;;
5925esac
5926if $test -f archname.cbu; then
5927 echo "Your platform has some specific hints for architecture name, using them..."
5928 . ./archname.cbu
5929fi
5930
5931: set the prefixit variable, to compute a suitable default value
5932prefixit='case "$3" in
5933""|none)
5934 case "$oldprefix" in
5935 "") eval "$1=\"\$$2\"";;
5936 *)
5937 case "$3" in
5938 "") eval "$1=";;
5939 none)
5940 eval "tp=\"\$$2\"";
5941 case "$tp" in
5942 ""|" ") eval "$1=\"\$$2\"";;
5943 *) eval "$1=";;
5944 esac;;
5945 esac;;
5946 esac;;
5947*)
5948 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5949 case "$tp" in
5950 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5951 /*-$oldprefix/*|\~*-$oldprefix/*)
5952 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5953 *) eval "$1=\"\$$2\"";;
5954 esac;;
5955esac'
5956
5957: get the patchlevel
5958echo " "
5959echo "Getting the current patchlevel..." >&4
5960if $test -r $rsrc/patchlevel.h;then
5961 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5962 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5963 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5964 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5965 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5966 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5967 perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5968else
5969 revision=0
5970 patchlevel=0
5971 subversion=0
5972 api_revision=0
5973 api_version=0
5974 api_subversion=0
5975 perl_patchlevel=0
5976 $echo "(You do not have patchlevel.h. Eek.)"
5977fi
5978if $test -r $rsrc/.patch ; then
5979 if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5980 perl_patchlevel=`cat $rsrc/.patch`
5981 fi
5982fi
5983: Define a handy string here to avoid duplication in myconfig.SH and configpm.
5984version_patchlevel_string="version $patchlevel subversion $subversion"
5985case "$perl_patchlevel" in
59860|'') ;;
5987*) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5988esac
5989
5990$echo "(You have $package $version_patchlevel_string.)"
5991
5992case "$osname" in
5993dos|vms)
5994 : XXX Should be a Configure test for double-dots in filenames.
5995 version=`echo $revision $patchlevel $subversion | \
5996 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5997 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5998 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5999 ;;
6000*)
6001 version=`echo $revision $patchlevel $subversion | \
6002 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6003 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6004 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6005 ;;
6006esac
6007: Special case the 5.005_xx maintenance series, which used 5.005
6008: without any subversion label as a subdirectory in $sitelib
6009if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6010 api_versionstring='5.005'
6011fi
6012
6013: determine installation style
6014: For now, try to deduce it from prefix unless it is already set.
6015: Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6016case "$installstyle" in
6017'') case "$prefix" in
6018 *perl*) dflt='lib';;
6019 *) dflt='lib/perl5' ;;
6020 esac
6021 ;;
6022*) dflt="$installstyle" ;;
6023esac
6024: Probably not worth prompting for this since we prompt for all
6025: the directories individually, and the prompt would be too long and
6026: confusing anyway.
6027installstyle=$dflt
6028
6029: determine where public executables go
6030echo " "
6031set dflt bin bin
6032eval $prefixit
6033fn=d~
6034rp='Pathname where the public executables will reside?'
6035. ./getfile
6036if $test "X$ansexp" != "X$binexp"; then
6037 installbin=''
6038fi
6039prefixvar=bin
6040: XXX Bug? -- ignores Configure -Dinstallprefix setting.
6041: XXX If this is fixed, also fix the "start perl" hunk below, which relies on
6042: this via initialinstalllocation
6043. ./setprefixvar
6044
6045case "$userelocatableinc" in
6046$define|true|[yY]*) dflt='y' ;;
6047*) dflt='n' ;;
6048esac
6049cat <<EOM
6050
6051Would you like to build Perl so that the installation is relocatable, so that
6052library paths in @INC are determined relative to the path of the perl binary?
6053This is not advised for system Perl installs, or if you need to run setid
6054scripts or scripts under taint mode.
6055
6056If this doesn't make any sense to you, just accept the default '$dflt'.
6057EOM
6058rp='Use relocatable @INC?'
6059. ./myread
6060case "$ans" in
6061y|Y) val="$define" ;;
6062*) val="$undef" ;;
6063esac
6064set userelocatableinc
6065eval $setvar
6066
6067initialinstalllocation="$binexp"
6068: Default prefix is now "up one level from where the binaries are"
6069case "$userelocatableinc" in
6070$define|true|[yY]*)
6071 bin=".../"
6072 binexp=".../"
6073 prefix=".../.."
6074 prefixexp=".../.."
6075 installprefixexp=".../.."
6076 ;;
6077esac
6078
6079: determine where private library files go
6080: Usual default is /usr/local/lib/perl5/$version.
6081: Also allow things like /opt/perl/lib/$version, since
6082: /opt/perl/lib/perl5... would be redundant.
6083: The default "style" setting is made in installstyle.U
6084case "$installstyle" in
6085*lib/perl5*) set dflt privlib lib/$package/$version ;;
6086*) set dflt privlib lib/$version ;;
6087esac
6088eval $prefixit
6089$cat <<EOM
6090
6091There are some auxiliary files for $package that need to be put into a
6092private library directory that is accessible by everyone.
6093
6094EOM
6095fn=$binexp
6096fn=d~+
6097rp='Pathname where the private library files will reside?'
6098. ./getfile
6099prefixvar=privlib
6100. ./setprefixvar
6101
6102: set the prefixup variable, to restore leading tilda escape
6103prefixup='case "$prefixexp" in
6104"$prefix") ;;
6105*) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6106esac'
6107
6108: determine where public architecture dependent libraries go
6109set archlib archlib
6110eval $prefixit
6111: privlib default is /usr/local/lib/$package/$version
6112: archlib default is /usr/local/lib/$package/$version/$archname
6113: privlib may have an optional trailing /share.
6114tdflt=`echo $privlib | $sed 's,/share$,,'`
6115tdflt=$tdflt/$archname
6116case "$archlib" in
6117'') dflt=$tdflt
6118 ;;
6119*) dflt="$archlib"
6120 ;;
6121esac
6122$cat <<EOM
6123
6124$spackage contains architecture-dependent library files. If you are
6125sharing libraries in a heterogeneous environment, you might store
6126these files in a separate location. Otherwise, you can just include
6127them with the rest of the public library files.
6128
6129EOM
6130fn=$binexp
6131fn=d+~
6132rp='Where do you want to put the public architecture-dependent libraries?'
6133. ./getfile
6134prefixvar=archlib
6135. ./setprefixvar
6136if $test X"$archlib" = X"$privlib"; then
6137 d_archlib="$undef"
6138else
6139 d_archlib="$define"
6140fi
6141
6142: see if setuid scripts can be secure
6143$cat <<EOM
6144
6145Some kernels have a bug that prevents setuid #! scripts from being
6146secure. Some sites have disabled setuid #! scripts because of this.
6147
6148First let's decide if your kernel supports secure setuid #! scripts.
6149(If setuid #! scripts would be secure but have been disabled anyway,
6150don't say that they are secure if asked.)
6151
6152EOM
6153
6154val="$undef"
6155if $test -d /dev/fd; then
6156 echo "#!$ls" >reflect
6157 chmod +x,u+s reflect
6158 ./reflect >flect 2>&1
6159 if $contains "/dev/fd" flect >/dev/null; then
6160 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6161 val="$define"
6162 else
6163 $cat <<EOM
6164If you are not sure if they are secure, I can check but I'll need a
6165username and password different from the one you are using right now.
6166If you don't have such a username or don't want me to test, simply
6167enter 'none'.
6168
6169EOM
6170 rp='Other username to test security of setuid scripts with?'
6171 dflt='none'
6172 . ./myread
6173 case "$ans" in
6174 n|none)
6175 case "$d_suidsafe" in
6176 '') echo "I'll assume setuid scripts are *not* secure." >&4
6177 dflt=n;;
6178 "$undef")
6179 echo "Well, the $hint value is *not* secure." >&4
6180 dflt=n;;
6181 *) echo "Well, the $hint value *is* secure." >&4
6182 dflt=y;;
6183 esac
6184 ;;
6185 *)
6186 $rm -f reflect flect
6187 echo "#!$ls" >reflect
6188 chmod +x,u+s reflect
6189 echo >flect
6190 chmod a+w flect
6191 echo '"su" will (probably) prompt you for '"$ans's password."
6192 su $ans -c './reflect >flect'
6193 if $contains "/dev/fd" flect >/dev/null; then
6194 echo "Okay, it looks like setuid scripts are secure." >&4
6195 dflt=y
6196 else
6197 echo "I don't think setuid scripts are secure." >&4
6198 dflt=n
6199 fi
6200 ;;
6201 esac
6202 rp='Does your kernel have *secure* setuid scripts?'
6203 . ./myread
6204 case "$ans" in
6205 [yY]*) val="$define";;
6206 *) val="$undef";;
6207 esac
6208 fi
6209else
6210 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6211 echo "(That's for file descriptors, not floppy disks.)"
6212 val="$undef"
6213fi
6214set d_suidsafe
6215eval $setvar
6216
6217$rm -f reflect flect
6218
6219: now see if they want to do setuid emulation
6220echo " "
6221val="$undef"
6222case "$d_suidsafe" in
6223"$define")
6224 val="$undef"
6225 echo "No need to emulate SUID scripts since they are secure here." >&4
6226 ;;
6227*)
6228 $cat <<EOM
6229Some systems have disabled setuid scripts, especially systems where
6230setuid scripts cannot be secure. On systems where setuid scripts have
6231been disabled, the setuid/setgid bits on scripts are currently
6232useless. It is possible for $package to detect those bits and emulate
6233setuid/setgid in a secure fashion. This emulation will only work if
6234setuid scripts have been disabled in your kernel.
6235
6236EOM
6237 case "$d_dosuid" in
6238 "$define") dflt=y ;;
6239 *) dflt=n ;;
6240 esac
6241 rp="Do you want to do setuid/setgid emulation?"
6242 . ./myread
6243 case "$ans" in
6244 [yY]*) val="$define";;
6245 *) val="$undef";;
6246 esac
6247 ;;
6248esac
6249set d_dosuid
6250eval $setvar
6251
6252: Find perl5.005 or later.
6253echo "Looking for a previously installed perl5.005 or later... "
6254case "$perl5" in
6255'') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6256 : Check if this perl is recent and can load a simple module
6257 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6258 perl5=$tdir/perl
6259 break;
6260 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6261 perl5=$tdir/perl5
6262 break;
6263 fi
6264 done
6265 ;;
6266*) perl5="$perl5"
6267 ;;
6268esac
6269case "$perl5" in
6270'') echo "None found. That's ok.";;
6271*) echo "Using $perl5." ;;
6272esac
6273
6274$cat <<EOM
6275
6276After $package is installed, you may wish to install various
6277add-on modules and utilities. Typically, these add-ons will
6278be installed under $prefix with the rest
6279of this package. However, you may wish to install such add-ons
6280elsewhere under a different prefix.
6281
6282If you do not wish to put everything under a single prefix, that's
6283ok. You will be prompted for the individual locations; this siteprefix
6284is only used to suggest the defaults.
6285
6286The default should be fine for most people.
6287
6288EOM
6289fn=d~+
6290rp='Installation prefix to use for add-on modules and utilities?'
6291: XXX Here might be another good place for an installstyle setting.
6292case "$siteprefix" in
6293'') dflt=$prefix ;;
6294*) dflt=$siteprefix ;;
6295esac
6296. ./getfile
6297: XXX Prefixit unit does not yet support siteprefix and vendorprefix
6298oldsiteprefix=''
6299case "$siteprefix" in
6300'') ;;
6301*) case "$ans" in
6302 "$prefix") ;;
6303 *) oldsiteprefix="$prefix";;
6304 esac
6305 ;;
6306esac
6307siteprefix="$ans"
6308siteprefixexp="$ansexp"
6309
6310: determine where site specific libraries go.
6311: Usual default is /usr/local/lib/perl5/site_perl/$version
6312: The default "style" setting is made in installstyle.U
6313: XXX No longer works with Prefixit stuff.
6314prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6315case "$sitelib" in
6316'') case "$installstyle" in
6317 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6318 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6319 esac
6320 ;;
6321*) dflt="$sitelib"
6322 ;;
6323esac
6324$cat <<EOM
6325
6326The installation process will create a directory for
6327site-specific extensions and modules. Most users find it convenient
6328to place all site-specific files in this directory rather than in the
6329main distribution directory.
6330
6331EOM
6332fn=d~+
6333rp='Pathname for the site-specific library files?'
6334. ./getfile
6335prefixvar=sitelib
6336. ./setprefixvar
6337sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6338
6339: Determine list of previous versions to include in @INC
6340$cat > getverlist <<EOPL
6341#!$perl5 -w
6342use File::Basename;
6343\$api_versionstring = "$api_versionstring";
6344\$version = "$version";
6345\$stem = "$sitelib_stem";
6346\$archname = "$archname";
6347EOPL
6348 $cat >> getverlist <<'EOPL'
6349# Can't have leading @ because metaconfig interprets it as a command!
6350;@inc_version_list=();
6351# XXX Redo to do opendir/readdir?
6352if (-d $stem) {
6353 chdir($stem);
6354 ;@candidates = glob("5.*");
6355}
6356else {
6357 ;@candidates = ();
6358}
6359
6360# XXX ToDo: These comparisons must be reworked when two-digit
6361# subversions come along, so that 5.7.10 compares as greater than
6362# 5.7.3! By that time, hope that 5.6.x is sufficiently
6363# widespread that we can use the built-in version vectors rather
6364# than reinventing them here. For 5.6.0, however, we must
6365# assume this script will likely be run by 5.005_0x. --AD 1/2000.
6366foreach $d (@candidates) {
6367 if ($d lt $version) {
6368 if ($d ge $api_versionstring) {
6369 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6370 }
6371 elsif ($d ge "5.005") {
6372 unshift(@inc_version_list, grep { -d } $d);
6373 }
6374 }
6375 else {
6376 # Skip newer version. I.e. don't look in
6377 # 5.7.0 if we're installing 5.6.1.
6378 }
6379}
6380
6381if (@inc_version_list) {
6382 print join(' ', @inc_version_list);
6383}
6384else {
6385 # Blank space to preserve value for next Configure run.
6386 print " ";
6387}
6388EOPL
6389chmod +x getverlist
6390case "$inc_version_list" in
6391'') if test -x "$perl5$exe_ext"; then
6392 dflt=`$perl5 getverlist`
6393 else
6394 dflt='none'
6395 fi
6396 ;;
6397$undef) dflt='none' ;;
6398*) eval dflt=\"$inc_version_list\" ;;
6399esac
6400case "$dflt" in
6401''|' ') dflt=none ;;
6402esac
6403case "$dflt" in
64045.005) dflt=none ;;
6405esac
6406$cat <<EOM
6407
6408In order to ease the process of upgrading, this version of perl
6409can be configured to use modules built and installed with earlier
6410versions of perl that were installed under $prefix. Specify here
6411the list of earlier versions that this version of perl should check.
6412If Configure detected no earlier versions of perl installed under
6413$prefix, then the list will be empty. Answer 'none' to tell perl
6414to not search earlier versions.
6415
6416The default should almost always be sensible, so if you're not sure,
6417just accept the default.
6418EOM
6419
6420rp='List of earlier versions to include in @INC?'
6421. ./myread
6422case "$ans" in
6423[Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6424*) inc_version_list="$ans" ;;
6425esac
6426case "$inc_version_list" in
6427''|' ')
6428 inc_version_list_init='0'
6429 d_inc_version_list="$undef"
6430 ;;
6431*) inc_version_list_init=`echo $inc_version_list |
6432 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6433 d_inc_version_list="$define"
6434 ;;
6435esac
6436$rm -f getverlist
6437
6438: see if this is a malloc.h system
6439: we want a real compile instead of Inhdr because some systems have a
6440: malloc.h that just gives a compile error saying to use stdlib.h instead
6441echo " "
6442$cat >try.c <<EOCP
6443#include <stdlib.h>
6444#include <malloc.h>
6445int main () { return 0; }
6446EOCP
6447set try
6448if eval $compile; then
6449 echo "<malloc.h> found." >&4
6450 val="$define"
6451else
6452 echo "<malloc.h> NOT found." >&4
6453 val="$undef"
6454fi
6455$rm -f try.c try
6456set i_malloc
6457eval $setvar
6458
6459: check for void type
6460echo " "
6461echo "Checking to see how well your C compiler groks the void type..." >&4
6462case "$voidflags" in
6463'')
6464 $cat >try.c <<EOCP
6465#$i_stdlib I_STDLIB
6466#ifdef I_STDLIB
6467#include <stdlib.h>
6468#endif
6469#if TRY & 1
6470void sub() {
6471#else
6472sub() {
6473#endif
6474 extern void moo(); /* function returning void */
6475 void (*goo)(); /* ptr to func returning void */
6476#if TRY & 8
6477 void *hue; /* generic ptr */
6478#endif
6479#if TRY & 2
6480 void (*foo[10])();
6481#endif
6482
6483#if TRY & 4
6484 if(goo == moo) {
6485 exit(0);
6486 }
6487#endif
6488 exit(0);
6489}
6490int main() { sub(); }
6491EOCP
6492 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6493 voidflags=$defvoidused
6494 echo "Good. It appears to support void to the level $package wants.">&4
6495 if $contains warning .out >/dev/null 2>&1; then
6496 echo "However, you might get some warnings that look like this:"
6497 $cat .out
6498 fi
6499 else
6500echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6501 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6502 echo "It supports 1..."
6503 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6504 echo "It also supports 2..."
6505 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6506 voidflags=7
6507 echo "And it supports 4 but not 8 definitely."
6508 else
6509 echo "It doesn't support 4..."
6510 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6511 voidflags=11
6512 echo "But it supports 8."
6513 else
6514 voidflags=3
6515 echo "Neither does it support 8."
6516 fi
6517 fi
6518 else
6519 echo "It does not support 2..."
6520 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6521 voidflags=13
6522 echo "But it supports 4 and 8."
6523 else
6524 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6525 voidflags=5
6526 echo "And it supports 4 but has not heard about 8."
6527 else
6528 echo "However it supports 8 but not 4."
6529 fi
6530 fi
6531 fi
6532 else
6533 echo "There is no support at all for void."
6534 voidflags=0
6535 fi
6536 fi
6537esac
6538case "$voidflags" in
6539"$defvoidused") ;;
6540*) $cat >&4 <<'EOM'
6541 Support flag bits are:
6542 1: basic void declarations.
6543 2: arrays of pointers to functions returning void.
6544 4: operations between pointers to and addresses of void functions.
6545 8: generic void pointers.
6546EOM
6547 dflt="$voidflags";
6548 rp="Your void support flags add up to what?"
6549 . ./myread
6550 voidflags="$ans"
6551 ;;
6552esac
6553$rm -f try.* .out
6554
6555: check for length of pointer
6556echo " "
6557case "$ptrsize" in
6558'')
6559 echo "Checking to see how big your pointers are..." >&4
6560 if test "$voidflags" -gt 7; then
6561 echo '#define VOID_PTR char *' > try.c
6562 else
6563 echo '#define VOID_PTR void *' > try.c
6564 fi
6565 $cat >>try.c <<EOCP
6566#include <stdio.h>
6567#$i_stdlib I_STDLIB
6568#ifdef I_STDLIB
6569#include <stdlib.h>
6570#endif
6571int main()
6572{
6573 printf("%d\n", (int)sizeof(VOID_PTR));
6574 exit(0);
6575}
6576EOCP
6577 set try
6578 if eval $compile_ok; then
6579 ptrsize=`$run ./try`
6580 echo "Your pointers are $ptrsize bytes long."
6581 else
6582 dflt='4'
6583 echo "(I can't seem to compile the test program. Guessing...)" >&4
6584 rp="What is the size of a pointer (in bytes)?"
6585 . ./myread
6586 ptrsize="$ans"
6587 fi
6588 ;;
6589esac
6590$rm -f try.c try
6591case "$use64bitall" in
6592"$define"|true|[yY]*)
6593 case "$ptrsize" in
6594 4) cat <<EOM >&4
6595
6596*** You have chosen a maximally 64-bit build,
6597*** but your pointers are only 4 bytes wide.
6598*** Please rerun Configure without -Duse64bitall.
6599EOM
6600 case "$d_quad" in
6601 define)
6602 cat <<EOM >&4
6603*** Since you have quads, you could possibly try with -Duse64bitint.
6604EOM
6605 ;;
6606 esac
6607 cat <<EOM >&4
6608*** Cannot continue, aborting.
6609
6610EOM
6611
6612 exit 1
6613 ;;
6614 esac
6615 ;;
6616esac
6617
6618
6619: determine whether to use malloc wrapping
6620echo " "
6621case "$usemallocwrap" in
6622[yY]*|true|$define) dflt='y' ;;
6623[nN]*|false|$undef) dflt='n' ;;
6624*) case "$usedevel" in
6625 [yY]*|true|$define) dflt='y' ;;
6626 *) dflt='n' ;;
6627 esac
6628 ;;
6629esac
6630rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6631. ./myread
6632usemallocwrap="$ans"
6633case "$ans" in
6634y*|true)
6635 usemallocwrap="$define" ;;
6636*)
6637 usemallocwrap="$undef" ;;
6638esac
6639
6640: determine which malloc to compile in
6641echo " "
6642case "$usemymalloc" in
6643[yY]*|true|$define) dflt='y' ;;
6644[nN]*|false|$undef) dflt='n' ;;
6645*) case "$ptrsize" in
6646 4) dflt='y' ;;
6647 *) dflt='n' ;;
6648 esac
6649 ;;
6650esac
6651rp="Do you wish to attempt to use the malloc that comes with $package?"
6652. ./myread
6653usemymalloc="$ans"
6654case "$ans" in
6655y*|true)
6656 usemymalloc='y'
6657 mallocsrc='malloc.c'
6658 mallocobj="malloc$_o"
6659 d_mymalloc="$define"
6660 case "$libs" in
6661 *-lmalloc*)
6662 : Remove malloc from list of libraries to use
6663 echo "Removing unneeded -lmalloc from library list" >&4
6664 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6665 shift
6666 libs="$*"
6667 echo "libs = $libs" >&4
6668 ;;
6669 esac
6670 ;;
6671*)
6672 usemymalloc='n'
6673 mallocsrc=''
6674 mallocobj=''
6675 d_mymalloc="$undef"
6676 ;;
6677esac
6678
6679: compute the return types of malloc and free
6680echo " "
6681$cat >malloc.c <<END
6682#$i_malloc I_MALLOC
6683#$i_stdlib I_STDLIB
6684#include <stdio.h>
6685#include <sys/types.h>
6686#ifdef I_MALLOC
6687#include <malloc.h>
6688#endif
6689#ifdef I_STDLIB
6690#include <stdlib.h>
6691#endif
6692#ifdef TRY_MALLOC
6693void *malloc();
6694#endif
6695#ifdef TRY_FREE
6696void free();
6697#endif
6698END
6699case "$malloctype" in
6700'')
6701 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6702 malloctype='void *'
6703 else
6704 malloctype='char *'
6705 fi
6706 ;;
6707esac
6708echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6709
6710case "$freetype" in
6711'')
6712 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6713 freetype='void'
6714 else
6715 freetype='int'
6716 fi
6717 ;;
6718esac
6719echo "Your system uses $freetype free(), it would seem." >&4
6720$rm -f malloc.[co]
6721: determine where site specific architecture-dependent libraries go.
6722: sitelib default is /usr/local/lib/perl5/site_perl/$version
6723: sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6724: sitelib may have an optional trailing /share.
6725case "$sitearch" in
6726'') dflt=`echo $sitelib | $sed 's,/share$,,'`
6727 dflt="$dflt/$archname"
6728 ;;
6729*) dflt="$sitearch"
6730 ;;
6731esac
6732set sitearch sitearch none
6733eval $prefixit
6734$cat <<EOM
6735
6736The installation process will also create a directory for
6737architecture-dependent site-specific extensions and modules.
6738
6739EOM
6740fn=d~+
6741rp='Pathname for the site-specific architecture-dependent library files?'
6742. ./getfile
6743prefixvar=sitearch
6744. ./setprefixvar
6745if $test X"$sitearch" = X"$sitelib"; then
6746 d_sitearch="$undef"
6747else
6748 d_sitearch="$define"
6749fi
6750
6751$cat <<EOM
6752
6753The installation process will also create a directory for
6754vendor-supplied add-ons. Vendors who supply perl with their system
6755may find it convenient to place all vendor-supplied files in this
6756directory rather than in the main distribution directory. This will
6757ease upgrades between binary-compatible maintenance versions of perl.
6758
6759Of course you may also use these directories in whatever way you see
6760fit. For example, you might use them to access modules shared over a
6761company-wide network.
6762
6763The default answer should be fine for most people.
6764This causes further questions about vendor add-ons to be skipped
6765and no vendor-specific directories will be configured for perl.
6766
6767EOM
6768rp='Do you want to configure vendor-specific add-on directories?'
6769case "$usevendorprefix" in
6770define|true|[yY]*) dflt=y ;;
6771*) : User may have set vendorprefix directly on Configure command line.
6772 case "$vendorprefix" in
6773 ''|' ') dflt=n ;;
6774 *) dflt=y ;;
6775 esac
6776 ;;
6777esac
6778. ./myread
6779case "$ans" in
6780[yY]*) fn=d~+
6781 rp='Installation prefix to use for vendor-supplied add-ons?'
6782 case "$vendorprefix" in
6783 '') dflt='' ;;
6784 *) dflt=$vendorprefix ;;
6785 esac
6786 . ./getfile
6787 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6788 oldvendorprefix=''
6789 case "$vendorprefix" in
6790 '') ;;
6791 *) case "$ans" in
6792 "$prefix") ;;
6793 *) oldvendorprefix="$prefix";;
6794 esac
6795 ;;
6796 esac
6797 usevendorprefix="$define"
6798 vendorprefix="$ans"
6799 vendorprefixexp="$ansexp"
6800 ;;
6801*) usevendorprefix="$undef"
6802 vendorprefix=''
6803 vendorprefixexp=''
6804 ;;
6805esac
6806
6807case "$vendorprefix" in
6808'') d_vendorlib="$undef"
6809 vendorlib=''
6810 vendorlibexp=''
6811 ;;
6812*) d_vendorlib="$define"
6813 : determine where vendor-supplied modules go.
6814 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6815 case "$vendorlib" in
6816 '')
6817 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6818 case "$installstyle" in
6819 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6820 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6821 esac
6822 ;;
6823 *) dflt="$vendorlib"
6824 ;;
6825 esac
6826 fn=d~+
6827 rp='Pathname for the vendor-supplied library files?'
6828 . ./getfile
6829 vendorlib="$ans"
6830 vendorlibexp="$ansexp"
6831 ;;
6832esac
6833vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6834prefixvar=vendorlib
6835. ./installprefix
6836
6837case "$vendorprefix" in
6838'') d_vendorarch="$undef"
6839 vendorarch=''
6840 vendorarchexp=''
6841 ;;
6842*) d_vendorarch="$define"
6843 : determine where vendor-supplied architecture-dependent libraries go.
6844 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6845 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6846 : vendorlib may have an optional trailing /share.
6847 case "$vendorarch" in
6848 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6849 dflt="$dflt/$archname"
6850 ;;
6851 *) dflt="$vendorarch" ;;
6852 esac
6853 fn=d~+
6854 rp='Pathname for vendor-supplied architecture-dependent files?'
6855 . ./getfile
6856 vendorarch="$ans"
6857 vendorarchexp="$ansexp"
6858 ;;
6859esac
6860prefixvar=vendorarch
6861. ./installprefix
6862
6863: Final catch-all directories to search
6864$cat <<EOM
6865
6866Lastly, you can have perl look in other directories for extensions and
6867modules in addition to those already specified.
6868These directories will be searched after
6869 $sitearch
6870 $sitelib
6871EOM
6872test X"$vendorlib" != "X" && echo ' ' $vendorlib
6873test X"$vendorarch" != "X" && echo ' ' $vendorarch
6874echo ' '
6875case "$otherlibdirs" in
6876''|' ') dflt='none' ;;
6877*) dflt="$otherlibdirs" ;;
6878esac
6879$cat <<EOM
6880Enter a colon-separated set of extra paths to include in perl's @INC
6881search path, or enter 'none' for no extra paths.
6882
6883EOM
6884
6885rp='Colon-separated list of additional directories for perl to search?'
6886. ./myread
6887case "$ans" in
6888' '|''|none) otherlibdirs=' ' ;;
6889*) otherlibdirs="$ans" ;;
6890esac
6891case "$otherlibdirs" in
6892' ') val=$undef ;;
6893*) val=$define ;;
6894esac
6895set d_perl_otherlibdirs
6896eval $setvar
6897
6898: Cruising for prototypes
6899echo " "
6900echo "Checking out function prototypes..." >&4
6901$cat >prototype.c <<EOCP
6902#$i_stdlib I_STDLIB
6903#ifdef I_STDLIB
6904#include <stdlib.h>
6905#endif
6906int main(int argc, char *argv[]) {
6907 exit(0);}
6908EOCP
6909if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6910 echo "Your C compiler appears to support function prototypes."
6911 val="$define"
6912else
6913 echo "Your C compiler doesn't seem to understand function prototypes."
6914 val="$undef"
6915fi
6916set prototype
6917eval $setvar
6918$rm -f prototype*
6919
6920case "$prototype" in
6921"$define") ;;
6922*) ansi2knr='ansi2knr'
6923 echo " "
6924 cat <<EOM >&4
6925
6926$me: FATAL ERROR:
6927This version of $package can only be compiled by a compiler that
6928understands function prototypes. Unfortunately, your C compiler
6929 $cc $ccflags
6930doesn't seem to understand them. Sorry about that.
6931
6932If GNU cc is available for your system, perhaps you could try that instead.
6933
6934Eventually, we hope to support building Perl with pre-ANSI compilers.
6935If you would like to help in that effort, please contact <perlbug@perl.org>.
6936
6937Aborting Configure now.
6938EOM
6939 exit 2
6940 ;;
6941esac
6942
6943echo " "
6944case "$extras" in
6945'') dflt='n';;
6946*) dflt='y';;
6947esac
6948cat <<EOM
6949Perl can be built with extra modules or bundles of modules which
6950will be fetched from the CPAN and installed alongside Perl.
6951
6952Notice that you will need access to the CPAN; either via the Internet,
6953or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6954be asked later to configure the CPAN.pm module which will in turn do
6955the installation of the rest of the extra modules or bundles.)
6956
6957Notice also that if the modules require any external software such as
6958libraries and headers (the libz library and the zlib.h header for the
6959Compress::Zlib module, for example) you MUST have any such software
6960already installed, this configuration process will NOT install such
6961things for you.
6962
6963If this doesn't make any sense to you, just accept the default '$dflt'.
6964EOM
6965rp='Install any extra modules (y or n)?'
6966. ./myread
6967case "$ans" in
6968y|Y)
6969 cat <<EOM
6970
6971Please list any extra modules or bundles to be installed from CPAN,
6972with spaces between the names. The names can be in any format the
6973'install' command of CPAN.pm will understand. (Answer 'none',
6974without the quotes, to install no extra modules or bundles.)
6975EOM
6976 rp='Extras?'
6977 dflt="$extras"
6978 . ./myread
6979 extras="$ans"
6980esac
6981case "$extras" in
6982''|'none')
6983 val=''
6984 $rm -f ../extras.lst
6985 ;;
6986*) echo "(Saving the list of extras for later...)"
6987 echo "$extras" > ../extras.lst
6988 val="'$extras'"
6989 ;;
6990esac
6991set extras
6992eval $setvar
6993echo " "
6994
6995: determine where html pages for programs go
6996set html1dir html1dir none
6997eval $prefixit
6998$cat <<EOM
6999
7000If you wish to install html files for programs in $spackage, indicate
7001the appropriate directory here. To skip installing html files,
7002answer "none".
7003EOM
7004case "$html1dir" in
7005''|none|$undef|' ') dflt=none ;;
7006*) dflt=$html1dir ;;
7007esac
7008fn=dn+~
7009rp="Directory for the main $spackage html pages?"
7010. ./getfile
7011prefixvar=html1dir
7012. ./setprefixvar
7013: Use ' ' for none so value is preserved next time through Configure
7014$test X"$html1dir" = "X" && html1dir=' '
7015
7016: determine where html pages for libraries and modules go
7017set html3dir html3dir none
7018eval $prefixit
7019$cat <<EOM
7020
7021If you wish to install html files for modules associated with $spackage,
7022indicate the appropriate directory here. To skip installing html files,
7023answer "none".
7024EOM
7025: There is no obvious default. If they have specified html1dir, then
7026: try to key off that, possibly changing .../html1 into .../html3.
7027case "$html3dir" in
7028'') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
7029*) dflt=$html3dir ;;
7030esac
7031fn=dn+~
7032rp="Directory for the $spackage module html pages?"
7033. ./getfile
7034prefixvar=html3dir
7035. ./setprefixvar
7036: Use ' ' for none so value is preserved next time through Configure
7037$test X"$html3dir" = "X" && html3dir=' '
7038
7039: determine whether to install perl also as /usr/bin/perl
7040
7041echo " "
7042if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7043 $cat <<EOM
7044Many scripts expect perl to be installed as /usr/bin/perl.
7045
7046If you want to, I can install the perl you are about to compile
7047as /usr/bin/perl (in addition to $bin/perl).
7048EOM
7049 if test -f /usr/bin/perl; then
7050 $cat <<EOM
7051
7052However, please note that because you already have a /usr/bin/perl,
7053overwriting that with a new Perl would very probably cause problems.
7054Therefore I'm assuming you don't want to do that (unless you insist).
7055
7056EOM
7057 case "$installusrbinperl" in
7058 "$define"|[yY]*) dflt='y';;
7059 *) dflt='n';;
7060 esac
7061 else
7062 $cat <<EOM
7063
7064Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
7065
7066EOM
7067 case "$installusrbinperl" in
7068 "$undef"|[nN]*) dflt='n';;
7069 *) dflt='y';;
7070 esac
7071 fi
7072 rp="Do you want to install perl as /usr/bin/perl?"
7073 . ./myread
7074 case "$ans" in
7075 [yY]*) val="$define";;
7076 *) val="$undef" ;;
7077 esac
7078else
7079 val="$undef"
7080fi
7081set installusrbinperl
7082eval $setvar
7083
7084echo " "
7085echo "Checking for GNU C Library..." >&4
7086cat >try.c <<'EOCP'
7087/* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
7088 alone are insufficient to distinguish different versions, such as
7089 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
7090 libc version 2.1.0. A. Dougherty, June 3, 2002.
7091*/
7092#include <stdio.h>
7093int main(void)
7094{
7095#ifdef __GLIBC__
7096# ifdef __GLIBC_MINOR__
7097# if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
7098# include <gnu/libc-version.h>
7099 printf("%s\n", gnu_get_libc_version());
7100# else
7101 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7102# endif
7103# else
7104 printf("%d\n", __GLIBC__);
7105# endif
7106 return 0;
7107#else
7108 return 1;
7109#endif
7110}
7111EOCP
7112set try
7113if eval $compile_ok && $run ./try > glibc.ver; then
7114 val="$define"
7115 gnulibc_version=`$cat glibc.ver`
7116 echo "You are using the GNU C Library version $gnulibc_version"
7117else
7118 val="$undef"
7119 gnulibc_version=''
7120 echo "You are not using the GNU C Library"
7121fi
7122$rm -f try try.* glibc.ver
7123set d_gnulibc
7124eval $setvar
7125
7126: see if nm is to be used to determine whether a symbol is defined or not
7127case "$usenm" in
7128'')
7129 dflt=''
7130 case "$d_gnulibc" in
7131 "$define")
7132 echo " "
7133 echo "nm probably won't work on the GNU C Library." >&4
7134 dflt=n
7135 ;;
7136 esac
7137 case "$dflt" in
7138 '')
7139 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7140 echo " "
7141 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7142 echo "'nm' won't be sufficient on this sytem." >&4
7143 dflt=n
7144 fi
7145 ;;
7146 esac
7147 case "$dflt" in
7148 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7149 if $test $dflt -gt 20; then
7150 dflt=y
7151 else
7152 dflt=n
7153 fi
7154 ;;
7155 esac
7156 ;;
7157*)
7158 case "$usenm" in
7159 true|$define) dflt=y;;
7160 *) dflt=n;;
7161 esac
7162 ;;
7163esac
7164$cat <<EOM
7165
7166I can use $nm to extract the symbols from your C libraries. This
7167is a time consuming task which may generate huge output on the disk (up
7168to 3 megabytes) but that should make the symbols extraction faster. The
7169alternative is to skip the 'nm' extraction part and to compile a small
7170test program instead to determine whether each symbol is present. If
7171you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7172this may be the best solution.
7173
7174You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7175
7176EOM
7177rp="Shall I use $nm to extract C symbols from the libraries?"
7178. ./myread
7179case "$ans" in
7180[Nn]*) usenm=false;;
7181*) usenm=true;;
7182esac
7183
7184runnm=$usenm
7185case "$reuseval" in
7186true) runnm=false;;
7187esac
7188
7189: nm options which may be necessary
7190case "$nm_opt" in
7191'') if $test -f /mach_boot; then
7192 nm_opt='' # Mach
7193 elif $test -d /usr/ccs/lib; then
7194 nm_opt='-p' # Solaris (and SunOS?)
7195 elif $test -f /dgux; then
7196 nm_opt='-p' # DG-UX
7197 elif $test -f /lib64/rld; then
7198 nm_opt='-p' # 64-bit Irix
7199 else
7200 nm_opt=''
7201 fi;;
7202esac
7203
7204: nm options which may be necessary for shared libraries but illegal
7205: for archive libraries. Thank you, Linux.
7206case "$nm_so_opt" in
7207'') case "$myuname" in
7208 *linux*|gnu*)
7209 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7210 nm_so_opt='--dynamic'
7211 fi
7212 ;;
7213 esac
7214 ;;
7215esac
7216
7217case "$runnm" in
7218true)
7219: get list of predefined functions in a handy place
7220echo " "
7221case "$libc" in
7222'') libc=unknown
7223 case "$libs" in
7224 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7225 esac
7226 ;;
7227esac
7228case "$libs" in
7229'') ;;
7230*) for thislib in $libs; do
7231 case "$thislib" in
7232 -lc|-lc_s)
7233 : Handle C library specially below.
7234 ;;
7235 -l*)
7236 thislib=`echo $thislib | $sed -e 's/^-l//'`
7237 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7238 :
7239 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7240 :
7241 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7242 :
7243 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7244 :
7245 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7246 :
7247 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7248 :
7249 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7250 :
7251 else
7252 try=''
7253 fi
7254 libnames="$libnames $try"
7255 ;;
7256 *) libnames="$libnames $thislib" ;;
7257 esac
7258 done
7259 ;;
7260esac
7261xxx=normal
7262case "$libc" in
7263unknown)
7264 set /lib/libc.$so
7265 for xxx in $libpth; do
7266 $test -r $1 || set $xxx/libc.$so
7267 : The messy sed command sorts on library version numbers.
7268 $test -r $1 || \
7269 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7270 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7271 h
7272 s/[0-9][0-9]*/0000&/g
7273 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7274 G
7275 s/\n/ /' | \
7276 $sort | $sed -e 's/^.* //'`
7277 eval set \$$#
7278 done
7279 $test -r $1 || set /usr/ccs/lib/libc.$so
7280 $test -r $1 || set /lib/libsys_s$_a
7281 ;;
7282*)
7283 set blurfl
7284 ;;
7285esac
7286if $test -r "$1"; then
7287 echo "Your (shared) C library seems to be in $1."
7288 libc="$1"
7289elif $test -r /lib/libc && $test -r /lib/clib; then
7290 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7291 xxx=apollo
7292 libc='/lib/clib /lib/libc'
7293 if $test -r /lib/syslib; then
7294 echo "(Your math library is in /lib/syslib.)"
7295 libc="$libc /lib/syslib"
7296 fi
7297elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7298 echo "Your C library seems to be in $libc, as you said before."
7299elif $test -r $incpath/usr/lib/libc$_a; then
7300 libc=$incpath/usr/lib/libc$_a;
7301 echo "Your C library seems to be in $libc. That's fine."
7302elif $test -r /lib/libc$_a; then
7303 libc=/lib/libc$_a;
7304 echo "Your C library seems to be in $libc. You're normal."
7305else
7306 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7307 :
7308 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7309 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7310 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7311 :
7312 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7313 :
7314 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7315 :
7316 else
7317 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7318 fi
7319 if $test -r "$tans"; then
7320 echo "Your C library seems to be in $tans, of all places."
7321 libc=$tans
7322 else
7323 libc='blurfl'
7324 fi
7325fi
7326if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7327 dflt="$libc"
7328 cat <<EOM
7329
7330If the guess above is wrong (which it might be if you're using a strange
7331compiler, or your machine supports multiple models), you can override it here.
7332
7333EOM
7334else
7335 dflt=''
7336 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7337 cat >&4 <<EOM
7338I can't seem to find your C library. I've looked in the following places:
7339
7340EOM
7341 $sed 's/^/ /' libpath
7342 cat <<EOM
7343
7344None of these seems to contain your C library. I need to get its name...
7345
7346EOM
7347fi
7348fn=f
7349rp='Where is your C library?'
7350. ./getfile
7351libc="$ans"
7352
7353echo " "
7354echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7355set X `cat libnames`
7356shift
7357xxx=files
7358case $# in 1) xxx=file; esac
7359echo "Extracting names from the following $xxx for later perusal:" >&4
7360echo " "
7361$sed 's/^/ /' libnames >&4
7362echo " "
7363$echo $n "This may take a while...$c" >&4
7364
7365for file in $*; do
7366 case $file in
7367 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7368 *) $nm $nm_opt $file 2>/dev/null;;
7369 esac
7370done >libc.tmp
7371
7372$echo $n ".$c"
7373$grep fprintf libc.tmp > libc.ptf
7374xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7375xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7376xxx='[ADTSIW]'
7377if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7378 eval $xscan;\
7379 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7380 eval $xrun
7381elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7382 eval $xscan;\
7383 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7384 eval $xrun
7385elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7386 eval $xscan;\
7387 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7388 eval $xrun
7389elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7390 eval $xscan;\
7391 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7392 eval $xrun
7393elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7394 eval $xscan;\
7395 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7396 eval $xrun
7397elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7398 eval $xscan;\
7399 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7400 eval $xrun
7401elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7402 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7403 eval $xscan;\
7404 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7405 eval $xrun
7406elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7407 eval $xscan;\
7408 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7409 eval $xrun
7410elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7411 eval $xscan;\
7412 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7413 eval $xrun
7414elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7415 eval $xscan;\
7416 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7417 eval $xrun
7418elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7419 eval $xscan;\
7420 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7421 eval $xrun
7422elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7423 eval $xscan;\
7424 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7425 eval $xrun
7426elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7427 eval $xscan;\
7428 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7429 eval $xrun
7430elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7431 eval $xscan;\
7432 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7433 eval $xrun
7434else
7435 $nm -p $* 2>/dev/null >libc.tmp
7436 $grep fprintf libc.tmp > libc.ptf
7437 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7438 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7439 then
7440 nm_opt='-p'
7441 eval $xrun
7442 else
7443 echo " "
7444 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7445 com=''
7446 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7447 for thisname in $libnames $libc; do
7448 $ar t $thisname >>libc.tmp
7449 done
7450 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7451 echo "Ok." >&4
7452 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7453 # Repeat libc to extract forwarders to DLL entries too
7454 for thisname in $libnames $libc; do
7455 $ar tv $thisname >>libc.tmp
7456 # Revision 50 of EMX has bug in $ar.
7457 # it will not extract forwarders to DLL entries
7458 # Use emximp which will extract exactly them.
7459 emximp -o tmp.imp $thisname \
7460 2>/dev/null && \
7461 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7462 < tmp.imp >>libc.tmp
7463 $rm tmp.imp
7464 done
7465 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7466 echo "Ok." >&4
7467 else
7468 echo "$ar didn't seem to work right." >&4
7469 echo "Maybe this is a Cray...trying bld instead..." >&4
7470 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7471 then
7472 for thisname in $libnames; do
7473 bld t $libnames | \
7474 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7475 $ar t $thisname >>libc.tmp
7476 done
7477 echo "Ok." >&4
7478 else
7479 echo "That didn't work either. Giving up." >&4
7480 exit 1
7481 fi
7482 fi
7483 fi
7484fi
7485nm_extract="$com"
7486case "$PASE" in
7487define)
7488 echo " "
7489 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7490 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7491 ;;
7492*) if $test -f /lib/syscalls.exp; then
7493 echo " "
7494 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7495 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7496 fi
7497 ;;
7498esac
7499;;
7500esac
7501$rm -f libnames libpath
7502
7503: see if dld is available
7504set dld.h i_dld
7505eval $inhdr
7506
7507: is a C symbol defined?
7508csym='tlook=$1;
7509case "$3" in
7510-v) tf=libc.tmp; tdc="";;
7511-a) tf=libc.tmp; tdc="[]";;
7512*) tlook="^$1\$"; tf=libc.list; tdc="()";;
7513esac;
7514tx=yes;
7515case "$reuseval-$4" in
7516true-) ;;
7517true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7518esac;
7519case "$tx" in
7520yes)
7521 tval=false;
7522 if $test "$runnm" = true; then
7523 if $contains $tlook $tf >/dev/null 2>&1; then
7524 tval=true;
7525 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7526 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7527 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7528 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7529 $rm -f try$_exe try.c core core.* try.core;
7530 fi;
7531 else
7532 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7533 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7534 $rm -f try$_exe try.c;
7535 fi;
7536 ;;
7537*)
7538 case "$tval" in
7539 $define) tval=true;;
7540 *) tval=false;;
7541 esac;
7542 ;;
7543esac;
7544eval "$2=$tval"'
7545
7546: define an is-in-libc? function
7547inlibc='echo " "; td=$define; tu=$undef;
7548sym=$1; var=$2; eval "was=\$$2";
7549tx=yes;
7550case "$reuseval$was" in
7551true) ;;
7552true*) tx=no;;
7553esac;
7554case "$tx" in
7555yes)
7556 set $sym tres -f;
7557 eval $csym;
7558 case "$tres" in
7559 true)
7560 echo "$sym() found." >&4;
7561 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7562 *)
7563 echo "$sym() NOT found." >&4;
7564 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7565 esac;;
7566*)
7567 case "$was" in
7568 $define) echo "$sym() found." >&4;;
7569 *) echo "$sym() NOT found." >&4;;
7570 esac;;
7571esac'
7572
7573
7574echo " "
7575echo "Checking for C++..." >&4
7576cat >try.c <<'EOCP'
7577#include <stdio.h>
7578int main(void)
7579{
7580#ifdef __cplusplus
7581 printf("define\n");
7582#else
7583 printf("undef\n");
7584#endif
7585 return 0;
7586}
7587EOCP
7588set try
7589if eval $compile_ok && $run ./try >cplusplus$$; then
7590 val=`$cat cplusplus$$`
7591 echo "You are using a C++ compiler."
7592else
7593 val="$undef"
7594 echo "You are not using a C++ compiler."
7595fi
7596$rm -f try try.* cplusplus$$
7597set d_cplusplus
7598eval $setvar
7599
7600: see if dlopen exists
7601xxx_runnm="$runnm"
7602xxx_ccflags="$ccflags"
7603runnm=false
7604: with g++ one needs -shared to get is-in-libc to work for dlopen
7605case "$gccversion" in
7606'') ;;
7607*) case "$d_cplusplus" in
7608 "$define") ccflags="$ccflags -shared" ;;
7609 esac
7610 ;;
7611esac
7612set dlopen d_dlopen
7613eval $inlibc
7614runnm="$xxx_runnm"
7615ccflags="$xxx_ccflags"
7616
7617: see if this is a unistd.h system
7618set unistd.h i_unistd
7619eval $inhdr
7620
7621: determine which dynamic loading, if any, to compile in
7622echo " "
7623dldir="ext/DynaLoader"
7624case "$usedl" in
7625$define|y|true)
7626 dflt='y'
7627 usedl="$define"
7628 ;;
7629$undef|n|false)
7630 dflt='n'
7631 usedl="$undef"
7632 ;;
7633*)
7634 dflt='n'
7635 case "$d_dlopen" in
7636 $define) dflt='y' ;;
7637 esac
7638 case "$i_dld" in
7639 $define) dflt='y' ;;
7640 esac
7641 : Does a dl_xxx.xs file exist for this operating system
7642 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7643 ;;
7644esac
7645rp="Do you wish to use dynamic loading?"
7646. ./myread
7647usedl="$ans"
7648case "$ans" in
7649y*) usedl="$define"
7650 case "$dlsrc" in
7651 '')
7652 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7653 dflt="$dldir/dl_${osname}.xs"
7654 elif $test "$d_dlopen" = "$define" ; then
7655 dflt="$dldir/dl_dlopen.xs"
7656 elif $test "$i_dld" = "$define" ; then
7657 dflt="$dldir/dl_dld.xs"
7658 else
7659 dflt=''
7660 fi
7661 ;;
7662 *) dflt="$dldir/$dlsrc"
7663 ;;
7664 esac
7665 echo "The following dynamic loading files are available:"
7666 : Can not go over to $dldir because getfile has path hard-coded in.
7667 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7668 rp="Source file to use for dynamic loading"
7669 fn="fne"
7670 gfpth="$src"
7671 . ./getfile
7672 usedl="$define"
7673 : emulate basename
7674 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7675
7676 $cat << EOM
7677
7678Some systems may require passing special flags to $cc -c to
7679compile modules that will be used to create a shared library.
7680To use no flags, say "none".
7681
7682EOM
7683 case "$cccdlflags" in
7684 '') case "$gccversion" in
7685 '') case "$osname" in
7686 hpux) dflt='+z' ;;
7687 next) dflt='none' ;;
7688 irix*) dflt='-KPIC' ;;
7689 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7690 sunos) dflt='-pic' ;;
7691 *) dflt='none' ;;
7692 esac
7693 ;;
7694 *) case "$osname" in
7695 darwin) dflt='none' ;;
7696 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7697 *) dflt='-fpic' ;;
7698 esac ;;
7699 esac ;;
7700 ' ') dflt='none' ;;
7701 *) dflt="$cccdlflags" ;;
7702 esac
7703 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7704 . ./myread
7705 case "$ans" in
7706 none) cccdlflags=' ' ;;
7707 *) cccdlflags="$ans" ;;
7708 esac
7709
7710 cat << EOM
7711
7712Some systems use ld to create libraries that can be dynamically loaded,
7713while other systems (such as those using ELF) use $cc.
7714
7715EOM
7716 case "$ld" in
7717 '') $cat >try.c <<EOM
7718/* Test for whether ELF binaries are produced */
7719#include <fcntl.h>
7720#$i_stdlib I_STDLIB
7721#ifdef I_STDLIB
7722#include <stdlib.h>
7723#endif
7724#$i_unistd I_UNISTD
7725#ifdef I_UNISTD
7726#include <unistd.h>
7727#endif
7728int main() {
7729 char b[4];
7730 int i = open("a.out",O_RDONLY);
7731 if(i == -1)
7732 exit(1); /* fail */
7733 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7734 exit(0); /* succeed (yes, it's ELF) */
7735 else
7736 exit(1); /* fail */
7737}
7738EOM
7739 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7740 cat <<EOM
7741You appear to have ELF support. I'll use $cc to build dynamic libraries.
7742EOM
7743 dflt="$cc"
7744 else
7745 echo "I'll use ld to build dynamic libraries."
7746 dflt='ld'
7747 fi
7748 rm -f try.c a.out
7749 ;;
7750 *) dflt="$ld"
7751 ;;
7752 esac
7753
7754 rp="What command should be used to create dynamic libraries?"
7755 . ./myread
7756 ld="$ans"
7757
7758 cat << EOM
7759
7760Some systems may require passing special flags to $ld to create a
7761library that can be dynamically loaded. If your ld flags include
7762-L/other/path options to locate libraries outside your loader's normal
7763search path, you may need to specify those -L options here as well. To
7764use no flags, say "none".
7765
7766EOM
7767 case "$lddlflags" in
7768 '') case "$osname" in
7769 beos) dflt='-nostart' ;;
7770 hpux) dflt='-b';
7771 case "$gccversion" in
7772 '') dflt="$dflt +vnocompatwarnings" ;;
7773 esac
7774 ;;
7775 linux|irix*|gnu*) dflt='-shared' ;;
7776 next) dflt='none' ;;
7777 solaris) dflt='-G' ;;
7778 sunos) dflt='-assert nodefinitions' ;;
7779 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7780 *) dflt='none' ;;
7781 esac
7782 ;;
7783 *) dflt="$lddlflags" ;;
7784 esac
7785
7786 : Try to guess additional flags to pick up local libraries.
7787 : Be careful not to append to a plain 'none'
7788 case "$dflt" in
7789 none) dflt='' ;;
7790 esac
7791 for thisflag in $ldflags; do
7792 case "$thisflag" in
7793 -L*|-R*|-Wl,-R*)
7794 case " $dflt " in
7795 *" $thisflag "*) ;;
7796 *) dflt="$dflt $thisflag" ;;
7797 esac
7798 ;;
7799 esac
7800 done
7801
7802 case "$dflt" in
7803 ''|' ') dflt='none' ;;
7804 esac
7805
7806 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7807 . ./myread
7808 case "$ans" in
7809 none) lddlflags=' ' ;;
7810 *) lddlflags="$ans" ;;
7811 esac
7812
7813 cat <<EOM
7814
7815Some systems may require passing special flags to $cc to indicate that
7816the resulting executable will use dynamic linking. To use no flags,
7817say "none".
7818
7819EOM
7820 case "$ccdlflags" in
7821 '') case "$osname" in
7822 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7823 next|sunos) dflt='none' ;;
7824 *) dflt='none' ;;
7825 esac ;;
7826 ' ') dflt='none' ;;
7827 *) dflt="$ccdlflags" ;;
7828 esac
7829 rp="Any special flags to pass to $cc to use dynamic linking?"
7830 . ./myread
7831 case "$ans" in
7832 none) ccdlflags=' ' ;;
7833 *) ccdlflags="$ans" ;;
7834 esac
7835 ;;
7836*) usedl="$undef"
7837 ld='ld'
7838 dlsrc='dl_none.xs'
7839 lddlflags=''
7840 ccdlflags=''
7841 ;;
7842esac
7843
7844also=''
7845case "$usedl" in
7846$undef)
7847 # No dynamic loading being used, so don't bother even to prompt.
7848 useshrplib='false'
7849 ;;
7850*) case "$useshrplib" in
7851 '') case "$osname" in
7852 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7853 dflt=y
7854 also='Building a shared libperl is required for dynamic loading to work on your system.'
7855 ;;
7856 next*)
7857 case "$osvers" in
7858 4*) dflt=y
7859 also='Building a shared libperl is needed for MAB support.'
7860 ;;
7861 *) dflt=n
7862 ;;
7863 esac
7864 ;;
7865 *) dflt=n
7866 ;;
7867 esac
7868 ;;
7869 $define|true|[Yy]*)
7870 dflt=y
7871 ;;
7872 *) dflt=n
7873 ;;
7874 esac
7875 $cat << EOM
7876
7877The perl executable is normally obtained by linking perlmain.c with
7878libperl${_a}, any static extensions (usually just DynaLoader), and
7879any other libraries needed on this system (such as -lm, etc.). Since
7880your system supports dynamic loading, it is probably possible to build
7881a shared libperl.$so. If you will have more than one executable linked
7882to libperl.$so, this will significantly reduce the size of each
7883executable, but it may have a noticeable effect on performance. The
7884default is probably sensible for your system.
7885$also
7886
7887EOM
7888 rp="Build a shared libperl.$so (y/n)"
7889 . ./myread
7890 case "$ans" in
7891 true|$define|[Yy]*)
7892 useshrplib='true' ;;
7893 *) useshrplib='false' ;;
7894 esac
7895 ;;
7896esac
7897
7898case "$useshrplib" in
7899true)
7900 case "$libperl" in
7901 '')
7902 # Figure out a good name for libperl.so. Since it gets stored in
7903 # a version-specific architecture-dependent library, the version
7904 # number isn't really that important, except for making cc/ld happy.
7905 #
7906 # A name such as libperl.so.3.1
7907 majmin="libperl.$so.$patchlevel.$subversion"
7908 # A name such as libperl.so.301
7909 majonly=`echo $patchlevel $subversion |
7910 $awk '{printf "%d%02d", $1, $2}'`
7911 majonly=libperl.$so.$majonly
7912 # I'd prefer to keep the os-specific stuff here to a minimum, and
7913 # rely on figuring it out from the naming of libc.
7914 case "${osname}${osvers}" in
7915 next4*)
7916 dflt=libperl.5.$so
7917 # XXX How handle the --version stuff for MAB?
7918 ;;
7919 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7920 dflt=libperl.$so
7921 ;;
7922 cygwin*) # ld links against an importlib
7923 dflt=libperl$lib_ext
7924 ;;
7925 *) # Try to guess based on whether libc has major.minor.
7926 case "$libc" in
7927 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7928 *libc.$so.[0-9]*) dflt=$majonly ;;
7929 *) dflt=libperl.$so ;;
7930 esac
7931 ;;
7932 esac
7933 ;;
7934 *) dflt=$libperl
7935 ;;
7936 esac
7937 cat << EOM
7938
7939I need to select a good name for the shared libperl. If your system uses
7940library names with major and minor numbers, then you might want something
7941like $majmin. Alternatively, if your system uses a single version
7942number for shared libraries, then you might want to use $majonly.
7943Or, your system might be quite happy with a simple libperl.$so.
7944
7945Since the shared libperl will get installed into a version-specific
7946architecture-dependent directory, the version number of the shared perl
7947library probably isn't important, so the default should be o.k.
7948
7949EOM
7950 rp='What name do you want to give to the shared libperl?'
7951 . ./myread
7952 libperl=$ans
7953 echo "Ok, I'll use $libperl"
7954 ;;
7955*)
7956 libperl="libperl${_a}"
7957 ;;
7958esac
7959
7960# Detect old use of shrpdir via undocumented Configure -Dshrpdir
7961case "$shrpdir" in
7962'') ;;
7963*) $cat >&4 <<EOM
7964WARNING: Use of the shrpdir variable for the installation location of
7965the shared $libperl is not supported. It was never documented and
7966will not work in this version. Let me (perlbug@perl.org)
7967know of any problems this may cause.
7968
7969EOM
7970 case "$shrpdir" in
7971 "$archlibexp/CORE")
7972 $cat >&4 <<EOM
7973But your current setting of $shrpdir is
7974the default anyway, so it's harmless.
7975EOM
7976 ;;
7977 *)
7978 $cat >&4 <<EOM
7979Further, your current attempted setting of $shrpdir
7980conflicts with the value of $archlibexp/CORE
7981that installperl will use.
7982EOM
7983 ;;
7984 esac
7985 ;;
7986esac
7987
7988# How will the perl executable find the installed shared $libperl?
7989# Add $xxx to ccdlflags.
7990# If we can't figure out a command-line option, use $shrpenv to
7991# set env LD_RUN_PATH. The main perl makefile uses this.
7992shrpdir=$archlibexp/CORE
7993xxx=''
7994tmp_shrpenv=''
7995if "$useshrplib"; then
7996 case "$osname" in
7997 aix)
7998 # We'll set it in Makefile.SH...
7999 ;;
8000 solaris)
8001 xxx="-R $shrpdir"
8002 ;;
8003 freebsd|netbsd|openbsd|interix|dragonfly)
8004 xxx="-Wl,-R$shrpdir"
8005 ;;
8006 bsdos|linux|irix*|dec_osf|gnu*)
8007 xxx="-Wl,-rpath,$shrpdir"
8008 ;;
8009 next)
8010 # next doesn't like the default...
8011 ;;
8012 beos)
8013 # beos doesn't like the default, either.
8014 ;;
8015 hpux*)
8016 # hpux doesn't like the default, either.
8017 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
8018 ;;
8019 *)
8020 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
8021 ;;
8022 esac
8023 case "$xxx" in
8024 '') ;;
8025 *)
8026 # Only add $xxx if it isn't already in ccdlflags.
8027 case " $ccdlflags " in
8028 *" $xxx "*) ;;
8029 *) ccdlflags="$ccdlflags $xxx"
8030 cat <<EOM >&4
8031
8032Adding $xxx to the flags
8033passed to $ld so that the perl executable will find the
8034installed shared $libperl.
8035
8036EOM
8037 ;;
8038 esac
8039 ;;
8040 esac
8041fi
8042# Fix ccdlflags in AIX for building external extensions.
8043# (For building Perl itself bare -bE:perl.exp is needed,
8044# Makefile.SH takes care of this.)
8045case "$osname" in
8046aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
8047esac
8048# Respect a hint or command-line value.
8049case "$shrpenv" in
8050'') shrpenv="$tmp_shrpenv" ;;
8051esac
8052case "$ldlibpthname" in
8053'') ldlibpthname=LD_LIBRARY_PATH ;;
8054none) ldlibpthname='' ;;
8055esac
8056
8057: determine where manual pages are on this system
8058echo " "
8059case "$sysman" in
8060'')
8061 syspath='/usr/share/man/man1 /usr/man/man1'
8062 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
8063 syspath="$syspath /usr/man/u_man/man1"
8064 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
8065 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
8066 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
8067 sysman=`./loc . /usr/man/man1 $syspath`
8068 ;;
8069esac
8070if $test -d "$sysman"; then
8071 echo "System manual is in $sysman." >&4
8072else
8073 echo "Could not find manual pages in source form." >&4
8074fi
8075
8076: determine where manual pages go
8077set man1dir man1dir none
8078eval $prefixit
8079$cat <<EOM
8080
8081$spackage has manual pages available in source form.
8082EOM
8083case "$nroff" in
8084nroff)
8085 echo "However, you don't have nroff, so they're probably useless to you."
8086 case "$man1dir" in
8087 '') man1dir="none";;
8088 esac;;
8089esac
8090echo "If you don't want the manual sources installed, answer 'none'."
8091case "$man1dir" in
8092' ') dflt=none
8093 ;;
8094'')
8095 lookpath="$prefixexp/share/man/man1"
8096 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
8097 lookpath="$lookpath $prefixexp/man/p_man/man1"
8098 lookpath="$lookpath $prefixexp/man/u_man/man1"
8099 lookpath="$lookpath $prefixexp/man/man.1"
8100 case "$sysman" in
8101 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
8102 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
8103 esac
8104 set dflt
8105 eval $prefixup
8106 ;;
8107*) dflt="$man1dir"
8108 ;;
8109esac
8110echo " "
8111fn=dn+~
8112rp="Where do the main $spackage manual pages (source) go?"
8113. ./getfile
8114if $test "X$man1direxp" != "X$ansexp"; then
8115 installman1dir=''
8116fi
8117prefixvar=man1dir
8118. ./setprefixvar
8119
8120case "$man1dir" in
8121'') man1dir=' '
8122 installman1dir='';;
8123esac
8124
8125: What suffix to use on installed man pages
8126
8127case "$man1dir" in
8128' ')
8129 man1ext='0'
8130 ;;
8131*)
8132 rp="What suffix should be used for the main $spackage man pages?"
8133 case "$man1ext" in
8134 '') case "$man1dir" in
8135 *1) dflt=1 ;;
8136 *1p) dflt=1p ;;
8137 *1pm) dflt=1pm ;;
8138 *l) dflt=l;;
8139 *n) dflt=n;;
8140 *o) dflt=o;;
8141 *p) dflt=p;;
8142 *C) dflt=C;;
8143 *L) dflt=L;;
8144 *L1) dflt=L1;;
8145 *) dflt=1;;
8146 esac
8147 ;;
8148 *) dflt="$man1ext";;
8149 esac
8150 . ./myread
8151 man1ext="$ans"
8152 ;;
8153esac
8154
8155: see if we can have long filenames
8156echo " "
8157first=123456789abcdef
8158$rm -f $first
8159if (echo hi >$first) 2>/dev/null; then
8160 if $test -f 123456789abcde; then
8161 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8162 val="$undef"
8163 else
8164 echo 'You can have filenames longer than 14 characters.'>&4
8165 val="$define"
8166 fi
8167else
8168 $cat <<'EOM'
8169You can't have filenames longer than 14 chars.
8170You can't even think about them!
8171EOM
8172 val="$undef"
8173fi
8174set d_flexfnam
8175eval $setvar
8176$rm -rf 123456789abcde*
8177
8178: determine where library module manual pages go
8179set man3dir man3dir none
8180eval $prefixit
8181$cat <<EOM
8182
8183$spackage has manual pages for many of the library modules.
8184EOM
8185
8186case "$nroff" in
8187nroff)
8188 $cat <<'EOM'
8189However, you don't have nroff, so they're probably useless to you.
8190EOM
8191 case "$man3dir" in
8192 '') man3dir="none";;
8193 esac;;
8194esac
8195
8196case "$d_flexfnam" in
8197undef)
8198 $cat <<'EOM'
8199However, your system can't handle the long file names like File::Basename.3.
8200EOM
8201 case "$man3dir" in
8202 '') man3dir="none";;
8203 esac;;
8204esac
8205
8206echo "If you don't want the manual sources installed, answer 'none'."
8207prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8208case "$man3dir" in
8209'') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8210 if $test -d "$privlib/man/man3"; then
8211 cat <<EOM >&4
8212
8213WARNING: Previous versions of perl installed man3 pages into
8214$privlib/man/man3. This version will suggest a
8215new default of $dflt.
8216EOM
8217 tdflt=$dflt
8218 dflt='n'
8219 rp='Do you wish to preserve the old behavior?(y/n)'
8220 . ./myread
8221 case "$ans" in
8222 y*) dflt="$privlib/man/man3" ;;
8223 *) dflt=$tdflt ;;
8224 esac
8225 fi
8226 ;;
8227*) dflt="$man3dir" ;;
8228esac
8229case "$dflt" in
8230' ') dflt=none ;;
8231esac
8232echo " "
8233fn=dn+~
8234rp="Where do the $package library man pages (source) go?"
8235. ./getfile
8236prefixvar=man3dir
8237. ./setprefixvar
8238
8239case "$man3dir" in
8240'') man3dir=' '
8241 installman3dir='';;
8242esac
8243
8244: What suffix to use on installed man pages
8245case "$man3dir" in
8246' ')
8247 man3ext='0'
8248 ;;
8249*)
8250 rp="What suffix should be used for the $package library man pages?"
8251 case "$man3ext" in
8252 '') case "$man3dir" in
8253 *3) dflt=3 ;;
8254 *3p) dflt=3p ;;
8255 *3pm) dflt=3pm ;;
8256 *l) dflt=l;;
8257 *n) dflt=n;;
8258 *o) dflt=o;;
8259 *p) dflt=p;;
8260 *C) dflt=C;;
8261 *L) dflt=L;;
8262 *L3) dflt=L3;;
8263 *) dflt=3;;
8264 esac
8265 ;;
8266 *) dflt="$man3ext";;
8267 esac
8268 . ./myread
8269 man3ext="$ans"
8270 ;;
8271esac
8272
8273: see if we have to deal with yellow pages, now NIS.
8274if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8275 if $test -f /usr/etc/nibindd; then
8276 echo " "
8277 echo "I'm fairly confident you're on a NeXT."
8278 echo " "
8279 rp='Do you get the hosts file via NetInfo?'
8280 dflt=y
8281 case "$hostcat" in
8282 nidump*) ;;
8283 '') ;;
8284 *) dflt=n;;
8285 esac
8286 . ./myread
8287 case "$ans" in
8288 y*) hostcat='nidump hosts .';;
8289 *) case "$hostcat" in
8290 nidump*) hostcat='';;
8291 esac
8292 ;;
8293 esac
8294 fi
8295 case "$hostcat" in
8296 nidump*) ;;
8297 *)
8298 case "$hostcat" in
8299 *ypcat*) dflt=y;;
8300 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8301 dflt=y
8302 else
8303 dflt=n
8304 fi;;
8305 *) dflt=n;;
8306 esac
8307 echo " "
8308 rp='Are you getting the hosts file via yellow pages?'
8309 . ./myread
8310 case "$ans" in
8311 y*) hostcat='ypcat hosts';;
8312 *) hostcat='cat /etc/hosts';;
8313 esac
8314 ;;
8315 esac
8316fi
8317case "$hostcat" in
8318'') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8319esac
8320case "$groupcat" in
8321'') test -f /etc/group && groupcat='cat /etc/group';;
8322esac
8323case "$passcat" in
8324'') test -f /etc/passwd && passcat='cat /etc/passwd';;
8325esac
8326
8327: now get the host name
8328echo " "
8329echo "Figuring out host name..." >&4
8330case "$myhostname" in
8331'') cont=true
8332 echo 'Maybe "hostname" will work...'
8333 if tans=`sh -c hostname 2>&1` ; then
8334 myhostname=$tans
8335 phostname=hostname
8336 cont=''
8337 fi
8338 ;;
8339*) cont='';;
8340esac
8341if $test "$cont"; then
8342 if ./xenix; then
8343 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8344 if tans=`cat /etc/systemid 2>&1` ; then
8345 myhostname=$tans
8346 phostname='cat /etc/systemid'
8347 echo "Whadyaknow. Xenix always was a bit strange..."
8348 cont=''
8349 fi
8350 elif $test -r /etc/systemid; then
8351 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8352 fi
8353fi
8354if $test "$cont"; then
8355 echo 'No, maybe "uuname -l" will work...'
8356 if tans=`sh -c 'uuname -l' 2>&1` ; then
8357 myhostname=$tans
8358 phostname='uuname -l'
8359 else
8360 echo 'Strange. Maybe "uname -n" will work...'
8361 if tans=`sh -c 'uname -n' 2>&1` ; then
8362 myhostname=$tans
8363 phostname='uname -n'
8364 else
8365 echo 'Oh well, maybe I can mine it out of whoami.h...'
8366 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8367 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8368 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8369 else
8370 case "$myhostname" in
8371 '') echo "Does this machine have an identity crisis or something?"
8372 phostname='';;
8373 *)
8374 echo "Well, you said $myhostname before..."
8375 phostname='echo $myhostname';;
8376 esac
8377 fi
8378 fi
8379 fi
8380fi
8381case "$myhostname" in
8382'') myhostname=noname ;;
8383esac
8384: you do not want to know about this
8385set $myhostname
8386myhostname=$1
8387
8388: verify guess
8389if $test "$myhostname" ; then
8390 dflt=y
8391 rp='Your host name appears to be "'$myhostname'".'" Right?"
8392 . ./myread
8393 case "$ans" in
8394 y*) ;;
8395 *) myhostname='';;
8396 esac
8397fi
8398
8399: bad guess or no guess
8400while $test "X$myhostname" = X ; do
8401 dflt=''
8402 rp="Please type the (one word) name of your host:"
8403 . ./myread
8404 myhostname="$ans"
8405done
8406
8407: translate upper to lower if necessary
8408case "$myhostname" in
8409*[A-Z]*)
8410 echo "(Normalizing case in your host name)"
8411 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8412 ;;
8413esac
8414
8415case "$myhostname" in
8416*.*)
8417 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8418 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8419 echo "(Trimming domain name from host name--host name is now $myhostname)"
8420 ;;
8421*) case "$mydomain" in
8422 '')
8423 {
8424 test "X$hostcat" = "Xypcat hosts" &&
8425 ypmatch "$myhostname" hosts 2>/dev/null |\
8426 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8427 $test -s hosts
8428 } || {
8429 test "X$hostcat" != "X" &&
8430 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8431 /[ ]$myhostname[ . ]/p" > hosts
8432 }
8433 tmp_re="[ . ]"
8434 if $test -f hosts; then
8435 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8436 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8437 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8438 hosts | $sort | $uniq | \
8439 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8440 case `$echo X$dflt` in
8441 X*\ *) echo "(Several hosts in the database matched hostname)"
8442 dflt=.
8443 ;;
8444 X.) echo "(You do not have fully-qualified names in the hosts database)"
8445 ;;
8446 esac
8447 else
8448 echo "(I cannot locate a hosts database anywhere)"
8449 dflt=.
8450 fi
8451 case "$dflt" in
8452 .)
8453 tans=`./loc resolv.conf X /etc /usr/etc`
8454 if $test -f "$tans"; then
8455 echo "(Attempting domain name extraction from $tans)"
8456 dflt=.`$sed -n -e 's/ / /g' \
8457 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8458 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8459 case "$dflt" in
8460 .) dflt=.`$sed -n -e 's/ / /g' \
8461 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8462 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8463 ;;
8464 esac
8465 fi
8466 ;;
8467 esac
8468 case "$dflt" in
8469 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8470 dflt=.`sh -c domainname 2>/dev/null`
8471 case "$dflt" in
8472 '') dflt='.';;
8473 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8474 esac
8475 ;;
8476 esac
8477 case "$dflt$osname" in
8478 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8479 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8480 ;;
8481 esac
8482 case "$dflt" in
8483 .) echo "(Lost all hope -- silly guess then)"
8484 dflt='.nonet'
8485 ;;
8486 esac
8487 $rm -f hosts
8488 ;;
8489 *) dflt="$mydomain";;
8490 esac;;
8491esac
8492echo " "
8493rp="What is your domain name?"
8494. ./myread
8495tans="$ans"
8496case "$ans" in
8497'') ;;
8498.*) ;;
8499*) tans=".$tans";;
8500esac
8501mydomain="$tans"
8502
8503: translate upper to lower if necessary
8504case "$mydomain" in
8505*[A-Z]*)
8506 echo "(Normalizing case in your domain name)"
8507 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8508 ;;
8509esac
8510
8511: a little sanity check here
8512case "$phostname" in
8513'') ;;
8514*)
8515 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8516 $myhostname$mydomain|$myhostname) ;;
8517 *)
8518 case "$phostname" in
8519 sed*)
8520 echo "(That doesn't agree with your whoami.h file, by the way.)"
8521 ;;
8522 *)
8523 echo "(That doesn't agree with your $phostname command, by the way.)"
8524 ;;
8525 esac
8526 ;;
8527 esac
8528 ;;
8529esac
8530
8531$cat <<EOM
8532
8533I need to get your e-mail address in Internet format if possible, i.e.
8534something like user@host.domain. Please answer accurately since I have
8535no easy means to double check it. The default value provided below
8536is most probably close to reality but may not be valid from outside
8537your organization...
8538
8539EOM
8540cont=x
8541while test "$cont"; do
8542 case "$cf_email" in
8543 '') dflt="$cf_by@$myhostname$mydomain";;
8544 *) dflt="$cf_email";;
8545 esac
8546 rp='What is your e-mail address?'
8547 . ./myread
8548 cf_email="$ans"
8549 case "$cf_email" in
8550 *@*.*) cont='' ;;
8551 *)
8552 rp='Address does not look like an Internet one. Use it anyway?'
8553 case "$fastread" in
8554 yes) dflt=y ;;
8555 *) dflt=n ;;
8556 esac
8557 . ./myread
8558 case "$ans" in
8559 y*) cont='' ;;
8560 *) echo " " ;;
8561 esac
8562 ;;
8563 esac
8564done
8565
8566$cat <<EOM
8567
8568If you or somebody else will be maintaining perl at your site, please
8569fill in the correct e-mail address here so that they may be contacted
8570if necessary. Currently, the "perlbug" program included with perl
8571will send mail to this address in addition to perlbug@perl.org. You may
8572enter "none" for no administrator.
8573
8574EOM
8575case "$perladmin" in
8576'') dflt="$cf_email";;
8577*) dflt="$perladmin";;
8578esac
8579rp='Perl administrator e-mail address'
8580. ./myread
8581perladmin="$ans"
8582
8583: determine whether to only install version-specific parts.
8584echo " "
8585$cat <<EOM
8586Do you want to install only the version-specific parts of the perl
8587distribution? Usually you do *not* want to do this.
8588EOM
8589case "$versiononly" in
8590"$define"|[Yy]*|true) dflt='y' ;;
8591*) dflt='n';
8592esac
8593rp="Do you want to install only the version-specific parts of perl?"
8594. ./myread
8595case "$ans" in
8596[yY]*) val="$define";;
8597*) val="$undef" ;;
8598esac
8599set versiononly
8600eval $setvar
8601
8602case "$versiononly" in
8603"$define") inc_version_list=''
8604 inc_version_list_init=0
8605 ;;
8606esac
8607
8608: figure out how to guarantee perl startup
8609: XXX Note that this currently takes advantage of the bug that binexp ignores
8610: the Configure -Dinstallprefix setting, which in turn means that under
8611: relocatable @INC, initialinstalllocation is what binexp started as.
8612case "$startperl" in
8613'')
8614 case "$sharpbang" in
8615 *!)
8616 $cat <<EOH
8617
8618I can use the #! construct to start perl on your system. This will
8619make startup of perl scripts faster, but may cause problems if you
8620want to share those scripts and perl is not in a standard place
8621($initialinstalllocation/perl) on all your platforms. The alternative
8622is to force a shell by starting the script with a single ':' character.
8623
8624EOH
8625 case "$versiononly" in
8626 "$define") dflt="$initialinstalllocation/perl$version";;
8627 *) dflt="$initialinstalllocation/perl";;
8628 esac
8629 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8630 . ./myread
8631 case "$ans" in
8632 none) startperl=": # use perl";;
8633 *) startperl="#!$ans"
8634 if $test 30 -lt `echo "$ans" | wc -c`; then
8635 $cat >&4 <<EOM
8636
8637WARNING: Some systems limit the #! command to 32 characters.
8638If you experience difficulty running Perl scripts with #!, try
8639installing Perl in a directory with a shorter pathname.
8640
8641EOM
8642 fi ;;
8643 esac
8644 ;;
8645 *) startperl=": # use perl"
8646 ;;
8647 esac
8648 ;;
8649esac
8650echo "I'll use $startperl to start perl scripts."
8651
8652: figure best path for perl in scripts
8653case "$perlpath" in
8654'')
8655 case "$versiononly" in
8656 "$define") perlpath="$initialinstalllocation/perl$version";;
8657 *) perlpath="$initialinstalllocation/perl";;
8658 esac
8659 case "$startperl" in
8660 *!*) ;;
8661 *)
8662 $cat <<EOH
8663
8664I will use the "eval 'exec'" idiom to start Perl on your system.
8665I can use the full path of your Perl binary for this purpose, but
8666doing so may cause problems if you want to share those scripts and
8667Perl is not always in a standard place ($initialinstalllocation/perl).
8668
8669EOH
8670 dflt="$initialinstalllocation/perl"
8671 rp="What path shall I use in \"eval 'exec'\"?"
8672 . ./myread
8673 perlpath="$ans"
8674 ;;
8675 esac
8676 ;;
8677esac
8678case "$startperl" in
8679*!*) ;;
8680*) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8681esac
8682
8683: determine where public executable scripts go
8684set scriptdir scriptdir
8685eval $prefixit
8686case "$scriptdir" in
8687'')
8688 dflt="$bin"
8689 : guess some guesses
8690 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8691 $test -d /usr/share/bin && dflt=/usr/share/bin
8692 $test -d /usr/local/script && dflt=/usr/local/script
8693 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8694 $test -d $prefixexp/script && dflt=$prefixexp/script
8695 set dflt
8696 eval $prefixup
8697 ;;
8698*) dflt="$scriptdir"
8699 ;;
8700esac
8701$cat <<EOM
8702
8703Some installations have a separate directory just for executable scripts so
8704that they can mount it across multiple architectures but keep the scripts in
8705one spot. You might, for example, have a subdirectory of /usr/share for this.
8706Or you might just lump your scripts in with all your other executables.
8707
8708EOM
8709fn=d~
8710rp='Where do you keep publicly executable scripts?'
8711. ./getfile
8712if $test "X$ansexp" != "X$scriptdirexp"; then
8713 installscript=''
8714fi
8715installscriptdir=''
8716prefixvar=scriptdir
8717. ./setprefixvar
8718: A little fix up for an irregularly named variable.
8719installscript="$installscriptdir"
8720
8721: determine where add-on public executables go
8722case "$sitebin" in
8723'') dflt=$siteprefix/bin ;;
8724*) dflt=$sitebin ;;
8725esac
8726fn=d~
8727rp='Pathname where the add-on public executables should be installed?'
8728. ./getfile
8729prefixvar=sitebin
8730. ./setprefixvar
8731
8732: determine where add-on html pages go
8733: There is no standard location, so try to copy the previously-selected
8734: directory structure for the core html pages.
8735case "$sitehtml1dir" in
8736'') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8737*) dflt=$sitehtml1dir ;;
8738esac
8739case "$dflt" in
8740''|' ') dflt=none ;;
8741esac
8742fn=dn+~
8743rp='Pathname where the site-specific html pages should be installed?'
8744. ./getfile
8745prefixvar=sitehtml1dir
8746. ./setprefixvar
8747
8748: determine where add-on library html pages go
8749: There is no standard location, so try to copy the previously-selected
8750: directory structure for the core html pages.
8751case "$sitehtml3dir" in
8752'') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8753*) dflt=$sitehtml3dir ;;
8754esac
8755case "$dflt" in
8756''|' ') dflt=none ;;
8757esac
8758fn=dn+~
8759rp='Pathname where the site-specific library html pages should be installed?'
8760. ./getfile
8761prefixvar=sitehtml3dir
8762. ./setprefixvar
8763
8764: determine where add-on manual pages go
8765case "$siteman1dir" in
8766'') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8767*) dflt=$siteman1dir ;;
8768esac
8769case "$dflt" in
8770''|' ') dflt=none ;;
8771esac
8772fn=dn+~
8773rp='Pathname where the site-specific manual pages should be installed?'
8774. ./getfile
8775prefixvar=siteman1dir
8776. ./setprefixvar
8777
8778: determine where add-on library man pages go
8779case "$siteman3dir" in
8780'') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8781*) dflt=$siteman3dir ;;
8782esac
8783case "$dflt" in
8784''|' ') dflt=none ;;
8785esac
8786fn=dn+~
8787rp='Pathname where the site-specific library manual pages should be installed?'
8788. ./getfile
8789prefixvar=siteman3dir
8790. ./setprefixvar
8791
8792: determine where add-on public executable scripts go
8793case "$sitescript" in
8794'') dflt=$siteprefix/script
8795 $test -d $dflt || dflt=$sitebin ;;
8796*) dflt="$sitescript" ;;
8797esac
8798fn=d~+
8799rp='Pathname where add-on public executable scripts should be installed?'
8800. ./getfile
8801prefixvar=sitescript
8802. ./setprefixvar
8803
8804case "$usefaststdio" in
8805$define|true|[yY]*|'')
8806 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8807 case "$xversion" in
8808 [68]) dflt='y' ;;
8809 *) dflt='n' ;;
8810 esac
8811 ;;
8812*) dflt='n';;
8813esac
8814cat <<EOM
8815
8816Perl can be built to use 'fast stdio', which means using the stdio
8817library but also directly manipulating the stdio buffers to enable
8818faster I/O. Using stdio is better for backward compatibility (especially
8819for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8820interface has been preferred instead of stdio.
8821
8822If this doesn't make any sense to you, just accept the default '$dflt'.
8823EOM
8824rp='Use the "fast stdio" if available?'
8825. ./myread
8826case "$ans" in
8827y|Y) val="$define" ;;
8828*) val="$undef" ;;
8829esac
8830set usefaststdio
8831eval $setvar
8832
8833
8834: define an is-a-typedef? function
8835typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8836case "$inclist" in
8837"") inclist="sys/types.h";;
8838esac;
8839eval "varval=\$$var";
8840case "$varval" in
8841"")
8842 $rm -f temp.c;
8843 for inc in $inclist; do
8844 echo "#include <$inc>" >>temp.c;
8845 done;
8846 echo "#ifdef $type" >> temp.c;
8847 echo "printf(\"We have $type\");" >> temp.c;
8848 echo "#endif" >> temp.c;
8849 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8850 if $contains $type temp.E >/dev/null 2>&1; then
8851 eval "$var=\$type";
8852 else
8853 eval "$var=\$def";
8854 fi;
8855 $rm -f temp.?;;
8856*) eval "$var=\$varval";;
8857esac'
8858
8859: define an is-a-typedef? function that prompts if the type is not available.
8860typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8861case "$inclist" in
8862"") inclist="sys/types.h";;
8863esac;
8864eval "varval=\$$var";
8865case "$varval" in
8866"")
8867 $rm -f temp.c;
8868 for inc in $inclist; do
8869 echo "#include <$inc>" >>temp.c;
8870 done;
8871 echo "#ifdef $type" >> temp.c;
8872 echo "printf(\"We have $type\");" >> temp.c;
8873 echo "#endif" >> temp.c;
8874 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8875 echo " " ;
8876 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8877 if $contains $type temp.E >/dev/null 2>&1; then
8878 echo "$type found." >&4;
8879 eval "$var=\$type";
8880 else
8881 echo "$type NOT found." >&4;
8882 dflt="$def";
8883 . ./myread ;
8884 eval "$var=\$ans";
8885 fi;
8886 $rm -f temp.?;;
8887*) eval "$var=\$varval";;
8888esac'
8889
8890: see what type lseek is declared as in the kernel
8891rp="What is the type used for lseek's offset on this system?"
8892set off_t lseektype long stdio.h sys/types.h
8893eval $typedef_ask
8894
8895echo " "
8896echo "Checking to see how big your file offsets are..." >&4
8897$cat >try.c <<EOCP
8898#include <sys/types.h>
8899#include <stdio.h>
8900int main()
8901{
8902 printf("%d\n", (int)sizeof($lseektype));
8903 return(0);
8904}
8905EOCP
8906set try
8907if eval $compile_ok; then
8908 lseeksize=`$run ./try`
8909 echo "Your file offsets are $lseeksize bytes long."
8910else
8911 dflt=$longsize
8912 echo " "
8913 echo "(I can't seem to compile the test program. Guessing...)"
8914 rp="What is the size of your file offsets (in bytes)?"
8915 . ./myread
8916 lseeksize="$ans"
8917fi
8918$rm -f try.c try
8919
8920: see what type file positions are declared as in the library
8921rp="What is the type for file position used by fsetpos()?"
8922set fpos_t fpostype long stdio.h sys/types.h
8923eval $typedef_ask
8924
8925echo " "
8926case "$fpostype" in
8927*_t) zzz="$fpostype" ;;
8928*) zzz="fpos_t" ;;
8929esac
8930echo "Checking the size of $zzz..." >&4
8931cat > try.c <<EOCP
8932#include <sys/types.h>
8933#include <stdio.h>
8934#$i_stdlib I_STDLIB
8935#ifdef I_STDLIB
8936#include <stdlib.h>
8937#endif
8938int main() {
8939 printf("%d\n", (int)sizeof($fpostype));
8940 exit(0);
8941}
8942EOCP
8943set try
8944if eval $compile_ok; then
8945 yyy=`$run ./try`
8946 case "$yyy" in
8947 '') fpossize=4
8948 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8949 ;;
8950 *) fpossize=$yyy
8951 echo "Your $zzz is $fpossize bytes long."
8952 ;;
8953 esac
8954else
8955 dflt="$longsize"
8956 echo " " >&4
8957 echo "(I can't compile the test program. Guessing...)" >&4
8958 rp="What is the size of your file positions (in bytes)?"
8959 . ./myread
8960 fpossize="$ans"
8961fi
8962
8963# Backward compatibility (uselfs is deprecated).
8964case "$uselfs" in
8965"$define"|true|[yY]*)
8966 cat <<EOM >&4
8967
8968*** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8969EOM
8970 uselargefiles="$define"
8971 ;;
8972esac
8973
8974case "$lseeksize:$fpossize" in
89758:8) cat <<EOM
8976
8977You can have files larger than 2 gigabytes.
8978EOM
8979 val="$define" ;;
8980*) case "$uselargefiles" in
8981 "$undef"|false|[nN]*) dflt='n' ;;
8982 *) dflt='y' ;;
8983 esac
8984 cat <<EOM
8985
8986Perl can be built to understand large files (files larger than 2 gigabytes)
8987on some systems. To do so, Configure can be run with -Duselargefiles.
8988
8989If this doesn't make any sense to you, just accept the default '$dflt'.
8990EOM
8991 rp='Try to understand large files, if available?'
8992 . ./myread
8993 case "$ans" in
8994 y|Y) val="$define" ;;
8995 *) val="$undef" ;;
8996 esac
8997 ;;
8998esac
8999set uselargefiles
9000eval $setvar
9001: Look for a hint-file generated 'call-back-unit'. If the
9002: user has specified that a large files perl is to be built,
9003: we may need to set or change some other defaults.
9004if $test -f uselargefiles.cbu; then
9005 echo "Your platform has some specific hints regarding large file builds, using them..."
9006 . ./uselargefiles.cbu
9007fi
9008case "$uselargefiles" in
9009"$define")
9010 if $test -f uselargefiles.cbu; then
9011 echo " "
9012 echo "Rechecking to see how big your file offsets are..." >&4
9013 $cat >try.c <<EOCP
9014#include <sys/types.h>
9015#include <stdio.h>
9016int main()
9017{
9018 printf("%d\n", (int)sizeof($lseektype));
9019 return(0);
9020}
9021EOCP
9022 set try
9023 if eval $compile_ok; then
9024 lseeksize=`$run ./try`
9025 $echo "Your file offsets are now $lseeksize bytes long."
9026 else
9027 dflt="$lseeksize"
9028 echo " "
9029 echo "(I can't seem to compile the test program. Guessing...)"
9030 rp="What is the size of your file offsets (in bytes)?"
9031 . ./myread
9032 lseeksize="$ans"
9033 fi
9034 case "$fpostype" in
9035 *_t) zzz="$fpostype" ;;
9036 *) zzz="fpos_t" ;;
9037 esac
9038 $echo $n "Rechecking the size of $zzz...$c" >&4
9039 $cat > try.c <<EOCP
9040#include <sys/types.h>
9041#include <stdio.h>
9042#$i_stdlib I_STDLIB
9043#ifdef I_STDLIB
9044#include <stdlib.h>
9045#endif
9046int main() {
9047 printf("%d\n", (int)sizeof($fpostype));
9048 return(0);
9049}
9050EOCP
9051 set try
9052 if eval $compile_ok; then
9053 yyy=`$run ./try`
9054 dflt="$lseeksize"
9055 case "$yyy" in
9056 '') echo " "
9057 echo "(I can't execute the test program--guessing $fpossize.)" >&4
9058 ;;
9059 *) fpossize=$yyy
9060 echo " $fpossize bytes." >&4
9061 ;;
9062 esac
9063 else
9064 dflt="$fpossize"
9065 echo " "
9066 echo "(I can't compile the test program. Guessing...)" >&4
9067 rp="What is the size of your file positions (in bytes)?"
9068 . ./myread
9069 fpossize="$ans"
9070 fi
9071 $rm -f try.c try
9072 fi
9073 ;;
9074esac
9075
9076case "$vendorprefix" in
9077'') d_vendorbin="$undef"
9078 vendorbin=''
9079 vendorbinexp=''
9080 ;;
9081*) d_vendorbin="$define"
9082 : determine where vendor-supplied executables go.
9083 case "$vendorbin" in
9084 '') dflt=$vendorprefix/bin ;;
9085 *) dflt="$vendorbin" ;;
9086 esac
9087 fn=d~+
9088 rp='Pathname for the vendor-supplied executables directory?'
9089 . ./getfile
9090 vendorbin="$ans"
9091 vendorbinexp="$ansexp"
9092 ;;
9093esac
9094prefixvar=vendorbin
9095. ./installprefix
9096
9097case "$vendorprefix" in
9098'') vendorhtml1dir=''
9099 vendorhtml1direxp=''
9100 ;;
9101*) : determine where vendor-supplied html pages go.
9102 : There is no standard location, so try to copy the previously-selected
9103 : directory structure for the core html pages.
9104 : XXX Better default suggestions would be welcome.
9105 case "$vendorhtml1dir" in
9106 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9107 *) dflt=$vendorhtml1dir ;;
9108 esac
9109 case "$dflt" in
9110 ''|' ') dflt=none ;;
9111 esac
9112 fn=dn+~
9113 rp='Pathname for the vendor-supplied html pages?'
9114 . ./getfile
9115 vendorhtml1dir="$ans"
9116 vendorhtml1direxp="$ansexp"
9117 ;;
9118esac
9119: Use ' ' for none so value is preserved next time through Configure
9120$test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9121prefixvar=vendorhtml1dir
9122. ./installprefix
9123
9124case "$vendorprefix" in
9125'') vendorhtml3dir=''
9126 vendorhtml3direxp=''
9127 ;;
9128*) : determine where vendor-supplied module html pages go.
9129 : There is no standard location, so try to copy the previously-selected
9130 : directory structure for the core html pages.
9131 : XXX Better default suggestions would be welcome.
9132 case "$vendorhtml3dir" in
9133 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9134 *) dflt=$vendorhtml3dir ;;
9135 esac
9136 case "$dflt" in
9137 ''|' ') dflt=none ;;
9138 esac
9139 fn=dn+~
9140 rp='Pathname for the vendor-supplied html pages?'
9141 . ./getfile
9142 vendorhtml3dir="$ans"
9143 vendorhtml3direxp="$ansexp"
9144 ;;
9145esac
9146: Use ' ' for none so value is preserved next time through Configure
9147$test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9148prefixvar=vendorhtml3dir
9149. ./installprefix
9150
9151case "$vendorprefix" in
9152'') vendorman1dir=''
9153 vendorman1direxp=''
9154 ;;
9155*) : determine where vendor-supplied manual pages go.
9156 case "$vendorman1dir" in
9157 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9158 *) dflt=$vendorman1dir ;;
9159 esac
9160 case "$dflt" in
9161 ''|' ') dflt=none ;;
9162 esac
9163 fn=nd~+
9164 rp='Pathname for the vendor-supplied manual section 1 pages?'
9165 . ./getfile
9166 vendorman1dir="$ans"
9167 vendorman1direxp="$ansexp"
9168 ;;
9169esac
9170: Use ' ' for none so value is preserved next time through Configure
9171$test X"$vendorman1dir" = "X" && vendorman1dir=' '
9172prefixvar=vendorman1dir
9173. ./installprefix
9174
9175case "$vendorprefix" in
9176'') vendorman3dir=''
9177 vendorman3direxp=''
9178 ;;
9179*) : determine where vendor-supplied module manual pages go.
9180 case "$vendorman3dir" in
9181 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9182 *) dflt=$vendorman3dir ;;
9183 esac
9184 case "$dflt" in
9185 ''|' ') dflt=none ;;
9186 esac
9187 fn=nd~+
9188 rp='Pathname for the vendor-supplied manual section 3 pages?'
9189 . ./getfile
9190 vendorman3dir="$ans"
9191 vendorman3direxp="$ansexp"
9192 ;;
9193esac
9194: Use ' ' for none so value is preserved next time through Configure
9195$test X"$vendorman3dir" = "X" && vendorman3dir=' '
9196prefixvar=vendorman3dir
9197. ./installprefix
9198
9199case "$vendorprefix" in
9200'') d_vendorscript="$undef"
9201 vendorscript=''
9202 vendorscriptexp=''
9203 ;;
9204*) d_vendorscript="$define"
9205 : determine where vendor-supplied scripts go.
9206 case "$vendorscript" in
9207 '') dflt=$vendorprefix/script
9208 $test -d $dflt || dflt=$vendorbin ;;
9209 *) dflt="$vendorscript" ;;
9210 esac
9211 $cat <<EOM
9212
9213The installation process will create a directory for
9214vendor-supplied scripts.
9215
9216EOM
9217 fn=d~+
9218 rp='Pathname for the vendor-supplied scripts directory?'
9219 . ./getfile
9220 vendorscript="$ans"
9221 vendorscriptexp="$ansexp"
9222 ;;
9223esac
9224prefixvar=vendorscript
9225. ./installprefix
9226
9227: see if qgcvt exists
9228set qgcvt d_qgcvt
9229eval $inlibc
9230
9231echo " "
9232
9233if $test X"$d_longdbl" = X"$define"; then
9234
9235echo "Checking how to print long doubles..." >&4
9236
9237if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9238 $cat >try.c <<'EOCP'
9239#include <sys/types.h>
9240#include <stdio.h>
9241int main() {
9242 double d = 123.456;
9243 printf("%.3f\n", d);
9244}
9245EOCP
9246 set try
9247 if eval $compile; then
9248 yyy=`$run ./try`
9249 case "$yyy" in
9250 123.456)
9251 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9252 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9253 echo "We will use %f."
9254 ;;
9255 esac
9256 fi
9257fi
9258
9259if $test X"$sPRIfldbl" = X; then
9260 $cat >try.c <<'EOCP'
9261#include <sys/types.h>
9262#include <stdio.h>
9263int main() {
9264 long double d = 123.456;
9265 printf("%.3Lf\n", d);
9266}
9267EOCP
9268 set try
9269 if eval $compile; then
9270 yyy=`$run ./try`
9271 case "$yyy" in
9272 123.456)
9273 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9274 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9275 echo "We will use %Lf."
9276 ;;
9277 esac
9278 fi
9279fi
9280
9281if $test X"$sPRIfldbl" = X; then
9282 $cat >try.c <<'EOCP'
9283#include <sys/types.h>
9284#include <stdio.h>
9285int main() {
9286 long double d = 123.456;
9287 printf("%.3llf\n", d);
9288}
9289EOCP
9290 set try
9291 if eval $compile; then
9292 yyy=`$run ./try`
9293 case "$yyy" in
9294 123.456)
9295 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9296 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9297 echo "We will use %llf."
9298 ;;
9299 esac
9300 fi
9301fi
9302
9303if $test X"$sPRIfldbl" = X; then
9304 $cat >try.c <<'EOCP'
9305#include <sys/types.h>
9306#include <stdio.h>
9307int main() {
9308 long double d = 123.456;
9309 printf("%.3lf\n", d);
9310}
9311EOCP
9312 set try
9313 if eval $compile; then
9314 yyy=`$run ./try`
9315 case "$yyy" in
9316 123.456)
9317 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9318 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9319 echo "We will use %lf."
9320 ;;
9321 esac
9322 fi
9323fi
9324
9325if $test X"$sPRIfldbl" = X; then
9326 echo "Cannot figure out how to print long doubles." >&4
9327else
9328 sSCNfldbl=$sPRIfldbl # expect consistency
9329fi
9330
9331$rm -f try try.*
9332
9333fi # d_longdbl
9334
9335case "$sPRIfldbl" in
9336'') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9337 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9338 d_SCNfldbl="$undef";
9339 ;;
9340*) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9341 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9342 d_SCNfldbl="$define";
9343 ;;
9344esac
9345
9346: Check how to convert floats to strings.
9347
9348if test "X$d_Gconvert" = X; then
9349
9350echo " "
9351echo "Checking for an efficient way to convert floats to strings."
9352echo " " > try.c
9353case "$uselongdouble" in
9354"$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9355esac
9356case "$d_longdbl" in
9357"$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9358esac
9359case "$d_PRIgldbl" in
9360"$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9361esac
9362$cat >>try.c <<EOP
9363#ifdef TRY_gconvert
9364#define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9365char *myname = "gconvert";
9366#endif
9367#ifdef TRY_gcvt
9368#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9369char *myname = "gcvt";
9370#endif
9371#ifdef TRY_qgcvt
9372#define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9373char *myname = "qgcvt";
9374#define DOUBLETYPE long double
9375#endif
9376#ifdef TRY_sprintf
9377#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9378#ifdef HAS_PRIgldbl
9379#define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9380#else
9381#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9382#endif
9383#else
9384#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9385#endif
9386char *myname = "sprintf";
9387#endif
9388
9389#ifndef DOUBLETYPE
9390#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9391#define DOUBLETYPE long double
9392#else
9393#define DOUBLETYPE double
9394#endif
9395#endif
9396
9397#include <stdio.h>
9398
9399#define I_STDLIB $i_stdlib
9400#ifdef I_STDLIB
9401#include <stdlib.h>
9402#endif
9403
9404int
9405checkit(expect, got)
9406char *expect;
9407char *got;
9408{
9409 if (strcmp(expect, got)) {
9410 printf("%s oddity: Expected %s, got %s\n",
9411 myname, expect, got);
9412 exit(1);
9413 }
9414}
9415
9416int main()
9417{
9418 char buf[64];
9419 buf[63] = '\0';
9420
9421 /* This must be 1st test on (which?) platform */
9422 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9423 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9424 checkit("0.1", buf);
9425
9426 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9427 checkit("0.01", buf);
9428
9429 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9430 checkit("0.001", buf);
9431
9432 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9433 checkit("0.0001", buf);
9434
9435 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9436 if (strlen(buf) > 5)
9437 checkit("9e-005", buf); /* for Microsoft ?? */
9438 else
9439 checkit("9e-05", buf);
9440
9441 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9442 checkit("1", buf);
9443
9444 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9445 checkit("1.1", buf);
9446
9447 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9448 checkit("1.01", buf);
9449
9450 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9451 checkit("1.001", buf);
9452
9453 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9454 checkit("1.0001", buf);
9455
9456 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9457 checkit("1.00001", buf);
9458
9459 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9460 checkit("1.000001", buf);
9461
9462 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9463 checkit("0", buf);
9464
9465 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9466 checkit("-1", buf);
9467
9468 /* Some Linux gcvt's give 1.e+5 here. */
9469 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9470 checkit("100000", buf);
9471
9472 /* Some Linux gcvt's give -1.e+5 here. */
9473 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9474 checkit("-100000", buf);
9475
9476 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9477 checkit("123.456", buf);
9478
9479 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9480 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9481 /* 34 should be enough to scare even long double
9482 * places into using the e notation. */
9483 if (strlen(buf) > 5)
9484 checkit("1e+034", buf); /* for Microsoft */
9485 else
9486 checkit("1e+34", buf);
9487
9488 /* For Perl, if you add additional tests here, also add them to
9489 * t/base/num.t for benefit of platforms not using Configure or
9490 * overriding d_Gconvert */
9491
9492 exit(0);
9493}
9494EOP
9495: first add preferred functions to our list
9496xxx_list=""
9497for xxx_convert in $gconvert_preference; do
9498 case $xxx_convert in
9499 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9500 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9501 esac
9502done
9503: then add any others
9504for xxx_convert in gconvert gcvt sprintf; do
9505 case "$xxx_list" in
9506 *$xxx_convert*) ;;
9507 *) xxx_list="$xxx_list $xxx_convert" ;;
9508 esac
9509done
9510
9511case "$d_longdbl$uselongdouble" in
9512"$define$define")
9513 : again, add prefered functions to our list first
9514 xxx_ld_list=""
9515 for xxx_convert in $gconvert_ld_preference; do
9516 case $xxx_convert in
9517 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9518 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9519 esac
9520 done
9521 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9522 for xxx_convert in qgcvt sprintf $xxx_list; do
9523 case "$xxx_ld_list" in
9524 $xxx_convert*|*" $xxx_convert"*) ;;
9525 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9526 esac
9527 done
9528 : if sprintf cannot do long doubles, move it to the end
9529 if test "$d_PRIgldbl" != "$define"; then
9530 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9531 fi
9532 : if no qgcvt, remove it
9533 if test "$d_qgcvt" != "$define"; then
9534 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9535 fi
9536 : use the ld_list
9537 xxx_list="$xxx_ld_list"
9538 ;;
9539esac
9540
9541for xxx_convert in $xxx_list; do
9542 echo "Trying $xxx_convert..."
9543 $rm -f try try$_o
9544 set try -DTRY_$xxx_convert
9545 if eval $compile; then
9546 echo "$xxx_convert() found." >&4
9547 if $run ./try; then
9548 echo "I'll use $xxx_convert to convert floats into a string." >&4
9549 break;
9550 else
9551 echo "...But $xxx_convert didn't work as I expected."
9552 xxx_convert=''
9553 fi
9554 else
9555 echo "$xxx_convert NOT found." >&4
9556 fi
9557done
9558
9559if test X$xxx_convert = X; then
9560 echo "*** WHOA THERE!!! ***" >&4
9561 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9562 xxx_convert=sprintf
9563fi
9564
9565case "$xxx_convert" in
9566gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9567gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9568qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9569*) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9570 "$define$define$define")
9571 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9572 "$define$define$undef")
9573 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9574 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9575 esac
9576 ;;
9577esac
9578
9579fi
9580
9581: see if _fwalk exists
9582set fwalk d__fwalk
9583eval $inlibc
9584
9585: Initialize h_fcntl
9586h_fcntl=false
9587
9588: Initialize h_sysfile
9589h_sysfile=false
9590
9591: access call always available on UNIX
9592set access d_access
9593eval $inlibc
9594
9595: locate the flags for 'access()'
9596case "$d_access" in
9597"$define")
9598 echo " "
9599 $cat >access.c <<EOCP
9600#include <sys/types.h>
9601#ifdef I_FCNTL
9602#include <fcntl.h>
9603#endif
9604#ifdef I_SYS_FILE
9605#include <sys/file.h>
9606#endif
9607#ifdef I_UNISTD
9608#include <unistd.h>
9609#endif
9610#$i_stdlib I_STDLIB
9611#ifdef I_STDLIB
9612#include <stdlib.h>
9613#endif
9614int main() {
9615 exit(R_OK);
9616}
9617EOCP
9618 : check sys/file.h first, no particular reason here
9619 if $test `./findhdr sys/file.h` && \
9620 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9621 h_sysfile=true;
9622 echo "<sys/file.h> defines the *_OK access constants." >&4
9623 elif $test `./findhdr fcntl.h` && \
9624 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9625 h_fcntl=true;
9626 echo "<fcntl.h> defines the *_OK access constants." >&4
9627 elif $test `./findhdr unistd.h` && \
9628 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9629 echo "<unistd.h> defines the *_OK access constants." >&4
9630 else
9631 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9632 fi
9633 ;;
9634esac
9635$rm -f access*
9636
9637: see if accessx exists
9638set accessx d_accessx
9639eval $inlibc
9640
9641: see if aintl exists
9642set aintl d_aintl
9643eval $inlibc
9644
9645: see if alarm exists
9646set alarm d_alarm
9647eval $inlibc
9648
9649: see if POSIX threads are available
9650set pthread.h i_pthread
9651eval $inhdr
9652
9653: define a fucntion to check prototypes
9654$cat > protochk <<EOSH
9655$startsh
9656cc="$cc"
9657optimize="$optimize"
9658ccflags="$ccflags"
9659prototype="$prototype"
9660define="$define"
9661rm=$rm
9662usethreads=$usethreads
9663i_pthread=$i_pthread
9664pthread_h_first=$pthread_h_first
9665EOSH
9666
9667$cat >> protochk <<'EOSH'
9668
9669$rm -f try.c
9670foo="$1"
9671shift
9672while test $# -ge 2; do
9673 case "$1" in
9674 $define) echo "#include <$2>" >> try.c ;;
9675 literal) echo "$2" >> try.c ;;
9676 esac
9677 # Extra magic for the benefit of systems that need pthread.h
9678 # to be included early to correctly detect threadsafe functions.
9679 # Such functions must guarantee themselves, though, that the usethreads
9680 # and i_pthread have been defined, before calling protochk.
9681 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9682 echo "#include <pthread.h>" >> try.c
9683 pthread_h_done=yes
9684 fi
9685 shift 2
9686done
9687test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9688cat >> try.c <<'EOCP'
9689#ifdef CAN_PROTOTYPE
9690#define _(args) args
9691#else
9692#define _(args) ()
9693#endif
9694EOCP
9695echo "$foo" >> try.c
9696echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9697$cc $optimize $ccflags -c try.c > /dev/null 2>&1
9698status=$?
9699$rm -f try.[co]
9700exit $status
9701EOSH
9702chmod +x protochk
9703$eunicefix protochk
9704
9705hasproto='varname=$1; func=$2; shift; shift;
9706while $test $# -ge 2; do
9707 case "$1" in
9708 $define) echo "#include <$2>";;
9709 esac ;
9710 shift 2;
9711done > try.c;
9712$cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9713if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9714 echo "$func() prototype found.";
9715 val="$define";
9716else
9717 echo "$func() prototype NOT found.";
9718 val="$undef";
9719fi;
9720set $varname;
9721eval $setvar;
9722$rm -f try.c tryout.c'
9723
9724: see if sys/types.h has to be included
9725set sys/types.h i_systypes
9726eval $inhdr
9727
9728: see if sys/select.h has to be included
9729set sys/select.h i_sysselct
9730eval $inhdr
9731
9732hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9733while $test $# -ge 2; do
9734 case "$1" in
9735 $define) echo "#include <$2>";;
9736 esac ;
9737 shift 2;
9738done > try.c;
9739echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9740set try;
9741if eval $compile; then
9742 val="$define";
9743else
9744 val="$undef";
9745fi;
9746set $varname;
9747eval $setvar;
9748$rm -f try.c try.o'
9749
9750: see if we should include time.h, sys/time.h, or both
9751echo " "
9752if test "X$timeincl" = X; then
9753 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9754 $echo $n "I'm now running the test program...$c"
9755 $cat >try.c <<EOCP
9756#include <sys/types.h>
9757#ifdef I_TIME
9758#include <time.h>
9759#endif
9760#ifdef I_SYSTIME
9761#ifdef SYSTIMEKERNEL
9762#define KERNEL
9763#endif
9764#include <sys/time.h>
9765#endif
9766#ifdef I_SYSSELECT
9767#include <sys/select.h>
9768#endif
9769#$i_stdlib I_STDLIB
9770#ifdef I_STDLIB
9771#include <stdlib.h>
9772#endif
9773int main()
9774{
9775 struct tm foo;
9776#ifdef S_TIMEVAL
9777 struct timeval bar;
9778#endif
9779#ifdef S_TIMEZONE
9780 struct timezone tzp;
9781#endif
9782 if (foo.tm_sec == foo.tm_sec)
9783 exit(0);
9784#ifdef S_TIMEVAL
9785 if (bar.tv_sec == bar.tv_sec)
9786 exit(0);
9787#endif
9788 exit(1);
9789}
9790EOCP
9791 flags=''
9792 for s_timezone in '-DS_TIMEZONE' ''; do
9793 sysselect=''
9794 for s_timeval in '-DS_TIMEVAL' ''; do
9795 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9796 for i_time in '' '-DI_TIME'; do
9797 for i_systime in '-DI_SYSTIME' ''; do
9798 case "$flags" in
9799 '') $echo $n ".$c"
9800 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9801 if eval $compile; then
9802 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9803 shift
9804 flags="$*"
9805 echo " "
9806 $echo $n "Succeeded with $flags$c"
9807 fi
9808 ;;
9809 esac
9810 done
9811 done
9812 done
9813 done
9814 done
9815 timeincl=''
9816 echo " "
9817 case "$flags" in
9818 *SYSTIMEKERNEL*) i_systimek="$define"
9819 timeincl=`./findhdr sys/time.h`
9820 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9821 *) i_systimek="$undef";;
9822 esac
9823 case "$flags" in
9824 *I_TIME*) i_time="$define"
9825 timeincl=`./findhdr time.h`" $timeincl"
9826 echo "We'll include <time.h>." >&4;;
9827 *) i_time="$undef";;
9828 esac
9829 case "$flags" in
9830 *I_SYSTIME*) i_systime="$define"
9831 timeincl=`./findhdr sys/time.h`" $timeincl"
9832 echo "We'll include <sys/time.h>." >&4;;
9833 *) i_systime="$undef";;
9834 esac
9835 $rm -f try.c try
9836fi
9837: see if struct tm knows about tm_zone
9838case "$i_systime$i_time" in
9839*$define*)
9840 echo " "
9841 echo "Checking to see if your struct tm has tm_zone field..." >&4
9842 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9843 eval $hasfield
9844 ;;
9845*) val="$undef"
9846 set d_tm_tm_zone
9847 eval $setvar
9848 ;;
9849esac
9850case "$d_tm_tm_zone" in
9851"$define") echo "Yes, it does." ;;
9852*) echo "No, it doesn't." ;;
9853esac
9854: see if struct tm knows about tm_gmtoff
9855case "$i_systime$i_time" in
9856*$define*)
9857 echo " "
9858 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9859 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9860 eval $hasfield
9861 ;;
9862*) val="$undef"
9863 set d_tm_tm_gmtoff
9864 eval $setvar
9865 ;;
9866esac
9867case "$d_tm_tm_gmtoff" in
9868"$define") echo "Yes, it does." ;;
9869*) echo "No, it doesn't." ;;
9870esac
9871
9872: see if asctime_r exists
9873set asctime_r d_asctime_r
9874eval $inlibc
9875case "$d_asctime_r" in
9876"$define")
9877 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9878 case "$d_asctime_r_proto:$usethreads" in
9879 ":define") d_asctime_r_proto=define
9880 set d_asctime_r_proto asctime_r $hdrs
9881 eval $hasproto ;;
9882 *) ;;
9883 esac
9884 case "$d_asctime_r_proto" in
9885 define)
9886 case "$asctime_r_proto" in
9887 ''|0) try='char* asctime_r(const struct tm*, char*);'
9888 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9889 esac
9890 case "$asctime_r_proto" in
9891 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9892 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9893 esac
9894 case "$asctime_r_proto" in
9895 ''|0) try='int asctime_r(const struct tm*, char*);'
9896 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9897 esac
9898 case "$asctime_r_proto" in
9899 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9900 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9901 esac
9902 case "$asctime_r_proto" in
9903 ''|0) d_asctime_r=undef
9904 asctime_r_proto=0
9905 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9906 * ) case "$asctime_r_proto" in
9907 REENTRANT_PROTO*) ;;
9908 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9909 esac
9910 echo "Prototype: $try" ;;
9911 esac
9912 ;;
9913 *) case "$usethreads" in
9914 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9915 esac
9916 d_asctime_r=undef
9917 asctime_r_proto=0
9918 ;;
9919 esac
9920 ;;
9921*) asctime_r_proto=0
9922 ;;
9923esac
9924
9925: see if atolf exists
9926set atolf d_atolf
9927eval $inlibc
9928
9929: see if atoll exists
9930set atoll d_atoll
9931eval $inlibc
9932
9933: Look for GCC-style attribute format
9934case "$d_attribute_format" in
9935'')
9936echo " "
9937echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
9938$cat >attrib.c <<'EOCP'
9939#include <stdio.h>
9940void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
9941EOCP
9942if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9943 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9944 echo "Your C compiler doesn't support __attribute__((format))."
9945 val="$undef"
9946 else
9947 echo "Your C compiler supports __attribute__((format))."
9948 val="$define"
9949 fi
9950else
9951 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9952 val="$undef"
9953fi
9954;;
9955*) val="$d_attribute_format" ;;
9956esac
9957set d_attribute_format
9958eval $setvar
9959$rm -f attrib*
9960
9961: Look for GCC-style attribute malloc
9962case "$d_attribute_malloc" in
9963'')
9964echo " "
9965echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
9966$cat >attrib.c <<'EOCP'
9967#include <stdio.h>
9968char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
9969EOCP
9970if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9971 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9972 echo "Your C compiler doesn't support __attribute__((malloc))."
9973 val="$undef"
9974 else
9975 echo "Your C compiler supports __attribute__((malloc))."
9976 val="$define"
9977 fi
9978else
9979 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9980 val="$undef"
9981fi
9982;;
9983*) val="$d_attribute_malloc" ;;
9984esac
9985set d_attribute_malloc
9986eval $setvar
9987$rm -f attrib*
9988
9989: Look for GCC-style attribute nonnull
9990case "$d_attribute_nonnull" in
9991'')
9992echo " "
9993echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
9994$cat >attrib.c <<'EOCP'
9995#include <stdio.h>
9996void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
9997EOCP
9998if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9999 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10000 echo "Your C compiler doesn't support __attribute__((nonnull))."
10001 val="$undef"
10002 else
10003 echo "Your C compiler supports __attribute__((nonnull))."
10004 val="$define"
10005 fi
10006else
10007 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10008 val="$undef"
10009fi
10010;;
10011*) val="$d_attribute_nonnull" ;;
10012esac
10013set d_attribute_nonnull
10014eval $setvar
10015$rm -f attrib*
10016
10017: Look for GCC-style attribute noreturn
10018case "$d_attribute_noreturn" in
10019'')
10020echo " "
10021echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
10022$cat >attrib.c <<'EOCP'
10023#include <stdio.h>
10024void fall_over_dead( void ) __attribute__((noreturn));
10025EOCP
10026if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10027 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10028 echo "Your C compiler doesn't support __attribute__((noreturn))."
10029 val="$undef"
10030 else
10031 echo "Your C compiler supports __attribute__((noreturn))."
10032 val="$define"
10033 fi
10034else
10035 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10036 val="$undef"
10037fi
10038;;
10039*) val="$d_attribute_noreturn" ;;
10040esac
10041set d_attribute_noreturn
10042eval $setvar
10043$rm -f attrib*
10044
10045: Look for GCC-style attribute pure
10046case "$d_attribute_pure" in
10047'')
10048echo " "
10049echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
10050$cat >attrib.c <<'EOCP'
10051#include <stdio.h>
10052int square( int n ) __attribute__((pure));
10053EOCP
10054if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10055 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10056 echo "Your C compiler doesn't support __attribute__((pure))."
10057 val="$undef"
10058 else
10059 echo "Your C compiler supports __attribute__((pure))."
10060 val="$define"
10061 fi
10062else
10063 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10064 val="$undef"
10065fi
10066;;
10067*) val="$d_attribute_pure" ;;
10068esac
10069set d_attribute_pure
10070eval $setvar
10071$rm -f attrib*
10072
10073: Look for GCC-style attribute unused
10074case "$d_attribute_unused" in
10075'')
10076echo " "
10077echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
10078$cat >attrib.c <<'EOCP'
10079#include <stdio.h>
10080int do_something( int dummy __attribute__((unused)), int n );
10081EOCP
10082if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10083 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10084 echo "Your C compiler doesn't support __attribute__((unused))."
10085 val="$undef"
10086 else
10087 echo "Your C compiler supports __attribute__((unused))."
10088 val="$define"
10089 fi
10090else
10091 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10092 val="$undef"
10093fi
10094;;
10095*) val="$d_attribute_unused" ;;
10096esac
10097set d_attribute_unused
10098eval $setvar
10099$rm -f attrib*
10100
10101: Look for GCC-style attribute warn_unused_result
10102case "$d_attribute_warn_unused_result" in
10103'')
10104echo " "
10105echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
10106$cat >attrib.c <<'EOCP'
10107#include <stdio.h>
10108int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
10109EOCP
10110if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
10111 if $contains 'warning' attrib.out >/dev/null 2>&1; then
10112 echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
10113 val="$undef"
10114 else
10115 echo "Your C compiler supports __attribute__((warn_unused_result))."
10116 val="$define"
10117 fi
10118else
10119 echo "Your C compiler doesn't seem to understand __attribute__ at all."
10120 val="$undef"
10121fi
10122;;
10123*) val="$d_attribute_warn_unused_result" ;;
10124esac
10125set d_attribute_warn_unused_result
10126eval $setvar
10127$rm -f attrib*
10128
10129: see if bcmp exists
10130set bcmp d_bcmp
10131eval $inlibc
10132
10133: see if bcopy exists
10134set bcopy d_bcopy
10135eval $inlibc
10136
10137: see if getpgrp exists
10138set getpgrp d_getpgrp
10139eval $inlibc
10140
10141case "$d_getpgrp" in
10142"$define")
10143 echo " "
10144 echo "Checking to see which flavor of getpgrp is in use..."
10145 $cat >try.c <<EOP
10146#$i_unistd I_UNISTD
10147#include <sys/types.h>
10148#ifdef I_UNISTD
10149# include <unistd.h>
10150#endif
10151#$i_stdlib I_STDLIB
10152#ifdef I_STDLIB
10153#include <stdlib.h>
10154#endif
10155int main()
10156{
10157 if (getuid() == 0) {
10158 printf("(I see you are running Configure as super-user...)\n");
10159 setuid(1);
10160 }
10161#ifdef TRY_BSD_PGRP
10162 if (getpgrp(1) == 0)
10163 exit(0);
10164#else
10165 if (getpgrp() > 0)
10166 exit(0);
10167#endif
10168 exit(1);
10169}
10170EOP
10171 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10172 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
10173 val="$define"
10174 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10175 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
10176 val="$undef"
10177 else
10178 echo "I can't seem to compile and run the test program."
10179 if ./usg; then
10180 xxx="a USG one, i.e. you use getpgrp()."
10181 else
10182 # SVR4 systems can appear rather BSD-ish.
10183 case "$i_unistd" in
10184 $undef)
10185 xxx="a BSD one, i.e. you use getpgrp(pid)."
10186 val="$define"
10187 ;;
10188 $define)
10189 xxx="probably a USG one, i.e. you use getpgrp()."
10190 val="$undef"
10191 ;;
10192 esac
10193 fi
10194 echo "Assuming your getpgrp is $xxx" >&4
10195 fi
10196 ;;
10197*) val="$undef";;
10198esac
10199set d_bsdgetpgrp
10200eval $setvar
10201$rm -f try try.*
10202
10203: see if setpgrp exists
10204set setpgrp d_setpgrp
10205eval $inlibc
10206
10207case "$d_setpgrp" in
10208"$define")
10209 echo " "
10210 echo "Checking to see which flavor of setpgrp is in use..."
10211 $cat >try.c <<EOP
10212#$i_unistd I_UNISTD
10213#include <sys/types.h>
10214#ifdef I_UNISTD
10215# include <unistd.h>
10216#endif
10217#$i_stdlib I_STDLIB
10218#ifdef I_STDLIB
10219#include <stdlib.h>
10220#endif
10221int main()
10222{
10223 if (getuid() == 0) {
10224 printf("(I see you are running Configure as super-user...)\n");
10225 setuid(1);
10226 }
10227#ifdef TRY_BSD_PGRP
10228 if (-1 == setpgrp(1, 1))
10229 exit(0);
10230#else
10231 if (setpgrp() != -1)
10232 exit(0);
10233#endif
10234 exit(1);
10235}
10236EOP
10237 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10238 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10239 val="$define"
10240 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10241 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10242 val="$undef"
10243 else
10244 echo "(I can't seem to compile and run the test program.)"
10245 if ./usg; then
10246 xxx="a USG one, i.e. you use setpgrp()."
10247 else
10248 # SVR4 systems can appear rather BSD-ish.
10249 case "$i_unistd" in
10250 $undef)
10251 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10252 val="$define"
10253 ;;
10254 $define)
10255 xxx="probably a USG one, i.e. you use setpgrp()."
10256 val="$undef"
10257 ;;
10258 esac
10259 fi
10260 echo "Assuming your setpgrp is $xxx" >&4
10261 fi
10262 ;;
10263*) val="$undef";;
10264esac
10265set d_bsdsetpgrp
10266eval $setvar
10267$rm -f try try.*
10268: Look for GCC-style __builtin_choose_expr
10269case "$d_builtin_choose_expr" in
10270'')
10271 echo " "
10272 echo "Checking whether your compiler can handle __builtin_choose_expr ..." >&4
10273 $cat >try.c <<'EOCP'
10274#include <assert.h>
10275#include <stdlib.h>
10276#include <stdio.h>
10277
10278#define SYRINX(x) __builtin_choose_expr( x, (1056*2), (103*50) )
10279
10280int main(void) {
10281 assert( SYRINX(1) == 2112 );
10282 assert( SYRINX(1) != 5150 );
10283 assert( SYRINX(0) == 5150 );
10284 assert( SYRINX(0) != 2112 );
10285 puts( "All good!" );
10286 exit(0);
10287}
10288
10289EOCP
10290 set try
10291 if eval $compile; then
10292 echo "Your C compiler supports __builtin_choose_expr."
10293 val="$define"
10294 else
10295 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10296 val="$undef"
10297 fi
10298;;
10299*) val="$d_builtin_choose_expr" ;;
10300esac
10301
10302set d_builtin_choose_expr
10303eval $setvar
10304$rm -f try.* try core core.try.*
10305
10306: Look for GCC-style __builtin_expect
10307case "$d_builtin_expect" in
10308'')
10309 echo " "
10310 echo "Checking whether your compiler can handle __builtin_expect ..." >&4
10311 $cat >builtin.c <<'EOCP'
10312int main(void) {
10313 int n = 50;
10314 if ( __builtin_expect(n, 0) ) n = 1;
10315}
10316EOCP
10317 set try
10318 if eval $compile; then
10319 echo "Your C compiler supports __builtin_choose_expr."
10320 val="$define"
10321 else
10322 echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
10323 val="$undef"
10324 fi
10325 ;;
10326*) val="$d_builtin_expect" ;;
10327esac
10328
10329set d_builtin_expect
10330eval $setvar
10331$rm -f try.* try core core.try.*
10332
10333: see if bzero exists
10334set bzero d_bzero
10335eval $inlibc
10336
10337: see if stdarg is available
10338echo " "
10339if $test `./findhdr stdarg.h`; then
10340 echo "<stdarg.h> found." >&4
10341 valstd="$define"
10342else
10343 echo "<stdarg.h> NOT found." >&4
10344 valstd="$undef"
10345fi
10346
10347: see if varags is available
10348echo " "
10349if $test `./findhdr varargs.h`; then
10350 echo "<varargs.h> found." >&4
10351else
10352 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
10353fi
10354
10355: set up the varargs testing programs
10356$cat > varargs.c <<EOP
10357#ifdef I_STDARG
10358#include <stdarg.h>
10359#endif
10360#ifdef I_VARARGS
10361#include <varargs.h>
10362#endif
10363
10364#ifdef I_STDARG
10365int f(char *p, ...)
10366#else
10367int f(va_alist)
10368va_dcl
10369#endif
10370{
10371 va_list ap;
10372#ifndef I_STDARG
10373 char *p;
10374#endif
10375#ifdef I_STDARG
10376 va_start(ap,p);
10377#else
10378 va_start(ap);
10379 p = va_arg(ap, char *);
10380#endif
10381 va_end(ap);
10382 return 0;
10383}
10384EOP
10385$cat > varargs <<EOP
10386$startsh
10387if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
10388 echo "true"
10389else
10390 echo "false"
10391fi
10392$rm -f varargs$_o
10393EOP
10394chmod +x varargs
10395
10396: now check which varargs header should be included
10397echo " "
10398i_varhdr=''
10399case "$valstd" in
10400"$define")
10401 if `./varargs I_STDARG`; then
10402 val='stdarg.h'
10403 elif `./varargs I_VARARGS`; then
10404 val='varargs.h'
10405 fi
10406 ;;
10407*)
10408 if `./varargs I_VARARGS`; then
10409 val='varargs.h'
10410 fi
10411 ;;
10412esac
10413case "$val" in
10414'')
10415echo "I could not find the definition for va_dcl... You have problems..." >&4
10416 val="$undef"; set i_stdarg; eval $setvar
10417 val="$undef"; set i_varargs; eval $setvar
10418 ;;
10419*)
10420 set i_varhdr
10421 eval $setvar
10422 case "$i_varhdr" in
10423 stdarg.h)
10424 val="$define"; set i_stdarg; eval $setvar
10425 val="$undef"; set i_varargs; eval $setvar
10426 ;;
10427 varargs.h)
10428 val="$undef"; set i_stdarg; eval $setvar
10429 val="$define"; set i_varargs; eval $setvar
10430 ;;
10431 esac
10432 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
10433esac
10434$rm -f varargs*
10435
10436: see if the Compiler supports C99 variadic macros
10437case "$i_stdarg$i_stdlib" in
10438 "$define$define")
10439 echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
10440 $cat >try.c <<EOCP
10441#include <stdio.h>
10442#include <stdarg.h>
10443
10444#define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
10445
10446int main() {
10447 char buf[20];
10448 foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
10449 puts(buf);
10450 return 0;
10451}
10452EOCP
10453 set try
10454 if eval $compile && $run ./try 2>&1 >/dev/null; then
10455 case "`$run ./try`" in
10456 "123 456 789")
10457 echo "You have C99 variadic macros." >&4
10458 d_c99_variadic_macros="$define"
10459 ;;
10460 *)
10461 echo "You don't have functional C99 variadic macros." >&4
10462 d_c99_variadic_macros="$undef"
10463 ;;
10464 esac
10465 else
10466 echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
10467 d_c99_variadic_macros="$undef"
10468 fi
10469 $rm -f try.* try core core.try.*
10470 ;;
10471 *)
10472 echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
10473 d_c99_variadic_macros="$undef"
10474 ;;
10475esac
10476
10477: see if signal is declared as pointer to function returning int or void
10478echo " "
10479xxx=`./findhdr signal.h`
10480$test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10481if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10482 echo "You have int (*signal())() instead of void." >&4
10483 val="$undef"
10484elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10485 echo "You have void (*signal())()." >&4
10486 val="$define"
10487elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10488 echo "You have int (*signal())() instead of void." >&4
10489 val="$undef"
10490elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10491 echo "You have void (*signal())()." >&4
10492 val="$define"
10493else
10494 case "$d_voidsig" in
10495 '')
10496 echo "I can't determine whether signal handler returns void or int..." >&4
10497 dflt=void
10498 rp="What type does your signal handler return?"
10499 . ./myread
10500 case "$ans" in
10501 v*) val="$define";;
10502 *) val="$undef";;
10503 esac;;
10504 "$define")
10505 echo "As you already told me, signal handler returns void." >&4
10506 val="$define"
10507 ;;
10508 *) echo "As you already told me, signal handler returns int." >&4
10509 val="$undef"
10510 ;;
10511 esac
10512fi
10513set d_voidsig
10514eval $setvar
10515case "$d_voidsig" in
10516"$define") signal_t="void";;
10517*) signal_t="int";;
10518esac
10519$rm -f $$.tmp
10520
10521: check for ability to cast large floats to 32-bit ints.
10522echo " "
10523echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10524if $test "$intsize" -ge 4; then
10525 xxx=int
10526else
10527 xxx=long
10528fi
10529$cat >try.c <<EOCP
10530#include <stdio.h>
10531#$i_stdlib I_STDLIB
10532#ifdef I_STDLIB
10533#include <stdlib.h>
10534#endif
10535#include <sys/types.h>
10536#include <signal.h>
10537$signal_t blech(int s) { exit(3); }
10538int main()
10539{
10540 $xxx i32;
10541 double f, g;
10542 int result = 0;
10543 char str[16];
10544 signal(SIGFPE, blech);
10545
10546 /* Don't let compiler optimize the test away. Store the number
10547 in a writable string for gcc to pass to sscanf under HP/UX.
10548 */
10549 sprintf(str, "2147483647");
10550 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10551 g = 10 * f;
10552 i32 = ($xxx) g;
10553
10554 /* x86 processors will probably give 0x8000 0000, which is a
10555 sign change. We don't want that. We want to mimic SPARC
10556 behavior here, which is to preserve the sign and give
10557 back 0x7fff ffff.
10558 */
10559 if (i32 != ($xxx) f)
10560 result |= 1;
10561 exit(result);
10562}
10563EOCP
10564set try
10565if eval $compile_ok; then
10566 $run ./try
10567 yyy=$?
10568else
10569 echo "(I can't seem to compile the test program--assuming it can't)"
10570 yyy=1
10571fi
10572case "$yyy" in
105730) val="$define"
10574 echo "Yup, it can."
10575 ;;
10576*) val="$undef"
10577 echo "Nope, it can't."
10578 ;;
10579esac
10580set d_casti32
10581eval $setvar
10582$rm -f try try.*
10583
10584: check for ability to cast negative floats to unsigned
10585echo " "
10586echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10587$cat >try.c <<EOCP
10588#include <stdio.h>
10589#$i_stdlib I_STDLIB
10590#ifdef I_STDLIB
10591#include <stdlib.h>
10592#endif
10593#include <sys/types.h>
10594#include <signal.h>
10595$signal_t blech(int s) { exit(7); }
10596$signal_t blech_in_list(int s) { exit(4); }
10597unsigned long dummy_long(unsigned long p) { return p; }
10598unsigned int dummy_int(unsigned int p) { return p; }
10599unsigned short dummy_short(unsigned short p) { return p; }
10600int main()
10601{
10602 double f;
10603 unsigned long along;
10604 unsigned int aint;
10605 unsigned short ashort;
10606 int result = 0;
10607 char str[16];
10608
10609 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10610 a direct f = -123. assignment. gcc-2.8.0 reportedly
10611 optimized the whole file away
10612 */
10613 /* Store the number in a writable string for gcc to pass to
10614 sscanf under HP/UX.
10615 */
10616 sprintf(str, "-123");
10617 sscanf(str, "%lf", &f); /* f = -123.; */
10618
10619 signal(SIGFPE, blech);
10620 along = (unsigned long)f;
10621 aint = (unsigned int)f;
10622 ashort = (unsigned short)f;
10623 if (along != (unsigned long)-123)
10624 result |= 1;
10625 if (aint != (unsigned int)-123)
10626 result |= 1;
10627 if (ashort != (unsigned short)-123)
10628 result |= 1;
10629 sprintf(str, "1073741824.");
10630 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10631 f = f + f;
10632 along = 0;
10633 along = (unsigned long)f;
10634 if (along != 0x80000000)
10635 result |= 2;
10636 f -= 1.;
10637 along = 0;
10638 along = (unsigned long)f;
10639 if (along != 0x7fffffff)
10640 result |= 1;
10641 f += 2.;
10642 along = 0;
10643 along = (unsigned long)f;
10644 if (along != 0x80000001)
10645 result |= 2;
10646 if (result)
10647 exit(result);
10648 signal(SIGFPE, blech_in_list);
10649 sprintf(str, "123.");
10650 sscanf(str, "%lf", &f); /* f = 123.; */
10651 along = dummy_long((unsigned long)f);
10652 aint = dummy_int((unsigned int)f);
10653 ashort = dummy_short((unsigned short)f);
10654 if (along != (unsigned long)123)
10655 result |= 4;
10656 if (aint != (unsigned int)123)
10657 result |= 4;
10658 if (ashort != (unsigned short)123)
10659 result |= 4;
10660 exit(result);
10661
10662}
10663EOCP
10664set try
10665if eval $compile_ok; then
10666 $run ./try
10667 castflags=$?
10668else
10669 echo "(I can't seem to compile the test program--assuming it can't)"
10670 castflags=7
10671fi
10672case "$castflags" in
106730) val="$define"
10674 echo "Yup, it can."
10675 ;;
10676*) val="$undef"
10677 echo "Nope, it can't."
10678 ;;
10679esac
10680set d_castneg
10681eval $setvar
10682$rm -f try.*
10683
10684: see if vprintf exists
10685echo " "
10686if set vprintf val -f d_vprintf; eval $csym; $val; then
10687 echo 'vprintf() found.' >&4
10688 val="$define"
10689 $cat >try.c <<EOF
10690#include <varargs.h>
10691#$i_stdlib I_STDLIB
10692#ifdef I_STDLIB
10693#include <stdlib.h>
10694#endif
10695
10696int main() { xxx("foo"); }
10697
10698xxx(va_alist)
10699va_dcl
10700{
10701 va_list args;
10702 char buf[10];
10703
10704 va_start(args);
10705 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10706}
10707EOF
10708 set try
10709 if eval $compile && $run ./try; then
10710 echo "Your vsprintf() returns (int)." >&4
10711 val2="$undef"
10712 else
10713 echo "Your vsprintf() returns (char*)." >&4
10714 val2="$define"
10715 fi
10716else
10717 echo 'vprintf() NOT found.' >&4
10718 val="$undef"
10719 val2="$undef"
10720fi
10721$rm -f try try.*
10722set d_vprintf
10723eval $setvar
10724val=$val2
10725set d_charvspr
10726eval $setvar
10727
10728: see if chown exists
10729set chown d_chown
10730eval $inlibc
10731
10732: see if chroot exists
10733set chroot d_chroot
10734eval $inlibc
10735
10736: see if chsize exists
10737set chsize d_chsize
10738eval $inlibc
10739
10740: see if class exists
10741set class d_class
10742eval $inlibc
10743
10744: see if clearenv exists
10745set clearenv d_clearenv
10746eval $inlibc
10747
10748hasstruct='varname=$1; struct=$2; shift; shift;
10749while $test $# -ge 2; do
10750 case "$1" in
10751 $define) echo "#include <$2>";;
10752 esac ;
10753 shift 2;
10754done > try.c;
10755echo "int main () { struct $struct foo; }" >> try.c;
10756set try;
10757if eval $compile; then
10758 val="$define";
10759else
10760 val="$undef";
10761fi;
10762set $varname;
10763eval $setvar;
10764$rm -f try.c try.o'
10765
10766socketlib=''
10767sockethdr=''
10768: see whether socket exists
10769echo " "
10770$echo $n "Hmm... $c" >&4
10771if set socket val -f d_socket; eval $csym; $val; then
10772 echo "Looks like you have Berkeley networking support." >&4
10773 d_socket="$define"
10774 if set setsockopt val -f; eval $csym; $val; then
10775 d_oldsock="$undef"
10776 else
10777 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10778 d_oldsock="$define"
10779 fi
10780else
10781 if $contains socklib libc.list >/dev/null 2>&1; then
10782 echo "Looks like you have Berkeley networking support." >&4
10783 d_socket="$define"
10784 : we will have to assume that it supports the 4.2 BSD interface
10785 d_oldsock="$undef"
10786 else
10787 echo "You don't have Berkeley networking in libc$_a..." >&4
10788 if test "X$d_socket" = "X$define"; then
10789 echo "...but you seem to believe that you have sockets." >&4
10790 else
10791 for net in net socket
10792 do
10793 if test -f /usr/lib/lib$net$_a; then
10794 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10795 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10796 if $contains socket libc.list >/dev/null 2>&1; then
10797 d_socket="$define"
10798 socketlib="-l$net"
10799 case "$net" in
10800 net)
10801 echo "...but the Wollongong group seems to have hacked it in." >&4
10802 sockethdr="-I/usr/netinclude"
10803 ;;
10804 esac
10805 echo "Found Berkeley sockets interface in lib$net." >&4
10806 if $contains setsockopt libc.list >/dev/null 2>&1; then
10807 d_oldsock="$undef"
10808 else
10809 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10810 d_oldsock="$define"
10811 fi
10812 break
10813 fi
10814 fi
10815 done
10816 if test "X$d_socket" != "X$define"; then
10817 echo "or anywhere else I see." >&4
10818 d_socket="$undef"
10819 d_oldsock="$undef"
10820 fi
10821 fi
10822 fi
10823fi
10824
10825: see if socketpair exists
10826set socketpair d_sockpair
10827eval $inlibc
10828
10829
10830echo " "
10831echo "Checking the availability of certain socket constants..." >&4
10832for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10833 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10834 $cat >try.c <<EOF
10835#include <sys/types.h>
10836#include <sys/socket.h>
10837int main() {
10838 int i = $ENUM;
10839}
10840EOF
10841 val="$undef"
10842 set try; if eval $compile; then
10843 val="$define"
10844 fi
10845 set d_${enum}; eval $setvar
10846 $rm -f try.c try
10847done
10848
10849: see if this is a sys/uio.h system
10850set sys/uio.h i_sysuio
10851eval $inhdr
10852
10853
10854echo " "
10855echo "Checking to see if your system supports struct cmsghdr..." >&4
10856set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10857eval $hasstruct
10858case "$d_cmsghdr_s" in
10859"$define") echo "Yes, it does." ;;
10860*) echo "No, it doesn't." ;;
10861esac
10862
10863
10864: check for const keyword
10865echo " "
10866echo 'Checking to see if your C compiler knows about "const"...' >&4
10867$cat >const.c <<'EOCP'
10868typedef struct spug { int drokk; } spug;
10869int main()
10870{
10871 const char *foo;
10872 const spug y = { 0 };
10873}
10874EOCP
10875if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10876 val="$define"
10877 echo "Yup, it does."
10878else
10879 val="$undef"
10880 echo "Nope, it doesn't."
10881fi
10882set d_const
10883eval $setvar
10884
10885: see if copysignl exists
10886set copysignl d_copysignl
10887eval $inlibc
10888
10889: see if crypt exists
10890echo " "
10891set crypt d_crypt
10892eval $inlibc
10893case "$d_crypt" in
10894$define) cryptlib='' ;;
10895*) if set crypt val -f d_crypt; eval $csym; $val; then
10896 echo 'crypt() found.' >&4
10897 val="$define"
10898 cryptlib=''
10899 else
10900 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10901 if $test -z "$cryptlib"; then
10902 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10903 else
10904 cryptlib=-lcrypt
10905 fi
10906 if $test -z "$cryptlib"; then
10907 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10908 else
10909 cryptlib=-lcrypt
10910 fi
10911 if $test -z "$cryptlib"; then
10912 cryptlib=`./loc libcrypt$_a "" $libpth`
10913 else
10914 cryptlib=-lcrypt
10915 fi
10916 if $test -z "$cryptlib"; then
10917 echo 'crypt() NOT found.' >&4
10918 val="$undef"
10919 else
10920 val="$define"
10921 fi
10922 fi
10923 set d_crypt
10924 eval $setvar
10925 ;;
10926esac
10927
10928: see if this is a crypt.h system
10929set crypt.h i_crypt
10930eval $inhdr
10931
10932: see if crypt_r exists
10933set crypt_r d_crypt_r
10934eval $inlibc
10935case "$d_crypt_r" in
10936"$define")
10937 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10938 case "$d_crypt_r_proto:$usethreads" in
10939 ":define") d_crypt_r_proto=define
10940 set d_crypt_r_proto crypt_r $hdrs
10941 eval $hasproto ;;
10942 *) ;;
10943 esac
10944 case "$d_crypt_r_proto" in
10945 define)
10946 case "$crypt_r_proto" in
10947 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10948 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10949 esac
10950 case "$crypt_r_proto" in
10951 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10952 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10953 esac
10954 case "$crypt_r_proto" in
10955 ''|0) d_crypt_r=undef
10956 crypt_r_proto=0
10957 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10958 * ) case "$crypt_r_proto" in
10959 REENTRANT_PROTO*) ;;
10960 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10961 esac
10962 echo "Prototype: $try" ;;
10963 esac
10964 ;;
10965 *) case "$usethreads" in
10966 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10967 esac
10968 d_crypt_r=undef
10969 crypt_r_proto=0
10970 ;;
10971 esac
10972 ;;
10973*) crypt_r_proto=0
10974 ;;
10975esac
10976
10977: get csh whereabouts
10978case "$csh" in
10979'csh') val="$undef" ;;
10980*) val="$define" ;;
10981esac
10982set d_csh
10983eval $setvar
10984: Respect a hint or command line value for full_csh.
10985case "$full_csh" in
10986'') full_csh=$csh ;;
10987esac
10988
10989: see if ctermid_r exists
10990set ctermid_r d_ctermid_r
10991eval $inlibc
10992case "$d_ctermid_r" in
10993"$define")
10994 hdrs="$i_systypes sys/types.h define stdio.h "
10995 case "$d_ctermid_r_proto:$usethreads" in
10996 ":define") d_ctermid_r_proto=define
10997 set d_ctermid_r_proto ctermid_r $hdrs
10998 eval $hasproto ;;
10999 *) ;;
11000 esac
11001 case "$d_ctermid_r_proto" in
11002 define)
11003 case "$ctermid_r_proto" in
11004 ''|0) try='char* ctermid_r(char*);'
11005 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
11006 esac
11007 case "$ctermid_r_proto" in
11008 ''|0) d_ctermid_r=undef
11009 ctermid_r_proto=0
11010 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
11011 * ) case "$ctermid_r_proto" in
11012 REENTRANT_PROTO*) ;;
11013 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
11014 esac
11015 echo "Prototype: $try" ;;
11016 esac
11017 ;;
11018 *) case "$usethreads" in
11019 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
11020 esac
11021 d_ctermid_r=undef
11022 ctermid_r_proto=0
11023 ;;
11024 esac
11025 ;;
11026*) ctermid_r_proto=0
11027 ;;
11028esac
11029
11030: see if ctime_r exists
11031set ctime_r d_ctime_r
11032eval $inlibc
11033case "$d_ctime_r" in
11034"$define")
11035 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
11036 case "$d_ctime_r_proto:$usethreads" in
11037 ":define") d_ctime_r_proto=define
11038 set d_ctime_r_proto ctime_r $hdrs
11039 eval $hasproto ;;
11040 *) ;;
11041 esac
11042 case "$d_ctime_r_proto" in
11043 define)
11044 case "$ctime_r_proto" in
11045 ''|0) try='char* ctime_r(const time_t*, char*);'
11046 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
11047 esac
11048 case "$ctime_r_proto" in
11049 ''|0) try='char* ctime_r(const time_t*, char*, int);'
11050 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
11051 esac
11052 case "$ctime_r_proto" in
11053 ''|0) try='int ctime_r(const time_t*, char*);'
11054 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
11055 esac
11056 case "$ctime_r_proto" in
11057 ''|0) try='int ctime_r(const time_t*, char*, int);'
11058 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
11059 esac
11060 case "$ctime_r_proto" in
11061 ''|0) d_ctime_r=undef
11062 ctime_r_proto=0
11063 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
11064 * ) case "$ctime_r_proto" in
11065 REENTRANT_PROTO*) ;;
11066 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
11067 esac
11068 echo "Prototype: $try" ;;
11069 esac
11070 ;;
11071 *) case "$usethreads" in
11072 define) echo "ctime_r has no prototype, not using it." >&4 ;;
11073 esac
11074 d_ctime_r=undef
11075 ctime_r_proto=0
11076 ;;
11077 esac
11078 ;;
11079*) ctime_r_proto=0
11080 ;;
11081esac
11082
11083: see if cuserid exists
11084set cuserid d_cuserid
11085eval $inlibc
11086
11087: see if this is a limits.h system
11088set limits.h i_limits
11089eval $inhdr
11090
11091: see if this is a float.h system
11092set float.h i_float
11093eval $inhdr
11094
11095: See if number of significant digits in a double precision number is known
11096echo " "
11097$cat >dbl_dig.c <<EOM
11098#$i_limits I_LIMITS
11099#$i_float I_FLOAT
11100#ifdef I_LIMITS
11101#include <limits.h>
11102#endif
11103#ifdef I_FLOAT
11104#include <float.h>
11105#endif
11106#ifdef DBL_DIG
11107printf("Contains DBL_DIG");
11108#endif
11109EOM
11110$cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
11111if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
11112 echo "DBL_DIG found." >&4
11113 val="$define"
11114else
11115 echo "DBL_DIG NOT found." >&4
11116 val="$undef"
11117fi
11118$rm -f dbl_dig.?
11119set d_dbl_dig
11120eval $setvar
11121
11122: see if dbm.h is available
11123: see if dbmclose exists
11124set dbmclose d_dbmclose
11125eval $inlibc
11126
11127case "$d_dbmclose" in
11128$define)
11129 set dbm.h i_dbm
11130 eval $inhdr
11131 case "$i_dbm" in
11132 $define)
11133 val="$undef"
11134 set i_rpcsvcdbm
11135 eval $setvar
11136 ;;
11137 *) set rpcsvc/dbm.h i_rpcsvcdbm
11138 eval $inhdr
11139 ;;
11140 esac
11141 ;;
11142*) echo "We won't be including <dbm.h>"
11143 val="$undef"
11144 set i_dbm
11145 eval $setvar
11146 val="$undef"
11147 set i_rpcsvcdbm
11148 eval $setvar
11149 ;;
11150esac
11151
11152: see if prototype for dbminit is available
11153echo " "
11154set d_dbminitproto dbminit $i_dbm dbm.h
11155eval $hasproto
11156
11157: see if difftime exists
11158set difftime d_difftime
11159eval $inlibc
11160
11161: see if this is a dirent system
11162echo " "
11163if xinc=`./findhdr dirent.h`; $test "$xinc"; then
11164 val="$define"
11165 echo "<dirent.h> found." >&4
11166else
11167 val="$undef"
11168 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
11169 echo "<sys/dir.h> found." >&4
11170 echo " "
11171 else
11172 xinc=`./findhdr sys/ndir.h`
11173 fi
11174 echo "<dirent.h> NOT found." >&4
11175fi
11176set i_dirent
11177eval $setvar
11178
11179: Look for type of directory structure.
11180echo " "
11181$cppstdin $cppflags $cppminus < "$xinc" > try.c
11182
11183case "$direntrytype" in
11184''|' ')
11185 case "$i_dirent" in
11186 $define) guess1='struct dirent' ;;
11187 *) guess1='struct direct' ;;
11188 esac
11189 ;;
11190*) guess1="$direntrytype"
11191 ;;
11192esac
11193
11194case "$guess1" in
11195'struct dirent') guess2='struct direct' ;;
11196*) guess2='struct dirent' ;;
11197esac
11198
11199if $contains "$guess1" try.c >/dev/null 2>&1; then
11200 direntrytype="$guess1"
11201 echo "Your directory entries are $direntrytype." >&4
11202elif $contains "$guess2" try.c >/dev/null 2>&1; then
11203 direntrytype="$guess2"
11204 echo "Your directory entries seem to be $direntrytype." >&4
11205else
11206 echo "I don't recognize your system's directory entries." >&4
11207 rp="What type is used for directory entries on this system?"
11208 dflt="$guess1"
11209 . ./myread
11210 direntrytype="$ans"
11211fi
11212$rm -f try.c
11213
11214
11215: see if the directory entry stores field length
11216echo " "
11217$cppstdin $cppflags $cppminus < "$xinc" > try.c
11218if $contains 'd_namlen' try.c >/dev/null 2>&1; then
11219 echo "Good, your directory entry keeps length information in d_namlen." >&4
11220 val="$define"
11221else
11222 echo "Your directory entry does not know about the d_namlen field." >&4
11223 val="$undef"
11224fi
11225set d_dirnamlen
11226eval $setvar
11227$rm -f try.c
11228
11229: see if this is an sysdir system
11230set sys/dir.h i_sysdir
11231eval $inhdr
11232
11233: see if this is an sysndir system
11234set sys/ndir.h i_sysndir
11235eval $inhdr
11236
11237: Look for dirfd
11238echo " "
11239$cat >dirfd.c <<EOM
11240#include <stdio.h>
11241#$i_stdlib I_STDLIB
11242#ifdef I_STDLIB
11243#include <stdlib.h>
11244#endif
11245#$i_dirent I_DIRENT /**/
11246#$i_sysdir I_SYS_DIR /**/
11247#$i_sysndir I_SYS_NDIR /**/
11248#$i_systypes I_SYS_TYPES /**/
11249#if defined(I_SYS_TYPES)
11250#include <sys/types.h>
11251#endif
11252#if defined(I_DIRENT)
11253#include <dirent.h>
11254#if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
11255#include <sys/dir.h>
11256#endif
11257#else
11258#ifdef I_SYS_NDIR
11259#include <sys/ndir.h>
11260#else
11261#ifdef I_SYS_DIR
11262#ifdef hp9000s500
11263#include <ndir.h> /* may be wrong in the future */
11264#else
11265#include <sys/dir.h>
11266#endif
11267#endif
11268#endif
11269#endif
11270int main() {
11271 DIR *dirp = opendir(".");
11272 if (dirfd(dirp) >= 0)
11273 exit(0);
11274 else
11275 exit(1);
11276}
11277EOM
11278val=$undef
11279set dirfd
11280if eval $compile; then
11281 val="$define"
11282fi
11283case "$val" in
11284$define) echo "dirfd() found." >&4 ;;
11285*) echo "dirfd() NOT found." >&4 ;;
11286esac
11287set d_dirfd
11288eval $setvar
11289$rm -f dirfd*
11290
11291: see if dlerror exists
11292xxx_runnm="$runnm"
11293runnm=false
11294set dlerror d_dlerror
11295eval $inlibc
11296runnm="$xxx_runnm"
11297
11298: see if dlfcn is available
11299set dlfcn.h i_dlfcn
11300eval $inhdr
11301
11302case "$usedl" in
11303$define|y|true)
11304 $cat << EOM
11305
11306On a few systems, the dynamically loaded modules that perl generates and uses
11307will need a different extension than shared libs. The default will probably
11308be appropriate.
11309
11310EOM
11311 case "$dlext" in
11312 '') dflt="$so" ;;
11313 *) dflt="$dlext" ;;
11314 esac
11315 rp='What is the extension of dynamically loaded modules'
11316 . ./myread
11317 dlext="$ans"
11318 ;;
11319*)
11320 dlext="none"
11321 ;;
11322esac
11323
11324: Check if dlsym need a leading underscore
11325echo " "
11326val="$undef"
11327
11328case "$dlsrc" in
11329dl_dlopen.xs)
11330 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
11331 $cat >dyna.c <<'EOM'
11332fred () { }
11333EOM
11334
11335$cat >fred.c<<EOM
11336
11337#include <stdio.h>
11338#$i_stdlib I_STDLIB
11339#ifdef I_STDLIB
11340#include <stdlib.h>
11341#endif
11342#$i_dlfcn I_DLFCN
11343#ifdef I_DLFCN
11344#include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
11345#else
11346#include <sys/types.h>
11347#include <nlist.h>
11348#include <link.h>
11349#endif
11350
11351extern int fred() ;
11352
11353int main()
11354{
11355 void * handle ;
11356 void * symbol ;
11357#ifndef RTLD_LAZY
11358 int mode = 1 ;
11359#else
11360 int mode = RTLD_LAZY ;
11361#endif
11362 handle = dlopen("./dyna.$dlext", mode) ;
11363 if (handle == NULL) {
11364 printf ("1\n") ;
11365 fflush (stdout) ;
11366 exit(0);
11367 }
11368 symbol = dlsym(handle, "fred") ;
11369 if (symbol == NULL) {
11370 /* try putting a leading underscore */
11371 symbol = dlsym(handle, "_fred") ;
11372 if (symbol == NULL) {
11373 printf ("2\n") ;
11374 fflush (stdout) ;
11375 exit(0);
11376 }
11377 printf ("3\n") ;
11378 }
11379 else
11380 printf ("4\n") ;
11381 fflush (stdout) ;
11382 exit(0);
11383}
11384EOM
11385 : Call the object file tmp-dyna.o in case dlext=o.
11386 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
11387 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
11388 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
11389 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
11390 xxx=`$run ./fred`
11391 case $xxx in
11392 1) echo "Test program failed using dlopen." >&4
11393 echo "Perhaps you should not use dynamic loading." >&4;;
11394 2) echo "Test program failed using dlsym." >&4
11395 echo "Perhaps you should not use dynamic loading." >&4;;
11396 3) echo "dlsym needs a leading underscore" >&4
11397 val="$define" ;;
11398 4) echo "dlsym doesn't need a leading underscore." >&4;;
11399 esac
11400 else
11401 echo "I can't compile and run the test program." >&4
11402 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
11403 fi
11404 ;;
11405esac
11406
11407$rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
11408
11409set d_dlsymun
11410eval $setvar
11411
11412: see if drand48_r exists
11413set drand48_r d_drand48_r
11414eval $inlibc
11415case "$d_drand48_r" in
11416"$define")
11417 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
11418 case "$d_drand48_r_proto:$usethreads" in
11419 ":define") d_drand48_r_proto=define
11420 set d_drand48_r_proto drand48_r $hdrs
11421 eval $hasproto ;;
11422 *) ;;
11423 esac
11424 case "$d_drand48_r_proto" in
11425 define)
11426 case "$drand48_r_proto" in
11427 ''|0) try='int drand48_r(struct drand48_data*, double*);'
11428 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
11429 esac
11430 case "$drand48_r_proto" in
11431 ''|0) d_drand48_r=undef
11432 drand48_r_proto=0
11433 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
11434 * ) case "$drand48_r_proto" in
11435 REENTRANT_PROTO*) ;;
11436 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
11437 esac
11438 echo "Prototype: $try" ;;
11439 esac
11440 ;;
11441 *) case "$usethreads" in
11442 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11443 esac
11444 d_drand48_r=undef
11445 drand48_r_proto=0
11446 ;;
11447 esac
11448 ;;
11449*) drand48_r_proto=0
11450 ;;
11451esac
11452
11453: see if prototype for drand48 is available
11454echo " "
11455set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11456eval $hasproto
11457
11458: see if dup2 exists
11459set dup2 d_dup2
11460eval $inlibc
11461
11462: see if eaccess exists
11463set eaccess d_eaccess
11464eval $inlibc
11465
11466: see if endgrent exists
11467set endgrent d_endgrent
11468eval $inlibc
11469
11470: see if this is an grp system
11471set grp.h i_grp
11472eval $inhdr
11473
11474case "$i_grp" in
11475$define)
11476 xxx=`./findhdr grp.h`
11477 $cppstdin $cppflags $cppminus < $xxx >$$.h
11478
11479 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11480 val="$define"
11481 else
11482 val="$undef"
11483 fi
11484 set d_grpasswd
11485 eval $setvar
11486
11487 $rm -f $$.h
11488 ;;
11489*)
11490 val="$undef";
11491 set d_grpasswd; eval $setvar
11492 ;;
11493esac
11494
11495: see if endgrent_r exists
11496set endgrent_r d_endgrent_r
11497eval $inlibc
11498case "$d_endgrent_r" in
11499"$define")
11500 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11501 case "$d_endgrent_r_proto:$usethreads" in
11502 ":define") d_endgrent_r_proto=define
11503 set d_endgrent_r_proto endgrent_r $hdrs
11504 eval $hasproto ;;
11505 *) ;;
11506 esac
11507 case "$d_endgrent_r_proto" in
11508 define)
11509 case "$endgrent_r_proto" in
11510 ''|0) try='int endgrent_r(FILE**);'
11511 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11512 esac
11513 case "$endgrent_r_proto" in
11514 ''|0) try='void endgrent_r(FILE**);'
11515 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11516 esac
11517 case "$endgrent_r_proto" in
11518 ''|0) d_endgrent_r=undef
11519 endgrent_r_proto=0
11520 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11521 * ) case "$endgrent_r_proto" in
11522 REENTRANT_PROTO*) ;;
11523 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11524 esac
11525 echo "Prototype: $try" ;;
11526 esac
11527 ;;
11528 *) case "$usethreads" in
11529 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11530 esac
11531 d_endgrent_r=undef
11532 endgrent_r_proto=0
11533 ;;
11534 esac
11535 ;;
11536*) endgrent_r_proto=0
11537 ;;
11538esac
11539
11540: see if endhostent exists
11541set endhostent d_endhent
11542eval $inlibc
11543
11544: see if this is a netdb.h system
11545set netdb.h i_netdb
11546eval $inhdr
11547
11548: see if endhostent_r exists
11549set endhostent_r d_endhostent_r
11550eval $inlibc
11551case "$d_endhostent_r" in
11552"$define")
11553 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11554 case "$d_endhostent_r_proto:$usethreads" in
11555 ":define") d_endhostent_r_proto=define
11556 set d_endhostent_r_proto endhostent_r $hdrs
11557 eval $hasproto ;;
11558 *) ;;
11559 esac
11560 case "$d_endhostent_r_proto" in
11561 define)
11562 case "$endhostent_r_proto" in
11563 ''|0) try='int endhostent_r(struct hostent_data*);'
11564 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11565 esac
11566 case "$endhostent_r_proto" in
11567 ''|0) try='void endhostent_r(struct hostent_data*);'
11568 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11569 esac
11570 case "$endhostent_r_proto" in
11571 ''|0) d_endhostent_r=undef
11572 endhostent_r_proto=0
11573 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11574 * ) case "$endhostent_r_proto" in
11575 REENTRANT_PROTO*) ;;
11576 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11577 esac
11578 echo "Prototype: $try" ;;
11579 esac
11580 ;;
11581 *) case "$usethreads" in
11582 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11583 esac
11584 d_endhostent_r=undef
11585 endhostent_r_proto=0
11586 ;;
11587 esac
11588 ;;
11589*) endhostent_r_proto=0
11590 ;;
11591esac
11592
11593: see if endnetent exists
11594set endnetent d_endnent
11595eval $inlibc
11596
11597: see if endnetent_r exists
11598set endnetent_r d_endnetent_r
11599eval $inlibc
11600case "$d_endnetent_r" in
11601"$define")
11602 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11603 case "$d_endnetent_r_proto:$usethreads" in
11604 ":define") d_endnetent_r_proto=define
11605 set d_endnetent_r_proto endnetent_r $hdrs
11606 eval $hasproto ;;
11607 *) ;;
11608 esac
11609 case "$d_endnetent_r_proto" in
11610 define)
11611 case "$endnetent_r_proto" in
11612 ''|0) try='int endnetent_r(struct netent_data*);'
11613 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11614 esac
11615 case "$endnetent_r_proto" in
11616 ''|0) try='void endnetent_r(struct netent_data*);'
11617 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11618 esac
11619 case "$endnetent_r_proto" in
11620 ''|0) d_endnetent_r=undef
11621 endnetent_r_proto=0
11622 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11623 * ) case "$endnetent_r_proto" in
11624 REENTRANT_PROTO*) ;;
11625 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11626 esac
11627 echo "Prototype: $try" ;;
11628 esac
11629 ;;
11630 *) case "$usethreads" in
11631 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11632 esac
11633 d_endnetent_r=undef
11634 endnetent_r_proto=0
11635 ;;
11636 esac
11637 ;;
11638*) endnetent_r_proto=0
11639 ;;
11640esac
11641
11642: see if endprotoent exists
11643set endprotoent d_endpent
11644eval $inlibc
11645
11646: see if endprotoent_r exists
11647set endprotoent_r d_endprotoent_r
11648eval $inlibc
11649case "$d_endprotoent_r" in
11650"$define")
11651 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11652 case "$d_endprotoent_r_proto:$usethreads" in
11653 ":define") d_endprotoent_r_proto=define
11654 set d_endprotoent_r_proto endprotoent_r $hdrs
11655 eval $hasproto ;;
11656 *) ;;
11657 esac
11658 case "$d_endprotoent_r_proto" in
11659 define)
11660 case "$endprotoent_r_proto" in
11661 ''|0) try='int endprotoent_r(struct protoent_data*);'
11662 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11663 esac
11664 case "$endprotoent_r_proto" in
11665 ''|0) try='void endprotoent_r(struct protoent_data*);'
11666 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11667 esac
11668 case "$endprotoent_r_proto" in
11669 ''|0) d_endprotoent_r=undef
11670 endprotoent_r_proto=0
11671 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11672 * ) case "$endprotoent_r_proto" in
11673 REENTRANT_PROTO*) ;;
11674 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11675 esac
11676 echo "Prototype: $try" ;;
11677 esac
11678 ;;
11679 *) case "$usethreads" in
11680 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11681 esac
11682 d_endprotoent_r=undef
11683 endprotoent_r_proto=0
11684 ;;
11685 esac
11686 ;;
11687*) endprotoent_r_proto=0
11688 ;;
11689esac
11690
11691: see if endpwent exists
11692set endpwent d_endpwent
11693eval $inlibc
11694
11695: see if this is a pwd.h system
11696set pwd.h i_pwd
11697eval $inhdr
11698
11699case "$i_pwd" in
11700$define)
11701 xxx=`./findhdr pwd.h`
11702 $cppstdin $cppflags $cppminus < $xxx >$$.h
11703
11704 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11705 val="$define"
11706 else
11707 val="$undef"
11708 fi
11709 set d_pwquota
11710 eval $setvar
11711
11712 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11713 val="$define"
11714 else
11715 val="$undef"
11716 fi
11717 set d_pwage
11718 eval $setvar
11719
11720 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11721 val="$define"
11722 else
11723 val="$undef"
11724 fi
11725 set d_pwchange
11726 eval $setvar
11727
11728 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11729 val="$define"
11730 else
11731 val="$undef"
11732 fi
11733 set d_pwclass
11734 eval $setvar
11735
11736 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11737 val="$define"
11738 else
11739 val="$undef"
11740 fi
11741 set d_pwexpire
11742 eval $setvar
11743
11744 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11745 val="$define"
11746 else
11747 val="$undef"
11748 fi
11749 set d_pwcomment
11750 eval $setvar
11751
11752 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11753 val="$define"
11754 else
11755 val="$undef"
11756 fi
11757 set d_pwgecos
11758 eval $setvar
11759
11760 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11761 val="$define"
11762 else
11763 val="$undef"
11764 fi
11765 set d_pwpasswd
11766 eval $setvar
11767
11768 $rm -f $$.h
11769 ;;
11770*)
11771 val="$undef";
11772 set d_pwquota; eval $setvar
11773 set d_pwage; eval $setvar
11774 set d_pwchange; eval $setvar
11775 set d_pwclass; eval $setvar
11776 set d_pwexpire; eval $setvar
11777 set d_pwcomment; eval $setvar
11778 set d_pwgecos; eval $setvar
11779 set d_pwpasswd; eval $setvar
11780 ;;
11781esac
11782
11783: see if endpwent_r exists
11784set endpwent_r d_endpwent_r
11785eval $inlibc
11786case "$d_endpwent_r" in
11787"$define")
11788 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11789 case "$d_endpwent_r_proto:$usethreads" in
11790 ":define") d_endpwent_r_proto=define
11791 set d_endpwent_r_proto endpwent_r $hdrs
11792 eval $hasproto ;;
11793 *) ;;
11794 esac
11795 case "$d_endpwent_r_proto" in
11796 define)
11797 case "$endpwent_r_proto" in
11798 ''|0) try='int endpwent_r(FILE**);'
11799 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11800 esac
11801 case "$endpwent_r_proto" in
11802 ''|0) try='void endpwent_r(FILE**);'
11803 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11804 esac
11805 case "$endpwent_r_proto" in
11806 ''|0) d_endpwent_r=undef
11807 endpwent_r_proto=0
11808 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11809 * ) case "$endpwent_r_proto" in
11810 REENTRANT_PROTO*) ;;
11811 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11812 esac
11813 echo "Prototype: $try" ;;
11814 esac
11815 ;;
11816 *) case "$usethreads" in
11817 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11818 esac
11819 d_endpwent_r=undef
11820 endpwent_r_proto=0
11821 ;;
11822 esac
11823 ;;
11824*) endpwent_r_proto=0
11825 ;;
11826esac
11827
11828: see if endservent exists
11829set endservent d_endsent
11830eval $inlibc
11831
11832: see if endservent_r exists
11833set endservent_r d_endservent_r
11834eval $inlibc
11835case "$d_endservent_r" in
11836"$define")
11837 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11838 case "$d_endservent_r_proto:$usethreads" in
11839 ":define") d_endservent_r_proto=define
11840 set d_endservent_r_proto endservent_r $hdrs
11841 eval $hasproto ;;
11842 *) ;;
11843 esac
11844 case "$d_endservent_r_proto" in
11845 define)
11846 case "$endservent_r_proto" in
11847 ''|0) try='int endservent_r(struct servent_data*);'
11848 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11849 esac
11850 case "$endservent_r_proto" in
11851 ''|0) try='void endservent_r(struct servent_data*);'
11852 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11853 esac
11854 case "$endservent_r_proto" in
11855 ''|0) d_endservent_r=undef
11856 endservent_r_proto=0
11857 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11858 * ) case "$endservent_r_proto" in
11859 REENTRANT_PROTO*) ;;
11860 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11861 esac
11862 echo "Prototype: $try" ;;
11863 esac
11864 ;;
11865 *) case "$usethreads" in
11866 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11867 esac
11868 d_endservent_r=undef
11869 endservent_r_proto=0
11870 ;;
11871 esac
11872 ;;
11873*) endservent_r_proto=0
11874 ;;
11875esac
11876
11877: Locate the flags for 'open()'
11878echo " "
11879$cat >try.c <<EOCP
11880#include <sys/types.h>
11881#ifdef I_FCNTL
11882#include <fcntl.h>
11883#endif
11884#ifdef I_SYS_FILE
11885#include <sys/file.h>
11886#endif
11887#$i_stdlib I_STDLIB
11888#ifdef I_STDLIB
11889#include <stdlib.h>
11890#endif
11891int main() {
11892 if(O_RDONLY);
11893#ifdef O_TRUNC
11894 exit(0);
11895#else
11896 exit(1);
11897#endif
11898}
11899EOCP
11900: check sys/file.h first to get FREAD on Sun
11901if $test `./findhdr sys/file.h` && \
11902 set try -DI_SYS_FILE && eval $compile; then
11903 h_sysfile=true;
11904 echo "<sys/file.h> defines the O_* constants..." >&4
11905 if $run ./try; then
11906 echo "and you have the 3 argument form of open()." >&4
11907 val="$define"
11908 else
11909 echo "but not the 3 argument form of open(). Oh, well." >&4
11910 val="$undef"
11911 fi
11912elif $test `./findhdr fcntl.h` && \
11913 set try -DI_FCNTL && eval $compile; then
11914 h_fcntl=true;
11915 echo "<fcntl.h> defines the O_* constants..." >&4
11916 if $run ./try; then
11917 echo "and you have the 3 argument form of open()." >&4
11918 val="$define"
11919 else
11920 echo "but not the 3 argument form of open(). Oh, well." >&4
11921 val="$undef"
11922 fi
11923else
11924 val="$undef"
11925 echo "I can't find the O_* constant definitions! You got problems." >&4
11926fi
11927set d_open3
11928eval $setvar
11929$rm -f try try.*
11930
11931: see which of string.h or strings.h is needed
11932echo " "
11933strings=`./findhdr string.h`
11934if $test "$strings" && $test -r "$strings"; then
11935 echo "Using <string.h> instead of <strings.h>." >&4
11936 val="$define"
11937else
11938 val="$undef"
11939 strings=`./findhdr strings.h`
11940 if $test "$strings" && $test -r "$strings"; then
11941 echo "Using <strings.h> instead of <string.h>." >&4
11942 else
11943 echo "No string header found -- You'll surely have problems." >&4
11944 fi
11945fi
11946set i_string
11947eval $setvar
11948case "$i_string" in
11949"$undef") strings=`./findhdr strings.h`;;
11950*) strings=`./findhdr string.h`;;
11951esac
11952
11953: see if this is a sys/file.h system
11954val=''
11955set sys/file.h val
11956eval $inhdr
11957
11958: do we need to include sys/file.h ?
11959case "$val" in
11960"$define")
11961 echo " "
11962 if $h_sysfile; then
11963 val="$define"
11964 echo "We'll be including <sys/file.h>." >&4
11965 else
11966 val="$undef"
11967 echo "We won't be including <sys/file.h>." >&4
11968 fi
11969 ;;
11970*)
11971 h_sysfile=false
11972 ;;
11973esac
11974set i_sysfile
11975eval $setvar
11976
11977: see if fcntl.h is there
11978val=''
11979set fcntl.h val
11980eval $inhdr
11981
11982: see if we can include fcntl.h
11983case "$val" in
11984"$define")
11985 echo " "
11986 if $h_fcntl; then
11987 val="$define"
11988 echo "We'll be including <fcntl.h>." >&4
11989 else
11990 val="$undef"
11991 if $h_sysfile; then
11992 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11993 else
11994 echo "We won't be including <fcntl.h>." >&4
11995 fi
11996 fi
11997 ;;
11998*)
11999 h_fcntl=false
12000 val="$undef"
12001 ;;
12002esac
12003set i_fcntl
12004eval $setvar
12005
12006: check for non-blocking I/O stuff
12007case "$h_sysfile" in
12008true) echo "#include <sys/file.h>" > head.c;;
12009*)
12010 case "$h_fcntl" in
12011 true) echo "#include <fcntl.h>" > head.c;;
12012 *) echo "#include <sys/fcntl.h>" > head.c;;
12013 esac
12014 ;;
12015esac
12016echo " "
12017echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
12018case "$o_nonblock" in
12019'')
12020 $cat head.c > try.c
12021 $cat >>try.c <<EOCP
12022#include <stdio.h>
12023#$i_stdlib I_STDLIB
12024#ifdef I_STDLIB
12025#include <stdlib.h>
12026#endif
12027#$i_fcntl I_FCNTL
12028#ifdef I_FCNTL
12029#include <fcntl.h>
12030#endif
12031int main() {
12032#ifdef O_NONBLOCK
12033 printf("O_NONBLOCK\n");
12034 exit(0);
12035#endif
12036#ifdef O_NDELAY
12037 printf("O_NDELAY\n");
12038 exit(0);
12039#endif
12040#ifdef FNDELAY
12041 printf("FNDELAY\n");
12042 exit(0);
12043#endif
12044 exit(0);
12045}
12046EOCP
12047 set try
12048 if eval $compile_ok; then
12049 o_nonblock=`$run ./try`
12050 case "$o_nonblock" in
12051 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
12052 *) echo "Seems like we can use $o_nonblock.";;
12053 esac
12054 else
12055 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
12056 fi
12057 ;;
12058*) echo "Using $hint value $o_nonblock.";;
12059esac
12060$rm -f try try.* .out core
12061
12062echo " "
12063echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
12064case "$eagain" in
12065'')
12066 $cat head.c > try.c
12067 $cat >>try.c <<EOCP
12068#include <errno.h>
12069#include <sys/types.h>
12070#include <signal.h>
12071#include <stdio.h>
12072#$i_stdlib I_STDLIB
12073#ifdef I_STDLIB
12074#include <stdlib.h>
12075#endif
12076#$i_fcntl I_FCNTL
12077#ifdef I_FCNTL
12078#include <fcntl.h>
12079#endif
12080#define MY_O_NONBLOCK $o_nonblock
12081#ifndef errno /* XXX need better Configure test */
12082extern int errno;
12083#endif
12084#$i_unistd I_UNISTD
12085#ifdef I_UNISTD
12086#include <unistd.h>
12087#endif
12088#$i_string I_STRING
12089#ifdef I_STRING
12090#include <string.h>
12091#else
12092#include <strings.h>
12093#endif
12094$signal_t blech(int x) { exit(3); }
12095EOCP
12096 $cat >> try.c <<'EOCP'
12097int main()
12098{
12099 int pd[2];
12100 int pu[2];
12101 char buf[1];
12102 char string[100];
12103
12104 pipe(pd); /* Down: child -> parent */
12105 pipe(pu); /* Up: parent -> child */
12106 if (0 != fork()) {
12107 int ret;
12108 close(pd[1]); /* Parent reads from pd[0] */
12109 close(pu[0]); /* Parent writes (blocking) to pu[1] */
12110#ifdef F_SETFL
12111 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
12112 exit(1);
12113#else
12114 exit(4);
12115#endif
12116 signal(SIGALRM, blech);
12117 alarm(5);
12118 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
12119 exit(2);
12120 sprintf(string, "%d\n", ret);
12121 write(2, string, strlen(string));
12122 alarm(0);
12123#ifdef EAGAIN
12124 if (errno == EAGAIN) {
12125 printf("EAGAIN\n");
12126 goto ok;
12127 }
12128#endif
12129#ifdef EWOULDBLOCK
12130 if (errno == EWOULDBLOCK)
12131 printf("EWOULDBLOCK\n");
12132#endif
12133 ok:
12134 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
12135 sleep(2); /* Give it time to close our pipe */
12136 alarm(5);
12137 ret = read(pd[0], buf, 1); /* Should read EOF */
12138 alarm(0);
12139 sprintf(string, "%d\n", ret);
12140 write(4, string, strlen(string));
12141 exit(0);
12142 }
12143
12144 close(pd[0]); /* We write to pd[1] */
12145 close(pu[1]); /* We read from pu[0] */
12146 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
12147 close(pd[1]); /* Pipe pd is now fully closed! */
12148 exit(0); /* Bye bye, thank you for playing! */
12149}
12150EOCP
12151 set try
12152 if eval $compile_ok; then
12153 echo "$startsh" >mtry
12154 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
12155 chmod +x mtry
12156 ./mtry >/dev/null 2>&1
12157 case $? in
12158 0) eagain=`$cat try.out`;;
12159 1) echo "Could not perform non-blocking setting!";;
12160 2) echo "I did a successful read() for something that was not there!";;
12161 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
12162 4) echo "Could not find F_SETFL!";;
12163 *) echo "Something terribly wrong happened during testing.";;
12164 esac
12165 rd_nodata=`$cat try.ret`
12166 echo "A read() system call with no data present returns $rd_nodata."
12167 case "$rd_nodata" in
12168 0|-1) ;;
12169 *)
12170 echo "(That's peculiar, fixing that to be -1.)"
12171 rd_nodata=-1
12172 ;;
12173 esac
12174 case "$eagain" in
12175 '')
12176 echo "Forcing errno EAGAIN on read() with no data available."
12177 eagain=EAGAIN
12178 ;;
12179 *)
12180 echo "Your read() sets errno to $eagain when no data is available."
12181 ;;
12182 esac
12183 status=`$cat try.err`
12184 case "$status" in
12185 0) echo "And it correctly returns 0 to signal EOF.";;
12186 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
12187 *) echo "However, your read() returns '$status' on EOF??";;
12188 esac
12189 val="$define"
12190 if test "$status" = "$rd_nodata"; then
12191 echo "WARNING: you can't distinguish between EOF and no data!"
12192 val="$undef"
12193 fi
12194 else
12195 echo "I can't compile the test program--assuming errno EAGAIN will do."
12196 eagain=EAGAIN
12197 fi
12198 set d_eofnblk
12199 eval $setvar
12200 ;;
12201*)
12202 echo "Using $hint value $eagain."
12203 echo "Your read() returns $rd_nodata when no data is present."
12204 case "$d_eofnblk" in
12205 "$define") echo "And you can see EOF because read() returns 0.";;
12206 "$undef") echo "But you can't see EOF status from read() returned value.";;
12207 *)
12208 echo "(Assuming you can't see EOF status from read anyway.)"
12209 d_eofnblk=$undef
12210 ;;
12211 esac
12212 ;;
12213esac
12214$rm -f try try.* .out core head.c mtry
12215
12216: see if _ptr and _cnt from stdio act std
12217echo " "
12218
12219if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
12220 echo "(Looks like you have stdio.h from BSD.)"
12221 case "$stdio_ptr" in
12222 '') stdio_ptr='((fp)->_p)'
12223 ptr_lval=$define
12224 ;;
12225 *) ptr_lval=$d_stdio_ptr_lval;;
12226 esac
12227 case "$stdio_cnt" in
12228 '') stdio_cnt='((fp)->_r)'
12229 cnt_lval=$define
12230 ;;
12231 *) cnt_lval=$d_stdio_cnt_lval;;
12232 esac
12233 case "$stdio_base" in
12234 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
12235 esac
12236 case "$stdio_bufsiz" in
12237 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
12238 esac
12239elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
12240 echo "(Looks like you have stdio.h from Linux.)"
12241 case "$stdio_ptr" in
12242 '') stdio_ptr='((fp)->_IO_read_ptr)'
12243 ptr_lval=$define
12244 ;;
12245 *) ptr_lval=$d_stdio_ptr_lval;;
12246 esac
12247 case "$stdio_cnt" in
12248 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
12249 cnt_lval=$undef
12250 ;;
12251 *) cnt_lval=$d_stdio_cnt_lval;;
12252 esac
12253 case "$stdio_base" in
12254 '') stdio_base='((fp)->_IO_read_base)';;
12255 esac
12256 case "$stdio_bufsiz" in
12257 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
12258 esac
12259else
12260 case "$stdio_ptr" in
12261 '') stdio_ptr='((fp)->_ptr)'
12262 ptr_lval=$define
12263 ;;
12264 *) ptr_lval=$d_stdio_ptr_lval;;
12265 esac
12266 case "$stdio_cnt" in
12267 '') stdio_cnt='((fp)->_cnt)'
12268 cnt_lval=$define
12269 ;;
12270 *) cnt_lval=$d_stdio_cnt_lval;;
12271 esac
12272 case "$stdio_base" in
12273 '') stdio_base='((fp)->_base)';;
12274 esac
12275 case "$stdio_bufsiz" in
12276 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
12277 esac
12278fi
12279
12280: test whether _ptr and _cnt really work
12281echo "Checking how std your stdio is..." >&4
12282$cat >try.c <<EOP
12283#include <stdio.h>
12284#$i_stdlib I_STDLIB
12285#ifdef I_STDLIB
12286#include <stdlib.h>
12287#endif
12288#define FILE_ptr(fp) $stdio_ptr
12289#define FILE_cnt(fp) $stdio_cnt
12290int main() {
12291 FILE *fp = fopen("try.c", "r");
12292 char c = getc(fp);
12293 if (
12294 18 <= FILE_cnt(fp) &&
12295 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12296 )
12297 exit(0);
12298 exit(1);
12299}
12300EOP
12301val="$undef"
12302set try
12303if eval $compile && $to try.c; then
12304 if $run ./try; then
12305 echo "Your stdio acts pretty std."
12306 val="$define"
12307 else
12308 echo "Your stdio isn't very std."
12309 fi
12310else
12311 echo "Your stdio doesn't appear very std."
12312fi
12313$rm -f try.c try
12314
12315# glibc 2.2.90 and above apparently change stdio streams so Perl's
12316# direct buffer manipulation no longer works. The Configure tests
12317# should be changed to correctly detect this, but until then,
12318# the following check should at least let perl compile and run.
12319# (This quick fix should be updated before 5.8.1.)
12320# To be defensive, reject all unknown versions, and all versions > 2.2.9.
12321# A. Dougherty, June 3, 2002.
12322case "$d_gnulibc" in
12323$define)
12324 case "$gnulibc_version" in
12325 2.[01]*) ;;
12326 2.2) ;;
12327 2.2.[0-9]) ;;
12328 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
12329 val="$undef"
12330 ;;
12331 esac
12332 ;;
12333esac
12334set d_stdstdio
12335eval $setvar
12336
12337: Can _ptr be used as an lvalue?
12338case "$d_stdstdio$ptr_lval" in
12339$define$define) val=$define ;;
12340*) val=$undef ;;
12341esac
12342set d_stdio_ptr_lval
12343eval $setvar
12344
12345: Can _cnt be used as an lvalue?
12346case "$d_stdstdio$cnt_lval" in
12347$define$define) val=$define ;;
12348*) val=$undef ;;
12349esac
12350set d_stdio_cnt_lval
12351eval $setvar
12352
12353
12354: test whether setting _ptr sets _cnt as a side effect
12355d_stdio_ptr_lval_sets_cnt="$undef"
12356d_stdio_ptr_lval_nochange_cnt="$undef"
12357case "$d_stdio_ptr_lval$d_stdstdio" in
12358$define$define)
12359 echo "Checking to see what happens if we set the stdio ptr..." >&4
12360$cat >try.c <<EOP
12361#include <stdio.h>
12362/* Can we scream? */
12363/* Eat dust sed :-) */
12364/* In the buffer space, no one can hear you scream. */
12365#$i_stdlib I_STDLIB
12366#ifdef I_STDLIB
12367#include <stdlib.h>
12368#endif
12369#define FILE_ptr(fp) $stdio_ptr
12370#define FILE_cnt(fp) $stdio_cnt
12371#include <sys/types.h>
12372int main() {
12373 FILE *fp = fopen("try.c", "r");
12374 int c;
12375 char *ptr;
12376 size_t cnt;
12377 if (!fp) {
12378 puts("Fail even to read");
12379 exit(1);
12380 }
12381 c = getc(fp); /* Read away the first # */
12382 if (c == EOF) {
12383 puts("Fail even to read");
12384 exit(1);
12385 }
12386 if (!(
12387 18 <= FILE_cnt(fp) &&
12388 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12389 )) {
12390 puts("Fail even to read");
12391 exit (1);
12392 }
12393 ptr = (char*) FILE_ptr(fp);
12394 cnt = (size_t)FILE_cnt(fp);
12395
12396 FILE_ptr(fp) += 42;
12397
12398 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12399 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12400 exit (1);
12401 }
12402 if (FILE_cnt(fp) <= 20) {
12403 printf ("Fail (<20 chars to test)");
12404 exit (1);
12405 }
12406 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12407 puts("Fail compare");
12408 exit (1);
12409 }
12410 if (cnt == FILE_cnt(fp)) {
12411 puts("Pass_unchanged");
12412 exit (0);
12413 }
12414 if (FILE_cnt(fp) == (cnt - 42)) {
12415 puts("Pass_changed");
12416 exit (0);
12417 }
12418 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12419 return 1;
12420
12421}
12422EOP
12423 set try
12424 if eval $compile && $to try.c; then
12425 case `$run ./try` in
12426 Pass_changed)
12427 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12428 d_stdio_ptr_lval_sets_cnt="$define" ;;
12429 Pass_unchanged)
12430 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12431 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12432 Fail*)
12433 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12434 *)
12435 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12436 esac
12437 else
12438 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12439 fi
12440 $rm -f try.c try
12441 ;;
12442esac
12443
12444: see if _base is also standard
12445val="$undef"
12446case "$d_stdstdio" in
12447$define)
12448 $cat >try.c <<EOP
12449#include <stdio.h>
12450#$i_stdlib I_STDLIB
12451#ifdef I_STDLIB
12452#include <stdlib.h>
12453#endif
12454#define FILE_base(fp) $stdio_base
12455#define FILE_bufsiz(fp) $stdio_bufsiz
12456int main() {
12457 FILE *fp = fopen("try.c", "r");
12458 char c = getc(fp);
12459 if (
12460 19 <= FILE_bufsiz(fp) &&
12461 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12462 )
12463 exit(0);
12464 exit(1);
12465}
12466EOP
12467 set try
12468 if eval $compile && $to try.c; then
12469 if $run ./try; then
12470 echo "And its _base field acts std."
12471 val="$define"
12472 else
12473 echo "But its _base field isn't std."
12474 fi
12475 else
12476 echo "However, it seems to be lacking the _base field."
12477 fi
12478 $rm -f try.c try
12479 ;;
12480esac
12481set d_stdiobase
12482eval $setvar
12483
12484: see if fast_stdio exists
12485val="$undef"
12486case "$d_stdstdio:$d_stdio_ptr_lval" in
12487"$define:$define")
12488 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12489 *$define*)
12490 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12491 val="$define"
12492 ;;
12493 esac
12494 ;;
12495esac
12496set d_faststdio
12497eval $setvar
12498
12499
12500
12501: see if fchdir exists
12502set fchdir d_fchdir
12503eval $inlibc
12504
12505: see if fchmod exists
12506set fchmod d_fchmod
12507eval $inlibc
12508
12509: see if fchown exists
12510set fchown d_fchown
12511eval $inlibc
12512
12513: see if this is an fcntl system
12514set fcntl d_fcntl
12515eval $inlibc
12516
12517echo " "
12518: See if fcntl-based locking works.
12519$cat >try.c <<EOCP
12520#$i_stdlib I_STDLIB
12521#ifdef I_STDLIB
12522#include <stdlib.h>
12523#endif
12524#include <unistd.h>
12525#include <fcntl.h>
12526#include <signal.h>
12527$signal_t blech(int x) { exit(3); }
12528int main() {
12529#if defined(F_SETLK) && defined(F_SETLKW)
12530 struct flock flock;
12531 int retval, fd;
12532 fd = open("try.c", O_RDONLY);
12533 flock.l_type = F_RDLCK;
12534 flock.l_whence = SEEK_SET;
12535 flock.l_start = flock.l_len = 0;
12536 signal(SIGALRM, blech);
12537 alarm(10);
12538 retval = fcntl(fd, F_SETLK, &flock);
12539 close(fd);
12540 (retval < 0 ? exit(2) : exit(0));
12541#else
12542 exit(2);
12543#endif
12544}
12545EOCP
12546echo "Checking if fcntl-based file locking works... "
12547case "$d_fcntl" in
12548"$define")
12549 set try
12550 if eval $compile_ok; then
12551 if $run ./try; then
12552 echo "Yes, it seems to work."
12553 val="$define"
12554 else
12555 echo "Nope, it didn't work."
12556 val="$undef"
12557 case "$?" in
12558 3) $cat >&4 <<EOM
12559***
12560*** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12561*** This is (almost) impossible.
12562*** If your NFS lock daemons are not feeling well, something like
12563*** this may happen, please investigate. Cannot continue, aborting.
12564***
12565EOM
12566 exit 1
12567 ;;
12568 esac
12569 fi
12570 else
12571 echo "I'm unable to compile the test program, so I'll assume not."
12572 val="$undef"
12573 fi
12574 ;;
12575*) val="$undef";
12576 echo "Nope, since you don't even have fcntl()."
12577 ;;
12578esac
12579set d_fcntl_can_lock
12580eval $setvar
12581$rm -f try*
12582
12583
12584: check for fd_set items
12585$cat <<EOM
12586
12587Checking to see how well your C compiler handles fd_set and friends ...
12588EOM
12589$cat >try.c <<EOCP
12590#$i_stdlib I_STDLIB
12591#ifdef I_STDLIB
12592#include <stdlib.h>
12593#endif
12594#$i_systime I_SYS_TIME
12595#$i_sysselct I_SYS_SELECT
12596#$d_socket HAS_SOCKET
12597#include <sys/types.h>
12598#ifdef HAS_SOCKET
12599#include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12600#endif
12601#ifdef I_SYS_TIME
12602#include <sys/time.h>
12603#endif
12604#ifdef I_SYS_SELECT
12605#include <sys/select.h>
12606#endif
12607int main() {
12608 fd_set fds;
12609
12610#ifdef TRYBITS
12611 if(fds.fds_bits);
12612#endif
12613
12614#if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12615 exit(0);
12616#else
12617 exit(1);
12618#endif
12619}
12620EOCP
12621set try -DTRYBITS
12622if eval $compile; then
12623 d_fds_bits="$define"
12624 d_fd_set="$define"
12625 echo "Well, your system knows about the normal fd_set typedef..." >&4
12626 if $run ./try; then
12627 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12628 d_fd_macros="$define"
12629 else
12630 $cat >&4 <<'EOM'
12631but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12632EOM
12633 d_fd_macros="$undef"
12634 fi
12635else
12636 $cat <<'EOM'
12637Hmm, your compiler has some difficulty with fd_set. Checking further...
12638EOM
12639 set try
12640 if eval $compile; then
12641 d_fds_bits="$undef"
12642 d_fd_set="$define"
12643 echo "Well, your system has some sort of fd_set available..." >&4
12644 if $run ./try; then
12645 echo "and you have the normal fd_set macros." >&4
12646 d_fd_macros="$define"
12647 else
12648 $cat <<'EOM'
12649but not the normal fd_set macros! Gross! More work for me...
12650EOM
12651 d_fd_macros="$undef"
12652 fi
12653 else
12654 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12655 d_fd_set="$undef"
12656 d_fds_bits="$undef"
12657 d_fd_macros="$undef"
12658 fi
12659fi
12660$rm -f try try.*
12661
12662: see if fgetpos exists
12663set fgetpos d_fgetpos
12664eval $inlibc
12665
12666: see if finite exists
12667set finite d_finite
12668eval $inlibc
12669
12670: see if finitel exists
12671set finitel d_finitel
12672eval $inlibc
12673
12674: see if flock exists
12675set flock d_flock
12676eval $inlibc
12677
12678: see if prototype for flock is available
12679echo " "
12680set d_flockproto flock $i_sysfile sys/file.h
12681eval $hasproto
12682
12683: see if fork exists
12684set fork d_fork
12685eval $inlibc
12686
12687: see if fp_class exists
12688set fp_class d_fp_class
12689eval $inlibc
12690
12691: see if pathconf exists
12692set pathconf d_pathconf
12693eval $inlibc
12694
12695: see if fpathconf exists
12696set fpathconf d_fpathconf
12697eval $inlibc
12698
12699: see if fpclass exists
12700set fpclass d_fpclass
12701eval $inlibc
12702
12703: see if fpclassify exists
12704set fpclassify d_fpclassify
12705eval $inlibc
12706
12707: see if fpclassl exists
12708set fpclassl d_fpclassl
12709eval $inlibc
12710
12711
12712: check for fpos64_t
12713echo " "
12714echo "Checking to see if you have fpos64_t..." >&4
12715$cat >try.c <<EOCP
12716#include <stdio.h>
12717int main() { fpos64_t x = 7; }
12718EOCP
12719set try
12720if eval $compile; then
12721 val="$define"
12722 echo "You have fpos64_t."
12723else
12724 val="$undef"
12725 echo "You do not have fpos64_t."
12726 case "$fpossize" in
12727 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12728 esac
12729fi
12730$rm -f try.* try
12731set d_fpos64_t
12732eval $setvar
12733
12734: see if frexpl exists
12735set frexpl d_frexpl
12736eval $inlibc
12737
12738: see if this is a sys/param system
12739set sys/param.h i_sysparam
12740eval $inhdr
12741
12742: see if this is a sys/mount.h system
12743set sys/mount.h i_sysmount
12744eval $inhdr
12745
12746
12747echo " "
12748echo "Checking to see if your system supports struct fs_data..." >&4
12749set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12750eval $hasstruct
12751case "$d_fs_data_s" in
12752"$define") echo "Yes, it does." ;;
12753*) echo "No, it doesn't." ;;
12754esac
12755
12756: see if fseeko exists
12757set fseeko d_fseeko
12758eval $inlibc
12759case "$longsize" in
127608) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12761esac
12762
12763: see if fsetpos exists
12764set fsetpos d_fsetpos
12765eval $inlibc
12766
12767
12768: see if fstatfs exists
12769set fstatfs d_fstatfs
12770eval $inlibc
12771
12772
12773: see if statvfs exists
12774set statvfs d_statvfs
12775eval $inlibc
12776
12777: see if fstatvfs exists
12778set fstatvfs d_fstatvfs
12779eval $inlibc
12780
12781
12782: see if fsync exists
12783set fsync d_fsync
12784eval $inlibc
12785
12786: see if ftello exists
12787set ftello d_ftello
12788eval $inlibc
12789case "$longsize" in
127908) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12791esac
12792
12793d_futimes="$undef"
12794: check for a working futimes
12795echo " "
12796echo "Checking for a working futimes()" >&4
12797$cat >try.c <<EOCP
12798#include <stdio.h>
12799#include <sys/time.h>
12800#include <errno.h>
12801#include <fcntl.h>
12802
12803int main ()
12804{
12805 int fd, rv;
12806 fd = open ("try.c", O_RDWR);
12807 if (-1 == fd) exit (1);
12808 rv = futimes (fd, NULL);
12809 exit (rv == -1 ? errno : 0);
12810}
12811EOCP
12812set try
12813if eval $compile; then
12814 `$run ./try`
12815 rc=$?
12816 case "$rc" in
12817 0) echo "Yes, it does" >&4
12818 d_futimes="$define"
12819 ;;
12820 *) echo "No, it has futimes, but it isn't working ($rc) (probably harmless)\n" >&4
12821 ;;
12822 esac
12823else
12824 echo "No, it does not (probably harmless)\n" >&4
12825fi
12826$rm -f try.* try core core.try.*
12827
12828: see if getcwd exists
12829set getcwd d_getcwd
12830eval $inlibc
12831
12832: see if getespwnam exists
12833set getespwnam d_getespwnam
12834eval $inlibc
12835
12836
12837: see if getfsstat exists
12838set getfsstat d_getfsstat
12839eval $inlibc
12840
12841: see if getgrent exists
12842set getgrent d_getgrent
12843eval $inlibc
12844
12845: see if getgrent_r exists
12846set getgrent_r d_getgrent_r
12847eval $inlibc
12848case "$d_getgrent_r" in
12849"$define")
12850 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12851 case "$d_getgrent_r_proto:$usethreads" in
12852 ":define") d_getgrent_r_proto=define
12853 set d_getgrent_r_proto getgrent_r $hdrs
12854 eval $hasproto ;;
12855 *) ;;
12856 esac
12857 case "$d_getgrent_r_proto" in
12858 define)
12859 case "$getgrent_r_proto" in
12860 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12861 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12862 esac
12863 case "$getgrent_r_proto" in
12864 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12865 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12866 esac
12867 case "$getgrent_r_proto" in
12868 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12869 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12870 esac
12871 case "$getgrent_r_proto" in
12872 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12873 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12874 esac
12875 case "$getgrent_r_proto" in
12876 ''|0) try='int getgrent_r(struct group*, char*, int);'
12877 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12878 esac
12879 case "$getgrent_r_proto" in
12880 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12881 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12882 esac
12883 case "$getgrent_r_proto" in
12884 ''|0) d_getgrent_r=undef
12885 getgrent_r_proto=0
12886 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12887 * ) case "$getgrent_r_proto" in
12888 REENTRANT_PROTO*) ;;
12889 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12890 esac
12891 echo "Prototype: $try" ;;
12892 esac
12893 ;;
12894 *) case "$usethreads" in
12895 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12896 esac
12897 d_getgrent_r=undef
12898 getgrent_r_proto=0
12899 ;;
12900 esac
12901 ;;
12902*) getgrent_r_proto=0
12903 ;;
12904esac
12905
12906: see if getgrgid_r exists
12907set getgrgid_r d_getgrgid_r
12908eval $inlibc
12909case "$d_getgrgid_r" in
12910"$define")
12911 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12912 case "$d_getgrgid_r_proto:$usethreads" in
12913 ":define") d_getgrgid_r_proto=define
12914 set d_getgrgid_r_proto getgrgid_r $hdrs
12915 eval $hasproto ;;
12916 *) ;;
12917 esac
12918 case "$d_getgrgid_r_proto" in
12919 define)
12920 case "$getgrgid_r_proto" in
12921 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12922 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12923 esac
12924 case "$getgrgid_r_proto" in
12925 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12926 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12927 esac
12928 case "$getgrgid_r_proto" in
12929 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12930 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12931 esac
12932 case "$getgrgid_r_proto" in
12933 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12934 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12935 esac
12936 case "$getgrgid_r_proto" in
12937 ''|0) d_getgrgid_r=undef
12938 getgrgid_r_proto=0
12939 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12940 * ) case "$getgrgid_r_proto" in
12941 REENTRANT_PROTO*) ;;
12942 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12943 esac
12944 echo "Prototype: $try" ;;
12945 esac
12946 ;;
12947 *) case "$usethreads" in
12948 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12949 esac
12950 d_getgrgid_r=undef
12951 getgrgid_r_proto=0
12952 ;;
12953 esac
12954 ;;
12955*) getgrgid_r_proto=0
12956 ;;
12957esac
12958
12959: see if getgrnam_r exists
12960set getgrnam_r d_getgrnam_r
12961eval $inlibc
12962case "$d_getgrnam_r" in
12963"$define")
12964 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12965 case "$d_getgrnam_r_proto:$usethreads" in
12966 ":define") d_getgrnam_r_proto=define
12967 set d_getgrnam_r_proto getgrnam_r $hdrs
12968 eval $hasproto ;;
12969 *) ;;
12970 esac
12971 case "$d_getgrnam_r_proto" in
12972 define)
12973 case "$getgrnam_r_proto" in
12974 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12975 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12976 esac
12977 case "$getgrnam_r_proto" in
12978 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12979 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12980 esac
12981 case "$getgrnam_r_proto" in
12982 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12983 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12984 esac
12985 case "$getgrnam_r_proto" in
12986 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12987 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12988 esac
12989 case "$getgrnam_r_proto" in
12990 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12991 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12992 esac
12993 case "$getgrnam_r_proto" in
12994 ''|0) d_getgrnam_r=undef
12995 getgrnam_r_proto=0
12996 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12997 * ) case "$getgrnam_r_proto" in
12998 REENTRANT_PROTO*) ;;
12999 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
13000 esac
13001 echo "Prototype: $try" ;;
13002 esac
13003 ;;
13004 *) case "$usethreads" in
13005 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
13006 esac
13007 d_getgrnam_r=undef
13008 getgrnam_r_proto=0
13009 ;;
13010 esac
13011 ;;
13012*) getgrnam_r_proto=0
13013 ;;
13014esac
13015
13016: see if gethostbyaddr exists
13017set gethostbyaddr d_gethbyaddr
13018eval $inlibc
13019
13020: see if gethostbyname exists
13021set gethostbyname d_gethbyname
13022eval $inlibc
13023
13024: see if gethostent exists
13025set gethostent d_gethent
13026eval $inlibc
13027
13028: see how we will look up host name
13029echo " "
13030call=''
13031if set gethostname val -f d_gethname; eval $csym; $val; then
13032 echo 'gethostname() found.' >&4
13033 d_gethname="$define"
13034 call=gethostname
13035fi
13036if set uname val -f d_uname; eval $csym; $val; then
13037 if ./xenix; then
13038 $cat <<'EOM'
13039uname() was found, but you're running xenix, and older versions of xenix
13040have a broken uname(). If you don't really know whether your xenix is old
13041enough to have a broken system call, use the default answer.
13042
13043EOM
13044 dflt=y
13045 case "$d_uname" in
13046 "$define") dflt=n;;
13047 esac
13048 rp='Is your uname() broken?'
13049 . ./myread
13050 case "$ans" in
13051 n*) d_uname="$define"; call=uname;;
13052 esac
13053 else
13054 echo 'uname() found.' >&4
13055 d_uname="$define"
13056 case "$call" in
13057 '') call=uname ;;
13058 esac
13059 fi
13060fi
13061case "$d_gethname" in
13062'') d_gethname="$undef";;
13063esac
13064case "$d_uname" in
13065'') d_uname="$undef";;
13066esac
13067case "$d_uname$d_gethname" in
13068*define*)
13069 dflt=n
13070 cat <<EOM
13071
13072Every now and then someone has a $call() that lies about the hostname
13073but can't be fixed for political or economic reasons. If you wish, I can
13074pretend $call() isn't there and maybe compute hostname at run-time
13075thanks to the '$phostname' command.
13076
13077EOM
13078 rp="Shall I ignore $call() from now on?"
13079 . ./myread
13080 case "$ans" in
13081 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
13082 esac;;
13083esac
13084case "$phostname" in
13085'') aphostname='';;
13086*) case "$aphostname" in
13087 /*) ;;
13088 *) set X $phostname
13089 shift
13090 file=$1
13091 shift
13092 file=`./loc $file $file $pth`
13093 aphostname=`echo $file $*`
13094 ;;
13095 esac
13096 ;;
13097esac
13098case "$d_uname$d_gethname" in
13099*define*) ;;
13100*)
13101 case "$phostname" in
13102 '')
13103 echo "There will be no way for $package to get your hostname." >&4;;
13104 *)
13105 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
13106 ;;
13107 esac;;
13108esac
13109case "$d_phostname" in
13110'') d_phostname="$undef";;
13111esac
13112
13113: see if gethostbyaddr_r exists
13114set gethostbyaddr_r d_gethostbyaddr_r
13115eval $inlibc
13116case "$d_gethostbyaddr_r" in
13117"$define")
13118 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13119 case "$d_gethostbyaddr_r_proto:$usethreads" in
13120 ":define") d_gethostbyaddr_r_proto=define
13121 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
13122 eval $hasproto ;;
13123 *) ;;
13124 esac
13125 case "$d_gethostbyaddr_r_proto" in
13126 define)
13127 case "$gethostbyaddr_r_proto" in
13128 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13129 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
13130 esac
13131 case "$gethostbyaddr_r_proto" in
13132 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
13133 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
13134 esac
13135 case "$gethostbyaddr_r_proto" in
13136 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
13137 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
13138 esac
13139 case "$gethostbyaddr_r_proto" in
13140 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
13141 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
13142 esac
13143 case "$gethostbyaddr_r_proto" in
13144 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
13145 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
13146 esac
13147 case "$gethostbyaddr_r_proto" in
13148 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
13149 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
13150 esac
13151 case "$gethostbyaddr_r_proto" in
13152 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
13153 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
13154 esac
13155 case "$gethostbyaddr_r_proto" in
13156 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
13157 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
13158 esac
13159 case "$gethostbyaddr_r_proto" in
13160 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
13161 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
13162 esac
13163 case "$gethostbyaddr_r_proto" in
13164 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
13165 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
13166 esac
13167 case "$gethostbyaddr_r_proto" in
13168 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
13169 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
13170 esac
13171 case "$gethostbyaddr_r_proto" in
13172 ''|0) d_gethostbyaddr_r=undef
13173 gethostbyaddr_r_proto=0
13174 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
13175 * ) case "$gethostbyaddr_r_proto" in
13176 REENTRANT_PROTO*) ;;
13177 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
13178 esac
13179 echo "Prototype: $try" ;;
13180 esac
13181 ;;
13182 *) case "$usethreads" in
13183 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
13184 esac
13185 d_gethostbyaddr_r=undef
13186 gethostbyaddr_r_proto=0
13187 ;;
13188 esac
13189 ;;
13190*) gethostbyaddr_r_proto=0
13191 ;;
13192esac
13193
13194: see if gethostbyname_r exists
13195set gethostbyname_r d_gethostbyname_r
13196eval $inlibc
13197case "$d_gethostbyname_r" in
13198"$define")
13199 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13200 case "$d_gethostbyname_r_proto:$usethreads" in
13201 ":define") d_gethostbyname_r_proto=define
13202 set d_gethostbyname_r_proto gethostbyname_r $hdrs
13203 eval $hasproto ;;
13204 *) ;;
13205 esac
13206 case "$d_gethostbyname_r_proto" in
13207 define)
13208 case "$gethostbyname_r_proto" in
13209 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
13210 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
13211 esac
13212 case "$gethostbyname_r_proto" in
13213 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
13214 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
13215 esac
13216 case "$gethostbyname_r_proto" in
13217 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
13218 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
13219 esac
13220 case "$gethostbyname_r_proto" in
13221 ''|0) d_gethostbyname_r=undef
13222 gethostbyname_r_proto=0
13223 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
13224 * ) case "$gethostbyname_r_proto" in
13225 REENTRANT_PROTO*) ;;
13226 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
13227 esac
13228 echo "Prototype: $try" ;;
13229 esac
13230 ;;
13231 *) case "$usethreads" in
13232 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
13233 esac
13234 d_gethostbyname_r=undef
13235 gethostbyname_r_proto=0
13236 ;;
13237 esac
13238 ;;
13239*) gethostbyname_r_proto=0
13240 ;;
13241esac
13242
13243: see if gethostent_r exists
13244set gethostent_r d_gethostent_r
13245eval $inlibc
13246case "$d_gethostent_r" in
13247"$define")
13248 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13249 case "$d_gethostent_r_proto:$usethreads" in
13250 ":define") d_gethostent_r_proto=define
13251 set d_gethostent_r_proto gethostent_r $hdrs
13252 eval $hasproto ;;
13253 *) ;;
13254 esac
13255 case "$d_gethostent_r_proto" in
13256 define)
13257 case "$gethostent_r_proto" in
13258 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
13259 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
13260 esac
13261 case "$gethostent_r_proto" in
13262 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
13263 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
13264 esac
13265 case "$gethostent_r_proto" in
13266 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
13267 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
13268 esac
13269 case "$gethostent_r_proto" in
13270 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
13271 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
13272 esac
13273 case "$gethostent_r_proto" in
13274 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
13275 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
13276 esac
13277 case "$gethostent_r_proto" in
13278 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
13279 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
13280 esac
13281 case "$gethostent_r_proto" in
13282 ''|0) d_gethostent_r=undef
13283 gethostent_r_proto=0
13284 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
13285 * ) case "$gethostent_r_proto" in
13286 REENTRANT_PROTO*) ;;
13287 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
13288 esac
13289 echo "Prototype: $try" ;;
13290 esac
13291 ;;
13292 *) case "$usethreads" in
13293 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
13294 esac
13295 d_gethostent_r=undef
13296 gethostent_r_proto=0
13297 ;;
13298 esac
13299 ;;
13300*) gethostent_r_proto=0
13301 ;;
13302esac
13303
13304: see if prototypes for various gethostxxx netdb.h functions are available
13305echo " "
13306set d_gethostprotos gethostent $i_netdb netdb.h
13307eval $hasproto
13308
13309: see if getitimer exists
13310set getitimer d_getitimer
13311eval $inlibc
13312
13313: see if getlogin exists
13314set getlogin d_getlogin
13315eval $inlibc
13316
13317: see if getlogin_r exists
13318set getlogin_r d_getlogin_r
13319eval $inlibc
13320case "$d_getlogin_r" in
13321"$define")
13322 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
13323 case "$d_getlogin_r_proto:$usethreads" in
13324 ":define") d_getlogin_r_proto=define
13325 set d_getlogin_r_proto getlogin_r $hdrs
13326 eval $hasproto ;;
13327 *) ;;
13328 esac
13329 case "$d_getlogin_r_proto" in
13330 define)
13331 case "$getlogin_r_proto" in
13332 ''|0) try='int getlogin_r(char*, size_t);'
13333 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
13334 esac
13335 case "$getlogin_r_proto" in
13336 ''|0) try='int getlogin_r(char*, int);'
13337 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
13338 esac
13339 case "$getlogin_r_proto" in
13340 ''|0) try='char* getlogin_r(char*, size_t);'
13341 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
13342 esac
13343 case "$getlogin_r_proto" in
13344 ''|0) try='char* getlogin_r(char*, int);'
13345 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
13346 esac
13347 case "$getlogin_r_proto" in
13348 ''|0) d_getlogin_r=undef
13349 getlogin_r_proto=0
13350 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
13351 * ) case "$getlogin_r_proto" in
13352 REENTRANT_PROTO*) ;;
13353 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
13354 esac
13355 echo "Prototype: $try" ;;
13356 esac
13357 ;;
13358 *) case "$usethreads" in
13359 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
13360 esac
13361 d_getlogin_r=undef
13362 getlogin_r_proto=0
13363 ;;
13364 esac
13365 ;;
13366*) getlogin_r_proto=0
13367 ;;
13368esac
13369
13370: see if getmnt exists
13371set getmnt d_getmnt
13372eval $inlibc
13373
13374: see if getmntent exists
13375set getmntent d_getmntent
13376eval $inlibc
13377
13378: see if getnetbyaddr exists
13379set getnetbyaddr d_getnbyaddr
13380eval $inlibc
13381
13382: see if getnetbyname exists
13383set getnetbyname d_getnbyname
13384eval $inlibc
13385
13386: see if getnetent exists
13387set getnetent d_getnent
13388eval $inlibc
13389
13390: see if getnetbyaddr_r exists
13391set getnetbyaddr_r d_getnetbyaddr_r
13392eval $inlibc
13393case "$d_getnetbyaddr_r" in
13394"$define")
13395 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13396 case "$d_getnetbyaddr_r_proto:$usethreads" in
13397 ":define") d_getnetbyaddr_r_proto=define
13398 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
13399 eval $hasproto ;;
13400 *) ;;
13401 esac
13402 case "$d_getnetbyaddr_r_proto" in
13403 define)
13404 case "$getnetbyaddr_r_proto" in
13405 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
13406 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
13407 esac
13408 case "$getnetbyaddr_r_proto" in
13409 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
13410 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
13411 esac
13412 case "$getnetbyaddr_r_proto" in
13413 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
13414 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
13415 esac
13416 case "$getnetbyaddr_r_proto" in
13417 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
13418 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
13419 esac
13420 case "$getnetbyaddr_r_proto" in
13421 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
13422 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
13423 esac
13424 case "$getnetbyaddr_r_proto" in
13425 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
13426 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
13427 esac
13428 case "$getnetbyaddr_r_proto" in
13429 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
13430 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
13431 esac
13432 case "$getnetbyaddr_r_proto" in
13433 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
13434 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
13435 esac
13436 case "$getnetbyaddr_r_proto" in
13437 ''|0) d_getnetbyaddr_r=undef
13438 getnetbyaddr_r_proto=0
13439 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
13440 * ) case "$getnetbyaddr_r_proto" in
13441 REENTRANT_PROTO*) ;;
13442 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
13443 esac
13444 echo "Prototype: $try" ;;
13445 esac
13446 ;;
13447 *) case "$usethreads" in
13448 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
13449 esac
13450 d_getnetbyaddr_r=undef
13451 getnetbyaddr_r_proto=0
13452 ;;
13453 esac
13454 ;;
13455*) getnetbyaddr_r_proto=0
13456 ;;
13457esac
13458
13459: see if getnetbyname_r exists
13460set getnetbyname_r d_getnetbyname_r
13461eval $inlibc
13462case "$d_getnetbyname_r" in
13463"$define")
13464 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13465 case "$d_getnetbyname_r_proto:$usethreads" in
13466 ":define") d_getnetbyname_r_proto=define
13467 set d_getnetbyname_r_proto getnetbyname_r $hdrs
13468 eval $hasproto ;;
13469 *) ;;
13470 esac
13471 case "$d_getnetbyname_r_proto" in
13472 define)
13473 case "$getnetbyname_r_proto" in
13474 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13475 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13476 esac
13477 case "$getnetbyname_r_proto" in
13478 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13479 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13480 esac
13481 case "$getnetbyname_r_proto" in
13482 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13483 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13484 esac
13485 case "$getnetbyname_r_proto" in
13486 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13487 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13488 esac
13489 case "$getnetbyname_r_proto" in
13490 ''|0) d_getnetbyname_r=undef
13491 getnetbyname_r_proto=0
13492 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13493 * ) case "$getnetbyname_r_proto" in
13494 REENTRANT_PROTO*) ;;
13495 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13496 esac
13497 echo "Prototype: $try" ;;
13498 esac
13499 ;;
13500 *) case "$usethreads" in
13501 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13502 esac
13503 d_getnetbyname_r=undef
13504 getnetbyname_r_proto=0
13505 ;;
13506 esac
13507 ;;
13508*) getnetbyname_r_proto=0
13509 ;;
13510esac
13511
13512: see if getnetent_r exists
13513set getnetent_r d_getnetent_r
13514eval $inlibc
13515case "$d_getnetent_r" in
13516"$define")
13517 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13518 case "$d_getnetent_r_proto:$usethreads" in
13519 ":define") d_getnetent_r_proto=define
13520 set d_getnetent_r_proto getnetent_r $hdrs
13521 eval $hasproto ;;
13522 *) ;;
13523 esac
13524 case "$d_getnetent_r_proto" in
13525 define)
13526 case "$getnetent_r_proto" in
13527 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13528 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13529 esac
13530 case "$getnetent_r_proto" in
13531 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13532 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13533 esac
13534 case "$getnetent_r_proto" in
13535 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13536 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13537 esac
13538 case "$getnetent_r_proto" in
13539 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13540 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13541 esac
13542 case "$getnetent_r_proto" in
13543 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13544 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13545 esac
13546 case "$getnetent_r_proto" in
13547 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13548 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13549 esac
13550 case "$getnetent_r_proto" in
13551 ''|0) d_getnetent_r=undef
13552 getnetent_r_proto=0
13553 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13554 * ) case "$getnetent_r_proto" in
13555 REENTRANT_PROTO*) ;;
13556 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13557 esac
13558 echo "Prototype: $try" ;;
13559 esac
13560 ;;
13561 *) case "$usethreads" in
13562 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13563 esac
13564 d_getnetent_r=undef
13565 getnetent_r_proto=0
13566 ;;
13567 esac
13568 ;;
13569*) getnetent_r_proto=0
13570 ;;
13571esac
13572
13573: see if prototypes for various getnetxxx netdb.h functions are available
13574echo " "
13575set d_getnetprotos getnetent $i_netdb netdb.h
13576eval $hasproto
13577
13578: see if getpagesize exists
13579set getpagesize d_getpagsz
13580eval $inlibc
13581
13582
13583: see if getprotobyname exists
13584set getprotobyname d_getpbyname
13585eval $inlibc
13586
13587: see if getprotobynumber exists
13588set getprotobynumber d_getpbynumber
13589eval $inlibc
13590
13591: see if getprotoent exists
13592set getprotoent d_getpent
13593eval $inlibc
13594
13595: see if getpgid exists
13596set getpgid d_getpgid
13597eval $inlibc
13598
13599: see if getpgrp2 exists
13600set getpgrp2 d_getpgrp2
13601eval $inlibc
13602
13603: see if getppid exists
13604set getppid d_getppid
13605eval $inlibc
13606
13607: see if getpriority exists
13608set getpriority d_getprior
13609eval $inlibc
13610
13611: see if getprotobyname_r exists
13612set getprotobyname_r d_getprotobyname_r
13613eval $inlibc
13614case "$d_getprotobyname_r" in
13615"$define")
13616 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13617 case "$d_getprotobyname_r_proto:$usethreads" in
13618 ":define") d_getprotobyname_r_proto=define
13619 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13620 eval $hasproto ;;
13621 *) ;;
13622 esac
13623 case "$d_getprotobyname_r_proto" in
13624 define)
13625 case "$getprotobyname_r_proto" in
13626 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13627 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13628 esac
13629 case "$getprotobyname_r_proto" in
13630 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13631 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13632 esac
13633 case "$getprotobyname_r_proto" in
13634 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13635 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13636 esac
13637 case "$getprotobyname_r_proto" in
13638 ''|0) d_getprotobyname_r=undef
13639 getprotobyname_r_proto=0
13640 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13641 * ) case "$getprotobyname_r_proto" in
13642 REENTRANT_PROTO*) ;;
13643 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13644 esac
13645 echo "Prototype: $try" ;;
13646 esac
13647 ;;
13648 *) case "$usethreads" in
13649 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13650 esac
13651 d_getprotobyname_r=undef
13652 getprotobyname_r_proto=0
13653 ;;
13654 esac
13655 ;;
13656*) getprotobyname_r_proto=0
13657 ;;
13658esac
13659
13660: see if getprotobynumber_r exists
13661set getprotobynumber_r d_getprotobynumber_r
13662eval $inlibc
13663case "$d_getprotobynumber_r" in
13664"$define")
13665 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13666 case "$d_getprotobynumber_r_proto:$usethreads" in
13667 ":define") d_getprotobynumber_r_proto=define
13668 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13669 eval $hasproto ;;
13670 *) ;;
13671 esac
13672 case "$d_getprotobynumber_r_proto" in
13673 define)
13674 case "$getprotobynumber_r_proto" in
13675 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13676 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13677 esac
13678 case "$getprotobynumber_r_proto" in
13679 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13680 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13681 esac
13682 case "$getprotobynumber_r_proto" in
13683 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13684 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13685 esac
13686 case "$getprotobynumber_r_proto" in
13687 ''|0) d_getprotobynumber_r=undef
13688 getprotobynumber_r_proto=0
13689 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13690 * ) case "$getprotobynumber_r_proto" in
13691 REENTRANT_PROTO*) ;;
13692 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13693 esac
13694 echo "Prototype: $try" ;;
13695 esac
13696 ;;
13697 *) case "$usethreads" in
13698 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13699 esac
13700 d_getprotobynumber_r=undef
13701 getprotobynumber_r_proto=0
13702 ;;
13703 esac
13704 ;;
13705*) getprotobynumber_r_proto=0
13706 ;;
13707esac
13708
13709: see if getprotoent_r exists
13710set getprotoent_r d_getprotoent_r
13711eval $inlibc
13712case "$d_getprotoent_r" in
13713"$define")
13714 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13715 case "$d_getprotoent_r_proto:$usethreads" in
13716 ":define") d_getprotoent_r_proto=define
13717 set d_getprotoent_r_proto getprotoent_r $hdrs
13718 eval $hasproto ;;
13719 *) ;;
13720 esac
13721 case "$d_getprotoent_r_proto" in
13722 define)
13723 case "$getprotoent_r_proto" in
13724 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13725 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13726 esac
13727 case "$getprotoent_r_proto" in
13728 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13729 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13730 esac
13731 case "$getprotoent_r_proto" in
13732 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13733 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13734 esac
13735 case "$getprotoent_r_proto" in
13736 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13737 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13738 esac
13739 case "$getprotoent_r_proto" in
13740 ''|0) d_getprotoent_r=undef
13741 getprotoent_r_proto=0
13742 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13743 * ) case "$getprotoent_r_proto" in
13744 REENTRANT_PROTO*) ;;
13745 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13746 esac
13747 echo "Prototype: $try" ;;
13748 esac
13749 ;;
13750 *) case "$usethreads" in
13751 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13752 esac
13753 d_getprotoent_r=undef
13754 getprotoent_r_proto=0
13755 ;;
13756 esac
13757 ;;
13758*) getprotoent_r_proto=0
13759 ;;
13760esac
13761
13762: see if prototypes for various getprotoxxx netdb.h functions are available
13763echo " "
13764set d_getprotoprotos getprotoent $i_netdb netdb.h
13765eval $hasproto
13766
13767: see if getprpwnam exists
13768set getprpwnam d_getprpwnam
13769eval $inlibc
13770
13771: see if getpwent exists
13772set getpwent d_getpwent
13773eval $inlibc
13774
13775: see if getpwent_r exists
13776set getpwent_r d_getpwent_r
13777eval $inlibc
13778case "$d_getpwent_r" in
13779"$define")
13780 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13781 case "$d_getpwent_r_proto:$usethreads" in
13782 ":define") d_getpwent_r_proto=define
13783 set d_getpwent_r_proto getpwent_r $hdrs
13784 eval $hasproto ;;
13785 *) ;;
13786 esac
13787 case "$d_getpwent_r_proto" in
13788 define)
13789 case "$getpwent_r_proto" in
13790 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13791 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13792 esac
13793 case "$getpwent_r_proto" in
13794 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13795 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13796 esac
13797 case "$getpwent_r_proto" in
13798 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13799 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13800 esac
13801 case "$getpwent_r_proto" in
13802 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13803 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13804 esac
13805 case "$getpwent_r_proto" in
13806 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13807 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13808 esac
13809 case "$getpwent_r_proto" in
13810 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13811 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13812 esac
13813 case "$getpwent_r_proto" in
13814 ''|0) d_getpwent_r=undef
13815 getpwent_r_proto=0
13816 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13817 * ) case "$getpwent_r_proto" in
13818 REENTRANT_PROTO*) ;;
13819 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13820 esac
13821 echo "Prototype: $try" ;;
13822 esac
13823 ;;
13824 *) case "$usethreads" in
13825 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13826 esac
13827 d_getpwent_r=undef
13828 getpwent_r_proto=0
13829 ;;
13830 esac
13831 ;;
13832*) getpwent_r_proto=0
13833 ;;
13834esac
13835
13836: see if getpwnam_r exists
13837set getpwnam_r d_getpwnam_r
13838eval $inlibc
13839case "$d_getpwnam_r" in
13840"$define")
13841 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13842 case "$d_getpwnam_r_proto:$usethreads" in
13843 ":define") d_getpwnam_r_proto=define
13844 set d_getpwnam_r_proto getpwnam_r $hdrs
13845 eval $hasproto ;;
13846 *) ;;
13847 esac
13848 case "$d_getpwnam_r_proto" in
13849 define)
13850 case "$getpwnam_r_proto" in
13851 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13852 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13853 esac
13854 case "$getpwnam_r_proto" in
13855 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13856 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13857 esac
13858 case "$getpwnam_r_proto" in
13859 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13860 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13861 esac
13862 case "$getpwnam_r_proto" in
13863 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13864 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13865 esac
13866 case "$getpwnam_r_proto" in
13867 ''|0) d_getpwnam_r=undef
13868 getpwnam_r_proto=0
13869 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13870 * ) case "$getpwnam_r_proto" in
13871 REENTRANT_PROTO*) ;;
13872 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13873 esac
13874 echo "Prototype: $try" ;;
13875 esac
13876 ;;
13877 *) case "$usethreads" in
13878 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13879 esac
13880 d_getpwnam_r=undef
13881 getpwnam_r_proto=0
13882 ;;
13883 esac
13884 ;;
13885*) getpwnam_r_proto=0
13886 ;;
13887esac
13888
13889: see if getpwuid_r exists
13890set getpwuid_r d_getpwuid_r
13891eval $inlibc
13892case "$d_getpwuid_r" in
13893"$define")
13894 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13895 case "$d_getpwuid_r_proto:$usethreads" in
13896 ":define") d_getpwuid_r_proto=define
13897 set d_getpwuid_r_proto getpwuid_r $hdrs
13898 eval $hasproto ;;
13899 *) ;;
13900 esac
13901 case "$d_getpwuid_r_proto" in
13902 define)
13903 case "$getpwuid_r_proto" in
13904 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13905 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13906 esac
13907 case "$getpwuid_r_proto" in
13908 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13909 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13910 esac
13911 case "$getpwuid_r_proto" in
13912 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13913 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13914 esac
13915 case "$getpwuid_r_proto" in
13916 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13917 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13918 esac
13919 case "$getpwuid_r_proto" in
13920 ''|0) d_getpwuid_r=undef
13921 getpwuid_r_proto=0
13922 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13923 * ) case "$getpwuid_r_proto" in
13924 REENTRANT_PROTO*) ;;
13925 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13926 esac
13927 echo "Prototype: $try" ;;
13928 esac
13929 ;;
13930 *) case "$usethreads" in
13931 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13932 esac
13933 d_getpwuid_r=undef
13934 getpwuid_r_proto=0
13935 ;;
13936 esac
13937 ;;
13938*) getpwuid_r_proto=0
13939 ;;
13940esac
13941
13942
13943: see if getservbyname exists
13944set getservbyname d_getsbyname
13945eval $inlibc
13946
13947: see if getservbyport exists
13948set getservbyport d_getsbyport
13949eval $inlibc
13950
13951: see if getservent exists
13952set getservent d_getsent
13953eval $inlibc
13954
13955: see if getservbyname_r exists
13956set getservbyname_r d_getservbyname_r
13957eval $inlibc
13958case "$d_getservbyname_r" in
13959"$define")
13960 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13961 case "$d_getservbyname_r_proto:$usethreads" in
13962 ":define") d_getservbyname_r_proto=define
13963 set d_getservbyname_r_proto getservbyname_r $hdrs
13964 eval $hasproto ;;
13965 *) ;;
13966 esac
13967 case "$d_getservbyname_r_proto" in
13968 define)
13969 case "$getservbyname_r_proto" in
13970 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13971 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13972 esac
13973 case "$getservbyname_r_proto" in
13974 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13975 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13976 esac
13977 case "$getservbyname_r_proto" in
13978 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13979 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13980 esac
13981 case "$getservbyname_r_proto" in
13982 ''|0) d_getservbyname_r=undef
13983 getservbyname_r_proto=0
13984 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13985 * ) case "$getservbyname_r_proto" in
13986 REENTRANT_PROTO*) ;;
13987 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13988 esac
13989 echo "Prototype: $try" ;;
13990 esac
13991 ;;
13992 *) case "$usethreads" in
13993 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13994 esac
13995 d_getservbyname_r=undef
13996 getservbyname_r_proto=0
13997 ;;
13998 esac
13999 ;;
14000*) getservbyname_r_proto=0
14001 ;;
14002esac
14003
14004: see if getservbyport_r exists
14005set getservbyport_r d_getservbyport_r
14006eval $inlibc
14007case "$d_getservbyport_r" in
14008"$define")
14009 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14010 case "$d_getservbyport_r_proto:$usethreads" in
14011 ":define") d_getservbyport_r_proto=define
14012 set d_getservbyport_r_proto getservbyport_r $hdrs
14013 eval $hasproto ;;
14014 *) ;;
14015 esac
14016 case "$d_getservbyport_r_proto" in
14017 define)
14018 case "$getservbyport_r_proto" in
14019 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
14020 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
14021 esac
14022 case "$getservbyport_r_proto" in
14023 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
14024 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
14025 esac
14026 case "$getservbyport_r_proto" in
14027 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
14028 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
14029 esac
14030 case "$getservbyport_r_proto" in
14031 ''|0) d_getservbyport_r=undef
14032 getservbyport_r_proto=0
14033 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
14034 * ) case "$getservbyport_r_proto" in
14035 REENTRANT_PROTO*) ;;
14036 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
14037 esac
14038 echo "Prototype: $try" ;;
14039 esac
14040 ;;
14041 *) case "$usethreads" in
14042 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
14043 esac
14044 d_getservbyport_r=undef
14045 getservbyport_r_proto=0
14046 ;;
14047 esac
14048 ;;
14049*) getservbyport_r_proto=0
14050 ;;
14051esac
14052
14053: see if getservent_r exists
14054set getservent_r d_getservent_r
14055eval $inlibc
14056case "$d_getservent_r" in
14057"$define")
14058 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14059 case "$d_getservent_r_proto:$usethreads" in
14060 ":define") d_getservent_r_proto=define
14061 set d_getservent_r_proto getservent_r $hdrs
14062 eval $hasproto ;;
14063 *) ;;
14064 esac
14065 case "$d_getservent_r_proto" in
14066 define)
14067 case "$getservent_r_proto" in
14068 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
14069 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
14070 esac
14071 case "$getservent_r_proto" in
14072 ''|0) try='int getservent_r(struct servent*, char*, int);'
14073 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
14074 esac
14075 case "$getservent_r_proto" in
14076 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
14077 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
14078 esac
14079 case "$getservent_r_proto" in
14080 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
14081 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
14082 esac
14083 case "$getservent_r_proto" in
14084 ''|0) d_getservent_r=undef
14085 getservent_r_proto=0
14086 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
14087 * ) case "$getservent_r_proto" in
14088 REENTRANT_PROTO*) ;;
14089 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
14090 esac
14091 echo "Prototype: $try" ;;
14092 esac
14093 ;;
14094 *) case "$usethreads" in
14095 define) echo "getservent_r has no prototype, not using it." >&4 ;;
14096 esac
14097 d_getservent_r=undef
14098 getservent_r_proto=0
14099 ;;
14100 esac
14101 ;;
14102*) getservent_r_proto=0
14103 ;;
14104esac
14105
14106: see if prototypes for various getservxxx netdb.h functions are available
14107echo " "
14108set d_getservprotos getservent $i_netdb netdb.h
14109eval $hasproto
14110
14111: see if getspnam exists
14112set getspnam d_getspnam
14113eval $inlibc
14114
14115: see if this is a shadow.h system
14116set shadow.h i_shadow
14117eval $inhdr
14118
14119: see if getspnam_r exists
14120set getspnam_r d_getspnam_r
14121eval $inlibc
14122case "$d_getspnam_r" in
14123"$define")
14124 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
14125 case "$d_getspnam_r_proto:$usethreads" in
14126 ":define") d_getspnam_r_proto=define
14127 set d_getspnam_r_proto getspnam_r $hdrs
14128 eval $hasproto ;;
14129 *) ;;
14130 esac
14131 case "$d_getspnam_r_proto" in
14132 define)
14133 case "$getspnam_r_proto" in
14134 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
14135 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
14136 esac
14137 case "$getspnam_r_proto" in
14138 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
14139 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
14140 esac
14141 case "$getspnam_r_proto" in
14142 ''|0) d_getspnam_r=undef
14143 getspnam_r_proto=0
14144 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
14145 * ) case "$getspnam_r_proto" in
14146 REENTRANT_PROTO*) ;;
14147 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
14148 esac
14149 echo "Prototype: $try" ;;
14150 esac
14151 ;;
14152 *) case "$usethreads" in
14153 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
14154 esac
14155 d_getspnam_r=undef
14156 getspnam_r_proto=0
14157 ;;
14158 esac
14159 ;;
14160*) getspnam_r_proto=0
14161 ;;
14162esac
14163
14164: see if gettimeofday or ftime exists
14165set gettimeofday d_gettimeod
14166eval $inlibc
14167case "$d_gettimeod" in
14168"$undef")
14169 set ftime d_ftime
14170 eval $inlibc
14171 ;;
14172*)
14173 val="$undef"; set d_ftime; eval $setvar
14174 ;;
14175esac
14176case "$d_gettimeod$d_ftime" in
14177"$undef$undef")
14178 echo " "
14179 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
14180 ;;
14181esac
14182
14183: see if gmtime_r exists
14184set gmtime_r d_gmtime_r
14185eval $inlibc
14186case "$d_gmtime_r" in
14187"$define")
14188 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14189 case "$d_gmtime_r_proto:$usethreads" in
14190 ":define") d_gmtime_r_proto=define
14191 set d_gmtime_r_proto gmtime_r $hdrs
14192 eval $hasproto ;;
14193 *) ;;
14194 esac
14195 case "$d_gmtime_r_proto" in
14196 define)
14197 case "$gmtime_r_proto" in
14198 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
14199 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
14200 esac
14201 case "$gmtime_r_proto" in
14202 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
14203 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
14204 esac
14205 case "$gmtime_r_proto" in
14206 ''|0) d_gmtime_r=undef
14207 gmtime_r_proto=0
14208 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
14209 * ) case "$gmtime_r_proto" in
14210 REENTRANT_PROTO*) ;;
14211 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
14212 esac
14213 echo "Prototype: $try" ;;
14214 esac
14215 ;;
14216 *) case "$usethreads" in
14217 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
14218 esac
14219 d_gmtime_r=undef
14220 gmtime_r_proto=0
14221 ;;
14222 esac
14223 ;;
14224*) gmtime_r_proto=0
14225 ;;
14226esac
14227
14228: see if hasmntopt exists
14229set hasmntopt d_hasmntopt
14230eval $inlibc
14231
14232: see if this is a netinet/in.h or sys/in.h system
14233set netinet/in.h i_niin sys/in.h i_sysin
14234eval $inhdr
14235
14236: see if arpa/inet.h has to be included
14237set arpa/inet.h i_arpainet
14238eval $inhdr
14239
14240: see if htonl --and friends-- exists
14241val=''
14242set htonl val
14243eval $inlibc
14244
14245: Maybe they are macros.
14246case "$val" in
14247$undef)
14248 $cat >htonl.c <<EOM
14249#include <stdio.h>
14250#include <sys/types.h>
14251#$i_niin I_NETINET_IN
14252#$i_sysin I_SYS_IN
14253#$i_arpainet I_ARPA_INET
14254#ifdef I_NETINET_IN
14255#include <netinet/in.h>
14256#endif
14257#ifdef I_SYS_IN
14258#include <sys/in.h>
14259#endif
14260#ifdef I_ARPA_INET
14261#include <arpa/inet.h>
14262#endif
14263#ifdef htonl
14264printf("Defined as a macro.");
14265#endif
14266EOM
14267 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
14268 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
14269 val="$define"
14270 echo "But it seems to be defined as a macro." >&4
14271 fi
14272 $rm -f htonl.?
14273 ;;
14274esac
14275set d_htonl
14276eval $setvar
14277
14278: see if ilogbl exists
14279set ilogbl d_ilogbl
14280eval $inlibc
14281
14282: index or strchr
14283echo " "
14284if set index val -f; eval $csym; $val; then
14285 if set strchr val -f d_strchr; eval $csym; $val; then
14286 if $contains strchr "$strings" >/dev/null 2>&1 ; then
14287 val="$define"
14288 vali="$undef"
14289 echo "strchr() found." >&4
14290 else
14291 val="$undef"
14292 vali="$define"
14293 echo "index() found." >&4
14294 fi
14295 else
14296 val="$undef"
14297 vali="$define"
14298 echo "index() found." >&4
14299 fi
14300else
14301 if set strchr val -f d_strchr; eval $csym; $val; then
14302 val="$define"
14303 vali="$undef"
14304 echo "strchr() found." >&4
14305 else
14306 echo "No index() or strchr() found!" >&4
14307 val="$undef"
14308 vali="$undef"
14309 fi
14310fi
14311set d_strchr; eval $setvar
14312val="$vali"
14313set d_index; eval $setvar
14314
14315: check whether inet_aton exists
14316set inet_aton d_inetaton
14317eval $inlibc
14318
14319: Look for isascii
14320echo " "
14321$cat >isascii.c <<EOCP
14322#include <stdio.h>
14323#include <ctype.h>
14324#$i_stdlib I_STDLIB
14325#ifdef I_STDLIB
14326#include <stdlib.h>
14327#endif
14328int main() {
14329 int c = 'A';
14330 if (isascii(c))
14331 exit(0);
14332 else
14333 exit(1);
14334}
14335EOCP
14336set isascii
14337if eval $compile; then
14338 echo "isascii() found." >&4
14339 val="$define"
14340else
14341 echo "isascii() NOT found." >&4
14342 val="$undef"
14343fi
14344set d_isascii
14345eval $setvar
14346$rm -f isascii*
14347
14348: see if isfinite exists
14349set isfinite d_isfinite
14350eval $inlibc
14351
14352: see if isinf exists
14353set isinf d_isinf
14354eval $inlibc
14355
14356: see if isnan exists
14357set isnan d_isnan
14358eval $inlibc
14359
14360: see if isnanl exists
14361set isnanl d_isnanl
14362eval $inlibc
14363
14364: see if killpg exists
14365set killpg d_killpg
14366eval $inlibc
14367
14368: see if lchown exists
14369echo " "
14370$cat > try.c <<'EOCP'
14371/* System header to define __stub macros and hopefully few prototypes,
14372 which can conflict with char lchown(); below. */
14373#include <assert.h>
14374/* Override any gcc2 internal prototype to avoid an error. */
14375/* We use char because int might match the return type of a gcc2
14376 builtin and then its argument prototype would still apply. */
14377char lchown();
14378int main() {
14379 /* The GNU C library defines this for functions which it implements
14380 to always fail with ENOSYS. Some functions are actually named
14381 something starting with __ and the normal name is an alias. */
14382#if defined (__stub_lchown) || defined (__stub___lchown)
14383choke me
14384#else
14385lchown();
14386#endif
14387; return 0; }
14388EOCP
14389set try
14390if eval $compile; then
14391 $echo "lchown() found." >&4
14392 val="$define"
14393else
14394 $echo "lchown() NOT found." >&4
14395 val="$undef"
14396fi
14397set d_lchown
14398eval $setvar
14399
14400: See if number of significant digits in a double precision number is known
14401echo " "
14402$cat >ldbl_dig.c <<EOM
14403#$i_limits I_LIMITS
14404#$i_float I_FLOAT
14405#ifdef I_LIMITS
14406#include <limits.h>
14407#endif
14408#ifdef I_FLOAT
14409#include <float.h>
14410#endif
14411#ifdef LDBL_DIG
14412printf("Contains LDBL_DIG");
14413#endif
14414EOM
14415$cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
14416if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
14417 echo "LDBL_DIG found." >&4
14418 val="$define"
14419else
14420 echo "LDBL_DIG NOT found." >&4
14421 val="$undef"
14422fi
14423$rm -f ldbl_dig.?
14424set d_ldbl_dig
14425eval $setvar
14426
14427: see if this is a math.h system
14428set math.h i_math
14429eval $inhdr
14430
14431d_libm_lib_version="$undef"
14432case $i_math in
14433 $define)
14434 : check to see if math.h defines _LIB_VERSION
14435 echo " "
14436 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
14437 $cat >try.c <<EOCP
14438#include <unistd.h>
14439#include <math.h>
14440int main (int argc, char *argv[])
14441{
14442 printf ("%d\n", _LIB_VERSION);
14443 return (0);
14444 } /* main */
14445EOCP
14446 set try
14447 if eval $compile; then
14448 foo=`$run ./try`
14449 echo "Yes, it does ($foo)" >&4
14450 d_libm_lib_version="$define"
14451 else
14452 echo "No, it does not (probably harmless)\n" >&4
14453 fi
14454 $rm -f try.* try core core.try.*
14455 ;;
14456
14457 esac
14458
14459: see if link exists
14460set link d_link
14461eval $inlibc
14462
14463: see if localtime_r exists
14464set localtime_r d_localtime_r
14465eval $inlibc
14466case "$d_localtime_r" in
14467"$define")
14468 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
14469 case "$d_localtime_r_proto:$usethreads" in
14470 ":define") d_localtime_r_proto=define
14471 set d_localtime_r_proto localtime_r $hdrs
14472 eval $hasproto ;;
14473 *) ;;
14474 esac
14475 case "$d_localtime_r_proto" in
14476 define)
14477 case "$localtime_r_proto" in
14478 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14479 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14480 esac
14481 case "$localtime_r_proto" in
14482 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14483 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14484 esac
14485 case "$localtime_r_proto" in
14486 ''|0) d_localtime_r=undef
14487 localtime_r_proto=0
14488 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14489 * ) case "$localtime_r_proto" in
14490 REENTRANT_PROTO*) ;;
14491 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14492 esac
14493 echo "Prototype: $try" ;;
14494 esac
14495 ;;
14496 *) case "$usethreads" in
14497 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14498 esac
14499 d_localtime_r=undef
14500 localtime_r_proto=0
14501 ;;
14502 esac
14503 ;;
14504*) localtime_r_proto=0
14505 ;;
14506esac
14507
14508: see if localeconv exists
14509set localeconv d_locconv
14510eval $inlibc
14511
14512: see if lockf exists
14513set lockf d_lockf
14514eval $inlibc
14515
14516: see if prototype for lseek is available
14517echo " "
14518set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14519eval $hasproto
14520
14521: see if lstat exists
14522set lstat d_lstat
14523eval $inlibc
14524
14525: see if madvise exists
14526set madvise d_madvise
14527eval $inlibc
14528
14529: see if malloc_size exists
14530set malloc_size d_malloc_size
14531eval $inlibc
14532
14533: see if malloc_size_good exists
14534set malloc_good_size d_malloc_good_size
14535eval $inlibc
14536
14537: see if mblen exists
14538set mblen d_mblen
14539eval $inlibc
14540
14541: see if mbstowcs exists
14542set mbstowcs d_mbstowcs
14543eval $inlibc
14544
14545: see if mbtowc exists
14546set mbtowc d_mbtowc
14547eval $inlibc
14548
14549: see if memchr exists
14550set memchr d_memchr
14551eval $inlibc
14552
14553: see if memcmp exists
14554set memcmp d_memcmp
14555eval $inlibc
14556
14557: see if memcpy exists
14558set memcpy d_memcpy
14559eval $inlibc
14560
14561: see if memmove exists
14562set memmove d_memmove
14563eval $inlibc
14564
14565: see if memset exists
14566set memset d_memset
14567eval $inlibc
14568
14569: see if mkdir exists
14570set mkdir d_mkdir
14571eval $inlibc
14572
14573: see if mkdtemp exists
14574set mkdtemp d_mkdtemp
14575eval $inlibc
14576
14577: see if mkfifo exists
14578set mkfifo d_mkfifo
14579eval $inlibc
14580
14581: see if mkstemp exists
14582set mkstemp d_mkstemp
14583eval $inlibc
14584
14585: see if mkstemps exists
14586set mkstemps d_mkstemps
14587eval $inlibc
14588
14589: see if mktime exists
14590set mktime d_mktime
14591eval $inlibc
14592
14593: see if this is a sys/mman.h system
14594set sys/mman.h i_sysmman
14595eval $inhdr
14596
14597: see if mmap exists
14598set mmap d_mmap
14599eval $inlibc
14600: see what shmat returns
14601: default to something harmless
14602mmaptype='void *'
14603case "$i_sysmman$d_mmap" in
14604"$define$define")
14605 $cat >mmap.c <<'END'
14606#include <sys/mman.h>
14607void *mmap();
14608END
14609 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14610 mmaptype='void *'
14611 else
14612 mmaptype='caddr_t'
14613 fi
14614 echo "and it returns ($mmaptype)." >&4
14615 ;;
14616esac
14617
14618
14619
14620: see if sqrtl exists
14621set sqrtl d_sqrtl
14622eval $inlibc
14623
14624: see if scalbnl exists
14625set scalbnl d_scalbnl
14626eval $inlibc
14627
14628: see if modfl exists
14629set modfl d_modfl
14630eval $inlibc
14631
14632: see if prototype for modfl is available
14633echo " "
14634set d_modflproto modfl $i_math math.h
14635eval $hasproto
14636
14637d_modfl_pow32_bug="$undef"
14638
14639case "$d_longdbl$d_modfl" in
14640$define$define)
14641 $cat <<EOM
14642Checking to see whether your modfl() is okay for large values...
14643EOM
14644$cat >try.c <<EOCP
14645#include <math.h>
14646#include <stdio.h>
14647EOCP
14648if $test "X$d_modflproto" != "X$define"; then
14649 $cat >>try.c <<EOCP
14650/* Sigh. many current glibcs provide the function, but do not prototype it. */
14651long double modfl (long double, long double *);
14652EOCP
14653fi
14654$cat >>try.c <<EOCP
14655int main() {
14656 long double nv = 4294967303.15;
14657 long double v, w;
14658 v = modfl(nv, &w);
14659#ifdef __GLIBC__
14660 printf("glibc");
14661#endif
14662 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14663 return 0;
14664}
14665EOCP
14666 case "$osname:$gccversion" in
14667 aix:) saveccflags="$ccflags"
14668 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14669 esac
14670 set try
14671 if eval $compile; then
14672 foo=`$run ./try`
14673 case "$foo" in
14674 *" 4294967303.150000 1.150000 4294967302.000000")
14675 echo >&4 "Your modfl() is broken for large values."
14676 d_modfl_pow32_bug="$define"
14677 case "$foo" in
14678 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14679 ;;
14680 esac
14681 ;;
14682 *" 4294967303.150000 0.150000 4294967303.000000")
14683 echo >&4 "Your modfl() seems okay for large values."
14684 ;;
14685 *) echo >&4 "I don't understand your modfl() at all."
14686 d_modfl="$undef"
14687 ;;
14688 esac
14689 $rm -f try.* try core core.try.*
14690 else
14691 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14692 d_modfl="$undef"
14693 fi
14694 case "$osname:$gccversion" in
14695 aix:) ccflags="$saveccflags" ;; # restore
14696 esac
14697 ;;
14698esac
14699
14700if $test "$uselongdouble" = "$define"; then
14701 message=""
14702 if $test "$d_sqrtl" != "$define"; then
14703 message="$message sqrtl"
14704 fi
14705 if $test "$d_modfl" != "$define"; then
14706 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14707 echo "You have both aintl and copysignl, so I can emulate modfl."
14708 else
14709 message="$message modfl"
14710 fi
14711 fi
14712 if $test "$d_frexpl" != "$define"; then
14713 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14714 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14715 else
14716 message="$message frexpl"
14717 fi
14718 fi
14719
14720 if $test "$message" != ""; then
14721 $cat <<EOM >&4
14722
14723*** You requested the use of long doubles but you do not seem to have
14724*** the following mathematical functions needed for long double support:
14725*** $message
14726*** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14727*** Cannot continue, aborting.
14728
14729EOM
14730
14731 exit 1
14732 fi
14733fi
14734
14735: see if mprotect exists
14736set mprotect d_mprotect
14737eval $inlibc
14738
14739: see if msgctl exists
14740set msgctl d_msgctl
14741eval $inlibc
14742
14743: see if msgget exists
14744set msgget d_msgget
14745eval $inlibc
14746
14747: see if msgsnd exists
14748set msgsnd d_msgsnd
14749eval $inlibc
14750
14751: see if msgrcv exists
14752set msgrcv d_msgrcv
14753eval $inlibc
14754
14755: see how much of the 'msg*(2)' library is present.
14756h_msg=true
14757echo " "
14758case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14759*"$undef"*) h_msg=false;;
14760esac
14761case "$osname" in
14762freebsd)
14763 case "`ipcs 2>&1`" in
14764 "SVID messages"*"not configured"*)
14765 echo "Your $osname does not have the msg*(2) configured." >&4
14766 h_msg=false
14767 val="$undef"
14768 set msgctl d_msgctl
14769 eval $setvar
14770 set msgget d_msgget
14771 eval $setvar
14772 set msgsnd d_msgsnd
14773 eval $setvar
14774 set msgrcv d_msgrcv
14775 eval $setvar
14776 ;;
14777 esac
14778 ;;
14779esac
14780: we could also check for sys/ipc.h ...
14781if $h_msg && $test `./findhdr sys/msg.h`; then
14782 echo "You have the full msg*(2) library." >&4
14783 val="$define"
14784else
14785 echo "You don't have the full msg*(2) library." >&4
14786 val="$undef"
14787fi
14788set d_msg
14789eval $setvar
14790
14791
14792echo " "
14793echo "Checking to see if your system supports struct msghdr..." >&4
14794set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14795eval $hasstruct
14796case "$d_msghdr_s" in
14797"$define") echo "Yes, it does." ;;
14798*) echo "No, it doesn't." ;;
14799esac
14800
14801
14802: see if msync exists
14803set msync d_msync
14804eval $inlibc
14805
14806: see if munmap exists
14807set munmap d_munmap
14808eval $inlibc
14809
14810: see if nice exists
14811set nice d_nice
14812eval $inlibc
14813
14814: see if this is a langinfo.h system
14815set langinfo.h i_langinfo
14816eval $inhdr
14817
14818: see if nl_langinfo exists
14819set nl_langinfo d_nl_langinfo
14820eval $inlibc
14821
14822: check for length of character
14823echo " "
14824case "$charsize" in
14825'')
14826 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14827 $cat >try.c <<EOCP
14828#include <stdio.h>
14829#$i_stdlib I_STDLIB
14830#ifdef I_STDLIB
14831#include <stdlib.h>
14832#endif
14833int main()
14834{
14835 printf("%d\n", (int)sizeof(char));
14836 exit(0);
14837}
14838EOCP
14839 set try
14840 if eval $compile_ok; then
14841 dflt=`$run ./try`
14842 else
14843 dflt='1'
14844 echo "(I can't seem to compile the test program. Guessing...)"
14845 fi
14846 ;;
14847*)
14848 dflt="$charsize"
14849 ;;
14850esac
14851rp="What is the size of a character (in bytes)?"
14852. ./myread
14853charsize="$ans"
14854$rm -f try.c try
14855
14856: check for volatile keyword
14857echo " "
14858echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14859$cat >try.c <<'EOCP'
14860int main()
14861{
14862 typedef struct _goo_struct goo_struct;
14863 goo_struct * volatile goo = ((goo_struct *)0);
14864 struct _goo_struct {
14865 long long_int;
14866 int reg_int;
14867 char char_var;
14868 };
14869 typedef unsigned short foo_t;
14870 char *volatile foo;
14871 volatile int bar;
14872 volatile foo_t blech;
14873 foo = foo;
14874}
14875EOCP
14876if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14877 val="$define"
14878 echo "Yup, it does."
14879else
14880 val="$undef"
14881 echo "Nope, it doesn't."
14882fi
14883set d_volatile
14884eval $setvar
14885$rm -f try.*
14886
14887
14888echo " "
14889$echo "Choosing the C types to be used for Perl's internal types..." >&4
14890
14891case "$use64bitint:$d_quad:$quadtype" in
14892define:define:?*)
14893 ivtype="$quadtype"
14894 uvtype="$uquadtype"
14895 ivsize=8
14896 uvsize=8
14897 ;;
14898*) ivtype="long"
14899 uvtype="unsigned long"
14900 ivsize=$longsize
14901 uvsize=$longsize
14902 ;;
14903esac
14904
14905case "$uselongdouble:$d_longdbl" in
14906define:define)
14907 nvtype="long double"
14908 nvsize=$longdblsize
14909 ;;
14910*) nvtype=double
14911 nvsize=$doublesize
14912 ;;
14913esac
14914
14915$echo "(IV will be "$ivtype", $ivsize bytes)"
14916$echo "(UV will be "$uvtype", $uvsize bytes)"
14917$echo "(NV will be "$nvtype", $nvsize bytes)"
14918
14919$cat >try.c <<EOCP
14920#$i_inttypes I_INTTYPES
14921#ifdef I_INTTYPES
14922#include <inttypes.h>
14923#endif
14924#include <stdio.h>
14925int main() {
14926#ifdef INT8
14927 int8_t i = INT8_MAX;
14928 uint8_t u = UINT8_MAX;
14929 printf("int8_t\n");
14930#endif
14931#ifdef INT16
14932 int16_t i = INT16_MAX;
14933 uint16_t i = UINT16_MAX;
14934 printf("int16_t\n");
14935#endif
14936#ifdef INT32
14937 int32_t i = INT32_MAX;
14938 uint32_t u = UINT32_MAX;
14939 printf("int32_t\n");
14940#endif
14941}
14942EOCP
14943
14944case "$i8type" in
14945'') case "$charsize" in
14946 1) i8type=char
14947 u8type="unsigned char"
14948 i8size=$charsize
14949 u8size=$charsize
14950 ;;
14951 esac
14952 ;;
14953esac
14954case "$i8type" in
14955'') set try -DINT8
14956 if eval $compile; then
14957 case "`$run ./try`" in
14958 int8_t) i8type=int8_t
14959 u8type=uint8_t
14960 i8size=1
14961 u8size=1
14962 ;;
14963 esac
14964 fi
14965 ;;
14966esac
14967case "$i8type" in
14968'') if $test $charsize -ge 1; then
14969 i8type=char
14970 u8type="unsigned char"
14971 i8size=$charsize
14972 u8size=$charsize
14973 fi
14974 ;;
14975esac
14976
14977case "$i16type" in
14978'') case "$shortsize" in
14979 2) i16type=short
14980 u16type="unsigned short"
14981 i16size=$shortsize
14982 u16size=$shortsize
14983 ;;
14984 esac
14985 ;;
14986esac
14987case "$i16type" in
14988'') set try -DINT16
14989 if eval $compile; then
14990 case "`$run ./try`" in
14991 int16_t)
14992 i16type=int16_t
14993 u16type=uint16_t
14994 i16size=2
14995 u16size=2
14996 ;;
14997 esac
14998 fi
14999 ;;
15000esac
15001case "$i16type" in
15002'') if $test $shortsize -ge 2; then
15003 i16type=short
15004 u16type="unsigned short"
15005 i16size=$shortsize
15006 u16size=$shortsize
15007 fi
15008 ;;
15009esac
15010
15011case "$i32type" in
15012'') case "$longsize" in
15013 4) i32type=long
15014 u32type="unsigned long"
15015 i32size=$longsize
15016 u32size=$longsize
15017 ;;
15018 *) case "$intsize" in
15019 4) i32type=int
15020 u32type="unsigned int"
15021 i32size=$intsize
15022 u32size=$intsize
15023 ;;
15024 esac
15025 ;;
15026 esac
15027 ;;
15028esac
15029case "$i32type" in
15030'') set try -DINT32
15031 if eval $compile; then
15032 case "`$run ./try`" in
15033 int32_t)
15034 i32type=int32_t
15035 u32type=uint32_t
15036 i32size=4
15037 u32size=4
15038 ;;
15039 esac
15040 fi
15041 ;;
15042esac
15043case "$i32type" in
15044'') if $test $intsize -ge 4; then
15045 i32type=int
15046 u32type="unsigned int"
15047 i32size=$intsize
15048 u32size=$intsize
15049 fi
15050 ;;
15051esac
15052
15053case "$i64type" in
15054'') case "$d_quad:$quadtype" in
15055 define:?*)
15056 i64type="$quadtype"
15057 u64type="$uquadtype"
15058 i64size=8
15059 u64size=8
15060 ;;
15061 esac
15062 ;;
15063esac
15064
15065$echo "Checking how many bits of your UVs your NVs can preserve..." >&4
15066: volatile so that the compiler has to store it out to memory.
15067if test X"$d_volatile" = X"$define"; then
15068 volatile=volatile
15069fi
15070$cat <<EOP >try.c
15071#include <stdio.h>
15072#$i_stdlib I_STDLIB
15073#ifdef I_STDLIB
15074#include <stdlib.h>
15075#endif
15076#include <sys/types.h>
15077#include <signal.h>
15078#ifdef SIGFPE
15079$volatile int bletched = 0;
15080$signal_t blech(int s) { bletched = 1; }
15081#endif
15082int main() {
15083 $uvtype u = 0;
15084 $nvtype d;
15085 int n = 8 * $uvsize;
15086 int i;
15087#ifdef SIGFPE
15088 signal(SIGFPE, blech);
15089#endif
15090
15091 for (i = 0; i < n; i++) {
15092 u = u << 1 | ($uvtype)1;
15093 d = ($nvtype)u;
15094 if (($uvtype)d != u)
15095 break;
15096 if (d <= 0)
15097 break;
15098 d = ($nvtype)(u - 1);
15099 if (($uvtype)d != (u - 1))
15100 break;
15101#ifdef SIGFPE
15102 if (bletched) {
15103 break;
15104#endif
15105 }
15106 }
15107 printf("%d\n", ((i == n) ? -n : i));
15108 exit(0);
15109}
15110EOP
15111set try
15112
15113d_nv_preserves_uv="$undef"
15114if eval $compile; then
15115 nv_preserves_uv_bits="`$run ./try`"
15116fi
15117case "$nv_preserves_uv_bits" in
15118\-[1-9]*)
15119 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
15120 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
15121 d_nv_preserves_uv="$define"
15122 ;;
15123[1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
15124 d_nv_preserves_uv="$undef" ;;
15125*) $echo "Can't figure out how many bits your NVs preserve." 2>&1
15126 nv_preserves_uv_bits="$undef" ;;
15127esac
15128
15129$rm -f try.* try
15130
15131$echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
15132: volatile so that the compiler has to store it out to memory.
15133if test X"$d_volatile" = X"$define"; then
15134 volatile=volatile
15135fi
15136$cat <<EOP >try.c
15137#include <stdio.h>
15138#$i_stdlib I_STDLIB
15139#ifdef I_STDLIB
15140#include <stdlib.h>
15141#endif
15142#$i_string I_STRING
15143#ifdef I_STRING
15144# include <string.h>
15145#else
15146# include <strings.h>
15147#endif
15148#include <sys/types.h>
15149#include <signal.h>
15150#ifdef SIGFPE
15151$volatile int bletched = 0;
15152$signal_t blech(int s) { bletched = 1; }
15153#endif
15154
15155int checkit($nvtype d, char *where) {
15156 unsigned char *p = (char *)&d;
15157 unsigned char *end = p + sizeof(d);
15158 int fail = 0;
15159
15160 while (p < end)
15161 fail += *p++;
15162
15163 if (!fail)
15164 return 0;
15165
15166 p = (char *)&d;
15167 printf("No - %s: 0x", where);
15168 while (p < end)
15169 printf ("%02X", *p++);
15170 printf("\n");
15171 return 1;
15172}
15173
15174int main(int argc, char **argv) {
15175 $nvtype d = 0.0;
15176 int fail = 0;
15177 fail += checkit(d, "0.0");
15178
15179 /* The compiler shouldn't be assuming that bletched is 0 */
15180 d = bletched;
15181
15182 fail += checkit(d, "bleched");
15183
15184#ifdef SIGFPE
15185 signal(SIGFPE, blech);
15186#endif
15187
15188 /* Paranoia - the compiler should have no way of knowing that ANSI says
15189 that argv[argc] will always be NULL. Actually, if it did assume this it
15190 would be buggy, as this is C and main() can be called from elsewhere in
15191 the program. */
15192 d = argv[argc] ? 1 : 0;
15193
15194 if (d) {
15195 printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
15196 }
15197
15198 fail += checkit(d, "ternary");
15199
15200 memset(&d, sizeof(d), argv[argc] ? 1 : 0);
15201
15202 if (d != 0.0) {
15203 printf("No - memset doesn't give 0.0\n");
15204 /* This might just blow up: */
15205 printf("(gives %g)\n", d);
15206 return 1;
15207 }
15208
15209#ifdef SIGFPE
15210 if (bletched) {
15211 printf("No - something bleched\n");
15212 return 1;
15213 }
15214#endif
15215 if (fail) {
15216 printf("No - %d fail(s)\n", fail);
15217 return 1;
15218 }
15219 printf("Yes\n");
15220 return 0;
15221}
15222EOP
15223set try
15224
15225d_nv_zero_is_allbits_zero="$undef"
15226if eval $compile; then
15227 xxx="`$run ./try`"
15228 case "$?" in
15229 0)
15230 case "$xxx" in
15231 Yes) cat >&4 <<EOM
152320.0 is represented as all bits zero in memory
15233EOM
15234 d_nv_zero_is_allbits_zero="$define"
15235 ;;
15236 *) cat >&4 <<EOM
152370.0 is not represented as all bits zero in memory
15238EOM
15239 d_nv_zero_is_allbits_zero="$undef"
15240 ;;
15241 esac
15242 ;;
15243 *) cat >&4 <<EOM
152440.0 is not represented as all bits zero in memory
15245EOM
15246 d_nv_zero_is_allbits_zero="$undef"
15247 ;;
15248 esac
15249fi
15250
15251$rm -f try.* try
15252
15253
15254: check for off64_t
15255echo " "
15256echo "Checking to see if you have off64_t..." >&4
15257$cat >try.c <<EOCP
15258#include <sys/types.h>
15259#include <unistd.h>
15260int main() { off64_t x = 7; }
15261EOCP
15262set try
15263if eval $compile; then
15264 val="$define"
15265 echo "You have off64_t."
15266else
15267 val="$undef"
15268 echo "You do not have off64_t."
15269 case "$lseeksize" in
15270 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
15271 esac
15272fi
15273$rm -f try.* try
15274set d_off64_t
15275eval $setvar
15276
15277: how to create joinable pthreads
15278if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
15279 echo " "
15280 echo "Checking what constant to use for creating joinable pthreads..." >&4
15281 $cat >try.c <<'EOCP'
15282#include <pthread.h>
15283int main() {
15284 int detachstate = JOINABLE;
15285}
15286EOCP
15287 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
15288 if eval $compile; then
15289 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
15290 val="$undef" # Yes, undef.
15291 set d_old_pthread_create_joinable
15292 eval $setvar
15293 val=""
15294 set old_pthread_create_joinable
15295 eval $setvar
15296 else
15297 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
15298 if eval $compile; then
15299 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
15300 val="$define"
15301 set d_old_pthread_create_joinable
15302 eval $setvar
15303 val=PTHREAD_CREATE_UNDETACHED
15304 set old_pthread_create_joinable
15305 eval $setvar
15306 else
15307 set try -DJOINABLE=__UNDETACHED
15308 if eval $compile; then
15309 echo "You seem to use __UNDETACHED." >&4
15310 val="$define"
15311 set d_old_pthread_create_joinable
15312 eval $setvar
15313 val=__UNDETACHED
15314 set old_pthread_create_joinable
15315 eval $setvar
15316 else
15317 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
15318 val="$define"
15319 set d_old_pthread_create_joinable
15320 eval $setvar
15321 val=0
15322 set old_pthread_create_joinable
15323 eval $setvar
15324 fi
15325 fi
15326 fi
15327 $rm -f try try.*
15328else
15329 d_old_pthread_create_joinable="$undef"
15330 old_pthread_create_joinable=""
15331fi
15332
15333: see if pause exists
15334set pause d_pause
15335eval $inlibc
15336
15337: see if pipe exists
15338set pipe d_pipe
15339eval $inlibc
15340
15341: see if poll exists
15342set poll d_poll
15343eval $inlibc
15344
15345: see if readlink exists
15346set readlink d_readlink
15347eval $inlibc
15348
15349echo " "
15350procselfexe=''
15351val="$undef"
15352case "$d_readlink" in
15353"$define")
15354 if $issymlink /proc/self/exe ; then
15355 $ls -l /proc/self/exe > reflect
15356 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15357 echo "You have Linux-like /proc/self/exe."
15358 procselfexe='"/proc/self/exe"'
15359 val="$define"
15360 fi
15361 fi
15362 if $issymlink /proc/curproc/file ; then
15363 $ls -l /proc/curproc/file > reflect
15364 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
15365 echo "You have BSD-like /proc/curproc/file."
15366 procselfexe='"/proc/curproc/file"'
15367 val="$define"
15368 fi
15369 fi
15370 ;;
15371esac
15372$rm -f reflect
15373set d_procselfexe
15374eval $setvar
15375
15376: see whether the pthread_atfork exists
15377$cat >try.c <<EOP
15378#include <pthread.h>
15379#include <stdio.h>
15380int main() {
15381#ifdef PTHREAD_ATFORK
15382 pthread_atfork(NULL,NULL,NULL);
15383#endif
15384}
15385EOP
15386
15387: see if pthread_atfork exists
15388set try -DPTHREAD_ATFORK
15389if eval $compile; then
15390 val="$define"
15391else
15392 val="$undef"
15393fi
15394case "$usethreads" in
15395$define)
15396 case "$val" in
15397 $define) echo 'pthread_atfork found.' >&4 ;;
15398 *) echo 'pthread_atfork NOT found.' >&4 ;;
15399 esac
15400esac
15401set d_pthread_atfork
15402eval $setvar
15403
15404: see if pthread_attr_setscope exists
15405set pthread_attr_setscope d_pthread_attr_setscope
15406eval $inlibc
15407
15408
15409: see whether the various POSIXish _yields exist
15410$cat >try.c <<EOP
15411#include <pthread.h>
15412#include <stdio.h>
15413int main() {
15414#ifdef SCHED_YIELD
15415 sched_yield();
15416#else
15417#ifdef PTHREAD_YIELD
15418 pthread_yield();
15419#else
15420#ifdef PTHREAD_YIELD_NULL
15421 pthread_yield(NULL);
15422#endif
15423#endif
15424#endif
15425}
15426EOP
15427: see if sched_yield exists
15428set try -DSCHED_YIELD
15429if eval $compile; then
15430 val="$define"
15431 sched_yield='sched_yield()'
15432else
15433 val="$undef"
15434fi
15435case "$usethreads" in
15436$define)
15437 case "$val" in
15438 $define) echo 'sched_yield() found.' >&4 ;;
15439 *) echo 'sched_yield() NOT found.' >&4 ;;
15440 esac
15441esac
15442set d_sched_yield
15443eval $setvar
15444
15445: see if pthread_yield exists
15446set try -DPTHREAD_YIELD
15447if eval $compile; then
15448 val="$define"
15449 case "$sched_yield" in
15450 '') sched_yield='pthread_yield()' ;;
15451 esac
15452else
15453 set try -DPTHREAD_YIELD_NULL
15454 if eval $compile; then
15455 val="$define"
15456 case "$sched_yield" in
15457 '') sched_yield='pthread_yield(NULL)' ;;
15458 esac
15459 else
15460 val="$undef"
15461 fi
15462fi
15463case "$usethreads" in
15464$define)
15465 case "$val" in
15466 $define) echo 'pthread_yield() found.' >&4 ;;
15467 *) echo 'pthread_yield() NOT found.' >&4 ;;
15468 esac
15469 ;;
15470esac
15471set d_pthread_yield
15472eval $setvar
15473
15474case "$sched_yield" in
15475'') sched_yield=undef ;;
15476esac
15477
15478$rm -f try try.*
15479
15480: see if random_r exists
15481set random_r d_random_r
15482eval $inlibc
15483case "$d_random_r" in
15484"$define")
15485 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15486 case "$d_random_r_proto:$usethreads" in
15487 ":define") d_random_r_proto=define
15488 set d_random_r_proto random_r $hdrs
15489 eval $hasproto ;;
15490 *) ;;
15491 esac
15492 case "$d_random_r_proto" in
15493 define)
15494 case "$random_r_proto" in
15495 ''|0) try='int random_r(int*, struct random_data*);'
15496 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
15497 esac
15498 case "$random_r_proto" in
15499 ''|0) try='int random_r(long*, struct random_data*);'
15500 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
15501 esac
15502 case "$random_r_proto" in
15503 ''|0) try='int random_r(struct random_data*, int32_t*);'
15504 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
15505 esac
15506 case "$random_r_proto" in
15507 ''|0) d_random_r=undef
15508 random_r_proto=0
15509 echo "Disabling random_r, cannot determine prototype." >&4 ;;
15510 * ) case "$random_r_proto" in
15511 REENTRANT_PROTO*) ;;
15512 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
15513 esac
15514 echo "Prototype: $try" ;;
15515 esac
15516 ;;
15517 *) case "$usethreads" in
15518 define) echo "random_r has no prototype, not using it." >&4 ;;
15519 esac
15520 d_random_r=undef
15521 random_r_proto=0
15522 ;;
15523 esac
15524 ;;
15525*) random_r_proto=0
15526 ;;
15527esac
15528
15529: see if readdir and friends exist
15530set readdir d_readdir
15531eval $inlibc
15532set seekdir d_seekdir
15533eval $inlibc
15534set telldir d_telldir
15535eval $inlibc
15536set rewinddir d_rewinddir
15537eval $inlibc
15538
15539: see if readdir64_r exists
15540set readdir64_r d_readdir64_r
15541eval $inlibc
15542case "$d_readdir64_r" in
15543"$define")
15544 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15545 case "$d_readdir64_r_proto:$usethreads" in
15546 ":define") d_readdir64_r_proto=define
15547 set d_readdir64_r_proto readdir64_r $hdrs
15548 eval $hasproto ;;
15549 *) ;;
15550 esac
15551 case "$d_readdir64_r_proto" in
15552 define)
15553 case "$readdir64_r_proto" in
15554 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
15555 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
15556 esac
15557 case "$readdir64_r_proto" in
15558 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
15559 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
15560 esac
15561 case "$readdir64_r_proto" in
15562 ''|0) d_readdir64_r=undef
15563 readdir64_r_proto=0
15564 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
15565 * ) case "$readdir64_r_proto" in
15566 REENTRANT_PROTO*) ;;
15567 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
15568 esac
15569 echo "Prototype: $try" ;;
15570 esac
15571 ;;
15572 *) case "$usethreads" in
15573 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
15574 esac
15575 d_readdir64_r=undef
15576 readdir64_r_proto=0
15577 ;;
15578 esac
15579 ;;
15580*) readdir64_r_proto=0
15581 ;;
15582esac
15583
15584: see if readdir_r exists
15585set readdir_r d_readdir_r
15586eval $inlibc
15587case "$d_readdir_r" in
15588"$define")
15589 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
15590 case "$d_readdir_r_proto:$usethreads" in
15591 ":define") d_readdir_r_proto=define
15592 set d_readdir_r_proto readdir_r $hdrs
15593 eval $hasproto ;;
15594 *) ;;
15595 esac
15596 case "$d_readdir_r_proto" in
15597 define)
15598 case "$readdir_r_proto" in
15599 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
15600 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
15601 esac
15602 case "$readdir_r_proto" in
15603 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15604 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15605 esac
15606 case "$readdir_r_proto" in
15607 ''|0) d_readdir_r=undef
15608 readdir_r_proto=0
15609 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15610 * ) case "$readdir_r_proto" in
15611 REENTRANT_PROTO*) ;;
15612 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15613 esac
15614 echo "Prototype: $try" ;;
15615 esac
15616 ;;
15617 *) case "$usethreads" in
15618 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15619 esac
15620 d_readdir_r=undef
15621 readdir_r_proto=0
15622 ;;
15623 esac
15624 ;;
15625*) readdir_r_proto=0
15626 ;;
15627esac
15628
15629: see if readv exists
15630set readv d_readv
15631eval $inlibc
15632
15633: see if recvmsg exists
15634set recvmsg d_recvmsg
15635eval $inlibc
15636
15637: see if rename exists
15638set rename d_rename
15639eval $inlibc
15640
15641: see if rmdir exists
15642set rmdir d_rmdir
15643eval $inlibc
15644
15645: see if memory.h is available.
15646val=''
15647set memory.h val
15648eval $inhdr
15649
15650: See if it conflicts with string.h
15651case "$val" in
15652$define)
15653 case "$strings" in
15654 '') ;;
15655 *)
15656 $cppstdin $cppflags $cppminus < $strings > mem.h
15657 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15658 echo " "
15659 echo "We won't be including <memory.h>."
15660 val="$undef"
15661 fi
15662 $rm -f mem.h
15663 ;;
15664 esac
15665esac
15666set i_memory
15667eval $setvar
15668
15669: can bcopy handle overlapping blocks?
15670echo " "
15671val="$undef"
15672case "$d_memmove" in
15673"$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15674*) case "$d_bcopy" in
15675 "$define")
15676 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15677 $cat >try.c <<EOCP
15678#$i_memory I_MEMORY
15679#$i_stdlib I_STDLIB
15680#$i_string I_STRING
15681#$i_unistd I_UNISTD
15682EOCP
15683 $cat >>try.c <<'EOCP'
15684#include <stdio.h>
15685#ifdef I_MEMORY
15686# include <memory.h>
15687#endif
15688#ifdef I_STDLIB
15689# include <stdlib.h>
15690#endif
15691#ifdef I_STRING
15692# include <string.h>
15693#else
15694# include <strings.h>
15695#endif
15696#ifdef I_UNISTD
15697# include <unistd.h> /* Needed for NetBSD */
15698#endif
15699int main()
15700{
15701char buf[128], abc[128];
15702char *b;
15703int len;
15704int off;
15705int align;
15706
15707/* Copy "abcde..." string to char abc[] so that gcc doesn't
15708 try to store the string in read-only memory. */
15709bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15710
15711for (align = 7; align >= 0; align--) {
15712 for (len = 36; len; len--) {
15713 b = buf+align;
15714 bcopy(abc, b, len);
15715 for (off = 1; off <= len; off++) {
15716 bcopy(b, b+off, len);
15717 bcopy(b+off, b, len);
15718 if (bcmp(b, abc, len))
15719 exit(1);
15720 }
15721 }
15722}
15723exit(0);
15724}
15725EOCP
15726 set try
15727 if eval $compile_ok; then
15728 if ./try 2>/dev/null; then
15729 echo "Yes, it can."
15730 val="$define"
15731 else
15732 echo "It can't, sorry."
15733 fi
15734 else
15735 echo "(I can't compile the test program, so we'll assume not...)"
15736 fi
15737 ;;
15738 esac
15739 $rm -f try.* try core
15740 ;;
15741esac
15742set d_safebcpy
15743eval $setvar
15744
15745: can memcpy handle overlapping blocks?
15746echo " "
15747val="$undef"
15748case "$d_memmove" in
15749"$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15750*) case "$d_memcpy" in
15751 "$define")
15752 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15753 $cat >try.c <<EOCP
15754#$i_memory I_MEMORY
15755#$i_stdlib I_STDLIB
15756#$i_string I_STRING
15757#$i_unistd I_UNISTD
15758EOCP
15759 $cat >>try.c <<'EOCP'
15760#include <stdio.h>
15761#ifdef I_MEMORY
15762# include <memory.h>
15763#endif
15764#ifdef I_STDLIB
15765# include <stdlib.h>
15766#endif
15767#ifdef I_STRING
15768# include <string.h>
15769#else
15770# include <strings.h>
15771#endif
15772#ifdef I_UNISTD
15773# include <unistd.h> /* Needed for NetBSD */
15774#endif
15775int main()
15776{
15777char buf[128], abc[128];
15778char *b;
15779int len;
15780int off;
15781int align;
15782
15783/* Copy "abcde..." string to char abc[] so that gcc doesn't
15784 try to store the string in read-only memory. */
15785memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15786
15787for (align = 7; align >= 0; align--) {
15788 for (len = 36; len; len--) {
15789 b = buf+align;
15790 memcpy(b, abc, len);
15791 for (off = 1; off <= len; off++) {
15792 memcpy(b+off, b, len);
15793 memcpy(b, b+off, len);
15794 if (memcmp(b, abc, len))
15795 exit(1);
15796 }
15797 }
15798}
15799exit(0);
15800}
15801EOCP
15802 set try
15803 if eval $compile_ok; then
15804 if ./try 2>/dev/null; then
15805 echo "Yes, it can."
15806 val="$define"
15807 else
15808 echo "It can't, sorry."
15809 fi
15810 else
15811 echo "(I can't compile the test program, so we'll assume not...)"
15812 fi
15813 ;;
15814 esac
15815 $rm -f try.* try core
15816 ;;
15817esac
15818set d_safemcpy
15819eval $setvar
15820
15821: can memcmp be trusted to compare relative magnitude?
15822val="$undef"
15823case "$d_memcmp" in
15824"$define")
15825 echo " "
15826 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15827 $cat >try.c <<EOCP
15828#$i_memory I_MEMORY
15829#$i_stdlib I_STDLIB
15830#$i_string I_STRING
15831#$i_unistd I_UNISTD
15832EOCP
15833 $cat >>try.c <<'EOCP'
15834#include <stdio.h>
15835#ifdef I_MEMORY
15836# include <memory.h>
15837#endif
15838#ifdef I_STDLIB
15839# include <stdlib.h>
15840#endif
15841#ifdef I_STRING
15842# include <string.h>
15843#else
15844# include <strings.h>
15845#endif
15846#ifdef I_UNISTD
15847# include <unistd.h> /* Needed for NetBSD */
15848#endif
15849int main()
15850{
15851char a = -1;
15852char b = 0;
15853if ((a < b) && memcmp(&a, &b, 1) < 0)
15854 exit(1);
15855exit(0);
15856}
15857EOCP
15858 set try
15859 if eval $compile_ok; then
15860 if $run ./try 2>/dev/null; then
15861 echo "Yes, it can."
15862 val="$define"
15863 else
15864 echo "No, it can't (it uses signed chars)."
15865 fi
15866 else
15867 echo "(I can't compile the test program, so we'll assume not...)"
15868 fi
15869 ;;
15870esac
15871$rm -f try.* try core
15872set d_sanemcmp
15873eval $setvar
15874
15875: see if prototype for sbrk is available
15876echo " "
15877set d_sbrkproto sbrk $i_unistd unistd.h
15878eval $hasproto
15879
15880: see if select exists
15881set select d_select
15882eval $inlibc
15883
15884: see if semctl exists
15885set semctl d_semctl
15886eval $inlibc
15887
15888: see if semget exists
15889set semget d_semget
15890eval $inlibc
15891
15892: see if semop exists
15893set semop d_semop
15894eval $inlibc
15895
15896: see how much of the 'sem*(2)' library is present.
15897h_sem=true
15898echo " "
15899case "$d_semctl$d_semget$d_semop" in
15900*"$undef"*) h_sem=false;;
15901esac
15902case "$osname" in
15903freebsd)
15904 case "`ipcs 2>&1`" in
15905 "SVID messages"*"not configured"*)
15906 echo "Your $osname does not have the sem*(2) configured." >&4
15907 h_sem=false
15908 val="$undef"
15909 set semctl d_semctl
15910 eval $setvar
15911 set semget d_semget
15912 eval $setvar
15913 set semop d_semop
15914 eval $setvar
15915 ;;
15916 esac
15917 ;;
15918esac
15919: we could also check for sys/ipc.h ...
15920if $h_sem && $test `./findhdr sys/sem.h`; then
15921 echo "You have the full sem*(2) library." >&4
15922 val="$define"
15923else
15924 echo "You don't have the full sem*(2) library." >&4
15925 val="$undef"
15926fi
15927set d_sem
15928eval $setvar
15929
15930: see whether sys/sem.h defines union semun
15931echo " "
15932$cat > try.c <<'END'
15933#include <sys/types.h>
15934#include <sys/ipc.h>
15935#include <sys/sem.h>
15936int main () { union semun semun; semun.buf = 0; }
15937END
15938set try
15939if eval $compile; then
15940 echo "You have union semun in <sys/sem.h>." >&4
15941 val="$define"
15942else
15943 echo "You do not have union semun in <sys/sem.h>." >&4
15944 val="$undef"
15945fi
15946$rm -f try try.c
15947set d_union_semun
15948eval $setvar
15949
15950: see how to do semctl IPC_STAT
15951case "$d_sem" in
15952$define)
15953 echo " "
15954 $cat > try.h <<END
15955#ifndef S_IRUSR
15956# ifdef S_IREAD
15957# define S_IRUSR S_IREAD
15958# define S_IWUSR S_IWRITE
15959# define S_IXUSR S_IEXEC
15960# else
15961# define S_IRUSR 0400
15962# define S_IWUSR 0200
15963# define S_IXUSR 0100
15964# endif
15965# define S_IRGRP (S_IRUSR>>3)
15966# define S_IWGRP (S_IWUSR>>3)
15967# define S_IXGRP (S_IXUSR>>3)
15968# define S_IROTH (S_IRUSR>>6)
15969# define S_IWOTH (S_IWUSR>>6)
15970# define S_IXOTH (S_IXUSR>>6)
15971#endif
15972#ifndef S_IRWXU
15973# define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15974# define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15975# define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15976#endif
15977END
15978 : see whether semctl IPC_STAT can use union semun
15979 case "$d_semctl_semun" in
15980 '')
15981 val="$undef"
15982 $cat > try.c <<END
15983#include <sys/types.h>
15984#include <sys/ipc.h>
15985#include <sys/sem.h>
15986#include <sys/stat.h>
15987#include <stdio.h>
15988#include <errno.h>
15989#include "try.h"
15990#ifndef errno
15991extern int errno;
15992#endif
15993#$d_union_semun HAS_UNION_SEMUN
15994int main() {
15995 union semun
15996#ifndef HAS_UNION_SEMUN
15997 {
15998 int val;
15999 struct semid_ds *buf;
16000 unsigned short *array;
16001 }
16002#endif
16003 arg;
16004 int sem, st;
16005
16006#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16007 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16008 if (sem > -1) {
16009 struct semid_ds argbuf;
16010 arg.buf = &argbuf;
16011# ifdef IPC_STAT
16012 st = semctl(sem, 0, IPC_STAT, arg);
16013 if (st == 0)
16014 printf("semun\n");
16015 else
16016# endif /* IPC_STAT */
16017 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16018# ifdef IPC_RMID
16019 if (semctl(sem, 0, IPC_RMID, arg) != 0)
16020# endif /* IPC_RMID */
16021 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16022 } else
16023#endif /* IPC_PRIVATE && ... */
16024 printf("semget failed: errno = %d\n", errno);
16025 return 0;
16026}
16027END
16028 set try
16029 if eval $compile; then
16030 xxx=`$run ./try`
16031 case "$xxx" in
16032 semun) val="$define" ;;
16033 esac
16034 fi
16035 $rm -f try try.c
16036 set d_semctl_semun
16037 eval $setvar
16038 ;;
16039 esac
16040 case "$d_semctl_semun" in
16041 $define)
16042 echo "You can use union semun for semctl IPC_STAT." >&4
16043 also='also'
16044 ;;
16045 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
16046 also=''
16047 ;;
16048 esac
16049
16050 : see whether semctl IPC_STAT can use struct semid_ds pointer
16051 case "$d_semctl_semid_ds" in
16052 '')
16053 val="$undef"
16054 $cat > try.c <<'END'
16055#include <sys/types.h>
16056#include <sys/ipc.h>
16057#include <sys/sem.h>
16058#include <sys/stat.h>
16059#include "try.h"
16060#include <stdio.h>
16061#include <errno.h>
16062#ifndef errno
16063extern int errno;
16064#endif
16065int main() {
16066 struct semid_ds arg;
16067 int sem, st;
16068
16069#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
16070 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
16071 if (sem > -1) {
16072# ifdef IPC_STAT
16073 st = semctl(sem, 0, IPC_STAT, &arg);
16074 if (st == 0)
16075 printf("semid_ds\n");
16076 else
16077# endif /* IPC_STAT */
16078 printf("semctl IPC_STAT failed: errno = %d\n", errno);
16079# ifdef IPC_RMID
16080 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
16081# endif /* IPC_RMID */
16082 printf("semctl IPC_RMID failed: errno = %d\n", errno);
16083 } else
16084#endif /* IPC_PRIVATE && ... */
16085 printf("semget failed: errno = %d\n", errno);
16086
16087 return 0;
16088}
16089END
16090 set try
16091 if eval $compile; then
16092 xxx=`$run ./try`
16093 case "$xxx" in
16094 semid_ds) val="$define" ;;
16095 esac
16096 fi
16097 $rm -f try try.c
16098 set d_semctl_semid_ds
16099 eval $setvar
16100 ;;
16101 esac
16102 case "$d_semctl_semid_ds" in
16103 $define)
16104 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
16105 ;;
16106 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
16107 ;;
16108 esac
16109 $rm -f try.h
16110 ;;
16111*) val="$undef"
16112
16113 # We do not have the full sem*(2) library, so assume we can not
16114 # use either.
16115
16116 set d_semctl_semun
16117 eval $setvar
16118
16119 set d_semctl_semid_ds
16120 eval $setvar
16121 ;;
16122esac
16123
16124: see if sendmsg exists
16125set sendmsg d_sendmsg
16126eval $inlibc
16127
16128: see if setegid exists
16129set setegid d_setegid
16130eval $inlibc
16131
16132: see if seteuid exists
16133set seteuid d_seteuid
16134eval $inlibc
16135
16136: see if setgrent exists
16137set setgrent d_setgrent
16138eval $inlibc
16139
16140: see if setgrent_r exists
16141set setgrent_r d_setgrent_r
16142eval $inlibc
16143case "$d_setgrent_r" in
16144"$define")
16145 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
16146 case "$d_setgrent_r_proto:$usethreads" in
16147 ":define") d_setgrent_r_proto=define
16148 set d_setgrent_r_proto setgrent_r $hdrs
16149 eval $hasproto ;;
16150 *) ;;
16151 esac
16152 case "$d_setgrent_r_proto" in
16153 define)
16154 case "$setgrent_r_proto" in
16155 ''|0) try='int setgrent_r(FILE**);'
16156 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
16157 esac
16158 case "$setgrent_r_proto" in
16159 ''|0) try='void setgrent_r(FILE**);'
16160 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
16161 esac
16162 case "$setgrent_r_proto" in
16163 ''|0) d_setgrent_r=undef
16164 setgrent_r_proto=0
16165 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
16166 * ) case "$setgrent_r_proto" in
16167 REENTRANT_PROTO*) ;;
16168 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
16169 esac
16170 echo "Prototype: $try" ;;
16171 esac
16172 ;;
16173 *) case "$usethreads" in
16174 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
16175 esac
16176 d_setgrent_r=undef
16177 setgrent_r_proto=0
16178 ;;
16179 esac
16180 ;;
16181*) setgrent_r_proto=0
16182 ;;
16183esac
16184
16185: see if sethostent exists
16186set sethostent d_sethent
16187eval $inlibc
16188
16189: see if sethostent_r exists
16190set sethostent_r d_sethostent_r
16191eval $inlibc
16192case "$d_sethostent_r" in
16193"$define")
16194 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16195 case "$d_sethostent_r_proto:$usethreads" in
16196 ":define") d_sethostent_r_proto=define
16197 set d_sethostent_r_proto sethostent_r $hdrs
16198 eval $hasproto ;;
16199 *) ;;
16200 esac
16201 case "$d_sethostent_r_proto" in
16202 define)
16203 case "$sethostent_r_proto" in
16204 ''|0) try='int sethostent_r(int, struct hostent_data*);'
16205 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
16206 esac
16207 case "$sethostent_r_proto" in
16208 ''|0) try='void sethostent_r(int, struct hostent_data*);'
16209 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
16210 esac
16211 case "$sethostent_r_proto" in
16212 ''|0) d_sethostent_r=undef
16213 sethostent_r_proto=0
16214 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
16215 * ) case "$sethostent_r_proto" in
16216 REENTRANT_PROTO*) ;;
16217 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
16218 esac
16219 echo "Prototype: $try" ;;
16220 esac
16221 ;;
16222 *) case "$usethreads" in
16223 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
16224 esac
16225 d_sethostent_r=undef
16226 sethostent_r_proto=0
16227 ;;
16228 esac
16229 ;;
16230*) sethostent_r_proto=0
16231 ;;
16232esac
16233
16234: see if setitimer exists
16235set setitimer d_setitimer
16236eval $inlibc
16237
16238: see if setlinebuf exists
16239set setlinebuf d_setlinebuf
16240eval $inlibc
16241
16242: see if setlocale exists
16243set setlocale d_setlocale
16244eval $inlibc
16245
16246: see if locale.h is available
16247set locale.h i_locale
16248eval $inhdr
16249
16250: see if setlocale_r exists
16251set setlocale_r d_setlocale_r
16252eval $inlibc
16253case "$d_setlocale_r" in
16254"$define")
16255 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
16256 case "$d_setlocale_r_proto:$usethreads" in
16257 ":define") d_setlocale_r_proto=define
16258 set d_setlocale_r_proto setlocale_r $hdrs
16259 eval $hasproto ;;
16260 *) ;;
16261 esac
16262 case "$d_setlocale_r_proto" in
16263 define)
16264 case "$setlocale_r_proto" in
16265 ''|0) try='int setlocale_r(int, const char*, char*, int);'
16266 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
16267 esac
16268 case "$setlocale_r_proto" in
16269 ''|0) d_setlocale_r=undef
16270 setlocale_r_proto=0
16271 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
16272 * ) case "$setlocale_r_proto" in
16273 REENTRANT_PROTO*) ;;
16274 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
16275 esac
16276 echo "Prototype: $try" ;;
16277 esac
16278 ;;
16279 *) case "$usethreads" in
16280 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
16281 esac
16282 d_setlocale_r=undef
16283 setlocale_r_proto=0
16284 ;;
16285 esac
16286 ;;
16287*) setlocale_r_proto=0
16288 ;;
16289esac
16290
16291: see if setnetent exists
16292set setnetent d_setnent
16293eval $inlibc
16294
16295: see if setnetent_r exists
16296set setnetent_r d_setnetent_r
16297eval $inlibc
16298case "$d_setnetent_r" in
16299"$define")
16300 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16301 case "$d_setnetent_r_proto:$usethreads" in
16302 ":define") d_setnetent_r_proto=define
16303 set d_setnetent_r_proto setnetent_r $hdrs
16304 eval $hasproto ;;
16305 *) ;;
16306 esac
16307 case "$d_setnetent_r_proto" in
16308 define)
16309 case "$setnetent_r_proto" in
16310 ''|0) try='int setnetent_r(int, struct netent_data*);'
16311 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
16312 esac
16313 case "$setnetent_r_proto" in
16314 ''|0) try='void setnetent_r(int, struct netent_data*);'
16315 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
16316 esac
16317 case "$setnetent_r_proto" in
16318 ''|0) d_setnetent_r=undef
16319 setnetent_r_proto=0
16320 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
16321 * ) case "$setnetent_r_proto" in
16322 REENTRANT_PROTO*) ;;
16323 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
16324 esac
16325 echo "Prototype: $try" ;;
16326 esac
16327 ;;
16328 *) case "$usethreads" in
16329 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
16330 esac
16331 d_setnetent_r=undef
16332 setnetent_r_proto=0
16333 ;;
16334 esac
16335 ;;
16336*) setnetent_r_proto=0
16337 ;;
16338esac
16339
16340: see if setprotoent exists
16341set setprotoent d_setpent
16342eval $inlibc
16343
16344: see if setpgid exists
16345set setpgid d_setpgid
16346eval $inlibc
16347
16348: see if setpgrp2 exists
16349set setpgrp2 d_setpgrp2
16350eval $inlibc
16351
16352: see if setpriority exists
16353set setpriority d_setprior
16354eval $inlibc
16355
16356: see if setproctitle exists
16357set setproctitle d_setproctitle
16358eval $inlibc
16359
16360: see if setprotoent_r exists
16361set setprotoent_r d_setprotoent_r
16362eval $inlibc
16363case "$d_setprotoent_r" in
16364"$define")
16365 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16366 case "$d_setprotoent_r_proto:$usethreads" in
16367 ":define") d_setprotoent_r_proto=define
16368 set d_setprotoent_r_proto setprotoent_r $hdrs
16369 eval $hasproto ;;
16370 *) ;;
16371 esac
16372 case "$d_setprotoent_r_proto" in
16373 define)
16374 case "$setprotoent_r_proto" in
16375 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
16376 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
16377 esac
16378 case "$setprotoent_r_proto" in
16379 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
16380 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
16381 esac
16382 case "$setprotoent_r_proto" in
16383 ''|0) d_setprotoent_r=undef
16384 setprotoent_r_proto=0
16385 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
16386 * ) case "$setprotoent_r_proto" in
16387 REENTRANT_PROTO*) ;;
16388 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
16389 esac
16390 echo "Prototype: $try" ;;
16391 esac
16392 ;;
16393 *) case "$usethreads" in
16394 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
16395 esac
16396 d_setprotoent_r=undef
16397 setprotoent_r_proto=0
16398 ;;
16399 esac
16400 ;;
16401*) setprotoent_r_proto=0
16402 ;;
16403esac
16404
16405: see if setpwent exists
16406set setpwent d_setpwent
16407eval $inlibc
16408
16409: see if setpwent_r exists
16410set setpwent_r d_setpwent_r
16411eval $inlibc
16412case "$d_setpwent_r" in
16413"$define")
16414 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
16415 case "$d_setpwent_r_proto:$usethreads" in
16416 ":define") d_setpwent_r_proto=define
16417 set d_setpwent_r_proto setpwent_r $hdrs
16418 eval $hasproto ;;
16419 *) ;;
16420 esac
16421 case "$d_setpwent_r_proto" in
16422 define)
16423 case "$setpwent_r_proto" in
16424 ''|0) try='int setpwent_r(FILE**);'
16425 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
16426 esac
16427 case "$setpwent_r_proto" in
16428 ''|0) try='void setpwent_r(FILE**);'
16429 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
16430 esac
16431 case "$setpwent_r_proto" in
16432 ''|0) d_setpwent_r=undef
16433 setpwent_r_proto=0
16434 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
16435 * ) case "$setpwent_r_proto" in
16436 REENTRANT_PROTO*) ;;
16437 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
16438 esac
16439 echo "Prototype: $try" ;;
16440 esac
16441 ;;
16442 *) case "$usethreads" in
16443 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
16444 esac
16445 d_setpwent_r=undef
16446 setpwent_r_proto=0
16447 ;;
16448 esac
16449 ;;
16450*) setpwent_r_proto=0
16451 ;;
16452esac
16453
16454: see if setregid exists
16455set setregid d_setregid
16456eval $inlibc
16457set setresgid d_setresgid
16458eval $inlibc
16459
16460: see if setreuid exists
16461set setreuid d_setreuid
16462eval $inlibc
16463set setresuid d_setresuid
16464eval $inlibc
16465
16466: see if setrgid exists
16467set setrgid d_setrgid
16468eval $inlibc
16469
16470: see if setruid exists
16471set setruid d_setruid
16472eval $inlibc
16473
16474: see if setservent exists
16475set setservent d_setsent
16476eval $inlibc
16477
16478: see if setservent_r exists
16479set setservent_r d_setservent_r
16480eval $inlibc
16481case "$d_setservent_r" in
16482"$define")
16483 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
16484 case "$d_setservent_r_proto:$usethreads" in
16485 ":define") d_setservent_r_proto=define
16486 set d_setservent_r_proto setservent_r $hdrs
16487 eval $hasproto ;;
16488 *) ;;
16489 esac
16490 case "$d_setservent_r_proto" in
16491 define)
16492 case "$setservent_r_proto" in
16493 ''|0) try='int setservent_r(int, struct servent_data*);'
16494 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
16495 esac
16496 case "$setservent_r_proto" in
16497 ''|0) try='void setservent_r(int, struct servent_data*);'
16498 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
16499 esac
16500 case "$setservent_r_proto" in
16501 ''|0) d_setservent_r=undef
16502 setservent_r_proto=0
16503 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
16504 * ) case "$setservent_r_proto" in
16505 REENTRANT_PROTO*) ;;
16506 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
16507 esac
16508 echo "Prototype: $try" ;;
16509 esac
16510 ;;
16511 *) case "$usethreads" in
16512 define) echo "setservent_r has no prototype, not using it." >&4 ;;
16513 esac
16514 d_setservent_r=undef
16515 setservent_r_proto=0
16516 ;;
16517 esac
16518 ;;
16519*) setservent_r_proto=0
16520 ;;
16521esac
16522
16523: see if setsid exists
16524set setsid d_setsid
16525eval $inlibc
16526
16527: see if setvbuf exists
16528set setvbuf d_setvbuf
16529eval $inlibc
16530
16531: see if sfio.h is available
16532set sfio.h i_sfio
16533eval $inhdr
16534
16535
16536: see if sfio library is available
16537case "$i_sfio" in
16538$define)
16539 val=''
16540 set sfreserve val
16541 eval $inlibc
16542 ;;
16543*)
16544 val="$undef"
16545 ;;
16546esac
16547: Ok, but do we want to use it.
16548case "$val" in
16549$define)
16550 case "$usesfio" in
16551 true|$define|[yY]*) dflt='y';;
16552 *) dflt='n';;
16553 esac
16554 echo "$package can use the sfio library, but it is experimental."
16555 case "$useperlio" in
16556 "$undef")
16557 echo "For sfio also the PerlIO abstraction layer is needed."
16558 echo "Earlier you said you wouldn't want that."
16559 ;;
16560 esac
16561 rp="You seem to have sfio available, do you want to try using it?"
16562 . ./myread
16563 case "$ans" in
16564 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
16565 useperlio="$define"
16566 val="$define"
16567 ;;
16568 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
16569 val="$undef"
16570 ;;
16571 esac
16572 ;;
16573*) case "$usesfio" in
16574 true|$define|[yY]*)
16575 echo "Sorry, cannot find sfio on this machine." >&4
16576 echo "Ignoring your setting of usesfio=$usesfio." >&4
16577 val="$undef"
16578 ;;
16579 esac
16580 ;;
16581esac
16582set d_sfio
16583eval $setvar
16584case "$d_sfio" in
16585$define) usesfio='true';;
16586*) usesfio='false';;
16587esac
16588case "$d_sfio" in
16589$define) ;;
16590*) : Remove sfio from list of libraries to use
16591 case "$libs" in
16592 *-lsfio*)
16593 echo "Removing unneeded -lsfio from library list" >&4
16594 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
16595 shift
16596 libs="$*"
16597 echo "libs = $libs" >&4
16598 ;;
16599 esac
16600;;
16601esac
16602
16603
16604: see if shmctl exists
16605set shmctl d_shmctl
16606eval $inlibc
16607
16608: see if shmget exists
16609set shmget d_shmget
16610eval $inlibc
16611
16612: see if shmat exists
16613set shmat d_shmat
16614eval $inlibc
16615: see what shmat returns
16616case "$d_shmat" in
16617"$define")
16618 $cat >shmat.c <<'END'
16619#include <sys/shm.h>
16620void *shmat();
16621END
16622 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16623 shmattype='void *'
16624 else
16625 shmattype='char *'
16626 fi
16627 echo "and it returns ($shmattype)." >&4
16628 : see if a prototype for shmat is available
16629 xxx=`./findhdr sys/shm.h`
16630 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16631 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16632 val="$define"
16633 else
16634 val="$undef"
16635 fi
16636 $rm -f shmat.[co]
16637 ;;
16638*)
16639 val="$undef"
16640 ;;
16641esac
16642set d_shmatprototype
16643eval $setvar
16644
16645: see if shmdt exists
16646set shmdt d_shmdt
16647eval $inlibc
16648
16649: see how much of the 'shm*(2)' library is present.
16650h_shm=true
16651echo " "
16652case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16653*"$undef"*) h_shm=false;;
16654esac
16655case "$osname" in
16656freebsd)
16657 case "`ipcs 2>&1`" in
16658 "SVID shared memory"*"not configured"*)
16659 echo "Your $osname does not have the shm*(2) configured." >&4
16660 h_shm=false
16661 val="$undef"
16662 set shmctl d_shmctl
16663 evat $setvar
16664 set shmget d_shmget
16665 evat $setvar
16666 set shmat d_shmat
16667 evat $setvar
16668 set shmdt d_shmdt
16669 evat $setvar
16670 ;;
16671 esac
16672 ;;
16673esac
16674: we could also check for sys/ipc.h ...
16675if $h_shm && $test `./findhdr sys/shm.h`; then
16676 echo "You have the full shm*(2) library." >&4
16677 val="$define"
16678else
16679 echo "You don't have the full shm*(2) library." >&4
16680 val="$undef"
16681fi
16682set d_shm
16683eval $setvar
16684
16685echo " "
16686: see if we have sigaction
16687if set sigaction val -f d_sigaction; eval $csym; $val; then
16688 echo 'sigaction() found.' >&4
16689 $cat > try.c <<EOP
16690#include <stdio.h>
16691#include <sys/types.h>
16692#include <signal.h>
16693#$i_stdlib I_STDLIB
16694#ifdef I_STDLIB
16695#include <stdlib.h>
16696#endif
16697int main()
16698{
16699 struct sigaction act, oact;
16700 act.sa_flags = 0;
16701 oact.sa_handler = 0;
16702 /* so that act and oact are used */
16703 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16704}
16705EOP
16706 set try
16707 if eval $compile_ok; then
16708 val="$define"
16709 else
16710 echo "But you don't seem to have a useable struct sigaction." >&4
16711 val="$undef"
16712 fi
16713else
16714 echo 'sigaction NOT found.' >&4
16715 val="$undef"
16716fi
16717set d_sigaction; eval $setvar
16718$rm -f try try$_o try.c
16719
16720: see if sigprocmask exists
16721set sigprocmask d_sigprocmask
16722eval $inlibc
16723
16724: see if sigsetjmp exists
16725echo " "
16726case "$d_sigsetjmp" in
16727'')
16728 $cat >try.c <<EOP
16729#include <setjmp.h>
16730#$i_stdlib I_STDLIB
16731#ifdef I_STDLIB
16732#include <stdlib.h>
16733#endif
16734sigjmp_buf env;
16735int set = 1;
16736int main()
16737{
16738 if (sigsetjmp(env,1))
16739 exit(set);
16740 set = 0;
16741 siglongjmp(env, 1);
16742 exit(1);
16743}
16744EOP
16745 set try
16746 if eval $compile; then
16747 if $run ./try >/dev/null 2>&1; then
16748 echo "POSIX sigsetjmp found." >&4
16749 val="$define"
16750 else
16751 $cat >&4 <<EOM
16752Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16753I'll ignore them.
16754EOM
16755 val="$undef"
16756 fi
16757 else
16758 echo "sigsetjmp not found." >&4
16759 val="$undef"
16760 fi
16761 ;;
16762*) val="$d_sigsetjmp"
16763 case "$d_sigsetjmp" in
16764 $define) echo "POSIX sigsetjmp found." >&4;;
16765 $undef) echo "sigsetjmp not found." >&4;;
16766 esac
16767 ;;
16768esac
16769set d_sigsetjmp
16770eval $setvar
16771$rm -f try.c try
16772
16773: see if snprintf exists
16774set snprintf d_snprintf
16775eval $inlibc
16776
16777: see if vsnprintf exists
16778set vsnprintf d_vsnprintf
16779eval $inlibc
16780
16781case "$d_snprintf-$d_vsnprintf" in
16782"$define-$define")
16783 $cat <<EOM
16784Checking whether your snprintf() and vsnprintf() work okay...
16785EOM
16786 $cat >try.c <<'EOCP'
16787/* v?snprintf testing logic courtesy of Russ Allbery.
16788 * According to C99:
16789 * - if the buffer is too short it still must be \0-terminated
16790 * - if the buffer is too short the potentially required length
16791 * must be returned and not -1
16792 * - if the buffer is NULL the potentially required length
16793 * must be returned and not -1 or core dump
16794 */
16795#include <stdio.h>
16796#include <stdarg.h>
16797
16798char buf[2];
16799
16800int test (char *format, ...)
16801{
16802 va_list args;
16803 int count;
16804
16805 va_start (args, format);
16806 count = vsnprintf (buf, sizeof buf, format, args);
16807 va_end (args);
16808 return count;
16809}
16810
16811int main ()
16812{
16813 return ((test ("%s", "abcd") == 4 && buf[0] == 'a' && buf[1] == '\0'
16814 && snprintf (NULL, 0, "%s", "abcd") == 4) ? 0 : 1);
16815}
16816EOCP
16817 set try
16818 if eval $compile; then
16819 `$run ./try`
16820 case "$?" in
16821 0) echo "Your snprintf() and vsnprintf() seem to be working okay." ;;
16822 *) cat <<EOM >&4
16823Your snprintf() and snprintf() don't seem to be working okay.
16824EOM
16825 d_snprintf="$undef"
16826 d_vsnprintf="$undef"
16827 ;;
16828 esac
16829 else
16830 echo "(I can't seem to compile the test program--assuming they don't)"
16831 d_snprintf="$undef"
16832 d_vsnprintf="$undef"
16833 fi
16834 $rm -f try.* try core core.try.*
16835 ;;
16836esac
16837
16838: see if sockatmark exists
16839set sockatmark d_sockatmark
16840eval $inlibc
16841
16842: see if prototype for sockatmark is available
16843echo " "
16844set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16845eval $hasproto
16846
16847: see if socks5_init exists
16848set socks5_init d_socks5_init
16849eval $inlibc
16850
16851: see if sprintf returns the length of the string in the buffer as per ANSI
16852$echo "Checking whether sprintf returns the length of the string..." >&4
16853$cat <<EOP >try.c
16854#include <stdio.h>
16855#$i_stdlib I_STDLIB
16856#ifdef I_STDLIB
16857#include <stdlib.h>
16858#endif
16859#$i_string I_STRING
16860#ifdef I_STRING
16861# include <string.h>
16862#else
16863# include <strings.h>
16864#endif
16865#$i_math I_MATH
16866#ifdef I_MATH
16867#include <math.h>
16868#endif
16869
16870char buffer[256];
16871
16872int check (size_t expect, int test) {
16873 size_t got = strlen(buffer);
16874 if (expect == got)
16875 return 0;
16876
16877 printf("expected %ld, got %ld in test %d '%s'\n", (long) expect, (long) got,
16878 test, buffer);
16879 exit (test);
16880}
16881
16882int main(int argc, char **argv) {
16883 int test = 0;
16884
16885 check(sprintf(buffer, ""), ++test);
16886 check(sprintf(buffer, "%s %s", "perl", "rules"), ++test);
16887 check(sprintf(buffer, "I like %g", atan2(0,-1)), ++test);
16888
16889 return 0;
16890}
16891EOP
16892set try
16893
16894d_sprintf_returns_strlen="$undef"
16895if eval $compile; then
16896 xxx="`$run ./try`"
16897 case "$?" in
16898 0) cat >&4 <<EOM
16899sprintf returns the length of the string (as ANSI says it should)
16900EOM
16901 d_sprintf_returns_strlen="$define"
16902 ;;
16903 *) cat >&4 <<EOM
16904sprintf does not return the length of the string (how old is this system?)
16905EOM
16906 d_sprintf_returns_strlen="$undef"
16907 ;;
16908 esac
16909fi
16910
16911$rm -f try.* try
16912
16913: see if srand48_r exists
16914set srand48_r d_srand48_r
16915eval $inlibc
16916case "$d_srand48_r" in
16917"$define")
16918 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16919 case "$d_srand48_r_proto:$usethreads" in
16920 ":define") d_srand48_r_proto=define
16921 set d_srand48_r_proto srand48_r $hdrs
16922 eval $hasproto ;;
16923 *) ;;
16924 esac
16925 case "$d_srand48_r_proto" in
16926 define)
16927 case "$srand48_r_proto" in
16928 ''|0) try='int srand48_r(long, struct drand48_data*);'
16929 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16930 esac
16931 case "$srand48_r_proto" in
16932 ''|0) d_srand48_r=undef
16933 srand48_r_proto=0
16934 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16935 * ) case "$srand48_r_proto" in
16936 REENTRANT_PROTO*) ;;
16937 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16938 esac
16939 echo "Prototype: $try" ;;
16940 esac
16941 ;;
16942 *) case "$usethreads" in
16943 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16944 esac
16945 d_srand48_r=undef
16946 srand48_r_proto=0
16947 ;;
16948 esac
16949 ;;
16950*) srand48_r_proto=0
16951 ;;
16952esac
16953
16954: see if srandom_r exists
16955set srandom_r d_srandom_r
16956eval $inlibc
16957case "$d_srandom_r" in
16958"$define")
16959 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16960 case "$d_srandom_r_proto:$usethreads" in
16961 ":define") d_srandom_r_proto=define
16962 set d_srandom_r_proto srandom_r $hdrs
16963 eval $hasproto ;;
16964 *) ;;
16965 esac
16966 case "$d_srandom_r_proto" in
16967 define)
16968 case "$srandom_r_proto" in
16969 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16970 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16971 esac
16972 case "$srandom_r_proto" in
16973 ''|0) d_srandom_r=undef
16974 srandom_r_proto=0
16975 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16976 * ) case "$srandom_r_proto" in
16977 REENTRANT_PROTO*) ;;
16978 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16979 esac
16980 echo "Prototype: $try" ;;
16981 esac
16982 ;;
16983 *) case "$usethreads" in
16984 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16985 esac
16986 d_srandom_r=undef
16987 srandom_r_proto=0
16988 ;;
16989 esac
16990 ;;
16991*) srandom_r_proto=0
16992 ;;
16993esac
16994
16995: see if prototype for setresgid is available
16996echo " "
16997set d_sresgproto setresgid $i_unistd unistd.h
16998eval $hasproto
16999
17000: see if prototype for setresuid is available
17001echo " "
17002set d_sresuproto setresuid $i_unistd unistd.h
17003eval $hasproto
17004
17005: see if sys/stat.h is available
17006set sys/stat.h i_sysstat
17007eval $inhdr
17008
17009
17010: see if stat knows about block sizes
17011echo " "
17012echo "Checking to see if your struct stat has st_blocks field..." >&4
17013set d_statblks stat st_blocks $i_sysstat sys/stat.h
17014eval $hasfield
17015
17016
17017: see if this is a sys/vfs.h system
17018set sys/vfs.h i_sysvfs
17019eval $inhdr
17020
17021
17022: see if this is a sys/statfs.h system
17023set sys/statfs.h i_sysstatfs
17024eval $inhdr
17025
17026
17027echo " "
17028echo "Checking to see if your system supports struct statfs..." >&4
17029set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
17030eval $hasstruct
17031case "$d_statfs_s" in
17032"$define") echo "Yes, it does." ;;
17033*) echo "No, it doesn't." ;;
17034esac
17035
17036
17037
17038: see if struct statfs knows about f_flags
17039case "$d_statfs_s" in
17040define)
17041 echo " "
17042 echo "Checking to see if your struct statfs has f_flags field..." >&4
17043 set d_statfs_f_flags statfs f_flags $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
17044 eval $hasfield
17045 ;;
17046*) val="$undef"
17047 set d_statfs_f_flags
17048 eval $setvar
17049 ;;
17050esac
17051case "$d_statfs_f_flags" in
17052"$define") echo "Yes, it does." ;;
17053*) echo "No, it doesn't." ;;
17054esac
17055
17056$cat >&4 <<EOM
17057Checking how to access stdio streams by file descriptor number...
17058EOM
17059case "$stdio_stream_array" in
17060'') $cat >try.c <<EOCP
17061#include <stdio.h>
17062int main() {
17063 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
17064 printf("yes\n");
17065}
17066EOCP
17067 for s in _iob __iob __sF
17068 do
17069 set try -DSTDIO_STREAM_ARRAY=$s
17070 if eval $compile; then
17071 case "`$run ./try`" in
17072 yes) stdio_stream_array=$s; break ;;
17073 esac
17074 fi
17075 done
17076 $rm -f try.* try$exe_ext
17077esac
17078case "$stdio_stream_array" in
17079'') $cat >&4 <<EOM
17080I can't figure out how to access stdio streams by file descriptor number.
17081EOM
17082 d_stdio_stream_array="$undef"
17083 ;;
17084*) $cat >&4 <<EOM
17085You can access stdio streams by file descriptor number by the $stdio_stream_array array.
17086EOM
17087 d_stdio_stream_array="$define"
17088 ;;
17089esac
17090
17091: see if strcoll exists
17092set strcoll d_strcoll
17093eval $inlibc
17094
17095: check for structure copying
17096echo " "
17097echo "Checking to see if your C compiler can copy structs..." >&4
17098$cat >try.c <<'EOCP'
17099int main()
17100{
17101 struct blurfl {
17102 int dyick;
17103 } foo, bar;
17104
17105 foo = bar;
17106}
17107EOCP
17108if $cc -c try.c >/dev/null 2>&1 ; then
17109 val="$define"
17110 echo "Yup, it can."
17111else
17112 val="$undef"
17113 echo "Nope, it can't."
17114fi
17115set d_strctcpy
17116eval $setvar
17117$rm -f try.*
17118
17119: see if strerror and/or sys_errlist[] exist
17120echo " "
17121if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
17122 if set strerror val -f d_strerror; eval $csym; $val; then
17123 echo 'strerror() found.' >&4
17124 d_strerror="$define"
17125 d_strerrm='strerror(e)'
17126 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17127 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
17128 d_syserrlst="$define"
17129 else
17130 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
17131 d_syserrlst="$undef"
17132 fi
17133 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
17134 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
17135 echo 'strerror() found in string header.' >&4
17136 d_strerror="$define"
17137 d_strerrm='strerror(e)'
17138 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17139 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
17140 d_syserrlst="$define"
17141 else
17142 echo "(You don't appear to have any sys_errlist[], how can this be?)"
17143 d_syserrlst="$undef"
17144 fi
17145 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
17146 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
17147 d_strerror="$undef"
17148 d_syserrlst="$define"
17149 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
17150 else
17151 echo 'strerror() and sys_errlist[] NOT found.' >&4
17152 d_strerror="$undef"
17153 d_syserrlst="$undef"
17154 d_strerrm='"unknown"'
17155 fi
17156fi
17157
17158: see if strerror_r exists
17159set strerror_r d_strerror_r
17160eval $inlibc
17161case "$d_strerror_r" in
17162"$define")
17163 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
17164 case "$d_strerror_r_proto:$usethreads" in
17165 ":define") d_strerror_r_proto=define
17166 set d_strerror_r_proto strerror_r $hdrs
17167 eval $hasproto ;;
17168 *) ;;
17169 esac
17170 case "$d_strerror_r_proto" in
17171 define)
17172 case "$strerror_r_proto" in
17173 ''|0) try='int strerror_r(int, char*, size_t);'
17174 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
17175 esac
17176 case "$strerror_r_proto" in
17177 ''|0) try='int strerror_r(int, char*, int);'
17178 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
17179 esac
17180 case "$strerror_r_proto" in
17181 ''|0) try='char* strerror_r(int, char*, size_t);'
17182 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
17183 esac
17184 case "$strerror_r_proto" in
17185 ''|0) d_strerror_r=undef
17186 strerror_r_proto=0
17187 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
17188 * ) case "$strerror_r_proto" in
17189 REENTRANT_PROTO*) ;;
17190 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
17191 esac
17192 echo "Prototype: $try" ;;
17193 esac
17194 ;;
17195 *) case "$usethreads" in
17196 define) echo "strerror_r has no prototype, not using it." >&4 ;;
17197 esac
17198 d_strerror_r=undef
17199 strerror_r_proto=0
17200 ;;
17201 esac
17202 ;;
17203*) strerror_r_proto=0
17204 ;;
17205esac
17206
17207: see if strftime exists
17208set strftime d_strftime
17209eval $inlibc
17210
17211: see if strlcat exists
17212set strlcat d_strlcat
17213eval $inlibc
17214
17215: see if strlcpy exists
17216set strlcpy d_strlcpy
17217eval $inlibc
17218
17219: see if strtod exists
17220set strtod d_strtod
17221eval $inlibc
17222
17223: see if strtol exists
17224set strtol d_strtol
17225eval $inlibc
17226
17227: see if strtold exists
17228set strtold d_strtold
17229eval $inlibc
17230
17231: see if strtoll exists
17232set strtoll d_strtoll
17233eval $inlibc
17234
17235case "$d_longlong-$d_strtoll" in
17236"$define-$define")
17237 $cat <<EOM
17238Checking whether your strtoll() works okay...
17239EOM
17240 $cat >try.c <<'EOCP'
17241#include <errno.h>
17242#ifdef __hpux
17243#define strtoll __strtoll
17244#endif
17245#ifdef __EMX__
17246#define strtoll _strtoll
17247#endif
17248#include <stdio.h>
17249extern long long int strtoll(char *s, char **, int);
17250static int bad = 0;
17251int check(char *s, long long ell, int een) {
17252 long long gll;
17253 errno = 0;
17254 gll = strtoll(s, 0, 10);
17255 if (!((gll == ell) && (errno == een)))
17256 bad++;
17257}
17258int main() {
17259 check(" 1", 1LL, 0);
17260 check(" 0", 0LL, 0);
17261 check("-1", -1LL, 0);
17262 check("-9223372036854775808", -9223372036854775808LL, 0);
17263 check("-9223372036854775808", -9223372036854775808LL, 0);
17264 check(" 9223372036854775807", 9223372036854775807LL, 0);
17265 check("-9223372036854775808", -9223372036854775808LL, 0);
17266 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
17267 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
17268 if (!bad)
17269 printf("ok\n");
17270}
17271EOCP
17272 set try
17273 if eval $compile; then
17274 yyy=`$run ./try`
17275 case "$yyy" in
17276 ok) echo "Your strtoll() seems to be working okay." ;;
17277 *) cat <<EOM >&4
17278Your strtoll() doesn't seem to be working okay.
17279EOM
17280 d_strtoll="$undef"
17281 ;;
17282 esac
17283 else
17284 echo "(I can't seem to compile the test program--assuming it doesn't)"
17285 d_strtoll="$undef"
17286 fi
17287 ;;
17288esac
17289
17290: see if strtoq exists
17291set strtoq d_strtoq
17292eval $inlibc
17293
17294: see if strtoul exists
17295set strtoul d_strtoul
17296eval $inlibc
17297
17298case "$d_strtoul" in
17299"$define")
17300 $cat <<EOM
17301Checking whether your strtoul() works okay...
17302EOM
17303 $cat >try.c <<'EOCP'
17304#include <errno.h>
17305#include <stdio.h>
17306extern unsigned long int strtoul(char *s, char **, int);
17307static int bad = 0;
17308void check(char *s, unsigned long eul, int een) {
17309 unsigned long gul;
17310 errno = 0;
17311 gul = strtoul(s, 0, 10);
17312 if (!((gul == eul) && (errno == een)))
17313 bad++;
17314}
17315int main() {
17316 check(" 1", 1L, 0);
17317 check(" 0", 0L, 0);
17318EOCP
17319 case "$longsize" in
17320 8)
17321 $cat >>try.c <<'EOCP'
17322 check("18446744073709551615", 18446744073709551615UL, 0);
17323 check("18446744073709551616", 18446744073709551615UL, ERANGE);
17324#if 0 /* strtoul() for /^-/ strings is undefined. */
17325 check("-1", 18446744073709551615UL, 0);
17326 check("-18446744073709551614", 2, 0);
17327 check("-18446744073709551615", 1, 0);
17328 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
17329 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
17330#endif
17331EOCP
17332 ;;
17333 4)
17334 $cat >>try.c <<'EOCP'
17335 check("4294967295", 4294967295UL, 0);
17336 check("4294967296", 4294967295UL, ERANGE);
17337#if 0 /* strtoul() for /^-/ strings is undefined. */
17338 check("-1", 4294967295UL, 0);
17339 check("-4294967294", 2, 0);
17340 check("-4294967295", 1, 0);
17341 check("-4294967296", 4294967295UL, ERANGE);
17342 check("-4294967297", 4294967295UL, ERANGE);
17343#endif
17344EOCP
17345 ;;
17346 *)
17347: Should we write these tests to be more portable by sprintf-ing
17348: ~0 and then manipulating that char string as input for strtol?
17349 ;;
17350 esac
17351 $cat >>try.c <<'EOCP'
17352 if (!bad)
17353 printf("ok\n");
17354 return 0;
17355}
17356EOCP
17357 set try
17358 if eval $compile; then
17359 case "`$run ./try`" in
17360 ok) echo "Your strtoul() seems to be working okay." ;;
17361 *) cat <<EOM >&4
17362Your strtoul() doesn't seem to be working okay.
17363EOM
17364 d_strtoul="$undef"
17365 ;;
17366 esac
17367 fi
17368 ;;
17369esac
17370
17371: see if strtoull exists
17372set strtoull d_strtoull
17373eval $inlibc
17374
17375case "$d_longlong-$d_strtoull" in
17376"$define-$define")
17377 $cat <<EOM
17378Checking whether your strtoull() works okay...
17379EOM
17380 $cat >try.c <<'EOCP'
17381#include <errno.h>
17382#ifdef __hpux
17383#define strtoull __strtoull
17384#endif
17385#include <stdio.h>
17386extern unsigned long long int strtoull(char *s, char **, int);
17387static int bad = 0;
17388int check(char *s, long long eull, int een) {
17389 long long gull;
17390 errno = 0;
17391 gull = strtoull(s, 0, 10);
17392 if (!((gull == eull) && (errno == een)))
17393 bad++;
17394}
17395int main() {
17396 check(" 1", 1LL, 0);
17397 check(" 0", 0LL, 0);
17398 check("18446744073709551615", 18446744073709551615ULL, 0);
17399 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17400#if 0 /* strtoull() for /^-/ strings is undefined. */
17401 check("-1", 18446744073709551615ULL, 0);
17402 check("-18446744073709551614", 2LL, 0);
17403 check("-18446744073709551615", 1LL, 0);
17404 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17405 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17406#endif
17407 if (!bad)
17408 printf("ok\n");
17409}
17410EOCP
17411 set try
17412 if eval $compile; then
17413 case "`$run ./try`" in
17414 ok) echo "Your strtoull() seems to be working okay." ;;
17415 *) cat <<EOM >&4
17416Your strtoull() doesn't seem to be working okay.
17417EOM
17418 d_strtoull="$undef"
17419 ;;
17420 esac
17421 fi
17422 ;;
17423esac
17424
17425: see if strtouq exists
17426set strtouq d_strtouq
17427eval $inlibc
17428
17429case "$d_strtouq" in
17430"$define")
17431 $cat <<EOM
17432Checking whether your strtouq() works okay...
17433EOM
17434 $cat >try.c <<'EOCP'
17435#include <errno.h>
17436#include <stdio.h>
17437extern unsigned long long int strtouq(char *s, char **, int);
17438static int bad = 0;
17439void check(char *s, unsigned long long eull, int een) {
17440 unsigned long long gull;
17441 errno = 0;
17442 gull = strtouq(s, 0, 10);
17443 if (!((gull == eull) && (errno == een)))
17444 bad++;
17445}
17446int main() {
17447 check(" 1", 1LL, 0);
17448 check(" 0", 0LL, 0);
17449 check("18446744073709551615", 18446744073709551615ULL, 0);
17450 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
17451#if 0 /* strtouq() for /^-/ strings is undefined. */
17452 check("-1", 18446744073709551615ULL, 0);
17453 check("-18446744073709551614", 2LL, 0);
17454 check("-18446744073709551615", 1LL, 0);
17455 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
17456 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
17457#endif
17458 if (!bad)
17459 printf("ok\n");
17460 return 0;
17461}
17462EOCP
17463 set try
17464 if eval $compile; then
17465 case "`$run ./try`" in
17466 ok) echo "Your strtouq() seems to be working okay." ;;
17467 *) cat <<EOM >&4
17468Your strtouq() doesn't seem to be working okay.
17469EOM
17470 d_strtouq="$undef"
17471 ;;
17472 esac
17473 fi
17474 ;;
17475esac
17476
17477: see if strxfrm exists
17478set strxfrm d_strxfrm
17479eval $inlibc
17480
17481: see if symlink exists
17482set symlink d_symlink
17483eval $inlibc
17484
17485: see if syscall exists
17486set syscall d_syscall
17487eval $inlibc
17488
17489: see if prototype for syscall is available
17490echo " "
17491set d_syscallproto syscall $i_unistd unistd.h
17492eval $hasproto
17493
17494: see if sysconf exists
17495set sysconf d_sysconf
17496eval $inlibc
17497
17498: see if system exists
17499set system d_system
17500eval $inlibc
17501
17502: see if tcgetpgrp exists
17503set tcgetpgrp d_tcgetpgrp
17504eval $inlibc
17505
17506: see if tcsetpgrp exists
17507set tcsetpgrp d_tcsetpgrp
17508eval $inlibc
17509
17510: see if prototype for telldir is available
17511echo " "
17512set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
17513eval $hasproto
17514
17515: see if time exists
17516echo " "
17517if test "X$d_time" = X -o X"$timetype" = X; then
17518 if set time val -f d_time; eval $csym; $val; then
17519 echo 'time() found.' >&4
17520 val="$define"
17521 rp="What is the type returned by time() on this system?"
17522 set time_t timetype long stdio.h sys/types.h
17523 eval $typedef_ask
17524 else
17525 echo 'time() not found, hope that will do.' >&4
17526 val="$undef"
17527 timetype='int';
17528 fi
17529 set d_time
17530 eval $setvar
17531fi
17532
17533: see if this is a sys/times.h system
17534set sys/times.h i_systimes
17535eval $inhdr
17536
17537: see if times exists
17538echo " "
17539if set times val -f d_times; eval $csym; $val; then
17540 echo 'times() found.' >&4
17541 d_times="$define"
17542 inc=''
17543 case "$i_systimes" in
17544 "$define") inc='sys/times.h';;
17545 esac
17546 rp="What is the type returned by times() on this system?"
17547 set clock_t clocktype long stdio.h sys/types.h $inc
17548 eval $typedef_ask
17549else
17550 echo 'times() NOT found, hope that will do.' >&4
17551 d_times="$undef"
17552 clocktype='int'
17553fi
17554
17555: see if tmpnam_r exists
17556set tmpnam_r d_tmpnam_r
17557eval $inlibc
17558case "$d_tmpnam_r" in
17559"$define")
17560 hdrs="$i_systypes sys/types.h define stdio.h "
17561 case "$d_tmpnam_r_proto:$usethreads" in
17562 ":define") d_tmpnam_r_proto=define
17563 set d_tmpnam_r_proto tmpnam_r $hdrs
17564 eval $hasproto ;;
17565 *) ;;
17566 esac
17567 case "$d_tmpnam_r_proto" in
17568 define)
17569 case "$tmpnam_r_proto" in
17570 ''|0) try='char* tmpnam_r(char*);'
17571 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
17572 esac
17573 case "$tmpnam_r_proto" in
17574 ''|0) d_tmpnam_r=undef
17575 tmpnam_r_proto=0
17576 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
17577 * ) case "$tmpnam_r_proto" in
17578 REENTRANT_PROTO*) ;;
17579 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
17580 esac
17581 echo "Prototype: $try" ;;
17582 esac
17583 ;;
17584 *) case "$usethreads" in
17585 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
17586 esac
17587 d_tmpnam_r=undef
17588 tmpnam_r_proto=0
17589 ;;
17590 esac
17591 ;;
17592*) tmpnam_r_proto=0
17593 ;;
17594esac
17595
17596: see if truncate exists
17597set truncate d_truncate
17598eval $inlibc
17599
17600: see if ttyname_r exists
17601set ttyname_r d_ttyname_r
17602eval $inlibc
17603case "$d_ttyname_r" in
17604"$define")
17605 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
17606 case "$d_ttyname_r_proto:$usethreads" in
17607 ":define") d_ttyname_r_proto=define
17608 set d_ttyname_r_proto ttyname_r $hdrs
17609 eval $hasproto ;;
17610 *) ;;
17611 esac
17612 case "$d_ttyname_r_proto" in
17613 define)
17614 case "$ttyname_r_proto" in
17615 ''|0) try='int ttyname_r(int, char*, size_t);'
17616 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
17617 esac
17618 case "$ttyname_r_proto" in
17619 ''|0) try='int ttyname_r(int, char*, int);'
17620 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
17621 esac
17622 case "$ttyname_r_proto" in
17623 ''|0) try='char* ttyname_r(int, char*, int);'
17624 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
17625 esac
17626 case "$ttyname_r_proto" in
17627 ''|0) d_ttyname_r=undef
17628 ttyname_r_proto=0
17629 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
17630 * ) case "$ttyname_r_proto" in
17631 REENTRANT_PROTO*) ;;
17632 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
17633 esac
17634 echo "Prototype: $try" ;;
17635 esac
17636 ;;
17637 *) case "$usethreads" in
17638 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
17639 esac
17640 d_ttyname_r=undef
17641 ttyname_r_proto=0
17642 ;;
17643 esac
17644 ;;
17645*) ttyname_r_proto=0
17646 ;;
17647esac
17648
17649: see if tzname[] exists
17650echo " "
17651if set tzname val -a d_tzname; eval $csym; $val; then
17652 val="$define"
17653 echo 'tzname[] found.' >&4
17654else
17655 val="$undef"
17656 echo 'tzname[] NOT found.' >&4
17657fi
17658set d_tzname
17659eval $setvar
17660
17661case "$osname" in
17662next|rhapsody|darwin) multiarch="$define" ;;
17663esac
17664case "$multiarch" in
17665''|[nN]*) multiarch="$undef" ;;
17666esac
17667
17668: check for ordering of bytes in a UV
17669echo " "
17670case "$usecrosscompile$multiarch" in
17671*$define*)
17672 $cat <<EOM
17673You seem to be either cross-compiling or doing a multiarchitecture build,
17674skipping the byteorder check.
17675
17676EOM
17677 byteorder='ffff'
17678 ;;
17679*)
17680 case "$byteorder" in
17681 '')
17682 $cat <<'EOM'
17683In the following, larger digits indicate more significance. A big-endian
17684machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
17685little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
17686machines may have weird orders like 3412. A Cray will report 87654321,
17687an Alpha will report 12345678. If the test program works the default is
17688probably right.
17689I'm now running the test program...
17690EOM
17691 $cat >try.c <<EOCP
17692#include <stdio.h>
17693#$i_stdlib I_STDLIB
17694#ifdef I_STDLIB
17695#include <stdlib.h>
17696#endif
17697#include <sys/types.h>
17698typedef $uvtype UV;
17699int main()
17700{
17701 int i;
17702 union {
17703 UV l;
17704 char c[$uvsize];
17705 } u;
17706
17707 if ($uvsize > 4)
17708 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
17709 else
17710 u.l = (UV)0x04030201;
17711 for (i = 0; i < $uvsize; i++)
17712 printf("%c", u.c[i]+'0');
17713 printf("\n");
17714 exit(0);
17715}
17716EOCP
17717 xxx_prompt=y
17718 set try
17719 if eval $compile && ./try > /dev/null; then
17720 dflt=`$run ./try`
17721 case "$dflt" in
17722 [1-4][1-4][1-4][1-4]|12345678|87654321)
17723 echo "(The test program ran ok.)"
17724 echo "byteorder=$dflt"
17725 xxx_prompt=n
17726 ;;
17727 ????|????????) echo "(The test program ran ok.)" ;;
17728 *) echo "(The test program didn't run right for some reason.)" ;;
17729 esac
17730 else
17731 dflt='4321'
17732 cat <<'EOM'
17733(I can't seem to compile the test program. Guessing big-endian...)
17734EOM
17735 fi
17736 case "$xxx_prompt" in
17737 y)
17738 rp="What is the order of bytes in $uvtype?"
17739 . ./myread
17740 byteorder="$ans"
17741 ;;
17742 *) byteorder=$dflt
17743 ;;
17744 esac
17745 ;;
17746 esac
17747 $rm -f try.c try
17748 ;;
17749esac
17750
17751
17752$cat <<EOM
17753
17754Checking to see whether you can access character data unalignedly...
17755EOM
17756case "$d_u32align" in
17757'') $cat >try.c <<EOCP
17758#include <stdio.h>
17759#$i_stdlib I_STDLIB
17760#ifdef I_STDLIB
17761#include <stdlib.h>
17762#endif
17763#define U32 $u32type
17764#define BYTEORDER 0x$byteorder
17765#define U8 $u8type
17766#include <signal.h>
17767#ifdef SIGBUS
17768$signal_t bletch(int s) { exit(4); }
17769#endif
17770int main() {
17771#if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17772 U8 buf[8];
17773 U32 *up;
17774 int i;
17775
17776 if (sizeof(U32) != 4) {
17777 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17778 exit(1);
17779 }
17780
17781 fflush(stdout);
17782
17783#ifdef SIGBUS
17784 signal(SIGBUS, bletch);
17785#endif
17786
17787 buf[0] = 0;
17788 buf[1] = 0;
17789 buf[2] = 0;
17790 buf[3] = 1;
17791 buf[4] = 0;
17792 buf[5] = 0;
17793 buf[6] = 0;
17794 buf[7] = 1;
17795
17796 for (i = 0; i < 4; i++) {
17797 up = (U32*)(buf + i);
17798 if (! ((*up == 1 << (8*i)) || /* big-endian */
17799 (*up == 1 << (8*(3-i))) /* little-endian */
17800 )
17801 )
17802 {
17803 printf("read failed (%x)\n", *up);
17804 exit(2);
17805 }
17806 }
17807
17808 /* write test */
17809 for (i = 0; i < 4; i++) {
17810 up = (U32*)(buf + i);
17811 *up = 0xBeef;
17812 if (*up != 0xBeef) {
17813 printf("write failed (%x)\n", *up);
17814 exit(3);
17815 }
17816 }
17817
17818 exit(0);
17819#else
17820 printf("1\n");
17821 exit(1);
17822#endif
17823 return 0;
17824}
17825EOCP
17826set try
17827if eval $compile_ok; then
17828 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17829 $run ./try 2>&1 >/dev/null
17830 case "$?" in
17831 0) cat >&4 <<EOM
17832You can access character data pretty unalignedly.
17833EOM
17834 d_u32align="$undef"
17835 ;;
17836 *) cat >&4 <<EOM
17837It seems that you must access character data in an aligned manner.
17838EOM
17839 d_u32align="$define"
17840 ;;
17841 esac
17842else
17843 rp='Can you access character data at unaligned addresses?'
17844 dflt='n'
17845 . ./myread
17846 case "$ans" in
17847 [yY]*) d_u32align="$undef" ;;
17848 *) d_u32align="$define" ;;
17849 esac
17850fi
17851$rm -f core core.try.* try.core
17852;;
17853esac
17854
17855: see if ualarm exists
17856set ualarm d_ualarm
17857eval $inlibc
17858
17859: see if umask exists
17860set umask d_umask
17861eval $inlibc
17862
17863: see if unordered exists
17864set unordered d_unordered
17865eval $inlibc
17866
17867: see if unsetenv exists
17868set unsetenv d_unsetenv
17869eval $inlibc
17870
17871: see if usleep exists
17872set usleep d_usleep
17873eval $inlibc
17874
17875: see if prototype for usleep is available
17876echo " "
17877set d_usleepproto usleep $i_unistd unistd.h
17878eval $hasproto
17879
17880: see if ustat exists
17881set ustat d_ustat
17882eval $inlibc
17883
17884: backward compatibility for d_hvfork
17885if test X$d_hvfork != X; then
17886 d_vfork="$d_hvfork"
17887 d_hvfork=''
17888fi
17889: see if there is a vfork
17890val=''
17891set vfork val
17892eval $inlibc
17893
17894: Ok, but do we want to use it. vfork is reportedly unreliable in
17895: perl on Solaris 2.x, and probably elsewhere.
17896case "$val" in
17897$define)
17898 echo " "
17899 case "$usevfork" in
17900 false) dflt='n';;
17901 *) dflt='y';;
17902 esac
17903 cat <<'EOM'
17904
17905Perl can only use a vfork() that doesn't suffer from strict
17906restrictions on calling functions or modifying global data in
17907the child. For example, glibc-2.1 contains such a vfork()
17908that is unsuitable. If your system provides a proper fork()
17909call, chances are that you do NOT want perl to use vfork().
17910
17911EOM
17912 rp="Do you still want to use vfork()?"
17913 . ./myread
17914 case "$ans" in
17915 y|Y) ;;
17916 *)
17917 echo "Ok, we won't use vfork()."
17918 val="$undef"
17919 ;;
17920 esac
17921 ;;
17922esac
17923set d_vfork
17924eval $setvar
17925case "$d_vfork" in
17926$define) usevfork='true';;
17927*) usevfork='false';;
17928esac
17929
17930: see if closedir exists
17931set closedir d_closedir
17932eval $inlibc
17933
17934case "$d_closedir" in
17935"$define")
17936 echo " "
17937 echo "Checking whether closedir() returns a status..." >&4
17938 cat > try.c <<EOM
17939#$i_dirent I_DIRENT /**/
17940#$i_sysdir I_SYS_DIR /**/
17941#$i_sysndir I_SYS_NDIR /**/
17942#$i_systypes I_SYS_TYPES /**/
17943
17944#if defined(I_SYS_TYPES)
17945#include <sys/types.h>
17946#endif
17947#if defined(I_DIRENT)
17948#include <dirent.h>
17949#if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17950#include <sys/dir.h>
17951#endif
17952#else
17953#ifdef I_SYS_NDIR
17954#include <sys/ndir.h>
17955#else
17956#ifdef I_SYS_DIR
17957#ifdef hp9000s500
17958#include <ndir.h> /* may be wrong in the future */
17959#else
17960#include <sys/dir.h>
17961#endif
17962#endif
17963#endif
17964#endif
17965int main() { return closedir(opendir(".")); }
17966EOM
17967 set try
17968 if eval $compile_ok; then
17969 if $run ./try > /dev/null 2>&1 ; then
17970 echo "Yes, it does."
17971 val="$undef"
17972 else
17973 echo "No, it doesn't."
17974 val="$define"
17975 fi
17976 else
17977 echo "(I can't seem to compile the test program--assuming it doesn't)"
17978 val="$define"
17979 fi
17980 ;;
17981*)
17982 val="$undef";
17983 ;;
17984esac
17985set d_void_closedir
17986eval $setvar
17987$rm -f try try.*
17988: see if there is a wait4
17989set wait4 d_wait4
17990eval $inlibc
17991
17992: see if waitpid exists
17993set waitpid d_waitpid
17994eval $inlibc
17995
17996: see if wcstombs exists
17997set wcstombs d_wcstombs
17998eval $inlibc
17999
18000: see if wctomb exists
18001set wctomb d_wctomb
18002eval $inlibc
18003
18004: see if writev exists
18005set writev d_writev
18006eval $inlibc
18007
18008: preserve RCS keywords in files with variable substitution, grrr
18009Date='$Date'
18010Id='$Id'
18011Log='$Log'
18012RCSfile='$RCSfile'
18013Revision='$Revision'
18014
18015: check for alignment requirements
18016echo " "
18017case "$usecrosscompile$multiarch" in
18018*$define*)
18019 $cat <<EOM
18020You seem to be either cross-compiling or doing a multiarchitecture build,
18021skipping the memory alignment check.
18022
18023EOM
18024 case "$alignbytes" in
18025 '') alignbytes=8 ;;
18026 esac
18027 ;;
18028*)
18029 case "$alignbytes" in
18030 '') echo "Checking alignment constraints..." >&4
18031 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
18032 $cat >try.c <<'EOCP'
18033typedef long double NV;
18034EOCP
18035 else
18036 $cat >try.c <<'EOCP'
18037typedef double NV;
18038EOCP
18039 fi
18040 $cat >>try.c <<'EOCP'
18041#include <stdio.h>
18042struct foobar {
18043 char foo;
18044 NV bar;
18045} try_algn;
18046int main()
18047{
18048 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
18049 return(0);
18050}
18051EOCP
18052 set try
18053 if eval $compile_ok; then
18054 dflt=`$run ./try`
18055 else
18056 dflt='8'
18057 echo "(I can't seem to compile the test program...)"
18058 fi
18059 ;;
18060 *) dflt="$alignbytes"
18061 ;;
18062 esac
18063 rp="Doubles must be aligned on a how-many-byte boundary?"
18064 . ./myread
18065 alignbytes="$ans"
18066 $rm -f try.c try
18067 ;;
18068esac
18069
18070
18071: set the base revision
18072baserev=5.0
18073
18074: how do we concatenate cpp tokens here?
18075echo " "
18076echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
18077$cat >cpp_stuff.c <<'EOCP'
18078#define RCAT(a,b)a/**/b
18079#define ACAT(a,b)a ## b
18080RCAT(Rei,ser)
18081ACAT(Cir,cus)
18082EOCP
18083$cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
18084if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
18085 echo "Oh! Smells like ANSI's been here." >&4
18086 echo "We can catify or stringify, separately or together!"
18087 cpp_stuff=42
18088elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
18089 echo "Ah, yes! The good old days!" >&4
18090 echo "However, in the good old days we don't know how to stringify and"
18091 echo "catify at the same time."
18092 cpp_stuff=1
18093else
18094 $cat >&4 <<EOM
18095Hmm, I don't seem to be able to concatenate tokens with your cpp.
18096You're going to have to edit the values of CAT[2-5] in config.h...
18097EOM
18098 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
18099fi
18100$rm -f cpp_stuff.*
18101
18102: see if this is a db.h system
18103set db.h i_db
18104eval $inhdr
18105
18106case "$i_db" in
18107$define)
18108 : Check db version.
18109 echo " "
18110 echo "Checking Berkeley DB version ..." >&4
18111 $cat >try.c <<EOCP
18112#$d_const HASCONST
18113#ifndef HASCONST
18114#define const
18115#endif
18116#include <sys/types.h>
18117#include <stdio.h>
18118#$i_stdlib I_STDLIB
18119#ifdef I_STDLIB
18120#include <stdlib.h>
18121#endif
18122#include <db.h>
18123int main(int argc, char *argv[])
18124{
18125#ifdef DB_VERSION_MAJOR /* DB version >= 2 */
18126 int Major, Minor, Patch ;
18127 unsigned long Version ;
18128 (void)db_version(&Major, &Minor, &Patch) ;
18129 if (argc == 2) {
18130 printf("%d %d %d %d %d %d\n",
18131 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
18132 Major, Minor, Patch);
18133 exit(0);
18134 }
18135 printf("You have Berkeley DB Version 2 or greater.\n");
18136
18137 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
18138 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
18139 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
18140 Major, Minor, Patch) ;
18141
18142 /* check that db.h & libdb are compatible */
18143 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
18144 printf("db.h and libdb are incompatible.\n") ;
18145 exit(3);
18146 }
18147
18148 printf("db.h and libdb are compatible.\n") ;
18149
18150 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
18151 + DB_VERSION_PATCH ;
18152
18153 /* needs to be >= 2.3.4 */
18154 if (Version < 2003004) {
18155 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
18156 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
18157 exit(2);
18158 }
18159
18160 exit(0);
18161#else
18162#if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
18163 if (argc == 2) {
18164 printf("1 0 0\n");
18165 exit(0);
18166 }
18167 printf("You have Berkeley DB Version 1.\n");
18168 exit(0); /* DB version < 2: the coast is clear. */
18169#else
18170 exit(1); /* <db.h> not Berkeley DB? */
18171#endif
18172#endif
18173}
18174EOCP
18175 set try
18176 if eval $compile_ok && $run ./try; then
18177 echo 'Looks OK.' >&4
18178 set `$run ./try 1`
18179 db_version_major=$1
18180 db_version_minor=$2
18181 db_version_patch=$3
18182 else
18183 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
18184 i_db=$undef
18185 case " $libs " in
18186 *"-ldb "*)
18187 : Remove db from list of libraries to use
18188 echo "Removing unusable -ldb from library list" >&4
18189 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
18190 shift
18191 libs="$*"
18192 echo "libs = $libs" >&4
18193 ;;
18194 esac
18195 fi
18196 $rm -f try.*
18197 ;;
18198esac
18199
18200case "$i_db" in
18201define)
18202 : Check the return type needed for hash
18203 echo " "
18204 echo "Checking return type needed for hash for Berkeley DB ..." >&4
18205 $cat >try.c <<EOCP
18206#$d_const HASCONST
18207#ifndef HASCONST
18208#define const
18209#endif
18210#include <sys/types.h>
18211#include <db.h>
18212
18213#ifndef DB_VERSION_MAJOR
18214u_int32_t hash_cb (ptr, size)
18215const void *ptr;
18216size_t size;
18217{
18218}
18219HASHINFO info;
18220int main()
18221{
18222 info.hash = hash_cb;
18223}
18224#endif
18225EOCP
18226 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18227 if $contains warning try.out >>/dev/null 2>&1 ; then
18228 db_hashtype='int'
18229 else
18230 db_hashtype='u_int32_t'
18231 fi
18232 else
18233 : XXX Maybe we should just give up here.
18234 db_hashtype=u_int32_t
18235 $cat try.out >&4
18236 echo "Help: I can't seem to compile the db test program." >&4
18237 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
18238 fi
18239 $rm -f try.*
18240 echo "Your version of Berkeley DB uses $db_hashtype for hash."
18241 ;;
18242*) db_hashtype=u_int32_t
18243 ;;
18244esac
18245case "$i_db" in
18246define)
18247 : Check the return type needed for prefix
18248 echo " "
18249 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
18250 cat >try.c <<EOCP
18251#$d_const HASCONST
18252#ifndef HASCONST
18253#define const
18254#endif
18255#include <sys/types.h>
18256#include <db.h>
18257
18258#ifndef DB_VERSION_MAJOR
18259size_t prefix_cb (key1, key2)
18260const DBT *key1;
18261const DBT *key2;
18262{
18263}
18264BTREEINFO info;
18265int main()
18266{
18267 info.prefix = prefix_cb;
18268}
18269#endif
18270EOCP
18271 if $cc $ccflags -c try.c >try.out 2>&1 ; then
18272 if $contains warning try.out >>/dev/null 2>&1 ; then
18273 db_prefixtype='int'
18274 else
18275 db_prefixtype='size_t'
18276 fi
18277 else
18278 db_prefixtype='size_t'
18279 : XXX Maybe we should just give up here.
18280 $cat try.out >&4
18281 echo "Help: I can't seem to compile the db test program." >&4
18282 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
18283 fi
18284 $rm -f try.*
18285 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
18286 ;;
18287*) db_prefixtype='size_t'
18288 ;;
18289esac
18290
18291
18292: How can we generate normalized random numbers ?
18293echo " "
18294echo "Looking for a random number function..." >&4
18295case "$randfunc" in
18296'')
18297 if set drand48 val -f; eval $csym; $val; then
18298 dflt="drand48"
18299 echo "Good, found drand48()." >&4
18300 elif set random val -f; eval $csym; $val; then
18301 dflt="random"
18302 echo "OK, found random()." >&4
18303 else
18304 dflt="rand"
18305 echo "Yick, looks like I have to use rand()." >&4
18306 fi
18307 echo " "
18308 ;;
18309*)
18310 dflt="$randfunc"
18311 ;;
18312esac
18313cont=true
18314
18315case "$ccflags" in
18316*-Dmy_rand=*|*-Dmy_srand=*)
18317 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
18318 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
18319 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
18320 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
18321 ;;
18322esac
18323
18324while $test "$cont"; do
18325 rp="Use which function to generate random numbers?"
18326 . ./myread
18327 if $test "$ans" = "$dflt"; then
18328 : null
18329 else
18330 randbits=''
18331 fi
18332 randfunc="$ans"
18333 if set $ans val -f; eval $csym; $val; then
18334 cont=''
18335 else
18336 dflt=y
18337 rp="I cannot find function $ans. Use that name anyway?"
18338 . ./myread
18339 dflt=rand
18340 case "$ans" in
18341 [yY]*) cont='';;
18342 esac
18343 fi
18344 case "$cont" in
18345 '')
18346 case "$randfunc" in
18347 drand48)
18348 drand01="drand48()"
18349 seedfunc="srand48"
18350 randbits=48
18351 randseedtype=long
18352 ;;
18353 rand|random)
18354 case "$randbits" in
18355 '')
18356echo "Checking to see how many bits your $randfunc() function produces..." >&4
18357 $cat >try.c <<EOCP
18358#$i_unistd I_UNISTD
18359#$i_stdlib I_STDLIB
18360#include <stdio.h>
18361#ifdef I_UNISTD
18362# include <unistd.h>
18363#endif
18364#ifdef I_STDLIB
18365# include <stdlib.h>
18366#endif
18367int main()
18368{
18369 register int i;
18370 register unsigned long tmp;
18371 register unsigned long max = 0L;
18372
18373 for (i = 1000; i; i--) {
18374 tmp = (unsigned long) $randfunc();
18375 if (tmp > max) max = tmp;
18376 }
18377 for (i = 0; max; i++)
18378 max /= 2;
18379 printf("%d\n",i);
18380}
18381EOCP
18382 set try
18383 if eval $compile_ok; then
18384 dflt=`try`
18385 else
18386 dflt='?'
18387 echo "(I can't seem to compile the test program...)"
18388 fi
18389 ;;
18390 *)
18391 dflt="$randbits"
18392 ;;
18393 esac
18394 rp="How many bits does your $randfunc() function produce?"
18395 . ./myread
18396 randbits="$ans"
18397 $rm -f try.c try
18398 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18399 seedfunc="s$randfunc"
18400 randseedtype=unsigned
18401 ;;
18402 *)
18403 dflt="31"
18404 rp="How many bits does your $randfunc() function produce?"
18405 . ./myread
18406 randbits="$ans"
18407 seedfunc="s$randfunc"
18408 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
18409 if set $seedfunc val -f; eval $csym; $val; then
18410 echo "(Using $seedfunc() to seed random generator)"
18411 else
18412 echo "(Warning: no $seedfunc() to seed random generator)"
18413 seedfunc=rand
18414 fi
18415 randseedtype=unsigned
18416 ;;
18417 esac
18418 ;;
18419 esac
18420done
18421
18422echo " "
18423echo "Determining whether or not we are on an EBCDIC system..." >&4
18424$cat >try.c <<'EOM'
18425int main()
18426{
18427 if ('M'==0xd4) return 0;
18428 return 1;
18429}
18430EOM
18431
18432val=$undef
18433set try
18434if eval $compile_ok; then
18435 if $run ./try; then
18436 echo "You seem to speak EBCDIC." >&4
18437 val="$define"
18438 else
18439 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
18440 fi
18441else
18442 echo "I'm unable to compile the test program." >&4
18443 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
18444fi
18445$rm -f try try.*
18446set ebcdic
18447eval $setvar
18448
18449echo " "
18450$cat >&4 <<EOM
18451Checking how to flush all pending stdio output...
18452EOM
18453# I only know how to find the first 32 possibly open files on SunOS.
18454# See also hints/sunos_4_1.sh and util.c --AD
18455case "$osname" in
18456sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
18457esac
18458$cat >>try.c <<EOCP
18459#include <stdio.h>
18460#$i_stdlib I_STDLIB
18461#ifdef I_STDLIB
18462#include <stdlib.h>
18463#endif
18464#$i_unistd I_UNISTD
18465#ifdef I_UNISTD
18466# include <unistd.h>
18467#endif
18468#$d_sysconf HAS_SYSCONF
18469#$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
18470#ifdef HAS_STDIO_STREAM_ARRAY
18471# define STDIO_STREAM_ARRAY $stdio_stream_array
18472#endif
18473int main() {
18474 FILE* p;
18475 unlink("try.out");
18476 p = fopen("try.out", "w");
18477#ifdef TRY_FPUTC
18478 fputc('x', p);
18479#else
18480# ifdef TRY_FPRINTF
18481 fprintf(p, "x");
18482# endif
18483#endif
18484#ifdef TRY_FFLUSH_NULL
18485 fflush(NULL);
18486#endif
18487#ifdef TRY_FFLUSH_ALL
18488 {
18489 long open_max = -1;
18490# ifdef PERL_FFLUSH_ALL_FOPEN_MAX
18491 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
18492# else
18493# if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
18494 open_max = sysconf(_SC_OPEN_MAX);
18495# else
18496# ifdef FOPEN_MAX
18497 open_max = FOPEN_MAX;
18498# else
18499# ifdef OPEN_MAX
18500 open_max = OPEN_MAX;
18501# else
18502# ifdef _NFILE
18503 open_max = _NFILE;
18504# endif
18505# endif
18506# endif
18507# endif
18508# endif
18509# ifdef HAS_STDIO_STREAM_ARRAY
18510 if (open_max > 0) {
18511 long i;
18512 for (i = 0; i < open_max; i++)
18513 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
18514 STDIO_STREAM_ARRAY[i]._file < open_max &&
18515 STDIO_STREAM_ARRAY[i]._flag)
18516 fflush(&STDIO_STREAM_ARRAY[i]);
18517 }
18518 }
18519# endif
18520#endif
18521 _exit(42);
18522}
18523EOCP
18524: first we have to find out how _not_ to flush
18525$to try.c
18526if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
18527 output=''
18528 set try -DTRY_FPUTC
18529 if eval $compile; then
18530 $run ./try 2>/dev/null
18531 code="$?"
18532 $from try.out
18533 if $test ! -s try.out -a "X$code" = X42; then
18534 output=-DTRY_FPUTC
18535 fi
18536 fi
18537 case "$output" in
18538 '')
18539 set try -DTRY_FPRINTF
18540 if eval $compile; then
18541 $run ./try 2>/dev/null
18542 code="$?"
18543 $from try.out
18544 if $test ! -s try.out -a "X$code" = X42; then
18545 output=-DTRY_FPRINTF
18546 fi
18547 fi
18548 ;;
18549 esac
18550fi
18551: check for fflush NULL behaviour
18552case "$fflushNULL" in
18553'') set try -DTRY_FFLUSH_NULL $output
18554 if eval $compile; then
18555 $run ./try 2>/dev/null
18556 code="$?"
18557 $from try.out
18558 if $test -s try.out -a "X$code" = X42; then
18559 fflushNULL="`$cat try.out`"
18560 else
18561 if $test "X$code" != X42; then
18562 $cat >&4 <<EOM
18563(If this test failed, don't worry, we'll try another method shortly.)
18564EOM
18565 fi
18566 fi
18567 fi
18568 $rm -f core try.core core.try.*
18569 case "$fflushNULL" in
18570 x) $cat >&4 <<EOM
18571Your fflush(NULL) works okay for output streams.
18572Let's see if it clobbers input pipes...
18573EOM
18574# As of mid-March 2000 all versions of Solaris appear to have a stdio
18575# bug that improperly flushes the input end of pipes. So we avoid the
18576# autoflush on fork/system/exec support for now. :-(
18577$cat >tryp.c <<EOCP
18578#include <stdio.h>
18579int
18580main(int argc, char **argv)
18581{
18582 char buf[1024];
18583 int i;
18584 char *bp = buf;
18585 while (1) {
18586 while ((i = getc(stdin)) != -1
18587 && (*bp++ = i) != '\n'
18588 && bp < &buf[1024])
18589 /* DO NOTHING */ ;
18590 *bp = '\0';
18591 fprintf(stdout, "%s", buf);
18592 fflush(NULL);
18593 if (i == -1)
18594 return 0;
18595 bp = buf;
18596 }
18597}
18598EOCP
18599 fflushNULL="$define"
18600 set tryp
18601 if eval $compile; then
18602 $rm -f tryp.out
18603 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18604 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18605 $cat >&4 <<EOM
18606fflush(NULL) seems to behave okay with input streams.
18607EOM
18608 fflushNULL="$define"
18609 else
18610 $cat >&4 <<EOM
18611Ouch, fflush(NULL) clobbers input pipes! We will not use it.
18612EOM
18613 fflushNULL="$undef"
18614 fi
18615 fi
18616 $rm -f core tryp.c tryp.core core.tryp.*
18617 ;;
18618 '') $cat >&4 <<EOM
18619Your fflush(NULL) isn't working (contrary to ANSI C).
18620EOM
18621 fflushNULL="$undef"
18622 ;;
18623 *) $cat >&4 <<EOM
18624Cannot figure out whether your fflush(NULL) works or not.
18625I'm assuming it doesn't (contrary to ANSI C).
18626EOM
18627 fflushNULL="$undef"
18628 ;;
18629 esac
18630 ;;
18631$define|true|[yY]*)
18632 fflushNULL="$define"
18633 ;;
18634*)
18635 fflushNULL="$undef"
18636 ;;
18637esac
18638: check explicit looping only if NULL did not work, and if the pipe
18639: bug does not show up on an explicit flush too
18640case "$fflushNULL" in
18641"$undef")
18642 $cat >tryp.c <<EOCP
18643#include <stdio.h>
18644int
18645main(int argc, char **argv)
18646{
18647 char buf[1024];
18648 int i;
18649 char *bp = buf;
18650 while (1) {
18651 while ((i = getc(stdin)) != -1
18652 && (*bp++ = i) != '\n'
18653 && bp < &buf[1024])
18654 /* DO NOTHING */ ;
18655 *bp = '\0';
18656 fprintf(stdout, "%s", buf);
18657 fflush(stdin);
18658 if (i == -1)
18659 return 0;
18660 bp = buf;
18661 }
18662}
18663EOCP
18664 set tryp
18665 if eval $compile; then
18666 $rm -f tryp.out
18667 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
18668 if cmp tryp.c tryp.out >/dev/null 2>&1; then
18669 $cat >&4 <<EOM
18670Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
18671EOM
18672 : now check for fflushall behaviour
18673 case "$fflushall" in
18674 '') set try -DTRY_FFLUSH_ALL $output
18675 if eval $compile; then
18676 $cat >&4 <<EOM
18677(Now testing the other method--but note that this also may fail.)
18678EOM
18679 $run ./try 2>/dev/null
18680 code=$?
18681 $from try.out
18682 if $test -s try.out -a "X$code" = X42; then
18683 fflushall="`$cat try.out`"
18684 fi
18685 fi
18686 $rm -f core try.core core.try.*
18687 case "$fflushall" in
18688 x) $cat >&4 <<EOM
18689Whew. Flushing explicitly all the stdio streams works.
18690EOM
18691 fflushall="$define"
18692 ;;
18693 '') $cat >&4 <<EOM
18694Sigh. Flushing explicitly all the stdio streams doesn't work.
18695EOM
18696 fflushall="$undef"
18697 ;;
18698 *) $cat >&4 <<EOM
18699Cannot figure out whether flushing stdio streams explicitly works or not.
18700I'm assuming it doesn't.
18701EOM
18702 fflushall="$undef"
18703 ;;
18704 esac
18705 ;;
18706 "$define"|true|[yY]*)
18707 fflushall="$define"
18708 ;;
18709 *)
18710 fflushall="$undef"
18711 ;;
18712 esac
18713 else
18714 $cat >&4 <<EOM
18715All is futile. Even fflush(stdin) clobbers input pipes!
18716EOM
18717 fflushall="$undef"
18718 fi
18719 else
18720 fflushall="$undef"
18721 fi
18722 $rm -f core tryp.c tryp.core core.tryp.*
18723 ;;
18724*) fflushall="$undef"
18725 ;;
18726esac
18727
18728case "$fflushNULL$fflushall" in
18729undefundef)
18730 $cat <<EOM
18731OK, I give up. I cannot figure out how to flush pending stdio output.
18732We won't be flushing handles at all before fork/exec/popen.
18733EOM
18734 ;;
18735esac
18736$rm -f try.* try$exe_ext
18737
18738: Store the full pathname to the ar program for use in the C program
18739: Respect a hint or command line value for full_ar.
18740case "$full_ar" in
18741'') full_ar=$ar ;;
18742esac
18743
18744: Store the full pathname to the sed program for use in the C program
18745full_sed=$sed
18746
18747: see what type gids are declared as in the kernel
18748echo " "
18749echo "Looking for the type for group ids returned by getgid()."
18750set gid_t gidtype xxx stdio.h sys/types.h
18751eval $typedef
18752case "$gidtype" in
18753xxx)
18754 xxx=`./findhdr sys/user.h`
18755 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18756 case $1 in
18757 unsigned) dflt="$1 $2" ;;
18758 *) dflt="$1" ;;
18759 esac
18760 ;;
18761*) dflt="$gidtype";;
18762esac
18763case "$gidtype" in
18764gid_t) echo "gid_t found." ;;
18765*) rp="What is the type for group ids returned by getgid()?"
18766 . ./myread
18767 gidtype="$ans"
18768 ;;
18769esac
18770
18771echo " "
18772case "$gidtype" in
18773*_t) zzz="$gidtype" ;;
18774*) zzz="gid" ;;
18775esac
18776echo "Checking the size of $zzz..." >&4
18777cat > try.c <<EOCP
18778#include <sys/types.h>
18779#include <stdio.h>
18780#$i_stdlib I_STDLIB
18781#ifdef I_STDLIB
18782#include <stdlib.h>
18783#endif
18784int main() {
18785 printf("%d\n", (int)sizeof($gidtype));
18786 exit(0);
18787}
18788EOCP
18789set try
18790if eval $compile_ok; then
18791 yyy=`$run ./try`
18792 case "$yyy" in
18793 '') gidsize=4
18794 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18795 ;;
18796 *) gidsize=$yyy
18797 echo "Your $zzz is $gidsize bytes long."
18798 ;;
18799 esac
18800else
18801 gidsize=4
18802 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18803fi
18804
18805
18806echo " "
18807case "$gidtype" in
18808*_t) zzz="$gidtype" ;;
18809*) zzz="gid" ;;
18810esac
18811echo "Checking the sign of $zzz..." >&4
18812cat > try.c <<EOCP
18813#include <sys/types.h>
18814#include <stdio.h>
18815int main() {
18816 $gidtype foo = -1;
18817 if (foo < 0)
18818 printf("-1\n");
18819 else
18820 printf("1\n");
18821}
18822EOCP
18823set try
18824if eval $compile; then
18825 yyy=`$run ./try`
18826 case "$yyy" in
18827 '') gidsign=1
18828 echo "(I can't execute the test program--guessing unsigned.)" >&4
18829 ;;
18830 *) gidsign=$yyy
18831 case "$gidsign" in
18832 1) echo "Your $zzz is unsigned." ;;
18833 -1) echo "Your $zzz is signed." ;;
18834 esac
18835 ;;
18836 esac
18837else
18838 gidsign=1
18839 echo "(I can't compile the test program--guessing unsigned.)" >&4
18840fi
18841
18842
18843echo " "
18844
18845if $test X"$quadtype" != X; then
18846
18847echo "Checking how to print 64-bit integers..." >&4
18848
18849if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18850 $cat >try.c <<'EOCP'
18851#include <sys/types.h>
18852#include <stdio.h>
18853int main() {
18854 int q = 12345678901;
18855 printf("%ld\n", q);
18856}
18857EOCP
18858 set try
18859 if eval $compile; then
18860 yyy=`$run ./try`
18861 case "$yyy" in
18862 12345678901)
18863 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18864 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18865 echo "We will use %d."
18866 ;;
18867 esac
18868 fi
18869fi
18870
18871if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18872 $cat >try.c <<'EOCP'
18873#include <sys/types.h>
18874#include <stdio.h>
18875int main() {
18876 long q = 12345678901;
18877 printf("%ld\n", q);
18878}
18879EOCP
18880 set try
18881 if eval $compile; then
18882 yyy=`$run ./try`
18883 case "$yyy" in
18884 12345678901)
18885 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18886 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18887 echo "We will use %ld."
18888 ;;
18889 esac
18890 fi
18891fi
18892
18893if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18894 $cat >try.c <<'EOCP'
18895#include <sys/types.h>
18896#include <inttypes.h>
18897#include <stdio.h>
18898int main() {
18899 int64_t q = 12345678901;
18900 printf("%" PRId64 "\n", q);
18901}
18902EOCP
18903 set try
18904 if eval $compile; then
18905 yyy=`$run ./try`
18906 case "$yyy" in
18907 12345678901)
18908 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18909 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18910 echo "We will use the C9X style."
18911 ;;
18912 esac
18913 fi
18914fi
18915
18916if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18917 $cat >try.c <<EOCP
18918#include <sys/types.h>
18919#include <stdio.h>
18920int main() {
18921 $quadtype q = 12345678901;
18922 printf("%Ld\n", q);
18923}
18924EOCP
18925 set try
18926 if eval $compile; then
18927 yyy=`$run ./try`
18928 case "$yyy" in
18929 12345678901)
18930 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18931 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18932 echo "We will use %Ld."
18933 ;;
18934 esac
18935 fi
18936fi
18937
18938if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18939 $cat >try.c <<'EOCP'
18940#include <sys/types.h>
18941#include <stdio.h>
18942int main() {
18943 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18944 printf("%lld\n", q);
18945}
18946EOCP
18947 set try
18948 if eval $compile; then
18949 yyy=`$run ./try`
18950 case "$yyy" in
18951 12345678901)
18952 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18953 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18954 echo "We will use the %lld style."
18955 ;;
18956 esac
18957 fi
18958fi
18959
18960if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18961 $cat >try.c <<EOCP
18962#include <sys/types.h>
18963#include <stdio.h>
18964int main() {
18965 $quadtype q = 12345678901;
18966 printf("%qd\n", q);
18967}
18968EOCP
18969 set try
18970 if eval $compile; then
18971 yyy=`$run ./try`
18972 case "$yyy" in
18973 12345678901)
18974 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18975 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18976 echo "We will use %qd."
18977 ;;
18978 esac
18979 fi
18980fi
18981
18982if $test X"$sPRId64" = X; then
18983 echo "Cannot figure out how to print 64-bit integers." >&4
18984fi
18985
18986$rm -f try try.*
18987
18988fi
18989
18990case "$sPRId64" in
18991'') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18992 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18993 ;;
18994*) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18995 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18996 ;;
18997esac
18998
18999
19000echo " "
19001$echo "Checking the format strings to be used for Perl's internal types..." >&4
19002
19003if $test X"$ivsize" = X8; then
19004 ivdformat="$sPRId64"
19005 uvuformat="$sPRIu64"
19006 uvoformat="$sPRIo64"
19007 uvxformat="$sPRIx64"
19008 uvXUformat="$sPRIXU64"
19009else
19010 if $test X"$ivsize" = X"$longsize"; then
19011 ivdformat='"ld"'
19012 uvuformat='"lu"'
19013 uvoformat='"lo"'
19014 uvxformat='"lx"'
19015 uvXUformat='"lX"'
19016 else
19017 if $test X"$ivsize" = X"$intsize"; then
19018 ivdformat='"d"'
19019 uvuformat='"u"'
19020 uvoformat='"o"'
19021 uvxformat='"x"'
19022 uvXUformat='"X"'
19023 else
19024 : far out
19025 if $test X"$ivsize" = X"$shortsize"; then
19026 ivdformat='"hd"'
19027 uvuformat='"hu"'
19028 uvoformat='"ho"'
19029 uvxformat='"hx"'
19030 uvXUformat='"hX"'
19031 fi
19032 fi
19033 fi
19034fi
19035
19036if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
19037 nveformat="$sPRIeldbl"
19038 nvfformat="$sPRIfldbl"
19039 nvgformat="$sPRIgldbl"
19040 nvEUformat="$sPRIEUldbl"
19041 nvFUformat="$sPRIFUldbl"
19042 nvGUformat="$sPRIGUldbl"
19043else
19044 nveformat='"e"'
19045 nvfformat='"f"'
19046 nvgformat='"g"'
19047 nvEUformat='"E"'
19048 nvFUformat='"F"'
19049 nvGUformat='"G"'
19050fi
19051
19052case "$ivdformat" in
19053'') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
19054 exit 1
19055 ;;
19056esac
19057
19058
19059echo " "
19060$echo "Checking the format string to be used for gids..." >&4
19061
19062case "$gidsign" in
19063-1) if $test X"$gidsize" = X"$ivsize"; then
19064 gidformat="$ivdformat"
19065 else
19066 if $test X"$gidsize" = X"$longsize"; then
19067 gidformat='"ld"'
19068 else
19069 if $test X"$gidsize" = X"$intsize"; then
19070 gidformat='"d"'
19071 else
19072 if $test X"$gidsize" = X"$shortsize"; then
19073 gidformat='"hd"'
19074 fi
19075 fi
19076 fi
19077 fi
19078 ;;
19079*) if $test X"$gidsize" = X"$uvsize"; then
19080 gidformat="$uvuformat"
19081 else
19082 if $test X"$gidsize" = X"$longsize"; then
19083 gidformat='"lu"'
19084 else
19085 if $test X"$gidsize" = X"$intsize"; then
19086 gidformat='"u"'
19087 else
19088 if $test X"$gidsize" = X"$shortsize"; then
19089 gidformat='"hu"'
19090 fi
19091 fi
19092 fi
19093 fi
19094 ;;
19095esac
19096
19097: see if getgroups exists
19098set getgroups d_getgrps
19099eval $inlibc
19100
19101: see if setgroups exists
19102set setgroups d_setgrps
19103eval $inlibc
19104
19105
19106: Find type of 2nd arg to 'getgroups()' and 'setgroups()'
19107echo " "
19108case "$d_getgrps$d_setgrps" in
19109*define*)
19110 case "$groupstype" in
19111 '') dflt="$gidtype" ;;
19112 *) dflt="$groupstype" ;;
19113 esac
19114 $cat <<EOM
19115What type of pointer is the second argument to getgroups() and setgroups()?
19116Usually this is the same as group ids, $gidtype, but not always.
19117
19118EOM
19119 rp='What type pointer is the second argument to getgroups() and setgroups()?'
19120 . ./myread
19121 groupstype="$ans"
19122 ;;
19123*) groupstype="$gidtype";;
19124esac
19125
19126
19127if $test $patchlevel -lt 9; then
19128: MAD is not available in 5.8.x or earlier.
19129 ans=n;
19130else
19131 case "$mad" in
19132 $define|true|[yY]*) dflt='y' ;;
19133 *) dflt='n' ;;
19134 esac
19135 cat <<EOM
19136
19137Would you like to build with Misc Attribute Decoration? This is development
19138work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
19139overhead on the interpreter.
19140
19141If this doesn't make any sense to you, just accept the default '$dflt'.
19142EOM
19143 rp='Build Perl with MAD?'
19144 . ./myread
19145fi
19146case "$ans" in
19147y|Y) val="$define"
19148 madlyh='madly.h madly.act madly.tab'
19149 madlysrc='madly.c'
19150 madlyobj="madly$_o" ;;
19151*) val="$undef"
19152 madlyh=''
19153 madlysrc=''
19154 madlyobj='' ;;
19155esac
19156set mad
19157eval $setvar
19158
19159echo " "
19160echo "Checking if your $make program sets \$(MAKE)..." >&4
19161case "$make_set_make" in
19162'')
19163 $sed 's/^X //' > testmake.mak << 'EOF'
19164Xall:
19165X @echo 'maketemp="$(MAKE)"'
19166EOF
19167 case "`$make -f testmake.mak 2>/dev/null`" in
19168 *maketemp=*) make_set_make='#' ;;
19169 *) make_set_make="MAKE=$make" ;;
19170 esac
19171 $rm -f testmake.mak
19172 ;;
19173esac
19174case "$make_set_make" in
19175'#') echo "Yup, it does.";;
19176*) echo "Nope, it doesn't.";;
19177esac
19178
19179: see what type is used for mode_t
19180rp="What is the type used for file modes for system calls (e.g. fchmod())?"
19181set mode_t modetype int stdio.h sys/types.h
19182eval $typedef_ask
19183
19184: see if we need va_copy
19185echo " "
19186case "$i_stdarg" in
19187"$define")
19188 $cat >try.c <<EOCP
19189#include <stdarg.h>
19190#include <stdio.h>
19191#$i_stdlib I_STDLIB
19192#ifdef I_STDLIB
19193#include <stdlib.h>
19194#endif
19195#include <signal.h>
19196
19197int
19198ivfprintf(FILE *f, const char *fmt, va_list *valp)
19199{
19200 return vfprintf(f, fmt, *valp);
19201}
19202
19203int
19204myvfprintf(FILE *f, const char *fmt, va_list val)
19205{
19206 return ivfprintf(f, fmt, &val);
19207}
19208
19209int
19210myprintf(char *fmt, ...)
19211{
19212 va_list val;
19213 va_start(val, fmt);
19214 return myvfprintf(stdout, fmt, val);
19215}
19216
19217int
19218main(int ac, char **av)
19219{
19220 signal(SIGSEGV, exit);
19221
19222 myprintf("%s%cs all right, then\n", "that", '\'');
19223 exit(0);
19224}
19225EOCP
19226 set try
19227 if eval $compile && $run ./try 2>&1 >/dev/null; then
19228 case "`$run ./try`" in
19229 "that's all right, then")
19230 okay=yes
19231 ;;
19232 esac
19233 fi
19234 case "$okay" in
19235 yes) echo "It seems that you don't need va_copy()." >&4
19236 need_va_copy="$undef"
19237 ;;
19238 *) echo "It seems that va_copy() or similar will be needed." >&4
19239 need_va_copy="$define"
19240 ;;
19241 esac
19242 $rm -f try.* core core.* *.core *.core.*
19243 ;;
19244*) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
19245 ;;
19246esac
19247
19248: see what type is used for size_t
19249rp="What is the type used for the length parameter for string functions?"
19250set size_t sizetype 'unsigned int' stdio.h sys/types.h
19251eval $typedef_ask
19252
19253: check for type of arguments to gethostbyaddr.
19254if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
19255 case "$d_gethbyaddr" in
19256 $define)
19257 $cat <<EOM
19258
19259Checking to see what type of arguments are accepted by gethostbyaddr().
19260EOM
19261 hdrs="$define sys/types.h
19262 $d_socket sys/socket.h
19263 $i_niin netinet/in.h
19264 $i_netdb netdb.h
19265 $i_unistd unistd.h"
19266 : The first arg can 'char *' or 'void *'
19267 : The second arg is some of integral type
19268 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
19269 for yyy in size_t long int; do
19270 case "$netdb_host_type" in
19271 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
19272 if ./protochk "$try" $hdrs; then
19273 echo "Your system accepts $xxx for the first arg."
19274 echo "...and $yyy for the second arg."
19275 netdb_host_type="$xxx"
19276 netdb_hlen_type="$yyy"
19277 fi
19278 ;;
19279 esac
19280 done
19281 done
19282 : In case none of those worked, prompt the user.
19283 case "$netdb_host_type" in
19284 '') rp='What is the type for the 1st argument to gethostbyaddr?'
19285 dflt='char *'
19286 . ./myread
19287 netdb_host_type=$ans
19288 rp='What is the type for the 2nd argument to gethostbyaddr?'
19289 dflt="$sizetype"
19290 . ./myread
19291 netdb_hlen_type=$ans
19292 ;;
19293 esac
19294 ;;
19295 *) : no gethostbyaddr, so pick harmless defaults
19296 netdb_host_type='char *'
19297 netdb_hlen_type="$sizetype"
19298 ;;
19299 esac
19300 # Remove the "const" if needed. -- but then we'll have a
19301 # prototype clash!
19302 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
19303fi
19304
19305: check for type of argument to gethostbyname.
19306if test "X$netdb_name_type" = X ; then
19307 case "$d_gethbyname" in
19308 $define)
19309 $cat <<EOM
19310
19311Checking to see what type of argument is accepted by gethostbyname().
19312EOM
19313 hdrs="$define sys/types.h
19314 $d_socket sys/socket.h
19315 $i_niin netinet/in.h
19316 $i_netdb netdb.h
19317 $i_unistd unistd.h"
19318 for xxx in "const char *" "char *"; do
19319 case "$netdb_name_type" in
19320 '') try="extern struct hostent *gethostbyname($xxx);"
19321 if ./protochk "$try" $hdrs; then
19322 echo "Your system accepts $xxx."
19323 netdb_name_type="$xxx"
19324 fi
19325 ;;
19326 esac
19327 done
19328 : In case none of those worked, prompt the user.
19329 case "$netdb_name_type" in
19330 '') rp='What is the type for the 1st argument to gethostbyname?'
19331 dflt='char *'
19332 . ./myread
19333 netdb_name_type=$ans
19334 ;;
19335 esac
19336 ;;
19337 *) : no gethostbyname, so pick harmless default
19338 netdb_name_type='char *'
19339 ;;
19340 esac
19341fi
19342
19343: check for type of 1st argument to getnetbyaddr.
19344if test "X$netdb_net_type" = X ; then
19345 case "$d_getnbyaddr" in
19346 $define)
19347 $cat <<EOM
19348
19349Checking to see what type of 1st argument is accepted by getnetbyaddr().
19350EOM
19351 hdrs="$define sys/types.h
19352 $d_socket sys/socket.h
19353 $i_niin netinet/in.h
19354 $i_netdb netdb.h
19355 $i_unistd unistd.h"
19356 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
19357 case "$netdb_net_type" in
19358 '') try="extern struct netent *getnetbyaddr($xxx, int);"
19359 if ./protochk "$try" $hdrs; then
19360 echo "Your system accepts $xxx."
19361 netdb_net_type="$xxx"
19362 fi
19363 ;;
19364 esac
19365 done
19366 : In case none of those worked, prompt the user.
19367 case "$netdb_net_type" in
19368 '') rp='What is the type for the 1st argument to getnetbyaddr?'
19369 dflt='long'
19370 . ./myread
19371 netdb_net_type=$ans
19372 ;;
19373 esac
19374 ;;
19375 *) : no getnetbyaddr, so pick harmless default
19376 netdb_net_type='long'
19377 ;;
19378 esac
19379fi
19380: locate the preferred pager for this system
19381fn=f/
19382case "$pager" in
19383'')
19384 dflt=''
19385 case "$pg" in
19386 /*) dflt=$pg;;
19387 [a-zA-Z]:/*) dflt=$pg;;
19388 esac
19389 case "$more" in
19390 /*) dflt=$more;;
19391 [a-zA-Z]:/*) dflt=$more;;
19392 esac
19393 case "$less" in
19394 /*) dflt=$less;;
19395 [a-zA-Z]:/*) dflt=$less;;
19396 esac
19397 case "$dflt" in
19398 '') dflt=/usr/ucb/more;;
19399 esac
19400 ;;
19401*) dflt="$pager"
19402 : Instruct ./getfile to trust the hinted or previous pager value,
19403 : even if it does not begin with a slash. For example, on os2,
19404 : pager might be cmd /c more. See comments in UU/getfile.
19405 fn="f/($pager)"
19406 ;;
19407esac
19408echo " "
19409rp='What pager is used on your system?'
19410. ./getfile
19411pager="$ans"
19412
19413: see what type pids are declared as in the kernel
19414rp="What is the type of process ids on this system?"
19415set pid_t pidtype int stdio.h sys/types.h
19416eval $typedef_ask
19417
19418: see if ar generates random libraries by itself
19419echo " "
19420echo "Checking how to generate random libraries on your machine..." >&4
19421echo 'int bar1() { return bar2(); }' > bar1.c
19422echo 'int bar2() { return 2; }' > bar2.c
19423$cat > foo.c <<EOP
19424#$i_stdlib I_STDLIB
19425#ifdef I_STDLIB
19426#include <stdlib.h>
19427#endif
19428int main() { printf("%d\n", bar1()); exit(0); }
19429EOP
19430$cc $ccflags -c bar1.c >/dev/null 2>&1
19431$cc $ccflags -c bar2.c >/dev/null 2>&1
19432$cc $ccflags -c foo.c >/dev/null 2>&1
19433$ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
19434if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19435 $run ./foobar >/dev/null 2>&1; then
19436 echo "$ar appears to generate random libraries itself."
19437 orderlib=false
19438 if [ "X$ranlib" = "X" ]; then
19439 ranlib=":"
19440 fi
19441elif $ar s bar$_a >/dev/null 2>&1 &&
19442 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19443 $run ./foobar >/dev/null 2>&1; then
19444 echo "a table of contents needs to be added with '$ar s'."
19445 orderlib=false
19446 ranlib="$ar s"
19447elif $ar ts bar$_a >/dev/null 2>&1 &&
19448 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
19449 $run ./foobar >/dev/null 2>&1; then
19450 echo "a table of contents needs to be added with '$ar ts'."
19451 orderlib=false
19452 ranlib="$ar ts"
19453else
19454 case "$ranlib" in
19455 :) ranlib='';;
19456 '')
19457 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
19458 $test -f $ranlib || ranlib=''
19459 ;;
19460 esac
19461 if $test -n "$ranlib"; then
19462 echo "your system has '$ranlib'; we'll use that."
19463 orderlib=false
19464 else
19465 echo "your system doesn't seem to support random libraries"
19466 echo "so we'll use lorder and tsort to order the libraries."
19467 orderlib=true
19468 ranlib=":"
19469 fi
19470fi
19471$rm -f foo* bar*
19472
19473: check for type of arguments to select.
19474case "$selecttype" in
19475'') case "$d_select" in
19476 $define)
19477 echo " "
19478 $cat <<EOM
19479Checking to see what type of arguments are accepted by select().
19480EOM
19481 hdrs="$define sys/types.h
19482 $i_systime sys/time.h
19483 $i_sysselct sys/select.h
19484 $d_socket sys/socket.h"
19485 : The first arg can be int, unsigned, or size_t
19486 : The last arg may or may not be 'const'
19487 val=''
19488 : void pointer has been seen but using that
19489 : breaks the selectminbits test
19490 for xxx in 'fd_set *' 'int *'; do
19491 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
19492 for tmo in 'struct timeval *' 'const struct timeval *'; do
19493 case "$val" in
19494 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
19495 if ./protochk "$try" $hdrs; then
19496 echo "Your system accepts $xxx."
19497 val="$xxx"
19498 fi
19499 ;;
19500 esac
19501 done
19502 done
19503 done
19504 case "$val" in
19505 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
19506 case "$d_fd_set" in
19507 $define) dflt="fd_set *" ;;
19508 *) dflt="int *" ;;
19509 esac
19510 . ./myread
19511 val=$ans
19512 ;;
19513 esac
19514 selecttype="$val"
19515 ;;
19516 *) : no select, so pick a harmless default
19517 selecttype='int *'
19518 ;;
19519 esac
19520 ;;
19521esac
19522
19523: check for the select 'width'
19524case "$selectminbits" in
19525'') safebits=`expr $ptrsize \* 8`
19526 case "$d_select" in
19527 $define)
19528 $cat <<EOM
19529
19530Checking to see on how many bits at a time your select() operates...
19531EOM
19532 $cat >try.c <<EOCP
19533#include <sys/types.h>
19534#$i_time I_TIME
19535#$i_systime I_SYS_TIME
19536#$i_systimek I_SYS_TIME_KERNEL
19537#ifdef I_TIME
19538# include <time.h>
19539#endif
19540#ifdef I_SYS_TIME
19541# ifdef I_SYS_TIME_KERNEL
19542# define KERNEL
19543# endif
19544# include <sys/time.h>
19545# ifdef I_SYS_TIME_KERNEL
19546# undef KERNEL
19547# endif
19548#endif
19549#$i_sysselct I_SYS_SELECT
19550#ifdef I_SYS_SELECT
19551#include <sys/select.h>
19552#endif
19553#$d_socket HAS_SOCKET
19554#ifdef HAS_SOCKET
19555# include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
19556#endif
19557#include <stdio.h>
19558#$i_stdlib I_STDLIB
19559#ifdef I_STDLIB
19560#include <stdlib.h>
19561#endif
19562$selecttype b;
19563#define S sizeof(*(b))
19564#define MINBITS 64
19565#define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
19566#define NBITS (NBYTES * 8)
19567int main() {
19568 char *s = (char *)malloc(NBYTES);
19569 struct timeval t;
19570 int i;
19571 FILE* fp;
19572 int fd;
19573
19574 if (!s)
19575 exit(1);
19576 fclose(stdin);
19577 fp = fopen("try.c", "r");
19578 if (fp == 0)
19579 exit(2);
19580 fd = fileno(fp);
19581 if (fd < 0)
19582 exit(3);
19583 b = ($selecttype)s;
19584 for (i = 0; i < NBITS; i++)
19585 FD_SET(i, b);
19586 t.tv_sec = 0;
19587 t.tv_usec = 0;
19588 select(fd + 1, b, 0, 0, &t);
19589 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
19590 free(s);
19591 printf("%d\n", i + 1);
19592 return 0;
19593}
19594EOCP
19595 set try
19596 if eval $compile_ok; then
19597 selectminbits=`$run ./try`
19598 case "$selectminbits" in
19599 '') cat >&4 <<EOM
19600Cannot figure out on how many bits at a time your select() operates.
19601I'll play safe and guess it is $safebits bits.
19602EOM
19603 selectminbits=$safebits
19604 bits="$safebits bits"
19605 ;;
19606 1) bits="1 bit" ;;
19607 *) bits="$selectminbits bits" ;;
19608 esac
19609 echo "Your select() operates on $bits at a time." >&4
19610 else
19611 rp='What is the minimum number of bits your select() operates on?'
19612 case "$byteorder" in
19613 12345678) dflt=64 ;;
19614 1234) dflt=32 ;;
19615 *) dflt=1 ;;
19616 esac
19617 . ./myread
19618 val=$ans
19619 selectminbits="$val"
19620 fi
19621 $rm -f try.* try
19622 ;;
19623 *) : no select, so pick a harmless default
19624 selectminbits=$safebits
19625 ;;
19626 esac
19627 ;;
19628esac
19629
19630: Trace out the files included by signal.h, then look for SIGxxx names.
19631: Remove SIGARRAYSIZE used by HPUX.
19632: Remove SIGSTKSIZE used by Linux.
19633: Remove SIGSTKSZ used by Posix.
19634: Remove SIGTYP void lines used by OS2.
19635: Some cpps, like os390, dont give the file name anywhere
19636if [ "X$fieldn" = X ]; then
19637 : Just make some guesses. We check them later.
19638 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
19639else
19640 xxx=`echo '#include <signal.h>' |
19641 $cppstdin $cppminus $cppflags 2>/dev/null |
19642 $grep '^[ ]*#.*include' |
19643 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
19644fi
19645: Check this list of files to be sure we have parsed the cpp output ok.
19646: This will also avoid potentially non-existent files, such
19647: as ../foo/bar.h
19648xxxfiles=''
19649for xx in $xxx /dev/null ; do
19650 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
19651done
19652: If we have found no files, at least try signal.h
19653case "$xxxfiles" in
19654'') xxxfiles=`./findhdr signal.h` ;;
19655esac
19656xxx=`awk '
19657$1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
19658 print substr($2, 4, 20)
19659}
19660$1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
19661 print substr($3, 4, 20)
19662}' $xxxfiles`
19663: Append some common names just in case the awk scan failed.
19664xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
19665xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
19666xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19667xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19668xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19669
19670: generate a few handy files for later
19671$cat > signal.c <<EOCP
19672#include <sys/types.h>
19673#include <signal.h>
19674#$i_stdlib I_STDLIB
19675#ifdef I_STDLIB
19676#include <stdlib.h>
19677#endif
19678#include <stdio.h>
19679int main() {
19680
19681/* Strange style to avoid deeply-nested #if/#else/#endif */
19682#ifndef NSIG
19683# ifdef _NSIG
19684# define NSIG (_NSIG)
19685# endif
19686#endif
19687
19688#ifndef NSIG
19689# ifdef SIGMAX
19690# define NSIG (SIGMAX+1)
19691# endif
19692#endif
19693
19694#ifndef NSIG
19695# ifdef SIG_MAX
19696# define NSIG (SIG_MAX+1)
19697# endif
19698#endif
19699
19700#ifndef NSIG
19701# ifdef _SIG_MAX
19702# define NSIG (_SIG_MAX+1)
19703# endif
19704#endif
19705
19706#ifndef NSIG
19707# ifdef MAXSIG
19708# define NSIG (MAXSIG+1)
19709# endif
19710#endif
19711
19712#ifndef NSIG
19713# ifdef MAX_SIG
19714# define NSIG (MAX_SIG+1)
19715# endif
19716#endif
19717
19718#ifndef NSIG
19719# ifdef SIGARRAYSIZE
19720# define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
19721# endif
19722#endif
19723
19724#ifndef NSIG
19725# ifdef _sys_nsig
19726# define NSIG (_sys_nsig) /* Solaris 2.5 */
19727# endif
19728#endif
19729
19730/* Default to some arbitrary number that's big enough to get most
19731 of the common signals.
19732*/
19733#ifndef NSIG
19734# define NSIG 50
19735#endif
19736
19737printf("NSIG %d\n", NSIG);
19738
19739#ifndef JUST_NSIG
19740
19741EOCP
19742
19743echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19744{
19745 printf "#ifdef SIG"; printf $1; printf "\n"
19746 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19747 printf $1; printf ");\n"
19748 printf "#endif\n"
19749}
19750END {
19751 printf "#endif /* JUST_NSIG */\n";
19752 printf "exit(0);\n}\n";
19753}
19754' >>signal.c
19755$cat >signal.awk <<'EOP'
19756BEGIN { ndups = 0 }
19757$1 ~ /^NSIG$/ { nsig = $2 }
19758($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19759 if ($2 > maxsig) { maxsig = $2 }
19760 if (sig_name[$2]) {
19761 dup_name[ndups] = $1
19762 dup_num[ndups] = $2
19763 ndups++
19764 }
19765 else {
19766 sig_name[$2] = $1
19767 sig_num[$2] = $2
19768 }
19769}
19770END {
19771 if (nsig == 0) {
19772 nsig = maxsig + 1
19773 }
19774 printf("NSIG %d\n", nsig);
19775 for (n = 1; n < nsig; n++) {
19776 if (sig_name[n]) {
19777 printf("%s %d\n", sig_name[n], sig_num[n])
19778 }
19779 else {
19780 printf("NUM%d %d\n", n, n)
19781 }
19782 }
19783 for (n = 0; n < ndups; n++) {
19784 printf("%s %d\n", dup_name[n], dup_num[n])
19785 }
19786}
19787EOP
19788$cat >signal_cmd <<EOS
19789$startsh
19790if $test -s signal.lst; then
19791 echo "Using your existing signal.lst file"
19792 exit 0
19793fi
19794xxx="$xxx"
19795EOS
19796$cat >>signal_cmd <<'EOS'
19797
19798set signal
19799if eval $compile_ok; then
19800 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19801else
19802 echo "(I can't seem be able to compile the whole test program)" >&4
19803 echo "(I'll try it in little pieces.)" >&4
19804 set signal -DJUST_NSIG
19805 if eval $compile_ok; then
19806 $run ./signal$_exe > signal.nsg
19807 $cat signal.nsg
19808 else
19809 echo "I can't seem to figure out how many signals you have." >&4
19810 echo "Guessing 50." >&4
19811 echo 'NSIG 50' > signal.nsg
19812 fi
19813 : Now look at all the signal names, one at a time.
19814 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19815 $cat > signal.c <<EOCP
19816#include <sys/types.h>
19817#include <signal.h>
19818#include <stdio.h>
19819int main() {
19820printf("$xx %d\n", SIG${xx});
19821return 0;
19822}
19823EOCP
19824 set signal
19825 if eval $compile; then
19826 echo "SIG${xx} found."
19827 $run ./signal$_exe >> signal.ls1
19828 else
19829 echo "SIG${xx} NOT found."
19830 fi
19831 done
19832 if $test -s signal.ls1; then
19833 $cat signal.nsg signal.ls1 |
19834 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19835 fi
19836
19837fi
19838if $test -s signal.lst; then
19839 :
19840else
19841 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19842 echo 'kill -l' >signal
19843 set X `csh -f <signal`
19844 $rm -f signal
19845 shift
19846 case $# in
19847 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19848 esac
19849 echo $@ | $tr ' ' $trnl | \
19850 $awk '{ printf "%s %d\n", $1, ++s; }
19851 END { printf "NSIG %d\n", ++s }' >signal.lst
19852fi
19853$rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19854EOS
19855chmod a+x signal_cmd
19856$eunicefix signal_cmd
19857
19858: generate list of signal names
19859echo " "
19860case "$sig_name_init" in
19861'') doinit=yes ;;
19862*) case "$sig_num_init" in
19863 ''|*,*) doinit=yes ;;
19864 esac ;;
19865esac
19866case "$doinit" in
19867yes)
19868 echo "Generating a list of signal names and numbers..." >&4
19869 . ./signal_cmd
19870 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19871 sig_name=`$awk 'BEGIN { printf "ZERO " }
19872 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19873 sig_num=`$awk 'BEGIN { printf "0 " }
19874 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19875 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19876 !/^NSIG/ { printf "\"%s\", ", $1 }
19877 END { printf "0\n" }' signal.lst`
19878 sig_num_init=`$awk 'BEGIN { printf "0, " }
19879 !/^NSIG/ { printf "%d, ", $2}
19880 END { printf "0\n"}' signal.lst`
19881 ;;
19882esac
19883echo "The following $sig_count signals are available:"
19884echo " "
19885echo $sig_name | $awk \
19886'BEGIN { linelen = 0 }
19887{
19888 for (i = 1; i <= NF; i++) {
19889 name = "SIG" $i " "
19890 linelen = linelen + length(name)
19891 if (linelen > 70) {
19892 printf "\n"
19893 linelen = length(name)
19894 }
19895 printf "%s", name
19896 }
19897 printf "\n"
19898}'
19899sig_size=`echo $sig_name | awk '{print NF}'`
19900$rm -f signal signal.c signal.awk signal.lst signal_cmd
19901
19902echo " "
19903case "$sizetype" in
19904*_t) zzz="$sizetype" ;;
19905*) zzz="filesize" ;;
19906esac
19907echo "Checking the size of $zzz..." >&4
19908cat > try.c <<EOCP
19909#include <sys/types.h>
19910#include <stdio.h>
19911#$i_stdlib I_STDLIB
19912#ifdef I_STDLIB
19913#include <stdlib.h>
19914#endif
19915int main() {
19916 printf("%d\n", (int)sizeof($sizetype));
19917 exit(0);
19918}
19919EOCP
19920set try
19921if eval $compile_ok; then
19922 yyy=`$run ./try`
19923 case "$yyy" in
19924 '') sizesize=4
19925 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19926 ;;
19927 *) sizesize=$yyy
19928 echo "Your $zzz size is $sizesize bytes."
19929 ;;
19930 esac
19931else
19932 sizesize=4
19933 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19934fi
19935
19936
19937: check for socklen_t
19938echo " "
19939echo "Checking to see if you have socklen_t..." >&4
19940$cat >try.c <<EOCP
19941#include <sys/types.h>
19942#$d_socket HAS_SOCKET
19943#ifdef HAS_SOCKET
19944#include <sys/socket.h>
19945#endif
19946int main() { socklen_t x = 16; }
19947EOCP
19948set try
19949if eval $compile; then
19950 val="$define"
19951 echo "You have socklen_t."
19952else
19953 val="$undef"
19954 echo "You do not have socklen_t."
19955 case "$sizetype" in
19956 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19957 esac
19958fi
19959$rm -f try try.*
19960set d_socklen_t
19961eval $setvar
19962
19963: see if this is a socks.h system
19964set socks.h i_socks
19965eval $inhdr
19966
19967: check for type of the size argument to socket calls
19968case "$d_socket" in
19969"$define")
19970 $cat <<EOM
19971
19972Checking to see what type is the last argument of accept().
19973EOM
19974 yyy=''
19975 case "$d_socklen_t" in
19976 "$define") yyy="$yyy socklen_t"
19977 esac
19978 yyy="$yyy $sizetype int long unsigned"
19979 for xxx in $yyy; do
19980 case "$socksizetype" in
19981 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19982 case "$usesocks" in
19983 "$define")
19984 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19985 echo "Your system accepts '$xxx *' for the last argument of accept()."
19986 socksizetype="$xxx"
19987 fi
19988 ;;
19989 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19990 echo "Your system accepts '$xxx *' for the last argument of accept()."
19991 socksizetype="$xxx"
19992 fi
19993 ;;
19994 esac
19995 ;;
19996 esac
19997 done
19998: In case none of those worked, prompt the user.
19999 case "$socksizetype" in
20000 '') rp='What is the type for socket address structure sizes?'
20001 dflt='int'
20002 . ./myread
20003 socksizetype=$ans
20004 ;;
20005 esac
20006 ;;
20007*) : no sockets, so pick relatively harmless default
20008 socksizetype='int'
20009 ;;
20010esac
20011
20012: see what type is used for signed size_t
20013set ssize_t ssizetype int stdio.h sys/types.h
20014eval $typedef
20015dflt="$ssizetype"
20016$cat > try.c <<EOM
20017#include <stdio.h>
20018#$i_stdlib I_STDLIB
20019#ifdef I_STDLIB
20020#include <stdlib.h>
20021#endif
20022#include <sys/types.h>
20023#define Size_t $sizetype
20024#define SSize_t $dflt
20025int main()
20026{
20027 if (sizeof(Size_t) == sizeof(SSize_t))
20028 printf("$dflt\n");
20029 else if (sizeof(Size_t) == sizeof(int))
20030 printf("int\n");
20031 else
20032 printf("long\n");
20033 exit(0);
20034}
20035EOM
20036echo " "
20037set try
20038if eval $compile_ok && $run ./try > /dev/null; then
20039 ssizetype=`$run ./try`
20040 echo "I'll be using $ssizetype for functions returning a byte count." >&4
20041else
20042 $cat >&4 <<EOM
20043Help! I can't compile and run the ssize_t test program: please enlighten me!
20044(This is probably a misconfiguration in your system or libraries, and
20045you really ought to fix it. Still, I'll try anyway.)
20046
20047I need a type that is the same size as $sizetype, but is guaranteed to
20048be signed. Common values are ssize_t, int and long.
20049
20050EOM
20051 rp="What signed type is the same size as $sizetype?"
20052 . ./myread
20053 ssizetype="$ans"
20054fi
20055$rm -f try try.*
20056
20057: see what type of char stdio uses.
20058echo " "
20059echo '#include <stdio.h>' > stdio.c
20060$cppstdin $cppminus < stdio.c > stdioh
20061if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
20062 echo "Your stdio uses unsigned chars." >&4
20063 stdchar="unsigned char"
20064else
20065 echo "Your stdio uses signed chars." >&4
20066 stdchar="char"
20067fi
20068$rm -f stdio.* stdioh
20069
20070: see what type uids are declared as in the kernel
20071echo " "
20072echo "Looking for the type for user ids returned by getuid()."
20073set uid_t uidtype xxx stdio.h sys/types.h
20074eval $typedef
20075case "$uidtype" in
20076xxx)
20077 xxx=`./findhdr sys/user.h`
20078 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
20079 case $1 in
20080 unsigned) dflt="$1 $2" ;;
20081 *) dflt="$1" ;;
20082 esac
20083 ;;
20084*) dflt="$uidtype";;
20085esac
20086case "$uidtype" in
20087uid_t) echo "uid_t found." ;;
20088*) rp="What is the type for user ids returned by getuid()?"
20089 . ./myread
20090 uidtype="$ans"
20091 ;;
20092esac
20093
20094echo " "
20095case "$uidtype" in
20096*_t) zzz="$uidtype" ;;
20097*) zzz="uid" ;;
20098esac
20099echo "Checking the size of $zzz..." >&4
20100cat > try.c <<EOCP
20101#include <sys/types.h>
20102#include <stdio.h>
20103#$i_stdlib I_STDLIB
20104#ifdef I_STDLIB
20105#include <stdlib.h>
20106#endif
20107int main() {
20108 printf("%d\n", (int)sizeof($uidtype));
20109 exit(0);
20110}
20111EOCP
20112set try
20113if eval $compile_ok; then
20114 yyy=`$run ./try`
20115 case "$yyy" in
20116 '') uidsize=4
20117 echo "(I can't execute the test program--guessing $uidsize.)" >&4
20118 ;;
20119 *) uidsize=$yyy
20120 echo "Your $zzz is $uidsize bytes long."
20121 ;;
20122 esac
20123else
20124 uidsize=4
20125 echo "(I can't compile the test program--guessing $uidsize.)" >&4
20126fi
20127
20128echo " "
20129case "$uidtype" in
20130*_t) zzz="$uidtype" ;;
20131*) zzz="uid" ;;
20132esac
20133echo "Checking the sign of $zzz..." >&4
20134cat > try.c <<EOCP
20135#include <sys/types.h>
20136#include <stdio.h>
20137int main() {
20138 $uidtype foo = -1;
20139 if (foo < 0)
20140 printf("-1\n");
20141 else
20142 printf("1\n");
20143}
20144EOCP
20145set try
20146if eval $compile; then
20147 yyy=`$run ./try`
20148 case "$yyy" in
20149 '') uidsign=1
20150 echo "(I can't execute the test program--guessing unsigned.)" >&4
20151 ;;
20152 *) uidsign=$yyy
20153 case "$uidsign" in
20154 1) echo "Your $zzz is unsigned." ;;
20155 -1) echo "Your $zzz is signed." ;;
20156 esac
20157 ;;
20158 esac
20159else
20160 uidsign=1
20161 echo "(I can't compile the test program--guessing unsigned.)" >&4
20162fi
20163
20164
20165
20166echo " "
20167$echo "Checking the format string to be used for uids..." >&4
20168
20169case "$uidsign" in
20170-1) if $test X"$uidsize" = X"$ivsize"; then
20171 uidformat="$ivdformat"
20172 else
20173 if $test X"$uidsize" = X"$longsize"; then
20174 uidformat='"ld"'
20175 else
20176 if $test X"$uidsize" = X"$intsize"; then
20177 uidformat='"d"'
20178 else
20179 if $test X"$uidsize" = X"$shortsize"; then
20180 uidformat='"hd"'
20181 fi
20182 fi
20183 fi
20184 fi
20185 ;;
20186*) if $test X"$uidsize" = X"$uvsize"; then
20187 uidformat="$uvuformat"
20188 else
20189 if $test X"$uidsize" = X"$longsize"; then
20190 uidformat='"lu"'
20191 else
20192 if $test X"$uidsize" = X"$intsize"; then
20193 uidformat='"u"'
20194 else
20195 if $test X"$uidsize" = X"$shortsize"; then
20196 uidformat='"hu"'
20197 fi
20198 fi
20199 fi
20200 fi
20201 ;;
20202esac
20203
20204
20205case "$usesitecustomize" in
20206 $define|true|[Yy]*)
20207 usesitecustomize="$define"
20208 ;;
20209 *)
20210 usesitecustomize="$undef"
20211 ;;
20212 esac
20213
20214: determine compiler compiler
20215case "$yacc" in
20216'')
20217 dflt=yacc;;
20218*)
20219 dflt="$yacc";;
20220esac
20221echo " "
20222comp='yacc'
20223if $test -f "$byacc$_exe"; then
20224 dflt="$byacc"
20225 comp="byacc or $comp"
20226fi
20227if $test -f "$bison$_exe"; then
20228 comp="$comp or bison -y"
20229fi
20230rp="Which compiler compiler ($comp) shall I use?"
20231. ./myread
20232yacc="$ans"
20233case "$yacc" in
20234*bis*)
20235 case "$yacc" in
20236 *-y*) ;;
20237 *)
20238 yacc="$yacc -y"
20239 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
20240 ;;
20241 esac
20242 ;;
20243esac
20244
20245: see if this is a fp.h system
20246set fp.h i_fp
20247eval $inhdr
20248
20249: see if this is a fp_class.h system
20250set fp_class.h i_fp_class
20251eval $inhdr
20252
20253: see if this is a ieeefp.h system
20254case "$i_ieeefp" in
20255'' ) set ieeefp.h i_ieeefp
20256 eval $inhdr
20257 ;;
20258esac
20259
20260: see if this is a libutil.h system
20261set libutil.h i_libutil
20262eval $inhdr
20263
20264: see if mach cthreads are available
20265if test "X$usethreads" = "X$define"; then
20266 set mach/cthreads.h i_machcthr
20267 eval $inhdr
20268else
20269 i_machcthr="$undef"
20270fi
20271
20272
20273
20274: see if this is a mntent.h system
20275set mntent.h i_mntent
20276eval $inhdr
20277
20278: see if ndbm.h is available
20279set ndbm.h t_ndbm
20280eval $inhdr
20281
20282case "$t_ndbm" in
20283$undef)
20284 # Some Linux distributions such as RedHat 7.1 put the
20285 # ndbm.h header in /usr/include/gdbm/ndbm.h.
20286 if $test -f /usr/include/gdbm/ndbm.h; then
20287 echo '<gdbm/ndbm.h> found.'
20288 ccflags="$ccflags -I/usr/include/gdbm"
20289 cppflags="$cppflags -I/usr/include/gdbm"
20290 t_ndbm=$define
20291 fi
20292 ;;
20293esac
20294
20295case "$t_ndbm" in
20296$define)
20297 : see if dbm_open exists
20298 set dbm_open d_dbm_open
20299 eval $inlibc
20300 case "$d_dbm_open" in
20301 $undef)
20302 t_ndbm="$undef"
20303 echo "We won't be including <ndbm.h>"
20304 ;;
20305 esac
20306 ;;
20307esac
20308val="$t_ndbm"
20309set i_ndbm
20310eval $setvar
20311
20312: see if net/errno.h is available
20313val=''
20314set net/errno.h val
20315eval $inhdr
20316
20317: Unfortunately, it causes problems on some systems. Arrgh.
20318case "$val" in
20319$define)
20320 cat > try.c <<'EOM'
20321#include <stdio.h>
20322#include <errno.h>
20323#include <net/errno.h>
20324int func()
20325{
20326 return ENOTSOCK;
20327}
20328EOM
20329 if $cc $ccflags -c try.c >/dev/null 2>&1; then
20330 echo "We'll be including <net/errno.h>." >&4
20331 else
20332 echo "We won't be including <net/errno.h>." >&4
20333 val="$undef"
20334 fi
20335 $rm -f try.* try
20336 ;;
20337esac
20338set i_neterrno
20339eval $setvar
20340
20341: see if netinet/tcp.h is available
20342set netinet/tcp.h i_netinettcp
20343eval $inhdr
20344
20345: see if this is a poll.h system
20346set poll.h i_poll
20347eval $inhdr
20348
20349: see if this is a prot.h system
20350set prot.h i_prot
20351eval $inhdr
20352
20353echo " "
20354$echo "Guessing which symbols your C compiler and preprocessor define..." >&4
20355$cat <<'EOSH' > Cppsym.know
20356a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
20357AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
20358alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
20359ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
20360BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
20361BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
20362bull c cadmus clipper CMU COFF COMPILER_VERSION
20363concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
20364CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
20365Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
20366FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
20367GLIBC GLIBC_MINOR
20368GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
20369H3050R H3050RX hbullx20 hcx host_mips
20370hp200 hp300 hp700 HP700 hp800 hp9000
20371hp9000s200 hp9000s300 hp9000s400 hp9000s500
20372hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
20373i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
20374IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
20375INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
20376LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
20377LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
20378Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
20379LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
20380M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
20381M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
20382M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
20383MATH_HAS_NO_SIDE_EFFECTS
20384mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
20385mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
20386mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
20387MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
20388mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
20389NetBSD news1500 news1700 news1800 news1900 news3700
20390news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
20391ns32016 ns32332 ns32k nsc32000
20392OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
20393pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
20394pc532 pdp11 PGC PIC plexus PORTAR posix
20395POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
20396POSIX_C_SOURCE POSIX_SOURCE POWER
20397PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
20398riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
20399SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
20400sony sony_news sonyrisc sparc sparclite spectrum
20401stardent stdc STDC_EXT stratos sun sun3 sun386
20402Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
20403SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
20404SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
20405sysV68 sysV88 Tek4132 Tek4300 titan
20406TM3200 TM5400 TM5600
20407tower tower32 tower32_200 tower32_600 tower32_700
20408tower32_800 tower32_850 tss
20409u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
20410ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
20411unix UNIX95 UNIX99 unixpc unos
20412USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
20413USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
20414USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
20415USGr4 USGr4_2
20416Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
20417XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
20418XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
20419z8000
20420EOSH
20421# Maybe put other stuff here too.
20422cat <<EOSH >>Cppsym.know
20423$osname
20424EOSH
20425./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
20426./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
20427$cat Cppsym.know > Cppsym.c
20428$cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
20429$rm -f Cppsym.a Cppsym.b Cppsym.c
20430cat <<EOSH > Cppsym
20431$startsh
20432if $test \$# -gt 0; then
20433 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
20434 if $test -s Cppsym.got; then
20435 $rm -f Cppsym.got
20436 exit 0
20437 fi
20438 $rm -f Cppsym.got
20439 exit 1
20440else
20441 $tr " " "$trnl" | ./Cppsym.try
20442 exit 0
20443fi
20444EOSH
20445chmod +x Cppsym
20446$eunicefix Cppsym
20447cat <<EOSH > Cppsym.try
20448$startsh
20449cat <<'EOCP' > try.c
20450#include <stdio.h>
20451#if cpp_stuff == 1
20452#define STRINGIFY(a) "a"
20453#endif
20454#if cpp_stuff == 42
20455#define StGiFy(a) #a
20456#define STRINGIFY(a) StGiFy(a)
20457#endif
20458#if $cpp_stuff != 1 && $cpp_stuff != 42
20459# include "Bletch: How does this C preprocessor stringify macros?"
20460#endif
20461int main() {
20462EOCP
20463$awk \\
20464EOSH
20465cat <<'EOSH' >> Cppsym.try
20466'length($1) > 0 {
20467 printf "#ifdef %s\nprintf(\"%s=%%s\\n\", STRINGIFY(%s));\n#endif\n", $1, $1, $1
20468 printf "#ifdef _%s\nprintf(\"_%s=%%s\\n\", STRINGIFY(_%s));\n#endif\n", $1, $1, $1
20469 printf "#ifdef __%s\nprintf(\"__%s=%%s\\n\", STRINGIFY(__%s));\n#endif\n", $1, $1, $1
20470 printf "#ifdef __%s__\nprintf(\"__%s__=%%s\\n\", STRINGIFY(__%s__));\n#endif\n", $1, $1, $1
20471}' >> try.c
20472echo 'return 0;}' >> try.c
20473EOSH
20474cat <<EOSH >> Cppsym.try
20475ccflags="$ccflags"
20476case "$osname-$gccversion" in
20477irix-) ccflags="\$ccflags -woff 1178" ;;
20478os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
20479esac
20480$cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
20481EOSH
20482chmod +x Cppsym.try
20483$eunicefix Cppsym.try
20484./Cppsym < Cppsym.know > Cppsym.true
20485: Add in any linux cpp "predefined macros":
20486case "$osname::$gccversion" in
20487 *linux*::*.*)
20488 tHdrH=_tmpHdr
20489 rm -f $tHdrH'.h' $tHdrH
20490 touch $tHdrH'.h'
20491 if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
20492 sed 's/#define[\ \ ]*//;s/[\ \ ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
20493 if [ -s $tHdrH'_cppsym.real' ]; then
20494 cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
20495 fi
20496 fi
20497 rm -f $tHdrH'.h' $tHdrH'_cppsym.h' $tHdrH'_cppsym.real'
20498 ;;
20499esac
20500: now check the C compiler for additional symbols
20501postprocess_cc_v=''
20502case "$osname" in
20503aix) postprocess_cc_v="|$tr , ' '" ;;
20504esac
20505$cat >ccsym <<EOS
20506$startsh
20507$cat >tmp.c <<EOF
20508extern int foo;
20509EOF
20510for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
20511do
20512 case "\$i" in
20513 -D*) echo "\$i" | $sed 's/^-D//';;
20514 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
20515 esac
20516done
20517$rm -f try.c
20518EOS
20519postprocess_cc_v=''
20520chmod +x ccsym
20521$eunicefix ccsym
20522./ccsym > ccsym1.raw
20523if $test -s ccsym1.raw; then
20524 $sort ccsym1.raw | $uniq >ccsym.raw
20525else
20526 mv ccsym1.raw ccsym.raw
20527fi
20528
20529$awk '/\=/ { print $0; next }
20530 { print $0"=1" }' ccsym.raw >ccsym.list
20531$comm -13 Cppsym.true ccsym.list >ccsym.own
20532$comm -12 Cppsym.true ccsym.list >ccsym.com
20533$comm -23 Cppsym.true ccsym.list >ccsym.cpp
20534also=''
20535if $test -z ccsym.raw; then
20536 echo "Your C compiler doesn't seem to define any symbols!" >&4
20537 echo " "
20538 echo "However, your C preprocessor defines the following symbols:"
20539 $cat Cppsym.true
20540 ccsymbols=''
20541 cppsymbols=`$cat Cppsym.true`
20542 cppsymbols=`echo $cppsymbols`
20543 cppccsymbols="$cppsymbols"
20544else
20545 if $test -s ccsym.com; then
20546 echo "Your C compiler and pre-processor define these symbols:"
20547 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
20548 also='also '
20549 symbols='ones'
20550 cppccsymbols=`$cat ccsym.com`
20551 cppccsymbols=`echo $cppccsymbols`
20552 $test "$silent" || sleep 1
20553 fi
20554 if $test -s ccsym.cpp; then
20555 $test "$also" && echo " "
20556 echo "Your C pre-processor ${also}defines the following symbols:"
20557 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
20558 also='further '
20559 cppsymbols=`$cat ccsym.cpp`
20560 cppsymbols=`echo $cppsymbols`
20561 $test "$silent" || sleep 1
20562 fi
20563 if $test -s ccsym.own; then
20564 $test "$also" && echo " "
20565 echo "Your C compiler ${also}defines the following cpp symbols:"
20566 $sed -e 's/\(..*\)=1/\1/' ccsym.own
20567 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
20568 ccsymbols=`$cat ccsym.own`
20569 ccsymbols=`echo $ccsymbols`
20570 $test "$silent" || sleep 1
20571 fi
20572fi
20573
20574: see if this is a termio system
20575val="$undef"
20576val2="$undef"
20577val3="$undef"
20578if $test `./findhdr termios.h`; then
20579 set tcsetattr i_termios
20580 eval $inlibc
20581 val3="$i_termios"
20582fi
20583echo " "
20584case "$val3" in
20585"$define") echo "You have POSIX termios.h... good!" >&4;;
20586*) if ./Cppsym pyr; then
20587 case "`/bin/universe`" in
20588 ucb) if $test `./findhdr sgtty.h`; then
20589 val2="$define"
20590 echo "<sgtty.h> found." >&4
20591 else
20592 echo "System is pyramid with BSD universe."
20593 echo "<sgtty.h> not found--you could have problems." >&4
20594 fi;;
20595 *) if $test `./findhdr termio.h`; then
20596 val="$define"
20597 echo "<termio.h> found." >&4
20598 else
20599 echo "System is pyramid with USG universe."
20600 echo "<termio.h> not found--you could have problems." >&4
20601 fi;;
20602 esac
20603 elif ./usg; then
20604 if $test `./findhdr termio.h`; then
20605 echo "<termio.h> found." >&4
20606 val="$define"
20607 elif $test `./findhdr sgtty.h`; then
20608 echo "<sgtty.h> found." >&4
20609 val2="$define"
20610 else
20611echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
20612 fi
20613 else
20614 if $test `./findhdr sgtty.h`; then
20615 echo "<sgtty.h> found." >&4
20616 val2="$define"
20617 elif $test `./findhdr termio.h`; then
20618 echo "<termio.h> found." >&4
20619 val="$define"
20620 else
20621echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
20622 fi
20623 fi;;
20624esac
20625set i_termio; eval $setvar
20626val=$val2; set i_sgtty; eval $setvar
20627val=$val3; set i_termios; eval $setvar
20628
20629: see if stddef is available
20630set stddef.h i_stddef
20631eval $inhdr
20632
20633: see if this is a sunmath.h system
20634set sunmath.h i_sunmath
20635eval $inhdr
20636
20637: see if sys/access.h is available
20638set sys/access.h i_sysaccess
20639eval $inhdr
20640
20641: see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
20642set sys/filio.h i_sysfilio
20643eval $inhdr
20644echo " "
20645if $test `./findhdr sys/ioctl.h`; then
20646 val="$define"
20647 echo '<sys/ioctl.h> found.' >&4
20648else
20649 val="$undef"
20650 if $test $i_sysfilio = "$define"; then
20651 echo '<sys/ioctl.h> NOT found.' >&4
20652 else
20653 $test $i_sgtty = "$define" && xxx="sgtty.h"
20654 $test $i_termio = "$define" && xxx="termio.h"
20655 $test $i_termios = "$define" && xxx="termios.h"
20656echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
20657 fi
20658fi
20659set i_sysioctl
20660eval $setvar
20661
20662: see if socket ioctl defs are in sys/sockio.h
20663echo " "
20664xxx=`./findhdr sys/sockio.h`
20665if $test "$xxx"; then
20666 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
20667 val="$define"
20668 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
20669 else
20670 val="$undef"
20671 echo "No socket ioctls found in <sys/sockio.h>." >&4
20672 fi
20673else
20674 val="$undef"
20675 $cat <<EOM
20676<sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
20677EOM
20678fi
20679set i_syssockio
20680eval $setvar
20681
20682
20683: see if this is a syslog.h system
20684set syslog.h i_syslog
20685eval $inhdr
20686
20687
20688: see if this is a sys/mode.h system
20689set sys/mode.h i_sysmode
20690eval $inhdr
20691
20692: see if sys/resource.h has to be included
20693set sys/resource.h i_sysresrc
20694eval $inhdr
20695
20696: see if sys/security.h is available
20697set sys/security.h i_syssecrt
20698eval $inhdr
20699
20700: see if this is a sys/statvfs.h system
20701set sys/statvfs.h i_sysstatvfs
20702eval $inhdr
20703
20704: see if this is a sys/un.h system
20705set sys/un.h i_sysun
20706eval $inhdr
20707
20708
20709: see if this is a sys/utsname.h system
20710set sys/utsname.h i_sysutsname
20711eval $inhdr
20712
20713: see if this is a syswait system
20714set sys/wait.h i_syswait
20715eval $inhdr
20716
20717: see if this is a ustat.h system
20718set ustat.h i_ustat
20719eval $inhdr
20720
20721: see if this is an utime system
20722set utime.h i_utime
20723eval $inhdr
20724
20725: see if this is a values.h system
20726set values.h i_values
20727eval $inhdr
20728
20729: see if this is a vfork system
20730case "$d_vfork" in
20731"$define")
20732 set vfork.h i_vfork
20733 eval $inhdr
20734 ;;
20735*)
20736 i_vfork="$undef"
20737 ;;
20738esac
20739
20740: see if gdbm.h is available
20741set gdbm.h t_gdbm
20742eval $inhdr
20743case "$t_gdbm" in
20744$define)
20745 : see if gdbm_open exists
20746 set gdbm_open d_gdbm_open
20747 eval $inlibc
20748 case "$d_gdbm_open" in
20749 $undef)
20750 t_gdbm="$undef"
20751 echo "We won't be including <gdbm.h>"
20752 ;;
20753 esac
20754 ;;
20755esac
20756val="$t_gdbm"
20757set i_gdbm
20758eval $setvar
20759
20760echo " "
20761echo "Looking for extensions..." >&4
20762: If we are using the old config.sh, known_extensions may contain
20763: old or inaccurate or duplicate values.
20764known_extensions=''
20765nonxs_extensions=''
20766: We do not use find because it might not be available.
20767: We do not just use MANIFEST because the user may have dropped
20768: some additional extensions into the source tree and expect them
20769: to be built.
20770
20771: Function to recursively find available extensions, ignoring DynaLoader
20772: NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20773find_extensions='
20774 for xxx in *; do
20775 case "$xxx" in
20776 DynaLoader|dynaload) ;;
20777 *)
20778 if $test -f $xxx/$xxx.xs; then
20779 known_extensions="$known_extensions $1$xxx";
20780 elif $test -f $xxx/Makefile.PL; then
20781 nonxs_extensions="$nonxs_extensions $1$xxx";
20782 else
20783 if $test -d $xxx -a $# -lt 10; then
20784 set $1$xxx/ $*;
20785 cd "$xxx";
20786 eval $find_extensions;
20787 cd ..;
20788 shift;
20789 fi;
20790 fi
20791 ;;
20792 esac;
20793 done'
20794tdir=`pwd`
20795cd "$rsrc/ext"
20796set X
20797shift
20798eval $find_extensions
20799# Special case: Add in threads/shared since it is not picked up by the
20800# recursive find above (and adding in general recursive finding breaks
20801# SDBM_File/sdbm). A.D. 10/25/2001.
20802known_extensions="$known_extensions threads/shared"
20803set X $nonxs_extensions
20804shift
20805nonxs_extensions="$*"
20806set X $known_extensions
20807shift
20808known_extensions="$*"
20809cd "$tdir"
20810
20811: Now see which are supported on this system.
20812avail_ext=''
20813for xxx in $known_extensions ; do
20814 case "$xxx" in
20815 DB_File|db_file)
20816 case "$i_db" in
20817 $define) avail_ext="$avail_ext $xxx" ;;
20818 esac
20819 ;;
20820 GDBM_File|gdbm_fil)
20821 case "$i_gdbm" in
20822 $define) avail_ext="$avail_ext $xxx" ;;
20823 esac
20824 ;;
20825 I18N/Langinfo|i18n_lan)
20826 case "$i_langinfo$d_nl_langinfo" in
20827 $define$define) avail_ext="$avail_ext $xxx" ;;
20828 esac
20829 ;;
20830 NDBM_File|ndbm_fil)
20831 case "$i_ndbm" in
20832 $define)
20833 case "$osname-$use64bitint" in
20834 hpux-define)
20835 case "$libs" in
20836 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20837 esac
20838 ;;
20839 *) avail_ext="$avail_ext $xxx" ;;
20840 esac
20841 ;;
20842 esac
20843 ;;
20844 ODBM_File|odbm_fil)
20845 case "${i_dbm}${i_rpcsvcdbm}" in
20846 *"${define}"*)
20847 case "$osname-$use64bitint" in
20848 hpux-define)
20849 case "$libs" in
20850 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20851 esac
20852 ;;
20853 *) avail_ext="$avail_ext $xxx" ;;
20854 esac
20855 ;;
20856 esac
20857 ;;
20858 POSIX|posix)
20859 case "$useposix" in
20860 true|define|y) avail_ext="$avail_ext $xxx" ;;
20861 esac
20862 ;;
20863 Opcode|opcode)
20864 case "$useopcode" in
20865 true|define|y) avail_ext="$avail_ext $xxx" ;;
20866 esac
20867 ;;
20868 Socket|socket)
20869 case "$d_socket" in
20870 true|$define|y)
20871 case "$osname" in
20872 beos) ;; # not unless BONE
20873 *) avail_ext="$avail_ext $xxx" ;;
20874 esac
20875 ;;
20876 esac
20877 ;;
20878 Sys/Syslog|sys/syslog)
20879 : XXX syslog requires socket
20880 case "$d_socket" in
20881 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20882 esac
20883 ;;
20884 Thread|thread)
20885 case "$usethreads" in
20886 true|$define|y)
20887 case "$useithreads" in
20888 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20889 esac
20890 esac
20891 ;;
20892 XS/APItest|xs/apitest)
20893 # This is just for testing. Skip it unless we have dynamic loading.
20894
20895 case "$usedl" in
20896 $define) avail_ext="$avail_ext $xxx" ;;
20897 esac
20898 ;;
20899 XS/Typemap|xs/typemap)
20900 # This is just for testing. Skip it unless we have dynamic loading.
20901 case "$usedl" in
20902 $define) avail_ext="$avail_ext $xxx" ;;
20903 esac
20904 ;;
20905 threads|threads/shared)
20906 # threads and threads::shared are special cases.
20907 # To stop people from asking "Perl 5.8.0 was supposed
20908 # to have this new fancy threads implementation but my
20909 # perl doesn't have it" and from people trying to
20910 # (re)install the threads module using CPAN.pm and
20911 # CPAN.pm then offering to reinstall Perl 5.8.0,
20912 # the threads.pm and threads/shared.pm will always be
20913 # there, croaking informatively ("you need to rebuild
20914 # all of Perl with threads, sorry") when threads haven't
20915 # been compiled in.
20916 # --jhi
20917 avail_ext="$avail_ext $xxx"
20918 ;;
20919 IPC/SysV|ipc/sysv)
20920 : XXX Do we need a useipcsysv variable here
20921 case "${d_msg}${d_sem}${d_shm}" in
20922 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20923 esac
20924 ;;
20925 *) avail_ext="$avail_ext $xxx"
20926 ;;
20927 esac
20928done
20929
20930set X $avail_ext
20931shift
20932avail_ext="$*"
20933
20934case "$onlyextensions" in
20935'') ;;
20936*) keepextensions=''
20937 echo "You have requested that only certains extensions be included..." >&4
20938 for i in $onlyextensions; do
20939 case " $avail_ext " in
20940 *" $i "*)
20941 echo "Keeping extension $i."
20942 keepextensions="$keepextensions $i"
20943 ;;
20944 *) echo "Ignoring extension $i." ;;
20945 esac
20946 done
20947 avail_ext="$keepextensions"
20948 ;;
20949esac
20950
20951case "$noextensions" in
20952'') ;;
20953*) keepextensions=''
20954 echo "You have requested that certain extensions be ignored..." >&4
20955 for i in $avail_ext; do
20956 case " $noextensions " in
20957 *" $i "*) echo "Ignoring extension $i." ;;
20958 *) echo "Keeping extension $i.";
20959 keepextensions="$keepextensions $i"
20960 ;;
20961 esac
20962 done
20963 avail_ext="$keepextensions"
20964 ;;
20965esac
20966
20967: Now see which nonxs extensions are supported on this system.
20968: For now assume all are.
20969nonxs_ext=''
20970for xxx in $nonxs_extensions ; do
20971 case "$xxx" in
20972 *) nonxs_ext="$nonxs_ext $xxx"
20973 ;;
20974 esac
20975done
20976
20977set X $nonxs_ext
20978shift
20979nonxs_ext="$*"
20980
20981case $usedl in
20982$define)
20983 $cat <<EOM
20984A number of extensions are supplied with $package. You may choose to
20985compile these extensions for dynamic loading (the default), compile
20986them into the $package executable (static loading), or not include
20987them at all. Answer "none" to include no extensions.
20988Note that DynaLoader is always built and need not be mentioned here.
20989
20990EOM
20991 case "$dynamic_ext" in
20992 '')
20993 : Exclude those listed in static_ext
20994 dflt=''
20995 for xxx in $avail_ext; do
20996 case " $static_ext " in
20997 *" $xxx "*) ;;
20998 *) dflt="$dflt $xxx" ;;
20999 esac
21000 done
21001 set X $dflt
21002 shift
21003 dflt="$*"
21004 ;;
21005 *) dflt="$dynamic_ext"
21006 # Perhaps we are reusing an old out-of-date config.sh.
21007 case "$hint" in
21008 previous)
21009 if test X"$dynamic_ext" != X"$avail_ext"; then
21010 $cat <<EOM
21011NOTICE: Your previous config.sh list may be incorrect.
21012The extensions now available to you are
21013 ${avail_ext}
21014but the default list from your previous config.sh is
21015 ${dynamic_ext}
21016
21017EOM
21018 fi
21019 ;;
21020 esac
21021 ;;
21022 esac
21023 case "$dflt" in
21024 '') dflt=none;;
21025 esac
21026 rp="What extensions do you wish to load dynamically?"
21027 . ./myread
21028 case "$ans" in
21029 none) dynamic_ext=' ' ;;
21030 *) dynamic_ext="$ans" ;;
21031 esac
21032
21033 case "$static_ext" in
21034 '')
21035 : Exclude those already listed in dynamic linking
21036 dflt=''
21037 for xxx in $avail_ext; do
21038 case " $dynamic_ext " in
21039 *" $xxx "*) ;;
21040 *) dflt="$dflt $xxx" ;;
21041 esac
21042 done
21043 set X $dflt
21044 shift
21045 dflt="$*"
21046 ;;
21047 *) dflt="$static_ext"
21048 ;;
21049 esac
21050
21051 case "$dflt" in
21052 '') dflt=none;;
21053 esac
21054 rp="What extensions do you wish to load statically?"
21055 . ./myread
21056 case "$ans" in
21057 none) static_ext=' ' ;;
21058 *) static_ext="$ans" ;;
21059 esac
21060 ;;
21061*)
21062 $cat <<EOM
21063A number of extensions are supplied with $package. Answer "none"
21064to include no extensions.
21065Note that DynaLoader is always built and need not be mentioned here.
21066
21067EOM
21068 case "$static_ext" in
21069 '') dflt="$avail_ext" ;;
21070 *) dflt="$static_ext"
21071 # Perhaps we are reusing an old out-of-date config.sh.
21072 case "$hint" in
21073 previous)
21074 if test X"$static_ext" != X"$avail_ext"; then
21075 $cat <<EOM
21076NOTICE: Your previous config.sh list may be incorrect.
21077The extensions now available to you are
21078 ${avail_ext}
21079but the default list from your previous config.sh is
21080 ${static_ext}
21081
21082EOM
21083 fi
21084 ;;
21085 esac
21086 ;;
21087 esac
21088 : Exclude those that are not xs extensions
21089 case "$dflt" in
21090 '') dflt=none;;
21091 esac
21092 rp="What extensions do you wish to include?"
21093 . ./myread
21094 case "$ans" in
21095 none) static_ext=' ' ;;
21096 *) static_ext="$ans" ;;
21097 esac
21098 ;;
21099esac
21100#
21101# Encode is a special case. If we are building Encode as a static
21102# extension, we need to explicitly list its subextensions as well.
21103# For other nested extensions, this is handled automatically by
21104# the appropriate Makefile.PL.
21105case " $static_ext " in
21106 *" Encode "*) # Add the subextensions of Encode
21107 cd "$rsrc/ext"
21108 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
21109 static_ext="$static_ext Encode/$xxx"
21110 done
21111 cd "$tdir"
21112 ;;
21113esac
21114
21115set X $dynamic_ext $static_ext $nonxs_ext
21116shift
21117extensions="$*"
21118
21119# Sanity check: We require an extension suitable for use with
21120# AnyDBM_File, as well as Fcntl and IO. (Failure to have these
21121# should show up as failures in the test suite, but it's helpful to
21122# catch them now.) The 'extensions' list is normally sorted
21123# alphabetically, so we need to accept either
21124# DB_File ... Fcntl ... IO ....
21125# or something like
21126# Fcntl ... NDBM_File ... IO ....
21127case " $extensions" in
21128*"_File "*" Fcntl "*" IO "*) ;; # DB_File
21129*" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
21130*" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
21131*) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
21132 echo "WARNING: The Perl you are building will be quite crippled." >& 4
21133 ;;
21134esac
21135
21136: Remove libraries needed only for extensions
21137: The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
21138: The exception is SunOS 4.x, which needs them.
21139case "${osname}X${osvers}" in
21140sunos*X4*)
21141 perllibs="$libs"
21142 ;;
21143*) case "$usedl" in
21144 $define|true|[yY]*)
21145 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
21146 shift
21147 perllibs="$*"
21148 ;;
21149 *) perllibs="$libs"
21150 ;;
21151 esac
21152 ;;
21153esac
21154
21155: Remove build directory name from cppstdin so it can be used from
21156: either the present location or the final installed location.
21157echo " "
21158: Get out of the UU directory to get correct path name.
21159cd ..
21160case "$cppstdin" in
21161`pwd`/cppstdin)
21162 echo "Stripping down cppstdin path name"
21163 cppstdin=cppstdin
21164 ;;
21165esac
21166cd UU
21167
21168: end of configuration questions
21169echo " "
21170echo "End of configuration questions."
21171echo " "
21172
21173: back to where it started
21174if test -d ../UU; then
21175 cd ..
21176fi
21177
21178: configuration may be patched via a 'config.arch' file
21179if $test -f config.arch; then
21180 echo "I see a config.arch file, loading it."
21181 . ./config.arch
21182fi
21183
21184: configuration may be patched via a 'config.over' file
21185if $test -f config.over; then
21186 echo " "
21187 dflt=y
21188 rp='I see a config.over file. Do you wish to load it?'
21189 . UU/myread
21190 case "$ans" in
21191 n*) echo "OK, I'll ignore it.";;
21192 *) . ./config.over
21193 echo "Configuration override changes have been loaded."
21194 ;;
21195 esac
21196fi
21197
21198: in case they want portability, strip down executable paths
21199case "$d_portable" in
21200"$define")
21201 echo " "
21202 echo "Stripping down executable paths..." >&4
21203 for file in $loclist $trylist; do
21204 eval temp=\$$file
21205 eval $file=`basename $temp`
21206 done
21207 ;;
21208esac
21209
21210: create config.sh file
21211echo " "
21212echo "Creating config.sh..." >&4
21213$spitshell <<EOT >config.sh
21214$startsh
21215#
21216# This file was produced by running the Configure script. It holds all the
21217# definitions figured out by Configure. Should you modify one of these values,
21218# do not forget to propagate your changes by running "Configure -der". You may
21219# instead choose to run each of the .SH files by yourself, or "Configure -S".
21220#
21221
21222# Package name : $package
21223# Source directory : $src
21224# Configuration time: $cf_time
21225# Configured by : $cf_by
21226# Target system : $myuname
21227
21228Author='$Author'
21229Date='$Date'
21230Header='$Header'
21231Id='$Id'
21232Locker='$Locker'
21233Log='$Log'
21234Mcc='$Mcc'
21235RCSfile='$RCSfile'
21236Revision='$Revision'
21237Source='$Source'
21238State='$State'
21239_a='$_a'
21240_exe='$_exe'
21241_o='$_o'
21242afs='$afs'
21243afsroot='$afsroot'
21244alignbytes='$alignbytes'
21245ansi2knr='$ansi2knr'
21246aphostname='$aphostname'
21247api_revision='$api_revision'
21248api_subversion='$api_subversion'
21249api_version='$api_version'
21250api_versionstring='$api_versionstring'
21251ar='$ar'
21252archlib='$archlib'
21253archlibexp='$archlibexp'
21254archname64='$archname64'
21255archname='$archname'
21256archobjs='$archobjs'
21257asctime_r_proto='$asctime_r_proto'
21258awk='$awk'
21259baserev='$baserev'
21260bash='$bash'
21261bin='$bin'
21262binexp='$binexp'
21263bison='$bison'
21264byacc='$byacc'
21265byteorder='$byteorder'
21266c='$c'
21267castflags='$castflags'
21268cat='$cat'
21269cc='$cc'
21270cccdlflags='$cccdlflags'
21271ccdlflags='$ccdlflags'
21272ccflags='$ccflags'
21273ccflags_uselargefiles='$ccflags_uselargefiles'
21274ccname='$ccname'
21275ccsymbols='$ccsymbols'
21276ccversion='$ccversion'
21277cf_by='$cf_by'
21278cf_email='$cf_email'
21279cf_time='$cf_time'
21280charsize='$charsize'
21281chgrp='$chgrp'
21282chmod='$chmod'
21283chown='$chown'
21284clocktype='$clocktype'
21285comm='$comm'
21286compress='$compress'
21287contains='$contains'
21288cp='$cp'
21289cpio='$cpio'
21290cpp='$cpp'
21291cpp_stuff='$cpp_stuff'
21292cppccsymbols='$cppccsymbols'
21293cppflags='$cppflags'
21294cpplast='$cpplast'
21295cppminus='$cppminus'
21296cpprun='$cpprun'
21297cppstdin='$cppstdin'
21298cppsymbols='$cppsymbols'
21299crypt_r_proto='$crypt_r_proto'
21300cryptlib='$cryptlib'
21301csh='$csh'
21302ctermid_r_proto='$ctermid_r_proto'
21303ctime_r_proto='$ctime_r_proto'
21304d_Gconvert='$d_Gconvert'
21305d_PRIEUldbl='$d_PRIEUldbl'
21306d_PRIFUldbl='$d_PRIFUldbl'
21307d_PRIGUldbl='$d_PRIGUldbl'
21308d_PRIXU64='$d_PRIXU64'
21309d_PRId64='$d_PRId64'
21310d_PRIeldbl='$d_PRIeldbl'
21311d_PRIfldbl='$d_PRIfldbl'
21312d_PRIgldbl='$d_PRIgldbl'
21313d_PRIi64='$d_PRIi64'
21314d_PRIo64='$d_PRIo64'
21315d_PRIu64='$d_PRIu64'
21316d_PRIx64='$d_PRIx64'
21317d_SCNfldbl='$d_SCNfldbl'
21318d__fwalk='$d__fwalk'
21319d_access='$d_access'
21320d_accessx='$d_accessx'
21321d_aintl='$d_aintl'
21322d_alarm='$d_alarm'
21323d_archlib='$d_archlib'
21324d_asctime_r='$d_asctime_r'
21325d_atolf='$d_atolf'
21326d_atoll='$d_atoll'
21327d_attribute_format='$d_attribute_format'
21328d_attribute_malloc='$d_attribute_malloc'
21329d_attribute_nonnull='$d_attribute_nonnull'
21330d_attribute_noreturn='$d_attribute_noreturn'
21331d_attribute_pure='$d_attribute_pure'
21332d_attribute_unused='$d_attribute_unused'
21333d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
21334d_bcmp='$d_bcmp'
21335d_bcopy='$d_bcopy'
21336d_bsd='$d_bsd'
21337d_bsdgetpgrp='$d_bsdgetpgrp'
21338d_bsdsetpgrp='$d_bsdsetpgrp'
21339d_builtin_choose_expr='$d_builtin_choose_expr'
21340d_builtin_expect='$d_builtin_expect'
21341d_bzero='$d_bzero'
21342d_c99_variadic_macros='$d_c99_variadic_macros'
21343d_casti32='$d_casti32'
21344d_castneg='$d_castneg'
21345d_charvspr='$d_charvspr'
21346d_chown='$d_chown'
21347d_chroot='$d_chroot'
21348d_chsize='$d_chsize'
21349d_class='$d_class'
21350d_clearenv='$d_clearenv'
21351d_closedir='$d_closedir'
21352d_cmsghdr_s='$d_cmsghdr_s'
21353d_const='$d_const'
21354d_copysignl='$d_copysignl'
21355d_cplusplus='$d_cplusplus'
21356d_crypt='$d_crypt'
21357d_crypt_r='$d_crypt_r'
21358d_csh='$d_csh'
21359d_ctermid_r='$d_ctermid_r'
21360d_ctime_r='$d_ctime_r'
21361d_cuserid='$d_cuserid'
21362d_dbl_dig='$d_dbl_dig'
21363d_dbminitproto='$d_dbminitproto'
21364d_difftime='$d_difftime'
21365d_dirfd='$d_dirfd'
21366d_dirnamlen='$d_dirnamlen'
21367d_dlerror='$d_dlerror'
21368d_dlopen='$d_dlopen'
21369d_dlsymun='$d_dlsymun'
21370d_dosuid='$d_dosuid'
21371d_drand48_r='$d_drand48_r'
21372d_drand48proto='$d_drand48proto'
21373d_dup2='$d_dup2'
21374d_eaccess='$d_eaccess'
21375d_endgrent='$d_endgrent'
21376d_endgrent_r='$d_endgrent_r'
21377d_endhent='$d_endhent'
21378d_endhostent_r='$d_endhostent_r'
21379d_endnent='$d_endnent'
21380d_endnetent_r='$d_endnetent_r'
21381d_endpent='$d_endpent'
21382d_endprotoent_r='$d_endprotoent_r'
21383d_endpwent='$d_endpwent'
21384d_endpwent_r='$d_endpwent_r'
21385d_endsent='$d_endsent'
21386d_endservent_r='$d_endservent_r'
21387d_eofnblk='$d_eofnblk'
21388d_eunice='$d_eunice'
21389d_faststdio='$d_faststdio'
21390d_fchdir='$d_fchdir'
21391d_fchmod='$d_fchmod'
21392d_fchown='$d_fchown'
21393d_fcntl='$d_fcntl'
21394d_fcntl_can_lock='$d_fcntl_can_lock'
21395d_fd_macros='$d_fd_macros'
21396d_fd_set='$d_fd_set'
21397d_fds_bits='$d_fds_bits'
21398d_fgetpos='$d_fgetpos'
21399d_finite='$d_finite'
21400d_finitel='$d_finitel'
21401d_flexfnam='$d_flexfnam'
21402d_flock='$d_flock'
21403d_flockproto='$d_flockproto'
21404d_fork='$d_fork'
21405d_fp_class='$d_fp_class'
21406d_fpathconf='$d_fpathconf'
21407d_fpclass='$d_fpclass'
21408d_fpclassify='$d_fpclassify'
21409d_fpclassl='$d_fpclassl'
21410d_fpos64_t='$d_fpos64_t'
21411d_frexpl='$d_frexpl'
21412d_fs_data_s='$d_fs_data_s'
21413d_fseeko='$d_fseeko'
21414d_fsetpos='$d_fsetpos'
21415d_fstatfs='$d_fstatfs'
21416d_fstatvfs='$d_fstatvfs'
21417d_fsync='$d_fsync'
21418d_ftello='$d_ftello'
21419d_ftime='$d_ftime'
21420d_futimes='$d_futimes'
21421d_getcwd='$d_getcwd'
21422d_getespwnam='$d_getespwnam'
21423d_getfsstat='$d_getfsstat'
21424d_getgrent='$d_getgrent'
21425d_getgrent_r='$d_getgrent_r'
21426d_getgrgid_r='$d_getgrgid_r'
21427d_getgrnam_r='$d_getgrnam_r'
21428d_getgrps='$d_getgrps'
21429d_gethbyaddr='$d_gethbyaddr'
21430d_gethbyname='$d_gethbyname'
21431d_gethent='$d_gethent'
21432d_gethname='$d_gethname'
21433d_gethostbyaddr_r='$d_gethostbyaddr_r'
21434d_gethostbyname_r='$d_gethostbyname_r'
21435d_gethostent_r='$d_gethostent_r'
21436d_gethostprotos='$d_gethostprotos'
21437d_getitimer='$d_getitimer'
21438d_getlogin='$d_getlogin'
21439d_getlogin_r='$d_getlogin_r'
21440d_getmnt='$d_getmnt'
21441d_getmntent='$d_getmntent'
21442d_getnbyaddr='$d_getnbyaddr'
21443d_getnbyname='$d_getnbyname'
21444d_getnent='$d_getnent'
21445d_getnetbyaddr_r='$d_getnetbyaddr_r'
21446d_getnetbyname_r='$d_getnetbyname_r'
21447d_getnetent_r='$d_getnetent_r'
21448d_getnetprotos='$d_getnetprotos'
21449d_getpagsz='$d_getpagsz'
21450d_getpbyname='$d_getpbyname'
21451d_getpbynumber='$d_getpbynumber'
21452d_getpent='$d_getpent'
21453d_getpgid='$d_getpgid'
21454d_getpgrp2='$d_getpgrp2'
21455d_getpgrp='$d_getpgrp'
21456d_getppid='$d_getppid'
21457d_getprior='$d_getprior'
21458d_getprotobyname_r='$d_getprotobyname_r'
21459d_getprotobynumber_r='$d_getprotobynumber_r'
21460d_getprotoent_r='$d_getprotoent_r'
21461d_getprotoprotos='$d_getprotoprotos'
21462d_getprpwnam='$d_getprpwnam'
21463d_getpwent='$d_getpwent'
21464d_getpwent_r='$d_getpwent_r'
21465d_getpwnam_r='$d_getpwnam_r'
21466d_getpwuid_r='$d_getpwuid_r'
21467d_getsbyname='$d_getsbyname'
21468d_getsbyport='$d_getsbyport'
21469d_getsent='$d_getsent'
21470d_getservbyname_r='$d_getservbyname_r'
21471d_getservbyport_r='$d_getservbyport_r'
21472d_getservent_r='$d_getservent_r'
21473d_getservprotos='$d_getservprotos'
21474d_getspnam='$d_getspnam'
21475d_getspnam_r='$d_getspnam_r'
21476d_gettimeod='$d_gettimeod'
21477d_gmtime_r='$d_gmtime_r'
21478d_gnulibc='$d_gnulibc'
21479d_grpasswd='$d_grpasswd'
21480d_hasmntopt='$d_hasmntopt'
21481d_htonl='$d_htonl'
21482d_ilogbl='$d_ilogbl'
21483d_inc_version_list='$d_inc_version_list'
21484d_index='$d_index'
21485d_inetaton='$d_inetaton'
21486d_int64_t='$d_int64_t'
21487d_isascii='$d_isascii'
21488d_isfinite='$d_isfinite'
21489d_isinf='$d_isinf'
21490d_isnan='$d_isnan'
21491d_isnanl='$d_isnanl'
21492d_killpg='$d_killpg'
21493d_lchown='$d_lchown'
21494d_ldbl_dig='$d_ldbl_dig'
21495d_libm_lib_version='$d_libm_lib_version'
21496d_link='$d_link'
21497d_localtime_r='$d_localtime_r'
21498d_locconv='$d_locconv'
21499d_lockf='$d_lockf'
21500d_longdbl='$d_longdbl'
21501d_longlong='$d_longlong'
21502d_lseekproto='$d_lseekproto'
21503d_lstat='$d_lstat'
21504d_madvise='$d_madvise'
21505d_malloc_good_size='$d_malloc_good_size'
21506d_malloc_size='$d_malloc_size'
21507d_mblen='$d_mblen'
21508d_mbstowcs='$d_mbstowcs'
21509d_mbtowc='$d_mbtowc'
21510d_memchr='$d_memchr'
21511d_memcmp='$d_memcmp'
21512d_memcpy='$d_memcpy'
21513d_memmove='$d_memmove'
21514d_memset='$d_memset'
21515d_mkdir='$d_mkdir'
21516d_mkdtemp='$d_mkdtemp'
21517d_mkfifo='$d_mkfifo'
21518d_mkstemp='$d_mkstemp'
21519d_mkstemps='$d_mkstemps'
21520d_mktime='$d_mktime'
21521d_mmap='$d_mmap'
21522d_modfl='$d_modfl'
21523d_modfl_pow32_bug='$d_modfl_pow32_bug'
21524d_modflproto='$d_modflproto'
21525d_mprotect='$d_mprotect'
21526d_msg='$d_msg'
21527d_msg_ctrunc='$d_msg_ctrunc'
21528d_msg_dontroute='$d_msg_dontroute'
21529d_msg_oob='$d_msg_oob'
21530d_msg_peek='$d_msg_peek'
21531d_msg_proxy='$d_msg_proxy'
21532d_msgctl='$d_msgctl'
21533d_msgget='$d_msgget'
21534d_msghdr_s='$d_msghdr_s'
21535d_msgrcv='$d_msgrcv'
21536d_msgsnd='$d_msgsnd'
21537d_msync='$d_msync'
21538d_munmap='$d_munmap'
21539d_mymalloc='$d_mymalloc'
21540d_nice='$d_nice'
21541d_nl_langinfo='$d_nl_langinfo'
21542d_nv_preserves_uv='$d_nv_preserves_uv'
21543d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
21544d_off64_t='$d_off64_t'
21545d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
21546d_oldpthreads='$d_oldpthreads'
21547d_oldsock='$d_oldsock'
21548d_open3='$d_open3'
21549d_pathconf='$d_pathconf'
21550d_pause='$d_pause'
21551d_perl_otherlibdirs='$d_perl_otherlibdirs'
21552d_phostname='$d_phostname'
21553d_pipe='$d_pipe'
21554d_poll='$d_poll'
21555d_portable='$d_portable'
21556d_procselfexe='$d_procselfexe'
21557d_pthread_atfork='$d_pthread_atfork'
21558d_pthread_attr_setscope='$d_pthread_attr_setscope'
21559d_pthread_yield='$d_pthread_yield'
21560d_pwage='$d_pwage'
21561d_pwchange='$d_pwchange'
21562d_pwclass='$d_pwclass'
21563d_pwcomment='$d_pwcomment'
21564d_pwexpire='$d_pwexpire'
21565d_pwgecos='$d_pwgecos'
21566d_pwpasswd='$d_pwpasswd'
21567d_pwquota='$d_pwquota'
21568d_qgcvt='$d_qgcvt'
21569d_quad='$d_quad'
21570d_random_r='$d_random_r'
21571d_readdir64_r='$d_readdir64_r'
21572d_readdir='$d_readdir'
21573d_readdir_r='$d_readdir_r'
21574d_readlink='$d_readlink'
21575d_readv='$d_readv'
21576d_recvmsg='$d_recvmsg'
21577d_rename='$d_rename'
21578d_rewinddir='$d_rewinddir'
21579d_rmdir='$d_rmdir'
21580d_safebcpy='$d_safebcpy'
21581d_safemcpy='$d_safemcpy'
21582d_sanemcmp='$d_sanemcmp'
21583d_sbrkproto='$d_sbrkproto'
21584d_scalbnl='$d_scalbnl'
21585d_sched_yield='$d_sched_yield'
21586d_scm_rights='$d_scm_rights'
21587d_seekdir='$d_seekdir'
21588d_select='$d_select'
21589d_sem='$d_sem'
21590d_semctl='$d_semctl'
21591d_semctl_semid_ds='$d_semctl_semid_ds'
21592d_semctl_semun='$d_semctl_semun'
21593d_semget='$d_semget'
21594d_semop='$d_semop'
21595d_sendmsg='$d_sendmsg'
21596d_setegid='$d_setegid'
21597d_seteuid='$d_seteuid'
21598d_setgrent='$d_setgrent'
21599d_setgrent_r='$d_setgrent_r'
21600d_setgrps='$d_setgrps'
21601d_sethent='$d_sethent'
21602d_sethostent_r='$d_sethostent_r'
21603d_setitimer='$d_setitimer'
21604d_setlinebuf='$d_setlinebuf'
21605d_setlocale='$d_setlocale'
21606d_setlocale_r='$d_setlocale_r'
21607d_setnent='$d_setnent'
21608d_setnetent_r='$d_setnetent_r'
21609d_setpent='$d_setpent'
21610d_setpgid='$d_setpgid'
21611d_setpgrp2='$d_setpgrp2'
21612d_setpgrp='$d_setpgrp'
21613d_setprior='$d_setprior'
21614d_setproctitle='$d_setproctitle'
21615d_setprotoent_r='$d_setprotoent_r'
21616d_setpwent='$d_setpwent'
21617d_setpwent_r='$d_setpwent_r'
21618d_setregid='$d_setregid'
21619d_setresgid='$d_setresgid'
21620d_setresuid='$d_setresuid'
21621d_setreuid='$d_setreuid'
21622d_setrgid='$d_setrgid'
21623d_setruid='$d_setruid'
21624d_setsent='$d_setsent'
21625d_setservent_r='$d_setservent_r'
21626d_setsid='$d_setsid'
21627d_setvbuf='$d_setvbuf'
21628d_sfio='$d_sfio'
21629d_shm='$d_shm'
21630d_shmat='$d_shmat'
21631d_shmatprototype='$d_shmatprototype'
21632d_shmctl='$d_shmctl'
21633d_shmdt='$d_shmdt'
21634d_shmget='$d_shmget'
21635d_sigaction='$d_sigaction'
21636d_sigprocmask='$d_sigprocmask'
21637d_sigsetjmp='$d_sigsetjmp'
21638d_sitearch='$d_sitearch'
21639d_snprintf='$d_snprintf'
21640d_sockatmark='$d_sockatmark'
21641d_sockatmarkproto='$d_sockatmarkproto'
21642d_socket='$d_socket'
21643d_socklen_t='$d_socklen_t'
21644d_sockpair='$d_sockpair'
21645d_socks5_init='$d_socks5_init'
21646d_sprintf_returns_strlen='$d_sprintf_returns_strlen'
21647d_sqrtl='$d_sqrtl'
21648d_srand48_r='$d_srand48_r'
21649d_srandom_r='$d_srandom_r'
21650d_sresgproto='$d_sresgproto'
21651d_sresuproto='$d_sresuproto'
21652d_statblks='$d_statblks'
21653d_statfs_f_flags='$d_statfs_f_flags'
21654d_statfs_s='$d_statfs_s'
21655d_statvfs='$d_statvfs'
21656d_stdio_cnt_lval='$d_stdio_cnt_lval'
21657d_stdio_ptr_lval='$d_stdio_ptr_lval'
21658d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
21659d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
21660d_stdio_stream_array='$d_stdio_stream_array'
21661d_stdiobase='$d_stdiobase'
21662d_stdstdio='$d_stdstdio'
21663d_strchr='$d_strchr'
21664d_strcoll='$d_strcoll'
21665d_strctcpy='$d_strctcpy'
21666d_strerrm='$d_strerrm'
21667d_strerror='$d_strerror'
21668d_strerror_r='$d_strerror_r'
21669d_strftime='$d_strftime'
21670d_strlcat='$d_strlcat'
21671d_strlcpy='$d_strlcpy'
21672d_strtod='$d_strtod'
21673d_strtol='$d_strtol'
21674d_strtold='$d_strtold'
21675d_strtoll='$d_strtoll'
21676d_strtoq='$d_strtoq'
21677d_strtoul='$d_strtoul'
21678d_strtoull='$d_strtoull'
21679d_strtouq='$d_strtouq'
21680d_strxfrm='$d_strxfrm'
21681d_suidsafe='$d_suidsafe'
21682d_symlink='$d_symlink'
21683d_syscall='$d_syscall'
21684d_syscallproto='$d_syscallproto'
21685d_sysconf='$d_sysconf'
21686d_sysernlst='$d_sysernlst'
21687d_syserrlst='$d_syserrlst'
21688d_system='$d_system'
21689d_tcgetpgrp='$d_tcgetpgrp'
21690d_tcsetpgrp='$d_tcsetpgrp'
21691d_telldir='$d_telldir'
21692d_telldirproto='$d_telldirproto'
21693d_time='$d_time'
21694d_times='$d_times'
21695d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
21696d_tm_tm_zone='$d_tm_tm_zone'
21697d_tmpnam_r='$d_tmpnam_r'
21698d_truncate='$d_truncate'
21699d_ttyname_r='$d_ttyname_r'
21700d_tzname='$d_tzname'
21701d_u32align='$d_u32align'
21702d_ualarm='$d_ualarm'
21703d_umask='$d_umask'
21704d_uname='$d_uname'
21705d_union_semun='$d_union_semun'
21706d_unordered='$d_unordered'
21707d_unsetenv='$d_unsetenv'
21708d_usleep='$d_usleep'
21709d_usleepproto='$d_usleepproto'
21710d_ustat='$d_ustat'
21711d_vendorarch='$d_vendorarch'
21712d_vendorbin='$d_vendorbin'
21713d_vendorlib='$d_vendorlib'
21714d_vendorscript='$d_vendorscript'
21715d_vfork='$d_vfork'
21716d_void_closedir='$d_void_closedir'
21717d_voidsig='$d_voidsig'
21718d_voidtty='$d_voidtty'
21719d_volatile='$d_volatile'
21720d_vprintf='$d_vprintf'
21721d_vsnprintf='$d_vsnprintf'
21722d_wait4='$d_wait4'
21723d_waitpid='$d_waitpid'
21724d_wcstombs='$d_wcstombs'
21725d_wctomb='$d_wctomb'
21726d_writev='$d_writev'
21727d_xenix='$d_xenix'
21728date='$date'
21729db_hashtype='$db_hashtype'
21730db_prefixtype='$db_prefixtype'
21731db_version_major='$db_version_major'
21732db_version_minor='$db_version_minor'
21733db_version_patch='$db_version_patch'
21734defvoidused='$defvoidused'
21735direntrytype='$direntrytype'
21736dlext='$dlext'
21737dlsrc='$dlsrc'
21738doublesize='$doublesize'
21739drand01='$drand01'
21740drand48_r_proto='$drand48_r_proto'
21741dynamic_ext='$dynamic_ext'
21742eagain='$eagain'
21743ebcdic='$ebcdic'
21744echo='$echo'
21745egrep='$egrep'
21746emacs='$emacs'
21747endgrent_r_proto='$endgrent_r_proto'
21748endhostent_r_proto='$endhostent_r_proto'
21749endnetent_r_proto='$endnetent_r_proto'
21750endprotoent_r_proto='$endprotoent_r_proto'
21751endpwent_r_proto='$endpwent_r_proto'
21752endservent_r_proto='$endservent_r_proto'
21753eunicefix='$eunicefix'
21754exe_ext='$exe_ext'
21755expr='$expr'
21756extensions='$extensions'
21757extras='$extras'
21758fflushNULL='$fflushNULL'
21759fflushall='$fflushall'
21760find='$find'
21761firstmakefile='$firstmakefile'
21762flex='$flex'
21763fpossize='$fpossize'
21764fpostype='$fpostype'
21765freetype='$freetype'
21766from='$from'
21767full_ar='$full_ar'
21768full_csh='$full_csh'
21769full_sed='$full_sed'
21770gccansipedantic='$gccansipedantic'
21771gccosandvers='$gccosandvers'
21772gccversion='$gccversion'
21773getgrent_r_proto='$getgrent_r_proto'
21774getgrgid_r_proto='$getgrgid_r_proto'
21775getgrnam_r_proto='$getgrnam_r_proto'
21776gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21777gethostbyname_r_proto='$gethostbyname_r_proto'
21778gethostent_r_proto='$gethostent_r_proto'
21779getlogin_r_proto='$getlogin_r_proto'
21780getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21781getnetbyname_r_proto='$getnetbyname_r_proto'
21782getnetent_r_proto='$getnetent_r_proto'
21783getprotobyname_r_proto='$getprotobyname_r_proto'
21784getprotobynumber_r_proto='$getprotobynumber_r_proto'
21785getprotoent_r_proto='$getprotoent_r_proto'
21786getpwent_r_proto='$getpwent_r_proto'
21787getpwnam_r_proto='$getpwnam_r_proto'
21788getpwuid_r_proto='$getpwuid_r_proto'
21789getservbyname_r_proto='$getservbyname_r_proto'
21790getservbyport_r_proto='$getservbyport_r_proto'
21791getservent_r_proto='$getservent_r_proto'
21792getspnam_r_proto='$getspnam_r_proto'
21793gidformat='$gidformat'
21794gidsign='$gidsign'
21795gidsize='$gidsize'
21796gidtype='$gidtype'
21797glibpth='$glibpth'
21798gmake='$gmake'
21799gmtime_r_proto='$gmtime_r_proto'
21800gnulibc_version='$gnulibc_version'
21801grep='$grep'
21802groupcat='$groupcat'
21803groupstype='$groupstype'
21804gzip='$gzip'
21805h_fcntl='$h_fcntl'
21806h_sysfile='$h_sysfile'
21807hint='$hint'
21808hostcat='$hostcat'
21809html1dir='$html1dir'
21810html1direxp='$html1direxp'
21811html3dir='$html3dir'
21812html3direxp='$html3direxp'
21813i16size='$i16size'
21814i16type='$i16type'
21815i32size='$i32size'
21816i32type='$i32type'
21817i64size='$i64size'
21818i64type='$i64type'
21819i8size='$i8size'
21820i8type='$i8type'
21821i_arpainet='$i_arpainet'
21822i_bsdioctl='$i_bsdioctl'
21823i_crypt='$i_crypt'
21824i_db='$i_db'
21825i_dbm='$i_dbm'
21826i_dirent='$i_dirent'
21827i_dld='$i_dld'
21828i_dlfcn='$i_dlfcn'
21829i_fcntl='$i_fcntl'
21830i_float='$i_float'
21831i_fp='$i_fp'
21832i_fp_class='$i_fp_class'
21833i_gdbm='$i_gdbm'
21834i_grp='$i_grp'
21835i_ieeefp='$i_ieeefp'
21836i_inttypes='$i_inttypes'
21837i_langinfo='$i_langinfo'
21838i_libutil='$i_libutil'
21839i_limits='$i_limits'
21840i_locale='$i_locale'
21841i_machcthr='$i_machcthr'
21842i_malloc='$i_malloc'
21843i_math='$i_math'
21844i_memory='$i_memory'
21845i_mntent='$i_mntent'
21846i_ndbm='$i_ndbm'
21847i_netdb='$i_netdb'
21848i_neterrno='$i_neterrno'
21849i_netinettcp='$i_netinettcp'
21850i_niin='$i_niin'
21851i_poll='$i_poll'
21852i_prot='$i_prot'
21853i_pthread='$i_pthread'
21854i_pwd='$i_pwd'
21855i_rpcsvcdbm='$i_rpcsvcdbm'
21856i_sfio='$i_sfio'
21857i_sgtty='$i_sgtty'
21858i_shadow='$i_shadow'
21859i_socks='$i_socks'
21860i_stdarg='$i_stdarg'
21861i_stddef='$i_stddef'
21862i_stdlib='$i_stdlib'
21863i_string='$i_string'
21864i_sunmath='$i_sunmath'
21865i_sysaccess='$i_sysaccess'
21866i_sysdir='$i_sysdir'
21867i_sysfile='$i_sysfile'
21868i_sysfilio='$i_sysfilio'
21869i_sysin='$i_sysin'
21870i_sysioctl='$i_sysioctl'
21871i_syslog='$i_syslog'
21872i_sysmman='$i_sysmman'
21873i_sysmode='$i_sysmode'
21874i_sysmount='$i_sysmount'
21875i_sysndir='$i_sysndir'
21876i_sysparam='$i_sysparam'
21877i_sysresrc='$i_sysresrc'
21878i_syssecrt='$i_syssecrt'
21879i_sysselct='$i_sysselct'
21880i_syssockio='$i_syssockio'
21881i_sysstat='$i_sysstat'
21882i_sysstatfs='$i_sysstatfs'
21883i_sysstatvfs='$i_sysstatvfs'
21884i_systime='$i_systime'
21885i_systimek='$i_systimek'
21886i_systimes='$i_systimes'
21887i_systypes='$i_systypes'
21888i_sysuio='$i_sysuio'
21889i_sysun='$i_sysun'
21890i_sysutsname='$i_sysutsname'
21891i_sysvfs='$i_sysvfs'
21892i_syswait='$i_syswait'
21893i_termio='$i_termio'
21894i_termios='$i_termios'
21895i_time='$i_time'
21896i_unistd='$i_unistd'
21897i_ustat='$i_ustat'
21898i_utime='$i_utime'
21899i_values='$i_values'
21900i_varargs='$i_varargs'
21901i_varhdr='$i_varhdr'
21902i_vfork='$i_vfork'
21903ignore_versioned_solibs='$ignore_versioned_solibs'
21904inc_version_list='$inc_version_list'
21905inc_version_list_init='$inc_version_list_init'
21906incpath='$incpath'
21907inews='$inews'
21908initialinstalllocation='$initialinstalllocation'
21909installarchlib='$installarchlib'
21910installbin='$installbin'
21911installhtml1dir='$installhtml1dir'
21912installhtml3dir='$installhtml3dir'
21913installman1dir='$installman1dir'
21914installman3dir='$installman3dir'
21915installprefix='$installprefix'
21916installprefixexp='$installprefixexp'
21917installprivlib='$installprivlib'
21918installscript='$installscript'
21919installsitearch='$installsitearch'
21920installsitebin='$installsitebin'
21921installsitehtml1dir='$installsitehtml1dir'
21922installsitehtml3dir='$installsitehtml3dir'
21923installsitelib='$installsitelib'
21924installsiteman1dir='$installsiteman1dir'
21925installsiteman3dir='$installsiteman3dir'
21926installsitescript='$installsitescript'
21927installstyle='$installstyle'
21928installusrbinperl='$installusrbinperl'
21929installvendorarch='$installvendorarch'
21930installvendorbin='$installvendorbin'
21931installvendorhtml1dir='$installvendorhtml1dir'
21932installvendorhtml3dir='$installvendorhtml3dir'
21933installvendorlib='$installvendorlib'
21934installvendorman1dir='$installvendorman1dir'
21935installvendorman3dir='$installvendorman3dir'
21936installvendorscript='$installvendorscript'
21937intsize='$intsize'
21938issymlink='$issymlink'
21939ivdformat='$ivdformat'
21940ivsize='$ivsize'
21941ivtype='$ivtype'
21942known_extensions='$known_extensions'
21943ksh='$ksh'
21944ld='$ld'
21945lddlflags='$lddlflags'
21946ldflags='$ldflags'
21947ldflags_uselargefiles='$ldflags_uselargefiles'
21948ldlibpthname='$ldlibpthname'
21949less='$less'
21950lib_ext='$lib_ext'
21951libc='$libc'
21952libperl='$libperl'
21953libpth='$libpth'
21954libs='$libs'
21955libsdirs='$libsdirs'
21956libsfiles='$libsfiles'
21957libsfound='$libsfound'
21958libspath='$libspath'
21959libswanted='$libswanted'
21960libswanted_uselargefiles='$libswanted_uselargefiles'
21961line='$line'
21962lint='$lint'
21963lkflags='$lkflags'
21964ln='$ln'
21965lns='$lns'
21966localtime_r_proto='$localtime_r_proto'
21967locincpth='$locincpth'
21968loclibpth='$loclibpth'
21969longdblsize='$longdblsize'
21970longlongsize='$longlongsize'
21971longsize='$longsize'
21972lp='$lp'
21973lpr='$lpr'
21974ls='$ls'
21975lseeksize='$lseeksize'
21976lseektype='$lseektype'
21977mad='$mad'
21978madlyh='$madlyh'
21979madlyobj='$madlyobj'
21980madlysrc='$madlysrc'
21981mail='$mail'
21982mailx='$mailx'
21983make='$make'
21984make_set_make='$make_set_make'
21985mallocobj='$mallocobj'
21986mallocsrc='$mallocsrc'
21987malloctype='$malloctype'
21988man1dir='$man1dir'
21989man1direxp='$man1direxp'
21990man1ext='$man1ext'
21991man3dir='$man3dir'
21992man3direxp='$man3direxp'
21993man3ext='$man3ext'
21994mips_type='$mips_type'
21995mistrustnm='$mistrustnm'
21996mkdir='$mkdir'
21997mmaptype='$mmaptype'
21998modetype='$modetype'
21999more='$more'
22000multiarch='$multiarch'
22001mv='$mv'
22002myarchname='$myarchname'
22003mydomain='$mydomain'
22004myhostname='$myhostname'
22005myuname='$myuname'
22006n='$n'
22007need_va_copy='$need_va_copy'
22008netdb_hlen_type='$netdb_hlen_type'
22009netdb_host_type='$netdb_host_type'
22010netdb_name_type='$netdb_name_type'
22011netdb_net_type='$netdb_net_type'
22012nm='$nm'
22013nm_opt='$nm_opt'
22014nm_so_opt='$nm_so_opt'
22015nonxs_ext='$nonxs_ext'
22016nroff='$nroff'
22017nvEUformat='$nvEUformat'
22018nvFUformat='$nvFUformat'
22019nvGUformat='$nvGUformat'
22020nv_preserves_uv_bits='$nv_preserves_uv_bits'
22021nveformat='$nveformat'
22022nvfformat='$nvfformat'
22023nvgformat='$nvgformat'
22024nvsize='$nvsize'
22025nvtype='$nvtype'
22026o_nonblock='$o_nonblock'
22027obj_ext='$obj_ext'
22028old_pthread_create_joinable='$old_pthread_create_joinable'
22029optimize='$optimize'
22030orderlib='$orderlib'
22031osname='$osname'
22032osvers='$osvers'
22033otherlibdirs='$otherlibdirs'
22034package='$package'
22035pager='$pager'
22036passcat='$passcat'
22037patchlevel='$patchlevel'
22038path_sep='$path_sep'
22039perl5='$perl5'
22040perl='$perl'
22041perl_patchlevel='$perl_patchlevel'
22042perladmin='$perladmin'
22043perllibs='$perllibs'
22044perlpath='$perlpath'
22045pg='$pg'
22046phostname='$phostname'
22047pidtype='$pidtype'
22048plibpth='$plibpth'
22049pmake='$pmake'
22050pr='$pr'
22051prefix='$prefix'
22052prefixexp='$prefixexp'
22053privlib='$privlib'
22054privlibexp='$privlibexp'
22055procselfexe='$procselfexe'
22056prototype='$prototype'
22057ptrsize='$ptrsize'
22058quadkind='$quadkind'
22059quadtype='$quadtype'
22060randbits='$randbits'
22061randfunc='$randfunc'
22062random_r_proto='$random_r_proto'
22063randseedtype='$randseedtype'
22064ranlib='$ranlib'
22065rd_nodata='$rd_nodata'
22066readdir64_r_proto='$readdir64_r_proto'
22067readdir_r_proto='$readdir_r_proto'
22068revision='$revision'
22069rm='$rm'
22070rmail='$rmail'
22071run='$run'
22072runnm='$runnm'
22073sPRIEUldbl='$sPRIEUldbl'
22074sPRIFUldbl='$sPRIFUldbl'
22075sPRIGUldbl='$sPRIGUldbl'
22076sPRIXU64='$sPRIXU64'
22077sPRId64='$sPRId64'
22078sPRIeldbl='$sPRIeldbl'
22079sPRIfldbl='$sPRIfldbl'
22080sPRIgldbl='$sPRIgldbl'
22081sPRIi64='$sPRIi64'
22082sPRIo64='$sPRIo64'
22083sPRIu64='$sPRIu64'
22084sPRIx64='$sPRIx64'
22085sSCNfldbl='$sSCNfldbl'
22086sched_yield='$sched_yield'
22087scriptdir='$scriptdir'
22088scriptdirexp='$scriptdirexp'
22089sed='$sed'
22090seedfunc='$seedfunc'
22091selectminbits='$selectminbits'
22092selecttype='$selecttype'
22093sendmail='$sendmail'
22094setgrent_r_proto='$setgrent_r_proto'
22095sethostent_r_proto='$sethostent_r_proto'
22096setlocale_r_proto='$setlocale_r_proto'
22097setnetent_r_proto='$setnetent_r_proto'
22098setprotoent_r_proto='$setprotoent_r_proto'
22099setpwent_r_proto='$setpwent_r_proto'
22100setservent_r_proto='$setservent_r_proto'
22101sh='$sh'
22102shar='$shar'
22103sharpbang='$sharpbang'
22104shmattype='$shmattype'
22105shortsize='$shortsize'
22106shrpenv='$shrpenv'
22107shsharp='$shsharp'
22108sig_count='$sig_count'
22109sig_name='$sig_name'
22110sig_name_init='$sig_name_init'
22111sig_num='$sig_num'
22112sig_num_init='$sig_num_init'
22113sig_size='$sig_size'
22114signal_t='$signal_t'
22115sitearch='$sitearch'
22116sitearchexp='$sitearchexp'
22117sitebin='$sitebin'
22118sitebinexp='$sitebinexp'
22119sitehtml1dir='$sitehtml1dir'
22120sitehtml1direxp='$sitehtml1direxp'
22121sitehtml3dir='$sitehtml3dir'
22122sitehtml3direxp='$sitehtml3direxp'
22123sitelib='$sitelib'
22124sitelib_stem='$sitelib_stem'
22125sitelibexp='$sitelibexp'
22126siteman1dir='$siteman1dir'
22127siteman1direxp='$siteman1direxp'
22128siteman3dir='$siteman3dir'
22129siteman3direxp='$siteman3direxp'
22130siteprefix='$siteprefix'
22131siteprefixexp='$siteprefixexp'
22132sitescript='$sitescript'
22133sitescriptexp='$sitescriptexp'
22134sizesize='$sizesize'
22135sizetype='$sizetype'
22136sleep='$sleep'
22137smail='$smail'
22138so='$so'
22139sockethdr='$sockethdr'
22140socketlib='$socketlib'
22141socksizetype='$socksizetype'
22142sort='$sort'
22143spackage='$spackage'
22144spitshell='$spitshell'
22145srand48_r_proto='$srand48_r_proto'
22146srandom_r_proto='$srandom_r_proto'
22147src='$src'
22148ssizetype='$ssizetype'
22149startperl='$startperl'
22150startsh='$startsh'
22151static_ext='$static_ext'
22152stdchar='$stdchar'
22153stdio_base='$stdio_base'
22154stdio_bufsiz='$stdio_bufsiz'
22155stdio_cnt='$stdio_cnt'
22156stdio_filbuf='$stdio_filbuf'
22157stdio_ptr='$stdio_ptr'
22158stdio_stream_array='$stdio_stream_array'
22159strerror_r_proto='$strerror_r_proto'
22160strings='$strings'
22161submit='$submit'
22162subversion='$subversion'
22163sysman='$sysman'
22164tail='$tail'
22165tar='$tar'
22166targetarch='$targetarch'
22167tbl='$tbl'
22168tee='$tee'
22169test='$test'
22170timeincl='$timeincl'
22171timetype='$timetype'
22172tmpnam_r_proto='$tmpnam_r_proto'
22173to='$to'
22174touch='$touch'
22175tr='$tr'
22176trnl='$trnl'
22177troff='$troff'
22178ttyname_r_proto='$ttyname_r_proto'
22179u16size='$u16size'
22180u16type='$u16type'
22181u32size='$u32size'
22182u32type='$u32type'
22183u64size='$u64size'
22184u64type='$u64type'
22185u8size='$u8size'
22186u8type='$u8type'
22187uidformat='$uidformat'
22188uidsign='$uidsign'
22189uidsize='$uidsize'
22190uidtype='$uidtype'
22191uname='$uname'
22192uniq='$uniq'
22193uquadtype='$uquadtype'
22194use5005threads='$use5005threads'
22195use64bitall='$use64bitall'
22196use64bitint='$use64bitint'
22197usecrosscompile='$usecrosscompile'
22198usedl='$usedl'
22199usefaststdio='$usefaststdio'
22200useithreads='$useithreads'
22201uselargefiles='$uselargefiles'
22202uselongdouble='$uselongdouble'
22203usemallocwrap='$usemallocwrap'
22204usemorebits='$usemorebits'
22205usemultiplicity='$usemultiplicity'
22206usemymalloc='$usemymalloc'
22207usenm='$usenm'
22208useopcode='$useopcode'
22209useperlio='$useperlio'
22210useposix='$useposix'
22211usereentrant='$usereentrant'
22212userelocatableinc='$userelocatableinc'
22213usesfio='$usesfio'
22214useshrplib='$useshrplib'
22215usesitecustomize='$usesitecustomize'
22216usesocks='$usesocks'
22217usethreads='$usethreads'
22218usevendorprefix='$usevendorprefix'
22219usevfork='$usevfork'
22220usrinc='$usrinc'
22221uuname='$uuname'
22222uvXUformat='$uvXUformat'
22223uvoformat='$uvoformat'
22224uvsize='$uvsize'
22225uvtype='$uvtype'
22226uvuformat='$uvuformat'
22227uvxformat='$uvxformat'
22228vendorarch='$vendorarch'
22229vendorarchexp='$vendorarchexp'
22230vendorbin='$vendorbin'
22231vendorbinexp='$vendorbinexp'
22232vendorhtml1dir='$vendorhtml1dir'
22233vendorhtml1direxp='$vendorhtml1direxp'
22234vendorhtml3dir='$vendorhtml3dir'
22235vendorhtml3direxp='$vendorhtml3direxp'
22236vendorlib='$vendorlib'
22237vendorlib_stem='$vendorlib_stem'
22238vendorlibexp='$vendorlibexp'
22239vendorman1dir='$vendorman1dir'
22240vendorman1direxp='$vendorman1direxp'
22241vendorman3dir='$vendorman3dir'
22242vendorman3direxp='$vendorman3direxp'
22243vendorprefix='$vendorprefix'
22244vendorprefixexp='$vendorprefixexp'
22245vendorscript='$vendorscript'
22246vendorscriptexp='$vendorscriptexp'
22247version='$version'
22248version_patchlevel_string='$version_patchlevel_string'
22249versiononly='$versiononly'
22250vi='$vi'
22251voidflags='$voidflags'
22252xlibpth='$xlibpth'
22253yacc='$yacc'
22254yaccflags='$yaccflags'
22255zcat='$zcat'
22256zip='$zip'
22257EOT
22258
22259: Add in command line options if available
22260$test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
22261
22262: add special variables
22263$test -f $src/patchlevel.h && \
22264awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
22265echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
22266echo "PERL_CONFIG_SH=true" >>config.sh
22267
22268: propagate old symbols
22269if $test -f UU/config.sh; then
22270 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
22271 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
22272 $sort | $uniq -u >UU/oldsyms
22273 set X `cat UU/oldsyms`
22274 shift
22275 case $# in
22276 0) ;;
22277 *)
22278 cat <<EOM
22279Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
22280EOM
22281 echo "# Variables propagated from previous config.sh file." >>config.sh
22282 for sym in `cat UU/oldsyms`; do
22283 echo " Propagating $hint variable "'$'"$sym..."
22284 eval 'tmp="$'"${sym}"'"'
22285 echo "$tmp" | \
22286 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
22287 done
22288 ;;
22289 esac
22290fi
22291
22292: Finish up by extracting the .SH files
22293case "$alldone" in
22294exit)
22295 $rm -rf UU
22296 echo "Extraction done."
22297 exit 0
22298 ;;
22299cont)
22300 ;;
22301'')
22302 dflt=''
22303 nostick=true
22304 $cat <<EOM
22305
22306If you'd like to make any changes to the config.sh file before I begin
22307to configure things, do it as a shell escape now (e.g. !vi config.sh).
22308
22309EOM
22310 rp="Press return or use a shell escape to edit config.sh:"
22311 . UU/myread
22312 nostick=''
22313 case "$ans" in
22314 '') ;;
22315 *) : in case they cannot read
22316 sh 1>&4 -c "$ans";;
22317 esac
22318 ;;
22319esac
22320
22321: if this fails, just run all the .SH files by hand
22322. ./config.sh
22323
22324echo " "
22325exec 1>&4
22326pwd=`pwd`
22327. ./UU/extract
22328cd "$pwd"
22329
22330if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
22331 dflt=y
22332 case "$silent" in
22333 true) ;;
22334 *)
22335 $cat <<EOM
22336
22337Now you need to generate make dependencies by running "$make depend".
22338You might prefer to run it in background: "$make depend > makedepend.out &"
22339It can take a while, so you might not want to run it right now.
22340
22341EOM
22342 ;;
22343 esac
22344 rp="Run $make depend now?"
22345 . UU/myread
22346 case "$ans" in
22347 y*)
22348 $make depend && echo "Now you must run '$make'."
22349 ;;
22350 *)
22351 echo "You must run '$make depend' then '$make'."
22352 ;;
22353 esac
22354elif test -f [Mm]akefile; then
22355 echo " "
22356 echo "Now you must run a $make."
22357else
22358 echo "Configure done."
22359fi
22360
22361if $test -f Policy.sh; then
22362 $cat <<EOM
22363
22364If you compile $package on a different machine or from a different object
22365directory, copy the Policy.sh file from this object directory to the
22366new one before you run Configure -- this will help you with most of
22367the policy defaults.
22368
22369EOM
22370fi
22371if $test -f config.msg; then
22372 echo "Hmm. I also noted the following information while running:"
22373 echo " "
22374 $cat config.msg >&4
22375 $rm -f config.msg
22376fi
22377$rm -f kit*isdone ark*isdone
22378$rm -rf UU
22379
22380: End of Configure
22381