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 Apr 8 17:56:15 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
375 endhostent_r_proto=''
381 endprotoent_r_proto=''
387 endservent_r_proto=''
437 gethostbyaddr_r_proto=''
439 gethostbyname_r_proto=''
441 gethostent_r_proto=''
453 getnetbyaddr_r_proto=''
455 getnetbyname_r_proto=''
469 d_getprotobyname_r=''
470 getprotobyname_r_proto=''
471 d_getprotobynumber_r=''
472 getprotobynumber_r_proto=''
474 getprotoent_r_proto=''
486 getservbyname_r_proto=''
488 getservbyport_r_proto=''
490 getservent_r_proto=''
563 d_old_pthread_create_joinable=''
564 old_pthread_create_joinable=''
603 sethostent_r_proto=''
620 setprotoent_r_proto=''
632 setservent_r_proto=''
676 d_stdio_ptr_lval_nochange_cnt=''
677 d_stdio_ptr_lval_sets_cnt=''
871 inc_version_list_init=''
890 ignore_versioned_solibs=''
949 d_perl_otherlibdirs=''
963 version_patchlevel_string=''
978 nv_preserves_uv_bits=''
1067 d_stdio_stream_array=''
1068 stdio_stream_array=''
1078 ccflags_uselargefiles=''
1079 ldflags_uselargefiles=''
1080 libswanted_uselargefiles=''
1100 installvendorarch=''
1126 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1129 : We must find out about Eunice early
1131 if test -f /etc/unixtovms; then
1132 eunicefix=/etc/unixtovms
1134 if test -f /etc/unixtovms.exe; then
1135 eunicefix=/etc/unixtovms.exe
1138 : Set executable suffix now -- needed before hints available
1139 if test -f "/libs/version.library"; then
1142 elif test -f "/system/gnu_library/bin/ar.pm"; then
1145 elif test -n "$DJGPP"; then
1148 elif test -d c:/. ; then
1157 : set useposix=false in your hint file to disable the POSIX extension.
1159 : set useopcode=false in your hint file to disable the Opcode extension.
1161 : Trailing extension. Override this in a hint file, if needed.
1162 : Extra object files, if any, needed on this platform.
1165 : Possible local include directories to search.
1166 : Set locincpth to "" in a hint file to defeat local include searches.
1167 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1168 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1170 : no include file wanted by default
1175 : change the next line if compiling for Xenix/286 on Xenix/386
1176 xlibpth='/usr/lib/386 /lib/386'
1177 : Possible local library directories to search.
1178 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1179 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1181 : general looking path for locating libraries
1182 glibpth="/lib /usr/lib $xlibpth"
1183 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1184 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1185 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1187 : Private path used by Configure to find libraries. Its value
1188 : is prepended to libpth. This variable takes care of special
1189 : machines, like the mips. Usually, it should be empty.
1192 : default library list
1194 : some systems want to use only the non-versioned libso:s
1195 ignore_versioned_solibs=''
1197 ccflags_uselargefiles=''
1198 ldflags_uselargefiles=''
1199 libswanted_uselargefiles=''
1200 : set usemultiplicity on the Configure command line to enable multiplicity.
1201 : set usesocks on the Configure command line to enable socks.
1202 : set usethreads on the Configure command line to enable threads.
1203 usereentrant='undef'
1204 : full support for void wanted by default
1207 : List of libraries we want.
1208 : If anyone needs -lnet, put it in a hint file.
1209 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1210 libswanted="$libswanted dld ld sun m c cposix posix"
1211 libswanted="$libswanted ndir dir crypt sec"
1212 libswanted="$libswanted ucb bsd BSD PW x util"
1213 : We probably want to search /usr/shlib before most other libraries.
1214 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1215 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1216 glibpth="/usr/shlib $glibpth"
1217 : Do not use vfork unless overridden by a hint file.
1220 : Find the basic shell for Bourne shell scripts
1224 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1227 if test -f "$xxx"; then
1230 : Build up a list and do a single loop so we can 'break' out.
1231 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1232 for xxx in sh bash ksh pdksh ash; do
1234 try="$try ${p}/${xxx}"
1238 if test -f "$xxx"; then
1241 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1244 elif test -f "$xxx.exe"; then
1255 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1257 Usually it's in /bin/sh. How did you even get this far?
1258 Please contact me (Perl Maintainers) at perlbug@perl.org and
1259 we'll try to straighten this all out.
1265 : see if sh knows # comments
1266 if `$sh -c '#' >/dev/null 2>&1`; then
1270 test -f $xcat$_exe || xcat=/usr/bin/cat
1271 if test ! -f $xcat$_exe; then
1272 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1273 if test -f $p/cat$_exe; then
1278 if test ! -f $xcat$_exe; then
1279 echo "Can't find cat anywhere!"
1283 echo "#!$xcat" >sharp
1287 if test -s today; then
1290 echo "#! $xcat" > sharp
1294 if test -s today; then
1302 echo "Your $sh doesn't grok # comments--I will strip them later on."
1305 echo "exec grep -v '^[ ]*#'" >spitshell
1307 $eunicefix spitshell
1308 spitshell=`pwd`/spitshell
1310 echo "I presume that if # doesn't work, #! won't work either!"
1315 : figure out how to guarantee sh startup
1317 '') startsh=${sharpbang}${sh} ;;
1329 : echo "Yup, it does."
1331 echo "Hmm... '$startsh' does not guarantee sh startup..."
1332 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1337 : Save command line options in file UU/cmdline.opt for later use in
1338 : generating config.sh.
1339 cat > cmdline.opt <<EOSH
1340 # Configure command line arguments.
1349 cat >>cmdline.opt <<EOSH
1350 config_arg$argn='$arg'
1352 # Extreme backslashitis: replace each ' by '"'"'
1353 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1356 arg_exp=`cat cmdl.opt`
1357 args_exp="$args_exp$args_sep'$arg_exp'"
1358 argn=`expr $argn + 1`
1361 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1362 # used by ./hints/os2.sh
1365 : produce awk script to parse command line options
1366 cat >options.awk <<'EOF'
1368 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1370 len = length(optstr);
1371 for (i = 1; i <= len; i++) {
1372 c = substr(optstr, i, 1);
1373 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1384 if (substr(str, 1, 1) != "-") {
1385 printf("'%s'\n", str);
1389 for (i = 2; i <= len; i++) {
1390 c = substr(str, i, 1);
1392 printf("-%s\n", substr(str, i));
1398 printf("'%s'\n", substr(str, i + 1));
1411 : process the command line options
1412 set X `for arg in "$@"; do echo "X$arg"; done |
1413 sed -e s/X// | awk -f options.awk`
1418 : set up default values
1428 rm -f optdef.sh posthint.sh
1429 cat >optdef.sh <<EOS
1435 while test $# -gt 0; do
1437 -d) shift; fastread=yes;;
1438 -e) shift; alldone=cont;;
1442 if test -r "$1"; then
1445 echo "$me: cannot read config file $1." >&2
1450 -h) shift; error=true;;
1451 -r) shift; reuseval=true;;
1452 -s) shift; silent=true; realsilent=true;;
1453 -E) shift; alldone=exit;;
1454 -K) shift; knowitall=true;;
1455 -O) shift; override=true;;
1456 -S) shift; silent=true; extractsh=true;;
1461 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1462 echo "$me: ignoring -D $1" >&2
1465 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1466 *) echo "$1='define'" >> optdef.sh;;
1473 *=) echo "$1" >> optdef.sh;;
1475 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1476 echo "$me: ignoring -U $1" >&2
1478 *) echo "$1='undef'" >> optdef.sh;;
1489 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1493 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1494 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1500 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1501 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1502 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1503 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1504 *) xxx=`echo $yyy|sed 's!:.*!!'`
1505 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1511 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1513 echo "$yyy=''" >> posthint.sh ;;
1518 echo "$yyy='$zzz'" >> posthint.sh ;;
1520 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1522 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1527 echo "$yyy=$zzz" >> posthint.sh ;;
1528 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1532 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1535 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1543 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1544 [-U symbol] [-U symbol=] [-A command:symbol...]
1545 -d : use defaults for all answers.
1546 -e : go on without questioning past the production of config.sh.
1547 -f : specify an alternate default configuration file.
1548 -h : print this help message and exit (with an error status).
1549 -r : reuse C symbols value if possible (skips costly nm extraction).
1550 -s : silent mode, only echoes questions and essential information.
1551 -D : define symbol to have some value:
1552 -D symbol symbol gets the value 'define'
1553 -D symbol=value symbol gets the value 'value'
1554 -E : stop at the end of questions, after having produced config.sh.
1555 -K : do not use unless you know what you are doing.
1556 -O : let -D and -U override definitions from loaded configuration file.
1557 -S : perform variable substitutions on all .SH files (can mix with -f)
1558 -U : undefine symbol:
1559 -U symbol symbol gets the value 'undef'
1560 -U symbol= symbol gets completely empty
1561 -A : manipulate symbol after the platform specific hints have been applied:
1562 -A symbol=value append " "value to symbol
1563 -A append:symbol=value append value to symbol
1564 -A define:symbol=value define symbol to have value
1565 -A clear:symbol define symbol to be ''
1566 -A define:symbol define symbol to be 'define'
1567 -A eval:symbol=value define symbol to be eval of value
1568 -A prepend:symbol=value prepend value to symbol
1569 -A undef:symbol define symbol to be 'undef'
1570 -A undef:symbol= define symbol to be ''
1571 -V : print version number and exit (with a zero status).
1578 case "$fastread$alldone" in
1581 case "$extractsh" in
1584 if test ! -t 0; then
1585 echo "Say 'sh Configure', not 'sh <Configure'"
1595 true) exec 1>/dev/null;;
1598 : run the defines and the undefines, if any, but leave the file out there...
1601 : create the posthint manipulation script and leave the file out there...
1606 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1607 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1608 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1609 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1610 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1613 : Some greps do not return status, grrr.
1614 echo "grimblepritz" >grimble
1615 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1617 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1623 : the following should work in any shell
1627 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1628 cat >contains <<'EOSS'
1629 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1634 : Find the path to the source tree
1637 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1641 *) src=`cd ../$src && pwd` ;;
1654 if test -f $rsrc/Configure && \
1655 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1657 : found it, so we are ok.
1660 for src in . .. ../.. ../../.. ../../../..; do
1661 if test -f ../$src/Configure && \
1662 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1673 Sorry, I can't seem to locate the source dir for $package. Please start
1674 Configure with an explicit path -- i.e. /some/path/Configure.
1682 echo "Sources for $package found in \"$src\"." >&4
1686 : script used to extract .SH files with variable substitutions
1687 cat >extract <<'EOS'
1689 echo "Doing variable substitutions on .SH files..."
1690 if test -f MANIFEST; then
1691 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1693 echo "(Looking for .SH files under the source directory.)"
1694 set x `(cd "$src"; find . -name "*.SH" -print)`
1698 0) set x `(cd "$src"; echo *.SH)`; shift;;
1700 if test ! -f "$src/$1"; then
1706 while test $name; do
1707 if test ! -d "$name"; then
1708 create="$name $create";
1709 name=`echo $name | sed -e "s|^[^/]*$||"`;
1710 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1715 for file in $create; do
1724 dir=`expr X$file : 'X\(.*\)/'`
1725 file=`expr X$file : 'X.*/\(.*\)'`
1726 (cd "$dir" && . ./$file)
1736 dir=`expr X$file : 'X\(.*\)/'`
1737 file=`expr X$file : 'X.*/\(.*\)'`
1738 (set x $dir; shift; eval $mkdir_p)
1739 sh <"$src/$dir/$file"
1748 if test -f "$src/config_h.SH"; then
1749 if test ! -f config.h; then
1750 : oops, they left it out of MANIFEST, probably, so do it anyway.
1751 . "$src/config_h.SH"
1756 : extract files and exit if asked to do so
1757 case "$extractsh" in
1759 case "$realsilent" in
1763 case "$config_sh" in
1764 '') config_sh='config.sh';;
1767 echo "Fetching answers from $config_sh..."
1770 test "$override" && . ./optdef.sh
1774 echo "Extraction done."
1779 : Eunice requires " " instead of "", can you believe it
1782 echo "Beginning of configuration questions for $package."
1784 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1786 : first determine how to suppress newline on echo command
1788 echo "Checking echo to see how to suppress newlines..."
1789 (echo "hi there\c" ; echo " ") >.echotmp
1790 if $contains c .echotmp >/dev/null 2>&1 ; then
1801 echo $n "The star should be here-->$c"
1805 : Now test for existence of everything in MANIFEST
1807 if test -f "$rsrc/MANIFEST"; then
1808 echo "First let's make sure your kit is complete. Checking..." >&4
1809 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1812 for filelist in x??; do
1813 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1815 if test -s missing; then
1819 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1821 You have the option of continuing the configuration process, despite the
1822 distinct possibility that your kit is damaged, by typing 'y'es. If you
1823 do, don't blame me if something goes wrong. I advise you to type 'n'o
1824 and contact the author (perlbug@perl.org).
1827 echo $n "Continue? [n] $c" >&4
1831 echo "Continuing..." >&4
1835 echo "ABORTING..." >&4
1840 echo "Looks good..."
1843 echo "There is no MANIFEST file. I hope your kit is complete !"
1848 : Find the appropriate value for a newline for tr
1849 if test -n "$DJGPP"; then
1852 if test X"$trnl" = X; then
1853 case "`echo foo|tr '\n' x 2>/dev/null`" in
1857 if test X"$trnl" = X; then
1858 case "`echo foo|tr '\012' x 2>/dev/null`" in
1859 foox) trnl='\012' ;;
1862 if test X"$trnl" = X; then
1865 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1871 : compute the number of columns on the terminal for proper question formatting
1876 : set up the echo used in my read
1877 myecho="case \"\$xxxm\" in
1878 '') echo $n \"\$rp $c\" >&4;;
1880 '') echo $n \"[\$xxxm] $c\";;
1882 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1884 echo $n \"[\$xxxm] $c\" >&4
1886 echo $n \"\$rp [\$xxxm] $c\" >&4
1892 : now set up to do reads with possible shell escape and default assignment
1898 case "\$fastread" in
1899 yes) case "\$dflt" in
1902 case "\$silent-\$rp" in
1907 *) case "\$silent" in
1908 true) case "\$rp" in
1913 while expr "X\$ans" : "X!" >/dev/null; do
1917 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1925 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1934 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1939 echo "(OK, I'll run with -d after this question.)" >&4
1942 echo "*** Sorry, \$1 not supported yet." >&4
1952 echo "*** Substitution done -- please confirm."
1954 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1959 echo "*** Error -- try again."
1966 case "\$ans\$xxxm\$nostick" in
1978 : create .config dir to save info across Configure sessions
1979 test -d ../.config || mkdir ../.config
1980 cat >../.config/README <<EOF
1981 This directory created by Configure to save information that should
1982 persist across sessions for $package.
1984 You may safely delete it if you wish.
1987 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1989 $define|true|[yY]*) ;;
1990 *) case "$xversion" in
1993 *** WHOA THERE!!! ***
1995 This is an UNSTABLE DEVELOPMENT release.
1996 The version of this $package distribution is $xversion, that is, odd,
1997 (as opposed to even) and that signifies a development release.
1998 If you want a maintenance release, you want an even-numbered version.
2000 Do ***NOT*** install this into production use.
2001 Data corruption and crashes are possible.
2003 It is most seriously suggested that you do not continue any further
2004 unless you want to help in developing and debugging Perl.
2006 If you *still* want to build perl, you can answer 'y' now,
2007 or pass -Dusedevel to Configure.
2010 rp='Do you really want to continue?'
2014 [yY]) echo >&4 "Okay, continuing."
2015 usedevel="$define" ;;
2016 *) echo >&4 "Okay, bye."
2026 case "$versiononly" in
2027 '') versiononly="$define" ;;
2029 case "$installusrbinperl" in
2030 '') installusrbinperl="$undef" ;;
2035 : general instructions
2038 user=`(logname) 2>/dev/null`
2040 '') user=`whoami 2>&1`;;
2042 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2045 rp='Would you like to see the instructions?'
2056 This installation shell script will examine your system and ask you questions
2057 to determine how the perl5 package should be installed. If you get
2058 stuck on a question, you may use a ! shell escape to start a subshell or
2059 execute a command. Many of the questions will have default answers in square
2060 brackets; typing carriage return will give you the default.
2062 On some of the questions which ask for file or directory names you are allowed
2063 to use the ~name construct to specify the login directory belonging to "name",
2064 even if you don't have a shell which knows about that. Questions where this is
2065 allowed will be marked "(~name ok)".
2069 dflt='Type carriage return to continue'
2073 The prompter used in this script allows you to use shell variables and
2074 backticks in your answers. You may use $1, $2, etc... to refer to the words
2075 in the default answer, as if the default line was a set of arguments given to a
2076 script shell. This means you may also use $* to repeat the whole default line,
2077 so you do not have to re-type everything to add something to the default.
2079 Everytime there is a substitution, you will have to confirm. If there is an
2080 error (e.g. an unmatched backtick), the default answer will remain unchanged
2081 and you will be prompted again.
2083 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2084 the questions and use the computed defaults (or the previous answers if there
2085 was already a config.sh file). Type 'Configure -h' for a list of options.
2086 You may also start interactively and then answer '& -d' at any prompt to turn
2087 on the non-interactive behaviour for the remainder of the execution.
2093 Much effort has been expended to ensure that this shell script will run on any
2094 Unix system. If despite that it blows up on yours, your best bet is to edit
2095 Configure and run it again. If you can't run Configure for some reason,
2096 you'll have to generate a config.sh file by hand. Whatever problems you
2097 have, let me (perlbug@perl.org) know how I blew it.
2099 This installation script affects things in two ways:
2101 1) it may do direct variable substitutions on some of the files included
2103 2) it builds a config.h file for inclusion in C programs. You may edit
2104 any of these files as the need arises after running this script.
2106 If you make a mistake on a question, there is no easy way to back up to it
2107 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2108 files. Configure will offer to let you do this before it runs the SH files.
2111 dflt='Type carriage return to continue'
2113 case "$firsttime" in
2114 true) echo $user >>../.config/instruct;;
2118 : find out where common programs are
2120 echo "Locating common programs..." >&4
2133 if test -d \$dir/\$thing; then
2139 for thisthing in \$dir/\$thing; do
2140 : just loop through to pick last item
2142 if test -f \$thisthing; then
2145 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2148 elif test -f \$dir/\$thing.exe; then
2149 if test -n "$DJGPP"; then
2150 echo \$dir/\$thing.exe
2152 : on Eunice apparently
2205 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2206 pth="$pth /lib /usr/lib"
2207 for file in $loclist; do
2211 if test -f "$xxx"; then
2214 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2215 xxx=`./loc $file $file $pth`
2218 '') xxx=`./loc $file $file $pth`;;
2219 *) xxx=`./loc $xxx $xxx $pth`;;
2221 eval $file=$xxx$_exe
2225 echo $file is in $xxx.
2228 echo $file is in $xxx.
2231 echo "I don't know where '$file' is, and my life depends on it." >&4
2232 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2238 echo "Don't worry if any of the following aren't found..."
2240 for file in $trylist; do
2244 if test -f "$xxx"; then
2247 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2248 xxx=`./loc $file $file $pth`
2251 '') xxx=`./loc $file $file $pth`;;
2252 *) xxx=`./loc $xxx $xxx $pth`;;
2254 eval $file=$xxx$_exe
2258 echo $file is in $xxx.
2261 echo $file is in $xxx.
2264 echo "I don't see $file out there, $say."
2271 echo "Substituting grep for egrep."
2278 echo "Substituting cp for ln."
2287 echo "I can't find make or gmake, and my life depends on it." >&4
2288 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2296 *) # We can't have osname yet.
2297 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2298 # Assume that gmake, if found, is definitely GNU make
2299 # and prefer it over the system make.
2300 echo "Substituting gmake for make."
2308 echo "Hopefully test is built into your sh."
2311 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2312 echo "Using the test built into your sh."
2320 echo "Hopefully echo is built into your sh."
2325 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2326 $echo $n "hi there$c" >foo1
2327 echo $n "hi there$c" >foo2
2328 if cmp foo1 foo2 >/dev/null 2>&1; then
2329 echo "They are compatible. In fact, they may be identical."
2336 They are not compatible! You are probably running ksh on a non-USG system.
2337 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2338 have echo built in and we may have to run some Bourne shell scripts. That
2339 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2342 $echo $n "The star should be here-->$c"
2352 cat <<'EOSC' >>trygcc
2357 int main(int argc, char *argv[]) {
2361 if $cc -o try $ccflags $ldflags try.c; then
2364 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2370 case "`$cc -v -c try.c 2>&1`" in
2373 if $test X"$trygcc" = Xyes; then
2374 if gcc -o try -c try.c; then
2376 echo "You seem to have a working gcc, though." >&4
2377 rp="Would you like to use it?"
2379 if $test -f myread; then
2382 if $test -f UU/myread; then
2385 echo "Cannot find myread, sorry. Aborting." >&2
2390 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2391 if $test -f usethreads.cbu; then
2394 *** However, any setting of the C compiler flags (e.g. for thread support)
2395 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2396 *** (together with e.g. -Dusethreads).
2412 cat <<'EOSC' >>checkcc
2417 int main(int argc, char *argv[]) {
2421 if $cc -o try $ccflags $ldflags try.c; then
2424 if $test X"$despair" = Xyes; then
2425 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2428 You need to find a working C compiler.
2429 Either (purchase and) install the C compiler supplied by your OS vendor,
2430 or for a free C compiler try http://gcc.gnu.org/
2431 I cannot continue any further, aborting.
2440 : determine whether symbolic links are supported
2443 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2444 echo "Symbolic links are supported." >&4
2447 echo "Symbolic links are NOT supported." >&4
2452 : determine whether symbolic links are supported
2456 echo "Checking how to test for symbolic links..." >&4
2458 if $test "X$issymlink" = X; then
2460 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2461 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2463 if test $? = 0; then
2466 echo "Your builtin 'test -h' may be broken." >&4
2469 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2472 if test -f "$p/$test"; then
2481 echo "Trying external '$test -h'." >&4
2482 issymlink="$test -h"
2483 if $test ! -h sym >/dev/null 2>&1; then
2484 echo "External '$test -h' is broken, too." >&4
2492 if $test "X$issymlink" = X; then
2493 if $test -L sym 2>/dev/null; then
2494 issymlink="$test -L"
2495 echo "The builtin '$test -L' worked." >&4
2498 if $test "X$issymlink" != X; then
2499 echo "You can test for symbolic links with '$issymlink'." >&4
2501 echo "I do not know how you can test for symbolic links." >&4
2505 *) echo "No symbolic links, so not testing for their testing..." >&4
2511 case "$mksymlinks" in
2514 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2517 *) case "$lns:$issymlink" in
2518 *"ln"*" -s:"*"test -"?)
2519 echo "Creating the symbolic links..." >&4
2520 echo "(First creating the subdirectories...)" >&4
2522 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2524 test -z "$directory" && break
2528 if test ! -d t/base; then
2529 echo "Failed to create the subdirectories. Aborting." >&4
2532 echo "(Then creating the symlinks...)" >&4
2533 awk '{print $1}' $src/MANIFEST | while true; do
2535 test -z "$filename" && break
2536 if test -f $filename; then
2537 if $issymlink $filename; then
2541 if test -f $filename; then
2542 echo "$filename already exists, not symlinking."
2544 ln -s $src/$filename $filename
2548 if test ! -f t/base/lex.t; then
2549 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2554 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2563 case "$usecrosscompile" in
2565 $echo "Cross-compiling..."
2568 *-*-gcc) # A cross-compiling gcc, probably.
2569 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2571 # leave out ld, choosing it is more complex
2573 ranlib=$targetarch-ranlib
2574 $echo 'extern int foo;' > try.c
2575 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2577 if $test $# -gt 0; then
2579 incpth="`$echo $incpth|$sed 's/^ //'`"
2580 echo "Guessing incpth '$incpth'." >&4
2582 j="`$echo $i|$sed 's,/include$,/lib,'`"
2583 if $test -d $j; then
2587 libpth="`$echo $libpth|$sed 's/^ //'`"
2588 echo "Guessing libpth '$libpth'." >&4
2593 case "$targetarch" in
2594 '') echo "Targetarch not defined." >&4; croak=y ;;
2595 *) echo "Using targetarch $targetarch." >&4 ;;
2598 '') echo "Incpth not defined." >&4; croak=y ;;
2599 *) echo "Using incpth '$incpth'." >&4 ;;
2602 '') echo "Libpth not defined." >&4; croak=y ;;
2603 *) echo "Using libpth '$libpth'." >&4 ;;
2606 '') for i in $incpth; do
2607 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2609 echo "Guessing usrinc $usrinc." >&4
2614 '') echo "Usrinc not defined." >&4; croak=y ;;
2617 *) echo "Using usrinc $usrinc." >&4 ;;
2619 case "$targethost" in
2620 '') echo "Targethost not defined." >&4; croak=y ;;
2621 *) echo "Using targethost $targethost." >&4
2626 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2629 /*) run=$src/Cross/run
2630 targetmkdir=$src/Cross/mkdir
2632 from=$src/Cross/from
2634 *) pwd=`$test -f ../Configure & cd ..; pwd`
2636 targetmkdir=$pwd/Cross/mkdir
2638 from=$pwd/Cross/from
2641 case "$targetrun" in
2642 '') targetrun=ssh ;;
2647 case "$targetfrom" in
2648 '') targetfrom=scp ;;
2652 from=$from-$targetfrom
2653 case "$targetdir" in
2655 echo "Guessing targetdir $targetdir." >&4
2658 case "$targetuser" in
2660 echo "Guessing targetuser $targetuser." >&4
2663 case "$targetfrom" in
2667 case "$targetrun" in
2679 '') cwd=$targetdir ;;
2683 if $test ! -f \$exe.xok; then
2687 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2690 *) echo "Unknown targetrun '$targetrun'" >&4
2694 case "$targetmkdir" in
2696 cat >$targetmkdir <<EOF
2698 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2700 $chmod a+rx $targetmkdir
2702 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2714 $targetmkdir \`dirname \$f\`
2715 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2718 $targetmkdir $targetdir/\`dirname \$f\`
2719 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2732 $mkdir -p $targetdir/\`dirname \$f\`
2733 $cp \$f $targetdir/\$f || exit 1
2736 $targetmkdir $targetdir/\`dirname \$f\`
2737 $cp \$f $targetdir/\$f || exit 1
2744 *) echo "Unknown targetto '$targetto'" >&4
2748 case "$targetfrom" in
2755 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2760 cp) cat >$from <<EOF
2765 cp $targetdir/\$f . || exit 1
2770 *) echo "Unknown targetfrom '$targetfrom'" >&4
2774 if $test ! -f $run; then
2775 echo "Target 'run' script '$run' not found." >&4
2779 if $test ! -f $to; then
2780 echo "Target 'to' script '$to' not found." >&4
2784 if $test ! -f $from; then
2785 echo "Target 'from' script '$from' not found." >&4
2789 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2793 Using '$run' for remote execution,
2794 and '$from' and '$to'
2795 for remote file transfer.
2801 usecrosscompile='undef'
2806 : see whether [:lower:] and [:upper:] are supported character classes
2808 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2810 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2814 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2815 # (0xc9 and 0xd1), therefore that is a nice testing point.
2816 if test "X$up" = X -o "X$low" = X; then
2817 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2823 if test "X$up" = X -o "X$low" = X; then
2824 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2830 if test "X$up" = X -o "X$low" = X; then
2831 case "`echo IJ | od -x 2>/dev/null`" in
2833 echo "Hey, this might be EBCDIC." >&4
2834 if test "X$up" = X -o "X$low" = X; then
2835 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2836 ij) up='[A-IJ-RS-Z]'
2841 if test "X$up" = X -o "X$low" = X; then
2842 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2852 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2854 echo "Using $up and $low to convert case." >&4
2857 echo "I don't know how to translate letters from upper to lower case." >&4
2858 echo "Your tr is not acting any way I know of." >&4
2862 : set up the translation script tr, must be called with ./tr of course
2866 '[A-Z][a-z]') exec $tr '$up' '$low';;
2867 '[a-z][A-Z]') exec $tr '$low' '$up';;
2874 : Try to determine whether config.sh was made on this system
2875 case "$config_sh" in
2877 myuname=`$uname -a 2>/dev/null`
2878 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2879 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2880 # because the A-Z/a-z are not consecutive.
2881 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2882 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2883 newmyuname="$myuname"
2885 case "$knowitall" in
2887 if test -f ../config.sh; then
2888 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2889 eval "`grep myuname= ../config.sh`"
2891 if test "X$myuname" = "X$newmyuname"; then
2899 : Get old answers from old config file if Configure was run on the
2900 : same system, otherwise use the hints.
2903 if test -f config.sh; then
2905 rp="I see a config.sh file. Shall I use it to set the defaults?"
2908 n*|N*) echo "OK, I'll ignore it."
2909 mv config.sh config.sh.old
2910 myuname="$newmyuname"
2912 *) echo "Fetching default answers from your old config.sh file..." >&4
2920 : Older versions did not always set $sh. Catch re-use of such
2930 if test ! -f config.sh; then
2933 First time through, eh? I have some defaults handy for some systems
2934 that need some extra help getting the Configure answers right:
2937 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2939 : Half the following guesses are probably wrong... If you have better
2940 : tests or hints, please send them to perlbug@perl.org
2941 : The metaconfig authors would also appreciate a copy...
2942 $test -f /irix && osname=irix
2943 $test -f /xenix && osname=sco_xenix
2944 $test -f /dynix && osname=dynix
2945 $test -f /dnix && osname=dnix
2946 $test -f /lynx.os && osname=lynxos
2947 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2948 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2949 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2950 $test -f /bin/mips && /bin/mips && osname=mips
2951 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2952 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2953 $test -d /usr/apollo/bin && osname=apollo
2954 $test -f /etc/saf/_sactab && osname=svr4
2955 $test -d /usr/include/minix && osname=minix
2956 $test -f /system/gnu_library/bin/ar.pm && osname=vos
2957 if $test -d /MachTen -o -d /MachTen_Folder; then
2959 if $test -x /sbin/version; then
2960 osvers=`/sbin/version | $awk '{print $2}' |
2961 $sed -e 's/[A-Za-z]$//'`
2962 elif $test -x /usr/etc/version; then
2963 osvers=`/usr/etc/version | $awk '{print $2}' |
2964 $sed -e 's/[A-Za-z]$//'`
2970 $test -f /sys/posix.dll &&
2971 $test -f /usr/bin/what &&
2972 set X `/usr/bin/what /sys/posix.dll` &&
2973 $test "$3" = UWIN &&
2977 if $test -f $uname; then
2985 umips) osname=umips ;;
2988 [23]100) osname=mips ;;
2989 next*) osname=next ;;
2991 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2992 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2995 elif $test -f /etc/kconfig; then
2997 if test "$lns" = "$ln -s"; then
2999 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3001 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3008 if test -n "$DJGPP"; then
3017 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3019 'not found') osvers="$4"."$3" ;;
3020 '<3240'|'<>3240') osvers=3.2.0 ;;
3021 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3022 '=3250'|'>3250') osvers=3.2.5 ;;
3026 bsd386) osname=bsd386
3029 cygwin*) osname=cygwin
3032 *dc.osx) osname=dcosx
3038 domainos) osname=apollo
3044 dynixptx*) osname=dynixptx
3045 osvers=`echo "$4"|sed 's/^v//'`
3047 freebsd) osname=freebsd
3049 genix) osname=genix ;;
3051 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3067 netbsd*) osname=netbsd
3070 news-os) osvers="$3"
3072 4*) osname=newsos4 ;;
3076 next*) osname=next ;;
3077 nonstop-ux) osname=nonstopux ;;
3078 openbsd) osname=openbsd
3081 POSIX-BC | posix-bc ) osname=posix-bc
3084 powerux | power_ux | powermax_os | powermaxos | \
3085 powerunix | power_unix) osname=powerux
3091 solaris) osname=solaris
3093 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3100 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3104 titanos) osname=titanos
3113 ultrix) osname=ultrix
3116 osf1|mls+) case "$5" in
3119 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3122 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3125 hp*) osname=hp_osf1 ;;
3126 mips) osname=mips_osf1 ;;
3129 unixware) osname=svr5
3137 $2) case "$osname" in
3141 : svr4.x or possibly later
3151 if test -f /stand/boot ; then
3152 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3153 if test -n "$INITPROG" -a -f "$INITPROG"; then
3154 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3155 if test -n "$isesix"; then
3163 *) if test -f /etc/systemid; then
3165 set `echo $3 | $sed 's/\./ /g'` $4
3166 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3168 elif $test -f $src/hints/sco_$1_$2.sh; then
3170 elif $test -f $src/hints/sco_$1.sh; then
3175 '') : Still unknown. Probably a generic Sys V.
3184 *) case "$osname" in
3185 '') : Still unknown. Probably a generic BSD.
3193 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3194 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3195 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3198 $rm -f UU/kernel.what
3199 elif test -d c:/.; then
3206 case "$targetarch" in
3209 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3214 : Now look for a hint file osname_osvers, unless one has been
3215 : specified already.
3218 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3219 : Also try without trailing minor version numbers.
3220 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3221 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3222 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3223 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3226 *) case "$osvers" in
3229 *) if $test -f $src/hints/$file.sh ; then
3231 elif $test -f $src/hints/$xfile.sh ; then
3233 elif $test -f $src/hints/$xxfile.sh ; then
3235 elif $test -f $src/hints/$xxxfile.sh ; then
3237 elif $test -f $src/hints/$xxxxfile.sh ; then
3239 elif $test -f "$src/hints/${osname}.sh" ; then
3248 if $test -f Policy.sh ; then
3251 none) dflt="Policy" ;;
3252 *) dflt="Policy $dflt" ;;
3257 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3261 if $test -f Policy.sh ; then
3264 There's also a Policy hint file available, which should make the
3265 site-specific (policy) questions easier to answer.
3272 You may give one or more space-separated answers, or "none" if appropriate.
3273 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3274 is a good thing. DO NOT give a wrong version or a wrong OS.
3278 rp="Which of these apply, if any?"
3281 for file in $tans; do
3282 if $test X$file = XPolicy -a -f Policy.sh; then
3284 $cat Policy.sh >> UU/config.sh
3285 elif $test -f $src/hints/$file.sh; then
3286 . $src/hints/$file.sh
3287 $cat $src/hints/$file.sh >> UU/config.sh
3288 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3291 : Give one chance to correct a possible typo.
3292 echo "$file.sh does not exist"
3294 rp="hint to use instead?"
3296 for file in $ans; do
3297 if $test -f "$src/hints/$file.sh"; then
3298 . $src/hints/$file.sh
3299 $cat $src/hints/$file.sh >> UU/config.sh
3300 elif $test X$ans = X -o X$ans = Xnone ; then
3303 echo "$file.sh does not exist -- ignored."
3310 : Remember our hint file for later.
3311 if $test -f "$src/hints/$file.sh" ; then
3321 echo "Fetching default answers from $config_sh..." >&4
3325 cp $config_sh config.sh 2>/dev/null
3335 test "$override" && . ./optdef.sh
3337 : Restore computed paths
3338 for file in $loclist $trylist; do
3339 eval $file="\$_$file"
3344 Configure uses the operating system name and version to set some defaults.
3345 The default value is probably right if the name rings a bell. Otherwise,
3346 since spelling matters for me, either accept the default or answer "none"
3353 ''|' '|none) dflt=none ;;
3354 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3357 *) dflt="$osname" ;;
3359 rp="Operating system name?"
3363 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3369 ''|' '|none) dflt=none ;;
3370 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3371 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3373 ''|' ') dflt=none ;;
3378 *) dflt="$osvers" ;;
3380 rp="Operating system version?"
3390 : who configured the system
3391 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3392 cf_by=`(logname) 2>/dev/null`
3395 cf_by=`(whoami) 2>/dev/null`
3397 "") cf_by=unknown ;;
3401 : set up the script used to warn in case of inconsistency
3408 echo "*** WHOA THERE!!! ***" >&4
3409 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3410 rp=" Keep the $hint value?"
3413 y) td=$was; tu=$was;;
3417 : function used to set $1 to $val
3418 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3420 $define$undef) . ./whoa; eval "$var=\$td";;
3421 $undef$define) . ./whoa; eval "$var=\$tu";;
3422 *) eval "$var=$val";;
3425 case "$usethreads" in
3426 $define|true|[yY]*) dflt='y';;
3427 *) # Catch case where user specified ithreads or 5005threads but
3428 # forgot -Dusethreads (A.D. 4/2002)
3429 case "$useithreads$use5005threads" in
3430 *$define*) dflt='y' ;;
3437 Perl can be built to take advantage of threads on some systems.
3438 To do so, Configure can be run with -Dusethreads.
3440 Note that threading is a highly experimental feature, and
3441 some known race conditions still remain. If you choose to try
3442 it, be very sure to not actually deploy it for production
3443 purposes. README.threads has more details, and is required
3444 reading if you enable threads.
3446 If this doesn't make any sense to you, just accept the default '$dflt'.
3448 rp='Build a threading Perl?'
3451 y|Y) val="$define" ;;
3457 case "$usethreads" in
3461 As of release 5.6, Perl has two different threading implementations,
3462 an interpreter-based version (ithreads) with one interpreter per
3463 thread, and the 5.005 version (5005threads). Both implementations
3464 are considered experimental, but since 5.8 ithreads somewhat less so.
3465 The 5005threads is effectively unmaintained.
3468 : Default to ithreads unless overridden on command line or with
3471 case "$use5005threads" in
3472 $define|true|[yY]*) dflt='n';;
3474 case "$useithreads" in
3475 $undef|false|[nN]*) dflt='n';;
3477 rp='Use interpreter-based ithreads?'
3480 y|Y) val="$define" ;;
3485 : Now set use5005threads to the opposite value.
3486 case "$useithreads" in
3487 $define) val="$undef" ;;
3494 useithreads="$undef"
3495 use5005threads="$undef"
3499 case "$useithreads$use5005threads" in
3503 You cannot have both the ithreads and the 5.005 threads enabled
3504 at the same time. Disabling the 5.005 threads since they are
3505 much less stable than the ithreads.
3508 use5005threads="$undef"
3512 case "$d_oldpthreads" in
3513 '') : Configure tests would be welcome here. For now, assume undef.
3515 *) val="$d_oldpthreads" ;;
3521 case "$usethreads" in
3522 "$define"|true|[yY]*)
3523 : Look for a hint-file generated 'call-back-unit'. If the
3524 : user has specified that a threading perl is to be built,
3525 : we may need to set or change some other defaults.
3526 if $test -f usethreads.cbu; then
3527 echo "Your platform has some specific hints for threaded builds, using them..."
3531 (Your platform doesn't have any specific hints for threaded builds.
3532 Assuming POSIX threads, then.)
3540 Perl can be built so that multiple Perl interpreters can coexist
3541 within the same Perl executable.
3544 case "$useithreads" in
3547 This multiple interpreter support is required for interpreter-based threads.
3551 *) case "$usemultiplicity" in
3552 $define|true|[yY]*) dflt='y';;
3556 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3557 rp='Build Perl for multiplicity?'
3560 y|Y) val="$define" ;;
3569 case "$usemorebits" in
3570 "$define"|true|[yY]*)
3571 use64bitint="$define"
3572 uselongdouble="$define"
3573 usemorebits="$define"
3575 *) usemorebits="$undef"
3579 : make some quick guesses about what we are up against
3581 $echo $n "Hmm... $c"
3591 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3592 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3594 echo "Looks kind of like an OSF/1 system, but we'll see..."
3596 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3597 xxx=`./loc addbib blurfl $pth`
3598 if $test -f $xxx; then
3599 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3603 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3604 echo "Looks kind of like an extended USG system, but we'll see..."
3606 echo "Looks kind of like a USG system, but we'll see..."
3610 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3611 echo "Looks kind of like a BSD system, but we'll see..."
3615 echo "Looks kind of like a Version 7 system, but we'll see..."
3618 case "$eunicefix" in
3621 There is, however, a strange, musty smell in the air that reminds me of
3622 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3626 : it so happens the Eunice I know will not run shell scripts in Unix format
3630 echo "Congratulations. You aren't running Eunice."
3634 : Detect OS2. The p_ variable is set above in the Head.U unit.
3635 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3636 : semicolon as a patch separator
3641 I have the feeling something is not exactly right, however...don't tell me...
3642 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3643 (Or you may be running DOS with DJGPP.)
3648 if test -f /xenix; then
3649 echo "Actually, this looks more like a XENIX system..."
3654 echo "It's not Xenix..."
3659 if test -f /venix; then
3660 echo "Actually, this looks more like a VENIX system..."
3667 echo "Nor is it Venix..."
3670 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3671 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3678 rp="Use which C compiler?"
3682 : See if they have not cc but they do have gcc
3684 : Look for a hint-file generated 'call-back-unit'. Now that the
3685 : user has specified the compiler, we may need to set or change some
3687 if $test -f cc.cbu; then
3693 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3699 printf("%s\n", __VERSION__);
3701 printf("%s\n", "1");
3707 if $cc -o try $ccflags $ldflags try.c; then
3708 gccversion=`$run ./try`
3709 case "$gccversion" in
3710 '') echo "You are not using GNU cc." ;;
3711 *) echo "You are using GNU cc $gccversion."
3717 echo "*** WHOA THERE!!! ***" >&4
3718 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3719 case "$knowitall" in
3721 echo " You'd better start hunting for one and let me know about it." >&4
3727 case "$gccversion" in
3728 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3730 case "$gccversion" in
3731 '') gccosandvers='' ;;
3732 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3733 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3735 case "$gccosandvers" in
3736 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3737 $osname$osvers) ;; # looking good
3738 $osname*) cat <<EOM >&4
3740 *** WHOA THERE!!! ***
3742 Your gcc has not been compiled for the exact release of
3743 your operating system ($gccosandvers versus $osname$osvers).
3745 In general it is a good idea to keep gcc synchronized with
3746 the operating system because otherwise serious problems
3747 may ensue when trying to compile software, like Perl.
3749 I'm trying to be optimistic here, though, and will continue.
3750 If later during the configuration and build icky compilation
3751 problems appear (headerfile conflicts being the most common
3752 manifestation), I suggest reinstalling the gcc to match
3753 your operating system release.
3757 *) gccosandvers='' ;; # failed to parse, better be silent
3766 : decide how portable to be. Allow command line overrides.
3767 case "$d_portable" in
3769 *) d_portable="$define" ;;
3772 : set up shell script to do ~ expansion
3778 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3781 if $test -f /bin/csh; then
3782 /bin/csh -f -c "glob \$1"
3787 name=\`$expr x\$1 : '..\([^/]*\)'\`
3788 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3789 if $test ! -d "\$dir"; then
3791 echo "\$me: can't locate home directory for: \$name" >&2
3796 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3812 : now set up to get a file name
3816 cat <<'EOSC' >>getfile
3832 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3833 fn=`echo $fn | sed 's/(.*)//'`
3839 loc_file=`expr $fn : '.*:\(.*\)'`
3840 fn=`expr $fn : '\(.*\):.*'`
3848 */*) fullpath=true;;
3857 *e*) exp_file=true;;
3860 *p*) nopath_ok=true;;
3865 *d*) type='Directory';;
3866 *l*) type='Locate';;
3871 Locate) what='File';;
3876 case "$d_portable" in
3884 while test "$type"; do
3889 true) rp="$rp (~name ok)";;
3892 if test -f UU/getfile.ok && \
3893 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3912 value=`UU/filexp $ans`
3915 if test "$ans" != "$value"; then
3916 echo "(That expands to $value on this system.)"
3930 /*) value="$ansexp" ;;
3931 [a-zA-Z]:/*) value="$ansexp" ;;
3936 echo "I shall only accept a full path name, as in /bin/ls." >&4
3937 echo "Use a ! shell escape if you wish to check pathnames." >&4
3940 echo "Please give a full path name, starting with slash." >&4
3943 echo "Note that using ~name is ok provided it expands well." >&4
3956 for fp in $gfpth; do
3957 if test "X$fp" = X.; then
3962 if test -f "$pf"; then
3964 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3966 echo "($value is not a plain file, but that's ok.)"
3969 if test X"$type" = X; then
3976 for fp in $gfpth; do
3977 if test "X$fp" = X.; then
3982 direxp="$fp/$ansexp"
3984 if test -d "$direxp"; then
3992 if test -d "$ansexp"; then
3993 echo "(Looking for $loc_file in directory $value.)"
3994 value="$value/$loc_file"
3995 ansexp="$ansexp/$loc_file"
3997 if test -f "$ansexp"; then
4000 case "$nopath_ok" in
4001 true) case "$value" in
4003 *) echo "Assuming $value will be in people's path."
4019 if test "$fastread" = yes; then
4024 rp="$what $value doesn't exist. Use that name anyway?"
4043 test "X$gfpthkeep" != Xy && gfpth=""
4046 : What should the include directory be ?
4048 $echo $n "Hmm... $c"
4052 if $test -f /bin/mips && /bin/mips; then
4053 echo "Looks like a MIPS system..."
4054 $cat >usr.c <<'EOCP'
4055 #ifdef SYSTYPE_BSD43
4059 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4060 dflt='/bsd43/usr/include'
4064 mips_type='System V'
4066 $rm -f usr.c usr.out
4067 echo "and you're compiling with the $mips_type compiler and libraries."
4071 echo "Doesn't look like a MIPS system."
4081 case "$xxx_prompt" in
4084 rp='Where are the include files you want to use?'
4092 : see how we invoke the C preprocessor
4094 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4095 cat <<'EOT' >testcpp.c
4101 if test ! -f cppstdin; then
4102 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4103 # AIX cc -E doesn't show the absolute headerfile
4104 # locations but we'll cheat by using the -M flag.
4105 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
4107 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4110 echo "Keeping your $hint cppstdin wrapper."
4113 wrapper=`pwd`/cppstdin
4117 if $test "X$cppstdin" != "X" && \
4118 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4119 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4121 echo "You used to use $cppstdin $cppminus so we'll use that again."
4123 '') echo "But let's see if we can live without a wrapper..." ;;
4125 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4126 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4128 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4131 echo "(However, $cpprun $cpplast does not work, let's see...)"
4139 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4146 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4147 $cc -E <testcpp.c >testcpp.out 2>&1; \
4148 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4149 echo "Yup, it does."
4152 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4153 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4154 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4155 echo "Yup, it does."
4158 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4159 $cc -P <testcpp.c >testcpp.out 2>&1; \
4160 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4161 echo "Yipee, that works!"
4164 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4165 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4166 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4167 echo "At long last!"
4170 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4171 $cpp <testcpp.c >testcpp.out 2>&1; \
4172 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4176 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4177 $cpp - <testcpp.c >testcpp.out 2>&1; \
4178 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4179 echo "Hooray, it works! I was beginning to wonder."
4182 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4183 $wrapper <testcpp.c >testcpp.out 2>&1; \
4184 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4190 rp="No dice. I can't find a C preprocessor. Name one:"
4194 $x_cpp <testcpp.c >testcpp.out 2>&1
4195 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4196 echo "OK, that will do." >&4
4198 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4213 echo "Perhaps can we force $cc -E using a wrapper..."
4214 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4215 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4221 echo "Nope, we'll have to live without it..."
4235 "$wrapper"|'cppstdin') ;;
4236 *) $rm -f $wrapper;;
4238 $rm -f testcpp.c testcpp.out
4240 : Set private lib path
4243 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4248 '') dlist="$loclibpth $plibpth $glibpth";;
4249 *) dlist="$libpth";;
4252 : Now check and see which directories actually exist, avoiding duplicates
4256 if $test -d $xxx; then
4259 *) libpth="$libpth $xxx";;
4265 Some systems have incompatible or broken versions of libraries. Among
4266 the directories listed in the question below, please remove any you
4267 know not to be holding relevant libraries, and add any that are needed.
4268 Say "none" for none.
4279 rp="Directories to use for library searches?"
4286 : compute shared library extension
4289 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4299 On some systems, shared libraries may be available. Answer 'none' if
4300 you want to suppress searching of shared libraries for the remainder
4301 of this configuration.
4304 rp='What is the file extension used for shared libraries?'
4308 : Define several unixisms.
4309 : Hints files or command line option can be used to override them.
4310 : The convoluted testing is in case hints files set either the old
4313 '') case "$exe_ext" in
4315 *) _exe="$exe_ext" ;;
4320 '') case "$lib_ext" in
4327 '') case "$obj_ext" in
4334 '') case "$path_sep" in
4345 : Which makefile gets called first. This is used by make depend.
4346 case "$firstmakefile" in
4347 '') firstmakefile='makefile';;
4351 $define|true|[yY]*) dflt='y';;
4356 Perl can be built to use the SOCKS proxy protocol library. To do so,
4357 Configure must be run with -Dusesocks. If you use SOCKS you also need
4358 to use the PerlIO abstraction layer, this will be implicitly selected.
4360 If this doesn't make any sense to you, just accept the default '$dflt'.
4362 rp='Build Perl for SOCKS?'
4365 y|Y) val="$define" ;;
4372 $define|true|[yY]*) useperlio="$define";;
4375 : Looking for optional libraries
4377 echo "Checking for optional libraries..." >&4
4382 case "$libswanted" in
4383 '') libswanted='c_s';;
4386 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4392 for thisdir in $libpth $xlibpth; do
4393 test -d $thisdir && libspath="$libspath $thisdir"
4395 for thislib in $libswanted; do
4396 for thisdir in $libspath; do
4398 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4399 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4400 $test -f "$xxx" && eval $libscheck
4401 $test -f "$xxx" && libstyle=shared
4403 if test ! -f "$xxx"; then
4404 xxx=$thisdir/lib$thislib.$so
4405 $test -f "$xxx" && eval $libscheck
4406 $test -f "$xxx" && libstyle=shared
4408 if test ! -f "$xxx"; then
4409 xxx=$thisdir/lib$thislib$_a
4410 $test -f "$xxx" && eval $libscheck
4411 $test -f "$xxx" && libstyle=static
4413 if test ! -f "$xxx"; then
4414 xxx=$thisdir/$thislib$_a
4415 $test -f "$xxx" && eval $libscheck
4416 $test -f "$xxx" && libstyle=static
4418 if test ! -f "$xxx"; then
4419 xxx=$thisdir/lib${thislib}_s$_a
4420 $test -f "$xxx" && eval $libscheck
4421 $test -f "$xxx" && libstyle=static
4422 $test -f "$xxx" && thislib=${thislib}_s
4424 if test ! -f "$xxx"; then
4425 xxx=$thisdir/Slib$thislib$_a
4426 $test -f "$xxx" && eval $libscheck
4427 $test -f "$xxx" && libstyle=static
4429 if $test -f "$xxx"; then
4431 shared) echo "Found -l$thislib (shared)." ;;
4432 static) echo "Found -l$thislib." ;;
4433 *) echo "Found -l$thislib ($libstyle)." ;;
4437 *) dflt="$dflt -l$thislib"
4438 libsfound="$libsfound $xxx"
4440 libsfiles="$libsfiles $yyy"
4441 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4442 case " $libsdirs " in
4444 *) libsdirs="$libsdirs $yyy" ;;
4451 if $test ! -f "$xxx"; then
4452 echo "No -l$thislib."
4463 ' '|'') dflt='none';;
4468 In order to compile $package on your machine, a number of libraries
4469 are usually needed. Include any other special libraries here as well.
4470 Say "none" for none. The default list is almost always right.
4474 rp="What libraries to use?"
4481 : determine optimization, if desired, or use for debug flag also
4483 ' '|$undef) dflt='none';;
4485 *) dflt="$optimize";;
4489 By default, $package compiles with the -O flag to use the optimizer.
4490 Alternately, you might want to use the symbolic debugger, which uses
4491 the -g flag (on traditional Unix systems). Either flag can be
4492 specified here. To use neither flag, specify the word "none".
4495 rp="What optimizer/debugger flag should be used?"
4499 'none') optimize=" ";;
4503 : We will not override a previous value, but we might want to
4504 : augment a hint file
4506 default|recommended)
4507 case "$gccversion" in
4508 1*) dflt='-fpcc-struct-return' ;;
4511 *-g*) dflt="$dflt -DDEBUGGING";;
4513 case "$gccversion" in
4514 2*) if test -d /etc/conf/kconfig.d &&
4515 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4521 case "$gccversion" in
4525 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4526 echo 'int main(void) { return 0; }' > gcctest.c
4527 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4528 echo "Yes, it does." 2>&1
4531 echo "Leaving current flags $ccflags alone." 2>&1
4533 *) dflt="$dflt -fno-strict-aliasing" ;;
4536 echo "Nope, it doesn't, but that's ok." 2>&1
4543 case "$mips_type" in
4544 *BSD*|'') inclwanted="$locincpth $usrinc";;
4545 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4547 for thisincl in $inclwanted; do
4548 if $test -d $thisincl; then
4549 if $test x$thisincl != x$usrinc; then
4551 *" -I$thisincl "*);;
4552 *) dflt="$dflt -I$thisincl ";;
4558 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4560 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4568 *) dflt="$dflt -D$2";;
4572 set signal.h LANGUAGE_C; eval $inctest
4576 ccflags="$ccflags -DSOCKS"
4581 default|recommended) dflt="$ccflags $dflt" ;;
4582 *) dflt="$ccflags";;
4591 Your C compiler may want other flags. For this question you should include
4592 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4593 but you should NOT include libraries or ld flags like -lwhatever. If you
4594 want $package to honor its debug switch, you should include -DDEBUGGING here.
4595 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4597 To use no flags, specify the word "none".
4603 rp="Any additional cc flags?"
4610 : the following weeds options from ccflags that are of no interest to cpp
4612 '') cppflags="$ccflags" ;;
4613 *) cppflags="$cppflags $ccflags" ;;
4615 case "$gccversion" in
4616 1*) cppflags="$cppflags -D__GNUC__"
4618 case "$mips_type" in
4620 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4626 echo "Let me guess what the preprocessor flags are..." >&4
4640 *) ftry="$previous $flag";;
4642 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4643 >cpp1.out 2>/dev/null && \
4644 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4645 >cpp2.out 2>/dev/null && \
4646 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4647 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4649 cppflags="$cppflags $ftry"
4659 *-*) echo "They appear to be: $cppflags";;
4661 $rm -f cpp.c cpp?.out
4665 : flags used in final linking phase
4667 '') if ./venix; then
4673 *-posix*) dflt="$dflt -posix" ;;
4676 *) dflt="$ldflags";;
4679 : Try to guess additional flags to pick up local libraries.
4680 for thislibdir in $libpth; do
4681 case " $loclibpth " in
4684 *"-L$thislibdir "*) ;;
4685 *) dflt="$dflt -L$thislibdir" ;;
4697 Your C linker may need flags. For this question you should
4698 include -L/whatever and any other flags used by the C linker, but you
4699 should NOT include libraries like -lwhatever.
4701 Make sure you include the appropriate -L/path flags if your C linker
4702 does not normally search all of the directories you specified above,
4705 To use no flags, specify the word "none".
4709 rp="Any additional ld flags (NOT including libraries)?"
4715 rmlist="$rmlist pdp11"
4719 echo "Checking your choice of C compiler and flags for coherency..." >&4
4720 $cat > try.c <<'EOF'
4722 int main() { printf("Ok\n"); exit(0); }
4724 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4726 $cat >try.msg <<'EOM'
4727 I've tried to compile and run the following simple program:
4730 $cat try.c >> try.msg
4732 $cat >> try.msg <<EOM
4739 and I got the following output:
4743 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4744 if $sh -c "$run ./try" >>try.msg 2>&1; then
4748 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4751 cat >> try.msg <<'EOQS'
4752 If $libs contains -lsfio, and sfio is mis-configured, then it
4753 sometimes (apparently) runs and exits with a 0 status, but with no
4754 output! It may have to do with sfio's use of _exit vs. exit.
4757 rp="You have a big problem. Shall I abort Configure"
4764 echo "The program compiled OK, but exited with status $?." >>try.msg
4765 rp="You have a problem. Shall I abort Configure"
4769 echo "I can't compile the test program." >>try.msg
4770 rp="You have a BIG problem. Shall I abort Configure"
4776 case "$knowitall" in
4778 echo "(The supplied flags or libraries might be incorrect.)"
4786 *) echo "Ok. Stopping Configure." >&4
4791 n) echo "OK, that should do.";;
4793 $rm -f try try.* core
4795 : define a shorthand compile call
4799 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4800 : define a shorthand compile call for compilations that should be ok.
4804 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4806 : check for lengths of integral types
4810 echo "Checking to see how big your integers are..." >&4
4811 $cat >try.c <<'EOCP'
4815 printf("intsize=%d;\n", (int)sizeof(int));
4816 printf("longsize=%d;\n", (int)sizeof(long));
4817 printf("shortsize=%d;\n", (int)sizeof(short));
4822 if eval $compile_ok && $run ./try > /dev/null; then
4824 echo "Your integers are $intsize bytes long."
4825 echo "Your long integers are $longsize bytes long."
4826 echo "Your short integers are $shortsize bytes long."
4830 Help! I can't compile and run the intsize test program: please enlighten me!
4831 (This is probably a misconfiguration in your system or libraries, and
4832 you really ought to fix it. Still, I'll try anyway.)
4836 rp="What is the size of an integer (in bytes)?"
4840 rp="What is the size of a long integer (in bytes)?"
4844 rp="What is the size of a short integer (in bytes)?"
4852 : check for void type
4854 echo "Checking to see how well your C compiler groks the void type..." >&4
4855 case "$voidflags" in
4857 $cat >try.c <<'EOCP'
4863 extern void moo(); /* function returning void */
4864 void (*goo)(); /* ptr to func returning void */
4866 void *hue; /* generic ptr */
4879 int main() { sub(); }
4881 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4882 voidflags=$defvoidused
4883 echo "Good. It appears to support void to the level $package wants.">&4
4884 if $contains warning .out >/dev/null 2>&1; then
4885 echo "However, you might get some warnings that look like this:"
4889 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4890 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4891 echo "It supports 1..."
4892 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4893 echo "It also supports 2..."
4894 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4896 echo "And it supports 4 but not 8 definitely."
4898 echo "It doesn't support 4..."
4899 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4901 echo "But it supports 8."
4904 echo "Neither does it support 8."
4908 echo "It does not support 2..."
4909 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4911 echo "But it supports 4 and 8."
4913 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4915 echo "And it supports 4 but has not heard about 8."
4917 echo "However it supports 8 but not 4."
4922 echo "There is no support at all for void."
4927 case "$voidflags" in
4930 Support flag bits are:
4931 1: basic void declarations.
4932 2: arrays of pointers to functions returning void.
4933 4: operations between pointers to and addresses of void functions.
4934 8: generic void pointers.
4937 rp="Your void support flags add up to what?"
4944 : check for length of pointer
4948 echo "Checking to see how big your pointers are..." >&4
4949 if test "$voidflags" -gt 7; then
4950 echo '#define VOID_PTR char *' > try.c
4952 echo '#define VOID_PTR void *' > try.c
4954 $cat >>try.c <<'EOCP'
4958 printf("%d\n", (int)sizeof(VOID_PTR));
4963 if eval $compile_ok; then
4964 ptrsize=`$run ./try`
4965 echo "Your pointers are $ptrsize bytes long."
4968 echo "(I can't seem to compile the test program. Guessing...)" >&4
4969 rp="What is the size of a pointer (in bytes)?"
4977 : check for long long
4979 echo "Checking to see if you have long long..." >&4
4980 echo 'int main() { long long x = 7; return 0; }' > try.c
4982 if eval $compile; then
4984 echo "You have long long."
4987 echo "You do not have long long."
4993 : check for length of long long
4994 case "${d_longlong}${longlongsize}" in
4997 echo "Checking to see how big your long longs are..." >&4
4998 $cat >try.c <<'EOCP'
5002 printf("%d\n", (int)sizeof(long long));
5007 if eval $compile_ok; then
5008 longlongsize=`$run ./try`
5009 echo "Your long longs are $longlongsize bytes long."
5013 echo "(I can't seem to compile the test program. Guessing...)"
5014 rp="What is the size of a long long (in bytes)?"
5018 if $test "X$longsize" = "X$longlongsize"; then
5019 echo "(That isn't any different from an ordinary long.)"
5025 : determine filename position in cpp output
5027 echo "Computing filename position in cpp output for #include directives..." >&4
5029 vos) testaccess=-e ;;
5032 echo '#include <stdio.h>' > foo.c
5035 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5036 $grep '^[ ]*#.*stdio\.h' | \
5037 while read cline; do
5040 while $test \$# -gt 0; do
5041 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5046 pos=\`expr \$pos + 1\`
5058 *) pos="${fieldn}th";;
5060 echo "Your cpp writes the filename in the $pos field of the line."
5063 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5066 : locate header file
5071 for usrincdir in $usrinc
5073 if test -f \$usrincdir/\$wanted; then
5074 echo "\$usrincdir/\$wanted"
5078 awkprg='{ print \$$fieldn }'
5079 echo "#include <\$wanted>" > foo\$\$.c
5080 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5081 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5082 while read cline; do
5083 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5085 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5086 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5091 # status = 0: grep returned 0 lines, case statement not executed
5092 # status = 1: headerfile found
5093 # status = 2: while loop executed, no headerfile found
5097 if test \$status -eq 1; then
5104 : define an alternate in-header-list? function
5105 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5106 cont=true; xxf="echo \"<\$1> found.\" >&4";
5107 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5108 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5110 case $# in 4) instead=instead;; *) instead="at last";; esac;
5111 while $test "$cont"; do
5113 var=$2; eval "was=\$$2";
5114 if $test "$xxx" && $test -r "$xxx";
5116 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5119 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5120 set $yyy; shift; shift; yyy=$@;
5121 case $# in 0) cont="";;
5122 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5123 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5124 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5125 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5129 do set $yyy; var=$2; eval "was=\$$2";
5130 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5131 set $yyy; shift; shift; yyy=$@;
5134 : see if inttypes.h is available
5135 : we want a real compile instead of Inhdr because some systems
5136 : have an inttypes.h which includes non-existent headers
5139 #include <inttypes.h>
5141 static int32_t foo32 = 0x12345678;
5145 if eval $compile; then
5146 echo "<inttypes.h> found." >&4
5149 echo "<inttypes.h> NOT found." >&4
5158 echo "Checking to see if you have int64_t..." >&4
5160 #include <sys/types.h>
5161 #$i_inttypes I_INTTYPES
5163 #include <inttypes.h>
5165 int main() { int64_t x = 7; }
5168 if eval $compile; then
5170 echo "You have int64_t."
5173 echo "You do not have int64_t."
5181 echo "Checking which 64-bit integer type we could use..." >&4
5187 val='"unsigned int"'
5192 *) case "$longsize" in
5196 val='"unsigned long"'
5201 *) case "$d_longlong:$longlongsize" in
5206 val='"unsigned long long"'
5211 *) case "$d_int64_t" in
5230 '') echo "Alas, no 64-bit integer types in sight." >&4
5233 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5239 case "$uselonglong" in
5240 "$define"|true|[yY]*)
5243 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5245 use64bitint="$define"
5248 case "$use64bits" in
5249 "$define"|true|[yY]*)
5252 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5254 use64bitint="$define"
5257 case "$use64bitints" in
5258 "$define"|true|[yY]*)
5261 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5263 use64bitint="$define"
5266 case "$use64bitsint" in
5267 "$define"|true|[yY]*)
5270 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5272 use64bitint="$define"
5275 case "$uselonglongs" in
5276 "$define"|true|[yY]*)
5279 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5281 use64bitint="$define"
5284 case "$use64bitsall" in
5285 "$define"|true|[yY]*)
5288 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5290 use64bitall="$define"
5295 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5297 case "$use64bitall" in
5298 "$define"|true|[yY]*) use64bitint="$define" ;;
5304 You have natively 64-bit long integers.
5308 *) case "$use64bitint" in
5309 "$define"|true|[yY]*) dflt='y';;
5318 Perl can be built to take advantage of 64-bit integer types
5319 on some systems. To do so, Configure can be run with -Duse64bitint.
5320 Choosing this option will most probably introduce binary incompatibilities.
5322 If this doesn't make any sense to you, just accept the default '$dflt'.
5323 (The default has been chosen based on your configuration.)
5325 rp='Try to use 64-bit integers, if available?'
5328 [yY]*) val="$define" ;;
5336 case "$use64bitall" in
5337 "$define"|true|[yY]*) dflt='y' ;;
5338 *) case "$longsize" in
5346 You may also choose to try maximal 64-bitness. It means using as much
5347 64-bitness as possible on the platform. This in turn means even more
5348 binary incompatibilities. On the other hand, your platform may not
5349 have any more 64-bitness available than what you already have chosen.
5351 If this doesn't make any sense to you, just accept the default '$dflt'.
5352 (The default has been chosen based on your configuration.)
5354 rp='Try to use maximal 64-bit support, if available?'
5357 [yY]*) val="$define" ;;
5362 case "$use64bitall" in
5364 case "$use64bitint" in
5368 Since you have chosen a maximally 64-bit build, I'm also turning on
5369 the use of 64-bit integers.
5371 use64bitint="$define" ;;
5376 case "$use64bitall" in
5377 "$define"|true|[yY]*)
5381 *** You have chosen a maximally 64-bit build, but your pointers
5382 *** are only 4 bytes wide, disabling maximal 64-bitness.
5385 use64bitall="$undef"
5386 case "$use64bitint" in
5387 "$define"|true|[yY]*) ;;
5390 *** Downgrading from maximal 64-bitness to using 64-bit integers.
5393 use64bitint="$define"
5401 case "$use64bitint" in
5402 "$define"|true|[yY]*)
5403 : Look for a hint-file generated 'call-back-unit'. If the
5404 : user has specified that a 64-bit perl is to be built,
5405 : we may need to set or change some other defaults.
5406 if $test -f use64bitint.cbu; then
5407 echo "Your platform has some specific hints for 64-bit integers, using them..."
5411 4) case "$archname64" in
5412 '') archname64=64int ;;
5419 case "$use64bitall" in
5420 "$define"|true|[yY]*)
5421 : Look for a hint-file generated 'call-back-unit'. If the
5422 : user has specified that a maximally 64-bit perl is to be built,
5423 : we may need to set or change some other defaults.
5424 if $test -f use64bitall.cbu; then
5425 echo "Your platform has some specific hints for 64-bit builds, using them..."
5429 4) case "$archname64" in
5430 ''|64int) archname64=64all ;;
5438 echo "Checking for GNU C Library..." >&4
5451 if eval $compile_ok && $run ./try; then
5453 echo "You are using the GNU C Library"
5456 echo "You are not using the GNU C Library"
5462 : see if nm is to be used to determine whether a symbol is defined or not
5466 case "$d_gnulibc" in
5469 echo "nm probably won't work on the GNU C Library." >&4
5475 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5477 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5478 echo "'nm' won't be sufficient on this sytem." >&4
5484 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5485 if $test $dflt -gt 20; then
5495 true|$define) dflt=y;;
5502 I can use $nm to extract the symbols from your C libraries. This
5503 is a time consuming task which may generate huge output on the disk (up
5504 to 3 megabytes) but that should make the symbols extraction faster. The
5505 alternative is to skip the 'nm' extraction part and to compile a small
5506 test program instead to determine whether each symbol is present. If
5507 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5508 this may be the best solution.
5510 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5513 rp="Shall I use $nm to extract C symbols from the libraries?"
5516 [Nn]*) usenm=false;;
5525 : nm options which may be necessary
5527 '') if $test -f /mach_boot; then
5529 elif $test -d /usr/ccs/lib; then
5530 nm_opt='-p' # Solaris (and SunOS?)
5531 elif $test -f /dgux; then
5533 elif $test -f /lib64/rld; then
5534 nm_opt='-p' # 64-bit Irix
5540 : nm options which may be necessary for shared libraries but illegal
5541 : for archive libraries. Thank you, Linux.
5542 case "$nm_so_opt" in
5543 '') case "$myuname" in
5545 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5546 nm_so_opt='--dynamic'
5555 : get list of predefined functions in a handy place
5560 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5566 *) for thislib in $libs; do
5569 : Handle C library specially below.
5572 thislib=`echo $thislib | $sed -e 's/^-l//'`
5573 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5575 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5577 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5579 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5581 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5583 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5585 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5590 libnames="$libnames $try"
5592 *) libnames="$libnames $thislib" ;;
5601 for xxx in $libpth; do
5602 $test -r $1 || set $xxx/libc.$so
5603 : The messy sed command sorts on library version numbers.
5605 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5606 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5608 s/[0-9][0-9]*/0000&/g
5609 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5612 $sort | $sed -e 's/^.* //'`
5615 $test -r $1 || set /usr/ccs/lib/libc.$so
5616 $test -r $1 || set /lib/libsys_s$_a
5622 if $test -r "$1"; then
5623 echo "Your (shared) C library seems to be in $1."
5625 elif $test -r /lib/libc && $test -r /lib/clib; then
5626 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5628 libc='/lib/clib /lib/libc'
5629 if $test -r /lib/syslib; then
5630 echo "(Your math library is in /lib/syslib.)"
5631 libc="$libc /lib/syslib"
5633 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5634 echo "Your C library seems to be in $libc, as you said before."
5635 elif $test -r $incpath/usr/lib/libc$_a; then
5636 libc=$incpath/usr/lib/libc$_a;
5637 echo "Your C library seems to be in $libc. That's fine."
5638 elif $test -r /lib/libc$_a; then
5640 echo "Your C library seems to be in $libc. You're normal."
5642 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5644 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5645 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5646 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5648 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5650 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5653 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5655 if $test -r "$tans"; then
5656 echo "Your C library seems to be in $tans, of all places."
5662 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5666 If the guess above is wrong (which it might be if you're using a strange
5667 compiler, or your machine supports multiple models), you can override it here.
5672 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5674 I can't seem to find your C library. I've looked in the following places:
5677 $sed 's/^/ /' libpath
5680 None of these seems to contain your C library. I need to get its name...
5685 rp='Where is your C library?'
5690 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5691 set X `cat libnames`
5694 case $# in 1) xxx=file; esac
5695 echo "Extracting names from the following $xxx for later perusal:" >&4
5697 $sed 's/^/ /' libnames >&4
5699 $echo $n "This may take a while...$c" >&4
5703 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5704 *) $nm $nm_opt $file 2>/dev/null;;
5709 $grep fprintf libc.tmp > libc.ptf
5710 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5711 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
5713 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5715 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5717 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5719 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5721 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5723 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5725 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5727 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5729 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5731 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5733 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5735 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5737 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5738 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5740 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5742 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5744 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5746 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5748 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5750 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5752 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5754 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5756 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5758 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5760 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5762 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5764 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5766 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5768 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5771 $nm -p $* 2>/dev/null >libc.tmp
5772 $grep fprintf libc.tmp > libc.ptf
5773 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5774 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5780 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5782 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5783 for thisname in $libnames $libc; do
5784 $ar t $thisname >>libc.tmp
5786 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5788 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5789 # Repeat libc to extract forwarders to DLL entries too
5790 for thisname in $libnames $libc; do
5791 $ar tv $thisname >>libc.tmp
5792 # Revision 50 of EMX has bug in $ar.
5793 # it will not extract forwarders to DLL entries
5794 # Use emximp which will extract exactly them.
5795 emximp -o tmp.imp $thisname \
5797 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5798 < tmp.imp >>libc.tmp
5801 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5804 echo "$ar didn't seem to work right." >&4
5805 echo "Maybe this is a Cray...trying bld instead..." >&4
5806 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5808 for thisname in $libnames; do
5810 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5811 $ar t $thisname >>libc.tmp
5815 echo "That didn't work either. Giving up." >&4
5822 if $test -f /lib/syscalls.exp; then
5824 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5825 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
5829 $rm -f libnames libpath
5831 : is a C symbol defined?
5834 -v) tf=libc.tmp; tc=""; tdc="";;
5835 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5836 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5839 case "$reuseval-$4" in
5841 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5847 if $contains $tlook $tf >/dev/null 2>&1;
5852 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5853 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5861 $define) tval=true;;
5867 : define an is-in-libc? function
5868 inlibc='echo " "; td=$define; tu=$undef;
5869 sym=$1; var=$2; eval "was=\$$2";
5871 case "$reuseval$was" in
5881 echo "$sym() found." >&4;
5882 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5884 echo "$sym() NOT found." >&4;
5885 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5889 $define) echo "$sym() found." >&4;;
5890 *) echo "$sym() NOT found." >&4;;
5894 : see if sqrtl exists
5898 : check for length of double
5900 case "$doublesize" in
5902 echo "Checking to see how big your double precision numbers are..." >&4
5903 $cat >try.c <<'EOCP'
5907 printf("%d\n", (int)sizeof(double));
5912 if eval $compile_ok; then
5913 doublesize=`$run ./try`
5914 echo "Your double is $doublesize bytes long."
5917 echo "(I can't seem to compile the test program. Guessing...)"
5918 rp="What is the size of a double precision number (in bytes)?"
5926 : check for long doubles
5928 echo "Checking to see if you have long double..." >&4
5929 echo 'int main() { long double x = 7.0; }' > try.c
5931 if eval $compile; then
5933 echo "You have long double."
5936 echo "You do not have long double."
5942 : check for length of long double
5943 case "${d_longdbl}${longdblsize}" in
5946 echo "Checking to see how big your long doubles are..." >&4
5947 $cat >try.c <<'EOCP'
5951 printf("%d\n", sizeof(long double));
5956 if eval $compile; then
5957 longdblsize=`$run ./try`
5958 echo "Your long doubles are $longdblsize bytes long."
5962 echo "(I can't seem to compile the test program. Guessing...)" >&4
5963 rp="What is the size of a long double (in bytes)?"
5967 if $test "X$doublesize" = "X$longdblsize"; then
5968 echo "(That isn't any different from an ordinary double.)"
5976 if $test X"$d_longdbl" = X"$define"; then
5978 echo "Checking how to print long doubles..." >&4
5980 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
5981 $cat >try.c <<'EOCP'
5982 #include <sys/types.h>
5986 printf("%.3f\n", d);
5990 if eval $compile; then
5994 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
5995 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
5996 echo "We will use %f."
6002 if $test X"$sPRIfldbl" = X; then
6003 $cat >try.c <<'EOCP'
6004 #include <sys/types.h>
6007 long double d = 123.456;
6008 printf("%.3Lf\n", d);
6012 if eval $compile; then
6016 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
6017 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
6018 echo "We will use %Lf."
6024 if $test X"$sPRIfldbl" = X; then
6025 $cat >try.c <<'EOCP'
6026 #include <sys/types.h>
6029 long double d = 123.456;
6030 printf("%.3llf\n", d);
6034 if eval $compile; then
6038 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
6039 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
6040 echo "We will use %llf."
6046 if $test X"$sPRIfldbl" = X; then
6047 $cat >try.c <<'EOCP'
6048 #include <sys/types.h>
6051 long double d = 123.456;
6052 printf("%.3lf\n", d);
6056 if eval $compile; then
6060 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
6061 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
6062 echo "We will use %lf."
6068 if $test X"$sPRIfldbl" = X; then
6069 echo "Cannot figure out how to print long doubles." >&4
6071 sSCNfldbl=$sPRIfldbl # expect consistency
6078 case "$sPRIfldbl" in
6079 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
6080 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
6081 d_SCNfldbl="$undef";
6083 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
6084 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
6085 d_SCNfldbl="$define";
6089 : see if modfl exists
6093 d_modfl_pow32_bug="$undef"
6095 case "$d_longdbl$d_modfl" in
6098 Checking to see whether your modfl() is okay for large values...
6104 long double nv = 4294967303.15;
6110 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
6114 case "$osname:$gccversion" in
6115 aix:) saveccflags="$ccflags"
6116 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
6119 if eval $compile; then
6122 *" 4294967303.150000 1.150000 4294967302.000000")
6123 echo >&4 "Your modfl() is broken for large values."
6124 d_modfl_pow32_bug="$define"
6126 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
6130 *" 4294967303.150000 0.150000 4294967303.000000")
6131 echo >&4 "Your modfl() seems okay for large values."
6133 *) echo >&4 "I don't understand your modfl() at all."
6137 $rm -f try.* try core core.try.*
6139 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
6142 case "$osname:$gccversion" in
6143 aix:) ccflags="$saveccflags" ;; # restore
6149 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6152 case "$uselongdouble" in
6153 $define|true|[yY]*) dflt='y';;
6158 Perl can be built to take advantage of long doubles which
6159 (if available) may give more accuracy and range for floating point numbers.
6161 If this doesn't make any sense to you, just accept the default '$dflt'.
6163 rp='Try to use long doubles if available?'
6166 y|Y) val="$define" ;;
6172 case "$uselongdouble" in
6173 true|[yY]*) uselongdouble="$define" ;;
6176 case "$uselongdouble" in
6178 : Look for a hint-file generated 'call-back-unit'. If the
6179 : user has specified that long doubles should be used,
6180 : we may need to set or change some other defaults.
6181 if $test -f uselongdouble.cbu; then
6182 echo "Your platform has some specific hints for long doubles, using them..."
6183 . ./uselongdouble.cbu
6186 (Your platform doesn't have any specific hints for long doubles.)
6193 case "$uselongdouble:$d_sqrtl:$d_modfl" in
6194 $define:$define:$define)
6197 $define:$define:$undef)
6198 message="I could not find modfl"
6200 $define:$undef:$define)
6201 message="I could not find sqrtl"
6203 $define:$undef:$undef)
6204 message="I found neither sqrtl nor modfl"
6208 if $test "$message" != X; then
6211 *** You requested the use of long doubles but you do not seem to have
6212 *** the mathematic functions for long doubles.
6214 *** I'm disabling the use of long doubles.
6218 uselongdouble=$undef
6221 case "$useperlio" in
6222 $define|true|[yY]*|'') dflt='y';;
6227 Previous version of $package used the standard IO mechanisms as
6228 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
6229 alternate IO mechanisms via the PerlIO abstraction layer, but the
6230 stdio mechanism is still available if needed. The abstraction layer
6231 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
6232 Using PerlIO with sfio may cause problems with some extension modules.
6234 If this doesn't make any sense to you, just accept the default '$dflt'.
6236 rp='Use the PerlIO abstraction layer?'
6243 echo "Ok, doing things the stdio way."
6252 case "$useperlio" in
6253 $define|true|[yY]*) ;;
6256 You are using the SOCKS proxy protocol library which means that you
6257 should also use the PerlIO layer. You may be headed for trouble.
6266 : determine the architecture name
6268 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6269 tarch=`arch`"-$osname"
6270 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6271 if uname -m > tmparch 2>&1 ; then
6272 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6273 -e 's/$/'"-$osname/" tmparch`
6281 case "$myarchname" in
6284 echo "(Your architecture name used to be $myarchname.)"
6288 case "$targetarch" in
6290 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6295 *) dflt="$archname";;
6297 rp='What is your architecture name'
6300 case "$usethreads" in
6302 echo "Threads selected." >&4
6304 *-thread*) echo "...and architecture name already has -thread." >&4
6306 *) archname="$archname-thread"
6307 echo "...setting architecture name to $archname." >&4
6312 case "$usemultiplicity" in
6314 echo "Multiplicity selected." >&4
6316 *-multi*) echo "...and architecture name already has -multi." >&4
6318 *) archname="$archname-multi"
6319 echo "...setting architecture name to $archname." >&4
6324 case "$use64bitint$use64bitall" in
6326 case "$archname64" in
6328 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6331 case "$use64bitint" in
6332 "$define") echo "64 bit integers selected." >&4 ;;
6334 case "$use64bitall" in
6335 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6338 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6340 *) archname="$archname-$archname64"
6341 echo "...setting architecture name to $archname." >&4
6347 case "$uselongdouble" in
6349 echo "Long doubles selected." >&4
6350 case "$longdblsize" in
6352 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6356 *-ld*) echo "...and architecture name already has -ld." >&4
6358 *) archname="$archname-ld"
6359 echo "...setting architecture name to $archname." >&4
6366 case "$useperlio" in
6368 echo "Perlio selected." >&4
6371 echo "Perlio not selected, using stdio." >&4
6373 *-stdio*) echo "...and architecture name already has -stdio." >&4
6375 *) archname="$archname-stdio"
6376 echo "...setting architecture name to $archname." >&4
6382 : determine root of directory hierarchy where package will be installed.
6385 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
6393 By default, $package will be installed in $dflt/bin, manual pages
6394 under $dflt/man, etc..., i.e. with $dflt as prefix for all
6395 installation directories. Typically this is something like /usr/local.
6396 If you wish to have binaries under /usr/bin but other parts of the
6397 installation under /usr/local, that's ok: you will be prompted
6398 separately for each of the installation directories, the prefix being
6399 only used to set the defaults.
6403 rp='Installation prefix to use?'
6411 *) oldprefix="$prefix";;
6420 *) afsroot=$afsroot ;;
6426 $define|true) afs=true ;;
6427 $undef|false) afs=false ;;
6428 *) if test -d $afsroot; then
6436 echo "AFS may be running... I'll be extra cautious then..." >&4
6438 echo "AFS does not seem to be running..." >&4
6441 : determine installation prefix for where package is to be installed.
6445 Since you are running AFS, I need to distinguish the directory in which
6446 files will reside from the directory in which they are installed (and from
6447 which they are presumably copied to the former directory by occult means).
6450 case "$installprefix" in
6451 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
6452 *) dflt="$installprefix";;
6457 In some special cases, particularly when building $package for distribution,
6458 it is convenient to distinguish between the directory in which files should
6459 be installed from the directory ($prefix) in which they
6460 will eventually reside. For most users, these two directories are the same.
6463 case "$installprefix" in
6465 *) dflt=$installprefix;;
6469 rp='What installation prefix should I use for installing files?'
6471 installprefix="$ans"
6472 installprefixexp="$ansexp"
6474 : set the prefixit variable, to compute a suitable default value
6475 prefixit='case "$3" in
6477 case "$oldprefix" in
6478 "") eval "$1=\"\$$2\"";;
6485 ""|" ") eval "$1=\"\$$2\"";;
6491 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6493 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6494 /*-$oldprefix/*|\~*-$oldprefix/*)
6495 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6496 *) eval "$1=\"\$$2\"";;
6500 : get the patchlevel
6502 echo "Getting the current patchlevel..." >&4
6503 if $test -r $rsrc/patchlevel.h;then
6504 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6505 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6506 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6507 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6508 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6509 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6510 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6519 $echo "(You do not have patchlevel.h. Eek.)"
6521 if $test -r $rsrc/.patch ; then
6522 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6523 perl_patchlevel=`cat $rsrc/.patch`
6526 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6527 version_patchlevel_string="version $patchlevel subversion $subversion"
6528 case "$perl_patchlevel" in
6530 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6533 $echo "(You have $package $version_patchlevel_string.)"
6537 : XXX Should be a Configure test for double-dots in filenames.
6538 version=`echo $revision $patchlevel $subversion | \
6539 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6540 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6541 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6544 version=`echo $revision $patchlevel $subversion | \
6545 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6546 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6547 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6550 : Special case the 5.005_xx maintenance series, which used 5.005
6551 : without any subversion label as a subdirectory in $sitelib
6552 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6553 api_versionstring='5.005'
6556 : determine installation style
6557 : For now, try to deduce it from prefix unless it is already set.
6558 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6559 case "$installstyle" in
6560 '') case "$prefix" in
6561 *perl*) dflt='lib';;
6562 *) dflt='lib/perl5' ;;
6565 *) dflt="$installstyle" ;;
6567 : Probably not worth prompting for this since we prompt for all
6568 : the directories individually, and the prompt would be too long and
6572 : determine where private library files go
6573 : Usual default is /usr/local/lib/perl5/$version.
6574 : Also allow things like /opt/perl/lib/$version, since
6575 : /opt/perl/lib/perl5... would be redundant.
6576 : The default "style" setting is made in installstyle.U
6577 case "$installstyle" in
6578 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6579 *) set dflt privlib lib/$version ;;
6584 There are some auxiliary files for $package that need to be put into a
6585 private library directory that is accessible by everyone.
6589 rp='Pathname where the private library files will reside?'
6592 privlibexp="$ansexp"
6593 : Change installation prefix, if necessary.
6594 if $test X"$prefix" != X"$installprefix"; then
6595 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6597 installprivlib="$privlibexp"
6600 : set the prefixup variable, to restore leading tilda escape
6601 prefixup='case "$prefixexp" in
6603 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6606 : determine where public architecture dependent libraries go
6609 : privlib default is /usr/local/lib/$package/$version
6610 : archlib default is /usr/local/lib/$package/$version/$archname
6611 : privlib may have an optional trailing /share.
6612 tdflt=`echo $privlib | $sed 's,/share$,,'`
6613 tdflt=$tdflt/$archname
6622 $spackage contains architecture-dependent library files. If you are
6623 sharing libraries in a heterogeneous environment, you might store
6624 these files in a separate location. Otherwise, you can just include
6625 them with the rest of the public library files.
6629 rp='Where do you want to put the public architecture-dependent libraries?'
6632 archlibexp="$ansexp"
6633 if $test X"$archlib" = X"$privlib"; then
6638 : Change installation prefix, if necessary.
6639 if $test X"$prefix" != X"$installprefix"; then
6640 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6642 installarchlib="$archlibexp"
6646 : Binary compatibility with 5.005 is not possible for builds
6647 : with advanced features
6648 case "$usethreads$usemultiplicity" in
6650 bincompat5005="$undef"
6651 d_bincompat5005="$undef"
6655 This version of Perl can be compiled for binary compatibility with 5.005.
6656 If you decide to do so, you will be able to continue using most of the
6657 extensions that were compiled for Perl 5.005.
6660 case "$bincompat5005$d_bincompat5005" in
6661 *"$undef"*) dflt=n ;;
6664 rp='Binary compatibility with Perl 5.005?'
6667 y*) val="$define" ;;
6672 case "$d_bincompat5005" in
6674 bincompat5005="$define"
6676 *) bincompat5005="$undef"
6677 d_bincompat5005="$undef"
6684 : see if setuid scripts can be secure
6687 Some kernels have a bug that prevents setuid #! scripts from being
6688 secure. Some sites have disabled setuid #! scripts because of this.
6690 First let's decide if your kernel supports secure setuid #! scripts.
6691 (If setuid #! scripts would be secure but have been disabled anyway,
6692 don't say that they are secure if asked.)
6697 if $test -d /dev/fd; then
6698 echo "#!$ls" >reflect
6699 chmod +x,u+s reflect
6700 ./reflect >flect 2>&1
6701 if $contains "/dev/fd" flect >/dev/null; then
6702 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6706 If you are not sure if they are secure, I can check but I'll need a
6707 username and password different from the one you are using right now.
6708 If you don't have such a username or don't want me to test, simply
6712 rp='Other username to test security of setuid scripts with?'
6717 case "$d_suidsafe" in
6718 '') echo "I'll assume setuid scripts are *not* secure." >&4
6721 echo "Well, the $hint value is *not* secure." >&4
6723 *) echo "Well, the $hint value *is* secure." >&4
6728 $rm -f reflect flect
6729 echo "#!$ls" >reflect
6730 chmod +x,u+s reflect
6733 echo '"su" will (probably) prompt you for '"$ans's password."
6734 su $ans -c './reflect >flect'
6735 if $contains "/dev/fd" flect >/dev/null; then
6736 echo "Okay, it looks like setuid scripts are secure." >&4
6739 echo "I don't think setuid scripts are secure." >&4
6744 rp='Does your kernel have *secure* setuid scripts?'
6747 [yY]*) val="$define";;
6752 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6753 echo "(That's for file descriptors, not floppy disks.)"
6759 $rm -f reflect flect
6761 : now see if they want to do setuid emulation
6764 case "$d_suidsafe" in
6767 echo "No need to emulate SUID scripts since they are secure here." >&4
6771 Some systems have disabled setuid scripts, especially systems where
6772 setuid scripts cannot be secure. On systems where setuid scripts have
6773 been disabled, the setuid/setgid bits on scripts are currently
6774 useless. It is possible for $package to detect those bits and emulate
6775 setuid/setgid in a secure fashion. This emulation will only work if
6776 setuid scripts have been disabled in your kernel.
6780 "$define") dflt=y ;;
6783 rp="Do you want to do setuid/setgid emulation?"
6786 [yY]*) val="$define";;
6794 : see if this is a malloc.h system
6795 set malloc.h i_malloc
6798 : see if stdlib is available
6799 set stdlib.h i_stdlib
6802 : determine which malloc to compile in
6804 case "$usemymalloc" in
6805 [yY]*|true|$define) dflt='y' ;;
6806 [nN]*|false|$undef) dflt='n' ;;
6807 *) case "$ptrsize" in
6813 rp="Do you wish to attempt to use the malloc that comes with $package?"
6819 mallocsrc='malloc.c'
6820 mallocobj="malloc$_o"
6821 d_mymalloc="$define"
6824 : Remove malloc from list of libraries to use
6825 echo "Removing unneeded -lmalloc from library list" >&4
6826 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6829 echo "libs = $libs" >&4
6841 : compute the return types of malloc and free
6843 $cat >malloc.c <<END
6847 #include <sys/types.h>
6861 case "$malloctype" in
6863 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6870 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6874 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6881 echo "Your system uses $freetype free(), it would seem." >&4
6885 After $package is installed, you may wish to install various
6886 add-on modules and utilities. Typically, these add-ons will
6887 be installed under $prefix with the rest
6888 of this package. However, you may wish to install such add-ons
6889 elsewhere under a different prefix.
6891 If you do not wish to put everything under a single prefix, that's
6892 ok. You will be prompted for the individual locations; this siteprefix
6893 is only used to suggest the defaults.
6895 The default should be fine for most people.
6899 rp='Installation prefix to use for add-on modules and utilities?'
6900 : XXX Here might be another good place for an installstyle setting.
6901 case "$siteprefix" in
6903 *) dflt=$siteprefix ;;
6906 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6908 case "$siteprefix" in
6912 *) oldsiteprefix="$prefix";;
6917 siteprefixexp="$ansexp"
6919 : determine where site specific libraries go.
6920 : Usual default is /usr/local/lib/perl5/site_perl/$version
6921 : The default "style" setting is made in installstyle.U
6922 : XXX No longer works with Prefixit stuff.
6923 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6925 '') case "$installstyle" in
6926 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6927 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6935 The installation process will create a directory for
6936 site-specific extensions and modules. Most users find it convenient
6937 to place all site-specific files in this directory rather than in the
6938 main distribution directory.
6942 rp='Pathname for the site-specific library files?'
6945 sitelibexp="$ansexp"
6946 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6947 : Change installation prefix, if necessary.
6948 if $test X"$prefix" != X"$installprefix"; then
6949 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6951 installsitelib="$sitelibexp"
6954 : determine where site specific architecture-dependent libraries go.
6955 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6956 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6957 : sitelib may have an optional trailing /share.
6959 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6960 dflt="$dflt/$archname"
6965 set sitearch sitearch none
6969 The installation process will also create a directory for
6970 architecture-dependent site-specific extensions and modules.
6974 rp='Pathname for the site-specific architecture-dependent library files?'
6977 sitearchexp="$ansexp"
6978 : Change installation prefix, if necessary.
6979 if $test X"$prefix" != X"$installprefix"; then
6980 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6982 installsitearch="$sitearchexp"
6987 The installation process will also create a directory for
6988 vendor-supplied add-ons. Vendors who supply perl with their system
6989 may find it convenient to place all vendor-supplied files in this
6990 directory rather than in the main distribution directory. This will
6991 ease upgrades between binary-compatible maintenance versions of perl.
6993 Of course you may also use these directories in whatever way you see
6994 fit. For example, you might use them to access modules shared over a
6995 company-wide network.
6997 The default answer should be fine for most people.
6998 This causes further questions about vendor add-ons to be skipped
6999 and no vendor-specific directories will be configured for perl.
7002 rp='Do you want to configure vendor-specific add-on directories?'
7003 case "$usevendorprefix" in
7004 define|true|[yY]*) dflt=y ;;
7005 *) : User may have set vendorprefix directly on Configure command line.
7006 case "$vendorprefix" in
7015 rp='Installation prefix to use for vendor-supplied add-ons?'
7016 case "$vendorprefix" in
7018 *) dflt=$vendorprefix ;;
7021 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7023 case "$vendorprefix" in
7027 *) oldvendorprefix="$prefix";;
7031 usevendorprefix="$define"
7033 vendorprefixexp="$ansexp"
7035 *) usevendorprefix="$undef"
7041 case "$vendorprefix" in
7042 '') d_vendorlib="$undef"
7046 *) d_vendorlib="$define"
7047 : determine where vendor-supplied modules go.
7048 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7049 case "$vendorlib" in
7051 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7052 case "$installstyle" in
7053 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7054 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7057 *) dflt="$vendorlib"
7061 rp='Pathname for the vendor-supplied library files?'
7064 vendorlibexp="$ansexp"
7067 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7068 : Change installation prefix, if necessary.
7069 if $test X"$prefix" != X"$installprefix"; then
7070 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
7072 installvendorlib="$vendorlibexp"
7075 case "$vendorprefix" in
7076 '') d_vendorarch="$undef"
7080 *) d_vendorarch="$define"
7081 : determine where vendor-supplied architecture-dependent libraries go.
7082 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7083 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7084 : vendorlib may have an optional trailing /share.
7085 case "$vendorarch" in
7086 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7087 dflt="$dflt/$archname"
7089 *) dflt="$vendorarch" ;;
7092 rp='Pathname for vendor-supplied architecture-dependent files?'
7095 vendorarchexp="$ansexp"
7098 : Change installation prefix, if necessary.
7099 if $test X"$prefix" != X"$installprefix"; then
7100 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
7102 installvendorarch="$vendorarchexp"
7105 : Final catch-all directories to search
7108 Lastly, you can have perl look in other directories for extensions and
7109 modules in addition to those already specified.
7110 These directories will be searched after
7114 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7115 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7117 case "$otherlibdirs" in
7118 ''|' ') dflt='none' ;;
7119 *) dflt="$otherlibdirs" ;;
7122 Enter a colon-separated set of extra paths to include in perl's @INC
7123 search path, or enter 'none' for no extra paths.
7127 rp='Colon-separated list of additional directories for perl to search?'
7130 ' '|''|none) otherlibdirs=' ' ;;
7131 *) otherlibdirs="$ans" ;;
7133 case "$otherlibdirs" in
7137 set d_perl_otherlibdirs
7140 : Cruising for prototypes
7142 echo "Checking out function prototypes..." >&4
7143 $cat >prototype.c <<'EOCP'
7144 int main(int argc, char *argv[]) {
7147 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7148 echo "Your C compiler appears to support function prototypes."
7151 echo "Your C compiler doesn't seem to understand function prototypes."
7158 case "$prototype" in
7160 *) ansi2knr='ansi2knr'
7165 This version of $package can only be compiled by a compiler that
7166 understands function prototypes. Unfortunately, your C compiler
7168 doesn't seem to understand them. Sorry about that.
7170 If GNU cc is available for your system, perhaps you could try that instead.
7172 Eventually, we hope to support building Perl with pre-ANSI compilers.
7173 If you would like to help in that effort, please contact <perlbug@perl.org>.
7175 Aborting Configure now.
7181 : determine where public executables go
7186 rp='Pathname where the public executables will reside?'
7188 if $test "X$ansexp" != "X$binexp"; then
7193 : Change installation prefix, if necessary.
7194 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7195 if $test X"$prefix" != X"$installprefix"; then
7196 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
7198 installbin="$binexp"
7207 Perl can be built with extra modules or bundles of modules which
7208 will be fetched from the CPAN and installed alongside Perl.
7210 Notice that you will need access to the CPAN; either via the Internet,
7211 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7212 be asked later to configure the CPAN.pm module which will in turn do
7213 the installation of the rest of the extra modules or bundles.)
7215 Notice also that if the modules require any external software such as
7216 libraries and headers (the libz library and the zlib.h header for the
7217 Compress::Zlib module, for example) you MUST have any such software
7218 already installed, this configuration process will NOT install such
7221 If this doesn't make any sense to you, just accept the default '$dflt'.
7223 rp='Install any extra modules (y or n)?'
7229 Please list any extra modules or bundles to be installed from CPAN,
7230 with spaces between the names. The names can be in any format the
7231 'install' command of CPAN.pm will understand. (Answer 'none',
7232 without the quotes, to install no extra modules or bundles.)
7242 $rm -f ../extras.lst
7244 *) echo "(Saving the list of extras for later...)"
7245 echo "$extras" > ../extras.lst
7253 : Find perl5.005 or later.
7254 echo "Looking for a previously installed perl5.005 or later... "
7256 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7257 : Check if this perl is recent and can load a simple module
7258 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7261 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7271 '') echo "None found. That's ok.";;
7272 *) echo "Using $perl5." ;;
7275 : Determine list of previous versions to include in @INC
7276 $cat > getverlist <<EOPL
7279 \$api_versionstring = "$api_versionstring";
7280 \$version = "$version";
7281 \$stem = "$sitelib_stem";
7282 \$archname = "$archname";
7284 $cat >> getverlist <<'EOPL'
7285 # Can't have leading @ because metaconfig interprets it as a command!
7286 ;@inc_version_list=();
7287 # XXX Redo to do opendir/readdir?
7290 ;@candidates = glob("5.*");
7296 # XXX ToDo: These comparisons must be reworked when two-digit
7297 # subversions come along, so that 5.7.10 compares as greater than
7298 # 5.7.3! By that time, hope that 5.6.x is sufficiently
7299 # widespread that we can use the built-in version vectors rather
7300 # than reinventing them here. For 5.6.0, however, we must
7301 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
7302 foreach $d (@candidates) {
7303 if ($d lt $version) {
7304 if ($d ge $api_versionstring) {
7305 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
7307 elsif ($d ge "5.005") {
7308 unshift(@inc_version_list, grep { -d } $d);
7312 # Skip newer version. I.e. don't look in
7313 # 5.7.0 if we're installing 5.6.1.
7317 if (@inc_version_list) {
7318 print join(' ', @inc_version_list);
7321 # Blank space to preserve value for next Configure run.
7326 case "$inc_version_list" in
7327 '') if test -x "$perl5$exe_ext"; then
7328 dflt=`$perl5 getverlist`
7333 $undef) dflt='none' ;;
7334 *) eval dflt=\"$inc_version_list\" ;;
7337 ''|' ') dflt=none ;;
7340 5.005) case "$bincompat5005" in
7341 $define|true|[yY]*) ;;
7348 In order to ease the process of upgrading, this version of perl
7349 can be configured to use modules built and installed with earlier
7350 versions of perl that were installed under $prefix. Specify here
7351 the list of earlier versions that this version of perl should check.
7352 If Configure detected no earlier versions of perl installed under
7353 $prefix, then the list will be empty. Answer 'none' to tell perl
7354 to not search earlier versions.
7356 The default should almost always be sensible, so if you're not sure,
7357 just accept the default.
7360 rp='List of earlier versions to include in @INC?'
7363 [Nn]one|''|' ') inc_version_list=' ' ;;
7364 *) inc_version_list="$ans" ;;
7366 case "$inc_version_list" in
7368 inc_version_list_init='0';;
7369 *) inc_version_list_init=`echo $inc_version_list |
7370 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7375 : determine whether to install perl also as /usr/bin/perl
7378 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7380 Many scripts expect perl to be installed as /usr/bin/perl.
7381 I can install the perl you are about to compile also as /usr/bin/perl
7382 (in addition to $installbin/perl).
7384 case "$installusrbinperl" in
7385 "$undef"|[nN]*) dflt='n';;
7388 rp="Do you want to install perl as /usr/bin/perl?"
7391 [yY]*) val="$define";;
7397 set installusrbinperl
7400 : see if dld is available
7404 : see if dlopen exists
7411 : determine which dynamic loading, if any, to compile in
7413 dldir="ext/DynaLoader"
7426 $define) dflt='y' ;;
7429 $define) dflt='y' ;;
7431 : Does a dl_xxx.xs file exist for this operating system
7432 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7435 rp="Do you wish to use dynamic loading?"
7442 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7443 dflt="$dldir/dl_${osname}.xs"
7444 elif $test "$d_dlopen" = "$define" ; then
7445 dflt="$dldir/dl_dlopen.xs"
7446 elif $test "$i_dld" = "$define" ; then
7447 dflt="$dldir/dl_dld.xs"
7452 *) dflt="$dldir/$dlsrc"
7455 echo "The following dynamic loading files are available:"
7456 : Can not go over to $dldir because getfile has path hard-coded in.
7457 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7458 rp="Source file to use for dynamic loading"
7464 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7468 Some systems may require passing special flags to $cc -c to
7469 compile modules that will be used to create a shared library.
7470 To use no flags, say "none".
7473 case "$cccdlflags" in
7474 '') case "$gccversion" in
7475 '') case "$osname" in
7477 next) dflt='none' ;;
7478 irix*) dflt='-KPIC' ;;
7479 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7480 sunos) dflt='-pic' ;;
7484 *) case "$osname" in
7485 darwin) dflt='none' ;;
7486 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7491 *) dflt="$cccdlflags" ;;
7493 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7496 none) cccdlflags=' ' ;;
7497 *) cccdlflags="$ans" ;;
7502 Some systems use ld to create libraries that can be dynamically loaded,
7503 while other systems (such as those using ELF) use $cc.
7507 '') $cat >try.c <<'EOM'
7508 /* Test for whether ELF binaries are produced */
7513 int i = open("a.out",O_RDONLY);
7516 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7517 exit(0); /* succeed (yes, it's ELF) */
7522 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7524 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7528 echo "I'll use ld to build dynamic libraries."
7537 rp="What command should be used to create dynamic libraries?"
7543 Some systems may require passing special flags to $ld to create a
7544 library that can be dynamically loaded. If your ld flags include
7545 -L/other/path options to locate libraries outside your loader's normal
7546 search path, you may need to specify those -L options here as well. To
7547 use no flags, say "none".
7550 case "$lddlflags" in
7551 '') case "$osname" in
7552 beos) dflt='-nostart' ;;
7554 case "$gccversion" in
7555 '') dflt="$dflt +vnocompatwarnings" ;;
7558 linux|irix*) dflt='-shared' ;;
7559 next) dflt='none' ;;
7560 solaris) dflt='-G' ;;
7561 sunos) dflt='-assert nodefinitions' ;;
7562 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7566 *) dflt="$lddlflags" ;;
7569 : Try to guess additional flags to pick up local libraries.
7570 : Be careful not to append to a plain 'none'
7574 for thisflag in $ldflags; do
7579 *) dflt="$dflt $thisflag" ;;
7586 ''|' ') dflt='none' ;;
7589 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7592 none) lddlflags=' ' ;;
7593 *) lddlflags="$ans" ;;
7598 Some systems may require passing special flags to $cc to indicate that
7599 the resulting executable will use dynamic linking. To use no flags,
7603 case "$ccdlflags" in
7604 '') case "$osname" in
7605 hpux) dflt='-Wl,-E' ;;
7606 linux) dflt='-rdynamic' ;;
7607 next) dflt='none' ;;
7608 sunos) dflt='none' ;;
7612 *) dflt="$ccdlflags" ;;
7614 rp="Any special flags to pass to $cc to use dynamic linking?"
7617 none) ccdlflags=' ' ;;
7618 *) ccdlflags="$ans" ;;
7632 # No dynamic loading being used, so don't bother even to prompt.
7635 *) case "$useshrplib" in
7636 '') case "$osname" in
7637 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7639 also='Building a shared libperl is required for dynamic loading to work on your system.'
7644 also='Building a shared libperl is needed for MAB support.'
7662 The perl executable is normally obtained by linking perlmain.c with
7663 libperl${_a}, any static extensions (usually just DynaLoader), and
7664 any other libraries needed on this system (such as -lm, etc.). Since
7665 your system supports dynamic loading, it is probably possible to build
7666 a shared libperl.$so. If you will have more than one executable linked
7667 to libperl.$so, this will significantly reduce the size of each
7668 executable, but it may have a noticeable affect on performance. The
7669 default is probably sensible for your system.
7673 rp="Build a shared libperl.$so (y/n)"
7677 useshrplib='true' ;;
7678 *) useshrplib='false' ;;
7683 case "$useshrplib" in
7687 # Figure out a good name for libperl.so. Since it gets stored in
7688 # a version-specific architecture-dependent library, the version
7689 # number isn't really that important, except for making cc/ld happy.
7691 # A name such as libperl.so.3.1
7692 majmin="libperl.$so.$patchlevel.$subversion"
7693 # A name such as libperl.so.301
7694 majonly=`echo $patchlevel $subversion |
7695 $awk '{printf "%d%02d", $1, $2}'`
7696 majonly=libperl.$so.$majonly
7697 # I'd prefer to keep the os-specific stuff here to a minimum, and
7698 # rely on figuring it out from the naming of libc.
7699 case "${osname}${osvers}" in
7702 # XXX How handle the --version stuff for MAB?
7704 linux*) # ld won't link with a bare -lperl otherwise.
7707 cygwin*) # ld links against an importlib
7708 dflt=libperl$lib_ext
7710 *) # Try to guess based on whether libc has major.minor.
7712 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7713 *libc.$so.[0-9]*) dflt=$majonly ;;
7714 *) dflt=libperl.$so ;;
7724 I need to select a good name for the shared libperl. If your system uses
7725 library names with major and minor numbers, then you might want something
7726 like $majmin. Alternatively, if your system uses a single version
7727 number for shared libraries, then you might want to use $majonly.
7728 Or, your system might be quite happy with a simple libperl.$so.
7730 Since the shared libperl will get installed into a version-specific
7731 architecture-dependent directory, the version number of the shared perl
7732 library probably isn't important, so the default should be o.k.
7735 rp='What name do you want to give to the shared libperl?'
7738 echo "Ok, I'll use $libperl"
7741 libperl="libperl${_a}"
7745 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7749 WARNING: Use of the shrpdir variable for the installation location of
7750 the shared $libperl is not supported. It was never documented and
7751 will not work in this version. Let me (perlbug@perl.org)
7752 know of any problems this may cause.
7758 But your current setting of $shrpdir is
7759 the default anyway, so it's harmless.
7764 Further, your current attempted setting of $shrpdir
7765 conflicts with the value of $archlibexp/CORE
7766 that installperl will use.
7773 # How will the perl executable find the installed shared $libperl?
7774 # Add $xxx to ccdlflags.
7775 # If we can't figure out a command-line option, use $shrpenv to
7776 # set env LD_RUN_PATH. The main perl makefile uses this.
7777 shrpdir=$archlibexp/CORE
7780 if "$useshrplib"; then
7783 # We'll set it in Makefile.SH...
7789 xxx="-Wl,-R$shrpdir"
7791 bsdos|linux|irix*|dec_osf)
7792 xxx="-Wl,-rpath,$shrpdir"
7795 # next doesn't like the default...
7798 # beos doesn't like the default, either.
7801 # hpux doesn't like the default, either.
7802 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7805 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7811 # Only add $xxx if it isn't already in ccdlflags.
7812 case " $ccdlflags " in
7814 *) ccdlflags="$ccdlflags $xxx"
7817 Adding $xxx to the flags
7818 passed to $ld so that the perl executable will find the
7819 installed shared $libperl.
7827 # Fix ccdlflags in AIX for building external extensions.
7828 # (For building Perl itself bare -bE:perl.exp is needed,
7829 # Makefile.SH takes care of this.)
7831 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7833 # Respect a hint or command-line value.
7835 '') shrpenv="$tmp_shrpenv" ;;
7837 case "$ldlibpthname" in
7838 '') ldlibpthname=LD_LIBRARY_PATH ;;
7839 none) ldlibpthname='' ;;
7842 : determine where manual pages are on this system
7846 syspath='/usr/share/man/man1 /usr/man/man1'
7847 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7848 syspath="$syspath /usr/man/u_man/man1"
7849 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7850 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7851 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7852 sysman=`./loc . /usr/man/man1 $syspath`
7855 if $test -d "$sysman"; then
7856 echo "System manual is in $sysman." >&4
7858 echo "Could not find manual pages in source form." >&4
7861 : determine where manual pages go
7862 set man1dir man1dir none
7866 $spackage has manual pages available in source form.
7870 echo "However, you don't have nroff, so they're probably useless to you."
7872 '') man1dir="none";;
7875 echo "If you don't want the manual sources installed, answer 'none'."
7880 lookpath="$prefixexp/share/man/man1"
7881 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7882 lookpath="$lookpath $prefixexp/man/p_man/man1"
7883 lookpath="$lookpath $prefixexp/man/u_man/man1"
7884 lookpath="$lookpath $prefixexp/man/man.1"
7886 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7887 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7897 rp="Where do the main $spackage manual pages (source) go?"
7899 if $test "X$man1direxp" != "X$ansexp"; then
7903 man1direxp="$ansexp"
7909 : Change installation prefix, if necessary.
7910 if $test X"$prefix" != X"$installprefix"; then
7911 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7913 installman1dir="$man1direxp"
7916 : What suffix to use on installed man pages
7923 rp="What suffix should be used for the main $spackage man pages?"
7925 '') case "$man1dir" in
7939 *) dflt="$man1ext";;
7946 : see if we can have long filenames
7948 first=123456789abcdef
7950 if (echo hi >$first) 2>/dev/null; then
7951 if $test -f 123456789abcde; then
7952 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7955 echo 'You can have filenames longer than 14 characters.'>&4
7960 You can't have filenames longer than 14 chars.
7961 You can't even think about them!
7967 $rm -rf 123456789abcde*
7969 : determine where library module manual pages go
7970 set man3dir man3dir none
7974 $spackage has manual pages for many of the library modules.
7980 However, you don't have nroff, so they're probably useless to you.
7983 '') man3dir="none";;
7987 case "$d_flexfnam" in
7990 However, your system can't handle the long file names like File::Basename.3.
7993 '') man3dir="none";;
7997 echo "If you don't want the manual sources installed, answer 'none'."
7998 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8000 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8001 if $test -d "$privlib/man/man3"; then
8004 WARNING: Previous versions of perl installed man3 pages into
8005 $privlib/man/man3. This version will suggest a
8006 new default of $dflt.
8010 rp='Do you wish to preserve the old behavior?(y/n)'
8013 y*) dflt="$privlib/man/man3" ;;
8018 *) dflt="$man3dir" ;;
8025 rp="Where do the $package library man pages (source) go?"
8028 man3direxp="$ansexp"
8034 : Change installation prefix, if necessary.
8035 if $test X"$prefix" != X"$installprefix"; then
8036 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8038 installman3dir="$man3direxp"
8041 : What suffix to use on installed man pages
8047 rp="What suffix should be used for the $package library man pages?"
8049 '') case "$man3dir" in
8063 *) dflt="$man3ext";;
8070 : see if we have to deal with yellow pages, now NIS.
8071 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8072 if $test -f /usr/etc/nibindd; then
8074 echo "I'm fairly confident you're on a NeXT."
8076 rp='Do you get the hosts file via NetInfo?'
8085 y*) hostcat='nidump hosts .';;
8086 *) case "$hostcat" in
8087 nidump*) hostcat='';;
8097 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8105 rp='Are you getting the hosts file via yellow pages?'
8108 y*) hostcat='ypcat hosts';;
8109 *) hostcat='cat /etc/hosts';;
8115 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8118 '') test -f /etc/group && groupcat='cat /etc/group';;
8121 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8124 : now get the host name
8126 echo "Figuring out host name..." >&4
8127 case "$myhostname" in
8129 echo 'Maybe "hostname" will work...'
8130 if tans=`sh -c hostname 2>&1` ; then
8138 if $test "$cont"; then
8140 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8141 if tans=`cat /etc/systemid 2>&1` ; then
8143 phostname='cat /etc/systemid'
8144 echo "Whadyaknow. Xenix always was a bit strange..."
8147 elif $test -r /etc/systemid; then
8148 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8151 if $test "$cont"; then
8152 echo 'No, maybe "uuname -l" will work...'
8153 if tans=`sh -c 'uuname -l' 2>&1` ; then
8155 phostname='uuname -l'
8157 echo 'Strange. Maybe "uname -n" will work...'
8158 if tans=`sh -c 'uname -n' 2>&1` ; then
8160 phostname='uname -n'
8162 echo 'Oh well, maybe I can mine it out of whoami.h...'
8163 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8164 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8165 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8167 case "$myhostname" in
8168 '') echo "Does this machine have an identity crisis or something?"
8171 echo "Well, you said $myhostname before..."
8172 phostname='echo $myhostname';;
8178 case "$myhostname" in
8179 '') myhostname=noname ;;
8181 : you do not want to know about this
8186 if $test "$myhostname" ; then
8188 rp='Your host name appears to be "'$myhostname'".'" Right?"
8196 : bad guess or no guess
8197 while $test "X$myhostname" = X ; do
8199 rp="Please type the (one word) name of your host:"
8204 : translate upper to lower if necessary
8205 case "$myhostname" in
8207 echo "(Normalizing case in your host name)"
8208 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8212 case "$myhostname" in
8214 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8215 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8216 echo "(Trimming domain name from host name--host name is now $myhostname)"
8218 *) case "$mydomain" in
8221 test "X$hostcat" = "Xypcat hosts" &&
8222 ypmatch "$myhostname" hosts 2>/dev/null |\
8223 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8226 test "X$hostcat" != "X" &&
8227 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8228 /[ ]$myhostname[ . ]/p" > hosts
8231 if $test -f hosts; then
8232 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8233 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8234 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8235 hosts | $sort | $uniq | \
8236 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8237 case `$echo X$dflt` in
8238 X*\ *) echo "(Several hosts in the database matched hostname)"
8241 X.) echo "(You do not have fully-qualified names in the hosts database)"
8245 echo "(I cannot locate a hosts database anywhere)"
8250 tans=`./loc resolv.conf X /etc /usr/etc`
8251 if $test -f "$tans"; then
8252 echo "(Attempting domain name extraction from $tans)"
8253 dflt=.`$sed -n -e 's/ / /g' \
8254 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8255 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8257 .) dflt=.`$sed -n -e 's/ / /g' \
8258 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8259 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8266 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8267 dflt=.`sh -c domainname 2>/dev/null`
8270 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8274 case "$dflt$osname" in
8275 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8276 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8280 .) echo "(Lost all hope -- silly guess then)"
8286 *) dflt="$mydomain";;
8290 rp="What is your domain name?"
8300 : translate upper to lower if necessary
8303 echo "(Normalizing case in your domain name)"
8304 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8308 : a little sanity check here
8309 case "$phostname" in
8312 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8313 $myhostname$mydomain|$myhostname) ;;
8315 case "$phostname" in
8317 echo "(That doesn't agree with your whoami.h file, by the way.)"
8320 echo "(That doesn't agree with your $phostname command, by the way.)"
8330 I need to get your e-mail address in Internet format if possible, i.e.
8331 something like user@host.domain. Please answer accurately since I have
8332 no easy means to double check it. The default value provided below
8333 is most probably close to reality but may not be valid from outside
8334 your organization...
8338 while test "$cont"; do
8340 '') dflt="$cf_by@$myhostname$mydomain";;
8341 *) dflt="$cf_email";;
8343 rp='What is your e-mail address?'
8349 rp='Address does not look like an Internet one. Use it anyway?'
8365 If you or somebody else will be maintaining perl at your site, please
8366 fill in the correct e-mail address here so that they may be contacted
8367 if necessary. Currently, the "perlbug" program included with perl
8368 will send mail to this address in addition to perlbug@perl.org. You may
8369 enter "none" for no administrator.
8372 case "$perladmin" in
8373 '') dflt="$cf_email";;
8374 *) dflt="$perladmin";;
8376 rp='Perl administrator e-mail address'
8380 : determine whether to only install version-specific parts.
8383 Do you want to install only the version-specific parts of the perl
8384 distribution? Usually you do *not* want to do this.
8386 case "$versiononly" in
8387 "$define"|[Yy]*|true) dflt='y' ;;
8390 rp="Do you want to install only the version-specific parts of perl?"
8393 [yY]*) val="$define";;
8399 case "$versiononly" in
8400 "$define") inc_version_list=''
8401 inc_version_list_init=0
8405 : figure out how to guarantee perl startup
8406 case "$startperl" in
8408 case "$sharpbang" in
8412 I can use the #! construct to start perl on your system. This will
8413 make startup of perl scripts faster, but may cause problems if you
8414 want to share those scripts and perl is not in a standard place
8415 ($binexp/perl) on all your platforms. The alternative is to force
8416 a shell by starting the script with a single ':' character.
8419 case "$versiononly" in
8420 "$define") dflt="$binexp/perl$version";;
8421 *) dflt="$binexp/perl";;
8423 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8426 none) startperl=": # use perl";;
8427 *) startperl="#!$ans"
8428 if $test 30 -lt `echo "$ans" | wc -c`; then
8431 WARNING: Some systems limit the #! command to 32 characters.
8432 If you experience difficulty running Perl scripts with #!, try
8433 installing Perl in a directory with a shorter pathname.
8439 *) startperl=": # use perl"
8444 echo "I'll use $startperl to start perl scripts."
8446 : figure best path for perl in scripts
8449 case "$versiononly" in
8450 "$define") perlpath="$binexp/perl$version";;
8451 *) perlpath="$binexp/perl";;
8453 case "$startperl" in
8458 I will use the "eval 'exec'" idiom to start Perl on your system.
8459 I can use the full path of your Perl binary for this purpose, but
8460 doing so may cause problems if you want to share those scripts and
8461 Perl is not always in a standard place ($binexp/perl).
8465 rp="What path shall I use in \"eval 'exec'\"?"
8472 case "$startperl" in
8474 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8477 : determine where public executable scripts go
8478 set scriptdir scriptdir
8480 case "$scriptdir" in
8483 : guess some guesses
8484 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8485 $test -d /usr/share/bin && dflt=/usr/share/bin
8486 $test -d /usr/local/script && dflt=/usr/local/script
8487 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8488 $test -d $prefixexp/script && dflt=$prefixexp/script
8492 *) dflt="$scriptdir"
8497 Some installations have a separate directory just for executable scripts so
8498 that they can mount it across multiple architectures but keep the scripts in
8499 one spot. You might, for example, have a subdirectory of /usr/share for this.
8500 Or you might just lump your scripts in with all your other executables.
8504 rp='Where do you keep publicly executable scripts?'
8506 if $test "X$ansexp" != "X$scriptdirexp"; then
8510 scriptdirexp="$ansexp"
8511 : Change installation prefix, if necessary.
8512 if $test X"$prefix" != X"$installprefix"; then
8513 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8515 installscript="$scriptdirexp"
8518 : determine where add-on public executables go
8520 '') dflt=$siteprefix/bin ;;
8524 rp='Pathname where the add-on public executables should be installed?'
8527 sitebinexp="$ansexp"
8528 : Change installation prefix, if necessary.
8529 if $test X"$prefix" != X"$installprefix"; then
8530 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8532 installsitebin="$sitebinexp"
8535 : define an is-a-typedef? function
8536 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8538 "") inclist="sys/types.h";;
8540 eval "varval=\$$var";
8544 for inc in $inclist; do
8545 echo "#include <$inc>" >>temp.c;
8547 echo "#ifdef $type" >> temp.c;
8548 echo "printf(\"We have $type\");" >> temp.c;
8549 echo "#endif" >> temp.c;
8550 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8551 if $contains $type temp.E >/dev/null 2>&1; then
8557 *) eval "$var=\$varval";;
8560 : define an is-a-typedef? function that prompts if the type is not available.
8561 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8563 "") inclist="sys/types.h";;
8565 eval "varval=\$$var";
8569 for inc in $inclist; do
8570 echo "#include <$inc>" >>temp.c;
8572 echo "#ifdef $type" >> temp.c;
8573 echo "printf(\"We have $type\");" >> temp.c;
8574 echo "#endif" >> temp.c;
8575 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8577 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8578 if $contains $type temp.E >/dev/null 2>&1; then
8579 echo "$type found." >&4;
8582 echo "$type NOT found." >&4;
8588 *) eval "$var=\$varval";;
8591 : see what type lseek is declared as in the kernel
8592 rp="What is the type used for lseek's offset on this system?"
8593 set off_t lseektype long stdio.h sys/types.h
8597 echo "Checking to see how big your file offsets are..." >&4
8599 #include <sys/types.h>
8603 printf("%d\n", (int)sizeof($lseektype));
8608 if eval $compile_ok; then
8609 lseeksize=`$run ./try`
8610 echo "Your file offsets are $lseeksize bytes long."
8614 echo "(I can't seem to compile the test program. Guessing...)"
8615 rp="What is the size of your file offsets (in bytes)?"
8621 : see what type file positions are declared as in the library
8622 rp="What is the type for file position used by fsetpos()?"
8623 set fpos_t fpostype long stdio.h sys/types.h
8628 *_t) zzz="$fpostype" ;;
8631 echo "Checking the size of $zzz..." >&4
8633 #include <sys/types.h>
8636 printf("%d\n", (int)sizeof($fpostype));
8641 if eval $compile_ok; then
8645 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8648 echo "Your $zzz is $fpossize bytes long."
8654 echo "(I can't compile the test program. Guessing...)" >&4
8655 rp="What is the size of your file positions (in bytes)?"
8662 # Backward compatibility (uselfs is deprecated).
8664 "$define"|true|[yY]*)
8667 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8669 uselargefiles="$define"
8673 case "$lseeksize:$fpossize" in
8676 You can have files larger than 2 gigabytes.
8679 *) case "$uselargefiles" in
8680 "$undef"|false|[nN]*) dflt='n' ;;
8685 Perl can be built to understand large files (files larger than 2 gigabytes)
8686 on some systems. To do so, Configure can be run with -Duselargefiles.
8688 If this doesn't make any sense to you, just accept the default '$dflt'.
8690 rp='Try to understand large files, if available?'
8693 y|Y) val="$define" ;;
8700 case "$uselargefiles" in
8702 : Look for a hint-file generated 'call-back-unit'. If the
8703 : user has specified that a large files perl is to be built,
8704 : we may need to set or change some other defaults.
8705 if $test -f uselargefiles.cbu; then
8706 echo "Your platform has some specific hints for large file builds, using them..."
8707 . ./uselargefiles.cbu
8709 echo "Rechecking to see how big your file offsets are..." >&4
8711 #include <sys/types.h>
8715 printf("%d\n", (int)sizeof($lseektype));
8720 if eval $compile_ok; then
8721 lseeksize=`$run ./try`
8722 $echo "Your file offsets are now $lseeksize bytes long."
8726 echo "(I can't seem to compile the test program. Guessing...)"
8727 rp="What is the size of your file offsets (in bytes)?"
8732 *_t) zzz="$fpostype" ;;
8735 $echo $n "Rechecking the size of $zzz...$c" >&4
8737 #include <sys/types.h>
8740 printf("%d\n", (int)sizeof($fpostype));
8745 if eval $compile_ok; then
8750 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8753 echo " $fpossize bytes." >&4
8759 echo "(I can't compile the test program. Guessing...)" >&4
8760 rp="What is the size of your file positions (in bytes)?"
8769 case "$vendorprefix" in
8770 '') d_vendorbin="$undef"
8774 *) d_vendorbin="$define"
8775 : determine where vendor-supplied executables go.
8776 case "$vendorbin" in
8777 '') dflt=$vendorprefix/bin ;;
8778 *) dflt="$vendorbin" ;;
8781 rp='Pathname for the vendor-supplied executables directory?'
8784 vendorbinexp="$ansexp"
8787 : Change installation prefix, if necessary.
8788 if $test X"$prefix" != X"$installprefix"; then
8789 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
8791 installvendorbin="$vendorbinexp"
8794 : see if qgcvt exists
8798 : Check how to convert floats to strings.
8800 if test "X$d_Gconvert" = X; then
8803 echo "Checking for an efficient way to convert floats to strings."
8805 case "$uselongdouble" in
8806 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8808 case "$d_longdbl" in
8809 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8811 case "$d_PRIgldbl" in
8812 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8816 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8817 char *myname = "gconvert";
8820 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8821 char *myname = "gcvt";
8824 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8825 char *myname = "qgcvt";
8826 #define DOUBLETYPE long double
8829 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8831 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8833 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
8836 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8838 char *myname = "sprintf";
8842 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8843 #define DOUBLETYPE long double
8845 #define DOUBLETYPE double
8851 #define I_STDLIB $i_stdlib
8857 checkit(expect, got)
8861 if (strcmp(expect, got)) {
8862 printf("%s oddity: Expected %s, got %s\n",
8863 myname, expect, got);
8873 /* This must be 1st test on (which?) platform */
8874 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8875 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8876 checkit("0.1", buf);
8878 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
8879 checkit("0.01", buf);
8881 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
8882 checkit("0.001", buf);
8884 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
8885 checkit("0.0001", buf);
8887 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
8888 if (strlen(buf) > 5)
8889 checkit("9e-005", buf); /* for Microsoft ?? */
8891 checkit("9e-05", buf);
8893 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8896 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8897 checkit("1.1", buf);
8899 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8900 checkit("1.01", buf);
8902 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8903 checkit("1.001", buf);
8905 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8906 checkit("1.0001", buf);
8908 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8909 checkit("1.00001", buf);
8911 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8912 checkit("1.000001", buf);
8914 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8917 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8920 /* Some Linux gcvt's give 1.e+5 here. */
8921 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8922 checkit("100000", buf);
8924 /* Some Linux gcvt's give -1.e+5 here. */
8925 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8926 checkit("-100000", buf);
8928 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8929 checkit("123.456", buf);
8931 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
8932 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
8933 /* 34 should be enough to scare even long double
8934 * places into using the e notation. */
8935 if (strlen(buf) > 5)
8936 checkit("1e+034", buf); /* for Microsoft */
8938 checkit("1e+34", buf);
8940 /* For Perl, if you add additional tests here, also add them to
8941 * t/base/num.t for benefit of platforms not using Configure or
8942 * overriding d_Gconvert */
8947 : first add preferred functions to our list
8949 for xxx_convert in $gconvert_preference; do
8950 case $xxx_convert in
8951 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
8952 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
8955 : then add any others
8956 for xxx_convert in gconvert gcvt sprintf; do
8959 *) xxx_list="$xxx_list $xxx_convert" ;;
8963 case "$d_longdbl$uselongdouble" in
8965 : again, add prefered functions to our list first
8967 for xxx_convert in $gconvert_ld_preference; do
8968 case $xxx_convert in
8969 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
8970 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
8973 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
8974 for xxx_convert in qgcvt sprintf $xxx_list; do
8975 case "$xxx_ld_list" in
8976 $xxx_convert*|*" $xxx_convert"*) ;;
8977 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
8980 : if sprintf cannot do long doubles, move it to the end
8981 if test "$d_PRIgldbl" != "$define"; then
8982 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
8984 : if no qgcvt, remove it
8985 if test "$d_qgcvt" != "$define"; then
8986 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
8989 xxx_list="$xxx_ld_list"
8993 for xxx_convert in $xxx_list; do
8994 echo "Trying $xxx_convert..."
8996 set try -DTRY_$xxx_convert
8997 if eval $compile; then
8998 echo "$xxx_convert() found." >&4
9000 echo "I'll use $xxx_convert to convert floats into a string." >&4
9003 echo "...But $xxx_convert didn't work as I expected."
9007 echo "$xxx_convert NOT found." >&4
9011 if test X$xxx_convert = X; then
9012 echo "*** WHOA THERE!!! ***" >&4
9013 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9017 case "$xxx_convert" in
9018 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9019 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9020 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9021 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9022 "$define$define$define")
9023 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9024 "$define$define$undef")
9025 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9026 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9033 : see if _fwalk exists
9037 : Initialize h_fcntl
9040 : Initialize h_sysfile
9043 : access call always available on UNIX
9047 : locate the flags for 'access()'
9051 $cat >access.c <<'EOCP'
9052 #include <sys/types.h>
9057 #include <sys/file.h>
9066 : check sys/file.h first, no particular reason here
9067 if $test `./findhdr sys/file.h` && \
9068 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9070 echo "<sys/file.h> defines the *_OK access constants." >&4
9071 elif $test `./findhdr fcntl.h` && \
9072 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9074 echo "<fcntl.h> defines the *_OK access constants." >&4
9075 elif $test `./findhdr unistd.h` && \
9076 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9077 echo "<unistd.h> defines the *_OK access constants." >&4
9079 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9085 : see if accessx exists
9086 set accessx d_accessx
9089 : see if alarm exists
9093 : define a fucntion to check prototypes
9094 $cat > protochk <<EOSH
9097 optimize="$optimize"
9099 prototype="$prototype"
9104 $cat >> protochk <<'EOSH'
9109 while test $# -ge 2; do
9111 $define) echo "#include <$2>" >> try.c ;;
9112 literal) echo "$2" >> try.c ;;
9114 # Extra magic for the benefit of systems that need pthread.h
9115 # to be included early to correctly detect threadsafe functions.
9116 # Such functions must guarantee themselves, though, that the usethreads
9117 # and i_pthread have been defined, before calling protochk.
9118 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9119 echo "#include <pthread.h>" >> try.c
9124 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9125 cat >> try.c <<'EOCP'
9126 #ifdef CAN_PROTOTYPE
9127 #define _(args) args
9132 echo "$foo" >> try.c
9133 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9134 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9142 hasproto='varname=$1; func=$2; shift; shift;
9143 while $test $# -ge 2; do
9145 $define) echo "#include <$2>";;
9149 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9150 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9151 echo "$func() prototype found.";
9154 echo "$func() prototype NOT found.";
9159 $rm -f try.c tryout.c'
9161 : see if sys/types.h has to be included
9162 set sys/types.h i_systypes
9165 : see if sys/select.h has to be included
9166 set sys/select.h i_sysselct
9169 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9170 while $test $# -ge 2; do
9172 $define) echo "#include <$2>";;
9176 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9178 if eval $compile; then
9187 : see if we should include time.h, sys/time.h, or both
9189 if test "X$timeincl" = X; then
9190 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9191 $echo $n "I'm now running the test program...$c"
9192 $cat >try.c <<'EOCP'
9193 #include <sys/types.h>
9198 #ifdef SYSTIMEKERNEL
9201 #include <sys/time.h>
9204 #include <sys/select.h>
9213 struct timezone tzp;
9215 if (foo.tm_sec == foo.tm_sec)
9218 if (bar.tv_sec == bar.tv_sec)
9225 for s_timezone in '-DS_TIMEZONE' ''; do
9227 for s_timeval in '-DS_TIMEVAL' ''; do
9228 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9229 for i_time in '' '-DI_TIME'; do
9230 for i_systime in '-DI_SYSTIME' ''; do
9233 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9234 if eval $compile; then
9235 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9239 $echo $n "Succeeded with $flags$c"
9251 *SYSTIMEKERNEL*) i_systimek="$define"
9252 timeincl=`./findhdr sys/time.h`
9253 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9254 *) i_systimek="$undef";;
9257 *I_TIME*) i_time="$define"
9258 timeincl=`./findhdr time.h`" $timeincl"
9259 echo "We'll include <time.h>." >&4;;
9260 *) i_time="$undef";;
9263 *I_SYSTIME*) i_systime="$define"
9264 timeincl=`./findhdr sys/time.h`" $timeincl"
9265 echo "We'll include <sys/time.h>." >&4;;
9266 *) i_systime="$undef";;
9270 : see if struct tm knows about tm_zone
9271 case "$i_systime$i_time" in
9274 echo "Checking to see if your struct tm has tm_zone field..." >&4
9275 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9283 case "$d_tm_tm_zone" in
9284 "$define") echo "Yes, it does." ;;
9285 *) echo "No, it doesn't." ;;
9287 : see if struct tm knows about tm_gmtoff
9288 case "$i_systime$i_time" in
9291 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9292 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9300 case "$d_tm_tm_gmtoff" in
9301 "$define") echo "Yes, it does." ;;
9302 *) echo "No, it doesn't." ;;
9305 : see if POSIX threads are available
9306 set pthread.h i_pthread
9309 : see if asctime_r exists
9310 set asctime_r d_asctime_r
9312 case "$d_asctime_r" in
9314 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h"
9317 hdrs="$hdrs $i_systime sys/time.h"
9320 case "$d_asctime_r_proto:$usethreads" in
9321 ":define") d_asctime_r_proto=define
9322 set d_asctime_r_proto asctime_r $hdrs
9326 case "$d_asctime_r_proto" in
9328 case "$asctime_r_proto" in
9329 ''|0) try='char* asctime_r(const struct tm*, char*);'
9330 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9332 case "$asctime_r_proto" in
9333 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9334 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9336 case "$asctime_r_proto" in
9337 ''|0) try='int asctime_r(const struct tm*, char*);'
9338 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9340 case "$asctime_r_proto" in
9341 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9342 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9344 case "$asctime_r_proto" in
9345 ''|0) d_asctime_r=undef
9347 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9348 * ) case "$asctime_r_proto" in
9349 REENTRANT_PROTO*) ;;
9350 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9352 echo "Prototype: $try" ;;
9355 *) case "$usethreads" in
9356 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9363 *) asctime_r_proto=0
9367 : see if atolf exists
9371 : see if atoll exists
9375 : Look for GNU-cc style attribute checking
9377 echo "Checking whether your compiler can handle __attribute__ ..." >&4
9378 $cat >attrib.c <<'EOCP'
9380 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
9382 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9383 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9384 echo "Your C compiler doesn't fully support __attribute__."
9387 echo "Your C compiler supports __attribute__."
9391 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9398 : see if bcmp exists
9402 : see if bcopy exists
9406 : see if this is a unistd.h system
9407 set unistd.h i_unistd
9410 : see if getpgrp exists
9411 set getpgrp d_getpgrp
9414 case "$d_getpgrp" in
9417 echo "Checking to see which flavor of getpgrp is in use..."
9420 #include <sys/types.h>
9422 # include <unistd.h>
9426 if (getuid() == 0) {
9427 printf("(I see you are running Configure as super-user...)\n");
9431 if (getpgrp(1) == 0)
9440 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9441 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
9443 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9444 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
9447 echo "I can't seem to compile and run the test program."
9449 xxx="a USG one, i.e. you use getpgrp()."
9451 # SVR4 systems can appear rather BSD-ish.
9454 xxx="a BSD one, i.e. you use getpgrp(pid)."
9458 xxx="probably a USG one, i.e. you use getpgrp()."
9463 echo "Assuming your getpgrp is $xxx" >&4
9472 : see if setpgrp exists
9473 set setpgrp d_setpgrp
9476 case "$d_setpgrp" in
9479 echo "Checking to see which flavor of setpgrp is in use..."
9482 #include <sys/types.h>
9484 # include <unistd.h>
9488 if (getuid() == 0) {
9489 printf("(I see you are running Configure as super-user...)\n");
9493 if (-1 == setpgrp(1, 1))
9496 if (setpgrp() != -1)
9502 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9503 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
9505 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9506 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
9509 echo "(I can't seem to compile and run the test program.)"
9511 xxx="a USG one, i.e. you use setpgrp()."
9513 # SVR4 systems can appear rather BSD-ish.
9516 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
9520 xxx="probably a USG one, i.e. you use setpgrp()."
9525 echo "Assuming your setpgrp is $xxx" >&4
9533 : see if bzero exists
9537 : see if signal is declared as pointer to function returning int or void
9539 xxx=`./findhdr signal.h`
9540 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
9541 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9542 echo "You have int (*signal())() instead of void." >&4
9544 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9545 echo "You have void (*signal())()." >&4
9547 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
9548 echo "You have int (*signal())() instead of void." >&4
9550 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
9551 echo "You have void (*signal())()." >&4
9554 case "$d_voidsig" in
9556 echo "I can't determine whether signal handler returns void or int..." >&4
9558 rp="What type does your signal handler return?"
9565 echo "As you already told me, signal handler returns void." >&4
9568 *) echo "As you already told me, signal handler returns int." >&4
9575 case "$d_voidsig" in
9576 "$define") signal_t="void";;
9581 : check for ability to cast large floats to 32-bit ints.
9583 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
9584 if $test "$intsize" -ge 4; then
9591 #include <sys/types.h>
9593 $signal_t blech(s) int s; { exit(3); }
9600 signal(SIGFPE, blech);
9602 /* Don't let compiler optimize the test away. Store the number
9603 in a writable string for gcc to pass to sscanf under HP/UX.
9605 sprintf(str, "2147483647");
9606 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
9610 /* x86 processors will probably give 0x8000 0000, which is a
9611 sign change. We don't want that. We want to mimic SPARC
9612 behavior here, which is to preserve the sign and give
9615 if (i32 != ($xxx) f)
9621 if eval $compile_ok; then
9625 echo "(I can't seem to compile the test program--assuming it can't)"
9633 echo "Nope, it can't."
9640 : check for ability to cast negative floats to unsigned
9642 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
9645 #include <sys/types.h>
9647 $signal_t blech(s) int s; { exit(7); }
9648 $signal_t blech_in_list(s) int s; { exit(4); }
9649 unsigned long dummy_long(p) unsigned long p; { return p; }
9650 unsigned int dummy_int(p) unsigned int p; { return p; }
9651 unsigned short dummy_short(p) unsigned short p; { return p; }
9655 unsigned long along;
9657 unsigned short ashort;
9661 /* Frustrate gcc-2.7.2's optimizer which failed this test with
9662 a direct f = -123. assignment. gcc-2.8.0 reportedly
9663 optimized the whole file away
9665 /* Store the number in a writable string for gcc to pass to
9668 sprintf(str, "-123");
9669 sscanf(str, "%lf", &f); /* f = -123.; */
9671 signal(SIGFPE, blech);
9672 along = (unsigned long)f;
9673 aint = (unsigned int)f;
9674 ashort = (unsigned short)f;
9675 if (along != (unsigned long)-123)
9677 if (aint != (unsigned int)-123)
9679 if (ashort != (unsigned short)-123)
9681 sprintf(str, "1073741824.");
9682 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
9685 along = (unsigned long)f;
9686 if (along != 0x80000000)
9690 along = (unsigned long)f;
9691 if (along != 0x7fffffff)
9695 along = (unsigned long)f;
9696 if (along != 0x80000001)
9700 signal(SIGFPE, blech_in_list);
9701 sprintf(str, "123.");
9702 sscanf(str, "%lf", &f); /* f = 123.; */
9703 along = dummy_long((unsigned long)f);
9704 aint = dummy_int((unsigned int)f);
9705 ashort = dummy_short((unsigned short)f);
9706 if (along != (unsigned long)123)
9708 if (aint != (unsigned int)123)
9710 if (ashort != (unsigned short)123)
9717 if eval $compile_ok; then
9721 echo "(I can't seem to compile the test program--assuming it can't)"
9724 case "$castflags" in
9729 echo "Nope, it can't."
9736 : see if vprintf exists
9738 if set vprintf val -f d_vprintf; eval $csym; $val; then
9739 echo 'vprintf() found.' >&4
9742 #include <varargs.h>
9744 int main() { xxx("foo"); }
9753 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
9757 if eval $compile && $run ./try; then
9758 echo "Your vsprintf() returns (int)." >&4
9761 echo "Your vsprintf() returns (char*)." >&4
9765 echo 'vprintf() NOT found.' >&4
9776 : see if chown exists
9780 : see if chroot exists
9784 : see if chsize exists
9788 : see if class exists
9792 hasstruct='varname=$1; struct=$2; shift; shift;
9793 while $test $# -ge 2; do
9795 $define) echo "#include <$2>";;
9799 echo "int main () { struct $struct foo; }" >> try.c;
9801 if eval $compile; then
9812 : see whether socket exists
9814 $echo $n "Hmm... $c" >&4
9815 if set socket val -f d_socket; eval $csym; $val; then
9816 echo "Looks like you have Berkeley networking support." >&4
9818 if set setsockopt val -f; eval $csym; $val; then
9821 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9825 if $contains socklib libc.list >/dev/null 2>&1; then
9826 echo "Looks like you have Berkeley networking support." >&4
9828 : we will have to assume that it supports the 4.2 BSD interface
9831 echo "You don't have Berkeley networking in libc$_a..." >&4
9832 if test "X$d_socket" = "X$define"; then
9833 echo "...but you seem to believe that you have sockets." >&4
9835 for net in net socket
9837 if test -f /usr/lib/lib$net$_a; then
9838 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9839 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9840 if $contains socket libc.list >/dev/null 2>&1; then
9845 echo "...but the Wollongong group seems to have hacked it in." >&4
9846 sockethdr="-I/usr/netinclude"
9849 echo "Found Berkeley sockets interface in lib$net." >&4
9850 if $contains setsockopt libc.list >/dev/null 2>&1; then
9853 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9860 if test "X$d_socket" != "X$define"; then
9861 echo "or anywhere else I see." >&4
9869 : see if socketpair exists
9870 set socketpair d_sockpair
9875 echo "Checking the availability of certain socket constants..." >&4
9876 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9877 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9879 #include <sys/types.h>
9880 #include <sys/socket.h>
9886 set try; if eval $compile; then
9889 set d_${enum}; eval $setvar
9893 : see if this is a sys/uio.h system
9894 set sys/uio.h i_sysuio
9899 echo "Checking to see if your system supports struct cmsghdr..." >&4
9900 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
9902 case "$d_cmsghdr_s" in
9903 "$define") echo "Yes, it does." ;;
9904 *) echo "No, it doesn't." ;;
9908 : check for const keyword
9910 echo 'Checking to see if your C compiler knows about "const"...' >&4
9911 $cat >const.c <<'EOCP'
9912 typedef struct spug { int drokk; } spug;
9919 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
9921 echo "Yup, it does."
9924 echo "Nope, it doesn't."
9929 : see if crypt exists
9934 $define) cryptlib='' ;;
9935 *) if set crypt val -f d_crypt; eval $csym; $val; then
9936 echo 'crypt() found.' >&4
9940 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
9941 if $test -z "$cryptlib"; then
9942 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
9946 if $test -z "$cryptlib"; then
9947 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
9951 if $test -z "$cryptlib"; then
9952 cryptlib=`./loc libcrypt$_a "" $libpth`
9956 if $test -z "$cryptlib"; then
9957 echo 'crypt() NOT found.' >&4
9968 : see if this is a crypt.h system
9972 : see if crypt_r exists
9973 set crypt_r d_crypt_r
9975 case "$d_crypt_r" in
9977 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
9980 hdrs="$hdrs $i_systime sys/time.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 "
10042 hdrs="$hdrs $i_systime sys/time.h"
10045 case "$d_ctermid_r_proto:$usethreads" in
10046 ":define") d_ctermid_r_proto=define
10047 set d_ctermid_r_proto ctermid_r $hdrs
10051 case "$d_ctermid_r_proto" in
10053 case "$ctermid_r_proto" in
10054 ''|0) try='char* ctermid_r(char*);'
10055 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10057 case "$ctermid_r_proto" in
10058 ''|0) d_ctermid_r=undef
10060 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10061 * ) case "$ctermid_r_proto" in
10062 REENTRANT_PROTO*) ;;
10063 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10065 echo "Prototype: $try" ;;
10068 *) case "$usethreads" in
10069 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10076 *) ctermid_r_proto=0
10080 : see if ctime_r exists
10081 set ctime_r d_ctime_r
10083 case "$d_ctime_r" in
10085 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h"
10088 hdrs="$hdrs $i_systime sys/time.h"
10091 case "$d_ctime_r_proto:$usethreads" in
10092 ":define") d_ctime_r_proto=define
10093 set d_ctime_r_proto ctime_r $hdrs
10097 case "$d_ctime_r_proto" in
10099 case "$ctime_r_proto" in
10100 ''|0) try='char* ctime_r(const time_t*, char*);'
10101 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10103 case "$ctime_r_proto" in
10104 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10105 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10107 case "$ctime_r_proto" in
10108 ''|0) try='int ctime_r(const time_t*, char*);'
10109 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10111 case "$ctime_r_proto" in
10112 ''|0) try='int ctime_r(const time_t*, char*, int);'
10113 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10115 case "$ctime_r_proto" in
10116 ''|0) d_ctime_r=undef
10118 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10119 * ) case "$ctime_r_proto" in
10120 REENTRANT_PROTO*) ;;
10121 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10123 echo "Prototype: $try" ;;
10126 *) case "$usethreads" in
10127 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10138 : see if cuserid exists
10139 set cuserid d_cuserid
10142 : see if this is a limits.h system
10143 set limits.h i_limits
10146 : see if this is a float.h system
10147 set float.h i_float
10150 : See if number of significant digits in a double precision number is known
10152 $cat >dbl_dig.c <<EOM
10153 #$i_limits I_LIMITS
10156 #include <limits.h>
10162 printf("Contains DBL_DIG");
10165 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10166 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10167 echo "DBL_DIG found." >&4
10170 echo "DBL_DIG NOT found." >&4
10177 : see if dbm.h is available
10178 : see if dbmclose exists
10179 set dbmclose d_dbmclose
10182 case "$d_dbmclose" in
10192 *) set rpcsvc/dbm.h i_rpcsvcdbm
10197 *) echo "We won't be including <dbm.h>"
10207 : see if prototype for dbminit is available
10209 set d_dbminitproto dbminit $i_dbm dbm.h
10212 : see if difftime exists
10213 set difftime d_difftime
10216 : see if this is a dirent system
10218 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10220 echo "<dirent.h> found." >&4
10223 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10224 echo "<sys/dir.h> found." >&4
10227 xinc=`./findhdr sys/ndir.h`
10229 echo "<dirent.h> NOT found." >&4
10234 : Look for type of directory structure.
10236 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10238 case "$direntrytype" in
10240 case "$i_dirent" in
10241 $define) guess1='struct dirent' ;;
10242 *) guess1='struct direct' ;;
10245 *) guess1="$direntrytype"
10250 'struct dirent') guess2='struct direct' ;;
10251 *) guess2='struct dirent' ;;
10254 if $contains "$guess1" try.c >/dev/null 2>&1; then
10255 direntrytype="$guess1"
10256 echo "Your directory entries are $direntrytype." >&4
10257 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10258 direntrytype="$guess2"
10259 echo "Your directory entries seem to be $direntrytype." >&4
10261 echo "I don't recognize your system's directory entries." >&4
10262 rp="What type is used for directory entries on this system?"
10265 direntrytype="$ans"
10270 : see if the directory entry stores field length
10272 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10273 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10274 echo "Good, your directory entry keeps length information in d_namlen." >&4
10277 echo "Your directory entry does not know about the d_namlen field." >&4
10284 : see if this is an sysdir system
10285 set sys/dir.h i_sysdir
10288 : see if this is an sysndir system
10289 set sys/ndir.h i_sysndir
10294 $cat >dirfd.c <<EOM
10296 #$i_dirent I_DIRENT /**/
10297 #$i_sysdir I_SYS_DIR /**/
10298 #$i_sysndir I_SYS_NDIR /**/
10299 #$i_systypes I_SYS_TYPES /**/
10300 #if defined(I_SYS_TYPES)
10301 #include <sys/types.h>
10303 #if defined(I_DIRENT)
10304 #include <dirent.h>
10305 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10306 #include <sys/dir.h>
10310 #include <sys/ndir.h>
10314 #include <ndir.h> /* may be wrong in the future */
10316 #include <sys/dir.h>
10322 DIR *dirp = opendir(".");
10323 if (dirfd(dirp) >= 0)
10330 if eval $compile; then
10334 $define) echo "dirfd() found." >&4 ;;
10335 *) echo "dirfd() NOT found." >&4 ;;
10341 : see if dlerror exists
10344 set dlerror d_dlerror
10348 : see if dlfcn is available
10349 set dlfcn.h i_dlfcn
10356 On a few systems, the dynamically loaded modules that perl generates and uses
10357 will need a different extension than shared libs. The default will probably
10363 *) dflt="$dlext" ;;
10365 rp='What is the extension of dynamically loaded modules'
10374 : Check if dlsym need a leading underscore
10380 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
10381 $cat >dyna.c <<'EOM'
10390 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
10392 #include <sys/types.h>
10397 extern int fred() ;
10406 int mode = RTLD_LAZY ;
10408 handle = dlopen("./dyna.$dlext", mode) ;
10409 if (handle == NULL) {
10414 symbol = dlsym(handle, "fred") ;
10415 if (symbol == NULL) {
10416 /* try putting a leading underscore */
10417 symbol = dlsym(handle, "_fred") ;
10418 if (symbol == NULL) {
10431 : Call the object file tmp-dyna.o in case dlext=o.
10432 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
10433 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
10434 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
10435 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
10438 1) echo "Test program failed using dlopen." >&4
10439 echo "Perhaps you should not use dynamic loading." >&4;;
10440 2) echo "Test program failed using dlsym." >&4
10441 echo "Perhaps you should not use dynamic loading." >&4;;
10442 3) echo "dlsym needs a leading underscore" >&4
10444 4) echo "dlsym doesn't need a leading underscore." >&4;;
10447 echo "I can't compile and run the test program." >&4
10448 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
10453 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
10458 : see if drand48_r exists
10459 set drand48_r d_drand48_r
10461 case "$d_drand48_r" in
10463 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
10466 hdrs="$hdrs $i_systime sys/time.h"
10469 case "$d_drand48_r_proto:$usethreads" in
10470 ":define") d_drand48_r_proto=define
10471 set d_drand48_r_proto drand48_r $hdrs
10475 case "$d_drand48_r_proto" in
10477 case "$drand48_r_proto" in
10478 ''|0) try='int drand48_r(struct drand48_data*, double*);'
10479 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
10481 case "$drand48_r_proto" in
10482 ''|0) d_drand48_r=undef
10484 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
10485 * ) case "$drand48_r_proto" in
10486 REENTRANT_PROTO*) ;;
10487 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
10489 echo "Prototype: $try" ;;
10492 *) case "$usethreads" in
10493 define) echo "drand48_r has no prototype, not using it." >&4 ;;
10500 *) drand48_r_proto=0
10504 : see if prototype for drand48 is available
10506 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
10509 : see if dup2 exists
10513 : see if eaccess exists
10514 set eaccess d_eaccess
10517 : see if endgrent exists
10518 set endgrent d_endgrent
10521 : see if this is an grp system
10527 xxx=`./findhdr grp.h`
10528 $cppstdin $cppflags $cppminus < $xxx >$$.h
10530 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10542 set d_grpasswd; eval $setvar
10546 : see if endgrent_r exists
10547 set endgrent_r d_endgrent_r
10549 case "$d_endgrent_r" in
10551 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
10554 hdrs="$hdrs $i_systime sys/time.h"
10557 case "$d_endgrent_r_proto:$usethreads" in
10558 ":define") d_endgrent_r_proto=define
10559 set d_endgrent_r_proto endgrent_r $hdrs
10563 case "$d_endgrent_r_proto" in
10565 case "$endgrent_r_proto" in
10566 ''|0) try='int endgrent_r(FILE**);'
10567 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
10569 case "$endgrent_r_proto" in
10570 ''|0) try='void endgrent_r(FILE**);'
10571 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
10573 case "$endgrent_r_proto" in
10574 ''|0) d_endgrent_r=undef
10576 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
10577 * ) case "$endgrent_r_proto" in
10578 REENTRANT_PROTO*) ;;
10579 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
10581 echo "Prototype: $try" ;;
10584 *) case "$usethreads" in
10585 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
10592 *) endgrent_r_proto=0
10596 : see if endhostent exists
10597 set endhostent d_endhent
10600 : see if this is a netdb.h system
10601 set netdb.h i_netdb
10604 : see if endhostent_r exists
10605 set endhostent_r d_endhostent_r
10607 case "$d_endhostent_r" in
10609 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10612 hdrs="$hdrs $i_systime sys/time.h"
10615 case "$d_endhostent_r_proto:$usethreads" in
10616 ":define") d_endhostent_r_proto=define
10617 set d_endhostent_r_proto endhostent_r $hdrs
10621 case "$d_endhostent_r_proto" in
10623 case "$endhostent_r_proto" in
10624 ''|0) try='int endhostent_r(struct hostent_data*);'
10625 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
10627 case "$endhostent_r_proto" in
10628 ''|0) try='void endhostent_r(struct hostent_data*);'
10629 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
10631 case "$endhostent_r_proto" in
10632 ''|0) d_endhostent_r=undef
10633 endhostent_r_proto=0
10634 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
10635 * ) case "$endhostent_r_proto" in
10636 REENTRANT_PROTO*) ;;
10637 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
10639 echo "Prototype: $try" ;;
10642 *) case "$usethreads" in
10643 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
10645 d_endhostent_r=undef
10646 endhostent_r_proto=0
10650 *) endhostent_r_proto=0
10654 : see if endnetent exists
10655 set endnetent d_endnent
10658 : see if endnetent_r exists
10659 set endnetent_r d_endnetent_r
10661 case "$d_endnetent_r" in
10663 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10666 hdrs="$hdrs $i_systime sys/time.h"
10669 case "$d_endnetent_r_proto:$usethreads" in
10670 ":define") d_endnetent_r_proto=define
10671 set d_endnetent_r_proto endnetent_r $hdrs
10675 case "$d_endnetent_r_proto" in
10677 case "$endnetent_r_proto" in
10678 ''|0) try='int endnetent_r(struct netent_data*);'
10679 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
10681 case "$endnetent_r_proto" in
10682 ''|0) try='void endnetent_r(struct netent_data*);'
10683 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
10685 case "$endnetent_r_proto" in
10686 ''|0) d_endnetent_r=undef
10687 endnetent_r_proto=0
10688 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
10689 * ) case "$endnetent_r_proto" in
10690 REENTRANT_PROTO*) ;;
10691 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
10693 echo "Prototype: $try" ;;
10696 *) case "$usethreads" in
10697 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
10699 d_endnetent_r=undef
10700 endnetent_r_proto=0
10704 *) endnetent_r_proto=0
10708 : see if endprotoent exists
10709 set endprotoent d_endpent
10712 : see if endprotoent_r exists
10713 set endprotoent_r d_endprotoent_r
10715 case "$d_endprotoent_r" in
10717 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10720 hdrs="$hdrs $i_systime sys/time.h"
10723 case "$d_endprotoent_r_proto:$usethreads" in
10724 ":define") d_endprotoent_r_proto=define
10725 set d_endprotoent_r_proto endprotoent_r $hdrs
10729 case "$d_endprotoent_r_proto" in
10731 case "$endprotoent_r_proto" in
10732 ''|0) try='int endprotoent_r(struct protoent_data*);'
10733 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
10735 case "$endprotoent_r_proto" in
10736 ''|0) try='void endprotoent_r(struct protoent_data*);'
10737 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
10739 case "$endprotoent_r_proto" in
10740 ''|0) d_endprotoent_r=undef
10741 endprotoent_r_proto=0
10742 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
10743 * ) case "$endprotoent_r_proto" in
10744 REENTRANT_PROTO*) ;;
10745 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
10747 echo "Prototype: $try" ;;
10750 *) case "$usethreads" in
10751 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
10753 d_endprotoent_r=undef
10754 endprotoent_r_proto=0
10758 *) endprotoent_r_proto=0
10762 : see if endpwent exists
10763 set endpwent d_endpwent
10766 : see if this is a pwd.h system
10772 xxx=`./findhdr pwd.h`
10773 $cppstdin $cppflags $cppminus < $xxx >$$.h
10775 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10783 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10791 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10799 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10807 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10815 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10823 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10831 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10843 set d_pwquota; eval $setvar
10844 set d_pwage; eval $setvar
10845 set d_pwchange; eval $setvar
10846 set d_pwclass; eval $setvar
10847 set d_pwexpire; eval $setvar
10848 set d_pwcomment; eval $setvar
10849 set d_pwgecos; eval $setvar
10850 set d_pwpasswd; eval $setvar
10854 : see if endpwent_r exists
10855 set endpwent_r d_endpwent_r
10857 case "$d_endpwent_r" in
10859 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
10862 hdrs="$hdrs $i_systime sys/time.h"
10865 case "$d_endpwent_r_proto:$usethreads" in
10866 ":define") d_endpwent_r_proto=define
10867 set d_endpwent_r_proto endpwent_r $hdrs
10871 case "$d_endpwent_r_proto" in
10873 case "$endpwent_r_proto" in
10874 ''|0) try='int endpwent_r(FILE**);'
10875 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
10877 case "$endpwent_r_proto" in
10878 ''|0) try='void endpwent_r(FILE**);'
10879 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
10881 case "$endpwent_r_proto" in
10882 ''|0) d_endpwent_r=undef
10884 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
10885 * ) case "$endpwent_r_proto" in
10886 REENTRANT_PROTO*) ;;
10887 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
10889 echo "Prototype: $try" ;;
10892 *) case "$usethreads" in
10893 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
10900 *) endpwent_r_proto=0
10904 : see if endservent exists
10905 set endservent d_endsent
10908 : see if endservent_r exists
10909 set endservent_r d_endservent_r
10911 case "$d_endservent_r" in
10913 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10916 hdrs="$hdrs $i_systime sys/time.h"
10919 case "$d_endservent_r_proto:$usethreads" in
10920 ":define") d_endservent_r_proto=define
10921 set d_endservent_r_proto endservent_r $hdrs
10925 case "$d_endservent_r_proto" in
10927 case "$endservent_r_proto" in
10928 ''|0) try='int endservent_r(struct servent_data*);'
10929 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
10931 case "$endservent_r_proto" in
10932 ''|0) try='void endservent_r(struct servent_data*);'
10933 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
10935 case "$endservent_r_proto" in
10936 ''|0) d_endservent_r=undef
10937 endservent_r_proto=0
10938 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
10939 * ) case "$endservent_r_proto" in
10940 REENTRANT_PROTO*) ;;
10941 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
10943 echo "Prototype: $try" ;;
10946 *) case "$usethreads" in
10947 define) echo "endservent_r has no prototype, not using it." >&4 ;;
10949 d_endservent_r=undef
10950 endservent_r_proto=0
10954 *) endservent_r_proto=0
10958 : Locate the flags for 'open()'
10960 $cat >try.c <<'EOCP'
10961 #include <sys/types.h>
10966 #include <sys/file.h>
10977 : check sys/file.h first to get FREAD on Sun
10978 if $test `./findhdr sys/file.h` && \
10979 set try -DI_SYS_FILE && eval $compile; then
10981 echo "<sys/file.h> defines the O_* constants..." >&4
10982 if $run ./try; then
10983 echo "and you have the 3 argument form of open()." >&4
10986 echo "but not the 3 argument form of open(). Oh, well." >&4
10989 elif $test `./findhdr fcntl.h` && \
10990 set try -DI_FCNTL && eval $compile; then
10992 echo "<fcntl.h> defines the O_* constants..." >&4
10993 if $run ./try; then
10994 echo "and you have the 3 argument form of open()." >&4
10997 echo "but not the 3 argument form of open(). Oh, well." >&4
11002 echo "I can't find the O_* constant definitions! You got problems." >&4
11008 : see which of string.h or strings.h is needed
11010 strings=`./findhdr string.h`
11011 if $test "$strings" && $test -r "$strings"; then
11012 echo "Using <string.h> instead of <strings.h>." >&4
11016 strings=`./findhdr strings.h`
11017 if $test "$strings" && $test -r "$strings"; then
11018 echo "Using <strings.h> instead of <string.h>." >&4
11020 echo "No string header found -- You'll surely have problems." >&4
11025 case "$i_string" in
11026 "$undef") strings=`./findhdr strings.h`;;
11027 *) strings=`./findhdr string.h`;;
11030 : see if this is a sys/file.h system
11035 : do we need to include sys/file.h ?
11039 if $h_sysfile; then
11041 echo "We'll be including <sys/file.h>." >&4
11044 echo "We won't be including <sys/file.h>." >&4
11054 : see if fcntl.h is there
11059 : see if we can include fcntl.h
11065 echo "We'll be including <fcntl.h>." >&4
11068 if $h_sysfile; then
11069 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11071 echo "We won't be including <fcntl.h>." >&4
11083 : check for non-blocking I/O stuff
11084 case "$h_sysfile" in
11085 true) echo "#include <sys/file.h>" > head.c;;
11088 true) echo "#include <fcntl.h>" > head.c;;
11089 *) echo "#include <sys/fcntl.h>" > head.c;;
11094 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11095 case "$o_nonblock" in
11097 $cat head.c > try.c
11098 $cat >>try.c <<EOCP
11100 #include <stdlib.h>
11107 printf("O_NONBLOCK\n");
11111 printf("O_NDELAY\n");
11115 printf("FNDELAY\n");
11122 if eval $compile_ok; then
11123 o_nonblock=`$run ./try`
11124 case "$o_nonblock" in
11125 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11126 *) echo "Seems like we can use $o_nonblock.";;
11129 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11132 *) echo "Using $hint value $o_nonblock.";;
11134 $rm -f try try.* .out core
11137 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11140 $cat head.c > try.c
11141 $cat >>try.c <<EOCP
11143 #include <sys/types.h>
11144 #include <signal.h>
11146 #include <stdlib.h>
11151 #define MY_O_NONBLOCK $o_nonblock
11152 #ifndef errno /* XXX need better Configure test */
11155 #$i_unistd I_UNISTD
11157 #include <unistd.h>
11159 #$i_string I_STRING
11161 #include <string.h>
11163 #include <strings.h>
11165 $signal_t blech(x) int x; { exit(3); }
11167 $cat >> try.c <<'EOCP'
11175 pipe(pd); /* Down: child -> parent */
11176 pipe(pu); /* Up: parent -> child */
11179 close(pd[1]); /* Parent reads from pd[0] */
11180 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11182 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11187 signal(SIGALRM, blech);
11189 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11191 sprintf(string, "%d\n", ret);
11192 write(2, string, strlen(string));
11195 if (errno == EAGAIN) {
11196 printf("EAGAIN\n");
11201 if (errno == EWOULDBLOCK)
11202 printf("EWOULDBLOCK\n");
11205 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11206 sleep(2); /* Give it time to close our pipe */
11208 ret = read(pd[0], buf, 1); /* Should read EOF */
11210 sprintf(string, "%d\n", ret);
11211 write(4, string, strlen(string));
11215 close(pd[0]); /* We write to pd[1] */
11216 close(pu[1]); /* We read from pu[0] */
11217 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11218 close(pd[1]); /* Pipe pd is now fully closed! */
11219 exit(0); /* Bye bye, thank you for playing! */
11223 if eval $compile_ok; then
11224 echo "$startsh" >mtry
11225 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11227 ./mtry >/dev/null 2>&1
11229 0) eagain=`$cat try.out`;;
11230 1) echo "Could not perform non-blocking setting!";;
11231 2) echo "I did a successful read() for something that was not there!";;
11232 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11233 4) echo "Could not find F_SETFL!";;
11234 *) echo "Something terribly wrong happened during testing.";;
11236 rd_nodata=`$cat try.ret`
11237 echo "A read() system call with no data present returns $rd_nodata."
11238 case "$rd_nodata" in
11241 echo "(That's peculiar, fixing that to be -1.)"
11247 echo "Forcing errno EAGAIN on read() with no data available."
11251 echo "Your read() sets errno to $eagain when no data is available."
11254 status=`$cat try.err`
11256 0) echo "And it correctly returns 0 to signal EOF.";;
11257 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11258 *) echo "However, your read() returns '$status' on EOF??";;
11261 if test "$status" = "$rd_nodata"; then
11262 echo "WARNING: you can't distinguish between EOF and no data!"
11266 echo "I can't compile the test program--assuming errno EAGAIN will do."
11273 echo "Using $hint value $eagain."
11274 echo "Your read() returns $rd_nodata when no data is present."
11275 case "$d_eofnblk" in
11276 "$define") echo "And you can see EOF because read() returns 0.";;
11277 "$undef") echo "But you can't see EOF status from read() returned value.";;
11279 echo "(Assuming you can't see EOF status from read anyway.)"
11285 $rm -f try try.* .out core head.c mtry
11287 : see if fchdir exists
11288 set fchdir d_fchdir
11291 : see if fchmod exists
11292 set fchmod d_fchmod
11295 : see if fchown exists
11296 set fchown d_fchown
11299 : see if this is an fcntl system
11304 : See if fcntl-based locking works.
11306 #include <stdlib.h>
11307 #include <unistd.h>
11309 #include <signal.h>
11310 $signal_t blech(x) int x; { exit(3); }
11312 #if defined(F_SETLK) && defined(F_SETLKW)
11313 struct flock flock;
11315 fd = open("try.c", O_RDONLY);
11316 flock.l_type = F_RDLCK;
11317 flock.l_whence = SEEK_SET;
11318 flock.l_start = flock.l_len = 0;
11319 signal(SIGALRM, blech);
11321 retval = fcntl(fd, F_SETLK, &flock);
11323 (retval < 0 ? exit(2) : exit(0));
11329 echo "Checking if fcntl-based file locking works... "
11333 if eval $compile_ok; then
11334 if $run ./try; then
11335 echo "Yes, it seems to work."
11338 echo "Nope, it didn't work."
11343 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
11344 *** This is (almost) impossible.
11345 *** If your NFS lock daemons are not feeling well, something like
11346 *** this may happen, please investigate. Cannot continue, aborting.
11354 echo "I'm unable to compile the test program, so I'll assume not."
11359 echo "Nope, since you don't even have fcntl()."
11362 set d_fcntl_can_lock
11367 : check for fd_set items
11370 Checking to see how well your C compiler handles fd_set and friends ...
11373 #$i_systime I_SYS_TIME
11374 #$i_sysselct I_SYS_SELECT
11375 #$d_socket HAS_SOCKET
11376 #include <sys/types.h>
11378 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
11381 #include <sys/time.h>
11383 #ifdef I_SYS_SELECT
11384 #include <sys/select.h>
11393 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
11401 if eval $compile; then
11402 d_fds_bits="$define"
11404 echo "Well, your system knows about the normal fd_set typedef..." >&4
11405 if $run ./try; then
11406 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
11407 d_fd_macros="$define"
11410 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
11412 d_fd_macros="$undef"
11416 Hmm, your compiler has some difficulty with fd_set. Checking further...
11419 if eval $compile; then
11420 d_fds_bits="$undef"
11422 echo "Well, your system has some sort of fd_set available..." >&4
11423 if $run ./try; then
11424 echo "and you have the normal fd_set macros." >&4
11425 d_fd_macros="$define"
11428 but not the normal fd_set macros! Gross! More work for me...
11430 d_fd_macros="$undef"
11433 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
11435 d_fds_bits="$undef"
11436 d_fd_macros="$undef"
11441 : see if fgetpos exists
11442 set fgetpos d_fgetpos
11445 : see if finite exists
11446 set finite d_finite
11449 : see if finitel exists
11450 set finitel d_finitel
11453 : see if flock exists
11457 : see if prototype for flock is available
11459 set d_flockproto flock $i_sysfile sys/file.h
11462 : see if fork exists
11466 : see if fp_class exists
11467 set fp_class d_fp_class
11470 : see if pathconf exists
11471 set pathconf d_pathconf
11474 : see if fpathconf exists
11475 set fpathconf d_fpathconf
11478 : see if fpclass exists
11479 set fpclass d_fpclass
11482 : see if fpclassify exists
11483 set fpclassify d_fpclassify
11486 : see if fpclassl exists
11487 set fpclassl d_fpclassl
11491 : check for fpos64_t
11493 echo "Checking to see if you have fpos64_t..." >&4
11496 int main() { fpos64_t x = 7; }
11499 if eval $compile; then
11501 echo "You have fpos64_t."
11504 echo "You do not have fpos64_t."
11505 case "$fpossize" in
11506 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
11513 : see if frexpl exists
11514 set frexpl d_frexpl
11517 : see if this is a sys/param system
11518 set sys/param.h i_sysparam
11521 : see if this is a sys/mount.h system
11522 set sys/mount.h i_sysmount
11527 echo "Checking to see if your system supports struct fs_data..." >&4
11528 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
11530 case "$d_fs_data_s" in
11531 "$define") echo "Yes, it does." ;;
11532 *) echo "No, it doesn't." ;;
11535 : see if fseeko exists
11536 set fseeko d_fseeko
11538 case "$longsize" in
11539 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
11542 : see if fsetpos exists
11543 set fsetpos d_fsetpos
11547 : see if fstatfs exists
11548 set fstatfs d_fstatfs
11552 : see if statvfs exists
11553 set statvfs d_statvfs
11556 : see if fstatvfs exists
11557 set fstatvfs d_fstatvfs
11561 : see if fsync exists
11565 : see if ftello exists
11566 set ftello d_ftello
11568 case "$longsize" in
11569 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
11572 : see if getcwd exists
11573 set getcwd d_getcwd
11576 : see if getespwnam exists
11577 set getespwnam d_getespwnam
11581 : see if getfsstat exists
11582 set getfsstat d_getfsstat
11585 : see if getgrent exists
11586 set getgrent d_getgrent
11589 : see if getgrent_r exists
11590 set getgrent_r d_getgrent_r
11592 case "$d_getgrent_r" in
11594 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11597 hdrs="$hdrs $i_systime sys/time.h"
11600 case "$d_getgrent_r_proto:$usethreads" in
11601 ":define") d_getgrent_r_proto=define
11602 set d_getgrent_r_proto getgrent_r $hdrs
11606 case "$d_getgrent_r_proto" in
11608 case "$getgrent_r_proto" in
11609 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
11610 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
11612 case "$getgrent_r_proto" in
11613 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
11614 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
11616 case "$getgrent_r_proto" in
11617 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
11618 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
11620 case "$getgrent_r_proto" in
11621 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
11622 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
11624 case "$getgrent_r_proto" in
11625 ''|0) try='int getgrent_r(struct group*, char*, int);'
11626 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
11628 case "$getgrent_r_proto" in
11629 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
11630 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
11632 case "$getgrent_r_proto" in
11633 ''|0) d_getgrent_r=undef
11635 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
11636 * ) case "$getgrent_r_proto" in
11637 REENTRANT_PROTO*) ;;
11638 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
11640 echo "Prototype: $try" ;;
11643 *) case "$usethreads" in
11644 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
11651 *) getgrent_r_proto=0
11655 : see if getgrgid_r exists
11656 set getgrgid_r d_getgrgid_r
11658 case "$d_getgrgid_r" in
11660 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11663 hdrs="$hdrs $i_systime sys/time.h"
11666 case "$d_getgrgid_r_proto:$usethreads" in
11667 ":define") d_getgrgid_r_proto=define
11668 set d_getgrgid_r_proto getgrgid_r $hdrs
11672 case "$d_getgrgid_r_proto" in
11674 case "$getgrgid_r_proto" in
11675 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
11676 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
11678 case "$getgrgid_r_proto" in
11679 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
11680 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
11682 case "$getgrgid_r_proto" in
11683 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
11684 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
11686 case "$getgrgid_r_proto" in
11687 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
11688 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
11690 case "$getgrgid_r_proto" in
11691 ''|0) d_getgrgid_r=undef
11693 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
11694 * ) case "$getgrgid_r_proto" in
11695 REENTRANT_PROTO*) ;;
11696 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
11698 echo "Prototype: $try" ;;
11701 *) case "$usethreads" in
11702 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
11709 *) getgrgid_r_proto=0
11713 : see if getgrnam_r exists
11714 set getgrnam_r d_getgrnam_r
11716 case "$d_getgrnam_r" in
11718 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11721 hdrs="$hdrs $i_systime sys/time.h"
11724 case "$d_getgrnam_r_proto:$usethreads" in
11725 ":define") d_getgrnam_r_proto=define
11726 set d_getgrnam_r_proto getgrnam_r $hdrs
11730 case "$d_getgrnam_r_proto" in
11732 case "$getgrnam_r_proto" in
11733 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
11734 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
11736 case "$getgrnam_r_proto" in
11737 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
11738 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
11740 case "$getgrnam_r_proto" in
11741 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
11742 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
11744 case "$getgrnam_r_proto" in
11745 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
11746 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
11748 case "$getgrnam_r_proto" in
11749 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
11750 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
11752 case "$getgrnam_r_proto" in
11753 ''|0) d_getgrnam_r=undef
11755 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
11756 * ) case "$getgrnam_r_proto" in
11757 REENTRANT_PROTO*) ;;
11758 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
11760 echo "Prototype: $try" ;;
11763 *) case "$usethreads" in
11764 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
11771 *) getgrnam_r_proto=0
11775 : see if gethostbyaddr exists
11776 set gethostbyaddr d_gethbyaddr
11779 : see if gethostbyname exists
11780 set gethostbyname d_gethbyname
11783 : see if gethostent exists
11784 set gethostent d_gethent
11787 : see how we will look up host name
11790 if set gethostname val -f d_gethname; eval $csym; $val; then
11791 echo 'gethostname() found.' >&4
11792 d_gethname="$define"
11795 if set uname val -f d_uname; eval $csym; $val; then
11798 uname() was found, but you're running xenix, and older versions of xenix
11799 have a broken uname(). If you don't really know whether your xenix is old
11800 enough to have a broken system call, use the default answer.
11805 "$define") dflt=n;;
11807 rp='Is your uname() broken?'
11810 n*) d_uname="$define"; call=uname;;
11813 echo 'uname() found.' >&4
11820 case "$d_gethname" in
11821 '') d_gethname="$undef";;
11824 '') d_uname="$undef";;
11826 case "$d_uname$d_gethname" in
11831 Every now and then someone has a $call() that lies about the hostname
11832 but can't be fixed for political or economic reasons. If you wish, I can
11833 pretend $call() isn't there and maybe compute hostname at run-time
11834 thanks to the '$phostname' command.
11837 rp="Shall I ignore $call() from now on?"
11840 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
11843 case "$phostname" in
11844 '') aphostname='';;
11845 *) case "$aphostname" in
11847 *) set X $phostname
11851 file=`./loc $file $file $pth`
11852 aphostname=`echo $file $*`
11857 case "$d_uname$d_gethname" in
11860 case "$phostname" in
11862 echo "There will be no way for $package to get your hostname." >&4;;
11864 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
11868 case "$d_phostname" in
11869 '') d_phostname="$undef";;
11872 : see if gethostbyaddr_r exists
11873 set gethostbyaddr_r d_gethostbyaddr_r
11875 case "$d_gethostbyaddr_r" in
11877 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11880 hdrs="$hdrs $i_systime sys/time.h"
11883 case "$d_gethostbyaddr_r_proto:$usethreads" in
11884 ":define") d_gethostbyaddr_r_proto=define
11885 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
11889 case "$d_gethostbyaddr_r_proto" in
11891 case "$gethostbyaddr_r_proto" in
11892 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
11893 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
11895 case "$gethostbyaddr_r_proto" in
11896 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
11897 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
11899 case "$gethostbyaddr_r_proto" in
11900 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
11901 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
11903 case "$gethostbyaddr_r_proto" in
11904 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
11905 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
11907 case "$gethostbyaddr_r_proto" in
11908 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
11909 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
11911 case "$gethostbyaddr_r_proto" in
11912 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
11913 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
11915 case "$gethostbyaddr_r_proto" in
11916 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
11917 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
11919 case "$gethostbyaddr_r_proto" in
11920 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
11921 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
11923 case "$gethostbyaddr_r_proto" in
11924 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
11925 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
11927 case "$gethostbyaddr_r_proto" in
11928 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
11929 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
11931 case "$gethostbyaddr_r_proto" in
11932 ''|0) d_gethostbyaddr_r=undef
11933 gethostbyaddr_r_proto=0
11934 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
11935 * ) case "$gethostbyaddr_r_proto" in
11936 REENTRANT_PROTO*) ;;
11937 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
11939 echo "Prototype: $try" ;;
11942 *) case "$usethreads" in
11943 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
11945 d_gethostbyaddr_r=undef
11946 gethostbyaddr_r_proto=0
11950 *) gethostbyaddr_r_proto=0
11954 : see if gethostbyname_r exists
11955 set gethostbyname_r d_gethostbyname_r
11957 case "$d_gethostbyname_r" in
11959 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11962 hdrs="$hdrs $i_systime sys/time.h"
11965 case "$d_gethostbyname_r_proto:$usethreads" in
11966 ":define") d_gethostbyname_r_proto=define
11967 set d_gethostbyname_r_proto gethostbyname_r $hdrs
11971 case "$d_gethostbyname_r_proto" in
11973 case "$gethostbyname_r_proto" in
11974 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
11975 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
11977 case "$gethostbyname_r_proto" in
11978 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
11979 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
11981 case "$gethostbyname_r_proto" in
11982 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
11983 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
11985 case "$gethostbyname_r_proto" in
11986 ''|0) d_gethostbyname_r=undef
11987 gethostbyname_r_proto=0
11988 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
11989 * ) case "$gethostbyname_r_proto" in
11990 REENTRANT_PROTO*) ;;
11991 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
11993 echo "Prototype: $try" ;;
11996 *) case "$usethreads" in
11997 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
11999 d_gethostbyname_r=undef
12000 gethostbyname_r_proto=0
12004 *) gethostbyname_r_proto=0
12008 : see if gethostent_r exists
12009 set gethostent_r d_gethostent_r
12011 case "$d_gethostent_r" in
12013 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12016 hdrs="$hdrs $i_systime sys/time.h"
12019 case "$d_gethostent_r_proto:$usethreads" in
12020 ":define") d_gethostent_r_proto=define
12021 set d_gethostent_r_proto gethostent_r $hdrs
12025 case "$d_gethostent_r_proto" in
12027 case "$gethostent_r_proto" in
12028 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
12029 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
12031 case "$gethostent_r_proto" in
12032 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
12033 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
12035 case "$gethostent_r_proto" in
12036 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
12037 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
12039 case "$gethostent_r_proto" in
12040 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
12041 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
12043 case "$gethostent_r_proto" in
12044 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
12045 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
12047 case "$gethostent_r_proto" in
12048 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
12049 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
12051 case "$gethostent_r_proto" in
12052 ''|0) d_gethostent_r=undef
12053 gethostent_r_proto=0
12054 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
12055 * ) case "$gethostent_r_proto" in
12056 REENTRANT_PROTO*) ;;
12057 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
12059 echo "Prototype: $try" ;;
12062 *) case "$usethreads" in
12063 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
12065 d_gethostent_r=undef
12066 gethostent_r_proto=0
12070 *) gethostent_r_proto=0
12074 : see if prototypes for various gethostxxx netdb.h functions are available
12076 set d_gethostprotos gethostent $i_netdb netdb.h
12079 : see if getitimer exists
12080 set getitimer d_getitimer
12083 : see if getlogin exists
12084 set getlogin d_getlogin
12087 : see if getlogin_r exists
12088 set getlogin_r d_getlogin_r
12090 case "$d_getlogin_r" in
12092 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
12095 hdrs="$hdrs $i_systime sys/time.h"
12098 case "$d_getlogin_r_proto:$usethreads" in
12099 ":define") d_getlogin_r_proto=define
12100 set d_getlogin_r_proto getlogin_r $hdrs
12104 case "$d_getlogin_r_proto" in
12106 case "$getlogin_r_proto" in
12107 ''|0) try='int getlogin_r(char*, size_t);'
12108 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
12110 case "$getlogin_r_proto" in
12111 ''|0) try='int getlogin_r(char*, int);'
12112 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
12114 case "$getlogin_r_proto" in
12115 ''|0) try='char* getlogin_r(char*, size_t);'
12116 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
12118 case "$getlogin_r_proto" in
12119 ''|0) try='char* getlogin_r(char*, int);'
12120 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
12122 case "$getlogin_r_proto" in
12123 ''|0) d_getlogin_r=undef
12125 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
12126 * ) case "$getlogin_r_proto" in
12127 REENTRANT_PROTO*) ;;
12128 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
12130 echo "Prototype: $try" ;;
12133 *) case "$usethreads" in
12134 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
12141 *) getlogin_r_proto=0
12145 : see if getmnt exists
12146 set getmnt d_getmnt
12149 : see if getmntent exists
12150 set getmntent d_getmntent
12153 : see if getnetbyaddr exists
12154 set getnetbyaddr d_getnbyaddr
12157 : see if getnetbyname exists
12158 set getnetbyname d_getnbyname
12161 : see if getnetent exists
12162 set getnetent d_getnent
12165 : see if getnetbyaddr_r exists
12166 set getnetbyaddr_r d_getnetbyaddr_r
12168 case "$d_getnetbyaddr_r" in
12170 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12173 hdrs="$hdrs $i_systime sys/time.h"
12176 case "$d_getnetbyaddr_r_proto:$usethreads" in
12177 ":define") d_getnetbyaddr_r_proto=define
12178 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
12182 case "$d_getnetbyaddr_r_proto" in
12184 case "$getnetbyaddr_r_proto" in
12185 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
12186 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
12188 case "$getnetbyaddr_r_proto" in
12189 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
12190 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
12192 case "$getnetbyaddr_r_proto" in
12193 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
12194 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
12196 case "$getnetbyaddr_r_proto" in
12197 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
12198 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
12200 case "$getnetbyaddr_r_proto" in
12201 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
12202 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
12204 case "$getnetbyaddr_r_proto" in
12205 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
12206 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
12208 case "$getnetbyaddr_r_proto" in
12209 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
12210 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
12212 case "$getnetbyaddr_r_proto" in
12213 ''|0) d_getnetbyaddr_r=undef
12214 getnetbyaddr_r_proto=0
12215 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
12216 * ) case "$getnetbyaddr_r_proto" in
12217 REENTRANT_PROTO*) ;;
12218 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
12220 echo "Prototype: $try" ;;
12223 *) case "$usethreads" in
12224 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
12226 d_getnetbyaddr_r=undef
12227 getnetbyaddr_r_proto=0
12231 *) getnetbyaddr_r_proto=0
12235 : see if getnetbyname_r exists
12236 set getnetbyname_r d_getnetbyname_r
12238 case "$d_getnetbyname_r" in
12240 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12243 hdrs="$hdrs $i_systime sys/time.h"
12246 case "$d_getnetbyname_r_proto:$usethreads" in
12247 ":define") d_getnetbyname_r_proto=define
12248 set d_getnetbyname_r_proto getnetbyname_r $hdrs
12252 case "$d_getnetbyname_r_proto" in
12254 case "$getnetbyname_r_proto" in
12255 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
12256 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
12258 case "$getnetbyname_r_proto" in
12259 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
12260 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
12262 case "$getnetbyname_r_proto" in
12263 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
12264 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
12266 case "$getnetbyname_r_proto" in
12267 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
12268 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
12270 case "$getnetbyname_r_proto" in
12271 ''|0) d_getnetbyname_r=undef
12272 getnetbyname_r_proto=0
12273 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
12274 * ) case "$getnetbyname_r_proto" in
12275 REENTRANT_PROTO*) ;;
12276 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
12278 echo "Prototype: $try" ;;
12281 *) case "$usethreads" in
12282 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
12284 d_getnetbyname_r=undef
12285 getnetbyname_r_proto=0
12289 *) getnetbyname_r_proto=0
12293 : see if getnetent_r exists
12294 set getnetent_r d_getnetent_r
12296 case "$d_getnetent_r" in
12298 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12301 hdrs="$hdrs $i_systime sys/time.h"
12304 case "$d_getnetent_r_proto:$usethreads" in
12305 ":define") d_getnetent_r_proto=define
12306 set d_getnetent_r_proto getnetent_r $hdrs
12310 case "$d_getnetent_r_proto" in
12312 case "$getnetent_r_proto" in
12313 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
12314 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
12316 case "$getnetent_r_proto" in
12317 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
12318 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
12320 case "$getnetent_r_proto" in
12321 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
12322 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
12324 case "$getnetent_r_proto" in
12325 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
12326 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
12328 case "$getnetent_r_proto" in
12329 ''|0) try='int getnetent_r(struct netent*, char*, int);'
12330 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
12332 case "$getnetent_r_proto" in
12333 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
12334 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
12336 case "$getnetent_r_proto" in
12337 ''|0) d_getnetent_r=undef
12338 getnetent_r_proto=0
12339 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
12340 * ) case "$getnetent_r_proto" in
12341 REENTRANT_PROTO*) ;;
12342 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
12344 echo "Prototype: $try" ;;
12347 *) case "$usethreads" in
12348 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
12350 d_getnetent_r=undef
12351 getnetent_r_proto=0
12355 *) getnetent_r_proto=0
12359 : see if prototypes for various getnetxxx netdb.h functions are available
12361 set d_getnetprotos getnetent $i_netdb netdb.h
12364 : see if getpagesize exists
12365 set getpagesize d_getpagsz
12369 : see if getprotobyname exists
12370 set getprotobyname d_getpbyname
12373 : see if getprotobynumber exists
12374 set getprotobynumber d_getpbynumber
12377 : see if getprotoent exists
12378 set getprotoent d_getpent
12381 : see if getpgid exists
12382 set getpgid d_getpgid
12385 : see if getpgrp2 exists
12386 set getpgrp2 d_getpgrp2
12389 : see if getppid exists
12390 set getppid d_getppid
12393 : see if getpriority exists
12394 set getpriority d_getprior
12397 : see if getprotobyname_r exists
12398 set getprotobyname_r d_getprotobyname_r
12400 case "$d_getprotobyname_r" in
12402 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12405 hdrs="$hdrs $i_systime sys/time.h"
12408 case "$d_getprotobyname_r_proto:$usethreads" in
12409 ":define") d_getprotobyname_r_proto=define
12410 set d_getprotobyname_r_proto getprotobyname_r $hdrs
12414 case "$d_getprotobyname_r_proto" in
12416 case "$getprotobyname_r_proto" in
12417 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
12418 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
12420 case "$getprotobyname_r_proto" in
12421 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
12422 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
12424 case "$getprotobyname_r_proto" in
12425 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
12426 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
12428 case "$getprotobyname_r_proto" in
12429 ''|0) d_getprotobyname_r=undef
12430 getprotobyname_r_proto=0
12431 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
12432 * ) case "$getprotobyname_r_proto" in
12433 REENTRANT_PROTO*) ;;
12434 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
12436 echo "Prototype: $try" ;;
12439 *) case "$usethreads" in
12440 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
12442 d_getprotobyname_r=undef
12443 getprotobyname_r_proto=0
12447 *) getprotobyname_r_proto=0
12451 : see if getprotobynumber_r exists
12452 set getprotobynumber_r d_getprotobynumber_r
12454 case "$d_getprotobynumber_r" in
12456 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12459 hdrs="$hdrs $i_systime sys/time.h"
12462 case "$d_getprotobynumber_r_proto:$usethreads" in
12463 ":define") d_getprotobynumber_r_proto=define
12464 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
12468 case "$d_getprotobynumber_r_proto" in
12470 case "$getprotobynumber_r_proto" in
12471 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
12472 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
12474 case "$getprotobynumber_r_proto" in
12475 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
12476 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
12478 case "$getprotobynumber_r_proto" in
12479 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
12480 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
12482 case "$getprotobynumber_r_proto" in
12483 ''|0) d_getprotobynumber_r=undef
12484 getprotobynumber_r_proto=0
12485 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
12486 * ) case "$getprotobynumber_r_proto" in
12487 REENTRANT_PROTO*) ;;
12488 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
12490 echo "Prototype: $try" ;;
12493 *) case "$usethreads" in
12494 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
12496 d_getprotobynumber_r=undef
12497 getprotobynumber_r_proto=0
12501 *) getprotobynumber_r_proto=0
12505 : see if getprotoent_r exists
12506 set getprotoent_r d_getprotoent_r
12508 case "$d_getprotoent_r" in
12510 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12513 hdrs="$hdrs $i_systime sys/time.h"
12516 case "$d_getprotoent_r_proto:$usethreads" in
12517 ":define") d_getprotoent_r_proto=define
12518 set d_getprotoent_r_proto getprotoent_r $hdrs
12522 case "$d_getprotoent_r_proto" in
12524 case "$getprotoent_r_proto" in
12525 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
12526 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
12528 case "$getprotoent_r_proto" in
12529 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
12530 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
12532 case "$getprotoent_r_proto" in
12533 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
12534 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
12536 case "$getprotoent_r_proto" in
12537 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
12538 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
12540 case "$getprotoent_r_proto" in
12541 ''|0) d_getprotoent_r=undef
12542 getprotoent_r_proto=0
12543 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
12544 * ) case "$getprotoent_r_proto" in
12545 REENTRANT_PROTO*) ;;
12546 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
12548 echo "Prototype: $try" ;;
12551 *) case "$usethreads" in
12552 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
12554 d_getprotoent_r=undef
12555 getprotoent_r_proto=0
12559 *) getprotoent_r_proto=0
12563 : see if prototypes for various getprotoxxx netdb.h functions are available
12565 set d_getprotoprotos getprotoent $i_netdb netdb.h
12568 : see if getprpwnam exists
12569 set getprpwnam d_getprpwnam
12572 : see if getpwent exists
12573 set getpwent d_getpwent
12576 : see if getpwent_r exists
12577 set getpwent_r d_getpwent_r
12579 case "$d_getpwent_r" in
12581 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12584 hdrs="$hdrs $i_systime sys/time.h"
12587 case "$d_getpwent_r_proto:$usethreads" in
12588 ":define") d_getpwent_r_proto=define
12589 set d_getpwent_r_proto getpwent_r $hdrs
12593 case "$d_getpwent_r_proto" in
12595 case "$getpwent_r_proto" in
12596 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
12597 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
12599 case "$getpwent_r_proto" in
12600 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
12601 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
12603 case "$getpwent_r_proto" in
12604 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
12605 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
12607 case "$getpwent_r_proto" in
12608 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
12609 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
12611 case "$getpwent_r_proto" in
12612 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
12613 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
12615 case "$getpwent_r_proto" in
12616 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
12617 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
12619 case "$getpwent_r_proto" in
12620 ''|0) d_getpwent_r=undef
12622 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
12623 * ) case "$getpwent_r_proto" in
12624 REENTRANT_PROTO*) ;;
12625 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
12627 echo "Prototype: $try" ;;
12630 *) case "$usethreads" in
12631 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
12638 *) getpwent_r_proto=0
12642 : see if getpwnam_r exists
12643 set getpwnam_r d_getpwnam_r
12645 case "$d_getpwnam_r" in
12647 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12650 hdrs="$hdrs $i_systime sys/time.h"
12653 case "$d_getpwnam_r_proto:$usethreads" in
12654 ":define") d_getpwnam_r_proto=define
12655 set d_getpwnam_r_proto getpwnam_r $hdrs
12659 case "$d_getpwnam_r_proto" in
12661 case "$getpwnam_r_proto" in
12662 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
12663 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
12665 case "$getpwnam_r_proto" in
12666 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
12667 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
12669 case "$getpwnam_r_proto" in
12670 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
12671 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
12673 case "$getpwnam_r_proto" in
12674 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
12675 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
12677 case "$getpwnam_r_proto" in
12678 ''|0) d_getpwnam_r=undef
12680 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
12681 * ) case "$getpwnam_r_proto" in
12682 REENTRANT_PROTO*) ;;
12683 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
12685 echo "Prototype: $try" ;;
12688 *) case "$usethreads" in
12689 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
12696 *) getpwnam_r_proto=0
12700 : see if getpwuid_r exists
12701 set getpwuid_r d_getpwuid_r
12703 case "$d_getpwuid_r" in
12705 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12708 hdrs="$hdrs $i_systime sys/time.h"
12711 case "$d_getpwuid_r_proto:$usethreads" in
12712 ":define") d_getpwuid_r_proto=define
12713 set d_getpwuid_r_proto getpwuid_r $hdrs
12717 case "$d_getpwuid_r_proto" in
12719 case "$getpwuid_r_proto" in
12720 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
12721 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
12723 case "$getpwuid_r_proto" in
12724 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
12725 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
12727 case "$getpwuid_r_proto" in
12728 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
12729 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
12731 case "$getpwuid_r_proto" in
12732 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
12733 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
12735 case "$getpwuid_r_proto" in
12736 ''|0) d_getpwuid_r=undef
12738 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
12739 * ) case "$getpwuid_r_proto" in
12740 REENTRANT_PROTO*) ;;
12741 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
12743 echo "Prototype: $try" ;;
12746 *) case "$usethreads" in
12747 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
12754 *) getpwuid_r_proto=0
12759 : see if getservbyname exists
12760 set getservbyname d_getsbyname
12763 : see if getservbyport exists
12764 set getservbyport d_getsbyport
12767 : see if getservent exists
12768 set getservent d_getsent
12771 : see if getservbyname_r exists
12772 set getservbyname_r d_getservbyname_r
12774 case "$d_getservbyname_r" in
12776 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12779 hdrs="$hdrs $i_systime sys/time.h"
12782 case "$d_getservbyname_r_proto:$usethreads" in
12783 ":define") d_getservbyname_r_proto=define
12784 set d_getservbyname_r_proto getservbyname_r $hdrs
12788 case "$d_getservbyname_r_proto" in
12790 case "$getservbyname_r_proto" in
12791 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
12792 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
12794 case "$getservbyname_r_proto" in
12795 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
12796 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
12798 case "$getservbyname_r_proto" in
12799 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
12800 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
12802 case "$getservbyname_r_proto" in
12803 ''|0) d_getservbyname_r=undef
12804 getservbyname_r_proto=0
12805 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
12806 * ) case "$getservbyname_r_proto" in
12807 REENTRANT_PROTO*) ;;
12808 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
12810 echo "Prototype: $try" ;;
12813 *) case "$usethreads" in
12814 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
12816 d_getservbyname_r=undef
12817 getservbyname_r_proto=0
12821 *) getservbyname_r_proto=0
12825 : see if getservbyport_r exists
12826 set getservbyport_r d_getservbyport_r
12828 case "$d_getservbyport_r" in
12830 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12833 hdrs="$hdrs $i_systime sys/time.h"
12836 case "$d_getservbyport_r_proto:$usethreads" in
12837 ":define") d_getservbyport_r_proto=define
12838 set d_getservbyport_r_proto getservbyport_r $hdrs
12842 case "$d_getservbyport_r_proto" in
12844 case "$getservbyport_r_proto" in
12845 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
12846 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
12848 case "$getservbyport_r_proto" in
12849 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
12850 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
12852 case "$getservbyport_r_proto" in
12853 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
12854 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
12856 case "$getservbyport_r_proto" in
12857 ''|0) d_getservbyport_r=undef
12858 getservbyport_r_proto=0
12859 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
12860 * ) case "$getservbyport_r_proto" in
12861 REENTRANT_PROTO*) ;;
12862 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
12864 echo "Prototype: $try" ;;
12867 *) case "$usethreads" in
12868 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
12870 d_getservbyport_r=undef
12871 getservbyport_r_proto=0
12875 *) getservbyport_r_proto=0
12879 : see if getservent_r exists
12880 set getservent_r d_getservent_r
12882 case "$d_getservent_r" in
12884 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12887 hdrs="$hdrs $i_systime sys/time.h"
12890 case "$d_getservent_r_proto:$usethreads" in
12891 ":define") d_getservent_r_proto=define
12892 set d_getservent_r_proto getservent_r $hdrs
12896 case "$d_getservent_r_proto" in
12898 case "$getservent_r_proto" in
12899 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
12900 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
12902 case "$getservent_r_proto" in
12903 ''|0) try='int getservent_r(struct servent*, char*, int);'
12904 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
12906 case "$getservent_r_proto" in
12907 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
12908 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
12910 case "$getservent_r_proto" in
12911 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
12912 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
12914 case "$getservent_r_proto" in
12915 ''|0) d_getservent_r=undef
12916 getservent_r_proto=0
12917 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
12918 * ) case "$getservent_r_proto" in
12919 REENTRANT_PROTO*) ;;
12920 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
12922 echo "Prototype: $try" ;;
12925 *) case "$usethreads" in
12926 define) echo "getservent_r has no prototype, not using it." >&4 ;;
12928 d_getservent_r=undef
12929 getservent_r_proto=0
12933 *) getservent_r_proto=0
12937 : see if prototypes for various getservxxx netdb.h functions are available
12939 set d_getservprotos getservent $i_netdb netdb.h
12942 : see if getspnam exists
12943 set getspnam d_getspnam
12946 : see if this is a shadow.h system
12947 set shadow.h i_shadow
12950 : see if getspnam_r exists
12951 set getspnam_r d_getspnam_r
12953 case "$d_getspnam_r" in
12955 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
12958 hdrs="$hdrs $i_systime sys/time.h"
12961 case "$d_getspnam_r_proto:$usethreads" in
12962 ":define") d_getspnam_r_proto=define
12963 set d_getspnam_r_proto getspnam_r $hdrs
12967 case "$d_getspnam_r_proto" in
12969 case "$getspnam_r_proto" in
12970 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
12971 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
12973 case "$getspnam_r_proto" in
12974 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
12975 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
12977 case "$getspnam_r_proto" in
12978 ''|0) d_getspnam_r=undef
12980 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
12981 * ) case "$getspnam_r_proto" in
12982 REENTRANT_PROTO*) ;;
12983 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
12985 echo "Prototype: $try" ;;
12988 *) case "$usethreads" in
12989 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
12996 *) getspnam_r_proto=0
13000 : see if gettimeofday or ftime exists
13001 set gettimeofday d_gettimeod
13003 case "$d_gettimeod" in
13009 val="$undef"; set d_ftime; eval $setvar
13012 case "$d_gettimeod$d_ftime" in
13015 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13019 : see if gmtime_r exists
13020 set gmtime_r d_gmtime_r
13022 case "$d_gmtime_r" in
13024 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h"
13027 hdrs="$hdrs $i_systime sys/time.h"
13030 case "$d_gmtime_r_proto:$usethreads" in
13031 ":define") d_gmtime_r_proto=define
13032 set d_gmtime_r_proto gmtime_r $hdrs
13036 case "$d_gmtime_r_proto" in
13038 case "$gmtime_r_proto" in
13039 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13040 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13042 case "$gmtime_r_proto" in
13043 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13044 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13046 case "$gmtime_r_proto" in
13047 ''|0) d_gmtime_r=undef
13049 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13050 * ) case "$gmtime_r_proto" in
13051 REENTRANT_PROTO*) ;;
13052 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13054 echo "Prototype: $try" ;;
13057 *) case "$usethreads" in
13058 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13065 *) gmtime_r_proto=0
13069 : see if hasmntopt exists
13070 set hasmntopt d_hasmntopt
13073 : see if this is a netinet/in.h or sys/in.h system
13074 set netinet/in.h i_niin sys/in.h i_sysin
13077 : see if arpa/inet.h has to be included
13078 set arpa/inet.h i_arpainet
13081 : see if htonl --and friends-- exists
13086 : Maybe they are macros.
13089 $cat >htonl.c <<EOM
13091 #include <sys/types.h>
13092 #$i_niin I_NETINET_IN
13094 #$i_arpainet I_ARPA_INET
13095 #ifdef I_NETINET_IN
13096 #include <netinet/in.h>
13099 #include <sys/in.h>
13102 #include <arpa/inet.h>
13105 printf("Defined as a macro.");
13108 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
13109 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
13111 echo "But it seems to be defined as a macro." >&4
13121 if set index val -f; eval $csym; $val; then
13122 if set strchr val -f d_strchr; eval $csym; $val; then
13123 if $contains strchr "$strings" >/dev/null 2>&1 ; then
13126 echo "strchr() found." >&4
13130 echo "index() found." >&4
13135 echo "index() found." >&4
13138 if set strchr val -f d_strchr; eval $csym; $val; then
13141 echo "strchr() found." >&4
13143 echo "No index() or strchr() found!" >&4
13148 set d_strchr; eval $setvar
13150 set d_index; eval $setvar
13152 : check whether inet_aton exists
13153 set inet_aton d_inetaton
13158 $cat >isascii.c <<'EOCP'
13170 if eval $compile; then
13171 echo "isascii() found." >&4
13174 echo "isascii() NOT found." >&4
13181 : see if isfinite exists
13182 set isfinite d_isfinite
13185 : see if isinf exists
13189 : see if isnan exists
13193 : see if isnanl exists
13194 set isnanl d_isnanl
13197 : see if killpg exists
13198 set killpg d_killpg
13201 : see if lchown exists
13203 $cat > try.c <<'EOCP'
13204 /* System header to define __stub macros and hopefully few prototypes,
13205 which can conflict with char lchown(); below. */
13206 #include <assert.h>
13207 /* Override any gcc2 internal prototype to avoid an error. */
13208 /* We use char because int might match the return type of a gcc2
13209 builtin and then its argument prototype would still apply. */
13212 /* The GNU C library defines this for functions which it implements
13213 to always fail with ENOSYS. Some functions are actually named
13214 something starting with __ and the normal name is an alias. */
13215 #if defined (__stub_lchown) || defined (__stub___lchown)
13223 if eval $compile; then
13224 $echo "lchown() found." >&4
13227 $echo "lchown() NOT found." >&4
13233 : See if number of significant digits in a double precision number is known
13235 $cat >ldbl_dig.c <<EOM
13236 #$i_limits I_LIMITS
13239 #include <limits.h>
13245 printf("Contains LDBL_DIG");
13248 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
13249 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
13250 echo "LDBL_DIG found." >&4
13253 echo "LDBL_DIG NOT found." >&4
13260 : see if link exists
13264 : see if localtime_r exists
13265 set localtime_r d_localtime_r
13267 case "$d_localtime_r" in
13269 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h"
13272 hdrs="$hdrs $i_systime sys/time.h"
13275 case "$d_localtime_r_proto:$usethreads" in
13276 ":define") d_localtime_r_proto=define
13277 set d_localtime_r_proto localtime_r $hdrs
13281 case "$d_localtime_r_proto" in
13283 case "$localtime_r_proto" in
13284 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
13285 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
13287 case "$localtime_r_proto" in
13288 ''|0) try='int localtime_r(const time_t*, struct tm*);'
13289 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
13291 case "$localtime_r_proto" in
13292 ''|0) d_localtime_r=undef
13293 localtime_r_proto=0
13294 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
13295 * ) case "$localtime_r_proto" in
13296 REENTRANT_PROTO*) ;;
13297 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
13299 echo "Prototype: $try" ;;
13302 *) case "$usethreads" in
13303 define) echo "localtime_r has no prototype, not using it." >&4 ;;
13305 d_localtime_r=undef
13306 localtime_r_proto=0
13310 *) localtime_r_proto=0
13314 : see if localeconv exists
13315 set localeconv d_locconv
13318 : see if lockf exists
13322 : see if prototype for lseek is available
13324 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
13327 : see if lstat exists
13331 : see if madvise exists
13332 set madvise d_madvise
13335 : see if mblen exists
13339 : see if mbstowcs exists
13340 set mbstowcs d_mbstowcs
13343 : see if mbtowc exists
13344 set mbtowc d_mbtowc
13347 : see if memchr exists
13348 set memchr d_memchr
13351 : see if memcmp exists
13352 set memcmp d_memcmp
13355 : see if memcpy exists
13356 set memcpy d_memcpy
13359 : see if memmove exists
13360 set memmove d_memmove
13363 : see if memset exists
13364 set memset d_memset
13367 : see if mkdir exists
13371 : see if mkdtemp exists
13372 set mkdtemp d_mkdtemp
13375 : see if mkfifo exists
13376 set mkfifo d_mkfifo
13379 : see if mkstemp exists
13380 set mkstemp d_mkstemp
13383 : see if mkstemps exists
13384 set mkstemps d_mkstemps
13387 : see if mktime exists
13388 set mktime d_mktime
13391 : see if this is a sys/mman.h system
13392 set sys/mman.h i_sysmman
13395 : see if mmap exists
13398 : see what shmat returns
13399 : default to something harmless
13401 case "$i_sysmman$d_mmap" in
13403 $cat >mmap.c <<'END'
13404 #include <sys/mman.h>
13407 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
13412 echo "and it returns ($mmaptype)." >&4
13418 : see if mprotect exists
13419 set mprotect d_mprotect
13422 : see if msgctl exists
13423 set msgctl d_msgctl
13426 : see if msgget exists
13427 set msgget d_msgget
13430 : see if msgsnd exists
13431 set msgsnd d_msgsnd
13434 : see if msgrcv exists
13435 set msgrcv d_msgrcv
13438 : see how much of the 'msg*(2)' library is present.
13441 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
13442 *"$undef"*) h_msg=false;;
13446 case "`ipcs 2>&1`" in
13447 "SVID messages"*"not configured"*)
13448 echo "Your $osname does not have the msg*(2) configured." >&4
13451 set msgctl d_msgctl
13453 set msgget d_msgget
13455 set msgsnd d_msgsnd
13457 set msgrcv d_msgrcv
13463 : we could also check for sys/ipc.h ...
13464 if $h_msg && $test `./findhdr sys/msg.h`; then
13465 echo "You have the full msg*(2) library." >&4
13468 echo "You don't have the full msg*(2) library." >&4
13476 echo "Checking to see if your system supports struct msghdr..." >&4
13477 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
13479 case "$d_msghdr_s" in
13480 "$define") echo "Yes, it does." ;;
13481 *) echo "No, it doesn't." ;;
13485 : see if msync exists
13489 : see if munmap exists
13490 set munmap d_munmap
13493 : see if nice exists
13497 : see if this is a langinfo.h system
13498 set langinfo.h i_langinfo
13501 : see if nl_langinfo exists
13502 set nl_langinfo d_nl_langinfo
13505 : check for length of character
13507 case "$charsize" in
13509 echo "Checking to see how big your characters are (hey, you never know)..." >&4
13510 $cat >try.c <<'EOCP'
13514 printf("%d\n", (int)sizeof(char));
13519 if eval $compile_ok; then
13523 echo "(I can't seem to compile the test program. Guessing...)"
13530 rp="What is the size of a character (in bytes)?"
13535 : check for volatile keyword
13537 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
13538 $cat >try.c <<'EOCP'
13541 typedef struct _goo_struct goo_struct;
13542 goo_struct * volatile goo = ((goo_struct *)0);
13543 struct _goo_struct {
13548 typedef unsigned short foo_t;
13549 char *volatile foo;
13551 volatile foo_t blech;
13555 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
13557 echo "Yup, it does."
13560 echo "Nope, it doesn't."
13568 $echo "Choosing the C types to be used for Perl's internal types..." >&4
13570 case "$use64bitint:$d_quad:$quadtype" in
13573 uvtype="$uquadtype"
13578 uvtype="unsigned long"
13584 case "$uselongdouble:$d_longdbl" in
13586 nvtype="long double"
13587 nvsize=$longdblsize
13594 $echo "(IV will be "$ivtype", $ivsize bytes)"
13595 $echo "(UV will be "$uvtype", $uvsize bytes)"
13596 $echo "(NV will be "$nvtype", $nvsize bytes)"
13599 #$i_inttypes I_INTTYPES
13601 #include <inttypes.h>
13606 int8_t i = INT8_MAX;
13607 uint8_t u = UINT8_MAX;
13608 printf("int8_t\n");
13611 int16_t i = INT16_MAX;
13612 uint16_t i = UINT16_MAX;
13613 printf("int16_t\n");
13616 int32_t i = INT32_MAX;
13617 uint32_t u = UINT32_MAX;
13618 printf("int32_t\n");
13624 '') case "$charsize" in
13626 u8type="unsigned char"
13635 if eval $compile; then
13636 case "`$run ./try`" in
13637 int8_t) i8type=int8_t
13647 '') if $test $charsize -ge 1; then
13649 u8type="unsigned char"
13657 '') case "$shortsize" in
13659 u16type="unsigned short"
13667 '') set try -DINT16
13668 if eval $compile; then
13669 case "`$run ./try`" in
13681 '') if $test $shortsize -ge 2; then
13683 u16type="unsigned short"
13691 '') case "$longsize" in
13693 u32type="unsigned long"
13697 *) case "$intsize" in
13699 u32type="unsigned int"
13709 '') set try -DINT32
13710 if eval $compile; then
13711 case "`$run ./try`" in
13723 '') if $test $intsize -ge 4; then
13725 u32type="unsigned int"
13733 '') case "$d_quad:$quadtype" in
13735 i64type="$quadtype"
13736 u64type="$uquadtype"
13744 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
13745 : volatile so that the compiler has to store it out to memory.
13746 if test X"$d_volatile" = X"$define"; then
13751 #include <sys/types.h>
13752 #include <signal.h>
13754 $volatile int bletched = 0;
13755 $signal_t blech(s) int s; { bletched = 1; }
13760 int n = 8 * $uvsize;
13763 signal(SIGFPE, blech);
13766 for (i = 0; i < n; i++) {
13767 u = u << 1 | ($uvtype)1;
13769 if (($uvtype)d != u)
13773 d = ($nvtype)(u - 1);
13774 if (($uvtype)d != (u - 1))
13782 printf("%d\n", ((i == n) ? -n : i));
13788 d_nv_preserves_uv="$undef"
13789 if eval $compile; then
13790 nv_preserves_uv_bits="`$run ./try`"
13792 case "$nv_preserves_uv_bits" in
13794 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
13795 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
13796 d_nv_preserves_uv="$define"
13798 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
13799 d_nv_preserves_uv="$undef" ;;
13800 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
13801 nv_preserves_uv_bits="$undef" ;;
13807 : check for off64_t
13809 echo "Checking to see if you have off64_t..." >&4
13811 #include <sys/types.h>
13812 #include <unistd.h>
13813 int main() { off64_t x = 7; }
13816 if eval $compile; then
13818 echo "You have off64_t."
13821 echo "You do not have off64_t."
13822 case "$lseeksize" in
13823 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
13830 : how to create joinable pthreads
13831 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
13833 echo "Checking what constant to use for creating joinable pthreads..." >&4
13834 $cat >try.c <<'EOCP'
13835 #include <pthread.h>
13837 int detachstate = JOINABLE;
13840 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
13841 if eval $compile; then
13842 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
13843 val="$undef" # Yes, undef.
13844 set d_old_pthread_create_joinable
13847 set old_pthread_create_joinable
13850 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
13851 if eval $compile; then
13852 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
13854 set d_old_pthread_create_joinable
13856 val=PTHREAD_CREATE_UNDETACHED
13857 set old_pthread_create_joinable
13860 set try -DJOINABLE=__UNDETACHED
13861 if eval $compile; then
13862 echo "You seem to use __UNDETACHED." >&4
13864 set d_old_pthread_create_joinable
13867 set old_pthread_create_joinable
13870 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
13872 set d_old_pthread_create_joinable
13875 set old_pthread_create_joinable
13882 d_old_pthread_create_joinable="$undef"
13883 old_pthread_create_joinable=""
13886 : see if pause exists
13890 : see if pipe exists
13894 : see if poll exists
13898 : see if readlink exists
13899 set readlink d_readlink
13905 case "$d_readlink" in
13907 if $issymlink /proc/self/exe ; then
13908 $ls -l /proc/self/exe > reflect
13909 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
13910 echo "You have Linux-like /proc/self/exe."
13911 procselfexe='"/proc/self/exe"'
13915 if $issymlink /proc/curproc/file ; then
13916 $ls -l /proc/curproc/file > reflect
13917 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
13918 echo "You have BSD-like /proc/curproc/file."
13919 procselfexe='"/proc/curproc/file"'
13929 : see whether the pthread_atfork exists
13931 #include <pthread.h>
13934 #ifdef PTHREAD_ATFORK
13935 pthread_atfork(NULL,NULL,NULL);
13940 : see if pthread_atfork exists
13941 set try -DPTHREAD_ATFORK
13942 if eval $compile; then
13947 case "$usethreads" in
13950 $define) echo 'pthread_atfork found.' >&4 ;;
13951 *) echo 'pthread_atfork NOT found.' >&4 ;;
13954 set d_pthread_atfork
13958 : see whether the various POSIXish _yields exist
13960 #include <pthread.h>
13966 #ifdef PTHREAD_YIELD
13969 #ifdef PTHREAD_YIELD_NULL
13970 pthread_yield(NULL);
13976 : see if sched_yield exists
13977 set try -DSCHED_YIELD
13978 if eval $compile; then
13980 sched_yield='sched_yield()'
13984 case "$usethreads" in
13987 $define) echo 'sched_yield() found.' >&4 ;;
13988 *) echo 'sched_yield() NOT found.' >&4 ;;
13994 : see if pthread_yield exists
13995 set try -DPTHREAD_YIELD
13996 if eval $compile; then
13998 case "$sched_yield" in
13999 '') sched_yield='pthread_yield()' ;;
14002 set try -DPTHREAD_YIELD_NULL
14003 if eval $compile; then
14005 case "$sched_yield" in
14006 '') sched_yield='pthread_yield(NULL)' ;;
14012 case "$usethreads" in
14015 $define) echo 'pthread_yield() found.' >&4 ;;
14016 *) echo 'pthread_yield() NOT found.' >&4 ;;
14020 set d_pthread_yield
14023 case "$sched_yield" in
14024 '') sched_yield=undef ;;
14029 : see if random_r exists
14030 set random_r d_random_r
14032 case "$d_random_r" in
14034 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
14037 hdrs="$hdrs $i_systime sys/time.h"
14040 case "$d_random_r_proto:$usethreads" in
14041 ":define") d_random_r_proto=define
14042 set d_random_r_proto random_r $hdrs
14046 case "$d_random_r_proto" in
14048 case "$random_r_proto" in
14049 ''|0) try='int random_r(int*, struct random_data*);'
14050 ./protochk "extern $try" $hdrs && random_r_proto=I_TS ;;
14052 case "$random_r_proto" in
14053 ''|0) d_random_r=undef
14055 echo "Disabling random_r, cannot determine prototype." >&4 ;;
14056 * ) case "$random_r_proto" in
14057 REENTRANT_PROTO*) ;;
14058 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
14060 echo "Prototype: $try" ;;
14063 *) case "$usethreads" in
14064 define) echo "random_r has no prototype, not using it." >&4 ;;
14071 *) random_r_proto=0
14075 : see if readdir and friends exist
14076 set readdir d_readdir
14078 set seekdir d_seekdir
14080 set telldir d_telldir
14082 set rewinddir d_rewinddir
14085 : see if readdir64_r exists
14086 set readdir64_r d_readdir64_r
14088 case "$d_readdir64_r" in
14090 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
14093 hdrs="$hdrs $i_systime sys/time.h"
14096 case "$d_readdir64_r_proto:$usethreads" in
14097 ":define") d_readdir64_r_proto=define
14098 set d_readdir64_r_proto readdir64_r $hdrs
14102 case "$d_readdir64_r_proto" in
14104 case "$readdir64_r_proto" in
14105 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
14106 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
14108 case "$readdir64_r_proto" in
14109 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
14110 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
14112 case "$readdir64_r_proto" in
14113 ''|0) d_readdir64_r=undef
14114 readdir64_r_proto=0
14115 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
14116 * ) case "$readdir64_r_proto" in
14117 REENTRANT_PROTO*) ;;
14118 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
14120 echo "Prototype: $try" ;;
14123 *) case "$usethreads" in
14124 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
14126 d_readdir64_r=undef
14127 readdir64_r_proto=0
14131 *) readdir64_r_proto=0
14135 : see if readdir_r exists
14136 set readdir_r d_readdir_r
14138 case "$d_readdir_r" in
14140 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
14143 hdrs="$hdrs $i_systime sys/time.h"
14146 case "$d_readdir_r_proto:$usethreads" in
14147 ":define") d_readdir_r_proto=define
14148 set d_readdir_r_proto readdir_r $hdrs
14152 case "$d_readdir_r_proto" in
14154 case "$readdir_r_proto" in
14155 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
14156 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
14158 case "$readdir_r_proto" in
14159 ''|0) try='int readdir_r(DIR*, struct dirent*);'
14160 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
14162 case "$readdir_r_proto" in
14163 ''|0) d_readdir_r=undef
14165 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
14166 * ) case "$readdir_r_proto" in
14167 REENTRANT_PROTO*) ;;
14168 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
14170 echo "Prototype: $try" ;;
14173 *) case "$usethreads" in
14174 define) echo "readdir_r has no prototype, not using it." >&4 ;;
14181 *) readdir_r_proto=0
14185 : see if readv exists
14189 : see if recvmsg exists
14190 set recvmsg d_recvmsg
14193 : see if rename exists
14194 set rename d_rename
14197 : see if rmdir exists
14201 : see if memory.h is available.
14206 : See if it conflicts with string.h
14212 $cppstdin $cppflags $cppminus < $strings > mem.h
14213 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
14215 echo "We won't be including <memory.h>."
14225 : can bcopy handle overlapping blocks?
14228 case "$d_memmove" in
14229 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
14230 *) case "$d_bcopy" in
14232 echo "Checking to see if bcopy() can do overlapping copies..." >&4
14234 #$i_memory I_MEMORY
14235 #$i_stdlib I_STDLIB
14236 #$i_string I_STRING
14237 #$i_unistd I_UNISTD
14239 $cat >>try.c <<'EOCP'
14242 # include <memory.h>
14245 # include <stdlib.h>
14248 # include <string.h>
14250 # include <strings.h>
14253 # include <unistd.h> /* Needed for NetBSD */
14257 char buf[128], abc[128];
14263 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14264 try to store the string in read-only memory. */
14265 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
14267 for (align = 7; align >= 0; align--) {
14268 for (len = 36; len; len--) {
14270 bcopy(abc, b, len);
14271 for (off = 1; off <= len; off++) {
14272 bcopy(b, b+off, len);
14273 bcopy(b+off, b, len);
14274 if (bcmp(b, abc, len))
14283 if eval $compile_ok; then
14284 if ./try 2>/dev/null; then
14285 echo "Yes, it can."
14288 echo "It can't, sorry."
14291 echo "(I can't compile the test program, so we'll assume not...)"
14295 $rm -f try.* try core
14301 : can memcpy handle overlapping blocks?
14304 case "$d_memmove" in
14305 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
14306 *) case "$d_memcpy" in
14308 echo "Checking to see if memcpy() can do overlapping copies..." >&4
14310 #$i_memory I_MEMORY
14311 #$i_stdlib I_STDLIB
14312 #$i_string I_STRING
14313 #$i_unistd I_UNISTD
14315 $cat >>try.c <<'EOCP'
14318 # include <memory.h>
14321 # include <stdlib.h>
14324 # include <string.h>
14326 # include <strings.h>
14329 # include <unistd.h> /* Needed for NetBSD */
14333 char buf[128], abc[128];
14339 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14340 try to store the string in read-only memory. */
14341 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
14343 for (align = 7; align >= 0; align--) {
14344 for (len = 36; len; len--) {
14346 memcpy(b, abc, len);
14347 for (off = 1; off <= len; off++) {
14348 memcpy(b+off, b, len);
14349 memcpy(b, b+off, len);
14350 if (memcmp(b, abc, len))
14359 if eval $compile_ok; then
14360 if ./try 2>/dev/null; then
14361 echo "Yes, it can."
14364 echo "It can't, sorry."
14367 echo "(I can't compile the test program, so we'll assume not...)"
14371 $rm -f try.* try core
14377 : can memcmp be trusted to compare relative magnitude?
14379 case "$d_memcmp" in
14382 echo "Checking if your memcmp() can compare relative magnitude..." >&4
14384 #$i_memory I_MEMORY
14385 #$i_stdlib I_STDLIB
14386 #$i_string I_STRING
14387 #$i_unistd I_UNISTD
14389 $cat >>try.c <<'EOCP'
14392 # include <memory.h>
14395 # include <stdlib.h>
14398 # include <string.h>
14400 # include <strings.h>
14403 # include <unistd.h> /* Needed for NetBSD */
14409 if ((a < b) && memcmp(&a, &b, 1) < 0)
14415 if eval $compile_ok; then
14416 if $run ./try 2>/dev/null; then
14417 echo "Yes, it can."
14420 echo "No, it can't (it uses signed chars)."
14423 echo "(I can't compile the test program, so we'll assume not...)"
14427 $rm -f try.* try core
14431 : see if prototype for sbrk is available
14433 set d_sbrkproto sbrk $i_unistd unistd.h
14436 : see if select exists
14437 set select d_select
14440 : see if semctl exists
14441 set semctl d_semctl
14444 : see if semget exists
14445 set semget d_semget
14448 : see if semop exists
14452 : see how much of the 'sem*(2)' library is present.
14455 case "$d_semctl$d_semget$d_semop" in
14456 *"$undef"*) h_sem=false;;
14460 case "`ipcs 2>&1`" in
14461 "SVID messages"*"not configured"*)
14462 echo "Your $osname does not have the sem*(2) configured." >&4
14465 set semctl d_semctl
14467 set semget d_semget
14475 : we could also check for sys/ipc.h ...
14476 if $h_sem && $test `./findhdr sys/sem.h`; then
14477 echo "You have the full sem*(2) library." >&4
14480 echo "You don't have the full sem*(2) library." >&4
14486 : see whether sys/sem.h defines union semun
14488 $cat > try.c <<'END'
14489 #include <sys/types.h>
14490 #include <sys/ipc.h>
14491 #include <sys/sem.h>
14492 int main () { union semun semun; semun.buf = 0; }
14495 if eval $compile; then
14496 echo "You have union semun in <sys/sem.h>." >&4
14499 echo "You do not have union semun in <sys/sem.h>." >&4
14502 $rm -f try try.c try.h
14506 : see how to do semctl IPC_STAT
14509 : see whether semctl IPC_STAT can use union semun
14514 # define S_IRUSR S_IREAD
14515 # define S_IWUSR S_IWRITE
14516 # define S_IXUSR S_IEXEC
14518 # define S_IRUSR 0400
14519 # define S_IWUSR 0200
14520 # define S_IXUSR 0100
14522 # define S_IRGRP (S_IRUSR>>3)
14523 # define S_IWGRP (S_IWUSR>>3)
14524 # define S_IXGRP (S_IXUSR>>3)
14525 # define S_IROTH (S_IRUSR>>6)
14526 # define S_IWOTH (S_IWUSR>>6)
14527 # define S_IXOTH (S_IXUSR>>6)
14530 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
14531 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
14532 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
14537 #include <sys/types.h>
14538 #include <sys/ipc.h>
14539 #include <sys/sem.h>
14540 #include <sys/stat.h>
14547 #$d_union_semun HAS_UNION_SEMUN
14550 #ifndef HAS_UNION_SEMUN
14553 struct semid_ds *buf;
14554 unsigned short *array;
14560 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14561 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14563 struct semid_ds argbuf;
14566 st = semctl(sem, 0, IPC_STAT, arg);
14570 # endif /* IPC_STAT */
14571 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14573 if (semctl(sem, 0, IPC_RMID, arg) != 0)
14574 # endif /* IPC_RMID */
14575 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14577 #endif /* IPC_PRIVATE && ... */
14578 printf("semget failed: errno = %d\n", errno);
14584 if eval $compile; then
14587 semun) val="$define" ;;
14593 case "$d_semctl_semun" in
14595 echo "You can use union semun for semctl IPC_STAT." >&4
14598 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
14603 : see whether semctl IPC_STAT can use struct semid_ds pointer
14604 $cat > try.c <<'END'
14605 #include <sys/types.h>
14606 #include <sys/ipc.h>
14607 #include <sys/sem.h>
14608 #include <sys/stat.h>
14616 struct semid_ds arg;
14619 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14620 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14623 st = semctl(sem, 0, IPC_STAT, &arg);
14625 printf("semid_ds\n");
14627 # endif /* IPC_STAT */
14628 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14630 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
14631 # endif /* IPC_RMID */
14632 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14634 #endif /* IPC_PRIVATE && ... */
14635 printf("semget failed: errno = %d\n", errno);
14642 if eval $compile; then
14645 semid_ds) val="$define" ;;
14649 set d_semctl_semid_ds
14651 case "$d_semctl_semid_ds" in
14653 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
14655 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
14662 # We do not have the full sem*(2) library, so assume we can not
14668 set d_semctl_semid_ds
14673 : see if sendmsg exists
14674 set sendmsg d_sendmsg
14677 : see if setegid exists
14678 set setegid d_setegid
14681 : see if seteuid exists
14682 set seteuid d_seteuid
14685 : see if setgrent exists
14686 set setgrent d_setgrent
14689 : see if setgrent_r exists
14690 set setgrent_r d_setgrent_r
14692 case "$d_setgrent_r" in
14694 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14697 hdrs="$hdrs $i_systime sys/time.h"
14700 case "$d_setgrent_r_proto:$usethreads" in
14701 ":define") d_setgrent_r_proto=define
14702 set d_setgrent_r_proto setgrent_r $hdrs
14706 case "$d_setgrent_r_proto" in
14708 case "$setgrent_r_proto" in
14709 ''|0) try='int setgrent_r(FILE**);'
14710 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
14712 case "$setgrent_r_proto" in
14713 ''|0) try='void setgrent_r(FILE**);'
14714 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
14716 case "$setgrent_r_proto" in
14717 ''|0) d_setgrent_r=undef
14719 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
14720 * ) case "$setgrent_r_proto" in
14721 REENTRANT_PROTO*) ;;
14722 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
14724 echo "Prototype: $try" ;;
14727 *) case "$usethreads" in
14728 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
14735 *) setgrent_r_proto=0
14739 : see if sethostent exists
14740 set sethostent d_sethent
14743 : see if sethostent_r exists
14744 set sethostent_r d_sethostent_r
14746 case "$d_sethostent_r" in
14748 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14751 hdrs="$hdrs $i_systime sys/time.h"
14754 case "$d_sethostent_r_proto:$usethreads" in
14755 ":define") d_sethostent_r_proto=define
14756 set d_sethostent_r_proto sethostent_r $hdrs
14760 case "$d_sethostent_r_proto" in
14762 case "$sethostent_r_proto" in
14763 ''|0) try='int sethostent_r(int, struct hostent_data*);'
14764 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
14766 case "$sethostent_r_proto" in
14767 ''|0) try='void sethostent_r(int, struct hostent_data*);'
14768 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
14770 case "$sethostent_r_proto" in
14771 ''|0) d_sethostent_r=undef
14772 sethostent_r_proto=0
14773 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
14774 * ) case "$sethostent_r_proto" in
14775 REENTRANT_PROTO*) ;;
14776 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
14778 echo "Prototype: $try" ;;
14781 *) case "$usethreads" in
14782 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
14784 d_sethostent_r=undef
14785 sethostent_r_proto=0
14789 *) sethostent_r_proto=0
14793 : see if setitimer exists
14794 set setitimer d_setitimer
14797 : see if setlinebuf exists
14798 set setlinebuf d_setlinebuf
14801 : see if setlocale exists
14802 set setlocale d_setlocale
14805 : see if locale.h is available
14806 set locale.h i_locale
14809 : see if setlocale_r exists
14810 set setlocale_r d_setlocale_r
14812 case "$d_setlocale_r" in
14814 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
14817 hdrs="$hdrs $i_systime sys/time.h"
14820 case "$d_setlocale_r_proto:$usethreads" in
14821 ":define") d_setlocale_r_proto=define
14822 set d_setlocale_r_proto setlocale_r $hdrs
14826 case "$d_setlocale_r_proto" in
14828 case "$setlocale_r_proto" in
14829 ''|0) try='int setlocale_r(int, const char*, char*, int);'
14830 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
14832 case "$setlocale_r_proto" in
14833 ''|0) d_setlocale_r=undef
14834 setlocale_r_proto=0
14835 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
14836 * ) case "$setlocale_r_proto" in
14837 REENTRANT_PROTO*) ;;
14838 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
14840 echo "Prototype: $try" ;;
14843 *) case "$usethreads" in
14844 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
14846 d_setlocale_r=undef
14847 setlocale_r_proto=0
14851 *) setlocale_r_proto=0
14855 : see if setnetent exists
14856 set setnetent d_setnent
14859 : see if setnetent_r exists
14860 set setnetent_r d_setnetent_r
14862 case "$d_setnetent_r" in
14864 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14867 hdrs="$hdrs $i_systime sys/time.h"
14870 case "$d_setnetent_r_proto:$usethreads" in
14871 ":define") d_setnetent_r_proto=define
14872 set d_setnetent_r_proto setnetent_r $hdrs
14876 case "$d_setnetent_r_proto" in
14878 case "$setnetent_r_proto" in
14879 ''|0) try='int setnetent_r(int, struct netent_data*);'
14880 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
14882 case "$setnetent_r_proto" in
14883 ''|0) try='void setnetent_r(int, struct netent_data*);'
14884 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
14886 case "$setnetent_r_proto" in
14887 ''|0) d_setnetent_r=undef
14888 setnetent_r_proto=0
14889 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
14890 * ) case "$setnetent_r_proto" in
14891 REENTRANT_PROTO*) ;;
14892 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
14894 echo "Prototype: $try" ;;
14897 *) case "$usethreads" in
14898 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
14900 d_setnetent_r=undef
14901 setnetent_r_proto=0
14905 *) setnetent_r_proto=0
14909 : see if setprotoent exists
14910 set setprotoent d_setpent
14913 : see if setpgid exists
14914 set setpgid d_setpgid
14917 : see if setpgrp2 exists
14918 set setpgrp2 d_setpgrp2
14921 : see if setpriority exists
14922 set setpriority d_setprior
14925 : see if setproctitle exists
14926 set setproctitle d_setproctitle
14929 : see if setprotoent_r exists
14930 set setprotoent_r d_setprotoent_r
14932 case "$d_setprotoent_r" in
14934 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14937 hdrs="$hdrs $i_systime sys/time.h"
14940 case "$d_setprotoent_r_proto:$usethreads" in
14941 ":define") d_setprotoent_r_proto=define
14942 set d_setprotoent_r_proto setprotoent_r $hdrs
14946 case "$d_setprotoent_r_proto" in
14948 case "$setprotoent_r_proto" in
14949 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
14950 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
14952 case "$setprotoent_r_proto" in
14953 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
14954 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
14956 case "$setprotoent_r_proto" in
14957 ''|0) d_setprotoent_r=undef
14958 setprotoent_r_proto=0
14959 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
14960 * ) case "$setprotoent_r_proto" in
14961 REENTRANT_PROTO*) ;;
14962 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
14964 echo "Prototype: $try" ;;
14967 *) case "$usethreads" in
14968 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
14970 d_setprotoent_r=undef
14971 setprotoent_r_proto=0
14975 *) setprotoent_r_proto=0
14979 : see if setpwent exists
14980 set setpwent d_setpwent
14983 : see if setpwent_r exists
14984 set setpwent_r d_setpwent_r
14986 case "$d_setpwent_r" in
14988 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14991 hdrs="$hdrs $i_systime sys/time.h"
14994 case "$d_setpwent_r_proto:$usethreads" in
14995 ":define") d_setpwent_r_proto=define
14996 set d_setpwent_r_proto setpwent_r $hdrs
15000 case "$d_setpwent_r_proto" in
15002 case "$setpwent_r_proto" in
15003 ''|0) try='int setpwent_r(FILE**);'
15004 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
15006 case "$setpwent_r_proto" in
15007 ''|0) try='void setpwent_r(FILE**);'
15008 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
15010 case "$setpwent_r_proto" in
15011 ''|0) d_setpwent_r=undef
15013 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
15014 * ) case "$setpwent_r_proto" in
15015 REENTRANT_PROTO*) ;;
15016 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
15018 echo "Prototype: $try" ;;
15021 *) case "$usethreads" in
15022 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
15029 *) setpwent_r_proto=0
15033 : see if setregid exists
15034 set setregid d_setregid
15036 set setresgid d_setresgid
15039 : see if setreuid exists
15040 set setreuid d_setreuid
15042 set setresuid d_setresuid
15045 : see if setrgid exists
15046 set setrgid d_setrgid
15049 : see if setruid exists
15050 set setruid d_setruid
15053 : see if setservent exists
15054 set setservent d_setsent
15057 : see if setservent_r exists
15058 set setservent_r d_setservent_r
15060 case "$d_setservent_r" in
15062 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15065 hdrs="$hdrs $i_systime sys/time.h"
15068 case "$d_setservent_r_proto:$usethreads" in
15069 ":define") d_setservent_r_proto=define
15070 set d_setservent_r_proto setservent_r $hdrs
15074 case "$d_setservent_r_proto" in
15076 case "$setservent_r_proto" in
15077 ''|0) try='int setservent_r(int, struct servent_data*);'
15078 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
15080 case "$setservent_r_proto" in
15081 ''|0) try='void setservent_r(int, struct servent_data*);'
15082 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
15084 case "$setservent_r_proto" in
15085 ''|0) d_setservent_r=undef
15086 setservent_r_proto=0
15087 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
15088 * ) case "$setservent_r_proto" in
15089 REENTRANT_PROTO*) ;;
15090 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
15092 echo "Prototype: $try" ;;
15095 *) case "$usethreads" in
15096 define) echo "setservent_r has no prototype, not using it." >&4 ;;
15098 d_setservent_r=undef
15099 setservent_r_proto=0
15103 *) setservent_r_proto=0
15107 : see if setsid exists
15108 set setsid d_setsid
15111 : see if setvbuf exists
15112 set setvbuf d_setvbuf
15115 : see if sfio.h is available
15120 : see if sfio library is available
15131 : Ok, but do we want to use it.
15135 true|$define|[yY]*) dflt='y';;
15138 echo "$package can use the sfio library, but it is experimental."
15139 case "$useperlio" in
15141 echo "For sfio also the PerlIO abstraction layer is needed."
15142 echo "Earlier you said you wouldn't want that."
15145 rp="You seem to have sfio available, do you want to try using it?"
15148 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
15149 useperlio="$define"
15152 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
15157 *) case "$usesfio" in
15158 true|$define|[yY]*)
15159 echo "Sorry, cannot find sfio on this machine." >&4
15160 echo "Ignoring your setting of usesfio=$usesfio." >&4
15169 $define) usesfio='true';;
15170 *) usesfio='false';;
15174 *) : Remove sfio from list of libraries to use
15177 echo "Removing unneeded -lsfio from library list" >&4
15178 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
15181 echo "libs = $libs" >&4
15188 : see if shmctl exists
15189 set shmctl d_shmctl
15192 : see if shmget exists
15193 set shmget d_shmget
15196 : see if shmat exists
15199 : see what shmat returns
15202 $cat >shmat.c <<'END'
15203 #include <sys/shm.h>
15206 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
15211 echo "and it returns ($shmattype)." >&4
15212 : see if a prototype for shmat is available
15213 xxx=`./findhdr sys/shm.h`
15214 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
15215 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
15226 set d_shmatprototype
15229 : see if shmdt exists
15233 : see how much of the 'shm*(2)' library is present.
15236 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
15237 *"$undef"*) h_shm=false;;
15241 case "`ipcs 2>&1`" in
15242 "SVID shared memory"*"not configured"*)
15243 echo "Your $osname does not have the shm*(2) configured." >&4
15246 set shmctl d_shmctl
15248 set shmget d_shmget
15258 : we could also check for sys/ipc.h ...
15259 if $h_shm && $test `./findhdr sys/shm.h`; then
15260 echo "You have the full shm*(2) library." >&4
15263 echo "You don't have the full shm*(2) library." >&4
15270 : see if we have sigaction
15271 if set sigaction val -f d_sigaction; eval $csym; $val; then
15272 echo 'sigaction() found.' >&4
15273 $cat > try.c <<'EOP'
15275 #include <sys/types.h>
15276 #include <signal.h>
15279 struct sigaction act, oact;
15281 oact.sa_handler = 0;
15282 /* so that act and oact are used */
15283 exit(act.sa_flags == 0 && oact.sa_handler == 0);
15287 if eval $compile_ok; then
15290 echo "But you don't seem to have a useable struct sigaction." >&4
15294 echo 'sigaction NOT found.' >&4
15297 set d_sigaction; eval $setvar
15298 $rm -f try try$_o try.c
15300 : see if sigprocmask exists
15301 set sigprocmask d_sigprocmask
15304 : see if sigsetjmp exists
15306 case "$d_sigsetjmp" in
15308 $cat >try.c <<'EOP'
15309 #include <setjmp.h>
15314 if (sigsetjmp(env,1))
15317 siglongjmp(env, 1);
15322 if eval $compile; then
15323 if $run ./try >/dev/null 2>&1; then
15324 echo "POSIX sigsetjmp found." >&4
15328 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
15334 echo "sigsetjmp not found." >&4
15338 *) val="$d_sigsetjmp"
15339 case "$d_sigsetjmp" in
15340 $define) echo "POSIX sigsetjmp found." >&4;;
15341 $undef) echo "sigsetjmp not found." >&4;;
15349 : see if sockatmark exists
15350 set sockatmark d_sockatmark
15353 : see if prototype for sockatmark is available
15355 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
15358 : see if socks5_init exists
15359 set socks5_init d_socks5_init
15362 : see if srand48_r exists
15363 set srand48_r d_srand48_r
15365 case "$d_srand48_r" in
15367 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15370 hdrs="$hdrs $i_systime sys/time.h"
15373 case "$d_srand48_r_proto:$usethreads" in
15374 ":define") d_srand48_r_proto=define
15375 set d_srand48_r_proto srand48_r $hdrs
15379 case "$d_srand48_r_proto" in
15381 case "$srand48_r_proto" in
15382 ''|0) try='int srand48_r(long, struct drand48_data*);'
15383 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
15385 case "$srand48_r_proto" in
15386 ''|0) d_srand48_r=undef
15388 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
15389 * ) case "$srand48_r_proto" in
15390 REENTRANT_PROTO*) ;;
15391 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
15393 echo "Prototype: $try" ;;
15396 *) case "$usethreads" in
15397 define) echo "srand48_r has no prototype, not using it." >&4 ;;
15404 *) srand48_r_proto=0
15408 : see if srandom_r exists
15409 set srandom_r d_srandom_r
15411 case "$d_srandom_r" in
15413 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15416 hdrs="$hdrs $i_systime sys/time.h"
15419 case "$d_srandom_r_proto:$usethreads" in
15420 ":define") d_srandom_r_proto=define
15421 set d_srandom_r_proto srandom_r $hdrs
15425 case "$d_srandom_r_proto" in
15427 case "$srandom_r_proto" in
15428 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
15429 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
15431 case "$srandom_r_proto" in
15432 ''|0) d_srandom_r=undef
15434 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
15435 * ) case "$srandom_r_proto" in
15436 REENTRANT_PROTO*) ;;
15437 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
15439 echo "Prototype: $try" ;;
15442 *) case "$usethreads" in
15443 define) echo "srandom_r has no prototype, not using it." >&4 ;;
15450 *) srandom_r_proto=0
15454 : see if prototype for setresgid is available
15456 set d_sresgproto setresgid $i_unistd unistd.h
15459 : see if prototype for setresuid is available
15461 set d_sresuproto setresuid $i_unistd unistd.h
15464 : see if sys/stat.h is available
15465 set sys/stat.h i_sysstat
15469 : see if stat knows about block sizes
15471 echo "Checking to see if your struct stat has st_blocks field..." >&4
15472 set d_statblks stat st_blocks $i_sysstat sys/stat.h
15476 : see if this is a sys/vfs.h system
15477 set sys/vfs.h i_sysvfs
15481 : see if this is a sys/statfs.h system
15482 set sys/statfs.h i_sysstatfs
15487 echo "Checking to see if your system supports struct statfs..." >&4
15488 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
15490 case "$d_statfs_s" in
15491 "$define") echo "Yes, it does." ;;
15492 *) echo "No, it doesn't." ;;
15497 : see if struct statfs knows about f_flags
15498 case "$d_statfs_s" in
15501 echo "Checking to see if your struct statfs has f_flags field..." >&4
15502 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
15506 set d_statfs_f_flags
15510 case "$d_statfs_f_flags" in
15511 "$define") echo "Yes, it does." ;;
15512 *) echo "No, it doesn't." ;;
15515 : see if _ptr and _cnt from stdio act std
15518 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
15519 echo "(Looks like you have stdio.h from BSD.)"
15520 case "$stdio_ptr" in
15521 '') stdio_ptr='((fp)->_p)'
15524 *) ptr_lval=$d_stdio_ptr_lval;;
15526 case "$stdio_cnt" in
15527 '') stdio_cnt='((fp)->_r)'
15530 *) cnt_lval=$d_stdio_cnt_lval;;
15532 case "$stdio_base" in
15533 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
15535 case "$stdio_bufsiz" in
15536 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
15538 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
15539 echo "(Looks like you have stdio.h from Linux.)"
15540 case "$stdio_ptr" in
15541 '') stdio_ptr='((fp)->_IO_read_ptr)'
15544 *) ptr_lval=$d_stdio_ptr_lval;;
15546 case "$stdio_cnt" in
15547 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
15550 *) cnt_lval=$d_stdio_cnt_lval;;
15552 case "$stdio_base" in
15553 '') stdio_base='((fp)->_IO_read_base)';;
15555 case "$stdio_bufsiz" in
15556 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
15559 case "$stdio_ptr" in
15560 '') stdio_ptr='((fp)->_ptr)'
15563 *) ptr_lval=$d_stdio_ptr_lval;;
15565 case "$stdio_cnt" in
15566 '') stdio_cnt='((fp)->_cnt)'
15569 *) cnt_lval=$d_stdio_cnt_lval;;
15571 case "$stdio_base" in
15572 '') stdio_base='((fp)->_base)';;
15574 case "$stdio_bufsiz" in
15575 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
15579 : test whether _ptr and _cnt really work
15580 echo "Checking how std your stdio is..." >&4
15583 #define FILE_ptr(fp) $stdio_ptr
15584 #define FILE_cnt(fp) $stdio_cnt
15586 FILE *fp = fopen("try.c", "r");
15589 18 <= FILE_cnt(fp) &&
15590 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15598 if eval $compile && $to try.c; then
15599 if $run ./try; then
15600 echo "Your stdio acts pretty std."
15603 echo "Your stdio isn't very std."
15606 echo "Your stdio doesn't appear very std."
15612 : Can _ptr be used as an lvalue?
15613 case "$d_stdstdio$ptr_lval" in
15614 $define$define) val=$define ;;
15617 set d_stdio_ptr_lval
15620 : Can _cnt be used as an lvalue?
15621 case "$d_stdstdio$cnt_lval" in
15622 $define$define) val=$define ;;
15625 set d_stdio_cnt_lval
15629 : test whether setting _ptr sets _cnt as a side effect
15630 d_stdio_ptr_lval_sets_cnt="$undef"
15631 d_stdio_ptr_lval_nochange_cnt="$undef"
15632 case "$d_stdio_ptr_lval$d_stdstdio" in
15634 echo "Checking to see what happens if we set the stdio ptr..." >&4
15637 /* Can we scream? */
15638 /* Eat dust sed :-) */
15639 /* In the buffer space, no one can hear you scream. */
15640 #define FILE_ptr(fp) $stdio_ptr
15641 #define FILE_cnt(fp) $stdio_cnt
15642 #include <sys/types.h>
15644 FILE *fp = fopen("try.c", "r");
15649 puts("Fail even to read");
15652 c = getc(fp); /* Read away the first # */
15654 puts("Fail even to read");
15658 18 <= FILE_cnt(fp) &&
15659 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15661 puts("Fail even to read");
15664 ptr = (char*) FILE_ptr(fp);
15665 cnt = (size_t)FILE_cnt(fp);
15667 FILE_ptr(fp) += 42;
15669 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
15670 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
15673 if (FILE_cnt(fp) <= 20) {
15674 printf ("Fail (<20 chars to test)");
15677 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
15678 puts("Fail compare");
15681 if (cnt == FILE_cnt(fp)) {
15682 puts("Pass_unchanged");
15685 if (FILE_cnt(fp) == (cnt - 42)) {
15686 puts("Pass_changed");
15689 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
15695 if eval $compile && $to try.c; then
15696 case `$run ./try` in
15698 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
15699 d_stdio_ptr_lval_sets_cnt="$define" ;;
15701 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
15702 d_stdio_ptr_lval_nochange_cnt="$define" ;;
15704 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
15706 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
15709 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
15715 : see if _base is also standard
15717 case "$d_stdstdio" in
15721 #define FILE_base(fp) $stdio_base
15722 #define FILE_bufsiz(fp) $stdio_bufsiz
15724 FILE *fp = fopen("try.c", "r");
15727 19 <= FILE_bufsiz(fp) &&
15728 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
15735 if eval $compile && $to try.c; then
15736 if $run ./try; then
15737 echo "And its _base field acts std."
15740 echo "But its _base field isn't std."
15743 echo "However, it seems to be lacking the _base field."
15752 Checking how to access stdio streams by file descriptor number...
15754 case "$stdio_stream_array" in
15755 '') $cat >try.c <<EOCP
15758 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
15762 for s in _iob __iob __sF
15764 set try -DSTDIO_STREAM_ARRAY=$s
15765 if eval $compile; then
15766 case "`$run ./try`" in
15767 yes) stdio_stream_array=$s; break ;;
15771 $rm -f try.* try$exe_ext
15773 case "$stdio_stream_array" in
15775 I can't figure out how to access stdio streams by file descriptor number.
15777 d_stdio_stream_array="$undef"
15780 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
15782 d_stdio_stream_array="$define"
15786 : see if strcoll exists
15787 set strcoll d_strcoll
15790 : check for structure copying
15792 echo "Checking to see if your C compiler can copy structs..." >&4
15793 $cat >try.c <<'EOCP'
15803 if $cc -c try.c >/dev/null 2>&1 ; then
15805 echo "Yup, it can."
15808 echo "Nope, it can't."
15814 : see if strerror and/or sys_errlist[] exist
15816 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
15817 if set strerror val -f d_strerror; eval $csym; $val; then
15818 echo 'strerror() found.' >&4
15819 d_strerror="$define"
15820 d_strerrm='strerror(e)'
15821 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15822 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
15823 d_syserrlst="$define"
15825 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
15826 d_syserrlst="$undef"
15828 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
15829 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
15830 echo 'strerror() found in string header.' >&4
15831 d_strerror="$define"
15832 d_strerrm='strerror(e)'
15833 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15834 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
15835 d_syserrlst="$define"
15837 echo "(You don't appear to have any sys_errlist[], how can this be?)"
15838 d_syserrlst="$undef"
15840 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15841 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
15842 d_strerror="$undef"
15843 d_syserrlst="$define"
15844 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
15846 echo 'strerror() and sys_errlist[] NOT found.' >&4
15847 d_strerror="$undef"
15848 d_syserrlst="$undef"
15849 d_strerrm='"unknown"'
15853 : see if strerror_r exists
15854 set strerror_r d_strerror_r
15856 case "$d_strerror_r" in
15858 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
15861 hdrs="$hdrs $i_systime sys/time.h"
15864 case "$d_strerror_r_proto:$usethreads" in
15865 ":define") d_strerror_r_proto=define
15866 set d_strerror_r_proto strerror_r $hdrs
15870 case "$d_strerror_r_proto" in
15872 case "$strerror_r_proto" in
15873 ''|0) try='int strerror_r(int, char*, size_t);'
15874 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
15876 case "$strerror_r_proto" in
15877 ''|0) try='int strerror_r(int, char*, int);'
15878 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
15880 case "$strerror_r_proto" in
15881 ''|0) try='char* strerror_r(int, char*, size_t);'
15882 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
15884 case "$strerror_r_proto" in
15885 ''|0) d_strerror_r=undef
15887 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
15888 * ) case "$strerror_r_proto" in
15889 REENTRANT_PROTO*) ;;
15890 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
15892 echo "Prototype: $try" ;;
15895 *) case "$usethreads" in
15896 define) echo "strerror_r has no prototype, not using it." >&4 ;;
15903 *) strerror_r_proto=0
15907 : see if strftime exists
15908 set strftime d_strftime
15911 : see if strtod exists
15912 set strtod d_strtod
15915 : see if strtol exists
15916 set strtol d_strtol
15919 : see if strtold exists
15920 set strtold d_strtold
15923 : see if strtoll exists
15924 set strtoll d_strtoll
15927 case "$d_longlong-$d_strtoll" in
15930 Checking whether your strtoll() works okay...
15932 $cat >try.c <<'EOCP'
15935 #define strtoll __strtoll
15938 #define strtoll _strtoll
15941 extern long long int strtoll(char *s, char **, int);
15942 static int bad = 0;
15943 int check(char *s, long long ell, int een) {
15946 gll = strtoll(s, 0, 10);
15947 if (!((gll == ell) && (errno == een)))
15951 check(" 1", 1LL, 0);
15952 check(" 0", 0LL, 0);
15953 check("-1", -1LL, 0);
15954 check("-9223372036854775808", -9223372036854775808LL, 0);
15955 check("-9223372036854775808", -9223372036854775808LL, 0);
15956 check(" 9223372036854775807", 9223372036854775807LL, 0);
15957 check("-9223372036854775808", -9223372036854775808LL, 0);
15958 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
15959 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
15965 if eval $compile; then
15968 ok) echo "Your strtoll() seems to be working okay." ;;
15970 Your strtoll() doesn't seem to be working okay.
15976 echo "(I can't seem to compile the test program--assuming it doesn't)"
15982 : see if strtoq exists
15983 set strtoq d_strtoq
15986 : see if strtoul exists
15987 set strtoul d_strtoul
15990 case "$d_strtoul" in
15993 Checking whether your strtoul() works okay...
15995 $cat >try.c <<'EOCP'
15998 extern unsigned long int strtoul(char *s, char **, int);
15999 static int bad = 0;
16000 void check(char *s, unsigned long eul, int een) {
16003 gul = strtoul(s, 0, 10);
16004 if (!((gul == eul) && (errno == een)))
16008 check(" 1", 1L, 0);
16009 check(" 0", 0L, 0);
16011 case "$longsize" in
16013 $cat >>try.c <<'EOCP'
16014 check("18446744073709551615", 18446744073709551615UL, 0);
16015 check("18446744073709551616", 18446744073709551615UL, ERANGE);
16016 #if 0 /* strtoul() for /^-/ strings is undefined. */
16017 check("-1", 18446744073709551615UL, 0);
16018 check("-18446744073709551614", 2, 0);
16019 check("-18446744073709551615", 1, 0);
16020 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
16021 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
16026 $cat >>try.c <<'EOCP'
16027 check("4294967295", 4294967295UL, 0);
16028 check("4294967296", 4294967295UL, ERANGE);
16029 #if 0 /* strtoul() for /^-/ strings is undefined. */
16030 check("-1", 4294967295UL, 0);
16031 check("-4294967294", 2, 0);
16032 check("-4294967295", 1, 0);
16033 check("-4294967296", 4294967295UL, ERANGE);
16034 check("-4294967297", 4294967295UL, ERANGE);
16039 : Should we write these tests to be more portable by sprintf-ing
16040 : ~0 and then manipulating that char string as input for strtol?
16043 $cat >>try.c <<'EOCP'
16050 if eval $compile; then
16051 case "`$run ./try`" in
16052 ok) echo "Your strtoul() seems to be working okay." ;;
16054 Your strtoul() doesn't seem to be working okay.
16063 : see if strtoull exists
16064 set strtoull d_strtoull
16067 case "$d_longlong-$d_strtoull" in
16070 Checking whether your strtoull() works okay...
16072 $cat >try.c <<'EOCP'
16075 #define strtoull __strtoull
16078 extern unsigned long long int strtoull(char *s, char **, int);
16079 static int bad = 0;
16080 int check(char *s, long long eull, int een) {
16083 gull = strtoull(s, 0, 10);
16084 if (!((gull == eull) && (errno == een)))
16088 check(" 1", 1LL, 0);
16089 check(" 0", 0LL, 0);
16090 check("18446744073709551615", 18446744073709551615ULL, 0);
16091 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16092 #if 0 /* strtoull() for /^-/ strings is undefined. */
16093 check("-1", 18446744073709551615ULL, 0);
16094 check("-18446744073709551614", 2LL, 0);
16095 check("-18446744073709551615", 1LL, 0);
16096 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16097 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16104 if eval $compile; then
16105 case "`$run ./try`" in
16106 ok) echo "Your strtoull() seems to be working okay." ;;
16108 Your strtoull() doesn't seem to be working okay.
16110 d_strtoull="$undef"
16117 : see if strtouq exists
16118 set strtouq d_strtouq
16121 case "$d_strtouq" in
16124 Checking whether your strtouq() works okay...
16126 $cat >try.c <<'EOCP'
16129 extern unsigned long long int strtouq(char *s, char **, int);
16130 static int bad = 0;
16131 void check(char *s, unsigned long long eull, int een) {
16132 unsigned long long gull;
16134 gull = strtouq(s, 0, 10);
16135 if (!((gull == eull) && (errno == een)))
16139 check(" 1", 1LL, 0);
16140 check(" 0", 0LL, 0);
16141 check("18446744073709551615", 18446744073709551615ULL, 0);
16142 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16143 #if 0 /* strtouq() for /^-/ strings is undefined. */
16144 check("-1", 18446744073709551615ULL, 0);
16145 check("-18446744073709551614", 2LL, 0);
16146 check("-18446744073709551615", 1LL, 0);
16147 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16148 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16156 if eval $compile; then
16157 case "`$run ./try`" in
16158 ok) echo "Your strtouq() seems to be working okay." ;;
16160 Your strtouq() doesn't seem to be working okay.
16169 : see if strxfrm exists
16170 set strxfrm d_strxfrm
16173 : see if symlink exists
16174 set symlink d_symlink
16177 : see if syscall exists
16178 set syscall d_syscall
16181 : see if prototype for syscall is available
16183 set d_syscallproto syscall $i_unistd unistd.h
16186 : see if sysconf exists
16187 set sysconf d_sysconf
16190 : see if system exists
16191 set system d_system
16194 : see if tcgetpgrp exists
16195 set tcgetpgrp d_tcgetpgrp
16198 : see if tcsetpgrp exists
16199 set tcsetpgrp d_tcsetpgrp
16202 : see if prototype for telldir is available
16204 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
16207 : see if time exists
16209 if test "X$d_time" = X -o X"$timetype" = X; then
16210 if set time val -f d_time; eval $csym; $val; then
16211 echo 'time() found.' >&4
16213 rp="What is the type returned by time() on this system?"
16214 set time_t timetype long stdio.h sys/types.h
16217 echo 'time() not found, hope that will do.' >&4
16225 : see if this is a sys/times.h system
16226 set sys/times.h i_systimes
16229 : see if times exists
16231 if set times val -f d_times; eval $csym; $val; then
16232 echo 'times() found.' >&4
16235 case "$i_systimes" in
16236 "$define") inc='sys/times.h';;
16238 rp="What is the type returned by times() on this system?"
16239 set clock_t clocktype long stdio.h sys/types.h $inc
16242 echo 'times() NOT found, hope that will do.' >&4
16247 : see if tmpnam_r exists
16248 set tmpnam_r d_tmpnam_r
16250 case "$d_tmpnam_r" in
16252 hdrs="$i_systypes sys/types.h define stdio.h "
16255 hdrs="$hdrs $i_systime sys/time.h"
16258 case "$d_tmpnam_r_proto:$usethreads" in
16259 ":define") d_tmpnam_r_proto=define
16260 set d_tmpnam_r_proto tmpnam_r $hdrs
16264 case "$d_tmpnam_r_proto" in
16266 case "$tmpnam_r_proto" in
16267 ''|0) try='char* tmpnam_r(char*);'
16268 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
16270 case "$tmpnam_r_proto" in
16271 ''|0) d_tmpnam_r=undef
16273 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
16274 * ) case "$tmpnam_r_proto" in
16275 REENTRANT_PROTO*) ;;
16276 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
16278 echo "Prototype: $try" ;;
16281 *) case "$usethreads" in
16282 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
16289 *) tmpnam_r_proto=0
16293 : see if truncate exists
16294 set truncate d_truncate
16297 : see if ttyname_r exists
16298 set ttyname_r d_ttyname_r
16300 case "$d_ttyname_r" in
16302 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
16305 hdrs="$hdrs $i_systime sys/time.h"
16308 case "$d_ttyname_r_proto:$usethreads" in
16309 ":define") d_ttyname_r_proto=define
16310 set d_ttyname_r_proto ttyname_r $hdrs
16314 case "$d_ttyname_r_proto" in
16316 case "$ttyname_r_proto" in
16317 ''|0) try='int ttyname_r(int, char*, size_t);'
16318 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
16320 case "$ttyname_r_proto" in
16321 ''|0) try='int ttyname_r(int, char*, int);'
16322 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
16324 case "$ttyname_r_proto" in
16325 ''|0) try='char* ttyname_r(int, char*, int);'
16326 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
16328 case "$ttyname_r_proto" in
16329 ''|0) d_ttyname_r=undef
16331 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
16332 * ) case "$ttyname_r_proto" in
16333 REENTRANT_PROTO*) ;;
16334 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
16336 echo "Prototype: $try" ;;
16339 *) case "$usethreads" in
16340 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
16347 *) ttyname_r_proto=0
16351 : see if tzname[] exists
16353 if set tzname val -a d_tzname; eval $csym; $val; then
16355 echo 'tzname[] found.' >&4
16358 echo 'tzname[] NOT found.' >&4
16364 next|rhapsody|darwin) multiarch="$define" ;;
16366 case "$multiarch" in
16367 ''|[nN]*) multiarch="$undef" ;;
16370 : check for ordering of bytes in a long
16372 case "$usecrosscompile$multiarch" in
16375 You seem to be either cross-compiling or doing a multiarchitecture build,
16376 skipping the byteorder check.
16382 case "$byteorder" in
16385 In the following, larger digits indicate more significance. A big-endian
16386 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
16387 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
16388 machines may have weird orders like 3412. A Cray will report 87654321,
16389 an Alpha will report 12345678. If the test program works the default is
16391 I'm now running the test program...
16393 $cat >try.c <<'EOCP'
16400 char c[sizeof(long)];
16403 if (sizeof(long) > 4)
16404 u.l = (0x08070605L << 32) | 0x04030201L;
16407 for (i = 0; i < sizeof(long); i++)
16408 printf("%c", u.c[i]+'0');
16415 if eval $compile && ./try > /dev/null; then
16418 [1-4][1-4][1-4][1-4]|12345678|87654321)
16419 echo "(The test program ran ok.)"
16420 echo "byteorder=$dflt"
16423 ????|????????) echo "(The test program ran ok.)" ;;
16424 *) echo "(The test program didn't run right for some reason.)" ;;
16429 (I can't seem to compile the test program. Guessing big-endian...)
16432 case "$xxx_prompt" in
16434 rp="What is the order of bytes in a long?"
16450 Checking to see whether you can access character data unalignedly...
16452 case "$d_u32align" in
16453 '') $cat >try.c <<EOCP
16455 #define U32 $u32type
16456 #define BYTEORDER 0x$byteorder
16458 #include <signal.h>
16460 $signal_t bletch(s) int s; { exit(4); }
16463 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
16468 if (sizeof(U32) != 4) {
16469 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
16476 signal(SIGBUS, bletch);
16488 for (i = 0; i < 4; i++) {
16489 up = (U32*)(buf + i);
16490 if (! ((*up == 1 << (8*i)) || /* big-endian */
16491 (*up == 1 << (8*(3-i))) /* little-endian */
16495 printf("read failed (%x)\n", *up);
16501 for (i = 0; i < 4; i++) {
16502 up = (U32*)(buf + i);
16504 if (*up != 0xBeef) {
16505 printf("write failed (%x)\n", *up);
16519 if eval $compile_ok; then
16520 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
16521 $run ./try 2>&1 >/dev/null
16524 You can access character data pretty unalignedly.
16526 d_u32align="$undef"
16529 It seems that you must access character data in an aligned manner.
16531 d_u32align="$define"
16535 rp='Can you access character data at unaligned addresses?'
16539 [yY]*) d_u32align="$undef" ;;
16540 *) d_u32align="$define" ;;
16543 $rm -f core core.try.* try.core
16547 : see if ualarm exists
16548 set ualarm d_ualarm
16551 : see if umask exists
16555 : see if unordered exists
16556 set unordered d_unordered
16559 : see if usleep exists
16560 set usleep d_usleep
16563 : see if prototype for usleep is available
16565 set d_usleepproto usleep $i_unistd unistd.h
16568 : see if ustat exists
16572 : backward compatibility for d_hvfork
16573 if test X$d_hvfork != X; then
16574 d_vfork="$d_hvfork"
16577 : see if there is a vfork
16582 : Ok, but do we want to use it. vfork is reportedly unreliable in
16583 : perl on Solaris 2.x, and probably elsewhere.
16587 case "$usevfork" in
16593 Perl can only use a vfork() that doesn't suffer from strict
16594 restrictions on calling functions or modifying global data in
16595 the child. For example, glibc-2.1 contains such a vfork()
16596 that is unsuitable. If your system provides a proper fork()
16597 call, chances are that you do NOT want perl to use vfork().
16600 rp="Do you still want to use vfork()?"
16605 echo "Ok, we won't use vfork()."
16614 $define) usevfork='true';;
16615 *) usevfork='false';;
16618 : see if closedir exists
16619 set closedir d_closedir
16622 case "$d_closedir" in
16625 echo "Checking whether closedir() returns a status..." >&4
16627 #$i_dirent I_DIRENT /**/
16628 #$i_sysdir I_SYS_DIR /**/
16629 #$i_sysndir I_SYS_NDIR /**/
16630 #$i_systypes I_SYS_TYPES /**/
16632 #if defined(I_SYS_TYPES)
16633 #include <sys/types.h>
16635 #if defined(I_DIRENT)
16636 #include <dirent.h>
16637 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
16638 #include <sys/dir.h>
16642 #include <sys/ndir.h>
16646 #include <ndir.h> /* may be wrong in the future */
16648 #include <sys/dir.h>
16653 int main() { return closedir(opendir(".")); }
16656 if eval $compile_ok; then
16657 if $run ./try > /dev/null 2>&1 ; then
16658 echo "Yes, it does."
16661 echo "No, it doesn't."
16665 echo "(I can't seem to compile the test program--assuming it doesn't)"
16673 set d_void_closedir
16676 : see if there is a wait4
16680 : see if waitpid exists
16681 set waitpid d_waitpid
16684 : see if wcstombs exists
16685 set wcstombs d_wcstombs
16688 : see if wctomb exists
16689 set wctomb d_wctomb
16692 : see if writev exists
16693 set writev d_writev
16696 : preserve RCS keywords in files with variable substitution, grrr
16701 Revision='$Revision'
16703 : check for alignment requirements
16705 case "$usecrosscompile$multiarch" in
16708 You seem to be either cross-compiling or doing a multiarchitecture build,
16709 skipping the memory alignment check.
16712 case "$alignbytes" in
16713 '') alignbytes=8 ;;
16717 case "$alignbytes" in
16718 '') echo "Checking alignment constraints..." >&4
16719 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
16720 $cat >try.c <<'EOCP'
16721 typedef long double NV;
16724 $cat >try.c <<'EOCP'
16728 $cat >>try.c <<'EOCP'
16736 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
16741 if eval $compile_ok; then
16745 echo "(I can't seem to compile the test program...)"
16748 *) dflt="$alignbytes"
16751 rp="Doubles must be aligned on a how-many-byte boundary?"
16759 : set the base revision
16762 : how do we catenate cpp tokens here?
16764 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
16765 $cat >cpp_stuff.c <<'EOCP'
16766 #define RCAT(a,b)a/**/b
16767 #define ACAT(a,b)a ## b
16771 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
16772 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
16773 echo "Oh! Smells like ANSI's been here." >&4
16774 echo "We can catify or stringify, separately or together!"
16776 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
16777 echo "Ah, yes! The good old days!" >&4
16778 echo "However, in the good old days we don't know how to stringify and"
16779 echo "catify at the same time."
16783 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
16784 to have to edit the values of CAT[2-5] in config.h...
16786 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
16790 : see if this is a db.h system
16796 : Check db version.
16798 echo "Checking Berkeley DB version ..." >&4
16804 #include <sys/types.h>
16807 int main(int argc, char *argv[])
16809 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
16810 int Major, Minor, Patch ;
16811 unsigned long Version ;
16812 (void)db_version(&Major, &Minor, &Patch) ;
16814 printf("%d %d %d %d %d %d\n",
16815 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
16816 Major, Minor, Patch);
16819 printf("You have Berkeley DB Version 2 or greater.\n");
16821 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
16822 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
16823 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
16824 Major, Minor, Patch) ;
16826 /* check that db.h & libdb are compatible */
16827 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
16828 printf("db.h and libdb are incompatible.\n") ;
16832 printf("db.h and libdb are compatible.\n") ;
16834 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
16835 + DB_VERSION_PATCH ;
16837 /* needs to be >= 2.3.4 */
16838 if (Version < 2003004) {
16839 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
16840 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
16846 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
16851 printf("You have Berkeley DB Version 1.\n");
16852 exit(0); /* DB version < 2: the coast is clear. */
16854 exit(1); /* <db.h> not Berkeley DB? */
16860 if eval $compile_ok && $run ./try; then
16861 echo 'Looks OK.' >&4
16863 db_version_major=$1
16864 db_version_minor=$2
16865 db_version_patch=$3
16867 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
16871 : Remove db from list of libraries to use
16872 echo "Removing unusable -ldb from library list" >&4
16873 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
16876 echo "libs = $libs" >&4
16886 : Check the return type needed for hash
16888 echo "Checking return type needed for hash for Berkeley DB ..." >&4
16894 #include <sys/types.h>
16897 #ifndef DB_VERSION_MAJOR
16898 u_int32_t hash_cb (ptr, size)
16906 info.hash = hash_cb;
16910 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16911 if $contains warning try.out >>/dev/null 2>&1 ; then
16914 db_hashtype='u_int32_t'
16917 : XXX Maybe we should just give up here.
16918 db_hashtype=u_int32_t
16920 echo "Help: I can't seem to compile the db test program." >&4
16921 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
16924 echo "Your version of Berkeley DB uses $db_hashtype for hash."
16926 *) db_hashtype=u_int32_t
16931 : Check the return type needed for prefix
16933 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
16939 #include <sys/types.h>
16942 #ifndef DB_VERSION_MAJOR
16943 size_t prefix_cb (key1, key2)
16951 info.prefix = prefix_cb;
16955 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16956 if $contains warning try.out >>/dev/null 2>&1 ; then
16957 db_prefixtype='int'
16959 db_prefixtype='size_t'
16962 db_prefixtype='size_t'
16963 : XXX Maybe we should just give up here.
16965 echo "Help: I can't seem to compile the db test program." >&4
16966 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
16969 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
16971 *) db_prefixtype='size_t'
16976 : How can we generate normalized random numbers ?
16978 echo "Looking for a random number function..." >&4
16979 case "$randfunc" in
16981 if set drand48 val -f; eval $csym; $val; then
16983 echo "Good, found drand48()." >&4
16984 elif set random val -f; eval $csym; $val; then
16986 echo "OK, found random()." >&4
16989 echo "Yick, looks like I have to use rand()." >&4
17000 *-Dmy_rand=*|*-Dmy_srand=*)
17001 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
17002 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
17003 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
17004 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
17008 while $test "$cont"; do
17009 rp="Use which function to generate random numbers?"
17011 if $test "$ans" = "$dflt"; then
17017 if set $ans val -f; eval $csym; $val; then
17021 rp="I cannot find function $ans. Use that name anyway?"
17030 case "$randfunc" in
17032 drand01="drand48()"
17038 case "$randbits" in
17040 echo "Checking to see how many bits your $randfunc() function produces..." >&4
17042 #$i_unistd I_UNISTD
17043 #$i_stdlib I_STDLIB
17046 # include <unistd.h>
17049 # include <stdlib.h>
17054 register unsigned long tmp;
17055 register unsigned long max = 0L;
17057 for (i = 1000; i; i--) {
17058 tmp = (unsigned long) $randfunc();
17059 if (tmp > max) max = tmp;
17061 for (i = 0; max; i++)
17067 if eval $compile_ok; then
17071 echo "(I can't seem to compile the test program...)"
17078 rp="How many bits does your $randfunc() function produce?"
17082 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17083 seedfunc="s$randfunc"
17084 randseedtype=unsigned
17088 rp="How many bits does your $randfunc() function produce?"
17091 seedfunc="s$randfunc"
17092 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17093 if set $seedfunc val -f; eval $csym; $val; then
17094 echo "(Using $seedfunc() to seed random generator)"
17096 echo "(Warning: no $seedfunc() to seed random generator)"
17099 randseedtype=unsigned
17107 echo "Determining whether or not we are on an EBCDIC system..." >&4
17108 $cat >try.c <<'EOM'
17111 if ('M'==0xd4) return 0;
17118 if eval $compile_ok; then
17119 if $run ./try; then
17120 echo "You seem to speak EBCDIC." >&4
17123 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
17126 echo "I'm unable to compile the test program." >&4
17127 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
17135 Checking how to flush all pending stdio output...
17137 # I only know how to find the first 32 possibly open files on SunOS.
17138 # See also hints/sunos_4_1.sh and util.c --AD
17140 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
17142 $cat >>try.c <<EOCP
17144 #$i_unistd I_UNISTD
17146 # include <unistd.h>
17148 #$d_sysconf HAS_SYSCONF
17149 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
17150 #ifdef HAS_STDIO_STREAM_ARRAY
17151 # define STDIO_STREAM_ARRAY $stdio_stream_array
17156 p = fopen("try.out", "w");
17160 # ifdef TRY_FPRINTF
17164 #ifdef TRY_FFLUSH_NULL
17167 #ifdef TRY_FFLUSH_ALL
17169 long open_max = -1;
17170 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
17171 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
17173 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
17174 open_max = sysconf(_SC_OPEN_MAX);
17177 open_max = FOPEN_MAX;
17180 open_max = OPEN_MAX;
17189 # ifdef HAS_STDIO_STREAM_ARRAY
17190 if (open_max > 0) {
17192 for (i = 0; i < open_max; i++)
17193 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
17194 STDIO_STREAM_ARRAY[i]._file < open_max &&
17195 STDIO_STREAM_ARRAY[i]._flag)
17196 fflush(&STDIO_STREAM_ARRAY[i]);
17204 : first we have to find out how _not_ to flush
17206 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
17208 set try -DTRY_FPUTC
17209 if eval $compile; then
17210 $run ./try 2>/dev/null
17213 if $test ! -s try.out -a "X$code" = X42; then
17219 set try -DTRY_FPRINTF
17220 if eval $compile; then
17221 $run ./try 2>/dev/null
17224 if $test ! -s try.out -a "X$code" = X42; then
17225 output=-DTRY_FPRINTF
17231 : check for fflush NULL behaviour
17232 case "$fflushNULL" in
17233 '') set try -DTRY_FFLUSH_NULL $output
17234 if eval $compile; then
17235 $run ./try 2>/dev/null
17238 if $test -s try.out -a "X$code" = X42; then
17239 fflushNULL="`$cat try.out`"
17241 if $test "X$code" != X42; then
17243 (If this test failed, don't worry, we'll try another method shortly.)
17248 $rm -f core try.core core.try.*
17249 case "$fflushNULL" in
17251 Your fflush(NULL) works okay for output streams.
17252 Let's see if it clobbers input pipes...
17254 # As of mid-March 2000 all versions of Solaris appear to have a stdio
17255 # bug that improperly flushes the input end of pipes. So we avoid the
17256 # autoflush on fork/system/exec support for now. :-(
17257 $cat >tryp.c <<EOCP
17260 main(int argc, char **argv)
17266 while ((i = getc(stdin)) != -1
17267 && (*bp++ = i) != '\n'
17268 && bp < &buf[1024])
17271 fprintf(stdout, "%s", buf);
17279 fflushNULL="$define"
17281 if eval $compile; then
17283 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17284 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17286 fflush(NULL) seems to behave okay with input streams.
17288 fflushNULL="$define"
17291 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
17293 fflushNULL="$undef"
17296 $rm -f core tryp.c tryp.core core.tryp.*
17299 Your fflush(NULL) isn't working (contrary to ANSI C).
17301 fflushNULL="$undef"
17304 Cannot figure out whether your fflush(NULL) works or not.
17305 I'm assuming it doesn't (contrary to ANSI C).
17307 fflushNULL="$undef"
17311 $define|true|[yY]*)
17312 fflushNULL="$define"
17315 fflushNULL="$undef"
17318 : check explicit looping only if NULL did not work, and if the pipe
17319 : bug does not show up on an explicit flush too
17320 case "$fflushNULL" in
17322 $cat >tryp.c <<EOCP
17325 main(int argc, char **argv)
17331 while ((i = getc(stdin)) != -1
17332 && (*bp++ = i) != '\n'
17333 && bp < &buf[1024])
17336 fprintf(stdout, "%s", buf);
17345 if eval $compile; then
17347 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17348 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17350 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
17352 : now check for fflushall behaviour
17353 case "$fflushall" in
17354 '') set try -DTRY_FFLUSH_ALL $output
17355 if eval $compile; then
17357 (Now testing the other method--but note that this also may fail.)
17359 $run ./try 2>/dev/null
17362 if $test -s try.out -a "X$code" = X42; then
17363 fflushall="`$cat try.out`"
17366 $rm -f core try.core core.try.*
17367 case "$fflushall" in
17369 Whew. Flushing explicitly all the stdio streams works.
17371 fflushall="$define"
17374 Sigh. Flushing explicitly all the stdio streams doesn't work.
17379 Cannot figure out whether flushing stdio streams explicitly works or not.
17380 I'm assuming it doesn't.
17386 "$define"|true|[yY]*)
17387 fflushall="$define"
17395 All is futile. Even fflush(stdin) clobbers input pipes!
17402 $rm -f core tryp.c tryp.core core.tryp.*
17404 *) fflushall="$undef"
17408 case "$fflushNULL$fflushall" in
17411 OK, I give up. I cannot figure out how to flush pending stdio output.
17412 We won't be flushing handles at all before fork/exec/popen.
17416 $rm -f try.* try$exe_ext
17418 : Store the full pathname to the ar program for use in the C program
17419 : Respect a hint or command line value for full_ar.
17424 : Store the full pathname to the sed program for use in the C program
17427 : see what type gids are declared as in the kernel
17429 echo "Looking for the type for group ids returned by getgid()."
17430 set gid_t gidtype xxx stdio.h sys/types.h
17434 xxx=`./findhdr sys/user.h`
17435 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
17437 unsigned) dflt="$1 $2" ;;
17441 *) dflt="$gidtype";;
17444 gid_t) echo "gid_t found." ;;
17445 *) rp="What is the type for group ids returned by getgid()?"
17453 *_t) zzz="$gidtype" ;;
17456 echo "Checking the size of $zzz..." >&4
17458 #include <sys/types.h>
17461 printf("%d\n", (int)sizeof($gidtype));
17466 if eval $compile_ok; then
17470 echo "(I can't execute the test program--guessing $gidsize.)" >&4
17473 echo "Your $zzz is $gidsize bytes long."
17478 echo "(I can't compile the test program--guessing $gidsize.)" >&4
17484 *_t) zzz="$gidtype" ;;
17487 echo "Checking the sign of $zzz..." >&4
17489 #include <sys/types.h>
17500 if eval $compile; then
17504 echo "(I can't execute the test program--guessing unsigned.)" >&4
17508 1) echo "Your $zzz is unsigned." ;;
17509 -1) echo "Your $zzz is signed." ;;
17515 echo "(I can't compile the test program--guessing unsigned.)" >&4
17521 if $test X"$quadtype" != X; then
17523 echo "Checking how to print 64-bit integers..." >&4
17525 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
17526 $cat >try.c <<'EOCP'
17527 #include <sys/types.h>
17530 int q = 12345678901;
17531 printf("%ld\n", q);
17535 if eval $compile; then
17539 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
17540 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
17541 echo "We will use %d."
17547 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
17548 $cat >try.c <<'EOCP'
17549 #include <sys/types.h>
17552 long q = 12345678901;
17553 printf("%ld\n", q);
17557 if eval $compile; then
17561 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
17562 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
17563 echo "We will use %ld."
17569 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
17570 $cat >try.c <<'EOCP'
17571 #include <sys/types.h>
17572 #include <inttypes.h>
17575 int64_t q = 12345678901;
17576 printf("%" PRId64 "\n", q);
17580 if eval $compile; then
17584 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
17585 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
17586 echo "We will use the C9X style."
17592 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17594 #include <sys/types.h>
17597 $quadtype q = 12345678901;
17598 printf("%Ld\n", q);
17602 if eval $compile; then
17606 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
17607 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
17608 echo "We will use %Ld."
17614 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
17615 $cat >try.c <<'EOCP'
17616 #include <sys/types.h>
17619 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
17620 printf("%lld\n", q);
17624 if eval $compile; then
17628 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
17629 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
17630 echo "We will use the %lld style."
17636 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17638 #include <sys/types.h>
17641 $quadtype q = 12345678901;
17642 printf("%qd\n", q);
17646 if eval $compile; then
17650 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
17651 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
17652 echo "We will use %qd."
17658 if $test X"$sPRId64" = X; then
17659 echo "Cannot figure out how to print 64-bit integers." >&4
17667 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
17668 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
17670 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
17671 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
17677 $echo "Checking the format strings to be used for Perl's internal types..." >&4
17679 if $test X"$ivsize" = X8; then
17680 ivdformat="$sPRId64"
17681 uvuformat="$sPRIu64"
17682 uvoformat="$sPRIo64"
17683 uvxformat="$sPRIx64"
17684 uvXUformat="$sPRIXU64"
17686 if $test X"$ivsize" = X"$longsize"; then
17693 if $test X"$ivsize" = X"$intsize"; then
17701 if $test X"$ivsize" = X"$shortsize"; then
17712 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
17713 nveformat="$sPRIeldbl"
17714 nvfformat="$sPRIfldbl"
17715 nvgformat="$sPRIgldbl"
17716 nvEUformat="$sPRIEUldbl"
17717 nvFUformat="$sPRIFUldbl"
17718 nvGUformat="$sPRIGUldbl"
17728 case "$ivdformat" in
17729 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
17736 $echo "Checking the format string to be used for gids..." >&4
17739 -1) if $test X"$gidsize" = X"$ivsize"; then
17740 gidformat="$ivdformat"
17742 if $test X"$gidsize" = X"$longsize"; then
17745 if $test X"$gidsize" = X"$intsize"; then
17748 if $test X"$gidsize" = X"$shortsize"; then
17755 *) if $test X"$gidsize" = X"$uvsize"; then
17756 gidformat="$uvuformat"
17758 if $test X"$gidsize" = X"$longsize"; then
17761 if $test X"$gidsize" = X"$intsize"; then
17764 if $test X"$gidsize" = X"$shortsize"; then
17773 : see if getgroups exists
17774 set getgroups d_getgrps
17777 : see if setgroups exists
17778 set setgroups d_setgrps
17782 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
17784 case "$d_getgrps$d_setgrps" in
17786 case "$groupstype" in
17787 '') dflt="$gidtype" ;;
17788 *) dflt="$groupstype" ;;
17791 What type of pointer is the second argument to getgroups() and setgroups()?
17792 Usually this is the same as group ids, $gidtype, but not always.
17795 rp='What type pointer is the second argument to getgroups() and setgroups()?'
17799 *) groupstype="$gidtype";;
17803 echo "Checking if your $make program sets \$(MAKE)..." >&4
17804 case "$make_set_make" in
17806 $sed 's/^X //' > testmake.mak << 'EOF'
17808 X @echo 'maketemp="$(MAKE)"'
17810 case "`$make -f testmake.mak 2>/dev/null`" in
17811 *maketemp=*) make_set_make='#' ;;
17812 *) make_set_make="MAKE=$make" ;;
17814 $rm -f testmake.mak
17817 case "$make_set_make" in
17818 '#') echo "Yup, it does.";;
17819 *) echo "Nope, it doesn't.";;
17822 : see what type is used for mode_t
17823 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
17824 set mode_t modetype int stdio.h sys/types.h
17827 : see if stdarg is available
17829 if $test `./findhdr stdarg.h`; then
17830 echo "<stdarg.h> found." >&4
17833 echo "<stdarg.h> NOT found." >&4
17837 : see if varags is available
17839 if $test `./findhdr varargs.h`; then
17840 echo "<varargs.h> found." >&4
17842 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
17845 : set up the varargs testing programs
17846 $cat > varargs.c <<EOP
17848 #include <stdarg.h>
17851 #include <varargs.h>
17855 int f(char *p, ...)
17869 p = va_arg(ap, char *);
17874 $cat > varargs <<EOP
17876 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
17885 : now check which varargs header should be included
17890 if `./varargs I_STDARG`; then
17892 elif `./varargs I_VARARGS`; then
17897 if `./varargs I_VARARGS`; then
17904 echo "I could not find the definition for va_dcl... You have problems..." >&4
17905 val="$undef"; set i_stdarg; eval $setvar
17906 val="$undef"; set i_varargs; eval $setvar
17911 case "$i_varhdr" in
17913 val="$define"; set i_stdarg; eval $setvar
17914 val="$undef"; set i_varargs; eval $setvar
17917 val="$undef"; set i_stdarg; eval $setvar
17918 val="$define"; set i_varargs; eval $setvar
17921 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
17925 : see if we need va_copy
17927 case "$i_stdarg" in
17930 #include <stdarg.h>
17932 #$i_stdlib I_STDLIB
17934 #include <stdlib.h>
17936 #include <signal.h>
17939 ivfprintf(FILE *f, const char *fmt, va_list *valp)
17941 return vfprintf(f, fmt, *valp);
17945 myvfprintf(FILE *f, const char *fmt, va_list val)
17947 return ivfprintf(f, fmt, &val);
17951 myprintf(char *fmt, ...)
17954 va_start(val, fmt);
17955 return myvfprintf(stdout, fmt, val);
17959 main(int ac, char **av)
17961 signal(SIGSEGV, exit);
17963 myprintf("%s%cs all right, then\n", "that", '\'');
17968 if eval $compile && $run ./try 2>&1 >/dev/null; then
17969 case "`$run ./try`" in
17970 "that's all right, then")
17976 yes) echo "It seems that you don't need va_copy()." >&4
17977 need_va_copy="$undef"
17979 *) echo "It seems that va_copy() or similar will be needed." >&4
17980 need_va_copy="$define"
17983 $rm -f try.* core core.* *.core *.core.*
17985 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
17989 : see what type is used for size_t
17990 rp="What is the type used for the length parameter for string functions?"
17991 set size_t sizetype 'unsigned int' stdio.h sys/types.h
17994 : check for type of arguments to gethostbyaddr.
17995 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
17996 case "$d_gethbyaddr" in
18000 Checking to see what type of arguments are accepted by gethostbyaddr().
18002 hdrs="$define sys/types.h
18003 $d_socket sys/socket.h
18004 $i_niin netinet/in.h
18006 $i_unistd unistd.h"
18007 : The first arg can 'char *' or 'void *'
18008 : The second arg is some of integral type
18009 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
18010 for yyy in size_t long int; do
18011 case "$netdb_host_type" in
18012 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
18013 if ./protochk "$try" $hdrs; then
18014 echo "Your system accepts $xxx for the first arg."
18015 echo "...and $yyy for the second arg."
18016 netdb_host_type="$xxx"
18017 netdb_hlen_type="$yyy"
18023 : In case none of those worked, prompt the user.
18024 case "$netdb_host_type" in
18025 '') rp='What is the type for the 1st argument to gethostbyaddr?'
18028 netdb_host_type=$ans
18029 rp='What is the type for the 2nd argument to gethostbyaddr?'
18032 netdb_hlen_type=$ans
18036 *) : no gethostbyaddr, so pick harmless defaults
18037 netdb_host_type='char *'
18038 netdb_hlen_type="$sizetype"
18041 # Remove the "const" if needed. -- but then we'll have a
18043 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
18046 : check for type of argument to gethostbyname.
18047 if test "X$netdb_name_type" = X ; then
18048 case "$d_gethbyname" in
18052 Checking to see what type of argument is accepted by gethostbyname().
18054 hdrs="$define sys/types.h
18055 $d_socket sys/socket.h
18056 $i_niin netinet/in.h
18058 $i_unistd unistd.h"
18059 for xxx in "const char *" "char *"; do
18060 case "$netdb_name_type" in
18061 '') try="extern struct hostent *gethostbyname($xxx);"
18062 if ./protochk "$try" $hdrs; then
18063 echo "Your system accepts $xxx."
18064 netdb_name_type="$xxx"
18069 : In case none of those worked, prompt the user.
18070 case "$netdb_name_type" in
18071 '') rp='What is the type for the 1st argument to gethostbyname?'
18074 netdb_name_type=$ans
18078 *) : no gethostbyname, so pick harmless default
18079 netdb_name_type='char *'
18084 : check for type of 1st argument to getnetbyaddr.
18085 if test "X$netdb_net_type" = X ; then
18086 case "$d_getnbyaddr" in
18090 Checking to see what type of 1st argument is accepted by getnetbyaddr().
18092 hdrs="$define sys/types.h
18093 $d_socket sys/socket.h
18094 $i_niin netinet/in.h
18096 $i_unistd unistd.h"
18097 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
18098 case "$netdb_net_type" in
18099 '') try="extern struct netent *getnetbyaddr($xxx, int);"
18100 if ./protochk "$try" $hdrs; then
18101 echo "Your system accepts $xxx."
18102 netdb_net_type="$xxx"
18107 : In case none of those worked, prompt the user.
18108 case "$netdb_net_type" in
18109 '') rp='What is the type for the 1st argument to getnetbyaddr?'
18112 netdb_net_type=$ans
18116 *) : no getnetbyaddr, so pick harmless default
18117 netdb_net_type='long'
18121 : locate the preferred pager for this system
18127 [a-zA-Z]:/*) dflt=$pg;;
18131 [a-zA-Z]:/*) dflt=$more;;
18135 [a-zA-Z]:/*) dflt=$less;;
18138 '') dflt=/usr/ucb/more;;
18145 rp='What pager is used on your system?'
18149 : see what type pids are declared as in the kernel
18150 rp="What is the type of process ids on this system?"
18151 set pid_t pidtype int stdio.h sys/types.h
18154 : Find earliest binary compatible site_perl subdirectory perl can use.
18155 case "$bincompat5005" in
18156 "$define") xs_apiversion='5.005' ;;
18157 *) xs_apiversion=$version ;; # The current site_perl version.
18159 : Find earliest pure perl site_perl subdirectory perl can use.
18160 : The versioned directories started at 5.005.
18161 pm_apiversion='5.005'
18163 : see if ar generates random libraries by itself
18165 echo "Checking how to generate random libraries on your machine..." >&4
18166 echo 'int bar1() { return bar2(); }' > bar1.c
18167 echo 'int bar2() { return 2; }' > bar2.c
18168 $cat > foo.c <<'EOP'
18169 int main() { printf("%d\n", bar1()); exit(0); }
18171 $cc $ccflags -c bar1.c >/dev/null 2>&1
18172 $cc $ccflags -c bar2.c >/dev/null 2>&1
18173 $cc $ccflags -c foo.c >/dev/null 2>&1
18174 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
18175 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
18176 $run ./foobar >/dev/null 2>&1; then
18177 echo "$ar appears to generate random libraries itself."
18180 elif $ar ts bar$_a >/dev/null 2>&1 &&
18181 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
18182 $run ./foobar >/dev/null 2>&1; then
18183 echo "a table of contents needs to be added with '$ar ts'."
18190 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
18191 $test -f $ranlib || ranlib=''
18194 if $test -n "$ranlib"; then
18195 echo "your system has '$ranlib'; we'll use that."
18198 echo "your system doesn't seem to support random libraries"
18199 echo "so we'll use lorder and tsort to order the libraries."
18206 : check for type of arguments to select.
18207 case "$selecttype" in
18208 '') case "$d_select" in
18212 Checking to see what type of arguments are accepted by select().
18214 hdrs="$define sys/types.h
18215 $i_systime sys/time.h
18216 $i_sysselct sys/select.h
18217 $d_socket sys/socket.h"
18218 : The first arg can be int, unsigned, or size_t
18219 : The last arg may or may not be 'const'
18221 : void pointer has been seen but using that
18222 : breaks the selectminbits test
18223 for xxx in 'fd_set *' 'int *'; do
18224 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
18225 for tmo in 'struct timeval *' 'const struct timeval *'; do
18227 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
18228 if ./protochk "$try" $hdrs; then
18229 echo "Your system accepts $xxx."
18238 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
18239 case "$d_fd_set" in
18240 $define) dflt="fd_set *" ;;
18249 *) : no select, so pick a harmless default
18256 : check for the select 'width'
18257 case "$selectminbits" in
18258 '') case "$d_select" in
18262 Checking to see on how many bits at a time your select() operates...
18265 #include <sys/types.h>
18267 #$i_systime I_SYS_TIME
18268 #$i_systimek I_SYS_TIME_KERNEL
18273 # ifdef I_SYS_TIME_KERNEL
18276 # include <sys/time.h>
18277 # ifdef I_SYS_TIME_KERNEL
18281 #$i_sysselct I_SYS_SELECT
18282 #ifdef I_SYS_SELECT
18283 #include <sys/select.h>
18285 #$d_socket HAS_SOCKET
18287 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
18291 #define S sizeof(*(b))
18293 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
18294 #define NBITS (NBYTES * 8)
18303 fp = fopen("try.c", "r");
18309 b = ($selecttype)s;
18310 for (i = 0; i < NBITS; i++)
18314 select(fd + 1, b, 0, 0, &t);
18315 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
18316 printf("%d\n", i + 1);
18321 if eval $compile_ok; then
18322 selectminbits=`$run ./try`
18323 case "$selectminbits" in
18325 Cannot figure out on how many bits at a time your select() operates.
18326 I'll play safe and guess it is 32 bits.
18332 *) bits="$selectminbits bits" ;;
18334 echo "Your select() operates on $bits at a time." >&4
18336 rp='What is the minimum number of bits your select() operates on?'
18337 case "$byteorder" in
18338 1234|12345678) dflt=32 ;;
18343 selectminbits="$val"
18347 *) : no select, so pick a harmless default
18354 : Trace out the files included by signal.h, then look for SIGxxx names.
18355 : Remove SIGARRAYSIZE used by HPUX.
18356 : Remove SIGSTKSIZE used by Linux.
18357 : Remove SIGSTKSZ used by Posix.
18358 : Remove SIGTYP void lines used by OS2.
18359 : Some cpps, like os390, dont give the file name anywhere
18360 if [ "X$fieldn" = X ]; then
18361 : Just make some guesses. We check them later.
18362 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
18364 xxx=`echo '#include <signal.h>' |
18365 $cppstdin $cppminus $cppflags 2>/dev/null |
18366 $grep '^[ ]*#.*include' |
18367 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
18369 : Check this list of files to be sure we have parsed the cpp output ok.
18370 : This will also avoid potentially non-existent files, such
18373 for xx in $xxx /dev/null ; do
18374 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
18376 : If we have found no files, at least try signal.h
18377 case "$xxxfiles" in
18378 '') xxxfiles=`./findhdr signal.h` ;;
18381 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
18382 print substr($2, 4, 20)
18384 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
18385 print substr($3, 4, 20)
18387 : Append some common names just in case the awk scan failed.
18388 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
18389 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
18390 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
18391 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
18392 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
18394 : generate a few handy files for later
18395 $cat > signal.c <<'EOCP'
18396 #include <sys/types.h>
18397 #include <signal.h>
18401 /* Strange style to avoid deeply-nested #if/#else/#endif */
18404 # define NSIG (_NSIG)
18410 # define NSIG (SIGMAX+1)
18416 # define NSIG (SIG_MAX+1)
18422 # define NSIG (MAXSIG+1)
18428 # define NSIG (MAX_SIG+1)
18433 # ifdef SIGARRAYSIZE
18434 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
18440 # define NSIG (_sys_nsig) /* Solaris 2.5 */
18444 /* Default to some arbitrary number that's big enough to get most
18445 of the common signals.
18451 printf("NSIG %d\n", NSIG);
18457 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
18459 printf "#ifdef SIG"; printf $1; printf "\n"
18460 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
18461 printf $1; printf ");\n"
18465 printf "#endif /* JUST_NSIG */\n";
18466 printf "exit(0);\n}\n";
18469 $cat >signal.awk <<'EOP'
18470 BEGIN { ndups = 0 }
18471 $1 ~ /^NSIG$/ { nsig = $2 }
18472 ($1 !~ /^NSIG$/) && (NF == 2) {
18473 if ($2 > maxsig) { maxsig = $2 }
18474 if (sig_name[$2]) {
18475 dup_name[ndups] = $1
18476 dup_num[ndups] = $2
18488 printf("NSIG %d\n", nsig);
18489 for (n = 1; n < nsig; n++) {
18491 printf("%s %d\n", sig_name[n], sig_num[n])
18494 printf("NUM%d %d\n", n, n)
18497 for (n = 0; n < ndups; n++) {
18498 printf("%s %d\n", dup_name[n], dup_num[n])
18502 $cat >signal_cmd <<EOS
18504 if $test -s signal.lst; then
18505 echo "Using your existing signal.lst file"
18510 $cat >>signal_cmd <<'EOS'
18513 if eval $compile_ok; then
18514 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
18516 echo "(I can't seem be able to compile the whole test program)" >&4
18517 echo "(I'll try it in little pieces.)" >&4
18518 set signal -DJUST_NSIG
18519 if eval $compile_ok; then
18520 $run ./signal$_exe > signal.nsg
18523 echo "I can't seem to figure out how many signals you have." >&4
18524 echo "Guessing 50." >&4
18525 echo 'NSIG 50' > signal.nsg
18527 : Now look at all the signal names, one at a time.
18528 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
18529 $cat > signal.c <<EOCP
18530 #include <sys/types.h>
18531 #include <signal.h>
18534 printf("$xx %d\n", SIG${xx});
18539 if eval $compile; then
18540 echo "SIG${xx} found."
18541 $run ./signal$_exe >> signal.ls1
18543 echo "SIG${xx} NOT found."
18546 if $test -s signal.ls1; then
18547 $cat signal.nsg signal.ls1 |
18548 $sort -n | $uniq | $awk -f signal.awk >signal.lst
18552 if $test -s signal.lst; then
18555 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
18556 echo 'kill -l' >signal
18557 set X `csh -f <signal`
18561 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
18563 echo $@ | $tr ' ' $trnl | \
18564 $awk '{ printf "%s %d\n", $1, ++s; }
18565 END { printf "NSIG %d\n", ++s }' >signal.lst
18567 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
18569 chmod a+x signal_cmd
18570 $eunicefix signal_cmd
18572 : generate list of signal names
18574 case "$sig_name_init" in
18576 *) case "$sig_num_init" in
18577 ''|*,*) doinit=yes ;;
18582 echo "Generating a list of signal names and numbers..." >&4
18584 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
18585 sig_name=`$awk 'BEGIN { printf "ZERO " }
18586 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
18587 sig_num=`$awk 'BEGIN { printf "0 " }
18588 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
18589 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
18590 !/^NSIG/ { printf "\"%s\", ", $1 }
18591 END { printf "0\n" }' signal.lst`
18592 sig_num_init=`$awk 'BEGIN { printf "0, " }
18593 !/^NSIG/ { printf "%d, ", $2}
18594 END { printf "0\n"}' signal.lst`
18597 echo "The following $sig_count signals are available:"
18599 echo $sig_name | $awk \
18600 'BEGIN { linelen = 0 }
18602 for (i = 1; i <= NF; i++) {
18603 name = "SIG" $i " "
18604 linelen = linelen + length(name)
18605 if (linelen > 70) {
18607 linelen = length(name)
18613 sig_size=`echo $sig_name | awk '{print NF}'`
18614 $rm -f signal signal.c signal.awk signal.lst signal_cmd
18617 case "$sizetype" in
18618 *_t) zzz="$sizetype" ;;
18619 *) zzz="filesize" ;;
18621 echo "Checking the size of $zzz..." >&4
18623 #include <sys/types.h>
18626 printf("%d\n", (int)sizeof($sizetype));
18631 if eval $compile_ok; then
18635 echo "(I can't execute the test program--guessing $sizesize.)" >&4
18638 echo "Your $zzz size is $sizesize bytes."
18643 echo "(I can't compile the test program--guessing $sizesize.)" >&4
18647 : check for socklen_t
18649 echo "Checking to see if you have socklen_t..." >&4
18651 #include <sys/types.h>
18652 #$d_socket HAS_SOCKET
18654 #include <sys/socket.h>
18656 int main() { socklen_t x = 16; }
18659 if eval $compile; then
18661 echo "You have socklen_t."
18664 echo "You do not have socklen_t."
18665 case "$sizetype" in
18666 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
18673 : see if this is a socks.h system
18674 set socks.h i_socks
18677 : check for type of the size argument to socket calls
18678 case "$d_socket" in
18682 Checking to see what type is the last argument of accept().
18685 case "$d_socklen_t" in
18686 "$define") yyy="$yyy socklen_t"
18688 yyy="$yyy $sizetype int long unsigned"
18689 for xxx in $yyy; do
18690 case "$socksizetype" in
18691 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
18692 case "$usesocks" in
18694 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
18695 echo "Your system accepts '$xxx *' for the last argument of accept()."
18696 socksizetype="$xxx"
18699 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
18700 echo "Your system accepts '$xxx *' for the last argument of accept()."
18701 socksizetype="$xxx"
18708 : In case none of those worked, prompt the user.
18709 case "$socksizetype" in
18710 '') rp='What is the type for socket address structure sizes?'
18717 *) : no sockets, so pick relatively harmless default
18722 : see what type is used for signed size_t
18723 set ssize_t ssizetype int stdio.h sys/types.h
18728 #include <sys/types.h>
18729 #define Size_t $sizetype
18730 #define SSize_t $dflt
18733 if (sizeof(Size_t) == sizeof(SSize_t))
18735 else if (sizeof(Size_t) == sizeof(int))
18744 if eval $compile_ok && $run ./try > /dev/null; then
18745 ssizetype=`$run ./try`
18746 echo "I'll be using $ssizetype for functions returning a byte count." >&4
18749 Help! I can't compile and run the ssize_t test program: please enlighten me!
18750 (This is probably a misconfiguration in your system or libraries, and
18751 you really ought to fix it. Still, I'll try anyway.)
18753 I need a type that is the same size as $sizetype, but is guaranteed to
18754 be signed. Common values are ssize_t, int and long.
18757 rp="What signed type is the same size as $sizetype?"
18763 : see what type of char stdio uses.
18765 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
18766 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
18767 echo "Your stdio uses unsigned chars." >&4
18768 stdchar="unsigned char"
18770 echo "Your stdio uses signed chars." >&4
18777 : see what type uids are declared as in the kernel
18779 echo "Looking for the type for user ids returned by getuid()."
18780 set uid_t uidtype xxx stdio.h sys/types.h
18784 xxx=`./findhdr sys/user.h`
18785 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18787 unsigned) dflt="$1 $2" ;;
18791 *) dflt="$uidtype";;
18794 uid_t) echo "uid_t found." ;;
18795 *) rp="What is the type for user ids returned by getuid()?"
18803 *_t) zzz="$uidtype" ;;
18806 echo "Checking the size of $zzz..." >&4
18808 #include <sys/types.h>
18811 printf("%d\n", (int)sizeof($uidtype));
18816 if eval $compile_ok; then
18820 echo "(I can't execute the test program--guessing $uidsize.)" >&4
18823 echo "Your $zzz is $uidsize bytes long."
18828 echo "(I can't compile the test program--guessing $uidsize.)" >&4
18833 *_t) zzz="$uidtype" ;;
18836 echo "Checking the sign of $zzz..." >&4
18838 #include <sys/types.h>
18849 if eval $compile; then
18853 echo "(I can't execute the test program--guessing unsigned.)" >&4
18857 1) echo "Your $zzz is unsigned." ;;
18858 -1) echo "Your $zzz is signed." ;;
18864 echo "(I can't compile the test program--guessing unsigned.)" >&4
18870 $echo "Checking the format string to be used for uids..." >&4
18873 -1) if $test X"$uidsize" = X"$ivsize"; then
18874 uidformat="$ivdformat"
18876 if $test X"$uidsize" = X"$longsize"; then
18879 if $test X"$uidsize" = X"$intsize"; then
18882 if $test X"$uidsize" = X"$shortsize"; then
18889 *) if $test X"$uidsize" = X"$uvsize"; then
18890 uidformat="$uvuformat"
18892 if $test X"$uidsize" = X"$longsize"; then
18895 if $test X"$uidsize" = X"$intsize"; then
18898 if $test X"$uidsize" = X"$shortsize"; then
18907 : determine compiler compiler
18916 if $test -f "$byacc$_exe"; then
18918 comp="byacc or $comp"
18920 if $test -f "$bison$_exe"; then
18921 comp="$comp or bison -y"
18923 rp="Which compiler compiler ($comp) shall I use?"
18932 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
18938 : see if this is a fp.h system
18942 : see if this is a fp_class.h system
18943 set fp_class.h i_fp_class
18946 : see if this is a ieeefp.h system
18947 case "$i_ieeefp" in
18948 '' ) set ieeefp.h i_ieeefp
18953 : see if this is a libutil.h system
18954 set libutil.h i_libutil
18957 : see if mach cthreads are available
18958 if test "X$usethreads" = "X$define"; then
18959 set mach/cthreads.h i_machcthr
18962 i_machcthr="$undef"
18967 : see if this is a math.h system
18971 : see if this is a mntent.h system
18972 set mntent.h i_mntent
18975 : see if ndbm.h is available
18981 # Some Linux distributions such as RedHat 7.1 put the
18982 # ndbm.h header in /usr/include/gdbm/ndbm.h.
18983 if $test -f /usr/include/gdbm/ndbm.h; then
18984 echo '<gdbm/ndbm.h> found.'
18985 ccflags="$ccflags -I/usr/include/gdbm"
18986 cppflags="$cppflags -I/usr/include/gdbm"
18994 : see if dbm_open exists
18995 set dbm_open d_dbm_open
18997 case "$d_dbm_open" in
19000 echo "We won't be including <ndbm.h>"
19009 : see if net/errno.h is available
19011 set net/errno.h val
19014 : Unfortunately, it causes problems on some systems. Arrgh.
19017 cat > try.c <<'EOM'
19020 #include <net/errno.h>
19026 if $cc $ccflags -c try.c >/dev/null 2>&1; then
19027 echo "We'll be including <net/errno.h>." >&4
19029 echo "We won't be including <net/errno.h>." >&4
19038 : see if netinet/tcp.h is available
19039 set netinet/tcp.h i_netinettcp
19042 : see if this is a poll.h system
19046 : see if this is a prot.h system
19051 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
19052 $cat <<'EOSH' > Cppsym.know
19053 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
19054 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
19055 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
19056 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
19057 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
19058 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
19059 bull c cadmus clipper CMU COFF COMPILER_VERSION
19060 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
19061 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
19062 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
19063 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
19065 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
19066 H3050R H3050RX hbullx20 hcx host_mips
19067 hp200 hp300 hp700 HP700 hp800 hp9000
19068 hp9000s200 hp9000s300 hp9000s400 hp9000s500
19069 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
19070 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
19071 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
19072 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
19073 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
19074 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
19075 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
19076 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
19077 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
19078 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
19079 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
19080 MATH_HAS_NO_SIDE_EFFECTS
19081 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
19082 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
19083 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
19084 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
19085 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
19086 NetBSD news1500 news1700 news1800 news1900 news3700
19087 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
19088 ns32016 ns32332 ns32k nsc32000
19089 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
19090 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
19091 pc532 pdp11 PGC PIC plexus PORTAR posix
19092 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
19093 POSIX_C_SOURCE POSIX_SOURCE POWER
19094 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
19095 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
19096 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
19097 sony sony_news sonyrisc sparc sparclite spectrum
19098 stardent stdc STDC_EXT stratos sun sun3 sun386
19099 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
19100 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
19101 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
19102 sysV68 sysV88 Tek4132 Tek4300 titan
19103 TM3200 TM5400 TM5600
19104 tower tower32 tower32_200 tower32_600 tower32_700
19105 tower32_800 tower32_850 tss
19106 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
19107 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
19108 unix UNIX95 UNIX99 unixpc unos
19109 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
19110 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
19111 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
19113 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
19114 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
19115 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
19118 # Maybe put other stuff here too.
19119 cat <<EOSH >>Cppsym.know
19122 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
19123 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
19124 $cat Cppsym.know > Cppsym.c
19125 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
19126 $rm -f Cppsym.a Cppsym.b Cppsym.c
19127 cat <<EOSH > Cppsym
19129 if $test \$# -gt 0; then
19130 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
19131 if $test -s Cppsym.got; then
19138 $tr " " "$trnl" | ./Cppsym.try
19144 cat <<EOSH > Cppsym.try
19146 cat <<'EOCP' > try.c
19152 cat <<'EOSH' >> Cppsym.try
19154 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
19155 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
19156 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
19157 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
19159 echo 'return 0;}' >> try.c
19161 cat <<EOSH >> Cppsym.try
19163 case "$osname-$gccversion" in
19164 irix-) ccflags="\$ccflags -woff 1178" ;;
19165 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
19167 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
19169 chmod +x Cppsym.try
19170 $eunicefix Cppsym.try
19171 ./Cppsym < Cppsym.know > Cppsym.true
19172 : now check the C compiler for additional symbols
19173 postprocess_cc_v=''
19175 aix) postprocess_cc_v="|$tr , ' '" ;;
19182 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
19185 -D*) echo "\$i" | $sed 's/^-D//';;
19186 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
19191 postprocess_cc_v=''
19194 ./ccsym > ccsym1.raw
19195 if $test -s ccsym1.raw; then
19196 $sort ccsym1.raw | $uniq >ccsym.raw
19198 mv ccsym1.raw ccsym.raw
19201 $awk '/\=/ { print $0; next }
19202 { print $0"=1" }' ccsym.raw >ccsym.list
19203 $awk '/\=/ { print $0; next }
19204 { print $0"=1" }' Cppsym.true >ccsym.true
19205 $comm -13 ccsym.true ccsym.list >ccsym.own
19206 $comm -12 ccsym.true ccsym.list >ccsym.com
19207 $comm -23 ccsym.true ccsym.list >ccsym.cpp
19209 if $test -z ccsym.raw; then
19210 echo "Your C compiler doesn't seem to define any symbols!" >&4
19212 echo "However, your C preprocessor defines the following symbols:"
19215 cppsymbols=`$cat Cppsym.true`
19216 cppsymbols=`echo $cppsymbols`
19217 cppccsymbols="$cppsymbols"
19219 if $test -s ccsym.com; then
19220 echo "Your C compiler and pre-processor define these symbols:"
19221 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
19224 cppccsymbols=`$cat ccsym.com`
19225 cppccsymbols=`echo $cppccsymbols`
19226 $test "$silent" || sleep 1
19228 if $test -s ccsym.cpp; then
19229 $test "$also" && echo " "
19230 echo "Your C pre-processor ${also}defines the following symbols:"
19231 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
19233 cppsymbols=`$cat ccsym.cpp`
19234 cppsymbols=`echo $cppsymbols`
19235 $test "$silent" || sleep 1
19237 if $test -s ccsym.own; then
19238 $test "$also" && echo " "
19239 echo "Your C compiler ${also}defines the following cpp symbols:"
19240 $sed -e 's/\(..*\)=1/\1/' ccsym.own
19241 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
19242 ccsymbols=`$cat ccsym.own`
19243 ccsymbols=`echo $ccsymbols`
19244 $test "$silent" || sleep 1
19248 : see if this is a termio system
19252 if $test `./findhdr termios.h`; then
19253 set tcsetattr i_termios
19259 "$define") echo "You have POSIX termios.h... good!" >&4;;
19260 *) if ./Cppsym pyr; then
19261 case "`/bin/universe`" in
19262 ucb) if $test `./findhdr sgtty.h`; then
19264 echo "<sgtty.h> found." >&4
19266 echo "System is pyramid with BSD universe."
19267 echo "<sgtty.h> not found--you could have problems." >&4
19269 *) if $test `./findhdr termio.h`; then
19271 echo "<termio.h> found." >&4
19273 echo "System is pyramid with USG universe."
19274 echo "<termio.h> not found--you could have problems." >&4
19278 if $test `./findhdr termio.h`; then
19279 echo "<termio.h> found." >&4
19281 elif $test `./findhdr sgtty.h`; then
19282 echo "<sgtty.h> found." >&4
19285 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
19288 if $test `./findhdr sgtty.h`; then
19289 echo "<sgtty.h> found." >&4
19291 elif $test `./findhdr termio.h`; then
19292 echo "<termio.h> found." >&4
19295 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
19299 set i_termio; eval $setvar
19300 val=$val2; set i_sgtty; eval $setvar
19301 val=$val3; set i_termios; eval $setvar
19303 : see if stddef is available
19304 set stddef.h i_stddef
19307 : see if this is a sunmath.h system
19308 set sunmath.h i_sunmath
19311 : see if sys/access.h is available
19312 set sys/access.h i_sysaccess
19315 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
19316 set sys/filio.h i_sysfilio
19319 if $test `./findhdr sys/ioctl.h`; then
19321 echo '<sys/ioctl.h> found.' >&4
19324 if $test $i_sysfilio = "$define"; then
19325 echo '<sys/ioctl.h> NOT found.' >&4
19327 $test $i_sgtty = "$define" && xxx="sgtty.h"
19328 $test $i_termio = "$define" && xxx="termio.h"
19329 $test $i_termios = "$define" && xxx="termios.h"
19330 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
19336 : see if socket ioctl defs are in sys/sockio.h
19338 xxx=`./findhdr sys/sockio.h`
19339 if $test "$xxx"; then
19340 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
19342 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
19345 echo "No socket ioctls found in <sys/sockio.h>." >&4
19350 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
19357 : see if this is a syslog.h system
19358 set syslog.h i_syslog
19362 : see if this is a sys/mode.h system
19363 set sys/mode.h i_sysmode
19366 : see if sys/resource.h has to be included
19367 set sys/resource.h i_sysresrc
19370 : see if sys/security.h is available
19371 set sys/security.h i_syssecrt
19374 : see if this is a sys/statvfs.h system
19375 set sys/statvfs.h i_sysstatvfs
19378 : see if this is a sys/un.h system
19379 set sys/un.h i_sysun
19383 : see if this is a sys/utsname.h system
19384 set sys/utsname.h i_sysutsname
19387 : see if this is a syswait system
19388 set sys/wait.h i_syswait
19391 : see if this is a ustat.h system
19392 set ustat.h i_ustat
19395 : see if this is an utime system
19396 set utime.h i_utime
19399 : see if this is a values.h system
19400 set values.h i_values
19403 : see if this is a vfork system
19406 set vfork.h i_vfork
19414 : see if gdbm.h is available
19419 : see if gdbm_open exists
19420 set gdbm_open d_gdbm_open
19422 case "$d_gdbm_open" in
19425 echo "We won't be including <gdbm.h>"
19435 echo "Looking for extensions..." >&4
19436 : If we are using the old config.sh, known_extensions may contain
19437 : old or inaccurate or duplicate values.
19438 known_extensions=''
19439 nonxs_extensions=''
19440 : We do not use find because it might not be available.
19441 : We do not just use MANIFEST because the user may have dropped
19442 : some additional extensions into the source tree and expect them
19445 : Function to recursively find available extensions, ignoring DynaLoader
19446 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
19450 DynaLoader|dynaload) ;;
19452 if $test -f $xxx/$xxx.xs; then
19453 known_extensions="$known_extensions $1$xxx";
19454 elif $test -f $xxx/Makefile.PL; then
19455 nonxs_extensions="$nonxs_extensions $1$xxx";
19457 if $test -d $xxx -a $# -lt 10; then
19460 eval $find_extensions;
19472 eval $find_extensions
19473 # Special case: Add in threads/shared since it is not picked up by the
19474 # recursive find above (and adding in general recursive finding breaks
19475 # SDBM_File/sdbm). A.D. 10/25/2001.
19476 known_extensions="$known_extensions threads/shared"
19477 set X $nonxs_extensions
19479 nonxs_extensions="$*"
19480 set X $known_extensions
19482 known_extensions="$*"
19485 : Now see which are supported on this system.
19487 for xxx in $known_extensions ; do
19491 $define) avail_ext="$avail_ext $xxx" ;;
19494 GDBM_File|gdbm_fil)
19496 $define) avail_ext="$avail_ext $xxx" ;;
19499 I18N/Langinfo|i18n_lan)
19500 case "$i_langinfo$d_nl_langinfo" in
19501 $define$define) avail_ext="$avail_ext $xxx" ;;
19504 NDBM_File|ndbm_fil)
19507 case "$osname-$use64bitint" in
19508 cygwin-*|hpux-define)
19510 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
19513 *) avail_ext="$avail_ext $xxx" ;;
19518 ODBM_File|odbm_fil)
19519 case "${i_dbm}${i_rpcsvcdbm}" in
19521 case "$osname-$use64bitint" in
19522 cygwin-*|hpux-define)
19524 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
19527 *) avail_ext="$avail_ext $xxx" ;;
19533 case "$useposix" in
19534 true|define|y) avail_ext="$avail_ext $xxx" ;;
19538 case "$useopcode" in
19539 true|define|y) avail_ext="$avail_ext $xxx" ;;
19543 case "$d_socket" in
19546 beos) ;; # not unless BONE
19547 *) avail_ext="$avail_ext $xxx" ;;
19552 Sys/Syslog|sys/syslog)
19553 : XXX syslog requires socket
19554 case "$d_socket" in
19555 true|$define|y) avail_ext="$avail_ext $xxx" ;;
19559 case "$usethreads" in
19561 case "$useithreads" in
19562 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
19566 threads|threads/shared)
19567 case "$usethreads" in
19569 case "$useithreads" in
19570 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
19575 : XXX Do we need a useipcsysv variable here
19576 case "${d_msg}${d_sem}${d_shm}" in
19577 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
19580 *) avail_ext="$avail_ext $xxx"
19589 : Now see which nonxs extensions are supported on this system.
19590 : For now assume all are.
19592 for xxx in $nonxs_extensions ; do
19594 *) nonxs_ext="$nonxs_ext $xxx"
19606 A number of extensions are supplied with $package. You may choose to
19607 compile these extensions for dynamic loading (the default), compile
19608 them into the $package executable (static loading), or not include
19609 them at all. Answer "none" to include no extensions.
19610 Note that DynaLoader is always built and need not be mentioned here.
19613 case "$dynamic_ext" in
19614 '') dflt="$avail_ext" ;;
19615 *) dflt="$dynamic_ext"
19616 # Perhaps we are reusing an old out-of-date config.sh.
19619 if test X"$dynamic_ext" != X"$avail_ext"; then
19621 NOTICE: Your previous config.sh list may be incorrect.
19622 The extensions now available to you are
19624 but the default list from your previous config.sh is
19636 rp="What extensions do you wish to load dynamically?"
19639 none) dynamic_ext=' ' ;;
19640 *) dynamic_ext="$ans" ;;
19643 case "$static_ext" in
19645 : Exclude those already listed in dynamic linking
19647 for xxx in $avail_ext; do
19648 case " $dynamic_ext " in
19650 *) dflt="$dflt $xxx" ;;
19657 *) dflt="$static_ext"
19664 rp="What extensions do you wish to load statically?"
19667 none) static_ext=' ' ;;
19668 *) static_ext="$ans" ;;
19673 A number of extensions are supplied with $package. Answer "none"
19674 to include no extensions.
19675 Note that DynaLoader is always built and need not be mentioned here.
19678 case "$static_ext" in
19679 '') dflt="$avail_ext" ;;
19680 *) dflt="$static_ext"
19681 # Perhaps we are reusing an old out-of-date config.sh.
19684 if test X"$static_ext" != X"$avail_ext"; then
19686 NOTICE: Your previous config.sh list may be incorrect.
19687 The extensions now available to you are
19689 but the default list from your previous config.sh is
19698 : Exclude those that are not xs extensions
19701 *) case " $dflt " in
19702 *" Encode "*) # Add the subextensions of Encode
19704 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
19705 dflt="$dflt Encode/$xxx"
19712 rp="What extensions do you wish to include?"
19715 none) static_ext=' ' ;;
19716 *) static_ext="$ans" ;;
19721 set X $dynamic_ext $static_ext $nonxs_ext
19725 : Remove libraries needed only for extensions
19726 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
19727 : The exception is SunOS 4.x, which needs them.
19728 case "${osname}X${osvers}" in
19732 *) case "$usedl" in
19733 $define|true|[yY]*)
19734 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
19738 *) perllibs="$libs"
19744 : Remove build directory name from cppstdin so it can be used from
19745 : either the present location or the final installed location.
19747 : Get out of the UU directory to get correct path name.
19749 case "$cppstdin" in
19751 echo "Stripping down cppstdin path name"
19757 : end of configuration questions
19759 echo "End of configuration questions."
19762 : back to where it started
19763 if test -d ../UU; then
19767 : configuration may be patched via a 'config.arch' file
19768 if $test -f config.arch; then
19769 echo "I see a config.arch file, loading it."
19773 : configuration may be patched via a 'config.over' file
19774 if $test -f config.over; then
19777 rp='I see a config.over file. Do you wish to load it?'
19780 n*) echo "OK, I'll ignore it.";;
19782 echo "Configuration override changes have been loaded."
19787 : in case they want portability, strip down executable paths
19788 case "$d_portable" in
19791 echo "Stripping down executable paths..." >&4
19792 for file in $loclist $trylist; do
19794 eval $file=`basename $temp`
19799 : create config.sh file
19801 echo "Creating config.sh..." >&4
19802 $spitshell <<EOT >config.sh
19805 # This file was produced by running the Configure script. It holds all the
19806 # definitions figured out by Configure. Should you modify one of these values,
19807 # do not forget to propagate your changes by running "Configure -der". You may
19808 # instead choose to run each of the .SH files by yourself, or "Configure -S".
19811 # Package name : $package
19812 # Source directory : $src
19813 # Configuration time: $cf_time
19814 # Configured by : $cf_by
19815 # Target system : $myuname
19825 Revision='$Revision'
19833 alignbytes='$alignbytes'
19834 ansi2knr='$ansi2knr'
19835 aphostname='$aphostname'
19836 api_revision='$api_revision'
19837 api_subversion='$api_subversion'
19838 api_version='$api_version'
19839 api_versionstring='$api_versionstring'
19842 archlibexp='$archlibexp'
19843 archname64='$archname64'
19844 archname='$archname'
19845 archobjs='$archobjs'
19846 asctime_r_proto='$asctime_r_proto'
19851 bincompat5005='$bincompat5005'
19855 byteorder='$byteorder'
19857 castflags='$castflags'
19860 cccdlflags='$cccdlflags'
19861 ccdlflags='$ccdlflags'
19863 ccflags_uselargefiles='$ccflags_uselargefiles'
19865 ccsymbols='$ccsymbols'
19866 ccversion='$ccversion'
19868 cf_email='$cf_email'
19870 charsize='$charsize'
19874 clocktype='$clocktype'
19876 compress='$compress'
19877 contains='$contains'
19881 cpp_stuff='$cpp_stuff'
19882 cppccsymbols='$cppccsymbols'
19883 cppflags='$cppflags'
19885 cppminus='$cppminus'
19887 cppstdin='$cppstdin'
19888 cppsymbols='$cppsymbols'
19889 crypt_r_proto='$crypt_r_proto'
19890 cryptlib='$cryptlib'
19892 ctermid_r_proto='$ctermid_r_proto'
19893 ctime_r_proto='$ctime_r_proto'
19894 d_Gconvert='$d_Gconvert'
19895 d_PRIEUldbl='$d_PRIEUldbl'
19896 d_PRIFUldbl='$d_PRIFUldbl'
19897 d_PRIGUldbl='$d_PRIGUldbl'
19898 d_PRIXU64='$d_PRIXU64'
19899 d_PRId64='$d_PRId64'
19900 d_PRIeldbl='$d_PRIeldbl'
19901 d_PRIfldbl='$d_PRIfldbl'
19902 d_PRIgldbl='$d_PRIgldbl'
19903 d_PRIi64='$d_PRIi64'
19904 d_PRIo64='$d_PRIo64'
19905 d_PRIu64='$d_PRIu64'
19906 d_PRIx64='$d_PRIx64'
19907 d_SCNfldbl='$d_SCNfldbl'
19908 d__fwalk='$d__fwalk'
19909 d_access='$d_access'
19910 d_accessx='$d_accessx'
19912 d_archlib='$d_archlib'
19913 d_asctime_r='$d_asctime_r'
19916 d_attribut='$d_attribut'
19919 d_bincompat5005='$d_bincompat5005'
19921 d_bsdgetpgrp='$d_bsdgetpgrp'
19922 d_bsdsetpgrp='$d_bsdsetpgrp'
19924 d_casti32='$d_casti32'
19925 d_castneg='$d_castneg'
19926 d_charvspr='$d_charvspr'
19928 d_chroot='$d_chroot'
19929 d_chsize='$d_chsize'
19931 d_closedir='$d_closedir'
19932 d_cmsghdr_s='$d_cmsghdr_s'
19935 d_crypt_r='$d_crypt_r'
19937 d_ctermid_r='$d_ctermid_r'
19938 d_ctime_r='$d_ctime_r'
19939 d_cuserid='$d_cuserid'
19940 d_dbl_dig='$d_dbl_dig'
19941 d_dbminitproto='$d_dbminitproto'
19942 d_difftime='$d_difftime'
19944 d_dirnamlen='$d_dirnamlen'
19945 d_dlerror='$d_dlerror'
19946 d_dlopen='$d_dlopen'
19947 d_dlsymun='$d_dlsymun'
19948 d_dosuid='$d_dosuid'
19949 d_drand48_r='$d_drand48_r'
19950 d_drand48proto='$d_drand48proto'
19952 d_eaccess='$d_eaccess'
19953 d_endgrent='$d_endgrent'
19954 d_endgrent_r='$d_endgrent_r'
19955 d_endhent='$d_endhent'
19956 d_endhostent_r='$d_endhostent_r'
19957 d_endnent='$d_endnent'
19958 d_endnetent_r='$d_endnetent_r'
19959 d_endpent='$d_endpent'
19960 d_endprotoent_r='$d_endprotoent_r'
19961 d_endpwent='$d_endpwent'
19962 d_endpwent_r='$d_endpwent_r'
19963 d_endsent='$d_endsent'
19964 d_endservent_r='$d_endservent_r'
19965 d_eofnblk='$d_eofnblk'
19966 d_eunice='$d_eunice'
19967 d_fchdir='$d_fchdir'
19968 d_fchmod='$d_fchmod'
19969 d_fchown='$d_fchown'
19971 d_fcntl_can_lock='$d_fcntl_can_lock'
19972 d_fd_macros='$d_fd_macros'
19973 d_fd_set='$d_fd_set'
19974 d_fds_bits='$d_fds_bits'
19975 d_fgetpos='$d_fgetpos'
19976 d_finite='$d_finite'
19977 d_finitel='$d_finitel'
19978 d_flexfnam='$d_flexfnam'
19980 d_flockproto='$d_flockproto'
19982 d_fp_class='$d_fp_class'
19983 d_fpathconf='$d_fpathconf'
19984 d_fpclass='$d_fpclass'
19985 d_fpclassify='$d_fpclassify'
19986 d_fpclassl='$d_fpclassl'
19987 d_fpos64_t='$d_fpos64_t'
19988 d_frexpl='$d_frexpl'
19989 d_fs_data_s='$d_fs_data_s'
19990 d_fseeko='$d_fseeko'
19991 d_fsetpos='$d_fsetpos'
19992 d_fstatfs='$d_fstatfs'
19993 d_fstatvfs='$d_fstatvfs'
19995 d_ftello='$d_ftello'
19997 d_getcwd='$d_getcwd'
19998 d_getespwnam='$d_getespwnam'
19999 d_getfsstat='$d_getfsstat'
20000 d_getgrent='$d_getgrent'
20001 d_getgrent_r='$d_getgrent_r'
20002 d_getgrgid_r='$d_getgrgid_r'
20003 d_getgrnam_r='$d_getgrnam_r'
20004 d_getgrps='$d_getgrps'
20005 d_gethbyaddr='$d_gethbyaddr'
20006 d_gethbyname='$d_gethbyname'
20007 d_gethent='$d_gethent'
20008 d_gethname='$d_gethname'
20009 d_gethostbyaddr_r='$d_gethostbyaddr_r'
20010 d_gethostbyname_r='$d_gethostbyname_r'
20011 d_gethostent_r='$d_gethostent_r'
20012 d_gethostprotos='$d_gethostprotos'
20013 d_getitimer='$d_getitimer'
20014 d_getlogin='$d_getlogin'
20015 d_getlogin_r='$d_getlogin_r'
20016 d_getmnt='$d_getmnt'
20017 d_getmntent='$d_getmntent'
20018 d_getnbyaddr='$d_getnbyaddr'
20019 d_getnbyname='$d_getnbyname'
20020 d_getnent='$d_getnent'
20021 d_getnetbyaddr_r='$d_getnetbyaddr_r'
20022 d_getnetbyname_r='$d_getnetbyname_r'
20023 d_getnetent_r='$d_getnetent_r'
20024 d_getnetprotos='$d_getnetprotos'
20025 d_getpagsz='$d_getpagsz'
20026 d_getpbyname='$d_getpbyname'
20027 d_getpbynumber='$d_getpbynumber'
20028 d_getpent='$d_getpent'
20029 d_getpgid='$d_getpgid'
20030 d_getpgrp2='$d_getpgrp2'
20031 d_getpgrp='$d_getpgrp'
20032 d_getppid='$d_getppid'
20033 d_getprior='$d_getprior'
20034 d_getprotobyname_r='$d_getprotobyname_r'
20035 d_getprotobynumber_r='$d_getprotobynumber_r'
20036 d_getprotoent_r='$d_getprotoent_r'
20037 d_getprotoprotos='$d_getprotoprotos'
20038 d_getprpwnam='$d_getprpwnam'
20039 d_getpwent='$d_getpwent'
20040 d_getpwent_r='$d_getpwent_r'
20041 d_getpwnam_r='$d_getpwnam_r'
20042 d_getpwuid_r='$d_getpwuid_r'
20043 d_getsbyname='$d_getsbyname'
20044 d_getsbyport='$d_getsbyport'
20045 d_getsent='$d_getsent'
20046 d_getservbyname_r='$d_getservbyname_r'
20047 d_getservbyport_r='$d_getservbyport_r'
20048 d_getservent_r='$d_getservent_r'
20049 d_getservprotos='$d_getservprotos'
20050 d_getspnam='$d_getspnam'
20051 d_getspnam_r='$d_getspnam_r'
20052 d_gettimeod='$d_gettimeod'
20053 d_gmtime_r='$d_gmtime_r'
20054 d_gnulibc='$d_gnulibc'
20055 d_grpasswd='$d_grpasswd'
20056 d_hasmntopt='$d_hasmntopt'
20059 d_inetaton='$d_inetaton'
20060 d_int64_t='$d_int64_t'
20061 d_isascii='$d_isascii'
20062 d_isfinite='$d_isfinite'
20065 d_isnanl='$d_isnanl'
20066 d_killpg='$d_killpg'
20067 d_lchown='$d_lchown'
20068 d_ldbl_dig='$d_ldbl_dig'
20070 d_localtime_r='$d_localtime_r'
20071 d_locconv='$d_locconv'
20073 d_longdbl='$d_longdbl'
20074 d_longlong='$d_longlong'
20075 d_lseekproto='$d_lseekproto'
20077 d_madvise='$d_madvise'
20079 d_mbstowcs='$d_mbstowcs'
20080 d_mbtowc='$d_mbtowc'
20081 d_memchr='$d_memchr'
20082 d_memcmp='$d_memcmp'
20083 d_memcpy='$d_memcpy'
20084 d_memmove='$d_memmove'
20085 d_memset='$d_memset'
20087 d_mkdtemp='$d_mkdtemp'
20088 d_mkfifo='$d_mkfifo'
20089 d_mkstemp='$d_mkstemp'
20090 d_mkstemps='$d_mkstemps'
20091 d_mktime='$d_mktime'
20094 d_modfl_pow32_bug='$d_modfl_pow32_bug'
20095 d_mprotect='$d_mprotect'
20097 d_msg_ctrunc='$d_msg_ctrunc'
20098 d_msg_dontroute='$d_msg_dontroute'
20099 d_msg_oob='$d_msg_oob'
20100 d_msg_peek='$d_msg_peek'
20101 d_msg_proxy='$d_msg_proxy'
20102 d_msgctl='$d_msgctl'
20103 d_msgget='$d_msgget'
20104 d_msghdr_s='$d_msghdr_s'
20105 d_msgrcv='$d_msgrcv'
20106 d_msgsnd='$d_msgsnd'
20108 d_munmap='$d_munmap'
20109 d_mymalloc='$d_mymalloc'
20111 d_nl_langinfo='$d_nl_langinfo'
20112 d_nv_preserves_uv='$d_nv_preserves_uv'
20113 d_off64_t='$d_off64_t'
20114 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
20115 d_oldpthreads='$d_oldpthreads'
20116 d_oldsock='$d_oldsock'
20118 d_pathconf='$d_pathconf'
20120 d_perl_otherlibdirs='$d_perl_otherlibdirs'
20121 d_phostname='$d_phostname'
20124 d_portable='$d_portable'
20125 d_procselfexe='$d_procselfexe'
20126 d_pthread_atfork='$d_pthread_atfork'
20127 d_pthread_yield='$d_pthread_yield'
20129 d_pwchange='$d_pwchange'
20130 d_pwclass='$d_pwclass'
20131 d_pwcomment='$d_pwcomment'
20132 d_pwexpire='$d_pwexpire'
20133 d_pwgecos='$d_pwgecos'
20134 d_pwpasswd='$d_pwpasswd'
20135 d_pwquota='$d_pwquota'
20138 d_random_r='$d_random_r'
20139 d_readdir64_r='$d_readdir64_r'
20140 d_readdir='$d_readdir'
20141 d_readdir_r='$d_readdir_r'
20142 d_readlink='$d_readlink'
20144 d_recvmsg='$d_recvmsg'
20145 d_rename='$d_rename'
20146 d_rewinddir='$d_rewinddir'
20148 d_safebcpy='$d_safebcpy'
20149 d_safemcpy='$d_safemcpy'
20150 d_sanemcmp='$d_sanemcmp'
20151 d_sbrkproto='$d_sbrkproto'
20152 d_sched_yield='$d_sched_yield'
20153 d_scm_rights='$d_scm_rights'
20154 d_seekdir='$d_seekdir'
20155 d_select='$d_select'
20157 d_semctl='$d_semctl'
20158 d_semctl_semid_ds='$d_semctl_semid_ds'
20159 d_semctl_semun='$d_semctl_semun'
20160 d_semget='$d_semget'
20162 d_sendmsg='$d_sendmsg'
20163 d_setegid='$d_setegid'
20164 d_seteuid='$d_seteuid'
20165 d_setgrent='$d_setgrent'
20166 d_setgrent_r='$d_setgrent_r'
20167 d_setgrps='$d_setgrps'
20168 d_sethent='$d_sethent'
20169 d_sethostent_r='$d_sethostent_r'
20170 d_setitimer='$d_setitimer'
20171 d_setlinebuf='$d_setlinebuf'
20172 d_setlocale='$d_setlocale'
20173 d_setlocale_r='$d_setlocale_r'
20174 d_setnent='$d_setnent'
20175 d_setnetent_r='$d_setnetent_r'
20176 d_setpent='$d_setpent'
20177 d_setpgid='$d_setpgid'
20178 d_setpgrp2='$d_setpgrp2'
20179 d_setpgrp='$d_setpgrp'
20180 d_setprior='$d_setprior'
20181 d_setproctitle='$d_setproctitle'
20182 d_setprotoent_r='$d_setprotoent_r'
20183 d_setpwent='$d_setpwent'
20184 d_setpwent_r='$d_setpwent_r'
20185 d_setregid='$d_setregid'
20186 d_setresgid='$d_setresgid'
20187 d_setresuid='$d_setresuid'
20188 d_setreuid='$d_setreuid'
20189 d_setrgid='$d_setrgid'
20190 d_setruid='$d_setruid'
20191 d_setsent='$d_setsent'
20192 d_setservent_r='$d_setservent_r'
20193 d_setsid='$d_setsid'
20194 d_setvbuf='$d_setvbuf'
20198 d_shmatprototype='$d_shmatprototype'
20199 d_shmctl='$d_shmctl'
20201 d_shmget='$d_shmget'
20202 d_sigaction='$d_sigaction'
20203 d_sigprocmask='$d_sigprocmask'
20204 d_sigsetjmp='$d_sigsetjmp'
20205 d_sockatmark='$d_sockatmark'
20206 d_sockatmarkproto='$d_sockatmarkproto'
20207 d_socket='$d_socket'
20208 d_socklen_t='$d_socklen_t'
20209 d_sockpair='$d_sockpair'
20210 d_socks5_init='$d_socks5_init'
20212 d_srand48_r='$d_srand48_r'
20213 d_srandom_r='$d_srandom_r'
20214 d_sresgproto='$d_sresgproto'
20215 d_sresuproto='$d_sresuproto'
20216 d_statblks='$d_statblks'
20217 d_statfs_f_flags='$d_statfs_f_flags'
20218 d_statfs_s='$d_statfs_s'
20219 d_statvfs='$d_statvfs'
20220 d_stdio_cnt_lval='$d_stdio_cnt_lval'
20221 d_stdio_ptr_lval='$d_stdio_ptr_lval'
20222 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
20223 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
20224 d_stdio_stream_array='$d_stdio_stream_array'
20225 d_stdiobase='$d_stdiobase'
20226 d_stdstdio='$d_stdstdio'
20227 d_strchr='$d_strchr'
20228 d_strcoll='$d_strcoll'
20229 d_strctcpy='$d_strctcpy'
20230 d_strerrm='$d_strerrm'
20231 d_strerror='$d_strerror'
20232 d_strerror_r='$d_strerror_r'
20233 d_strftime='$d_strftime'
20234 d_strtod='$d_strtod'
20235 d_strtol='$d_strtol'
20236 d_strtold='$d_strtold'
20237 d_strtoll='$d_strtoll'
20238 d_strtoq='$d_strtoq'
20239 d_strtoul='$d_strtoul'
20240 d_strtoull='$d_strtoull'
20241 d_strtouq='$d_strtouq'
20242 d_strxfrm='$d_strxfrm'
20243 d_suidsafe='$d_suidsafe'
20244 d_symlink='$d_symlink'
20245 d_syscall='$d_syscall'
20246 d_syscallproto='$d_syscallproto'
20247 d_sysconf='$d_sysconf'
20248 d_sysernlst='$d_sysernlst'
20249 d_syserrlst='$d_syserrlst'
20250 d_system='$d_system'
20251 d_tcgetpgrp='$d_tcgetpgrp'
20252 d_tcsetpgrp='$d_tcsetpgrp'
20253 d_telldir='$d_telldir'
20254 d_telldirproto='$d_telldirproto'
20257 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
20258 d_tm_tm_zone='$d_tm_tm_zone'
20259 d_tmpnam_r='$d_tmpnam_r'
20260 d_truncate='$d_truncate'
20261 d_ttyname_r='$d_ttyname_r'
20262 d_tzname='$d_tzname'
20263 d_u32align='$d_u32align'
20264 d_ualarm='$d_ualarm'
20267 d_union_semun='$d_union_semun'
20268 d_unordered='$d_unordered'
20269 d_usleep='$d_usleep'
20270 d_usleepproto='$d_usleepproto'
20272 d_vendorarch='$d_vendorarch'
20273 d_vendorbin='$d_vendorbin'
20274 d_vendorlib='$d_vendorlib'
20276 d_void_closedir='$d_void_closedir'
20277 d_voidsig='$d_voidsig'
20278 d_voidtty='$d_voidtty'
20279 d_volatile='$d_volatile'
20280 d_vprintf='$d_vprintf'
20282 d_waitpid='$d_waitpid'
20283 d_wcstombs='$d_wcstombs'
20284 d_wctomb='$d_wctomb'
20285 d_writev='$d_writev'
20288 db_hashtype='$db_hashtype'
20289 db_prefixtype='$db_prefixtype'
20290 db_version_major='$db_version_major'
20291 db_version_minor='$db_version_minor'
20292 db_version_patch='$db_version_patch'
20293 defvoidused='$defvoidused'
20294 direntrytype='$direntrytype'
20297 doublesize='$doublesize'
20299 drand48_r_proto='$drand48_r_proto'
20300 dynamic_ext='$dynamic_ext'
20306 endgrent_r_proto='$endgrent_r_proto'
20307 endhostent_r_proto='$endhostent_r_proto'
20308 endnetent_r_proto='$endnetent_r_proto'
20309 endprotoent_r_proto='$endprotoent_r_proto'
20310 endpwent_r_proto='$endpwent_r_proto'
20311 endservent_r_proto='$endservent_r_proto'
20312 eunicefix='$eunicefix'
20315 extensions='$extensions'
20317 fflushNULL='$fflushNULL'
20318 fflushall='$fflushall'
20320 firstmakefile='$firstmakefile'
20322 fpossize='$fpossize'
20323 fpostype='$fpostype'
20324 freetype='$freetype'
20327 full_csh='$full_csh'
20328 full_sed='$full_sed'
20329 gccosandvers='$gccosandvers'
20330 gccversion='$gccversion'
20331 getgrent_r_proto='$getgrent_r_proto'
20332 getgrgid_r_proto='$getgrgid_r_proto'
20333 getgrnam_r_proto='$getgrnam_r_proto'
20334 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
20335 gethostbyname_r_proto='$gethostbyname_r_proto'
20336 gethostent_r_proto='$gethostent_r_proto'
20337 getlogin_r_proto='$getlogin_r_proto'
20338 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
20339 getnetbyname_r_proto='$getnetbyname_r_proto'
20340 getnetent_r_proto='$getnetent_r_proto'
20341 getprotobyname_r_proto='$getprotobyname_r_proto'
20342 getprotobynumber_r_proto='$getprotobynumber_r_proto'
20343 getprotoent_r_proto='$getprotoent_r_proto'
20344 getpwent_r_proto='$getpwent_r_proto'
20345 getpwnam_r_proto='$getpwnam_r_proto'
20346 getpwuid_r_proto='$getpwuid_r_proto'
20347 getservbyname_r_proto='$getservbyname_r_proto'
20348 getservbyport_r_proto='$getservbyport_r_proto'
20349 getservent_r_proto='$getservent_r_proto'
20350 getspnam_r_proto='$getspnam_r_proto'
20351 gidformat='$gidformat'
20357 gmtime_r_proto='$gmtime_r_proto'
20359 groupcat='$groupcat'
20360 groupstype='$groupstype'
20363 h_sysfile='$h_sysfile'
20374 i_arpainet='$i_arpainet'
20375 i_bsdioctl='$i_bsdioctl'
20379 i_dirent='$i_dirent'
20385 i_fp_class='$i_fp_class'
20388 i_ieeefp='$i_ieeefp'
20389 i_inttypes='$i_inttypes'
20390 i_langinfo='$i_langinfo'
20391 i_libutil='$i_libutil'
20392 i_limits='$i_limits'
20393 i_locale='$i_locale'
20394 i_machcthr='$i_machcthr'
20395 i_malloc='$i_malloc'
20397 i_memory='$i_memory'
20398 i_mntent='$i_mntent'
20401 i_neterrno='$i_neterrno'
20402 i_netinettcp='$i_netinettcp'
20406 i_pthread='$i_pthread'
20408 i_rpcsvcdbm='$i_rpcsvcdbm'
20411 i_shadow='$i_shadow'
20413 i_stdarg='$i_stdarg'
20414 i_stddef='$i_stddef'
20415 i_stdlib='$i_stdlib'
20416 i_string='$i_string'
20417 i_sunmath='$i_sunmath'
20418 i_sysaccess='$i_sysaccess'
20419 i_sysdir='$i_sysdir'
20420 i_sysfile='$i_sysfile'
20421 i_sysfilio='$i_sysfilio'
20423 i_sysioctl='$i_sysioctl'
20424 i_syslog='$i_syslog'
20425 i_sysmman='$i_sysmman'
20426 i_sysmode='$i_sysmode'
20427 i_sysmount='$i_sysmount'
20428 i_sysndir='$i_sysndir'
20429 i_sysparam='$i_sysparam'
20430 i_sysresrc='$i_sysresrc'
20431 i_syssecrt='$i_syssecrt'
20432 i_sysselct='$i_sysselct'
20433 i_syssockio='$i_syssockio'
20434 i_sysstat='$i_sysstat'
20435 i_sysstatfs='$i_sysstatfs'
20436 i_sysstatvfs='$i_sysstatvfs'
20437 i_systime='$i_systime'
20438 i_systimek='$i_systimek'
20439 i_systimes='$i_systimes'
20440 i_systypes='$i_systypes'
20441 i_sysuio='$i_sysuio'
20443 i_sysutsname='$i_sysutsname'
20444 i_sysvfs='$i_sysvfs'
20445 i_syswait='$i_syswait'
20446 i_termio='$i_termio'
20447 i_termios='$i_termios'
20449 i_unistd='$i_unistd'
20452 i_values='$i_values'
20453 i_varargs='$i_varargs'
20454 i_varhdr='$i_varhdr'
20456 ignore_versioned_solibs='$ignore_versioned_solibs'
20457 inc_version_list='$inc_version_list'
20458 inc_version_list_init='$inc_version_list_init'
20461 installarchlib='$installarchlib'
20462 installbin='$installbin'
20463 installman1dir='$installman1dir'
20464 installman3dir='$installman3dir'
20465 installprefix='$installprefix'
20466 installprefixexp='$installprefixexp'
20467 installprivlib='$installprivlib'
20468 installscript='$installscript'
20469 installsitearch='$installsitearch'
20470 installsitebin='$installsitebin'
20471 installsitelib='$installsitelib'
20472 installstyle='$installstyle'
20473 installusrbinperl='$installusrbinperl'
20474 installvendorarch='$installvendorarch'
20475 installvendorbin='$installvendorbin'
20476 installvendorlib='$installvendorlib'
20478 issymlink='$issymlink'
20479 ivdformat='$ivdformat'
20482 known_extensions='$known_extensions'
20485 lddlflags='$lddlflags'
20487 ldflags_uselargefiles='$ldflags_uselargefiles'
20488 ldlibpthname='$ldlibpthname'
20495 libsdirs='$libsdirs'
20496 libsfiles='$libsfiles'
20497 libsfound='$libsfound'
20498 libspath='$libspath'
20499 libswanted='$libswanted'
20500 libswanted_uselargefiles='$libswanted_uselargefiles'
20506 localtime_r_proto='$localtime_r_proto'
20507 locincpth='$locincpth'
20508 loclibpth='$loclibpth'
20509 longdblsize='$longdblsize'
20510 longlongsize='$longlongsize'
20511 longsize='$longsize'
20515 lseeksize='$lseeksize'
20516 lseektype='$lseektype'
20520 make_set_make='$make_set_make'
20521 mallocobj='$mallocobj'
20522 mallocsrc='$mallocsrc'
20523 malloctype='$malloctype'
20525 man1direxp='$man1direxp'
20528 man3direxp='$man3direxp'
20530 mips_type='$mips_type'
20532 mmaptype='$mmaptype'
20533 modetype='$modetype'
20535 multiarch='$multiarch'
20537 myarchname='$myarchname'
20538 mydomain='$mydomain'
20539 myhostname='$myhostname'
20542 need_va_copy='$need_va_copy'
20543 netdb_hlen_type='$netdb_hlen_type'
20544 netdb_host_type='$netdb_host_type'
20545 netdb_name_type='$netdb_name_type'
20546 netdb_net_type='$netdb_net_type'
20549 nm_so_opt='$nm_so_opt'
20550 nonxs_ext='$nonxs_ext'
20552 nvEUformat='$nvEUformat'
20553 nvFUformat='$nvFUformat'
20554 nvGUformat='$nvGUformat'
20555 nv_preserves_uv_bits='$nv_preserves_uv_bits'
20556 nveformat='$nveformat'
20557 nvfformat='$nvfformat'
20558 nvgformat='$nvgformat'
20561 o_nonblock='$o_nonblock'
20563 old_pthread_create_joinable='$old_pthread_create_joinable'
20564 optimize='$optimize'
20565 orderlib='$orderlib'
20568 otherlibdirs='$otherlibdirs'
20572 patchlevel='$patchlevel'
20573 path_sep='$path_sep'
20576 perl_patchlevel='$perl_patchlevel'
20577 perladmin='$perladmin'
20578 perllibs='$perllibs'
20579 perlpath='$perlpath'
20581 phostname='$phostname'
20584 pm_apiversion='$pm_apiversion'
20588 prefixexp='$prefixexp'
20590 privlibexp='$privlibexp'
20591 procselfexe='$procselfexe'
20592 prototype='$prototype'
20594 quadkind='$quadkind'
20595 quadtype='$quadtype'
20596 randbits='$randbits'
20597 randfunc='$randfunc'
20598 random_r_proto='$random_r_proto'
20599 randseedtype='$randseedtype'
20601 rd_nodata='$rd_nodata'
20602 readdir64_r_proto='$readdir64_r_proto'
20603 readdir_r_proto='$readdir_r_proto'
20604 revision='$revision'
20609 sPRIEUldbl='$sPRIEUldbl'
20610 sPRIFUldbl='$sPRIFUldbl'
20611 sPRIGUldbl='$sPRIGUldbl'
20612 sPRIXU64='$sPRIXU64'
20614 sPRIeldbl='$sPRIeldbl'
20615 sPRIfldbl='$sPRIfldbl'
20616 sPRIgldbl='$sPRIgldbl'
20621 sSCNfldbl='$sSCNfldbl'
20622 sched_yield='$sched_yield'
20623 scriptdir='$scriptdir'
20624 scriptdirexp='$scriptdirexp'
20626 seedfunc='$seedfunc'
20627 selectminbits='$selectminbits'
20628 selecttype='$selecttype'
20629 sendmail='$sendmail'
20630 setgrent_r_proto='$setgrent_r_proto'
20631 sethostent_r_proto='$sethostent_r_proto'
20632 setlocale_r_proto='$setlocale_r_proto'
20633 setnetent_r_proto='$setnetent_r_proto'
20634 setprotoent_r_proto='$setprotoent_r_proto'
20635 setpwent_r_proto='$setpwent_r_proto'
20636 setservent_r_proto='$setservent_r_proto'
20639 sharpbang='$sharpbang'
20640 shmattype='$shmattype'
20641 shortsize='$shortsize'
20644 sig_count='$sig_count'
20645 sig_name='$sig_name'
20646 sig_name_init='$sig_name_init'
20648 sig_num_init='$sig_num_init'
20649 sig_size='$sig_size'
20650 signal_t='$signal_t'
20651 sitearch='$sitearch'
20652 sitearchexp='$sitearchexp'
20654 sitebinexp='$sitebinexp'
20656 sitelib_stem='$sitelib_stem'
20657 sitelibexp='$sitelibexp'
20658 siteprefix='$siteprefix'
20659 siteprefixexp='$siteprefixexp'
20660 sizesize='$sizesize'
20661 sizetype='$sizetype'
20665 sockethdr='$sockethdr'
20666 socketlib='$socketlib'
20667 socksizetype='$socksizetype'
20669 spackage='$spackage'
20670 spitshell='$spitshell'
20671 srand48_r_proto='$srand48_r_proto'
20672 srandom_r_proto='$srandom_r_proto'
20674 ssizetype='$ssizetype'
20675 startperl='$startperl'
20677 static_ext='$static_ext'
20679 stdio_base='$stdio_base'
20680 stdio_bufsiz='$stdio_bufsiz'
20681 stdio_cnt='$stdio_cnt'
20682 stdio_filbuf='$stdio_filbuf'
20683 stdio_ptr='$stdio_ptr'
20684 stdio_stream_array='$stdio_stream_array'
20685 strerror_r_proto='$strerror_r_proto'
20688 subversion='$subversion'
20692 targetarch='$targetarch'
20696 timeincl='$timeincl'
20697 timetype='$timetype'
20698 tmpnam_r_proto='$tmpnam_r_proto'
20704 ttyname_r_proto='$ttyname_r_proto'
20713 uidformat='$uidformat'
20719 uquadtype='$uquadtype'
20720 use5005threads='$use5005threads'
20721 use64bitall='$use64bitall'
20722 use64bitint='$use64bitint'
20723 usecrosscompile='$usecrosscompile'
20725 useithreads='$useithreads'
20726 uselargefiles='$uselargefiles'
20727 uselongdouble='$uselongdouble'
20728 usemorebits='$usemorebits'
20729 usemultiplicity='$usemultiplicity'
20730 usemymalloc='$usemymalloc'
20732 useopcode='$useopcode'
20733 useperlio='$useperlio'
20734 useposix='$useposix'
20735 usereentrant='$usereentrant'
20737 useshrplib='$useshrplib'
20738 usesocks='$usesocks'
20739 usethreads='$usethreads'
20740 usevendorprefix='$usevendorprefix'
20741 usevfork='$usevfork'
20744 uvXUformat='$uvXUformat'
20745 uvoformat='$uvoformat'
20748 uvuformat='$uvuformat'
20749 uvxformat='$uvxformat'
20750 vendorarch='$vendorarch'
20751 vendorarchexp='$vendorarchexp'
20752 vendorbin='$vendorbin'
20753 vendorbinexp='$vendorbinexp'
20754 vendorlib='$vendorlib'
20755 vendorlib_stem='$vendorlib_stem'
20756 vendorlibexp='$vendorlibexp'
20757 vendorprefix='$vendorprefix'
20758 vendorprefixexp='$vendorprefixexp'
20760 version_patchlevel_string='$version_patchlevel_string'
20761 versiononly='$versiononly'
20763 voidflags='$voidflags'
20765 xs_apiversion='$xs_apiversion'
20767 yaccflags='$yaccflags'
20772 : Add in command line options if available
20773 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
20775 : add special variables
20776 $test -f $src/patchlevel.h && \
20777 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
20778 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
20779 echo "PERL_CONFIG_SH=true" >>config.sh
20781 : propagate old symbols
20782 if $test -f UU/config.sh; then
20783 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
20784 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
20785 $sort | $uniq -u >UU/oldsyms
20786 set X `cat UU/oldsyms`
20792 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
20794 echo "# Variables propagated from previous config.sh file." >>config.sh
20795 for sym in `cat UU/oldsyms`; do
20796 echo " Propagating $hint variable "'$'"$sym..."
20797 eval 'tmp="$'"${sym}"'"'
20799 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
20805 : Finish up by extracting the .SH files
20809 echo "Extraction done."
20819 If you'd like to make any changes to the config.sh file before I begin
20820 to configure things, do it as a shell escape now (e.g. !vi config.sh).
20823 rp="Press return or use a shell escape to edit config.sh:"
20828 *) : in case they cannot read
20829 sh 1>&4 -c "$ans";;
20834 : if this fails, just run all the .SH files by hand
20843 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
20850 Now you need to generate make dependencies by running "$make depend".
20851 You might prefer to run it in background: "$make depend > makedepend.out &"
20852 It can take a while, so you might not want to run it right now.
20857 rp="Run $make depend now?"
20861 $make depend && echo "Now you must run '$make'."
20864 echo "You must run '$make depend' then '$make'."
20867 elif test -f [Mm]akefile; then
20869 echo "Now you must run a $make."
20871 echo "Configure done."
20874 if $test -f Policy.sh; then
20877 If you compile $package on a different machine or from a different object
20878 directory, copy the Policy.sh file from this object directory to the
20879 new one before you run Configure -- this will help you with most of
20880 the policy defaults.
20884 if $test -f config.msg; then
20885 echo "Hmm. I also noted the following information while running:"
20887 $cat config.msg >&4
20890 $rm -f kit*isdone ark*isdone