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.
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.)
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.
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.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Mon Jun 10 07:25:01 EET DST 2002 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat c2$$
47 (exit $?0) || exec sh $0 $argv:q
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
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 case "X${MACHTYPE:-nonesuchmach}" in
76 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
77 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
78 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
79 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
80 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
81 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
82 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
83 paths="$paths /sbin /usr/sbin /usr/libexec"
84 paths="$paths /system/gnu_library/bin"
90 *) test -d $p && PATH=$PATH$p_$p ;;
97 : shall we be using ksh?
103 if (PATH=.; alias -x) >/dev/null 2>&1; then
106 if test -f /hp-ux -a -f /bin/ksh; then
107 needksh='to avoid sh bug in "here document" expansion'
109 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
110 if test X`/usr/bin/uname -v` = X4; then
111 avoidksh="to avoid AIX 4's /bin/sh"
115 if test -f /osf_boot -a -f /usr/sbin/setld; then
116 if test X`/usr/bin/uname -s` = XOSF1; then
117 avoidksh="to avoid Digital UNIX' ksh"
119 unset BIN_SH # if this is 'xpg4' sh will start up ksh
122 case "$inksh/$needksh" in
129 case "$inksh/$avoidksh" in
135 case "$inksh/$needksh-$avoidksh-" in
138 (I see you are using the Korn shell. Some ksh's blow up on $me,
139 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
146 echo "(Feeding myself to $newsh $reason.)"
148 Configure|*/Configure) exec $newsh $0 "$@";;
149 *) exec $newsh Configure "$@";;
154 : if needed set CDPATH to a harmless value that is not chatty
155 : avoid bash 2.02 problems with empty CDPATH.
159 *bash*) CDPATH='.' ;;
164 : Configure runs within the UU subdirectory
165 test -d UU || mkdir UU
373 endhostent_r_proto=''
379 endprotoent_r_proto=''
385 endservent_r_proto=''
435 gethostbyaddr_r_proto=''
437 gethostbyname_r_proto=''
439 gethostent_r_proto=''
451 getnetbyaddr_r_proto=''
453 getnetbyname_r_proto=''
467 d_getprotobyname_r=''
468 getprotobyname_r_proto=''
469 d_getprotobynumber_r=''
470 getprotobynumber_r_proto=''
472 getprotoent_r_proto=''
484 getservbyname_r_proto=''
486 getservbyport_r_proto=''
488 getservent_r_proto=''
562 d_old_pthread_create_joinable=''
563 old_pthread_create_joinable=''
602 sethostent_r_proto=''
619 setprotoent_r_proto=''
631 setservent_r_proto=''
675 d_stdio_ptr_lval_nochange_cnt=''
676 d_stdio_ptr_lval_sets_cnt=''
870 inc_version_list_init=''
889 ignore_versioned_solibs=''
948 d_perl_otherlibdirs=''
962 version_patchlevel_string=''
977 nv_preserves_uv_bits=''
1066 d_stdio_stream_array=''
1067 stdio_stream_array=''
1077 ccflags_uselargefiles=''
1078 ldflags_uselargefiles=''
1079 libswanted_uselargefiles=''
1099 installvendorarch=''
1125 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1128 : We must find out about Eunice early
1130 if test -f /etc/unixtovms; then
1131 eunicefix=/etc/unixtovms
1133 if test -f /etc/unixtovms.exe; then
1134 eunicefix=/etc/unixtovms.exe
1137 : Set executable suffix now -- needed before hints available
1138 if test -f "/libs/version.library"; then
1141 elif test -f "/system/gnu_library/bin/ar.pm"; then
1144 elif test -n "$DJGPP"; then
1147 elif test -d c:/. ; then
1156 : set useposix=false in your hint file to disable the POSIX extension.
1158 : set useopcode=false in your hint file to disable the Opcode extension.
1160 : Trailing extension. Override this in a hint file, if needed.
1161 : Extra object files, if any, needed on this platform.
1164 : Possible local include directories to search.
1165 : Set locincpth to "" in a hint file to defeat local include searches.
1166 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1167 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1169 : no include file wanted by default
1174 : change the next line if compiling for Xenix/286 on Xenix/386
1175 xlibpth='/usr/lib/386 /lib/386'
1176 : Possible local library directories to search.
1177 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1178 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1180 : general looking path for locating libraries
1181 glibpth="/lib /usr/lib $xlibpth"
1182 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1183 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1184 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1186 : Private path used by Configure to find libraries. Its value
1187 : is prepended to libpth. This variable takes care of special
1188 : machines, like the mips. Usually, it should be empty.
1191 : default library list
1193 : some systems want to use only the non-versioned libso:s
1194 ignore_versioned_solibs=''
1196 ccflags_uselargefiles=''
1197 ldflags_uselargefiles=''
1198 libswanted_uselargefiles=''
1199 : set usemultiplicity on the Configure command line to enable multiplicity.
1200 : set usesocks on the Configure command line to enable socks.
1201 : set usethreads on the Configure command line to enable threads.
1202 usereentrant='undef'
1203 : full support for void wanted by default
1206 : List of libraries we want.
1207 : If anyone needs -lnet, put it in a hint file.
1208 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1209 libswanted="$libswanted dld ld sun m c cposix posix"
1210 libswanted="$libswanted ndir dir crypt sec"
1211 libswanted="$libswanted ucb bsd BSD PW x util"
1212 : We probably want to search /usr/shlib before most other libraries.
1213 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1214 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1215 glibpth="/usr/shlib $glibpth"
1216 : Do not use vfork unless overridden by a hint file.
1219 : Find the basic shell for Bourne shell scripts
1223 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1226 if test -f "$xxx"; then
1229 : Build up a list and do a single loop so we can 'break' out.
1230 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1231 for xxx in sh bash ksh pdksh ash; do
1233 try="$try ${p}/${xxx}"
1237 if test -f "$xxx"; then
1240 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1243 elif test -f "$xxx.exe"; then
1254 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1256 Usually it's in /bin/sh. How did you even get this far?
1257 Please contact me (Perl Maintainers) at perlbug@perl.org and
1258 we'll try to straighten this all out.
1264 : see if sh knows # comments
1265 if `$sh -c '#' >/dev/null 2>&1`; then
1269 test -f $xcat$_exe || xcat=/usr/bin/cat
1270 if test ! -f $xcat$_exe; then
1271 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1272 if test -f $p/cat$_exe; then
1277 if test ! -f $xcat$_exe; then
1278 echo "Can't find cat anywhere!"
1282 echo "#!$xcat" >sharp
1286 if test -s today; then
1289 echo "#! $xcat" > sharp
1293 if test -s today; then
1301 echo "Your $sh doesn't grok # comments--I will strip them later on."
1304 echo "exec grep -v '^[ ]*#'" >spitshell
1306 $eunicefix spitshell
1307 spitshell=`pwd`/spitshell
1309 echo "I presume that if # doesn't work, #! won't work either!"
1314 : figure out how to guarantee sh startup
1316 '') startsh=${sharpbang}${sh} ;;
1328 : echo "Yup, it does."
1330 echo "Hmm... '$startsh' does not guarantee sh startup..."
1331 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1336 : Save command line options in file UU/cmdline.opt for later use in
1337 : generating config.sh.
1338 cat > cmdline.opt <<EOSH
1339 # Configure command line arguments.
1348 cat >>cmdline.opt <<EOSH
1349 config_arg$argn='$arg'
1351 # Extreme backslashitis: replace each ' by '"'"'
1352 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1355 arg_exp=`cat cmdl.opt`
1356 args_exp="$args_exp$args_sep'$arg_exp'"
1357 argn=`expr $argn + 1`
1360 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1361 # used by ./hints/os2.sh
1364 : produce awk script to parse command line options
1365 cat >options.awk <<'EOF'
1367 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1369 len = length(optstr);
1370 for (i = 1; i <= len; i++) {
1371 c = substr(optstr, i, 1);
1372 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1383 if (substr(str, 1, 1) != "-") {
1384 printf("'%s'\n", str);
1388 for (i = 2; i <= len; i++) {
1389 c = substr(str, i, 1);
1391 printf("-%s\n", substr(str, i));
1397 printf("'%s'\n", substr(str, i + 1));
1410 : process the command line options
1411 set X `for arg in "$@"; do echo "X$arg"; done |
1412 sed -e s/X// | awk -f options.awk`
1417 : set up default values
1427 rm -f optdef.sh posthint.sh
1428 cat >optdef.sh <<EOS
1434 while test $# -gt 0; do
1436 -d) shift; fastread=yes;;
1437 -e) shift; alldone=cont;;
1441 if test -r "$1"; then
1444 echo "$me: cannot read config file $1." >&2
1449 -h) shift; error=true;;
1450 -r) shift; reuseval=true;;
1451 -s) shift; silent=true; realsilent=true;;
1452 -E) shift; alldone=exit;;
1453 -K) shift; knowitall=true;;
1454 -O) shift; override=true;;
1455 -S) shift; silent=true; extractsh=true;;
1460 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1461 echo "$me: ignoring -D $1" >&2
1464 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1465 *) echo "$1='define'" >> optdef.sh;;
1472 *=) echo "$1" >> optdef.sh;;
1474 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1475 echo "$me: ignoring -U $1" >&2
1477 *) echo "$1='undef'" >> optdef.sh;;
1488 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1492 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1493 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1499 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1500 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1501 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1502 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1503 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1504 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1510 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1512 echo "$yyy=''" >> posthint.sh ;;
1517 echo "$yyy='$zzz'" >> posthint.sh ;;
1519 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1521 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1526 echo "$yyy=$zzz" >> posthint.sh ;;
1527 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1531 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1534 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1542 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1543 [-U symbol] [-U symbol=] [-A command:symbol...]
1544 -d : use defaults for all answers.
1545 -e : go on without questioning past the production of config.sh.
1546 -f : specify an alternate default configuration file.
1547 -h : print this help message and exit (with an error status).
1548 -r : reuse C symbols value if possible (skips costly nm extraction).
1549 -s : silent mode, only echoes questions and essential information.
1550 -D : define symbol to have some value:
1551 -D symbol symbol gets the value 'define'
1552 -D symbol=value symbol gets the value 'value'
1553 -E : stop at the end of questions, after having produced config.sh.
1554 -K : do not use unless you know what you are doing.
1555 -O : let -D and -U override definitions from loaded configuration file.
1556 -S : perform variable substitutions on all .SH files (can mix with -f)
1557 -U : undefine symbol:
1558 -U symbol symbol gets the value 'undef'
1559 -U symbol= symbol gets completely empty
1560 -A : manipulate symbol after the platform specific hints have been applied:
1561 -A symbol=value append " "value to symbol
1562 -A append:symbol=value append value to symbol
1563 -A define:symbol=value define symbol to have value
1564 -A clear:symbol define symbol to be ''
1565 -A define:symbol define symbol to be 'define'
1566 -A eval:symbol=value define symbol to be eval of value
1567 -A prepend:symbol=value prepend value to symbol
1568 -A undef:symbol define symbol to be 'undef'
1569 -A undef:symbol= define symbol to be ''
1570 -V : print version number and exit (with a zero status).
1577 case "$fastread$alldone" in
1580 case "$extractsh" in
1583 if test ! -t 0; then
1584 echo "Say 'sh Configure', not 'sh <Configure'"
1594 true) exec 1>/dev/null;;
1597 : run the defines and the undefines, if any, but leave the file out there...
1600 : create the posthint manipulation script and leave the file out there...
1605 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1606 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1607 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1608 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1609 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1612 : Some greps do not return status, grrr.
1613 echo "grimblepritz" >grimble
1614 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1616 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1622 : the following should work in any shell
1626 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1627 cat >contains <<'EOSS'
1628 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1633 : Find the path to the source tree
1636 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1640 *) src=`cd ../$src && pwd` ;;
1653 if test -f $rsrc/Configure && \
1654 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1656 : found it, so we are ok.
1659 for src in . .. ../.. ../../.. ../../../..; do
1660 if test -f ../$src/Configure && \
1661 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1672 Sorry, I can't seem to locate the source dir for $package. Please start
1673 Configure with an explicit path -- i.e. /some/path/Configure.
1681 echo "Sources for $package found in \"$src\"." >&4
1685 : script used to extract .SH files with variable substitutions
1686 cat >extract <<'EOS'
1688 echo "Doing variable substitutions on .SH files..."
1689 if test -f MANIFEST; then
1690 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1692 echo "(Looking for .SH files under the source directory.)"
1693 set x `(cd "$src"; find . -name "*.SH" -print)`
1697 0) set x `(cd "$src"; echo *.SH)`; shift;;
1699 if test ! -f "$src/$1"; then
1705 while test $name; do
1706 if test ! -d "$name"; then
1707 create="$name $create";
1708 name=`echo $name | sed -e "s|^[^/]*$||"`;
1709 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1714 for file in $create; do
1723 dir=`expr X$file : 'X\(.*\)/'`
1724 file=`expr X$file : 'X.*/\(.*\)'`
1725 (cd "$dir" && . ./$file)
1735 dir=`expr X$file : 'X\(.*\)/'`
1736 file=`expr X$file : 'X.*/\(.*\)'`
1737 (set x $dir; shift; eval $mkdir_p)
1738 sh <"$src/$dir/$file"
1747 if test -f "$src/config_h.SH"; then
1748 if test ! -f config.h; then
1749 : oops, they left it out of MANIFEST, probably, so do it anyway.
1750 . "$src/config_h.SH"
1755 : extract files and exit if asked to do so
1756 case "$extractsh" in
1758 case "$realsilent" in
1762 case "$config_sh" in
1763 '') config_sh='config.sh';;
1766 echo "Fetching answers from $config_sh..."
1769 test "$override" && . ./optdef.sh
1773 echo "Extraction done."
1778 : Eunice requires " " instead of "", can you believe it
1781 echo "Beginning of configuration questions for $package."
1783 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1785 : first determine how to suppress newline on echo command
1787 echo "Checking echo to see how to suppress newlines..."
1788 (echo "hi there\c" ; echo " ") >.echotmp
1789 if $contains c .echotmp >/dev/null 2>&1 ; then
1800 echo $n "The star should be here-->$c"
1804 : Now test for existence of everything in MANIFEST
1806 if test -f "$rsrc/MANIFEST"; then
1807 echo "First let's make sure your kit is complete. Checking..." >&4
1808 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1811 for filelist in x??; do
1812 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1814 if test -s missing; then
1818 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1820 You have the option of continuing the configuration process, despite the
1821 distinct possibility that your kit is damaged, by typing 'y'es. If you
1822 do, don't blame me if something goes wrong. I advise you to type 'n'o
1823 and contact the author (perlbug@perl.org).
1826 echo $n "Continue? [n] $c" >&4
1830 echo "Continuing..." >&4
1834 echo "ABORTING..." >&4
1839 echo "Looks good..."
1842 echo "There is no MANIFEST file. I hope your kit is complete !"
1847 : Find the appropriate value for a newline for tr
1848 if test -n "$DJGPP"; then
1851 if test X"$trnl" = X; then
1852 case "`echo foo|tr '\n' x 2>/dev/null`" in
1856 if test X"$trnl" = X; then
1857 case "`echo foo|tr '\012' x 2>/dev/null`" in
1858 foox) trnl='\012' ;;
1861 if test X"$trnl" = X; then
1862 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1863 fooxy) trnl='\n\r' ;;
1866 if test X"$trnl" = X; then
1869 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1875 : compute the number of columns on the terminal for proper question formatting
1880 : set up the echo used in my read
1881 myecho="case \"\$xxxm\" in
1882 '') echo $n \"\$rp $c\" >&4;;
1884 '') echo $n \"[\$xxxm] $c\";;
1886 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1888 echo $n \"[\$xxxm] $c\" >&4
1890 echo $n \"\$rp [\$xxxm] $c\" >&4
1896 : now set up to do reads with possible shell escape and default assignment
1902 case "\$fastread" in
1903 yes) case "\$dflt" in
1906 case "\$silent-\$rp" in
1911 *) case "\$silent" in
1912 true) case "\$rp" in
1917 while expr "X\$ans" : "X!" >/dev/null; do
1921 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1929 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1938 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1943 echo "(OK, I'll run with -d after this question.)" >&4
1946 echo "*** Sorry, \$1 not supported yet." >&4
1956 echo "*** Substitution done -- please confirm."
1958 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1963 echo "*** Error -- try again."
1970 case "\$ans\$xxxm\$nostick" in
1982 : create .config dir to save info across Configure sessions
1983 test -d ../.config || mkdir ../.config
1984 cat >../.config/README <<EOF
1985 This directory created by Configure to save information that should
1986 persist across sessions for $package.
1988 You may safely delete it if you wish.
1991 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1993 $define|true|[yY]*) ;;
1994 *) case "$xversion" in
1997 *** WHOA THERE!!! ***
1999 This is an UNSTABLE DEVELOPMENT release.
2000 The version of this $package distribution is $xversion, that is, odd,
2001 (as opposed to even) and that signifies a development release.
2002 If you want a maintenance release, you want an even-numbered version.
2004 Do ***NOT*** install this into production use.
2005 Data corruption and crashes are possible.
2007 It is most seriously suggested that you do not continue any further
2008 unless you want to help in developing and debugging Perl.
2010 If you *still* want to build perl, you can answer 'y' now,
2011 or pass -Dusedevel to Configure.
2014 rp='Do you really want to continue?'
2018 [yY]) echo >&4 "Okay, continuing."
2019 usedevel="$define" ;;
2020 *) echo >&4 "Okay, bye."
2030 case "$versiononly" in
2031 '') versiononly="$define" ;;
2033 case "$installusrbinperl" in
2034 '') installusrbinperl="$undef" ;;
2039 : general instructions
2042 user=`(logname) 2>/dev/null`
2044 '') user=`whoami 2>&1`;;
2046 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2049 rp='Would you like to see the instructions?'
2060 This installation shell script will examine your system and ask you questions
2061 to determine how the perl5 package should be installed. If you get
2062 stuck on a question, you may use a ! shell escape to start a subshell or
2063 execute a command. Many of the questions will have default answers in square
2064 brackets; typing carriage return will give you the default.
2066 On some of the questions which ask for file or directory names you are allowed
2067 to use the ~name construct to specify the login directory belonging to "name",
2068 even if you don't have a shell which knows about that. Questions where this is
2069 allowed will be marked "(~name ok)".
2073 dflt='Type carriage return to continue'
2077 The prompter used in this script allows you to use shell variables and
2078 backticks in your answers. You may use $1, $2, etc... to refer to the words
2079 in the default answer, as if the default line was a set of arguments given to a
2080 script shell. This means you may also use $* to repeat the whole default line,
2081 so you do not have to re-type everything to add something to the default.
2083 Everytime there is a substitution, you will have to confirm. If there is an
2084 error (e.g. an unmatched backtick), the default answer will remain unchanged
2085 and you will be prompted again.
2087 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2088 the questions and use the computed defaults (or the previous answers if there
2089 was already a config.sh file). Type 'Configure -h' for a list of options.
2090 You may also start interactively and then answer '& -d' at any prompt to turn
2091 on the non-interactive behaviour for the remainder of the execution.
2097 Much effort has been expended to ensure that this shell script will run on any
2098 Unix system. If despite that it blows up on yours, your best bet is to edit
2099 Configure and run it again. If you can't run Configure for some reason,
2100 you'll have to generate a config.sh file by hand. Whatever problems you
2101 have, let me (perlbug@perl.org) know how I blew it.
2103 This installation script affects things in two ways:
2105 1) it may do direct variable substitutions on some of the files included
2107 2) it builds a config.h file for inclusion in C programs. You may edit
2108 any of these files as the need arises after running this script.
2110 If you make a mistake on a question, there is no easy way to back up to it
2111 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2112 files. Configure will offer to let you do this before it runs the SH files.
2115 dflt='Type carriage return to continue'
2117 case "$firsttime" in
2118 true) echo $user >>../.config/instruct;;
2122 : find out where common programs are
2124 echo "Locating common programs..." >&4
2137 if test -d \$dir/\$thing; then
2143 for thisthing in \$dir/\$thing; do
2144 : just loop through to pick last item
2146 if test -f \$thisthing; then
2149 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2152 elif test -f \$dir/\$thing.exe; then
2153 if test -n "$DJGPP"; then
2154 echo \$dir/\$thing.exe
2156 : on Eunice apparently
2209 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2210 pth="$pth /lib /usr/lib"
2211 for file in $loclist; do
2215 if test -f "$xxx"; then
2218 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2219 xxx=`./loc $file $file $pth`
2222 '') xxx=`./loc $file $file $pth`;;
2223 *) xxx=`./loc $xxx $xxx $pth`;;
2225 eval $file=$xxx$_exe
2229 echo $file is in $xxx.
2232 echo $file is in $xxx.
2235 echo "I don't know where '$file' is, and my life depends on it." >&4
2236 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2242 echo "Don't worry if any of the following aren't found..."
2244 for file in $trylist; do
2248 if test -f "$xxx"; then
2251 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2252 xxx=`./loc $file $file $pth`
2255 '') xxx=`./loc $file $file $pth`;;
2256 *) xxx=`./loc $xxx $xxx $pth`;;
2258 eval $file=$xxx$_exe
2262 echo $file is in $xxx.
2265 echo $file is in $xxx.
2268 echo "I don't see $file out there, $say."
2275 echo "Substituting grep for egrep."
2282 echo "Substituting cp for ln."
2291 echo "I can't find make or gmake, and my life depends on it." >&4
2292 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2300 *) # We can't have osname yet.
2301 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2302 # Assume that gmake, if found, is definitely GNU make
2303 # and prefer it over the system make.
2304 echo "Substituting gmake for make."
2312 echo "Hopefully test is built into your sh."
2315 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2316 echo "Using the test built into your sh."
2324 echo "Hopefully echo is built into your sh."
2329 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2330 $echo $n "hi there$c" >foo1
2331 echo $n "hi there$c" >foo2
2332 if cmp foo1 foo2 >/dev/null 2>&1; then
2333 echo "They are compatible. In fact, they may be identical."
2340 They are not compatible! You are probably running ksh on a non-USG system.
2341 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2342 have echo built in and we may have to run some Bourne shell scripts. That
2343 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2346 $echo $n "The star should be here-->$c"
2356 cat <<'EOSC' >>trygcc
2361 int main(int argc, char *argv[]) {
2365 if $cc -o try $ccflags $ldflags try.c; then
2368 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2374 case "`$cc -v -c try.c 2>&1`" in
2377 if $test X"$trygcc" = Xyes; then
2378 if gcc -o try -c try.c; then
2380 echo "You seem to have a working gcc, though." >&4
2381 rp="Would you like to use it?"
2383 if $test -f myread; then
2386 if $test -f UU/myread; then
2389 echo "Cannot find myread, sorry. Aborting." >&2
2394 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2395 if $test -f usethreads.cbu; then
2398 *** However, any setting of the C compiler flags (e.g. for thread support)
2399 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2400 *** (together with e.g. -Dusethreads).
2416 cat <<'EOSC' >>checkcc
2421 int main(int argc, char *argv[]) {
2425 if $cc -o try $ccflags $ldflags try.c; then
2428 if $test X"$despair" = Xyes; then
2429 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2432 You need to find a working C compiler.
2433 Either (purchase and) install the C compiler supplied by your OS vendor,
2434 or for a free C compiler try http://gcc.gnu.org/
2435 I cannot continue any further, aborting.
2444 : determine whether symbolic links are supported
2447 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2448 echo "Symbolic links are supported." >&4
2451 echo "Symbolic links are NOT supported." >&4
2456 : determine whether symbolic links are supported
2460 echo "Checking how to test for symbolic links..." >&4
2462 if $test "X$issymlink" = X; then
2464 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2465 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2467 if test $? = 0; then
2470 echo "Your builtin 'test -h' may be broken." >&4
2473 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2476 if test -f "$p/$test"; then
2485 echo "Trying external '$test -h'." >&4
2486 issymlink="$test -h"
2487 if $test ! -h sym >/dev/null 2>&1; then
2488 echo "External '$test -h' is broken, too." >&4
2496 if $test "X$issymlink" = X; then
2497 if $test -L sym 2>/dev/null; then
2498 issymlink="$test -L"
2499 echo "The builtin '$test -L' worked." >&4
2502 if $test "X$issymlink" != X; then
2503 echo "You can test for symbolic links with '$issymlink'." >&4
2505 echo "I do not know how you can test for symbolic links." >&4
2509 *) echo "No symbolic links, so not testing for their testing..." >&4
2515 case "$mksymlinks" in
2518 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2521 *) case "$lns:$issymlink" in
2522 *"ln"*" -s:"*"test -"?)
2523 echo "Creating the symbolic links..." >&4
2524 echo "(First creating the subdirectories...)" >&4
2526 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2528 test -z "$directory" && break
2532 if test ! -d t/base; then
2533 echo "Failed to create the subdirectories. Aborting." >&4
2536 echo "(Then creating the symlinks...)" >&4
2537 awk '{print $1}' $src/MANIFEST | while true; do
2539 test -z "$filename" && break
2540 if test -f $filename; then
2541 if $issymlink $filename; then
2545 if test -f $filename; then
2546 echo "$filename already exists, not symlinking."
2548 ln -s $src/$filename $filename
2552 if test ! -f t/base/lex.t; then
2553 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2558 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2567 case "$usecrosscompile" in
2569 $echo "Cross-compiling..."
2572 *-*-gcc) # A cross-compiling gcc, probably.
2573 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2575 # leave out ld, choosing it is more complex
2577 ranlib=$targetarch-ranlib
2578 $echo 'extern int foo;' > try.c
2579 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2581 if $test $# -gt 0; then
2583 incpth="`$echo $incpth|$sed 's/^ //'`"
2584 echo "Guessing incpth '$incpth'." >&4
2586 j="`$echo $i|$sed 's,/include$,/lib,'`"
2587 if $test -d $j; then
2591 libpth="`$echo $libpth|$sed 's/^ //'`"
2592 echo "Guessing libpth '$libpth'." >&4
2597 case "$targetarch" in
2598 '') echo "Targetarch not defined." >&4; croak=y ;;
2599 *) echo "Using targetarch $targetarch." >&4 ;;
2602 '') echo "Incpth not defined." >&4; croak=y ;;
2603 *) echo "Using incpth '$incpth'." >&4 ;;
2606 '') echo "Libpth not defined." >&4; croak=y ;;
2607 *) echo "Using libpth '$libpth'." >&4 ;;
2610 '') for i in $incpth; do
2611 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2613 echo "Guessing usrinc $usrinc." >&4
2618 '') echo "Usrinc not defined." >&4; croak=y ;;
2621 *) echo "Using usrinc $usrinc." >&4 ;;
2623 case "$targethost" in
2624 '') echo "Targethost not defined." >&4; croak=y ;;
2625 *) echo "Using targethost $targethost." >&4
2630 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2633 /*) run=$src/Cross/run
2634 targetmkdir=$src/Cross/mkdir
2636 from=$src/Cross/from
2638 *) pwd=`$test -f ../Configure & cd ..; pwd`
2640 targetmkdir=$pwd/Cross/mkdir
2642 from=$pwd/Cross/from
2645 case "$targetrun" in
2646 '') targetrun=ssh ;;
2651 case "$targetfrom" in
2652 '') targetfrom=scp ;;
2656 from=$from-$targetfrom
2657 case "$targetdir" in
2659 echo "Guessing targetdir $targetdir." >&4
2662 case "$targetuser" in
2664 echo "Guessing targetuser $targetuser." >&4
2667 case "$targetfrom" in
2671 case "$targetrun" in
2683 '') cwd=$targetdir ;;
2687 if $test ! -f \$exe.xok; then
2691 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2694 *) echo "Unknown targetrun '$targetrun'" >&4
2698 case "$targetmkdir" in
2700 cat >$targetmkdir <<EOF
2702 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2704 $chmod a+rx $targetmkdir
2706 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2718 $targetmkdir \`dirname \$f\`
2719 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2722 $targetmkdir $targetdir/\`dirname \$f\`
2723 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2736 $mkdir -p $targetdir/\`dirname \$f\`
2737 $cp \$f $targetdir/\$f || exit 1
2740 $targetmkdir $targetdir/\`dirname \$f\`
2741 $cp \$f $targetdir/\$f || exit 1
2748 *) echo "Unknown targetto '$targetto'" >&4
2752 case "$targetfrom" in
2759 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2764 cp) cat >$from <<EOF
2769 cp $targetdir/\$f . || exit 1
2774 *) echo "Unknown targetfrom '$targetfrom'" >&4
2778 if $test ! -f $run; then
2779 echo "Target 'run' script '$run' not found." >&4
2783 if $test ! -f $to; then
2784 echo "Target 'to' script '$to' not found." >&4
2788 if $test ! -f $from; then
2789 echo "Target 'from' script '$from' not found." >&4
2793 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2797 Using '$run' for remote execution,
2798 and '$from' and '$to'
2799 for remote file transfer.
2805 usecrosscompile='undef'
2810 : see whether [:lower:] and [:upper:] are supported character classes
2812 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2814 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2818 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2819 # (0xc9 and 0xd1), therefore that is a nice testing point.
2820 if test "X$up" = X -o "X$low" = X; then
2821 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2827 if test "X$up" = X -o "X$low" = X; then
2828 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2834 if test "X$up" = X -o "X$low" = X; then
2835 case "`echo IJ | od -x 2>/dev/null`" in
2837 echo "Hey, this might be EBCDIC." >&4
2838 if test "X$up" = X -o "X$low" = X; then
2839 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2840 ij) up='[A-IJ-RS-Z]'
2845 if test "X$up" = X -o "X$low" = X; then
2846 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2856 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2858 echo "Using $up and $low to convert case." >&4
2861 echo "I don't know how to translate letters from upper to lower case." >&4
2862 echo "Your tr is not acting any way I know of." >&4
2866 : set up the translation script tr, must be called with ./tr of course
2870 '[A-Z][a-z]') exec $tr '$up' '$low';;
2871 '[a-z][A-Z]') exec $tr '$low' '$up';;
2878 : Try to determine whether config.sh was made on this system
2879 case "$config_sh" in
2881 myuname=`$uname -a 2>/dev/null`
2882 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2883 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2884 # because the A-Z/a-z are not consecutive.
2885 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2886 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2887 newmyuname="$myuname"
2889 case "$knowitall" in
2891 if test -f ../config.sh; then
2892 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2893 eval "`grep myuname= ../config.sh`"
2895 if test "X$myuname" = "X$newmyuname"; then
2903 : Get old answers from old config file if Configure was run on the
2904 : same system, otherwise use the hints.
2907 if test -f config.sh; then
2909 rp="I see a config.sh file. Shall I use it to set the defaults?"
2912 n*|N*) echo "OK, I'll ignore it."
2913 mv config.sh config.sh.old
2914 myuname="$newmyuname"
2916 *) echo "Fetching default answers from your old config.sh file..." >&4
2924 : Older versions did not always set $sh. Catch re-use of such
2934 if test ! -f config.sh; then
2937 First time through, eh? I have some defaults handy for some systems
2938 that need some extra help getting the Configure answers right:
2941 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2943 : Half the following guesses are probably wrong... If you have better
2944 : tests or hints, please send them to perlbug@perl.org
2945 : The metaconfig authors would also appreciate a copy...
2946 $test -f /irix && osname=irix
2947 $test -f /xenix && osname=sco_xenix
2948 $test -f /dynix && osname=dynix
2949 $test -f /dnix && osname=dnix
2950 $test -f /lynx.os && osname=lynxos
2951 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2952 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2953 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2954 $test -f /bin/mips && /bin/mips && osname=mips
2955 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2956 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2957 $test -d /usr/apollo/bin && osname=apollo
2958 $test -f /etc/saf/_sactab && osname=svr4
2959 $test -d /usr/include/minix && osname=minix
2960 $test -f /system/gnu_library/bin/ar.pm && osname=vos
2961 if $test -d /MachTen -o -d /MachTen_Folder; then
2963 if $test -x /sbin/version; then
2964 osvers=`/sbin/version | $awk '{print $2}' |
2965 $sed -e 's/[A-Za-z]$//'`
2966 elif $test -x /usr/etc/version; then
2967 osvers=`/usr/etc/version | $awk '{print $2}' |
2968 $sed -e 's/[A-Za-z]$//'`
2974 $test -f /sys/posix.dll &&
2975 $test -f /usr/bin/what &&
2976 set X `/usr/bin/what /sys/posix.dll` &&
2977 $test "$3" = UWIN &&
2981 if $test -f $uname; then
2989 umips) osname=umips ;;
2992 [23]100) osname=mips ;;
2993 next*) osname=next ;;
2995 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2996 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2999 elif $test -f /etc/kconfig; then
3001 if test "$lns" = "$ln -s"; then
3003 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3005 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3012 if test -n "$DJGPP"; then
3021 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3023 'not found') osvers="$4"."$3" ;;
3024 '<3240'|'<>3240') osvers=3.2.0 ;;
3025 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3026 '=3250'|'>3250') osvers=3.2.5 ;;
3030 bsd386) osname=bsd386
3033 cygwin*) osname=cygwin
3036 *dc.osx) osname=dcosx
3042 domainos) osname=apollo
3048 dynixptx*) osname=dynixptx
3049 osvers=`echo "$4"|sed 's/^v//'`
3051 freebsd) osname=freebsd
3053 genix) osname=genix ;;
3055 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3071 netbsd*) osname=netbsd
3074 news-os) osvers="$3"
3076 4*) osname=newsos4 ;;
3080 next*) osname=next ;;
3081 nonstop-ux) osname=nonstopux ;;
3082 openbsd) osname=openbsd
3085 POSIX-BC | posix-bc ) osname=posix-bc
3088 powerux | power_ux | powermax_os | powermaxos | \
3089 powerunix | power_unix) osname=powerux
3095 solaris) osname=solaris
3097 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3104 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3108 titanos) osname=titanos
3117 ultrix) osname=ultrix
3120 osf1|mls+) case "$5" in
3123 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3126 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3129 hp*) osname=hp_osf1 ;;
3130 mips) osname=mips_osf1 ;;
3133 unixware) osname=svr5
3141 $2) case "$osname" in
3145 : svr4.x or possibly later
3155 if test -f /stand/boot ; then
3156 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3157 if test -n "$INITPROG" -a -f "$INITPROG"; then
3158 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3159 if test -n "$isesix"; then
3167 *) if test -f /etc/systemid; then
3169 set `echo $3 | $sed 's/\./ /g'` $4
3170 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3172 elif $test -f $src/hints/sco_$1_$2.sh; then
3174 elif $test -f $src/hints/sco_$1.sh; then
3179 '') : Still unknown. Probably a generic Sys V.
3188 *) case "$osname" in
3189 '') : Still unknown. Probably a generic BSD.
3197 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3198 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3199 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3202 $rm -f UU/kernel.what
3203 elif test -d c:/.; then
3210 case "$targetarch" in
3213 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3218 : Now look for a hint file osname_osvers, unless one has been
3219 : specified already.
3222 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3223 : Also try without trailing minor version numbers.
3224 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3225 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3226 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3227 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3230 *) case "$osvers" in
3233 *) if $test -f $src/hints/$file.sh ; then
3235 elif $test -f $src/hints/$xfile.sh ; then
3237 elif $test -f $src/hints/$xxfile.sh ; then
3239 elif $test -f $src/hints/$xxxfile.sh ; then
3241 elif $test -f $src/hints/$xxxxfile.sh ; then
3243 elif $test -f "$src/hints/${osname}.sh" ; then
3252 if $test -f Policy.sh ; then
3255 none) dflt="Policy" ;;
3256 *) dflt="Policy $dflt" ;;
3261 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3265 if $test -f Policy.sh ; then
3268 There's also a Policy hint file available, which should make the
3269 site-specific (policy) questions easier to answer.
3276 You may give one or more space-separated answers, or "none" if appropriate.
3277 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3278 is a good thing. DO NOT give a wrong version or a wrong OS.
3282 rp="Which of these apply, if any?"
3285 for file in $tans; do
3286 if $test X$file = XPolicy -a -f Policy.sh; then
3288 $cat Policy.sh >> UU/config.sh
3289 elif $test -f $src/hints/$file.sh; then
3290 . $src/hints/$file.sh
3291 $cat $src/hints/$file.sh >> UU/config.sh
3292 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3295 : Give one chance to correct a possible typo.
3296 echo "$file.sh does not exist"
3298 rp="hint to use instead?"
3300 for file in $ans; do
3301 if $test -f "$src/hints/$file.sh"; then
3302 . $src/hints/$file.sh
3303 $cat $src/hints/$file.sh >> UU/config.sh
3304 elif $test X$ans = X -o X$ans = Xnone ; then
3307 echo "$file.sh does not exist -- ignored."
3314 : Remember our hint file for later.
3315 if $test -f "$src/hints/$file.sh" ; then
3325 echo "Fetching default answers from $config_sh..." >&4
3329 cp $config_sh config.sh 2>/dev/null
3339 test "$override" && . ./optdef.sh
3341 : Restore computed paths
3342 for file in $loclist $trylist; do
3343 eval $file="\$_$file"
3348 Configure uses the operating system name and version to set some defaults.
3349 The default value is probably right if the name rings a bell. Otherwise,
3350 since spelling matters for me, either accept the default or answer "none"
3357 ''|' '|none) dflt=none ;;
3358 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3361 *) dflt="$osname" ;;
3363 rp="Operating system name?"
3367 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3373 ''|' '|none) dflt=none ;;
3374 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3375 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3377 ''|' ') dflt=none ;;
3382 *) dflt="$osvers" ;;
3384 rp="Operating system version?"
3394 : who configured the system
3395 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3396 cf_by=`(logname) 2>/dev/null`
3399 cf_by=`(whoami) 2>/dev/null`
3401 "") cf_by=unknown ;;
3405 : set up the script used to warn in case of inconsistency
3412 echo "*** WHOA THERE!!! ***" >&4
3413 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3414 rp=" Keep the $hint value?"
3417 y) td=$was; tu=$was;;
3421 : function used to set $1 to $val
3422 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3424 $define$undef) . ./whoa; eval "$var=\$td";;
3425 $undef$define) . ./whoa; eval "$var=\$tu";;
3426 *) eval "$var=$val";;
3430 $define|true|[yY]*) dflt='y';;
3435 Perl can be built to use the SOCKS proxy protocol library. To do so,
3436 Configure must be run with -Dusesocks. If you use SOCKS you also need
3437 to use the PerlIO abstraction layer, this will be implicitly selected.
3439 If this doesn't make any sense to you, just accept the default '$dflt'.
3441 rp='Build Perl for SOCKS?'
3444 y|Y) val="$define" ;;
3451 $define|true|[yY]*) useperlio="$define";;
3454 case "$useperlio" in
3455 $define|true|[yY]*|'') dflt='y';;
3460 Previous version of $package used the standard IO mechanisms as
3461 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3462 alternate IO mechanisms via the PerlIO abstraction layer, but the
3463 stdio mechanism is still available if needed. The abstraction layer
3464 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3465 Using PerlIO with sfio may cause problems with some extension modules.
3467 If this doesn't make any sense to you, just accept the default '$dflt'.
3469 rp='Use the PerlIO abstraction layer?'
3476 echo "Ok, doing things the stdio way."
3485 case "$useperlio" in
3486 $define|true|[yY]*) ;;
3489 You are using the SOCKS proxy protocol library which means that you
3490 should also use the PerlIO layer. You may be headed for trouble.
3499 case "$usethreads" in
3500 $define|true|[yY]*) dflt='y';;
3501 *) # Catch case where user specified ithreads or 5005threads but
3502 # forgot -Dusethreads (A.D. 4/2002)
3503 case "$useithreads$use5005threads" in
3505 case "$useperlio" in
3506 "$define") dflt='y' ;;
3516 Perl can be built to take advantage of threads on some systems.
3517 To do so, Configure can be run with -Dusethreads.
3519 Note that Perl built with threading support runs slightly slower
3520 and uses more memory than plain Perl. The current implementation
3521 is believed to be stable, but it is fairly new, and so should be
3522 treated with caution.
3524 If this doesn't make any sense to you, just accept the default '$dflt'.
3526 rp='Build a threading Perl?'
3529 y|Y) val="$define" ;;
3535 case "$usethreads" in
3539 Since release 5.6, Perl has had two different threading implementations,
3540 the newer interpreter-based version (ithreads) with one interpreter per
3541 thread, and the older 5.005 version (5005threads).
3542 The 5005threads version is effectively unmaintained and will probably be
3543 removed in Perl 5.10, so there should be no need to build a Perl using it
3544 unless needed for backwards compatibility with some existing 5.005threads
3548 : Default to ithreads unless overridden on command line or with
3551 case "$use5005threads" in
3552 $define|true|[yY]*) dflt='n';;
3554 case "$useithreads" in
3555 $undef|false|[nN]*) dflt='n';;
3557 rp='Use the newer interpreter-based ithreads?'
3560 y|Y) val="$define" ;;
3565 : Now set use5005threads to the opposite value.
3566 case "$useithreads" in
3567 $define) val="$undef" ;;
3574 useithreads="$undef"
3575 use5005threads="$undef"
3579 case "$useithreads$use5005threads" in
3583 You cannot have both the ithreads and the 5.005 threads enabled
3584 at the same time. Disabling the 5.005 threads since they are
3585 much less stable than the ithreads.
3588 use5005threads="$undef"
3592 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3595 *** To build with ithreads you must also use the PerlIO layer.
3596 *** Cannot continue, aborting.
3602 case "$d_oldpthreads" in
3603 '') : Configure tests would be welcome here. For now, assume undef.
3605 *) val="$d_oldpthreads" ;;
3611 case "$usethreads" in
3612 "$define"|true|[yY]*)
3613 : Look for a hint-file generated 'call-back-unit'. If the
3614 : user has specified that a threading perl is to be built,
3615 : we may need to set or change some other defaults.
3616 if $test -f usethreads.cbu; then
3617 echo "Your platform has some specific hints for threaded builds, using them..."
3621 (Your platform doesn't have any specific hints for threaded builds.
3622 Assuming POSIX threads, then.)
3630 Perl can be built so that multiple Perl interpreters can coexist
3631 within the same Perl executable.
3634 case "$useithreads" in
3637 This multiple interpreter support is required for interpreter-based threads.
3641 *) case "$usemultiplicity" in
3642 $define|true|[yY]*) dflt='y';;
3646 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3647 rp='Build Perl for multiplicity?'
3650 y|Y) val="$define" ;;
3659 case "$usemorebits" in
3660 "$define"|true|[yY]*)
3661 use64bitint="$define"
3662 uselongdouble="$define"
3663 usemorebits="$define"
3665 *) usemorebits="$undef"
3669 : make some quick guesses about what we are up against
3671 $echo $n "Hmm... $c"
3681 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3682 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3684 echo "Looks kind of like an OSF/1 system, but we'll see..."
3686 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3687 xxx=`./loc addbib blurfl $pth`
3688 if $test -f $xxx; then
3689 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3693 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3694 echo "Looks kind of like an extended USG system, but we'll see..."
3696 echo "Looks kind of like a USG system, but we'll see..."
3700 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3701 echo "Looks kind of like a BSD system, but we'll see..."
3705 echo "Looks kind of like a Version 7 system, but we'll see..."
3708 case "$eunicefix" in
3711 There is, however, a strange, musty smell in the air that reminds me of
3712 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3716 : it so happens the Eunice I know will not run shell scripts in Unix format
3720 echo "Congratulations. You aren't running Eunice."
3724 : Detect OS2. The p_ variable is set above in the Head.U unit.
3725 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3726 : semicolon as a patch separator
3731 I have the feeling something is not exactly right, however...don't tell me...
3732 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3733 (Or you may be running DOS with DJGPP.)
3738 if test -f /xenix; then
3739 echo "Actually, this looks more like a XENIX system..."
3744 echo "It's not Xenix..."
3749 if test -f /venix; then
3750 echo "Actually, this looks more like a VENIX system..."
3757 echo "Nor is it Venix..."
3760 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3761 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3768 rp="Use which C compiler?"
3772 : See if they have not cc but they do have gcc
3774 : Look for a hint-file generated 'call-back-unit'. Now that the
3775 : user has specified the compiler, we may need to set or change some
3777 if $test -f cc.cbu; then
3783 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3789 printf("%s\n", __VERSION__);
3791 printf("%s\n", "1");
3797 if $cc -o try $ccflags $ldflags try.c; then
3798 gccversion=`$run ./try`
3799 case "$gccversion" in
3800 '') echo "You are not using GNU cc." ;;
3801 *) echo "You are using GNU cc $gccversion."
3807 echo "*** WHOA THERE!!! ***" >&4
3808 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3809 case "$knowitall" in
3811 echo " You'd better start hunting for one and let me know about it." >&4
3817 case "$gccversion" in
3818 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3820 case "$gccversion" in
3821 '') gccosandvers='' ;;
3822 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3823 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3825 case "$gccosandvers" in
3826 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3827 $osname$osvers) ;; # looking good
3828 $osname*) cat <<EOM >&4
3830 *** WHOA THERE!!! ***
3832 Your gcc has not been compiled for the exact release of
3833 your operating system ($gccosandvers versus $osname$osvers).
3835 In general it is a good idea to keep gcc synchronized with
3836 the operating system because otherwise serious problems
3837 may ensue when trying to compile software, like Perl.
3839 I'm trying to be optimistic here, though, and will continue.
3840 If later during the configuration and build icky compilation
3841 problems appear (headerfile conflicts being the most common
3842 manifestation), I suggest reinstalling the gcc to match
3843 your operating system release.
3847 *) gccosandvers='' ;; # failed to parse, better be silent
3855 # gcc 3.1 complains about adding -Idirectories that it already knows about,
3856 # so we will take those off from locincpth.
3857 case "$gccversion" in
3859 echo "main(){}">try.c
3860 for incdir in `$cc -v -c try.c 2>&1 | \
3861 sed '1,/^#include <\.\.\.>/d;/^End of search list/,$d;s/^ //'` ; do
3862 locincpth=`echo $locincpth | sed s!$incdir!!`
3867 : decide how portable to be. Allow command line overrides.
3868 case "$d_portable" in
3870 *) d_portable="$define" ;;
3873 : set up shell script to do ~ expansion
3879 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3882 if $test -f /bin/csh; then
3883 /bin/csh -f -c "glob \$1"
3888 name=\`$expr x\$1 : '..\([^/]*\)'\`
3889 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3890 if $test ! -d "\$dir"; then
3892 echo "\$me: can't locate home directory for: \$name" >&2
3897 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3913 : now set up to get a file name
3917 cat <<'EOSC' >>getfile
3933 : getfile will accept an answer from the comma-separated list
3934 : enclosed in parentheses even if it does not meet other criteria.
3935 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3936 fn=`echo $fn | sed 's/(.*)//'`
3942 loc_file=`expr $fn : '.*:\(.*\)'`
3943 fn=`expr $fn : '\(.*\):.*'`
3951 */*) fullpath=true;;
3960 *e*) exp_file=true;;
3963 *p*) nopath_ok=true;;
3968 *d*) type='Directory';;
3969 *l*) type='Locate';;
3974 Locate) what='File';;
3979 case "$d_portable" in
3987 while test "$type"; do
3992 true) rp="$rp (~name ok)";;
3995 if test -f UU/getfile.ok && \
3996 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4015 value=`UU/filexp $ans`
4018 if test "$ans" != "$value"; then
4019 echo "(That expands to $value on this system.)"
4033 /*) value="$ansexp" ;;
4034 [a-zA-Z]:/*) value="$ansexp" ;;
4039 echo "I shall only accept a full path name, as in /bin/ls." >&4
4040 echo "Use a ! shell escape if you wish to check pathnames." >&4
4043 echo "Please give a full path name, starting with slash." >&4
4046 echo "Note that using ~name is ok provided it expands well." >&4
4059 for fp in $gfpth; do
4060 if test "X$fp" = X.; then
4065 if test -f "$pf"; then
4067 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4069 echo "($value is not a plain file, but that's ok.)"
4072 if test X"$type" = X; then
4079 for fp in $gfpth; do
4080 if test "X$fp" = X.; then
4085 direxp="$fp/$ansexp"
4087 if test -d "$direxp"; then
4095 if test -d "$ansexp"; then
4096 echo "(Looking for $loc_file in directory $value.)"
4097 value="$value/$loc_file"
4098 ansexp="$ansexp/$loc_file"
4100 if test -f "$ansexp"; then
4103 case "$nopath_ok" in
4104 true) case "$value" in
4106 *) echo "Assuming $value will be in people's path."
4122 if test "$fastread" = yes; then
4127 rp="$what $value doesn't exist. Use that name anyway?"
4146 test "X$gfpthkeep" != Xy && gfpth=""
4149 : What should the include directory be ?
4151 $echo $n "Hmm... $c"
4155 if $test -f /bin/mips && /bin/mips; then
4156 echo "Looks like a MIPS system..."
4157 $cat >usr.c <<'EOCP'
4158 #ifdef SYSTYPE_BSD43
4162 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4163 dflt='/bsd43/usr/include'
4167 mips_type='System V'
4169 $rm -f usr.c usr.out
4170 echo "and you're compiling with the $mips_type compiler and libraries."
4174 echo "Doesn't look like a MIPS system."
4184 case "$xxx_prompt" in
4187 rp='Where are the include files you want to use?'
4195 : see how we invoke the C preprocessor
4197 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4198 cat <<'EOT' >testcpp.c
4204 if test ! -f cppstdin; then
4205 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4206 # AIX cc -E doesn't show the absolute headerfile
4207 # locations but we'll cheat by using the -M flag.
4208 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
4210 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4213 echo "Keeping your $hint cppstdin wrapper."
4216 wrapper=`pwd`/cppstdin
4220 if $test "X$cppstdin" != "X" && \
4221 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4222 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4224 echo "You used to use $cppstdin $cppminus so we'll use that again."
4226 '') echo "But let's see if we can live without a wrapper..." ;;
4228 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4229 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4231 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4234 echo "(However, $cpprun $cpplast does not work, let's see...)"
4242 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4249 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4250 $cc -E <testcpp.c >testcpp.out 2>&1; \
4251 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4252 echo "Yup, it does."
4255 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4256 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4257 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4258 echo "Yup, it does."
4261 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4262 $cc -P <testcpp.c >testcpp.out 2>&1; \
4263 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4264 echo "Yipee, that works!"
4267 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4268 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4269 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4270 echo "At long last!"
4273 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4274 $cpp <testcpp.c >testcpp.out 2>&1; \
4275 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4279 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4280 $cpp - <testcpp.c >testcpp.out 2>&1; \
4281 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4282 echo "Hooray, it works! I was beginning to wonder."
4285 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4286 $wrapper <testcpp.c >testcpp.out 2>&1; \
4287 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4293 rp="No dice. I can't find a C preprocessor. Name one:"
4297 $x_cpp <testcpp.c >testcpp.out 2>&1
4298 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4299 echo "OK, that will do." >&4
4301 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4316 echo "Perhaps can we force $cc -E using a wrapper..."
4317 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4318 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4324 echo "Nope, we'll have to live without it..."
4338 "$wrapper"|'cppstdin') ;;
4339 *) $rm -f $wrapper;;
4341 $rm -f testcpp.c testcpp.out
4343 : Set private lib path
4346 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4351 '') dlist="$loclibpth $plibpth $glibpth";;
4352 *) dlist="$libpth";;
4355 : Now check and see which directories actually exist, avoiding duplicates
4359 if $test -d $xxx; then
4362 *) libpth="$libpth $xxx";;
4368 Some systems have incompatible or broken versions of libraries. Among
4369 the directories listed in the question below, please remove any you
4370 know not to be holding relevant libraries, and add any that are needed.
4371 Say "none" for none.
4382 rp="Directories to use for library searches?"
4389 : compute shared library extension
4392 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4402 On some systems, shared libraries may be available. Answer 'none' if
4403 you want to suppress searching of shared libraries for the remainder
4404 of this configuration.
4407 rp='What is the file extension used for shared libraries?'
4411 : Define several unixisms.
4412 : Hints files or command line option can be used to override them.
4413 : The convoluted testing is in case hints files set either the old
4416 '') case "$exe_ext" in
4418 *) _exe="$exe_ext" ;;
4423 '') case "$lib_ext" in
4430 '') case "$obj_ext" in
4437 '') case "$path_sep" in
4448 : Which makefile gets called first. This is used by make depend.
4449 case "$firstmakefile" in
4450 '') firstmakefile='makefile';;
4453 : Looking for optional libraries
4455 echo "Checking for optional libraries..." >&4
4460 case "$libswanted" in
4461 '') libswanted='c_s';;
4464 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4470 for thisdir in $libpth $xlibpth; do
4471 test -d $thisdir && libspath="$libspath $thisdir"
4473 for thislib in $libswanted; do
4474 for thisdir in $libspath; do
4476 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4477 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4478 $test -f "$xxx" && eval $libscheck
4479 $test -f "$xxx" && libstyle=shared
4481 if test ! -f "$xxx"; then
4482 xxx=$thisdir/lib$thislib.$so
4483 $test -f "$xxx" && eval $libscheck
4484 $test -f "$xxx" && libstyle=shared
4486 if test ! -f "$xxx"; then
4487 xxx=$thisdir/lib$thislib$_a
4488 $test -f "$xxx" && eval $libscheck
4489 $test -f "$xxx" && libstyle=static
4491 if test ! -f "$xxx"; then
4492 xxx=$thisdir/$thislib$_a
4493 $test -f "$xxx" && eval $libscheck
4494 $test -f "$xxx" && libstyle=static
4496 if test ! -f "$xxx"; then
4497 xxx=$thisdir/lib${thislib}_s$_a
4498 $test -f "$xxx" && eval $libscheck
4499 $test -f "$xxx" && libstyle=static
4500 $test -f "$xxx" && thislib=${thislib}_s
4502 if test ! -f "$xxx"; then
4503 xxx=$thisdir/Slib$thislib$_a
4504 $test -f "$xxx" && eval $libscheck
4505 $test -f "$xxx" && libstyle=static
4507 if $test -f "$xxx"; then
4509 shared) echo "Found -l$thislib (shared)." ;;
4510 static) echo "Found -l$thislib." ;;
4511 *) echo "Found -l$thislib ($libstyle)." ;;
4515 *) dflt="$dflt -l$thislib"
4516 libsfound="$libsfound $xxx"
4518 libsfiles="$libsfiles $yyy"
4519 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4520 case " $libsdirs " in
4522 *) libsdirs="$libsdirs $yyy" ;;
4529 if $test ! -f "$xxx"; then
4530 echo "No -l$thislib."
4541 ' '|'') dflt='none';;
4546 In order to compile $package on your machine, a number of libraries
4547 are usually needed. Include any other special libraries here as well.
4548 Say "none" for none. The default list is almost always right.
4552 rp="What libraries to use?"
4559 : determine optimization, if desired, or use for debug flag also
4561 ' '|$undef) dflt='none';;
4563 *) dflt="$optimize";;
4567 By default, $package compiles with the -O flag to use the optimizer.
4568 Alternately, you might want to use the symbolic debugger, which uses
4569 the -g flag (on traditional Unix systems). Either flag can be
4570 specified here. To use neither flag, specify the word "none".
4573 rp="What optimizer/debugger flag should be used?"
4577 'none') optimize=" ";;
4581 : We will not override a previous value, but we might want to
4582 : augment a hint file
4584 default|recommended)
4585 case "$gccversion" in
4586 1*) dflt='-fpcc-struct-return' ;;
4589 *-g*) dflt="$dflt -DDEBUGGING";;
4591 case "$gccversion" in
4592 2*) if test -d /etc/conf/kconfig.d &&
4593 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4599 case "$gccversion" in
4603 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4604 echo 'int main(void) { return 0; }' > gcctest.c
4605 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4606 echo "Yes, it does." 2>&1
4609 echo "Leaving current flags $ccflags alone." 2>&1
4611 *) dflt="$dflt -fno-strict-aliasing" ;;
4614 echo "Nope, it doesn't, but that's ok." 2>&1
4621 case "$mips_type" in
4622 *BSD*|'') inclwanted="$locincpth $usrinc";;
4623 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4625 for thisincl in $inclwanted; do
4626 if $test -d $thisincl; then
4627 if $test x$thisincl != x$usrinc; then
4629 *" -I$thisincl "*);;
4630 *) dflt="$dflt -I$thisincl ";;
4636 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4638 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4646 *) dflt="$dflt -D$2";;
4650 set signal.h LANGUAGE_C; eval $inctest
4654 ccflags="$ccflags -DSOCKS"
4659 default|recommended) dflt="$ccflags $dflt" ;;
4660 *) dflt="$ccflags";;
4669 Your C compiler may want other flags. For this question you should include
4670 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4671 but you should NOT include libraries or ld flags like -lwhatever. If you
4672 want $package to honor its debug switch, you should include -DDEBUGGING here.
4673 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4675 To use no flags, specify the word "none".
4681 rp="Any additional cc flags?"
4688 : the following weeds options from ccflags that are of no interest to cpp
4690 '') cppflags="$ccflags" ;;
4691 *) cppflags="$cppflags $ccflags" ;;
4693 case "$gccversion" in
4694 1*) cppflags="$cppflags -D__GNUC__"
4696 case "$mips_type" in
4698 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4704 echo "Let me guess what the preprocessor flags are..." >&4
4718 *) ftry="$previous $flag";;
4720 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4721 >cpp1.out 2>/dev/null && \
4722 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4723 >cpp2.out 2>/dev/null && \
4724 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4725 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4727 cppflags="$cppflags $ftry"
4737 *-*) echo "They appear to be: $cppflags";;
4739 $rm -f cpp.c cpp?.out
4743 : flags used in final linking phase
4745 '') if ./venix; then
4751 *-posix*) dflt="$dflt -posix" ;;
4754 *) dflt="$ldflags";;
4757 : Try to guess additional flags to pick up local libraries.
4758 for thislibdir in $libpth; do
4759 case " $loclibpth " in
4762 *"-L$thislibdir "*) ;;
4763 *) dflt="$dflt -L$thislibdir" ;;
4775 Your C linker may need flags. For this question you should
4776 include -L/whatever and any other flags used by the C linker, but you
4777 should NOT include libraries like -lwhatever.
4779 Make sure you include the appropriate -L/path flags if your C linker
4780 does not normally search all of the directories you specified above,
4783 To use no flags, specify the word "none".
4787 rp="Any additional ld flags (NOT including libraries)?"
4793 rmlist="$rmlist pdp11"
4797 echo "Checking your choice of C compiler and flags for coherency..." >&4
4798 $cat > try.c <<'EOF'
4800 int main() { printf("Ok\n"); exit(0); }
4802 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4804 $cat >try.msg <<'EOM'
4805 I've tried to compile and run the following simple program:
4808 $cat try.c >> try.msg
4810 $cat >> try.msg <<EOM
4817 and I got the following output:
4821 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4822 if $sh -c "$run ./try" >>try.msg 2>&1; then
4826 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4829 cat >> try.msg <<'EOQS'
4830 If $libs contains -lsfio, and sfio is mis-configured, then it
4831 sometimes (apparently) runs and exits with a 0 status, but with no
4832 output! It may have to do with sfio's use of _exit vs. exit.
4835 rp="You have a big problem. Shall I abort Configure"
4842 echo "The program compiled OK, but exited with status $?." >>try.msg
4843 rp="You have a problem. Shall I abort Configure"
4847 echo "I can't compile the test program." >>try.msg
4848 rp="You have a BIG problem. Shall I abort Configure"
4854 case "$knowitall" in
4856 echo "(The supplied flags or libraries might be incorrect.)"
4864 *) echo "Ok. Stopping Configure." >&4
4869 n) echo "OK, that should do.";;
4871 $rm -f try try.* core
4873 : define a shorthand compile call
4877 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4878 : define a shorthand compile call for compilations that should be ok.
4882 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4884 : check for lengths of integral types
4888 echo "Checking to see how big your integers are..." >&4
4889 $cat >try.c <<'EOCP'
4893 printf("intsize=%d;\n", (int)sizeof(int));
4894 printf("longsize=%d;\n", (int)sizeof(long));
4895 printf("shortsize=%d;\n", (int)sizeof(short));
4900 if eval $compile_ok && $run ./try > /dev/null; then
4902 echo "Your integers are $intsize bytes long."
4903 echo "Your long integers are $longsize bytes long."
4904 echo "Your short integers are $shortsize bytes long."
4908 Help! I can't compile and run the intsize test program: please enlighten me!
4909 (This is probably a misconfiguration in your system or libraries, and
4910 you really ought to fix it. Still, I'll try anyway.)
4914 rp="What is the size of an integer (in bytes)?"
4918 rp="What is the size of a long integer (in bytes)?"
4922 rp="What is the size of a short integer (in bytes)?"
4930 : check for long long
4932 echo "Checking to see if you have long long..." >&4
4933 echo 'int main() { long long x = 7; return 0; }' > try.c
4935 if eval $compile; then
4937 echo "You have long long."
4940 echo "You do not have long long."
4946 : check for length of long long
4947 case "${d_longlong}${longlongsize}" in
4950 echo "Checking to see how big your long longs are..." >&4
4951 $cat >try.c <<'EOCP'
4955 printf("%d\n", (int)sizeof(long long));
4960 if eval $compile_ok; then
4961 longlongsize=`$run ./try`
4962 echo "Your long longs are $longlongsize bytes long."
4966 echo "(I can't seem to compile the test program. Guessing...)"
4967 rp="What is the size of a long long (in bytes)?"
4971 if $test "X$longsize" = "X$longlongsize"; then
4972 echo "(That isn't any different from an ordinary long.)"
4978 : determine filename position in cpp output
4980 echo "Computing filename position in cpp output for #include directives..." >&4
4982 vos) testaccess=-e ;;
4985 echo '#include <stdio.h>' > foo.c
4988 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4989 $grep '^[ ]*#.*stdio\.h' | \
4990 while read cline; do
4993 while $test \$# -gt 0; do
4994 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
4999 pos=\`expr \$pos + 1\`
5011 *) pos="${fieldn}th";;
5013 echo "Your cpp writes the filename in the $pos field of the line."
5016 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5019 : locate header file
5024 for usrincdir in $usrinc
5026 if test -f \$usrincdir/\$wanted; then
5027 echo "\$usrincdir/\$wanted"
5031 awkprg='{ print \$$fieldn }'
5032 echo "#include <\$wanted>" > foo\$\$.c
5033 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5034 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5035 while read cline; do
5036 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5038 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5039 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5044 # status = 0: grep returned 0 lines, case statement not executed
5045 # status = 1: headerfile found
5046 # status = 2: while loop executed, no headerfile found
5050 if test \$status -eq 1; then
5057 : define an alternate in-header-list? function
5058 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5059 cont=true; xxf="echo \"<\$1> found.\" >&4";
5060 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5061 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5063 case $# in 4) instead=instead;; *) instead="at last";; esac;
5064 while $test "$cont"; do
5066 var=$2; eval "was=\$$2";
5067 if $test "$xxx" && $test -r "$xxx";
5069 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5072 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5073 set $yyy; shift; shift; yyy=$@;
5074 case $# in 0) cont="";;
5075 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5076 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5077 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5078 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5082 do set $yyy; var=$2; eval "was=\$$2";
5083 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5084 set $yyy; shift; shift; yyy=$@;
5087 : see if inttypes.h is available
5088 : we want a real compile instead of Inhdr because some systems
5089 : have an inttypes.h which includes non-existent headers
5092 #include <inttypes.h>
5094 static int32_t foo32 = 0x12345678;
5098 if eval $compile; then
5099 echo "<inttypes.h> found." >&4
5102 echo "<inttypes.h> NOT found." >&4
5111 echo "Checking to see if you have int64_t..." >&4
5113 #include <sys/types.h>
5114 #$i_inttypes I_INTTYPES
5116 #include <inttypes.h>
5118 int main() { int64_t x = 7; }
5121 if eval $compile; then
5123 echo "You have int64_t."
5126 echo "You do not have int64_t."
5134 echo "Checking which 64-bit integer type we could use..." >&4
5140 val='"unsigned int"'
5145 *) case "$longsize" in
5149 val='"unsigned long"'
5154 *) case "$d_longlong:$longlongsize" in
5159 val='"unsigned long long"'
5164 *) case "$d_int64_t" in
5183 '') echo "Alas, no 64-bit integer types in sight." >&4
5186 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5192 case "$uselonglong" in
5193 "$define"|true|[yY]*)
5196 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5198 use64bitint="$define"
5201 case "$use64bits" in
5202 "$define"|true|[yY]*)
5205 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5207 use64bitint="$define"
5210 case "$use64bitints" in
5211 "$define"|true|[yY]*)
5214 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5216 use64bitint="$define"
5219 case "$use64bitsint" in
5220 "$define"|true|[yY]*)
5223 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5225 use64bitint="$define"
5228 case "$uselonglongs" in
5229 "$define"|true|[yY]*)
5232 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5234 use64bitint="$define"
5237 case "$use64bitsall" in
5238 "$define"|true|[yY]*)
5241 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5243 use64bitall="$define"
5248 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5250 case "$use64bitall" in
5251 "$define"|true|[yY]*) use64bitint="$define" ;;
5257 You have natively 64-bit long integers.
5261 *) case "$use64bitint" in
5262 "$define"|true|[yY]*) dflt='y';;
5271 Perl can be built to take advantage of 64-bit integer types
5272 on some systems. To do so, Configure can be run with -Duse64bitint.
5273 Choosing this option will most probably introduce binary incompatibilities.
5275 If this doesn't make any sense to you, just accept the default '$dflt'.
5276 (The default has been chosen based on your configuration.)
5278 rp='Try to use 64-bit integers, if available?'
5281 [yY]*) val="$define" ;;
5289 case "$use64bitall" in
5290 "$define"|true|[yY]*) dflt='y' ;;
5291 *) case "$longsize" in
5299 You may also choose to try maximal 64-bitness. It means using as much
5300 64-bitness as possible on the platform. This in turn means even more
5301 binary incompatibilities. On the other hand, your platform may not
5302 have any more 64-bitness available than what you already have chosen.
5304 If this doesn't make any sense to you, just accept the default '$dflt'.
5305 (The default has been chosen based on your configuration.)
5307 rp='Try to use maximal 64-bit support, if available?'
5310 [yY]*) val="$define" ;;
5315 case "$use64bitall" in
5317 case "$use64bitint" in
5321 Since you have chosen a maximally 64-bit build, I'm also turning on
5322 the use of 64-bit integers.
5324 use64bitint="$define" ;;
5329 case "$use64bitint" in
5330 "$define"|true|[yY]*)
5331 : Look for a hint-file generated 'call-back-unit'. If the
5332 : user has specified that a 64-bit perl is to be built,
5333 : we may need to set or change some other defaults.
5334 if $test -f use64bitint.cbu; then
5335 echo "Your platform has some specific hints for 64-bit integers, using them..."
5339 4) case "$archname64" in
5340 '') archname64=64int ;;
5347 case "$use64bitall" in
5348 "$define"|true|[yY]*)
5349 : Look for a hint-file generated 'call-back-unit'. If the
5350 : user has specified that a maximally 64-bit perl is to be built,
5351 : we may need to set or change some other defaults.
5352 if $test -f use64bitall.cbu; then
5353 echo "Your platform has some specific hints for 64-bit builds, using them..."
5357 4) case "$archname64" in
5358 ''|64int) archname64=64all ;;
5366 echo "Checking for GNU C Library..." >&4
5368 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
5369 alone are insufficient to distinguish different versions, such as
5370 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
5371 libc version 2.1.0. A. Dougherty, June 3, 2002.
5377 # ifdef __GLIBC_MINOR__
5378 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
5379 # include <gnu/libc-version.h>
5380 printf("%s\n", gnu_get_libc_version());
5382 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
5385 printf("%d\n", __GLIBC__);
5394 if eval $compile_ok && $run ./try > glibc.ver; then
5396 gnulibc_version=`$cat glibc.ver`
5397 echo "You are using the GNU C Library version $gnulibc_version"
5401 echo "You are not using the GNU C Library"
5403 $rm -f try try.* glibc.ver
5407 : see if nm is to be used to determine whether a symbol is defined or not
5411 case "$d_gnulibc" in
5414 echo "nm probably won't work on the GNU C Library." >&4
5420 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5422 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5423 echo "'nm' won't be sufficient on this sytem." >&4
5429 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5430 if $test $dflt -gt 20; then
5440 true|$define) dflt=y;;
5447 I can use $nm to extract the symbols from your C libraries. This
5448 is a time consuming task which may generate huge output on the disk (up
5449 to 3 megabytes) but that should make the symbols extraction faster. The
5450 alternative is to skip the 'nm' extraction part and to compile a small
5451 test program instead to determine whether each symbol is present. If
5452 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5453 this may be the best solution.
5455 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5458 rp="Shall I use $nm to extract C symbols from the libraries?"
5461 [Nn]*) usenm=false;;
5470 : nm options which may be necessary
5472 '') if $test -f /mach_boot; then
5474 elif $test -d /usr/ccs/lib; then
5475 nm_opt='-p' # Solaris (and SunOS?)
5476 elif $test -f /dgux; then
5478 elif $test -f /lib64/rld; then
5479 nm_opt='-p' # 64-bit Irix
5485 : nm options which may be necessary for shared libraries but illegal
5486 : for archive libraries. Thank you, Linux.
5487 case "$nm_so_opt" in
5488 '') case "$myuname" in
5490 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5491 nm_so_opt='--dynamic'
5500 : get list of predefined functions in a handy place
5505 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5511 *) for thislib in $libs; do
5514 : Handle C library specially below.
5517 thislib=`echo $thislib | $sed -e 's/^-l//'`
5518 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5520 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5522 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5524 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5526 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5528 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5530 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5535 libnames="$libnames $try"
5537 *) libnames="$libnames $thislib" ;;
5546 for xxx in $libpth; do
5547 $test -r $1 || set $xxx/libc.$so
5548 : The messy sed command sorts on library version numbers.
5550 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5551 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5553 s/[0-9][0-9]*/0000&/g
5554 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5557 $sort | $sed -e 's/^.* //'`
5560 $test -r $1 || set /usr/ccs/lib/libc.$so
5561 $test -r $1 || set /lib/libsys_s$_a
5567 if $test -r "$1"; then
5568 echo "Your (shared) C library seems to be in $1."
5570 elif $test -r /lib/libc && $test -r /lib/clib; then
5571 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5573 libc='/lib/clib /lib/libc'
5574 if $test -r /lib/syslib; then
5575 echo "(Your math library is in /lib/syslib.)"
5576 libc="$libc /lib/syslib"
5578 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5579 echo "Your C library seems to be in $libc, as you said before."
5580 elif $test -r $incpath/usr/lib/libc$_a; then
5581 libc=$incpath/usr/lib/libc$_a;
5582 echo "Your C library seems to be in $libc. That's fine."
5583 elif $test -r /lib/libc$_a; then
5585 echo "Your C library seems to be in $libc. You're normal."
5587 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5589 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5590 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5591 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5593 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5595 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5598 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5600 if $test -r "$tans"; then
5601 echo "Your C library seems to be in $tans, of all places."
5607 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5611 If the guess above is wrong (which it might be if you're using a strange
5612 compiler, or your machine supports multiple models), you can override it here.
5617 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5619 I can't seem to find your C library. I've looked in the following places:
5622 $sed 's/^/ /' libpath
5625 None of these seems to contain your C library. I need to get its name...
5630 rp='Where is your C library?'
5635 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5636 set X `cat libnames`
5639 case $# in 1) xxx=file; esac
5640 echo "Extracting names from the following $xxx for later perusal:" >&4
5642 $sed 's/^/ /' libnames >&4
5644 $echo $n "This may take a while...$c" >&4
5648 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5649 *) $nm $nm_opt $file 2>/dev/null;;
5654 $grep fprintf libc.tmp > libc.ptf
5655 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5656 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
5658 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5660 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5662 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5664 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5666 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5668 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5670 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5672 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5674 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5676 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5678 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5680 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5682 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5683 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5685 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5687 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5689 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5691 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5693 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5695 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5697 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5699 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5701 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5703 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5705 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5707 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5709 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5711 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5713 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5716 $nm -p $* 2>/dev/null >libc.tmp
5717 $grep fprintf libc.tmp > libc.ptf
5718 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5719 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5725 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5727 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5728 for thisname in $libnames $libc; do
5729 $ar t $thisname >>libc.tmp
5731 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5733 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5734 # Repeat libc to extract forwarders to DLL entries too
5735 for thisname in $libnames $libc; do
5736 $ar tv $thisname >>libc.tmp
5737 # Revision 50 of EMX has bug in $ar.
5738 # it will not extract forwarders to DLL entries
5739 # Use emximp which will extract exactly them.
5740 emximp -o tmp.imp $thisname \
5742 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5743 < tmp.imp >>libc.tmp
5746 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5749 echo "$ar didn't seem to work right." >&4
5750 echo "Maybe this is a Cray...trying bld instead..." >&4
5751 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5753 for thisname in $libnames; do
5755 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5756 $ar t $thisname >>libc.tmp
5760 echo "That didn't work either. Giving up." >&4
5767 if $test -f /lib/syscalls.exp; then
5769 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5770 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
5774 $rm -f libnames libpath
5776 : is a C symbol defined?
5779 -v) tf=libc.tmp; tc=""; tdc="";;
5780 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5781 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5784 case "$reuseval-$4" in
5786 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5792 if $contains $tlook $tf >/dev/null 2>&1;
5797 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5798 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5806 $define) tval=true;;
5812 : define an is-in-libc? function
5813 inlibc='echo " "; td=$define; tu=$undef;
5814 sym=$1; var=$2; eval "was=\$$2";
5816 case "$reuseval$was" in
5826 echo "$sym() found." >&4;
5827 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5829 echo "$sym() NOT found." >&4;
5830 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5834 $define) echo "$sym() found." >&4;;
5835 *) echo "$sym() NOT found." >&4;;
5839 : see if sqrtl exists
5843 : check for length of double
5845 case "$doublesize" in
5847 echo "Checking to see how big your double precision numbers are..." >&4
5848 $cat >try.c <<'EOCP'
5852 printf("%d\n", (int)sizeof(double));
5857 if eval $compile_ok; then
5858 doublesize=`$run ./try`
5859 echo "Your double is $doublesize bytes long."
5862 echo "(I can't seem to compile the test program. Guessing...)"
5863 rp="What is the size of a double precision number (in bytes)?"
5871 : check for long doubles
5873 echo "Checking to see if you have long double..." >&4
5874 echo 'int main() { long double x = 7.0; }' > try.c
5876 if eval $compile; then
5878 echo "You have long double."
5881 echo "You do not have long double."
5887 : check for length of long double
5888 case "${d_longdbl}${longdblsize}" in
5891 echo "Checking to see how big your long doubles are..." >&4
5892 $cat >try.c <<'EOCP'
5896 printf("%d\n", sizeof(long double));
5901 if eval $compile; then
5902 longdblsize=`$run ./try`
5903 echo "Your long doubles are $longdblsize bytes long."
5907 echo "(I can't seem to compile the test program. Guessing...)" >&4
5908 rp="What is the size of a long double (in bytes)?"
5912 if $test "X$doublesize" = "X$longdblsize"; then
5913 echo "(That isn't any different from an ordinary double.)"
5921 if $test X"$d_longdbl" = X"$define"; then
5923 echo "Checking how to print long doubles..." >&4
5925 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
5926 $cat >try.c <<'EOCP'
5927 #include <sys/types.h>
5931 printf("%.3f\n", d);
5935 if eval $compile; then
5939 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
5940 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
5941 echo "We will use %f."
5947 if $test X"$sPRIfldbl" = X; then
5948 $cat >try.c <<'EOCP'
5949 #include <sys/types.h>
5952 long double d = 123.456;
5953 printf("%.3Lf\n", d);
5957 if eval $compile; then
5961 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
5962 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
5963 echo "We will use %Lf."
5969 if $test X"$sPRIfldbl" = X; then
5970 $cat >try.c <<'EOCP'
5971 #include <sys/types.h>
5974 long double d = 123.456;
5975 printf("%.3llf\n", d);
5979 if eval $compile; then
5983 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
5984 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
5985 echo "We will use %llf."
5991 if $test X"$sPRIfldbl" = X; then
5992 $cat >try.c <<'EOCP'
5993 #include <sys/types.h>
5996 long double d = 123.456;
5997 printf("%.3lf\n", d);
6001 if eval $compile; then
6005 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
6006 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
6007 echo "We will use %lf."
6013 if $test X"$sPRIfldbl" = X; then
6014 echo "Cannot figure out how to print long doubles." >&4
6016 sSCNfldbl=$sPRIfldbl # expect consistency
6023 case "$sPRIfldbl" in
6024 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
6025 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
6026 d_SCNfldbl="$undef";
6028 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
6029 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
6030 d_SCNfldbl="$define";
6034 : see if modfl exists
6038 d_modfl_pow32_bug="$undef"
6040 case "$d_longdbl$d_modfl" in
6043 Checking to see whether your modfl() is okay for large values...
6049 long double nv = 4294967303.15;
6055 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
6059 case "$osname:$gccversion" in
6060 aix:) saveccflags="$ccflags"
6061 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
6064 if eval $compile; then
6067 *" 4294967303.150000 1.150000 4294967302.000000")
6068 echo >&4 "Your modfl() is broken for large values."
6069 d_modfl_pow32_bug="$define"
6071 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
6075 *" 4294967303.150000 0.150000 4294967303.000000")
6076 echo >&4 "Your modfl() seems okay for large values."
6078 *) echo >&4 "I don't understand your modfl() at all."
6082 $rm -f try.* try core core.try.*
6084 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
6087 case "$osname:$gccversion" in
6088 aix:) ccflags="$saveccflags" ;; # restore
6094 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6097 case "$uselongdouble" in
6098 $define|true|[yY]*) dflt='y';;
6103 Perl can be built to take advantage of long doubles which
6104 (if available) may give more accuracy and range for floating point numbers.
6106 If this doesn't make any sense to you, just accept the default '$dflt'.
6108 rp='Try to use long doubles if available?'
6111 y|Y) val="$define" ;;
6117 case "$uselongdouble" in
6118 true|[yY]*) uselongdouble="$define" ;;
6121 case "$uselongdouble" in
6123 : Look for a hint-file generated 'call-back-unit'. If the
6124 : user has specified that long doubles should be used,
6125 : we may need to set or change some other defaults.
6126 if $test -f uselongdouble.cbu; then
6127 echo "Your platform has some specific hints for long doubles, using them..."
6128 . ./uselongdouble.cbu
6131 (Your platform doesn't have any specific hints for long doubles.)
6138 case "$uselongdouble:$d_sqrtl:$d_modfl" in
6139 $define:$define:$define)
6142 $define:$define:$undef)
6143 message="I could not find modfl"
6145 $define:$undef:$define)
6146 message="I could not find sqrtl"
6148 $define:$undef:$undef)
6149 message="I found neither sqrtl nor modfl"
6153 if $test "$message" != X; then
6156 *** You requested the use of long doubles but you do not seem to have
6157 *** the mathematic functions for long doubles.
6159 *** I'm disabling the use of long doubles.
6163 uselongdouble=$undef
6166 : determine the architecture name
6168 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6169 tarch=`arch`"-$osname"
6170 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6171 if uname -m > tmparch 2>&1 ; then
6172 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6173 -e 's/$/'"-$osname/" tmparch`
6181 case "$myarchname" in
6184 echo "(Your architecture name used to be $myarchname.)"
6188 case "$targetarch" in
6190 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6195 *) dflt="$archname";;
6197 rp='What is your architecture name'
6200 case "$usethreads" in
6202 echo "Threads selected." >&4
6204 *-thread*) echo "...and architecture name already has -thread." >&4
6206 *) archname="$archname-thread"
6207 echo "...setting architecture name to $archname." >&4
6212 case "$usemultiplicity" in
6214 echo "Multiplicity selected." >&4
6216 *-multi*) echo "...and architecture name already has -multi." >&4
6218 *) archname="$archname-multi"
6219 echo "...setting architecture name to $archname." >&4
6224 case "$use64bitint$use64bitall" in
6226 case "$archname64" in
6228 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6231 case "$use64bitint" in
6232 "$define") echo "64 bit integers selected." >&4 ;;
6234 case "$use64bitall" in
6235 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6238 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6240 *) archname="$archname-$archname64"
6241 echo "...setting architecture name to $archname." >&4
6247 case "$uselongdouble" in
6249 echo "Long doubles selected." >&4
6250 case "$longdblsize" in
6252 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6256 *-ld*) echo "...and architecture name already has -ld." >&4
6258 *) archname="$archname-ld"
6259 echo "...setting architecture name to $archname." >&4
6266 case "$useperlio" in
6268 echo "Perlio selected." >&4
6271 echo "Perlio not selected, using stdio." >&4
6273 *-stdio*) echo "...and architecture name already has -stdio." >&4
6275 *) archname="$archname-stdio"
6276 echo "...setting architecture name to $archname." >&4
6282 : determine root of directory hierarchy where package will be installed.
6285 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
6293 By default, $package will be installed in $dflt/bin, manual pages
6294 under $dflt/man, etc..., i.e. with $dflt as prefix for all
6295 installation directories. Typically this is something like /usr/local.
6296 If you wish to have binaries under /usr/bin but other parts of the
6297 installation under /usr/local, that's ok: you will be prompted
6298 separately for each of the installation directories, the prefix being
6299 only used to set the defaults.
6303 rp='Installation prefix to use?'
6311 *) oldprefix="$prefix";;
6320 *) afsroot=$afsroot ;;
6326 $define|true) afs=true ;;
6327 $undef|false) afs=false ;;
6328 *) if test -d $afsroot; then
6336 echo "AFS may be running... I'll be extra cautious then..." >&4
6338 echo "AFS does not seem to be running..." >&4
6341 : determine installation prefix for where package is to be installed.
6345 Since you are running AFS, I need to distinguish the directory in which
6346 files will reside from the directory in which they are installed (and from
6347 which they are presumably copied to the former directory by occult means).
6350 case "$installprefix" in
6351 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
6352 *) dflt="$installprefix";;
6357 In some special cases, particularly when building $package for distribution,
6358 it is convenient to distinguish between the directory in which files should
6359 be installed from the directory ($prefix) in which they
6360 will eventually reside. For most users, these two directories are the same.
6363 case "$installprefix" in
6365 *) dflt=$installprefix;;
6369 rp='What installation prefix should I use for installing files?'
6371 installprefix="$ans"
6372 installprefixexp="$ansexp"
6374 : set the prefixit variable, to compute a suitable default value
6375 prefixit='case "$3" in
6377 case "$oldprefix" in
6378 "") eval "$1=\"\$$2\"";;
6385 ""|" ") eval "$1=\"\$$2\"";;
6391 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6393 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6394 /*-$oldprefix/*|\~*-$oldprefix/*)
6395 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6396 *) eval "$1=\"\$$2\"";;
6400 : get the patchlevel
6402 echo "Getting the current patchlevel..." >&4
6403 if $test -r $rsrc/patchlevel.h;then
6404 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6405 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6406 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6407 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6408 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6409 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6410 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6419 $echo "(You do not have patchlevel.h. Eek.)"
6421 if $test -r $rsrc/.patch ; then
6422 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6423 perl_patchlevel=`cat $rsrc/.patch`
6426 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6427 version_patchlevel_string="version $patchlevel subversion $subversion"
6428 case "$perl_patchlevel" in
6430 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6433 $echo "(You have $package $version_patchlevel_string.)"
6437 : XXX Should be a Configure test for double-dots in filenames.
6438 version=`echo $revision $patchlevel $subversion | \
6439 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6440 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6441 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6444 version=`echo $revision $patchlevel $subversion | \
6445 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6446 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6447 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6450 : Special case the 5.005_xx maintenance series, which used 5.005
6451 : without any subversion label as a subdirectory in $sitelib
6452 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6453 api_versionstring='5.005'
6456 : determine installation style
6457 : For now, try to deduce it from prefix unless it is already set.
6458 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6459 case "$installstyle" in
6460 '') case "$prefix" in
6461 *perl*) dflt='lib';;
6462 *) dflt='lib/perl5' ;;
6465 *) dflt="$installstyle" ;;
6467 : Probably not worth prompting for this since we prompt for all
6468 : the directories individually, and the prompt would be too long and
6472 : determine where private library files go
6473 : Usual default is /usr/local/lib/perl5/$version.
6474 : Also allow things like /opt/perl/lib/$version, since
6475 : /opt/perl/lib/perl5... would be redundant.
6476 : The default "style" setting is made in installstyle.U
6477 case "$installstyle" in
6478 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6479 *) set dflt privlib lib/$version ;;
6484 There are some auxiliary files for $package that need to be put into a
6485 private library directory that is accessible by everyone.
6489 rp='Pathname where the private library files will reside?'
6492 privlibexp="$ansexp"
6493 : Change installation prefix, if necessary.
6494 if $test X"$prefix" != X"$installprefix"; then
6495 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6497 installprivlib="$privlibexp"
6500 : set the prefixup variable, to restore leading tilda escape
6501 prefixup='case "$prefixexp" in
6503 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6506 : determine where public architecture dependent libraries go
6509 : privlib default is /usr/local/lib/$package/$version
6510 : archlib default is /usr/local/lib/$package/$version/$archname
6511 : privlib may have an optional trailing /share.
6512 tdflt=`echo $privlib | $sed 's,/share$,,'`
6513 tdflt=$tdflt/$archname
6522 $spackage contains architecture-dependent library files. If you are
6523 sharing libraries in a heterogeneous environment, you might store
6524 these files in a separate location. Otherwise, you can just include
6525 them with the rest of the public library files.
6529 rp='Where do you want to put the public architecture-dependent libraries?'
6532 archlibexp="$ansexp"
6533 if $test X"$archlib" = X"$privlib"; then
6538 : Change installation prefix, if necessary.
6539 if $test X"$prefix" != X"$installprefix"; then
6540 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6542 installarchlib="$archlibexp"
6545 : see if setuid scripts can be secure
6548 Some kernels have a bug that prevents setuid #! scripts from being
6549 secure. Some sites have disabled setuid #! scripts because of this.
6551 First let's decide if your kernel supports secure setuid #! scripts.
6552 (If setuid #! scripts would be secure but have been disabled anyway,
6553 don't say that they are secure if asked.)
6558 if $test -d /dev/fd; then
6559 echo "#!$ls" >reflect
6560 chmod +x,u+s reflect
6561 ./reflect >flect 2>&1
6562 if $contains "/dev/fd" flect >/dev/null; then
6563 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6567 If you are not sure if they are secure, I can check but I'll need a
6568 username and password different from the one you are using right now.
6569 If you don't have such a username or don't want me to test, simply
6573 rp='Other username to test security of setuid scripts with?'
6578 case "$d_suidsafe" in
6579 '') echo "I'll assume setuid scripts are *not* secure." >&4
6582 echo "Well, the $hint value is *not* secure." >&4
6584 *) echo "Well, the $hint value *is* secure." >&4
6589 $rm -f reflect flect
6590 echo "#!$ls" >reflect
6591 chmod +x,u+s reflect
6594 echo '"su" will (probably) prompt you for '"$ans's password."
6595 su $ans -c './reflect >flect'
6596 if $contains "/dev/fd" flect >/dev/null; then
6597 echo "Okay, it looks like setuid scripts are secure." >&4
6600 echo "I don't think setuid scripts are secure." >&4
6605 rp='Does your kernel have *secure* setuid scripts?'
6608 [yY]*) val="$define";;
6613 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6614 echo "(That's for file descriptors, not floppy disks.)"
6620 $rm -f reflect flect
6622 : now see if they want to do setuid emulation
6625 case "$d_suidsafe" in
6628 echo "No need to emulate SUID scripts since they are secure here." >&4
6632 Some systems have disabled setuid scripts, especially systems where
6633 setuid scripts cannot be secure. On systems where setuid scripts have
6634 been disabled, the setuid/setgid bits on scripts are currently
6635 useless. It is possible for $package to detect those bits and emulate
6636 setuid/setgid in a secure fashion. This emulation will only work if
6637 setuid scripts have been disabled in your kernel.
6641 "$define") dflt=y ;;
6644 rp="Do you want to do setuid/setgid emulation?"
6647 [yY]*) val="$define";;
6655 : see if this is a malloc.h system
6656 set malloc.h i_malloc
6659 : see if stdlib is available
6660 set stdlib.h i_stdlib
6663 : check for void type
6665 echo "Checking to see how well your C compiler groks the void type..." >&4
6666 case "$voidflags" in
6668 $cat >try.c <<'EOCP'
6674 extern void moo(); /* function returning void */
6675 void (*goo)(); /* ptr to func returning void */
6677 void *hue; /* generic ptr */
6690 int main() { sub(); }
6692 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6693 voidflags=$defvoidused
6694 echo "Good. It appears to support void to the level $package wants.">&4
6695 if $contains warning .out >/dev/null 2>&1; then
6696 echo "However, you might get some warnings that look like this:"
6700 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6701 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6702 echo "It supports 1..."
6703 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6704 echo "It also supports 2..."
6705 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6707 echo "And it supports 4 but not 8 definitely."
6709 echo "It doesn't support 4..."
6710 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6712 echo "But it supports 8."
6715 echo "Neither does it support 8."
6719 echo "It does not support 2..."
6720 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6722 echo "But it supports 4 and 8."
6724 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6726 echo "And it supports 4 but has not heard about 8."
6728 echo "However it supports 8 but not 4."
6733 echo "There is no support at all for void."
6738 case "$voidflags" in
6741 Support flag bits are:
6742 1: basic void declarations.
6743 2: arrays of pointers to functions returning void.
6744 4: operations between pointers to and addresses of void functions.
6745 8: generic void pointers.
6748 rp="Your void support flags add up to what?"
6755 : check for length of pointer
6759 echo "Checking to see how big your pointers are..." >&4
6760 if test "$voidflags" -gt 7; then
6761 echo '#define VOID_PTR char *' > try.c
6763 echo '#define VOID_PTR void *' > try.c
6765 $cat >>try.c <<'EOCP'
6769 printf("%d\n", (int)sizeof(VOID_PTR));
6774 if eval $compile_ok; then
6775 ptrsize=`$run ./try`
6776 echo "Your pointers are $ptrsize bytes long."
6779 echo "(I can't seem to compile the test program. Guessing...)" >&4
6780 rp="What is the size of a pointer (in bytes)?"
6787 case "$use64bitall" in
6788 "$define"|true|[yY]*)
6792 *** You have chosen a maximally 64-bit build, but your pointers
6793 *** are only 4 bytes wide, disabling maximal 64-bitness.
6796 use64bitall="$undef"
6797 case "$use64bitint" in
6798 "$define"|true|[yY]*) ;;
6801 *** Downgrading from maximal 64-bitness to using 64-bit integers.
6804 use64bitint="$define"
6813 : determine which malloc to compile in
6815 case "$usemymalloc" in
6816 [yY]*|true|$define) dflt='y' ;;
6817 [nN]*|false|$undef) dflt='n' ;;
6818 *) case "$ptrsize" in
6824 rp="Do you wish to attempt to use the malloc that comes with $package?"
6830 mallocsrc='malloc.c'
6831 mallocobj="malloc$_o"
6832 d_mymalloc="$define"
6835 : Remove malloc from list of libraries to use
6836 echo "Removing unneeded -lmalloc from library list" >&4
6837 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6840 echo "libs = $libs" >&4
6852 : compute the return types of malloc and free
6854 $cat >malloc.c <<END
6858 #include <sys/types.h>
6872 case "$malloctype" in
6874 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6881 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6885 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6892 echo "Your system uses $freetype free(), it would seem." >&4
6896 After $package is installed, you may wish to install various
6897 add-on modules and utilities. Typically, these add-ons will
6898 be installed under $prefix with the rest
6899 of this package. However, you may wish to install such add-ons
6900 elsewhere under a different prefix.
6902 If you do not wish to put everything under a single prefix, that's
6903 ok. You will be prompted for the individual locations; this siteprefix
6904 is only used to suggest the defaults.
6906 The default should be fine for most people.
6910 rp='Installation prefix to use for add-on modules and utilities?'
6911 : XXX Here might be another good place for an installstyle setting.
6912 case "$siteprefix" in
6914 *) dflt=$siteprefix ;;
6917 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6919 case "$siteprefix" in
6923 *) oldsiteprefix="$prefix";;
6928 siteprefixexp="$ansexp"
6930 : determine where site specific libraries go.
6931 : Usual default is /usr/local/lib/perl5/site_perl/$version
6932 : The default "style" setting is made in installstyle.U
6933 : XXX No longer works with Prefixit stuff.
6934 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6936 '') case "$installstyle" in
6937 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6938 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6946 The installation process will create a directory for
6947 site-specific extensions and modules. Most users find it convenient
6948 to place all site-specific files in this directory rather than in the
6949 main distribution directory.
6953 rp='Pathname for the site-specific library files?'
6956 sitelibexp="$ansexp"
6957 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6958 : Change installation prefix, if necessary.
6959 if $test X"$prefix" != X"$installprefix"; then
6960 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6962 installsitelib="$sitelibexp"
6965 : determine where site specific architecture-dependent libraries go.
6966 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6967 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6968 : sitelib may have an optional trailing /share.
6970 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6971 dflt="$dflt/$archname"
6976 set sitearch sitearch none
6980 The installation process will also create a directory for
6981 architecture-dependent site-specific extensions and modules.
6985 rp='Pathname for the site-specific architecture-dependent library files?'
6988 sitearchexp="$ansexp"
6989 : Change installation prefix, if necessary.
6990 if $test X"$prefix" != X"$installprefix"; then
6991 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6993 installsitearch="$sitearchexp"
6998 The installation process will also create a directory for
6999 vendor-supplied add-ons. Vendors who supply perl with their system
7000 may find it convenient to place all vendor-supplied files in this
7001 directory rather than in the main distribution directory. This will
7002 ease upgrades between binary-compatible maintenance versions of perl.
7004 Of course you may also use these directories in whatever way you see
7005 fit. For example, you might use them to access modules shared over a
7006 company-wide network.
7008 The default answer should be fine for most people.
7009 This causes further questions about vendor add-ons to be skipped
7010 and no vendor-specific directories will be configured for perl.
7013 rp='Do you want to configure vendor-specific add-on directories?'
7014 case "$usevendorprefix" in
7015 define|true|[yY]*) dflt=y ;;
7016 *) : User may have set vendorprefix directly on Configure command line.
7017 case "$vendorprefix" in
7026 rp='Installation prefix to use for vendor-supplied add-ons?'
7027 case "$vendorprefix" in
7029 *) dflt=$vendorprefix ;;
7032 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7034 case "$vendorprefix" in
7038 *) oldvendorprefix="$prefix";;
7042 usevendorprefix="$define"
7044 vendorprefixexp="$ansexp"
7046 *) usevendorprefix="$undef"
7052 case "$vendorprefix" in
7053 '') d_vendorlib="$undef"
7057 *) d_vendorlib="$define"
7058 : determine where vendor-supplied modules go.
7059 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7060 case "$vendorlib" in
7062 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7063 case "$installstyle" in
7064 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7065 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7068 *) dflt="$vendorlib"
7072 rp='Pathname for the vendor-supplied library files?'
7075 vendorlibexp="$ansexp"
7078 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7079 : Change installation prefix, if necessary.
7080 if $test X"$prefix" != X"$installprefix"; then
7081 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
7083 installvendorlib="$vendorlibexp"
7086 case "$vendorprefix" in
7087 '') d_vendorarch="$undef"
7091 *) d_vendorarch="$define"
7092 : determine where vendor-supplied architecture-dependent libraries go.
7093 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7094 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7095 : vendorlib may have an optional trailing /share.
7096 case "$vendorarch" in
7097 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7098 dflt="$dflt/$archname"
7100 *) dflt="$vendorarch" ;;
7103 rp='Pathname for vendor-supplied architecture-dependent files?'
7106 vendorarchexp="$ansexp"
7109 : Change installation prefix, if necessary.
7110 if $test X"$prefix" != X"$installprefix"; then
7111 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
7113 installvendorarch="$vendorarchexp"
7116 : Final catch-all directories to search
7119 Lastly, you can have perl look in other directories for extensions and
7120 modules in addition to those already specified.
7121 These directories will be searched after
7125 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7126 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7128 case "$otherlibdirs" in
7129 ''|' ') dflt='none' ;;
7130 *) dflt="$otherlibdirs" ;;
7133 Enter a colon-separated set of extra paths to include in perl's @INC
7134 search path, or enter 'none' for no extra paths.
7138 rp='Colon-separated list of additional directories for perl to search?'
7141 ' '|''|none) otherlibdirs=' ' ;;
7142 *) otherlibdirs="$ans" ;;
7144 case "$otherlibdirs" in
7148 set d_perl_otherlibdirs
7151 : Cruising for prototypes
7153 echo "Checking out function prototypes..." >&4
7154 $cat >prototype.c <<'EOCP'
7155 int main(int argc, char *argv[]) {
7158 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7159 echo "Your C compiler appears to support function prototypes."
7162 echo "Your C compiler doesn't seem to understand function prototypes."
7169 case "$prototype" in
7171 *) ansi2knr='ansi2knr'
7176 This version of $package can only be compiled by a compiler that
7177 understands function prototypes. Unfortunately, your C compiler
7179 doesn't seem to understand them. Sorry about that.
7181 If GNU cc is available for your system, perhaps you could try that instead.
7183 Eventually, we hope to support building Perl with pre-ANSI compilers.
7184 If you would like to help in that effort, please contact <perlbug@perl.org>.
7186 Aborting Configure now.
7192 : determine where public executables go
7197 rp='Pathname where the public executables will reside?'
7199 if $test "X$ansexp" != "X$binexp"; then
7204 : Change installation prefix, if necessary.
7205 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7206 if $test X"$prefix" != X"$installprefix"; then
7207 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
7209 installbin="$binexp"
7218 Perl can be built with extra modules or bundles of modules which
7219 will be fetched from the CPAN and installed alongside Perl.
7221 Notice that you will need access to the CPAN; either via the Internet,
7222 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7223 be asked later to configure the CPAN.pm module which will in turn do
7224 the installation of the rest of the extra modules or bundles.)
7226 Notice also that if the modules require any external software such as
7227 libraries and headers (the libz library and the zlib.h header for the
7228 Compress::Zlib module, for example) you MUST have any such software
7229 already installed, this configuration process will NOT install such
7232 If this doesn't make any sense to you, just accept the default '$dflt'.
7234 rp='Install any extra modules (y or n)?'
7240 Please list any extra modules or bundles to be installed from CPAN,
7241 with spaces between the names. The names can be in any format the
7242 'install' command of CPAN.pm will understand. (Answer 'none',
7243 without the quotes, to install no extra modules or bundles.)
7253 $rm -f ../extras.lst
7255 *) echo "(Saving the list of extras for later...)"
7256 echo "$extras" > ../extras.lst
7264 : Find perl5.005 or later.
7265 echo "Looking for a previously installed perl5.005 or later... "
7267 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7268 : Check if this perl is recent and can load a simple module
7269 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7272 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7282 '') echo "None found. That's ok.";;
7283 *) echo "Using $perl5." ;;
7286 : Determine list of previous versions to include in @INC
7287 $cat > getverlist <<EOPL
7290 \$api_versionstring = "$api_versionstring";
7291 \$version = "$version";
7292 \$stem = "$sitelib_stem";
7293 \$archname = "$archname";
7295 $cat >> getverlist <<'EOPL'
7296 # Can't have leading @ because metaconfig interprets it as a command!
7297 ;@inc_version_list=();
7298 # XXX Redo to do opendir/readdir?
7301 ;@candidates = glob("5.*");
7307 # XXX ToDo: These comparisons must be reworked when two-digit
7308 # subversions come along, so that 5.7.10 compares as greater than
7309 # 5.7.3! By that time, hope that 5.6.x is sufficiently
7310 # widespread that we can use the built-in version vectors rather
7311 # than reinventing them here. For 5.6.0, however, we must
7312 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
7313 foreach $d (@candidates) {
7314 if ($d lt $version) {
7315 if ($d ge $api_versionstring) {
7316 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
7318 elsif ($d ge "5.005") {
7319 unshift(@inc_version_list, grep { -d } $d);
7323 # Skip newer version. I.e. don't look in
7324 # 5.7.0 if we're installing 5.6.1.
7328 if (@inc_version_list) {
7329 print join(' ', @inc_version_list);
7332 # Blank space to preserve value for next Configure run.
7337 case "$inc_version_list" in
7338 '') if test -x "$perl5$exe_ext"; then
7339 dflt=`$perl5 getverlist`
7344 $undef) dflt='none' ;;
7345 *) eval dflt=\"$inc_version_list\" ;;
7348 ''|' ') dflt=none ;;
7355 In order to ease the process of upgrading, this version of perl
7356 can be configured to use modules built and installed with earlier
7357 versions of perl that were installed under $prefix. Specify here
7358 the list of earlier versions that this version of perl should check.
7359 If Configure detected no earlier versions of perl installed under
7360 $prefix, then the list will be empty. Answer 'none' to tell perl
7361 to not search earlier versions.
7363 The default should almost always be sensible, so if you're not sure,
7364 just accept the default.
7367 rp='List of earlier versions to include in @INC?'
7370 [Nn]one|''|' ') inc_version_list=' ' ;;
7371 *) inc_version_list="$ans" ;;
7373 case "$inc_version_list" in
7375 inc_version_list_init='0';;
7376 *) inc_version_list_init=`echo $inc_version_list |
7377 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7382 : determine whether to install perl also as /usr/bin/perl
7385 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7387 Many scripts expect perl to be installed as /usr/bin/perl.
7388 I can install the perl you are about to compile also as /usr/bin/perl
7389 (in addition to $installbin/perl).
7391 case "$installusrbinperl" in
7392 "$undef"|[nN]*) dflt='n';;
7395 rp="Do you want to install perl as /usr/bin/perl?"
7398 [yY]*) val="$define";;
7404 set installusrbinperl
7407 : see if dld is available
7411 : see if dlopen exists
7418 : determine which dynamic loading, if any, to compile in
7420 dldir="ext/DynaLoader"
7433 $define) dflt='y' ;;
7436 $define) dflt='y' ;;
7438 : Does a dl_xxx.xs file exist for this operating system
7439 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7442 rp="Do you wish to use dynamic loading?"
7449 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7450 dflt="$dldir/dl_${osname}.xs"
7451 elif $test "$d_dlopen" = "$define" ; then
7452 dflt="$dldir/dl_dlopen.xs"
7453 elif $test "$i_dld" = "$define" ; then
7454 dflt="$dldir/dl_dld.xs"
7459 *) dflt="$dldir/$dlsrc"
7462 echo "The following dynamic loading files are available:"
7463 : Can not go over to $dldir because getfile has path hard-coded in.
7464 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7465 rp="Source file to use for dynamic loading"
7471 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7475 Some systems may require passing special flags to $cc -c to
7476 compile modules that will be used to create a shared library.
7477 To use no flags, say "none".
7480 case "$cccdlflags" in
7481 '') case "$gccversion" in
7482 '') case "$osname" in
7484 next) dflt='none' ;;
7485 irix*) dflt='-KPIC' ;;
7486 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7487 sunos) dflt='-pic' ;;
7491 *) case "$osname" in
7492 darwin) dflt='none' ;;
7493 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7498 *) dflt="$cccdlflags" ;;
7500 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7503 none) cccdlflags=' ' ;;
7504 *) cccdlflags="$ans" ;;
7509 Some systems use ld to create libraries that can be dynamically loaded,
7510 while other systems (such as those using ELF) use $cc.
7514 '') $cat >try.c <<'EOM'
7515 /* Test for whether ELF binaries are produced */
7520 int i = open("a.out",O_RDONLY);
7523 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7524 exit(0); /* succeed (yes, it's ELF) */
7529 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7531 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7535 echo "I'll use ld to build dynamic libraries."
7544 rp="What command should be used to create dynamic libraries?"
7550 Some systems may require passing special flags to $ld to create a
7551 library that can be dynamically loaded. If your ld flags include
7552 -L/other/path options to locate libraries outside your loader's normal
7553 search path, you may need to specify those -L options here as well. To
7554 use no flags, say "none".
7557 case "$lddlflags" in
7558 '') case "$osname" in
7559 beos) dflt='-nostart' ;;
7561 case "$gccversion" in
7562 '') dflt="$dflt +vnocompatwarnings" ;;
7565 linux|irix*) dflt='-shared' ;;
7566 next) dflt='none' ;;
7567 solaris) dflt='-G' ;;
7568 sunos) dflt='-assert nodefinitions' ;;
7569 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7573 *) dflt="$lddlflags" ;;
7576 : Try to guess additional flags to pick up local libraries.
7577 : Be careful not to append to a plain 'none'
7581 for thisflag in $ldflags; do
7586 *) dflt="$dflt $thisflag" ;;
7593 ''|' ') dflt='none' ;;
7596 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7599 none) lddlflags=' ' ;;
7600 *) lddlflags="$ans" ;;
7605 Some systems may require passing special flags to $cc to indicate that
7606 the resulting executable will use dynamic linking. To use no flags,
7610 case "$ccdlflags" in
7611 '') case "$osname" in
7612 hpux) dflt='-Wl,-E' ;;
7613 linux) dflt='-rdynamic' ;;
7614 next) dflt='none' ;;
7615 sunos) dflt='none' ;;
7619 *) dflt="$ccdlflags" ;;
7621 rp="Any special flags to pass to $cc to use dynamic linking?"
7624 none) ccdlflags=' ' ;;
7625 *) ccdlflags="$ans" ;;
7639 # No dynamic loading being used, so don't bother even to prompt.
7642 *) case "$useshrplib" in
7643 '') case "$osname" in
7644 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7646 also='Building a shared libperl is required for dynamic loading to work on your system.'
7651 also='Building a shared libperl is needed for MAB support.'
7669 The perl executable is normally obtained by linking perlmain.c with
7670 libperl${_a}, any static extensions (usually just DynaLoader), and
7671 any other libraries needed on this system (such as -lm, etc.). Since
7672 your system supports dynamic loading, it is probably possible to build
7673 a shared libperl.$so. If you will have more than one executable linked
7674 to libperl.$so, this will significantly reduce the size of each
7675 executable, but it may have a noticeable affect on performance. The
7676 default is probably sensible for your system.
7680 rp="Build a shared libperl.$so (y/n)"
7684 useshrplib='true' ;;
7685 *) useshrplib='false' ;;
7690 case "$useshrplib" in
7694 # Figure out a good name for libperl.so. Since it gets stored in
7695 # a version-specific architecture-dependent library, the version
7696 # number isn't really that important, except for making cc/ld happy.
7698 # A name such as libperl.so.3.1
7699 majmin="libperl.$so.$patchlevel.$subversion"
7700 # A name such as libperl.so.301
7701 majonly=`echo $patchlevel $subversion |
7702 $awk '{printf "%d%02d", $1, $2}'`
7703 majonly=libperl.$so.$majonly
7704 # I'd prefer to keep the os-specific stuff here to a minimum, and
7705 # rely on figuring it out from the naming of libc.
7706 case "${osname}${osvers}" in
7709 # XXX How handle the --version stuff for MAB?
7711 linux*) # ld won't link with a bare -lperl otherwise.
7714 cygwin*) # ld links against an importlib
7715 dflt=libperl$lib_ext
7717 *) # Try to guess based on whether libc has major.minor.
7719 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7720 *libc.$so.[0-9]*) dflt=$majonly ;;
7721 *) dflt=libperl.$so ;;
7731 I need to select a good name for the shared libperl. If your system uses
7732 library names with major and minor numbers, then you might want something
7733 like $majmin. Alternatively, if your system uses a single version
7734 number for shared libraries, then you might want to use $majonly.
7735 Or, your system might be quite happy with a simple libperl.$so.
7737 Since the shared libperl will get installed into a version-specific
7738 architecture-dependent directory, the version number of the shared perl
7739 library probably isn't important, so the default should be o.k.
7742 rp='What name do you want to give to the shared libperl?'
7745 echo "Ok, I'll use $libperl"
7748 libperl="libperl${_a}"
7752 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7756 WARNING: Use of the shrpdir variable for the installation location of
7757 the shared $libperl is not supported. It was never documented and
7758 will not work in this version. Let me (perlbug@perl.org)
7759 know of any problems this may cause.
7765 But your current setting of $shrpdir is
7766 the default anyway, so it's harmless.
7771 Further, your current attempted setting of $shrpdir
7772 conflicts with the value of $archlibexp/CORE
7773 that installperl will use.
7780 # How will the perl executable find the installed shared $libperl?
7781 # Add $xxx to ccdlflags.
7782 # If we can't figure out a command-line option, use $shrpenv to
7783 # set env LD_RUN_PATH. The main perl makefile uses this.
7784 shrpdir=$archlibexp/CORE
7787 if "$useshrplib"; then
7790 # We'll set it in Makefile.SH...
7796 xxx="-Wl,-R$shrpdir"
7798 bsdos|linux|irix*|dec_osf)
7799 xxx="-Wl,-rpath,$shrpdir"
7802 # next doesn't like the default...
7805 # beos doesn't like the default, either.
7808 # hpux doesn't like the default, either.
7809 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7812 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7818 # Only add $xxx if it isn't already in ccdlflags.
7819 case " $ccdlflags " in
7821 *) ccdlflags="$ccdlflags $xxx"
7824 Adding $xxx to the flags
7825 passed to $ld so that the perl executable will find the
7826 installed shared $libperl.
7834 # Fix ccdlflags in AIX for building external extensions.
7835 # (For building Perl itself bare -bE:perl.exp is needed,
7836 # Makefile.SH takes care of this.)
7838 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7840 # Respect a hint or command-line value.
7842 '') shrpenv="$tmp_shrpenv" ;;
7844 case "$ldlibpthname" in
7845 '') ldlibpthname=LD_LIBRARY_PATH ;;
7846 none) ldlibpthname='' ;;
7849 : determine where manual pages are on this system
7853 syspath='/usr/share/man/man1 /usr/man/man1'
7854 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7855 syspath="$syspath /usr/man/u_man/man1"
7856 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7857 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7858 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7859 sysman=`./loc . /usr/man/man1 $syspath`
7862 if $test -d "$sysman"; then
7863 echo "System manual is in $sysman." >&4
7865 echo "Could not find manual pages in source form." >&4
7868 : determine where manual pages go
7869 set man1dir man1dir none
7873 $spackage has manual pages available in source form.
7877 echo "However, you don't have nroff, so they're probably useless to you."
7879 '') man1dir="none";;
7882 echo "If you don't want the manual sources installed, answer 'none'."
7887 lookpath="$prefixexp/share/man/man1"
7888 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7889 lookpath="$lookpath $prefixexp/man/p_man/man1"
7890 lookpath="$lookpath $prefixexp/man/u_man/man1"
7891 lookpath="$lookpath $prefixexp/man/man.1"
7893 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7894 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7904 rp="Where do the main $spackage manual pages (source) go?"
7906 if $test "X$man1direxp" != "X$ansexp"; then
7910 man1direxp="$ansexp"
7916 : Change installation prefix, if necessary.
7917 if $test X"$prefix" != X"$installprefix"; then
7918 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7920 installman1dir="$man1direxp"
7923 : What suffix to use on installed man pages
7930 rp="What suffix should be used for the main $spackage man pages?"
7932 '') case "$man1dir" in
7946 *) dflt="$man1ext";;
7953 : see if we can have long filenames
7955 first=123456789abcdef
7957 if (echo hi >$first) 2>/dev/null; then
7958 if $test -f 123456789abcde; then
7959 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7962 echo 'You can have filenames longer than 14 characters.'>&4
7967 You can't have filenames longer than 14 chars.
7968 You can't even think about them!
7974 $rm -rf 123456789abcde*
7976 : determine where library module manual pages go
7977 set man3dir man3dir none
7981 $spackage has manual pages for many of the library modules.
7987 However, you don't have nroff, so they're probably useless to you.
7990 '') man3dir="none";;
7994 case "$d_flexfnam" in
7997 However, your system can't handle the long file names like File::Basename.3.
8000 '') man3dir="none";;
8004 echo "If you don't want the manual sources installed, answer 'none'."
8005 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8007 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8008 if $test -d "$privlib/man/man3"; then
8011 WARNING: Previous versions of perl installed man3 pages into
8012 $privlib/man/man3. This version will suggest a
8013 new default of $dflt.
8017 rp='Do you wish to preserve the old behavior?(y/n)'
8020 y*) dflt="$privlib/man/man3" ;;
8025 *) dflt="$man3dir" ;;
8032 rp="Where do the $package library man pages (source) go?"
8035 man3direxp="$ansexp"
8041 : Change installation prefix, if necessary.
8042 if $test X"$prefix" != X"$installprefix"; then
8043 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8045 installman3dir="$man3direxp"
8048 : What suffix to use on installed man pages
8054 rp="What suffix should be used for the $package library man pages?"
8056 '') case "$man3dir" in
8070 *) dflt="$man3ext";;
8077 : see if we have to deal with yellow pages, now NIS.
8078 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8079 if $test -f /usr/etc/nibindd; then
8081 echo "I'm fairly confident you're on a NeXT."
8083 rp='Do you get the hosts file via NetInfo?'
8092 y*) hostcat='nidump hosts .';;
8093 *) case "$hostcat" in
8094 nidump*) hostcat='';;
8104 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8112 rp='Are you getting the hosts file via yellow pages?'
8115 y*) hostcat='ypcat hosts';;
8116 *) hostcat='cat /etc/hosts';;
8122 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8125 '') test -f /etc/group && groupcat='cat /etc/group';;
8128 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8131 : now get the host name
8133 echo "Figuring out host name..." >&4
8134 case "$myhostname" in
8136 echo 'Maybe "hostname" will work...'
8137 if tans=`sh -c hostname 2>&1` ; then
8145 if $test "$cont"; then
8147 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8148 if tans=`cat /etc/systemid 2>&1` ; then
8150 phostname='cat /etc/systemid'
8151 echo "Whadyaknow. Xenix always was a bit strange..."
8154 elif $test -r /etc/systemid; then
8155 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8158 if $test "$cont"; then
8159 echo 'No, maybe "uuname -l" will work...'
8160 if tans=`sh -c 'uuname -l' 2>&1` ; then
8162 phostname='uuname -l'
8164 echo 'Strange. Maybe "uname -n" will work...'
8165 if tans=`sh -c 'uname -n' 2>&1` ; then
8167 phostname='uname -n'
8169 echo 'Oh well, maybe I can mine it out of whoami.h...'
8170 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8171 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8172 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8174 case "$myhostname" in
8175 '') echo "Does this machine have an identity crisis or something?"
8178 echo "Well, you said $myhostname before..."
8179 phostname='echo $myhostname';;
8185 case "$myhostname" in
8186 '') myhostname=noname ;;
8188 : you do not want to know about this
8193 if $test "$myhostname" ; then
8195 rp='Your host name appears to be "'$myhostname'".'" Right?"
8203 : bad guess or no guess
8204 while $test "X$myhostname" = X ; do
8206 rp="Please type the (one word) name of your host:"
8211 : translate upper to lower if necessary
8212 case "$myhostname" in
8214 echo "(Normalizing case in your host name)"
8215 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8219 case "$myhostname" in
8221 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8222 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8223 echo "(Trimming domain name from host name--host name is now $myhostname)"
8225 *) case "$mydomain" in
8228 test "X$hostcat" = "Xypcat hosts" &&
8229 ypmatch "$myhostname" hosts 2>/dev/null |\
8230 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8233 test "X$hostcat" != "X" &&
8234 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8235 /[ ]$myhostname[ . ]/p" > hosts
8238 if $test -f hosts; then
8239 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8240 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8241 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8242 hosts | $sort | $uniq | \
8243 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8244 case `$echo X$dflt` in
8245 X*\ *) echo "(Several hosts in the database matched hostname)"
8248 X.) echo "(You do not have fully-qualified names in the hosts database)"
8252 echo "(I cannot locate a hosts database anywhere)"
8257 tans=`./loc resolv.conf X /etc /usr/etc`
8258 if $test -f "$tans"; then
8259 echo "(Attempting domain name extraction from $tans)"
8260 dflt=.`$sed -n -e 's/ / /g' \
8261 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8262 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8264 .) dflt=.`$sed -n -e 's/ / /g' \
8265 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8266 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8273 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8274 dflt=.`sh -c domainname 2>/dev/null`
8277 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8281 case "$dflt$osname" in
8282 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8283 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8287 .) echo "(Lost all hope -- silly guess then)"
8293 *) dflt="$mydomain";;
8297 rp="What is your domain name?"
8307 : translate upper to lower if necessary
8310 echo "(Normalizing case in your domain name)"
8311 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8315 : a little sanity check here
8316 case "$phostname" in
8319 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8320 $myhostname$mydomain|$myhostname) ;;
8322 case "$phostname" in
8324 echo "(That doesn't agree with your whoami.h file, by the way.)"
8327 echo "(That doesn't agree with your $phostname command, by the way.)"
8337 I need to get your e-mail address in Internet format if possible, i.e.
8338 something like user@host.domain. Please answer accurately since I have
8339 no easy means to double check it. The default value provided below
8340 is most probably close to reality but may not be valid from outside
8341 your organization...
8345 while test "$cont"; do
8347 '') dflt="$cf_by@$myhostname$mydomain";;
8348 *) dflt="$cf_email";;
8350 rp='What is your e-mail address?'
8356 rp='Address does not look like an Internet one. Use it anyway?'
8372 If you or somebody else will be maintaining perl at your site, please
8373 fill in the correct e-mail address here so that they may be contacted
8374 if necessary. Currently, the "perlbug" program included with perl
8375 will send mail to this address in addition to perlbug@perl.org. You may
8376 enter "none" for no administrator.
8379 case "$perladmin" in
8380 '') dflt="$cf_email";;
8381 *) dflt="$perladmin";;
8383 rp='Perl administrator e-mail address'
8387 : determine whether to only install version-specific parts.
8390 Do you want to install only the version-specific parts of the perl
8391 distribution? Usually you do *not* want to do this.
8393 case "$versiononly" in
8394 "$define"|[Yy]*|true) dflt='y' ;;
8397 rp="Do you want to install only the version-specific parts of perl?"
8400 [yY]*) val="$define";;
8406 case "$versiononly" in
8407 "$define") inc_version_list=''
8408 inc_version_list_init=0
8412 : figure out how to guarantee perl startup
8413 case "$startperl" in
8415 case "$sharpbang" in
8419 I can use the #! construct to start perl on your system. This will
8420 make startup of perl scripts faster, but may cause problems if you
8421 want to share those scripts and perl is not in a standard place
8422 ($binexp/perl) on all your platforms. The alternative is to force
8423 a shell by starting the script with a single ':' character.
8426 case "$versiononly" in
8427 "$define") dflt="$binexp/perl$version";;
8428 *) dflt="$binexp/perl";;
8430 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8433 none) startperl=": # use perl";;
8434 *) startperl="#!$ans"
8435 if $test 30 -lt `echo "$ans" | wc -c`; then
8438 WARNING: Some systems limit the #! command to 32 characters.
8439 If you experience difficulty running Perl scripts with #!, try
8440 installing Perl in a directory with a shorter pathname.
8446 *) startperl=": # use perl"
8451 echo "I'll use $startperl to start perl scripts."
8453 : figure best path for perl in scripts
8456 case "$versiononly" in
8457 "$define") perlpath="$binexp/perl$version";;
8458 *) perlpath="$binexp/perl";;
8460 case "$startperl" in
8465 I will use the "eval 'exec'" idiom to start Perl on your system.
8466 I can use the full path of your Perl binary for this purpose, but
8467 doing so may cause problems if you want to share those scripts and
8468 Perl is not always in a standard place ($binexp/perl).
8472 rp="What path shall I use in \"eval 'exec'\"?"
8479 case "$startperl" in
8481 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8484 : determine where public executable scripts go
8485 set scriptdir scriptdir
8487 case "$scriptdir" in
8490 : guess some guesses
8491 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8492 $test -d /usr/share/bin && dflt=/usr/share/bin
8493 $test -d /usr/local/script && dflt=/usr/local/script
8494 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8495 $test -d $prefixexp/script && dflt=$prefixexp/script
8499 *) dflt="$scriptdir"
8504 Some installations have a separate directory just for executable scripts so
8505 that they can mount it across multiple architectures but keep the scripts in
8506 one spot. You might, for example, have a subdirectory of /usr/share for this.
8507 Or you might just lump your scripts in with all your other executables.
8511 rp='Where do you keep publicly executable scripts?'
8513 if $test "X$ansexp" != "X$scriptdirexp"; then
8517 scriptdirexp="$ansexp"
8518 : Change installation prefix, if necessary.
8519 if $test X"$prefix" != X"$installprefix"; then
8520 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8522 installscript="$scriptdirexp"
8525 : determine where add-on public executables go
8527 '') dflt=$siteprefix/bin ;;
8531 rp='Pathname where the add-on public executables should be installed?'
8534 sitebinexp="$ansexp"
8535 : Change installation prefix, if necessary.
8536 if $test X"$prefix" != X"$installprefix"; then
8537 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8539 installsitebin="$sitebinexp"
8542 : define an is-a-typedef? function
8543 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8545 "") inclist="sys/types.h";;
8547 eval "varval=\$$var";
8551 for inc in $inclist; do
8552 echo "#include <$inc>" >>temp.c;
8554 echo "#ifdef $type" >> temp.c;
8555 echo "printf(\"We have $type\");" >> temp.c;
8556 echo "#endif" >> temp.c;
8557 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8558 if $contains $type temp.E >/dev/null 2>&1; then
8564 *) eval "$var=\$varval";;
8567 : define an is-a-typedef? function that prompts if the type is not available.
8568 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8570 "") inclist="sys/types.h";;
8572 eval "varval=\$$var";
8576 for inc in $inclist; do
8577 echo "#include <$inc>" >>temp.c;
8579 echo "#ifdef $type" >> temp.c;
8580 echo "printf(\"We have $type\");" >> temp.c;
8581 echo "#endif" >> temp.c;
8582 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8584 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8585 if $contains $type temp.E >/dev/null 2>&1; then
8586 echo "$type found." >&4;
8589 echo "$type NOT found." >&4;
8595 *) eval "$var=\$varval";;
8598 : see what type lseek is declared as in the kernel
8599 rp="What is the type used for lseek's offset on this system?"
8600 set off_t lseektype long stdio.h sys/types.h
8604 echo "Checking to see how big your file offsets are..." >&4
8606 #include <sys/types.h>
8610 printf("%d\n", (int)sizeof($lseektype));
8615 if eval $compile_ok; then
8616 lseeksize=`$run ./try`
8617 echo "Your file offsets are $lseeksize bytes long."
8621 echo "(I can't seem to compile the test program. Guessing...)"
8622 rp="What is the size of your file offsets (in bytes)?"
8628 : see what type file positions are declared as in the library
8629 rp="What is the type for file position used by fsetpos()?"
8630 set fpos_t fpostype long stdio.h sys/types.h
8635 *_t) zzz="$fpostype" ;;
8638 echo "Checking the size of $zzz..." >&4
8640 #include <sys/types.h>
8643 printf("%d\n", (int)sizeof($fpostype));
8648 if eval $compile_ok; then
8652 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8655 echo "Your $zzz is $fpossize bytes long."
8661 echo "(I can't compile the test program. Guessing...)" >&4
8662 rp="What is the size of your file positions (in bytes)?"
8669 # Backward compatibility (uselfs is deprecated).
8671 "$define"|true|[yY]*)
8674 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8676 uselargefiles="$define"
8680 case "$lseeksize:$fpossize" in
8683 You can have files larger than 2 gigabytes.
8686 *) case "$uselargefiles" in
8687 "$undef"|false|[nN]*) dflt='n' ;;
8692 Perl can be built to understand large files (files larger than 2 gigabytes)
8693 on some systems. To do so, Configure can be run with -Duselargefiles.
8695 If this doesn't make any sense to you, just accept the default '$dflt'.
8697 rp='Try to understand large files, if available?'
8700 y|Y) val="$define" ;;
8707 case "$uselargefiles" in
8709 : Look for a hint-file generated 'call-back-unit'. If the
8710 : user has specified that a large files perl is to be built,
8711 : we may need to set or change some other defaults.
8712 if $test -f uselargefiles.cbu; then
8713 echo "Your platform has some specific hints for large file builds, using them..."
8714 . ./uselargefiles.cbu
8716 echo "Rechecking to see how big your file offsets are..." >&4
8718 #include <sys/types.h>
8722 printf("%d\n", (int)sizeof($lseektype));
8727 if eval $compile_ok; then
8728 lseeksize=`$run ./try`
8729 $echo "Your file offsets are now $lseeksize bytes long."
8733 echo "(I can't seem to compile the test program. Guessing...)"
8734 rp="What is the size of your file offsets (in bytes)?"
8739 *_t) zzz="$fpostype" ;;
8742 $echo $n "Rechecking the size of $zzz...$c" >&4
8744 #include <sys/types.h>
8747 printf("%d\n", (int)sizeof($fpostype));
8752 if eval $compile_ok; then
8757 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8760 echo " $fpossize bytes." >&4
8766 echo "(I can't compile the test program. Guessing...)" >&4
8767 rp="What is the size of your file positions (in bytes)?"
8776 case "$vendorprefix" in
8777 '') d_vendorbin="$undef"
8781 *) d_vendorbin="$define"
8782 : determine where vendor-supplied executables go.
8783 case "$vendorbin" in
8784 '') dflt=$vendorprefix/bin ;;
8785 *) dflt="$vendorbin" ;;
8788 rp='Pathname for the vendor-supplied executables directory?'
8791 vendorbinexp="$ansexp"
8794 : Change installation prefix, if necessary.
8795 if $test X"$prefix" != X"$installprefix"; then
8796 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
8798 installvendorbin="$vendorbinexp"
8801 : see if qgcvt exists
8805 : Check how to convert floats to strings.
8807 if test "X$d_Gconvert" = X; then
8810 echo "Checking for an efficient way to convert floats to strings."
8812 case "$uselongdouble" in
8813 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8815 case "$d_longdbl" in
8816 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8818 case "$d_PRIgldbl" in
8819 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8823 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8824 char *myname = "gconvert";
8827 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8828 char *myname = "gcvt";
8831 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8832 char *myname = "qgcvt";
8833 #define DOUBLETYPE long double
8836 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8838 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8840 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
8843 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8845 char *myname = "sprintf";
8849 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8850 #define DOUBLETYPE long double
8852 #define DOUBLETYPE double
8858 #define I_STDLIB $i_stdlib
8864 checkit(expect, got)
8868 if (strcmp(expect, got)) {
8869 printf("%s oddity: Expected %s, got %s\n",
8870 myname, expect, got);
8880 /* This must be 1st test on (which?) platform */
8881 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8882 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8883 checkit("0.1", buf);
8885 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
8886 checkit("0.01", buf);
8888 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
8889 checkit("0.001", buf);
8891 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
8892 checkit("0.0001", buf);
8894 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
8895 if (strlen(buf) > 5)
8896 checkit("9e-005", buf); /* for Microsoft ?? */
8898 checkit("9e-05", buf);
8900 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8903 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8904 checkit("1.1", buf);
8906 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8907 checkit("1.01", buf);
8909 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8910 checkit("1.001", buf);
8912 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8913 checkit("1.0001", buf);
8915 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8916 checkit("1.00001", buf);
8918 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8919 checkit("1.000001", buf);
8921 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8924 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8927 /* Some Linux gcvt's give 1.e+5 here. */
8928 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8929 checkit("100000", buf);
8931 /* Some Linux gcvt's give -1.e+5 here. */
8932 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8933 checkit("-100000", buf);
8935 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8936 checkit("123.456", buf);
8938 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
8939 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
8940 /* 34 should be enough to scare even long double
8941 * places into using the e notation. */
8942 if (strlen(buf) > 5)
8943 checkit("1e+034", buf); /* for Microsoft */
8945 checkit("1e+34", buf);
8947 /* For Perl, if you add additional tests here, also add them to
8948 * t/base/num.t for benefit of platforms not using Configure or
8949 * overriding d_Gconvert */
8954 : first add preferred functions to our list
8956 for xxx_convert in $gconvert_preference; do
8957 case $xxx_convert in
8958 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
8959 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
8962 : then add any others
8963 for xxx_convert in gconvert gcvt sprintf; do
8966 *) xxx_list="$xxx_list $xxx_convert" ;;
8970 case "$d_longdbl$uselongdouble" in
8972 : again, add prefered functions to our list first
8974 for xxx_convert in $gconvert_ld_preference; do
8975 case $xxx_convert in
8976 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
8977 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
8980 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
8981 for xxx_convert in qgcvt sprintf $xxx_list; do
8982 case "$xxx_ld_list" in
8983 $xxx_convert*|*" $xxx_convert"*) ;;
8984 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
8987 : if sprintf cannot do long doubles, move it to the end
8988 if test "$d_PRIgldbl" != "$define"; then
8989 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
8991 : if no qgcvt, remove it
8992 if test "$d_qgcvt" != "$define"; then
8993 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
8996 xxx_list="$xxx_ld_list"
9000 for xxx_convert in $xxx_list; do
9001 echo "Trying $xxx_convert..."
9003 set try -DTRY_$xxx_convert
9004 if eval $compile; then
9005 echo "$xxx_convert() found." >&4
9007 echo "I'll use $xxx_convert to convert floats into a string." >&4
9010 echo "...But $xxx_convert didn't work as I expected."
9014 echo "$xxx_convert NOT found." >&4
9018 if test X$xxx_convert = X; then
9019 echo "*** WHOA THERE!!! ***" >&4
9020 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9024 case "$xxx_convert" in
9025 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9026 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9027 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9028 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9029 "$define$define$define")
9030 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9031 "$define$define$undef")
9032 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9033 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9040 : see if _fwalk exists
9044 : Initialize h_fcntl
9047 : Initialize h_sysfile
9050 : access call always available on UNIX
9054 : locate the flags for 'access()'
9058 $cat >access.c <<'EOCP'
9059 #include <sys/types.h>
9064 #include <sys/file.h>
9073 : check sys/file.h first, no particular reason here
9074 if $test `./findhdr sys/file.h` && \
9075 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9077 echo "<sys/file.h> defines the *_OK access constants." >&4
9078 elif $test `./findhdr fcntl.h` && \
9079 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9081 echo "<fcntl.h> defines the *_OK access constants." >&4
9082 elif $test `./findhdr unistd.h` && \
9083 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9084 echo "<unistd.h> defines the *_OK access constants." >&4
9086 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9092 : see if accessx exists
9093 set accessx d_accessx
9096 : see if alarm exists
9100 : see if POSIX threads are available
9101 set pthread.h i_pthread
9104 : define a fucntion to check prototypes
9105 $cat > protochk <<EOSH
9108 optimize="$optimize"
9110 prototype="$prototype"
9113 usethreads=$usethreads
9114 i_pthread=$i_pthread
9115 pthread_h_first=$pthread_h_first
9118 $cat >> protochk <<'EOSH'
9123 while test $# -ge 2; do
9125 $define) echo "#include <$2>" >> try.c ;;
9126 literal) echo "$2" >> try.c ;;
9128 # Extra magic for the benefit of systems that need pthread.h
9129 # to be included early to correctly detect threadsafe functions.
9130 # Such functions must guarantee themselves, though, that the usethreads
9131 # and i_pthread have been defined, before calling protochk.
9132 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9133 echo "#include <pthread.h>" >> try.c
9138 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9139 cat >> try.c <<'EOCP'
9140 #ifdef CAN_PROTOTYPE
9141 #define _(args) args
9146 echo "$foo" >> try.c
9147 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9148 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9156 hasproto='varname=$1; func=$2; shift; shift;
9157 while $test $# -ge 2; do
9159 $define) echo "#include <$2>";;
9163 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9164 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9165 echo "$func() prototype found.";
9168 echo "$func() prototype NOT found.";
9173 $rm -f try.c tryout.c'
9175 : see if sys/types.h has to be included
9176 set sys/types.h i_systypes
9179 : see if sys/select.h has to be included
9180 set sys/select.h i_sysselct
9183 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9184 while $test $# -ge 2; do
9186 $define) echo "#include <$2>";;
9190 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9192 if eval $compile; then
9201 : see if we should include time.h, sys/time.h, or both
9203 if test "X$timeincl" = X; then
9204 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9205 $echo $n "I'm now running the test program...$c"
9206 $cat >try.c <<'EOCP'
9207 #include <sys/types.h>
9212 #ifdef SYSTIMEKERNEL
9215 #include <sys/time.h>
9218 #include <sys/select.h>
9227 struct timezone tzp;
9229 if (foo.tm_sec == foo.tm_sec)
9232 if (bar.tv_sec == bar.tv_sec)
9239 for s_timezone in '-DS_TIMEZONE' ''; do
9241 for s_timeval in '-DS_TIMEVAL' ''; do
9242 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9243 for i_time in '' '-DI_TIME'; do
9244 for i_systime in '-DI_SYSTIME' ''; do
9247 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9248 if eval $compile; then
9249 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9253 $echo $n "Succeeded with $flags$c"
9265 *SYSTIMEKERNEL*) i_systimek="$define"
9266 timeincl=`./findhdr sys/time.h`
9267 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9268 *) i_systimek="$undef";;
9271 *I_TIME*) i_time="$define"
9272 timeincl=`./findhdr time.h`" $timeincl"
9273 echo "We'll include <time.h>." >&4;;
9274 *) i_time="$undef";;
9277 *I_SYSTIME*) i_systime="$define"
9278 timeincl=`./findhdr sys/time.h`" $timeincl"
9279 echo "We'll include <sys/time.h>." >&4;;
9280 *) i_systime="$undef";;
9284 : see if struct tm knows about tm_zone
9285 case "$i_systime$i_time" in
9288 echo "Checking to see if your struct tm has tm_zone field..." >&4
9289 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9297 case "$d_tm_tm_zone" in
9298 "$define") echo "Yes, it does." ;;
9299 *) echo "No, it doesn't." ;;
9301 : see if struct tm knows about tm_gmtoff
9302 case "$i_systime$i_time" in
9305 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9306 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9314 case "$d_tm_tm_gmtoff" in
9315 "$define") echo "Yes, it does." ;;
9316 *) echo "No, it doesn't." ;;
9319 : see if asctime_r exists
9320 set asctime_r d_asctime_r
9322 case "$d_asctime_r" in
9324 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9325 case "$d_asctime_r_proto:$usethreads" in
9326 ":define") d_asctime_r_proto=define
9327 set d_asctime_r_proto asctime_r $hdrs
9331 case "$d_asctime_r_proto" in
9333 case "$asctime_r_proto" in
9334 ''|0) try='char* asctime_r(const struct tm*, char*);'
9335 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9337 case "$asctime_r_proto" in
9338 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9339 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9341 case "$asctime_r_proto" in
9342 ''|0) try='int asctime_r(const struct tm*, char*);'
9343 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9345 case "$asctime_r_proto" in
9346 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9347 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9349 case "$asctime_r_proto" in
9350 ''|0) d_asctime_r=undef
9352 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9353 * ) case "$asctime_r_proto" in
9354 REENTRANT_PROTO*) ;;
9355 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9357 echo "Prototype: $try" ;;
9360 *) case "$usethreads" in
9361 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9368 *) asctime_r_proto=0
9372 : see if atolf exists
9376 : see if atoll exists
9380 : Look for GNU-cc style attribute checking
9382 echo "Checking whether your compiler can handle __attribute__ ..." >&4
9383 $cat >attrib.c <<'EOCP'
9385 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
9387 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9388 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9389 echo "Your C compiler doesn't fully support __attribute__."
9392 echo "Your C compiler supports __attribute__."
9396 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9403 : see if bcmp exists
9407 : see if bcopy exists
9411 : see if this is a unistd.h system
9412 set unistd.h i_unistd
9415 : see if getpgrp exists
9416 set getpgrp d_getpgrp
9419 case "$d_getpgrp" in
9422 echo "Checking to see which flavor of getpgrp is in use..."
9425 #include <sys/types.h>
9427 # include <unistd.h>
9431 if (getuid() == 0) {
9432 printf("(I see you are running Configure as super-user...)\n");
9436 if (getpgrp(1) == 0)
9445 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9446 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
9448 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9449 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
9452 echo "I can't seem to compile and run the test program."
9454 xxx="a USG one, i.e. you use getpgrp()."
9456 # SVR4 systems can appear rather BSD-ish.
9459 xxx="a BSD one, i.e. you use getpgrp(pid)."
9463 xxx="probably a USG one, i.e. you use getpgrp()."
9468 echo "Assuming your getpgrp is $xxx" >&4
9477 : see if setpgrp exists
9478 set setpgrp d_setpgrp
9481 case "$d_setpgrp" in
9484 echo "Checking to see which flavor of setpgrp is in use..."
9487 #include <sys/types.h>
9489 # include <unistd.h>
9493 if (getuid() == 0) {
9494 printf("(I see you are running Configure as super-user...)\n");
9498 if (-1 == setpgrp(1, 1))
9501 if (setpgrp() != -1)
9507 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9508 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
9510 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9511 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
9514 echo "(I can't seem to compile and run the test program.)"
9516 xxx="a USG one, i.e. you use setpgrp()."
9518 # SVR4 systems can appear rather BSD-ish.
9521 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
9525 xxx="probably a USG one, i.e. you use setpgrp()."
9530 echo "Assuming your setpgrp is $xxx" >&4
9538 : see if bzero exists
9542 : see if signal is declared as pointer to function returning int or void
9544 xxx=`./findhdr signal.h`
9545 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
9546 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9547 echo "You have int (*signal())() instead of void." >&4
9549 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9550 echo "You have void (*signal())()." >&4
9552 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
9553 echo "You have int (*signal())() instead of void." >&4
9555 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
9556 echo "You have void (*signal())()." >&4
9559 case "$d_voidsig" in
9561 echo "I can't determine whether signal handler returns void or int..." >&4
9563 rp="What type does your signal handler return?"
9570 echo "As you already told me, signal handler returns void." >&4
9573 *) echo "As you already told me, signal handler returns int." >&4
9580 case "$d_voidsig" in
9581 "$define") signal_t="void";;
9586 : check for ability to cast large floats to 32-bit ints.
9588 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
9589 if $test "$intsize" -ge 4; then
9596 #include <sys/types.h>
9598 $signal_t blech(s) int s; { exit(3); }
9605 signal(SIGFPE, blech);
9607 /* Don't let compiler optimize the test away. Store the number
9608 in a writable string for gcc to pass to sscanf under HP/UX.
9610 sprintf(str, "2147483647");
9611 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
9615 /* x86 processors will probably give 0x8000 0000, which is a
9616 sign change. We don't want that. We want to mimic SPARC
9617 behavior here, which is to preserve the sign and give
9620 if (i32 != ($xxx) f)
9626 if eval $compile_ok; then
9630 echo "(I can't seem to compile the test program--assuming it can't)"
9638 echo "Nope, it can't."
9645 : check for ability to cast negative floats to unsigned
9647 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
9650 #include <sys/types.h>
9652 $signal_t blech(s) int s; { exit(7); }
9653 $signal_t blech_in_list(s) int s; { exit(4); }
9654 unsigned long dummy_long(p) unsigned long p; { return p; }
9655 unsigned int dummy_int(p) unsigned int p; { return p; }
9656 unsigned short dummy_short(p) unsigned short p; { return p; }
9660 unsigned long along;
9662 unsigned short ashort;
9666 /* Frustrate gcc-2.7.2's optimizer which failed this test with
9667 a direct f = -123. assignment. gcc-2.8.0 reportedly
9668 optimized the whole file away
9670 /* Store the number in a writable string for gcc to pass to
9673 sprintf(str, "-123");
9674 sscanf(str, "%lf", &f); /* f = -123.; */
9676 signal(SIGFPE, blech);
9677 along = (unsigned long)f;
9678 aint = (unsigned int)f;
9679 ashort = (unsigned short)f;
9680 if (along != (unsigned long)-123)
9682 if (aint != (unsigned int)-123)
9684 if (ashort != (unsigned short)-123)
9686 sprintf(str, "1073741824.");
9687 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
9690 along = (unsigned long)f;
9691 if (along != 0x80000000)
9695 along = (unsigned long)f;
9696 if (along != 0x7fffffff)
9700 along = (unsigned long)f;
9701 if (along != 0x80000001)
9705 signal(SIGFPE, blech_in_list);
9706 sprintf(str, "123.");
9707 sscanf(str, "%lf", &f); /* f = 123.; */
9708 along = dummy_long((unsigned long)f);
9709 aint = dummy_int((unsigned int)f);
9710 ashort = dummy_short((unsigned short)f);
9711 if (along != (unsigned long)123)
9713 if (aint != (unsigned int)123)
9715 if (ashort != (unsigned short)123)
9722 if eval $compile_ok; then
9726 echo "(I can't seem to compile the test program--assuming it can't)"
9729 case "$castflags" in
9734 echo "Nope, it can't."
9741 : see if vprintf exists
9743 if set vprintf val -f d_vprintf; eval $csym; $val; then
9744 echo 'vprintf() found.' >&4
9747 #include <varargs.h>
9749 int main() { xxx("foo"); }
9758 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
9762 if eval $compile && $run ./try; then
9763 echo "Your vsprintf() returns (int)." >&4
9766 echo "Your vsprintf() returns (char*)." >&4
9770 echo 'vprintf() NOT found.' >&4
9781 : see if chown exists
9785 : see if chroot exists
9789 : see if chsize exists
9793 : see if class exists
9797 hasstruct='varname=$1; struct=$2; shift; shift;
9798 while $test $# -ge 2; do
9800 $define) echo "#include <$2>";;
9804 echo "int main () { struct $struct foo; }" >> try.c;
9806 if eval $compile; then
9817 : see whether socket exists
9819 $echo $n "Hmm... $c" >&4
9820 if set socket val -f d_socket; eval $csym; $val; then
9821 echo "Looks like you have Berkeley networking support." >&4
9823 if set setsockopt val -f; eval $csym; $val; then
9826 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9830 if $contains socklib libc.list >/dev/null 2>&1; then
9831 echo "Looks like you have Berkeley networking support." >&4
9833 : we will have to assume that it supports the 4.2 BSD interface
9836 echo "You don't have Berkeley networking in libc$_a..." >&4
9837 if test "X$d_socket" = "X$define"; then
9838 echo "...but you seem to believe that you have sockets." >&4
9840 for net in net socket
9842 if test -f /usr/lib/lib$net$_a; then
9843 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9844 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9845 if $contains socket libc.list >/dev/null 2>&1; then
9850 echo "...but the Wollongong group seems to have hacked it in." >&4
9851 sockethdr="-I/usr/netinclude"
9854 echo "Found Berkeley sockets interface in lib$net." >&4
9855 if $contains setsockopt libc.list >/dev/null 2>&1; then
9858 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9865 if test "X$d_socket" != "X$define"; then
9866 echo "or anywhere else I see." >&4
9874 : see if socketpair exists
9875 set socketpair d_sockpair
9880 echo "Checking the availability of certain socket constants..." >&4
9881 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9882 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9884 #include <sys/types.h>
9885 #include <sys/socket.h>
9891 set try; if eval $compile; then
9894 set d_${enum}; eval $setvar
9898 : see if this is a sys/uio.h system
9899 set sys/uio.h i_sysuio
9904 echo "Checking to see if your system supports struct cmsghdr..." >&4
9905 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
9907 case "$d_cmsghdr_s" in
9908 "$define") echo "Yes, it does." ;;
9909 *) echo "No, it doesn't." ;;
9913 : check for const keyword
9915 echo 'Checking to see if your C compiler knows about "const"...' >&4
9916 $cat >const.c <<'EOCP'
9917 typedef struct spug { int drokk; } spug;
9924 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
9926 echo "Yup, it does."
9929 echo "Nope, it doesn't."
9934 : see if crypt exists
9939 $define) cryptlib='' ;;
9940 *) if set crypt val -f d_crypt; eval $csym; $val; then
9941 echo 'crypt() found.' >&4
9945 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
9946 if $test -z "$cryptlib"; then
9947 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
9951 if $test -z "$cryptlib"; then
9952 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
9956 if $test -z "$cryptlib"; then
9957 cryptlib=`./loc libcrypt$_a "" $libpth`
9961 if $test -z "$cryptlib"; then
9962 echo 'crypt() NOT found.' >&4
9973 : see if this is a crypt.h system
9977 : see if crypt_r exists
9978 set crypt_r d_crypt_r
9980 case "$d_crypt_r" in
9982 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
9983 case "$d_crypt_r_proto:$usethreads" in
9984 ":define") d_crypt_r_proto=define
9985 set d_crypt_r_proto crypt_r $hdrs
9989 case "$d_crypt_r_proto" in
9991 case "$crypt_r_proto" in
9992 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
9993 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
9995 case "$crypt_r_proto" in
9996 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
9997 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
9999 case "$crypt_r_proto" in
10000 ''|0) d_crypt_r=undef
10002 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10003 * ) case "$crypt_r_proto" in
10004 REENTRANT_PROTO*) ;;
10005 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10007 echo "Prototype: $try" ;;
10010 *) case "$usethreads" in
10011 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10022 : get csh whereabouts
10024 'csh') val="$undef" ;;
10025 *) val="$define" ;;
10029 : Respect a hint or command line value for full_csh.
10030 case "$full_csh" in
10031 '') full_csh=$csh ;;
10034 : see if ctermid_r exists
10035 set ctermid_r d_ctermid_r
10037 case "$d_ctermid_r" in
10039 hdrs="$i_systypes sys/types.h define stdio.h "
10040 case "$d_ctermid_r_proto:$usethreads" in
10041 ":define") d_ctermid_r_proto=define
10042 set d_ctermid_r_proto ctermid_r $hdrs
10046 case "$d_ctermid_r_proto" in
10048 case "$ctermid_r_proto" in
10049 ''|0) try='char* ctermid_r(char*);'
10050 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10052 case "$ctermid_r_proto" in
10053 ''|0) d_ctermid_r=undef
10055 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10056 * ) case "$ctermid_r_proto" in
10057 REENTRANT_PROTO*) ;;
10058 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10060 echo "Prototype: $try" ;;
10063 *) case "$usethreads" in
10064 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10071 *) ctermid_r_proto=0
10075 : see if ctime_r exists
10076 set ctime_r d_ctime_r
10078 case "$d_ctime_r" in
10080 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10081 case "$d_ctime_r_proto:$usethreads" in
10082 ":define") d_ctime_r_proto=define
10083 set d_ctime_r_proto ctime_r $hdrs
10087 case "$d_ctime_r_proto" in
10089 case "$ctime_r_proto" in
10090 ''|0) try='char* ctime_r(const time_t*, char*);'
10091 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10093 case "$ctime_r_proto" in
10094 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10095 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10097 case "$ctime_r_proto" in
10098 ''|0) try='int ctime_r(const time_t*, char*);'
10099 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10101 case "$ctime_r_proto" in
10102 ''|0) try='int ctime_r(const time_t*, char*, int);'
10103 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10105 case "$ctime_r_proto" in
10106 ''|0) d_ctime_r=undef
10108 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10109 * ) case "$ctime_r_proto" in
10110 REENTRANT_PROTO*) ;;
10111 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10113 echo "Prototype: $try" ;;
10116 *) case "$usethreads" in
10117 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10128 : see if cuserid exists
10129 set cuserid d_cuserid
10132 : see if this is a limits.h system
10133 set limits.h i_limits
10136 : see if this is a float.h system
10137 set float.h i_float
10140 : See if number of significant digits in a double precision number is known
10142 $cat >dbl_dig.c <<EOM
10143 #$i_limits I_LIMITS
10146 #include <limits.h>
10152 printf("Contains DBL_DIG");
10155 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10156 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10157 echo "DBL_DIG found." >&4
10160 echo "DBL_DIG NOT found." >&4
10167 : see if dbm.h is available
10168 : see if dbmclose exists
10169 set dbmclose d_dbmclose
10172 case "$d_dbmclose" in
10182 *) set rpcsvc/dbm.h i_rpcsvcdbm
10187 *) echo "We won't be including <dbm.h>"
10197 : see if prototype for dbminit is available
10199 set d_dbminitproto dbminit $i_dbm dbm.h
10202 : see if difftime exists
10203 set difftime d_difftime
10206 : see if this is a dirent system
10208 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10210 echo "<dirent.h> found." >&4
10213 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10214 echo "<sys/dir.h> found." >&4
10217 xinc=`./findhdr sys/ndir.h`
10219 echo "<dirent.h> NOT found." >&4
10224 : Look for type of directory structure.
10226 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10228 case "$direntrytype" in
10230 case "$i_dirent" in
10231 $define) guess1='struct dirent' ;;
10232 *) guess1='struct direct' ;;
10235 *) guess1="$direntrytype"
10240 'struct dirent') guess2='struct direct' ;;
10241 *) guess2='struct dirent' ;;
10244 if $contains "$guess1" try.c >/dev/null 2>&1; then
10245 direntrytype="$guess1"
10246 echo "Your directory entries are $direntrytype." >&4
10247 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10248 direntrytype="$guess2"
10249 echo "Your directory entries seem to be $direntrytype." >&4
10251 echo "I don't recognize your system's directory entries." >&4
10252 rp="What type is used for directory entries on this system?"
10255 direntrytype="$ans"
10260 : see if the directory entry stores field length
10262 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10263 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10264 echo "Good, your directory entry keeps length information in d_namlen." >&4
10267 echo "Your directory entry does not know about the d_namlen field." >&4
10274 : see if this is an sysdir system
10275 set sys/dir.h i_sysdir
10278 : see if this is an sysndir system
10279 set sys/ndir.h i_sysndir
10284 $cat >dirfd.c <<EOM
10286 #$i_dirent I_DIRENT /**/
10287 #$i_sysdir I_SYS_DIR /**/
10288 #$i_sysndir I_SYS_NDIR /**/
10289 #$i_systypes I_SYS_TYPES /**/
10290 #if defined(I_SYS_TYPES)
10291 #include <sys/types.h>
10293 #if defined(I_DIRENT)
10294 #include <dirent.h>
10295 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10296 #include <sys/dir.h>
10300 #include <sys/ndir.h>
10304 #include <ndir.h> /* may be wrong in the future */
10306 #include <sys/dir.h>
10312 DIR *dirp = opendir(".");
10313 if (dirfd(dirp) >= 0)
10320 if eval $compile; then
10324 $define) echo "dirfd() found." >&4 ;;
10325 *) echo "dirfd() NOT found." >&4 ;;
10331 : see if dlerror exists
10334 set dlerror d_dlerror
10338 : see if dlfcn is available
10339 set dlfcn.h i_dlfcn
10346 On a few systems, the dynamically loaded modules that perl generates and uses
10347 will need a different extension than shared libs. The default will probably
10353 *) dflt="$dlext" ;;
10355 rp='What is the extension of dynamically loaded modules'
10364 : Check if dlsym need a leading underscore
10370 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
10371 $cat >dyna.c <<'EOM'
10380 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
10382 #include <sys/types.h>
10387 extern int fred() ;
10396 int mode = RTLD_LAZY ;
10398 handle = dlopen("./dyna.$dlext", mode) ;
10399 if (handle == NULL) {
10404 symbol = dlsym(handle, "fred") ;
10405 if (symbol == NULL) {
10406 /* try putting a leading underscore */
10407 symbol = dlsym(handle, "_fred") ;
10408 if (symbol == NULL) {
10421 : Call the object file tmp-dyna.o in case dlext=o.
10422 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
10423 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
10424 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
10425 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
10428 1) echo "Test program failed using dlopen." >&4
10429 echo "Perhaps you should not use dynamic loading." >&4;;
10430 2) echo "Test program failed using dlsym." >&4
10431 echo "Perhaps you should not use dynamic loading." >&4;;
10432 3) echo "dlsym needs a leading underscore" >&4
10434 4) echo "dlsym doesn't need a leading underscore." >&4;;
10437 echo "I can't compile and run the test program." >&4
10438 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
10443 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
10448 : see if drand48_r exists
10449 set drand48_r d_drand48_r
10451 case "$d_drand48_r" in
10453 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
10454 case "$d_drand48_r_proto:$usethreads" in
10455 ":define") d_drand48_r_proto=define
10456 set d_drand48_r_proto drand48_r $hdrs
10460 case "$d_drand48_r_proto" in
10462 case "$drand48_r_proto" in
10463 ''|0) try='int drand48_r(struct drand48_data*, double*);'
10464 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
10466 case "$drand48_r_proto" in
10467 ''|0) d_drand48_r=undef
10469 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
10470 * ) case "$drand48_r_proto" in
10471 REENTRANT_PROTO*) ;;
10472 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
10474 echo "Prototype: $try" ;;
10477 *) case "$usethreads" in
10478 define) echo "drand48_r has no prototype, not using it." >&4 ;;
10485 *) drand48_r_proto=0
10489 : see if prototype for drand48 is available
10491 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
10494 : see if dup2 exists
10498 : see if eaccess exists
10499 set eaccess d_eaccess
10502 : see if endgrent exists
10503 set endgrent d_endgrent
10506 : see if this is an grp system
10512 xxx=`./findhdr grp.h`
10513 $cppstdin $cppflags $cppminus < $xxx >$$.h
10515 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10527 set d_grpasswd; eval $setvar
10531 : see if endgrent_r exists
10532 set endgrent_r d_endgrent_r
10534 case "$d_endgrent_r" in
10536 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
10537 case "$d_endgrent_r_proto:$usethreads" in
10538 ":define") d_endgrent_r_proto=define
10539 set d_endgrent_r_proto endgrent_r $hdrs
10543 case "$d_endgrent_r_proto" in
10545 case "$endgrent_r_proto" in
10546 ''|0) try='int endgrent_r(FILE**);'
10547 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
10549 case "$endgrent_r_proto" in
10550 ''|0) try='void endgrent_r(FILE**);'
10551 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
10553 case "$endgrent_r_proto" in
10554 ''|0) d_endgrent_r=undef
10556 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
10557 * ) case "$endgrent_r_proto" in
10558 REENTRANT_PROTO*) ;;
10559 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
10561 echo "Prototype: $try" ;;
10564 *) case "$usethreads" in
10565 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
10572 *) endgrent_r_proto=0
10576 : see if endhostent exists
10577 set endhostent d_endhent
10580 : see if this is a netdb.h system
10581 set netdb.h i_netdb
10584 : see if endhostent_r exists
10585 set endhostent_r d_endhostent_r
10587 case "$d_endhostent_r" in
10589 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10590 case "$d_endhostent_r_proto:$usethreads" in
10591 ":define") d_endhostent_r_proto=define
10592 set d_endhostent_r_proto endhostent_r $hdrs
10596 case "$d_endhostent_r_proto" in
10598 case "$endhostent_r_proto" in
10599 ''|0) try='int endhostent_r(struct hostent_data*);'
10600 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
10602 case "$endhostent_r_proto" in
10603 ''|0) try='void endhostent_r(struct hostent_data*);'
10604 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
10606 case "$endhostent_r_proto" in
10607 ''|0) d_endhostent_r=undef
10608 endhostent_r_proto=0
10609 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
10610 * ) case "$endhostent_r_proto" in
10611 REENTRANT_PROTO*) ;;
10612 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
10614 echo "Prototype: $try" ;;
10617 *) case "$usethreads" in
10618 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
10620 d_endhostent_r=undef
10621 endhostent_r_proto=0
10625 *) endhostent_r_proto=0
10629 : see if endnetent exists
10630 set endnetent d_endnent
10633 : see if endnetent_r exists
10634 set endnetent_r d_endnetent_r
10636 case "$d_endnetent_r" in
10638 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10639 case "$d_endnetent_r_proto:$usethreads" in
10640 ":define") d_endnetent_r_proto=define
10641 set d_endnetent_r_proto endnetent_r $hdrs
10645 case "$d_endnetent_r_proto" in
10647 case "$endnetent_r_proto" in
10648 ''|0) try='int endnetent_r(struct netent_data*);'
10649 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
10651 case "$endnetent_r_proto" in
10652 ''|0) try='void endnetent_r(struct netent_data*);'
10653 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
10655 case "$endnetent_r_proto" in
10656 ''|0) d_endnetent_r=undef
10657 endnetent_r_proto=0
10658 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
10659 * ) case "$endnetent_r_proto" in
10660 REENTRANT_PROTO*) ;;
10661 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
10663 echo "Prototype: $try" ;;
10666 *) case "$usethreads" in
10667 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
10669 d_endnetent_r=undef
10670 endnetent_r_proto=0
10674 *) endnetent_r_proto=0
10678 : see if endprotoent exists
10679 set endprotoent d_endpent
10682 : see if endprotoent_r exists
10683 set endprotoent_r d_endprotoent_r
10685 case "$d_endprotoent_r" in
10687 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10688 case "$d_endprotoent_r_proto:$usethreads" in
10689 ":define") d_endprotoent_r_proto=define
10690 set d_endprotoent_r_proto endprotoent_r $hdrs
10694 case "$d_endprotoent_r_proto" in
10696 case "$endprotoent_r_proto" in
10697 ''|0) try='int endprotoent_r(struct protoent_data*);'
10698 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
10700 case "$endprotoent_r_proto" in
10701 ''|0) try='void endprotoent_r(struct protoent_data*);'
10702 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
10704 case "$endprotoent_r_proto" in
10705 ''|0) d_endprotoent_r=undef
10706 endprotoent_r_proto=0
10707 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
10708 * ) case "$endprotoent_r_proto" in
10709 REENTRANT_PROTO*) ;;
10710 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
10712 echo "Prototype: $try" ;;
10715 *) case "$usethreads" in
10716 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
10718 d_endprotoent_r=undef
10719 endprotoent_r_proto=0
10723 *) endprotoent_r_proto=0
10727 : see if endpwent exists
10728 set endpwent d_endpwent
10731 : see if this is a pwd.h system
10737 xxx=`./findhdr pwd.h`
10738 $cppstdin $cppflags $cppminus < $xxx >$$.h
10740 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10748 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10756 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10764 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10772 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10780 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10788 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10796 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10808 set d_pwquota; eval $setvar
10809 set d_pwage; eval $setvar
10810 set d_pwchange; eval $setvar
10811 set d_pwclass; eval $setvar
10812 set d_pwexpire; eval $setvar
10813 set d_pwcomment; eval $setvar
10814 set d_pwgecos; eval $setvar
10815 set d_pwpasswd; eval $setvar
10819 : see if endpwent_r exists
10820 set endpwent_r d_endpwent_r
10822 case "$d_endpwent_r" in
10824 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
10825 case "$d_endpwent_r_proto:$usethreads" in
10826 ":define") d_endpwent_r_proto=define
10827 set d_endpwent_r_proto endpwent_r $hdrs
10831 case "$d_endpwent_r_proto" in
10833 case "$endpwent_r_proto" in
10834 ''|0) try='int endpwent_r(FILE**);'
10835 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
10837 case "$endpwent_r_proto" in
10838 ''|0) try='void endpwent_r(FILE**);'
10839 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
10841 case "$endpwent_r_proto" in
10842 ''|0) d_endpwent_r=undef
10844 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
10845 * ) case "$endpwent_r_proto" in
10846 REENTRANT_PROTO*) ;;
10847 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
10849 echo "Prototype: $try" ;;
10852 *) case "$usethreads" in
10853 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
10860 *) endpwent_r_proto=0
10864 : see if endservent exists
10865 set endservent d_endsent
10868 : see if endservent_r exists
10869 set endservent_r d_endservent_r
10871 case "$d_endservent_r" in
10873 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10874 case "$d_endservent_r_proto:$usethreads" in
10875 ":define") d_endservent_r_proto=define
10876 set d_endservent_r_proto endservent_r $hdrs
10880 case "$d_endservent_r_proto" in
10882 case "$endservent_r_proto" in
10883 ''|0) try='int endservent_r(struct servent_data*);'
10884 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
10886 case "$endservent_r_proto" in
10887 ''|0) try='void endservent_r(struct servent_data*);'
10888 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
10890 case "$endservent_r_proto" in
10891 ''|0) d_endservent_r=undef
10892 endservent_r_proto=0
10893 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
10894 * ) case "$endservent_r_proto" in
10895 REENTRANT_PROTO*) ;;
10896 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
10898 echo "Prototype: $try" ;;
10901 *) case "$usethreads" in
10902 define) echo "endservent_r has no prototype, not using it." >&4 ;;
10904 d_endservent_r=undef
10905 endservent_r_proto=0
10909 *) endservent_r_proto=0
10913 : Locate the flags for 'open()'
10915 $cat >try.c <<'EOCP'
10916 #include <sys/types.h>
10921 #include <sys/file.h>
10932 : check sys/file.h first to get FREAD on Sun
10933 if $test `./findhdr sys/file.h` && \
10934 set try -DI_SYS_FILE && eval $compile; then
10936 echo "<sys/file.h> defines the O_* constants..." >&4
10937 if $run ./try; then
10938 echo "and you have the 3 argument form of open()." >&4
10941 echo "but not the 3 argument form of open(). Oh, well." >&4
10944 elif $test `./findhdr fcntl.h` && \
10945 set try -DI_FCNTL && eval $compile; then
10947 echo "<fcntl.h> defines the O_* constants..." >&4
10948 if $run ./try; then
10949 echo "and you have the 3 argument form of open()." >&4
10952 echo "but not the 3 argument form of open(). Oh, well." >&4
10957 echo "I can't find the O_* constant definitions! You got problems." >&4
10963 : see which of string.h or strings.h is needed
10965 strings=`./findhdr string.h`
10966 if $test "$strings" && $test -r "$strings"; then
10967 echo "Using <string.h> instead of <strings.h>." >&4
10971 strings=`./findhdr strings.h`
10972 if $test "$strings" && $test -r "$strings"; then
10973 echo "Using <strings.h> instead of <string.h>." >&4
10975 echo "No string header found -- You'll surely have problems." >&4
10980 case "$i_string" in
10981 "$undef") strings=`./findhdr strings.h`;;
10982 *) strings=`./findhdr string.h`;;
10985 : see if this is a sys/file.h system
10990 : do we need to include sys/file.h ?
10994 if $h_sysfile; then
10996 echo "We'll be including <sys/file.h>." >&4
10999 echo "We won't be including <sys/file.h>." >&4
11009 : see if fcntl.h is there
11014 : see if we can include fcntl.h
11020 echo "We'll be including <fcntl.h>." >&4
11023 if $h_sysfile; then
11024 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11026 echo "We won't be including <fcntl.h>." >&4
11038 : check for non-blocking I/O stuff
11039 case "$h_sysfile" in
11040 true) echo "#include <sys/file.h>" > head.c;;
11043 true) echo "#include <fcntl.h>" > head.c;;
11044 *) echo "#include <sys/fcntl.h>" > head.c;;
11049 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11050 case "$o_nonblock" in
11052 $cat head.c > try.c
11053 $cat >>try.c <<EOCP
11055 #include <stdlib.h>
11062 printf("O_NONBLOCK\n");
11066 printf("O_NDELAY\n");
11070 printf("FNDELAY\n");
11077 if eval $compile_ok; then
11078 o_nonblock=`$run ./try`
11079 case "$o_nonblock" in
11080 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11081 *) echo "Seems like we can use $o_nonblock.";;
11084 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11087 *) echo "Using $hint value $o_nonblock.";;
11089 $rm -f try try.* .out core
11092 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11095 $cat head.c > try.c
11096 $cat >>try.c <<EOCP
11098 #include <sys/types.h>
11099 #include <signal.h>
11101 #include <stdlib.h>
11106 #define MY_O_NONBLOCK $o_nonblock
11107 #ifndef errno /* XXX need better Configure test */
11110 #$i_unistd I_UNISTD
11112 #include <unistd.h>
11114 #$i_string I_STRING
11116 #include <string.h>
11118 #include <strings.h>
11120 $signal_t blech(x) int x; { exit(3); }
11122 $cat >> try.c <<'EOCP'
11130 pipe(pd); /* Down: child -> parent */
11131 pipe(pu); /* Up: parent -> child */
11134 close(pd[1]); /* Parent reads from pd[0] */
11135 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11137 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11142 signal(SIGALRM, blech);
11144 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11146 sprintf(string, "%d\n", ret);
11147 write(2, string, strlen(string));
11150 if (errno == EAGAIN) {
11151 printf("EAGAIN\n");
11156 if (errno == EWOULDBLOCK)
11157 printf("EWOULDBLOCK\n");
11160 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11161 sleep(2); /* Give it time to close our pipe */
11163 ret = read(pd[0], buf, 1); /* Should read EOF */
11165 sprintf(string, "%d\n", ret);
11166 write(4, string, strlen(string));
11170 close(pd[0]); /* We write to pd[1] */
11171 close(pu[1]); /* We read from pu[0] */
11172 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11173 close(pd[1]); /* Pipe pd is now fully closed! */
11174 exit(0); /* Bye bye, thank you for playing! */
11178 if eval $compile_ok; then
11179 echo "$startsh" >mtry
11180 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11182 ./mtry >/dev/null 2>&1
11184 0) eagain=`$cat try.out`;;
11185 1) echo "Could not perform non-blocking setting!";;
11186 2) echo "I did a successful read() for something that was not there!";;
11187 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11188 4) echo "Could not find F_SETFL!";;
11189 *) echo "Something terribly wrong happened during testing.";;
11191 rd_nodata=`$cat try.ret`
11192 echo "A read() system call with no data present returns $rd_nodata."
11193 case "$rd_nodata" in
11196 echo "(That's peculiar, fixing that to be -1.)"
11202 echo "Forcing errno EAGAIN on read() with no data available."
11206 echo "Your read() sets errno to $eagain when no data is available."
11209 status=`$cat try.err`
11211 0) echo "And it correctly returns 0 to signal EOF.";;
11212 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11213 *) echo "However, your read() returns '$status' on EOF??";;
11216 if test "$status" = "$rd_nodata"; then
11217 echo "WARNING: you can't distinguish between EOF and no data!"
11221 echo "I can't compile the test program--assuming errno EAGAIN will do."
11228 echo "Using $hint value $eagain."
11229 echo "Your read() returns $rd_nodata when no data is present."
11230 case "$d_eofnblk" in
11231 "$define") echo "And you can see EOF because read() returns 0.";;
11232 "$undef") echo "But you can't see EOF status from read() returned value.";;
11234 echo "(Assuming you can't see EOF status from read anyway.)"
11240 $rm -f try try.* .out core head.c mtry
11242 : see if fchdir exists
11243 set fchdir d_fchdir
11246 : see if fchmod exists
11247 set fchmod d_fchmod
11250 : see if fchown exists
11251 set fchown d_fchown
11254 : see if this is an fcntl system
11259 : See if fcntl-based locking works.
11261 #include <stdlib.h>
11262 #include <unistd.h>
11264 #include <signal.h>
11265 $signal_t blech(x) int x; { exit(3); }
11267 #if defined(F_SETLK) && defined(F_SETLKW)
11268 struct flock flock;
11270 fd = open("try.c", O_RDONLY);
11271 flock.l_type = F_RDLCK;
11272 flock.l_whence = SEEK_SET;
11273 flock.l_start = flock.l_len = 0;
11274 signal(SIGALRM, blech);
11276 retval = fcntl(fd, F_SETLK, &flock);
11278 (retval < 0 ? exit(2) : exit(0));
11284 echo "Checking if fcntl-based file locking works... "
11288 if eval $compile_ok; then
11289 if $run ./try; then
11290 echo "Yes, it seems to work."
11293 echo "Nope, it didn't work."
11298 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
11299 *** This is (almost) impossible.
11300 *** If your NFS lock daemons are not feeling well, something like
11301 *** this may happen, please investigate. Cannot continue, aborting.
11309 echo "I'm unable to compile the test program, so I'll assume not."
11314 echo "Nope, since you don't even have fcntl()."
11317 set d_fcntl_can_lock
11322 : check for fd_set items
11325 Checking to see how well your C compiler handles fd_set and friends ...
11328 #$i_systime I_SYS_TIME
11329 #$i_sysselct I_SYS_SELECT
11330 #$d_socket HAS_SOCKET
11331 #include <sys/types.h>
11333 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
11336 #include <sys/time.h>
11338 #ifdef I_SYS_SELECT
11339 #include <sys/select.h>
11348 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
11356 if eval $compile; then
11357 d_fds_bits="$define"
11359 echo "Well, your system knows about the normal fd_set typedef..." >&4
11360 if $run ./try; then
11361 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
11362 d_fd_macros="$define"
11365 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
11367 d_fd_macros="$undef"
11371 Hmm, your compiler has some difficulty with fd_set. Checking further...
11374 if eval $compile; then
11375 d_fds_bits="$undef"
11377 echo "Well, your system has some sort of fd_set available..." >&4
11378 if $run ./try; then
11379 echo "and you have the normal fd_set macros." >&4
11380 d_fd_macros="$define"
11383 but not the normal fd_set macros! Gross! More work for me...
11385 d_fd_macros="$undef"
11388 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
11390 d_fds_bits="$undef"
11391 d_fd_macros="$undef"
11396 : see if fgetpos exists
11397 set fgetpos d_fgetpos
11400 : see if finite exists
11401 set finite d_finite
11404 : see if finitel exists
11405 set finitel d_finitel
11408 : see if flock exists
11412 : see if prototype for flock is available
11414 set d_flockproto flock $i_sysfile sys/file.h
11417 : see if fork exists
11421 : see if fp_class exists
11422 set fp_class d_fp_class
11425 : see if pathconf exists
11426 set pathconf d_pathconf
11429 : see if fpathconf exists
11430 set fpathconf d_fpathconf
11433 : see if fpclass exists
11434 set fpclass d_fpclass
11437 : see if fpclassify exists
11438 set fpclassify d_fpclassify
11441 : see if fpclassl exists
11442 set fpclassl d_fpclassl
11446 : check for fpos64_t
11448 echo "Checking to see if you have fpos64_t..." >&4
11451 int main() { fpos64_t x = 7; }
11454 if eval $compile; then
11456 echo "You have fpos64_t."
11459 echo "You do not have fpos64_t."
11460 case "$fpossize" in
11461 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
11468 : see if frexpl exists
11469 set frexpl d_frexpl
11472 : see if this is a sys/param system
11473 set sys/param.h i_sysparam
11476 : see if this is a sys/mount.h system
11477 set sys/mount.h i_sysmount
11482 echo "Checking to see if your system supports struct fs_data..." >&4
11483 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
11485 case "$d_fs_data_s" in
11486 "$define") echo "Yes, it does." ;;
11487 *) echo "No, it doesn't." ;;
11490 : see if fseeko exists
11491 set fseeko d_fseeko
11493 case "$longsize" in
11494 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
11497 : see if fsetpos exists
11498 set fsetpos d_fsetpos
11502 : see if fstatfs exists
11503 set fstatfs d_fstatfs
11507 : see if statvfs exists
11508 set statvfs d_statvfs
11511 : see if fstatvfs exists
11512 set fstatvfs d_fstatvfs
11516 : see if fsync exists
11520 : see if ftello exists
11521 set ftello d_ftello
11523 case "$longsize" in
11524 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
11527 : see if getcwd exists
11528 set getcwd d_getcwd
11531 : see if getespwnam exists
11532 set getespwnam d_getespwnam
11536 : see if getfsstat exists
11537 set getfsstat d_getfsstat
11540 : see if getgrent exists
11541 set getgrent d_getgrent
11544 : see if getgrent_r exists
11545 set getgrent_r d_getgrent_r
11547 case "$d_getgrent_r" in
11549 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11550 case "$d_getgrent_r_proto:$usethreads" in
11551 ":define") d_getgrent_r_proto=define
11552 set d_getgrent_r_proto getgrent_r $hdrs
11556 case "$d_getgrent_r_proto" in
11558 case "$getgrent_r_proto" in
11559 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
11560 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
11562 case "$getgrent_r_proto" in
11563 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
11564 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
11566 case "$getgrent_r_proto" in
11567 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
11568 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
11570 case "$getgrent_r_proto" in
11571 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
11572 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
11574 case "$getgrent_r_proto" in
11575 ''|0) try='int getgrent_r(struct group*, char*, int);'
11576 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
11578 case "$getgrent_r_proto" in
11579 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
11580 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
11582 case "$getgrent_r_proto" in
11583 ''|0) d_getgrent_r=undef
11585 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
11586 * ) case "$getgrent_r_proto" in
11587 REENTRANT_PROTO*) ;;
11588 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
11590 echo "Prototype: $try" ;;
11593 *) case "$usethreads" in
11594 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
11601 *) getgrent_r_proto=0
11605 : see if getgrgid_r exists
11606 set getgrgid_r d_getgrgid_r
11608 case "$d_getgrgid_r" in
11610 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11611 case "$d_getgrgid_r_proto:$usethreads" in
11612 ":define") d_getgrgid_r_proto=define
11613 set d_getgrgid_r_proto getgrgid_r $hdrs
11617 case "$d_getgrgid_r_proto" in
11619 case "$getgrgid_r_proto" in
11620 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
11621 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
11623 case "$getgrgid_r_proto" in
11624 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
11625 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
11627 case "$getgrgid_r_proto" in
11628 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
11629 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
11631 case "$getgrgid_r_proto" in
11632 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
11633 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
11635 case "$getgrgid_r_proto" in
11636 ''|0) d_getgrgid_r=undef
11638 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
11639 * ) case "$getgrgid_r_proto" in
11640 REENTRANT_PROTO*) ;;
11641 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
11643 echo "Prototype: $try" ;;
11646 *) case "$usethreads" in
11647 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
11654 *) getgrgid_r_proto=0
11658 : see if getgrnam_r exists
11659 set getgrnam_r d_getgrnam_r
11661 case "$d_getgrnam_r" in
11663 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11664 case "$d_getgrnam_r_proto:$usethreads" in
11665 ":define") d_getgrnam_r_proto=define
11666 set d_getgrnam_r_proto getgrnam_r $hdrs
11670 case "$d_getgrnam_r_proto" in
11672 case "$getgrnam_r_proto" in
11673 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
11674 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
11676 case "$getgrnam_r_proto" in
11677 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
11678 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
11680 case "$getgrnam_r_proto" in
11681 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
11682 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
11684 case "$getgrnam_r_proto" in
11685 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
11686 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
11688 case "$getgrnam_r_proto" in
11689 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
11690 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
11692 case "$getgrnam_r_proto" in
11693 ''|0) d_getgrnam_r=undef
11695 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
11696 * ) case "$getgrnam_r_proto" in
11697 REENTRANT_PROTO*) ;;
11698 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
11700 echo "Prototype: $try" ;;
11703 *) case "$usethreads" in
11704 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
11711 *) getgrnam_r_proto=0
11715 : see if gethostbyaddr exists
11716 set gethostbyaddr d_gethbyaddr
11719 : see if gethostbyname exists
11720 set gethostbyname d_gethbyname
11723 : see if gethostent exists
11724 set gethostent d_gethent
11727 : see how we will look up host name
11730 if set gethostname val -f d_gethname; eval $csym; $val; then
11731 echo 'gethostname() found.' >&4
11732 d_gethname="$define"
11735 if set uname val -f d_uname; eval $csym; $val; then
11738 uname() was found, but you're running xenix, and older versions of xenix
11739 have a broken uname(). If you don't really know whether your xenix is old
11740 enough to have a broken system call, use the default answer.
11745 "$define") dflt=n;;
11747 rp='Is your uname() broken?'
11750 n*) d_uname="$define"; call=uname;;
11753 echo 'uname() found.' >&4
11760 case "$d_gethname" in
11761 '') d_gethname="$undef";;
11764 '') d_uname="$undef";;
11766 case "$d_uname$d_gethname" in
11771 Every now and then someone has a $call() that lies about the hostname
11772 but can't be fixed for political or economic reasons. If you wish, I can
11773 pretend $call() isn't there and maybe compute hostname at run-time
11774 thanks to the '$phostname' command.
11777 rp="Shall I ignore $call() from now on?"
11780 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
11783 case "$phostname" in
11784 '') aphostname='';;
11785 *) case "$aphostname" in
11787 *) set X $phostname
11791 file=`./loc $file $file $pth`
11792 aphostname=`echo $file $*`
11797 case "$d_uname$d_gethname" in
11800 case "$phostname" in
11802 echo "There will be no way for $package to get your hostname." >&4;;
11804 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
11808 case "$d_phostname" in
11809 '') d_phostname="$undef";;
11812 : see if gethostbyaddr_r exists
11813 set gethostbyaddr_r d_gethostbyaddr_r
11815 case "$d_gethostbyaddr_r" in
11817 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11818 case "$d_gethostbyaddr_r_proto:$usethreads" in
11819 ":define") d_gethostbyaddr_r_proto=define
11820 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
11824 case "$d_gethostbyaddr_r_proto" in
11826 case "$gethostbyaddr_r_proto" in
11827 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
11828 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
11830 case "$gethostbyaddr_r_proto" in
11831 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
11832 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
11834 case "$gethostbyaddr_r_proto" in
11835 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
11836 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
11838 case "$gethostbyaddr_r_proto" in
11839 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
11840 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
11842 case "$gethostbyaddr_r_proto" in
11843 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
11844 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
11846 case "$gethostbyaddr_r_proto" in
11847 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
11848 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
11850 case "$gethostbyaddr_r_proto" in
11851 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
11852 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
11854 case "$gethostbyaddr_r_proto" in
11855 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
11856 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
11858 case "$gethostbyaddr_r_proto" in
11859 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
11860 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
11862 case "$gethostbyaddr_r_proto" in
11863 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
11864 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
11866 case "$gethostbyaddr_r_proto" in
11867 ''|0) d_gethostbyaddr_r=undef
11868 gethostbyaddr_r_proto=0
11869 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
11870 * ) case "$gethostbyaddr_r_proto" in
11871 REENTRANT_PROTO*) ;;
11872 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
11874 echo "Prototype: $try" ;;
11877 *) case "$usethreads" in
11878 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
11880 d_gethostbyaddr_r=undef
11881 gethostbyaddr_r_proto=0
11885 *) gethostbyaddr_r_proto=0
11889 : see if gethostbyname_r exists
11890 set gethostbyname_r d_gethostbyname_r
11892 case "$d_gethostbyname_r" in
11894 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11895 case "$d_gethostbyname_r_proto:$usethreads" in
11896 ":define") d_gethostbyname_r_proto=define
11897 set d_gethostbyname_r_proto gethostbyname_r $hdrs
11901 case "$d_gethostbyname_r_proto" in
11903 case "$gethostbyname_r_proto" in
11904 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
11905 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
11907 case "$gethostbyname_r_proto" in
11908 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
11909 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
11911 case "$gethostbyname_r_proto" in
11912 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
11913 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
11915 case "$gethostbyname_r_proto" in
11916 ''|0) d_gethostbyname_r=undef
11917 gethostbyname_r_proto=0
11918 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
11919 * ) case "$gethostbyname_r_proto" in
11920 REENTRANT_PROTO*) ;;
11921 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
11923 echo "Prototype: $try" ;;
11926 *) case "$usethreads" in
11927 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
11929 d_gethostbyname_r=undef
11930 gethostbyname_r_proto=0
11934 *) gethostbyname_r_proto=0
11938 : see if gethostent_r exists
11939 set gethostent_r d_gethostent_r
11941 case "$d_gethostent_r" in
11943 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11944 case "$d_gethostent_r_proto:$usethreads" in
11945 ":define") d_gethostent_r_proto=define
11946 set d_gethostent_r_proto gethostent_r $hdrs
11950 case "$d_gethostent_r_proto" in
11952 case "$gethostent_r_proto" in
11953 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
11954 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
11956 case "$gethostent_r_proto" in
11957 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
11958 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
11960 case "$gethostent_r_proto" in
11961 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
11962 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
11964 case "$gethostent_r_proto" in
11965 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
11966 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
11968 case "$gethostent_r_proto" in
11969 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
11970 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
11972 case "$gethostent_r_proto" in
11973 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
11974 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
11976 case "$gethostent_r_proto" in
11977 ''|0) d_gethostent_r=undef
11978 gethostent_r_proto=0
11979 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
11980 * ) case "$gethostent_r_proto" in
11981 REENTRANT_PROTO*) ;;
11982 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
11984 echo "Prototype: $try" ;;
11987 *) case "$usethreads" in
11988 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
11990 d_gethostent_r=undef
11991 gethostent_r_proto=0
11995 *) gethostent_r_proto=0
11999 : see if prototypes for various gethostxxx netdb.h functions are available
12001 set d_gethostprotos gethostent $i_netdb netdb.h
12004 : see if getitimer exists
12005 set getitimer d_getitimer
12008 : see if getlogin exists
12009 set getlogin d_getlogin
12012 : see if getlogin_r exists
12013 set getlogin_r d_getlogin_r
12015 case "$d_getlogin_r" in
12017 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
12018 case "$d_getlogin_r_proto:$usethreads" in
12019 ":define") d_getlogin_r_proto=define
12020 set d_getlogin_r_proto getlogin_r $hdrs
12024 case "$d_getlogin_r_proto" in
12026 case "$getlogin_r_proto" in
12027 ''|0) try='int getlogin_r(char*, size_t);'
12028 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
12030 case "$getlogin_r_proto" in
12031 ''|0) try='int getlogin_r(char*, int);'
12032 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
12034 case "$getlogin_r_proto" in
12035 ''|0) try='char* getlogin_r(char*, size_t);'
12036 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
12038 case "$getlogin_r_proto" in
12039 ''|0) try='char* getlogin_r(char*, int);'
12040 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
12042 case "$getlogin_r_proto" in
12043 ''|0) d_getlogin_r=undef
12045 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
12046 * ) case "$getlogin_r_proto" in
12047 REENTRANT_PROTO*) ;;
12048 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
12050 echo "Prototype: $try" ;;
12053 *) case "$usethreads" in
12054 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
12061 *) getlogin_r_proto=0
12065 : see if getmnt exists
12066 set getmnt d_getmnt
12069 : see if getmntent exists
12070 set getmntent d_getmntent
12073 : see if getnetbyaddr exists
12074 set getnetbyaddr d_getnbyaddr
12077 : see if getnetbyname exists
12078 set getnetbyname d_getnbyname
12081 : see if getnetent exists
12082 set getnetent d_getnent
12085 : see if getnetbyaddr_r exists
12086 set getnetbyaddr_r d_getnetbyaddr_r
12088 case "$d_getnetbyaddr_r" in
12090 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12091 case "$d_getnetbyaddr_r_proto:$usethreads" in
12092 ":define") d_getnetbyaddr_r_proto=define
12093 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
12097 case "$d_getnetbyaddr_r_proto" in
12099 case "$getnetbyaddr_r_proto" in
12100 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
12101 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
12103 case "$getnetbyaddr_r_proto" in
12104 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
12105 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
12107 case "$getnetbyaddr_r_proto" in
12108 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
12109 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
12111 case "$getnetbyaddr_r_proto" in
12112 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
12113 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
12115 case "$getnetbyaddr_r_proto" in
12116 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
12117 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
12119 case "$getnetbyaddr_r_proto" in
12120 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
12121 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
12123 case "$getnetbyaddr_r_proto" in
12124 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
12125 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
12127 case "$getnetbyaddr_r_proto" in
12128 ''|0) d_getnetbyaddr_r=undef
12129 getnetbyaddr_r_proto=0
12130 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
12131 * ) case "$getnetbyaddr_r_proto" in
12132 REENTRANT_PROTO*) ;;
12133 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
12135 echo "Prototype: $try" ;;
12138 *) case "$usethreads" in
12139 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
12141 d_getnetbyaddr_r=undef
12142 getnetbyaddr_r_proto=0
12146 *) getnetbyaddr_r_proto=0
12150 : see if getnetbyname_r exists
12151 set getnetbyname_r d_getnetbyname_r
12153 case "$d_getnetbyname_r" in
12155 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12156 case "$d_getnetbyname_r_proto:$usethreads" in
12157 ":define") d_getnetbyname_r_proto=define
12158 set d_getnetbyname_r_proto getnetbyname_r $hdrs
12162 case "$d_getnetbyname_r_proto" in
12164 case "$getnetbyname_r_proto" in
12165 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
12166 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
12168 case "$getnetbyname_r_proto" in
12169 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
12170 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
12172 case "$getnetbyname_r_proto" in
12173 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
12174 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
12176 case "$getnetbyname_r_proto" in
12177 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
12178 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
12180 case "$getnetbyname_r_proto" in
12181 ''|0) d_getnetbyname_r=undef
12182 getnetbyname_r_proto=0
12183 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
12184 * ) case "$getnetbyname_r_proto" in
12185 REENTRANT_PROTO*) ;;
12186 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
12188 echo "Prototype: $try" ;;
12191 *) case "$usethreads" in
12192 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
12194 d_getnetbyname_r=undef
12195 getnetbyname_r_proto=0
12199 *) getnetbyname_r_proto=0
12203 : see if getnetent_r exists
12204 set getnetent_r d_getnetent_r
12206 case "$d_getnetent_r" in
12208 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12209 case "$d_getnetent_r_proto:$usethreads" in
12210 ":define") d_getnetent_r_proto=define
12211 set d_getnetent_r_proto getnetent_r $hdrs
12215 case "$d_getnetent_r_proto" in
12217 case "$getnetent_r_proto" in
12218 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
12219 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
12221 case "$getnetent_r_proto" in
12222 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
12223 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
12225 case "$getnetent_r_proto" in
12226 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
12227 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
12229 case "$getnetent_r_proto" in
12230 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
12231 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
12233 case "$getnetent_r_proto" in
12234 ''|0) try='int getnetent_r(struct netent*, char*, int);'
12235 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
12237 case "$getnetent_r_proto" in
12238 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
12239 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
12241 case "$getnetent_r_proto" in
12242 ''|0) d_getnetent_r=undef
12243 getnetent_r_proto=0
12244 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
12245 * ) case "$getnetent_r_proto" in
12246 REENTRANT_PROTO*) ;;
12247 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
12249 echo "Prototype: $try" ;;
12252 *) case "$usethreads" in
12253 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
12255 d_getnetent_r=undef
12256 getnetent_r_proto=0
12260 *) getnetent_r_proto=0
12264 : see if prototypes for various getnetxxx netdb.h functions are available
12266 set d_getnetprotos getnetent $i_netdb netdb.h
12269 : see if getpagesize exists
12270 set getpagesize d_getpagsz
12274 : see if getprotobyname exists
12275 set getprotobyname d_getpbyname
12278 : see if getprotobynumber exists
12279 set getprotobynumber d_getpbynumber
12282 : see if getprotoent exists
12283 set getprotoent d_getpent
12286 : see if getpgid exists
12287 set getpgid d_getpgid
12290 : see if getpgrp2 exists
12291 set getpgrp2 d_getpgrp2
12294 : see if getppid exists
12295 set getppid d_getppid
12298 : see if getpriority exists
12299 set getpriority d_getprior
12302 : see if getprotobyname_r exists
12303 set getprotobyname_r d_getprotobyname_r
12305 case "$d_getprotobyname_r" in
12307 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12308 case "$d_getprotobyname_r_proto:$usethreads" in
12309 ":define") d_getprotobyname_r_proto=define
12310 set d_getprotobyname_r_proto getprotobyname_r $hdrs
12314 case "$d_getprotobyname_r_proto" in
12316 case "$getprotobyname_r_proto" in
12317 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
12318 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
12320 case "$getprotobyname_r_proto" in
12321 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
12322 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
12324 case "$getprotobyname_r_proto" in
12325 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
12326 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
12328 case "$getprotobyname_r_proto" in
12329 ''|0) d_getprotobyname_r=undef
12330 getprotobyname_r_proto=0
12331 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
12332 * ) case "$getprotobyname_r_proto" in
12333 REENTRANT_PROTO*) ;;
12334 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
12336 echo "Prototype: $try" ;;
12339 *) case "$usethreads" in
12340 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
12342 d_getprotobyname_r=undef
12343 getprotobyname_r_proto=0
12347 *) getprotobyname_r_proto=0
12351 : see if getprotobynumber_r exists
12352 set getprotobynumber_r d_getprotobynumber_r
12354 case "$d_getprotobynumber_r" in
12356 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12357 case "$d_getprotobynumber_r_proto:$usethreads" in
12358 ":define") d_getprotobynumber_r_proto=define
12359 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
12363 case "$d_getprotobynumber_r_proto" in
12365 case "$getprotobynumber_r_proto" in
12366 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
12367 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
12369 case "$getprotobynumber_r_proto" in
12370 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
12371 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
12373 case "$getprotobynumber_r_proto" in
12374 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
12375 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
12377 case "$getprotobynumber_r_proto" in
12378 ''|0) d_getprotobynumber_r=undef
12379 getprotobynumber_r_proto=0
12380 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
12381 * ) case "$getprotobynumber_r_proto" in
12382 REENTRANT_PROTO*) ;;
12383 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
12385 echo "Prototype: $try" ;;
12388 *) case "$usethreads" in
12389 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
12391 d_getprotobynumber_r=undef
12392 getprotobynumber_r_proto=0
12396 *) getprotobynumber_r_proto=0
12400 : see if getprotoent_r exists
12401 set getprotoent_r d_getprotoent_r
12403 case "$d_getprotoent_r" in
12405 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12406 case "$d_getprotoent_r_proto:$usethreads" in
12407 ":define") d_getprotoent_r_proto=define
12408 set d_getprotoent_r_proto getprotoent_r $hdrs
12412 case "$d_getprotoent_r_proto" in
12414 case "$getprotoent_r_proto" in
12415 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
12416 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
12418 case "$getprotoent_r_proto" in
12419 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
12420 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
12422 case "$getprotoent_r_proto" in
12423 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
12424 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
12426 case "$getprotoent_r_proto" in
12427 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
12428 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
12430 case "$getprotoent_r_proto" in
12431 ''|0) d_getprotoent_r=undef
12432 getprotoent_r_proto=0
12433 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
12434 * ) case "$getprotoent_r_proto" in
12435 REENTRANT_PROTO*) ;;
12436 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
12438 echo "Prototype: $try" ;;
12441 *) case "$usethreads" in
12442 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
12444 d_getprotoent_r=undef
12445 getprotoent_r_proto=0
12449 *) getprotoent_r_proto=0
12453 : see if prototypes for various getprotoxxx netdb.h functions are available
12455 set d_getprotoprotos getprotoent $i_netdb netdb.h
12458 : see if getprpwnam exists
12459 set getprpwnam d_getprpwnam
12462 : see if getpwent exists
12463 set getpwent d_getpwent
12466 : see if getpwent_r exists
12467 set getpwent_r d_getpwent_r
12469 case "$d_getpwent_r" in
12471 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12472 case "$d_getpwent_r_proto:$usethreads" in
12473 ":define") d_getpwent_r_proto=define
12474 set d_getpwent_r_proto getpwent_r $hdrs
12478 case "$d_getpwent_r_proto" in
12480 case "$getpwent_r_proto" in
12481 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
12482 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
12484 case "$getpwent_r_proto" in
12485 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
12486 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
12488 case "$getpwent_r_proto" in
12489 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
12490 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
12492 case "$getpwent_r_proto" in
12493 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
12494 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
12496 case "$getpwent_r_proto" in
12497 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
12498 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
12500 case "$getpwent_r_proto" in
12501 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
12502 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
12504 case "$getpwent_r_proto" in
12505 ''|0) d_getpwent_r=undef
12507 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
12508 * ) case "$getpwent_r_proto" in
12509 REENTRANT_PROTO*) ;;
12510 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
12512 echo "Prototype: $try" ;;
12515 *) case "$usethreads" in
12516 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
12523 *) getpwent_r_proto=0
12527 : see if getpwnam_r exists
12528 set getpwnam_r d_getpwnam_r
12530 case "$d_getpwnam_r" in
12532 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12533 case "$d_getpwnam_r_proto:$usethreads" in
12534 ":define") d_getpwnam_r_proto=define
12535 set d_getpwnam_r_proto getpwnam_r $hdrs
12539 case "$d_getpwnam_r_proto" in
12541 case "$getpwnam_r_proto" in
12542 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
12543 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
12545 case "$getpwnam_r_proto" in
12546 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
12547 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
12549 case "$getpwnam_r_proto" in
12550 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
12551 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
12553 case "$getpwnam_r_proto" in
12554 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
12555 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
12557 case "$getpwnam_r_proto" in
12558 ''|0) d_getpwnam_r=undef
12560 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
12561 * ) case "$getpwnam_r_proto" in
12562 REENTRANT_PROTO*) ;;
12563 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
12565 echo "Prototype: $try" ;;
12568 *) case "$usethreads" in
12569 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
12576 *) getpwnam_r_proto=0
12580 : see if getpwuid_r exists
12581 set getpwuid_r d_getpwuid_r
12583 case "$d_getpwuid_r" in
12585 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12586 case "$d_getpwuid_r_proto:$usethreads" in
12587 ":define") d_getpwuid_r_proto=define
12588 set d_getpwuid_r_proto getpwuid_r $hdrs
12592 case "$d_getpwuid_r_proto" in
12594 case "$getpwuid_r_proto" in
12595 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
12596 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
12598 case "$getpwuid_r_proto" in
12599 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
12600 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
12602 case "$getpwuid_r_proto" in
12603 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
12604 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
12606 case "$getpwuid_r_proto" in
12607 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
12608 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
12610 case "$getpwuid_r_proto" in
12611 ''|0) d_getpwuid_r=undef
12613 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
12614 * ) case "$getpwuid_r_proto" in
12615 REENTRANT_PROTO*) ;;
12616 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
12618 echo "Prototype: $try" ;;
12621 *) case "$usethreads" in
12622 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
12629 *) getpwuid_r_proto=0
12634 : see if getservbyname exists
12635 set getservbyname d_getsbyname
12638 : see if getservbyport exists
12639 set getservbyport d_getsbyport
12642 : see if getservent exists
12643 set getservent d_getsent
12646 : see if getservbyname_r exists
12647 set getservbyname_r d_getservbyname_r
12649 case "$d_getservbyname_r" in
12651 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12652 case "$d_getservbyname_r_proto:$usethreads" in
12653 ":define") d_getservbyname_r_proto=define
12654 set d_getservbyname_r_proto getservbyname_r $hdrs
12658 case "$d_getservbyname_r_proto" in
12660 case "$getservbyname_r_proto" in
12661 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
12662 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
12664 case "$getservbyname_r_proto" in
12665 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
12666 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
12668 case "$getservbyname_r_proto" in
12669 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
12670 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
12672 case "$getservbyname_r_proto" in
12673 ''|0) d_getservbyname_r=undef
12674 getservbyname_r_proto=0
12675 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
12676 * ) case "$getservbyname_r_proto" in
12677 REENTRANT_PROTO*) ;;
12678 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
12680 echo "Prototype: $try" ;;
12683 *) case "$usethreads" in
12684 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
12686 d_getservbyname_r=undef
12687 getservbyname_r_proto=0
12691 *) getservbyname_r_proto=0
12695 : see if getservbyport_r exists
12696 set getservbyport_r d_getservbyport_r
12698 case "$d_getservbyport_r" in
12700 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12701 case "$d_getservbyport_r_proto:$usethreads" in
12702 ":define") d_getservbyport_r_proto=define
12703 set d_getservbyport_r_proto getservbyport_r $hdrs
12707 case "$d_getservbyport_r_proto" in
12709 case "$getservbyport_r_proto" in
12710 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
12711 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
12713 case "$getservbyport_r_proto" in
12714 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
12715 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
12717 case "$getservbyport_r_proto" in
12718 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
12719 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
12721 case "$getservbyport_r_proto" in
12722 ''|0) d_getservbyport_r=undef
12723 getservbyport_r_proto=0
12724 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
12725 * ) case "$getservbyport_r_proto" in
12726 REENTRANT_PROTO*) ;;
12727 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
12729 echo "Prototype: $try" ;;
12732 *) case "$usethreads" in
12733 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
12735 d_getservbyport_r=undef
12736 getservbyport_r_proto=0
12740 *) getservbyport_r_proto=0
12744 : see if getservent_r exists
12745 set getservent_r d_getservent_r
12747 case "$d_getservent_r" in
12749 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12750 case "$d_getservent_r_proto:$usethreads" in
12751 ":define") d_getservent_r_proto=define
12752 set d_getservent_r_proto getservent_r $hdrs
12756 case "$d_getservent_r_proto" in
12758 case "$getservent_r_proto" in
12759 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
12760 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
12762 case "$getservent_r_proto" in
12763 ''|0) try='int getservent_r(struct servent*, char*, int);'
12764 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
12766 case "$getservent_r_proto" in
12767 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
12768 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
12770 case "$getservent_r_proto" in
12771 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
12772 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
12774 case "$getservent_r_proto" in
12775 ''|0) d_getservent_r=undef
12776 getservent_r_proto=0
12777 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
12778 * ) case "$getservent_r_proto" in
12779 REENTRANT_PROTO*) ;;
12780 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
12782 echo "Prototype: $try" ;;
12785 *) case "$usethreads" in
12786 define) echo "getservent_r has no prototype, not using it." >&4 ;;
12788 d_getservent_r=undef
12789 getservent_r_proto=0
12793 *) getservent_r_proto=0
12797 : see if prototypes for various getservxxx netdb.h functions are available
12799 set d_getservprotos getservent $i_netdb netdb.h
12802 : see if getspnam exists
12803 set getspnam d_getspnam
12806 : see if this is a shadow.h system
12807 set shadow.h i_shadow
12810 : see if getspnam_r exists
12811 set getspnam_r d_getspnam_r
12813 case "$d_getspnam_r" in
12815 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
12816 case "$d_getspnam_r_proto:$usethreads" in
12817 ":define") d_getspnam_r_proto=define
12818 set d_getspnam_r_proto getspnam_r $hdrs
12822 case "$d_getspnam_r_proto" in
12824 case "$getspnam_r_proto" in
12825 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
12826 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
12828 case "$getspnam_r_proto" in
12829 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
12830 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
12832 case "$getspnam_r_proto" in
12833 ''|0) d_getspnam_r=undef
12835 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
12836 * ) case "$getspnam_r_proto" in
12837 REENTRANT_PROTO*) ;;
12838 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
12840 echo "Prototype: $try" ;;
12843 *) case "$usethreads" in
12844 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
12851 *) getspnam_r_proto=0
12855 : see if gettimeofday or ftime exists
12856 set gettimeofday d_gettimeod
12858 case "$d_gettimeod" in
12864 val="$undef"; set d_ftime; eval $setvar
12867 case "$d_gettimeod$d_ftime" in
12870 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
12874 : see if gmtime_r exists
12875 set gmtime_r d_gmtime_r
12877 case "$d_gmtime_r" in
12879 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12880 case "$d_gmtime_r_proto:$usethreads" in
12881 ":define") d_gmtime_r_proto=define
12882 set d_gmtime_r_proto gmtime_r $hdrs
12886 case "$d_gmtime_r_proto" in
12888 case "$gmtime_r_proto" in
12889 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
12890 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
12892 case "$gmtime_r_proto" in
12893 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
12894 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
12896 case "$gmtime_r_proto" in
12897 ''|0) d_gmtime_r=undef
12899 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
12900 * ) case "$gmtime_r_proto" in
12901 REENTRANT_PROTO*) ;;
12902 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
12904 echo "Prototype: $try" ;;
12907 *) case "$usethreads" in
12908 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
12915 *) gmtime_r_proto=0
12919 : see if hasmntopt exists
12920 set hasmntopt d_hasmntopt
12923 : see if this is a netinet/in.h or sys/in.h system
12924 set netinet/in.h i_niin sys/in.h i_sysin
12927 : see if arpa/inet.h has to be included
12928 set arpa/inet.h i_arpainet
12931 : see if htonl --and friends-- exists
12936 : Maybe they are macros.
12939 $cat >htonl.c <<EOM
12941 #include <sys/types.h>
12942 #$i_niin I_NETINET_IN
12944 #$i_arpainet I_ARPA_INET
12945 #ifdef I_NETINET_IN
12946 #include <netinet/in.h>
12949 #include <sys/in.h>
12952 #include <arpa/inet.h>
12955 printf("Defined as a macro.");
12958 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
12959 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
12961 echo "But it seems to be defined as a macro." >&4
12971 if set index val -f; eval $csym; $val; then
12972 if set strchr val -f d_strchr; eval $csym; $val; then
12973 if $contains strchr "$strings" >/dev/null 2>&1 ; then
12976 echo "strchr() found." >&4
12980 echo "index() found." >&4
12985 echo "index() found." >&4
12988 if set strchr val -f d_strchr; eval $csym; $val; then
12991 echo "strchr() found." >&4
12993 echo "No index() or strchr() found!" >&4
12998 set d_strchr; eval $setvar
13000 set d_index; eval $setvar
13002 : check whether inet_aton exists
13003 set inet_aton d_inetaton
13008 $cat >isascii.c <<'EOCP'
13020 if eval $compile; then
13021 echo "isascii() found." >&4
13024 echo "isascii() NOT found." >&4
13031 : see if isfinite exists
13032 set isfinite d_isfinite
13035 : see if isinf exists
13039 : see if isnan exists
13043 : see if isnanl exists
13044 set isnanl d_isnanl
13047 : see if killpg exists
13048 set killpg d_killpg
13051 : see if lchown exists
13053 $cat > try.c <<'EOCP'
13054 /* System header to define __stub macros and hopefully few prototypes,
13055 which can conflict with char lchown(); below. */
13056 #include <assert.h>
13057 /* Override any gcc2 internal prototype to avoid an error. */
13058 /* We use char because int might match the return type of a gcc2
13059 builtin and then its argument prototype would still apply. */
13062 /* The GNU C library defines this for functions which it implements
13063 to always fail with ENOSYS. Some functions are actually named
13064 something starting with __ and the normal name is an alias. */
13065 #if defined (__stub_lchown) || defined (__stub___lchown)
13073 if eval $compile; then
13074 $echo "lchown() found." >&4
13077 $echo "lchown() NOT found." >&4
13083 : See if number of significant digits in a double precision number is known
13085 $cat >ldbl_dig.c <<EOM
13086 #$i_limits I_LIMITS
13089 #include <limits.h>
13095 printf("Contains LDBL_DIG");
13098 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
13099 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
13100 echo "LDBL_DIG found." >&4
13103 echo "LDBL_DIG NOT found." >&4
13110 : see if link exists
13114 : see if localtime_r exists
13115 set localtime_r d_localtime_r
13117 case "$d_localtime_r" in
13119 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13120 case "$d_localtime_r_proto:$usethreads" in
13121 ":define") d_localtime_r_proto=define
13122 set d_localtime_r_proto localtime_r $hdrs
13126 case "$d_localtime_r_proto" in
13128 case "$localtime_r_proto" in
13129 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
13130 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
13132 case "$localtime_r_proto" in
13133 ''|0) try='int localtime_r(const time_t*, struct tm*);'
13134 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
13136 case "$localtime_r_proto" in
13137 ''|0) d_localtime_r=undef
13138 localtime_r_proto=0
13139 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
13140 * ) case "$localtime_r_proto" in
13141 REENTRANT_PROTO*) ;;
13142 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
13144 echo "Prototype: $try" ;;
13147 *) case "$usethreads" in
13148 define) echo "localtime_r has no prototype, not using it." >&4 ;;
13150 d_localtime_r=undef
13151 localtime_r_proto=0
13155 *) localtime_r_proto=0
13159 : see if localeconv exists
13160 set localeconv d_locconv
13163 : see if lockf exists
13167 : see if prototype for lseek is available
13169 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
13172 : see if lstat exists
13176 : see if madvise exists
13177 set madvise d_madvise
13180 : see if mblen exists
13184 : see if mbstowcs exists
13185 set mbstowcs d_mbstowcs
13188 : see if mbtowc exists
13189 set mbtowc d_mbtowc
13192 : see if memchr exists
13193 set memchr d_memchr
13196 : see if memcmp exists
13197 set memcmp d_memcmp
13200 : see if memcpy exists
13201 set memcpy d_memcpy
13204 : see if memmove exists
13205 set memmove d_memmove
13208 : see if memset exists
13209 set memset d_memset
13212 : see if mkdir exists
13216 : see if mkdtemp exists
13217 set mkdtemp d_mkdtemp
13220 : see if mkfifo exists
13221 set mkfifo d_mkfifo
13224 : see if mkstemp exists
13225 set mkstemp d_mkstemp
13228 : see if mkstemps exists
13229 set mkstemps d_mkstemps
13232 : see if mktime exists
13233 set mktime d_mktime
13236 : see if this is a sys/mman.h system
13237 set sys/mman.h i_sysmman
13240 : see if mmap exists
13243 : see what shmat returns
13244 : default to something harmless
13246 case "$i_sysmman$d_mmap" in
13248 $cat >mmap.c <<'END'
13249 #include <sys/mman.h>
13252 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
13257 echo "and it returns ($mmaptype)." >&4
13263 : see if mprotect exists
13264 set mprotect d_mprotect
13267 : see if msgctl exists
13268 set msgctl d_msgctl
13271 : see if msgget exists
13272 set msgget d_msgget
13275 : see if msgsnd exists
13276 set msgsnd d_msgsnd
13279 : see if msgrcv exists
13280 set msgrcv d_msgrcv
13283 : see how much of the 'msg*(2)' library is present.
13286 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
13287 *"$undef"*) h_msg=false;;
13291 case "`ipcs 2>&1`" in
13292 "SVID messages"*"not configured"*)
13293 echo "Your $osname does not have the msg*(2) configured." >&4
13296 set msgctl d_msgctl
13298 set msgget d_msgget
13300 set msgsnd d_msgsnd
13302 set msgrcv d_msgrcv
13308 : we could also check for sys/ipc.h ...
13309 if $h_msg && $test `./findhdr sys/msg.h`; then
13310 echo "You have the full msg*(2) library." >&4
13313 echo "You don't have the full msg*(2) library." >&4
13321 echo "Checking to see if your system supports struct msghdr..." >&4
13322 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
13324 case "$d_msghdr_s" in
13325 "$define") echo "Yes, it does." ;;
13326 *) echo "No, it doesn't." ;;
13330 : see if msync exists
13334 : see if munmap exists
13335 set munmap d_munmap
13338 : see if nice exists
13342 : see if this is a langinfo.h system
13343 set langinfo.h i_langinfo
13346 : see if nl_langinfo exists
13347 set nl_langinfo d_nl_langinfo
13350 : check for length of character
13352 case "$charsize" in
13354 echo "Checking to see how big your characters are (hey, you never know)..." >&4
13355 $cat >try.c <<'EOCP'
13359 printf("%d\n", (int)sizeof(char));
13364 if eval $compile_ok; then
13368 echo "(I can't seem to compile the test program. Guessing...)"
13375 rp="What is the size of a character (in bytes)?"
13380 : check for volatile keyword
13382 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
13383 $cat >try.c <<'EOCP'
13386 typedef struct _goo_struct goo_struct;
13387 goo_struct * volatile goo = ((goo_struct *)0);
13388 struct _goo_struct {
13393 typedef unsigned short foo_t;
13394 char *volatile foo;
13396 volatile foo_t blech;
13400 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
13402 echo "Yup, it does."
13405 echo "Nope, it doesn't."
13413 $echo "Choosing the C types to be used for Perl's internal types..." >&4
13415 case "$use64bitint:$d_quad:$quadtype" in
13418 uvtype="$uquadtype"
13423 uvtype="unsigned long"
13429 case "$uselongdouble:$d_longdbl" in
13431 nvtype="long double"
13432 nvsize=$longdblsize
13439 $echo "(IV will be "$ivtype", $ivsize bytes)"
13440 $echo "(UV will be "$uvtype", $uvsize bytes)"
13441 $echo "(NV will be "$nvtype", $nvsize bytes)"
13444 #$i_inttypes I_INTTYPES
13446 #include <inttypes.h>
13451 int8_t i = INT8_MAX;
13452 uint8_t u = UINT8_MAX;
13453 printf("int8_t\n");
13456 int16_t i = INT16_MAX;
13457 uint16_t i = UINT16_MAX;
13458 printf("int16_t\n");
13461 int32_t i = INT32_MAX;
13462 uint32_t u = UINT32_MAX;
13463 printf("int32_t\n");
13469 '') case "$charsize" in
13471 u8type="unsigned char"
13480 if eval $compile; then
13481 case "`$run ./try`" in
13482 int8_t) i8type=int8_t
13492 '') if $test $charsize -ge 1; then
13494 u8type="unsigned char"
13502 '') case "$shortsize" in
13504 u16type="unsigned short"
13512 '') set try -DINT16
13513 if eval $compile; then
13514 case "`$run ./try`" in
13526 '') if $test $shortsize -ge 2; then
13528 u16type="unsigned short"
13536 '') case "$longsize" in
13538 u32type="unsigned long"
13542 *) case "$intsize" in
13544 u32type="unsigned int"
13554 '') set try -DINT32
13555 if eval $compile; then
13556 case "`$run ./try`" in
13568 '') if $test $intsize -ge 4; then
13570 u32type="unsigned int"
13578 '') case "$d_quad:$quadtype" in
13580 i64type="$quadtype"
13581 u64type="$uquadtype"
13589 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
13590 : volatile so that the compiler has to store it out to memory.
13591 if test X"$d_volatile" = X"$define"; then
13596 #include <sys/types.h>
13597 #include <signal.h>
13599 $volatile int bletched = 0;
13600 $signal_t blech(s) int s; { bletched = 1; }
13605 int n = 8 * $uvsize;
13608 signal(SIGFPE, blech);
13611 for (i = 0; i < n; i++) {
13612 u = u << 1 | ($uvtype)1;
13614 if (($uvtype)d != u)
13618 d = ($nvtype)(u - 1);
13619 if (($uvtype)d != (u - 1))
13627 printf("%d\n", ((i == n) ? -n : i));
13633 d_nv_preserves_uv="$undef"
13634 if eval $compile; then
13635 nv_preserves_uv_bits="`$run ./try`"
13637 case "$nv_preserves_uv_bits" in
13639 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
13640 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
13641 d_nv_preserves_uv="$define"
13643 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
13644 d_nv_preserves_uv="$undef" ;;
13645 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
13646 nv_preserves_uv_bits="$undef" ;;
13652 : check for off64_t
13654 echo "Checking to see if you have off64_t..." >&4
13656 #include <sys/types.h>
13657 #include <unistd.h>
13658 int main() { off64_t x = 7; }
13661 if eval $compile; then
13663 echo "You have off64_t."
13666 echo "You do not have off64_t."
13667 case "$lseeksize" in
13668 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
13675 : how to create joinable pthreads
13676 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
13678 echo "Checking what constant to use for creating joinable pthreads..." >&4
13679 $cat >try.c <<'EOCP'
13680 #include <pthread.h>
13682 int detachstate = JOINABLE;
13685 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
13686 if eval $compile; then
13687 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
13688 val="$undef" # Yes, undef.
13689 set d_old_pthread_create_joinable
13692 set old_pthread_create_joinable
13695 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
13696 if eval $compile; then
13697 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
13699 set d_old_pthread_create_joinable
13701 val=PTHREAD_CREATE_UNDETACHED
13702 set old_pthread_create_joinable
13705 set try -DJOINABLE=__UNDETACHED
13706 if eval $compile; then
13707 echo "You seem to use __UNDETACHED." >&4
13709 set d_old_pthread_create_joinable
13712 set old_pthread_create_joinable
13715 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
13717 set d_old_pthread_create_joinable
13720 set old_pthread_create_joinable
13727 d_old_pthread_create_joinable="$undef"
13728 old_pthread_create_joinable=""
13731 : see if pause exists
13735 : see if pipe exists
13739 : see if poll exists
13743 : see if readlink exists
13744 set readlink d_readlink
13750 case "$d_readlink" in
13752 if $issymlink /proc/self/exe ; then
13753 $ls -l /proc/self/exe > reflect
13754 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
13755 echo "You have Linux-like /proc/self/exe."
13756 procselfexe='"/proc/self/exe"'
13760 if $issymlink /proc/curproc/file ; then
13761 $ls -l /proc/curproc/file > reflect
13762 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
13763 echo "You have BSD-like /proc/curproc/file."
13764 procselfexe='"/proc/curproc/file"'
13774 : see whether the pthread_atfork exists
13776 #include <pthread.h>
13779 #ifdef PTHREAD_ATFORK
13780 pthread_atfork(NULL,NULL,NULL);
13785 : see if pthread_atfork exists
13786 set try -DPTHREAD_ATFORK
13787 if eval $compile; then
13792 case "$usethreads" in
13795 $define) echo 'pthread_atfork found.' >&4 ;;
13796 *) echo 'pthread_atfork NOT found.' >&4 ;;
13799 set d_pthread_atfork
13803 : see whether the various POSIXish _yields exist
13805 #include <pthread.h>
13811 #ifdef PTHREAD_YIELD
13814 #ifdef PTHREAD_YIELD_NULL
13815 pthread_yield(NULL);
13821 : see if sched_yield exists
13822 set try -DSCHED_YIELD
13823 if eval $compile; then
13825 sched_yield='sched_yield()'
13829 case "$usethreads" in
13832 $define) echo 'sched_yield() found.' >&4 ;;
13833 *) echo 'sched_yield() NOT found.' >&4 ;;
13839 : see if pthread_yield exists
13840 set try -DPTHREAD_YIELD
13841 if eval $compile; then
13843 case "$sched_yield" in
13844 '') sched_yield='pthread_yield()' ;;
13847 set try -DPTHREAD_YIELD_NULL
13848 if eval $compile; then
13850 case "$sched_yield" in
13851 '') sched_yield='pthread_yield(NULL)' ;;
13857 case "$usethreads" in
13860 $define) echo 'pthread_yield() found.' >&4 ;;
13861 *) echo 'pthread_yield() NOT found.' >&4 ;;
13865 set d_pthread_yield
13868 case "$sched_yield" in
13869 '') sched_yield=undef ;;
13874 : see if random_r exists
13875 set random_r d_random_r
13877 case "$d_random_r" in
13879 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
13880 case "$d_random_r_proto:$usethreads" in
13881 ":define") d_random_r_proto=define
13882 set d_random_r_proto random_r $hdrs
13886 case "$d_random_r_proto" in
13888 case "$random_r_proto" in
13889 ''|0) try='int random_r(int*, struct random_data*);'
13890 ./protochk "extern $try" $hdrs && random_r_proto=I_TS ;;
13892 case "$random_r_proto" in
13893 ''|0) d_random_r=undef
13895 echo "Disabling random_r, cannot determine prototype." >&4 ;;
13896 * ) case "$random_r_proto" in
13897 REENTRANT_PROTO*) ;;
13898 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
13900 echo "Prototype: $try" ;;
13903 *) case "$usethreads" in
13904 define) echo "random_r has no prototype, not using it." >&4 ;;
13911 *) random_r_proto=0
13915 : see if readdir and friends exist
13916 set readdir d_readdir
13918 set seekdir d_seekdir
13920 set telldir d_telldir
13922 set rewinddir d_rewinddir
13925 : see if readdir64_r exists
13926 set readdir64_r d_readdir64_r
13928 case "$d_readdir64_r" in
13930 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
13931 case "$d_readdir64_r_proto:$usethreads" in
13932 ":define") d_readdir64_r_proto=define
13933 set d_readdir64_r_proto readdir64_r $hdrs
13937 case "$d_readdir64_r_proto" in
13939 case "$readdir64_r_proto" in
13940 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
13941 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
13943 case "$readdir64_r_proto" in
13944 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
13945 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
13947 case "$readdir64_r_proto" in
13948 ''|0) d_readdir64_r=undef
13949 readdir64_r_proto=0
13950 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
13951 * ) case "$readdir64_r_proto" in
13952 REENTRANT_PROTO*) ;;
13953 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
13955 echo "Prototype: $try" ;;
13958 *) case "$usethreads" in
13959 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
13961 d_readdir64_r=undef
13962 readdir64_r_proto=0
13966 *) readdir64_r_proto=0
13970 : see if readdir_r exists
13971 set readdir_r d_readdir_r
13973 case "$d_readdir_r" in
13975 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
13976 case "$d_readdir_r_proto:$usethreads" in
13977 ":define") d_readdir_r_proto=define
13978 set d_readdir_r_proto readdir_r $hdrs
13982 case "$d_readdir_r_proto" in
13984 case "$readdir_r_proto" in
13985 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
13986 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
13988 case "$readdir_r_proto" in
13989 ''|0) try='int readdir_r(DIR*, struct dirent*);'
13990 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
13992 case "$readdir_r_proto" in
13993 ''|0) d_readdir_r=undef
13995 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
13996 * ) case "$readdir_r_proto" in
13997 REENTRANT_PROTO*) ;;
13998 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
14000 echo "Prototype: $try" ;;
14003 *) case "$usethreads" in
14004 define) echo "readdir_r has no prototype, not using it." >&4 ;;
14011 *) readdir_r_proto=0
14015 : see if readv exists
14019 : see if recvmsg exists
14020 set recvmsg d_recvmsg
14023 : see if rename exists
14024 set rename d_rename
14027 : see if rmdir exists
14031 : see if memory.h is available.
14036 : See if it conflicts with string.h
14042 $cppstdin $cppflags $cppminus < $strings > mem.h
14043 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
14045 echo "We won't be including <memory.h>."
14055 : can bcopy handle overlapping blocks?
14058 case "$d_memmove" in
14059 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
14060 *) case "$d_bcopy" in
14062 echo "Checking to see if bcopy() can do overlapping copies..." >&4
14064 #$i_memory I_MEMORY
14065 #$i_stdlib I_STDLIB
14066 #$i_string I_STRING
14067 #$i_unistd I_UNISTD
14069 $cat >>try.c <<'EOCP'
14072 # include <memory.h>
14075 # include <stdlib.h>
14078 # include <string.h>
14080 # include <strings.h>
14083 # include <unistd.h> /* Needed for NetBSD */
14087 char buf[128], abc[128];
14093 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14094 try to store the string in read-only memory. */
14095 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
14097 for (align = 7; align >= 0; align--) {
14098 for (len = 36; len; len--) {
14100 bcopy(abc, b, len);
14101 for (off = 1; off <= len; off++) {
14102 bcopy(b, b+off, len);
14103 bcopy(b+off, b, len);
14104 if (bcmp(b, abc, len))
14113 if eval $compile_ok; then
14114 if ./try 2>/dev/null; then
14115 echo "Yes, it can."
14118 echo "It can't, sorry."
14121 echo "(I can't compile the test program, so we'll assume not...)"
14125 $rm -f try.* try core
14131 : can memcpy handle overlapping blocks?
14134 case "$d_memmove" in
14135 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
14136 *) case "$d_memcpy" in
14138 echo "Checking to see if memcpy() can do overlapping copies..." >&4
14140 #$i_memory I_MEMORY
14141 #$i_stdlib I_STDLIB
14142 #$i_string I_STRING
14143 #$i_unistd I_UNISTD
14145 $cat >>try.c <<'EOCP'
14148 # include <memory.h>
14151 # include <stdlib.h>
14154 # include <string.h>
14156 # include <strings.h>
14159 # include <unistd.h> /* Needed for NetBSD */
14163 char buf[128], abc[128];
14169 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14170 try to store the string in read-only memory. */
14171 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
14173 for (align = 7; align >= 0; align--) {
14174 for (len = 36; len; len--) {
14176 memcpy(b, abc, len);
14177 for (off = 1; off <= len; off++) {
14178 memcpy(b+off, b, len);
14179 memcpy(b, b+off, len);
14180 if (memcmp(b, abc, len))
14189 if eval $compile_ok; then
14190 if ./try 2>/dev/null; then
14191 echo "Yes, it can."
14194 echo "It can't, sorry."
14197 echo "(I can't compile the test program, so we'll assume not...)"
14201 $rm -f try.* try core
14207 : can memcmp be trusted to compare relative magnitude?
14209 case "$d_memcmp" in
14212 echo "Checking if your memcmp() can compare relative magnitude..." >&4
14214 #$i_memory I_MEMORY
14215 #$i_stdlib I_STDLIB
14216 #$i_string I_STRING
14217 #$i_unistd I_UNISTD
14219 $cat >>try.c <<'EOCP'
14222 # include <memory.h>
14225 # include <stdlib.h>
14228 # include <string.h>
14230 # include <strings.h>
14233 # include <unistd.h> /* Needed for NetBSD */
14239 if ((a < b) && memcmp(&a, &b, 1) < 0)
14245 if eval $compile_ok; then
14246 if $run ./try 2>/dev/null; then
14247 echo "Yes, it can."
14250 echo "No, it can't (it uses signed chars)."
14253 echo "(I can't compile the test program, so we'll assume not...)"
14257 $rm -f try.* try core
14261 : see if prototype for sbrk is available
14263 set d_sbrkproto sbrk $i_unistd unistd.h
14266 : see if select exists
14267 set select d_select
14270 : see if semctl exists
14271 set semctl d_semctl
14274 : see if semget exists
14275 set semget d_semget
14278 : see if semop exists
14282 : see how much of the 'sem*(2)' library is present.
14285 case "$d_semctl$d_semget$d_semop" in
14286 *"$undef"*) h_sem=false;;
14290 case "`ipcs 2>&1`" in
14291 "SVID messages"*"not configured"*)
14292 echo "Your $osname does not have the sem*(2) configured." >&4
14295 set semctl d_semctl
14297 set semget d_semget
14305 : we could also check for sys/ipc.h ...
14306 if $h_sem && $test `./findhdr sys/sem.h`; then
14307 echo "You have the full sem*(2) library." >&4
14310 echo "You don't have the full sem*(2) library." >&4
14316 : see whether sys/sem.h defines union semun
14318 $cat > try.c <<'END'
14319 #include <sys/types.h>
14320 #include <sys/ipc.h>
14321 #include <sys/sem.h>
14322 int main () { union semun semun; semun.buf = 0; }
14325 if eval $compile; then
14326 echo "You have union semun in <sys/sem.h>." >&4
14329 echo "You do not have union semun in <sys/sem.h>." >&4
14332 $rm -f try try.c try.h
14336 : see how to do semctl IPC_STAT
14339 : see whether semctl IPC_STAT can use union semun
14344 # define S_IRUSR S_IREAD
14345 # define S_IWUSR S_IWRITE
14346 # define S_IXUSR S_IEXEC
14348 # define S_IRUSR 0400
14349 # define S_IWUSR 0200
14350 # define S_IXUSR 0100
14352 # define S_IRGRP (S_IRUSR>>3)
14353 # define S_IWGRP (S_IWUSR>>3)
14354 # define S_IXGRP (S_IXUSR>>3)
14355 # define S_IROTH (S_IRUSR>>6)
14356 # define S_IWOTH (S_IWUSR>>6)
14357 # define S_IXOTH (S_IXUSR>>6)
14360 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
14361 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
14362 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
14367 #include <sys/types.h>
14368 #include <sys/ipc.h>
14369 #include <sys/sem.h>
14370 #include <sys/stat.h>
14377 #$d_union_semun HAS_UNION_SEMUN
14380 #ifndef HAS_UNION_SEMUN
14383 struct semid_ds *buf;
14384 unsigned short *array;
14390 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14391 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14393 struct semid_ds argbuf;
14396 st = semctl(sem, 0, IPC_STAT, arg);
14400 # endif /* IPC_STAT */
14401 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14403 if (semctl(sem, 0, IPC_RMID, arg) != 0)
14404 # endif /* IPC_RMID */
14405 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14407 #endif /* IPC_PRIVATE && ... */
14408 printf("semget failed: errno = %d\n", errno);
14414 if eval $compile; then
14417 semun) val="$define" ;;
14423 case "$d_semctl_semun" in
14425 echo "You can use union semun for semctl IPC_STAT." >&4
14428 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
14433 : see whether semctl IPC_STAT can use struct semid_ds pointer
14434 $cat > try.c <<'END'
14435 #include <sys/types.h>
14436 #include <sys/ipc.h>
14437 #include <sys/sem.h>
14438 #include <sys/stat.h>
14446 struct semid_ds arg;
14449 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14450 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14453 st = semctl(sem, 0, IPC_STAT, &arg);
14455 printf("semid_ds\n");
14457 # endif /* IPC_STAT */
14458 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14460 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
14461 # endif /* IPC_RMID */
14462 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14464 #endif /* IPC_PRIVATE && ... */
14465 printf("semget failed: errno = %d\n", errno);
14472 if eval $compile; then
14475 semid_ds) val="$define" ;;
14479 set d_semctl_semid_ds
14481 case "$d_semctl_semid_ds" in
14483 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
14485 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
14492 # We do not have the full sem*(2) library, so assume we can not
14498 set d_semctl_semid_ds
14503 : see if sendmsg exists
14504 set sendmsg d_sendmsg
14507 : see if setegid exists
14508 set setegid d_setegid
14511 : see if seteuid exists
14512 set seteuid d_seteuid
14515 : see if setgrent exists
14516 set setgrent d_setgrent
14519 : see if setgrent_r exists
14520 set setgrent_r d_setgrent_r
14522 case "$d_setgrent_r" in
14524 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14525 case "$d_setgrent_r_proto:$usethreads" in
14526 ":define") d_setgrent_r_proto=define
14527 set d_setgrent_r_proto setgrent_r $hdrs
14531 case "$d_setgrent_r_proto" in
14533 case "$setgrent_r_proto" in
14534 ''|0) try='int setgrent_r(FILE**);'
14535 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
14537 case "$setgrent_r_proto" in
14538 ''|0) try='void setgrent_r(FILE**);'
14539 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
14541 case "$setgrent_r_proto" in
14542 ''|0) d_setgrent_r=undef
14544 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
14545 * ) case "$setgrent_r_proto" in
14546 REENTRANT_PROTO*) ;;
14547 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
14549 echo "Prototype: $try" ;;
14552 *) case "$usethreads" in
14553 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
14560 *) setgrent_r_proto=0
14564 : see if sethostent exists
14565 set sethostent d_sethent
14568 : see if sethostent_r exists
14569 set sethostent_r d_sethostent_r
14571 case "$d_sethostent_r" in
14573 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14574 case "$d_sethostent_r_proto:$usethreads" in
14575 ":define") d_sethostent_r_proto=define
14576 set d_sethostent_r_proto sethostent_r $hdrs
14580 case "$d_sethostent_r_proto" in
14582 case "$sethostent_r_proto" in
14583 ''|0) try='int sethostent_r(int, struct hostent_data*);'
14584 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
14586 case "$sethostent_r_proto" in
14587 ''|0) try='void sethostent_r(int, struct hostent_data*);'
14588 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
14590 case "$sethostent_r_proto" in
14591 ''|0) d_sethostent_r=undef
14592 sethostent_r_proto=0
14593 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
14594 * ) case "$sethostent_r_proto" in
14595 REENTRANT_PROTO*) ;;
14596 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
14598 echo "Prototype: $try" ;;
14601 *) case "$usethreads" in
14602 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
14604 d_sethostent_r=undef
14605 sethostent_r_proto=0
14609 *) sethostent_r_proto=0
14613 : see if setitimer exists
14614 set setitimer d_setitimer
14617 : see if setlinebuf exists
14618 set setlinebuf d_setlinebuf
14621 : see if setlocale exists
14622 set setlocale d_setlocale
14625 : see if locale.h is available
14626 set locale.h i_locale
14629 : see if setlocale_r exists
14630 set setlocale_r d_setlocale_r
14632 case "$d_setlocale_r" in
14634 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
14635 case "$d_setlocale_r_proto:$usethreads" in
14636 ":define") d_setlocale_r_proto=define
14637 set d_setlocale_r_proto setlocale_r $hdrs
14641 case "$d_setlocale_r_proto" in
14643 case "$setlocale_r_proto" in
14644 ''|0) try='int setlocale_r(int, const char*, char*, int);'
14645 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
14647 case "$setlocale_r_proto" in
14648 ''|0) d_setlocale_r=undef
14649 setlocale_r_proto=0
14650 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
14651 * ) case "$setlocale_r_proto" in
14652 REENTRANT_PROTO*) ;;
14653 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
14655 echo "Prototype: $try" ;;
14658 *) case "$usethreads" in
14659 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
14661 d_setlocale_r=undef
14662 setlocale_r_proto=0
14666 *) setlocale_r_proto=0
14670 : see if setnetent exists
14671 set setnetent d_setnent
14674 : see if setnetent_r exists
14675 set setnetent_r d_setnetent_r
14677 case "$d_setnetent_r" in
14679 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14680 case "$d_setnetent_r_proto:$usethreads" in
14681 ":define") d_setnetent_r_proto=define
14682 set d_setnetent_r_proto setnetent_r $hdrs
14686 case "$d_setnetent_r_proto" in
14688 case "$setnetent_r_proto" in
14689 ''|0) try='int setnetent_r(int, struct netent_data*);'
14690 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
14692 case "$setnetent_r_proto" in
14693 ''|0) try='void setnetent_r(int, struct netent_data*);'
14694 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
14696 case "$setnetent_r_proto" in
14697 ''|0) d_setnetent_r=undef
14698 setnetent_r_proto=0
14699 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
14700 * ) case "$setnetent_r_proto" in
14701 REENTRANT_PROTO*) ;;
14702 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
14704 echo "Prototype: $try" ;;
14707 *) case "$usethreads" in
14708 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
14710 d_setnetent_r=undef
14711 setnetent_r_proto=0
14715 *) setnetent_r_proto=0
14719 : see if setprotoent exists
14720 set setprotoent d_setpent
14723 : see if setpgid exists
14724 set setpgid d_setpgid
14727 : see if setpgrp2 exists
14728 set setpgrp2 d_setpgrp2
14731 : see if setpriority exists
14732 set setpriority d_setprior
14735 : see if setproctitle exists
14736 set setproctitle d_setproctitle
14739 : see if setprotoent_r exists
14740 set setprotoent_r d_setprotoent_r
14742 case "$d_setprotoent_r" in
14744 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14745 case "$d_setprotoent_r_proto:$usethreads" in
14746 ":define") d_setprotoent_r_proto=define
14747 set d_setprotoent_r_proto setprotoent_r $hdrs
14751 case "$d_setprotoent_r_proto" in
14753 case "$setprotoent_r_proto" in
14754 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
14755 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
14757 case "$setprotoent_r_proto" in
14758 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
14759 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
14761 case "$setprotoent_r_proto" in
14762 ''|0) d_setprotoent_r=undef
14763 setprotoent_r_proto=0
14764 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
14765 * ) case "$setprotoent_r_proto" in
14766 REENTRANT_PROTO*) ;;
14767 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
14769 echo "Prototype: $try" ;;
14772 *) case "$usethreads" in
14773 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
14775 d_setprotoent_r=undef
14776 setprotoent_r_proto=0
14780 *) setprotoent_r_proto=0
14784 : see if setpwent exists
14785 set setpwent d_setpwent
14788 : see if setpwent_r exists
14789 set setpwent_r d_setpwent_r
14791 case "$d_setpwent_r" in
14793 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14794 case "$d_setpwent_r_proto:$usethreads" in
14795 ":define") d_setpwent_r_proto=define
14796 set d_setpwent_r_proto setpwent_r $hdrs
14800 case "$d_setpwent_r_proto" in
14802 case "$setpwent_r_proto" in
14803 ''|0) try='int setpwent_r(FILE**);'
14804 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
14806 case "$setpwent_r_proto" in
14807 ''|0) try='void setpwent_r(FILE**);'
14808 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
14810 case "$setpwent_r_proto" in
14811 ''|0) d_setpwent_r=undef
14813 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
14814 * ) case "$setpwent_r_proto" in
14815 REENTRANT_PROTO*) ;;
14816 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
14818 echo "Prototype: $try" ;;
14821 *) case "$usethreads" in
14822 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
14829 *) setpwent_r_proto=0
14833 : see if setregid exists
14834 set setregid d_setregid
14836 set setresgid d_setresgid
14839 : see if setreuid exists
14840 set setreuid d_setreuid
14842 set setresuid d_setresuid
14845 : see if setrgid exists
14846 set setrgid d_setrgid
14849 : see if setruid exists
14850 set setruid d_setruid
14853 : see if setservent exists
14854 set setservent d_setsent
14857 : see if setservent_r exists
14858 set setservent_r d_setservent_r
14860 case "$d_setservent_r" in
14862 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14863 case "$d_setservent_r_proto:$usethreads" in
14864 ":define") d_setservent_r_proto=define
14865 set d_setservent_r_proto setservent_r $hdrs
14869 case "$d_setservent_r_proto" in
14871 case "$setservent_r_proto" in
14872 ''|0) try='int setservent_r(int, struct servent_data*);'
14873 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
14875 case "$setservent_r_proto" in
14876 ''|0) try='void setservent_r(int, struct servent_data*);'
14877 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
14879 case "$setservent_r_proto" in
14880 ''|0) d_setservent_r=undef
14881 setservent_r_proto=0
14882 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
14883 * ) case "$setservent_r_proto" in
14884 REENTRANT_PROTO*) ;;
14885 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
14887 echo "Prototype: $try" ;;
14890 *) case "$usethreads" in
14891 define) echo "setservent_r has no prototype, not using it." >&4 ;;
14893 d_setservent_r=undef
14894 setservent_r_proto=0
14898 *) setservent_r_proto=0
14902 : see if setsid exists
14903 set setsid d_setsid
14906 : see if setvbuf exists
14907 set setvbuf d_setvbuf
14910 : see if sfio.h is available
14915 : see if sfio library is available
14926 : Ok, but do we want to use it.
14930 true|$define|[yY]*) dflt='y';;
14933 echo "$package can use the sfio library, but it is experimental."
14934 case "$useperlio" in
14936 echo "For sfio also the PerlIO abstraction layer is needed."
14937 echo "Earlier you said you wouldn't want that."
14940 rp="You seem to have sfio available, do you want to try using it?"
14943 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
14944 useperlio="$define"
14947 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
14952 *) case "$usesfio" in
14953 true|$define|[yY]*)
14954 echo "Sorry, cannot find sfio on this machine." >&4
14955 echo "Ignoring your setting of usesfio=$usesfio." >&4
14964 $define) usesfio='true';;
14965 *) usesfio='false';;
14969 *) : Remove sfio from list of libraries to use
14972 echo "Removing unneeded -lsfio from library list" >&4
14973 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
14976 echo "libs = $libs" >&4
14983 : see if shmctl exists
14984 set shmctl d_shmctl
14987 : see if shmget exists
14988 set shmget d_shmget
14991 : see if shmat exists
14994 : see what shmat returns
14997 $cat >shmat.c <<'END'
14998 #include <sys/shm.h>
15001 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
15006 echo "and it returns ($shmattype)." >&4
15007 : see if a prototype for shmat is available
15008 xxx=`./findhdr sys/shm.h`
15009 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
15010 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
15021 set d_shmatprototype
15024 : see if shmdt exists
15028 : see how much of the 'shm*(2)' library is present.
15031 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
15032 *"$undef"*) h_shm=false;;
15036 case "`ipcs 2>&1`" in
15037 "SVID shared memory"*"not configured"*)
15038 echo "Your $osname does not have the shm*(2) configured." >&4
15041 set shmctl d_shmctl
15043 set shmget d_shmget
15053 : we could also check for sys/ipc.h ...
15054 if $h_shm && $test `./findhdr sys/shm.h`; then
15055 echo "You have the full shm*(2) library." >&4
15058 echo "You don't have the full shm*(2) library." >&4
15065 : see if we have sigaction
15066 if set sigaction val -f d_sigaction; eval $csym; $val; then
15067 echo 'sigaction() found.' >&4
15068 $cat > try.c <<'EOP'
15070 #include <sys/types.h>
15071 #include <signal.h>
15074 struct sigaction act, oact;
15076 oact.sa_handler = 0;
15077 /* so that act and oact are used */
15078 exit(act.sa_flags == 0 && oact.sa_handler == 0);
15082 if eval $compile_ok; then
15085 echo "But you don't seem to have a useable struct sigaction." >&4
15089 echo 'sigaction NOT found.' >&4
15092 set d_sigaction; eval $setvar
15093 $rm -f try try$_o try.c
15095 : see if sigprocmask exists
15096 set sigprocmask d_sigprocmask
15099 : see if sigsetjmp exists
15101 case "$d_sigsetjmp" in
15103 $cat >try.c <<'EOP'
15104 #include <setjmp.h>
15109 if (sigsetjmp(env,1))
15112 siglongjmp(env, 1);
15117 if eval $compile; then
15118 if $run ./try >/dev/null 2>&1; then
15119 echo "POSIX sigsetjmp found." >&4
15123 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
15129 echo "sigsetjmp not found." >&4
15133 *) val="$d_sigsetjmp"
15134 case "$d_sigsetjmp" in
15135 $define) echo "POSIX sigsetjmp found." >&4;;
15136 $undef) echo "sigsetjmp not found." >&4;;
15144 : see if sockatmark exists
15145 set sockatmark d_sockatmark
15148 : see if prototype for sockatmark is available
15150 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
15153 : see if socks5_init exists
15154 set socks5_init d_socks5_init
15157 : see if srand48_r exists
15158 set srand48_r d_srand48_r
15160 case "$d_srand48_r" in
15162 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15163 case "$d_srand48_r_proto:$usethreads" in
15164 ":define") d_srand48_r_proto=define
15165 set d_srand48_r_proto srand48_r $hdrs
15169 case "$d_srand48_r_proto" in
15171 case "$srand48_r_proto" in
15172 ''|0) try='int srand48_r(long, struct drand48_data*);'
15173 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
15175 case "$srand48_r_proto" in
15176 ''|0) d_srand48_r=undef
15178 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
15179 * ) case "$srand48_r_proto" in
15180 REENTRANT_PROTO*) ;;
15181 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
15183 echo "Prototype: $try" ;;
15186 *) case "$usethreads" in
15187 define) echo "srand48_r has no prototype, not using it." >&4 ;;
15194 *) srand48_r_proto=0
15198 : see if srandom_r exists
15199 set srandom_r d_srandom_r
15201 case "$d_srandom_r" in
15203 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15204 case "$d_srandom_r_proto:$usethreads" in
15205 ":define") d_srandom_r_proto=define
15206 set d_srandom_r_proto srandom_r $hdrs
15210 case "$d_srandom_r_proto" in
15212 case "$srandom_r_proto" in
15213 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
15214 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
15216 case "$srandom_r_proto" in
15217 ''|0) d_srandom_r=undef
15219 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
15220 * ) case "$srandom_r_proto" in
15221 REENTRANT_PROTO*) ;;
15222 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
15224 echo "Prototype: $try" ;;
15227 *) case "$usethreads" in
15228 define) echo "srandom_r has no prototype, not using it." >&4 ;;
15235 *) srandom_r_proto=0
15239 : see if prototype for setresgid is available
15241 set d_sresgproto setresgid $i_unistd unistd.h
15244 : see if prototype for setresuid is available
15246 set d_sresuproto setresuid $i_unistd unistd.h
15249 : see if sys/stat.h is available
15250 set sys/stat.h i_sysstat
15254 : see if stat knows about block sizes
15256 echo "Checking to see if your struct stat has st_blocks field..." >&4
15257 set d_statblks stat st_blocks $i_sysstat sys/stat.h
15261 : see if this is a sys/vfs.h system
15262 set sys/vfs.h i_sysvfs
15266 : see if this is a sys/statfs.h system
15267 set sys/statfs.h i_sysstatfs
15272 echo "Checking to see if your system supports struct statfs..." >&4
15273 set 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
15275 case "$d_statfs_s" in
15276 "$define") echo "Yes, it does." ;;
15277 *) echo "No, it doesn't." ;;
15282 : see if struct statfs knows about f_flags
15283 case "$d_statfs_s" in
15286 echo "Checking to see if your struct statfs has f_flags field..." >&4
15287 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
15291 set d_statfs_f_flags
15295 case "$d_statfs_f_flags" in
15296 "$define") echo "Yes, it does." ;;
15297 *) echo "No, it doesn't." ;;
15300 : see if _ptr and _cnt from stdio act std
15303 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
15304 echo "(Looks like you have stdio.h from BSD.)"
15305 case "$stdio_ptr" in
15306 '') stdio_ptr='((fp)->_p)'
15309 *) ptr_lval=$d_stdio_ptr_lval;;
15311 case "$stdio_cnt" in
15312 '') stdio_cnt='((fp)->_r)'
15315 *) cnt_lval=$d_stdio_cnt_lval;;
15317 case "$stdio_base" in
15318 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
15320 case "$stdio_bufsiz" in
15321 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
15323 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
15324 echo "(Looks like you have stdio.h from Linux.)"
15325 case "$stdio_ptr" in
15326 '') stdio_ptr='((fp)->_IO_read_ptr)'
15329 *) ptr_lval=$d_stdio_ptr_lval;;
15331 case "$stdio_cnt" in
15332 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
15335 *) cnt_lval=$d_stdio_cnt_lval;;
15337 case "$stdio_base" in
15338 '') stdio_base='((fp)->_IO_read_base)';;
15340 case "$stdio_bufsiz" in
15341 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
15344 case "$stdio_ptr" in
15345 '') stdio_ptr='((fp)->_ptr)'
15348 *) ptr_lval=$d_stdio_ptr_lval;;
15350 case "$stdio_cnt" in
15351 '') stdio_cnt='((fp)->_cnt)'
15354 *) cnt_lval=$d_stdio_cnt_lval;;
15356 case "$stdio_base" in
15357 '') stdio_base='((fp)->_base)';;
15359 case "$stdio_bufsiz" in
15360 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
15364 : test whether _ptr and _cnt really work
15365 echo "Checking how std your stdio is..." >&4
15368 #define FILE_ptr(fp) $stdio_ptr
15369 #define FILE_cnt(fp) $stdio_cnt
15371 FILE *fp = fopen("try.c", "r");
15374 18 <= FILE_cnt(fp) &&
15375 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15383 if eval $compile && $to try.c; then
15384 if $run ./try; then
15385 echo "Your stdio acts pretty std."
15388 echo "Your stdio isn't very std."
15391 echo "Your stdio doesn't appear very std."
15395 # glibc 2.2.90 and above apparently change stdio streams so Perl's
15396 # direct buffer manipulation no longer works. The Configure tests
15397 # should be changed to correctly detect this, but until then,
15398 # the following check should at least let perl compile and run.
15399 # (This quick fix should be updated before 5.8.1.)
15400 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
15401 # A. Dougherty, June 3, 2002.
15402 case "$d_gnulibc" in
15404 case "$gnulibc_version" in
15408 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
15417 : Can _ptr be used as an lvalue?
15418 case "$d_stdstdio$ptr_lval" in
15419 $define$define) val=$define ;;
15422 set d_stdio_ptr_lval
15425 : Can _cnt be used as an lvalue?
15426 case "$d_stdstdio$cnt_lval" in
15427 $define$define) val=$define ;;
15430 set d_stdio_cnt_lval
15434 : test whether setting _ptr sets _cnt as a side effect
15435 d_stdio_ptr_lval_sets_cnt="$undef"
15436 d_stdio_ptr_lval_nochange_cnt="$undef"
15437 case "$d_stdio_ptr_lval$d_stdstdio" in
15439 echo "Checking to see what happens if we set the stdio ptr..." >&4
15442 /* Can we scream? */
15443 /* Eat dust sed :-) */
15444 /* In the buffer space, no one can hear you scream. */
15445 #define FILE_ptr(fp) $stdio_ptr
15446 #define FILE_cnt(fp) $stdio_cnt
15447 #include <sys/types.h>
15449 FILE *fp = fopen("try.c", "r");
15454 puts("Fail even to read");
15457 c = getc(fp); /* Read away the first # */
15459 puts("Fail even to read");
15463 18 <= FILE_cnt(fp) &&
15464 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15466 puts("Fail even to read");
15469 ptr = (char*) FILE_ptr(fp);
15470 cnt = (size_t)FILE_cnt(fp);
15472 FILE_ptr(fp) += 42;
15474 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
15475 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
15478 if (FILE_cnt(fp) <= 20) {
15479 printf ("Fail (<20 chars to test)");
15482 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
15483 puts("Fail compare");
15486 if (cnt == FILE_cnt(fp)) {
15487 puts("Pass_unchanged");
15490 if (FILE_cnt(fp) == (cnt - 42)) {
15491 puts("Pass_changed");
15494 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
15500 if eval $compile && $to try.c; then
15501 case `$run ./try` in
15503 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
15504 d_stdio_ptr_lval_sets_cnt="$define" ;;
15506 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
15507 d_stdio_ptr_lval_nochange_cnt="$define" ;;
15509 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
15511 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
15514 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
15520 : see if _base is also standard
15522 case "$d_stdstdio" in
15526 #define FILE_base(fp) $stdio_base
15527 #define FILE_bufsiz(fp) $stdio_bufsiz
15529 FILE *fp = fopen("try.c", "r");
15532 19 <= FILE_bufsiz(fp) &&
15533 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
15540 if eval $compile && $to try.c; then
15541 if $run ./try; then
15542 echo "And its _base field acts std."
15545 echo "But its _base field isn't std."
15548 echo "However, it seems to be lacking the _base field."
15557 Checking how to access stdio streams by file descriptor number...
15559 case "$stdio_stream_array" in
15560 '') $cat >try.c <<EOCP
15563 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
15567 for s in _iob __iob __sF
15569 set try -DSTDIO_STREAM_ARRAY=$s
15570 if eval $compile; then
15571 case "`$run ./try`" in
15572 yes) stdio_stream_array=$s; break ;;
15576 $rm -f try.* try$exe_ext
15578 case "$stdio_stream_array" in
15580 I can't figure out how to access stdio streams by file descriptor number.
15582 d_stdio_stream_array="$undef"
15585 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
15587 d_stdio_stream_array="$define"
15591 : see if strcoll exists
15592 set strcoll d_strcoll
15595 : check for structure copying
15597 echo "Checking to see if your C compiler can copy structs..." >&4
15598 $cat >try.c <<'EOCP'
15608 if $cc -c try.c >/dev/null 2>&1 ; then
15610 echo "Yup, it can."
15613 echo "Nope, it can't."
15619 : see if strerror and/or sys_errlist[] exist
15621 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
15622 if set strerror val -f d_strerror; eval $csym; $val; then
15623 echo 'strerror() found.' >&4
15624 d_strerror="$define"
15625 d_strerrm='strerror(e)'
15626 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15627 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
15628 d_syserrlst="$define"
15630 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
15631 d_syserrlst="$undef"
15633 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
15634 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
15635 echo 'strerror() found in string header.' >&4
15636 d_strerror="$define"
15637 d_strerrm='strerror(e)'
15638 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15639 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
15640 d_syserrlst="$define"
15642 echo "(You don't appear to have any sys_errlist[], how can this be?)"
15643 d_syserrlst="$undef"
15645 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15646 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
15647 d_strerror="$undef"
15648 d_syserrlst="$define"
15649 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
15651 echo 'strerror() and sys_errlist[] NOT found.' >&4
15652 d_strerror="$undef"
15653 d_syserrlst="$undef"
15654 d_strerrm='"unknown"'
15658 : see if strerror_r exists
15659 set strerror_r d_strerror_r
15661 case "$d_strerror_r" in
15663 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
15664 case "$d_strerror_r_proto:$usethreads" in
15665 ":define") d_strerror_r_proto=define
15666 set d_strerror_r_proto strerror_r $hdrs
15670 case "$d_strerror_r_proto" in
15672 case "$strerror_r_proto" in
15673 ''|0) try='int strerror_r(int, char*, size_t);'
15674 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
15676 case "$strerror_r_proto" in
15677 ''|0) try='int strerror_r(int, char*, int);'
15678 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
15680 case "$strerror_r_proto" in
15681 ''|0) try='char* strerror_r(int, char*, size_t);'
15682 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
15684 case "$strerror_r_proto" in
15685 ''|0) d_strerror_r=undef
15687 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
15688 * ) case "$strerror_r_proto" in
15689 REENTRANT_PROTO*) ;;
15690 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
15692 echo "Prototype: $try" ;;
15695 *) case "$usethreads" in
15696 define) echo "strerror_r has no prototype, not using it." >&4 ;;
15703 *) strerror_r_proto=0
15707 : see if strftime exists
15708 set strftime d_strftime
15711 : see if strtod exists
15712 set strtod d_strtod
15715 : see if strtol exists
15716 set strtol d_strtol
15719 : see if strtold exists
15720 set strtold d_strtold
15723 : see if strtoll exists
15724 set strtoll d_strtoll
15727 case "$d_longlong-$d_strtoll" in
15730 Checking whether your strtoll() works okay...
15732 $cat >try.c <<'EOCP'
15735 #define strtoll __strtoll
15738 #define strtoll _strtoll
15741 extern long long int strtoll(char *s, char **, int);
15742 static int bad = 0;
15743 int check(char *s, long long ell, int een) {
15746 gll = strtoll(s, 0, 10);
15747 if (!((gll == ell) && (errno == een)))
15751 check(" 1", 1LL, 0);
15752 check(" 0", 0LL, 0);
15753 check("-1", -1LL, 0);
15754 check("-9223372036854775808", -9223372036854775808LL, 0);
15755 check("-9223372036854775808", -9223372036854775808LL, 0);
15756 check(" 9223372036854775807", 9223372036854775807LL, 0);
15757 check("-9223372036854775808", -9223372036854775808LL, 0);
15758 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
15759 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
15765 if eval $compile; then
15768 ok) echo "Your strtoll() seems to be working okay." ;;
15770 Your strtoll() doesn't seem to be working okay.
15776 echo "(I can't seem to compile the test program--assuming it doesn't)"
15782 : see if strtoq exists
15783 set strtoq d_strtoq
15786 : see if strtoul exists
15787 set strtoul d_strtoul
15790 case "$d_strtoul" in
15793 Checking whether your strtoul() works okay...
15795 $cat >try.c <<'EOCP'
15798 extern unsigned long int strtoul(char *s, char **, int);
15799 static int bad = 0;
15800 void check(char *s, unsigned long eul, int een) {
15803 gul = strtoul(s, 0, 10);
15804 if (!((gul == eul) && (errno == een)))
15808 check(" 1", 1L, 0);
15809 check(" 0", 0L, 0);
15811 case "$longsize" in
15813 $cat >>try.c <<'EOCP'
15814 check("18446744073709551615", 18446744073709551615UL, 0);
15815 check("18446744073709551616", 18446744073709551615UL, ERANGE);
15816 #if 0 /* strtoul() for /^-/ strings is undefined. */
15817 check("-1", 18446744073709551615UL, 0);
15818 check("-18446744073709551614", 2, 0);
15819 check("-18446744073709551615", 1, 0);
15820 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
15821 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
15826 $cat >>try.c <<'EOCP'
15827 check("4294967295", 4294967295UL, 0);
15828 check("4294967296", 4294967295UL, ERANGE);
15829 #if 0 /* strtoul() for /^-/ strings is undefined. */
15830 check("-1", 4294967295UL, 0);
15831 check("-4294967294", 2, 0);
15832 check("-4294967295", 1, 0);
15833 check("-4294967296", 4294967295UL, ERANGE);
15834 check("-4294967297", 4294967295UL, ERANGE);
15839 : Should we write these tests to be more portable by sprintf-ing
15840 : ~0 and then manipulating that char string as input for strtol?
15843 $cat >>try.c <<'EOCP'
15850 if eval $compile; then
15851 case "`$run ./try`" in
15852 ok) echo "Your strtoul() seems to be working okay." ;;
15854 Your strtoul() doesn't seem to be working okay.
15863 : see if strtoull exists
15864 set strtoull d_strtoull
15867 case "$d_longlong-$d_strtoull" in
15870 Checking whether your strtoull() works okay...
15872 $cat >try.c <<'EOCP'
15875 #define strtoull __strtoull
15878 extern unsigned long long int strtoull(char *s, char **, int);
15879 static int bad = 0;
15880 int check(char *s, long long eull, int een) {
15883 gull = strtoull(s, 0, 10);
15884 if (!((gull == eull) && (errno == een)))
15888 check(" 1", 1LL, 0);
15889 check(" 0", 0LL, 0);
15890 check("18446744073709551615", 18446744073709551615ULL, 0);
15891 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
15892 #if 0 /* strtoull() for /^-/ strings is undefined. */
15893 check("-1", 18446744073709551615ULL, 0);
15894 check("-18446744073709551614", 2LL, 0);
15895 check("-18446744073709551615", 1LL, 0);
15896 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
15897 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
15904 if eval $compile; then
15905 case "`$run ./try`" in
15906 ok) echo "Your strtoull() seems to be working okay." ;;
15908 Your strtoull() doesn't seem to be working okay.
15910 d_strtoull="$undef"
15917 : see if strtouq exists
15918 set strtouq d_strtouq
15921 case "$d_strtouq" in
15924 Checking whether your strtouq() works okay...
15926 $cat >try.c <<'EOCP'
15929 extern unsigned long long int strtouq(char *s, char **, int);
15930 static int bad = 0;
15931 void check(char *s, unsigned long long eull, int een) {
15932 unsigned long long gull;
15934 gull = strtouq(s, 0, 10);
15935 if (!((gull == eull) && (errno == een)))
15939 check(" 1", 1LL, 0);
15940 check(" 0", 0LL, 0);
15941 check("18446744073709551615", 18446744073709551615ULL, 0);
15942 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
15943 #if 0 /* strtouq() for /^-/ strings is undefined. */
15944 check("-1", 18446744073709551615ULL, 0);
15945 check("-18446744073709551614", 2LL, 0);
15946 check("-18446744073709551615", 1LL, 0);
15947 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
15948 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
15956 if eval $compile; then
15957 case "`$run ./try`" in
15958 ok) echo "Your strtouq() seems to be working okay." ;;
15960 Your strtouq() doesn't seem to be working okay.
15969 : see if strxfrm exists
15970 set strxfrm d_strxfrm
15973 : see if symlink exists
15974 set symlink d_symlink
15977 : see if syscall exists
15978 set syscall d_syscall
15981 : see if prototype for syscall is available
15983 set d_syscallproto syscall $i_unistd unistd.h
15986 : see if sysconf exists
15987 set sysconf d_sysconf
15990 : see if system exists
15991 set system d_system
15994 : see if tcgetpgrp exists
15995 set tcgetpgrp d_tcgetpgrp
15998 : see if tcsetpgrp exists
15999 set tcsetpgrp d_tcsetpgrp
16002 : see if prototype for telldir is available
16004 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
16007 : see if time exists
16009 if test "X$d_time" = X -o X"$timetype" = X; then
16010 if set time val -f d_time; eval $csym; $val; then
16011 echo 'time() found.' >&4
16013 rp="What is the type returned by time() on this system?"
16014 set time_t timetype long stdio.h sys/types.h
16017 echo 'time() not found, hope that will do.' >&4
16025 : see if this is a sys/times.h system
16026 set sys/times.h i_systimes
16029 : see if times exists
16031 if set times val -f d_times; eval $csym; $val; then
16032 echo 'times() found.' >&4
16035 case "$i_systimes" in
16036 "$define") inc='sys/times.h';;
16038 rp="What is the type returned by times() on this system?"
16039 set clock_t clocktype long stdio.h sys/types.h $inc
16042 echo 'times() NOT found, hope that will do.' >&4
16047 : see if tmpnam_r exists
16048 set tmpnam_r d_tmpnam_r
16050 case "$d_tmpnam_r" in
16052 hdrs="$i_systypes sys/types.h define stdio.h "
16053 case "$d_tmpnam_r_proto:$usethreads" in
16054 ":define") d_tmpnam_r_proto=define
16055 set d_tmpnam_r_proto tmpnam_r $hdrs
16059 case "$d_tmpnam_r_proto" in
16061 case "$tmpnam_r_proto" in
16062 ''|0) try='char* tmpnam_r(char*);'
16063 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
16065 case "$tmpnam_r_proto" in
16066 ''|0) d_tmpnam_r=undef
16068 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
16069 * ) case "$tmpnam_r_proto" in
16070 REENTRANT_PROTO*) ;;
16071 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
16073 echo "Prototype: $try" ;;
16076 *) case "$usethreads" in
16077 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
16084 *) tmpnam_r_proto=0
16088 : see if truncate exists
16089 set truncate d_truncate
16092 : see if ttyname_r exists
16093 set ttyname_r d_ttyname_r
16095 case "$d_ttyname_r" in
16097 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
16098 case "$d_ttyname_r_proto:$usethreads" in
16099 ":define") d_ttyname_r_proto=define
16100 set d_ttyname_r_proto ttyname_r $hdrs
16104 case "$d_ttyname_r_proto" in
16106 case "$ttyname_r_proto" in
16107 ''|0) try='int ttyname_r(int, char*, size_t);'
16108 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
16110 case "$ttyname_r_proto" in
16111 ''|0) try='int ttyname_r(int, char*, int);'
16112 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
16114 case "$ttyname_r_proto" in
16115 ''|0) try='char* ttyname_r(int, char*, int);'
16116 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
16118 case "$ttyname_r_proto" in
16119 ''|0) d_ttyname_r=undef
16121 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
16122 * ) case "$ttyname_r_proto" in
16123 REENTRANT_PROTO*) ;;
16124 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
16126 echo "Prototype: $try" ;;
16129 *) case "$usethreads" in
16130 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
16137 *) ttyname_r_proto=0
16141 : see if tzname[] exists
16143 if set tzname val -a d_tzname; eval $csym; $val; then
16145 echo 'tzname[] found.' >&4
16148 echo 'tzname[] NOT found.' >&4
16154 next|rhapsody|darwin) multiarch="$define" ;;
16156 case "$multiarch" in
16157 ''|[nN]*) multiarch="$undef" ;;
16160 : check for ordering of bytes in a UV
16162 case "$usecrosscompile$multiarch" in
16165 You seem to be either cross-compiling or doing a multiarchitecture build,
16166 skipping the byteorder check.
16172 case "$byteorder" in
16175 In the following, larger digits indicate more significance. A big-endian
16176 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
16177 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
16178 machines may have weird orders like 3412. A Cray will report 87654321,
16179 an Alpha will report 12345678. If the test program works the default is
16181 I'm now running the test program...
16185 #include <sys/types.h>
16186 typedef $uvtype UV;
16196 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
16198 u.l = (UV)0x04030201;
16199 for (i = 0; i < $uvsize; i++)
16200 printf("%c", u.c[i]+'0');
16207 if eval $compile && ./try > /dev/null; then
16210 [1-4][1-4][1-4][1-4]|12345678|87654321)
16211 echo "(The test program ran ok.)"
16212 echo "byteorder=$dflt"
16215 ????|????????) echo "(The test program ran ok.)" ;;
16216 *) echo "(The test program didn't run right for some reason.)" ;;
16221 (I can't seem to compile the test program. Guessing big-endian...)
16224 case "$xxx_prompt" in
16226 rp="What is the order of bytes in $uvtype?"
16242 Checking to see whether you can access character data unalignedly...
16244 case "$d_u32align" in
16245 '') $cat >try.c <<EOCP
16247 #define U32 $u32type
16248 #define BYTEORDER 0x$byteorder
16250 #include <signal.h>
16252 $signal_t bletch(s) int s; { exit(4); }
16255 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
16260 if (sizeof(U32) != 4) {
16261 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
16268 signal(SIGBUS, bletch);
16280 for (i = 0; i < 4; i++) {
16281 up = (U32*)(buf + i);
16282 if (! ((*up == 1 << (8*i)) || /* big-endian */
16283 (*up == 1 << (8*(3-i))) /* little-endian */
16287 printf("read failed (%x)\n", *up);
16293 for (i = 0; i < 4; i++) {
16294 up = (U32*)(buf + i);
16296 if (*up != 0xBeef) {
16297 printf("write failed (%x)\n", *up);
16311 if eval $compile_ok; then
16312 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
16313 $run ./try 2>&1 >/dev/null
16316 You can access character data pretty unalignedly.
16318 d_u32align="$undef"
16321 It seems that you must access character data in an aligned manner.
16323 d_u32align="$define"
16327 rp='Can you access character data at unaligned addresses?'
16331 [yY]*) d_u32align="$undef" ;;
16332 *) d_u32align="$define" ;;
16335 $rm -f core core.try.* try.core
16339 : see if ualarm exists
16340 set ualarm d_ualarm
16343 : see if umask exists
16347 : see if unordered exists
16348 set unordered d_unordered
16351 : see if usleep exists
16352 set usleep d_usleep
16355 : see if prototype for usleep is available
16357 set d_usleepproto usleep $i_unistd unistd.h
16360 : see if ustat exists
16364 : backward compatibility for d_hvfork
16365 if test X$d_hvfork != X; then
16366 d_vfork="$d_hvfork"
16369 : see if there is a vfork
16374 : Ok, but do we want to use it. vfork is reportedly unreliable in
16375 : perl on Solaris 2.x, and probably elsewhere.
16379 case "$usevfork" in
16385 Perl can only use a vfork() that doesn't suffer from strict
16386 restrictions on calling functions or modifying global data in
16387 the child. For example, glibc-2.1 contains such a vfork()
16388 that is unsuitable. If your system provides a proper fork()
16389 call, chances are that you do NOT want perl to use vfork().
16392 rp="Do you still want to use vfork()?"
16397 echo "Ok, we won't use vfork()."
16406 $define) usevfork='true';;
16407 *) usevfork='false';;
16410 : see if closedir exists
16411 set closedir d_closedir
16414 case "$d_closedir" in
16417 echo "Checking whether closedir() returns a status..." >&4
16419 #$i_dirent I_DIRENT /**/
16420 #$i_sysdir I_SYS_DIR /**/
16421 #$i_sysndir I_SYS_NDIR /**/
16422 #$i_systypes I_SYS_TYPES /**/
16424 #if defined(I_SYS_TYPES)
16425 #include <sys/types.h>
16427 #if defined(I_DIRENT)
16428 #include <dirent.h>
16429 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
16430 #include <sys/dir.h>
16434 #include <sys/ndir.h>
16438 #include <ndir.h> /* may be wrong in the future */
16440 #include <sys/dir.h>
16445 int main() { return closedir(opendir(".")); }
16448 if eval $compile_ok; then
16449 if $run ./try > /dev/null 2>&1 ; then
16450 echo "Yes, it does."
16453 echo "No, it doesn't."
16457 echo "(I can't seem to compile the test program--assuming it doesn't)"
16465 set d_void_closedir
16468 : see if there is a wait4
16472 : see if waitpid exists
16473 set waitpid d_waitpid
16476 : see if wcstombs exists
16477 set wcstombs d_wcstombs
16480 : see if wctomb exists
16481 set wctomb d_wctomb
16484 : see if writev exists
16485 set writev d_writev
16488 : preserve RCS keywords in files with variable substitution, grrr
16493 Revision='$Revision'
16495 : check for alignment requirements
16497 case "$usecrosscompile$multiarch" in
16500 You seem to be either cross-compiling or doing a multiarchitecture build,
16501 skipping the memory alignment check.
16504 case "$alignbytes" in
16505 '') alignbytes=8 ;;
16509 case "$alignbytes" in
16510 '') echo "Checking alignment constraints..." >&4
16511 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
16512 $cat >try.c <<'EOCP'
16513 typedef long double NV;
16516 $cat >try.c <<'EOCP'
16520 $cat >>try.c <<'EOCP'
16528 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
16533 if eval $compile_ok; then
16537 echo "(I can't seem to compile the test program...)"
16540 *) dflt="$alignbytes"
16543 rp="Doubles must be aligned on a how-many-byte boundary?"
16551 : set the base revision
16554 : how do we catenate cpp tokens here?
16556 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
16557 $cat >cpp_stuff.c <<'EOCP'
16558 #define RCAT(a,b)a/**/b
16559 #define ACAT(a,b)a ## b
16563 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
16564 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
16565 echo "Oh! Smells like ANSI's been here." >&4
16566 echo "We can catify or stringify, separately or together!"
16568 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
16569 echo "Ah, yes! The good old days!" >&4
16570 echo "However, in the good old days we don't know how to stringify and"
16571 echo "catify at the same time."
16575 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
16576 to have to edit the values of CAT[2-5] in config.h...
16578 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
16582 : see if this is a db.h system
16588 : Check db version.
16590 echo "Checking Berkeley DB version ..." >&4
16596 #include <sys/types.h>
16599 int main(int argc, char *argv[])
16601 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
16602 int Major, Minor, Patch ;
16603 unsigned long Version ;
16604 (void)db_version(&Major, &Minor, &Patch) ;
16606 printf("%d %d %d %d %d %d\n",
16607 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
16608 Major, Minor, Patch);
16611 printf("You have Berkeley DB Version 2 or greater.\n");
16613 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
16614 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
16615 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
16616 Major, Minor, Patch) ;
16618 /* check that db.h & libdb are compatible */
16619 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
16620 printf("db.h and libdb are incompatible.\n") ;
16624 printf("db.h and libdb are compatible.\n") ;
16626 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
16627 + DB_VERSION_PATCH ;
16629 /* needs to be >= 2.3.4 */
16630 if (Version < 2003004) {
16631 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
16632 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
16638 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
16643 printf("You have Berkeley DB Version 1.\n");
16644 exit(0); /* DB version < 2: the coast is clear. */
16646 exit(1); /* <db.h> not Berkeley DB? */
16652 if eval $compile_ok && $run ./try; then
16653 echo 'Looks OK.' >&4
16655 db_version_major=$1
16656 db_version_minor=$2
16657 db_version_patch=$3
16659 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
16663 : Remove db from list of libraries to use
16664 echo "Removing unusable -ldb from library list" >&4
16665 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
16668 echo "libs = $libs" >&4
16678 : Check the return type needed for hash
16680 echo "Checking return type needed for hash for Berkeley DB ..." >&4
16686 #include <sys/types.h>
16689 #ifndef DB_VERSION_MAJOR
16690 u_int32_t hash_cb (ptr, size)
16698 info.hash = hash_cb;
16702 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16703 if $contains warning try.out >>/dev/null 2>&1 ; then
16706 db_hashtype='u_int32_t'
16709 : XXX Maybe we should just give up here.
16710 db_hashtype=u_int32_t
16712 echo "Help: I can't seem to compile the db test program." >&4
16713 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
16716 echo "Your version of Berkeley DB uses $db_hashtype for hash."
16718 *) db_hashtype=u_int32_t
16723 : Check the return type needed for prefix
16725 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
16731 #include <sys/types.h>
16734 #ifndef DB_VERSION_MAJOR
16735 size_t prefix_cb (key1, key2)
16743 info.prefix = prefix_cb;
16747 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16748 if $contains warning try.out >>/dev/null 2>&1 ; then
16749 db_prefixtype='int'
16751 db_prefixtype='size_t'
16754 db_prefixtype='size_t'
16755 : XXX Maybe we should just give up here.
16757 echo "Help: I can't seem to compile the db test program." >&4
16758 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
16761 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
16763 *) db_prefixtype='size_t'
16768 : How can we generate normalized random numbers ?
16770 echo "Looking for a random number function..." >&4
16771 case "$randfunc" in
16773 if set drand48 val -f; eval $csym; $val; then
16775 echo "Good, found drand48()." >&4
16776 elif set random val -f; eval $csym; $val; then
16778 echo "OK, found random()." >&4
16781 echo "Yick, looks like I have to use rand()." >&4
16792 *-Dmy_rand=*|*-Dmy_srand=*)
16793 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
16794 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
16795 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
16796 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
16800 while $test "$cont"; do
16801 rp="Use which function to generate random numbers?"
16803 if $test "$ans" = "$dflt"; then
16809 if set $ans val -f; eval $csym; $val; then
16813 rp="I cannot find function $ans. Use that name anyway?"
16822 case "$randfunc" in
16824 drand01="drand48()"
16830 case "$randbits" in
16832 echo "Checking to see how many bits your $randfunc() function produces..." >&4
16834 #$i_unistd I_UNISTD
16835 #$i_stdlib I_STDLIB
16838 # include <unistd.h>
16841 # include <stdlib.h>
16846 register unsigned long tmp;
16847 register unsigned long max = 0L;
16849 for (i = 1000; i; i--) {
16850 tmp = (unsigned long) $randfunc();
16851 if (tmp > max) max = tmp;
16853 for (i = 0; max; i++)
16859 if eval $compile_ok; then
16863 echo "(I can't seem to compile the test program...)"
16870 rp="How many bits does your $randfunc() function produce?"
16874 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
16875 seedfunc="s$randfunc"
16876 randseedtype=unsigned
16880 rp="How many bits does your $randfunc() function produce?"
16883 seedfunc="s$randfunc"
16884 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
16885 if set $seedfunc val -f; eval $csym; $val; then
16886 echo "(Using $seedfunc() to seed random generator)"
16888 echo "(Warning: no $seedfunc() to seed random generator)"
16891 randseedtype=unsigned
16899 echo "Determining whether or not we are on an EBCDIC system..." >&4
16900 $cat >try.c <<'EOM'
16903 if ('M'==0xd4) return 0;
16910 if eval $compile_ok; then
16911 if $run ./try; then
16912 echo "You seem to speak EBCDIC." >&4
16915 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
16918 echo "I'm unable to compile the test program." >&4
16919 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
16927 Checking how to flush all pending stdio output...
16929 # I only know how to find the first 32 possibly open files on SunOS.
16930 # See also hints/sunos_4_1.sh and util.c --AD
16932 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
16934 $cat >>try.c <<EOCP
16936 #$i_unistd I_UNISTD
16938 # include <unistd.h>
16940 #$d_sysconf HAS_SYSCONF
16941 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
16942 #ifdef HAS_STDIO_STREAM_ARRAY
16943 # define STDIO_STREAM_ARRAY $stdio_stream_array
16948 p = fopen("try.out", "w");
16952 # ifdef TRY_FPRINTF
16956 #ifdef TRY_FFLUSH_NULL
16959 #ifdef TRY_FFLUSH_ALL
16961 long open_max = -1;
16962 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
16963 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
16965 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
16966 open_max = sysconf(_SC_OPEN_MAX);
16969 open_max = FOPEN_MAX;
16972 open_max = OPEN_MAX;
16981 # ifdef HAS_STDIO_STREAM_ARRAY
16982 if (open_max > 0) {
16984 for (i = 0; i < open_max; i++)
16985 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
16986 STDIO_STREAM_ARRAY[i]._file < open_max &&
16987 STDIO_STREAM_ARRAY[i]._flag)
16988 fflush(&STDIO_STREAM_ARRAY[i]);
16996 : first we have to find out how _not_ to flush
16998 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
17000 set try -DTRY_FPUTC
17001 if eval $compile; then
17002 $run ./try 2>/dev/null
17005 if $test ! -s try.out -a "X$code" = X42; then
17011 set try -DTRY_FPRINTF
17012 if eval $compile; then
17013 $run ./try 2>/dev/null
17016 if $test ! -s try.out -a "X$code" = X42; then
17017 output=-DTRY_FPRINTF
17023 : check for fflush NULL behaviour
17024 case "$fflushNULL" in
17025 '') set try -DTRY_FFLUSH_NULL $output
17026 if eval $compile; then
17027 $run ./try 2>/dev/null
17030 if $test -s try.out -a "X$code" = X42; then
17031 fflushNULL="`$cat try.out`"
17033 if $test "X$code" != X42; then
17035 (If this test failed, don't worry, we'll try another method shortly.)
17040 $rm -f core try.core core.try.*
17041 case "$fflushNULL" in
17043 Your fflush(NULL) works okay for output streams.
17044 Let's see if it clobbers input pipes...
17046 # As of mid-March 2000 all versions of Solaris appear to have a stdio
17047 # bug that improperly flushes the input end of pipes. So we avoid the
17048 # autoflush on fork/system/exec support for now. :-(
17049 $cat >tryp.c <<EOCP
17052 main(int argc, char **argv)
17058 while ((i = getc(stdin)) != -1
17059 && (*bp++ = i) != '\n'
17060 && bp < &buf[1024])
17063 fprintf(stdout, "%s", buf);
17071 fflushNULL="$define"
17073 if eval $compile; then
17075 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17076 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17078 fflush(NULL) seems to behave okay with input streams.
17080 fflushNULL="$define"
17083 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
17085 fflushNULL="$undef"
17088 $rm -f core tryp.c tryp.core core.tryp.*
17091 Your fflush(NULL) isn't working (contrary to ANSI C).
17093 fflushNULL="$undef"
17096 Cannot figure out whether your fflush(NULL) works or not.
17097 I'm assuming it doesn't (contrary to ANSI C).
17099 fflushNULL="$undef"
17103 $define|true|[yY]*)
17104 fflushNULL="$define"
17107 fflushNULL="$undef"
17110 : check explicit looping only if NULL did not work, and if the pipe
17111 : bug does not show up on an explicit flush too
17112 case "$fflushNULL" in
17114 $cat >tryp.c <<EOCP
17117 main(int argc, char **argv)
17123 while ((i = getc(stdin)) != -1
17124 && (*bp++ = i) != '\n'
17125 && bp < &buf[1024])
17128 fprintf(stdout, "%s", buf);
17137 if eval $compile; then
17139 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17140 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17142 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
17144 : now check for fflushall behaviour
17145 case "$fflushall" in
17146 '') set try -DTRY_FFLUSH_ALL $output
17147 if eval $compile; then
17149 (Now testing the other method--but note that this also may fail.)
17151 $run ./try 2>/dev/null
17154 if $test -s try.out -a "X$code" = X42; then
17155 fflushall="`$cat try.out`"
17158 $rm -f core try.core core.try.*
17159 case "$fflushall" in
17161 Whew. Flushing explicitly all the stdio streams works.
17163 fflushall="$define"
17166 Sigh. Flushing explicitly all the stdio streams doesn't work.
17171 Cannot figure out whether flushing stdio streams explicitly works or not.
17172 I'm assuming it doesn't.
17178 "$define"|true|[yY]*)
17179 fflushall="$define"
17187 All is futile. Even fflush(stdin) clobbers input pipes!
17194 $rm -f core tryp.c tryp.core core.tryp.*
17196 *) fflushall="$undef"
17200 case "$fflushNULL$fflushall" in
17203 OK, I give up. I cannot figure out how to flush pending stdio output.
17204 We won't be flushing handles at all before fork/exec/popen.
17208 $rm -f try.* try$exe_ext
17210 : Store the full pathname to the ar program for use in the C program
17211 : Respect a hint or command line value for full_ar.
17216 : Store the full pathname to the sed program for use in the C program
17219 : see what type gids are declared as in the kernel
17221 echo "Looking for the type for group ids returned by getgid()."
17222 set gid_t gidtype xxx stdio.h sys/types.h
17226 xxx=`./findhdr sys/user.h`
17227 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
17229 unsigned) dflt="$1 $2" ;;
17233 *) dflt="$gidtype";;
17236 gid_t) echo "gid_t found." ;;
17237 *) rp="What is the type for group ids returned by getgid()?"
17245 *_t) zzz="$gidtype" ;;
17248 echo "Checking the size of $zzz..." >&4
17250 #include <sys/types.h>
17253 printf("%d\n", (int)sizeof($gidtype));
17258 if eval $compile_ok; then
17262 echo "(I can't execute the test program--guessing $gidsize.)" >&4
17265 echo "Your $zzz is $gidsize bytes long."
17270 echo "(I can't compile the test program--guessing $gidsize.)" >&4
17276 *_t) zzz="$gidtype" ;;
17279 echo "Checking the sign of $zzz..." >&4
17281 #include <sys/types.h>
17292 if eval $compile; then
17296 echo "(I can't execute the test program--guessing unsigned.)" >&4
17300 1) echo "Your $zzz is unsigned." ;;
17301 -1) echo "Your $zzz is signed." ;;
17307 echo "(I can't compile the test program--guessing unsigned.)" >&4
17313 if $test X"$quadtype" != X; then
17315 echo "Checking how to print 64-bit integers..." >&4
17317 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
17318 $cat >try.c <<'EOCP'
17319 #include <sys/types.h>
17322 int q = 12345678901;
17323 printf("%ld\n", q);
17327 if eval $compile; then
17331 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
17332 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
17333 echo "We will use %d."
17339 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
17340 $cat >try.c <<'EOCP'
17341 #include <sys/types.h>
17344 long q = 12345678901;
17345 printf("%ld\n", q);
17349 if eval $compile; then
17353 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
17354 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
17355 echo "We will use %ld."
17361 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
17362 $cat >try.c <<'EOCP'
17363 #include <sys/types.h>
17364 #include <inttypes.h>
17367 int64_t q = 12345678901;
17368 printf("%" PRId64 "\n", q);
17372 if eval $compile; then
17376 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
17377 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
17378 echo "We will use the C9X style."
17384 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17386 #include <sys/types.h>
17389 $quadtype q = 12345678901;
17390 printf("%Ld\n", q);
17394 if eval $compile; then
17398 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
17399 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
17400 echo "We will use %Ld."
17406 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
17407 $cat >try.c <<'EOCP'
17408 #include <sys/types.h>
17411 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
17412 printf("%lld\n", q);
17416 if eval $compile; then
17420 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
17421 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
17422 echo "We will use the %lld style."
17428 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17430 #include <sys/types.h>
17433 $quadtype q = 12345678901;
17434 printf("%qd\n", q);
17438 if eval $compile; then
17442 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
17443 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
17444 echo "We will use %qd."
17450 if $test X"$sPRId64" = X; then
17451 echo "Cannot figure out how to print 64-bit integers." >&4
17459 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
17460 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
17462 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
17463 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
17469 $echo "Checking the format strings to be used for Perl's internal types..." >&4
17471 if $test X"$ivsize" = X8; then
17472 ivdformat="$sPRId64"
17473 uvuformat="$sPRIu64"
17474 uvoformat="$sPRIo64"
17475 uvxformat="$sPRIx64"
17476 uvXUformat="$sPRIXU64"
17478 if $test X"$ivsize" = X"$longsize"; then
17485 if $test X"$ivsize" = X"$intsize"; then
17493 if $test X"$ivsize" = X"$shortsize"; then
17504 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
17505 nveformat="$sPRIeldbl"
17506 nvfformat="$sPRIfldbl"
17507 nvgformat="$sPRIgldbl"
17508 nvEUformat="$sPRIEUldbl"
17509 nvFUformat="$sPRIFUldbl"
17510 nvGUformat="$sPRIGUldbl"
17520 case "$ivdformat" in
17521 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
17528 $echo "Checking the format string to be used for gids..." >&4
17531 -1) if $test X"$gidsize" = X"$ivsize"; then
17532 gidformat="$ivdformat"
17534 if $test X"$gidsize" = X"$longsize"; then
17537 if $test X"$gidsize" = X"$intsize"; then
17540 if $test X"$gidsize" = X"$shortsize"; then
17547 *) if $test X"$gidsize" = X"$uvsize"; then
17548 gidformat="$uvuformat"
17550 if $test X"$gidsize" = X"$longsize"; then
17553 if $test X"$gidsize" = X"$intsize"; then
17556 if $test X"$gidsize" = X"$shortsize"; then
17565 : see if getgroups exists
17566 set getgroups d_getgrps
17569 : see if setgroups exists
17570 set setgroups d_setgrps
17574 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
17576 case "$d_getgrps$d_setgrps" in
17578 case "$groupstype" in
17579 '') dflt="$gidtype" ;;
17580 *) dflt="$groupstype" ;;
17583 What type of pointer is the second argument to getgroups() and setgroups()?
17584 Usually this is the same as group ids, $gidtype, but not always.
17587 rp='What type pointer is the second argument to getgroups() and setgroups()?'
17591 *) groupstype="$gidtype";;
17595 echo "Checking if your $make program sets \$(MAKE)..." >&4
17596 case "$make_set_make" in
17598 $sed 's/^X //' > testmake.mak << 'EOF'
17600 X @echo 'maketemp="$(MAKE)"'
17602 case "`$make -f testmake.mak 2>/dev/null`" in
17603 *maketemp=*) make_set_make='#' ;;
17604 *) make_set_make="MAKE=$make" ;;
17606 $rm -f testmake.mak
17609 case "$make_set_make" in
17610 '#') echo "Yup, it does.";;
17611 *) echo "Nope, it doesn't.";;
17614 : see what type is used for mode_t
17615 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
17616 set mode_t modetype int stdio.h sys/types.h
17619 : see if stdarg is available
17621 if $test `./findhdr stdarg.h`; then
17622 echo "<stdarg.h> found." >&4
17625 echo "<stdarg.h> NOT found." >&4
17629 : see if varags is available
17631 if $test `./findhdr varargs.h`; then
17632 echo "<varargs.h> found." >&4
17634 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
17637 : set up the varargs testing programs
17638 $cat > varargs.c <<EOP
17640 #include <stdarg.h>
17643 #include <varargs.h>
17647 int f(char *p, ...)
17661 p = va_arg(ap, char *);
17666 $cat > varargs <<EOP
17668 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
17677 : now check which varargs header should be included
17682 if `./varargs I_STDARG`; then
17684 elif `./varargs I_VARARGS`; then
17689 if `./varargs I_VARARGS`; then
17696 echo "I could not find the definition for va_dcl... You have problems..." >&4
17697 val="$undef"; set i_stdarg; eval $setvar
17698 val="$undef"; set i_varargs; eval $setvar
17703 case "$i_varhdr" in
17705 val="$define"; set i_stdarg; eval $setvar
17706 val="$undef"; set i_varargs; eval $setvar
17709 val="$undef"; set i_stdarg; eval $setvar
17710 val="$define"; set i_varargs; eval $setvar
17713 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
17717 : see if we need va_copy
17719 case "$i_stdarg" in
17722 #include <stdarg.h>
17724 #$i_stdlib I_STDLIB
17726 #include <stdlib.h>
17728 #include <signal.h>
17731 ivfprintf(FILE *f, const char *fmt, va_list *valp)
17733 return vfprintf(f, fmt, *valp);
17737 myvfprintf(FILE *f, const char *fmt, va_list val)
17739 return ivfprintf(f, fmt, &val);
17743 myprintf(char *fmt, ...)
17746 va_start(val, fmt);
17747 return myvfprintf(stdout, fmt, val);
17751 main(int ac, char **av)
17753 signal(SIGSEGV, exit);
17755 myprintf("%s%cs all right, then\n", "that", '\'');
17760 if eval $compile && $run ./try 2>&1 >/dev/null; then
17761 case "`$run ./try`" in
17762 "that's all right, then")
17768 yes) echo "It seems that you don't need va_copy()." >&4
17769 need_va_copy="$undef"
17771 *) echo "It seems that va_copy() or similar will be needed." >&4
17772 need_va_copy="$define"
17775 $rm -f try.* core core.* *.core *.core.*
17777 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
17781 : see what type is used for size_t
17782 rp="What is the type used for the length parameter for string functions?"
17783 set size_t sizetype 'unsigned int' stdio.h sys/types.h
17786 : check for type of arguments to gethostbyaddr.
17787 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
17788 case "$d_gethbyaddr" in
17792 Checking to see what type of arguments are accepted by gethostbyaddr().
17794 hdrs="$define sys/types.h
17795 $d_socket sys/socket.h
17796 $i_niin netinet/in.h
17798 $i_unistd unistd.h"
17799 : The first arg can 'char *' or 'void *'
17800 : The second arg is some of integral type
17801 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
17802 for yyy in size_t long int; do
17803 case "$netdb_host_type" in
17804 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
17805 if ./protochk "$try" $hdrs; then
17806 echo "Your system accepts $xxx for the first arg."
17807 echo "...and $yyy for the second arg."
17808 netdb_host_type="$xxx"
17809 netdb_hlen_type="$yyy"
17815 : In case none of those worked, prompt the user.
17816 case "$netdb_host_type" in
17817 '') rp='What is the type for the 1st argument to gethostbyaddr?'
17820 netdb_host_type=$ans
17821 rp='What is the type for the 2nd argument to gethostbyaddr?'
17824 netdb_hlen_type=$ans
17828 *) : no gethostbyaddr, so pick harmless defaults
17829 netdb_host_type='char *'
17830 netdb_hlen_type="$sizetype"
17833 # Remove the "const" if needed. -- but then we'll have a
17835 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
17838 : check for type of argument to gethostbyname.
17839 if test "X$netdb_name_type" = X ; then
17840 case "$d_gethbyname" in
17844 Checking to see what type of argument is accepted by gethostbyname().
17846 hdrs="$define sys/types.h
17847 $d_socket sys/socket.h
17848 $i_niin netinet/in.h
17850 $i_unistd unistd.h"
17851 for xxx in "const char *" "char *"; do
17852 case "$netdb_name_type" in
17853 '') try="extern struct hostent *gethostbyname($xxx);"
17854 if ./protochk "$try" $hdrs; then
17855 echo "Your system accepts $xxx."
17856 netdb_name_type="$xxx"
17861 : In case none of those worked, prompt the user.
17862 case "$netdb_name_type" in
17863 '') rp='What is the type for the 1st argument to gethostbyname?'
17866 netdb_name_type=$ans
17870 *) : no gethostbyname, so pick harmless default
17871 netdb_name_type='char *'
17876 : check for type of 1st argument to getnetbyaddr.
17877 if test "X$netdb_net_type" = X ; then
17878 case "$d_getnbyaddr" in
17882 Checking to see what type of 1st argument is accepted by getnetbyaddr().
17884 hdrs="$define sys/types.h
17885 $d_socket sys/socket.h
17886 $i_niin netinet/in.h
17888 $i_unistd unistd.h"
17889 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
17890 case "$netdb_net_type" in
17891 '') try="extern struct netent *getnetbyaddr($xxx, int);"
17892 if ./protochk "$try" $hdrs; then
17893 echo "Your system accepts $xxx."
17894 netdb_net_type="$xxx"
17899 : In case none of those worked, prompt the user.
17900 case "$netdb_net_type" in
17901 '') rp='What is the type for the 1st argument to getnetbyaddr?'
17904 netdb_net_type=$ans
17908 *) : no getnetbyaddr, so pick harmless default
17909 netdb_net_type='long'
17913 : locate the preferred pager for this system
17920 [a-zA-Z]:/*) dflt=$pg;;
17924 [a-zA-Z]:/*) dflt=$more;;
17928 [a-zA-Z]:/*) dflt=$less;;
17931 '') dflt=/usr/ucb/more;;
17935 : Instruct ./getfile to trust the hinted or previous pager value,
17936 : even if it does not begin with a slash. For example, on os2,
17937 : pager might be cmd /c more. See comments in UU/getfile.
17942 rp='What pager is used on your system?'
17946 : see what type pids are declared as in the kernel
17947 rp="What is the type of process ids on this system?"
17948 set pid_t pidtype int stdio.h sys/types.h
17951 : Find earliest binary compatible site_perl subdirectory perl can use.
17952 xs_apiversion=$version # The current site_perl version.
17953 : Find earliest pure perl site_perl subdirectory perl can use.
17954 : The versioned directories started at 5.005.
17955 pm_apiversion='5.005'
17957 : see if ar generates random libraries by itself
17959 echo "Checking how to generate random libraries on your machine..." >&4
17960 echo 'int bar1() { return bar2(); }' > bar1.c
17961 echo 'int bar2() { return 2; }' > bar2.c
17962 $cat > foo.c <<'EOP'
17963 int main() { printf("%d\n", bar1()); exit(0); }
17965 $cc $ccflags -c bar1.c >/dev/null 2>&1
17966 $cc $ccflags -c bar2.c >/dev/null 2>&1
17967 $cc $ccflags -c foo.c >/dev/null 2>&1
17968 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
17969 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
17970 $run ./foobar >/dev/null 2>&1; then
17971 echo "$ar appears to generate random libraries itself."
17974 elif $ar ts bar$_a >/dev/null 2>&1 &&
17975 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
17976 $run ./foobar >/dev/null 2>&1; then
17977 echo "a table of contents needs to be added with '$ar ts'."
17984 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
17985 $test -f $ranlib || ranlib=''
17988 if $test -n "$ranlib"; then
17989 echo "your system has '$ranlib'; we'll use that."
17992 echo "your system doesn't seem to support random libraries"
17993 echo "so we'll use lorder and tsort to order the libraries."
18000 : check for type of arguments to select.
18001 case "$selecttype" in
18002 '') case "$d_select" in
18006 Checking to see what type of arguments are accepted by select().
18008 hdrs="$define sys/types.h
18009 $i_systime sys/time.h
18010 $i_sysselct sys/select.h
18011 $d_socket sys/socket.h"
18012 : The first arg can be int, unsigned, or size_t
18013 : The last arg may or may not be 'const'
18015 : void pointer has been seen but using that
18016 : breaks the selectminbits test
18017 for xxx in 'fd_set *' 'int *'; do
18018 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
18019 for tmo in 'struct timeval *' 'const struct timeval *'; do
18021 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
18022 if ./protochk "$try" $hdrs; then
18023 echo "Your system accepts $xxx."
18032 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
18033 case "$d_fd_set" in
18034 $define) dflt="fd_set *" ;;
18043 *) : no select, so pick a harmless default
18050 : check for the select 'width'
18051 case "$selectminbits" in
18052 '') case "$d_select" in
18056 Checking to see on how many bits at a time your select() operates...
18059 #include <sys/types.h>
18061 #$i_systime I_SYS_TIME
18062 #$i_systimek I_SYS_TIME_KERNEL
18067 # ifdef I_SYS_TIME_KERNEL
18070 # include <sys/time.h>
18071 # ifdef I_SYS_TIME_KERNEL
18075 #$i_sysselct I_SYS_SELECT
18076 #ifdef I_SYS_SELECT
18077 #include <sys/select.h>
18079 #$d_socket HAS_SOCKET
18081 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
18085 #define S sizeof(*(b))
18087 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
18088 #define NBITS (NBYTES * 8)
18097 fp = fopen("try.c", "r");
18103 b = ($selecttype)s;
18104 for (i = 0; i < NBITS; i++)
18108 select(fd + 1, b, 0, 0, &t);
18109 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
18110 printf("%d\n", i + 1);
18115 if eval $compile_ok; then
18116 selectminbits=`$run ./try`
18117 case "$selectminbits" in
18119 Cannot figure out on how many bits at a time your select() operates.
18120 I'll play safe and guess it is 32 bits.
18126 *) bits="$selectminbits bits" ;;
18128 echo "Your select() operates on $bits at a time." >&4
18130 rp='What is the minimum number of bits your select() operates on?'
18131 case "$byteorder" in
18132 1234|12345678) dflt=32 ;;
18137 selectminbits="$val"
18141 *) : no select, so pick a harmless default
18148 : Trace out the files included by signal.h, then look for SIGxxx names.
18149 : Remove SIGARRAYSIZE used by HPUX.
18150 : Remove SIGSTKSIZE used by Linux.
18151 : Remove SIGSTKSZ used by Posix.
18152 : Remove SIGTYP void lines used by OS2.
18153 : Some cpps, like os390, dont give the file name anywhere
18154 if [ "X$fieldn" = X ]; then
18155 : Just make some guesses. We check them later.
18156 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
18158 xxx=`echo '#include <signal.h>' |
18159 $cppstdin $cppminus $cppflags 2>/dev/null |
18160 $grep '^[ ]*#.*include' |
18161 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
18163 : Check this list of files to be sure we have parsed the cpp output ok.
18164 : This will also avoid potentially non-existent files, such
18167 for xx in $xxx /dev/null ; do
18168 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
18170 : If we have found no files, at least try signal.h
18171 case "$xxxfiles" in
18172 '') xxxfiles=`./findhdr signal.h` ;;
18175 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
18176 print substr($2, 4, 20)
18178 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
18179 print substr($3, 4, 20)
18181 : Append some common names just in case the awk scan failed.
18182 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
18183 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
18184 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
18185 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
18186 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
18188 : generate a few handy files for later
18189 $cat > signal.c <<'EOCP'
18190 #include <sys/types.h>
18191 #include <signal.h>
18195 /* Strange style to avoid deeply-nested #if/#else/#endif */
18198 # define NSIG (_NSIG)
18204 # define NSIG (SIGMAX+1)
18210 # define NSIG (SIG_MAX+1)
18216 # define NSIG (MAXSIG+1)
18222 # define NSIG (MAX_SIG+1)
18227 # ifdef SIGARRAYSIZE
18228 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
18234 # define NSIG (_sys_nsig) /* Solaris 2.5 */
18238 /* Default to some arbitrary number that's big enough to get most
18239 of the common signals.
18245 printf("NSIG %d\n", NSIG);
18251 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
18253 printf "#ifdef SIG"; printf $1; printf "\n"
18254 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
18255 printf $1; printf ");\n"
18259 printf "#endif /* JUST_NSIG */\n";
18260 printf "exit(0);\n}\n";
18263 $cat >signal.awk <<'EOP'
18264 BEGIN { ndups = 0 }
18265 $1 ~ /^NSIG$/ { nsig = $2 }
18266 ($1 !~ /^NSIG$/) && (NF == 2) {
18267 if ($2 > maxsig) { maxsig = $2 }
18268 if (sig_name[$2]) {
18269 dup_name[ndups] = $1
18270 dup_num[ndups] = $2
18282 printf("NSIG %d\n", nsig);
18283 for (n = 1; n < nsig; n++) {
18285 printf("%s %d\n", sig_name[n], sig_num[n])
18288 printf("NUM%d %d\n", n, n)
18291 for (n = 0; n < ndups; n++) {
18292 printf("%s %d\n", dup_name[n], dup_num[n])
18296 $cat >signal_cmd <<EOS
18298 if $test -s signal.lst; then
18299 echo "Using your existing signal.lst file"
18304 $cat >>signal_cmd <<'EOS'
18307 if eval $compile_ok; then
18308 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
18310 echo "(I can't seem be able to compile the whole test program)" >&4
18311 echo "(I'll try it in little pieces.)" >&4
18312 set signal -DJUST_NSIG
18313 if eval $compile_ok; then
18314 $run ./signal$_exe > signal.nsg
18317 echo "I can't seem to figure out how many signals you have." >&4
18318 echo "Guessing 50." >&4
18319 echo 'NSIG 50' > signal.nsg
18321 : Now look at all the signal names, one at a time.
18322 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
18323 $cat > signal.c <<EOCP
18324 #include <sys/types.h>
18325 #include <signal.h>
18328 printf("$xx %d\n", SIG${xx});
18333 if eval $compile; then
18334 echo "SIG${xx} found."
18335 $run ./signal$_exe >> signal.ls1
18337 echo "SIG${xx} NOT found."
18340 if $test -s signal.ls1; then
18341 $cat signal.nsg signal.ls1 |
18342 $sort -n | $uniq | $awk -f signal.awk >signal.lst
18346 if $test -s signal.lst; then
18349 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
18350 echo 'kill -l' >signal
18351 set X `csh -f <signal`
18355 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
18357 echo $@ | $tr ' ' $trnl | \
18358 $awk '{ printf "%s %d\n", $1, ++s; }
18359 END { printf "NSIG %d\n", ++s }' >signal.lst
18361 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
18363 chmod a+x signal_cmd
18364 $eunicefix signal_cmd
18366 : generate list of signal names
18368 case "$sig_name_init" in
18370 *) case "$sig_num_init" in
18371 ''|*,*) doinit=yes ;;
18376 echo "Generating a list of signal names and numbers..." >&4
18378 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
18379 sig_name=`$awk 'BEGIN { printf "ZERO " }
18380 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
18381 sig_num=`$awk 'BEGIN { printf "0 " }
18382 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
18383 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
18384 !/^NSIG/ { printf "\"%s\", ", $1 }
18385 END { printf "0\n" }' signal.lst`
18386 sig_num_init=`$awk 'BEGIN { printf "0, " }
18387 !/^NSIG/ { printf "%d, ", $2}
18388 END { printf "0\n"}' signal.lst`
18391 echo "The following $sig_count signals are available:"
18393 echo $sig_name | $awk \
18394 'BEGIN { linelen = 0 }
18396 for (i = 1; i <= NF; i++) {
18397 name = "SIG" $i " "
18398 linelen = linelen + length(name)
18399 if (linelen > 70) {
18401 linelen = length(name)
18407 sig_size=`echo $sig_name | awk '{print NF}'`
18408 $rm -f signal signal.c signal.awk signal.lst signal_cmd
18411 case "$sizetype" in
18412 *_t) zzz="$sizetype" ;;
18413 *) zzz="filesize" ;;
18415 echo "Checking the size of $zzz..." >&4
18417 #include <sys/types.h>
18420 printf("%d\n", (int)sizeof($sizetype));
18425 if eval $compile_ok; then
18429 echo "(I can't execute the test program--guessing $sizesize.)" >&4
18432 echo "Your $zzz size is $sizesize bytes."
18437 echo "(I can't compile the test program--guessing $sizesize.)" >&4
18441 : check for socklen_t
18443 echo "Checking to see if you have socklen_t..." >&4
18445 #include <sys/types.h>
18446 #$d_socket HAS_SOCKET
18448 #include <sys/socket.h>
18450 int main() { socklen_t x = 16; }
18453 if eval $compile; then
18455 echo "You have socklen_t."
18458 echo "You do not have socklen_t."
18459 case "$sizetype" in
18460 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
18467 : see if this is a socks.h system
18468 set socks.h i_socks
18471 : check for type of the size argument to socket calls
18472 case "$d_socket" in
18476 Checking to see what type is the last argument of accept().
18479 case "$d_socklen_t" in
18480 "$define") yyy="$yyy socklen_t"
18482 yyy="$yyy $sizetype int long unsigned"
18483 for xxx in $yyy; do
18484 case "$socksizetype" in
18485 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
18486 case "$usesocks" in
18488 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
18489 echo "Your system accepts '$xxx *' for the last argument of accept()."
18490 socksizetype="$xxx"
18493 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
18494 echo "Your system accepts '$xxx *' for the last argument of accept()."
18495 socksizetype="$xxx"
18502 : In case none of those worked, prompt the user.
18503 case "$socksizetype" in
18504 '') rp='What is the type for socket address structure sizes?'
18511 *) : no sockets, so pick relatively harmless default
18516 : see what type is used for signed size_t
18517 set ssize_t ssizetype int stdio.h sys/types.h
18522 #include <sys/types.h>
18523 #define Size_t $sizetype
18524 #define SSize_t $dflt
18527 if (sizeof(Size_t) == sizeof(SSize_t))
18529 else if (sizeof(Size_t) == sizeof(int))
18538 if eval $compile_ok && $run ./try > /dev/null; then
18539 ssizetype=`$run ./try`
18540 echo "I'll be using $ssizetype for functions returning a byte count." >&4
18543 Help! I can't compile and run the ssize_t test program: please enlighten me!
18544 (This is probably a misconfiguration in your system or libraries, and
18545 you really ought to fix it. Still, I'll try anyway.)
18547 I need a type that is the same size as $sizetype, but is guaranteed to
18548 be signed. Common values are ssize_t, int and long.
18551 rp="What signed type is the same size as $sizetype?"
18557 : see what type of char stdio uses.
18559 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
18560 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
18561 echo "Your stdio uses unsigned chars." >&4
18562 stdchar="unsigned char"
18564 echo "Your stdio uses signed chars." >&4
18571 : see what type uids are declared as in the kernel
18573 echo "Looking for the type for user ids returned by getuid()."
18574 set uid_t uidtype xxx stdio.h sys/types.h
18578 xxx=`./findhdr sys/user.h`
18579 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18581 unsigned) dflt="$1 $2" ;;
18585 *) dflt="$uidtype";;
18588 uid_t) echo "uid_t found." ;;
18589 *) rp="What is the type for user ids returned by getuid()?"
18597 *_t) zzz="$uidtype" ;;
18600 echo "Checking the size of $zzz..." >&4
18602 #include <sys/types.h>
18605 printf("%d\n", (int)sizeof($uidtype));
18610 if eval $compile_ok; then
18614 echo "(I can't execute the test program--guessing $uidsize.)" >&4
18617 echo "Your $zzz is $uidsize bytes long."
18622 echo "(I can't compile the test program--guessing $uidsize.)" >&4
18627 *_t) zzz="$uidtype" ;;
18630 echo "Checking the sign of $zzz..." >&4
18632 #include <sys/types.h>
18643 if eval $compile; then
18647 echo "(I can't execute the test program--guessing unsigned.)" >&4
18651 1) echo "Your $zzz is unsigned." ;;
18652 -1) echo "Your $zzz is signed." ;;
18658 echo "(I can't compile the test program--guessing unsigned.)" >&4
18664 $echo "Checking the format string to be used for uids..." >&4
18667 -1) if $test X"$uidsize" = X"$ivsize"; then
18668 uidformat="$ivdformat"
18670 if $test X"$uidsize" = X"$longsize"; then
18673 if $test X"$uidsize" = X"$intsize"; then
18676 if $test X"$uidsize" = X"$shortsize"; then
18683 *) if $test X"$uidsize" = X"$uvsize"; then
18684 uidformat="$uvuformat"
18686 if $test X"$uidsize" = X"$longsize"; then
18689 if $test X"$uidsize" = X"$intsize"; then
18692 if $test X"$uidsize" = X"$shortsize"; then
18701 : determine compiler compiler
18710 if $test -f "$byacc$_exe"; then
18712 comp="byacc or $comp"
18714 if $test -f "$bison$_exe"; then
18715 comp="$comp or bison -y"
18717 rp="Which compiler compiler ($comp) shall I use?"
18726 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
18732 : see if this is a fp.h system
18736 : see if this is a fp_class.h system
18737 set fp_class.h i_fp_class
18740 : see if this is a ieeefp.h system
18741 case "$i_ieeefp" in
18742 '' ) set ieeefp.h i_ieeefp
18747 : see if this is a libutil.h system
18748 set libutil.h i_libutil
18751 : see if mach cthreads are available
18752 if test "X$usethreads" = "X$define"; then
18753 set mach/cthreads.h i_machcthr
18756 i_machcthr="$undef"
18761 : see if this is a math.h system
18765 : see if this is a mntent.h system
18766 set mntent.h i_mntent
18769 : see if ndbm.h is available
18775 # Some Linux distributions such as RedHat 7.1 put the
18776 # ndbm.h header in /usr/include/gdbm/ndbm.h.
18777 if $test -f /usr/include/gdbm/ndbm.h; then
18778 echo '<gdbm/ndbm.h> found.'
18779 ccflags="$ccflags -I/usr/include/gdbm"
18780 cppflags="$cppflags -I/usr/include/gdbm"
18788 : see if dbm_open exists
18789 set dbm_open d_dbm_open
18791 case "$d_dbm_open" in
18794 echo "We won't be including <ndbm.h>"
18803 : see if net/errno.h is available
18805 set net/errno.h val
18808 : Unfortunately, it causes problems on some systems. Arrgh.
18811 cat > try.c <<'EOM'
18814 #include <net/errno.h>
18820 if $cc $ccflags -c try.c >/dev/null 2>&1; then
18821 echo "We'll be including <net/errno.h>." >&4
18823 echo "We won't be including <net/errno.h>." >&4
18832 : see if netinet/tcp.h is available
18833 set netinet/tcp.h i_netinettcp
18836 : see if this is a poll.h system
18840 : see if this is a prot.h system
18845 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
18846 $cat <<'EOSH' > Cppsym.know
18847 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
18848 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
18849 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
18850 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
18851 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
18852 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
18853 bull c cadmus clipper CMU COFF COMPILER_VERSION
18854 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
18855 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
18856 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
18857 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
18859 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
18860 H3050R H3050RX hbullx20 hcx host_mips
18861 hp200 hp300 hp700 HP700 hp800 hp9000
18862 hp9000s200 hp9000s300 hp9000s400 hp9000s500
18863 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
18864 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
18865 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
18866 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
18867 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
18868 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
18869 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
18870 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
18871 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
18872 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
18873 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
18874 MATH_HAS_NO_SIDE_EFFECTS
18875 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
18876 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
18877 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
18878 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
18879 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
18880 NetBSD news1500 news1700 news1800 news1900 news3700
18881 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
18882 ns32016 ns32332 ns32k nsc32000
18883 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
18884 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
18885 pc532 pdp11 PGC PIC plexus PORTAR posix
18886 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
18887 POSIX_C_SOURCE POSIX_SOURCE POWER
18888 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
18889 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
18890 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
18891 sony sony_news sonyrisc sparc sparclite spectrum
18892 stardent stdc STDC_EXT stratos sun sun3 sun386
18893 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
18894 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
18895 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
18896 sysV68 sysV88 Tek4132 Tek4300 titan
18897 TM3200 TM5400 TM5600
18898 tower tower32 tower32_200 tower32_600 tower32_700
18899 tower32_800 tower32_850 tss
18900 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
18901 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
18902 unix UNIX95 UNIX99 unixpc unos
18903 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
18904 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
18905 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
18907 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
18908 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
18909 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
18912 # Maybe put other stuff here too.
18913 cat <<EOSH >>Cppsym.know
18916 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
18917 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
18918 $cat Cppsym.know > Cppsym.c
18919 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
18920 $rm -f Cppsym.a Cppsym.b Cppsym.c
18921 cat <<EOSH > Cppsym
18923 if $test \$# -gt 0; then
18924 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
18925 if $test -s Cppsym.got; then
18932 $tr " " "$trnl" | ./Cppsym.try
18938 cat <<EOSH > Cppsym.try
18940 cat <<'EOCP' > try.c
18946 cat <<'EOSH' >> Cppsym.try
18948 printf "#ifdef %s\n#if %s+0\nprintf(\"%s=%%ld\\n\", (long)%s);\n#else\nprintf(\"%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
18949 printf "#ifdef _%s\n#if _%s+0\nprintf(\"_%s=%%ld\\n\", (long)_%s);\n#else\nprintf(\"_%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
18950 printf "#ifdef __%s\n#if __%s+0\nprintf(\"__%s=%%ld\\n\", (long)__%s);\n#else\nprintf(\"__%s\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
18951 printf "#ifdef __%s__\n#if __%s__+0\nprintf(\"__%s__=%%ld\\n\", (long)__%s__);\n#else\nprintf(\"__%s__\\n\");\n#endif\n#endif\n", $1, $1, $1, $1, $1
18953 echo 'return 0;}' >> try.c
18955 cat <<EOSH >> Cppsym.try
18957 case "$osname-$gccversion" in
18958 irix-) ccflags="\$ccflags -woff 1178" ;;
18959 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
18961 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
18963 chmod +x Cppsym.try
18964 $eunicefix Cppsym.try
18965 ./Cppsym < Cppsym.know > Cppsym.true
18966 : now check the C compiler for additional symbols
18967 postprocess_cc_v=''
18969 aix) postprocess_cc_v="|$tr , ' '" ;;
18976 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
18979 -D*) echo "\$i" | $sed 's/^-D//';;
18980 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
18985 postprocess_cc_v=''
18988 ./ccsym > ccsym1.raw
18989 if $test -s ccsym1.raw; then
18990 $sort ccsym1.raw | $uniq >ccsym.raw
18992 mv ccsym1.raw ccsym.raw
18995 $awk '/\=/ { print $0; next }
18996 { print $0"=1" }' ccsym.raw >ccsym.list
18997 $awk '/\=/ { print $0; next }
18998 { print $0"=1" }' Cppsym.true >ccsym.true
18999 $comm -13 ccsym.true ccsym.list >ccsym.own
19000 $comm -12 ccsym.true ccsym.list >ccsym.com
19001 $comm -23 ccsym.true ccsym.list >ccsym.cpp
19003 if $test -z ccsym.raw; then
19004 echo "Your C compiler doesn't seem to define any symbols!" >&4
19006 echo "However, your C preprocessor defines the following symbols:"
19009 cppsymbols=`$cat Cppsym.true`
19010 cppsymbols=`echo $cppsymbols`
19011 cppccsymbols="$cppsymbols"
19013 if $test -s ccsym.com; then
19014 echo "Your C compiler and pre-processor define these symbols:"
19015 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
19018 cppccsymbols=`$cat ccsym.com`
19019 cppccsymbols=`echo $cppccsymbols`
19020 $test "$silent" || sleep 1
19022 if $test -s ccsym.cpp; then
19023 $test "$also" && echo " "
19024 echo "Your C pre-processor ${also}defines the following symbols:"
19025 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
19027 cppsymbols=`$cat ccsym.cpp`
19028 cppsymbols=`echo $cppsymbols`
19029 $test "$silent" || sleep 1
19031 if $test -s ccsym.own; then
19032 $test "$also" && echo " "
19033 echo "Your C compiler ${also}defines the following cpp symbols:"
19034 $sed -e 's/\(..*\)=1/\1/' ccsym.own
19035 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
19036 ccsymbols=`$cat ccsym.own`
19037 ccsymbols=`echo $ccsymbols`
19038 $test "$silent" || sleep 1
19042 : see if this is a termio system
19046 if $test `./findhdr termios.h`; then
19047 set tcsetattr i_termios
19053 "$define") echo "You have POSIX termios.h... good!" >&4;;
19054 *) if ./Cppsym pyr; then
19055 case "`/bin/universe`" in
19056 ucb) if $test `./findhdr sgtty.h`; then
19058 echo "<sgtty.h> found." >&4
19060 echo "System is pyramid with BSD universe."
19061 echo "<sgtty.h> not found--you could have problems." >&4
19063 *) if $test `./findhdr termio.h`; then
19065 echo "<termio.h> found." >&4
19067 echo "System is pyramid with USG universe."
19068 echo "<termio.h> not found--you could have problems." >&4
19072 if $test `./findhdr termio.h`; then
19073 echo "<termio.h> found." >&4
19075 elif $test `./findhdr sgtty.h`; then
19076 echo "<sgtty.h> found." >&4
19079 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
19082 if $test `./findhdr sgtty.h`; then
19083 echo "<sgtty.h> found." >&4
19085 elif $test `./findhdr termio.h`; then
19086 echo "<termio.h> found." >&4
19089 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
19093 set i_termio; eval $setvar
19094 val=$val2; set i_sgtty; eval $setvar
19095 val=$val3; set i_termios; eval $setvar
19097 : see if stddef is available
19098 set stddef.h i_stddef
19101 : see if this is a sunmath.h system
19102 set sunmath.h i_sunmath
19105 : see if sys/access.h is available
19106 set sys/access.h i_sysaccess
19109 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
19110 set sys/filio.h i_sysfilio
19113 if $test `./findhdr sys/ioctl.h`; then
19115 echo '<sys/ioctl.h> found.' >&4
19118 if $test $i_sysfilio = "$define"; then
19119 echo '<sys/ioctl.h> NOT found.' >&4
19121 $test $i_sgtty = "$define" && xxx="sgtty.h"
19122 $test $i_termio = "$define" && xxx="termio.h"
19123 $test $i_termios = "$define" && xxx="termios.h"
19124 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
19130 : see if socket ioctl defs are in sys/sockio.h
19132 xxx=`./findhdr sys/sockio.h`
19133 if $test "$xxx"; then
19134 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
19136 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
19139 echo "No socket ioctls found in <sys/sockio.h>." >&4
19144 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
19151 : see if this is a syslog.h system
19152 set syslog.h i_syslog
19156 : see if this is a sys/mode.h system
19157 set sys/mode.h i_sysmode
19160 : see if sys/resource.h has to be included
19161 set sys/resource.h i_sysresrc
19164 : see if sys/security.h is available
19165 set sys/security.h i_syssecrt
19168 : see if this is a sys/statvfs.h system
19169 set sys/statvfs.h i_sysstatvfs
19172 : see if this is a sys/un.h system
19173 set sys/un.h i_sysun
19177 : see if this is a sys/utsname.h system
19178 set sys/utsname.h i_sysutsname
19181 : see if this is a syswait system
19182 set sys/wait.h i_syswait
19185 : see if this is a ustat.h system
19186 set ustat.h i_ustat
19189 : see if this is an utime system
19190 set utime.h i_utime
19193 : see if this is a values.h system
19194 set values.h i_values
19197 : see if this is a vfork system
19200 set vfork.h i_vfork
19208 : see if gdbm.h is available
19213 : see if gdbm_open exists
19214 set gdbm_open d_gdbm_open
19216 case "$d_gdbm_open" in
19219 echo "We won't be including <gdbm.h>"
19229 echo "Looking for extensions..." >&4
19230 : If we are using the old config.sh, known_extensions may contain
19231 : old or inaccurate or duplicate values.
19232 known_extensions=''
19233 nonxs_extensions=''
19234 : We do not use find because it might not be available.
19235 : We do not just use MANIFEST because the user may have dropped
19236 : some additional extensions into the source tree and expect them
19239 : Function to recursively find available extensions, ignoring DynaLoader
19240 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
19244 DynaLoader|dynaload) ;;
19246 if $test -f $xxx/$xxx.xs; then
19247 known_extensions="$known_extensions $1$xxx";
19248 elif $test -f $xxx/Makefile.PL; then
19249 nonxs_extensions="$nonxs_extensions $1$xxx";
19251 if $test -d $xxx -a $# -lt 10; then
19254 eval $find_extensions;
19266 eval $find_extensions
19267 # Special case: Add in threads/shared since it is not picked up by the
19268 # recursive find above (and adding in general recursive finding breaks
19269 # SDBM_File/sdbm). A.D. 10/25/2001.
19270 known_extensions="$known_extensions threads/shared"
19271 set X $nonxs_extensions
19273 nonxs_extensions="$*"
19274 set X $known_extensions
19276 known_extensions="$*"
19279 : Now see which are supported on this system.
19281 for xxx in $known_extensions ; do
19285 $define) avail_ext="$avail_ext $xxx" ;;
19288 GDBM_File|gdbm_fil)
19290 $define) avail_ext="$avail_ext $xxx" ;;
19293 I18N/Langinfo|i18n_lan)
19294 case "$i_langinfo$d_nl_langinfo" in
19295 $define$define) avail_ext="$avail_ext $xxx" ;;
19298 NDBM_File|ndbm_fil)
19301 case "$osname-$use64bitint" in
19302 cygwin-*|hpux-define)
19304 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
19307 *) avail_ext="$avail_ext $xxx" ;;
19312 ODBM_File|odbm_fil)
19313 case "${i_dbm}${i_rpcsvcdbm}" in
19315 case "$osname-$use64bitint" in
19316 cygwin-*|hpux-define)
19318 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
19321 *) avail_ext="$avail_ext $xxx" ;;
19327 case "$useposix" in
19328 true|define|y) avail_ext="$avail_ext $xxx" ;;
19332 case "$useopcode" in
19333 true|define|y) avail_ext="$avail_ext $xxx" ;;
19337 case "$d_socket" in
19340 beos) ;; # not unless BONE
19341 *) avail_ext="$avail_ext $xxx" ;;
19346 Sys/Syslog|sys/syslog)
19347 : XXX syslog requires socket
19348 case "$d_socket" in
19349 true|$define|y) avail_ext="$avail_ext $xxx" ;;
19353 case "$usethreads" in
19355 case "$useithreads" in
19356 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
19360 threads|threads/shared)
19361 # threads and threads::shared are special cases.
19362 # To stop people from asking "Perl 5.8.0 was supposed
19363 # to have this new fancy threads implementation but my
19364 # perl doesn't have it" and from people trying to
19365 # (re)install the threads module using CPAN.pm and
19366 # CPAN.pm then offering to reinstall Perl 5.8.0,
19367 # the threads.pm and threads/shared.pm will always be
19368 # there, croaking informatively ("you need to rebuild
19369 # all of Perl with threads, sorry") when threads haven't
19370 # been compiled in.
19372 avail_ext="$avail_ext $xxx"
19375 : XXX Do we need a useipcsysv variable here
19376 case "${d_msg}${d_sem}${d_shm}" in
19377 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
19380 *) avail_ext="$avail_ext $xxx"
19389 : Now see which nonxs extensions are supported on this system.
19390 : For now assume all are.
19392 for xxx in $nonxs_extensions ; do
19394 *) nonxs_ext="$nonxs_ext $xxx"
19406 A number of extensions are supplied with $package. You may choose to
19407 compile these extensions for dynamic loading (the default), compile
19408 them into the $package executable (static loading), or not include
19409 them at all. Answer "none" to include no extensions.
19410 Note that DynaLoader is always built and need not be mentioned here.
19413 case "$dynamic_ext" in
19414 '') dflt="$avail_ext" ;;
19415 *) dflt="$dynamic_ext"
19416 # Perhaps we are reusing an old out-of-date config.sh.
19419 if test X"$dynamic_ext" != X"$avail_ext"; then
19421 NOTICE: Your previous config.sh list may be incorrect.
19422 The extensions now available to you are
19424 but the default list from your previous config.sh is
19436 rp="What extensions do you wish to load dynamically?"
19439 none) dynamic_ext=' ' ;;
19440 *) dynamic_ext="$ans" ;;
19443 case "$static_ext" in
19445 : Exclude those already listed in dynamic linking
19447 for xxx in $avail_ext; do
19448 case " $dynamic_ext " in
19450 *) dflt="$dflt $xxx" ;;
19457 *) dflt="$static_ext"
19464 rp="What extensions do you wish to load statically?"
19467 none) static_ext=' ' ;;
19468 *) static_ext="$ans" ;;
19473 A number of extensions are supplied with $package. Answer "none"
19474 to include no extensions.
19475 Note that DynaLoader is always built and need not be mentioned here.
19478 case "$static_ext" in
19479 '') dflt="$avail_ext" ;;
19480 *) dflt="$static_ext"
19481 # Perhaps we are reusing an old out-of-date config.sh.
19484 if test X"$static_ext" != X"$avail_ext"; then
19486 NOTICE: Your previous config.sh list may be incorrect.
19487 The extensions now available to you are
19489 but the default list from your previous config.sh is
19498 : Exclude those that are not xs extensions
19502 rp="What extensions do you wish to include?"
19505 none) static_ext=' ' ;;
19506 *) static_ext="$ans" ;;
19511 # Encode is a special case. If we are building Encode as a static
19512 # extension, we need to explicitly list its subextensions as well.
19513 # For other nested extensions, this is handled automatically by
19514 # the appropriate Makefile.PL.
19515 case " $static_ext " in
19516 *" Encode "*) # Add the subextensions of Encode
19518 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
19519 static_ext="$static_ext Encode/$xxx"
19525 set X $dynamic_ext $static_ext $nonxs_ext
19529 : Remove libraries needed only for extensions
19530 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
19531 : The exception is SunOS 4.x, which needs them.
19532 case "${osname}X${osvers}" in
19536 *) case "$usedl" in
19537 $define|true|[yY]*)
19538 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
19542 *) perllibs="$libs"
19548 : Remove build directory name from cppstdin so it can be used from
19549 : either the present location or the final installed location.
19551 : Get out of the UU directory to get correct path name.
19553 case "$cppstdin" in
19555 echo "Stripping down cppstdin path name"
19561 : end of configuration questions
19563 echo "End of configuration questions."
19566 : back to where it started
19567 if test -d ../UU; then
19571 : configuration may be patched via a 'config.arch' file
19572 if $test -f config.arch; then
19573 echo "I see a config.arch file, loading it."
19577 : configuration may be patched via a 'config.over' file
19578 if $test -f config.over; then
19581 rp='I see a config.over file. Do you wish to load it?'
19584 n*) echo "OK, I'll ignore it.";;
19586 echo "Configuration override changes have been loaded."
19591 : in case they want portability, strip down executable paths
19592 case "$d_portable" in
19595 echo "Stripping down executable paths..." >&4
19596 for file in $loclist $trylist; do
19598 eval $file=`basename $temp`
19603 : create config.sh file
19605 echo "Creating config.sh..." >&4
19606 $spitshell <<EOT >config.sh
19609 # This file was produced by running the Configure script. It holds all the
19610 # definitions figured out by Configure. Should you modify one of these values,
19611 # do not forget to propagate your changes by running "Configure -der". You may
19612 # instead choose to run each of the .SH files by yourself, or "Configure -S".
19615 # Package name : $package
19616 # Source directory : $src
19617 # Configuration time: $cf_time
19618 # Configured by : $cf_by
19619 # Target system : $myuname
19629 Revision='$Revision'
19637 alignbytes='$alignbytes'
19638 ansi2knr='$ansi2knr'
19639 aphostname='$aphostname'
19640 api_revision='$api_revision'
19641 api_subversion='$api_subversion'
19642 api_version='$api_version'
19643 api_versionstring='$api_versionstring'
19646 archlibexp='$archlibexp'
19647 archname64='$archname64'
19648 archname='$archname'
19649 archobjs='$archobjs'
19650 asctime_r_proto='$asctime_r_proto'
19658 byteorder='$byteorder'
19660 castflags='$castflags'
19663 cccdlflags='$cccdlflags'
19664 ccdlflags='$ccdlflags'
19666 ccflags_uselargefiles='$ccflags_uselargefiles'
19668 ccsymbols='$ccsymbols'
19669 ccversion='$ccversion'
19671 cf_email='$cf_email'
19673 charsize='$charsize'
19677 clocktype='$clocktype'
19679 compress='$compress'
19680 contains='$contains'
19684 cpp_stuff='$cpp_stuff'
19685 cppccsymbols='$cppccsymbols'
19686 cppflags='$cppflags'
19688 cppminus='$cppminus'
19690 cppstdin='$cppstdin'
19691 cppsymbols='$cppsymbols'
19692 crypt_r_proto='$crypt_r_proto'
19693 cryptlib='$cryptlib'
19695 ctermid_r_proto='$ctermid_r_proto'
19696 ctime_r_proto='$ctime_r_proto'
19697 d_Gconvert='$d_Gconvert'
19698 d_PRIEUldbl='$d_PRIEUldbl'
19699 d_PRIFUldbl='$d_PRIFUldbl'
19700 d_PRIGUldbl='$d_PRIGUldbl'
19701 d_PRIXU64='$d_PRIXU64'
19702 d_PRId64='$d_PRId64'
19703 d_PRIeldbl='$d_PRIeldbl'
19704 d_PRIfldbl='$d_PRIfldbl'
19705 d_PRIgldbl='$d_PRIgldbl'
19706 d_PRIi64='$d_PRIi64'
19707 d_PRIo64='$d_PRIo64'
19708 d_PRIu64='$d_PRIu64'
19709 d_PRIx64='$d_PRIx64'
19710 d_SCNfldbl='$d_SCNfldbl'
19711 d__fwalk='$d__fwalk'
19712 d_access='$d_access'
19713 d_accessx='$d_accessx'
19715 d_archlib='$d_archlib'
19716 d_asctime_r='$d_asctime_r'
19719 d_attribut='$d_attribut'
19723 d_bsdgetpgrp='$d_bsdgetpgrp'
19724 d_bsdsetpgrp='$d_bsdsetpgrp'
19726 d_casti32='$d_casti32'
19727 d_castneg='$d_castneg'
19728 d_charvspr='$d_charvspr'
19730 d_chroot='$d_chroot'
19731 d_chsize='$d_chsize'
19733 d_closedir='$d_closedir'
19734 d_cmsghdr_s='$d_cmsghdr_s'
19737 d_crypt_r='$d_crypt_r'
19739 d_ctermid_r='$d_ctermid_r'
19740 d_ctime_r='$d_ctime_r'
19741 d_cuserid='$d_cuserid'
19742 d_dbl_dig='$d_dbl_dig'
19743 d_dbminitproto='$d_dbminitproto'
19744 d_difftime='$d_difftime'
19746 d_dirnamlen='$d_dirnamlen'
19747 d_dlerror='$d_dlerror'
19748 d_dlopen='$d_dlopen'
19749 d_dlsymun='$d_dlsymun'
19750 d_dosuid='$d_dosuid'
19751 d_drand48_r='$d_drand48_r'
19752 d_drand48proto='$d_drand48proto'
19754 d_eaccess='$d_eaccess'
19755 d_endgrent='$d_endgrent'
19756 d_endgrent_r='$d_endgrent_r'
19757 d_endhent='$d_endhent'
19758 d_endhostent_r='$d_endhostent_r'
19759 d_endnent='$d_endnent'
19760 d_endnetent_r='$d_endnetent_r'
19761 d_endpent='$d_endpent'
19762 d_endprotoent_r='$d_endprotoent_r'
19763 d_endpwent='$d_endpwent'
19764 d_endpwent_r='$d_endpwent_r'
19765 d_endsent='$d_endsent'
19766 d_endservent_r='$d_endservent_r'
19767 d_eofnblk='$d_eofnblk'
19768 d_eunice='$d_eunice'
19769 d_fchdir='$d_fchdir'
19770 d_fchmod='$d_fchmod'
19771 d_fchown='$d_fchown'
19773 d_fcntl_can_lock='$d_fcntl_can_lock'
19774 d_fd_macros='$d_fd_macros'
19775 d_fd_set='$d_fd_set'
19776 d_fds_bits='$d_fds_bits'
19777 d_fgetpos='$d_fgetpos'
19778 d_finite='$d_finite'
19779 d_finitel='$d_finitel'
19780 d_flexfnam='$d_flexfnam'
19782 d_flockproto='$d_flockproto'
19784 d_fp_class='$d_fp_class'
19785 d_fpathconf='$d_fpathconf'
19786 d_fpclass='$d_fpclass'
19787 d_fpclassify='$d_fpclassify'
19788 d_fpclassl='$d_fpclassl'
19789 d_fpos64_t='$d_fpos64_t'
19790 d_frexpl='$d_frexpl'
19791 d_fs_data_s='$d_fs_data_s'
19792 d_fseeko='$d_fseeko'
19793 d_fsetpos='$d_fsetpos'
19794 d_fstatfs='$d_fstatfs'
19795 d_fstatvfs='$d_fstatvfs'
19797 d_ftello='$d_ftello'
19799 d_getcwd='$d_getcwd'
19800 d_getespwnam='$d_getespwnam'
19801 d_getfsstat='$d_getfsstat'
19802 d_getgrent='$d_getgrent'
19803 d_getgrent_r='$d_getgrent_r'
19804 d_getgrgid_r='$d_getgrgid_r'
19805 d_getgrnam_r='$d_getgrnam_r'
19806 d_getgrps='$d_getgrps'
19807 d_gethbyaddr='$d_gethbyaddr'
19808 d_gethbyname='$d_gethbyname'
19809 d_gethent='$d_gethent'
19810 d_gethname='$d_gethname'
19811 d_gethostbyaddr_r='$d_gethostbyaddr_r'
19812 d_gethostbyname_r='$d_gethostbyname_r'
19813 d_gethostent_r='$d_gethostent_r'
19814 d_gethostprotos='$d_gethostprotos'
19815 d_getitimer='$d_getitimer'
19816 d_getlogin='$d_getlogin'
19817 d_getlogin_r='$d_getlogin_r'
19818 d_getmnt='$d_getmnt'
19819 d_getmntent='$d_getmntent'
19820 d_getnbyaddr='$d_getnbyaddr'
19821 d_getnbyname='$d_getnbyname'
19822 d_getnent='$d_getnent'
19823 d_getnetbyaddr_r='$d_getnetbyaddr_r'
19824 d_getnetbyname_r='$d_getnetbyname_r'
19825 d_getnetent_r='$d_getnetent_r'
19826 d_getnetprotos='$d_getnetprotos'
19827 d_getpagsz='$d_getpagsz'
19828 d_getpbyname='$d_getpbyname'
19829 d_getpbynumber='$d_getpbynumber'
19830 d_getpent='$d_getpent'
19831 d_getpgid='$d_getpgid'
19832 d_getpgrp2='$d_getpgrp2'
19833 d_getpgrp='$d_getpgrp'
19834 d_getppid='$d_getppid'
19835 d_getprior='$d_getprior'
19836 d_getprotobyname_r='$d_getprotobyname_r'
19837 d_getprotobynumber_r='$d_getprotobynumber_r'
19838 d_getprotoent_r='$d_getprotoent_r'
19839 d_getprotoprotos='$d_getprotoprotos'
19840 d_getprpwnam='$d_getprpwnam'
19841 d_getpwent='$d_getpwent'
19842 d_getpwent_r='$d_getpwent_r'
19843 d_getpwnam_r='$d_getpwnam_r'
19844 d_getpwuid_r='$d_getpwuid_r'
19845 d_getsbyname='$d_getsbyname'
19846 d_getsbyport='$d_getsbyport'
19847 d_getsent='$d_getsent'
19848 d_getservbyname_r='$d_getservbyname_r'
19849 d_getservbyport_r='$d_getservbyport_r'
19850 d_getservent_r='$d_getservent_r'
19851 d_getservprotos='$d_getservprotos'
19852 d_getspnam='$d_getspnam'
19853 d_getspnam_r='$d_getspnam_r'
19854 d_gettimeod='$d_gettimeod'
19855 d_gmtime_r='$d_gmtime_r'
19856 d_gnulibc='$d_gnulibc'
19857 d_grpasswd='$d_grpasswd'
19858 d_hasmntopt='$d_hasmntopt'
19861 d_inetaton='$d_inetaton'
19862 d_int64_t='$d_int64_t'
19863 d_isascii='$d_isascii'
19864 d_isfinite='$d_isfinite'
19867 d_isnanl='$d_isnanl'
19868 d_killpg='$d_killpg'
19869 d_lchown='$d_lchown'
19870 d_ldbl_dig='$d_ldbl_dig'
19872 d_localtime_r='$d_localtime_r'
19873 d_locconv='$d_locconv'
19875 d_longdbl='$d_longdbl'
19876 d_longlong='$d_longlong'
19877 d_lseekproto='$d_lseekproto'
19879 d_madvise='$d_madvise'
19881 d_mbstowcs='$d_mbstowcs'
19882 d_mbtowc='$d_mbtowc'
19883 d_memchr='$d_memchr'
19884 d_memcmp='$d_memcmp'
19885 d_memcpy='$d_memcpy'
19886 d_memmove='$d_memmove'
19887 d_memset='$d_memset'
19889 d_mkdtemp='$d_mkdtemp'
19890 d_mkfifo='$d_mkfifo'
19891 d_mkstemp='$d_mkstemp'
19892 d_mkstemps='$d_mkstemps'
19893 d_mktime='$d_mktime'
19896 d_modfl_pow32_bug='$d_modfl_pow32_bug'
19897 d_mprotect='$d_mprotect'
19899 d_msg_ctrunc='$d_msg_ctrunc'
19900 d_msg_dontroute='$d_msg_dontroute'
19901 d_msg_oob='$d_msg_oob'
19902 d_msg_peek='$d_msg_peek'
19903 d_msg_proxy='$d_msg_proxy'
19904 d_msgctl='$d_msgctl'
19905 d_msgget='$d_msgget'
19906 d_msghdr_s='$d_msghdr_s'
19907 d_msgrcv='$d_msgrcv'
19908 d_msgsnd='$d_msgsnd'
19910 d_munmap='$d_munmap'
19911 d_mymalloc='$d_mymalloc'
19913 d_nl_langinfo='$d_nl_langinfo'
19914 d_nv_preserves_uv='$d_nv_preserves_uv'
19915 d_off64_t='$d_off64_t'
19916 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
19917 d_oldpthreads='$d_oldpthreads'
19918 d_oldsock='$d_oldsock'
19920 d_pathconf='$d_pathconf'
19922 d_perl_otherlibdirs='$d_perl_otherlibdirs'
19923 d_phostname='$d_phostname'
19926 d_portable='$d_portable'
19927 d_procselfexe='$d_procselfexe'
19928 d_pthread_atfork='$d_pthread_atfork'
19929 d_pthread_yield='$d_pthread_yield'
19931 d_pwchange='$d_pwchange'
19932 d_pwclass='$d_pwclass'
19933 d_pwcomment='$d_pwcomment'
19934 d_pwexpire='$d_pwexpire'
19935 d_pwgecos='$d_pwgecos'
19936 d_pwpasswd='$d_pwpasswd'
19937 d_pwquota='$d_pwquota'
19940 d_random_r='$d_random_r'
19941 d_readdir64_r='$d_readdir64_r'
19942 d_readdir='$d_readdir'
19943 d_readdir_r='$d_readdir_r'
19944 d_readlink='$d_readlink'
19946 d_recvmsg='$d_recvmsg'
19947 d_rename='$d_rename'
19948 d_rewinddir='$d_rewinddir'
19950 d_safebcpy='$d_safebcpy'
19951 d_safemcpy='$d_safemcpy'
19952 d_sanemcmp='$d_sanemcmp'
19953 d_sbrkproto='$d_sbrkproto'
19954 d_sched_yield='$d_sched_yield'
19955 d_scm_rights='$d_scm_rights'
19956 d_seekdir='$d_seekdir'
19957 d_select='$d_select'
19959 d_semctl='$d_semctl'
19960 d_semctl_semid_ds='$d_semctl_semid_ds'
19961 d_semctl_semun='$d_semctl_semun'
19962 d_semget='$d_semget'
19964 d_sendmsg='$d_sendmsg'
19965 d_setegid='$d_setegid'
19966 d_seteuid='$d_seteuid'
19967 d_setgrent='$d_setgrent'
19968 d_setgrent_r='$d_setgrent_r'
19969 d_setgrps='$d_setgrps'
19970 d_sethent='$d_sethent'
19971 d_sethostent_r='$d_sethostent_r'
19972 d_setitimer='$d_setitimer'
19973 d_setlinebuf='$d_setlinebuf'
19974 d_setlocale='$d_setlocale'
19975 d_setlocale_r='$d_setlocale_r'
19976 d_setnent='$d_setnent'
19977 d_setnetent_r='$d_setnetent_r'
19978 d_setpent='$d_setpent'
19979 d_setpgid='$d_setpgid'
19980 d_setpgrp2='$d_setpgrp2'
19981 d_setpgrp='$d_setpgrp'
19982 d_setprior='$d_setprior'
19983 d_setproctitle='$d_setproctitle'
19984 d_setprotoent_r='$d_setprotoent_r'
19985 d_setpwent='$d_setpwent'
19986 d_setpwent_r='$d_setpwent_r'
19987 d_setregid='$d_setregid'
19988 d_setresgid='$d_setresgid'
19989 d_setresuid='$d_setresuid'
19990 d_setreuid='$d_setreuid'
19991 d_setrgid='$d_setrgid'
19992 d_setruid='$d_setruid'
19993 d_setsent='$d_setsent'
19994 d_setservent_r='$d_setservent_r'
19995 d_setsid='$d_setsid'
19996 d_setvbuf='$d_setvbuf'
20000 d_shmatprototype='$d_shmatprototype'
20001 d_shmctl='$d_shmctl'
20003 d_shmget='$d_shmget'
20004 d_sigaction='$d_sigaction'
20005 d_sigprocmask='$d_sigprocmask'
20006 d_sigsetjmp='$d_sigsetjmp'
20007 d_sockatmark='$d_sockatmark'
20008 d_sockatmarkproto='$d_sockatmarkproto'
20009 d_socket='$d_socket'
20010 d_socklen_t='$d_socklen_t'
20011 d_sockpair='$d_sockpair'
20012 d_socks5_init='$d_socks5_init'
20014 d_srand48_r='$d_srand48_r'
20015 d_srandom_r='$d_srandom_r'
20016 d_sresgproto='$d_sresgproto'
20017 d_sresuproto='$d_sresuproto'
20018 d_statblks='$d_statblks'
20019 d_statfs_f_flags='$d_statfs_f_flags'
20020 d_statfs_s='$d_statfs_s'
20021 d_statvfs='$d_statvfs'
20022 d_stdio_cnt_lval='$d_stdio_cnt_lval'
20023 d_stdio_ptr_lval='$d_stdio_ptr_lval'
20024 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
20025 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
20026 d_stdio_stream_array='$d_stdio_stream_array'
20027 d_stdiobase='$d_stdiobase'
20028 d_stdstdio='$d_stdstdio'
20029 d_strchr='$d_strchr'
20030 d_strcoll='$d_strcoll'
20031 d_strctcpy='$d_strctcpy'
20032 d_strerrm='$d_strerrm'
20033 d_strerror='$d_strerror'
20034 d_strerror_r='$d_strerror_r'
20035 d_strftime='$d_strftime'
20036 d_strtod='$d_strtod'
20037 d_strtol='$d_strtol'
20038 d_strtold='$d_strtold'
20039 d_strtoll='$d_strtoll'
20040 d_strtoq='$d_strtoq'
20041 d_strtoul='$d_strtoul'
20042 d_strtoull='$d_strtoull'
20043 d_strtouq='$d_strtouq'
20044 d_strxfrm='$d_strxfrm'
20045 d_suidsafe='$d_suidsafe'
20046 d_symlink='$d_symlink'
20047 d_syscall='$d_syscall'
20048 d_syscallproto='$d_syscallproto'
20049 d_sysconf='$d_sysconf'
20050 d_sysernlst='$d_sysernlst'
20051 d_syserrlst='$d_syserrlst'
20052 d_system='$d_system'
20053 d_tcgetpgrp='$d_tcgetpgrp'
20054 d_tcsetpgrp='$d_tcsetpgrp'
20055 d_telldir='$d_telldir'
20056 d_telldirproto='$d_telldirproto'
20059 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
20060 d_tm_tm_zone='$d_tm_tm_zone'
20061 d_tmpnam_r='$d_tmpnam_r'
20062 d_truncate='$d_truncate'
20063 d_ttyname_r='$d_ttyname_r'
20064 d_tzname='$d_tzname'
20065 d_u32align='$d_u32align'
20066 d_ualarm='$d_ualarm'
20069 d_union_semun='$d_union_semun'
20070 d_unordered='$d_unordered'
20071 d_usleep='$d_usleep'
20072 d_usleepproto='$d_usleepproto'
20074 d_vendorarch='$d_vendorarch'
20075 d_vendorbin='$d_vendorbin'
20076 d_vendorlib='$d_vendorlib'
20078 d_void_closedir='$d_void_closedir'
20079 d_voidsig='$d_voidsig'
20080 d_voidtty='$d_voidtty'
20081 d_volatile='$d_volatile'
20082 d_vprintf='$d_vprintf'
20084 d_waitpid='$d_waitpid'
20085 d_wcstombs='$d_wcstombs'
20086 d_wctomb='$d_wctomb'
20087 d_writev='$d_writev'
20090 db_hashtype='$db_hashtype'
20091 db_prefixtype='$db_prefixtype'
20092 db_version_major='$db_version_major'
20093 db_version_minor='$db_version_minor'
20094 db_version_patch='$db_version_patch'
20095 defvoidused='$defvoidused'
20096 direntrytype='$direntrytype'
20099 doublesize='$doublesize'
20101 drand48_r_proto='$drand48_r_proto'
20102 dynamic_ext='$dynamic_ext'
20108 endgrent_r_proto='$endgrent_r_proto'
20109 endhostent_r_proto='$endhostent_r_proto'
20110 endnetent_r_proto='$endnetent_r_proto'
20111 endprotoent_r_proto='$endprotoent_r_proto'
20112 endpwent_r_proto='$endpwent_r_proto'
20113 endservent_r_proto='$endservent_r_proto'
20114 eunicefix='$eunicefix'
20117 extensions='$extensions'
20119 fflushNULL='$fflushNULL'
20120 fflushall='$fflushall'
20122 firstmakefile='$firstmakefile'
20124 fpossize='$fpossize'
20125 fpostype='$fpostype'
20126 freetype='$freetype'
20129 full_csh='$full_csh'
20130 full_sed='$full_sed'
20131 gccosandvers='$gccosandvers'
20132 gccversion='$gccversion'
20133 getgrent_r_proto='$getgrent_r_proto'
20134 getgrgid_r_proto='$getgrgid_r_proto'
20135 getgrnam_r_proto='$getgrnam_r_proto'
20136 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
20137 gethostbyname_r_proto='$gethostbyname_r_proto'
20138 gethostent_r_proto='$gethostent_r_proto'
20139 getlogin_r_proto='$getlogin_r_proto'
20140 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
20141 getnetbyname_r_proto='$getnetbyname_r_proto'
20142 getnetent_r_proto='$getnetent_r_proto'
20143 getprotobyname_r_proto='$getprotobyname_r_proto'
20144 getprotobynumber_r_proto='$getprotobynumber_r_proto'
20145 getprotoent_r_proto='$getprotoent_r_proto'
20146 getpwent_r_proto='$getpwent_r_proto'
20147 getpwnam_r_proto='$getpwnam_r_proto'
20148 getpwuid_r_proto='$getpwuid_r_proto'
20149 getservbyname_r_proto='$getservbyname_r_proto'
20150 getservbyport_r_proto='$getservbyport_r_proto'
20151 getservent_r_proto='$getservent_r_proto'
20152 getspnam_r_proto='$getspnam_r_proto'
20153 gidformat='$gidformat'
20159 gmtime_r_proto='$gmtime_r_proto'
20160 gnulibc_version='$gnulibc_version'
20162 groupcat='$groupcat'
20163 groupstype='$groupstype'
20166 h_sysfile='$h_sysfile'
20177 i_arpainet='$i_arpainet'
20178 i_bsdioctl='$i_bsdioctl'
20182 i_dirent='$i_dirent'
20188 i_fp_class='$i_fp_class'
20191 i_ieeefp='$i_ieeefp'
20192 i_inttypes='$i_inttypes'
20193 i_langinfo='$i_langinfo'
20194 i_libutil='$i_libutil'
20195 i_limits='$i_limits'
20196 i_locale='$i_locale'
20197 i_machcthr='$i_machcthr'
20198 i_malloc='$i_malloc'
20200 i_memory='$i_memory'
20201 i_mntent='$i_mntent'
20204 i_neterrno='$i_neterrno'
20205 i_netinettcp='$i_netinettcp'
20209 i_pthread='$i_pthread'
20211 i_rpcsvcdbm='$i_rpcsvcdbm'
20214 i_shadow='$i_shadow'
20216 i_stdarg='$i_stdarg'
20217 i_stddef='$i_stddef'
20218 i_stdlib='$i_stdlib'
20219 i_string='$i_string'
20220 i_sunmath='$i_sunmath'
20221 i_sysaccess='$i_sysaccess'
20222 i_sysdir='$i_sysdir'
20223 i_sysfile='$i_sysfile'
20224 i_sysfilio='$i_sysfilio'
20226 i_sysioctl='$i_sysioctl'
20227 i_syslog='$i_syslog'
20228 i_sysmman='$i_sysmman'
20229 i_sysmode='$i_sysmode'
20230 i_sysmount='$i_sysmount'
20231 i_sysndir='$i_sysndir'
20232 i_sysparam='$i_sysparam'
20233 i_sysresrc='$i_sysresrc'
20234 i_syssecrt='$i_syssecrt'
20235 i_sysselct='$i_sysselct'
20236 i_syssockio='$i_syssockio'
20237 i_sysstat='$i_sysstat'
20238 i_sysstatfs='$i_sysstatfs'
20239 i_sysstatvfs='$i_sysstatvfs'
20240 i_systime='$i_systime'
20241 i_systimek='$i_systimek'
20242 i_systimes='$i_systimes'
20243 i_systypes='$i_systypes'
20244 i_sysuio='$i_sysuio'
20246 i_sysutsname='$i_sysutsname'
20247 i_sysvfs='$i_sysvfs'
20248 i_syswait='$i_syswait'
20249 i_termio='$i_termio'
20250 i_termios='$i_termios'
20252 i_unistd='$i_unistd'
20255 i_values='$i_values'
20256 i_varargs='$i_varargs'
20257 i_varhdr='$i_varhdr'
20259 ignore_versioned_solibs='$ignore_versioned_solibs'
20260 inc_version_list='$inc_version_list'
20261 inc_version_list_init='$inc_version_list_init'
20264 installarchlib='$installarchlib'
20265 installbin='$installbin'
20266 installman1dir='$installman1dir'
20267 installman3dir='$installman3dir'
20268 installprefix='$installprefix'
20269 installprefixexp='$installprefixexp'
20270 installprivlib='$installprivlib'
20271 installscript='$installscript'
20272 installsitearch='$installsitearch'
20273 installsitebin='$installsitebin'
20274 installsitelib='$installsitelib'
20275 installstyle='$installstyle'
20276 installusrbinperl='$installusrbinperl'
20277 installvendorarch='$installvendorarch'
20278 installvendorbin='$installvendorbin'
20279 installvendorlib='$installvendorlib'
20281 issymlink='$issymlink'
20282 ivdformat='$ivdformat'
20285 known_extensions='$known_extensions'
20288 lddlflags='$lddlflags'
20290 ldflags_uselargefiles='$ldflags_uselargefiles'
20291 ldlibpthname='$ldlibpthname'
20298 libsdirs='$libsdirs'
20299 libsfiles='$libsfiles'
20300 libsfound='$libsfound'
20301 libspath='$libspath'
20302 libswanted='$libswanted'
20303 libswanted_uselargefiles='$libswanted_uselargefiles'
20309 localtime_r_proto='$localtime_r_proto'
20310 locincpth='$locincpth'
20311 loclibpth='$loclibpth'
20312 longdblsize='$longdblsize'
20313 longlongsize='$longlongsize'
20314 longsize='$longsize'
20318 lseeksize='$lseeksize'
20319 lseektype='$lseektype'
20323 make_set_make='$make_set_make'
20324 mallocobj='$mallocobj'
20325 mallocsrc='$mallocsrc'
20326 malloctype='$malloctype'
20328 man1direxp='$man1direxp'
20331 man3direxp='$man3direxp'
20333 mips_type='$mips_type'
20335 mmaptype='$mmaptype'
20336 modetype='$modetype'
20338 multiarch='$multiarch'
20340 myarchname='$myarchname'
20341 mydomain='$mydomain'
20342 myhostname='$myhostname'
20345 need_va_copy='$need_va_copy'
20346 netdb_hlen_type='$netdb_hlen_type'
20347 netdb_host_type='$netdb_host_type'
20348 netdb_name_type='$netdb_name_type'
20349 netdb_net_type='$netdb_net_type'
20352 nm_so_opt='$nm_so_opt'
20353 nonxs_ext='$nonxs_ext'
20355 nvEUformat='$nvEUformat'
20356 nvFUformat='$nvFUformat'
20357 nvGUformat='$nvGUformat'
20358 nv_preserves_uv_bits='$nv_preserves_uv_bits'
20359 nveformat='$nveformat'
20360 nvfformat='$nvfformat'
20361 nvgformat='$nvgformat'
20364 o_nonblock='$o_nonblock'
20366 old_pthread_create_joinable='$old_pthread_create_joinable'
20367 optimize='$optimize'
20368 orderlib='$orderlib'
20371 otherlibdirs='$otherlibdirs'
20375 patchlevel='$patchlevel'
20376 path_sep='$path_sep'
20379 perl_patchlevel='$perl_patchlevel'
20380 perladmin='$perladmin'
20381 perllibs='$perllibs'
20382 perlpath='$perlpath'
20384 phostname='$phostname'
20387 pm_apiversion='$pm_apiversion'
20391 prefixexp='$prefixexp'
20393 privlibexp='$privlibexp'
20394 procselfexe='$procselfexe'
20395 prototype='$prototype'
20397 quadkind='$quadkind'
20398 quadtype='$quadtype'
20399 randbits='$randbits'
20400 randfunc='$randfunc'
20401 random_r_proto='$random_r_proto'
20402 randseedtype='$randseedtype'
20404 rd_nodata='$rd_nodata'
20405 readdir64_r_proto='$readdir64_r_proto'
20406 readdir_r_proto='$readdir_r_proto'
20407 revision='$revision'
20412 sPRIEUldbl='$sPRIEUldbl'
20413 sPRIFUldbl='$sPRIFUldbl'
20414 sPRIGUldbl='$sPRIGUldbl'
20415 sPRIXU64='$sPRIXU64'
20417 sPRIeldbl='$sPRIeldbl'
20418 sPRIfldbl='$sPRIfldbl'
20419 sPRIgldbl='$sPRIgldbl'
20424 sSCNfldbl='$sSCNfldbl'
20425 sched_yield='$sched_yield'
20426 scriptdir='$scriptdir'
20427 scriptdirexp='$scriptdirexp'
20429 seedfunc='$seedfunc'
20430 selectminbits='$selectminbits'
20431 selecttype='$selecttype'
20432 sendmail='$sendmail'
20433 setgrent_r_proto='$setgrent_r_proto'
20434 sethostent_r_proto='$sethostent_r_proto'
20435 setlocale_r_proto='$setlocale_r_proto'
20436 setnetent_r_proto='$setnetent_r_proto'
20437 setprotoent_r_proto='$setprotoent_r_proto'
20438 setpwent_r_proto='$setpwent_r_proto'
20439 setservent_r_proto='$setservent_r_proto'
20442 sharpbang='$sharpbang'
20443 shmattype='$shmattype'
20444 shortsize='$shortsize'
20447 sig_count='$sig_count'
20448 sig_name='$sig_name'
20449 sig_name_init='$sig_name_init'
20451 sig_num_init='$sig_num_init'
20452 sig_size='$sig_size'
20453 signal_t='$signal_t'
20454 sitearch='$sitearch'
20455 sitearchexp='$sitearchexp'
20457 sitebinexp='$sitebinexp'
20459 sitelib_stem='$sitelib_stem'
20460 sitelibexp='$sitelibexp'
20461 siteprefix='$siteprefix'
20462 siteprefixexp='$siteprefixexp'
20463 sizesize='$sizesize'
20464 sizetype='$sizetype'
20468 sockethdr='$sockethdr'
20469 socketlib='$socketlib'
20470 socksizetype='$socksizetype'
20472 spackage='$spackage'
20473 spitshell='$spitshell'
20474 srand48_r_proto='$srand48_r_proto'
20475 srandom_r_proto='$srandom_r_proto'
20477 ssizetype='$ssizetype'
20478 startperl='$startperl'
20480 static_ext='$static_ext'
20482 stdio_base='$stdio_base'
20483 stdio_bufsiz='$stdio_bufsiz'
20484 stdio_cnt='$stdio_cnt'
20485 stdio_filbuf='$stdio_filbuf'
20486 stdio_ptr='$stdio_ptr'
20487 stdio_stream_array='$stdio_stream_array'
20488 strerror_r_proto='$strerror_r_proto'
20491 subversion='$subversion'
20495 targetarch='$targetarch'
20499 timeincl='$timeincl'
20500 timetype='$timetype'
20501 tmpnam_r_proto='$tmpnam_r_proto'
20507 ttyname_r_proto='$ttyname_r_proto'
20516 uidformat='$uidformat'
20522 uquadtype='$uquadtype'
20523 use5005threads='$use5005threads'
20524 use64bitall='$use64bitall'
20525 use64bitint='$use64bitint'
20526 usecrosscompile='$usecrosscompile'
20528 useithreads='$useithreads'
20529 uselargefiles='$uselargefiles'
20530 uselongdouble='$uselongdouble'
20531 usemorebits='$usemorebits'
20532 usemultiplicity='$usemultiplicity'
20533 usemymalloc='$usemymalloc'
20535 useopcode='$useopcode'
20536 useperlio='$useperlio'
20537 useposix='$useposix'
20538 usereentrant='$usereentrant'
20540 useshrplib='$useshrplib'
20541 usesocks='$usesocks'
20542 usethreads='$usethreads'
20543 usevendorprefix='$usevendorprefix'
20544 usevfork='$usevfork'
20547 uvXUformat='$uvXUformat'
20548 uvoformat='$uvoformat'
20551 uvuformat='$uvuformat'
20552 uvxformat='$uvxformat'
20553 vendorarch='$vendorarch'
20554 vendorarchexp='$vendorarchexp'
20555 vendorbin='$vendorbin'
20556 vendorbinexp='$vendorbinexp'
20557 vendorlib='$vendorlib'
20558 vendorlib_stem='$vendorlib_stem'
20559 vendorlibexp='$vendorlibexp'
20560 vendorprefix='$vendorprefix'
20561 vendorprefixexp='$vendorprefixexp'
20563 version_patchlevel_string='$version_patchlevel_string'
20564 versiononly='$versiononly'
20566 voidflags='$voidflags'
20568 xs_apiversion='$xs_apiversion'
20570 yaccflags='$yaccflags'
20575 : Add in command line options if available
20576 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
20578 : add special variables
20579 $test -f $src/patchlevel.h && \
20580 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
20581 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
20582 echo "PERL_CONFIG_SH=true" >>config.sh
20584 : propagate old symbols
20585 if $test -f UU/config.sh; then
20586 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
20587 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
20588 $sort | $uniq -u >UU/oldsyms
20589 set X `cat UU/oldsyms`
20595 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
20597 echo "# Variables propagated from previous config.sh file." >>config.sh
20598 for sym in `cat UU/oldsyms`; do
20599 echo " Propagating $hint variable "'$'"$sym..."
20600 eval 'tmp="$'"${sym}"'"'
20602 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
20608 : Finish up by extracting the .SH files
20612 echo "Extraction done."
20622 If you'd like to make any changes to the config.sh file before I begin
20623 to configure things, do it as a shell escape now (e.g. !vi config.sh).
20626 rp="Press return or use a shell escape to edit config.sh:"
20631 *) : in case they cannot read
20632 sh 1>&4 -c "$ans";;
20637 : if this fails, just run all the .SH files by hand
20646 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
20653 Now you need to generate make dependencies by running "$make depend".
20654 You might prefer to run it in background: "$make depend > makedepend.out &"
20655 It can take a while, so you might not want to run it right now.
20660 rp="Run $make depend now?"
20664 $make depend && echo "Now you must run '$make'."
20667 echo "You must run '$make depend' then '$make'."
20670 elif test -f [Mm]akefile; then
20672 echo "Now you must run a $make."
20674 echo "Configure done."
20677 if $test -f Policy.sh; then
20680 If you compile $package on a different machine or from a different object
20681 directory, copy the Policy.sh file from this object directory to the
20682 new one before you run Configure -- this will help you with most of
20683 the policy defaults.
20687 if $test -f config.msg; then
20688 echo "Hmm. I also noted the following information while running:"
20690 $cat config.msg >&4
20693 $rm -f kit*isdone ark*isdone