This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: [PATCH xsutils.c] Quieting warnings
[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# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
22#
23# Generated on Thu May 31 16:30:15 EET DST 2001 [metaconfig 3.0 PL70]
24# (with additional metaconfig patches by perlbug@perl.org)
25
26cat >c1$$ <<EOF
27ARGGGHHHH!!!!!
28
29SCO csh still thinks true is false. Write to SCO today and tell them that next
30year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
31
32(Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33we'd have to do is go in and swap the && and || tokens, wherever they are.)
34
35[End of diatribe. We now return you to your regularly scheduled programming...]
36EOF
37cat >c2$$ <<EOF
38
39OOPS! You naughty creature! You didn't run Configure with sh!
40I will attempt to remedy the situation by running sh for you...
41EOF
42
43true || cat c1$$ c2$$
44true || exec sh $0 $argv:q
45
46(exit $?0) || cat c2$$
47(exit $?0) || exec sh $0 $argv:q
48rm -f c1$$ c2$$
49
50: compute my invocation name
51me=$0
52case "$0" in
53*/*)
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
55 test "$me" || me=$0
56 ;;
57esac
58
59: Proper separator for the PATH environment variable
60p_=:
61: On OS/2 this directory should exist if this is not floppy only system :-]
62if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
64 p_=\;
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
68 p_=\;
69 fi
70fi
71
72: Proper PATH setting
73paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
74paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
75paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
76paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
77paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
78paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
79paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
80paths="$paths /sbin /usr/sbin /usr/libexec"
81
82for p in $paths
83do
84 case "$p_$PATH$p_" in
85 *$p_$p$p_*) ;;
86 *) test -d $p && PATH=$PATH$p_$p ;;
87 esac
88done
89
90PATH=.$p_$PATH
91export PATH
92
93: shall we be using ksh?
94inksh=''
95needksh=''
96avoidksh=''
97newsh=/bin/ksh
98changesh=''
99if (PATH=.; alias -x) >/dev/null 2>&1; then
100 inksh=true
101fi
102if test -f /hp-ux -a -f /bin/ksh; then
103 needksh='to avoid sh bug in "here document" expansion'
104fi
105if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
106 if test X`/usr/bin/uname -v` = X4; then
107 avoidksh="to avoid AIX 4's /bin/sh"
108 newsh=/usr/bin/bsh
109 fi
110fi
111if test -f /osf_boot -a -f /usr/sbin/setld; then
112 if test X`/usr/bin/uname -s` = XOSF1; then
113 avoidksh="to avoid Digital UNIX' ksh"
114 newsh=/bin/sh
115 unset BIN_SH # if this is 'xpg4' sh will start up ksh
116 fi
117fi
118case "$inksh/$needksh" in
119/[a-z]*)
120 ENV=''
121 changesh=true
122 reason="$needksh"
123 ;;
124esac
125case "$inksh/$avoidksh" in
126true/[a-z]*)
127 changesh=true
128 reason="$avoidksh"
129 ;;
130esac
131case "$inksh/$needksh-$avoidksh-" in
132true/--)
133 cat <<EOM
134(I see you are using the Korn shell. Some ksh's blow up on $me,
135mainly on older exotic systems. If yours does, try the Bourne shell instead.)
136EOM
137 ;;
138esac
139case "$changesh" in
140true)
141 echo "(Feeding myself to $newsh $reason.)"
142 case "$0" in
143 Configure|*/Configure) exec $newsh $0 "$@";;
144 *) exec $newsh Configure "$@";;
145 esac
146 ;;
147esac
148
149: if needed set CDPATH to a harmless value that is not chatty
150: avoid bash 2.02 problems with empty CDPATH.
151case "$CDPATH" in
152'') ;;
153*) case "$SHELL" in
154 *bash*) CDPATH='.' ;;
155 *) CDPATH='' ;;
156 esac
157 ;;
158esac
159: Configure runs within the UU subdirectory
160test -d UU || mkdir UU
161cd UU && rm -f ./*
162
163ccname=''
164ccversion=''
165ccsymbols=''
166cppccsymbols=''
167cppsymbols=''
168perllibs=''
169dynamic_ext=''
170extensions=''
171known_extensions=''
172nonxs_ext=''
173static_ext=''
174useopcode=''
175useposix=''
176d_bsd=''
177d_eunice=''
178d_xenix=''
179eunicefix=''
180Mcc=''
181ar=''
182awk=''
183bash=''
184bison=''
185byacc=''
186cat=''
187chgrp=''
188chmod=''
189chown=''
190comm=''
191compress=''
192cp=''
193cpio=''
194cpp=''
195csh=''
196date=''
197echo=''
198egrep=''
199emacs=''
200expr=''
201find=''
202flex=''
203grep=''
204gzip=''
205inews=''
206ksh=''
207less=''
208line=''
209lint=''
210ln=''
211lp=''
212lpr=''
213ls=''
214mail=''
215mailx=''
216make=''
217mkdir=''
218more=''
219mv=''
220nm=''
221nroff=''
222perl=''
223pg=''
224pmake=''
225pr=''
226rm=''
227rmail=''
228sed=''
229sendmail=''
230shar=''
231sleep=''
232smail=''
233sort=''
234submit=''
235tail=''
236tar=''
237tbl=''
238tee=''
239test=''
240touch=''
241tr=''
242troff=''
243uname=''
244uniq=''
245uuname=''
246vi=''
247zcat=''
248zip=''
249full_ar=''
250full_sed=''
251libswanted=''
252hint=''
253myuname=''
254osname=''
255osvers=''
256Author=''
257Date=''
258Header=''
259Id=''
260Locker=''
261Log=''
262RCSfile=''
263Revision=''
264Source=''
265State=''
266_a=''
267_exe=''
268_o=''
269archobjs=''
270exe_ext=''
271firstmakefile=''
272lib_ext=''
273obj_ext=''
274path_sep=''
275afs=''
276afsroot=''
277alignbytes=''
278ansi2knr=''
279archlib=''
280archlibexp=''
281d_archlib=''
282installarchlib=''
283archname=''
284myarchname=''
285d_atolf=''
286d_atoll=''
287baserev=''
288bin=''
289binexp=''
290installbin=''
291bincompat5005=''
292d_bincompat5005=''
293byteorder=''
294cc=''
295ccflags=''
296cppflags=''
297ldflags=''
298lkflags=''
299locincpth=''
300optimize=''
301cf_email=''
302cf_by=''
303cf_time=''
304charsize=''
305contains=''
306cpp_stuff=''
307cpplast=''
308cppminus=''
309cpprun=''
310cppstdin=''
311crosscompile=''
312d__fwalk=''
313d_access=''
314d_accessx=''
315d_alarm=''
316d_attribut=''
317d_bcmp=''
318d_bcopy=''
319d_bzero=''
320d_casti32=''
321castflags=''
322d_castneg=''
323d_chown=''
324d_chroot=''
325d_chsize=''
326d_closedir=''
327d_void_closedir=''
328d_cmsghdr_s=''
329d_const=''
330cryptlib=''
331d_crypt=''
332d_csh=''
333full_csh=''
334d_cuserid=''
335d_dbl_dig=''
336d_difftime=''
337d_dlerror=''
338d_dlopen=''
339d_dlsymun=''
340d_dosuid=''
341d_suidsafe=''
342d_drand48proto=''
343d_dup2=''
344d_eaccess=''
345d_endgrent=''
346d_endhent=''
347d_endnent=''
348d_endpent=''
349d_endpwent=''
350d_endsent=''
351d_fchmod=''
352d_fchown=''
353d_fcntl=''
354d_fcntl_can_lock=''
355d_fd_macros=''
356d_fd_set=''
357d_fds_bits=''
358d_fgetpos=''
359d_flexfnam=''
360d_flock=''
361d_fork=''
362d_fpos64_t=''
363d_frexpl=''
364d_fs_data_s=''
365d_fseeko=''
366d_fsetpos=''
367d_fstatfs=''
368d_fsync=''
369d_ftello=''
370d_ftime=''
371d_gettimeod=''
372d_Gconvert=''
373d_getcwd=''
374d_getespwnam=''
375d_getfsstat=''
376d_getgrent=''
377d_getgrps=''
378d_gethbyaddr=''
379d_gethbyname=''
380d_gethent=''
381aphostname=''
382d_gethname=''
383d_phostname=''
384d_uname=''
385d_gethostprotos=''
386d_getitimer=''
387d_getlogin=''
388d_getmnt=''
389d_getmntent=''
390d_getnbyaddr=''
391d_getnbyname=''
392d_getnent=''
393d_getnetprotos=''
394d_getpagsz=''
395d_getpent=''
396d_getpgid=''
397d_getpgrp2=''
398d_bsdgetpgrp=''
399d_getpgrp=''
400d_getppid=''
401d_getprior=''
402d_getpbyname=''
403d_getpbynumber=''
404d_getprotoprotos=''
405d_getprpwnam=''
406d_getpwent=''
407d_getsent=''
408d_getservprotos=''
409d_getspnam=''
410d_getsbyname=''
411d_getsbyport=''
412d_gnulibc=''
413d_hasmntopt=''
414d_htonl=''
415d_iconv=''
416d_inetaton=''
417d_int64_t=''
418d_isascii=''
419d_isnan=''
420d_isnanl=''
421d_killpg=''
422d_lchown=''
423d_ldbl_dig=''
424d_link=''
425d_locconv=''
426d_lockf=''
427d_longdbl=''
428longdblsize=''
429d_longlong=''
430longlongsize=''
431d_lseekproto=''
432d_lstat=''
433d_madvise=''
434d_mblen=''
435d_mbstowcs=''
436d_mbtowc=''
437d_memchr=''
438d_memcmp=''
439d_memcpy=''
440d_memmove=''
441d_memset=''
442d_mkdir=''
443d_mkdtemp=''
444d_mkfifo=''
445d_mkstemp=''
446d_mkstemps=''
447d_mktime=''
448d_mmap=''
449mmaptype=''
450d_modfl=''
451d_mprotect=''
452d_msg=''
453d_msgctl=''
454d_msgget=''
455d_msghdr_s=''
456d_msgrcv=''
457d_msgsnd=''
458d_msync=''
459d_munmap=''
460d_nice=''
461d_off64_t=''
462d_open3=''
463d_fpathconf=''
464d_pathconf=''
465d_pause=''
466d_pipe=''
467d_poll=''
468d_portable=''
469d_old_pthread_create_joinable=''
470old_pthread_create_joinable=''
471d_pthread_yield=''
472d_sched_yield=''
473sched_yield=''
474d_qgcvt=''
475d_readdir=''
476d_rewinddir=''
477d_seekdir=''
478d_telldir=''
479d_readlink=''
480d_readv=''
481d_recvmsg=''
482d_rename=''
483d_rmdir=''
484d_safebcpy=''
485d_safemcpy=''
486d_sanemcmp=''
487d_sbrkproto=''
488d_select=''
489d_sem=''
490d_semctl=''
491d_semget=''
492d_semop=''
493d_sendmsg=''
494d_setegid=''
495d_seteuid=''
496d_setgrent=''
497d_setgrps=''
498d_sethent=''
499d_setitimer=''
500d_setlinebuf=''
501d_setlocale=''
502d_setnent=''
503d_setpent=''
504d_setpgid=''
505d_setpgrp2=''
506d_bsdsetpgrp=''
507d_setpgrp=''
508d_setprior=''
509d_setproctitle=''
510d_setpwent=''
511d_setregid=''
512d_setresgid=''
513d_setresuid=''
514d_setreuid=''
515d_setrgid=''
516d_setruid=''
517d_setsent=''
518d_setsid=''
519d_setvbuf=''
520d_sfio=''
521usesfio=''
522d_shm=''
523d_shmat=''
524d_shmatprototype=''
525shmattype=''
526d_shmctl=''
527d_shmdt=''
528d_shmget=''
529d_sigaction=''
530d_sigprocmask=''
531d_sigsetjmp=''
532d_sockatmark=''
533d_msg_ctrunc=''
534d_msg_dontroute=''
535d_msg_oob=''
536d_msg_peek=''
537d_msg_proxy=''
538d_oldsock=''
539d_scm_rights=''
540d_socket=''
541d_sockpair=''
542sockethdr=''
543socketlib=''
544d_socklen_t=''
545d_socks5_init=''
546d_sqrtl=''
547d_statblks=''
548d_statfs_f_flags=''
549d_statfs_s=''
550d_fstatvfs=''
551d_statvfs=''
552d_stdio_cnt_lval=''
553d_stdio_ptr_lval=''
554d_stdio_ptr_lval_nochange_cnt=''
555d_stdio_ptr_lval_sets_cnt=''
556d_stdiobase=''
557d_stdstdio=''
558stdio_base=''
559stdio_bufsiz=''
560stdio_cnt=''
561stdio_filbuf=''
562stdio_ptr=''
563d_index=''
564d_strchr=''
565d_strcoll=''
566d_strctcpy=''
567d_strerrm=''
568d_strerror=''
569d_sysernlst=''
570d_syserrlst=''
571d_strftime=''
572d_strtod=''
573d_strtol=''
574d_strtold=''
575d_strtoll=''
576d_strtoq=''
577d_strtoul=''
578d_strtoull=''
579d_strtouq=''
580d_strxfrm=''
581d_symlink=''
582d_syscall=''
583d_sysconf=''
584d_system=''
585d_tcgetpgrp=''
586d_tcsetpgrp=''
587d_telldirproto=''
588d_time=''
589timetype=''
590clocktype=''
591d_times=''
592d_truncate=''
593d_tzname=''
594d_u32align=''
595d_ualarm=''
596d_umask=''
597d_semctl_semid_ds=''
598d_semctl_semun=''
599d_union_semun=''
600d_usleep=''
601d_ustat=''
602d_vfork=''
603usevfork=''
604d_voidsig=''
605signal_t=''
606d_volatile=''
607d_charvspr=''
608d_vprintf=''
609d_wait4=''
610d_waitpid=''
611d_wcstombs=''
612d_wctomb=''
613d_writev=''
614dlext=''
615cccdlflags=''
616ccdlflags=''
617dlsrc=''
618ld=''
619lddlflags=''
620usedl=''
621doublesize=''
622ebcdic=''
623fflushNULL=''
624fflushall=''
625fpossize=''
626fpostype=''
627gccosandvers=''
628gccversion=''
629gidformat=''
630gidsign=''
631gidsize=''
632gidtype=''
633groupstype=''
634h_fcntl=''
635h_sysfile=''
636i_arpainet=''
637db_hashtype=''
638db_prefixtype=''
639i_db=''
640i_dbm=''
641i_rpcsvcdbm=''
642d_dirnamlen=''
643direntrytype=''
644i_dirent=''
645i_dld=''
646i_dlfcn=''
647i_fcntl=''
648i_float=''
649i_gdbm=''
650d_grpasswd=''
651i_grp=''
652i_iconv=''
653i_ieeefp=''
654i_inttypes=''
655i_libutil=''
656i_limits=''
657i_locale=''
658i_machcthr=''
659i_malloc=''
660i_math=''
661i_memory=''
662i_mntent=''
663i_ndbm=''
664i_netdb=''
665i_neterrno=''
666i_netinettcp=''
667i_niin=''
668i_sysin=''
669i_poll=''
670i_prot=''
671i_pthread=''
672d_pwage=''
673d_pwchange=''
674d_pwclass=''
675d_pwcomment=''
676d_pwexpire=''
677d_pwgecos=''
678d_pwpasswd=''
679d_pwquota=''
680i_pwd=''
681i_sfio=''
682i_shadow=''
683i_socks=''
684i_stddef=''
685i_stdlib=''
686i_string=''
687strings=''
688i_sunmath=''
689i_sysaccess=''
690i_sysdir=''
691i_sysfile=''
692d_voidtty=''
693i_bsdioctl=''
694i_sysfilio=''
695i_sysioctl=''
696i_syssockio=''
697i_syslog=''
698i_sysmman=''
699i_sysmode=''
700i_sysmount=''
701i_sysndir=''
702i_sysparam=''
703i_sysresrc=''
704i_syssecrt=''
705i_sysselct=''
706i_sysstat=''
707i_sysstatfs=''
708i_sysstatvfs=''
709i_systimes=''
710i_systypes=''
711i_sysuio=''
712i_sysun=''
713i_sysutsname=''
714i_sysvfs=''
715i_syswait=''
716i_sgtty=''
717i_termio=''
718i_termios=''
719i_systime=''
720i_systimek=''
721i_time=''
722timeincl=''
723i_unistd=''
724i_ustat=''
725i_utime=''
726i_values=''
727i_stdarg=''
728i_varargs=''
729i_varhdr=''
730i_vfork=''
731inc_version_list=''
732inc_version_list_init=''
733installprefix=''
734installprefixexp=''
735installstyle=''
736installusrbinperl=''
737intsize=''
738longsize=''
739shortsize=''
740issymlink=''
741libc=''
742ldlibpthname=''
743libperl=''
744shrpenv=''
745useshrplib=''
746glibpth=''
747libpth=''
748loclibpth=''
749plibpth=''
750xlibpth=''
751ignore_versioned_solibs=''
752libs=''
753libsdirs=''
754libsfiles=''
755libsfound=''
756libspath=''
757lns=''
758d_PRIEUldbl=''
759d_PRIFUldbl=''
760d_PRIGUldbl=''
761d_PRIeldbl=''
762d_PRIfldbl=''
763d_PRIgldbl=''
764d_SCNfldbl=''
765sPRIEUldbl=''
766sPRIFUldbl=''
767sPRIGUldbl=''
768sPRIeldbl=''
769sPRIfldbl=''
770sPRIgldbl=''
771sSCNfldbl=''
772lseeksize=''
773lseektype=''
774make_set_make=''
775d_mymalloc=''
776freetype=''
777mallocobj=''
778mallocsrc=''
779malloctype=''
780usemymalloc=''
781installman1dir=''
782man1dir=''
783man1direxp=''
784man1ext=''
785installman3dir=''
786man3dir=''
787man3direxp=''
788man3ext=''
789modetype=''
790multiarch=''
791mydomain=''
792myhostname=''
793phostname=''
794c=''
795n=''
796d_eofnblk=''
797eagain=''
798o_nonblock=''
799rd_nodata=''
800need_va_copy=''
801netdb_hlen_type=''
802netdb_host_type=''
803netdb_name_type=''
804netdb_net_type=''
805groupcat=''
806hostcat=''
807passcat=''
808orderlib=''
809ranlib=''
810d_perl_otherlibdirs=''
811otherlibdirs=''
812package=''
813spackage=''
814pager=''
815api_revision=''
816api_subversion=''
817api_version=''
818api_versionstring=''
819patchlevel=''
820perl_patchlevel=''
821revision=''
822subversion=''
823version=''
824perl5=''
825perladmin=''
826perlpath=''
827d_nv_preserves_uv=''
828d_nv_preserves_uv_bits=''
829i16size=''
830i16type=''
831i32size=''
832i32type=''
833i64size=''
834i64type=''
835i8size=''
836i8type=''
837ivsize=''
838ivtype=''
839nvsize=''
840nvtype=''
841u16size=''
842u16type=''
843u32size=''
844u32type=''
845u64size=''
846u64type=''
847u8size=''
848u8type=''
849uvsize=''
850uvtype=''
851ivdformat=''
852nvEUformat=''
853nvFUformat=''
854nvGUformat=''
855nveformat=''
856nvfformat=''
857nvgformat=''
858uvXUformat=''
859uvoformat=''
860uvuformat=''
861uvxformat=''
862pidtype=''
863prefix=''
864prefixexp=''
865installprivlib=''
866privlib=''
867privlibexp=''
868prototype=''
869ptrsize=''
870d_PRIXU64=''
871d_PRId64=''
872d_PRIi64=''
873d_PRIo64=''
874d_PRIu64=''
875d_PRIx64=''
876sPRIXU64=''
877sPRId64=''
878sPRIi64=''
879sPRIo64=''
880sPRIu64=''
881sPRIx64=''
882d_quad=''
883quadkind=''
884quadtype=''
885uquadtype=''
886drand01=''
887randbits=''
888randfunc=''
889randseedtype=''
890seedfunc=''
891installscript=''
892scriptdir=''
893scriptdirexp=''
894selectminbits=''
895selecttype=''
896sh=''
897sig_count=''
898sig_name=''
899sig_name_init=''
900sig_num=''
901sig_num_init=''
902sig_size=''
903installsitearch=''
904sitearch=''
905sitearchexp=''
906installsitebin=''
907sitebin=''
908sitebinexp=''
909installsitelib=''
910sitelib=''
911sitelib_stem=''
912sitelibexp=''
913siteprefix=''
914siteprefixexp=''
915sizesize=''
916sizetype=''
917so=''
918socksizetype=''
919sharpbang=''
920shsharp=''
921spitshell=''
922src=''
923ssizetype=''
924startperl=''
925startsh=''
926stdchar=''
927d_stdio_stream_array=''
928stdio_stream_array=''
929sysman=''
930trnl=''
931uidformat=''
932uidsign=''
933uidsize=''
934uidtype=''
935archname64=''
936use64bitall=''
937use64bitint=''
938ccflags_uselargefiles=''
939ldflags_uselargefiles=''
940libswanted_uselargefiles=''
941uselargefiles=''
942uselongdouble=''
943usemorebits=''
944usemultiplicity=''
945nm_opt=''
946nm_so_opt=''
947runnm=''
948usenm=''
949useperlio=''
950usesocks=''
951d_oldpthreads=''
952use5005threads=''
953useithreads=''
954usethreads=''
955incpath=''
956mips_type=''
957usrinc=''
958d_vendorarch=''
959installvendorarch=''
960vendorarch=''
961vendorarchexp=''
962d_vendorbin=''
963installvendorbin=''
964vendorbin=''
965vendorbinexp=''
966d_vendorlib=''
967installvendorlib=''
968vendorlib=''
969vendorlib_stem=''
970vendorlibexp=''
971usevendorprefix=''
972vendorprefix=''
973vendorprefixexp=''
974versiononly=''
975defvoidused=''
976voidflags=''
977pm_apiversion=''
978xs_apiversion=''
979yacc=''
980yaccflags=''
981CONFIG=''
982
983define='define'
984undef='undef'
985smallmach='pdp11 i8086 z8000 i80286 iAPX286'
986rmlist=''
987
988: We must find out about Eunice early
989eunicefix=':'
990if test -f /etc/unixtovms; then
991 eunicefix=/etc/unixtovms
992fi
993if test -f /etc/unixtovms.exe; then
994 eunicefix=/etc/unixtovms.exe
995fi
996
997i_whoami=''
998ccname=''
999ccversion=''
1000perllibs=''
1001: set useposix=false in your hint file to disable the POSIX extension.
1002useposix=true
1003: set useopcode=false in your hint file to disable the Opcode extension.
1004useopcode=true
1005: Trailing extension. Override this in a hint file, if needed.
1006_exe=''
1007: Extra object files, if any, needed on this platform.
1008archobjs=''
1009archname=''
1010: Possible local include directories to search.
1011: Set locincpth to "" in a hint file to defeat local include searches.
1012locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1013locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1014:
1015: no include file wanted by default
1016inclwanted=''
1017
1018groupstype=''
1019: change the next line if compiling for Xenix/286 on Xenix/386
1020xlibpth='/usr/lib/386 /lib/386'
1021: Possible local library directories to search.
1022loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1023loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1024
1025: general looking path for locating libraries
1026glibpth="/lib /usr/lib $xlibpth"
1027glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1028test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1029test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1030
1031: Private path used by Configure to find libraries. Its value
1032: is prepended to libpth. This variable takes care of special
1033: machines, like the mips. Usually, it should be empty.
1034plibpth=''
1035
1036: default library list
1037libswanted=''
1038: some systems want to use only the non-versioned libso:s
1039ignore_versioned_solibs=''
1040archname64=''
1041ccflags_uselargefiles=''
1042ldflags_uselargefiles=''
1043libswanted_uselargefiles=''
1044: set usemultiplicity on the Configure command line to enable multiplicity.
1045: set usesocks on the Configure command line to enable socks.
1046: set usethreads on the Configure command line to enable threads.
1047: full support for void wanted by default
1048defvoidused=15
1049
1050: List of libraries we want.
1051: If anyone needs -lnet, put it in a hint file.
1052libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1053libswanted="$libswanted dld ld sun m c cposix posix"
1054libswanted="$libswanted ndir dir crypt sec"
1055libswanted="$libswanted ucb bsd BSD PW x iconv util"
1056: We probably want to search /usr/shlib before most other libraries.
1057: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1058glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1059glibpth="/usr/shlib $glibpth"
1060: Do not use vfork unless overridden by a hint file.
1061usevfork=false
1062
1063: Find the basic shell for Bourne shell scripts
1064case "$sh" in
1065'')
1066 case "$SYSTYPE" in
1067 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1068 *) xxx='/bin/sh';;
1069 esac
1070 if test -f "$xxx"; then
1071 sh="$xxx"
1072 else
1073 : Build up a list and do a single loop so we can 'break' out.
1074 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1075 for xxx in sh bash ksh pdksh ash; do
1076 for p in $pth; do
1077 try="$try ${p}/${xxx}"
1078 done
1079 done
1080 for xxx in $try; do
1081 if test -f "$xxx"; then
1082 sh="$xxx";
1083 break
1084 elif test -f "$xxx.exe"; then
1085 sh="$xxx";
1086 break
1087 fi
1088 done
1089 fi
1090 ;;
1091esac
1092
1093case "$sh" in
1094'') cat <<EOM >&2
1095$me: Fatal Error: I can't find a Bourne Shell anywhere.
1096
1097Usually it's in /bin/sh. How did you even get this far?
1098Please contact me (Perl Maintainers) at perlbug@perl.org and
1099we'll try to straighten this all out.
1100EOM
1101 exit 1
1102 ;;
1103esac
1104
1105: see if sh knows # comments
1106if `$sh -c '#' >/dev/null 2>&1`; then
1107 shsharp=true
1108 spitshell=cat
1109 xcat=/bin/cat
1110 test -f $xcat || xcat=/usr/bin/cat
1111 echo "#!$xcat" >try
1112 $eunicefix try
1113 chmod +x try
1114 ./try > today
1115 if test -s today; then
1116 sharpbang='#!'
1117 else
1118 echo "#! $xcat" > try
1119 $eunicefix try
1120 chmod +x try
1121 ./try > today
1122 if test -s today; then
1123 sharpbang='#! '
1124 else
1125 sharpbang=': use '
1126 fi
1127 fi
1128else
1129 echo " "
1130 echo "Your $sh doesn't grok # comments--I will strip them later on."
1131 shsharp=false
1132 cd ..
1133 echo "exec grep -v '^[ ]*#'" >spitshell
1134 chmod +x spitshell
1135 $eunicefix spitshell
1136 spitshell=`pwd`/spitshell
1137 cd UU
1138 echo "I presume that if # doesn't work, #! won't work either!"
1139 sharpbang=': use '
1140fi
1141rm -f try today
1142
1143: figure out how to guarantee sh startup
1144case "$startsh" in
1145'') startsh=${sharpbang}${sh} ;;
1146*)
1147esac
1148cat >try <<EOSS
1149$startsh
1150set abc
1151test "$?abc" != 1
1152EOSS
1153
1154chmod +x try
1155$eunicefix try
1156if ./try; then
1157 : echo "Yup, it does."
1158else
1159 echo "Hmm... '$startsh' does not guarantee sh startup..."
1160 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1161fi
1162rm -f try
1163
1164
1165: Save command line options in file UU/cmdline.opt for later use in
1166: generating config.sh.
1167cat > cmdline.opt <<EOSH
1168# Configure command line arguments.
1169config_arg0='$0'
1170config_args='$*'
1171config_argc=$#
1172EOSH
1173argn=1
1174for arg in "$@"; do
1175 cat >>cmdline.opt <<EOSH
1176config_arg$argn='$arg'
1177EOSH
1178 argn=`expr $argn + 1`
1179done
1180
1181: produce awk script to parse command line options
1182cat >options.awk <<'EOF'
1183BEGIN {
1184 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1185
1186 len = length(optstr);
1187 for (i = 1; i <= len; i++) {
1188 c = substr(optstr, i, 1);
1189 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1190 if (a == ":") {
1191 arg[c] = 1;
1192 i++;
1193 }
1194 opt[c] = 1;
1195 }
1196}
1197{
1198 expect = 0;
1199 str = $0;
1200 if (substr(str, 1, 1) != "-") {
1201 printf("'%s'\n", str);
1202 next;
1203 }
1204 len = length($0);
1205 for (i = 2; i <= len; i++) {
1206 c = substr(str, i, 1);
1207 if (!opt[c]) {
1208 printf("-%s\n", substr(str, i));
1209 next;
1210 }
1211 printf("-%s\n", c);
1212 if (arg[c]) {
1213 if (i < len)
1214 printf("'%s'\n", substr(str, i + 1));
1215 else
1216 expect = 1;
1217 next;
1218 }
1219 }
1220}
1221END {
1222 if (expect)
1223 print "?";
1224}
1225EOF
1226
1227: process the command line options
1228set X `for arg in "$@"; do echo "X$arg"; done |
1229 sed -e s/X// | awk -f options.awk`
1230eval "set $*"
1231shift
1232rm -f options.awk
1233
1234: set up default values
1235fastread=''
1236reuseval=false
1237config_sh=''
1238alldone=''
1239error=''
1240silent=''
1241extractsh=''
1242override=''
1243knowitall=''
1244rm -f optdef.sh posthint.sh
1245cat >optdef.sh <<EOS
1246$startsh
1247EOS
1248
1249
1250: option parsing
1251while test $# -gt 0; do
1252 case "$1" in
1253 -d) shift; fastread=yes;;
1254 -e) shift; alldone=cont;;
1255 -f)
1256 shift
1257 cd ..
1258 if test -r "$1"; then
1259 config_sh="$1"
1260 else
1261 echo "$me: cannot read config file $1." >&2
1262 error=true
1263 fi
1264 cd UU
1265 shift;;
1266 -h) shift; error=true;;
1267 -r) shift; reuseval=true;;
1268 -s) shift; silent=true; realsilent=true;;
1269 -E) shift; alldone=exit;;
1270 -K) shift; knowitall=true;;
1271 -O) shift; override=true;;
1272 -S) shift; silent=true; extractsh=true;;
1273 -D)
1274 shift
1275 case "$1" in
1276 *=)
1277 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1278 echo "$me: ignoring -D $1" >&2
1279 ;;
1280 *=*) echo "$1" | \
1281 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1282 *) echo "$1='define'" >> optdef.sh;;
1283 esac
1284 shift
1285 ;;
1286 -U)
1287 shift
1288 case "$1" in
1289 *=) echo "$1" >> optdef.sh;;
1290 *=*)
1291 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1292 echo "$me: ignoring -U $1" >&2
1293 ;;
1294 *) echo "$1='undef'" >> optdef.sh;;
1295 esac
1296 shift
1297 ;;
1298 -A)
1299 shift
1300 xxx=''
1301 yyy="$1"
1302 zzz=''
1303 uuu=undef
1304 case "$yyy" in
1305 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1306 case "$zzz" in
1307 *:*) zzz='' ;;
1308 *) xxx=append
1309 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1310 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1311 esac
1312 ;;
1313 esac
1314 case "$xxx" in
1315 '') case "$yyy" in
1316 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1317 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1318 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1319 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1320 *) xxx=`echo $yyy|sed 's!:.*!!'`
1321 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1322 esac
1323 ;;
1324 esac
1325 case "$xxx" in
1326 append)
1327 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1328 clear)
1329 echo "$yyy=''" >> posthint.sh ;;
1330 define)
1331 case "$zzz" in
1332 '') zzz=define ;;
1333 esac
1334 echo "$yyy='$zzz'" >> posthint.sh ;;
1335 eval)
1336 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1337 prepend)
1338 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1339 undef)
1340 case "$zzz" in
1341 '') zzz="$uuu" ;;
1342 esac
1343 echo "$yyy=$zzz" >> posthint.sh ;;
1344 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1345 esac
1346 shift
1347 ;;
1348 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1349 exit 0;;
1350 --) break;;
1351 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1352 *) break;;
1353 esac
1354done
1355
1356case "$error" in
1357true)
1358 cat >&2 <<EOM
1359Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1360 [-U symbol] [-U symbol=] [-A command:symbol...]
1361 -d : use defaults for all answers.
1362 -e : go on without questioning past the production of config.sh.
1363 -f : specify an alternate default configuration file.
1364 -h : print this help message and exit (with an error status).
1365 -r : reuse C symbols value if possible (skips costly nm extraction).
1366 -s : silent mode, only echoes questions and essential information.
1367 -D : define symbol to have some value:
1368 -D symbol symbol gets the value 'define'
1369 -D symbol=value symbol gets the value 'value'
1370 -E : stop at the end of questions, after having produced config.sh.
1371 -K : do not use unless you know what you are doing.
1372 -O : let -D and -U override definitions from loaded configuration file.
1373 -S : perform variable substitutions on all .SH files (can mix with -f)
1374 -U : undefine symbol:
1375 -U symbol symbol gets the value 'undef'
1376 -U symbol= symbol gets completely empty
1377 -A : manipulate symbol after the platform specific hints have been applied:
1378 -A symbol=value append " "value to symbol
1379 -A append:symbol=value append value to symbol
1380 -A define:symbol=value define symbol to have value
1381 -A clear:symbol define symbol to be ''
1382 -A define:symbol define symbol to be 'define'
1383 -A eval:symbol=value define symbol to be eval of value
1384 -A prepend:symbol=value prepend value to symbol
1385 -A undef:symbol define symbol to be 'undef'
1386 -A undef:symbol= define symbol to be ''
1387 -V : print version number and exit (with a zero status).
1388EOM
1389 exit 1
1390 ;;
1391esac
1392
1393: Sanity checks
1394case "$fastread$alldone" in
1395yescont|yesexit) ;;
1396*)
1397 case "$extractsh" in
1398 true) ;;
1399 *)
1400 if test ! -t 0; then
1401 echo "Say 'sh Configure', not 'sh <Configure'"
1402 exit 1
1403 fi
1404 ;;
1405 esac
1406 ;;
1407esac
1408
1409exec 4>&1
1410case "$silent" in
1411true) exec 1>/dev/null;;
1412esac
1413
1414: run the defines and the undefines, if any, but leave the file out there...
1415touch optdef.sh
1416. ./optdef.sh
1417: create the posthint manipulation script and leave the file out there...
1418touch posthint.sh
1419
1420: set package name
1421package=perl5
1422first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1423last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1424case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1425ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1426*) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1427esac
1428
1429: Some greps do not return status, grrr.
1430echo "grimblepritz" >grimble
1431if grep blurfldyick grimble >/dev/null 2>&1 ; then
1432 contains=contains
1433elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1434 contains=grep
1435else
1436 contains=contains
1437fi
1438rm -f grimble
1439: the following should work in any shell
1440case "$contains" in
1441contains*)
1442 echo " "
1443 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1444 cat >contains <<'EOSS'
1445grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1446EOSS
1447chmod +x contains
1448esac
1449
1450: Find the path to the source tree
1451case "$src" in
1452'') case "$0" in
1453 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1454 case "$src" in
1455 /*) ;;
1456 .) ;;
1457 *) src=`cd ../$src && pwd` ;;
1458 esac
1459 ;;
1460 *) src='.';;
1461 esac;;
1462esac
1463case "$src" in
1464'') src=/
1465 rsrc=/
1466 ;;
1467/*) rsrc="$src";;
1468*) rsrc="../$src";;
1469esac
1470if test -f $rsrc/Configure && \
1471 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1472then
1473 : found it, so we are ok.
1474else
1475 rsrc=''
1476 for src in . .. ../.. ../../.. ../../../..; do
1477 if test -f ../$src/Configure && \
1478 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1479 then
1480 rsrc=../$src
1481 break
1482 fi
1483 done
1484fi
1485case "$rsrc" in
1486'')
1487 cat <<EOM >&4
1488
1489Sorry, I can't seem to locate the source dir for $package. Please start
1490Configure with an explicit path -- i.e. /some/path/Configure.
1491
1492EOM
1493 exit 1
1494 ;;
1495../.) rsrc='..';;
1496*)
1497 echo " "
1498 echo "Sources for $package found in \"$src\"." >&4
1499 ;;
1500esac
1501
1502: script used to extract .SH files with variable substitutions
1503cat >extract <<'EOS'
1504PERL_CONFIG_SH=true
1505echo "Doing variable substitutions on .SH files..."
1506if test -f $src/MANIFEST; then
1507 set x `awk '{print $1}' <$src/MANIFEST | grep '\.SH$'`
1508else
1509 echo "(Looking for .SH files under the source directory.)"
1510 set x `(cd $src; find . -name "*.SH" -print)`
1511fi
1512shift
1513case $# in
15140) set x `(cd $src; echo *.SH)`; shift;;
1515esac
1516if test ! -f $src/$1; then
1517 shift
1518fi
1519mkdir_p='
1520name=$1;
1521create="";
1522while test $name; do
1523 if test ! -d "$name"; then
1524 create="$name $create";
1525 name=`echo $name | sed -e "s|^[^/]*$||"`;
1526 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1527 else
1528 name="";
1529 fi;
1530done;
1531for file in $create; do
1532 mkdir $file;
1533done
1534'
1535for file in $*; do
1536 case "$src" in
1537 ".")
1538 case "$file" in
1539 */*)
1540 dir=`expr X$file : 'X\(.*\)/'`
1541 file=`expr X$file : 'X.*/\(.*\)'`
1542 (cd $dir && . ./$file)
1543 ;;
1544 *)
1545 . ./$file
1546 ;;
1547 esac
1548 ;;
1549 *)
1550 case "$file" in
1551 */*)
1552 dir=`expr X$file : 'X\(.*\)/'`
1553 file=`expr X$file : 'X.*/\(.*\)'`
1554 (set x $dir; shift; eval $mkdir_p)
1555 sh <$src/$dir/$file
1556 ;;
1557 *)
1558 sh <$src/$file
1559 ;;
1560 esac
1561 ;;
1562 esac
1563done
1564if test -f $src/config_h.SH; then
1565 if test ! -f config.h; then
1566 : oops, they left it out of MANIFEST, probably, so do it anyway.
1567 . $src/config_h.SH
1568 fi
1569fi
1570EOS
1571
1572: extract files and exit if asked to do so
1573case "$extractsh" in
1574true)
1575 case "$realsilent" in
1576 true) ;;
1577 *) exec 1>&4;;
1578 esac
1579 case "$config_sh" in
1580 '') config_sh='config.sh';;
1581 esac
1582 echo " "
1583 echo "Fetching answers from $config_sh..."
1584 cd ..
1585 . $config_sh
1586 test "$override" && . ./optdef.sh
1587 echo " "
1588 . UU/extract
1589 rm -rf UU
1590 echo "Done."
1591 exit 0
1592 ;;
1593esac
1594
1595: Eunice requires " " instead of "", can you believe it
1596echo " "
1597: Here we go...
1598echo "Beginning of configuration questions for $package."
1599
1600trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1601
1602: first determine how to suppress newline on echo command
1603echo " "
1604echo "Checking echo to see how to suppress newlines..."
1605(echo "hi there\c" ; echo " ") >.echotmp
1606if $contains c .echotmp >/dev/null 2>&1 ; then
1607 echo "...using -n."
1608 n='-n'
1609 c=''
1610else
1611 cat <<'EOM'
1612...using \c
1613EOM
1614 n=''
1615 c='\c'
1616fi
1617echo $n "The star should be here-->$c"
1618echo '*'
1619rm -f .echotmp
1620
1621: Now test for existence of everything in MANIFEST
1622echo " "
1623if test -f $rsrc/MANIFEST; then
1624 echo "First let's make sure your kit is complete. Checking..." >&4
1625 awk '$1 !~ /PACK[A-Z]+/ {print $1}' $rsrc/MANIFEST | split -50
1626 rm -f missing
1627 tmppwd=`pwd`
1628 for filelist in x??; do
1629 (cd $rsrc; ls `cat $tmppwd/$filelist` >/dev/null 2>>$tmppwd/missing)
1630 done
1631 if test -s missing; then
1632 cat missing >&4
1633 cat >&4 <<'EOM'
1634
1635THIS PACKAGE SEEMS TO BE INCOMPLETE.
1636
1637You have the option of continuing the configuration process, despite the
1638distinct possibility that your kit is damaged, by typing 'y'es. If you
1639do, don't blame me if something goes wrong. I advise you to type 'n'o
1640and contact the author (perlbug@perl.org).
1641
1642EOM
1643 echo $n "Continue? [n] $c" >&4
1644 read ans
1645 case "$ans" in
1646 y*)
1647 echo "Continuing..." >&4
1648 rm -f missing
1649 ;;
1650 *)
1651 echo "ABORTING..." >&4
1652 kill $$
1653 ;;
1654 esac
1655 else
1656 echo "Looks good..."
1657 fi
1658else
1659 echo "There is no MANIFEST file. I hope your kit is complete !"
1660fi
1661rm -f missing x??
1662
1663echo " "
1664: Find the appropriate value for a newline for tr
1665if test -n "$DJGPP"; then
1666 trnl='\012'
1667fi
1668if test X"$trnl" = X; then
1669 case "`echo foo|tr '\n' x 2>/dev/null`" in
1670 foox) trnl='\n' ;;
1671 esac
1672fi
1673if test X"$trnl" = X; then
1674 case "`echo foo|tr '\012' x 2>/dev/null`" in
1675 foox) trnl='\012' ;;
1676 esac
1677fi
1678if test X"$trnl" = X; then
1679 cat <<EOM >&2
1680
1681$me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1682
1683EOM
1684 exit 1
1685fi
1686
1687: compute the number of columns on the terminal for proper question formatting
1688case "$COLUMNS" in
1689'') COLUMNS='80';;
1690esac
1691
1692: set up the echo used in my read
1693myecho="case \"\$xxxm\" in
1694'') echo $n \"\$rp $c\" >&4;;
1695*) case \"\$rp\" in
1696 '') echo $n \"[\$xxxm] $c\";;
1697 *)
1698 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1699 echo \"\$rp\" >&4
1700 echo $n \"[\$xxxm] $c\" >&4
1701 else
1702 echo $n \"\$rp [\$xxxm] $c\" >&4
1703 fi
1704 ;;
1705 esac;;
1706esac"
1707
1708: now set up to do reads with possible shell escape and default assignment
1709cat <<EOSC >myread
1710$startsh
1711xxxm=\$dflt
1712$myecho
1713ans='!'
1714case "\$fastread" in
1715yes) case "\$dflt" in
1716 '') ;;
1717 *) ans='';
1718 case "\$silent-\$rp" in
1719 true-) ;;
1720 *) echo " " >&4;;
1721 esac;;
1722 esac;;
1723*) case "\$silent" in
1724 true) case "\$rp" in
1725 '') ans='';;
1726 esac;;
1727 esac;;
1728esac
1729while expr "X\$ans" : "X!" >/dev/null; do
1730 read answ
1731 set x \$xxxm
1732 shift
1733 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1734 case "\$answ" in
1735 "!")
1736 sh 1>&4
1737 echo " "
1738 $myecho
1739 ;;
1740 !*)
1741 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1742 shift
1743 sh 1>&4 -c "\$*"
1744 echo " "
1745 $myecho
1746 ;;
1747 "\$ans")
1748 case "\$ans" in
1749 \\&*)
1750 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1751 shift
1752 case "\$1" in
1753 -d)
1754 fastread=yes
1755 echo "(OK, I'll run with -d after this question.)" >&4
1756 ;;
1757 -*)
1758 echo "*** Sorry, \$1 not supported yet." >&4
1759 ;;
1760 esac
1761 $myecho
1762 ans=!
1763 ;;
1764 esac;;
1765 *)
1766 case "\$aok" in
1767 y)
1768 echo "*** Substitution done -- please confirm."
1769 xxxm="\$ans"
1770 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1771 xxxm="\$ans"
1772 ans=!
1773 ;;
1774 *)
1775 echo "*** Error -- try again."
1776 ans=!
1777 ;;
1778 esac
1779 $myecho
1780 ;;
1781 esac
1782 case "\$ans\$xxxm\$nostick" in
1783 '')
1784 ans=!
1785 $myecho
1786 ;;
1787 esac
1788done
1789case "\$ans" in
1790'') ans="\$xxxm";;
1791esac
1792EOSC
1793
1794: create .config dir to save info across Configure sessions
1795test -d ../.config || mkdir ../.config
1796cat >../.config/README <<EOF
1797This directory created by Configure to save information that should
1798persist across sessions for $package.
1799
1800You may safely delete it if you wish.
1801EOF
1802
1803xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1804case "$usedevel" in
1805$define|true|[yY]*) ;;
1806*) case "$xversion" in
1807 *[13579])
1808 cat >&4 <<EOH
1809*** WHOA THERE!!! ***
1810
1811 This is an UNSTABLE DEVELOPMENT release.
1812 The version of this $package distribution is $xversion, that is, odd,
1813 (as opposed to even) and that signifies a development release.
1814 If you want a maintenance release, you want an even-numbered version.
1815
1816 Do ***NOT*** install this into production use.
1817 Data corruption and crashes are possible.
1818
1819 It is most seriously suggested that you do not continue any further
1820 unless you want to help in developing and debugging Perl.
1821
1822 If you *still* want to build perl, you can answer 'y' now,
1823 or pass -Dusedevel to Configure.
1824
1825EOH
1826 rp='Do you really want to continue?'
1827 dflt='n'
1828 . ./myread
1829 case "$ans" in
1830 [yY]) echo >&4 "Okay, continuing."
1831 usedevel="$define" ;;
1832 *) echo >&4 "Okay, bye."
1833 exit 1
1834 ;;
1835 esac
1836 ;;
1837 esac
1838 ;;
1839esac
1840case "$usedevel" in
1841$define|true|[yY]*)
1842 case "$versiononly" in
1843 '') versiononly="$define" ;;
1844 esac
1845 case "$installusrbinperl" in
1846 '') installusrbinperl="$undef" ;;
1847 esac
1848 ;;
1849esac
1850
1851: general instructions
1852needman=true
1853firsttime=true
1854user=`(logname) 2>/dev/null`
1855case "$user" in
1856'') user=`whoami 2>&1`;;
1857esac
1858if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
1859 firsttime=false
1860 echo " "
1861 rp='Would you like to see the instructions?'
1862 dflt=n
1863 . ./myread
1864 case "$ans" in
1865 [yY]*) ;;
1866 *) needman=false;;
1867 esac
1868fi
1869if $needman; then
1870 cat <<EOH
1871
1872This installation shell script will examine your system and ask you questions
1873to determine how the perl5 package should be installed. If you get
1874stuck on a question, you may use a ! shell escape to start a subshell or
1875execute a command. Many of the questions will have default answers in square
1876brackets; typing carriage return will give you the default.
1877
1878On some of the questions which ask for file or directory names you are allowed
1879to use the ~name construct to specify the login directory belonging to "name",
1880even if you don't have a shell which knows about that. Questions where this is
1881allowed will be marked "(~name ok)".
1882
1883EOH
1884 rp=''
1885 dflt='Type carriage return to continue'
1886 . ./myread
1887 cat <<'EOH'
1888
1889The prompter used in this script allows you to use shell variables and
1890backticks in your answers. You may use $1, $2, etc... to refer to the words
1891in the default answer, as if the default line was a set of arguments given to a
1892script shell. This means you may also use $* to repeat the whole default line,
1893so you do not have to re-type everything to add something to the default.
1894
1895Everytime there is a substitution, you will have to confirm. If there is an
1896error (e.g. an unmatched backtick), the default answer will remain unchanged
1897and you will be prompted again.
1898
1899If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
1900the questions and use the computed defaults (or the previous answers if there
1901was already a config.sh file). Type 'Configure -h' for a list of options.
1902You may also start interactively and then answer '& -d' at any prompt to turn
1903on the non-interactive behaviour for the remainder of the execution.
1904
1905EOH
1906 . ./myread
1907 cat <<EOH
1908
1909Much effort has been expended to ensure that this shell script will run on any
1910Unix system. If despite that it blows up on yours, your best bet is to edit
1911Configure and run it again. If you can't run Configure for some reason,
1912you'll have to generate a config.sh file by hand. Whatever problems you
1913have, let me (perlbug@perl.org) know how I blew it.
1914
1915This installation script affects things in two ways:
1916
19171) it may do direct variable substitutions on some of the files included
1918 in this kit.
19192) it builds a config.h file for inclusion in C programs. You may edit
1920 any of these files as the need arises after running this script.
1921
1922If you make a mistake on a question, there is no easy way to back up to it
1923currently. The easiest thing to do is to edit config.sh and rerun all the SH
1924files. Configure will offer to let you do this before it runs the SH files.
1925
1926EOH
1927 dflt='Type carriage return to continue'
1928 . ./myread
1929 case "$firsttime" in
1930 true) echo $user >>../.config/instruct;;
1931 esac
1932fi
1933
1934: find out where common programs are
1935echo " "
1936echo "Locating common programs..." >&4
1937cat <<EOSC >loc
1938$startsh
1939case \$# in
19400) exit 1;;
1941esac
1942thing=\$1
1943shift
1944dflt=\$1
1945shift
1946for dir in \$*; do
1947 case "\$thing" in
1948 .)
1949 if test -d \$dir/\$thing; then
1950 echo \$dir
1951 exit 0
1952 fi
1953 ;;
1954 *)
1955 for thisthing in \$dir/\$thing; do
1956 : just loop through to pick last item
1957 done
1958 if test -f \$thisthing; then
1959 echo \$thisthing
1960 exit 0
1961 elif test -f \$dir/\$thing.exe; then
1962 if test -n "$DJGPP"; then
1963 echo \$dir/\$thing.exe
1964 else
1965 : on Eunice apparently
1966 echo \$dir/\$thing
1967 fi
1968 exit 0
1969 fi
1970 ;;
1971 esac
1972done
1973echo \$dflt
1974exit 1
1975EOSC
1976chmod +x loc
1977$eunicefix loc
1978loclist="
1979awk
1980cat
1981comm
1982cp
1983echo
1984expr
1985grep
1986ls
1987make
1988mkdir
1989rm
1990sed
1991sort
1992touch
1993tr
1994uniq
1995"
1996trylist="
1997Mcc
1998ar
1999bison
2000byacc
2001cpp
2002csh
2003date
2004egrep
2005gzip
2006less
2007ln
2008more
2009nm
2010nroff
2011pg
2012test
2013uname
2014zip
2015"
2016pth=`echo $PATH | sed -e "s/$p_/ /g"`
2017pth="$pth /lib /usr/lib"
2018for file in $loclist; do
2019 eval xxx=\$$file
2020 case "$xxx" in
2021 /*|?:[\\/]*)
2022 if test -f "$xxx"; then
2023 : ok
2024 else
2025 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2026 xxx=`./loc $file $file $pth`
2027 fi
2028 ;;
2029 '') xxx=`./loc $file $file $pth`;;
2030 *) xxx=`./loc $xxx $xxx $pth`;;
2031 esac
2032 eval $file=$xxx
2033 eval _$file=$xxx
2034 case "$xxx" in
2035 /*)
2036 echo $file is in $xxx.
2037 ;;
2038 ?:[\\/]*)
2039 echo $file is in $xxx.
2040 ;;
2041 *)
2042 echo "I don't know where '$file' is, and my life depends on it." >&4
2043 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2044 exit 1
2045 ;;
2046 esac
2047done
2048echo " "
2049echo "Don't worry if any of the following aren't found..."
2050say=offhand
2051for file in $trylist; do
2052 eval xxx=\$$file
2053 case "$xxx" in
2054 /*|?:[\\/]*)
2055 if test -f "$xxx"; then
2056 : ok
2057 else
2058 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2059 xxx=`./loc $file $file $pth`
2060 fi
2061 ;;
2062 '') xxx=`./loc $file $file $pth`;;
2063 *) xxx=`./loc $xxx $xxx $pth`;;
2064 esac
2065 eval $file=$xxx
2066 eval _$file=$xxx
2067 case "$xxx" in
2068 /*)
2069 echo $file is in $xxx.
2070 ;;
2071 ?:[\\/]*)
2072 echo $file is in $xxx.
2073 ;;
2074 *)
2075 echo "I don't see $file out there, $say."
2076 say=either
2077 ;;
2078 esac
2079done
2080case "$egrep" in
2081egrep)
2082 echo "Substituting grep for egrep."
2083 egrep=$grep
2084 ;;
2085esac
2086case "$ln" in
2087ln)
2088 echo "Substituting cp for ln."
2089 ln=$cp
2090 ;;
2091esac
2092case "$test" in
2093test)
2094 echo "Hopefully test is built into your sh."
2095 ;;
2096*)
2097 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2098 echo "Using the test built into your sh."
2099 test=test
2100 _test=test
2101 fi
2102 ;;
2103esac
2104case "$echo" in
2105echo)
2106 echo "Hopefully echo is built into your sh."
2107 ;;
2108'') ;;
2109*)
2110 echo " "
2111echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2112 $echo $n "hi there$c" >foo1
2113 echo $n "hi there$c" >foo2
2114 if cmp foo1 foo2 >/dev/null 2>&1; then
2115 echo "They are compatible. In fact, they may be identical."
2116 else
2117 case "$n" in
2118 '-n') n='' c='\c';;
2119 *) n='-n' c='';;
2120 esac
2121 cat <<FOO
2122They are not compatible! You are probably running ksh on a non-USG system.
2123I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2124have echo built in and we may have to run some Bourne shell scripts. That
2125means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2126
2127FOO
2128 $echo $n "The star should be here-->$c"
2129 $echo "*"
2130 fi
2131 $rm -f foo1 foo2
2132 ;;
2133esac
2134
2135cat <<EOS >checkcc
2136$startsh
2137EOS
2138cat <<'EOSC' >>checkcc
2139case "$cc" in
2140'') ;;
2141*) $rm -f try try.*
2142 $cat >try.c <<EOM
2143int main(int argc, char *argv[]) {
2144 return 0;
2145}
2146EOM
2147 if $cc -o try $ccflags $ldflags try.c; then
2148 :
2149 else
2150 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2151 despair=yes
2152 trygcc=yes
2153 case "$cc" in
2154 *gcc*) trygcc=no ;;
2155 esac
2156 case "`$cc -v -c try.c 2>&1`" in
2157 *gcc*) trygcc=no ;;
2158 esac
2159 if $test X"$trygcc" = Xyes; then
2160 if gcc -o try -c try.c; then
2161 echo " "
2162 echo "You seem to have a working gcc, though." >&4
2163 rp="Would you like to use it?"
2164 dflt=y
2165 if $test -f myread; then
2166 . ./myread
2167 else
2168 if $test -f UU/myread; then
2169 . ./UU/myread
2170 else
2171 echo "Cannot find myread, sorry. Aborting." >&2
2172 exit 1
2173 fi
2174 fi
2175 case "$ans" in
2176 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no ;;
2177 esac
2178 fi
2179 fi
2180 if $test X"$despair" = Xyes; then
2181 $cat >&4 <<EOM
2182You need to find a working C compiler.
2183Either (purchase and) install the C compiler supplied by your OS vendor,
2184or for a free C compiler try http://gcc.gnu.org/
2185I cannot continue any further, aborting.
2186EOM
2187 exit 1
2188 fi
2189 fi
2190 $rm -f try try.*
2191 ;;
2192esac
2193EOSC
2194
2195: determine whether symbolic links are supported
2196echo " "
2197$touch blurfl
2198if $ln -s blurfl sym > /dev/null 2>&1 ; then
2199 echo "Symbolic links are supported." >&4
2200 lns="$ln -s"
2201else
2202 echo "Symbolic links are NOT supported." >&4
2203 lns="$ln"
2204fi
2205$rm -f blurfl sym
2206
2207: determine whether symbolic links are supported
2208echo " "
2209case "$lns" in
2210*"ln -s")
2211 echo "Checking how to test for symbolic links..." >&4
2212 $lns blurfl sym
2213 if $test "X$issymlink" = X; then
2214 sh -c "PATH= test -h sym" >/dev/null 2>&1
2215 if test $? = 0; then
2216 issymlink="test -h"
2217 fi
2218 fi
2219 if $test "X$issymlink" = X; then
2220 if $test -h >/dev/null 2>&1; then
2221 issymlink="$test -h"
2222 echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
2223 fi
2224 fi
2225 if $test "X$issymlink" = X; then
2226 if $test -L sym 2>/dev/null; then
2227 issymlink="$test -L"
2228 fi
2229 fi
2230 if $test "X$issymlink" != X; then
2231 echo "You can test for symbolic links with '$issymlink'." >&4
2232 else
2233 echo "I do not know how you can test for symbolic links." >&4
2234 fi
2235 $rm -f blurfl sym
2236 ;;
2237*) echo "No symbolic links, so not testing for their testing..." >&4
2238 ;;
2239esac
2240echo " "
2241
2242
2243case "$mksymlinks" in
2244$define|true|[yY]*)
2245 case "$src" in
2246 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2247 exit 1
2248 ;;
2249 *) case "$lns:$issymlink" in
2250 *"ln -s:"*"test -"?)
2251 echo "Creating the symbolic links..." >&4
2252 echo "(First creating the subdirectories...)" >&4
2253 cd ..
2254 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2255 read directory
2256 test -z "$directory" && break
2257 mkdir -p $directory
2258 done
2259 # Sanity check 1.
2260 if test ! -d t/base; then
2261 echo "Failed to create the subdirectories. Aborting." >&4
2262 exit 1
2263 fi
2264 echo "(Then creating the symlinks...)" >&4
2265 awk '{print $1}' $src/MANIFEST | while true; do
2266 read filename
2267 test -z "$filename" && break
2268 if test -f $filename; then
2269 if $issymlink $filename; then
2270 rm -f $filename
2271 fi
2272 fi
2273 if test -f $filename; then
2274 echo "$filename already exists, not symlinking."
2275 else
2276 ln -s $src/$filename $filename
2277 fi
2278 done
2279 # Sanity check 2.
2280 if test ! -f t/base/commonsense.t; then
2281 echo "Failed to create the symlinks. Aborting." >&4
2282 exit 1
2283 fi
2284 cd UU
2285 ;;
2286 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2287 ;;
2288 esac
2289 ;;
2290 esac
2291 ;;
2292esac
2293
2294: see whether [:lower:] and [:upper:] are supported character classes
2295echo " "
2296case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2297ABYZ)
2298 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2299 up='[:upper:]'
2300 low='[:lower:]'
2301 ;;
2302*) # There is a discontinuity in EBCDIC between 'I' and 'J'
2303 # (0xc9 and 0xd1), therefore that is a nice testing point.
2304 if test "X$up" = X -o "X$low" = X; then
2305 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2306 ij) up='[A-Z]'
2307 low='[a-z]'
2308 ;;
2309 esac
2310 fi
2311 if test "X$up" = X -o "X$low" = X; then
2312 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2313 ij) up='A-Z'
2314 low='a-z'
2315 ;;
2316 esac
2317 fi
2318 if test "X$up" = X -o "X$low" = X; then
2319 case "`echo IJ | od -x 2>/dev/null`" in
2320 *C9D1*|*c9d1*)
2321 echo "Hey, this might be EBCDIC." >&4
2322 if test "X$up" = X -o "X$low" = X; then
2323 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2324 ij) up='[A-IJ-RS-Z]'
2325 low='[a-ij-rs-z]'
2326 ;;
2327 esac
2328 fi
2329 if test "X$up" = X -o "X$low" = X; then
2330 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2331 ij) up='A-IJ-RS-Z'
2332 low='a-ij-rs-z'
2333 ;;
2334 esac
2335 fi
2336 ;;
2337 esac
2338 fi
2339esac
2340case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2341ij)
2342 echo "Using $up and $low to convert case." >&4
2343 ;;
2344*)
2345 echo "I don't know how to translate letters from upper to lower case." >&4
2346 echo "Your tr is not acting any way I know of." >&4
2347 exit 1
2348 ;;
2349esac
2350: set up the translation script tr, must be called with ./tr of course
2351cat >tr <<EOSC
2352$startsh
2353case "\$1\$2" in
2354'[A-Z][a-z]') exec $tr '$up' '$low';;
2355'[a-z][A-Z]') exec $tr '$low' '$up';;
2356esac
2357exec $tr "\$@"
2358EOSC
2359chmod +x tr
2360$eunicefix tr
2361
2362: Try to determine whether config.sh was made on this system
2363case "$config_sh" in
2364'')
2365myuname=`$uname -a 2>/dev/null`
2366$test -z "$myuname" && myuname=`hostname 2>/dev/null`
2367# tr '[A-Z]' '[a-z]' would not work in EBCDIC
2368# because the A-Z/a-z are not consecutive.
2369myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2370 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2371newmyuname="$myuname"
2372dflt=n
2373case "$knowitall" in
2374'')
2375 if test -f ../config.sh; then
2376 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2377 eval "`grep myuname= ../config.sh`"
2378 fi
2379 if test "X$myuname" = "X$newmyuname"; then
2380 dflt=y
2381 fi
2382 fi
2383 ;;
2384*) dflt=y;;
2385esac
2386
2387: Get old answers from old config file if Configure was run on the
2388: same system, otherwise use the hints.
2389hint=default
2390cd ..
2391if test -f config.sh; then
2392 echo " "
2393 rp="I see a config.sh file. Shall I use it to set the defaults?"
2394 . UU/myread
2395 case "$ans" in
2396 n*|N*) echo "OK, I'll ignore it."
2397 mv config.sh config.sh.old
2398 myuname="$newmyuname"
2399 ;;
2400 *) echo "Fetching default answers from your old config.sh file..." >&4
2401 tmp_n="$n"
2402 tmp_c="$c"
2403 tmp_sh="$sh"
2404 . ./config.sh
2405 cp config.sh UU
2406 n="$tmp_n"
2407 c="$tmp_c"
2408 : Older versions did not always set $sh. Catch re-use of such
2409 : an old config.sh.
2410 case "$sh" in
2411 '') sh="$tmp_sh" ;;
2412 esac
2413 hint=previous
2414 ;;
2415 esac
2416fi
2417. ./UU/checkcc
2418if test ! -f config.sh; then
2419 $cat <<EOM
2420
2421First time through, eh? I have some defaults handy for some systems
2422that need some extra help getting the Configure answers right:
2423
2424EOM
2425 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2426 dflt=''
2427 : Half the following guesses are probably wrong... If you have better
2428 : tests or hints, please send them to perlbug@perl.org
2429 : The metaconfig authors would also appreciate a copy...
2430 $test -f /irix && osname=irix
2431 $test -f /xenix && osname=sco_xenix
2432 $test -f /dynix && osname=dynix
2433 $test -f /dnix && osname=dnix
2434 $test -f /lynx.os && osname=lynxos
2435 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2436 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2437 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2438 $test -f /bin/mips && /bin/mips && osname=mips
2439 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2440 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2441 $test -d /usr/apollo/bin && osname=apollo
2442 $test -f /etc/saf/_sactab && osname=svr4
2443 $test -d /usr/include/minix && osname=minix
2444 if $test -d /MachTen -o -d /MachTen_Folder; then
2445 osname=machten
2446 if $test -x /sbin/version; then
2447 osvers=`/sbin/version | $awk '{print $2}' |
2448 $sed -e 's/[A-Za-z]$//'`
2449 elif $test -x /usr/etc/version; then
2450 osvers=`/usr/etc/version | $awk '{print $2}' |
2451 $sed -e 's/[A-Za-z]$//'`
2452 else
2453 osvers="$2.$3"
2454 fi
2455 fi
2456
2457 $test -f /sys/posix.dll &&
2458 $test -f /usr/bin/what &&
2459 set X `/usr/bin/what /sys/posix.dll` &&
2460 $test "$3" = UWIN &&
2461 osname=uwin &&
2462 osvers="$5"
2463
2464 if $test -f $uname; then
2465 set X $myuname
2466 shift
2467
2468 case "$5" in
2469 fps*) osname=fps ;;
2470 mips*)
2471 case "$4" in
2472 umips) osname=umips ;;
2473 *) osname=mips ;;
2474 esac;;
2475 [23]100) osname=mips ;;
2476 next*) osname=next ;;
2477 i386*)
2478 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2479 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2480 osname='sco'
2481 osvers=$tmp
2482 elif $test -f /etc/kconfig; then
2483 osname=isc
2484 if test "$lns" = "$ln -s"; then
2485 osvers=4
2486 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2487 osvers=3
2488 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2489 osvers=2
2490 fi
2491 fi
2492 tmp=''
2493 ;;
2494 pc*)
2495 if test -n "$DJGPP"; then
2496 osname=dos
2497 osvers=djgpp
2498 fi
2499 ;;
2500 esac
2501
2502 case "$1" in
2503 aix) osname=aix
2504 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
2505 case "$tmp" in
2506 'not found') osvers="$4"."$3" ;;
2507 '<3240'|'<>3240') osvers=3.2.0 ;;
2508 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
2509 '=3250'|'>3250') osvers=3.2.5 ;;
2510 *) osvers=$tmp;;
2511 esac
2512 ;;
2513 bsd386) osname=bsd386
2514 osvers=`$uname -r`
2515 ;;
2516 cygwin*) osname=cygwin
2517 osvers="$3"
2518 ;;
2519 *dc.osx) osname=dcosx
2520 osvers="$3"
2521 ;;
2522 dnix) osname=dnix
2523 osvers="$3"
2524 ;;
2525 domainos) osname=apollo
2526 osvers="$3"
2527 ;;
2528 dgux) osname=dgux
2529 osvers="$3"
2530 ;;
2531 dynixptx*) osname=dynixptx
2532 osvers=`echo "$4"|sed 's/^v//'`
2533 ;;
2534 freebsd) osname=freebsd
2535 osvers="$3" ;;
2536 genix) osname=genix ;;
2537 hp*) osname=hpux
2538 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
2539 ;;
2540 irix*) osname=irix
2541 case "$3" in
2542 4*) osvers=4 ;;
2543 5*) osvers=5 ;;
2544 *) osvers="$3" ;;
2545 esac
2546 ;;
2547 linux) osname=linux
2548 case "$3" in
2549 *) osvers="$3" ;;
2550 esac
2551 ;;
2552 MiNT) osname=mint
2553 ;;
2554 netbsd*) osname=netbsd
2555 osvers="$3"
2556 ;;
2557 news-os) osvers="$3"
2558 case "$3" in
2559 4*) osname=newsos4 ;;
2560 *) osname=newsos ;;
2561 esac
2562 ;;
2563 next*) osname=next ;;
2564 nonstop-ux) osname=nonstopux ;;
2565 POSIX-BC | posix-bc ) osname=posix-bc
2566 osvers="$3"
2567 ;;
2568 powerux | power_ux | powermax_os | powermaxos | \
2569 powerunix | power_unix) osname=powerux
2570 osvers="$3"
2571 ;;
2572 qnx) osname=qnx
2573 osvers="$4"
2574 ;;
2575 solaris) osname=solaris
2576 case "$3" in
2577 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2578 *) osvers="$3" ;;
2579 esac
2580 ;;
2581 sunos) osname=sunos
2582 case "$3" in
2583 5*) osname=solaris
2584 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
2585 *) osvers="$3" ;;
2586 esac
2587 ;;
2588 titanos) osname=titanos
2589 case "$3" in
2590 1*) osvers=1 ;;
2591 2*) osvers=2 ;;
2592 3*) osvers=3 ;;
2593 4*) osvers=4 ;;
2594 *) osvers="$3" ;;
2595 esac
2596 ;;
2597 ultrix) osname=ultrix
2598 osvers="$3"
2599 ;;
2600 osf1|mls+) case "$5" in
2601 alpha)
2602 osname=dec_osf
2603 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
2604 case "$osvers" in
2605 [1-9].[0-9]*) ;;
2606 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
2607 esac
2608 ;;
2609 hp*) osname=hp_osf1 ;;
2610 mips) osname=mips_osf1 ;;
2611 esac
2612 ;;
2613 unixware) osname=svr5
2614 osvers="$4"
2615 ;;
2616 uts) osname=uts
2617 osvers="$3"
2618 ;;
2619 $2) case "$osname" in
2620 *isc*) ;;
2621 *freebsd*) ;;
2622 svr*)
2623 : svr4.x or possibly later
2624 case "svr$3" in
2625 ${osname}*)
2626 osname=svr$3
2627 osvers=$4
2628 ;;
2629 esac
2630 case "$osname" in
2631 svr4.0)
2632 : Check for ESIX
2633 if test -f /stand/boot ; then
2634 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
2635 if test -n "$INITPROG" -a -f "$INITPROG"; then
2636 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
2637 if test -n "$isesix"; then
2638 osname=esix4
2639 fi
2640 fi
2641 fi
2642 ;;
2643 esac
2644 ;;
2645 *) if test -f /etc/systemid; then
2646 osname=sco
2647 set `echo $3 | $sed 's/\./ /g'` $4
2648 if $test -f $src/hints/sco_$1_$2_$3.sh; then
2649 osvers=$1.$2.$3
2650 elif $test -f $src/hints/sco_$1_$2.sh; then
2651 osvers=$1.$2
2652 elif $test -f $src/hints/sco_$1.sh; then
2653 osvers=$1
2654 fi
2655 else
2656 case "$osname" in
2657 '') : Still unknown. Probably a generic Sys V.
2658 osname="sysv"
2659 osvers="$3"
2660 ;;
2661 esac
2662 fi
2663 ;;
2664 esac
2665 ;;
2666 *) case "$osname" in
2667 '') : Still unknown. Probably a generic BSD.
2668 osname="$1"
2669 osvers="$3"
2670 ;;
2671 esac
2672 ;;
2673 esac
2674 else
2675 if test -f /vmunix -a -f $src/hints/news_os.sh; then
2676 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
2677 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
2678 osname=news_os
2679 fi
2680 $rm -f UU/kernel.what
2681 elif test -d c:/.; then
2682 set X $myuname
2683 osname=os2
2684 osvers="$5"
2685 fi
2686 fi
2687
2688 : Now look for a hint file osname_osvers, unless one has been
2689 : specified already.
2690 case "$hintfile" in
2691 ''|' ')
2692 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
2693 : Also try without trailing minor version numbers.
2694 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
2695 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
2696 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
2697 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
2698 case "$file" in
2699 '') dflt=none ;;
2700 *) case "$osvers" in
2701 '') dflt=$file
2702 ;;
2703 *) if $test -f $src/hints/$file.sh ; then
2704 dflt=$file
2705 elif $test -f $src/hints/$xfile.sh ; then
2706 dflt=$xfile
2707 elif $test -f $src/hints/$xxfile.sh ; then
2708 dflt=$xxfile
2709 elif $test -f $src/hints/$xxxfile.sh ; then
2710 dflt=$xxxfile
2711 elif $test -f $src/hints/$xxxxfile.sh ; then
2712 dflt=$xxxxfile
2713 elif $test -f "$src/hints/${osname}.sh" ; then
2714 dflt="${osname}"
2715 else
2716 dflt=none
2717 fi
2718 ;;
2719 esac
2720 ;;
2721 esac
2722 if $test -f Policy.sh ; then
2723 case "$dflt" in
2724 *Policy*) ;;
2725 none) dflt="Policy" ;;
2726 *) dflt="Policy $dflt" ;;
2727 esac
2728 fi
2729 ;;
2730 *)
2731 dflt=`echo $hintfile | $sed 's/\.sh$//'`
2732 ;;
2733 esac
2734
2735 if $test -f Policy.sh ; then
2736 $cat <<EOM
2737
2738There's also a Policy hint file available, which should make the
2739site-specific (policy) questions easier to answer.
2740EOM
2741
2742 fi
2743
2744 $cat <<EOM
2745
2746You may give one or more space-separated answers, or "none" if appropriate.
2747A well-behaved OS will have no hints, so answering "none" or just "Policy"
2748is a good thing. DO NOT give a wrong version or a wrong OS.
2749
2750EOM
2751
2752 rp="Which of these apply, if any?"
2753 . UU/myread
2754 tans=$ans
2755 for file in $tans; do
2756 if $test X$file = XPolicy -a -f Policy.sh; then
2757 . Policy.sh
2758 $cat Policy.sh >> UU/config.sh
2759 elif $test -f $src/hints/$file.sh; then
2760 . $src/hints/$file.sh
2761 $cat $src/hints/$file.sh >> UU/config.sh
2762 elif $test X$tans = X -o X$tans = Xnone ; then
2763 : nothing
2764 else
2765 : Give one chance to correct a possible typo.
2766 echo "$file.sh does not exist"
2767 dflt=$file
2768 rp="hint to use instead?"
2769 . UU/myread
2770 for file in $ans; do
2771 if $test -f "$src/hints/$file.sh"; then
2772 . $src/hints/$file.sh
2773 $cat $src/hints/$file.sh >> UU/config.sh
2774 elif $test X$ans = X -o X$ans = Xnone ; then
2775 : nothing
2776 else
2777 echo "$file.sh does not exist -- ignored."
2778 fi
2779 done
2780 fi
2781 done
2782
2783 hint=recommended
2784 : Remember our hint file for later.
2785 if $test -f "$src/hints/$file.sh" ; then
2786 hintfile="$file"
2787 else
2788 hintfile=''
2789 fi
2790fi
2791cd UU
2792;;
2793*)
2794 echo " "
2795 echo "Fetching default answers from $config_sh..." >&4
2796 tmp_n="$n"
2797 tmp_c="$c"
2798 cd ..
2799 cp $config_sh config.sh 2>/dev/null
2800 chmod +w config.sh
2801 . ./config.sh
2802 cd UU
2803 cp ../config.sh .
2804 n="$tmp_n"
2805 c="$tmp_c"
2806 hint=previous
2807 ;;
2808esac
2809test "$override" && . ./optdef.sh
2810
2811: Restore computed paths
2812for file in $loclist $trylist; do
2813 eval $file="\$_$file"
2814done
2815
2816cat << EOM
2817
2818Configure uses the operating system name and version to set some defaults.
2819The default value is probably right if the name rings a bell. Otherwise,
2820since spelling matters for me, either accept the default or answer "none"
2821to leave it blank.
2822
2823EOM
2824case "$osname" in
2825 ''|' ')
2826 case "$hintfile" in
2827 ''|' '|none) dflt=none ;;
2828 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
2829 esac
2830 ;;
2831 *) dflt="$osname" ;;
2832esac
2833rp="Operating system name?"
2834. ./myread
2835case "$ans" in
2836none) osname='' ;;
2837*) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
2838esac
2839echo " "
2840case "$osvers" in
2841 ''|' ')
2842 case "$hintfile" in
2843 ''|' '|none) dflt=none ;;
2844 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
2845 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
2846 case "$dflt" in
2847 ''|' ') dflt=none ;;
2848 esac
2849 ;;
2850 esac
2851 ;;
2852 *) dflt="$osvers" ;;
2853esac
2854rp="Operating system version?"
2855. ./myread
2856case "$ans" in
2857none) osvers='' ;;
2858*) osvers="$ans" ;;
2859esac
2860
2861
2862. ./posthint.sh
2863
2864: who configured the system
2865cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
2866cf_by=`(logname) 2>/dev/null`
2867case "$cf_by" in
2868"")
2869 cf_by=`(whoami) 2>/dev/null`
2870 case "$cf_by" in
2871 "") cf_by=unknown ;;
2872 esac ;;
2873esac
2874
2875: set up the script used to warn in case of inconsistency
2876cat <<EOS >whoa
2877$startsh
2878EOS
2879cat <<'EOSC' >>whoa
2880dflt=y
2881echo " "
2882echo "*** WHOA THERE!!! ***" >&4
2883echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
2884rp=" Keep the $hint value?"
2885. ./myread
2886case "$ans" in
2887y) td=$was; tu=$was;;
2888esac
2889EOSC
2890
2891: function used to set $1 to $val
2892setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
2893case "$val$was" in
2894$define$undef) . ./whoa; eval "$var=\$td";;
2895$undef$define) . ./whoa; eval "$var=\$tu";;
2896*) eval "$var=$val";;
2897esac'
2898
2899case "$usethreads" in
2900$define|true|[yY]*) dflt='y';;
2901*) dflt='n';;
2902esac
2903cat <<EOM
2904
2905Perl can be built to take advantage of threads on some systems.
2906To do so, Configure can be run with -Dusethreads.
2907
2908Note that threading is a highly experimental feature, and
2909some known race conditions still remain. If you choose to try
2910it, be very sure to not actually deploy it for production
2911purposes. README.threads has more details, and is required
2912reading if you enable threads.
2913
2914If this doesn't make any sense to you, just accept the default '$dflt'.
2915EOM
2916rp='Build a threading Perl?'
2917. ./myread
2918case "$ans" in
2919y|Y) val="$define" ;;
2920*) val="$undef" ;;
2921esac
2922set usethreads
2923eval $setvar
2924
2925case "$usethreads" in
2926$define)
2927 $cat <<EOM
2928
2929As of 5.5.640, Perl has two different internal threading implementations,
2930the 5.005 version (5005threads) and an interpreter-based version
2931(ithreads) that has one interpreter per thread. Both are very
2932experimental. This arrangement exists to help developers work out
2933which one is better.
2934
2935If you're a casual user, you probably don't want interpreter-threads
2936at this time. There doesn't yet exist a way to create threads from
2937within Perl in this model, i.e., "use Thread;" will NOT work.
2938EOM
2939 : Default to ithreads unless overridden on command line or with
2940 : old config.sh
2941 dflt='y'
2942 case "$use5005threads" in
2943 $define|true|[yY]*) dflt='n';;
2944 esac
2945 case "$useithreads" in
2946 $undef|false|[nN]*) dflt='n';;
2947 esac
2948 rp='Use interpreter-based ithreads?'
2949 . ./myread
2950 case "$ans" in
2951 y|Y) val="$define" ;;
2952 *) val="$undef" ;;
2953 esac
2954 set useithreads
2955 eval $setvar
2956 : Now set use5005threads to the opposite value.
2957 case "$useithreads" in
2958 $define) val="$undef" ;;
2959 *) val="$define" ;;
2960 esac
2961 set use5005threads
2962 eval $setvar
2963 ;;
2964*)
2965 useithreads="$undef"
2966 use5005threads="$undef"
2967 ;;
2968esac
2969
2970case "$useithreads$use5005threads" in
2971"$define$define")
2972 $cat >&4 <<EOM
2973
2974You cannot have both the ithreads and the 5.005 threads enabled
2975at the same time. Disabling the 5.005 threads since they are
2976much less stable than the ithreads.
2977
2978EOM
2979 use5005threads="$undef"
2980 ;;
2981esac
2982
2983case "$d_oldpthreads" in
2984'') : Configure tests would be welcome here. For now, assume undef.
2985 val="$undef" ;;
2986*) val="$d_oldpthreads" ;;
2987esac
2988set d_oldpthreads
2989eval $setvar
2990
2991
2992case "$usethreads" in
2993"$define"|true|[yY]*)
2994: Look for a hint-file generated 'call-back-unit'. If the
2995: user has specified that a threading perl is to be built,
2996: we may need to set or change some other defaults.
2997 if $test -f usethreads.cbu; then
2998 echo "Your platform has some specific hints for threaded builds, using them..."
2999 . ./usethreads.cbu
3000 else
3001 $cat <<EOM
3002(Your platform doesn't have any specific hints for threaded builds.
3003 Assuming POSIX threads, then.)
3004EOM
3005 fi
3006 ;;
3007esac
3008
3009cat <<EOM
3010
3011Perl can be built so that multiple Perl interpreters can coexist
3012within the same Perl executable.
3013EOM
3014
3015case "$useithreads" in
3016$define)
3017 cat <<EOM
3018This multiple interpreter support is required for interpreter-based threads.
3019EOM
3020 val="$define"
3021 ;;
3022*) case "$usemultiplicity" in
3023 $define|true|[yY]*) dflt='y';;
3024 *) dflt='n';;
3025 esac
3026 echo " "
3027 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3028 rp='Build Perl for multiplicity?'
3029 . ./myread
3030 case "$ans" in
3031 y|Y) val="$define" ;;
3032 *) val="$undef" ;;
3033 esac
3034 ;;
3035esac
3036set usemultiplicity
3037eval $setvar
3038
3039: make some quick guesses about what we are up against
3040echo " "
3041$echo $n "Hmm... $c"
3042echo exit 1 >bsd
3043echo exit 1 >usg
3044echo exit 1 >v7
3045echo exit 1 >osf1
3046echo exit 1 >eunice
3047echo exit 1 >xenix
3048echo exit 1 >venix
3049echo exit 1 >os2
3050d_bsd="$undef"
3051$cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3052if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3053then
3054 echo "Looks kind of like an OSF/1 system, but we'll see..."
3055 echo exit 0 >osf1
3056elif test `echo abc | $tr a-z A-Z` = Abc ; then
3057 xxx=`./loc addbib blurfl $pth`
3058 if $test -f $xxx; then
3059 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3060 echo exit 0 >bsd
3061 echo exit 0 >usg
3062 else
3063 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3064 echo "Looks kind of like an extended USG system, but we'll see..."
3065 else
3066 echo "Looks kind of like a USG system, but we'll see..."
3067 fi
3068 echo exit 0 >usg
3069 fi
3070elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3071 echo "Looks kind of like a BSD system, but we'll see..."
3072 d_bsd="$define"
3073 echo exit 0 >bsd
3074else
3075 echo "Looks kind of like a Version 7 system, but we'll see..."
3076 echo exit 0 >v7
3077fi
3078case "$eunicefix" in
3079*unixtovms*)
3080 $cat <<'EOI'
3081There is, however, a strange, musty smell in the air that reminds me of
3082something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3083EOI
3084 echo exit 0 >eunice
3085 d_eunice="$define"
3086: it so happens the Eunice I know will not run shell scripts in Unix format
3087 ;;
3088*)
3089 echo " "
3090 echo "Congratulations. You aren't running Eunice."
3091 d_eunice="$undef"
3092 ;;
3093esac
3094: Detect OS2. The p_ variable is set above in the Head.U unit.
3095: Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3096: semicolon as a patch separator
3097case "$p_" in
3098:) ;;
3099*)
3100 $cat <<'EOI'
3101I have the feeling something is not exactly right, however...don't tell me...
3102lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3103(Or you may be running DOS with DJGPP.)
3104EOI
3105 echo exit 0 >os2
3106 ;;
3107esac
3108if test -f /xenix; then
3109 echo "Actually, this looks more like a XENIX system..."
3110 echo exit 0 >xenix
3111 d_xenix="$define"
3112else
3113 echo " "
3114 echo "It's not Xenix..."
3115 d_xenix="$undef"
3116fi
3117chmod +x xenix
3118$eunicefix xenix
3119if test -f /venix; then
3120 echo "Actually, this looks more like a VENIX system..."
3121 echo exit 0 >venix
3122else
3123 echo " "
3124 if ./xenix; then
3125 : null
3126 else
3127 echo "Nor is it Venix..."
3128 fi
3129fi
3130chmod +x bsd usg v7 osf1 eunice xenix venix os2
3131$eunicefix bsd usg v7 osf1 eunice xenix venix os2
3132$rm -f foo
3133
3134case "$cc" in
3135'') dflt=cc;;
3136*) dflt="$cc";;
3137esac
3138rp="Use which C compiler?"
3139. ./myread
3140cc="$ans"
3141: Look for a hint-file generated 'call-back-unit'. Now that the
3142: user has specified the compiler, we may need to set or change some
3143: other defaults.
3144if $test -f cc.cbu; then
3145 . ./cc.cbu
3146fi
3147. ./checkcc
3148
3149echo " "
3150echo "Checking for GNU cc in disguise and/or its version number..." >&4
3151$cat >gccvers.c <<EOM
3152#include <stdio.h>
3153int main() {
3154#ifdef __GNUC__
3155#ifdef __VERSION__
3156 printf("%s\n", __VERSION__);
3157#else
3158 printf("%s\n", "1");
3159#endif
3160#endif
3161 exit(0);
3162}
3163EOM
3164if $cc -o gccvers $ccflags $ldflags gccvers.c; then
3165 gccversion=`./gccvers`
3166 case "$gccversion" in
3167 '') echo "You are not using GNU cc." ;;
3168 *) echo "You are using GNU cc $gccversion."
3169 ccname=gcc
3170 ;;
3171 esac
3172else
3173 echo " "
3174 echo "*** WHOA THERE!!! ***" >&4
3175 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3176 case "$knowitall" in
3177 '')
3178 echo " You'd better start hunting for one and let me know about it." >&4
3179 exit 1
3180 ;;
3181 esac
3182fi
3183$rm -f gccvers*
3184case "$gccversion" in
31851*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3186esac
3187case "$gccversion" in
3188'') gccosandvers='' ;;
3189*) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3190 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3191 gccshortvers=''
3192 case "$gccosandvers" in
3193 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3194 $osname$osvers) ;; # looking good
3195 $osname*) cat <<EOM >&4
3196
3197*** WHOA THERE!!! ***
3198
3199 Your gcc has not been compiled for the exact release of
3200 your operating system ($gccosandvers versus $osname$osvers).
3201
3202 In general it is a good idea to keep gcc synchronized with
3203 the operating system because otherwise serious problems
3204 may ensue when trying to compile software, like Perl.
3205
3206 I'm trying to be optimistic here, though, and will continue.
3207 If later during the configuration and build icky compilation
3208 problems appear (headerfile conflicts being the most common
3209 manifestation), I suggest reinstalling the gcc to match
3210 your operating system release.
3211
3212EOM
3213 ;;
3214 *) gccosandvers='' ;; # failed to parse, better be silent
3215 esac
3216 ;;
3217esac
3218case "$ccname" in
3219'') ccname="$cc" ;;
3220esac
3221
3222: see how we invoke the C preprocessor
3223echo " "
3224echo "Now, how can we feed standard input to your C preprocessor..." >&4
3225cat <<'EOT' >testcpp.c
3226#define ABC abc
3227#define XYZ xyz
3228ABC.XYZ
3229EOT
3230cd ..
3231if test ! -f cppstdin; then
3232 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
3233 # AIX cc -E doesn't show the absolute headerfile
3234 # locations but we'll cheat by using the -M flag.
3235 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
3236 else
3237 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
3238 fi
3239else
3240 echo "Keeping your $hint cppstdin wrapper."
3241fi
3242chmod 755 cppstdin
3243wrapper=`pwd`/cppstdin
3244ok='false'
3245cd UU
3246
3247if $test "X$cppstdin" != "X" && \
3248 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
3249 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3250then
3251 echo "You used to use $cppstdin $cppminus so we'll use that again."
3252 case "$cpprun" in
3253 '') echo "But let's see if we can live without a wrapper..." ;;
3254 *)
3255 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
3256 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3257 then
3258 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
3259 ok='true'
3260 else
3261 echo "(However, $cpprun $cpplast does not work, let's see...)"
3262 fi
3263 ;;
3264 esac
3265else
3266 case "$cppstdin" in
3267 '') ;;
3268 *)
3269 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
3270 ;;
3271 esac
3272fi
3273
3274if $ok; then
3275 : nothing
3276elif echo 'Maybe "'"$cc"' -E" will work...'; \
3277 $cc -E <testcpp.c >testcpp.out 2>&1; \
3278 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3279 echo "Yup, it does."
3280 x_cpp="$cc -E"
3281 x_minus='';
3282elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
3283 $cc -E - <testcpp.c >testcpp.out 2>&1; \
3284 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3285 echo "Yup, it does."
3286 x_cpp="$cc -E"
3287 x_minus='-';
3288elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
3289 $cc -P <testcpp.c >testcpp.out 2>&1; \
3290 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3291 echo "Yipee, that works!"
3292 x_cpp="$cc -P"
3293 x_minus='';
3294elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
3295 $cc -P - <testcpp.c >testcpp.out 2>&1; \
3296 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3297 echo "At long last!"
3298 x_cpp="$cc -P"
3299 x_minus='-';
3300elif echo 'No such luck, maybe "'$cpp'" will work...'; \
3301 $cpp <testcpp.c >testcpp.out 2>&1; \
3302 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3303 echo "It works!"
3304 x_cpp="$cpp"
3305 x_minus='';
3306elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
3307 $cpp - <testcpp.c >testcpp.out 2>&1; \
3308 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3309 echo "Hooray, it works! I was beginning to wonder."
3310 x_cpp="$cpp"
3311 x_minus='-';
3312elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
3313 $wrapper <testcpp.c >testcpp.out 2>&1; \
3314 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3315 x_cpp="$wrapper"
3316 x_minus=''
3317 echo "Eureka!"
3318else
3319 dflt=''
3320 rp="No dice. I can't find a C preprocessor. Name one:"
3321 . ./myread
3322 x_cpp="$ans"
3323 x_minus=''
3324 $x_cpp <testcpp.c >testcpp.out 2>&1
3325 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
3326 echo "OK, that will do." >&4
3327 else
3328echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
3329 exit 1
3330 fi
3331fi
3332
3333case "$ok" in
3334false)
3335 cppstdin="$x_cpp"
3336 cppminus="$x_minus"
3337 cpprun="$x_cpp"
3338 cpplast="$x_minus"
3339 set X $x_cpp
3340 shift
3341 case "$1" in
3342 "$cpp")
3343 echo "Perhaps can we force $cc -E using a wrapper..."
3344 if $wrapper <testcpp.c >testcpp.out 2>&1; \
3345 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
3346 then
3347 echo "Yup, we can."
3348 cppstdin="$wrapper"
3349 cppminus='';
3350 else
3351 echo "Nope, we'll have to live without it..."
3352 fi
3353 ;;
3354 esac
3355 case "$cpprun" in
3356 "$wrapper")
3357 cpprun=''
3358 cpplast=''
3359 ;;
3360 esac
3361 ;;
3362esac
3363
3364case "$cppstdin" in
3365"$wrapper"|'cppstdin') ;;
3366*) $rm -f $wrapper;;
3367esac
3368$rm -f testcpp.c testcpp.out
3369
3370: decide how portable to be. Allow command line overrides.
3371case "$d_portable" in
3372"$undef") ;;
3373*) d_portable="$define" ;;
3374esac
3375
3376: set up shell script to do ~ expansion
3377cat >filexp <<EOSS
3378$startsh
3379: expand filename
3380case "\$1" in
3381 ~/*|~)
3382 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3383 ;;
3384 ~*)
3385 if $test -f /bin/csh; then
3386 /bin/csh -f -c "glob \$1"
3387 failed=\$?
3388 echo ""
3389 exit \$failed
3390 else
3391 name=\`$expr x\$1 : '..\([^/]*\)'\`
3392 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3393 if $test ! -d "\$dir"; then
3394 me=\`basename \$0\`
3395 echo "\$me: can't locate home directory for: \$name" >&2
3396 exit 1
3397 fi
3398 case "\$1" in
3399 */*)
3400 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3401 ;;
3402 *)
3403 echo \$dir
3404 ;;
3405 esac
3406 fi
3407 ;;
3408*)
3409 echo \$1
3410 ;;
3411esac
3412EOSS
3413chmod +x filexp
3414$eunicefix filexp
3415
3416: now set up to get a file name
3417cat <<EOS >getfile
3418$startsh
3419EOS
3420cat <<'EOSC' >>getfile
3421tilde=''
3422fullpath=''
3423already=''
3424skip=''
3425none_ok=''
3426exp_file=''
3427nopath_ok=''
3428orig_rp="$rp"
3429orig_dflt="$dflt"
3430case "$gfpth" in
3431'') gfpth='.' ;;
3432esac
3433
3434case "$fn" in
3435*\(*)
3436 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3437 fn=`echo $fn | sed 's/(.*)//'`
3438 ;;
3439esac
3440
3441case "$fn" in
3442*:*)
3443 loc_file=`expr $fn : '.*:\(.*\)'`
3444 fn=`expr $fn : '\(.*\):.*'`
3445 ;;
3446esac
3447
3448case "$fn" in
3449*~*) tilde=true;;
3450esac
3451case "$fn" in
3452*/*) fullpath=true;;
3453esac
3454case "$fn" in
3455*+*) skip=true;;
3456esac
3457case "$fn" in
3458*n*) none_ok=true;;
3459esac
3460case "$fn" in
3461*e*) exp_file=true;;
3462esac
3463case "$fn" in
3464*p*) nopath_ok=true;;
3465esac
3466
3467case "$fn" in
3468*f*) type='File';;
3469*d*) type='Directory';;
3470*l*) type='Locate';;
3471esac
3472
3473what="$type"
3474case "$what" in
3475Locate) what='File';;
3476esac
3477
3478case "$exp_file" in
3479'')
3480 case "$d_portable" in
3481 "$define") ;;
3482 *) exp_file=true;;
3483 esac
3484 ;;
3485esac
3486
3487cd ..
3488while test "$type"; do
3489 redo=''
3490 rp="$orig_rp"
3491 dflt="$orig_dflt"
3492 case "$tilde" in
3493 true) rp="$rp (~name ok)";;
3494 esac
3495 . UU/myread
3496 if test -f UU/getfile.ok && \
3497 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3498 then
3499 value="$ans"
3500 ansexp="$ans"
3501 break
3502 fi
3503 case "$ans" in
3504 none)
3505 value=''
3506 ansexp=''
3507 case "$none_ok" in
3508 true) type='';;
3509 esac
3510 ;;
3511 *)
3512 case "$tilde" in
3513 '') value="$ans"
3514 ansexp="$ans";;
3515 *)
3516 value=`UU/filexp $ans`
3517 case $? in
3518 0)
3519 if test "$ans" != "$value"; then
3520 echo "(That expands to $value on this system.)"
3521 fi
3522 ;;
3523 *) value="$ans";;
3524 esac
3525 ansexp="$value"
3526 case "$exp_file" in
3527 '') value="$ans";;
3528 esac
3529 ;;
3530 esac
3531 case "$fullpath" in
3532 true)
3533 case "$ansexp" in
3534 /*) value="$ansexp" ;;
3535 [a-zA-Z]:/*) value="$ansexp" ;;
3536 *)
3537 redo=true
3538 case "$already" in
3539 true)
3540 echo "I shall only accept a full path name, as in /bin/ls." >&4
3541 echo "Use a ! shell escape if you wish to check pathnames." >&4
3542 ;;
3543 *)
3544 echo "Please give a full path name, starting with slash." >&4
3545 case "$tilde" in
3546 true)
3547 echo "Note that using ~name is ok provided it expands well." >&4
3548 already=true
3549 ;;
3550 esac
3551 esac
3552 ;;
3553 esac
3554 ;;
3555 esac
3556 case "$redo" in
3557 '')
3558 case "$type" in
3559 File)
3560 for fp in $gfpth; do
3561 if test "X$fp" = X.; then
3562 pf="$ansexp"
3563 else
3564 pf="$fp/$ansexp"
3565 fi
3566 if test -f "$pf"; then
3567 type=''
3568 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3569 then
3570 echo "($value is not a plain file, but that's ok.)"
3571 type=''
3572 fi
3573 if test X"$type" = X; then
3574 value="$pf"
3575 break
3576 fi
3577 done
3578 ;;
3579 Directory)
3580 for fp in $gfpth; do
3581 if test "X$fp" = X.; then
3582 dir="$ans"
3583 direxp="$ansexp"
3584 else
3585 dir="$fp/$ansexp"
3586 direxp="$fp/$ansexp"
3587 fi
3588 if test -d "$direxp"; then
3589 type=''
3590 value="$dir"
3591 break
3592 fi
3593 done
3594 ;;
3595 Locate)
3596 if test -d "$ansexp"; then
3597 echo "(Looking for $loc_file in directory $value.)"
3598 value="$value/$loc_file"
3599 ansexp="$ansexp/$loc_file"
3600 fi
3601 if test -f "$ansexp"; then
3602 type=''
3603 fi
3604 case "$nopath_ok" in
3605 true) case "$value" in
3606 */*) ;;
3607 *) echo "Assuming $value will be in people's path."
3608 type=''
3609 ;;
3610 esac
3611 ;;
3612 esac
3613 ;;
3614 esac
3615
3616 case "$skip" in
3617 true) type='';
3618 esac
3619
3620 case "$type" in
3621 '') ;;
3622 *)
3623 if test "$fastread" = yes; then
3624 dflt=y
3625 else
3626 dflt=n
3627 fi
3628 rp="$what $value doesn't exist. Use that name anyway?"
3629 . UU/myread
3630 dflt=''
3631 case "$ans" in
3632 y*) type='';;
3633 *) echo " ";;
3634 esac
3635 ;;
3636 esac
3637 ;;
3638 esac
3639 ;;
3640 esac
3641done
3642cd UU
3643ans="$value"
3644rp="$orig_rp"
3645dflt="$orig_dflt"
3646rm -f getfile.ok
3647test "X$gfpthkeep" != Xy && gfpth=""
3648EOSC
3649
3650: What should the include directory be ?
3651echo " "
3652$echo $n "Hmm... $c"
3653dflt='/usr/include'
3654incpath=''
3655mips_type=''
3656if $test -f /bin/mips && /bin/mips; then
3657 echo "Looks like a MIPS system..."
3658 $cat >usr.c <<'EOCP'
3659#ifdef SYSTYPE_BSD43
3660/bsd43
3661#endif
3662EOCP
3663 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
3664 dflt='/bsd43/usr/include'
3665 incpath='/bsd43'
3666 mips_type='BSD 4.3'
3667 else
3668 mips_type='System V'
3669 fi
3670 $rm -f usr.c usr.out
3671 echo "and you're compiling with the $mips_type compiler and libraries."
3672 xxx_prompt=y
3673 echo "exit 0" >mips
3674else
3675 echo "Doesn't look like a MIPS system."
3676 xxx_prompt=n
3677 echo "exit 1" >mips
3678fi
3679chmod +x mips
3680$eunicefix mips
3681case "$usrinc" in
3682'') ;;
3683*) dflt="$usrinc";;
3684esac
3685case "$xxx_prompt" in
3686y) fn=d/
3687 echo " "
3688 rp='Where are the include files you want to use?'
3689 . ./getfile
3690 usrinc="$ans"
3691 ;;
3692*) usrinc="$dflt"
3693 ;;
3694esac
3695
3696: Set private lib path
3697case "$plibpth" in
3698'') if ./mips; then
3699 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
3700 fi;;
3701esac
3702case "$libpth" in
3703' ') dlist='';;
3704'') dlist="$loclibpth $plibpth $glibpth";;
3705*) dlist="$libpth";;
3706esac
3707
3708: Now check and see which directories actually exist, avoiding duplicates
3709libpth=''
3710for xxx in $dlist
3711do
3712 if $test -d $xxx; then
3713 case " $libpth " in
3714 *" $xxx "*) ;;
3715 *) libpth="$libpth $xxx";;
3716 esac
3717 fi
3718done
3719$cat <<'EOM'
3720
3721Some systems have incompatible or broken versions of libraries. Among
3722the directories listed in the question below, please remove any you
3723know not to be holding relevant libraries, and add any that are needed.
3724Say "none" for none.
3725
3726EOM
3727case "$libpth" in
3728'') dflt='none';;
3729*)
3730 set X $libpth
3731 shift
3732 dflt=${1+"$@"}
3733 ;;
3734esac
3735rp="Directories to use for library searches?"
3736. ./myread
3737case "$ans" in
3738none) libpth=' ';;
3739*) libpth="$ans";;
3740esac
3741
3742: compute shared library extension
3743case "$so" in
3744'')
3745 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
3746 dflt='sl'
3747 else
3748 dflt='so'
3749 fi
3750 ;;
3751*) dflt="$so";;
3752esac
3753$cat <<EOM
3754
3755On some systems, shared libraries may be available. Answer 'none' if
3756you want to suppress searching of shared libraries for the remainder
3757of this configuration.
3758
3759EOM
3760rp='What is the file extension used for shared libraries?'
3761. ./myread
3762so="$ans"
3763
3764: Define several unixisms.
3765: Hints files or command line option can be used to override them.
3766: The convoluted testing is in case hints files set either the old
3767: or the new name.
3768case "$_exe" in
3769'') case "$exe_ext" in
3770 '') ;;
3771 *) _exe="$exe_ext" ;;
3772 esac
3773 ;;
3774esac
3775case "$_a" in
3776'') case "$lib_ext" in
3777 '') _a='.a';;
3778 *) _a="$lib_ext" ;;
3779 esac
3780 ;;
3781esac
3782case "$_o" in
3783'') case "$obj_ext" in
3784 '') _o='.o';;
3785 *) _o="$obj_ext";;
3786 esac
3787 ;;
3788esac
3789case "$p_" in
3790'') case "$path_sep" in
3791 '') p_=':';;
3792 *) p_="$path_sep";;
3793 esac
3794 ;;
3795esac
3796exe_ext=$_exe
3797lib_ext=$_a
3798obj_ext=$_o
3799path_sep=$p_
3800
3801: Which makefile gets called first. This is used by make depend.
3802case "$firstmakefile" in
3803'') firstmakefile='makefile';;
3804esac
3805
3806case "$usesocks" in
3807$define|true|[yY]*) dflt='y';;
3808*) dflt='n';;
3809esac
3810cat <<EOM
3811
3812Perl can be built to use the SOCKS proxy protocol library. To do so,
3813Configure must be run with -Dusesocks. If you use SOCKS you also need
3814to use the PerlIO abstraction layer, this will be implicitly selected.
3815
3816If this doesn't make any sense to you, just accept the default '$dflt'.
3817EOM
3818rp='Build Perl for SOCKS?'
3819. ./myread
3820case "$ans" in
3821y|Y) val="$define" ;;
3822*) val="$undef" ;;
3823esac
3824set usesocks
3825eval $setvar
3826
3827case "$usesocks" in
3828$define|true|[yY]*) useperlio="$define";;
3829esac
3830
3831: Looking for optional libraries
3832echo " "
3833echo "Checking for optional libraries..." >&4
3834case "$libs" in
3835' '|'') dflt='';;
3836*) dflt="$libs";;
3837esac
3838case "$libswanted" in
3839'') libswanted='c_s';;
3840esac
3841case "$usesocks" in
3842"$define") libswanted="$libswanted socks5 socks5_sh" ;;
3843esac
3844libsfound=''
3845libsfiles=''
3846libsdirs=''
3847libspath=''
3848for thisdir in $libpth $xlibpth; do
3849 test -d $thisdir && libspath="$libspath $thisdir"
3850done
3851for thislib in $libswanted; do
3852 for thisdir in $libspath; do
3853 xxx=''
3854 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
3855 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
3856 $test -f "$xxx" && eval $libscheck
3857 $test -f "$xxx" && libstyle=shared
3858 fi
3859 if test ! -f "$xxx"; then
3860 xxx=$thisdir/lib$thislib.$so
3861 $test -f "$xxx" && eval $libscheck
3862 $test -f "$xxx" && libstyle=shared
3863 fi
3864 if test ! -f "$xxx"; then
3865 xxx=$thisdir/lib$thislib$_a
3866 $test -f "$xxx" && eval $libscheck
3867 $test -f "$xxx" && libstyle=static
3868 fi
3869 if test ! -f "$xxx"; then
3870 xxx=$thisdir/$thislib$_a
3871 $test -f "$xxx" && eval $libscheck
3872 $test -f "$xxx" && libstyle=static
3873 fi
3874 if test ! -f "$xxx"; then
3875 xxx=$thisdir/lib${thislib}_s$_a
3876 $test -f "$xxx" && eval $libscheck
3877 $test -f "$xxx" && libstyle=static
3878 $test -f "$xxx" && thislib=${thislib}_s
3879 fi
3880 if test ! -f "$xxx"; then
3881 xxx=$thisdir/Slib$thislib$_a
3882 $test -f "$xxx" && eval $libscheck
3883 $test -f "$xxx" && libstyle=static
3884 fi
3885 if $test -f "$xxx"; then
3886 case "$libstyle" in
3887 shared) echo "Found -l$thislib (shared)." ;;
3888 static) echo "Found -l$thislib." ;;
3889 *) echo "Found -l$thislib ($libstyle)." ;;
3890 esac
3891 case " $dflt " in
3892 *"-l$thislib "*);;
3893 *) dflt="$dflt -l$thislib"
3894 libsfound="$libsfound $xxx"
3895 yyy=`basename $xxx`
3896 libsfiles="$libsfiles $yyy"
3897 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
3898 case " $libsdirs " in
3899 *" $yyy "*) ;;
3900 *) libsdirs="$libsdirs $yyy" ;;
3901 esac
3902 ;;
3903 esac
3904 break
3905 fi
3906 done
3907 if $test ! -f "$xxx"; then
3908 echo "No -l$thislib."
3909 fi
3910done
3911set X $dflt
3912shift
3913dflt="$*"
3914case "$libs" in
3915'') dflt="$dflt";;
3916*) dflt="$libs";;
3917esac
3918case "$dflt" in
3919' '|'') dflt='none';;
3920esac
3921
3922$cat <<EOM
3923
3924In order to compile $package on your machine, a number of libraries
3925are usually needed. Include any other special libraries here as well.
3926Say "none" for none. The default list is almost always right.
3927EOM
3928
3929echo " "
3930rp="What libraries to use?"
3931. ./myread
3932case "$ans" in
3933none) libs=' ';;
3934*) libs="$ans";;
3935esac
3936
3937: determine optimization, if desired, or use for debug flag also
3938case "$optimize" in
3939' '|$undef) dflt='none';;
3940'') dflt='-O';;
3941*) dflt="$optimize";;
3942esac
3943$cat <<EOH
3944
3945By default, $package compiles with the -O flag to use the optimizer.
3946Alternately, you might want to use the symbolic debugger, which uses
3947the -g flag (on traditional Unix systems). Either flag can be
3948specified here. To use neither flag, specify the word "none".
3949
3950EOH
3951rp="What optimizer/debugger flag should be used?"
3952. ./myread
3953optimize="$ans"
3954case "$optimize" in
3955'none') optimize=" ";;
3956esac
3957
3958dflt=''
3959: We will not override a previous value, but we might want to
3960: augment a hint file
3961case "$hint" in
3962default|recommended)
3963 case "$gccversion" in
3964 1*) dflt='-fpcc-struct-return' ;;
3965 esac
3966 case "$optimize" in
3967 *-g*) dflt="$dflt -DDEBUGGING";;
3968 esac
3969 case "$gccversion" in
3970 2*) if test -d /etc/conf/kconfig.d &&
3971 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
3972 then
3973 dflt="$dflt -posix"
3974 fi
3975 ;;
3976 esac
3977 case "$gccversion" in
3978 1*) ;;
3979 2.[0-8]*) ;;
3980 ?*) echo " "
3981 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
3982 echo 'int main(void) { return 0; }' > gcctest.c
3983 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
3984 echo "Yes, it does." 2>&1
3985 case "$ccflags" in
3986 *strict-aliasing*)
3987 echo "Leaving current flags $ccflags alone." 2>&1
3988 ;;
3989 *) dflt="$dflt -fno-strict-aliasing" ;;
3990 esac
3991 else
3992 echo "Nope, it doesn't, but that's ok." 2>&1
3993 fi
3994 ;;
3995 esac
3996 ;;
3997esac
3998
3999case "$mips_type" in
4000*BSD*|'') inclwanted="$locincpth $usrinc";;
4001*) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4002esac
4003for thisincl in $inclwanted; do
4004 if $test -d $thisincl; then
4005 if $test x$thisincl != x$usrinc; then
4006 case "$dflt" in
4007 *" -I$thisincl "*);;
4008 *) dflt="$dflt -I$thisincl ";;
4009 esac
4010 fi
4011 fi
4012done
4013
4014inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4015 xxx=true;
4016elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4017 xxx=true;
4018else
4019 xxx=false;
4020fi;
4021if $xxx; then
4022 case "$dflt" in
4023 *$2*);;
4024 *) dflt="$dflt -D$2";;
4025 esac;
4026fi'
4027
4028set signal.h LANGUAGE_C; eval $inctest
4029
4030case "$usesocks" in
4031$define)
4032 ccflags="$ccflags -DSOCKS"
4033 ;;
4034esac
4035
4036case "$hint" in
4037default|recommended) dflt="$ccflags $dflt" ;;
4038*) dflt="$ccflags";;
4039esac
4040
4041case "$dflt" in
4042''|' ') dflt=none;;
4043esac
4044
4045$cat <<EOH
4046
4047Your C compiler may want other flags. For this question you should include
4048-I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4049but you should NOT include libraries or ld flags like -lwhatever. If you
4050want $package to honor its debug switch, you should include -DDEBUGGING here.
4051Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4052
4053To use no flags, specify the word "none".
4054
4055EOH
4056set X $dflt
4057shift
4058dflt=${1+"$@"}
4059rp="Any additional cc flags?"
4060. ./myread
4061case "$ans" in
4062none) ccflags='';;
4063*) ccflags="$ans";;
4064esac
4065
4066: the following weeds options from ccflags that are of no interest to cpp
4067case "$cppflags" in
4068'') cppflags="$ccflags" ;;
4069*) cppflags="$cppflags $ccflags" ;;
4070esac
4071case "$gccversion" in
40721*) cppflags="$cppflags -D__GNUC__"
4073esac
4074case "$mips_type" in
4075'');;
4076*BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4077esac
4078case "$cppflags" in
4079'');;
4080*)
4081 echo " "
4082 echo "Let me guess what the preprocessor flags are..." >&4
4083 set X $cppflags
4084 shift
4085 cppflags=''
4086 $cat >cpp.c <<'EOM'
4087#define BLURFL foo
4088
4089BLURFL xx LFRULB
4090EOM
4091 previous=''
4092 for flag in $*
4093 do
4094 case "$flag" in
4095 -*) ftry="$flag";;
4096 *) ftry="$previous $flag";;
4097 esac
4098 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4099 >cpp1.out 2>/dev/null && \
4100 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4101 >cpp2.out 2>/dev/null && \
4102 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4103 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4104 then
4105 cppflags="$cppflags $ftry"
4106 previous=''
4107 else
4108 previous="$flag"
4109 fi
4110 done
4111 set X $cppflags
4112 shift
4113 cppflags=${1+"$@"}
4114 case "$cppflags" in
4115 *-*) echo "They appear to be: $cppflags";;
4116 esac
4117 $rm -f cpp.c cpp?.out
4118 ;;
4119esac
4120
4121: flags used in final linking phase
4122case "$ldflags" in
4123'') if ./venix; then
4124 dflt='-i -z'
4125 else
4126 dflt=''
4127 fi
4128 case "$ccflags" in
4129 *-posix*) dflt="$dflt -posix" ;;
4130 esac
4131 ;;
4132*) dflt="$ldflags";;
4133esac
4134
4135: Try to guess additional flags to pick up local libraries.
4136for thislibdir in $libpth; do
4137 case " $loclibpth " in
4138 *" $thislibdir "*)
4139 case "$dflt " in
4140 *"-L$thislibdir "*) ;;
4141 *) dflt="$dflt -L$thislibdir" ;;
4142 esac
4143 ;;
4144 esac
4145done
4146
4147case "$dflt" in
4148'') dflt='none' ;;
4149esac
4150
4151$cat <<EOH
4152
4153Your C linker may need flags. For this question you should
4154include -L/whatever and any other flags used by the C linker, but you
4155should NOT include libraries like -lwhatever.
4156
4157Make sure you include the appropriate -L/path flags if your C linker
4158does not normally search all of the directories you specified above,
4159namely
4160 $libpth
4161To use no flags, specify the word "none".
4162
4163EOH
4164
4165rp="Any additional ld flags (NOT including libraries)?"
4166. ./myread
4167case "$ans" in
4168none) ldflags='';;
4169*) ldflags="$ans";;
4170esac
4171rmlist="$rmlist pdp11"
4172
4173: coherency check
4174echo " "
4175echo "Checking your choice of C compiler and flags for coherency..." >&4
4176$cat > try.c <<'EOF'
4177#include <stdio.h>
4178int main() { printf("Ok\n"); exit(0); }
4179EOF
4180set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4181shift
4182$cat >try.msg <<'EOM'
4183I've tried to compile and run the following simple program:
4184
4185EOM
4186$cat try.c >> try.msg
4187
4188$cat >> try.msg <<EOM
4189
4190I used the command:
4191
4192 $*
4193 ./try
4194
4195and I got the following output:
4196
4197EOM
4198dflt=y
4199if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4200 if $sh -c './try' >>try.msg 2>&1; then
4201 xxx=`./try`
4202 case "$xxx" in
4203 "Ok") dflt=n ;;
4204 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4205 case " $libs " in
4206 *" -lsfio "*)
4207 cat >> try.msg <<'EOQS'
4208If $libs contains -lsfio, and sfio is mis-configured, then it
4209sometimes (apparently) runs and exits with a 0 status, but with no
4210output! It may have to do with sfio's use of _exit vs. exit.
4211
4212EOQS
4213 rp="You have a big problem. Shall I abort Configure"
4214 dflt=y
4215 ;;
4216 esac
4217 ;;
4218 esac
4219 else
4220 echo "The program compiled OK, but exited with status $?." >>try.msg
4221 rp="You have a problem. Shall I abort Configure"
4222 dflt=y
4223 fi
4224else
4225 echo "I can't compile the test program." >>try.msg
4226 rp="You have a BIG problem. Shall I abort Configure"
4227 dflt=y
4228fi
4229case "$dflt" in
4230y)
4231 $cat try.msg >&4
4232 case "$knowitall" in
4233 '')
4234 echo "(The supplied flags or libraries might be incorrect.)"
4235 ;;
4236 *) dflt=n;;
4237 esac
4238 echo " "
4239 . ./myread
4240 case "$ans" in
4241 n*|N*) ;;
4242 *) echo "Ok. Stopping Configure." >&4
4243 exit 1
4244 ;;
4245 esac
4246 ;;
4247n) echo "OK, that should do.";;
4248esac
4249$rm -f try try.* core
4250
4251: define an is-a-typedef? function
4252typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4253case "$inclist" in
4254"") inclist="sys/types.h";;
4255esac;
4256eval "varval=\$$var";
4257case "$varval" in
4258"")
4259 $rm -f temp.c;
4260 for inc in $inclist; do
4261 echo "#include <$inc>" >>temp.c;
4262 done;
4263 echo "#ifdef $type" >> temp.c;
4264 echo "printf(\"We have $type\");" >> temp.c;
4265 echo "#endif" >> temp.c;
4266 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4267 if $contains $type temp.E >/dev/null 2>&1; then
4268 eval "$var=\$type";
4269 else
4270 eval "$var=\$def";
4271 fi;
4272 $rm -f temp.?;;
4273*) eval "$var=\$varval";;
4274esac'
4275
4276: define an is-a-typedef? function that prompts if the type is not available.
4277typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
4278case "$inclist" in
4279"") inclist="sys/types.h";;
4280esac;
4281eval "varval=\$$var";
4282case "$varval" in
4283"")
4284 $rm -f temp.c;
4285 for inc in $inclist; do
4286 echo "#include <$inc>" >>temp.c;
4287 done;
4288 echo "#ifdef $type" >> temp.c;
4289 echo "printf(\"We have $type\");" >> temp.c;
4290 echo "#endif" >> temp.c;
4291 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
4292 echo " " ;
4293 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
4294 if $contains $type temp.E >/dev/null 2>&1; then
4295 echo "$type found." >&4;
4296 eval "$var=\$type";
4297 else
4298 echo "$type NOT found." >&4;
4299 dflt="$def";
4300 . ./myread ;
4301 eval "$var=\$ans";
4302 fi;
4303 $rm -f temp.?;;
4304*) eval "$var=\$varval";;
4305esac'
4306
4307: define a shorthand compile call
4308compile='
4309mc_file=$1;
4310shift;
4311$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4312: define a shorthand compile call for compilations that should be ok.
4313compile_ok='
4314mc_file=$1;
4315shift;
4316$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4317
4318: check for lengths of integral types
4319echo " "
4320case "$intsize" in
4321'')
4322 echo "Checking to see how big your integers are..." >&4
4323 $cat >intsize.c <<'EOCP'
4324#include <stdio.h>
4325int main()
4326{
4327 printf("intsize=%d;\n", (int)sizeof(int));
4328 printf("longsize=%d;\n", (int)sizeof(long));
4329 printf("shortsize=%d;\n", (int)sizeof(short));
4330 exit(0);
4331}
4332EOCP
4333 set intsize
4334 if eval $compile_ok && ./intsize > /dev/null; then
4335 eval `./intsize`
4336 echo "Your integers are $intsize bytes long."
4337 echo "Your long integers are $longsize bytes long."
4338 echo "Your short integers are $shortsize bytes long."
4339 else
4340 $cat >&4 <<EOM
4341!
4342Help! I can't compile and run the intsize test program: please enlighten me!
4343(This is probably a misconfiguration in your system or libraries, and
4344you really ought to fix it. Still, I'll try anyway.)
4345!
4346EOM
4347 dflt=4
4348 rp="What is the size of an integer (in bytes)?"
4349 . ./myread
4350 intsize="$ans"
4351 dflt=$intsize
4352 rp="What is the size of a long integer (in bytes)?"
4353 . ./myread
4354 longsize="$ans"
4355 dflt=2
4356 rp="What is the size of a short integer (in bytes)?"
4357 . ./myread
4358 shortsize="$ans"
4359 fi
4360 ;;
4361esac
4362$rm -f intsize intsize.*
4363
4364: see what type lseek is declared as in the kernel
4365rp="What is the type used for lseek's offset on this system?"
4366set off_t lseektype long stdio.h sys/types.h
4367eval $typedef_ask
4368
4369echo " "
4370echo "Checking to see how big your file offsets are..." >&4
4371$cat >try.c <<EOCP
4372#include <sys/types.h>
4373#include <stdio.h>
4374int main()
4375{
4376 printf("%d\n", (int)sizeof($lseektype));
4377 return(0);
4378}
4379EOCP
4380set try
4381if eval $compile_ok; then
4382 lseeksize=`./try`
4383 echo "Your file offsets are $lseeksize bytes long."
4384else
4385 dflt=$longsize
4386 echo " "
4387 echo "(I can't seem to compile the test program. Guessing...)"
4388 rp="What is the size of your file offsets (in bytes)?"
4389 . ./myread
4390 lseeksize="$ans"
4391fi
4392$rm -f try.c try
4393
4394: see what type file positions are declared as in the library
4395rp="What is the type for file position used by fsetpos()?"
4396set fpos_t fpostype long stdio.h sys/types.h
4397eval $typedef_ask
4398
4399echo " "
4400case "$fpostype" in
4401*_t) zzz="$fpostype" ;;
4402*) zzz="fpos_t" ;;
4403esac
4404echo "Checking the size of $zzz..." >&4
4405cat > try.c <<EOCP
4406#include <sys/types.h>
4407#include <stdio.h>
4408int main() {
4409 printf("%d\n", (int)sizeof($fpostype));
4410 exit(0);
4411}
4412EOCP
4413set try
4414if eval $compile_ok; then
4415 yyy=`./try`
4416 case "$yyy" in
4417 '') fpossize=4
4418 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4419 ;;
4420 *) fpossize=$yyy
4421 echo "Your $zzz is $fpossize bytes long."
4422 ;;
4423 esac
4424else
4425 dflt="$longsize"
4426 echo " " >&4
4427 echo "(I can't compile the test program. Guessing...)" >&4
4428 rp="What is the size of your file positions (in bytes)?"
4429 . ./myread
4430 fpossize="$ans"
4431fi
4432
4433
4434
4435# Backward compatibility (uselfs is deprecated).
4436case "$uselfs" in
4437"$define"|true|[yY]*)
4438 cat <<EOM >&4
4439
4440*** Configure -Duselfs is deprecated, using -Duselargefiles instead.
4441EOM
4442 uselargefiles="$define"
4443 ;;
4444esac
4445
4446case "$lseeksize:$fpossize" in
44478:8) cat <<EOM
4448
4449You can have files larger than 2 gigabytes.
4450EOM
4451 val="$define" ;;
4452*) case "$uselargefiles" in
4453 "$undef"|false|[nN]*) dflt='n' ;;
4454 *) dflt='y' ;;
4455 esac
4456 cat <<EOM
4457
4458Perl can be built to understand large files (files larger than 2 gigabytes)
4459on some systems. To do so, Configure can be run with -Duselargefiles.
4460
4461If this doesn't make any sense to you, just accept the default '$dflt'.
4462EOM
4463 rp='Try to understand large files, if available?'
4464 . ./myread
4465 case "$ans" in
4466 y|Y) val="$define" ;;
4467 *) val="$undef" ;;
4468 esac
4469 ;;
4470esac
4471set uselargefiles
4472eval $setvar
4473case "$uselargefiles" in
4474"$define")
4475: Look for a hint-file generated 'call-back-unit'. If the
4476: user has specified that a large files perl is to be built,
4477: we may need to set or change some other defaults.
4478 if $test -f uselargefiles.cbu; then
4479 echo "Your platform has some specific hints for large file builds, using them..."
4480 . ./uselargefiles.cbu
4481 echo " "
4482 echo "Rechecking to see how big your file offsets are..." >&4
4483 $cat >try.c <<EOCP
4484#include <sys/types.h>
4485#include <stdio.h>
4486int main()
4487{
4488 printf("%d\n", (int)sizeof($lseektype));
4489 return(0);
4490}
4491EOCP
4492 set try
4493 if eval $compile_ok; then
4494 lseeksize=`./try`
4495 $echo "Your file offsets are now $lseeksize bytes long."
4496 else
4497 dflt="$lseeksize"
4498 echo " "
4499 echo "(I can't seem to compile the test program. Guessing...)"
4500 rp="What is the size of your file offsets (in bytes)?"
4501 . ./myread
4502 lseeksize="$ans"
4503 fi
4504 case "$fpostype" in
4505 *_t) zzz="$fpostype" ;;
4506 *) zzz="fpos_t" ;;
4507 esac
4508 $echo $n "Rechecking the size of $zzz...$c" >&4
4509 $cat > try.c <<EOCP
4510#include <sys/types.h>
4511#include <stdio.h>
4512int main() {
4513 printf("%d\n", (int)sizeof($fpostype));
4514 exit(0);
4515}
4516EOCP
4517 set try
4518 if eval $compile_ok; then
4519 yyy=`./try`
4520 dflt="$lseeksize"
4521 case "$yyy" in
4522 '') echo " "
4523 echo "(I can't execute the test program--guessing $fpossize.)" >&4
4524 ;;
4525 *) fpossize=$yyy
4526 echo " $fpossize bytes." >&4
4527 ;;
4528 esac
4529 else
4530 dflt="$fpossize"
4531 echo " "
4532 echo "(I can't compile the test program. Guessing...)" >&4
4533 rp="What is the size of your file positions (in bytes)?"
4534 . ./myread
4535 fpossize="$ans"
4536 fi
4537 $rm -f try.c try
4538 fi
4539 ;;
4540esac
4541
4542
4543case "$usemorebits" in
4544"$define"|true|[yY]*)
4545 use64bitint="$define"
4546 uselongdouble="$define"
4547 usemorebits="$define"
4548 ;;
4549*) usemorebits="$undef"
4550 ;;
4551esac
4552
4553: check for void type
4554echo " "
4555echo "Checking to see how well your C compiler groks the void type..." >&4
4556case "$voidflags" in
4557'')
4558 $cat >try.c <<'EOCP'
4559#if TRY & 1
4560void sub() {
4561#else
4562sub() {
4563#endif
4564 extern void moo(); /* function returning void */
4565 void (*goo)(); /* ptr to func returning void */
4566#if TRY & 8
4567 void *hue; /* generic ptr */
4568#endif
4569#if TRY & 2
4570 void (*foo[10])();
4571#endif
4572
4573#if TRY & 4
4574 if(goo == moo) {
4575 exit(0);
4576 }
4577#endif
4578 exit(0);
4579}
4580int main() { sub(); }
4581EOCP
4582 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4583 voidflags=$defvoidused
4584 echo "Good. It appears to support void to the level $package wants.">&4
4585 if $contains warning .out >/dev/null 2>&1; then
4586 echo "However, you might get some warnings that look like this:"
4587 $cat .out
4588 fi
4589 else
4590echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4591 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4592 echo "It supports 1..."
4593 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4594 echo "It also supports 2..."
4595 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4596 voidflags=7
4597 echo "And it supports 4 but not 8 definitely."
4598 else
4599 echo "It doesn't support 4..."
4600 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4601 voidflags=11
4602 echo "But it supports 8."
4603 else
4604 voidflags=3
4605 echo "Neither does it support 8."
4606 fi
4607 fi
4608 else
4609 echo "It does not support 2..."
4610 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4611 voidflags=13
4612 echo "But it supports 4 and 8."
4613 else
4614 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4615 voidflags=5
4616 echo "And it supports 4 but has not heard about 8."
4617 else
4618 echo "However it supports 8 but not 4."
4619 fi
4620 fi
4621 fi
4622 else
4623 echo "There is no support at all for void."
4624 voidflags=0
4625 fi
4626 fi
4627esac
4628case "$voidflags" in
4629"$defvoidused") ;;
4630*) $cat >&4 <<'EOM'
4631 Support flag bits are:
4632 1: basic void declarations.
4633 2: arrays of pointers to functions returning void.
4634 4: operations between pointers to and addresses of void functions.
4635 8: generic void pointers.
4636EOM
4637 dflt="$voidflags";
4638 rp="Your void support flags add up to what?"
4639 . ./myread
4640 voidflags="$ans"
4641 ;;
4642esac
4643$rm -f try.* .out
4644
4645: check for length of pointer
4646echo " "
4647case "$ptrsize" in
4648'')
4649 echo "Checking to see how big your pointers are..." >&4
4650 if test "$voidflags" -gt 7; then
4651 echo '#define VOID_PTR char *' > try.c
4652 else
4653 echo '#define VOID_PTR void *' > try.c
4654 fi
4655 $cat >>try.c <<'EOCP'
4656#include <stdio.h>
4657int main()
4658{
4659 printf("%d\n", (int)sizeof(VOID_PTR));
4660 exit(0);
4661}
4662EOCP
4663 set try
4664 if eval $compile_ok; then
4665 ptrsize=`./try`
4666 echo "Your pointers are $ptrsize bytes long."
4667 else
4668 dflt='4'
4669 echo "(I can't seem to compile the test program. Guessing...)" >&4
4670 rp="What is the size of a pointer (in bytes)?"
4671 . ./myread
4672 ptrsize="$ans"
4673 fi
4674 ;;
4675esac
4676$rm -f try.c try
4677
4678: check for long long
4679echo " "
4680echo "Checking to see if you have long long..." >&4
4681echo 'int main() { long long x = 7; return 0; }' > try.c
4682set try
4683if eval $compile; then
4684 val="$define"
4685 echo "You have long long."
4686else
4687 val="$undef"
4688 echo "You do not have long long."
4689fi
4690$rm try.*
4691set d_longlong
4692eval $setvar
4693
4694: check for length of long long
4695case "${d_longlong}${longlongsize}" in
4696$define)
4697 echo " "
4698 echo "Checking to see how big your long longs are..." >&4
4699 $cat >try.c <<'EOCP'
4700#include <stdio.h>
4701int main()
4702{
4703 printf("%d\n", (int)sizeof(long long));
4704 return(0);
4705}
4706EOCP
4707 set try
4708 if eval $compile_ok; then
4709 longlongsize=`./try$exe_ext`
4710 echo "Your long longs are $longlongsize bytes long."
4711 else
4712 dflt='8'
4713 echo " "
4714 echo "(I can't seem to compile the test program. Guessing...)"
4715 rp="What is the size of a long long (in bytes)?"
4716 . ./myread
4717 longlongsize="$ans"
4718 fi
4719 if $test "X$longsize" = "X$longlongsize"; then
4720 echo "(That isn't any different from an ordinary long.)"
4721 fi
4722 ;;
4723esac
4724$rm -f try.* try
4725
4726: determine filename position in cpp output
4727echo " "
4728echo "Computing filename position in cpp output for #include directives..." >&4
4729echo '#include <stdio.h>' > foo.c
4730$cat >fieldn <<EOF
4731$startsh
4732$cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4733$grep '^[ ]*#.*stdio\.h' | \
4734while read cline; do
4735 pos=1
4736 set \$cline
4737 while $test \$# -gt 0; do
4738 if $test -r \`echo \$1 | $tr -d '"'\`; then
4739 echo "\$pos"
4740 exit 0
4741 fi
4742 shift
4743 pos=\`expr \$pos + 1\`
4744 done
4745done
4746EOF
4747chmod +x fieldn
4748fieldn=`./fieldn`
4749$rm -f foo.c fieldn
4750case $fieldn in
4751'') pos='???';;
47521) pos=first;;
47532) pos=second;;
47543) pos=third;;
4755*) pos="${fieldn}th";;
4756esac
4757echo "Your cpp writes the filename in the $pos field of the line."
4758
4759: locate header file
4760$cat >findhdr <<EOF
4761$startsh
4762wanted=\$1
4763name=''
4764for usrincdir in $usrinc
4765do
4766 if test -f \$usrincdir/\$wanted; then
4767 echo "\$usrincdir/\$wanted"
4768 exit 0
4769 fi
4770done
4771awkprg='{ print \$$fieldn }'
4772echo "#include <\$wanted>" > foo\$\$.c
4773$cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4774$grep "^[ ]*#.*\$wanted" | \
4775while read cline; do
4776 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4777 case "\$name" in
4778 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4779 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4780 *) exit 2;;
4781 esac;
4782done;
4783#
4784# status = 0: grep returned 0 lines, case statement not executed
4785# status = 1: headerfile found
4786# status = 2: while loop executed, no headerfile found
4787#
4788status=\$?
4789$rm -f foo\$\$.c;
4790if test \$status -eq 1; then
4791 exit 0;
4792fi
4793exit 1
4794EOF
4795chmod +x findhdr
4796
4797: define an alternate in-header-list? function
4798inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4799cont=true; xxf="echo \"<\$1> found.\" >&4";
4800case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4801*) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4802esac;
4803case $# in 4) instead=instead;; *) instead="at last";; esac;
4804while $test "$cont"; do
4805 xxx=`./findhdr $1`
4806 var=$2; eval "was=\$$2";
4807 if $test "$xxx" && $test -r "$xxx";
4808 then eval $xxf;
4809 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4810 cont="";
4811 else eval $xxnf;
4812 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4813 set $yyy; shift; shift; yyy=$@;
4814 case $# in 0) cont="";;
4815 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4816 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4817 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4818 xxnf="echo \"there is no <\$1>, ...\" >&4";;
4819 esac;
4820done;
4821while $test "$yyy";
4822do set $yyy; var=$2; eval "was=\$$2";
4823 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
4824 set $yyy; shift; shift; yyy=$@;
4825done'
4826
4827: see if inttypes.h is available
4828: we want a real compile instead of Inhdr because some systems
4829: have an inttypes.h which includes non-existent headers
4830echo " "
4831$cat >try.c <<EOCP
4832#include <inttypes.h>
4833int main() {
4834 static int32_t foo32 = 0x12345678;
4835}
4836EOCP
4837set try
4838if eval $compile; then
4839 echo "<inttypes.h> found." >&4
4840 val="$define"
4841else
4842 echo "<inttypes.h> NOT found." >&4
4843 val="$undef"
4844fi
4845$rm -f try.c try
4846set i_inttypes
4847eval $setvar
4848
4849: check for int64_t
4850echo " "
4851echo "Checking to see if you have int64_t..." >&4
4852$cat >try.c <<EOCP
4853#include <sys/types.h>
4854#$i_inttypes I_INTTYPES
4855#ifdef I_INTTYPES
4856#include <inttypes.h>
4857#endif
4858int main() { int64_t x = 7; }
4859EOCP
4860set try
4861if eval $compile; then
4862 val="$define"
4863 echo "You have int64_t."
4864else
4865 val="$undef"
4866 echo "You do not have int64_t."
4867fi
4868$rm -f try try.*
4869set d_int64_t
4870eval $setvar
4871
4872
4873echo " "
4874echo "Checking which 64-bit integer type we could use..." >&4
4875
4876case "$intsize" in
48778) val=int
4878 set quadtype
4879 eval $setvar
4880 val='"unsigned int"'
4881 set uquadtype
4882 eval $setvar
4883 quadkind=1
4884 ;;
4885*) case "$longsize" in
4886 8) val=long
4887 set quadtype
4888 eval $setvar
4889 val='"unsigned long"'
4890 set uquadtype
4891 eval $setvar
4892 quadkind=2
4893 ;;
4894 *) case "$d_longlong:$longlongsize" in
4895 define:8)
4896 val='"long long"'
4897 set quadtype
4898 eval $setvar
4899 val='"unsigned long long"'
4900 set uquadtype
4901 eval $setvar
4902 quadkind=3
4903 ;;
4904 *) case "$d_int64_t" in
4905 define)
4906 val=int64_t
4907 set quadtype
4908 eval $setvar
4909 val=uint64_t
4910 set uquadtype
4911 eval $setvar
4912 quadkind=4
4913 ;;
4914 esac
4915 ;;
4916 esac
4917 ;;
4918 esac
4919 ;;
4920esac
4921
4922case "$quadtype" in
4923'') echo "Alas, no 64-bit integer types in sight." >&4
4924 d_quad="$undef"
4925 ;;
4926*) echo "We could use '$quadtype' for 64-bit integers." >&4
4927 d_quad="$define"
4928 ;;
4929esac
4930
4931
4932case "$uselonglong" in
4933"$define"|true|[yY]*)
4934 cat <<EOM >&4
4935
4936*** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
4937EOM
4938 use64bitint="$define"
4939 ;;
4940esac
4941case "$use64bits" in
4942"$define"|true|[yY]*)
4943 cat <<EOM >&4
4944
4945*** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
4946EOM
4947 use64bitint="$define"
4948 ;;
4949esac
4950case "$use64bitints" in
4951"$define"|true|[yY]*)
4952 cat <<EOM >&4
4953
4954*** There is no Configure -Duse64bitints, using -Duse64bitint instead.
4955EOM
4956 use64bitint="$define"
4957 ;;
4958esac
4959case "$use64bitsint" in
4960"$define"|true|[yY]*)
4961 cat <<EOM >&4
4962
4963*** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
4964EOM
4965 use64bitint="$define"
4966 ;;
4967esac
4968case "$uselonglongs" in
4969"$define"|true|[yY]*)
4970 cat <<EOM >&4
4971
4972*** There is no Configure -Duselonglongs, using -Duse64bitint instead.
4973EOM
4974 use64bitint="$define"
4975 ;;
4976esac
4977case "$use64bitsall" in
4978"$define"|true|[yY]*)
4979 cat <<EOM >&4
4980
4981*** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
4982EOM
4983 use64bitall="$define"
4984 ;;
4985esac
4986
4987case "$ccflags" in
4988*-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
4989esac
4990case "$use64bitall" in
4991"$define"|true|[yY]*) use64bitint="$define" ;;
4992esac
4993
4994case "$longsize" in
49958) cat <<EOM
4996
4997You have natively 64-bit long integers.
4998EOM
4999 val="$define"
5000 ;;
5001*) case "$use64bitint" in
5002 "$define"|true|[yY]*) dflt='y';;
5003 *) dflt='n';;
5004 esac
5005 case "$d_quad" in
5006 "$define") ;;
5007 *) dflt='n' ;;
5008 esac
5009 cat <<EOM
5010
5011Perl can be built to take advantage of 64-bit integer types
5012on some systems. To do so, Configure can be run with -Duse64bitint.
5013Choosing this option will most probably introduce binary incompatibilities.
5014
5015If this doesn't make any sense to you, just accept the default '$dflt'.
5016(The default has been chosen based on your configuration.)
5017EOM
5018 rp='Try to use 64-bit integers, if available?'
5019 . ./myread
5020 case "$ans" in
5021 [yY]*) val="$define" ;;
5022 *) val="$undef" ;;
5023 esac
5024 ;;
5025esac
5026set use64bitint
5027eval $setvar
5028
5029case "$use64bitall" in
5030"$define"|true|[yY]*) dflt='y' ;;
5031*) case "$longsize" in
5032 8) dflt='y' ;;
5033 *) dflt='n' ;;
5034 esac
5035 ;;
5036esac
5037cat <<EOM
5038
5039You may also choose to try maximal 64-bitness. It means using as much
504064-bitness as possible on the platform. This in turn means even more
5041binary incompatibilities. On the other hand, your platform may not
5042have any more 64-bitness available than what you already have chosen.
5043
5044If this doesn't make any sense to you, just accept the default '$dflt'.
5045(The default has been chosen based on your configuration.)
5046EOM
5047rp='Try to use maximal 64-bit support, if available?'
5048. ./myread
5049case "$ans" in
5050[yY]*) val="$define" ;;
5051*) val="$undef" ;;
5052esac
5053set use64bitall
5054eval $setvar
5055case "$use64bitall" in
5056"$define")
5057 case "$use64bitint" in
5058 "$undef")
5059 cat <<EOM
5060
5061Since you have chosen a maximally 64-bit build, I'm also turning on
5062the use of 64-bit integers.
5063EOM
5064 use64bitint="$define" ;;
5065 esac
5066 ;;
5067esac
5068
5069case "$use64bitall" in
5070"$define"|true|[yY]*)
5071 case "$ptrsize" in
5072 4) cat <<EOM >&4
5073
5074*** You have chosen a maximally 64-bit build, but your pointers
5075*** are only 4 bytes wide, disabling maximal 64-bitness.
5076
5077EOM
5078 use64bitall="$undef"
5079 case "$use64bitint" in
5080 "$define"|true|[yY]*) ;;
5081 *) cat <<EOM >&4
5082
5083*** Downgrading from maximal 64-bitness to using 64-bit integers.
5084
5085EOM
5086 use64bitint="$define"
5087 ;;
5088 esac
5089 ;;
5090 esac
5091 ;;
5092esac
5093
5094case "$use64bitint" in
5095"$define"|true|[yY]*)
5096: Look for a hint-file generated 'call-back-unit'. If the
5097: user has specified that a 64-bit perl is to be built,
5098: we may need to set or change some other defaults.
5099 if $test -f use64bitint.cbu; then
5100 echo "Your platform has some specific hints for 64-bit integers, using them..."
5101 . ./use64bitint.cbu
5102 fi
5103 case "$longsize" in
5104 4) case "$archname64" in
5105 '') archname64=64int ;;
5106 esac
5107 ;;
5108 esac
5109 ;;
5110esac
5111
5112case "$use64bitall" in
5113"$define"|true|[yY]*)
5114: Look for a hint-file generated 'call-back-unit'. If the
5115: user has specified that a maximally 64-bit perl is to be built,
5116: we may need to set or change some other defaults.
5117 if $test -f use64bitall.cbu; then
5118 echo "Your platform has some specific hints for 64-bit builds, using them..."
5119 . ./use64bitall.cbu
5120 fi
5121 case "$longsize" in
5122 4) case "$archname64" in
5123 ''|64int) archname64=64all ;;
5124 esac
5125 ;;
5126 esac
5127 ;;
5128esac
5129
5130echo " "
5131echo "Checking for GNU C Library..." >&4
5132cat >gnulibc.c <<EOM
5133#include <stdio.h>
5134int main()
5135{
5136#ifdef __GLIBC__
5137 exit(0);
5138#else
5139 exit(1);
5140#endif
5141}
5142EOM
5143set gnulibc
5144if eval $compile_ok && ./gnulibc; then
5145 val="$define"
5146 echo "You are using the GNU C Library"
5147else
5148 val="$undef"
5149 echo "You are not using the GNU C Library"
5150fi
5151$rm -f gnulibc*
5152set d_gnulibc
5153eval $setvar
5154
5155: see if nm is to be used to determine whether a symbol is defined or not
5156case "$usenm" in
5157'')
5158 dflt=''
5159 case "$d_gnulibc" in
5160 "$define")
5161 echo " "
5162 echo "nm probably won't work on the GNU C Library." >&4
5163 dflt=n
5164 ;;
5165 esac
5166 case "$dflt" in
5167 '')
5168 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5169 echo " "
5170 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5171 echo "'nm' won't be sufficient on this sytem." >&4
5172 dflt=n
5173 fi
5174 ;;
5175 esac
5176 case "$dflt" in
5177 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5178 if $test $dflt -gt 20; then
5179 dflt=y
5180 else
5181 dflt=n
5182 fi
5183 ;;
5184 esac
5185 ;;
5186*)
5187 case "$usenm" in
5188 true|$define) dflt=y;;
5189 *) dflt=n;;
5190 esac
5191 ;;
5192esac
5193$cat <<EOM
5194
5195I can use $nm to extract the symbols from your C libraries. This
5196is a time consuming task which may generate huge output on the disk (up
5197to 3 megabytes) but that should make the symbols extraction faster. The
5198alternative is to skip the 'nm' extraction part and to compile a small
5199test program instead to determine whether each symbol is present. If
5200you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5201this may be the best solution.
5202
5203You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5204
5205EOM
5206rp="Shall I use $nm to extract C symbols from the libraries?"
5207. ./myread
5208case "$ans" in
5209[Nn]*) usenm=false;;
5210*) usenm=true;;
5211esac
5212
5213runnm=$usenm
5214case "$reuseval" in
5215true) runnm=false;;
5216esac
5217
5218: nm options which may be necessary
5219case "$nm_opt" in
5220'') if $test -f /mach_boot; then
5221 nm_opt='' # Mach
5222 elif $test -d /usr/ccs/lib; then
5223 nm_opt='-p' # Solaris (and SunOS?)
5224 elif $test -f /dgux; then
5225 nm_opt='-p' # DG-UX
5226 elif $test -f /lib64/rld; then
5227 nm_opt='-p' # 64-bit Irix
5228 else
5229 nm_opt=''
5230 fi;;
5231esac
5232
5233: nm options which may be necessary for shared libraries but illegal
5234: for archive libraries. Thank you, Linux.
5235case "$nm_so_opt" in
5236'') case "$myuname" in
5237 *linux*)
5238 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5239 nm_so_opt='--dynamic'
5240 fi
5241 ;;
5242 esac
5243 ;;
5244esac
5245
5246case "$runnm" in
5247true)
5248: get list of predefined functions in a handy place
5249echo " "
5250case "$libc" in
5251'') libc=unknown
5252 case "$libs" in
5253 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5254 esac
5255 ;;
5256esac
5257libnames='';
5258case "$libs" in
5259'') ;;
5260*) for thislib in $libs; do
5261 case "$thislib" in
5262 -lc|-lc_s)
5263 : Handle C library specially below.
5264 ;;
5265 -l*)
5266 thislib=`echo $thislib | $sed -e 's/^-l//'`
5267 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5268 :
5269 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5270 :
5271 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5272 :
5273 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5274 :
5275 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5276 :
5277 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5278 :
5279 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5280 :
5281 else
5282 try=''
5283 fi
5284 libnames="$libnames $try"
5285 ;;
5286 *) libnames="$libnames $thislib" ;;
5287 esac
5288 done
5289 ;;
5290esac
5291xxx=normal
5292case "$libc" in
5293unknown)
5294 set /lib/libc.$so
5295 for xxx in $libpth; do
5296 $test -r $1 || set $xxx/libc.$so
5297 : The messy sed command sorts on library version numbers.
5298 $test -r $1 || \
5299 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5300 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5301 h
5302 s/[0-9][0-9]*/0000&/g
5303 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5304 G
5305 s/\n/ /' | \
5306 $sort | $sed -e 's/^.* //'`
5307 eval set \$$#
5308 done
5309 $test -r $1 || set /usr/ccs/lib/libc.$so
5310 $test -r $1 || set /lib/libsys_s$_a
5311 ;;
5312*)
5313 set blurfl
5314 ;;
5315esac
5316if $test -r "$1"; then
5317 echo "Your (shared) C library seems to be in $1."
5318 libc="$1"
5319elif $test -r /lib/libc && $test -r /lib/clib; then
5320 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5321 xxx=apollo
5322 libc='/lib/clib /lib/libc'
5323 if $test -r /lib/syslib; then
5324 echo "(Your math library is in /lib/syslib.)"
5325 libc="$libc /lib/syslib"
5326 fi
5327elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5328 echo "Your C library seems to be in $libc, as you said before."
5329elif $test -r $incpath/usr/lib/libc$_a; then
5330 libc=$incpath/usr/lib/libc$_a;
5331 echo "Your C library seems to be in $libc. That's fine."
5332elif $test -r /lib/libc$_a; then
5333 libc=/lib/libc$_a;
5334 echo "Your C library seems to be in $libc. You're normal."
5335else
5336 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5337 :
5338 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5339 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5340 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5341 :
5342 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5343 :
5344 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5345 :
5346 else
5347 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5348 fi
5349 if $test -r "$tans"; then
5350 echo "Your C library seems to be in $tans, of all places."
5351 libc=$tans
5352 else
5353 libc='blurfl'
5354 fi
5355fi
5356if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5357 dflt="$libc"
5358 cat <<EOM
5359
5360If the guess above is wrong (which it might be if you're using a strange
5361compiler, or your machine supports multiple models), you can override it here.
5362
5363EOM
5364else
5365 dflt=''
5366 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5367 cat >&4 <<EOM
5368I can't seem to find your C library. I've looked in the following places:
5369
5370EOM
5371 $sed 's/^/ /' libpath
5372 cat <<EOM
5373
5374None of these seems to contain your C library. I need to get its name...
5375
5376EOM
5377fi
5378fn=f
5379rp='Where is your C library?'
5380. ./getfile
5381libc="$ans"
5382
5383echo " "
5384echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5385set X `cat libnames`
5386shift
5387xxx=files
5388case $# in 1) xxx=file; esac
5389echo "Extracting names from the following $xxx for later perusal:" >&4
5390echo " "
5391$sed 's/^/ /' libnames >&4
5392echo " "
5393$echo $n "This may take a while...$c" >&4
5394
5395for file in $*; do
5396 case $file in
5397 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5398 *) $nm $nm_opt $file 2>/dev/null;;
5399 esac
5400done >libc.tmp
5401
5402$echo $n ".$c"
5403$grep fprintf libc.tmp > libc.ptf
5404xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5405xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5406xxx='[ADTSIW]'
5407if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5408 eval $xscan;\
5409 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5410 eval $xrun
5411elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5412 eval $xscan;\
5413 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5414 eval $xrun
5415elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5416 eval $xscan;\
5417 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5418 eval $xrun
5419elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5420 eval $xscan;\
5421 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5422 eval $xrun
5423elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5424 eval $xscan;\
5425 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5426 eval $xrun
5427elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5428 eval $xscan;\
5429 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5430 eval $xrun
5431elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5432 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5433 eval $xscan;\
5434 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5435 eval $xrun
5436elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5437 eval $xscan;\
5438 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5439 eval $xrun
5440elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5441 eval $xscan;\
5442 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5443 eval $xrun
5444elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5445 eval $xscan;\
5446 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5447 eval $xrun
5448elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5449 eval $xscan;\
5450 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5451 eval $xrun
5452elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5453 eval $xscan;\
5454 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5455 eval $xrun
5456elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5457 eval $xscan;\
5458 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5459 eval $xrun
5460elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5461 eval $xscan;\
5462 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5463 eval $xrun
5464else
5465 $nm -p $* 2>/dev/null >libc.tmp
5466 $grep fprintf libc.tmp > libc.ptf
5467 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5468 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5469 then
5470 nm_opt='-p'
5471 eval $xrun
5472 else
5473 echo " "
5474 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5475 com=''
5476 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5477 for thisname in $libnames $libc; do
5478 $ar t $thisname >>libc.tmp
5479 done
5480 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5481 echo "Ok." >&4
5482 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5483 # Repeat libc to extract forwarders to DLL entries too
5484 for thisname in $libnames $libc; do
5485 $ar tv $thisname >>libc.tmp
5486 # Revision 50 of EMX has bug in $ar.
5487 # it will not extract forwarders to DLL entries
5488 # Use emximp which will extract exactly them.
5489 emximp -o tmp.imp $thisname \
5490 2>/dev/null && \
5491 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5492 < tmp.imp >>libc.tmp
5493 $rm tmp.imp
5494 done
5495 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5496 echo "Ok." >&4
5497 else
5498 echo "$ar didn't seem to work right." >&4
5499 echo "Maybe this is a Cray...trying bld instead..." >&4
5500 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5501 then
5502 for thisname in $libnames; do
5503 bld t $libnames | \
5504 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5505 $ar t $thisname >>libc.tmp
5506 done
5507 echo "Ok." >&4
5508 else
5509 echo "That didn't work either. Giving up." >&4
5510 exit 1
5511 fi
5512 fi
5513 fi
5514fi
5515nm_extract="$com"
5516if $test -f /lib/syscalls.exp; then
5517 echo " "
5518 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5519 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
5520fi
5521;;
5522esac
5523$rm -f libnames libpath
5524
5525: is a C symbol defined?
5526csym='tlook=$1;
5527case "$3" in
5528-v) tf=libc.tmp; tc=""; tdc="";;
5529-a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5530*) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5531esac;
5532tx=yes;
5533case "$reuseval-$4" in
5534true-) ;;
5535true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5536esac;
5537case "$tx" in
5538yes)
5539 case "$runnm" in
5540 true)
5541 if $contains $tlook $tf >/dev/null 2>&1;
5542 then tval=true;
5543 else tval=false;
5544 fi;;
5545 *)
5546 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5547 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5548 then tval=true;
5549 else tval=false;
5550 fi;
5551 $rm -f t t.c;;
5552 esac;;
5553*)
5554 case "$tval" in
5555 $define) tval=true;;
5556 *) tval=false;;
5557 esac;;
5558esac;
5559eval "$2=$tval"'
5560
5561: define an is-in-libc? function
5562inlibc='echo " "; td=$define; tu=$undef;
5563sym=$1; var=$2; eval "was=\$$2";
5564tx=yes;
5565case "$reuseval$was" in
5566true) ;;
5567true*) tx=no;;
5568esac;
5569case "$tx" in
5570yes)
5571 set $sym tres -f;
5572 eval $csym;
5573 case "$tres" in
5574 true)
5575 echo "$sym() found." >&4;
5576 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5577 *)
5578 echo "$sym() NOT found." >&4;
5579 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5580 esac;;
5581*)
5582 case "$was" in
5583 $define) echo "$sym() found." >&4;;
5584 *) echo "$sym() NOT found." >&4;;
5585 esac;;
5586esac'
5587
5588: see if sqrtl exists
5589set sqrtl d_sqrtl
5590eval $inlibc
5591
5592case "$ccflags" in
5593*-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
5594esac
5595
5596case "$uselongdouble" in
5597$define|true|[yY]*) dflt='y';;
5598*) dflt='n';;
5599esac
5600cat <<EOM
5601
5602Perl can be built to take advantage of long doubles which
5603(if available) may give more accuracy and range for floating point numbers.
5604
5605If this doesn't make any sense to you, just accept the default '$dflt'.
5606EOM
5607rp='Try to use long doubles if available?'
5608. ./myread
5609case "$ans" in
5610y|Y) val="$define" ;;
5611*) val="$undef" ;;
5612esac
5613set uselongdouble
5614eval $setvar
5615
5616case "$uselongdouble" in
5617true|[yY]*) uselongdouble="$define" ;;
5618esac
5619
5620case "$uselongdouble" in
5621$define)
5622: Look for a hint-file generated 'call-back-unit'. If the
5623: user has specified that long doubles should be used,
5624: we may need to set or change some other defaults.
5625 if $test -f uselongdouble.cbu; then
5626 echo "Your platform has some specific hints for long doubles, using them..."
5627 . ./uselongdouble.cbu
5628 else
5629 $cat <<EOM
5630(Your platform doesn't have any specific hints for long doubles.)
5631EOM
5632 fi
5633 ;;
5634esac
5635
5636case "$uselongdouble:$d_sqrtl" in
5637$define:$undef)
5638 $cat <<EOM >&4
5639
5640*** You requested the use of long doubles but you do not seem to have
5641*** the mathematic functions for long doubles. I'm disabling the use
5642*** of long doubles.
5643
5644EOM
5645 uselongdouble=$undef
5646 ;;
5647esac
5648
5649: check for length of double
5650echo " "
5651case "$doublesize" in
5652'')
5653 echo "Checking to see how big your double precision numbers are..." >&4
5654 $cat >try.c <<'EOCP'
5655#include <stdio.h>
5656int main()
5657{
5658 printf("%d\n", (int)sizeof(double));
5659 exit(0);
5660}
5661EOCP
5662 set try
5663 if eval $compile_ok; then
5664 doublesize=`./try`
5665 echo "Your double is $doublesize bytes long."
5666 else
5667 dflt='8'
5668 echo "(I can't seem to compile the test program. Guessing...)"
5669 rp="What is the size of a double precision number (in bytes)?"
5670 . ./myread
5671 doublesize="$ans"
5672 fi
5673 ;;
5674esac
5675$rm -f try.c try
5676
5677: check for long doubles
5678echo " "
5679echo "Checking to see if you have long double..." >&4
5680echo 'int main() { long double x = 7.0; }' > try.c
5681set try
5682if eval $compile; then
5683 val="$define"
5684 echo "You have long double."
5685else
5686 val="$undef"
5687 echo "You do not have long double."
5688fi
5689$rm try.*
5690set d_longdbl
5691eval $setvar
5692
5693: check for length of long double
5694case "${d_longdbl}${longdblsize}" in
5695$define)
5696 echo " "
5697 echo "Checking to see how big your long doubles are..." >&4
5698 $cat >try.c <<'EOCP'
5699#include <stdio.h>
5700int main()
5701{
5702 printf("%d\n", sizeof(long double));
5703}
5704EOCP
5705 set try
5706 set try
5707 if eval $compile; then
5708 longdblsize=`./try$exe_ext`
5709 echo "Your long doubles are $longdblsize bytes long."
5710 else
5711 dflt='8'
5712 echo " "
5713 echo "(I can't seem to compile the test program. Guessing...)" >&4
5714 rp="What is the size of a long double (in bytes)?"
5715 . ./myread
5716 longdblsize="$ans"
5717 fi
5718 if $test "X$doublesize" = "X$longdblsize"; then
5719 echo "(That isn't any different from an ordinary double.)"
5720 fi
5721 ;;
5722esac
5723$rm -f try.* try
5724
5725case "$useperlio" in
5726$define|true|[yY]*|'') dflt='y';;
5727*) dflt='n';;
5728esac
5729cat <<EOM
5730
5731Previous version of $package used the standard IO mechanisms as
5732defined in <stdio.h>. Versions 5.003_02 and later of $package allow
5733alternate IO mechanisms via the PerlIO abstraction layer, but the
5734stdio mechanism is still available if needed. The abstraction layer
5735can use AT&T's sfio (if you already have sfio installed) or regular stdio.
5736Using PerlIO with sfio may cause problems with some extension modules.
5737
5738If this doesn't make any sense to you, just accept the default '$dflt'.
5739EOM
5740rp='Use the PerlIO abstraction layer?'
5741. ./myread
5742case "$ans" in
5743y|Y)
5744 val="$define"
5745 ;;
5746*)
5747 echo "Ok, doing things the stdio way."
5748 val="$undef"
5749 ;;
5750esac
5751set useperlio
5752eval $setvar
5753
5754case "$usesocks" in
5755$define|true|[yY]*)
5756 case "$useperlio" in
5757 $define|true|[yY]*) ;;
5758 *) cat >&4 <<EOM
5759
5760You are using the SOCKS proxy protocol library which means that you
5761should also use the PerlIO layer. You may be headed for trouble.
5762
5763EOM
5764 ;;
5765 esac
5766 ;;
5767esac
5768
5769
5770: determine the architecture name
5771echo " "
5772if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5773 tarch=`arch`"-$osname"
5774elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5775 if uname -m > tmparch 2>&1 ; then
5776 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5777 -e 's/$/'"-$osname/" tmparch`
5778 else
5779 tarch="$osname"
5780 fi
5781 $rm -f tmparch
5782else
5783 tarch="$osname"
5784fi
5785case "$myarchname" in
5786''|"$tarch") ;;
5787*)
5788 echo "(Your architecture name used to be $myarchname.)"
5789 archname=''
5790 ;;
5791esac
5792myarchname="$tarch"
5793case "$archname" in
5794'') dflt="$tarch";;
5795*) dflt="$archname";;
5796esac
5797rp='What is your architecture name'
5798. ./myread
5799archname="$ans"
5800case "$usethreads" in
5801$define)
5802 echo "Threads selected." >&4
5803 case "$archname" in
5804 *-thread*) echo "...and architecture name already has -thread." >&4
5805 ;;
5806 *) archname="$archname-thread"
5807 echo "...setting architecture name to $archname." >&4
5808 ;;
5809 esac
5810 ;;
5811esac
5812case "$usemultiplicity" in
5813$define)
5814 echo "Multiplicity selected." >&4
5815 case "$archname" in
5816 *-multi*) echo "...and architecture name already has -multi." >&4
5817 ;;
5818 *) archname="$archname-multi"
5819 echo "...setting architecture name to $archname." >&4
5820 ;;
5821 esac
5822 ;;
5823esac
5824case "$use64bitint$use64bitall" in
5825*"$define"*)
5826 case "$archname64" in
5827 '')
5828 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5829 ;;
5830 *)
5831 case "$use64bitint" in
5832 "$define") echo "64 bit integers selected." >&4 ;;
5833 esac
5834 case "$use64bitall" in
5835 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5836 esac
5837 case "$archname" in
5838 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5839 ;;
5840 *) archname="$archname-$archname64"
5841 echo "...setting architecture name to $archname." >&4
5842 ;;
5843 esac
5844 ;;
5845 esac
5846esac
5847case "$uselongdouble" in
5848$define)
5849 echo "Long doubles selected." >&4
5850 case "$longdblsize" in
5851 $doublesize)
5852 "...but long doubles are equal to doubles, not changing architecture name." >&4
5853 ;;
5854 *)
5855 case "$archname" in
5856 *-ld*) echo "...and architecture name already has -ld." >&4
5857 ;;
5858 *) archname="$archname-ld"
5859 echo "...setting architecture name to $archname." >&4
5860 ;;
5861 esac
5862 ;;
5863 esac
5864 ;;
5865esac
5866case "$useperlio" in
5867$define)
5868 echo "Perlio selected." >&4
5869 ;;
5870*)
5871 echo "Perlio not selected, using stdio." >&4
5872 case "$archname" in
5873 *-stdio*) echo "...and architecture name already has -stdio." >&4
5874 ;;
5875 *) archname="$archname-stdio"
5876 echo "...setting architecture name to $archname." >&4
5877 ;;
5878 esac
5879 ;;
5880esac
5881
5882: determine root of directory hierarchy where package will be installed.
5883case "$prefix" in
5884'')
5885 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5886 ;;
5887*)
5888 dflt="$prefix"
5889 ;;
5890esac
5891$cat <<EOM
5892
5893By default, $package will be installed in $dflt/bin, manual pages
5894under $dflt/man, etc..., i.e. with $dflt as prefix for all
5895installation directories. Typically this is something like /usr/local.
5896If you wish to have binaries under /usr/bin but other parts of the
5897installation under /usr/local, that's ok: you will be prompted
5898separately for each of the installation directories, the prefix being
5899only used to set the defaults.
5900
5901EOM
5902fn=d~
5903rp='Installation prefix to use?'
5904. ./getfile
5905oldprefix=''
5906case "$prefix" in
5907'') ;;
5908*)
5909 case "$ans" in
5910 "$prefix") ;;
5911 *) oldprefix="$prefix";;
5912 esac
5913 ;;
5914esac
5915prefix="$ans"
5916prefixexp="$ansexp"
5917
5918case "$afsroot" in
5919'') afsroot=/afs ;;
5920*) afsroot=$afsroot ;;
5921esac
5922
5923: is AFS running?
5924echo " "
5925case "$afs" in
5926$define|true) afs=true ;;
5927$undef|false) afs=false ;;
5928*) if test -d $afsroot; then
5929 afs=true
5930 else
5931 afs=false
5932 fi
5933 ;;
5934esac
5935if $afs; then
5936 echo "AFS may be running... I'll be extra cautious then..." >&4
5937else
5938 echo "AFS does not seem to be running..." >&4
5939fi
5940
5941: determine installation prefix for where package is to be installed.
5942if $afs; then
5943$cat <<EOM
5944
5945Since you are running AFS, I need to distinguish the directory in which
5946files will reside from the directory in which they are installed (and from
5947which they are presumably copied to the former directory by occult means).
5948
5949EOM
5950 case "$installprefix" in
5951 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5952 *) dflt="$installprefix";;
5953 esac
5954else
5955$cat <<EOM
5956
5957In some special cases, particularly when building $package for distribution,
5958it is convenient to distinguish between the directory in which files should
5959be installed from the directory ($prefix) in which they
5960will eventually reside. For most users, these two directories are the same.
5961
5962EOM
5963 case "$installprefix" in
5964 '') dflt=$prefix ;;
5965 *) dflt=$installprefix;;
5966 esac
5967fi
5968fn=d~
5969rp='What installation prefix should I use for installing files?'
5970. ./getfile
5971installprefix="$ans"
5972installprefixexp="$ansexp"
5973
5974: set the prefixit variable, to compute a suitable default value
5975prefixit='case "$3" in
5976""|none)
5977 case "$oldprefix" in
5978 "") eval "$1=\"\$$2\"";;
5979 *)
5980 case "$3" in
5981 "") eval "$1=";;
5982 none)
5983 eval "tp=\"\$$2\"";
5984 case "$tp" in
5985 ""|" ") eval "$1=\"\$$2\"";;
5986 *) eval "$1=";;
5987 esac;;
5988 esac;;
5989 esac;;
5990*)
5991 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5992 case "$tp" in
5993 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5994 /*-$oldprefix/*|\~*-$oldprefix/*)
5995 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5996 *) eval "$1=\"\$$2\"";;
5997 esac;;
5998esac'
5999
6000
6001: get the patchlevel
6002echo " "
6003echo "Getting the current patchlevel..." >&4
6004if $test -r $rsrc/patchlevel.h;then
6005 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6006 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6007 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6008 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6009 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6010 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6011 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6012else
6013 revision=0
6014 patchlevel=0
6015 subversion=0
6016 api_revision=0
6017 api_version=0
6018 api_subversion=0
6019 perl_patchlevel=0
6020 $echo "(You do not have patchlevel.h. Eek.)"
6021fi
6022if $test -r $rsrc/.patch ; then
6023 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6024 perl_patchlevel=`cat $rsrc/.patch`
6025 fi
6026fi
6027case "$perl_patchlevel" in
60280) ;;
6029'') $echo "(You have $package version $patchlevel subversion $subversion.)" ;;
6030*) $echo "(You have $package version $patchlevel subversion $subversion patchlevel $perl_patchlevel.)" ;;
6031esac
6032case "$osname" in
6033dos|vms)
6034 : XXX Should be a Configure test for double-dots in filenames.
6035 version=`echo $revision $patchlevel $subversion | \
6036 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6037 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6038 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6039 ;;
6040*)
6041 version=`echo $revision $patchlevel $subversion | \
6042 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6043 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6044 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6045 ;;
6046esac
6047: Special case the 5.005_xx maintenance series, which used 5.005
6048: without any subversion label as a subdirectory in $sitelib
6049if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6050 api_versionstring='5.005'
6051fi
6052
6053: determine installation style
6054: For now, try to deduce it from prefix unless it is already set.
6055: Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6056case "$installstyle" in
6057'') case "$prefix" in
6058 *perl*) dflt='lib';;
6059 *) dflt='lib/perl5' ;;
6060 esac
6061 ;;
6062*) dflt="$installstyle" ;;
6063esac
6064: Probably not worth prompting for this since we prompt for all
6065: the directories individually, and the prompt would be too long and
6066: confusing anyway.
6067installstyle=$dflt
6068
6069: determine where private library files go
6070: Usual default is /usr/local/lib/perl5/$version.
6071: Also allow things like /opt/perl/lib/$version, since
6072: /opt/perl/lib/perl5... would be redundant.
6073: The default "style" setting is made in installstyle.U
6074case "$installstyle" in
6075*lib/perl5*) set dflt privlib lib/$package/$version ;;
6076*) set dflt privlib lib/$version ;;
6077esac
6078eval $prefixit
6079$cat <<EOM
6080
6081There are some auxiliary files for $package that need to be put into a
6082private library directory that is accessible by everyone.
6083
6084EOM
6085fn=d~+
6086rp='Pathname where the private library files will reside?'
6087. ./getfile
6088privlib="$ans"
6089privlibexp="$ansexp"
6090: Change installation prefix, if necessary.
6091if $test X"$prefix" != X"$installprefix"; then
6092 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6093else
6094 installprivlib="$privlibexp"
6095fi
6096
6097: set the prefixup variable, to restore leading tilda escape
6098prefixup='case "$prefixexp" in
6099"$prefix") ;;
6100*) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6101esac'
6102
6103: determine where public architecture dependent libraries go
6104set archlib archlib
6105eval $prefixit
6106: privlib default is /usr/local/lib/$package/$version
6107: archlib default is /usr/local/lib/$package/$version/$archname
6108: privlib may have an optional trailing /share.
6109tdflt=`echo $privlib | $sed 's,/share$,,'`
6110tdflt=$tdflt/$archname
6111case "$archlib" in
6112'') dflt=$tdflt
6113 ;;
6114*) dflt="$archlib"
6115 ;;
6116esac
6117$cat <<EOM
6118
6119$spackage contains architecture-dependent library files. If you are
6120sharing libraries in a heterogeneous environment, you might store
6121these files in a separate location. Otherwise, you can just include
6122them with the rest of the public library files.
6123
6124EOM
6125fn=d+~
6126rp='Where do you want to put the public architecture-dependent libraries?'
6127. ./getfile
6128archlib="$ans"
6129archlibexp="$ansexp"
6130if $test X"$archlib" = X"$privlib"; then
6131 d_archlib="$undef"
6132else
6133 d_archlib="$define"
6134fi
6135: Change installation prefix, if necessary.
6136if $test X"$prefix" != X"$installprefix"; then
6137 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6138else
6139 installarchlib="$archlibexp"
6140fi
6141
6142
6143: Binary compatibility with 5.005 is not possible for builds
6144: with advanced features
6145case "$usethreads$usemultiplicity" in
6146*define*)
6147 bincompat5005="$undef"
6148 d_bincompat5005="$undef"
6149 ;;
6150*) $cat <<EOM
6151
6152This version of Perl can be compiled for binary compatibility with 5.005.
6153If you decide to do so, you will be able to continue using most of the
6154extensions that were compiled for Perl 5.005.
6155
6156EOM
6157 case "$bincompat5005$d_bincompat5005" in
6158 *"$undef"*) dflt=n ;;
6159 *) dflt=y ;;
6160 esac
6161 rp='Binary compatibility with Perl 5.005?'
6162 . ./myread
6163 case "$ans" in
6164 y*) val="$define" ;;
6165 *) val="$undef" ;;
6166 esac
6167 set d_bincompat5005
6168 eval $setvar
6169 case "$d_bincompat5005" in
6170 "$define")
6171 bincompat5005="$define"
6172 ;;
6173 *) bincompat5005="$undef"
6174 d_bincompat5005="$undef"
6175 ;;
6176 esac
6177 ;;
6178esac
6179
6180
6181: see if setuid scripts can be secure
6182$cat <<EOM
6183
6184Some kernels have a bug that prevents setuid #! scripts from being
6185secure. Some sites have disabled setuid #! scripts because of this.
6186
6187First let's decide if your kernel supports secure setuid #! scripts.
6188(If setuid #! scripts would be secure but have been disabled anyway,
6189don't say that they are secure if asked.)
6190
6191EOM
6192
6193val="$undef"
6194if $test -d /dev/fd; then
6195 echo "#!$ls" >reflect
6196 chmod +x,u+s reflect
6197 ./reflect >flect 2>&1
6198 if $contains "/dev/fd" flect >/dev/null; then
6199 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6200 val="$define"
6201 else
6202 $cat <<EOM
6203If you are not sure if they are secure, I can check but I'll need a
6204username and password different from the one you are using right now.
6205If you don't have such a username or don't want me to test, simply
6206enter 'none'.
6207
6208EOM
6209 rp='Other username to test security of setuid scripts with?'
6210 dflt='none'
6211 . ./myread
6212 case "$ans" in
6213 n|none)
6214 case "$d_suidsafe" in
6215 '') echo "I'll assume setuid scripts are *not* secure." >&4
6216 dflt=n;;
6217 "$undef")
6218 echo "Well, the $hint value is *not* secure." >&4
6219 dflt=n;;
6220 *) echo "Well, the $hint value *is* secure." >&4
6221 dflt=y;;
6222 esac
6223 ;;
6224 *)
6225 $rm -f reflect flect
6226 echo "#!$ls" >reflect
6227 chmod +x,u+s reflect
6228 echo >flect
6229 chmod a+w flect
6230 echo '"su" will (probably) prompt you for '"$ans's password."
6231 su $ans -c './reflect >flect'
6232 if $contains "/dev/fd" flect >/dev/null; then
6233 echo "Okay, it looks like setuid scripts are secure." >&4
6234 dflt=y
6235 else
6236 echo "I don't think setuid scripts are secure." >&4
6237 dflt=n
6238 fi
6239 ;;
6240 esac
6241 rp='Does your kernel have *secure* setuid scripts?'
6242 . ./myread
6243 case "$ans" in
6244 [yY]*) val="$define";;
6245 *) val="$undef";;
6246 esac
6247 fi
6248else
6249 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6250 echo "(That's for file descriptors, not floppy disks.)"
6251 val="$undef"
6252fi
6253set d_suidsafe
6254eval $setvar
6255
6256$rm -f reflect flect
6257
6258: now see if they want to do setuid emulation
6259echo " "
6260val="$undef"
6261case "$d_suidsafe" in
6262"$define")
6263 val="$undef"
6264 echo "No need to emulate SUID scripts since they are secure here." >& 4
6265 ;;
6266*)
6267 $cat <<EOM
6268Some systems have disabled setuid scripts, especially systems where
6269setuid scripts cannot be secure. On systems where setuid scripts have
6270been disabled, the setuid/setgid bits on scripts are currently
6271useless. It is possible for $package to detect those bits and emulate
6272setuid/setgid in a secure fashion. This emulation will only work if
6273setuid scripts have been disabled in your kernel.
6274
6275EOM
6276 case "$d_dosuid" in
6277 "$define") dflt=y ;;
6278 *) dflt=n ;;
6279 esac
6280 rp="Do you want to do setuid/setgid emulation?"
6281 . ./myread
6282 case "$ans" in
6283 [yY]*) val="$define";;
6284 *) val="$undef";;
6285 esac
6286 ;;
6287esac
6288set d_dosuid
6289eval $setvar
6290
6291: see if this is a malloc.h system
6292set malloc.h i_malloc
6293eval $inhdr
6294
6295: see if stdlib is available
6296set stdlib.h i_stdlib
6297eval $inhdr
6298
6299: determine which malloc to compile in
6300echo " "
6301case "$usemymalloc" in
6302[yY]*|true|$define) dflt='y' ;;
6303[nN]*|false|$undef) dflt='n' ;;
6304*) case "$ptrsize" in
6305 4) dflt='y' ;;
6306 *) dflt='n' ;;
6307 esac
6308 ;;
6309esac
6310rp="Do you wish to attempt to use the malloc that comes with $package?"
6311. ./myread
6312usemymalloc="$ans"
6313case "$ans" in
6314y*|true)
6315 usemymalloc='y'
6316 mallocsrc='malloc.c'
6317 mallocobj="malloc$_o"
6318 d_mymalloc="$define"
6319 case "$libs" in
6320 *-lmalloc*)
6321 : Remove malloc from list of libraries to use
6322 echo "Removing unneeded -lmalloc from library list" >&4
6323 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6324 shift
6325 libs="$*"
6326 echo "libs = $libs" >&4
6327 ;;
6328 esac
6329 ;;
6330*)
6331 usemymalloc='n'
6332 mallocsrc=''
6333 mallocobj=''
6334 d_mymalloc="$undef"
6335 ;;
6336esac
6337
6338: compute the return types of malloc and free
6339echo " "
6340$cat >malloc.c <<END
6341#$i_malloc I_MALLOC
6342#$i_stdlib I_STDLIB
6343#include <stdio.h>
6344#include <sys/types.h>
6345#ifdef I_MALLOC
6346#include <malloc.h>
6347#endif
6348#ifdef I_STDLIB
6349#include <stdlib.h>
6350#endif
6351#ifdef TRY_MALLOC
6352void *malloc();
6353#endif
6354#ifdef TRY_FREE
6355void free();
6356#endif
6357END
6358case "$malloctype" in
6359'')
6360 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6361 malloctype='void *'
6362 else
6363 malloctype='char *'
6364 fi
6365 ;;
6366esac
6367echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6368
6369case "$freetype" in
6370'')
6371 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6372 freetype='void'
6373 else
6374 freetype='int'
6375 fi
6376 ;;
6377esac
6378echo "Your system uses $freetype free(), it would seem." >&4
6379$rm -f malloc.[co]
6380$cat <<EOM
6381
6382After $package is installed, you may wish to install various
6383add-on modules and utilities. Typically, these add-ons will
6384be installed under $prefix with the rest
6385of this package. However, you may wish to install such add-ons
6386elsewhere under a different prefix.
6387
6388If you do not wish to put everything under a single prefix, that's
6389ok. You will be prompted for the individual locations; this siteprefix
6390is only used to suggest the defaults.
6391
6392The default should be fine for most people.
6393
6394EOM
6395fn=d~+
6396rp='Installation prefix to use for add-on modules and utilities?'
6397: XXX Here might be another good place for an installstyle setting.
6398case "$siteprefix" in
6399'') dflt=$prefix ;;
6400*) dflt=$siteprefix ;;
6401esac
6402. ./getfile
6403: XXX Prefixit unit does not yet support siteprefix and vendorprefix
6404oldsiteprefix=''
6405case "$siteprefix" in
6406'') ;;
6407*) case "$ans" in
6408 "$prefix") ;;
6409 *) oldsiteprefix="$prefix";;
6410 esac
6411 ;;
6412esac
6413siteprefix="$ans"
6414siteprefixexp="$ansexp"
6415
6416: determine where site specific libraries go.
6417: Usual default is /usr/local/lib/perl5/site_perl/$version
6418: The default "style" setting is made in installstyle.U
6419: XXX No longer works with Prefixit stuff.
6420prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6421case "$sitelib" in
6422'') case "$installstyle" in
6423 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6424 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6425 esac
6426 ;;
6427*) dflt="$sitelib"
6428 ;;
6429esac
6430$cat <<EOM
6431
6432The installation process will create a directory for
6433site-specific extensions and modules. Most users find it convenient
6434to place all site-specific files in this directory rather than in the
6435main distribution directory.
6436
6437EOM
6438fn=d~+
6439rp='Pathname for the site-specific library files?'
6440. ./getfile
6441sitelib="$ans"
6442sitelibexp="$ansexp"
6443sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6444: Change installation prefix, if necessary.
6445if $test X"$prefix" != X"$installprefix"; then
6446 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6447else
6448 installsitelib="$sitelibexp"
6449fi
6450
6451: determine where site specific architecture-dependent libraries go.
6452: sitelib default is /usr/local/lib/perl5/site_perl/$version
6453: sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6454: sitelib may have an optional trailing /share.
6455case "$sitearch" in
6456'') dflt=`echo $sitelib | $sed 's,/share$,,'`
6457 dflt="$dflt/$archname"
6458 ;;
6459*) dflt="$sitearch"
6460 ;;
6461esac
6462set sitearch sitearch none
6463eval $prefixit
6464$cat <<EOM
6465
6466The installation process will also create a directory for
6467architecture-dependent site-specific extensions and modules.
6468
6469EOM
6470fn=d~+
6471rp='Pathname for the site-specific architecture-dependent library files?'
6472. ./getfile
6473sitearch="$ans"
6474sitearchexp="$ansexp"
6475: Change installation prefix, if necessary.
6476if $test X"$prefix" != X"$installprefix"; then
6477 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6478else
6479 installsitearch="$sitearchexp"
6480fi
6481
6482$cat <<EOM
6483
6484The installation process will also create a directory for
6485vendor-supplied add-ons. Vendors who supply perl with their system
6486may find it convenient to place all vendor-supplied files in this
6487directory rather than in the main distribution directory. This will
6488ease upgrades between binary-compatible maintenance versions of perl.
6489
6490Of course you may also use these directories in whatever way you see
6491fit. For example, you might use them to access modules shared over a
6492company-wide network.
6493
6494The default answer should be fine for most people.
6495This causes further questions about vendor add-ons to be skipped
6496and no vendor-specific directories will be configured for perl.
6497
6498EOM
6499rp='Do you want to configure vendor-specific add-on directories?'
6500case "$usevendorprefix" in
6501define|true|[yY]*) dflt=y ;;
6502*) : User may have set vendorprefix directly on Configure command line.
6503 case "$vendorprefix" in
6504 ''|' ') dflt=n ;;
6505 *) dflt=y ;;
6506 esac
6507 ;;
6508esac
6509. ./myread
6510case "$ans" in
6511[yY]*) fn=d~+
6512 rp='Installation prefix to use for vendor-supplied add-ons?'
6513 case "$vendorprefix" in
6514 '') dflt='' ;;
6515 *) dflt=$vendorprefix ;;
6516 esac
6517 . ./getfile
6518 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6519 oldvendorprefix=''
6520 case "$vendorprefix" in
6521 '') ;;
6522 *) case "$ans" in
6523 "$prefix") ;;
6524 *) oldvendorprefix="$prefix";;
6525 esac
6526 ;;
6527 esac
6528 usevendorprefix="$define"
6529 vendorprefix="$ans"
6530 vendorprefixexp="$ansexp"
6531 ;;
6532*) usevendorprefix="$undef"
6533 vendorprefix=''
6534 vendorprefixexp=''
6535 ;;
6536esac
6537
6538case "$vendorprefix" in
6539'') d_vendorlib="$undef"
6540 vendorlib=''
6541 vendorlibexp=''
6542 ;;
6543*) d_vendorlib="$define"
6544 : determine where vendor-supplied modules go.
6545 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6546 case "$vendorlib" in
6547 '')
6548 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6549 case "$installstyle" in
6550 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6551 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6552 esac
6553 ;;
6554 *) dflt="$vendorlib"
6555 ;;
6556 esac
6557 fn=d~+
6558 rp='Pathname for the vendor-supplied library files?'
6559 . ./getfile
6560 vendorlib="$ans"
6561 vendorlibexp="$ansexp"
6562 ;;
6563esac
6564vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6565: Change installation prefix, if necessary.
6566if $test X"$prefix" != X"$installprefix"; then
6567 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6568else
6569 installvendorlib="$vendorlibexp"
6570fi
6571
6572case "$vendorprefix" in
6573'') d_vendorarch="$undef"
6574 vendorarch=''
6575 vendorarchexp=''
6576 ;;
6577*) d_vendorarch="$define"
6578 : determine where vendor-supplied architecture-dependent libraries go.
6579 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6580 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6581 : vendorlib may have an optional trailing /share.
6582 case "$vendorarch" in
6583 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6584 dflt="$dflt/$archname"
6585 ;;
6586 *) dflt="$vendorarch" ;;
6587 esac
6588 fn=d~+
6589 rp='Pathname for vendor-supplied architecture-dependent files?'
6590 . ./getfile
6591 vendorarch="$ans"
6592 vendorarchexp="$ansexp"
6593 ;;
6594esac
6595: Change installation prefix, if necessary.
6596if $test X"$prefix" != X"$installprefix"; then
6597 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6598else
6599 installvendorarch="$vendorarchexp"
6600fi
6601
6602: Final catch-all directories to search
6603$cat <<EOM
6604
6605Lastly, you can have perl look in other directories for extensions and
6606modules in addition to those already specified.
6607These directories will be searched after
6608 $sitearch
6609 $sitelib
6610EOM
6611test X"$vendorlib" != "X" && echo ' ' $vendorlib
6612test X"$vendorarch" != "X" && echo ' ' $vendorarch
6613echo ' '
6614case "$otherlibdirs" in
6615''|' ') dflt='none' ;;
6616*) dflt="$otherlibdirs" ;;
6617esac
6618$cat <<EOM
6619Enter a colon-separated set of extra paths to include in perl's @INC
6620search path, or enter 'none' for no extra paths.
6621
6622EOM
6623
6624rp='Colon-separated list of additional directories for perl to search?'
6625. ./myread
6626case "$ans" in
6627' '|''|none) otherlibdirs=' ' ;;
6628*) otherlibdirs="$ans" ;;
6629esac
6630case "$otherlibdirs" in
6631' ') val=$undef ;;
6632*) val=$define ;;
6633esac
6634set d_perl_otherlibdirs
6635eval $setvar
6636
6637: Cruising for prototypes
6638echo " "
6639echo "Checking out function prototypes..." >&4
6640$cat >prototype.c <<'EOCP'
6641int main(int argc, char *argv[]) {
6642 exit(0);}
6643EOCP
6644if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6645 echo "Your C compiler appears to support function prototypes."
6646 val="$define"
6647else
6648 echo "Your C compiler doesn't seem to understand function prototypes."
6649 val="$undef"
6650fi
6651set prototype
6652eval $setvar
6653$rm -f prototype*
6654
6655case "$prototype" in
6656"$define") ;;
6657*) ansi2knr='ansi2knr'
6658 echo " "
6659 cat <<EOM >&4
6660
6661$me: FATAL ERROR:
6662This version of $package can only be compiled by a compiler that
6663understands function prototypes. Unfortunately, your C compiler
6664 $cc $ccflags
6665doesn't seem to understand them. Sorry about that.
6666
6667If GNU cc is available for your system, perhaps you could try that instead.
6668
6669Eventually, we hope to support building Perl with pre-ANSI compilers.
6670If you would like to help in that effort, please contact <perlbug@perl.org>.
6671
6672Aborting Configure now.
6673EOM
6674 exit 2
6675 ;;
6676esac
6677
6678: determine where public executables go
6679echo " "
6680set dflt bin bin
6681eval $prefixit
6682fn=d~
6683rp='Pathname where the public executables will reside?'
6684. ./getfile
6685if $test "X$ansexp" != "X$binexp"; then
6686 installbin=''
6687fi
6688bin="$ans"
6689binexp="$ansexp"
6690: Change installation prefix, if necessary.
6691: XXX Bug? -- ignores Configure -Dinstallprefix setting.
6692if $test X"$prefix" != X"$installprefix"; then
6693 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6694else
6695 installbin="$binexp"
6696fi
6697
6698: Find perl5.005 or later.
6699echo "Looking for a previously installed perl5.005 or later... "
6700case "$perl5" in
6701'') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6702 : Check if this perl is recent and can load a simple module
6703 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6704 perl5=$tdir/perl
6705 break;
6706 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6707 perl5=$tdir/perl5
6708 break;
6709 fi
6710 done
6711 ;;
6712*) perl5="$perl5"
6713 ;;
6714esac
6715case "$perl5" in
6716'') echo "None found. That's ok.";;
6717*) echo "Using $perl5." ;;
6718esac
6719
6720: Determine list of previous versions to include in @INC
6721$cat > getverlist <<EOPL
6722#!$perl5 -w
6723use File::Basename;
6724\$api_versionstring = "$api_versionstring";
6725\$version = "$version";
6726\$stem = "$sitelib_stem";
6727\$archname = "$archname";
6728EOPL
6729 $cat >> getverlist <<'EOPL'
6730# Can't have leading @ because metaconfig interprets it as a command!
6731;@inc_version_list=();
6732# XXX Redo to do opendir/readdir?
6733if (-d $stem) {
6734 chdir($stem);
6735 ;@candidates = glob("5.*");
6736}
6737else {
6738 ;@candidates = ();
6739}
6740
6741# XXX ToDo: These comparisons must be reworked when two-digit
6742# subversions come along, so that 5.7.10 compares as greater than
6743# 5.7.3! By that time, hope that 5.6.x is sufficiently
6744# widespread that we can use the built-in version vectors rather
6745# than reinventing them here. For 5.6.0, however, we must
6746# assume this script will likely be run by 5.005_0x. --AD 1/2000.
6747foreach $d (@candidates) {
6748 if ($d lt $version) {
6749 if ($d ge $api_versionstring) {
6750 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6751 }
6752 elsif ($d ge "5.005") {
6753 unshift(@inc_version_list, grep { -d } $d);
6754 }
6755 }
6756 else {
6757 # Skip newer version. I.e. don't look in
6758 # 5.7.0 if we're installing 5.6.1.
6759 }
6760}
6761
6762if (@inc_version_list) {
6763 print join(' ', @inc_version_list);
6764}
6765else {
6766 # Blank space to preserve value for next Configure run.
6767 print " ";
6768}
6769EOPL
6770chmod +x getverlist
6771case "$inc_version_list" in
6772'') if test -x "$perl5$exe_ext"; then
6773 dflt=`$perl5 getverlist`
6774 else
6775 dflt='none'
6776 fi
6777 ;;
6778$undef) dflt='none' ;;
6779*) eval dflt=\"$inc_version_list\" ;;
6780esac
6781case "$dflt" in
6782''|' ') dflt=none ;;
6783esac
6784case "$dflt" in
67855.005) case "$bincompat5005" in
6786 $define|true|[yY]*) ;;
6787 *) dflt=none ;;
6788 esac
6789 ;;
6790esac
6791$cat <<'EOM'
6792
6793In order to ease the process of upgrading, this version of perl
6794can be configured to use modules built and installed with earlier
6795versions of perl that were installed under $prefix. Specify here
6796the list of earlier versions that this version of perl should check.
6797If Configure detected no earlier versions of perl installed under
6798$prefix, then the list will be empty. Answer 'none' to tell perl
6799to not search earlier versions.
6800
6801The default should almost always be sensible, so if you're not sure,
6802just accept the default.
6803EOM
6804
6805rp='List of earlier versions to include in @INC?'
6806. ./myread
6807case "$ans" in
6808[Nn]one|''|' ') inc_version_list=' ' ;;
6809*) inc_version_list="$ans" ;;
6810esac
6811case "$inc_version_list" in
6812''|' ')
6813 inc_version_list_init='0';;
6814*) inc_version_list_init=`echo $inc_version_list |
6815 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6816 ;;
6817esac
6818$rm -f getverlist
6819
6820: determine whether to install perl also as /usr/bin/perl
6821
6822echo " "
6823if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6824 $cat <<EOM
6825Many scripts expect perl to be installed as /usr/bin/perl.
6826I can install the perl you are about to compile also as /usr/bin/perl
6827(in addition to $installbin/perl).
6828EOM
6829 case "$installusrbinperl" in
6830 "$undef"|[nN]*) dflt='n';;
6831 *) dflt='y';;
6832 esac
6833 rp="Do you want to install perl as /usr/bin/perl?"
6834 . ./myread
6835 case "$ans" in
6836 [yY]*) val="$define";;
6837 *) val="$undef" ;;
6838 esac
6839else
6840 val="$undef"
6841fi
6842set installusrbinperl
6843eval $setvar
6844
6845: see if dld is available
6846set dld.h i_dld
6847eval $inhdr
6848
6849: see if dlopen exists
6850xxx_runnm="$runnm"
6851runnm=false
6852set dlopen d_dlopen
6853eval $inlibc
6854runnm="$xxx_runnm"
6855
6856: determine which dynamic loading, if any, to compile in
6857echo " "
6858dldir="ext/DynaLoader"
6859case "$usedl" in
6860$define|y|true)
6861 dflt='y'
6862 usedl="$define"
6863 ;;
6864$undef|n|false)
6865 dflt='n'
6866 usedl="$undef"
6867 ;;
6868*)
6869 dflt='n'
6870 case "$d_dlopen" in
6871 $define) dflt='y' ;;
6872 esac
6873 case "$i_dld" in
6874 $define) dflt='y' ;;
6875 esac
6876 : Does a dl_xxx.xs file exist for this operating system
6877 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
6878 ;;
6879esac
6880rp="Do you wish to use dynamic loading?"
6881. ./myread
6882usedl="$ans"
6883case "$ans" in
6884y*) usedl="$define"
6885 case "$dlsrc" in
6886 '')
6887 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
6888 dflt="$dldir/dl_${osname}.xs"
6889 elif $test "$d_dlopen" = "$define" ; then
6890 dflt="$dldir/dl_dlopen.xs"
6891 elif $test "$i_dld" = "$define" ; then
6892 dflt="$dldir/dl_dld.xs"
6893 else
6894 dflt=''
6895 fi
6896 ;;
6897 *) dflt="$dldir/$dlsrc"
6898 ;;
6899 esac
6900 echo "The following dynamic loading files are available:"
6901 : Can not go over to $dldir because getfile has path hard-coded in.
6902 tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
6903 rp="Source file to use for dynamic loading"
6904 fn="fne"
6905 gfpth="$src"
6906 . ./getfile
6907 usedl="$define"
6908 : emulate basename
6909 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
6910
6911 $cat << EOM
6912
6913Some systems may require passing special flags to $cc -c to
6914compile modules that will be used to create a shared library.
6915To use no flags, say "none".
6916
6917EOM
6918 case "$cccdlflags" in
6919 '') case "$gccversion" in
6920 '') case "$osname" in
6921 hpux) dflt='+z' ;;
6922 next) dflt='none' ;;
6923 irix*) dflt='-KPIC' ;;
6924 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
6925 sunos) dflt='-pic' ;;
6926 *) dflt='none' ;;
6927 esac
6928 ;;
6929 *) case "$osname" in
6930 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
6931 *) dflt='-fpic' ;;
6932 esac ;;
6933 esac ;;
6934 ' ') dflt='none' ;;
6935 *) dflt="$cccdlflags" ;;
6936 esac
6937 rp="Any special flags to pass to $cc -c to compile shared library modules?"
6938 . ./myread
6939 case "$ans" in
6940 none) cccdlflags=' ' ;;
6941 *) cccdlflags="$ans" ;;
6942 esac
6943
6944 cat << EOM
6945
6946Some systems use ld to create libraries that can be dynamically loaded,
6947while other systems (such as those using ELF) use $cc.
6948
6949EOM
6950 case "$ld" in
6951 '') $cat >try.c <<'EOM'
6952/* Test for whether ELF binaries are produced */
6953#include <fcntl.h>
6954#include <stdlib.h>
6955int main() {
6956 char b[4];
6957 int i = open("a.out",O_RDONLY);
6958 if(i == -1)
6959 exit(1); /* fail */
6960 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
6961 exit(0); /* succeed (yes, it's ELF) */
6962 else
6963 exit(1); /* fail */
6964}
6965EOM
6966 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && ./a.out; then
6967 cat <<EOM
6968You appear to have ELF support. I'll use $cc to build dynamic libraries.
6969EOM
6970 dflt="$cc"
6971 else
6972 echo "I'll use ld to build dynamic libraries."
6973 dflt='ld'
6974 fi
6975 rm -f try.c a.out
6976 ;;
6977 *) dflt="$ld"
6978 ;;
6979 esac
6980
6981 rp="What command should be used to create dynamic libraries?"
6982 . ./myread
6983 ld="$ans"
6984
6985 cat << EOM
6986
6987Some systems may require passing special flags to $ld to create a
6988library that can be dynamically loaded. If your ld flags include
6989-L/other/path options to locate libraries outside your loader's normal
6990search path, you may need to specify those -L options here as well. To
6991use no flags, say "none".
6992
6993EOM
6994 case "$lddlflags" in
6995 '') case "$osname" in
6996 beos) dflt='-nostart' ;;
6997 hpux) dflt='-b';
6998 case "$gccversion" in
6999 '') dflt="$dflt +vnocompatwarnings" ;;
7000 esac
7001 ;;
7002 linux|irix*) dflt='-shared' ;;
7003 next) dflt='none' ;;
7004 solaris) dflt='-G' ;;
7005 sunos) dflt='-assert nodefinitions' ;;
7006 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7007 *) dflt='none' ;;
7008 esac
7009 ;;
7010 *) dflt="$lddlflags" ;;
7011 esac
7012
7013 : Try to guess additional flags to pick up local libraries.
7014 : Be careful not to append to a plain 'none'
7015 case "$dflt" in
7016 none) dflt='' ;;
7017 esac
7018 for thisflag in $ldflags; do
7019 case "$thisflag" in
7020 -L*|-R*)
7021 case " $dflt " in
7022 *" $thisflag "*) ;;
7023 *) dflt="$dflt $thisflag" ;;
7024 esac
7025 ;;
7026 esac
7027 done
7028
7029 case "$dflt" in
7030 ''|' ') dflt='none' ;;
7031 esac
7032
7033 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7034 . ./myread
7035 case "$ans" in
7036 none) lddlflags=' ' ;;
7037 *) lddlflags="$ans" ;;
7038 esac
7039
7040 cat <<EOM
7041
7042Some systems may require passing special flags to $cc to indicate that
7043the resulting executable will use dynamic linking. To use no flags,
7044say "none".
7045
7046EOM
7047 case "$ccdlflags" in
7048 '') case "$osname" in
7049 hpux) dflt='-Wl,-E' ;;
7050 linux) dflt='-rdynamic' ;;
7051 next) dflt='none' ;;
7052 sunos) dflt='none' ;;
7053 *) dflt='none' ;;
7054 esac ;;
7055 ' ') dflt='none' ;;
7056 *) dflt="$ccdlflags" ;;
7057 esac
7058 rp="Any special flags to pass to $cc to use dynamic linking?"
7059 . ./myread
7060 case "$ans" in
7061 none) ccdlflags=' ' ;;
7062 *) ccdlflags="$ans" ;;
7063 esac
7064 ;;
7065*) usedl="$undef"
7066 ld='ld'
7067 dlsrc='dl_none.xs'
7068 lddlflags=''
7069 ccdlflags=''
7070 ;;
7071esac
7072
7073also=''
7074case "$usedl" in
7075$undef)
7076 # No dynamic loading being used, so don't bother even to prompt.
7077 useshrplib='false'
7078 ;;
7079*) case "$useshrplib" in
7080 '') case "$osname" in
7081 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7082 dflt=y
7083 also='Building a shared libperl is required for dynamic loading to work on your system.'
7084 ;;
7085 next*)
7086 case "$osvers" in
7087 4*) dflt=y
7088 also='Building a shared libperl is needed for MAB support.'
7089 ;;
7090 *) dflt=n
7091 ;;
7092 esac
7093 ;;
7094 *) dflt=n
7095 ;;
7096 esac
7097 ;;
7098 $define|true|[Yy]*)
7099 dflt=y
7100 ;;
7101 *) dflt=n
7102 ;;
7103 esac
7104 $cat << EOM
7105
7106The perl executable is normally obtained by linking perlmain.c with
7107libperl${_a}, any static extensions (usually just DynaLoader), and
7108any other libraries needed on this system (such as -lm, etc.). Since
7109your system supports dynamic loading, it is probably possible to build
7110a shared libperl.$so. If you will have more than one executable linked
7111to libperl.$so, this will significantly reduce the size of each
7112executable, but it may have a noticeable affect on performance. The
7113default is probably sensible for your system.
7114$also
7115
7116EOM
7117 rp="Build a shared libperl.$so (y/n)"
7118 . ./myread
7119 case "$ans" in
7120 true|$define|[Yy]*)
7121 useshrplib='true' ;;
7122 *) useshrplib='false' ;;
7123 esac
7124 ;;
7125esac
7126
7127case "$useshrplib" in
7128true)
7129 case "$libperl" in
7130 '')
7131 # Figure out a good name for libperl.so. Since it gets stored in
7132 # a version-specific architecture-dependent library, the version
7133 # number isn't really that important, except for making cc/ld happy.
7134 #
7135 # A name such as libperl.so.3.1
7136 majmin="libperl.$so.$patchlevel.$subversion"
7137 # A name such as libperl.so.301
7138 majonly=`echo $patchlevel $subversion |
7139 $awk '{printf "%d%02d", $1, $2}'`
7140 majonly=libperl.$so.$majonly
7141 # I'd prefer to keep the os-specific stuff here to a minimum, and
7142 # rely on figuring it out from the naming of libc.
7143 case "${osname}${osvers}" in
7144 next4*)
7145 dflt=libperl.5.$so
7146 # XXX How handle the --version stuff for MAB?
7147 ;;
7148 linux*) # ld won't link with a bare -lperl otherwise.
7149 dflt=libperl.$so
7150 ;;
7151 cygwin*) # include version
7152 dflt=`echo libperl$version | sed -e 's/\./_/g'`$lib_ext
7153 ;;
7154 *) # Try to guess based on whether libc has major.minor.
7155 case "$libc" in
7156 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7157 *libc.$so.[0-9]*) dflt=$majonly ;;
7158 *) dflt=libperl.$so ;;
7159 esac
7160 ;;
7161 esac
7162 ;;
7163 *) dflt=$libperl
7164 ;;
7165 esac
7166 cat << EOM
7167
7168I need to select a good name for the shared libperl. If your system uses
7169library names with major and minor numbers, then you might want something
7170like $majmin. Alternatively, if your system uses a single version
7171number for shared libraries, then you might want to use $majonly.
7172Or, your system might be quite happy with a simple libperl.$so.
7173
7174Since the shared libperl will get installed into a version-specific
7175architecture-dependent directory, the version number of the shared perl
7176library probably isn't important, so the default should be o.k.
7177
7178EOM
7179 rp='What name do you want to give to the shared libperl?'
7180 . ./myread
7181 libperl=$ans
7182 echo "Ok, I'll use $libperl"
7183 ;;
7184*)
7185 libperl="libperl${_a}"
7186 ;;
7187esac
7188
7189# Detect old use of shrpdir via undocumented Configure -Dshrpdir
7190case "$shrpdir" in
7191'') ;;
7192*) $cat >&4 <<EOM
7193WARNING: Use of the shrpdir variable for the installation location of
7194the shared $libperl is not supported. It was never documented and
7195will not work in this version. Let me (perlbug@perl.org)
7196know of any problems this may cause.
7197
7198EOM
7199 case "$shrpdir" in
7200 "$archlibexp/CORE")
7201 $cat >&4 <<EOM
7202But your current setting of $shrpdir is
7203the default anyway, so it's harmless.
7204EOM
7205 ;;
7206 *)
7207 $cat >&4 <<EOM
7208Further, your current attempted setting of $shrpdir
7209conflicts with the value of $archlibexp/CORE
7210that installperl will use.
7211EOM
7212 ;;
7213 esac
7214 ;;
7215esac
7216
7217# How will the perl executable find the installed shared $libperl?
7218# Add $xxx to ccdlflags.
7219# If we can't figure out a command-line option, use $shrpenv to
7220# set env LD_RUN_PATH. The main perl makefile uses this.
7221shrpdir=$archlibexp/CORE
7222xxx=''
7223tmp_shrpenv=''
7224if "$useshrplib"; then
7225 case "$osname" in
7226 aix)
7227 # We'll set it in Makefile.SH...
7228 ;;
7229 solaris|netbsd)
7230 xxx="-R $shrpdir"
7231 ;;
7232 freebsd)
7233 xxx="-Wl,-R$shrpdir"
7234 ;;
7235 linux|irix*|dec_osf)
7236 xxx="-Wl,-rpath,$shrpdir"
7237 ;;
7238 next)
7239 # next doesn't like the default...
7240 ;;
7241 beos)
7242 # beos doesn't like the default, either.
7243 ;;
7244 hpux*)
7245 # hpux doesn't like the default, either.
7246 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7247 ;;
7248 *)
7249 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7250 ;;
7251 esac
7252 case "$xxx" in
7253 '') ;;
7254 *)
7255 # Only add $xxx if it isn't already in ccdlflags.
7256 case " $ccdlflags " in
7257 *" $xxx "*) ;;
7258 *) ccdlflags="$ccdlflags $xxx"
7259 cat <<EOM >&4
7260
7261Adding $xxx to the flags
7262passed to $ld so that the perl executable will find the
7263installed shared $libperl.
7264
7265EOM
7266 ;;
7267 esac
7268 ;;
7269 esac
7270fi
7271# Fix ccdlflags in AIX for building external extensions.
7272# (For building Perl itself bare -bE:perl.exp is needed,
7273# Makefile.SH takes care of this.)
7274case "$osname" in
7275aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7276esac
7277# Respect a hint or command-line value.
7278case "$shrpenv" in
7279'') shrpenv="$tmp_shrpenv" ;;
7280esac
7281case "$ldlibpthname" in
7282'') ldlibpthname=LD_LIBRARY_PATH ;;
7283none) ldlibpthname='' ;;
7284esac
7285
7286: determine where manual pages are on this system
7287echo " "
7288case "$sysman" in
7289'')
7290 syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
7291 syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
7292 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7293 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7294 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7295 sysman=`./loc . /usr/man/man1 $syspath`
7296 ;;
7297esac
7298if $test -d "$sysman"; then
7299 echo "System manual is in $sysman." >&4
7300else
7301 echo "Could not find manual pages in source form." >&4
7302fi
7303
7304: determine where manual pages go
7305set man1dir man1dir none
7306eval $prefixit
7307$cat <<EOM
7308
7309$spackage has manual pages available in source form.
7310EOM
7311case "$nroff" in
7312nroff)
7313 echo "However, you don't have nroff, so they're probably useless to you."
7314 case "$man1dir" in
7315 '') man1dir="none";;
7316 esac;;
7317esac
7318echo "If you don't want the manual sources installed, answer 'none'."
7319case "$man1dir" in
7320' ') dflt=none
7321 ;;
7322'')
7323 lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
7324 lookpath="$lookpath $prefixexp/man/p_man/man1"
7325 lookpath="$lookpath $prefixexp/man/u_man/man1"
7326 lookpath="$lookpath $prefixexp/man/man.1"
7327 case "$sysman" in
7328 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7329 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7330 esac
7331 set dflt
7332 eval $prefixup
7333 ;;
7334*) dflt="$man1dir"
7335 ;;
7336esac
7337echo " "
7338fn=dn+~
7339rp="Where do the main $spackage manual pages (source) go?"
7340. ./getfile
7341if $test "X$man1direxp" != "X$ansexp"; then
7342 installman1dir=''
7343fi
7344man1dir="$ans"
7345man1direxp="$ansexp"
7346case "$man1dir" in
7347'') man1dir=' '
7348 installman1dir='';;
7349esac
7350
7351: Change installation prefix, if necessary.
7352if $test X"$prefix" != X"$installprefix"; then
7353 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7354else
7355 installman1dir="$man1direxp"
7356fi
7357
7358: What suffix to use on installed man pages
7359
7360case "$man1dir" in
7361' ')
7362 man1ext='0'
7363 ;;
7364*)
7365 rp="What suffix should be used for the main $spackage man pages?"
7366 case "$man1ext" in
7367 '') case "$man1dir" in
7368 *1) dflt=1 ;;
7369 *1p) dflt=1p ;;
7370 *1pm) dflt=1pm ;;
7371 *l) dflt=l;;
7372 *n) dflt=n;;
7373 *o) dflt=o;;
7374 *p) dflt=p;;
7375 *C) dflt=C;;
7376 *L) dflt=L;;
7377 *L1) dflt=L1;;
7378 *) dflt=1;;
7379 esac
7380 ;;
7381 *) dflt="$man1ext";;
7382 esac
7383 . ./myread
7384 man1ext="$ans"
7385 ;;
7386esac
7387
7388: see if we can have long filenames
7389echo " "
7390first=123456789abcdef
7391$rm -f $first
7392if (echo hi >$first) 2>/dev/null; then
7393 if $test -f 123456789abcde; then
7394 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7395 val="$undef"
7396 else
7397 echo 'You can have filenames longer than 14 characters.'>&4
7398 val="$define"
7399 fi
7400else
7401 $cat <<'EOM'
7402You can't have filenames longer than 14 chars.
7403You can't even think about them!
7404EOM
7405 val="$undef"
7406fi
7407set d_flexfnam
7408eval $setvar
7409$rm -rf 123456789abcde*
7410
7411: determine where library module manual pages go
7412set man3dir man3dir none
7413eval $prefixit
7414$cat <<EOM
7415
7416$spackage has manual pages for many of the library modules.
7417EOM
7418
7419case "$nroff" in
7420nroff)
7421 $cat <<'EOM'
7422However, you don't have nroff, so they're probably useless to you.
7423EOM
7424 case "$man3dir" in
7425 '') man3dir="none";;
7426 esac;;
7427esac
7428
7429case "$d_flexfnam" in
7430undef)
7431 $cat <<'EOM'
7432However, your system can't handle the long file names like File::Basename.3.
7433EOM
7434 case "$man3dir" in
7435 '') man3dir="none";;
7436 esac;;
7437esac
7438
7439echo "If you don't want the manual sources installed, answer 'none'."
7440prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7441case "$man3dir" in
7442'') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7443 if $test -d "$privlib/man/man3"; then
7444 cat <<EOM >&4
7445
7446WARNING: Previous versions of perl installed man3 pages into
7447$privlib/man/man3. This version will suggest a
7448new default of $dflt.
7449EOM
7450 tdflt=$dflt
7451 dflt='n'
7452 rp='Do you wish to preserve the old behavior?(y/n)'
7453 . ./myread
7454 case "$ans" in
7455 y*) dflt="$privlib/man/man3" ;;
7456 *) dflt=$tdflt ;;
7457 esac
7458 fi
7459 ;;
7460*) dflt="$man3dir" ;;
7461esac
7462case "$dflt" in
7463' ') dflt=none ;;
7464esac
7465echo " "
7466fn=dn+~
7467rp="Where do the $package library man pages (source) go?"
7468. ./getfile
7469man3dir="$ans"
7470man3direxp="$ansexp"
7471case "$man3dir" in
7472'') man3dir=' '
7473 installman3dir='';;
7474esac
7475
7476: Change installation prefix, if necessary.
7477if $test X"$prefix" != X"$installprefix"; then
7478 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7479else
7480 installman3dir="$man3direxp"
7481fi
7482
7483: What suffix to use on installed man pages
7484case "$man3dir" in
7485' ')
7486 man3ext='0'
7487 ;;
7488*)
7489 rp="What suffix should be used for the $package library man pages?"
7490 case "$man3ext" in
7491 '') case "$man3dir" in
7492 *3) dflt=3 ;;
7493 *3p) dflt=3p ;;
7494 *3pm) dflt=3pm ;;
7495 *l) dflt=l;;
7496 *n) dflt=n;;
7497 *o) dflt=o;;
7498 *p) dflt=p;;
7499 *C) dflt=C;;
7500 *L) dflt=L;;
7501 *L3) dflt=L3;;
7502 *) dflt=3;;
7503 esac
7504 ;;
7505 *) dflt="$man3ext";;
7506 esac
7507 . ./myread
7508 man3ext="$ans"
7509 ;;
7510esac
7511
7512: see if we have to deal with yellow pages, now NIS.
7513if $test -d /usr/etc/yp || $test -d /etc/yp; then
7514 if $test -f /usr/etc/nibindd; then
7515 echo " "
7516 echo "I'm fairly confident you're on a NeXT."
7517 echo " "
7518 rp='Do you get the hosts file via NetInfo?'
7519 dflt=y
7520 case "$hostcat" in
7521 nidump*) ;;
7522 '') ;;
7523 *) dflt=n;;
7524 esac
7525 . ./myread
7526 case "$ans" in
7527 y*) hostcat='nidump hosts .';;
7528 *) case "$hostcat" in
7529 nidump*) hostcat='';;
7530 esac
7531 ;;
7532 esac
7533 fi
7534 case "$hostcat" in
7535 nidump*) ;;
7536 *)
7537 case "$hostcat" in
7538 *ypcat*) dflt=y;;
7539 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
7540 dflt=y
7541 else
7542 dflt=n
7543 fi;;
7544 *) dflt=n;;
7545 esac
7546 echo " "
7547 rp='Are you getting the hosts file via yellow pages?'
7548 . ./myread
7549 case "$ans" in
7550 y*) hostcat='ypcat hosts';;
7551 *) hostcat='cat /etc/hosts';;
7552 esac
7553 ;;
7554 esac
7555fi
7556case "$hostcat" in
7557'') test -f /etc/hosts && hostcat='cat /etc/hosts';;
7558esac
7559case "$groupcat" in
7560'') test -f /etc/group && groupcat='cat /etc/group';;
7561esac
7562case "$passcat" in
7563'') test -f /etc/passwd && passcat='cat /etc/passwd';;
7564esac
7565
7566: now get the host name
7567echo " "
7568echo "Figuring out host name..." >&4
7569case "$myhostname" in
7570'') cont=true
7571 echo 'Maybe "hostname" will work...'
7572 if tans=`sh -c hostname 2>&1` ; then
7573 myhostname=$tans
7574 phostname=hostname
7575 cont=''
7576 fi
7577 ;;
7578*) cont='';;
7579esac
7580if $test "$cont"; then
7581 if ./xenix; then
7582 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
7583 if tans=`cat /etc/systemid 2>&1` ; then
7584 myhostname=$tans
7585 phostname='cat /etc/systemid'
7586 echo "Whadyaknow. Xenix always was a bit strange..."
7587 cont=''
7588 fi
7589 elif $test -r /etc/systemid; then
7590 echo "(What is a non-Xenix system doing with /etc/systemid?)"
7591 fi
7592fi
7593if $test "$cont"; then
7594 echo 'No, maybe "uuname -l" will work...'
7595 if tans=`sh -c 'uuname -l' 2>&1` ; then
7596 myhostname=$tans
7597 phostname='uuname -l'
7598 else
7599 echo 'Strange. Maybe "uname -n" will work...'
7600 if tans=`sh -c 'uname -n' 2>&1` ; then
7601 myhostname=$tans
7602 phostname='uname -n'
7603 else
7604 echo 'Oh well, maybe I can mine it out of whoami.h...'
7605 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
7606 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
7607 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
7608 else
7609 case "$myhostname" in
7610 '') echo "Does this machine have an identity crisis or something?"
7611 phostname='';;
7612 *)
7613 echo "Well, you said $myhostname before..."
7614 phostname='echo $myhostname';;
7615 esac
7616 fi
7617 fi
7618 fi
7619fi
7620: you do not want to know about this
7621set $myhostname
7622myhostname=$1
7623
7624: verify guess
7625if $test "$myhostname" ; then
7626 dflt=y
7627 rp='Your host name appears to be "'$myhostname'".'" Right?"
7628 . ./myread
7629 case "$ans" in
7630 y*) ;;
7631 *) myhostname='';;
7632 esac
7633fi
7634
7635: bad guess or no guess
7636while $test "X$myhostname" = X ; do
7637 dflt=''
7638 rp="Please type the (one word) name of your host:"
7639 . ./myread
7640 myhostname="$ans"
7641done
7642
7643: translate upper to lower if necessary
7644case "$myhostname" in
7645*[A-Z]*)
7646 echo "(Normalizing case in your host name)"
7647 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
7648 ;;
7649esac
7650
7651case "$myhostname" in
7652*.*)
7653 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
7654 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
7655 echo "(Trimming domain name from host name--host name is now $myhostname)"
7656 ;;
7657*) case "$mydomain" in
7658 '')
7659 {
7660 test "X$hostcat" = "Xypcat hosts" &&
7661 ypmatch "$myhostname" hosts 2>/dev/null |\
7662 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
7663 $test -s hosts
7664 } || {
7665 test "X$hostcat" != "X" &&
7666 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
7667 /[ ]$myhostname[ . ]/p" > hosts
7668 }
7669 tmp_re="[ . ]"
7670 if $test -f hosts; then
7671 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
7672 END { print sum }" hosts` = x1 || tmp_re="[ ]"
7673 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
7674 hosts | $sort | $uniq | \
7675 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
7676 case `$echo X$dflt` in
7677 X*\ *) echo "(Several hosts in the database matched hostname)"
7678 dflt=.
7679 ;;
7680 X.) echo "(You do not have fully-qualified names in the hosts database)"
7681 ;;
7682 esac
7683 else
7684 echo "(I cannot locate a hosts database anywhere)"
7685 dflt=.
7686 fi
7687 case "$dflt" in
7688 .)
7689 tans=`./loc resolv.conf X /etc /usr/etc`
7690 if $test -f "$tans"; then
7691 echo "(Attempting domain name extraction from $tans)"
7692 dflt=.`$sed -n -e 's/ / /g' \
7693 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
7694 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7695 case "$dflt" in
7696 .) dflt=.`$sed -n -e 's/ / /g' \
7697 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
7698 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
7699 ;;
7700 esac
7701 fi
7702 ;;
7703 esac
7704 case "$dflt" in
7705 .) echo "(No help from resolv.conf either -- attempting clever guess)"
7706 dflt=.`sh -c domainname 2>/dev/null`
7707 case "$dflt" in
7708 '') dflt='.';;
7709 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
7710 esac
7711 ;;
7712 esac
7713 case "$dflt$osname" in
7714 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
7715 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
7716 ;;
7717 esac
7718 case "$dflt" in
7719 .) echo "(Lost all hope -- silly guess then)"
7720 dflt='.uucp'
7721 ;;
7722 esac
7723 $rm -f hosts
7724 ;;
7725 *) dflt="$mydomain";;
7726 esac;;
7727esac
7728echo " "
7729rp="What is your domain name?"
7730. ./myread
7731tans="$ans"
7732case "$ans" in
7733'') ;;
7734.*) ;;
7735*) tans=".$tans";;
7736esac
7737mydomain="$tans"
7738
7739: translate upper to lower if necessary
7740case "$mydomain" in
7741*[A-Z]*)
7742 echo "(Normalizing case in your domain name)"
7743 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
7744 ;;
7745esac
7746
7747: a little sanity check here
7748case "$phostname" in
7749'') ;;
7750*)
7751 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
7752 $myhostname$mydomain|$myhostname) ;;
7753 *)
7754 case "$phostname" in
7755 sed*)
7756 echo "(That doesn't agree with your whoami.h file, by the way.)"
7757 ;;
7758 *)
7759 echo "(That doesn't agree with your $phostname command, by the way.)"
7760 ;;
7761 esac
7762 ;;
7763 esac
7764 ;;
7765esac
7766
7767$cat <<EOM
7768
7769I need to get your e-mail address in Internet format if possible, i.e.
7770something like user@host.domain. Please answer accurately since I have
7771no easy means to double check it. The default value provided below
7772is most probably close to reality but may not be valid from outside
7773your organization...
7774
7775EOM
7776cont=x
7777while test "$cont"; do
7778 case "$cf_email" in
7779 '') dflt="$cf_by@$myhostname$mydomain";;
7780 *) dflt="$cf_email";;
7781 esac
7782 rp='What is your e-mail address?'
7783 . ./myread
7784 cf_email="$ans"
7785 case "$cf_email" in
7786 *@*.*) cont='' ;;
7787 *)
7788 rp='Address does not look like an Internet one. Use it anyway?'
7789 case "$fastread" in
7790 yes) dflt=y ;;
7791 *) dflt=n ;;
7792 esac
7793 . ./myread
7794 case "$ans" in
7795 y*) cont='' ;;
7796 *) echo " " ;;
7797 esac
7798 ;;
7799 esac
7800done
7801
7802$cat <<EOM
7803
7804If you or somebody else will be maintaining perl at your site, please
7805fill in the correct e-mail address here so that they may be contacted
7806if necessary. Currently, the "perlbug" program included with perl
7807will send mail to this address in addition to perlbug@perl.org. You may
7808enter "none" for no administrator.
7809
7810EOM
7811case "$perladmin" in
7812'') dflt="$cf_email";;
7813*) dflt="$perladmin";;
7814esac
7815rp='Perl administrator e-mail address'
7816. ./myread
7817perladmin="$ans"
7818
7819: determine whether to only install version-specific parts.
7820echo " "
7821$cat <<EOM
7822Do you want to install only the version-specific parts of the perl
7823distribution? Usually you do *not* want to do this.
7824EOM
7825case "$versiononly" in
7826"$define"|[Yy]*|true) dflt='y' ;;
7827*) dflt='n';
7828esac
7829rp="Do you want to install only the version-specific parts of perl?"
7830. ./myread
7831case "$ans" in
7832[yY]*) val="$define";;
7833*) val="$undef" ;;
7834esac
7835set versiononly
7836eval $setvar
7837
7838: figure out how to guarantee perl startup
7839case "$startperl" in
7840'')
7841 case "$sharpbang" in
7842 *!)
7843 $cat <<EOH
7844
7845I can use the #! construct to start perl on your system. This will
7846make startup of perl scripts faster, but may cause problems if you
7847want to share those scripts and perl is not in a standard place
7848($binexp/perl) on all your platforms. The alternative is to force
7849a shell by starting the script with a single ':' character.
7850
7851EOH
7852 case "$versiononly" in
7853 "$define") dflt="$binexp/perl$version";;
7854 *) dflt="$binexp/perl";;
7855 esac
7856 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
7857 . ./myread
7858 case "$ans" in
7859 none) startperl=": # use perl";;
7860 *) startperl="#!$ans"
7861 if $test 30 -lt `echo "$ans" | wc -c`; then
7862 $cat >&4 <<EOM
7863
7864WARNING: Some systems limit the #! command to 32 characters.
7865If you experience difficulty running Perl scripts with #!, try
7866installing Perl in a directory with a shorter pathname.
7867
7868EOM
7869 fi ;;
7870 esac
7871 ;;
7872 *) startperl=": # use perl"
7873 ;;
7874 esac
7875 ;;
7876esac
7877echo "I'll use $startperl to start perl scripts."
7878
7879: figure best path for perl in scripts
7880case "$perlpath" in
7881'')
7882 perlpath="$binexp/perl"
7883 case "$startperl" in
7884 *!*) ;;
7885 *)
7886 $cat <<EOH
7887
7888I will use the "eval 'exec'" idiom to start Perl on your system.
7889I can use the full path of your Perl binary for this purpose, but
7890doing so may cause problems if you want to share those scripts and
7891Perl is not always in a standard place ($binexp/perl).
7892
7893EOH
7894 dflt="$binexp/perl"
7895 rp="What path shall I use in \"eval 'exec'\"?"
7896 . ./myread
7897 perlpath="$ans"
7898 ;;
7899 esac
7900 ;;
7901esac
7902case "$startperl" in
7903*!*) ;;
7904*) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
7905esac
7906
7907: determine where public executable scripts go
7908set scriptdir scriptdir
7909eval $prefixit
7910case "$scriptdir" in
7911'')
7912 dflt="$bin"
7913 : guess some guesses
7914 $test -d /usr/share/scripts && dflt=/usr/share/scripts
7915 $test -d /usr/share/bin && dflt=/usr/share/bin
7916 $test -d /usr/local/script && dflt=/usr/local/script
7917 $test -d /usr/local/scripts && dflt=/usr/local/scripts
7918 $test -d $prefixexp/script && dflt=$prefixexp/script
7919 set dflt
7920 eval $prefixup
7921 ;;
7922*) dflt="$scriptdir"
7923 ;;
7924esac
7925$cat <<EOM
7926
7927Some installations have a separate directory just for executable scripts so
7928that they can mount it across multiple architectures but keep the scripts in
7929one spot. You might, for example, have a subdirectory of /usr/share for this.
7930Or you might just lump your scripts in with all your other executables.
7931
7932EOM
7933fn=d~
7934rp='Where do you keep publicly executable scripts?'
7935. ./getfile
7936if $test "X$ansexp" != "X$scriptdirexp"; then
7937 installscript=''
7938fi
7939scriptdir="$ans"
7940scriptdirexp="$ansexp"
7941: Change installation prefix, if necessary.
7942if $test X"$prefix" != X"$installprefix"; then
7943 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
7944else
7945 installscript="$scriptdirexp"
7946fi
7947
7948: determine where add-on public executables go
7949case "$sitebin" in
7950'') dflt=$siteprefix/bin ;;
7951*) dflt=$sitebin ;;
7952esac
7953fn=d~
7954rp='Pathname where the add-on public executables should be installed?'
7955. ./getfile
7956sitebin="$ans"
7957sitebinexp="$ansexp"
7958: Change installation prefix, if necessary.
7959if $test X"$prefix" != X"$installprefix"; then
7960 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
7961else
7962 installsitebin="$sitebinexp"
7963fi
7964
7965case "$vendorprefix" in
7966'') d_vendorbin="$undef"
7967 vendorbin=''
7968 vendorbinexp=''
7969 ;;
7970*) d_vendorbin="$define"
7971 : determine where vendor-supplied executables go.
7972 case "$vendorbin" in
7973 '') dflt=$vendorprefix/bin ;;
7974 *) dflt="$vendorbin" ;;
7975 esac
7976 fn=d~+
7977 rp='Pathname for the vendor-supplied executables directory?'
7978 . ./getfile
7979 vendorbin="$ans"
7980 vendorbinexp="$ansexp"
7981 ;;
7982esac
7983: Change installation prefix, if necessary.
7984if $test X"$prefix" != X"$installprefix"; then
7985 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
7986else
7987 installvendorbin="$vendorbinexp"
7988fi
7989
7990: see if qgcvt exists
7991set qgcvt d_qgcvt
7992eval $inlibc
7993
7994echo " "
7995
7996if $test X"$d_longdbl" = X"$define"; then
7997
7998echo "Checking how to print long doubles..." >&4
7999
8000if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
8001 $cat >try.c <<'EOCP'
8002#include <sys/types.h>
8003#include <stdio.h>
8004int main() {
8005 double d = 123.456;
8006 printf("%.3f\n", d);
8007}
8008EOCP
8009 set try
8010 if eval $compile; then
8011 yyy=`./try$exe_ext`
8012 case "$yyy" in
8013 123.456)
8014 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
8015 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
8016 echo "We will use %f."
8017 ;;
8018 esac
8019 fi
8020fi
8021
8022if $test X"$sPRIfldbl" = X; then
8023 $cat >try.c <<'EOCP'
8024#include <sys/types.h>
8025#include <stdio.h>
8026int main() {
8027 long double d = 123.456;
8028 printf("%.3llf\n", d);
8029}
8030EOCP
8031 set try
8032 if eval $compile; then
8033 yyy=`./try$exe_ext`
8034 case "$yyy" in
8035 123.456)
8036 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
8037 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
8038 echo "We will use %llf."
8039 ;;
8040 esac
8041 fi
8042fi
8043
8044if $test X"$sPRIfldbl" = X; then
8045 $cat >try.c <<'EOCP'
8046#include <sys/types.h>
8047#include <stdio.h>
8048int main() {
8049 long double d = 123.456;
8050 printf("%.3Lf\n", d);
8051}
8052EOCP
8053 set try
8054 if eval $compile; then
8055 yyy=`./try$exe_ext`
8056 case "$yyy" in
8057 123.456)
8058 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
8059 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
8060 echo "We will use %Lf."
8061 ;;
8062 esac
8063 fi
8064fi
8065
8066if $test X"$sPRIfldbl" = X; then
8067 $cat >try.c <<'EOCP'
8068#include <sys/types.h>
8069#include <stdio.h>
8070int main() {
8071 long double d = 123.456;
8072 printf("%.3lf\n", d);
8073}
8074EOCP
8075 set try
8076 if eval $compile; then
8077 yyy=`./try$exe_ext`
8078 case "$yyy" in
8079 123.456)
8080 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
8081 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
8082 echo "We will use %lf."
8083 ;;
8084 esac
8085 fi
8086fi
8087
8088if $test X"$sPRIfldbl" = X; then
8089 echo "Cannot figure out how to print long doubles." >&4
8090else
8091 sSCNfldbl=$sPRIfldbl # expect consistency
8092fi
8093
8094$rm -f try try.*
8095
8096fi # d_longdbl
8097
8098case "$sPRIfldbl" in
8099'') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
8100 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
8101 d_SCNfldbl="$undef";
8102 ;;
8103*) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
8104 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
8105 d_SCNfldbl="$define";
8106 ;;
8107esac
8108
8109: Check how to convert floats to strings.
8110echo " "
8111echo "Checking for an efficient way to convert floats to strings."
8112echo " " > try.c
8113case "$uselongdouble" in
8114"$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8115esac
8116case "$d_longdbl" in
8117"$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8118esac
8119case "$d_PRIgldbl" in
8120"$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8121esac
8122$cat >>try.c <<EOP
8123#ifdef TRY_gconvert
8124#define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8125char *myname = "gconvert";
8126#endif
8127#ifdef TRY_gcvt
8128#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8129char *myname = "gcvt";
8130#endif
8131#ifdef TRY_qgcvt
8132#define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8133char *myname = "qgcvt";
8134#define DOUBLETYPE long double
8135#endif
8136#ifdef TRY_sprintf
8137#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
8138#define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8139#else
8140#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8141#endif
8142char *myname = "sprintf";
8143#endif
8144
8145#ifndef DOUBLETYPE
8146#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8147#define DOUBLETYPE long double
8148#else
8149#define DOUBLETYPE double
8150#endif
8151#endif
8152
8153#include <stdio.h>
8154
8155#define I_STDLIB $i_stdlib
8156#ifdef I_STDLIB
8157#include <stdlib.h>
8158#endif
8159
8160int
8161checkit(expect, got)
8162char *expect;
8163char *got;
8164{
8165 if (strcmp(expect, got)) {
8166 printf("%s oddity: Expected %s, got %s\n",
8167 myname, expect, got);
8168 exit(1);
8169 }
8170}
8171
8172int main()
8173{
8174 char buf[64];
8175 buf[63] = '\0';
8176
8177 /* This must be 1st test on (which?) platform */
8178 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8179 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8180 checkit("0.1", buf);
8181
8182 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8183 checkit("1", buf);
8184
8185 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8186 checkit("1.1", buf);
8187
8188 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8189 checkit("1.01", buf);
8190
8191 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8192 checkit("1.001", buf);
8193
8194 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8195 checkit("1.0001", buf);
8196
8197 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8198 checkit("1.00001", buf);
8199
8200 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8201 checkit("1.000001", buf);
8202
8203 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8204 checkit("0", buf);
8205
8206 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8207 checkit("-1", buf);
8208
8209 /* Some Linux gcvt's give 1.e+5 here. */
8210 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8211 checkit("100000", buf);
8212
8213 /* Some Linux gcvt's give -1.e+5 here. */
8214 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8215 checkit("-100000", buf);
8216
8217 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8218 checkit("123.456", buf);
8219
8220 exit(0);
8221}
8222EOP
8223case "$d_Gconvert" in
8224gconvert*) xxx_list='gconvert gcvt sprintf' ;;
8225gcvt*) xxx_list='gcvt gconvert sprintf' ;;
8226sprintf*) xxx_list='sprintf gconvert gcvt' ;;
8227*) xxx_list='gconvert gcvt sprintf' ;;
8228esac
8229
8230case "$d_longdbl$uselongdouble$d_PRIgldbl" in
8231"$define$define$define")
8232 # for long doubles prefer first qgcvt, then sprintf
8233 xxx_list="`echo $xxx_list|sed s/sprintf//`"
8234 xxx_list="sprintf $xxx_list"
8235 case "$d_qgcvt" in
8236 "$define") xxx_list="qgcvt $xxx_list" ;;
8237 esac
8238 ;;
8239esac
8240
8241for xxx_convert in $xxx_list; do
8242 echo "Trying $xxx_convert..."
8243 $rm -f try try$_o
8244 set try -DTRY_$xxx_convert
8245 if eval $compile; then
8246 echo "$xxx_convert() found." >&4
8247 if ./try; then
8248 echo "I'll use $xxx_convert to convert floats into a string." >&4
8249 break;
8250 else
8251 echo "...But $xxx_convert didn't work as I expected."
8252 fi
8253 else
8254 echo "$xxx_convert NOT found." >&4
8255 fi
8256done
8257
8258case "$xxx_convert" in
8259gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8260gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8261qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8262*) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8263 "$define$define$define")
8264 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8265 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8266 esac
8267 ;;
8268esac
8269
8270: see if _fwalk exists
8271set fwalk d__fwalk
8272eval $inlibc
8273
8274: Initialize h_fcntl
8275h_fcntl=false
8276
8277: Initialize h_sysfile
8278h_sysfile=false
8279
8280: access call always available on UNIX
8281set access d_access
8282eval $inlibc
8283
8284: locate the flags for 'access()'
8285case "$d_access" in
8286"$define")
8287 echo " "
8288 $cat >access.c <<'EOCP'
8289#include <sys/types.h>
8290#ifdef I_FCNTL
8291#include <fcntl.h>
8292#endif
8293#ifdef I_SYS_FILE
8294#include <sys/file.h>
8295#endif
8296#ifdef I_UNISTD
8297#include <unistd.h>
8298#endif
8299int main() {
8300 exit(R_OK);
8301}
8302EOCP
8303 : check sys/file.h first, no particular reason here
8304 if $test `./findhdr sys/file.h` && \
8305 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
8306 h_sysfile=true;
8307 echo "<sys/file.h> defines the *_OK access constants." >&4
8308 elif $test `./findhdr fcntl.h` && \
8309 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
8310 h_fcntl=true;
8311 echo "<fcntl.h> defines the *_OK access constants." >&4
8312 elif $test `./findhdr unistd.h` && \
8313 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
8314 echo "<unistd.h> defines the *_OK access constants." >&4
8315 else
8316 echo "I can't find the four *_OK access constants--I'll use mine." >&4
8317 fi
8318 ;;
8319esac
8320$rm -f access*
8321
8322: see if accessx exists
8323set accessx d_accessx
8324eval $inlibc
8325
8326: see if alarm exists
8327set alarm d_alarm
8328eval $inlibc
8329
8330: see if atolf exists
8331set atolf d_atolf
8332eval $inlibc
8333
8334: see if atoll exists
8335set atoll d_atoll
8336eval $inlibc
8337
8338: Look for GNU-cc style attribute checking
8339echo " "
8340echo "Checking whether your compiler can handle __attribute__ ..." >&4
8341$cat >attrib.c <<'EOCP'
8342#include <stdio.h>
8343void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
8344EOCP
8345if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
8346 if $contains 'warning' attrib.out >/dev/null 2>&1; then
8347 echo "Your C compiler doesn't fully support __attribute__."
8348 val="$undef"
8349 else
8350 echo "Your C compiler supports __attribute__."
8351 val="$define"
8352 fi
8353else
8354 echo "Your C compiler doesn't seem to understand __attribute__ at all."
8355 val="$undef"
8356fi
8357set d_attribut
8358eval $setvar
8359$rm -f attrib*
8360
8361: see if bcmp exists
8362set bcmp d_bcmp
8363eval $inlibc
8364
8365: see if bcopy exists
8366set bcopy d_bcopy
8367eval $inlibc
8368
8369: see if this is a unistd.h system
8370set unistd.h i_unistd
8371eval $inhdr
8372
8373: see if getpgrp exists
8374set getpgrp d_getpgrp
8375eval $inlibc
8376
8377case "$d_getpgrp" in
8378"$define")
8379 echo " "
8380 echo "Checking to see which flavor of getpgrp is in use..."
8381 $cat >set.c <<EOP
8382#$i_unistd I_UNISTD
8383#include <sys/types.h>
8384#ifdef I_UNISTD
8385# include <unistd.h>
8386#endif
8387int main()
8388{
8389 if (getuid() == 0) {
8390 printf("(I see you are running Configure as super-user...)\n");
8391 setuid(1);
8392 }
8393#ifdef TRY_BSD_PGRP
8394 if (getpgrp(1) == 0)
8395 exit(0);
8396#else
8397 if (getpgrp() > 0)
8398 exit(0);
8399#endif
8400 exit(1);
8401}
8402EOP
8403 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8404 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
8405 val="$define"
8406 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8407 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
8408 val="$undef"
8409 else
8410 echo "I can't seem to compile and run the test program."
8411 if ./usg; then
8412 xxx="a USG one, i.e. you use getpgrp()."
8413 else
8414 # SVR4 systems can appear rather BSD-ish.
8415 case "$i_unistd" in
8416 $undef)
8417 xxx="a BSD one, i.e. you use getpgrp(pid)."
8418 val="$define"
8419 ;;
8420 $define)
8421 xxx="probably a USG one, i.e. you use getpgrp()."
8422 val="$undef"
8423 ;;
8424 esac
8425 fi
8426 echo "Assuming your getpgrp is $xxx" >&4
8427 fi
8428 ;;
8429*) val="$undef";;
8430esac
8431set d_bsdgetpgrp
8432eval $setvar
8433$rm -f set set.c
8434
8435: see if setpgrp exists
8436set setpgrp d_setpgrp
8437eval $inlibc
8438
8439case "$d_setpgrp" in
8440"$define")
8441 echo " "
8442 echo "Checking to see which flavor of setpgrp is in use..."
8443 $cat >set.c <<EOP
8444#$i_unistd I_UNISTD
8445#include <sys/types.h>
8446#ifdef I_UNISTD
8447# include <unistd.h>
8448#endif
8449int main()
8450{
8451 if (getuid() == 0) {
8452 printf("(I see you are running Configure as super-user...)\n");
8453 setuid(1);
8454 }
8455#ifdef TRY_BSD_PGRP
8456 if (-1 == setpgrp(1, 1))
8457 exit(0);
8458#else
8459 if (setpgrp() != -1)
8460 exit(0);
8461#endif
8462 exit(1);
8463}
8464EOP
8465 if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8466 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
8467 val="$define"
8468 elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
8469 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
8470 val="$undef"
8471 else
8472 echo "(I can't seem to compile and run the test program.)"
8473 if ./usg; then
8474 xxx="a USG one, i.e. you use setpgrp()."
8475 else
8476 # SVR4 systems can appear rather BSD-ish.
8477 case "$i_unistd" in
8478 $undef)
8479 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
8480 val="$define"
8481 ;;
8482 $define)
8483 xxx="probably a USG one, i.e. you use setpgrp()."
8484 val="$undef"
8485 ;;
8486 esac
8487 fi
8488 echo "Assuming your setpgrp is $xxx" >&4
8489 fi
8490 ;;
8491*) val="$undef";;
8492esac
8493set d_bsdsetpgrp
8494eval $setvar
8495$rm -f set set.c
8496: see if bzero exists
8497set bzero d_bzero
8498eval $inlibc
8499
8500: see if signal is declared as pointer to function returning int or void
8501echo " "
8502xxx=`./findhdr signal.h`
8503$test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
8504if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8505 echo "You have int (*signal())() instead of void." >&4
8506 val="$undef"
8507elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
8508 echo "You have void (*signal())()." >&4
8509 val="$define"
8510elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
8511 echo "You have int (*signal())() instead of void." >&4
8512 val="$undef"
8513elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
8514 echo "You have void (*signal())()." >&4
8515 val="$define"
8516else
8517 case "$d_voidsig" in
8518 '')
8519 echo "I can't determine whether signal handler returns void or int..." >&4
8520 dflt=void
8521 rp="What type does your signal handler return?"
8522 . ./myread
8523 case "$ans" in
8524 v*) val="$define";;
8525 *) val="$undef";;
8526 esac;;
8527 "$define")
8528 echo "As you already told me, signal handler returns void." >&4
8529 val="$define"
8530 ;;
8531 *) echo "As you already told me, signal handler returns int." >&4
8532 val="$undef"
8533 ;;
8534 esac
8535fi
8536set d_voidsig
8537eval $setvar
8538case "$d_voidsig" in
8539"$define") signal_t="void";;
8540*) signal_t="int";;
8541esac
8542$rm -f $$.tmp
8543
8544: check for ability to cast large floats to 32-bit ints.
8545echo " "
8546echo 'Checking whether your C compiler can cast large floats to int32.' >&4
8547if $test "$intsize" -ge 4; then
8548 xxx=int
8549else
8550 xxx=long
8551fi
8552$cat >try.c <<EOCP
8553#include <stdio.h>
8554#include <sys/types.h>
8555#include <signal.h>
8556$signal_t blech(s) int s; { exit(3); }
8557int main()
8558{
8559 $xxx i32;
8560 double f, g;
8561 int result = 0;
8562 char str[16];
8563 signal(SIGFPE, blech);
8564
8565 /* Don't let compiler optimize the test away. Store the number
8566 in a writable string for gcc to pass to sscanf under HP/UX.
8567 */
8568 sprintf(str, "2147483647");
8569 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
8570 g = 10 * f;
8571 i32 = ($xxx) g;
8572
8573 /* x86 processors will probably give 0x8000 0000, which is a
8574 sign change. We don't want that. We want to mimic SPARC
8575 behavior here, which is to preserve the sign and give
8576 back 0x7fff ffff.
8577 */
8578 if (i32 != ($xxx) f)
8579 result |= 1;
8580 exit(result);
8581}
8582EOCP
8583set try
8584if eval $compile_ok; then
8585 ./try
8586 yyy=$?
8587else
8588 echo "(I can't seem to compile the test program--assuming it can't)"
8589 yyy=1
8590fi
8591case "$yyy" in
85920) val="$define"
8593 echo "Yup, it can."
8594 ;;
8595*) val="$undef"
8596 echo "Nope, it can't."
8597 ;;
8598esac
8599set d_casti32
8600eval $setvar
8601$rm -f try try.*
8602
8603: check for ability to cast negative floats to unsigned
8604echo " "
8605echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
8606$cat >try.c <<EOCP
8607#include <stdio.h>
8608#include <sys/types.h>
8609#include <signal.h>
8610$signal_t blech(s) int s; { exit(7); }
8611$signal_t blech_in_list(s) int s; { exit(4); }
8612unsigned long dummy_long(p) unsigned long p; { return p; }
8613unsigned int dummy_int(p) unsigned int p; { return p; }
8614unsigned short dummy_short(p) unsigned short p; { return p; }
8615int main()
8616{
8617 double f;
8618 unsigned long along;
8619 unsigned int aint;
8620 unsigned short ashort;
8621 int result = 0;
8622 char str[16];
8623
8624 /* Frustrate gcc-2.7.2's optimizer which failed this test with
8625 a direct f = -123. assignment. gcc-2.8.0 reportedly
8626 optimized the whole file away
8627 */
8628 /* Store the number in a writable string for gcc to pass to
8629 sscanf under HP/UX.
8630 */
8631 sprintf(str, "-123");
8632 sscanf(str, "%lf", &f); /* f = -123.; */
8633
8634 signal(SIGFPE, blech);
8635 along = (unsigned long)f;
8636 aint = (unsigned int)f;
8637 ashort = (unsigned short)f;
8638 if (along != (unsigned long)-123)
8639 result |= 1;
8640 if (aint != (unsigned int)-123)
8641 result |= 1;
8642 if (ashort != (unsigned short)-123)
8643 result |= 1;
8644 sprintf(str, "1073741824.");
8645 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
8646 f = f + f;
8647 along = 0;
8648 along = (unsigned long)f;
8649 if (along != 0x80000000)
8650 result |= 2;
8651 f -= 1.;
8652 along = 0;
8653 along = (unsigned long)f;
8654 if (along != 0x7fffffff)
8655 result |= 1;
8656 f += 2.;
8657 along = 0;
8658 along = (unsigned long)f;
8659 if (along != 0x80000001)
8660 result |= 2;
8661 if (result)
8662 exit(result);
8663 signal(SIGFPE, blech_in_list);
8664 sprintf(str, "123.");
8665 sscanf(str, "%lf", &f); /* f = 123.; */
8666 along = dummy_long((unsigned long)f);
8667 aint = dummy_int((unsigned int)f);
8668 ashort = dummy_short((unsigned short)f);
8669 if (along != (unsigned long)123)
8670 result |= 4;
8671 if (aint != (unsigned int)123)
8672 result |= 4;
8673 if (ashort != (unsigned short)123)
8674 result |= 4;
8675 exit(result);
8676
8677}
8678EOCP
8679set try
8680if eval $compile_ok; then
8681 ./try
8682 castflags=$?
8683else
8684 echo "(I can't seem to compile the test program--assuming it can't)"
8685 castflags=7
8686fi
8687case "$castflags" in
86880) val="$define"
8689 echo "Yup, it can."
8690 ;;
8691*) val="$undef"
8692 echo "Nope, it can't."
8693 ;;
8694esac
8695set d_castneg
8696eval $setvar
8697$rm -f try.*
8698
8699: see if vprintf exists
8700echo " "
8701if set vprintf val -f d_vprintf; eval $csym; $val; then
8702 echo 'vprintf() found.' >&4
8703 val="$define"
8704 $cat >vprintf.c <<'EOF'
8705#include <varargs.h>
8706
8707int main() { xxx("foo"); }
8708
8709xxx(va_alist)
8710va_dcl
8711{
8712 va_list args;
8713 char buf[10];
8714
8715 va_start(args);
8716 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
8717}
8718EOF
8719 set vprintf
8720 if eval $compile && ./vprintf; then
8721 echo "Your vsprintf() returns (int)." >&4
8722 val2="$undef"
8723 else
8724 echo "Your vsprintf() returns (char*)." >&4
8725 val2="$define"
8726 fi
8727else
8728 echo 'vprintf() NOT found.' >&4
8729 val="$undef"
8730 val2="$undef"
8731fi
8732set d_vprintf
8733eval $setvar
8734val=$val2
8735set d_charvspr
8736eval $setvar
8737
8738: see if chown exists
8739set chown d_chown
8740eval $inlibc
8741
8742: see if chroot exists
8743set chroot d_chroot
8744eval $inlibc
8745
8746: see if chsize exists
8747set chsize d_chsize
8748eval $inlibc
8749
8750hasstruct='varname=$1; struct=$2; shift; shift;
8751while $test $# -ge 2; do
8752 case "$1" in
8753 $define) echo "#include <$2>";;
8754 esac ;
8755 shift 2;
8756done > try.c;
8757echo "int main () { struct $struct foo; }" >> try.c;
8758set try;
8759if eval $compile; then
8760 val="$define";
8761else
8762 val="$undef";
8763fi;
8764set $varname;
8765eval $setvar;
8766$rm -f try.c try.o'
8767
8768: see if sys/types.h has to be included
8769set sys/types.h i_systypes
8770eval $inhdr
8771
8772hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
8773while $test $# -ge 2; do
8774 case "$1" in
8775 $define) echo "#include <$2>";;
8776 esac ;
8777 shift 2;
8778done > try.c;
8779echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
8780set try;
8781if eval $compile; then
8782 val="$define";
8783else
8784 val="$undef";
8785fi;
8786set $varname;
8787eval $setvar;
8788$rm -f try.c try.o'
8789
8790socketlib=''
8791sockethdr=''
8792: see whether socket exists
8793echo " "
8794$echo $n "Hmm... $c" >&4
8795if set socket val -f d_socket; eval $csym; $val; then
8796 echo "Looks like you have Berkeley networking support." >&4
8797 d_socket="$define"
8798 if set setsockopt val -f; eval $csym; $val; then
8799 d_oldsock="$undef"
8800 else
8801 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
8802 d_oldsock="$define"
8803 fi
8804else
8805 if $contains socklib libc.list >/dev/null 2>&1; then
8806 echo "Looks like you have Berkeley networking support." >&4
8807 d_socket="$define"
8808 : we will have to assume that it supports the 4.2 BSD interface
8809 d_oldsock="$undef"
8810 else
8811 echo "You don't have Berkeley networking in libc$_a..." >&4
8812 if test "X$d_socket" = "X$define"; then
8813 echo "...but you seem to believe that you have sockets." >&4
8814 else
8815 for net in net socket
8816 do
8817 if test -f /usr/lib/lib$net$_a; then
8818 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
8819 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
8820 if $contains socket libc.list >/dev/null 2>&1; then
8821 d_socket="$define"
8822 socketlib="-l$net"
8823 case "$net" in
8824 net)
8825 echo "...but the Wollongong group seems to have hacked it in." >&4
8826 sockethdr="-I/usr/netinclude"
8827 ;;
8828 esac
8829 echo "Found Berkeley sockets interface in lib$net." >& 4
8830 if $contains setsockopt libc.list >/dev/null 2>&1; then
8831 d_oldsock="$undef"
8832 else
8833 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
8834 d_oldsock="$define"
8835 fi
8836 break
8837 fi
8838 fi
8839 done
8840 if test "X$d_socket" != "X$define"; then
8841 echo "or anywhere else I see." >&4
8842 d_socket="$undef"
8843 d_oldsock="$undef"
8844 fi
8845 fi
8846 fi
8847fi
8848
8849: see if socketpair exists
8850set socketpair d_sockpair
8851eval $inlibc
8852
8853
8854echo " "
8855echo "Checking the availability of certain socket constants..." >& 4
8856for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
8857 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
8858 $cat >try.c <<EOF
8859#include <sys/types.h>
8860#include <sys/socket.h>
8861int main() {
8862 int i = $ENUM;
8863}
8864EOF
8865 val="$undef"
8866 set try; if eval $compile; then
8867 val="$define"
8868 fi
8869 set d_${enum}; eval $setvar
8870 $rm -f try.c try
8871done
8872
8873: see if this is a sys/uio.h system
8874set sys/uio.h i_sysuio
8875eval $inhdr
8876
8877
8878echo " "
8879echo "Checking to see if your system supports struct cmsghdr..." >&4
8880set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
8881eval $hasstruct
8882case "$d_cmsghdr_s" in
8883"$define") echo "Yes, it does." ;;
8884*) echo "No, it doesn't." ;;
8885esac
8886
8887
8888: check for const keyword
8889echo " "
8890echo 'Checking to see if your C compiler knows about "const"...' >&4
8891$cat >const.c <<'EOCP'
8892typedef struct spug { int drokk; } spug;
8893int main()
8894{
8895 const char *foo;
8896 const spug y;
8897}
8898EOCP
8899if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
8900 val="$define"
8901 echo "Yup, it does."
8902else
8903 val="$undef"
8904 echo "Nope, it doesn't."
8905fi
8906set d_const
8907eval $setvar
8908
8909: see if crypt exists
8910echo " "
8911if set crypt val -f d_crypt; eval $csym; $val; then
8912 echo 'crypt() found.' >&4
8913 val="$define"
8914 cryptlib=''
8915else
8916 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
8917 if $test -z "$cryptlib"; then
8918 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
8919 else
8920 cryptlib=-lcrypt
8921 fi
8922 if $test -z "$cryptlib"; then
8923 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
8924 else
8925 cryptlib=-lcrypt
8926 fi
8927 if $test -z "$cryptlib"; then
8928 cryptlib=`./loc libcrypt$_a "" $libpth`
8929 else
8930 cryptlib=-lcrypt
8931 fi
8932 if $test -z "$cryptlib"; then
8933 echo 'crypt() NOT found.' >&4
8934 val="$undef"
8935 else
8936 val="$define"
8937 fi
8938fi
8939set d_crypt
8940eval $setvar
8941
8942: get csh whereabouts
8943case "$csh" in
8944'csh') val="$undef" ;;
8945*) val="$define" ;;
8946esac
8947set d_csh
8948eval $setvar
8949: Respect a hint or command line value for full_csh.
8950case "$full_csh" in
8951'') full_csh=$csh ;;
8952esac
8953
8954: see if cuserid exists
8955set cuserid d_cuserid
8956eval $inlibc
8957
8958: see if this is a limits.h system
8959set limits.h i_limits
8960eval $inhdr
8961
8962: see if this is a float.h system
8963set float.h i_float
8964eval $inhdr
8965
8966: See if number of significant digits in a double precision number is known
8967echo " "
8968$cat >dbl_dig.c <<EOM
8969#$i_limits I_LIMITS
8970#$i_float I_FLOAT
8971#ifdef I_LIMITS
8972#include <limits.h>
8973#endif
8974#ifdef I_FLOAT
8975#include <float.h>
8976#endif
8977#ifdef DBL_DIG
8978printf("Contains DBL_DIG");
8979#endif
8980EOM
8981$cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
8982if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
8983 echo "DBL_DIG found." >&4
8984 val="$define"
8985else
8986 echo "DBL_DIG NOT found." >&4
8987 val="$undef"
8988fi
8989$rm -f dbl_dig.?
8990set d_dbl_dig
8991eval $setvar
8992
8993: see if difftime exists
8994set difftime d_difftime
8995eval $inlibc
8996
8997: see if this is a dirent system
8998echo " "
8999if xinc=`./findhdr dirent.h`; $test "$xinc"; then
9000 val="$define"
9001 echo "<dirent.h> found." >&4
9002else
9003 val="$undef"
9004 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
9005 echo "<sys/dir.h> found." >&4
9006 echo " "
9007 else
9008 xinc=`./findhdr sys/ndir.h`
9009 fi
9010 echo "<dirent.h> NOT found." >&4
9011fi
9012set i_dirent
9013eval $setvar
9014
9015: Look for type of directory structure.
9016echo " "
9017$cppstdin $cppflags $cppminus < "$xinc" > try.c
9018
9019case "$direntrytype" in
9020''|' ')
9021 case "$i_dirent" in
9022 $define) guess1='struct dirent' ;;
9023 *) guess1='struct direct' ;;
9024 esac
9025 ;;
9026*) guess1="$direntrytype"
9027 ;;
9028esac
9029
9030case "$guess1" in
9031'struct dirent') guess2='struct direct' ;;
9032*) guess2='struct dirent' ;;
9033esac
9034
9035if $contains "$guess1" try.c >/dev/null 2>&1; then
9036 direntrytype="$guess1"
9037 echo "Your directory entries are $direntrytype." >&4
9038elif $contains "$guess2" try.c >/dev/null 2>&1; then
9039 direntrytype="$guess2"
9040 echo "Your directory entries seem to be $direntrytype." >&4
9041else
9042 echo "I don't recognize your system's directory entries." >&4
9043 rp="What type is used for directory entries on this system?"
9044 dflt="$guess1"
9045 . ./myread
9046 direntrytype="$ans"
9047fi
9048$rm -f try.c
9049
9050
9051: see if the directory entry stores field length
9052echo " "
9053$cppstdin $cppflags $cppminus < "$xinc" > try.c
9054if $contains 'd_namlen' try.c >/dev/null 2>&1; then
9055 echo "Good, your directory entry keeps length information in d_namlen." >&4
9056 val="$define"
9057else
9058 echo "Your directory entry does not know about the d_namlen field." >&4
9059 val="$undef"
9060fi
9061set d_dirnamlen
9062eval $setvar
9063$rm -f try.c
9064
9065: see if dlerror exists
9066xxx_runnm="$runnm"
9067runnm=false
9068set dlerror d_dlerror
9069eval $inlibc
9070runnm="$xxx_runnm"
9071
9072: see if dlfcn is available
9073set dlfcn.h i_dlfcn
9074eval $inhdr
9075
9076case "$usedl" in
9077$define|y|true)
9078 $cat << EOM
9079
9080On a few systems, the dynamically loaded modules that perl generates and uses
9081will need a different extension than shared libs. The default will probably
9082be appropriate.
9083
9084EOM
9085 case "$dlext" in
9086 '') dflt="$so" ;;
9087 *) dflt="$dlext" ;;
9088 esac
9089 rp='What is the extension of dynamically loaded modules'
9090 . ./myread
9091 dlext="$ans"
9092 ;;
9093*)
9094 dlext="none"
9095 ;;
9096esac
9097
9098: Check if dlsym need a leading underscore
9099echo " "
9100val="$undef"
9101
9102case "$dlsrc" in
9103dl_dlopen.xs)
9104 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
9105 $cat >dyna.c <<'EOM'
9106fred () { }
9107EOM
9108
9109$cat >fred.c<<EOM
9110
9111#include <stdio.h>
9112#$i_dlfcn I_DLFCN
9113#ifdef I_DLFCN
9114#include <dlfcn.h> /* the dynamic linker include file for Sunos/Solaris */
9115#else
9116#include <sys/types.h>
9117#include <nlist.h>
9118#include <link.h>
9119#endif
9120
9121extern int fred() ;
9122
9123int main()
9124{
9125 void * handle ;
9126 void * symbol ;
9127#ifndef RTLD_LAZY
9128 int mode = 1 ;
9129#else
9130 int mode = RTLD_LAZY ;
9131#endif
9132 handle = dlopen("./dyna.$dlext", mode) ;
9133 if (handle == NULL) {
9134 printf ("1\n") ;
9135 fflush (stdout) ;
9136 exit(0);
9137 }
9138 symbol = dlsym(handle, "fred") ;
9139 if (symbol == NULL) {
9140 /* try putting a leading underscore */
9141 symbol = dlsym(handle, "_fred") ;
9142 if (symbol == NULL) {
9143 printf ("2\n") ;
9144 fflush (stdout) ;
9145 exit(0);
9146 }
9147 printf ("3\n") ;
9148 }
9149 else
9150 printf ("4\n") ;
9151 fflush (stdout) ;
9152 exit(0);
9153}
9154EOM
9155 : Call the object file tmp-dyna.o in case dlext=o.
9156 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
9157 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
9158 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
9159 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
9160 xxx=`./fred`
9161 case $xxx in
9162 1) echo "Test program failed using dlopen." >&4
9163 echo "Perhaps you should not use dynamic loading." >&4;;
9164 2) echo "Test program failed using dlsym." >&4
9165 echo "Perhaps you should not use dynamic loading." >&4;;
9166 3) echo "dlsym needs a leading underscore" >&4
9167 val="$define" ;;
9168 4) echo "dlsym doesn't need a leading underscore." >&4;;
9169 esac
9170 else
9171 echo "I can't compile and run the test program." >&4
9172 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
9173 fi
9174 ;;
9175esac
9176
9177$rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
9178
9179set d_dlsymun
9180eval $setvar
9181
9182hasproto='varname=$1; func=$2; shift; shift;
9183while $test $# -ge 2; do
9184 case "$1" in
9185 $define) echo "#include <$2>";;
9186 esac ;
9187 shift 2;
9188done > try.c;
9189$cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9190if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9191 echo "$func() prototype found.";
9192 val="$define";
9193else
9194 echo "$func() prototype NOT found.";
9195 val="$undef";
9196fi;
9197set $varname;
9198eval $setvar;
9199$rm -f try.c tryout.c'
9200
9201: see if prototype for drand48 is available
9202echo " "
9203set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
9204eval $hasproto
9205
9206: see if dup2 exists
9207set dup2 d_dup2
9208eval $inlibc
9209
9210: see if eaccess exists
9211set eaccess d_eaccess
9212eval $inlibc
9213
9214: see if endgrent exists
9215set endgrent d_endgrent
9216eval $inlibc
9217
9218: see if endhostent exists
9219set endhostent d_endhent
9220eval $inlibc
9221
9222: see if endnetent exists
9223set endnetent d_endnent
9224eval $inlibc
9225
9226: see if endprotoent exists
9227set endprotoent d_endpent
9228eval $inlibc
9229
9230: see if endpwent exists
9231set endpwent d_endpwent
9232eval $inlibc
9233
9234: see if endservent exists
9235set endservent d_endsent
9236eval $inlibc
9237
9238: Locate the flags for 'open()'
9239echo " "
9240$cat >open3.c <<'EOCP'
9241#include <sys/types.h>
9242#ifdef I_FCNTL
9243#include <fcntl.h>
9244#endif
9245#ifdef I_SYS_FILE
9246#include <sys/file.h>
9247#endif
9248int main() {
9249 if(O_RDONLY);
9250#ifdef O_TRUNC
9251 exit(0);
9252#else
9253 exit(1);
9254#endif
9255}
9256EOCP
9257: check sys/file.h first to get FREAD on Sun
9258if $test `./findhdr sys/file.h` && \
9259 set open3 -DI_SYS_FILE && eval $compile; then
9260 h_sysfile=true;
9261 echo "<sys/file.h> defines the O_* constants..." >&4
9262 if ./open3; then
9263 echo "and you have the 3 argument form of open()." >&4
9264 val="$define"
9265 else
9266 echo "but not the 3 argument form of open(). Oh, well." >&4
9267 val="$undef"
9268 fi
9269elif $test `./findhdr fcntl.h` && \
9270 set open3 -DI_FCNTL && eval $compile; then
9271 h_fcntl=true;
9272 echo "<fcntl.h> defines the O_* constants..." >&4
9273 if ./open3; then
9274 echo "and you have the 3 argument form of open()." >&4
9275 val="$define"
9276 else
9277 echo "but not the 3 argument form of open(). Oh, well." >&4
9278 val="$undef"
9279 fi
9280else
9281 val="$undef"
9282 echo "I can't find the O_* constant definitions! You got problems." >&4
9283fi
9284set d_open3
9285eval $setvar
9286$rm -f open3*
9287
9288: see which of string.h or strings.h is needed
9289echo " "
9290strings=`./findhdr string.h`
9291if $test "$strings" && $test -r "$strings"; then
9292 echo "Using <string.h> instead of <strings.h>." >&4
9293 val="$define"
9294else
9295 val="$undef"
9296 strings=`./findhdr strings.h`
9297 if $test "$strings" && $test -r "$strings"; then
9298 echo "Using <strings.h> instead of <string.h>." >&4
9299 else
9300 echo "No string header found -- You'll surely have problems." >&4
9301 fi
9302fi
9303set i_string
9304eval $setvar
9305case "$i_string" in
9306"$undef") strings=`./findhdr strings.h`;;
9307*) strings=`./findhdr string.h`;;
9308esac
9309
9310: check for non-blocking I/O stuff
9311case "$h_sysfile" in
9312true) echo "#include <sys/file.h>" > head.c;;
9313*)
9314 case "$h_fcntl" in
9315 true) echo "#include <fcntl.h>" > head.c;;
9316 *) echo "#include <sys/fcntl.h>" > head.c;;
9317 esac
9318 ;;
9319esac
9320echo " "
9321echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
9322case "$o_nonblock" in
9323'')
9324 $cat head.c > try.c
9325 $cat >>try.c <<'EOCP'
9326#include <stdio.h>
9327int main() {
9328#ifdef O_NONBLOCK
9329 printf("O_NONBLOCK\n");
9330 exit(0);
9331#endif
9332#ifdef O_NDELAY
9333 printf("O_NDELAY\n");
9334 exit(0);
9335#endif
9336#ifdef FNDELAY
9337 printf("FNDELAY\n");
9338 exit(0);
9339#endif
9340 exit(0);
9341}
9342EOCP
9343 set try
9344 if eval $compile_ok; then
9345 o_nonblock=`./try`
9346 case "$o_nonblock" in
9347 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
9348 *) echo "Seems like we can use $o_nonblock.";;
9349 esac
9350 else
9351 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
9352 fi
9353 ;;
9354*) echo "Using $hint value $o_nonblock.";;
9355esac
9356$rm -f try try.* .out core
9357
9358echo " "
9359echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
9360case "$eagain" in
9361'')
9362 $cat head.c > try.c
9363 $cat >>try.c <<EOCP
9364#include <errno.h>
9365#include <sys/types.h>
9366#include <signal.h>
9367#include <stdio.h>
9368#define MY_O_NONBLOCK $o_nonblock
9369#ifndef errno /* XXX need better Configure test */
9370extern int errno;
9371#endif
9372#$i_unistd I_UNISTD
9373#ifdef I_UNISTD
9374#include <unistd.h>
9375#endif
9376#$i_string I_STRING
9377#ifdef I_STRING
9378#include <string.h>
9379#else
9380#include <strings.h>
9381#endif
9382$signal_t blech(x) int x; { exit(3); }
9383EOCP
9384 $cat >> try.c <<'EOCP'
9385int main()
9386{
9387 int pd[2];
9388 int pu[2];
9389 char buf[1];
9390 char string[100];
9391
9392 pipe(pd); /* Down: child -> parent */
9393 pipe(pu); /* Up: parent -> child */
9394 if (0 != fork()) {
9395 int ret;
9396 close(pd[1]); /* Parent reads from pd[0] */
9397 close(pu[0]); /* Parent writes (blocking) to pu[1] */
9398#ifdef F_SETFL
9399 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
9400 exit(1);
9401#else
9402 exit(4);
9403#endif
9404 signal(SIGALRM, blech);
9405 alarm(5);
9406 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
9407 exit(2);
9408 sprintf(string, "%d\n", ret);
9409 write(2, string, strlen(string));
9410 alarm(0);
9411#ifdef EAGAIN
9412 if (errno == EAGAIN) {
9413 printf("EAGAIN\n");
9414 goto ok;
9415 }
9416#endif
9417#ifdef EWOULDBLOCK
9418 if (errno == EWOULDBLOCK)
9419 printf("EWOULDBLOCK\n");
9420#endif
9421 ok:
9422 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
9423 sleep(2); /* Give it time to close our pipe */
9424 alarm(5);
9425 ret = read(pd[0], buf, 1); /* Should read EOF */
9426 alarm(0);
9427 sprintf(string, "%d\n", ret);
9428 write(3, string, strlen(string));
9429 exit(0);
9430 }
9431
9432 close(pd[0]); /* We write to pd[1] */
9433 close(pu[1]); /* We read from pu[0] */
9434 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
9435 close(pd[1]); /* Pipe pd is now fully closed! */
9436 exit(0); /* Bye bye, thank you for playing! */
9437}
9438EOCP
9439 set try
9440 if eval $compile_ok; then
9441 echo "$startsh" >mtry
9442 echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
9443 chmod +x mtry
9444 ./mtry >/dev/null 2>&1
9445 case $? in
9446 0) eagain=`$cat try.out`;;
9447 1) echo "Could not perform non-blocking setting!";;
9448 2) echo "I did a successful read() for something that was not there!";;
9449 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
9450 4) echo "Could not find F_SETFL!";;
9451 *) echo "Something terribly wrong happened during testing.";;
9452 esac
9453 rd_nodata=`$cat try.ret`
9454 echo "A read() system call with no data present returns $rd_nodata."
9455 case "$rd_nodata" in
9456 0|-1) ;;
9457 *)
9458 echo "(That's peculiar, fixing that to be -1.)"
9459 rd_nodata=-1
9460 ;;
9461 esac
9462 case "$eagain" in
9463 '')
9464 echo "Forcing errno EAGAIN on read() with no data available."
9465 eagain=EAGAIN
9466 ;;
9467 *)
9468 echo "Your read() sets errno to $eagain when no data is available."
9469 ;;
9470 esac
9471 status=`$cat try.err`
9472 case "$status" in
9473 0) echo "And it correctly returns 0 to signal EOF.";;
9474 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
9475 *) echo "However, your read() returns '$status' on EOF??";;
9476 esac
9477 val="$define"
9478 if test "$status" = "$rd_nodata"; then
9479 echo "WARNING: you can't distinguish between EOF and no data!"
9480 val="$undef"
9481 fi
9482 else
9483 echo "I can't compile the test program--assuming errno EAGAIN will do."
9484 eagain=EAGAIN
9485 fi
9486 set d_eofnblk
9487 eval $setvar
9488 ;;
9489*)
9490 echo "Using $hint value $eagain."
9491 echo "Your read() returns $rd_nodata when no data is present."
9492 case "$d_eofnblk" in
9493 "$define") echo "And you can see EOF because read() returns 0.";;
9494 "$undef") echo "But you can't see EOF status from read() returned value.";;
9495 *)
9496 echo "(Assuming you can't see EOF status from read anyway.)"
9497 d_eofnblk=$undef
9498 ;;
9499 esac
9500 ;;
9501esac
9502$rm -f try try.* .out core head.c mtry
9503
9504: see if fchmod exists
9505set fchmod d_fchmod
9506eval $inlibc
9507
9508: see if fchown exists
9509set fchown d_fchown
9510eval $inlibc
9511
9512: see if this is an fcntl system
9513set fcntl d_fcntl
9514eval $inlibc
9515
9516echo " "
9517: See if fcntl-based locking works.
9518$cat >try.c <<'EOCP'
9519#include <stdlib.h>
9520#include <unistd.h>
9521#include <fcntl.h>
9522int main() {
9523#if defined(F_SETLK) && defined(F_SETLKW)
9524 struct flock flock;
9525 int retval, fd;
9526 fd = open("try.c", O_RDONLY);
9527 flock.l_type = F_RDLCK;
9528 flock.l_whence = SEEK_SET;
9529 flock.l_start = flock.l_len = 0;
9530 retval = fcntl(fd, F_SETLK, &flock);
9531 close(fd);
9532 (retval < 0 ? exit(2) : exit(0));
9533#else
9534 exit(2);
9535#endif
9536}
9537EOCP
9538echo "Checking if fcntl-based file locking works... "
9539case "$d_fcntl" in
9540"$define")
9541 set try
9542 if eval $compile_ok; then
9543 if ./try; then
9544 echo "Yes, it seems to work."
9545 val="$define"
9546 else
9547 echo "Nope, it didn't work."
9548 val="$undef"
9549 fi
9550 else
9551 echo "I'm unable to compile the test program, so I'll assume not."
9552 val="$undef"
9553 fi
9554 ;;
9555*) val="$undef";
9556 echo "Nope, since you don't even have fcntl()."
9557 ;;
9558esac
9559set d_fcntl_can_lock
9560eval $setvar
9561$rm -f try*
9562
9563
9564: see if sys/select.h has to be included
9565set sys/select.h i_sysselct
9566eval $inhdr
9567
9568: see if we should include time.h, sys/time.h, or both
9569echo " "
9570if test "X$timeincl" = X; then
9571 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9572 $echo $n "I'm now running the test program...$c"
9573 $cat >try.c <<'EOCP'
9574#include <sys/types.h>
9575#ifdef I_TIME
9576#include <time.h>
9577#endif
9578#ifdef I_SYSTIME
9579#ifdef SYSTIMEKERNEL
9580#define KERNEL
9581#endif
9582#include <sys/time.h>
9583#endif
9584#ifdef I_SYSSELECT
9585#include <sys/select.h>
9586#endif
9587int main()
9588{
9589 struct tm foo;
9590#ifdef S_TIMEVAL
9591 struct timeval bar;
9592#endif
9593#ifdef S_TIMEZONE
9594 struct timezone tzp;
9595#endif
9596 if (foo.tm_sec == foo.tm_sec)
9597 exit(0);
9598#ifdef S_TIMEVAL
9599 if (bar.tv_sec == bar.tv_sec)
9600 exit(0);
9601#endif
9602 exit(1);
9603}
9604EOCP
9605 flags=''
9606 for s_timezone in '-DS_TIMEZONE' ''; do
9607 sysselect=''
9608 for s_timeval in '-DS_TIMEVAL' ''; do
9609 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9610 for i_time in '' '-DI_TIME'; do
9611 for i_systime in '-DI_SYSTIME' ''; do
9612 case "$flags" in
9613 '') $echo $n ".$c"
9614 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9615 if eval $compile; then
9616 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9617 shift
9618 flags="$*"
9619 echo " "
9620 $echo $n "Succeeded with $flags$c"
9621 fi
9622 ;;
9623 esac
9624 done
9625 done
9626 done
9627 done
9628 done
9629 timeincl=''
9630 echo " "
9631 case "$flags" in
9632 *SYSTIMEKERNEL*) i_systimek="$define"
9633 timeincl=`./findhdr sys/time.h`
9634 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9635 *) i_systimek="$undef";;
9636 esac
9637 case "$flags" in
9638 *I_TIME*) i_time="$define"
9639 timeincl=`./findhdr time.h`" $timeincl"
9640 echo "We'll include <time.h>." >&4;;
9641 *) i_time="$undef";;
9642 esac
9643 case "$flags" in
9644 *I_SYSTIME*) i_systime="$define"
9645 timeincl=`./findhdr sys/time.h`" $timeincl"
9646 echo "We'll include <sys/time.h>." >&4;;
9647 *) i_systime="$undef";;
9648 esac
9649 $rm -f try.c try
9650fi
9651
9652: check for fd_set items
9653$cat <<EOM
9654
9655Checking to see how well your C compiler handles fd_set and friends ...
9656EOM
9657$cat >fd_set.c <<EOCP
9658#$i_systime I_SYS_TIME
9659#$i_sysselct I_SYS_SELECT
9660#$d_socket HAS_SOCKET
9661#include <sys/types.h>
9662#ifdef HAS_SOCKET
9663#include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
9664#endif
9665#ifdef I_SYS_TIME
9666#include <sys/time.h>
9667#endif
9668#ifdef I_SYS_SELECT
9669#include <sys/select.h>
9670#endif
9671int main() {
9672 fd_set fds;
9673
9674#ifdef TRYBITS
9675 if(fds.fds_bits);
9676#endif
9677
9678#if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
9679 exit(0);
9680#else
9681 exit(1);
9682#endif
9683}
9684EOCP
9685set fd_set -DTRYBITS
9686if eval $compile; then
9687 d_fds_bits="$define"
9688 d_fd_set="$define"
9689 echo "Well, your system knows about the normal fd_set typedef..." >&4
9690 if ./fd_set; then
9691 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
9692 d_fd_macros="$define"
9693 else
9694 $cat >&4 <<'EOM'
9695but not the normal fd_set macros! Gaaack! I'll have to cover for you.
9696EOM
9697 d_fd_macros="$undef"
9698 fi
9699else
9700 $cat <<'EOM'
9701Hmm, your compiler has some difficulty with fd_set. Checking further...
9702EOM
9703 set fd_set
9704 if eval $compile; then
9705 d_fds_bits="$undef"
9706 d_fd_set="$define"
9707 echo "Well, your system has some sort of fd_set available..." >&4
9708 if ./fd_set; then
9709 echo "and you have the normal fd_set macros." >&4
9710 d_fd_macros="$define"
9711 else
9712 $cat <<'EOM'
9713but not the normal fd_set macros! Gross! More work for me...
9714EOM
9715 d_fd_macros="$undef"
9716 fi
9717 else
9718 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
9719 d_fd_set="$undef"
9720 d_fds_bits="$undef"
9721 d_fd_macros="$undef"
9722 fi
9723fi
9724$rm -f fd_set*
9725
9726: see if fgetpos exists
9727set fgetpos d_fgetpos
9728eval $inlibc
9729
9730: see if flock exists
9731set flock d_flock
9732eval $inlibc
9733
9734: see if fork exists
9735set fork d_fork
9736eval $inlibc
9737
9738: see if pathconf exists
9739set pathconf d_pathconf
9740eval $inlibc
9741
9742: see if fpathconf exists
9743set fpathconf d_fpathconf
9744eval $inlibc
9745
9746
9747: check for fpos64_t
9748echo " "
9749echo "Checking to see if you have fpos64_t..." >&4
9750$cat >try.c <<EOCP
9751#include <stdio.h>
9752int main() { fpos64_t x = 7; }
9753EOCP
9754set try
9755if eval $compile; then
9756 val="$define"
9757 echo "You have fpos64_t."
9758else
9759 val="$undef"
9760 echo "You do not have fpos64_t."
9761 case "$fpossize" in
9762 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
9763 esac
9764fi
9765$rm -f try.* try
9766set d_fpos64_t
9767eval $setvar
9768
9769: see if frexpl exists
9770set frexpl d_frexpl
9771eval $inlibc
9772
9773: see if this is a sys/param system
9774set sys/param.h i_sysparam
9775eval $inhdr
9776
9777: see if this is a sys/mount.h system
9778set sys/mount.h i_sysmount
9779eval $inhdr
9780
9781
9782echo " "
9783echo "Checking to see if your system supports struct fs_data..." >&4
9784set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
9785eval $hasstruct
9786case "$d_fs_data_s" in
9787"$define") echo "Yes, it does." ;;
9788*) echo "No, it doesn't." ;;
9789esac
9790
9791: see if fseeko exists
9792set fseeko d_fseeko
9793eval $inlibc
9794case "$longsize" in
97958) echo "(Your long is 64 bits, so you could use fseek.)" ;;
9796esac
9797
9798: see if fsetpos exists
9799set fsetpos d_fsetpos
9800eval $inlibc
9801
9802
9803: see if fstatfs exists
9804set fstatfs d_fstatfs
9805eval $inlibc
9806
9807
9808: see if statvfs exists
9809set statvfs d_statvfs
9810eval $inlibc
9811
9812: see if fstatvfs exists
9813set fstatvfs d_fstatvfs
9814eval $inlibc
9815
9816
9817: see if fsync exists
9818set fsync d_fsync
9819eval $inlibc
9820
9821: see if ftello exists
9822set ftello d_ftello
9823eval $inlibc
9824case "$longsize" in
98258) echo "(Your long is 64 bits, so you could use ftell.)" ;;
9826esac
9827
9828: see if getcwd exists
9829set getcwd d_getcwd
9830eval $inlibc
9831
9832: see if getespwnam exists
9833set getespwnam d_getespwnam
9834eval $inlibc
9835
9836
9837: see if getfsstat exists
9838set getfsstat d_getfsstat
9839eval $inlibc
9840
9841: see if getgrent exists
9842set getgrent d_getgrent
9843eval $inlibc
9844
9845: see if gethostbyaddr exists
9846set gethostbyaddr d_gethbyaddr
9847eval $inlibc
9848
9849: see if gethostbyname exists
9850set gethostbyname d_gethbyname
9851eval $inlibc
9852
9853: see if gethostent exists
9854set gethostent d_gethent
9855eval $inlibc
9856
9857: see how we will look up host name
9858echo " "
9859call=''
9860if set gethostname val -f d_gethname; eval $csym; $val; then
9861 echo 'gethostname() found.' >&4
9862 d_gethname="$define"
9863 call=gethostname
9864fi
9865if set uname val -f d_uname; eval $csym; $val; then
9866 if ./xenix; then
9867 $cat <<'EOM'
9868uname() was found, but you're running xenix, and older versions of xenix
9869have a broken uname(). If you don't really know whether your xenix is old
9870enough to have a broken system call, use the default answer.
9871
9872EOM
9873 dflt=y
9874 case "$d_uname" in
9875 "$define") dflt=n;;
9876 esac
9877 rp='Is your uname() broken?'
9878 . ./myread
9879 case "$ans" in
9880 n*) d_uname="$define"; call=uname;;
9881 esac
9882 else
9883 echo 'uname() found.' >&4
9884 d_uname="$define"
9885 case "$call" in
9886 '') call=uname ;;
9887 esac
9888 fi
9889fi
9890case "$d_gethname" in
9891'') d_gethname="$undef";;
9892esac
9893case "$d_uname" in
9894'') d_uname="$undef";;
9895esac
9896case "$d_uname$d_gethname" in
9897*define*)
9898 dflt=n
9899 cat <<EOM
9900
9901Every now and then someone has a $call() that lies about the hostname
9902but can't be fixed for political or economic reasons. If you wish, I can
9903pretend $call() isn't there and maybe compute hostname at run-time
9904thanks to the '$phostname' command.
9905
9906EOM
9907 rp="Shall I ignore $call() from now on?"
9908 . ./myread
9909 case "$ans" in
9910 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
9911 esac;;
9912esac
9913case "$phostname" in
9914'') aphostname='';;
9915*) case "$aphostname" in
9916 /*) ;;
9917 *) set X $phostname
9918 shift
9919 file=$1
9920 shift
9921 file=`./loc $file $file $pth`
9922 aphostname=`echo $file $*`
9923 ;;
9924 esac
9925 ;;
9926esac
9927case "$d_uname$d_gethname" in
9928*define*) ;;
9929*)
9930 case "$phostname" in
9931 '')
9932 echo "There will be no way for $package to get your hostname." >&4;;
9933 *)
9934 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
9935 ;;
9936 esac;;
9937esac
9938case "$d_phostname" in
9939'') d_phostname="$undef";;
9940esac
9941
9942: see if this is a netdb.h system
9943set netdb.h i_netdb
9944eval $inhdr
9945
9946: see if prototypes for various gethostxxx netdb.h functions are available
9947echo " "
9948set d_gethostprotos gethostent $i_netdb netdb.h
9949eval $hasproto
9950
9951: see if getitimer exists
9952set getitimer d_getitimer
9953eval $inlibc
9954
9955: see if getlogin exists
9956set getlogin d_getlogin
9957eval $inlibc
9958
9959: see if getmnt exists
9960set getmnt d_getmnt
9961eval $inlibc
9962
9963: see if getmntent exists
9964set getmntent d_getmntent
9965eval $inlibc
9966
9967: see if getnetbyaddr exists
9968set getnetbyaddr d_getnbyaddr
9969eval $inlibc
9970
9971: see if getnetbyname exists
9972set getnetbyname d_getnbyname
9973eval $inlibc
9974
9975: see if getnetent exists
9976set getnetent d_getnent
9977eval $inlibc
9978
9979: see if prototypes for various getnetxxx netdb.h functions are available
9980echo " "
9981set d_getnetprotos getnetent $i_netdb netdb.h
9982eval $hasproto
9983
9984: see if getpagesize exists
9985set getpagesize d_getpagsz
9986eval $inlibc
9987
9988
9989: see if getprotobyname exists
9990set getprotobyname d_getpbyname
9991eval $inlibc
9992
9993: see if getprotobynumber exists
9994set getprotobynumber d_getpbynumber
9995eval $inlibc
9996
9997: see if getprotoent exists
9998set getprotoent d_getpent
9999eval $inlibc
10000
10001: see if getpgid exists
10002set getpgid d_getpgid
10003eval $inlibc
10004
10005: see if getpgrp2 exists
10006set getpgrp2 d_getpgrp2
10007eval $inlibc
10008
10009: see if getppid exists
10010set getppid d_getppid
10011eval $inlibc
10012
10013: see if getpriority exists
10014set getpriority d_getprior
10015eval $inlibc
10016
10017: see if prototypes for various getprotoxxx netdb.h functions are available
10018echo " "
10019set d_getprotoprotos getprotoent $i_netdb netdb.h
10020eval $hasproto
10021
10022: see if getprpwnam exists
10023set getprpwnam d_getprpwnam
10024eval $inlibc
10025
10026: see if getpwent exists
10027set getpwent d_getpwent
10028eval $inlibc
10029
10030
10031: see if getservbyname exists
10032set getservbyname d_getsbyname
10033eval $inlibc
10034
10035: see if getservbyport exists
10036set getservbyport d_getsbyport
10037eval $inlibc
10038
10039: see if getservent exists
10040set getservent d_getsent
10041eval $inlibc
10042
10043: see if prototypes for various getservxxx netdb.h functions are available
10044echo " "
10045set d_getservprotos getservent $i_netdb netdb.h
10046eval $hasproto
10047
10048: see if getspnam exists
10049set getspnam d_getspnam
10050eval $inlibc
10051
10052: see if gettimeofday or ftime exists
10053set gettimeofday d_gettimeod
10054eval $inlibc
10055case "$d_gettimeod" in
10056"$undef")
10057 set ftime d_ftime
10058 eval $inlibc
10059 ;;
10060*)
10061 val="$undef"; set d_ftime; eval $setvar
10062 ;;
10063esac
10064case "$d_gettimeod$d_ftime" in
10065"$undef$undef")
10066 echo " "
10067 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
10068 ;;
10069esac
10070
10071: see if this is an grp system
10072set grp.h i_grp
10073eval $inhdr
10074
10075case "$i_grp" in
10076$define)
10077 xxx=`./findhdr grp.h`
10078 $cppstdin $cppflags $cppminus < $xxx >$$.h
10079
10080 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10081 val="$define"
10082 else
10083 val="$undef"
10084 fi
10085 set d_grpasswd
10086 eval $setvar
10087
10088 $rm -f $$.h
10089 ;;
10090*)
10091 val="$undef";
10092 set d_grpasswd; eval $setvar
10093 ;;
10094esac
10095
10096: see if hasmntopt exists
10097set hasmntopt d_hasmntopt
10098eval $inlibc
10099
10100: see if this is a netinet/in.h or sys/in.h system
10101set netinet/in.h i_niin sys/in.h i_sysin
10102eval $inhdr
10103
10104: see if arpa/inet.h has to be included
10105set arpa/inet.h i_arpainet
10106eval $inhdr
10107
10108: see if htonl --and friends-- exists
10109val=''
10110set htonl val
10111eval $inlibc
10112
10113: Maybe they are macros.
10114case "$val" in
10115$undef)
10116 $cat >htonl.c <<EOM
10117#include <stdio.h>
10118#include <sys/types.h>
10119#$i_niin I_NETINET_IN
10120#$i_sysin I_SYS_IN
10121#$i_arpainet I_ARPA_INET
10122#ifdef I_NETINET_IN
10123#include <netinet/in.h>
10124#endif
10125#ifdef I_SYS_IN
10126#include <sys/in.h>
10127#endif
10128#ifdef I_ARPA_INET
10129#include <arpa/inet.h>
10130#endif
10131#ifdef htonl
10132printf("Defined as a macro.");
10133#endif
10134EOM
10135 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
10136 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
10137 val="$define"
10138 echo "But it seems to be defined as a macro." >&4
10139 fi
10140 $rm -f htonl.?
10141 ;;
10142esac
10143set d_htonl
10144eval $setvar
10145
10146: see if iconv exists
10147set iconv d_iconv
10148eval $inlibc
10149
10150: index or strchr
10151echo " "
10152if set index val -f; eval $csym; $val; then
10153 if set strchr val -f d_strchr; eval $csym; $val; then
10154 if $contains strchr "$strings" >/dev/null 2>&1 ; then
10155 val="$define"
10156 vali="$undef"
10157 echo "strchr() found." >&4
10158 else
10159 val="$undef"
10160 vali="$define"
10161 echo "index() found." >&4
10162 fi
10163 else
10164 val="$undef"
10165 vali="$define"
10166 echo "index() found." >&4
10167 fi
10168else
10169 if set strchr val -f d_strchr; eval $csym; $val; then
10170 val="$define"
10171 vali="$undef"
10172 echo "strchr() found." >&4
10173 else
10174 echo "No index() or strchr() found!" >&4
10175 val="$undef"
10176 vali="$undef"
10177 fi
10178fi
10179set d_strchr; eval $setvar
10180val="$vali"
10181set d_index; eval $setvar
10182
10183: check whether inet_aton exists
10184set inet_aton d_inetaton
10185eval $inlibc
10186
10187: Look for isascii
10188echo " "
10189$cat >isascii.c <<'EOCP'
10190#include <stdio.h>
10191#include <ctype.h>
10192int main() {
10193 int c = 'A';
10194 if (isascii(c))
10195 exit(0);
10196 else
10197 exit(1);
10198}
10199EOCP
10200set isascii
10201if eval $compile; then
10202 echo "isascii() found." >&4
10203 val="$define"
10204else
10205 echo "isascii() NOT found." >&4
10206 val="$undef"
10207fi
10208set d_isascii
10209eval $setvar
10210$rm -f isascii*
10211
10212: see if isnan exists
10213set isnan d_isnan
10214eval $inlibc
10215
10216: see if isnanl exists
10217set isnanl d_isnanl
10218eval $inlibc
10219
10220: see if killpg exists
10221set killpg d_killpg
10222eval $inlibc
10223
10224: see if lchown exists
10225echo " "
10226$cat > try.c <<'EOCP'
10227/* System header to define __stub macros and hopefully few prototypes,
10228 which can conflict with char lchown(); below. */
10229#include <assert.h>
10230/* Override any gcc2 internal prototype to avoid an error. */
10231/* We use char because int might match the return type of a gcc2
10232 builtin and then its argument prototype would still apply. */
10233char lchown();
10234int main() {
10235 /* The GNU C library defines this for functions which it implements
10236 to always fail with ENOSYS. Some functions are actually named
10237 something starting with __ and the normal name is an alias. */
10238#if defined (__stub_lchown) || defined (__stub___lchown)
10239choke me
10240#else
10241lchown();
10242#endif
10243; return 0; }
10244EOCP
10245set try
10246if eval $compile; then
10247 $echo "lchown() found." >&4
10248 val="$define"
10249else
10250 $echo "lchown() NOT found." >&4
10251 val="$undef"
10252fi
10253set d_lchown
10254eval $setvar
10255
10256: See if number of significant digits in a double precision number is known
10257echo " "
10258$cat >ldbl_dig.c <<EOM
10259#$i_limits I_LIMITS
10260#$i_float I_FLOAT
10261#ifdef I_LIMITS
10262#include <limits.h>
10263#endif
10264#ifdef I_FLOAT
10265#include <float.h>
10266#endif
10267#ifdef LDBL_DIG
10268printf("Contains LDBL_DIG");
10269#endif
10270EOM
10271$cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
10272if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
10273 echo "LDBL_DIG found." >&4
10274 val="$define"
10275else
10276 echo "LDBL_DIG NOT found." >&4
10277 val="$undef"
10278fi
10279$rm -f ldbl_dig.?
10280set d_ldbl_dig
10281eval $setvar
10282
10283: see if link exists
10284set link d_link
10285eval $inlibc
10286
10287: see if localeconv exists
10288set localeconv d_locconv
10289eval $inlibc
10290
10291: see if lockf exists
10292set lockf d_lockf
10293eval $inlibc
10294
10295: see if prototype for lseek is available
10296echo " "
10297set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
10298eval $hasproto
10299
10300: see if lstat exists
10301set lstat d_lstat
10302eval $inlibc
10303
10304: see if madvise exists
10305set madvise d_madvise
10306eval $inlibc
10307
10308: see if mblen exists
10309set mblen d_mblen
10310eval $inlibc
10311
10312: see if mbstowcs exists
10313set mbstowcs d_mbstowcs
10314eval $inlibc
10315
10316: see if mbtowc exists
10317set mbtowc d_mbtowc
10318eval $inlibc
10319
10320: see if memchr exists
10321set memchr d_memchr
10322eval $inlibc
10323
10324: see if memcmp exists
10325set memcmp d_memcmp
10326eval $inlibc
10327
10328: see if memcpy exists
10329set memcpy d_memcpy
10330eval $inlibc
10331
10332: see if memmove exists
10333set memmove d_memmove
10334eval $inlibc
10335
10336: see if memset exists
10337set memset d_memset
10338eval $inlibc
10339
10340: see if mkdir exists
10341set mkdir d_mkdir
10342eval $inlibc
10343
10344: see if mkdtemp exists
10345set mkdtemp d_mkdtemp
10346eval $inlibc
10347
10348: see if mkfifo exists
10349set mkfifo d_mkfifo
10350eval $inlibc
10351
10352: see if mkstemp exists
10353set mkstemp d_mkstemp
10354eval $inlibc
10355
10356: see if mkstemps exists
10357set mkstemps d_mkstemps
10358eval $inlibc
10359
10360: see if mktime exists
10361set mktime d_mktime
10362eval $inlibc
10363
10364: see if this is a sys/mman.h system
10365set sys/mman.h i_sysmman
10366eval $inhdr
10367
10368: see if mmap exists
10369set mmap d_mmap
10370eval $inlibc
10371: see what shmat returns
10372: default to something harmless
10373mmaptype='void *'
10374case "$i_sysmman$d_mmap" in
10375"$define$define")
10376 $cat >mmap.c <<'END'
10377#include <sys/mman.h>
10378void *mmap();
10379END
10380 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
10381 mmaptype='void *'
10382 else
10383 mmaptype='caddr_t'
10384 fi
10385 echo "and it returns ($mmaptype)." >&4
10386 ;;
10387esac
10388
10389
10390
10391: see if modfl exists
10392set modfl d_modfl
10393eval $inlibc
10394
10395: see if mprotect exists
10396set mprotect d_mprotect
10397eval $inlibc
10398
10399: see if msgctl exists
10400set msgctl d_msgctl
10401eval $inlibc
10402
10403: see if msgget exists
10404set msgget d_msgget
10405eval $inlibc
10406
10407: see if msgsnd exists
10408set msgsnd d_msgsnd
10409eval $inlibc
10410
10411: see if msgrcv exists
10412set msgrcv d_msgrcv
10413eval $inlibc
10414
10415: see how much of the 'msg*(2)' library is present.
10416h_msg=true
10417echo " "
10418case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
10419*"$undef"*) h_msg=false;;
10420esac
10421case "$osname" in
10422freebsd)
10423 case "`ipcs 2>&1`" in
10424 "SVID messages"*"not configured"*)
10425 echo "Your $osname does not have the msg*(2) configured." >&4
10426 h_msg=false
10427 val="$undef"
10428 set msgctl d_msgctl
10429 eval $setvar
10430 set msgget d_msgget
10431 eval $setvar
10432 set msgsnd d_msgsnd
10433 eval $setvar
10434 set msgrcv d_msgrcv
10435 eval $setvar
10436 ;;
10437 esac
10438 ;;
10439esac
10440: we could also check for sys/ipc.h ...
10441if $h_msg && $test `./findhdr sys/msg.h`; then
10442 echo "You have the full msg*(2) library." >&4
10443 val="$define"
10444else
10445 echo "You don't have the full msg*(2) library." >&4
10446 val="$undef"
10447fi
10448set d_msg
10449eval $setvar
10450
10451
10452echo " "
10453echo "Checking to see if your system supports struct msghdr..." >&4
10454set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10455eval $hasstruct
10456case "$d_msghdr_s" in
10457"$define") echo "Yes, it does." ;;
10458*) echo "No, it doesn't." ;;
10459esac
10460
10461
10462: see if msync exists
10463set msync d_msync
10464eval $inlibc
10465
10466: see if munmap exists
10467set munmap d_munmap
10468eval $inlibc
10469
10470: see if nice exists
10471set nice d_nice
10472eval $inlibc
10473
10474: check for length of character
10475echo " "
10476case "$charsize" in
10477'')
10478 echo "Checking to see how big your characters are (hey, you never know)..." >&4
10479 $cat >try.c <<'EOCP'
10480#include <stdio.h>
10481int main()
10482{
10483 printf("%d\n", (int)sizeof(char));
10484 exit(0);
10485}
10486EOCP
10487 set try
10488 if eval $compile_ok; then
10489 dflt=`./try`
10490 else
10491 dflt='1'
10492 echo "(I can't seem to compile the test program. Guessing...)"
10493 fi
10494 ;;
10495*)
10496 dflt="$charsize"
10497 ;;
10498esac
10499rp="What is the size of a character (in bytes)?"
10500. ./myread
10501charsize="$ans"
10502$rm -f try.c try
10503
10504: check for volatile keyword
10505echo " "
10506echo 'Checking to see if your C compiler knows about "volatile"...' >&4
10507$cat >try.c <<'EOCP'
10508int main()
10509{
10510 typedef struct _goo_struct goo_struct;
10511 goo_struct * volatile goo = ((goo_struct *)0);
10512 struct _goo_struct {
10513 long long_int;
10514 int reg_int;
10515 char char_var;
10516 };
10517 typedef unsigned short foo_t;
10518 char *volatile foo;
10519 volatile int bar;
10520 volatile foo_t blech;
10521 foo = foo;
10522}
10523EOCP
10524if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
10525 val="$define"
10526 echo "Yup, it does."
10527else
10528 val="$undef"
10529 echo "Nope, it doesn't."
10530fi
10531set d_volatile
10532eval $setvar
10533$rm -f try.*
10534
10535
10536echo " "
10537$echo "Choosing the C types to be used for Perl's internal types..." >&4
10538
10539case "$use64bitint:$d_quad:$quadtype" in
10540define:define:?*)
10541 ivtype="$quadtype"
10542 uvtype="$uquadtype"
10543 ivsize=8
10544 uvsize=8
10545 ;;
10546*) ivtype="long"
10547 uvtype="unsigned long"
10548 ivsize=$longsize
10549 uvsize=$longsize
10550 ;;
10551esac
10552
10553case "$uselongdouble:$d_longdbl" in
10554define:define)
10555 nvtype="long double"
10556 nvsize=$longdblsize
10557 ;;
10558*) nvtype=double
10559 nvsize=$doublesize
10560 ;;
10561esac
10562
10563$echo "(IV will be "$ivtype", $ivsize bytes)"
10564$echo "(UV will be "$uvtype", $uvsize bytes)"
10565$echo "(NV will be "$nvtype", $nvsize bytes)"
10566
10567$cat >try.c <<EOCP
10568#$i_inttypes I_INTTYPES
10569#ifdef I_INTTYPES
10570#include <inttypes.h>
10571#endif
10572#include <stdio.h>
10573int main() {
10574#ifdef INT8
10575 int8_t i = INT8_MAX;
10576 uint8_t u = UINT8_MAX;
10577 printf("int8_t\n");
10578#endif
10579#ifdef INT16
10580 int16_t i = INT16_MAX;
10581 uint16_t i = UINT16_MAX;
10582 printf("int16_t\n");
10583#endif
10584#ifdef INT32
10585 int32_t i = INT32_MAX;
10586 uint32_t u = UINT32_MAX;
10587 printf("int32_t\n");
10588#endif
10589}
10590EOCP
10591
10592case "$i8type" in
10593'') case "$charsize" in
10594 1) i8type=char
10595 u8type="unsigned char"
10596 i8size=$charsize
10597 u8size=$charsize
10598 ;;
10599 esac
10600 ;;
10601esac
10602case "$i8type" in
10603'') set try -DINT8
10604 if eval $compile; then
10605 case "`./try$exe_ext`" in
10606 int8_t) i8type=int8_t
10607 u8type=uint8_t
10608 i8size=1
10609 u8size=1
10610 ;;
10611 esac
10612 fi
10613 ;;
10614esac
10615case "$i8type" in
10616'') if $test $charsize -ge 1; then
10617 i8type=char
10618 u8type="unsigned char"
10619 i8size=$charsize
10620 u8size=$charsize
10621 fi
10622 ;;
10623esac
10624
10625case "$i16type" in
10626'') case "$shortsize" in
10627 2) i16type=short
10628 u16type="unsigned short"
10629 i16size=$shortsize
10630 u16size=$shortsize
10631 ;;
10632 esac
10633 ;;
10634esac
10635case "$i16type" in
10636'') set try -DINT16
10637 if eval $compile; then
10638 case "`./try$exe_ext`" in
10639 int16_t)
10640 i16type=int16_t
10641 u16type=uint16_t
10642 i16size=2
10643 u16size=2
10644 ;;
10645 esac
10646 fi
10647 ;;
10648esac
10649case "$i16type" in
10650'') if $test $shortsize -ge 2; then
10651 i16type=short
10652 u16type="unsigned short"
10653 i16size=$shortsize
10654 u16size=$shortsize
10655 fi
10656 ;;
10657esac
10658
10659case "$i32type" in
10660'') case "$longsize" in
10661 4) i32type=long
10662 u32type="unsigned long"
10663 i32size=$longsize
10664 u32size=$longsize
10665 ;;
10666 *) case "$intsize" in
10667 4) i32type=int
10668 u32type="unsigned int"
10669 i32size=$intsize
10670 u32size=$intsize
10671 ;;
10672 esac
10673 ;;
10674 esac
10675 ;;
10676esac
10677case "$i32type" in
10678'') set try -DINT32
10679 if eval $compile; then
10680 case "`./try$exe_ext`" in
10681 int32_t)
10682 i32type=int32_t
10683 u32type=uint32_t
10684 i32size=4
10685 u32size=4
10686 ;;
10687 esac
10688 fi
10689 ;;
10690esac
10691case "$i32type" in
10692'') if $test $intsize -ge 4; then
10693 i32type=int
10694 u32type="unsigned int"
10695 i32size=$intsize
10696 u32size=$intsize
10697 fi
10698 ;;
10699esac
10700
10701case "$i64type" in
10702'') case "$d_quad:$quadtype" in
10703 define:?*)
10704 i64type="$quadtype"
10705 u64type="$uquadtype"
10706 i64size=8
10707 u64size=8
10708 ;;
10709 esac
10710 ;;
10711esac
10712
10713$echo "Checking how many bits of your UVs your NVs can preserve..." >&4
10714: volatile so that the compiler has to store it out to memory.
10715if test X"$d_volatile" = X"$define"; then
10716 volatile=volatile
10717fi
10718$cat <<EOP >try.c
10719#include <stdio.h>
10720#include <sys/types.h>
10721#include <signal.h>
10722#ifdef SIGFPE
10723$volatile int bletched = 0;
10724$signal_t blech(s) int s; { bletched = 1; }
10725#endif
10726int main() {
10727 $uvtype u = 0;
10728 $nvtype d;
10729 int n = 8 * $uvsize;
10730 int i;
10731#ifdef SIGFPE
10732 signal(SIGFPE, blech);
10733#endif
10734
10735 for (i = 0; i < n; i++) {
10736 u = u << 1 | ($uvtype)1;
10737 d = ($nvtype)u;
10738 if (($uvtype)d != u)
10739 break;
10740 if (d <= 0)
10741 break;
10742 d = ($nvtype)(u - 1);
10743 if (($uvtype)d != (u - 1))
10744 break;
10745#ifdef SIGFPE
10746 if (bletched) {
10747 break;
10748#endif
10749 }
10750 }
10751 printf("%d\n", ((i == n) ? -n : i));
10752 exit(0);
10753}
10754EOP
10755set try
10756
10757d_nv_preserves_uv="$undef"
10758if eval $compile; then
10759 d_nv_preserves_uv_bits="`./try$exe_ext`"
10760fi
10761case "$d_nv_preserves_uv_bits" in
10762\-[1-9]*)
10763 d_nv_preserves_uv_bits=`expr 0 - $d_nv_preserves_uv_bits`
10764 $echo "Your NVs can preserve all $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10765 d_nv_preserves_uv="$define"
10766 ;;
10767[1-9]*) $echo "Your NVs can preserve only $d_nv_preserves_uv_bits bits of your UVs." 2>&1
10768 d_nv_preserves_uv="$undef" ;;
10769*) $echo "Can't figure out how many bits your NVs preserve." 2>&1
10770 d_nv_preserves_uv_bits="$undef" ;;
10771esac
10772
10773$rm -f try.* try
10774
10775
10776: check for off64_t
10777echo " "
10778echo "Checking to see if you have off64_t..." >&4
10779$cat >try.c <<EOCP
10780#include <sys/types.h>
10781#include <unistd.h>
10782int main() { off64_t x = 7; }
10783EOCP
10784set try
10785if eval $compile; then
10786 val="$define"
10787 echo "You have off64_t."
10788else
10789 val="$undef"
10790 echo "You do not have off64_t."
10791 case "$lseeksize" in
10792 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
10793 esac
10794fi
10795$rm -f try.* try
10796set d_off64_t
10797eval $setvar
10798
10799: see if POSIX threads are available
10800set pthread.h i_pthread
10801eval $inhdr
10802
10803
10804
10805
10806: how to create joinable pthreads
10807if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
10808 echo " "
10809 echo "Checking what constant to use for creating joinable pthreads..." >&4
10810 $cat >try.c <<'EOCP'
10811#include <pthread.h>
10812int main() {
10813 int detachstate = JOINABLE;
10814}
10815EOCP
10816 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
10817 if eval $compile; then
10818 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
10819 val="$undef" # Yes, undef.
10820 set d_old_pthread_create_joinable
10821 eval $setvar
10822 val=""
10823 set old_pthread_create_joinable
10824 eval $setvar
10825 else
10826 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
10827 if eval $compile; then
10828 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
10829 val="$define"
10830 set d_old_pthread_create_joinable
10831 eval $setvar
10832 val=PTHREAD_CREATE_UNDETACHED
10833 set old_pthread_create_joinable
10834 eval $setvar
10835 else
10836 set try -DJOINABLE=__UNDETACHED
10837 if eval $compile; then
10838 echo "You seem to use __UNDETACHED." >&4
10839 val="$define"
10840 set d_old_pthread_create_joinable
10841 eval $setvar
10842 val=__UNDETACHED
10843 set old_pthread_create_joinable
10844 eval $setvar
10845 else
10846 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
10847 val="$define"
10848 set d_old_pthread_create_joinable
10849 eval $setvar
10850 val=0
10851 set old_pthread_create_joinable
10852 eval $setvar
10853 fi
10854 fi
10855 fi
10856 $rm -f try try.*
10857else
10858 d_old_pthread_create_joinable="$undef"
10859 old_pthread_create_joinable=""
10860fi
10861
10862: see if pause exists
10863set pause d_pause
10864eval $inlibc
10865
10866: see if pipe exists
10867set pipe d_pipe
10868eval $inlibc
10869
10870: see if poll exists
10871set poll d_poll
10872eval $inlibc
10873
10874
10875: see whether the various POSIXish _yields exist
10876$cat >try.c <<EOP
10877#include <pthread.h>
10878#include <stdio.h>
10879int main() {
10880#ifdef SCHED_YIELD
10881 sched_yield();
10882#else
10883#ifdef PTHREAD_YIELD
10884 pthread_yield();
10885#else
10886#ifdef PTHREAD_YIELD_NULL
10887 pthread_yield(NULL);
10888#endif
10889#endif
10890#endif
10891}
10892EOP
10893: see if sched_yield exists
10894set try -DSCHED_YIELD
10895if eval $compile; then
10896 val="$define"
10897 sched_yield='sched_yield()'
10898else
10899 val="$undef"
10900fi
10901case "$usethreads" in
10902$define)
10903 case "$val" in
10904 $define) echo 'sched_yield() found.' >&4 ;;
10905 *) echo 'sched_yield() NOT found.' >&4 ;;
10906 esac
10907esac
10908set d_sched_yield
10909eval $setvar
10910
10911: see if pthread_yield exists
10912set try -DPTHREAD_YIELD
10913if eval $compile; then
10914 val="$define"
10915 case "$sched_yield" in
10916 '') sched_yield='pthread_yield()' ;;
10917 esac
10918else
10919 set try -DPTHREAD_YIELD_NULL
10920 if eval $compile; then
10921 val="$define"
10922 case "$sched_yield" in
10923 '') sched_yield='pthread_yield(NULL)' ;;
10924 esac
10925 else
10926 val="$undef"
10927 fi
10928fi
10929case "$usethreads" in
10930$define)
10931 case "$val" in
10932 $define) echo 'pthread_yield() found.' >&4 ;;
10933 *) echo 'pthread_yield() NOT found.' >&4 ;;
10934 esac
10935 ;;
10936esac
10937set d_pthread_yield
10938eval $setvar
10939
10940case "$sched_yield" in
10941'') sched_yield=undef ;;
10942esac
10943
10944$rm -f try try.*
10945
10946: see if this is a pwd.h system
10947set pwd.h i_pwd
10948eval $inhdr
10949
10950case "$i_pwd" in
10951$define)
10952 xxx=`./findhdr pwd.h`
10953 $cppstdin $cppflags $cppminus < $xxx >$$.h
10954
10955 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10956 val="$define"
10957 else
10958 val="$undef"
10959 fi
10960 set d_pwquota
10961 eval $setvar
10962
10963 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10964 val="$define"
10965 else
10966 val="$undef"
10967 fi
10968 set d_pwage
10969 eval $setvar
10970
10971 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10972 val="$define"
10973 else
10974 val="$undef"
10975 fi
10976 set d_pwchange
10977 eval $setvar
10978
10979 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10980 val="$define"
10981 else
10982 val="$undef"
10983 fi
10984 set d_pwclass
10985 eval $setvar
10986
10987 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10988 val="$define"
10989 else
10990 val="$undef"
10991 fi
10992 set d_pwexpire
10993 eval $setvar
10994
10995 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10996 val="$define"
10997 else
10998 val="$undef"
10999 fi
11000 set d_pwcomment
11001 eval $setvar
11002
11003 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11004 val="$define"
11005 else
11006 val="$undef"
11007 fi
11008 set d_pwgecos
11009 eval $setvar
11010
11011 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11012 val="$define"
11013 else
11014 val="$undef"
11015 fi
11016 set d_pwpasswd
11017 eval $setvar
11018
11019 $rm -f $$.h
11020 ;;
11021*)
11022 val="$undef";
11023 set d_pwquota; eval $setvar
11024 set d_pwage; eval $setvar
11025 set d_pwchange; eval $setvar
11026 set d_pwclass; eval $setvar
11027 set d_pwexpire; eval $setvar
11028 set d_pwcomment; eval $setvar
11029 set d_pwgecos; eval $setvar
11030 set d_pwpasswd; eval $setvar
11031 ;;
11032esac
11033
11034: see if readdir and friends exist
11035set readdir d_readdir
11036eval $inlibc
11037set seekdir d_seekdir
11038eval $inlibc
11039set telldir d_telldir
11040eval $inlibc
11041set rewinddir d_rewinddir
11042eval $inlibc
11043
11044: see if readlink exists
11045set readlink d_readlink
11046eval $inlibc
11047
11048: see if readv exists
11049set readv d_readv
11050eval $inlibc
11051
11052: see if recvmsg exists
11053set recvmsg d_recvmsg
11054eval $inlibc
11055
11056: see if rename exists
11057set rename d_rename
11058eval $inlibc
11059
11060: see if rmdir exists
11061set rmdir d_rmdir
11062eval $inlibc
11063
11064: see if memory.h is available.
11065val=''
11066set memory.h val
11067eval $inhdr
11068
11069: See if it conflicts with string.h
11070case "$val" in
11071$define)
11072 case "$strings" in
11073 '') ;;
11074 *)
11075 $cppstdin $cppflags $cppminus < $strings > mem.h
11076 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
11077 echo " "
11078 echo "We won't be including <memory.h>."
11079 val="$undef"
11080 fi
11081 $rm -f mem.h
11082 ;;
11083 esac
11084esac
11085set i_memory
11086eval $setvar
11087
11088: can bcopy handle overlapping blocks?
11089val="$undef"
11090case "$d_bcopy" in
11091"$define")
11092 echo " "
11093 echo "Checking to see if your bcopy() can do overlapping copies..." >&4
11094 $cat >try.c <<EOCP
11095#$i_memory I_MEMORY
11096#$i_stdlib I_STDLIB
11097#$i_string I_STRING
11098#$i_unistd I_UNISTD
11099EOCP
11100 $cat >>try.c <<'EOCP'
11101#include <stdio.h>
11102#ifdef I_MEMORY
11103# include <memory.h>
11104#endif
11105#ifdef I_STDLIB
11106# include <stdlib.h>
11107#endif
11108#ifdef I_STRING
11109# include <string.h>
11110#else
11111# include <strings.h>
11112#endif
11113#ifdef I_UNISTD
11114# include <unistd.h> /* Needed for NetBSD */
11115#endif
11116int main()
11117{
11118char buf[128], abc[128];
11119char *b;
11120int len;
11121int off;
11122int align;
11123
11124bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
11125
11126for (align = 7; align >= 0; align--) {
11127 for (len = 36; len; len--) {
11128 b = buf+align;
11129 bcopy(abc, b, len);
11130 for (off = 1; off <= len; off++) {
11131 bcopy(b, b+off, len);
11132 bcopy(b+off, b, len);
11133 if (bcmp(b, abc, len))
11134 exit(1);
11135 }
11136 }
11137}
11138exit(0);
11139}
11140EOCP
11141 set try
11142 if eval $compile_ok; then
11143 if ./try 2>/dev/null; then
11144 echo "Yes, it can."
11145 val="$define"
11146 else
11147 echo "It can't, sorry."
11148 case "$d_memmove" in
11149 "$define") echo "But that's Ok since you have memmove()." ;;
11150 esac
11151 fi
11152 else
11153 echo "(I can't compile the test program, so we'll assume not...)"
11154 case "$d_memmove" in
11155 "$define") echo "But that's Ok since you have memmove()." ;;
11156 esac
11157 fi
11158 ;;
11159esac
11160$rm -f try.* try core
11161set d_safebcpy
11162eval $setvar
11163
11164: can memcpy handle overlapping blocks?
11165val="$undef"
11166case "$d_memcpy" in
11167"$define")
11168 echo " "
11169 echo "Checking to see if your memcpy() can do overlapping copies..." >&4
11170 $cat >try.c <<EOCP
11171#$i_memory I_MEMORY
11172#$i_stdlib I_STDLIB
11173#$i_string I_STRING
11174#$i_unistd I_UNISTD
11175EOCP
11176 $cat >>try.c <<'EOCP'
11177#include <stdio.h>
11178#ifdef I_MEMORY
11179# include <memory.h>
11180#endif
11181#ifdef I_STDLIB
11182# include <stdlib.h>
11183#endif
11184#ifdef I_STRING
11185# include <string.h>
11186#else
11187# include <strings.h>
11188#endif
11189#ifdef I_UNISTD
11190# include <unistd.h> /* Needed for NetBSD */
11191#endif
11192int main()
11193{
11194char buf[128], abc[128];
11195char *b;
11196int len;
11197int off;
11198int align;
11199
11200/* Copy "abcde..." string to char abc[] so that gcc doesn't
11201 try to store the string in read-only memory. */
11202memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
11203
11204for (align = 7; align >= 0; align--) {
11205 for (len = 36; len; len--) {
11206 b = buf+align;
11207 memcpy(b, abc, len);
11208 for (off = 1; off <= len; off++) {
11209 memcpy(b+off, b, len);
11210 memcpy(b, b+off, len);
11211 if (memcmp(b, abc, len))
11212 exit(1);
11213 }
11214 }
11215}
11216exit(0);
11217}
11218EOCP
11219 set try
11220 if eval $compile_ok; then
11221 if ./try 2>/dev/null; then
11222 echo "Yes, it can."
11223 val="$define"
11224 else
11225 echo "It can't, sorry."
11226 case "$d_memmove" in
11227 "$define") echo "But that's Ok since you have memmove()." ;;
11228 esac
11229 fi
11230 else
11231 echo "(I can't compile the test program, so we'll assume not...)"
11232 case "$d_memmove" in
11233 "$define") echo "But that's Ok since you have memmove()." ;;
11234 esac
11235 fi
11236 ;;
11237esac
11238$rm -f try.* try core
11239set d_safemcpy
11240eval $setvar
11241
11242: can memcmp be trusted to compare relative magnitude?
11243val="$undef"
11244case "$d_memcmp" in
11245"$define")
11246 echo " "
11247 echo "Checking if your memcmp() can compare relative magnitude..." >&4
11248 $cat >try.c <<EOCP
11249#$i_memory I_MEMORY
11250#$i_stdlib I_STDLIB
11251#$i_string I_STRING
11252#$i_unistd I_UNISTD
11253EOCP
11254 $cat >>try.c <<'EOCP'
11255#include <stdio.h>
11256#ifdef I_MEMORY
11257# include <memory.h>
11258#endif
11259#ifdef I_STDLIB
11260# include <stdlib.h>
11261#endif
11262#ifdef I_STRING
11263# include <string.h>
11264#else
11265# include <strings.h>
11266#endif
11267#ifdef I_UNISTD
11268# include <unistd.h> /* Needed for NetBSD */
11269#endif
11270int main()
11271{
11272char a = -1;
11273char b = 0;
11274if ((a < b) && memcmp(&a, &b, 1) < 0)
11275 exit(1);
11276exit(0);
11277}
11278EOCP
11279 set try
11280 if eval $compile_ok; then
11281 if ./try 2>/dev/null; then
11282 echo "Yes, it can."
11283 val="$define"
11284 else
11285 echo "No, it can't (it uses signed chars)."
11286 fi
11287 else
11288 echo "(I can't compile the test program, so we'll assume not...)"
11289 fi
11290 ;;
11291esac
11292$rm -f try.* try core
11293set d_sanemcmp
11294eval $setvar
11295
11296: see if prototype for sbrk is available
11297echo " "
11298set d_sbrkproto sbrk $i_unistd unistd.h
11299eval $hasproto
11300
11301: see if select exists
11302set select d_select
11303eval $inlibc
11304
11305: see if semctl exists
11306set semctl d_semctl
11307eval $inlibc
11308
11309: see if semget exists
11310set semget d_semget
11311eval $inlibc
11312
11313: see if semop exists
11314set semop d_semop
11315eval $inlibc
11316
11317: see how much of the 'sem*(2)' library is present.
11318h_sem=true
11319echo " "
11320case "$d_semctl$d_semget$d_semop" in
11321*"$undef"*) h_sem=false;;
11322esac
11323case "$osname" in
11324freebsd)
11325 case "`ipcs 2>&1`" in
11326 "SVID messages"*"not configured"*)
11327 echo "Your $osname does not have the sem*(2) configured." >&4
11328 h_sem=false
11329 val="$undef"
11330 set semctl d_semctl
11331 eval $setvar
11332 set semget d_semget
11333 eval $setvar
11334 set semop d_semop
11335 eval $setvar
11336 ;;
11337 esac
11338 ;;
11339esac
11340: we could also check for sys/ipc.h ...
11341if $h_sem && $test `./findhdr sys/sem.h`; then
11342 echo "You have the full sem*(2) library." >&4
11343 val="$define"
11344else
11345 echo "You don't have the full sem*(2) library." >&4
11346 val="$undef"
11347fi
11348set d_sem
11349eval $setvar
11350
11351: see whether sys/sem.h defines union semun
11352echo " "
11353$cat > try.c <<'END'
11354#include <sys/types.h>
11355#include <sys/ipc.h>
11356#include <sys/sem.h>
11357int main () { union semun semun; semun.buf = 0; }
11358END
11359set try
11360if eval $compile; then
11361 echo "You have union semun in <sys/sem.h>." >&4
11362 val="$define"
11363else
11364 echo "You do not have union semun in <sys/sem.h>." >&4
11365 val="$undef"
11366fi
11367$rm -f try try.c try.h
11368set d_union_semun
11369eval $setvar
11370
11371: see how to do semctl IPC_STAT
11372case "$d_sem" in
11373$define)
11374 : see whether semctl IPC_STAT can use union semun
11375 echo " "
11376 $cat > try.h <<END
11377#ifndef S_IRUSR
11378# ifdef S_IREAD
11379# define S_IRUSR S_IREAD
11380# define S_IWUSR S_IWRITE
11381# define S_IXUSR S_IEXEC
11382# else
11383# define S_IRUSR 0400
11384# define S_IWUSR 0200
11385# define S_IXUSR 0100
11386# endif
11387# define S_IRGRP (S_IRUSR>>3)
11388# define S_IWGRP (S_IWUSR>>3)
11389# define S_IXGRP (S_IXUSR>>3)
11390# define S_IROTH (S_IRUSR>>6)
11391# define S_IWOTH (S_IWUSR>>6)
11392# define S_IXOTH (S_IXUSR>>6)
11393#endif
11394#ifndef S_IRWXU
11395# define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
11396# define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
11397# define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
11398#endif
11399END
11400
11401 $cat > try.c <<END
11402#include <sys/types.h>
11403#include <sys/ipc.h>
11404#include <sys/sem.h>
11405#include <sys/stat.h>
11406#include <stdio.h>
11407#include <errno.h>
11408#include "try.h"
11409#ifndef errno
11410extern int errno;
11411#endif
11412#$d_union_semun HAS_UNION_SEMUN
11413int main() {
11414 union semun
11415#ifndef HAS_UNION_SEMUN
11416 {
11417 int val;
11418 struct semid_ds *buf;
11419 unsigned short *array;
11420 }
11421#endif
11422 arg;
11423 int sem, st;
11424
11425#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11426 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11427 if (sem > -1) {
11428 struct semid_ds argbuf;
11429 arg.buf = &argbuf;
11430# ifdef IPC_STAT
11431 st = semctl(sem, 0, IPC_STAT, arg);
11432 if (st == 0)
11433 printf("semun\n");
11434 else
11435# endif /* IPC_STAT */
11436 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11437# ifdef IPC_RMID
11438 if (semctl(sem, 0, IPC_RMID, arg) != 0)
11439# endif /* IPC_RMID */
11440 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11441 } else
11442#endif /* IPC_PRIVATE && ... */
11443 printf("semget failed: errno = %d\n", errno);
11444 return 0;
11445}
11446END
11447 val="$undef"
11448 set try
11449 if eval $compile; then
11450 xxx=`./try`
11451 case "$xxx" in
11452 semun) val="$define" ;;
11453 esac
11454 fi
11455 $rm -f try try.c
11456 set d_semctl_semun
11457 eval $setvar
11458 case "$d_semctl_semun" in
11459 $define)
11460 echo "You can use union semun for semctl IPC_STAT." >&4
11461 also='also'
11462 ;;
11463 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
11464 also=''
11465 ;;
11466 esac
11467
11468 : see whether semctl IPC_STAT can use struct semid_ds pointer
11469 $cat > try.c <<'END'
11470#include <sys/types.h>
11471#include <sys/ipc.h>
11472#include <sys/sem.h>
11473#include <sys/stat.h>
11474#include "try.h"
11475#include <stdio.h>
11476#include <errno.h>
11477#ifndef errno
11478extern int errno;
11479#endif
11480int main() {
11481 struct semid_ds arg;
11482 int sem, st;
11483
11484#if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
11485 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
11486 if (sem > -1) {
11487# ifdef IPC_STAT
11488 st = semctl(sem, 0, IPC_STAT, &arg);
11489 if (st == 0)
11490 printf("semid_ds\n");
11491 else
11492# endif /* IPC_STAT */
11493 printf("semctl IPC_STAT failed: errno = %d\n", errno);
11494# ifdef IPC_RMID
11495 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
11496# endif /* IPC_RMID */
11497 printf("semctl IPC_RMID failed: errno = %d\n", errno);
11498 } else
11499#endif /* IPC_PRIVATE && ... */
11500 printf("semget failed: errno = %d\n", errno);
11501
11502 return 0;
11503}
11504END
11505 val="$undef"
11506 set try
11507 if eval $compile; then
11508 xxx=`./try`
11509 case "$xxx" in
11510 semid_ds) val="$define" ;;
11511 esac
11512 fi
11513 $rm -f try try.c
11514 set d_semctl_semid_ds
11515 eval $setvar
11516 case "$d_semctl_semid_ds" in
11517 $define)
11518 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
11519 ;;
11520 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
11521 ;;
11522 esac
11523 $rm -f try.h
11524 ;;
11525*) val="$undef"
11526
11527 # We do not have the full sem*(2) library, so assume we can not
11528 # use either.
11529
11530 set d_semctl_semun
11531 eval $setvar
11532
11533 set d_semctl_semid_ds
11534 eval $setvar
11535 ;;
11536esac
11537
11538: see if sendmsg exists
11539set sendmsg d_sendmsg
11540eval $inlibc
11541
11542: see if setegid exists
11543set setegid d_setegid
11544eval $inlibc
11545
11546: see if seteuid exists
11547set seteuid d_seteuid
11548eval $inlibc
11549
11550: see if setgrent exists
11551set setgrent d_setgrent
11552eval $inlibc
11553
11554: see if sethostent exists
11555set sethostent d_sethent
11556eval $inlibc
11557
11558: see if setitimer exists
11559set setitimer d_setitimer
11560eval $inlibc
11561
11562: see if setlinebuf exists
11563set setlinebuf d_setlinebuf
11564eval $inlibc
11565
11566: see if setlocale exists
11567set setlocale d_setlocale
11568eval $inlibc
11569
11570: see if setnetent exists
11571set setnetent d_setnent
11572eval $inlibc
11573
11574: see if setprotoent exists
11575set setprotoent d_setpent
11576eval $inlibc
11577
11578: see if setpgid exists
11579set setpgid d_setpgid
11580eval $inlibc
11581
11582: see if setpgrp2 exists
11583set setpgrp2 d_setpgrp2
11584eval $inlibc
11585
11586: see if setpriority exists
11587set setpriority d_setprior
11588eval $inlibc
11589
11590: see if setproctitle exists
11591set setproctitle d_setproctitle
11592eval $inlibc
11593
11594: see if setpwent exists
11595set setpwent d_setpwent
11596eval $inlibc
11597
11598: see if setregid exists
11599set setregid d_setregid
11600eval $inlibc
11601set setresgid d_setresgid
11602eval $inlibc
11603
11604: see if setreuid exists
11605set setreuid d_setreuid
11606eval $inlibc
11607set setresuid d_setresuid
11608eval $inlibc
11609
11610: see if setrgid exists
11611set setrgid d_setrgid
11612eval $inlibc
11613
11614: see if setruid exists
11615set setruid d_setruid
11616eval $inlibc
11617
11618: see if setservent exists
11619set setservent d_setsent
11620eval $inlibc
11621
11622: see if setsid exists
11623set setsid d_setsid
11624eval $inlibc
11625
11626: see if setvbuf exists
11627set setvbuf d_setvbuf
11628eval $inlibc
11629
11630: see if sfio.h is available
11631set sfio.h i_sfio
11632eval $inhdr
11633
11634
11635: see if sfio library is available
11636case "$i_sfio" in
11637$define)
11638 val=''
11639 set sfreserve val
11640 eval $inlibc
11641 ;;
11642*)
11643 val="$undef"
11644 ;;
11645esac
11646: Ok, but do we want to use it.
11647case "$val" in
11648$define)
11649 case "$usesfio" in
11650 true|$define|[yY]*) dflt='y';;
11651 *) dflt='n';;
11652 esac
11653 echo "$package can use the sfio library, but it is experimental."
11654 case "$useperlio" in
11655 "$undef")
11656 echo "For sfio also the PerlIO abstraction layer is needed."
11657 echo "Earlier you said you wouldn't want that."
11658 ;;
11659 esac
11660 rp="You seem to have sfio available, do you want to try using it?"
11661 . ./myread
11662 case "$ans" in
11663 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
11664 useperlio="$define"
11665 val="$define"
11666 ;;
11667 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
11668 val="$undef"
11669 ;;
11670 esac
11671 ;;
11672*) case "$usesfio" in
11673 true|$define|[yY]*)
11674 echo "Sorry, cannot find sfio on this machine." >&4
11675 echo "Ignoring your setting of usesfio=$usesfio." >&4
11676 val="$undef"
11677 ;;
11678 esac
11679 ;;
11680esac
11681set d_sfio
11682eval $setvar
11683case "$d_sfio" in
11684$define) usesfio='true';;
11685*) usesfio='false';;
11686esac
11687case "$d_sfio" in
11688$define) ;;
11689*) : Remove sfio from list of libraries to use
11690 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
11691 shift
11692 libs="$*"
11693 echo "libs = $libs" >&4
11694;;
11695esac
11696
11697
11698: see if shmctl exists
11699set shmctl d_shmctl
11700eval $inlibc
11701
11702: see if shmget exists
11703set shmget d_shmget
11704eval $inlibc
11705
11706: see if shmat exists
11707set shmat d_shmat
11708eval $inlibc
11709: see what shmat returns
11710case "$d_shmat" in
11711"$define")
11712 $cat >shmat.c <<'END'
11713#include <sys/shm.h>
11714void *shmat();
11715END
11716 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
11717 shmattype='void *'
11718 else
11719 shmattype='char *'
11720 fi
11721 echo "and it returns ($shmattype)." >&4
11722 : see if a prototype for shmat is available
11723 xxx=`./findhdr sys/shm.h`
11724 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
11725 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
11726 val="$define"
11727 else
11728 val="$undef"
11729 fi
11730 $rm -f shmat.[co]
11731 ;;
11732*)
11733 val="$undef"
11734 ;;
11735esac
11736set d_shmatprototype
11737eval $setvar
11738
11739: see if shmdt exists
11740set shmdt d_shmdt
11741eval $inlibc
11742
11743: see how much of the 'shm*(2)' library is present.
11744h_shm=true
11745echo " "
11746case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
11747*"$undef"*) h_shm=false;;
11748esac
11749case "$osname" in
11750freebsd)
11751 case "`ipcs 2>&1`" in
11752 "SVID shared memory"*"not configured"*)
11753 echo "Your $osname does not have the shm*(2) configured." >&4
11754 h_shm=false
11755 val="$undef"
11756 set shmctl d_shmctl
11757 evat $setvar
11758 set shmget d_shmget
11759 evat $setvar
11760 set shmat d_shmat
11761 evat $setvar
11762 set shmdt d_shmdt
11763 evat $setvar
11764 ;;
11765 esac
11766 ;;
11767esac
11768: we could also check for sys/ipc.h ...
11769if $h_shm && $test `./findhdr sys/shm.h`; then
11770 echo "You have the full shm*(2) library." >&4
11771 val="$define"
11772else
11773 echo "You don't have the full shm*(2) library." >&4
11774 val="$undef"
11775fi
11776set d_shm
11777eval $setvar
11778
11779echo " "
11780: see if we have sigaction
11781if set sigaction val -f d_sigaction; eval $csym; $val; then
11782 echo 'sigaction() found.' >&4
11783 $cat > try.c <<'EOP'
11784#include <stdio.h>
11785#include <sys/types.h>
11786#include <signal.h>
11787int main()
11788{
11789 struct sigaction act, oact;
11790 act.sa_flags = 0;
11791 oact.sa_handler = 0;
11792 /* so that act and oact are used */
11793 exit(act.sa_flags == 0 && oact.sa_handler == 0);
11794}
11795EOP
11796 set try
11797 if eval $compile_ok; then
11798 val="$define"
11799 else
11800 echo "But you don't seem to have a useable struct sigaction." >&4
11801 val="$undef"
11802 fi
11803else
11804 echo 'sigaction NOT found.' >&4
11805 val="$undef"
11806fi
11807set d_sigaction; eval $setvar
11808$rm -f try try$_o try.c
11809
11810: see if sigprocmask exists
11811set sigprocmask d_sigprocmask
11812eval $inlibc
11813
11814: see if sigsetjmp exists
11815echo " "
11816case "$d_sigsetjmp" in
11817'')
11818 $cat >try.c <<'EOP'
11819#include <setjmp.h>
11820sigjmp_buf env;
11821int set = 1;
11822int main()
11823{
11824 if (sigsetjmp(env,1))
11825 exit(set);
11826 set = 0;
11827 siglongjmp(env, 1);
11828 exit(1);
11829}
11830EOP
11831 set try
11832 if eval $compile; then
11833 if ./try >/dev/null 2>&1; then
11834 echo "POSIX sigsetjmp found." >&4
11835 val="$define"
11836 else
11837 $cat >&4 <<EOM
11838Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
11839I'll ignore them.
11840EOM
11841 val="$undef"
11842 fi
11843 else
11844 echo "sigsetjmp not found." >&4
11845 val="$undef"
11846 fi
11847 ;;
11848*) val="$d_sigsetjmp"
11849 case "$d_sigsetjmp" in
11850 $define) echo "POSIX sigsetjmp found." >&4;;
11851 $undef) echo "sigsetjmp not found." >&4;;
11852 esac
11853 ;;
11854esac
11855set d_sigsetjmp
11856eval $setvar
11857$rm -f try.c try
11858
11859: see if sockatmark exists
11860set sockatmark d_sockatmark
11861eval $inlibc
11862
11863: see if socks5_init exists
11864set socks5_init d_socks5_init
11865eval $inlibc
11866
11867: see if sys/stat.h is available
11868set sys/stat.h i_sysstat
11869eval $inhdr
11870
11871
11872: see if stat knows about block sizes
11873echo " "
11874echo "Checking to see if your struct stat has st_blocks field..." >&4
11875set d_statblks stat st_blocks $i_sysstat sys/stat.h
11876eval $hasfield
11877
11878
11879: see if this is a sys/vfs.h system
11880set sys/vfs.h i_sysvfs
11881eval $inhdr
11882
11883
11884: see if this is a sys/statfs.h system
11885set sys/statfs.h i_sysstatfs
11886eval $inhdr
11887
11888
11889echo " "
11890echo "Checking to see if your system supports struct statfs..." >&4
11891set 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
11892eval $hasstruct
11893case "$d_statfs_s" in
11894"$define") echo "Yes, it does." ;;
11895*) echo "No, it doesn't." ;;
11896esac
11897
11898
11899
11900: see if struct statfs knows about f_flags
11901case "$d_statfs_s" in
11902define)
11903 echo " "
11904 echo "Checking to see if your struct statfs has f_flags field..." >&4
11905 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
11906 eval $hasfield
11907 ;;
11908*) val="$undef"
11909 set d_statfs_f_flags
11910 eval $setvar
11911 ;;
11912esac
11913case "$d_statfs_f_flags" in
11914"$define") echo "Yes, it does." ;;
11915*) echo "No, it doesn't." ;;
11916esac
11917
11918: see if _ptr and _cnt from stdio act std
11919echo " "
11920
11921if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11922 echo "(Looks like you have stdio.h from BSD.)"
11923 case "$stdio_ptr" in
11924 '') stdio_ptr='((fp)->_p)'
11925 ptr_lval=$define
11926 ;;
11927 *) ptr_lval=$d_stdio_ptr_lval;;
11928 esac
11929 case "$stdio_cnt" in
11930 '') stdio_cnt='((fp)->_r)'
11931 cnt_lval=$define
11932 ;;
11933 *) cnt_lval=$d_stdio_cnt_lval;;
11934 esac
11935 case "$stdio_base" in
11936 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11937 esac
11938 case "$stdio_bufsiz" in
11939 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11940 esac
11941elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11942 echo "(Looks like you have stdio.h from Linux.)"
11943 case "$stdio_ptr" in
11944 '') stdio_ptr='((fp)->_IO_read_ptr)'
11945 ptr_lval=$define
11946 ;;
11947 *) ptr_lval=$d_stdio_ptr_lval;;
11948 esac
11949 case "$stdio_cnt" in
11950 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11951 cnt_lval=$undef
11952 ;;
11953 *) cnt_lval=$d_stdio_cnt_lval;;
11954 esac
11955 case "$stdio_base" in
11956 '') stdio_base='((fp)->_IO_read_base)';;
11957 esac
11958 case "$stdio_bufsiz" in
11959 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11960 esac
11961else
11962 case "$stdio_ptr" in
11963 '') stdio_ptr='((fp)->_ptr)'
11964 ptr_lval=$define
11965 ;;
11966 *) ptr_lval=$d_stdio_ptr_lval;;
11967 esac
11968 case "$stdio_cnt" in
11969 '') stdio_cnt='((fp)->_cnt)'
11970 cnt_lval=$define
11971 ;;
11972 *) cnt_lval=$d_stdio_cnt_lval;;
11973 esac
11974 case "$stdio_base" in
11975 '') stdio_base='((fp)->_base)';;
11976 esac
11977 case "$stdio_bufsiz" in
11978 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11979 esac
11980fi
11981
11982: test whether _ptr and _cnt really work
11983echo "Checking how std your stdio is..." >&4
11984$cat >try.c <<EOP
11985#include <stdio.h>
11986#define FILE_ptr(fp) $stdio_ptr
11987#define FILE_cnt(fp) $stdio_cnt
11988int main() {
11989 FILE *fp = fopen("try.c", "r");
11990 char c = getc(fp);
11991 if (
11992 18 <= FILE_cnt(fp) &&
11993 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11994 )
11995 exit(0);
11996 exit(1);
11997}
11998EOP
11999val="$undef"
12000set try
12001if eval $compile; then
12002 if ./try; then
12003 echo "Your stdio acts pretty std."
12004 val="$define"
12005 else
12006 echo "Your stdio isn't very std."
12007 fi
12008else
12009 echo "Your stdio doesn't appear very std."
12010fi
12011$rm -f try.c try
12012set d_stdstdio
12013eval $setvar
12014
12015: Can _ptr be used as an lvalue?
12016case "$d_stdstdio$ptr_lval" in
12017$define$define) val=$define ;;
12018*) val=$undef ;;
12019esac
12020set d_stdio_ptr_lval
12021eval $setvar
12022
12023: Can _cnt be used as an lvalue?
12024case "$d_stdstdio$cnt_lval" in
12025$define$define) val=$define ;;
12026*) val=$undef ;;
12027esac
12028set d_stdio_cnt_lval
12029eval $setvar
12030
12031
12032: test whether setting _ptr sets _cnt as a side effect
12033d_stdio_ptr_lval_sets_cnt="$undef"
12034d_stdio_ptr_lval_nochange_cnt="$undef"
12035case "$d_stdio_ptr_lval$d_stdstdio" in
12036$define$define)
12037 echo "Checking to see what happens if we set the stdio ptr..." >&4
12038$cat >try.c <<EOP
12039#include <stdio.h>
12040/* Can we scream? */
12041/* Eat dust sed :-) */
12042/* In the buffer space, no one can hear you scream. */
12043#define FILE_ptr(fp) $stdio_ptr
12044#define FILE_cnt(fp) $stdio_cnt
12045#include <sys/types.h>
12046int main() {
12047 FILE *fp = fopen("try.c", "r");
12048 int c;
12049 char *ptr;
12050 size_t cnt;
12051 if (!fp) {
12052 puts("Fail even to read");
12053 exit(1);
12054 }
12055 c = getc(fp); /* Read away the first # */
12056 if (c == EOF) {
12057 puts("Fail even to read");
12058 exit(1);
12059 }
12060 if (!(
12061 18 <= FILE_cnt(fp) &&
12062 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
12063 )) {
12064 puts("Fail even to read");
12065 exit (1);
12066 }
12067 ptr = (char*) FILE_ptr(fp);
12068 cnt = (size_t)FILE_cnt(fp);
12069
12070 FILE_ptr(fp) += 42;
12071
12072 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
12073 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
12074 exit (1);
12075 }
12076 if (FILE_cnt(fp) <= 20) {
12077 printf ("Fail (<20 chars to test)");
12078 exit (1);
12079 }
12080 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
12081 puts("Fail compare");
12082 exit (1);
12083 }
12084 if (cnt == FILE_cnt(fp)) {
12085 puts("Pass_unchanged");
12086 exit (0);
12087 }
12088 if (FILE_cnt(fp) == (cnt - 42)) {
12089 puts("Pass_changed");
12090 exit (0);
12091 }
12092 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
12093 return 1;
12094
12095}
12096EOP
12097 set try
12098 if eval $compile; then
12099 case `./try$exe_ext` in
12100 Pass_changed)
12101 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
12102 d_stdio_ptr_lval_sets_cnt="$define" ;;
12103 Pass_unchanged)
12104 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
12105 d_stdio_ptr_lval_nochange_cnt="$define" ;;
12106 Fail*)
12107 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
12108 *)
12109 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
12110 esac
12111 else
12112 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12113 fi
12114 $rm -f try.c try
12115 ;;
12116esac
12117
12118: see if _base is also standard
12119val="$undef"
12120case "$d_stdstdio" in
12121$define)
12122 $cat >try.c <<EOP
12123#include <stdio.h>
12124#define FILE_base(fp) $stdio_base
12125#define FILE_bufsiz(fp) $stdio_bufsiz
12126int main() {
12127 FILE *fp = fopen("try.c", "r");
12128 char c = getc(fp);
12129 if (
12130 19 <= FILE_bufsiz(fp) &&
12131 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12132 )
12133 exit(0);
12134 exit(1);
12135}
12136EOP
12137 set try
12138 if eval $compile; then
12139 if ./try; then
12140 echo "And its _base field acts std."
12141 val="$define"
12142 else
12143 echo "But its _base field isn't std."
12144 fi
12145 else
12146 echo "However, it seems to be lacking the _base field."
12147 fi
12148 $rm -f try.c try
12149 ;;
12150esac
12151set d_stdiobase
12152eval $setvar
12153
12154$cat >&4 <<EOM
12155Checking how to access stdio streams by file descriptor number...
12156EOM
12157case "$stdio_stream_array" in
12158'') $cat >try.c <<EOCP
12159#include <stdio.h>
12160int main() {
12161 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
12162 printf("yes\n");
12163}
12164EOCP
12165 for s in _iob __iob __sF
12166 do
12167 set try -DSTDIO_STREAM_ARRAY=$s
12168 if eval $compile; then
12169 case "`./try$exe_ext`" in
12170 yes) stdio_stream_array=$s; break ;;
12171 esac
12172 fi
12173 done
12174 $rm -f try.* try$exe_ext
12175esac
12176case "$stdio_stream_array" in
12177'') $cat >&4 <<EOM
12178I can't figure out how to access stdio streams by file descriptor number.
12179EOM
12180 d_stdio_stream_array="$undef"
12181 ;;
12182*) $cat >&4 <<EOM
12183You can access stdio streams by file descriptor number by the $stdio_stream_array array.
12184EOM
12185 d_stdio_stream_array="$define"
12186 ;;
12187esac
12188
12189: see if strcoll exists
12190set strcoll d_strcoll
12191eval $inlibc
12192
12193: check for structure copying
12194echo " "
12195echo "Checking to see if your C compiler can copy structs..." >&4
12196$cat >try.c <<'EOCP'
12197int main()
12198{
12199 struct blurfl {
12200 int dyick;
12201 } foo, bar;
12202
12203 foo = bar;
12204}
12205EOCP
12206if $cc -c try.c >/dev/null 2>&1 ; then
12207 val="$define"
12208 echo "Yup, it can."
12209else
12210 val="$undef"
12211 echo "Nope, it can't."
12212fi
12213set d_strctcpy
12214eval $setvar
12215$rm -f try.*
12216
12217: see if strerror and/or sys_errlist[] exist
12218echo " "
12219if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
12220 if set strerror val -f d_strerror; eval $csym; $val; then
12221 echo 'strerror() found.' >&4
12222 d_strerror="$define"
12223 d_strerrm='strerror(e)'
12224 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12225 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
12226 d_syserrlst="$define"
12227 else
12228 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
12229 d_syserrlst="$undef"
12230 fi
12231 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
12232 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
12233 echo 'strerror() found in string header.' >&4
12234 d_strerror="$define"
12235 d_strerrm='strerror(e)'
12236 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12237 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
12238 d_syserrlst="$define"
12239 else
12240 echo "(You don't appear to have any sys_errlist[], how can this be?)"
12241 d_syserrlst="$undef"
12242 fi
12243 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
12244 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
12245 d_strerror="$undef"
12246 d_syserrlst="$define"
12247 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
12248 else
12249 echo 'strerror() and sys_errlist[] NOT found.' >&4
12250 d_strerror="$undef"
12251 d_syserrlst="$undef"
12252 d_strerrm='"unknown"'
12253 fi
12254fi
12255
12256: see if strftime exists
12257set strftime d_strftime
12258eval $inlibc
12259
12260: see if strtod exists
12261set strtod d_strtod
12262eval $inlibc
12263
12264: see if strtol exists
12265set strtol d_strtol
12266eval $inlibc
12267
12268: see if strtold exists
12269set strtold d_strtold
12270eval $inlibc
12271
12272: see if strtoll exists
12273set strtoll d_strtoll
12274eval $inlibc
12275
12276case "$d_longlong-$d_strtoll" in
12277"$define-$define")
12278 $cat <<EOM
12279Checking whether your strtoll() works okay...
12280EOM
12281 $cat >try.c <<'EOCP'
12282#include <errno.h>
12283#ifdef __hpux
12284#define strtoll __strtoll
12285#endif
12286#ifdef __EMX__
12287#define strtoll _strtoll
12288#endif
12289#include <stdio.h>
12290extern long long int strtoll(char *s, char **, int);
12291static int bad = 0;
12292int check(char *s, long long ell, int een) {
12293 long long gll;
12294 errno = 0;
12295 gll = strtoll(s, 0, 10);
12296 if (!((gll == ell) && (errno == een)))
12297 bad++;
12298}
12299int main() {
12300 check(" 1", 1LL, 0);
12301 check(" 0", 0LL, 0);
12302 check("-1", -1LL, 0);
12303 check("-9223372036854775808", -9223372036854775808LL, 0);
12304 check("-9223372036854775808", -9223372036854775808LL, 0);
12305 check(" 9223372036854775807", 9223372036854775807LL, 0);
12306 check("-9223372036854775808", -9223372036854775808LL, 0);
12307 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
12308 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
12309 if (!bad)
12310 printf("ok\n");
12311}
12312EOCP
12313 set try
12314 if eval $compile; then
12315 yyy=`./try`
12316 case "$yyy" in
12317 ok) echo "Your strtoll() seems to be working okay." ;;
12318 *) cat <<EOM >&4
12319Your strtoll() doesn't seem to be working okay.
12320EOM
12321 d_strtoll="$undef"
12322 ;;
12323 esac
12324 else
12325 echo "(I can't seem to compile the test program--assuming it doesn't)"
12326 d_strtoll="$undef"
12327 fi
12328 ;;
12329esac
12330
12331: see if strtoq exists
12332set strtoq d_strtoq
12333eval $inlibc
12334
12335: see if strtoul exists
12336set strtoul d_strtoul
12337eval $inlibc
12338
12339case "$d_strtoul" in
12340"$define")
12341 $cat <<EOM
12342Checking whether your strtoul() works okay...
12343EOM
12344 $cat >try.c <<'EOCP'
12345#include <errno.h>
12346#include <stdio.h>
12347extern unsigned long int strtoul(char *s, char **, int);
12348static int bad = 0;
12349void check(char *s, unsigned long eul, int een) {
12350 unsigned long gul;
12351 errno = 0;
12352 gul = strtoul(s, 0, 10);
12353 if (!((gul == eul) && (errno == een)))
12354 bad++;
12355}
12356int main() {
12357 check(" 1", 1L, 0);
12358 check(" 0", 0L, 0);
12359EOCP
12360 case "$longsize" in
12361 8)
12362 $cat >>try.c <<'EOCP'
12363 check("18446744073709551615", 18446744073709551615UL, 0);
12364 check("18446744073709551616", 18446744073709551615UL, ERANGE);
12365#if 0 /* strtoul() for /^-/ strings is undefined. */
12366 check("-1", 18446744073709551615UL, 0);
12367 check("-18446744073709551614", 2, 0);
12368 check("-18446744073709551615", 1, 0);
12369 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
12370 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
12371#endif
12372EOCP
12373 ;;
12374 4)
12375 $cat >>try.c <<'EOCP'
12376 check("4294967295", 4294967295UL, 0);
12377 check("4294967296", 4294967295UL, ERANGE);
12378#if 0 /* strtoul() for /^-/ strings is undefined. */
12379 check("-1", 4294967295UL, 0);
12380 check("-4294967294", 2, 0);
12381 check("-4294967295", 1, 0);
12382 check("-4294967296", 4294967295UL, ERANGE);
12383 check("-4294967297", 4294967295UL, ERANGE);
12384#endif
12385EOCP
12386 ;;
12387 *)
12388: Should we write these tests to be more portable by sprintf-ing
12389: ~0 and then manipulating that char string as input for strtol?
12390 ;;
12391 esac
12392 $cat >>try.c <<'EOCP'
12393 if (!bad)
12394 printf("ok\n");
12395 return 0;
12396}
12397EOCP
12398 set try
12399 if eval $compile; then
12400 case "`./try`" in
12401 ok) echo "Your strtoul() seems to be working okay." ;;
12402 *) cat <<EOM >&4
12403Your strtoul() doesn't seem to be working okay.
12404EOM
12405 d_strtoul="$undef"
12406 ;;
12407 esac
12408 fi
12409 ;;
12410esac
12411
12412: see if strtoull exists
12413set strtoull d_strtoull
12414eval $inlibc
12415
12416case "$d_longlong-$d_strtoull" in
12417"$define-$define")
12418 $cat <<EOM
12419Checking whether your strtoull() works okay...
12420EOM
12421 $cat >try.c <<'EOCP'
12422#include <errno.h>
12423#ifdef __hpux
12424#define strtoull __strtoull
12425#endif
12426#include <stdio.h>
12427extern unsigned long long int strtoull(char *s, char **, int);
12428static int bad = 0;
12429int check(char *s, long long eull, int een) {
12430 long long gull;
12431 errno = 0;
12432 gull = strtoull(s, 0, 10);
12433 if (!((gull == eull) && (errno == een)))
12434 bad++;
12435}
12436int main() {
12437 check(" 1", 1LL, 0);
12438 check(" 0", 0LL, 0);
12439 check("18446744073709551615", 18446744073709551615ULL, 0);
12440 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12441#if 0 /* strtoull() for /^-/ strings is undefined. */
12442 check("-1", 18446744073709551615ULL, 0);
12443 check("-18446744073709551614", 2LL, 0);
12444 check("-18446744073709551615", 1LL, 0);
12445 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12446 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12447#endif
12448 if (!bad)
12449 printf("ok\n");
12450}
12451EOCP
12452 set try
12453 if eval $compile; then
12454 case "`./try`" in
12455 ok) echo "Your strtoull() seems to be working okay." ;;
12456 *) cat <<EOM >&4
12457Your strtoull() doesn't seem to be working okay.
12458EOM
12459 d_strtoull="$undef"
12460 ;;
12461 esac
12462 fi
12463 ;;
12464esac
12465
12466: see if strtouq exists
12467set strtouq d_strtouq
12468eval $inlibc
12469
12470case "$d_strtouq" in
12471"$define")
12472 $cat <<EOM
12473Checking whether your strtouq() works okay...
12474EOM
12475 $cat >try.c <<'EOCP'
12476#include <errno.h>
12477#include <stdio.h>
12478extern unsigned long long int strtouq(char *s, char **, int);
12479static int bad = 0;
12480void check(char *s, unsigned long long eull, int een) {
12481 unsigned long long gull;
12482 errno = 0;
12483 gull = strtouq(s, 0, 10);
12484 if (!((gull == eull) && (errno == een)))
12485 bad++;
12486}
12487int main() {
12488 check(" 1", 1LL, 0);
12489 check(" 0", 0LL, 0);
12490 check("18446744073709551615", 18446744073709551615ULL, 0);
12491 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
12492#if 0 /* strtouq() for /^-/ strings is undefined. */
12493 check("-1", 18446744073709551615ULL, 0);
12494 check("-18446744073709551614", 2LL, 0);
12495 check("-18446744073709551615", 1LL, 0);
12496 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
12497 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
12498#endif
12499 if (!bad)
12500 printf("ok\n");
12501 return 0;
12502}
12503EOCP
12504 set try
12505 if eval $compile; then
12506 case "`./try`" in
12507 ok) echo "Your strtouq() seems to be working okay." ;;
12508 *) cat <<EOM >&4
12509Your strtouq() doesn't seem to be working okay.
12510EOM
12511 d_strtouq="$undef"
12512 ;;
12513 esac
12514 fi
12515 ;;
12516esac
12517
12518: see if strxfrm exists
12519set strxfrm d_strxfrm
12520eval $inlibc
12521
12522: see if symlink exists
12523set symlink d_symlink
12524eval $inlibc
12525
12526: see if syscall exists
12527set syscall d_syscall
12528eval $inlibc
12529
12530: see if sysconf exists
12531set sysconf d_sysconf
12532eval $inlibc
12533
12534: see if system exists
12535set system d_system
12536eval $inlibc
12537
12538: see if tcgetpgrp exists
12539set tcgetpgrp d_tcgetpgrp
12540eval $inlibc
12541
12542: see if tcsetpgrp exists
12543set tcsetpgrp d_tcsetpgrp
12544eval $inlibc
12545
12546: see if prototype for telldir is available
12547echo " "
12548set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
12549eval $hasproto
12550
12551: see if this is a sys/times.h system
12552set sys/times.h i_systimes
12553eval $inhdr
12554
12555: see if times exists
12556echo " "
12557if set times val -f d_times; eval $csym; $val; then
12558 echo 'times() found.' >&4
12559 d_times="$define"
12560 inc=''
12561 case "$i_systimes" in
12562 "$define") inc='sys/times.h';;
12563 esac
12564 rp="What is the type returned by times() on this system?"
12565 set clock_t clocktype long stdio.h sys/types.h $inc
12566 eval $typedef_ask
12567else
12568 echo 'times() NOT found, hope that will do.' >&4
12569 d_times="$undef"
12570 clocktype='int'
12571fi
12572
12573: see if truncate exists
12574set truncate d_truncate
12575eval $inlibc
12576
12577: see if tzname[] exists
12578echo " "
12579if set tzname val -a d_tzname; eval $csym; $val; then
12580 val="$define"
12581 echo 'tzname[] found.' >&4
12582else
12583 val="$undef"
12584 echo 'tzname[] NOT found.' >&4
12585fi
12586set d_tzname
12587eval $setvar
12588
12589case "$crosscompile" in
12590''|[nN]*) crosscompile="$undef" ;;
12591esac
12592
12593case "$osname" in
12594next|rhapsody|darwin) multiarch="$define" ;;
12595esac
12596case "$multiarch" in
12597''|[nN]*) multiarch="$undef" ;;
12598esac
12599
12600: check for ordering of bytes in a long
12601echo " "
12602case "$crosscompile$multiarch" in
12603*$define*)
12604 $cat <<EOM
12605You seem to be either cross-compiling or doing a multiarchitecture build,
12606skipping the byteorder check.
12607
12608EOM
12609 byteorder='0xffff'
12610 ;;
12611*)
12612 case "$byteorder" in
12613 '')
12614 $cat <<'EOM'
12615In the following, larger digits indicate more significance. A big-endian
12616machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
12617little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
12618machines may have weird orders like 3412. A Cray will report 87654321,
12619an Alpha will report 12345678. If the test program works the default is
12620probably right.
12621I'm now running the test program...
12622EOM
12623 $cat >try.c <<'EOCP'
12624#include <stdio.h>
12625int main()
12626{
12627 int i;
12628 union {
12629 unsigned long l;
12630 char c[sizeof(long)];
12631 } u;
12632
12633 if (sizeof(long) > 4)
12634 u.l = (0x08070605L << 32) | 0x04030201L;
12635 else
12636 u.l = 0x04030201L;
12637 for (i = 0; i < sizeof(long); i++)
12638 printf("%c", u.c[i]+'0');
12639 printf("\n");
12640 exit(0);
12641}
12642EOCP
12643 xxx_prompt=y
12644 set try
12645 if eval $compile && ./try > /dev/null; then
12646 dflt=`./try`
12647 case "$dflt" in
12648 [1-4][1-4][1-4][1-4]|12345678|87654321)
12649 echo "(The test program ran ok.)"
12650 echo "byteorder=$dflt"
12651 xxx_prompt=n
12652 ;;
12653 ????|????????) echo "(The test program ran ok.)" ;;
12654 *) echo "(The test program didn't run right for some reason.)" ;;
12655 esac
12656 else
12657 dflt='4321'
12658 cat <<'EOM'
12659(I can't seem to compile the test program. Guessing big-endian...)
12660EOM
12661 fi
12662 case "$xxx_prompt" in
12663 y)
12664 rp="What is the order of bytes in a long?"
12665 . ./myread
12666 byteorder="$ans"
12667 ;;
12668 *) byteorder=$dflt
12669 ;;
12670 esac
12671 ;;
12672 esac
12673 $rm -f try.c try
12674 ;;
12675esac
12676
12677
12678$cat <<EOM
12679
12680Checking to see whether you can access character data unalignedly...
12681EOM
12682$cat >try.c <<EOCP
12683#include <stdio.h>
12684#define U32 $u32type
12685#define BYTEORDER $byteorder
12686int main() {
12687#if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
12688 U8 buf[] = "\0\0\0\1\0\0\0\0";
12689 U32 *up;
12690 int i;
12691
12692 if (sizeof(U32) != 4) {
12693 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
12694 exit(1);
12695 }
12696
12697 fflush(stdout);
12698
12699 for (i = 0; i < 4; i++) {
12700 up = (U32*)(buf + i);
12701 if (! ((*up == 1 << (8*i)) || /* big-endian */
12702 (*up == 1 << (8*(3-i))) /* little-endian */
12703 )
12704 )
12705 {
12706 printf("read failed (%x)\n", *up);
12707 exit(2);
12708 }
12709 }
12710
12711 /* write test */
12712 for (i = 0; i < 4; i++) {
12713 up = (U32*)(buf + i);
12714 *up = 0xBeef;
12715 if (*up != 0xBeef) {
12716 printf("write failed (%x)\n", *up);
12717 exit(3);
12718 }
12719 }
12720
12721 exit(0);
12722#else
12723 printf("1\n");
12724 exit(1);
12725#endif
12726 return 0;
12727}
12728EOCP
12729set try
12730if eval $compile_ok; then
12731 echo "(This test may dump core.)" >&4
12732 ./try >&2 >/dev/null
12733 case "$?" in
12734 0) cat >&4 <<EOM
12735You can access character data pretty unalignedly.
12736EOM
12737 d_u32align="$undef"
12738 ;;
12739 *) cat >&4 <<EOM
12740It seems that you must access character data in an aligned manner.
12741EOM
12742 d_u32align="$define"
12743 ;;
12744 esac
12745 $rm -f core core.try.* try.core
12746else
12747 rp='Can you access character data at unaligned addresses?'
12748 dflt='n'
12749 . ./myread
12750 case "$ans" in
12751 [yY]*) d_u32align="$undef" ;;
12752 *) d_u32align="$define" ;;
12753 esac
12754fi
12755
12756: see if ualarm exists
12757set ualarm d_ualarm
12758eval $inlibc
12759
12760: see if umask exists
12761set umask d_umask
12762eval $inlibc
12763
12764: see if usleep exists
12765set usleep d_usleep
12766eval $inlibc
12767
12768: see if ustat exists
12769set ustat d_ustat
12770eval $inlibc
12771
12772: backward compatibility for d_hvfork
12773if test X$d_hvfork != X; then
12774 d_vfork="$d_hvfork"
12775 d_hvfork=''
12776fi
12777: see if there is a vfork
12778val=''
12779set vfork val
12780eval $inlibc
12781
12782: Ok, but do we want to use it. vfork is reportedly unreliable in
12783: perl on Solaris 2.x, and probably elsewhere.
12784case "$val" in
12785$define)
12786 echo " "
12787 case "$usevfork" in
12788 false) dflt='n';;
12789 *) dflt='y';;
12790 esac
12791 cat <<'EOM'
12792
12793Perl can only use a vfork() that doesn't suffer from strict
12794restrictions on calling functions or modifying global data in
12795the child. For example, glibc-2.1 contains such a vfork()
12796that is unsuitable. If your system provides a proper fork()
12797call, chances are that you do NOT want perl to use vfork().
12798
12799EOM
12800 rp="Do you still want to use vfork()?"
12801 . ./myread
12802 case "$ans" in
12803 y|Y) ;;
12804 *)
12805 echo "Ok, we won't use vfork()."
12806 val="$undef"
12807 ;;
12808 esac
12809 ;;
12810esac
12811set d_vfork
12812eval $setvar
12813case "$d_vfork" in
12814$define) usevfork='true';;
12815*) usevfork='false';;
12816esac
12817
12818: see if this is an sysdir system
12819set sys/dir.h i_sysdir
12820eval $inhdr
12821
12822: see if this is an sysndir system
12823set sys/ndir.h i_sysndir
12824eval $inhdr
12825
12826: see if closedir exists
12827set closedir d_closedir
12828eval $inlibc
12829
12830case "$d_closedir" in
12831"$define")
12832 echo " "
12833 echo "Checking whether closedir() returns a status..." >&4
12834 cat > closedir.c <<EOM
12835#$i_dirent I_DIRENT /**/
12836#$i_sysdir I_SYS_DIR /**/
12837#$i_sysndir I_SYS_NDIR /**/
12838#$i_systypes I_SYS_TYPES /**/
12839
12840#if defined(I_SYS_TYPES)
12841#include <sys/types.h>
12842#endif
12843#if defined(I_DIRENT)
12844#include <dirent.h>
12845#if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
12846#include <sys/dir.h>
12847#endif
12848#else
12849#ifdef I_SYS_NDIR
12850#include <sys/ndir.h>
12851#else
12852#ifdef I_SYS_DIR
12853#ifdef hp9000s500
12854#include <ndir.h> /* may be wrong in the future */
12855#else
12856#include <sys/dir.h>
12857#endif
12858#endif
12859#endif
12860#endif
12861int main() { return closedir(opendir(".")); }
12862EOM
12863 set closedir
12864 if eval $compile_ok; then
12865 if ./closedir > /dev/null 2>&1 ; then
12866 echo "Yes, it does."
12867 val="$undef"
12868 else
12869 echo "No, it doesn't."
12870 val="$define"
12871 fi
12872 else
12873 echo "(I can't seem to compile the test program--assuming it doesn't)"
12874 val="$define"
12875 fi
12876 ;;
12877*)
12878 val="$undef";
12879 ;;
12880esac
12881set d_void_closedir
12882eval $setvar
12883$rm -f closedir*
12884: see if there is a wait4
12885set wait4 d_wait4
12886eval $inlibc
12887
12888: see if waitpid exists
12889set waitpid d_waitpid
12890eval $inlibc
12891
12892: see if wcstombs exists
12893set wcstombs d_wcstombs
12894eval $inlibc
12895
12896: see if wctomb exists
12897set wctomb d_wctomb
12898eval $inlibc
12899
12900: see if writev exists
12901set writev d_writev
12902eval $inlibc
12903
12904: preserve RCS keywords in files with variable substitution, grrr
12905Date='$Date'
12906Id='$Id'
12907Log='$Log'
12908RCSfile='$RCSfile'
12909Revision='$Revision'
12910
12911: check for alignment requirements
12912echo " "
12913case "$crosscompile$multiarch" in
12914*$define*)
12915 $cat <<EOM
12916You seem to be either cross-compiling or doing a multiarchitecture build,
12917skipping the memory alignment check.
12918
12919EOM
12920 case "$alignbytes" in
12921 '') alignbytes=8 ;;
12922 esac
12923 ;;
12924*)
12925 case "$alignbytes" in
12926 '') echo "Checking alignment constraints..." >&4
12927 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
12928 $cat >try.c <<'EOCP'
12929typedef long double NV;
12930EOCP
12931 else
12932 $cat >try.c <<'EOCP'
12933typedef double NV;
12934EOCP
12935 fi
12936 $cat >>try.c <<'EOCP'
12937#include <stdio.h>
12938struct foobar {
12939 char foo;
12940 NV bar;
12941} try_algn;
12942int main()
12943{
12944 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
12945 return(0);
12946}
12947EOCP
12948 set try
12949 if eval $compile_ok; then
12950 dflt=`./try`
12951 else
12952 dflt='8'
12953 echo "(I can't seem to compile the test program...)"
12954 fi
12955 ;;
12956 *) dflt="$alignbytes"
12957 ;;
12958 esac
12959 rp="Doubles must be aligned on a how-many-byte boundary?"
12960 . ./myread
12961 alignbytes="$ans"
12962 $rm -f try.c try
12963 ;;
12964esac
12965
12966
12967: set the base revision
12968baserev=5.0
12969
12970: how do we catenate cpp tokens here?
12971echo " "
12972echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
12973$cat >cpp_stuff.c <<'EOCP'
12974#define RCAT(a,b)a/**/b
12975#define ACAT(a,b)a ## b
12976RCAT(Rei,ser)
12977ACAT(Cir,cus)
12978EOCP
12979$cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
12980if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
12981 echo "Oh! Smells like ANSI's been here." >&4
12982 echo "We can catify or stringify, separately or together!"
12983 cpp_stuff=42
12984elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
12985 echo "Ah, yes! The good old days!" >&4
12986 echo "However, in the good old days we don't know how to stringify and"
12987 echo "catify at the same time."
12988 cpp_stuff=1
12989else
12990 $cat >&4 <<EOM
12991Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
12992to have to edit the values of CAT[2-5] in config.h...
12993EOM
12994 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
12995fi
12996$rm -f cpp_stuff.*
12997
12998: see if this is a db.h system
12999set db.h i_db
13000eval $inhdr
13001
13002case "$i_db" in
13003$define)
13004 : Check db version.
13005 echo " "
13006 echo "Checking Berkeley DB version ..." >&4
13007 $cat >try.c <<EOCP
13008#$d_const HASCONST
13009#ifndef HASCONST
13010#define const
13011#endif
13012#include <sys/types.h>
13013#include <stdio.h>
13014#include <db.h>
13015int main()
13016{
13017#ifdef DB_VERSION_MAJOR /* DB version >= 2 */
13018 int Major, Minor, Patch ;
13019 unsigned long Version ;
13020 (void)db_version(&Major, &Minor, &Patch) ;
13021 printf("You have Berkeley DB Version 2 or greater\n");
13022
13023 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
13024 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
13025 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
13026 Major, Minor, Patch) ;
13027
13028 /* check that db.h & libdb are compatible */
13029 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
13030 printf("db.h and libdb are incompatible\n") ;
13031 exit(3);
13032 }
13033
13034 printf("db.h and libdb are compatible\n") ;
13035
13036 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
13037 + DB_VERSION_PATCH ;
13038
13039 /* needs to be >= 2.3.4 */
13040 if (Version < 2003004) {
13041 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
13042 printf("but Perl needs Berkeley DB 2.3.4 or greater\n") ;
13043 exit(2);
13044 }
13045
13046 exit(0);
13047#else
13048#if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
13049 printf("You have Berkeley DB Version 1\n");
13050 exit(0); /* DB version < 2: the coast is clear. */
13051#else
13052 exit(1); /* <db.h> not Berkeley DB? */
13053#endif
13054#endif
13055}
13056EOCP
13057 set try
13058 if eval $compile_ok && ./try; then
13059 echo 'Looks OK.' >&4
13060 else
13061 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
13062 i_db=$undef
13063 case " $libs " in
13064 *"-ldb "*)
13065 : Remove db from list of libraries to use
13066 echo "Removing unusable -ldb from library list" >&4
13067 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
13068 shift
13069 libs="$*"
13070 echo "libs = $libs" >&4
13071 ;;
13072 esac
13073 fi
13074 $rm -f try.*
13075 ;;
13076esac
13077
13078case "$i_db" in
13079define)
13080 : Check the return type needed for hash
13081 echo " "
13082 echo "Checking return type needed for hash for Berkeley DB ..." >&4
13083 $cat >try.c <<EOCP
13084#$d_const HASCONST
13085#ifndef HASCONST
13086#define const
13087#endif
13088#include <sys/types.h>
13089#include <db.h>
13090
13091#ifndef DB_VERSION_MAJOR
13092u_int32_t hash_cb (ptr, size)
13093const void *ptr;
13094size_t size;
13095{
13096}
13097HASHINFO info;
13098int main()
13099{
13100 info.hash = hash_cb;
13101}
13102#endif
13103EOCP
13104 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13105 if $contains warning try.out >>/dev/null 2>&1 ; then
13106 db_hashtype='int'
13107 else
13108 db_hashtype='u_int32_t'
13109 fi
13110 else
13111 : XXX Maybe we should just give up here.
13112 db_hashtype=u_int32_t
13113 $cat try.out >&4
13114 echo "Help: I can't seem to compile the db test program." >&4
13115 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
13116 fi
13117 $rm -f try.*
13118 echo "Your version of Berkeley DB uses $db_hashtype for hash."
13119 ;;
13120*) db_hashtype=u_int32_t
13121 ;;
13122esac
13123case "$i_db" in
13124define)
13125 : Check the return type needed for prefix
13126 echo " "
13127 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
13128 cat >try.c <<EOCP
13129#$d_const HASCONST
13130#ifndef HASCONST
13131#define const
13132#endif
13133#include <sys/types.h>
13134#include <db.h>
13135
13136#ifndef DB_VERSION_MAJOR
13137size_t prefix_cb (key1, key2)
13138const DBT *key1;
13139const DBT *key2;
13140{
13141}
13142BTREEINFO info;
13143int main()
13144{
13145 info.prefix = prefix_cb;
13146}
13147#endif
13148EOCP
13149 if $cc $ccflags -c try.c >try.out 2>&1 ; then
13150 if $contains warning try.out >>/dev/null 2>&1 ; then
13151 db_prefixtype='int'
13152 else
13153 db_prefixtype='size_t'
13154 fi
13155 else
13156 db_prefixtype='size_t'
13157 : XXX Maybe we should just give up here.
13158 $cat try.out >&4
13159 echo "Help: I can't seem to compile the db test program." >&4
13160 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
13161 fi
13162 $rm -f try.*
13163 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
13164 ;;
13165*) db_prefixtype='size_t'
13166 ;;
13167esac
13168
13169
13170: How can we generate normalized random numbers ?
13171echo " "
13172echo "Looking for a random number function..." >&4
13173case "$randfunc" in
13174'')
13175 if set drand48 val -f; eval $csym; $val; then
13176 dflt="drand48"
13177 echo "Good, found drand48()." >&4
13178 elif set random val -f; eval $csym; $val; then
13179 dflt="random"
13180 echo "OK, found random()." >&4
13181 else
13182 dflt="rand"
13183 echo "Yick, looks like I have to use rand()." >&4
13184 fi
13185 echo " "
13186 ;;
13187*)
13188 dflt="$randfunc"
13189 ;;
13190esac
13191cont=true
13192
13193case "$ccflags" in
13194*-Dmy_rand=*|*-Dmy_srand=*)
13195 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
13196 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
13197 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
13198 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
13199 ;;
13200esac
13201
13202while $test "$cont"; do
13203 rp="Use which function to generate random numbers?"
13204 . ./myread
13205 if $test "$ans" = "$dflt"; then
13206 : null
13207 else
13208 randbits=''
13209 fi
13210 randfunc="$ans"
13211 if set $ans val -f; eval $csym; $val; then
13212 cont=''
13213 else
13214 dflt=y
13215 rp="I cannot find function $ans. Use that name anyway?"
13216 . ./myread
13217 dflt=rand
13218 case "$ans" in
13219 [yY]*) cont='';;
13220 esac
13221 fi
13222 case "$cont" in
13223 '')
13224 case "$randfunc" in
13225 drand48)
13226 drand01="drand48()"
13227 seedfunc="srand48"
13228 randbits=48
13229 randseedtype=long
13230 ;;
13231 rand|random)
13232 case "$randbits" in
13233 '')
13234echo "Checking to see how many bits your $randfunc() function produces..." >&4
13235 $cat >try.c <<EOCP
13236#$i_unistd I_UNISTD
13237#$i_stdlib I_STDLIB
13238#include <stdio.h>
13239#ifdef I_UNISTD
13240# include <unistd.h>
13241#endif
13242#ifdef I_STDLIB
13243# include <stdlib.h>
13244#endif
13245int main()
13246{
13247 register int i;
13248 register unsigned long tmp;
13249 register unsigned long max = 0L;
13250
13251 for (i = 1000; i; i--) {
13252 tmp = (unsigned long) $randfunc();
13253 if (tmp > max) max = tmp;
13254 }
13255 for (i = 0; max; i++)
13256 max /= 2;
13257 printf("%d\n",i);
13258}
13259EOCP
13260 set try
13261 if eval $compile_ok; then
13262 dflt=`try`
13263 else
13264 dflt='?'
13265 echo "(I can't seem to compile the test program...)"
13266 fi
13267 ;;
13268 *)
13269 dflt="$randbits"
13270 ;;
13271 esac
13272 rp="How many bits does your $randfunc() function produce?"
13273 . ./myread
13274 randbits="$ans"
13275 $rm -f try.c try
13276 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13277 seedfunc="s$randfunc"
13278 randseedtype=unsigned
13279 ;;
13280 *)
13281 dflt="31"
13282 rp="How many bits does your $randfunc() function produce?"
13283 . ./myread
13284 randbits="$ans"
13285 seedfunc="s$randfunc"
13286 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
13287 if set $seedfunc val -f; eval $csym; $val; then
13288 echo "(Using $seedfunc() to seed random generator)"
13289 else
13290 echo "(Warning: no $seedfunc() to seed random generator)"
13291 seedfunc=rand
13292 fi
13293 randseedtype=unsigned
13294 ;;
13295 esac
13296 ;;
13297 esac
13298done
13299
13300echo " "
13301echo "Determining whether or not we are on an EBCDIC system..." >&4
13302$cat >tebcdic.c <<'EOM'
13303int main()
13304{
13305 if ('M'==0xd4) return 0;
13306 return 1;
13307}
13308EOM
13309
13310val=$undef
13311set tebcdic
13312if eval $compile_ok; then
13313 if ./tebcdic; then
13314 echo "You seem to speak EBCDIC." >&4
13315 val="$define"
13316 else
13317 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
13318 fi
13319else
13320 echo "I'm unable to compile the test program." >&4
13321 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
13322fi
13323$rm -f tebcdic.c tebcdic
13324set ebcdic
13325eval $setvar
13326
13327echo " "
13328$cat >&4 <<EOM
13329Checking how to flush all pending stdio output...
13330EOM
13331# I only know how to find the first 32 possibly open files on SunOS.
13332# See also hints/sunos_4_1.sh and util.c --AD
13333case "$osname" in
13334sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
13335esac
13336$cat >>try.c <<EOCP
13337#include <stdio.h>
13338#$i_unistd I_UNISTD
13339#ifdef I_UNISTD
13340# include <unistd.h>
13341#endif
13342#$d_sysconf HAS_SYSCONF
13343#$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
13344#ifdef HAS_STDIO_STREAM_ARRAY
13345# define STDIO_STREAM_ARRAY $stdio_stream_array
13346#endif
13347int main() {
13348 FILE* p = fopen("try.out", "w");
13349#ifdef TRY_FPUTC
13350 fputc('x', p);
13351#else
13352# ifdef TRY_FPRINTF
13353 fprintf(p, "x");
13354# endif
13355#endif
13356#ifdef TRY_FFLUSH_NULL
13357 fflush(NULL);
13358#endif
13359#ifdef TRY_FFLUSH_ALL
13360 {
13361 long open_max = -1;
13362# ifdef PERL_FFLUSH_ALL_FOPEN_MAX
13363 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
13364# else
13365# if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
13366 open_max = sysconf(_SC_OPEN_MAX);
13367# else
13368# ifdef FOPEN_MAX
13369 open_max = FOPEN_MAX;
13370# else
13371# ifdef OPEN_MAX
13372 open_max = OPEN_MAX;
13373# else
13374# ifdef _NFILE
13375 open_max = _NFILE;
13376# endif
13377# endif
13378# endif
13379# endif
13380# endif
13381# ifdef HAS_STDIO_STREAM_ARRAY
13382 if (open_max > 0) {
13383 long i;
13384 for (i = 0; i < open_max; i++)
13385 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
13386 STDIO_STREAM_ARRAY[i]._file < open_max &&
13387 STDIO_STREAM_ARRAY[i]._flag)
13388 fflush(&STDIO_STREAM_ARRAY[i]);
13389 }
13390 }
13391# endif
13392#endif
13393 _exit(42);
13394}
13395EOCP
13396: first we have to find out how _not_ to flush
13397if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
13398 output=''
13399 set try -DTRY_FPUTC
13400 if eval $compile; then
13401 $rm -f try.out
13402 ./try$exe_ext 2>/dev/null
13403 if $test ! -s try.out -a "X$?" = X42; then
13404 output=-DTRY_FPUTC
13405 fi
13406 fi
13407 case "$output" in
13408 '')
13409 set try -DTRY_FPRINTF
13410 $rm -f try.out
13411 if eval $compile; then
13412 $rm -f try.out
13413 ./try$exe_ext 2>/dev/null
13414 if $test ! -s try.out -a "X$?" = X42; then
13415 output=-DTRY_FPRINTF
13416 fi
13417 fi
13418 ;;
13419 esac
13420fi
13421: check for fflush NULL behaviour
13422case "$fflushNULL" in
13423'') set try -DTRY_FFLUSH_NULL $output
13424 if eval $compile; then
13425 $rm -f try.out
13426 ./try$exe_ext 2>/dev/null
13427 code="$?"
13428 if $test -s try.out -a "X$code" = X42; then
13429 fflushNULL="`$cat try.out`"
13430 else
13431 if $test "X$code" != X42; then
13432 $cat >&4 <<EOM
13433(If this test failed, don't worry, we'll try another method shortly.)
13434EOM
13435 fi
13436 fi
13437 fi
13438 $rm -f core try.core core.try.*
13439 case "$fflushNULL" in
13440 x) $cat >&4 <<EOM
13441Your fflush(NULL) works okay for output streams.
13442Let's see if it clobbers input pipes...
13443EOM
13444# As of mid-March 2000 all versions of Solaris appear to have a stdio
13445# bug that improperly flushes the input end of pipes. So we avoid the
13446# autoflush on fork/system/exec support for now. :-(
13447$cat >tryp.c <<EOCP
13448#include <stdio.h>
13449int
13450main(int argc, char **argv)
13451{
13452 char buf[1024];
13453 int i;
13454 char *bp = buf;
13455 while (1) {
13456 while ((i = getc(stdin)) != -1
13457 && (*bp++ = i) != '\n'
13458 && bp < &buf[1024])
13459 /* DO NOTHING */ ;
13460 *bp = '\0';
13461 fprintf(stdout, "%s", buf);
13462 fflush(NULL);
13463 if (i == -1)
13464 return 0;
13465 bp = buf;
13466 }
13467}
13468EOCP
13469 fflushNULL="$define"
13470 set tryp
13471 if eval $compile; then
13472 $rm -f tryp.out
13473 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13474 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13475 $cat >&4 <<EOM
13476fflush(NULL) seems to behave okay with input streams.
13477EOM
13478 fflushNULL="$define"
13479 else
13480 $cat >&4 <<EOM
13481Ouch, fflush(NULL) clobbers input pipes! We will not use it.
13482EOM
13483 fflushNULL="$undef"
13484 fi
13485 fi
13486 $rm -f core tryp.c tryp.core core.tryp.*
13487 ;;
13488 '') $cat >&4 <<EOM
13489Your fflush(NULL) isn't working (contrary to ANSI C).
13490EOM
13491 fflushNULL="$undef"
13492 ;;
13493 *) $cat >&4 <<EOM
13494Cannot figure out whether your fflush(NULL) works or not.
13495I'm assuming it doesn't (contrary to ANSI C).
13496EOM
13497 fflushNULL="$undef"
13498 ;;
13499 esac
13500 ;;
13501$define|true|[yY]*)
13502 fflushNULL="$define"
13503 ;;
13504*)
13505 fflushNULL="$undef"
13506 ;;
13507esac
13508: check explicit looping only if NULL did not work, and if the pipe
13509: bug does not show up on an explicit flush too
13510case "$fflushNULL" in
13511"$undef")
13512 $cat >tryp.c <<EOCP
13513#include <stdio.h>
13514int
13515main(int argc, char **argv)
13516{
13517 char buf[1024];
13518 int i;
13519 char *bp = buf;
13520 while (1) {
13521 while ((i = getc(stdin)) != -1
13522 && (*bp++ = i) != '\n'
13523 && bp < &buf[1024])
13524 /* DO NOTHING */ ;
13525 *bp = '\0';
13526 fprintf(stdout, "%s", buf);
13527 fflush(stdin);
13528 if (i == -1)
13529 return 0;
13530 bp = buf;
13531 }
13532}
13533EOCP
13534 set tryp
13535 if eval $compile; then
13536 $rm -f tryp.out
13537 $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
13538 if cmp tryp.c tryp.out >/dev/null 2>&1; then
13539 $cat >&4 <<EOM
13540Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
13541EOM
13542 : now check for fflushall behaviour
13543 case "$fflushall" in
13544 '') set try -DTRY_FFLUSH_ALL $output
13545 if eval $compile; then
13546 $cat >&4 <<EOM
13547(Now testing the other method--but note that this also may fail.)
13548EOM
13549 $rm -f try.out
13550 ./try$exe_ext 2>/dev/null
13551 if $test -s try.out -a "X$?" = X42; then
13552 fflushall="`$cat try.out`"
13553 fi
13554 fi
13555 $rm -f core try.core core.try.*
13556 case "$fflushall" in
13557 x) $cat >&4 <<EOM
13558Whew. Flushing explicitly all the stdio streams works.
13559EOM
13560 fflushall="$define"
13561 ;;
13562 '') $cat >&4 <<EOM
13563Sigh. Flushing explicitly all the stdio streams doesn't work.
13564EOM
13565 fflushall="$undef"
13566 ;;
13567 *) $cat >&4 <<EOM
13568Cannot figure out whether flushing stdio streams explicitly works or not.
13569I'm assuming it doesn't.
13570EOM
13571 fflushall="$undef"
13572 ;;
13573 esac
13574 ;;
13575 "$define"|true|[yY]*)
13576 fflushall="$define"
13577 ;;
13578 *)
13579 fflushall="$undef"
13580 ;;
13581 esac
13582 else
13583 $cat >&4 <<EOM
13584All is futile. Even fflush(stdin) clobbers input pipes!
13585EOM
13586 fflushall="$undef"
13587 fi
13588 else
13589 fflushall="$undef"
13590 fi
13591 $rm -f core tryp.c tryp.core core.tryp.*
13592 ;;
13593*) fflushall="$undef"
13594 ;;
13595esac
13596
13597case "$fflushNULL$fflushall" in
13598undefundef)
13599 $cat <<EOM
13600OK, I give up. I cannot figure out how to flush pending stdio output.
13601We won't be flushing handles at all before fork/exec/popen.
13602EOM
13603 ;;
13604esac
13605$rm -f try.* try$exe_ext
13606
13607: Store the full pathname to the ar program for use in the C program
13608: Respect a hint or command line value for full_ar.
13609case "$full_ar" in
13610'') full_ar=$ar ;;
13611esac
13612
13613: Store the full pathname to the sed program for use in the C program
13614full_sed=$sed
13615
13616: see what type gids are declared as in the kernel
13617echo " "
13618echo "Looking for the type for group ids returned by getgid()."
13619set gid_t gidtype xxx stdio.h sys/types.h
13620eval $typedef
13621case "$gidtype" in
13622xxx)
13623 xxx=`./findhdr sys/user.h`
13624 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
13625 case $1 in
13626 unsigned) dflt="$1 $2" ;;
13627 *) dflt="$1" ;;
13628 esac
13629 ;;
13630*) dflt="$gidtype";;
13631esac
13632case "$gidtype" in
13633gid_t) echo "gid_t found." ;;
13634*) rp="What is the type for group ids returned by getgid()?"
13635 . ./myread
13636 gidtype="$ans"
13637 ;;
13638esac
13639
13640echo " "
13641case "$gidtype" in
13642*_t) zzz="$gidtype" ;;
13643*) zzz="gid" ;;
13644esac
13645echo "Checking the size of $zzz..." >&4
13646cat > try.c <<EOCP
13647#include <sys/types.h>
13648#include <stdio.h>
13649int main() {
13650 printf("%d\n", (int)sizeof($gidtype));
13651 exit(0);
13652}
13653EOCP
13654set try
13655if eval $compile_ok; then
13656 yyy=`./try`
13657 case "$yyy" in
13658 '') gidsize=4
13659 echo "(I can't execute the test program--guessing $gidsize.)" >&4
13660 ;;
13661 *) gidsize=$yyy
13662 echo "Your $zzz is $gidsize bytes long."
13663 ;;
13664 esac
13665else
13666 gidsize=4
13667 echo "(I can't compile the test program--guessing $gidsize.)" >&4
13668fi
13669
13670
13671echo " "
13672case "$gidtype" in
13673*_t) zzz="$gidtype" ;;
13674*) zzz="gid" ;;
13675esac
13676echo "Checking the sign of $zzz..." >&4
13677cat > try.c <<EOCP
13678#include <sys/types.h>
13679#include <stdio.h>
13680int main() {
13681 $gidtype foo = -1;
13682 if (foo < 0)
13683 printf("-1\n");
13684 else
13685 printf("1\n");
13686}
13687EOCP
13688set try
13689if eval $compile; then
13690 yyy=`./try`
13691 case "$yyy" in
13692 '') gidsign=1
13693 echo "(I can't execute the test program--guessing unsigned.)" >&4
13694 ;;
13695 *) gidsign=$yyy
13696 case "$gidsign" in
13697 1) echo "Your $zzz is unsigned." ;;
13698 -1) echo "Your $zzz is signed." ;;
13699 esac
13700 ;;
13701 esac
13702else
13703 gidsign=1
13704 echo "(I can't compile the test program--guessing unsigned.)" >&4
13705fi
13706
13707
13708echo " "
13709
13710if $test X"$quadtype" != X; then
13711
13712echo "Checking how to print 64-bit integers..." >&4
13713
13714if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
13715 $cat >try.c <<'EOCP'
13716#include <sys/types.h>
13717#include <stdio.h>
13718int main() {
13719 int q = 12345678901;
13720 printf("%ld\n", q);
13721}
13722EOCP
13723 set try
13724 if eval $compile; then
13725 yyy=`./try$exe_ext`
13726 case "$yyy" in
13727 12345678901)
13728 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
13729 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
13730 echo "We will use %d."
13731 ;;
13732 esac
13733 fi
13734fi
13735
13736if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
13737 $cat >try.c <<'EOCP'
13738#include <sys/types.h>
13739#include <stdio.h>
13740int main() {
13741 long q = 12345678901;
13742 printf("%ld\n", q);
13743}
13744EOCP
13745 set try
13746 if eval $compile; then
13747 yyy=`./try$exe_ext`
13748 case "$yyy" in
13749 12345678901)
13750 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
13751 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
13752 echo "We will use %ld."
13753 ;;
13754 esac
13755 fi
13756fi
13757
13758if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
13759 $cat >try.c <<'EOCP'
13760#include <sys/types.h>
13761#include <inttypes.h>
13762#include <stdio.h>
13763int main() {
13764 int64_t q = 12345678901;
13765 printf("%" PRId64 "\n", q);
13766}
13767EOCP
13768 set try
13769 if eval $compile; then
13770 yyy=`./try$exe_ext`
13771 case "$yyy" in
13772 12345678901)
13773 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
13774 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
13775 echo "We will use the C9X style."
13776 ;;
13777 esac
13778 fi
13779fi
13780
13781if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
13782 $cat >try.c <<'EOCP'
13783#include <sys/types.h>
13784#include <stdio.h>
13785int main() {
13786 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
13787 printf("%lld\n", q);
13788}
13789EOCP
13790 set try
13791 if eval $compile; then
13792 yyy=`./try$exe_ext`
13793 case "$yyy" in
13794 12345678901)
13795 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
13796 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
13797 echo "We will use the %lld style."
13798 ;;
13799 esac
13800 fi
13801fi
13802
13803if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13804 $cat >try.c <<EOCP
13805#include <sys/types.h>
13806#include <stdio.h>
13807int main() {
13808 $quadtype q = 12345678901;
13809 printf("%Ld\n", q);
13810}
13811EOCP
13812 set try
13813 if eval $compile; then
13814 yyy=`./try$exe_ext`
13815 case "$yyy" in
13816 12345678901)
13817 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
13818 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
13819 echo "We will use %Ld."
13820 ;;
13821 esac
13822 fi
13823fi
13824
13825if $test X"$sPRId64" = X -a X"$quadtype" != X; then
13826 $cat >try.c <<EOCP
13827#include <sys/types.h>
13828#include <stdio.h>
13829int main() {
13830 $quadtype q = 12345678901;
13831 printf("%qd\n", q);
13832}
13833EOCP
13834 set try
13835 if eval $compile; then
13836 yyy=`./try$exe_ext`
13837 case "$yyy" in
13838 12345678901)
13839 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
13840 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
13841 echo "We will use %qd."
13842 ;;
13843 esac
13844 fi
13845fi
13846
13847if $test X"$sPRId64" = X; then
13848 echo "Cannot figure out how to print 64-bit integers." >&4
13849fi
13850
13851$rm -f try try.*
13852
13853fi
13854
13855case "$sPRId64" in
13856'') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
13857 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
13858 ;;
13859*) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
13860 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
13861 ;;
13862esac
13863
13864
13865echo " "
13866$echo "Checking the format strings to be used for Perl's internal types..." >&4
13867
13868if $test X"$ivsize" = X8; then
13869 ivdformat="$sPRId64"
13870 uvuformat="$sPRIu64"
13871 uvoformat="$sPRIo64"
13872 uvxformat="$sPRIx64"
13873 uvXUformat="$sPRIXU64"
13874else
13875 if $test X"$ivsize" = X"$longsize"; then
13876 ivdformat='"ld"'
13877 uvuformat='"lu"'
13878 uvoformat='"lo"'
13879 uvxformat='"lx"'
13880 uvXUformat='"lX"'
13881 else
13882 if $test X"$ivsize" = X"$intsize"; then
13883 ivdformat='"d"'
13884 uvuformat='"u"'
13885 uvoformat='"o"'
13886 uvxformat='"x"'
13887 uvXUformat='"X"'
13888 else
13889 : far out
13890 if $test X"$ivsize" = X"$shortsize"; then
13891 ivdformat='"hd"'
13892 uvuformat='"hu"'
13893 uvoformat='"ho"'
13894 uvxformat='"hx"'
13895 uvXUformat='"hX"'
13896 fi
13897 fi
13898 fi
13899fi
13900
13901if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
13902 nveformat="$sPRIeldbl"
13903 nvfformat="$sPRIfldbl"
13904 nvgformat="$sPRIgldbl"
13905 nvEUformat="$sPRIEUldbl"
13906 nvFUformat="$sPRIFUldbl"
13907 nvGUformat="$sPRIGUldbl"
13908else
13909 nveformat='"e"'
13910 nvfformat='"f"'
13911 nvgformat='"g"'
13912 nvEUformat='"E"'
13913 nvFUformat='"F"'
13914 nvGUformat='"G"'
13915fi
13916
13917case "$ivdformat" in
13918'') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
13919 exit 1
13920 ;;
13921esac
13922
13923
13924echo " "
13925$echo "Checking the format string to be used for gids..." >&4
13926
13927case "$gidsign" in
13928-1) if $test X"$gidsize" = X"$ivsize"; then
13929 gidformat="$ivdformat"
13930 else
13931 if $test X"$gidsize" = X"$longsize"; then
13932 gidformat='"ld"'
13933 else
13934 if $test X"$gidsize" = X"$intsize"; then
13935 gidformat='"d"'
13936 else
13937 if $test X"$gidsize" = X"$shortsize"; then
13938 gidformat='"hd"'
13939 fi
13940 fi
13941 fi
13942 fi
13943 ;;
13944*) if $test X"$gidsize" = X"$uvsize"; then
13945 gidformat="$uvuformat"
13946 else
13947 if $test X"$gidsize" = X"$longsize"; then
13948 gidformat='"lu"'
13949 else
13950 if $test X"$gidsize" = X"$intsize"; then
13951 gidformat='"u"'
13952 else
13953 if $test X"$gidsize" = X"$shortsize"; then
13954 gidformat='"hu"'
13955 fi
13956 fi
13957 fi
13958 fi
13959 ;;
13960esac
13961
13962: see if getgroups exists
13963set getgroups d_getgrps
13964eval $inlibc
13965
13966: see if setgroups exists
13967set setgroups d_setgrps
13968eval $inlibc
13969
13970
13971: Find type of 2nd arg to 'getgroups()' and 'setgroups()'
13972echo " "
13973case "$d_getgrps$d_setgrps" in
13974*define*)
13975 case "$groupstype" in
13976 '') dflt="$gidtype" ;;
13977 *) dflt="$groupstype" ;;
13978 esac
13979 $cat <<EOM
13980What type of pointer is the second argument to getgroups() and setgroups()?
13981Usually this is the same as group ids, $gidtype, but not always.
13982
13983EOM
13984 rp='What type pointer is the second argument to getgroups() and setgroups()?'
13985 . ./myread
13986 groupstype="$ans"
13987 ;;
13988*) groupstype="$gidtype";;
13989esac
13990
13991echo " "
13992echo "Checking if your $make program sets \$(MAKE)..." >&4
13993case "$make_set_make" in
13994'')
13995 $sed 's/^X //' > testmake.mak << 'EOF'
13996Xall:
13997X @echo 'maketemp="$(MAKE)"'
13998EOF
13999 case "`$make -f testmake.mak 2>/dev/null`" in
14000 *maketemp=*) make_set_make='#' ;;
14001 *) make_set_make="MAKE=$make" ;;
14002 esac
14003 $rm -f testmake.mak
14004 ;;
14005esac
14006case "$make_set_make" in
14007'#') echo "Yup, it does.";;
14008*) echo "Nope, it doesn't.";;
14009esac
14010
14011: see what type is used for mode_t
14012rp="What is the type used for file modes for system calls (e.g. fchmod())?"
14013set mode_t modetype int stdio.h sys/types.h
14014eval $typedef_ask
14015
14016: see if stdarg is available
14017echo " "
14018if $test `./findhdr stdarg.h`; then
14019 echo "<stdarg.h> found." >&4
14020 valstd="$define"
14021else
14022 echo "<stdarg.h> NOT found." >&4
14023 valstd="$undef"
14024fi
14025
14026: see if varags is available
14027echo " "
14028if $test `./findhdr varargs.h`; then
14029 echo "<varargs.h> found." >&4
14030else
14031 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
14032fi
14033
14034: set up the varargs testing programs
14035$cat > varargs.c <<EOP
14036#ifdef I_STDARG
14037#include <stdarg.h>
14038#endif
14039#ifdef I_VARARGS
14040#include <varargs.h>
14041#endif
14042
14043#ifdef I_STDARG
14044int f(char *p, ...)
14045#else
14046int f(va_alist)
14047va_dcl
14048#endif
14049{
14050 va_list ap;
14051#ifndef I_STDARG
14052 char *p;
14053#endif
14054#ifdef I_STDARG
14055 va_start(ap,p);
14056#else
14057 va_start(ap);
14058 p = va_arg(ap, char *);
14059#endif
14060 va_end(ap);
14061}
14062EOP
14063$cat > varargs <<EOP
14064$startsh
14065if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
14066 echo "true"
14067else
14068 echo "false"
14069fi
14070$rm -f varargs$_o
14071EOP
14072chmod +x varargs
14073
14074: now check which varargs header should be included
14075echo " "
14076i_varhdr=''
14077case "$valstd" in
14078"$define")
14079 if `./varargs I_STDARG`; then
14080 val='stdarg.h'
14081 elif `./varargs I_VARARGS`; then
14082 val='varargs.h'
14083 fi
14084 ;;
14085*)
14086 if `./varargs I_VARARGS`; then
14087 val='varargs.h'
14088 fi
14089 ;;
14090esac
14091case "$val" in
14092'')
14093echo "I could not find the definition for va_dcl... You have problems..." >&4
14094 val="$undef"; set i_stdarg; eval $setvar
14095 val="$undef"; set i_varargs; eval $setvar
14096 ;;
14097*)
14098 set i_varhdr
14099 eval $setvar
14100 case "$i_varhdr" in
14101 stdarg.h)
14102 val="$define"; set i_stdarg; eval $setvar
14103 val="$undef"; set i_varargs; eval $setvar
14104 ;;
14105 varargs.h)
14106 val="$undef"; set i_stdarg; eval $setvar
14107 val="$define"; set i_varargs; eval $setvar
14108 ;;
14109 esac
14110 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
14111esac
14112$rm -f varargs*
14113
14114: see if we need va_copy
14115echo " "
14116case "$i_stdarg" in
14117"$define")
14118 $cat >try.c <<EOCP
14119#include <stdarg.h>
14120#include <stdio.h>
14121#$i_stdlib I_STDLIB
14122#ifdef I_STDLIB
14123#include <stdlib.h>
14124#endif
14125#include <signal.h>
14126
14127int
14128ivfprintf(FILE *f, const char *fmt, va_list *valp)
14129{
14130 return vfprintf(f, fmt, *valp);
14131}
14132
14133int
14134myvfprintf(FILE *f, const char *fmt, va_list val)
14135{
14136 return ivfprintf(f, fmt, &val);
14137}
14138
14139int
14140myprintf(char *fmt, ...)
14141{
14142 va_list val;
14143 va_start(val, fmt);
14144 return myvfprintf(stdout, fmt, val);
14145}
14146
14147int
14148main(int ac, char **av)
14149{
14150 signal(SIGSEGV, exit);
14151
14152 myprintf("%s%cs all right, then\n", "that", '\'');
14153 exit(0);
14154}
14155EOCP
14156 set try
14157 if eval $compile && ./try 2>&1 >/dev/null; then
14158 case "`./try`" in
14159 "that's all right, then")
14160 okay=yes
14161 ;;
14162 esac
14163 fi
14164 case "$okay" in
14165 yes) echo "It seems that you don't need va_copy()." >&4
14166 need_va_copy="$undef"
14167 ;;
14168 *) echo "It seems that va_copy() or similar will be needed." >&4
14169 need_va_copy="$define"
14170 ;;
14171 esac
14172 $rm -f try.* core core.* *.core *.core.*
14173 ;;
14174*) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
14175 ;;
14176esac
14177
14178: define a fucntion to check prototypes
14179$cat > protochk <<EOSH
14180$startsh
14181cc="$cc"
14182optimize="$optimize"
14183ccflags="$ccflags"
14184prototype="$prototype"
14185define="$define"
14186rm=$rm
14187EOSH
14188
14189$cat >> protochk <<'EOSH'
14190
14191$rm -f try.c
14192foo="$1"
14193shift
14194while test $# -ge 2; do
14195 case "$1" in
14196 $define) echo "#include <$2>" >> try.c ;;
14197 literal) echo "$2" >> try.c ;;
14198 esac
14199 shift 2
14200done
14201test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
14202cat >> try.c <<'EOCP'
14203#ifdef CAN_PROTOTYPE
14204#define _(args) args
14205#else
14206#define _(args) ()
14207#endif
14208EOCP
14209echo "$foo" >> try.c
14210echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
14211$cc $optimize $ccflags -c try.c > /dev/null 2>&1
14212status=$?
14213$rm -f try.[co]
14214exit $status
14215EOSH
14216chmod +x protochk
14217$eunicefix protochk
14218
14219: see what type is used for size_t
14220rp="What is the type used for the length parameter for string functions?"
14221set size_t sizetype 'unsigned int' stdio.h sys/types.h
14222eval $typedef_ask
14223
14224: check for type of arguments to gethostbyaddr.
14225if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
14226 case "$d_gethbyaddr" in
14227 $define)
14228 $cat <<EOM
14229
14230Checking to see what type of arguments are accepted by gethostbyaddr().
14231EOM
14232 hdrs="$define sys/types.h
14233 $d_socket sys/socket.h
14234 $i_niin netinet/in.h
14235 $i_netdb netdb.h
14236 $i_unistd unistd.h"
14237 : The first arg can 'char *' or 'void *'
14238 : The second arg is some of integral type
14239 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
14240 for yyy in size_t long int; do
14241 case "$netdb_host_type" in
14242 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
14243 if ./protochk "$try" $hdrs; then
14244 echo "Your system accepts $xxx for the first arg."
14245 echo "...and $yyy for the second arg."
14246 netdb_host_type="$xxx"
14247 netdb_hlen_type="$yyy"
14248 fi
14249 ;;
14250 esac
14251 done
14252 done
14253 : In case none of those worked, prompt the user.
14254 case "$netdb_host_type" in
14255 '') rp='What is the type for the 1st argument to gethostbyaddr?'
14256 dflt='char *'
14257 . ./myread
14258 netdb_host_type=$ans
14259 rp='What is the type for the 2nd argument to gethostbyaddr?'
14260 dflt="$sizetype"
14261 . ./myread
14262 netdb_hlen_type=$ans
14263 ;;
14264 esac
14265 ;;
14266 *) : no gethostbyaddr, so pick harmless defaults
14267 netdb_host_type='char *'
14268 netdb_hlen_type="$sizetype"
14269 ;;
14270 esac
14271 # Remove the "const" if needed. -- but then we'll have a
14272 # prototype clash!
14273 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
14274fi
14275
14276: check for type of argument to gethostbyname.
14277if test "X$netdb_name_type" = X ; then
14278 case "$d_gethbyname" in
14279 $define)
14280 $cat <<EOM
14281
14282Checking to see what type of argument is accepted by gethostbyname().
14283EOM
14284 hdrs="$define sys/types.h
14285 $d_socket sys/socket.h
14286 $i_niin netinet/in.h
14287 $i_netdb netdb.h
14288 $i_unistd unistd.h"
14289 for xxx in "const char *" "char *"; do
14290 case "$netdb_name_type" in
14291 '') try="extern struct hostent *gethostbyname($xxx);"
14292 if ./protochk "$try" $hdrs; then
14293 echo "Your system accepts $xxx."
14294 netdb_name_type="$xxx"
14295 fi
14296 ;;
14297 esac
14298 done
14299 : In case none of those worked, prompt the user.
14300 case "$netdb_name_type" in
14301 '') rp='What is the type for the 1st argument to gethostbyname?'
14302 dflt='char *'
14303 . ./myread
14304 netdb_name_type=$ans
14305 ;;
14306 esac
14307 ;;
14308 *) : no gethostbyname, so pick harmless default
14309 netdb_name_type='char *'
14310 ;;
14311 esac
14312fi
14313
14314: check for type of 1st argument to getnetbyaddr.
14315if test "X$netdb_net_type" = X ; then
14316 case "$d_getnbyaddr" in
14317 $define)
14318 $cat <<EOM
14319
14320Checking to see what type of 1st argument is accepted by getnetbyaddr().
14321EOM
14322 hdrs="$define sys/types.h
14323 $d_socket sys/socket.h
14324 $i_niin netinet/in.h
14325 $i_netdb netdb.h
14326 $i_unistd unistd.h"
14327 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
14328 case "$netdb_net_type" in
14329 '') try="extern struct netent *getnetbyaddr($xxx, int);"
14330 if ./protochk "$try" $hdrs; then
14331 echo "Your system accepts $xxx."
14332 netdb_net_type="$xxx"
14333 fi
14334 ;;
14335 esac
14336 done
14337 : In case none of those worked, prompt the user.
14338 case "$netdb_net_type" in
14339 '') rp='What is the type for the 1st argument to getnetbyaddr?'
14340 dflt='long'
14341 . ./myread
14342 netdb_net_type=$ans
14343 ;;
14344 esac
14345 ;;
14346 *) : no getnetbyaddr, so pick harmless default
14347 netdb_net_type='long'
14348 ;;
14349 esac
14350fi
14351: locate the preferred pager for this system
14352case "$pager" in
14353'')
14354 dflt=''
14355 case "$pg" in
14356 /*) dflt=$pg;;
14357 [a-zA-Z]:/*) dflt=$pg;;
14358 esac
14359 case "$more" in
14360 /*) dflt=$more;;
14361 [a-zA-Z]:/*) dflt=$more;;
14362 esac
14363 case "$less" in
14364 /*) dflt=$less;;
14365 [a-zA-Z]:/*) dflt=$less;;
14366 esac
14367 case "$dflt" in
14368 '') dflt=/usr/ucb/more;;
14369 esac
14370 ;;
14371*) dflt="$pager";;
14372esac
14373echo " "
14374fn=f/
14375rp='What pager is used on your system?'
14376. ./getfile
14377pager="$ans"
14378
14379: see what type pids are declared as in the kernel
14380rp="What is the type of process ids on this system?"
14381set pid_t pidtype int stdio.h sys/types.h
14382eval $typedef_ask
14383
14384: Find earliest binary compatible site_perl subdirectory perl can use.
14385case "$bincompat5005" in
14386"$define") xs_apiversion='5.005' ;;
14387*) xs_apiversion=$version ;; # The current site_perl version.
14388esac
14389: Find earliest pure perl site_perl subdirectory perl can use.
14390: The versioned directories started at 5.005.
14391pm_apiversion='5.005'
14392
14393: see if ar generates random libraries by itself
14394echo " "
14395echo "Checking how to generate random libraries on your machine..." >&4
14396echo 'int bar1() { return bar2(); }' > bar1.c
14397echo 'int bar2() { return 2; }' > bar2.c
14398$cat > foo.c <<'EOP'
14399int main() { printf("%d\n", bar1()); exit(0); }
14400EOP
14401$cc $ccflags -c bar1.c >/dev/null 2>&1
14402$cc $ccflags -c bar2.c >/dev/null 2>&1
14403$cc $ccflags -c foo.c >/dev/null 2>&1
14404$ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
14405if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14406 ./foobar >/dev/null 2>&1; then
14407 echo "$ar appears to generate random libraries itself."
14408 orderlib=false
14409 ranlib=":"
14410elif $ar ts bar$_a >/dev/null 2>&1 &&
14411 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
14412 ./foobar >/dev/null 2>&1; then
14413 echo "a table of contents needs to be added with '$ar ts'."
14414 orderlib=false
14415 ranlib="$ar ts"
14416else
14417 case "$ranlib" in
14418 :) ranlib='';;
14419 '')
14420 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
14421 $test -f $ranlib || ranlib=''
14422 ;;
14423 esac
14424 if $test -n "$ranlib"; then
14425 echo "your system has '$ranlib'; we'll use that."
14426 orderlib=false
14427 else
14428 echo "your system doesn't seem to support random libraries"
14429 echo "so we'll use lorder and tsort to order the libraries."
14430 orderlib=true
14431 ranlib=":"
14432 fi
14433fi
14434$rm -f foo* bar*
14435
14436: check for type of arguments to select.
14437case "$selecttype" in
14438'') case "$d_select" in
14439 $define)
14440 echo " "
14441 $cat <<EOM
14442Checking to see what type of arguments are accepted by select().
14443EOM
14444 hdrs="$define sys/types.h
14445 $i_systime sys/time.h
14446 $i_sysselct sys/select.h
14447 $d_socket sys/socket.h"
14448 : The first arg can be int, unsigned, or size_t
14449 : The last arg may or may not be 'const'
14450 val=''
14451 : void pointer has been seen but using that
14452 : breaks the selectminbits test
14453 for xxx in 'fd_set *' 'int *'; do
14454 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
14455 for tmo in 'struct timeval *' 'const struct timeval *'; do
14456 case "$val" in
14457 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
14458 if ./protochk "$try" $hdrs; then
14459 echo "Your system accepts $xxx."
14460 val="$xxx"
14461 fi
14462 ;;
14463 esac
14464 done
14465 done
14466 done
14467 case "$val" in
14468 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
14469 case "$d_fd_set" in
14470 $define) dflt="fd_set *" ;;
14471 *) dflt="int *" ;;
14472 esac
14473 . ./myread
14474 val=$ans
14475 ;;
14476 esac
14477 selecttype="$val"
14478 ;;
14479 *) : no select, so pick a harmless default
14480 selecttype='int *'
14481 ;;
14482 esac
14483 ;;
14484esac
14485
14486: check for the select 'width'
14487case "$selectminbits" in
14488'') case "$d_select" in
14489 $define)
14490 $cat <<EOM
14491
14492Checking to see on how many bits at a time your select() operates...
14493EOM
14494 $cat >try.c <<EOCP
14495#include <sys/types.h>
14496#$i_time I_TIME
14497#$i_systime I_SYS_TIME
14498#$i_systimek I_SYS_TIME_KERNEL
14499#ifdef I_TIME
14500# include <time.h>
14501#endif
14502#ifdef I_SYS_TIME
14503# ifdef I_SYS_TIME_KERNEL
14504# define KERNEL
14505# endif
14506# include <sys/time.h>
14507# ifdef I_SYS_TIME_KERNEL
14508# undef KERNEL
14509# endif
14510#endif
14511#$i_sysselct I_SYS_SELECT
14512#ifdef I_SYS_SELECT
14513#include <sys/select.h>
14514#endif
14515#$d_socket HAS_SOCKET
14516#ifdef HAS_SOCKET
14517# include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
14518#endif
14519#include <stdio.h>
14520$selecttype b;
14521#define S sizeof(*(b))
14522#define MINBITS 64
14523#define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
14524#define NBITS (NBYTES * 8)
14525int main() {
14526 char s[NBYTES];
14527 struct timeval t;
14528 int i;
14529 FILE* fp;
14530 int fd;
14531
14532 fclose(stdin);
14533 fp = fopen("try.c", "r");
14534 if (fp == 0)
14535 exit(1);
14536 fd = fileno(fp);
14537 if (fd < 0)
14538 exit(2);
14539 b = ($selecttype)s;
14540 for (i = 0; i < NBITS; i++)
14541 FD_SET(i, b);
14542 t.tv_sec = 0;
14543 t.tv_usec = 0;
14544 select(fd + 1, b, 0, 0, &t);
14545 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
14546 printf("%d\n", i + 1);
14547 return 0;
14548}
14549EOCP
14550 set try
14551 if eval $compile_ok; then
14552 selectminbits=`./try`
14553 case "$selectminbits" in
14554 '') cat >&4 <<EOM
14555Cannot figure out on how many bits at a time your select() operates.
14556I'll play safe and guess it is 32 bits.
14557EOM
14558 selectminbits=32
14559 bits="32 bits"
14560 ;;
14561 1) bits="1 bit" ;;
14562 *) bits="$selectminbits bits" ;;
14563 esac
14564 echo "Your select() operates on $bits at a time." >&4
14565 else
14566 rp='What is the minimum number of bits your select() operates on?'
14567 case "$byteorder" in
14568 1234|12345678) dflt=32 ;;
14569 *) dflt=1 ;;
14570 esac
14571 . ./myread
14572 val=$ans
14573 selectminbits="$val"
14574 fi
14575 $rm -f try.* try
14576 ;;
14577 *) : no select, so pick a harmless default
14578 selectminbits='32'
14579 ;;
14580 esac
14581 ;;
14582esac
14583
14584: Trace out the files included by signal.h, then look for SIGxxx names.
14585: Remove SIGARRAYSIZE used by HPUX.
14586: Remove SIGSTKSIZE used by Linux.
14587: Remove SIGSTKSZ used by Posix.
14588: Remove SIGTYP void lines used by OS2.
14589: Some cpps, like os390, dont give the file name anywhere
14590if [ "X$fieldn" = X ]; then
14591 : Just make some guesses. We check them later.
14592 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
14593else
14594 xxx=`echo '#include <signal.h>' |
14595 $cppstdin $cppminus $cppflags 2>/dev/null |
14596 $grep '^[ ]*#.*include' |
14597 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
14598fi
14599: Check this list of files to be sure we have parsed the cpp output ok.
14600: This will also avoid potentially non-existent files, such
14601: as ../foo/bar.h
14602xxxfiles=''
14603for xx in $xxx /dev/null ; do
14604 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
14605done
14606: If we have found no files, at least try signal.h
14607case "$xxxfiles" in
14608'') xxxfiles=`./findhdr signal.h` ;;
14609esac
14610xxx=`awk '
14611$1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
14612 print substr($2, 4, 20)
14613}
14614$1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
14615 print substr($3, 4, 20)
14616}' $xxxfiles`
14617: Append some common names just in case the awk scan failed.
14618xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
14619xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
14620xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
14621xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
14622xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
14623
14624: generate a few handy files for later
14625$cat > signal.c <<'EOCP'
14626#include <sys/types.h>
14627#include <signal.h>
14628#include <stdio.h>
14629int main() {
14630
14631/* Strange style to avoid deeply-nested #if/#else/#endif */
14632#ifndef NSIG
14633# ifdef _NSIG
14634# define NSIG (_NSIG)
14635# endif
14636#endif
14637
14638#ifndef NSIG
14639# ifdef SIGMAX
14640# define NSIG (SIGMAX+1)
14641# endif
14642#endif
14643
14644#ifndef NSIG
14645# ifdef SIG_MAX
14646# define NSIG (SIG_MAX+1)
14647# endif
14648#endif
14649
14650#ifndef NSIG
14651# ifdef MAXSIG
14652# define NSIG (MAXSIG+1)
14653# endif
14654#endif
14655
14656#ifndef NSIG
14657# ifdef MAX_SIG
14658# define NSIG (MAX_SIG+1)
14659# endif
14660#endif
14661
14662#ifndef NSIG
14663# ifdef SIGARRAYSIZE
14664# define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
14665# endif
14666#endif
14667
14668#ifndef NSIG
14669# ifdef _sys_nsig
14670# define NSIG (_sys_nsig) /* Solaris 2.5 */
14671# endif
14672#endif
14673
14674/* Default to some arbitrary number that's big enough to get most
14675 of the common signals.
14676*/
14677#ifndef NSIG
14678# define NSIG 50
14679#endif
14680
14681printf("NSIG %d\n", NSIG);
14682
14683#ifndef JUST_NSIG
14684
14685EOCP
14686
14687echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
14688{
14689 printf "#ifdef SIG"; printf $1; printf "\n"
14690 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
14691 printf $1; printf ");\n"
14692 printf "#endif\n"
14693}
14694END {
14695 printf "#endif /* JUST_NSIG */\n";
14696 printf "exit(0);\n}\n";
14697}
14698' >>signal.c
14699$cat >signal.awk <<'EOP'
14700BEGIN { ndups = 0 }
14701$1 ~ /^NSIG$/ { nsig = $2 }
14702($1 !~ /^NSIG$/) && (NF == 2) {
14703 if ($2 > maxsig) { maxsig = $2 }
14704 if (sig_name[$2]) {
14705 dup_name[ndups] = $1
14706 dup_num[ndups] = $2
14707 ndups++
14708 }
14709 else {
14710 sig_name[$2] = $1
14711 sig_num[$2] = $2
14712 }
14713}
14714END {
14715 if (nsig == 0) {
14716 nsig = maxsig + 1
14717 }
14718 printf("NSIG %d\n", nsig);
14719 for (n = 1; n < nsig; n++) {
14720 if (sig_name[n]) {
14721 printf("%s %d\n", sig_name[n], sig_num[n])
14722 }
14723 else {
14724 printf("NUM%d %d\n", n, n)
14725 }
14726 }
14727 for (n = 0; n < ndups; n++) {
14728 printf("%s %d\n", dup_name[n], dup_num[n])
14729 }
14730}
14731EOP
14732$cat >signal_cmd <<EOS
14733$startsh
14734if $test -s signal.lst; then
14735 echo "Using your existing signal.lst file"
14736 exit 0
14737fi
14738xxx="$xxx"
14739EOS
14740$cat >>signal_cmd <<'EOS'
14741
14742set signal
14743if eval $compile_ok; then
14744 ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14745else
14746 echo "(I can't seem be able to compile the whole test program)" >&4
14747 echo "(I'll try it in little pieces.)" >&4
14748 set signal -DJUST_NSIG
14749 if eval $compile_ok; then
14750 ./signal$_exe > signal.nsg
14751 $cat signal.nsg
14752 else
14753 echo "I can't seem to figure out how many signals you have." >&4
14754 echo "Guessing 50." >&4
14755 echo 'NSIG 50' > signal.nsg
14756 fi
14757 : Now look at all the signal names, one at a time.
14758 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
14759 $cat > signal.c <<EOCP
14760#include <sys/types.h>
14761#include <signal.h>
14762#include <stdio.h>
14763int main() {
14764printf("$xx %d\n", SIG${xx});
14765return 0;
14766}
14767EOCP
14768 set signal
14769 if eval $compile; then
14770 echo "SIG${xx} found."
14771 ./signal$_exe >> signal.ls1
14772 else
14773 echo "SIG${xx} NOT found."
14774 fi
14775 done
14776 if $test -s signal.ls1; then
14777 $cat signal.nsg signal.ls1 |
14778 $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
14779 fi
14780
14781fi
14782if $test -s signal.lst; then
14783 :
14784else
14785 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
14786 echo 'kill -l' >signal
14787 set X `csh -f <signal`
14788 $rm -f signal
14789 shift
14790 case $# in
14791 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
14792 esac
14793 echo $@ | $tr ' ' $trnl | \
14794 $awk '{ printf "%s %d\n", $1, ++s; }
14795 END { printf "NSIG %d\n", ++s }' >signal.lst
14796fi
14797$rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
14798EOS
14799chmod a+x signal_cmd
14800$eunicefix signal_cmd
14801
14802: generate list of signal names
14803echo " "
14804case "$sig_name_init" in
14805'') doinit=yes ;;
14806*) case "$sig_num_init" in
14807 ''|*,*) doinit=yes ;;
14808 esac ;;
14809esac
14810case "$doinit" in
14811yes)
14812 echo "Generating a list of signal names and numbers..." >&4
14813 . ./signal_cmd
14814 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
14815 sig_name=`$awk 'BEGIN { printf "ZERO " }
14816 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
14817 sig_num=`$awk 'BEGIN { printf "0 " }
14818 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
14819 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
14820 !/^NSIG/ { printf "\"%s\", ", $1 }
14821 END { printf "0\n" }' signal.lst`
14822 sig_num_init=`$awk 'BEGIN { printf "0, " }
14823 !/^NSIG/ { printf "%d, ", $2}
14824 END { printf "0\n"}' signal.lst`
14825 ;;
14826esac
14827echo "The following $sig_count signals are available:"
14828echo " "
14829echo $sig_name | $awk \
14830'BEGIN { linelen = 0 }
14831{
14832 for (i = 1; i <= NF; i++) {
14833 name = "SIG" $i " "
14834 linelen = linelen + length(name)
14835 if (linelen > 70) {
14836 printf "\n"
14837 linelen = length(name)
14838 }
14839 printf "%s", name
14840 }
14841 printf "\n"
14842}'
14843sig_size=`echo $sig_name | awk '{print NF}'`
14844$rm -f signal signal.c signal.awk signal.lst signal_cmd
14845
14846echo " "
14847case "$sizetype" in
14848*_t) zzz="$sizetype" ;;
14849*) zzz="filesize" ;;
14850esac
14851echo "Checking the size of $zzz..." >&4
14852cat > try.c <<EOCP
14853#include <sys/types.h>
14854#include <stdio.h>
14855int main() {
14856 printf("%d\n", (int)sizeof($sizetype));
14857 exit(0);
14858}
14859EOCP
14860set try
14861if eval $compile_ok; then
14862 yyy=`./try`
14863 case "$yyy" in
14864 '') sizesize=4
14865 echo "(I can't execute the test program--guessing $sizesize.)" >&4
14866 ;;
14867 *) sizesize=$yyy
14868 echo "Your $zzz size is $sizesize bytes."
14869 ;;
14870 esac
14871else
14872 sizesize=4
14873 echo "(I can't compile the test program--guessing $sizesize.)" >&4
14874fi
14875
14876
14877: check for socklen_t
14878echo " "
14879echo "Checking to see if you have socklen_t..." >&4
14880$cat >try.c <<EOCP
14881#include <sys/types.h>
14882#$d_socket HAS_SOCKET
14883#ifdef HAS_SOCKET
14884#include <sys/socket.h>
14885#endif
14886int main() { socklen_t x = 16; }
14887EOCP
14888set try
14889if eval $compile; then
14890 val="$define"
14891 echo "You have socklen_t."
14892else
14893 val="$undef"
14894 echo "You do not have socklen_t."
14895 case "$sizetype" in
14896 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
14897 esac
14898fi
14899$rm -f try try.*
14900set d_socklen_t
14901eval $setvar
14902
14903: see if this is a socks.h system
14904set socks.h i_socks
14905eval $inhdr
14906
14907: check for type of the size argument to socket calls
14908case "$d_socket" in
14909"$define")
14910 $cat <<EOM
14911
14912Checking to see what type is the last argument of accept().
14913EOM
14914 yyy=''
14915 case "$d_socklen_t" in
14916 "$define") yyy="$yyy socklen_t"
14917 esac
14918 yyy="$yyy $sizetype int long unsigned"
14919 for xxx in $yyy; do
14920 case "$socksizetype" in
14921 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
14922 case "$usesocks" in
14923 "$define")
14924 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
14925 echo "Your system accepts '$xxx *' for the last argument of accept()."
14926 socksizetype="$xxx"
14927 fi
14928 ;;
14929 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
14930 echo "Your system accepts '$xxx *' for the last argument of accept()."
14931 socksizetype="$xxx"
14932 fi
14933 ;;
14934 esac
14935 ;;
14936 esac
14937 done
14938: In case none of those worked, prompt the user.
14939 case "$socksizetype" in
14940 '') rp='What is the type for socket address structure sizes?'
14941 dflt='int'
14942 . ./myread
14943 socksizetype=$ans
14944 ;;
14945 esac
14946 ;;
14947*) : no sockets, so pick relatively harmless default
14948 socksizetype='int'
14949 ;;
14950esac
14951
14952: see what type is used for signed size_t
14953set ssize_t ssizetype int stdio.h sys/types.h
14954eval $typedef
14955dflt="$ssizetype"
14956$cat > ssize.c <<EOM
14957#include <stdio.h>
14958#include <sys/types.h>
14959#define Size_t $sizetype
14960#define SSize_t $dflt
14961int main()
14962{
14963 if (sizeof(Size_t) == sizeof(SSize_t))
14964 printf("$dflt\n");
14965 else if (sizeof(Size_t) == sizeof(int))
14966 printf("int\n");
14967 else
14968 printf("long\n");
14969 exit(0);
14970}
14971EOM
14972echo " "
14973set ssize
14974if eval $compile_ok && ./ssize > /dev/null; then
14975 ssizetype=`./ssize`
14976 echo "I'll be using $ssizetype for functions returning a byte count." >&4
14977else
14978 $cat >&4 <<EOM
14979Help! I can't compile and run the ssize_t test program: please enlighten me!
14980(This is probably a misconfiguration in your system or libraries, and
14981you really ought to fix it. Still, I'll try anyway.)
14982
14983I need a type that is the same size as $sizetype, but is guaranteed to
14984be signed. Common values are ssize_t, int and long.
14985
14986EOM
14987 rp="What signed type is the same size as $sizetype?"
14988 . ./myread
14989 ssizetype="$ans"
14990fi
14991$rm -f ssize ssize.*
14992
14993: see what type of char stdio uses.
14994echo " "
14995echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
14996if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
14997 echo "Your stdio uses unsigned chars." >&4
14998 stdchar="unsigned char"
14999else
15000 echo "Your stdio uses signed chars." >&4
15001 stdchar="char"
15002fi
15003$rm -f stdioh
15004
15005
15006
15007: see if time exists
15008echo " "
15009if test "X$d_time" = X -o X"$timetype" = X; then
15010 if set time val -f d_time; eval $csym; $val; then
15011 echo 'time() found.' >&4
15012 val="$define"
15013 rp="What is the type returned by time() on this system?"
15014 set time_t timetype long stdio.h sys/types.h
15015 eval $typedef_ask
15016 else
15017 echo 'time() not found, hope that will do.' >&4
15018 val="$undef"
15019 timetype='int';
15020 fi
15021 set d_time
15022 eval $setvar
15023fi
15024
15025: see what type uids are declared as in the kernel
15026echo " "
15027echo "Looking for the type for user ids returned by getuid()."
15028set uid_t uidtype xxx stdio.h sys/types.h
15029eval $typedef
15030case "$uidtype" in
15031xxx)
15032 xxx=`./findhdr sys/user.h`
15033 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
15034 case $1 in
15035 unsigned) dflt="$1 $2" ;;
15036 *) dflt="$1" ;;
15037 esac
15038 ;;
15039*) dflt="$uidtype";;
15040esac
15041case "$uidtype" in
15042uid_t) echo "uid_t found." ;;
15043*) rp="What is the type for user ids returned by getuid()?"
15044 . ./myread
15045 uidtype="$ans"
15046 ;;
15047esac
15048
15049echo " "
15050case "$uidtype" in
15051*_t) zzz="$uidtype" ;;
15052*) zzz="uid" ;;
15053esac
15054echo "Checking the size of $zzz..." >&4
15055cat > try.c <<EOCP
15056#include <sys/types.h>
15057#include <stdio.h>
15058int main() {
15059 printf("%d\n", (int)sizeof($uidtype));
15060 exit(0);
15061}
15062EOCP
15063set try
15064if eval $compile_ok; then
15065 yyy=`./try`
15066 case "$yyy" in
15067 '') uidsize=4
15068 echo "(I can't execute the test program--guessing $uidsize.)" >&4
15069 ;;
15070 *) uidsize=$yyy
15071 echo "Your $zzz is $uidsize bytes long."
15072 ;;
15073 esac
15074else
15075 uidsize=4
15076 echo "(I can't compile the test program--guessing $uidsize.)" >&4
15077fi
15078
15079echo " "
15080case "$uidtype" in
15081*_t) zzz="$uidtype" ;;
15082*) zzz="uid" ;;
15083esac
15084echo "Checking the sign of $zzz..." >&4
15085cat > try.c <<EOCP
15086#include <sys/types.h>
15087#include <stdio.h>
15088int main() {
15089 $uidtype foo = -1;
15090 if (foo < 0)
15091 printf("-1\n");
15092 else
15093 printf("1\n");
15094}
15095EOCP
15096set try
15097if eval $compile; then
15098 yyy=`./try`
15099 case "$yyy" in
15100 '') uidsign=1
15101 echo "(I can't execute the test program--guessing unsigned.)" >&4
15102 ;;
15103 *) uidsign=$yyy
15104 case "$uidsign" in
15105 1) echo "Your $zzz is unsigned." ;;
15106 -1) echo "Your $zzz is signed." ;;
15107 esac
15108 ;;
15109 esac
15110else
15111 uidsign=1
15112 echo "(I can't compile the test program--guessing unsigned.)" >&4
15113fi
15114
15115
15116
15117echo " "
15118$echo "Checking the format string to be used for uids..." >&4
15119
15120case "$uidsign" in
15121-1) if $test X"$uidsize" = X"$ivsize"; then
15122 uidformat="$ivdformat"
15123 else
15124 if $test X"$uidsize" = X"$longsize"; then
15125 uidformat='"ld"'
15126 else
15127 if $test X"$uidsize" = X"$intsize"; then
15128 uidformat='"d"'
15129 else
15130 if $test X"$uidsize" = X"$shortsize"; then
15131 uidformat='"hd"'
15132 fi
15133 fi
15134 fi
15135 fi
15136 ;;
15137*) if $test X"$uidsize" = X"$uvsize"; then
15138 uidformat="$uvuformat"
15139 else
15140 if $test X"$uidsize" = X"$longsize"; then
15141 uidformat='"lu"'
15142 else
15143 if $test X"$uidsize" = X"$intsize"; then
15144 uidformat='"u"'
15145 else
15146 if $test X"$uidsize" = X"$shortsize"; then
15147 uidformat='"hu"'
15148 fi
15149 fi
15150 fi
15151 fi
15152 ;;
15153esac
15154
15155: determine compiler compiler
15156case "$yacc" in
15157'')
15158 dflt=yacc;;
15159*)
15160 dflt="$yacc";;
15161esac
15162echo " "
15163comp='yacc'
15164if $test -f "$byacc"; then
15165 dflt="$byacc"
15166 comp="byacc or $comp"
15167fi
15168if $test -f "$bison"; then
15169 comp="$comp or bison -y"
15170fi
15171rp="Which compiler compiler ($comp) shall I use?"
15172. ./myread
15173yacc="$ans"
15174case "$yacc" in
15175*bis*)
15176 case "$yacc" in
15177 *-y*) ;;
15178 *)
15179 yacc="$yacc -y"
15180 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
15181 ;;
15182 esac
15183 ;;
15184esac
15185
15186: see if dbm.h is available
15187: see if dbmclose exists
15188set dbmclose d_dbmclose
15189eval $inlibc
15190
15191case "$d_dbmclose" in
15192$define)
15193 set dbm.h i_dbm
15194 eval $inhdr
15195 case "$i_dbm" in
15196 $define)
15197 val="$undef"
15198 set i_rpcsvcdbm
15199 eval $setvar
15200 ;;
15201 *) set rpcsvc/dbm.h i_rpcsvcdbm
15202 eval $inhdr
15203 ;;
15204 esac
15205 ;;
15206*) echo "We won't be including <dbm.h>"
15207 val="$undef"
15208 set i_dbm
15209 eval $setvar
15210 val="$undef"
15211 set i_rpcsvcdbm
15212 eval $setvar
15213 ;;
15214esac
15215
15216: see if this is a sys/file.h system
15217val=''
15218set sys/file.h val
15219eval $inhdr
15220
15221: do we need to include sys/file.h ?
15222case "$val" in
15223"$define")
15224 echo " "
15225 if $h_sysfile; then
15226 val="$define"
15227 echo "We'll be including <sys/file.h>." >&4
15228 else
15229 val="$undef"
15230 echo "We won't be including <sys/file.h>." >&4
15231 fi
15232 ;;
15233*)
15234 h_sysfile=false
15235 ;;
15236esac
15237set i_sysfile
15238eval $setvar
15239
15240: see if fcntl.h is there
15241val=''
15242set fcntl.h val
15243eval $inhdr
15244
15245: see if we can include fcntl.h
15246case "$val" in
15247"$define")
15248 echo " "
15249 if $h_fcntl; then
15250 val="$define"
15251 echo "We'll be including <fcntl.h>." >&4
15252 else
15253 val="$undef"
15254 if $h_sysfile; then
15255 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
15256 else
15257 echo "We won't be including <fcntl.h>." >&4
15258 fi
15259 fi
15260 ;;
15261*)
15262 h_fcntl=false
15263 val="$undef"
15264 ;;
15265esac
15266set i_fcntl
15267eval $setvar
15268
15269: see if this is a iconv.h system
15270set iconv.h i_iconv
15271eval $inhdr
15272
15273: see if this is a ieeefp.h system
15274set ieeefp.h i_ieeefp
15275eval $inhdr
15276
15277: see if this is a libutil.h system
15278set libutil.h i_libutil
15279eval $inhdr
15280
15281: see if locale.h is available
15282set locale.h i_locale
15283eval $inhdr
15284
15285: see if mach cthreads are available
15286if test "X$usethreads" = "X$define"; then
15287 set mach/cthreads.h i_machcthr
15288 eval $inhdr
15289else
15290 i_machcthr="$undef"
15291fi
15292
15293
15294
15295: see if this is a math.h system
15296set math.h i_math
15297eval $inhdr
15298
15299: see if this is a mntent.h system
15300set mntent.h i_mntent
15301eval $inhdr
15302
15303: see if ndbm.h is available
15304set ndbm.h t_ndbm
15305eval $inhdr
15306case "$t_ndbm" in
15307$define)
15308 : see if dbm_open exists
15309 set dbm_open d_dbm_open
15310 eval $inlibc
15311 case "$d_dbm_open" in
15312 $undef)
15313 t_ndbm="$undef"
15314 echo "We won't be including <ndbm.h>"
15315 ;;
15316 esac
15317 ;;
15318esac
15319val="$t_ndbm"
15320set i_ndbm
15321eval $setvar
15322
15323: see if net/errno.h is available
15324val=''
15325set net/errno.h val
15326eval $inhdr
15327
15328: Unfortunately, it causes problems on some systems. Arrgh.
15329case "$val" in
15330$define)
15331 cat > try.c <<'EOM'
15332#include <stdio.h>
15333#include <errno.h>
15334#include <net/errno.h>
15335int func()
15336{
15337 return ENOTSOCK;
15338}
15339EOM
15340 if $cc $ccflags -c try.c >/dev/null 2>&1; then
15341 echo "We'll be including <net/errno.h>." >&4
15342 else
15343 echo "We won't be including <net/errno.h>." >&4
15344 val="$undef"
15345 fi
15346 $rm -f try.* try
15347 ;;
15348esac
15349set i_neterrno
15350eval $setvar
15351
15352: see if netinet/tcp.h is available
15353set netinet/tcp.h i_netinettcp
15354eval $inhdr
15355
15356: see if this is a poll.h system
15357set poll.h i_poll
15358eval $inhdr
15359
15360: see if this is a prot.h system
15361set prot.h i_prot
15362eval $inhdr
15363
15364echo " "
15365$echo "Guessing which symbols your C compiler and preprocessor define..." >&4
15366$cat <<'EOSH' > Cppsym.know
15367a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
15368AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
15369alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
15370ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
15371BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
15372BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
15373bull c cadmus clipper CMU COFF COMPILER_VERSION
15374concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
15375CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
15376Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
15377FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
15378GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
15379H3050R H3050RX hbullx20 hcx host_mips
15380hp200 hp300 hp700 HP700 hp800 hp9000
15381hp9000s200 hp9000s300 hp9000s400 hp9000s500
15382hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
15383i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
15384IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
15385INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
15386LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
15387LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
15388Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
15389LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
15390M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
15391M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
15392M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
15393MATH_HAS_NO_SIDE_EFFECTS
15394mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
15395mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
15396mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
15397MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
15398mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
15399NetBSD news1500 news1700 news1800 news1900 news3700
15400news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
15401ns32016 ns32332 ns32k nsc32000
15402OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
15403pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
15404pc532 pdp11 PGC PIC plexus PORTAR posix
15405POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
15406POSIX_C_SOURCE POSIX_SOURCE POWER
15407PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
15408riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
15409SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
15410sony sony_news sonyrisc sparc sparclite spectrum
15411stardent stdc STDC_EXT stratos sun sun3 sun386
15412Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
15413SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
15414SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
15415sysV68 sysV88 Tek4132 Tek4300 titan
15416TM3200 TM5400 TM5600
15417tower tower32 tower32_200 tower32_600 tower32_700
15418tower32_800 tower32_850 tss
15419u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
15420ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
15421unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
15422Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
15423XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
15424XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
15425z8000
15426EOSH
15427# Maybe put other stuff here too.
15428cat <<EOSH >>Cppsym.know
15429$osname
15430EOSH
15431./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
15432./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
15433$cat Cppsym.know > Cppsym.c
15434$cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
15435$rm -f Cppsym.a Cppsym.b Cppsym.c
15436cat <<EOSH > Cppsym
15437$startsh
15438if $test \$# -gt 0; then
15439 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
15440 if $test -s Cppsym.got; then
15441 $rm -f Cppsym.got
15442 exit 0
15443 fi
15444 $rm -f Cppsym.got
15445 exit 1
15446else
15447 $tr " " "$trnl" | ./Cppsym.try
15448 exit 0
15449fi
15450EOSH
15451chmod +x Cppsym
15452$eunicefix Cppsym
15453cat <<EOSH > Cppsym.try
15454$startsh
15455cat <<'EOCP' > try.c
15456#include <stdio.h>
15457int main() {
15458EOCP
15459$awk \\
15460EOSH
15461cat <<'EOSH' >> Cppsym.try
15462'length($1) > 0 {
15463 printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", %s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
15464 printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", _%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
15465 printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", __%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
15466 printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", __%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
15467}' >> try.c
15468echo '}' >> try.c
15469EOSH
15470cat <<EOSH >> Cppsym.try
15471ccflags="$ccflags"
15472case "$osname-$gccversion" in
15473irix-) ccflags="\$ccflags -woff 1178" ;;
15474os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
15475esac
15476$cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
15477EOSH
15478chmod +x Cppsym.try
15479$eunicefix Cppsym.try
15480./Cppsym < Cppsym.know > Cppsym.true
15481: now check the C compiler for additional symbols
15482postprocess_cc_v=''
15483case "$osname" in
15484aix) postprocess_cc_v="|$tr , ' '" ;;
15485esac
15486$cat >ccsym <<EOS
15487$startsh
15488$cat >tmp.c <<EOF
15489extern int foo;
15490EOF
15491for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
15492do
15493 case "\$i" in
15494 -D*) echo "\$i" | $sed 's/^-D//';;
15495 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
15496 esac
15497done
15498$rm -f try.c
15499EOS
15500postprocess_cc_v=''
15501chmod +x ccsym
15502$eunicefix ccsym
15503./ccsym > ccsym1.raw
15504if $test -s ccsym1.raw; then
15505 $sort ccsym1.raw | $uniq >ccsym.raw
15506else
15507 mv ccsym1.raw ccsym.raw
15508fi
15509
15510$awk '/\=/ { print $0; next }
15511 { print $0"=1" }' ccsym.raw >ccsym.list
15512$awk '/\=/ { print $0; next }
15513 { print $0"=1" }' Cppsym.true >ccsym.true
15514$comm -13 ccsym.true ccsym.list >ccsym.own
15515$comm -12 ccsym.true ccsym.list >ccsym.com
15516$comm -23 ccsym.true ccsym.list >ccsym.cpp
15517also=''
15518if $test -z ccsym.raw; then
15519 echo "Your C compiler doesn't seem to define any symbols!" >&4
15520 echo " "
15521 echo "However, your C preprocessor defines the following symbols:"
15522 $cat Cppsym.true
15523 ccsymbols=''
15524 cppsymbols=`$cat Cppsym.true`
15525 cppsymbols=`echo $cppsymbols`
15526 cppccsymbols="$cppsymbols"
15527else
15528 if $test -s ccsym.com; then
15529 echo "Your C compiler and pre-processor define these symbols:"
15530 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
15531 also='also '
15532 symbols='ones'
15533 cppccsymbols=`$cat ccsym.com`
15534 cppccsymbols=`echo $cppccsymbols`
15535 $test "$silent" || sleep 1
15536 fi
15537 if $test -s ccsym.cpp; then
15538 $test "$also" && echo " "
15539 echo "Your C pre-processor ${also}defines the following symbols:"
15540 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
15541 also='further '
15542 cppsymbols=`$cat ccsym.cpp`
15543 cppsymbols=`echo $cppsymbols`
15544 $test "$silent" || sleep 1
15545 fi
15546 if $test -s ccsym.own; then
15547 $test "$also" && echo " "
15548 echo "Your C compiler ${also}defines the following cpp symbols:"
15549 $sed -e 's/\(..*\)=1/\1/' ccsym.own
15550 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
15551 ccsymbols=`$cat ccsym.own`
15552 ccsymbols=`echo $ccsymbols`
15553 $test "$silent" || sleep 1
15554 fi
15555fi
15556$rm -f ccsym* Cppsym.*
15557
15558: see if this is a termio system
15559val="$undef"
15560val2="$undef"
15561val3="$undef"
15562if $test `./findhdr termios.h`; then
15563 set tcsetattr i_termios
15564 eval $inlibc
15565 val3="$i_termios"
15566fi
15567echo " "
15568case "$val3" in
15569"$define") echo "You have POSIX termios.h... good!" >&4;;
15570*) if ./Cppsym pyr; then
15571 case "`/bin/universe`" in
15572 ucb) if $test `./findhdr sgtty.h`; then
15573 val2="$define"
15574 echo "<sgtty.h> found." >&4
15575 else
15576 echo "System is pyramid with BSD universe."
15577 echo "<sgtty.h> not found--you could have problems." >&4
15578 fi;;
15579 *) if $test `./findhdr termio.h`; then
15580 val="$define"
15581 echo "<termio.h> found." >&4
15582 else
15583 echo "System is pyramid with USG universe."
15584 echo "<termio.h> not found--you could have problems." >&4
15585 fi;;
15586 esac
15587 elif ./usg; then
15588 if $test `./findhdr termio.h`; then
15589 echo "<termio.h> found." >&4
15590 val="$define"
15591 elif $test `./findhdr sgtty.h`; then
15592 echo "<sgtty.h> found." >&4
15593 val2="$define"
15594 else
15595echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
15596 fi
15597 else
15598 if $test `./findhdr sgtty.h`; then
15599 echo "<sgtty.h> found." >&4
15600 val2="$define"
15601 elif $test `./findhdr termio.h`; then
15602 echo "<termio.h> found." >&4
15603 val="$define"
15604 else
15605echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
15606 fi
15607 fi;;
15608esac
15609set i_termio; eval $setvar
15610val=$val2; set i_sgtty; eval $setvar
15611val=$val3; set i_termios; eval $setvar
15612
15613: see if this is a shadow.h system
15614set shadow.h i_shadow
15615eval $inhdr
15616
15617: see if stddef is available
15618set stddef.h i_stddef
15619eval $inhdr
15620
15621: see if this is a sunmath.h system
15622set sunmath.h i_sunmath
15623eval $inhdr
15624
15625: see if sys/access.h is available
15626set sys/access.h i_sysaccess
15627eval $inhdr
15628
15629: see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
15630set sys/filio.h i_sysfilio
15631eval $inhdr
15632echo " "
15633if $test `./findhdr sys/ioctl.h`; then
15634 val="$define"
15635 echo '<sys/ioctl.h> found.' >&4
15636else
15637 val="$undef"
15638 if $test $i_sysfilio = "$define"; then
15639 echo '<sys/ioctl.h> NOT found.' >&4
15640 else
15641 $test $i_sgtty = "$define" && xxx="sgtty.h"
15642 $test $i_termio = "$define" && xxx="termio.h"
15643 $test $i_termios = "$define" && xxx="termios.h"
15644echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
15645 fi
15646fi
15647set i_sysioctl
15648eval $setvar
15649
15650: see if socket ioctl defs are in sys/sockio.h
15651echo " "
15652xxx=`./findhdr sys/sockio.h`
15653if $test "$xxx"; then
15654 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
15655 val="$define"
15656 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
15657 else
15658 val="$undef"
15659 echo "No socket ioctls found in <sys/sockio.h>." >&4
15660 fi
15661else
15662 val="$undef"
15663 $cat <<EOM
15664<sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
15665EOM
15666fi
15667set i_syssockio
15668eval $setvar
15669
15670
15671: see if this is a syslog.h system
15672set syslog.h i_syslog
15673eval $inhdr
15674
15675
15676: see if this is a sys/mode.h system
15677set sys/mode.h i_sysmode
15678eval $inhdr
15679
15680: see if sys/resource.h has to be included
15681set sys/resource.h i_sysresrc
15682eval $inhdr
15683
15684: see if sys/security.h is available
15685set sys/security.h i_syssecrt
15686eval $inhdr
15687
15688: see if this is a sys/statvfs.h system
15689set sys/statvfs.h i_sysstatvfs
15690eval $inhdr
15691
15692: see if this is a sys/un.h system
15693set sys/un.h i_sysun
15694eval $inhdr
15695
15696
15697: see if this is a sys/utsname.h system
15698set sys/utsname.h i_sysutsname
15699eval $inhdr
15700
15701: see if this is a syswait system
15702set sys/wait.h i_syswait
15703eval $inhdr
15704
15705: see if this is a ustat.h system
15706set ustat.h i_ustat
15707eval $inhdr
15708
15709: see if this is an utime system
15710set utime.h i_utime
15711eval $inhdr
15712
15713: see if this is a values.h system
15714set values.h i_values
15715eval $inhdr
15716
15717: see if this is a vfork system
15718case "$d_vfork" in
15719"$define")
15720 set vfork.h i_vfork
15721 eval $inhdr
15722 ;;
15723*)
15724 i_vfork="$undef"
15725 ;;
15726esac
15727
15728: see if gdbm.h is available
15729set gdbm.h t_gdbm
15730eval $inhdr
15731case "$t_gdbm" in
15732$define)
15733 : see if gdbm_open exists
15734 set gdbm_open d_gdbm_open
15735 eval $inlibc
15736 case "$d_gdbm_open" in
15737 $undef)
15738 t_gdbm="$undef"
15739 echo "We won't be including <gdbm.h>"
15740 ;;
15741 esac
15742 ;;
15743esac
15744val="$t_gdbm"
15745set i_gdbm
15746eval $setvar
15747
15748echo " "
15749echo "Looking for extensions..." >&4
15750: If we are using the old config.sh, known_extensions may contain
15751: old or inaccurate or duplicate values.
15752known_extensions=''
15753nonxs_extensions=''
15754: We do not use find because it might not be available.
15755: We do not just use MANIFEST because the user may have dropped
15756: some additional extensions into the source tree and expect them
15757: to be built.
15758
15759: Function to recursively find available extensions, ignoring DynaLoader
15760: NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
15761find_extensions='
15762 for xxx in *; do
15763 case "$xxx" in
15764 DynaLoader|dynaload) ;;
15765 *)
15766 if $test -f $xxx/$xxx.xs; then
15767 known_extensions="$known_extensions $1$xxx";
15768 elif $test -f $xxx/Makefile.PL; then
15769 nonxs_extensions="$nonxs_extensions $1$xxx";
15770 else
15771 if $test -d $xxx -a $# -lt 10; then
15772 set $1$xxx/ $*;
15773 cd $xxx;
15774 eval $find_extensions;
15775 cd ..;
15776 shift;
15777 fi;
15778 fi
15779 ;;
15780 esac;
15781 done'
15782tdir=`pwd`
15783cd $rsrc/ext
15784set X
15785shift
15786eval $find_extensions
15787set X $nonxs_extensions
15788shift
15789nonxs_extensions="$*"
15790set X $known_extensions
15791shift
15792known_extensions="$*"
15793cd $tdir
15794
15795: Now see which are supported on this system.
15796avail_ext=''
15797for xxx in $known_extensions ; do
15798 case "$xxx" in
15799 DB_File|db_file)
15800 case "$i_db" in
15801 $define) avail_ext="$avail_ext $xxx" ;;
15802 esac
15803 ;;
15804 GDBM_File|gdbm_fil)
15805 case "$i_gdbm" in
15806 $define) avail_ext="$avail_ext $xxx" ;;
15807 esac
15808 ;;
15809 NDBM_File|ndbm_fil)
15810 case "$i_ndbm" in
15811 $define)
15812 case "$osname-$use64bitint" in
15813 hpux-define)
15814 case "$libs" in
15815 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
15816 esac
15817 ;;
15818 *) avail_ext="$avail_ext $xxx" ;;
15819 esac
15820 ;;
15821 esac
15822 ;;
15823 ODBM_File|odbm_fil)
15824 case "${i_dbm}${i_rpcsvcdbm}" in
15825 *"${define}"*)
15826 case "$osname-$use64bitint" in
15827 hpux-define)
15828 case "$libs" in
15829 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
15830 esac
15831 ;;
15832 *) avail_ext="$avail_ext $xxx" ;;
15833 esac
15834 ;;
15835 esac
15836 ;;
15837 POSIX|posix)
15838 case "$useposix" in
15839 true|define|y) avail_ext="$avail_ext $xxx" ;;
15840 esac
15841 ;;
15842 Opcode|opcode)
15843 case "$useopcode" in
15844 true|define|y) avail_ext="$avail_ext $xxx" ;;
15845 esac
15846 ;;
15847 Socket|socket)
15848 case "$d_socket" in
15849 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15850 esac
15851 ;;
15852 Sys/Syslog|sys/syslog)
15853 : XXX syslog requires socket
15854 case "$d_socket" in
15855 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15856 esac
15857 ;;
15858 Thread|thread)
15859 case "$usethreads" in
15860 true|$define|y) avail_ext="$avail_ext $xxx" ;;
15861 esac
15862 ;;
15863 IPC/SysV|ipc/sysv)
15864 : XXX Do we need a useipcsysv variable here
15865 case "${d_msg}${d_sem}${d_shm}" in
15866 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
15867 esac
15868 ;;
15869 *) avail_ext="$avail_ext $xxx"
15870 ;;
15871 esac
15872done
15873
15874set X $avail_ext
15875shift
15876avail_ext="$*"
15877
15878: Now see which nonxs extensions are supported on this system.
15879: For now assume all are.
15880nonxs_ext=''
15881for xxx in $nonxs_extensions ; do
15882 case "$xxx" in
15883 *) nonxs_ext="$nonxs_ext $xxx"
15884 ;;
15885 esac
15886done
15887
15888set X $nonxs_ext
15889shift
15890nonxs_ext="$*"
15891
15892case $usedl in
15893$define)
15894 $cat <<EOM
15895A number of extensions are supplied with $package. You may choose to
15896compile these extensions for dynamic loading (the default), compile
15897them into the $package executable (static loading), or not include
15898them at all. Answer "none" to include no extensions.
15899Note that DynaLoader is always built and need not be mentioned here.
15900
15901EOM
15902 case "$dynamic_ext" in
15903 '') dflt="$avail_ext" ;;
15904 *) dflt="$dynamic_ext"
15905 # Perhaps we are reusing an old out-of-date config.sh.
15906 case "$hint" in
15907 previous)
15908 if test X"$dynamic_ext" != X"$avail_ext"; then
15909 $cat <<EOM
15910NOTICE: Your previous config.sh list may be incorrect.
15911The extensions now available to you are
15912 ${avail_ext}
15913but the default list from your previous config.sh is
15914 ${dynamic_ext}
15915
15916EOM
15917 fi
15918 ;;
15919 esac
15920 ;;
15921 esac
15922 case "$dflt" in
15923 '') dflt=none;;
15924 esac
15925 rp="What extensions do you wish to load dynamically?"
15926 . ./myread
15927 case "$ans" in
15928 none) dynamic_ext=' ' ;;
15929 *) dynamic_ext="$ans" ;;
15930 esac
15931
15932 case "$static_ext" in
15933 '')
15934 : Exclude those already listed in dynamic linking
15935 dflt=''
15936 for xxx in $avail_ext; do
15937 case " $dynamic_ext " in
15938 *" $xxx "*) ;;
15939 *) dflt="$dflt $xxx" ;;
15940 esac
15941 done
15942 set X $dflt
15943 shift
15944 dflt="$*"
15945 ;;
15946 *) dflt="$static_ext"
15947 ;;
15948 esac
15949
15950 case "$dflt" in
15951 '') dflt=none;;
15952 esac
15953 rp="What extensions do you wish to load statically?"
15954 . ./myread
15955 case "$ans" in
15956 none) static_ext=' ' ;;
15957 *) static_ext="$ans" ;;
15958 esac
15959 ;;
15960*)
15961 $cat <<EOM
15962A number of extensions are supplied with $package. Answer "none"
15963to include no extensions.
15964Note that DynaLoader is always built and need not be mentioned here.
15965
15966EOM
15967 case "$static_ext" in
15968 '') dflt="$avail_ext" ;;
15969 *) dflt="$static_ext"
15970 # Perhaps we are reusing an old out-of-date config.sh.
15971 case "$hint" in
15972 previous)
15973 if test X"$static_ext" != X"$avail_ext"; then
15974 $cat <<EOM
15975NOTICE: Your previous config.sh list may be incorrect.
15976The extensions now available to you are
15977 ${avail_ext}
15978but the default list from your previous config.sh is
15979 ${static_ext}
15980
15981EOM
15982 fi
15983 ;;
15984 esac
15985 ;;
15986 esac
15987 : Exclude those that are not xs extensions
15988 case "$dflt" in
15989 '') dflt=none;;
15990 esac
15991 rp="What extensions do you wish to include?"
15992 . ./myread
15993 case "$ans" in
15994 none) static_ext=' ' ;;
15995 *) static_ext="$ans" ;;
15996 esac
15997 ;;
15998esac
15999
16000set X $dynamic_ext $static_ext $nonxs_ext
16001shift
16002extensions="$*"
16003
16004: Remove libraries needed only for extensions
16005: The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
16006: The exception is SunOS 4.x, which needs them.
16007case "${osname}X${osvers}" in
16008sunos*X4*)
16009 perllibs="$libs"
16010 ;;
16011*) case "$usedl" in
16012 $define|true|[yY]*)
16013 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
16014 shift
16015 perllibs="$*"
16016 ;;
16017 *) perllibs="$libs"
16018 ;;
16019 esac
16020 ;;
16021esac
16022
16023: Remove build directory name from cppstdin so it can be used from
16024: either the present location or the final installed location.
16025echo " "
16026: Get out of the UU directory to get correct path name.
16027cd ..
16028case "$cppstdin" in
16029`pwd`/cppstdin)
16030 echo "Stripping down cppstdin path name"
16031 cppstdin=cppstdin
16032 ;;
16033esac
16034cd UU
16035
16036: end of configuration questions
16037echo " "
16038echo "End of configuration questions."
16039echo " "
16040
16041: back to where it started
16042if test -d ../UU; then
16043 cd ..
16044fi
16045
16046: configuration may be patched via a 'config.over' file
16047if $test -f config.over; then
16048 echo " "
16049 dflt=y
16050 rp='I see a config.over file. Do you wish to load it?'
16051 . UU/myread
16052 case "$ans" in
16053 n*) echo "OK, I'll ignore it.";;
16054 *) . ./config.over
16055 echo "Configuration override changes have been loaded."
16056 ;;
16057 esac
16058fi
16059
16060: in case they want portability, strip down executable paths
16061case "$d_portable" in
16062"$define")
16063 echo " "
16064 echo "Stripping down executable paths..." >&4
16065 for file in $loclist $trylist; do
16066 eval temp=\$$file
16067 eval $file=`basename $temp`
16068 done
16069 ;;
16070esac
16071
16072: create config.sh file
16073echo " "
16074echo "Creating config.sh..." >&4
16075$spitshell <<EOT >config.sh
16076$startsh
16077#
16078# This file was produced by running the Configure script. It holds all the
16079# definitions figured out by Configure. Should you modify one of these values,
16080# do not forget to propagate your changes by running "Configure -der". You may
16081# instead choose to run each of the .SH files by yourself, or "Configure -S".
16082#
16083
16084# Package name : $package
16085# Source directory : $src
16086# Configuration time: $cf_time
16087# Configured by : $cf_by
16088# Target system : $myuname
16089
16090Author='$Author'
16091Date='$Date'
16092Header='$Header'
16093Id='$Id'
16094Locker='$Locker'
16095Log='$Log'
16096Mcc='$Mcc'
16097RCSfile='$RCSfile'
16098Revision='$Revision'
16099Source='$Source'
16100State='$State'
16101_a='$_a'
16102_exe='$_exe'
16103_o='$_o'
16104afs='$afs'
16105afsroot='$afsroot'
16106alignbytes='$alignbytes'
16107ansi2knr='$ansi2knr'
16108aphostname='$aphostname'
16109api_revision='$api_revision'
16110api_subversion='$api_subversion'
16111api_version='$api_version'
16112api_versionstring='$api_versionstring'
16113ar='$ar'
16114archlib='$archlib'
16115archlibexp='$archlibexp'
16116archname64='$archname64'
16117archname='$archname'
16118archobjs='$archobjs'
16119awk='$awk'
16120baserev='$baserev'
16121bash='$bash'
16122bin='$bin'
16123bincompat5005='$bincompat5005'
16124binexp='$binexp'
16125bison='$bison'
16126byacc='$byacc'
16127byteorder='$byteorder'
16128c='$c'
16129castflags='$castflags'
16130cat='$cat'
16131cc='$cc'
16132cccdlflags='$cccdlflags'
16133ccdlflags='$ccdlflags'
16134ccflags='$ccflags'
16135ccflags_uselargefiles='$ccflags_uselargefiles'
16136ccname='$ccname'
16137ccsymbols='$ccsymbols'
16138ccversion='$ccversion'
16139cf_by='$cf_by'
16140cf_email='$cf_email'
16141cf_time='$cf_time'
16142charsize='$charsize'
16143chgrp='$chgrp'
16144chmod='$chmod'
16145chown='$chown'
16146clocktype='$clocktype'
16147comm='$comm'
16148compress='$compress'
16149contains='$contains'
16150cp='$cp'
16151cpio='$cpio'
16152cpp='$cpp'
16153cpp_stuff='$cpp_stuff'
16154cppccsymbols='$cppccsymbols'
16155cppflags='$cppflags'
16156cpplast='$cpplast'
16157cppminus='$cppminus'
16158cpprun='$cpprun'
16159cppstdin='$cppstdin'
16160cppsymbols='$cppsymbols'
16161crosscompile='$crosscompile'
16162cryptlib='$cryptlib'
16163csh='$csh'
16164d_Gconvert='$d_Gconvert'
16165d_PRIEUldbl='$d_PRIEUldbl'
16166d_PRIFUldbl='$d_PRIFUldbl'
16167d_PRIGUldbl='$d_PRIGUldbl'
16168d_PRIXU64='$d_PRIXU64'
16169d_PRId64='$d_PRId64'
16170d_PRIeldbl='$d_PRIeldbl'
16171d_PRIfldbl='$d_PRIfldbl'
16172d_PRIgldbl='$d_PRIgldbl'
16173d_PRIi64='$d_PRIi64'
16174d_PRIo64='$d_PRIo64'
16175d_PRIu64='$d_PRIu64'
16176d_PRIx64='$d_PRIx64'
16177d_SCNfldbl='$d_SCNfldbl'
16178d__fwalk='$d__fwalk'
16179d_access='$d_access'
16180d_accessx='$d_accessx'
16181d_alarm='$d_alarm'
16182d_archlib='$d_archlib'
16183d_atolf='$d_atolf'
16184d_atoll='$d_atoll'
16185d_attribut='$d_attribut'
16186d_bcmp='$d_bcmp'
16187d_bcopy='$d_bcopy'
16188d_bincompat5005='$d_bincompat5005'
16189d_bsd='$d_bsd'
16190d_bsdgetpgrp='$d_bsdgetpgrp'
16191d_bsdsetpgrp='$d_bsdsetpgrp'
16192d_bzero='$d_bzero'
16193d_casti32='$d_casti32'
16194d_castneg='$d_castneg'
16195d_charvspr='$d_charvspr'
16196d_chown='$d_chown'
16197d_chroot='$d_chroot'
16198d_chsize='$d_chsize'
16199d_closedir='$d_closedir'
16200d_cmsghdr_s='$d_cmsghdr_s'
16201d_const='$d_const'
16202d_crypt='$d_crypt'
16203d_csh='$d_csh'
16204d_cuserid='$d_cuserid'
16205d_dbl_dig='$d_dbl_dig'
16206d_difftime='$d_difftime'
16207d_dirnamlen='$d_dirnamlen'
16208d_dlerror='$d_dlerror'
16209d_dlopen='$d_dlopen'
16210d_dlsymun='$d_dlsymun'
16211d_dosuid='$d_dosuid'
16212d_drand48proto='$d_drand48proto'
16213d_dup2='$d_dup2'
16214d_eaccess='$d_eaccess'
16215d_endgrent='$d_endgrent'
16216d_endhent='$d_endhent'
16217d_endnent='$d_endnent'
16218d_endpent='$d_endpent'
16219d_endpwent='$d_endpwent'
16220d_endsent='$d_endsent'
16221d_eofnblk='$d_eofnblk'
16222d_eunice='$d_eunice'
16223d_fchmod='$d_fchmod'
16224d_fchown='$d_fchown'
16225d_fcntl='$d_fcntl'
16226d_fcntl_can_lock='$d_fcntl_can_lock'
16227d_fd_macros='$d_fd_macros'
16228d_fd_set='$d_fd_set'
16229d_fds_bits='$d_fds_bits'
16230d_fgetpos='$d_fgetpos'
16231d_flexfnam='$d_flexfnam'
16232d_flock='$d_flock'
16233d_fork='$d_fork'
16234d_fpathconf='$d_fpathconf'
16235d_fpos64_t='$d_fpos64_t'
16236d_frexpl='$d_frexpl'
16237d_fs_data_s='$d_fs_data_s'
16238d_fseeko='$d_fseeko'
16239d_fsetpos='$d_fsetpos'
16240d_fstatfs='$d_fstatfs'
16241d_fstatvfs='$d_fstatvfs'
16242d_fsync='$d_fsync'
16243d_ftello='$d_ftello'
16244d_ftime='$d_ftime'
16245d_getcwd='$d_getcwd'
16246d_getespwnam='$d_getespwnam'
16247d_getfsstat='$d_getfsstat'
16248d_getgrent='$d_getgrent'
16249d_getgrps='$d_getgrps'
16250d_gethbyaddr='$d_gethbyaddr'
16251d_gethbyname='$d_gethbyname'
16252d_gethent='$d_gethent'
16253d_gethname='$d_gethname'
16254d_gethostprotos='$d_gethostprotos'
16255d_getitimer='$d_getitimer'
16256d_getlogin='$d_getlogin'
16257d_getmnt='$d_getmnt'
16258d_getmntent='$d_getmntent'
16259d_getnbyaddr='$d_getnbyaddr'
16260d_getnbyname='$d_getnbyname'
16261d_getnent='$d_getnent'
16262d_getnetprotos='$d_getnetprotos'
16263d_getpagsz='$d_getpagsz'
16264d_getpbyname='$d_getpbyname'
16265d_getpbynumber='$d_getpbynumber'
16266d_getpent='$d_getpent'
16267d_getpgid='$d_getpgid'
16268d_getpgrp2='$d_getpgrp2'
16269d_getpgrp='$d_getpgrp'
16270d_getppid='$d_getppid'
16271d_getprior='$d_getprior'
16272d_getprotoprotos='$d_getprotoprotos'
16273d_getprpwnam='$d_getprpwnam'
16274d_getpwent='$d_getpwent'
16275d_getsbyname='$d_getsbyname'
16276d_getsbyport='$d_getsbyport'
16277d_getsent='$d_getsent'
16278d_getservprotos='$d_getservprotos'
16279d_getspnam='$d_getspnam'
16280d_gettimeod='$d_gettimeod'
16281d_gnulibc='$d_gnulibc'
16282d_grpasswd='$d_grpasswd'
16283d_hasmntopt='$d_hasmntopt'
16284d_htonl='$d_htonl'
16285d_iconv='$d_iconv'
16286d_index='$d_index'
16287d_inetaton='$d_inetaton'
16288d_int64_t='$d_int64_t'
16289d_isascii='$d_isascii'
16290d_isnan='$d_isnan'
16291d_isnanl='$d_isnanl'
16292d_killpg='$d_killpg'
16293d_lchown='$d_lchown'
16294d_ldbl_dig='$d_ldbl_dig'
16295d_link='$d_link'
16296d_locconv='$d_locconv'
16297d_lockf='$d_lockf'
16298d_longdbl='$d_longdbl'
16299d_longlong='$d_longlong'
16300d_lseekproto='$d_lseekproto'
16301d_lstat='$d_lstat'
16302d_madvise='$d_madvise'
16303d_mblen='$d_mblen'
16304d_mbstowcs='$d_mbstowcs'
16305d_mbtowc='$d_mbtowc'
16306d_memchr='$d_memchr'
16307d_memcmp='$d_memcmp'
16308d_memcpy='$d_memcpy'
16309d_memmove='$d_memmove'
16310d_memset='$d_memset'
16311d_mkdir='$d_mkdir'
16312d_mkdtemp='$d_mkdtemp'
16313d_mkfifo='$d_mkfifo'
16314d_mkstemp='$d_mkstemp'
16315d_mkstemps='$d_mkstemps'
16316d_mktime='$d_mktime'
16317d_mmap='$d_mmap'
16318d_modfl='$d_modfl'
16319d_mprotect='$d_mprotect'
16320d_msg='$d_msg'
16321d_msg_ctrunc='$d_msg_ctrunc'
16322d_msg_dontroute='$d_msg_dontroute'
16323d_msg_oob='$d_msg_oob'
16324d_msg_peek='$d_msg_peek'
16325d_msg_proxy='$d_msg_proxy'
16326d_msgctl='$d_msgctl'
16327d_msgget='$d_msgget'
16328d_msghdr_s='$d_msghdr_s'
16329d_msgrcv='$d_msgrcv'
16330d_msgsnd='$d_msgsnd'
16331d_msync='$d_msync'
16332d_munmap='$d_munmap'
16333d_mymalloc='$d_mymalloc'
16334d_nice='$d_nice'
16335d_nv_preserves_uv='$d_nv_preserves_uv'
16336d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
16337d_off64_t='$d_off64_t'
16338d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
16339d_oldpthreads='$d_oldpthreads'
16340d_oldsock='$d_oldsock'
16341d_open3='$d_open3'
16342d_pathconf='$d_pathconf'
16343d_pause='$d_pause'
16344d_perl_otherlibdirs='$d_perl_otherlibdirs'
16345d_phostname='$d_phostname'
16346d_pipe='$d_pipe'
16347d_poll='$d_poll'
16348d_portable='$d_portable'
16349d_pthread_yield='$d_pthread_yield'
16350d_pwage='$d_pwage'
16351d_pwchange='$d_pwchange'
16352d_pwclass='$d_pwclass'
16353d_pwcomment='$d_pwcomment'
16354d_pwexpire='$d_pwexpire'
16355d_pwgecos='$d_pwgecos'
16356d_pwpasswd='$d_pwpasswd'
16357d_pwquota='$d_pwquota'
16358d_qgcvt='$d_qgcvt'
16359d_quad='$d_quad'
16360d_readdir='$d_readdir'
16361d_readlink='$d_readlink'
16362d_readv='$d_readv'
16363d_recvmsg='$d_recvmsg'
16364d_rename='$d_rename'
16365d_rewinddir='$d_rewinddir'
16366d_rmdir='$d_rmdir'
16367d_safebcpy='$d_safebcpy'
16368d_safemcpy='$d_safemcpy'
16369d_sanemcmp='$d_sanemcmp'
16370d_sbrkproto='$d_sbrkproto'
16371d_sched_yield='$d_sched_yield'
16372d_scm_rights='$d_scm_rights'
16373d_seekdir='$d_seekdir'
16374d_select='$d_select'
16375d_sem='$d_sem'
16376d_semctl='$d_semctl'
16377d_semctl_semid_ds='$d_semctl_semid_ds'
16378d_semctl_semun='$d_semctl_semun'
16379d_semget='$d_semget'
16380d_semop='$d_semop'
16381d_sendmsg='$d_sendmsg'
16382d_setegid='$d_setegid'
16383d_seteuid='$d_seteuid'
16384d_setgrent='$d_setgrent'
16385d_setgrps='$d_setgrps'
16386d_sethent='$d_sethent'
16387d_setitimer='$d_setitimer'
16388d_setlinebuf='$d_setlinebuf'
16389d_setlocale='$d_setlocale'
16390d_setnent='$d_setnent'
16391d_setpent='$d_setpent'
16392d_setpgid='$d_setpgid'
16393d_setpgrp2='$d_setpgrp2'
16394d_setpgrp='$d_setpgrp'
16395d_setprior='$d_setprior'
16396d_setproctitle='$d_setproctitle'
16397d_setpwent='$d_setpwent'
16398d_setregid='$d_setregid'
16399d_setresgid='$d_setresgid'
16400d_setresuid='$d_setresuid'
16401d_setreuid='$d_setreuid'
16402d_setrgid='$d_setrgid'
16403d_setruid='$d_setruid'
16404d_setsent='$d_setsent'
16405d_setsid='$d_setsid'
16406d_setvbuf='$d_setvbuf'
16407d_sfio='$d_sfio'
16408d_shm='$d_shm'
16409d_shmat='$d_shmat'
16410d_shmatprototype='$d_shmatprototype'
16411d_shmctl='$d_shmctl'
16412d_shmdt='$d_shmdt'
16413d_shmget='$d_shmget'
16414d_sigaction='$d_sigaction'
16415d_sigprocmask='$d_sigprocmask'
16416d_sigsetjmp='$d_sigsetjmp'
16417d_sockatmark='$d_sockatmark'
16418d_socket='$d_socket'
16419d_socklen_t='$d_socklen_t'
16420d_sockpair='$d_sockpair'
16421d_socks5_init='$d_socks5_init'
16422d_sqrtl='$d_sqrtl'
16423d_statblks='$d_statblks'
16424d_statfs_f_flags='$d_statfs_f_flags'
16425d_statfs_s='$d_statfs_s'
16426d_statvfs='$d_statvfs'
16427d_stdio_cnt_lval='$d_stdio_cnt_lval'
16428d_stdio_ptr_lval='$d_stdio_ptr_lval'
16429d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
16430d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
16431d_stdio_stream_array='$d_stdio_stream_array'
16432d_stdiobase='$d_stdiobase'
16433d_stdstdio='$d_stdstdio'
16434d_strchr='$d_strchr'
16435d_strcoll='$d_strcoll'
16436d_strctcpy='$d_strctcpy'
16437d_strerrm='$d_strerrm'
16438d_strerror='$d_strerror'
16439d_strftime='$d_strftime'
16440d_strtod='$d_strtod'
16441d_strtol='$d_strtol'
16442d_strtold='$d_strtold'
16443d_strtoll='$d_strtoll'
16444d_strtoq='$d_strtoq'
16445d_strtoul='$d_strtoul'
16446d_strtoull='$d_strtoull'
16447d_strtouq='$d_strtouq'
16448d_strxfrm='$d_strxfrm'
16449d_suidsafe='$d_suidsafe'
16450d_symlink='$d_symlink'
16451d_syscall='$d_syscall'
16452d_sysconf='$d_sysconf'
16453d_sysernlst='$d_sysernlst'
16454d_syserrlst='$d_syserrlst'
16455d_system='$d_system'
16456d_tcgetpgrp='$d_tcgetpgrp'
16457d_tcsetpgrp='$d_tcsetpgrp'
16458d_telldir='$d_telldir'
16459d_telldirproto='$d_telldirproto'
16460d_time='$d_time'
16461d_times='$d_times'
16462d_truncate='$d_truncate'
16463d_tzname='$d_tzname'
16464d_u32align='$d_u32align'
16465d_ualarm='$d_ualarm'
16466d_umask='$d_umask'
16467d_uname='$d_uname'
16468d_union_semun='$d_union_semun'
16469d_usleep='$d_usleep'
16470d_ustat='$d_ustat'
16471d_vendorarch='$d_vendorarch'
16472d_vendorbin='$d_vendorbin'
16473d_vendorlib='$d_vendorlib'
16474d_vfork='$d_vfork'
16475d_void_closedir='$d_void_closedir'
16476d_voidsig='$d_voidsig'
16477d_voidtty='$d_voidtty'
16478d_volatile='$d_volatile'
16479d_vprintf='$d_vprintf'
16480d_wait4='$d_wait4'
16481d_waitpid='$d_waitpid'
16482d_wcstombs='$d_wcstombs'
16483d_wctomb='$d_wctomb'
16484d_writev='$d_writev'
16485d_xenix='$d_xenix'
16486date='$date'
16487db_hashtype='$db_hashtype'
16488db_prefixtype='$db_prefixtype'
16489defvoidused='$defvoidused'
16490direntrytype='$direntrytype'
16491dlext='$dlext'
16492dlsrc='$dlsrc'
16493doublesize='$doublesize'
16494drand01='$drand01'
16495dynamic_ext='$dynamic_ext'
16496eagain='$eagain'
16497ebcdic='$ebcdic'
16498echo='$echo'
16499egrep='$egrep'
16500emacs='$emacs'
16501eunicefix='$eunicefix'
16502exe_ext='$exe_ext'
16503expr='$expr'
16504extensions='$extensions'
16505fflushNULL='$fflushNULL'
16506fflushall='$fflushall'
16507find='$find'
16508firstmakefile='$firstmakefile'
16509flex='$flex'
16510fpossize='$fpossize'
16511fpostype='$fpostype'
16512freetype='$freetype'
16513full_ar='$full_ar'
16514full_csh='$full_csh'
16515full_sed='$full_sed'
16516gccosandvers='$gccosandvers'
16517gccversion='$gccversion'
16518gidformat='$gidformat'
16519gidsign='$gidsign'
16520gidsize='$gidsize'
16521gidtype='$gidtype'
16522glibpth='$glibpth'
16523grep='$grep'
16524groupcat='$groupcat'
16525groupstype='$groupstype'
16526gzip='$gzip'
16527h_fcntl='$h_fcntl'
16528h_sysfile='$h_sysfile'
16529hint='$hint'
16530hostcat='$hostcat'
16531i16size='$i16size'
16532i16type='$i16type'
16533i32size='$i32size'
16534i32type='$i32type'
16535i64size='$i64size'
16536i64type='$i64type'
16537i8size='$i8size'
16538i8type='$i8type'
16539i_arpainet='$i_arpainet'
16540i_bsdioctl='$i_bsdioctl'
16541i_db='$i_db'
16542i_dbm='$i_dbm'
16543i_dirent='$i_dirent'
16544i_dld='$i_dld'
16545i_dlfcn='$i_dlfcn'
16546i_fcntl='$i_fcntl'
16547i_float='$i_float'
16548i_gdbm='$i_gdbm'
16549i_grp='$i_grp'
16550i_iconv='$i_iconv'
16551i_ieeefp='$i_ieeefp'
16552i_inttypes='$i_inttypes'
16553i_libutil='$i_libutil'
16554i_limits='$i_limits'
16555i_locale='$i_locale'
16556i_machcthr='$i_machcthr'
16557i_malloc='$i_malloc'
16558i_math='$i_math'
16559i_memory='$i_memory'
16560i_mntent='$i_mntent'
16561i_ndbm='$i_ndbm'
16562i_netdb='$i_netdb'
16563i_neterrno='$i_neterrno'
16564i_netinettcp='$i_netinettcp'
16565i_niin='$i_niin'
16566i_poll='$i_poll'
16567i_prot='$i_prot'
16568i_pthread='$i_pthread'
16569i_pwd='$i_pwd'
16570i_rpcsvcdbm='$i_rpcsvcdbm'
16571i_sfio='$i_sfio'
16572i_sgtty='$i_sgtty'
16573i_shadow='$i_shadow'
16574i_socks='$i_socks'
16575i_stdarg='$i_stdarg'
16576i_stddef='$i_stddef'
16577i_stdlib='$i_stdlib'
16578i_string='$i_string'
16579i_sunmath='$i_sunmath'
16580i_sysaccess='$i_sysaccess'
16581i_sysdir='$i_sysdir'
16582i_sysfile='$i_sysfile'
16583i_sysfilio='$i_sysfilio'
16584i_sysin='$i_sysin'
16585i_sysioctl='$i_sysioctl'
16586i_syslog='$i_syslog'
16587i_sysmman='$i_sysmman'
16588i_sysmode='$i_sysmode'
16589i_sysmount='$i_sysmount'
16590i_sysndir='$i_sysndir'
16591i_sysparam='$i_sysparam'
16592i_sysresrc='$i_sysresrc'
16593i_syssecrt='$i_syssecrt'
16594i_sysselct='$i_sysselct'
16595i_syssockio='$i_syssockio'
16596i_sysstat='$i_sysstat'
16597i_sysstatfs='$i_sysstatfs'
16598i_sysstatvfs='$i_sysstatvfs'
16599i_systime='$i_systime'
16600i_systimek='$i_systimek'
16601i_systimes='$i_systimes'
16602i_systypes='$i_systypes'
16603i_sysuio='$i_sysuio'
16604i_sysun='$i_sysun'
16605i_sysutsname='$i_sysutsname'
16606i_sysvfs='$i_sysvfs'
16607i_syswait='$i_syswait'
16608i_termio='$i_termio'
16609i_termios='$i_termios'
16610i_time='$i_time'
16611i_unistd='$i_unistd'
16612i_ustat='$i_ustat'
16613i_utime='$i_utime'
16614i_values='$i_values'
16615i_varargs='$i_varargs'
16616i_varhdr='$i_varhdr'
16617i_vfork='$i_vfork'
16618ignore_versioned_solibs='$ignore_versioned_solibs'
16619inc_version_list='$inc_version_list'
16620inc_version_list_init='$inc_version_list_init'
16621incpath='$incpath'
16622inews='$inews'
16623installarchlib='$installarchlib'
16624installbin='$installbin'
16625installman1dir='$installman1dir'
16626installman3dir='$installman3dir'
16627installprefix='$installprefix'
16628installprefixexp='$installprefixexp'
16629installprivlib='$installprivlib'
16630installscript='$installscript'
16631installsitearch='$installsitearch'
16632installsitebin='$installsitebin'
16633installsitelib='$installsitelib'
16634installstyle='$installstyle'
16635installusrbinperl='$installusrbinperl'
16636installvendorarch='$installvendorarch'
16637installvendorbin='$installvendorbin'
16638installvendorlib='$installvendorlib'
16639intsize='$intsize'
16640issymlink='$issymlink'
16641ivdformat='$ivdformat'
16642ivsize='$ivsize'
16643ivtype='$ivtype'
16644known_extensions='$known_extensions'
16645ksh='$ksh'
16646ld='$ld'
16647lddlflags='$lddlflags'
16648ldflags='$ldflags'
16649ldflags_uselargefiles='$ldflags_uselargefiles'
16650ldlibpthname='$ldlibpthname'
16651less='$less'
16652lib_ext='$lib_ext'
16653libc='$libc'
16654libperl='$libperl'
16655libpth='$libpth'
16656libs='$libs'
16657libsdirs='$libsdirs'
16658libsfiles='$libsfiles'
16659libsfound='$libsfound'
16660libspath='$libspath'
16661libswanted='$libswanted'
16662libswanted_uselargefiles='$libswanted_uselargefiles'
16663line='$line'
16664lint='$lint'
16665lkflags='$lkflags'
16666ln='$ln'
16667lns='$lns'
16668locincpth='$locincpth'
16669loclibpth='$loclibpth'
16670longdblsize='$longdblsize'
16671longlongsize='$longlongsize'
16672longsize='$longsize'
16673lp='$lp'
16674lpr='$lpr'
16675ls='$ls'
16676lseeksize='$lseeksize'
16677lseektype='$lseektype'
16678mail='$mail'
16679mailx='$mailx'
16680make='$make'
16681make_set_make='$make_set_make'
16682mallocobj='$mallocobj'
16683mallocsrc='$mallocsrc'
16684malloctype='$malloctype'
16685man1dir='$man1dir'
16686man1direxp='$man1direxp'
16687man1ext='$man1ext'
16688man3dir='$man3dir'
16689man3direxp='$man3direxp'
16690man3ext='$man3ext'
16691mips_type='$mips_type'
16692mkdir='$mkdir'
16693mmaptype='$mmaptype'
16694modetype='$modetype'
16695more='$more'
16696multiarch='$multiarch'
16697mv='$mv'
16698myarchname='$myarchname'
16699mydomain='$mydomain'
16700myhostname='$myhostname'
16701myuname='$myuname'
16702n='$n'
16703need_va_copy='$need_va_copy'
16704netdb_hlen_type='$netdb_hlen_type'
16705netdb_host_type='$netdb_host_type'
16706netdb_name_type='$netdb_name_type'
16707netdb_net_type='$netdb_net_type'
16708nm='$nm'
16709nm_opt='$nm_opt'
16710nm_so_opt='$nm_so_opt'
16711nonxs_ext='$nonxs_ext'
16712nroff='$nroff'
16713nvEUformat='$nvEUformat'
16714nvFUformat='$nvFUformat'
16715nvGUformat='$nvGUformat'
16716nveformat='$nveformat'
16717nvfformat='$nvfformat'
16718nvgformat='$nvgformat'
16719nvsize='$nvsize'
16720nvtype='$nvtype'
16721o_nonblock='$o_nonblock'
16722obj_ext='$obj_ext'
16723old_pthread_create_joinable='$old_pthread_create_joinable'
16724optimize='$optimize'
16725orderlib='$orderlib'
16726osname='$osname'
16727osvers='$osvers'
16728otherlibdirs='$otherlibdirs'
16729package='$package'
16730pager='$pager'
16731passcat='$passcat'
16732patchlevel='$patchlevel'
16733path_sep='$path_sep'
16734perl5='$perl5'
16735perl='$perl'
16736perl_patchlevel='$perl_patchlevel'
16737perladmin='$perladmin'
16738perllibs='$perllibs'
16739perlpath='$perlpath'
16740pg='$pg'
16741phostname='$phostname'
16742pidtype='$pidtype'
16743plibpth='$plibpth'
16744pm_apiversion='$pm_apiversion'
16745pmake='$pmake'
16746pr='$pr'
16747prefix='$prefix'
16748prefixexp='$prefixexp'
16749privlib='$privlib'
16750privlibexp='$privlibexp'
16751prototype='$prototype'
16752ptrsize='$ptrsize'
16753quadkind='$quadkind'
16754quadtype='$quadtype'
16755randbits='$randbits'
16756randfunc='$randfunc'
16757randseedtype='$randseedtype'
16758ranlib='$ranlib'
16759rd_nodata='$rd_nodata'
16760revision='$revision'
16761rm='$rm'
16762rmail='$rmail'
16763runnm='$runnm'
16764sPRIEUldbl='$sPRIEUldbl'
16765sPRIFUldbl='$sPRIFUldbl'
16766sPRIGUldbl='$sPRIGUldbl'
16767sPRIXU64='$sPRIXU64'
16768sPRId64='$sPRId64'
16769sPRIeldbl='$sPRIeldbl'
16770sPRIfldbl='$sPRIfldbl'
16771sPRIgldbl='$sPRIgldbl'
16772sPRIi64='$sPRIi64'
16773sPRIo64='$sPRIo64'
16774sPRIu64='$sPRIu64'
16775sPRIx64='$sPRIx64'
16776sSCNfldbl='$sSCNfldbl'
16777sched_yield='$sched_yield'
16778scriptdir='$scriptdir'
16779scriptdirexp='$scriptdirexp'
16780sed='$sed'
16781seedfunc='$seedfunc'
16782selectminbits='$selectminbits'
16783selecttype='$selecttype'
16784sendmail='$sendmail'
16785sh='$sh'
16786shar='$shar'
16787sharpbang='$sharpbang'
16788shmattype='$shmattype'
16789shortsize='$shortsize'
16790shrpenv='$shrpenv'
16791shsharp='$shsharp'
16792sig_count='$sig_count'
16793sig_name='$sig_name'
16794sig_name_init='$sig_name_init'
16795sig_num='$sig_num'
16796sig_num_init='$sig_num_init'
16797sig_size='$sig_size'
16798signal_t='$signal_t'
16799sitearch='$sitearch'
16800sitearchexp='$sitearchexp'
16801sitebin='$sitebin'
16802sitebinexp='$sitebinexp'
16803sitelib='$sitelib'
16804sitelib_stem='$sitelib_stem'
16805sitelibexp='$sitelibexp'
16806siteprefix='$siteprefix'
16807siteprefixexp='$siteprefixexp'
16808sizesize='$sizesize'
16809sizetype='$sizetype'
16810sleep='$sleep'
16811smail='$smail'
16812so='$so'
16813sockethdr='$sockethdr'
16814socketlib='$socketlib'
16815socksizetype='$socksizetype'
16816sort='$sort'
16817spackage='$spackage'
16818spitshell='$spitshell'
16819src='$src'
16820ssizetype='$ssizetype'
16821startperl='$startperl'
16822startsh='$startsh'
16823static_ext='$static_ext'
16824stdchar='$stdchar'
16825stdio_base='$stdio_base'
16826stdio_bufsiz='$stdio_bufsiz'
16827stdio_cnt='$stdio_cnt'
16828stdio_filbuf='$stdio_filbuf'
16829stdio_ptr='$stdio_ptr'
16830stdio_stream_array='$stdio_stream_array'
16831strings='$strings'
16832submit='$submit'
16833subversion='$subversion'
16834sysman='$sysman'
16835tail='$tail'
16836tar='$tar'
16837tbl='$tbl'
16838tee='$tee'
16839test='$test'
16840timeincl='$timeincl'
16841timetype='$timetype'
16842touch='$touch'
16843tr='$tr'
16844trnl='$trnl'
16845troff='$troff'
16846u16size='$u16size'
16847u16type='$u16type'
16848u32size='$u32size'
16849u32type='$u32type'
16850u64size='$u64size'
16851u64type='$u64type'
16852u8size='$u8size'
16853u8type='$u8type'
16854uidformat='$uidformat'
16855uidsign='$uidsign'
16856uidsize='$uidsize'
16857uidtype='$uidtype'
16858uname='$uname'
16859uniq='$uniq'
16860uquadtype='$uquadtype'
16861use5005threads='$use5005threads'
16862use64bitall='$use64bitall'
16863use64bitint='$use64bitint'
16864usedl='$usedl'
16865useithreads='$useithreads'
16866uselargefiles='$uselargefiles'
16867uselongdouble='$uselongdouble'
16868usemorebits='$usemorebits'
16869usemultiplicity='$usemultiplicity'
16870usemymalloc='$usemymalloc'
16871usenm='$usenm'
16872useopcode='$useopcode'
16873useperlio='$useperlio'
16874useposix='$useposix'
16875usesfio='$usesfio'
16876useshrplib='$useshrplib'
16877usesocks='$usesocks'
16878usethreads='$usethreads'
16879usevendorprefix='$usevendorprefix'
16880usevfork='$usevfork'
16881usrinc='$usrinc'
16882uuname='$uuname'
16883uvXUformat='$uvXUformat'
16884uvoformat='$uvoformat'
16885uvsize='$uvsize'
16886uvtype='$uvtype'
16887uvuformat='$uvuformat'
16888uvxformat='$uvxformat'
16889vendorarch='$vendorarch'
16890vendorarchexp='$vendorarchexp'
16891vendorbin='$vendorbin'
16892vendorbinexp='$vendorbinexp'
16893vendorlib='$vendorlib'
16894vendorlib_stem='$vendorlib_stem'
16895vendorlibexp='$vendorlibexp'
16896vendorprefix='$vendorprefix'
16897vendorprefixexp='$vendorprefixexp'
16898version='$version'
16899versiononly='$versiononly'
16900vi='$vi'
16901voidflags='$voidflags'
16902xlibpth='$xlibpth'
16903xs_apiversion='$xs_apiversion'
16904yacc='$yacc'
16905yaccflags='$yaccflags'
16906zcat='$zcat'
16907zip='$zip'
16908EOT
16909
16910: Add in command line options if available
16911$test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
16912
16913: add special variables
16914$test -f $src/patchlevel.h && \
16915awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
16916echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
16917echo "PERL_CONFIG_SH=true" >>config.sh
16918
16919: propagate old symbols
16920if $test -f UU/config.sh; then
16921 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
16922 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
16923 $sort | $uniq -u >UU/oldsyms
16924 set X `cat UU/oldsyms`
16925 shift
16926 case $# in
16927 0) ;;
16928 *)
16929 cat <<EOM
16930Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
16931EOM
16932 echo "# Variables propagated from previous config.sh file." >>config.sh
16933 for sym in `cat UU/oldsyms`; do
16934 echo " Propagating $hint variable "'$'"$sym..."
16935 eval 'tmp="$'"${sym}"'"'
16936 echo "$tmp" | \
16937 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
16938 done
16939 ;;
16940 esac
16941fi
16942
16943: Finish up by extracting the .SH files
16944case "$alldone" in
16945exit)
16946 $rm -rf UU
16947 echo "Done."
16948 exit 0
16949 ;;
16950cont)
16951 ;;
16952'')
16953 dflt=''
16954 nostick=true
16955 $cat <<EOM
16956
16957If you'd like to make any changes to the config.sh file before I begin
16958to configure things, do it as a shell escape now (e.g. !vi config.sh).
16959
16960EOM
16961 rp="Press return or use a shell escape to edit config.sh:"
16962 . UU/myread
16963 nostick=''
16964 case "$ans" in
16965 '') ;;
16966 *) : in case they cannot read
16967 sh 1>&4 -c "$ans";;
16968 esac
16969 ;;
16970esac
16971
16972: if this fails, just run all the .SH files by hand
16973. ./config.sh
16974
16975echo " "
16976exec 1>&4
16977. ./UU/extract
16978
16979if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
16980 dflt=y
16981 case "$silent" in
16982 true) ;;
16983 *)
16984 $cat <<EOM
16985
16986Now you need to generate make dependencies by running "$make depend".
16987You might prefer to run it in background: "$make depend > makedepend.out &"
16988It can take a while, so you might not want to run it right now.
16989
16990EOM
16991 ;;
16992 esac
16993 rp="Run $make depend now?"
16994 . UU/myread
16995 case "$ans" in
16996 y*)
16997 $make depend && echo "Now you must run '$make'."
16998 ;;
16999 *)
17000 echo "You must run '$make depend' then '$make'."
17001 ;;
17002 esac
17003elif test -f [Mm]akefile; then
17004 echo " "
17005 echo "Now you must run a $make."
17006else
17007 echo "Done."
17008fi
17009
17010if $test -f Policy.sh; then
17011 $cat <<EOM
17012
17013If you compile $package on a different machine or from a different object
17014directory, copy the Policy.sh file from this object directory to the
17015new one before you run Configure -- this will help you with most of
17016the policy defaults.
17017
17018EOM
17019fi
17020if $test -f config.msg; then
17021 echo "Hmm. I also noted the following information while running:"
17022 echo " "
17023 $cat config.msg >&4
17024 $rm -f config.msg
17025fi
17026$rm -f kit*isdone ark*isdone
17027$rm -rf UU
17028
17029: End of Configure
17030