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 Tue Mar 19 18:17:12 EET 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 ;;
2403 cat <<'EOSC' >>checkcc
2408 int main(int argc, char *argv[]) {
2412 if $cc -o try $ccflags $ldflags try.c; then
2415 if $test X"$despair" = Xyes; then
2416 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2419 You need to find a working C compiler.
2420 Either (purchase and) install the C compiler supplied by your OS vendor,
2421 or for a free C compiler try http://gcc.gnu.org/
2422 I cannot continue any further, aborting.
2431 : determine whether symbolic links are supported
2434 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2435 echo "Symbolic links are supported." >&4
2438 echo "Symbolic links are NOT supported." >&4
2443 : determine whether symbolic links are supported
2447 echo "Checking how to test for symbolic links..." >&4
2449 if $test "X$issymlink" = X; then
2451 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2452 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2454 if test $? = 0; then
2457 echo "Your builtin 'test -h' may be broken." >&4
2460 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2463 if test -f "$p/$test"; then
2472 echo "Trying external '$test -h'." >&4
2473 issymlink="$test -h"
2474 if $test ! -h sym >/dev/null 2>&1; then
2475 echo "External '$test -h' is broken, too." >&4
2483 if $test "X$issymlink" = X; then
2484 if $test -L sym 2>/dev/null; then
2485 issymlink="$test -L"
2486 echo "The builtin '$test -L' worked." >&4
2489 if $test "X$issymlink" != X; then
2490 echo "You can test for symbolic links with '$issymlink'." >&4
2492 echo "I do not know how you can test for symbolic links." >&4
2496 *) echo "No symbolic links, so not testing for their testing..." >&4
2502 case "$mksymlinks" in
2505 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2508 *) case "$lns:$issymlink" in
2509 *"ln"*" -s:"*"test -"?)
2510 echo "Creating the symbolic links..." >&4
2511 echo "(First creating the subdirectories...)" >&4
2513 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2515 test -z "$directory" && break
2519 if test ! -d t/base; then
2520 echo "Failed to create the subdirectories. Aborting." >&4
2523 echo "(Then creating the symlinks...)" >&4
2524 awk '{print $1}' $src/MANIFEST | while true; do
2526 test -z "$filename" && break
2527 if test -f $filename; then
2528 if $issymlink $filename; then
2532 if test -f $filename; then
2533 echo "$filename already exists, not symlinking."
2535 ln -s $src/$filename $filename
2539 if test ! -f t/base/lex.t; then
2540 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2545 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2554 case "$usecrosscompile" in
2556 $echo "Cross-compiling..."
2559 *-*-gcc) # A cross-compiling gcc, probably.
2560 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2562 # leave out ld, choosing it is more complex
2564 ranlib=$targetarch-ranlib
2565 $echo 'extern int foo;' > try.c
2566 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2568 if $test $# -gt 0; then
2570 incpth="`$echo $incpth|$sed 's/^ //'`"
2571 echo "Guessing incpth '$incpth'." >&4
2573 j="`$echo $i|$sed 's,/include$,/lib,'`"
2574 if $test -d $j; then
2578 libpth="`$echo $libpth|$sed 's/^ //'`"
2579 echo "Guessing libpth '$libpth'." >&4
2584 case "$targetarch" in
2585 '') echo "Targetarch not defined." >&4; croak=y ;;
2586 *) echo "Using targetarch $targetarch." >&4 ;;
2589 '') echo "Incpth not defined." >&4; croak=y ;;
2590 *) echo "Using incpth '$incpth'." >&4 ;;
2593 '') echo "Libpth not defined." >&4; croak=y ;;
2594 *) echo "Using libpth '$libpth'." >&4 ;;
2597 '') for i in $incpth; do
2598 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2600 echo "Guessing usrinc $usrinc." >&4
2605 '') echo "Usrinc not defined." >&4; croak=y ;;
2608 *) echo "Using usrinc $usrinc." >&4 ;;
2610 case "$targethost" in
2611 '') echo "Targethost not defined." >&4; croak=y ;;
2612 *) echo "Using targethost $targethost." >&4
2617 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2620 /*) run=$src/Cross/run
2621 targetmkdir=$src/Cross/mkdir
2623 from=$src/Cross/from
2625 *) pwd=`$test -f ../Configure & cd ..; pwd`
2627 targetmkdir=$pwd/Cross/mkdir
2629 from=$pwd/Cross/from
2632 case "$targetrun" in
2633 '') targetrun=ssh ;;
2638 case "$targetfrom" in
2639 '') targetfrom=scp ;;
2643 from=$from-$targetfrom
2644 case "$targetdir" in
2646 echo "Guessing targetdir $targetdir." >&4
2649 case "$targetuser" in
2651 echo "Guessing targetuser $targetuser." >&4
2654 case "$targetfrom" in
2658 case "$targetrun" in
2670 '') cwd=$targetdir ;;
2674 if $test ! -f \$exe.xok; then
2678 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2681 *) echo "Unknown targetrun '$targetrun'" >&4
2685 case "$targetmkdir" in
2687 cat >$targetmkdir <<EOF
2689 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2691 $chmod a+rx $targetmkdir
2693 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2705 $targetmkdir \`dirname \$f\`
2706 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2709 $targetmkdir $targetdir/\`dirname \$f\`
2710 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2723 $mkdir -p $targetdir/\`dirname \$f\`
2724 $cp \$f $targetdir/\$f || exit 1
2727 $targetmkdir $targetdir/\`dirname \$f\`
2728 $cp \$f $targetdir/\$f || exit 1
2735 *) echo "Unknown targetto '$targetto'" >&4
2739 case "$targetfrom" in
2746 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2751 cp) cat >$from <<EOF
2756 cp $targetdir/\$f . || exit 1
2761 *) echo "Unknown targetfrom '$targetfrom'" >&4
2765 if $test ! -f $run; then
2766 echo "Target 'run' script '$run' not found." >&4
2770 if $test ! -f $to; then
2771 echo "Target 'to' script '$to' not found." >&4
2775 if $test ! -f $from; then
2776 echo "Target 'from' script '$from' not found." >&4
2780 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2784 Using '$run' for remote execution,
2785 and '$from' and '$to'
2786 for remote file transfer.
2792 usecrosscompile='undef'
2797 : see whether [:lower:] and [:upper:] are supported character classes
2799 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2801 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2805 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2806 # (0xc9 and 0xd1), therefore that is a nice testing point.
2807 if test "X$up" = X -o "X$low" = X; then
2808 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2814 if test "X$up" = X -o "X$low" = X; then
2815 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2821 if test "X$up" = X -o "X$low" = X; then
2822 case "`echo IJ | od -x 2>/dev/null`" in
2824 echo "Hey, this might be EBCDIC." >&4
2825 if test "X$up" = X -o "X$low" = X; then
2826 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2827 ij) up='[A-IJ-RS-Z]'
2832 if test "X$up" = X -o "X$low" = X; then
2833 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2843 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2845 echo "Using $up and $low to convert case." >&4
2848 echo "I don't know how to translate letters from upper to lower case." >&4
2849 echo "Your tr is not acting any way I know of." >&4
2853 : set up the translation script tr, must be called with ./tr of course
2857 '[A-Z][a-z]') exec $tr '$up' '$low';;
2858 '[a-z][A-Z]') exec $tr '$low' '$up';;
2865 : Try to determine whether config.sh was made on this system
2866 case "$config_sh" in
2868 myuname=`$uname -a 2>/dev/null`
2869 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2870 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2871 # because the A-Z/a-z are not consecutive.
2872 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2873 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2874 newmyuname="$myuname"
2876 case "$knowitall" in
2878 if test -f ../config.sh; then
2879 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2880 eval "`grep myuname= ../config.sh`"
2882 if test "X$myuname" = "X$newmyuname"; then
2890 : Get old answers from old config file if Configure was run on the
2891 : same system, otherwise use the hints.
2894 if test -f config.sh; then
2896 rp="I see a config.sh file. Shall I use it to set the defaults?"
2899 n*|N*) echo "OK, I'll ignore it."
2900 mv config.sh config.sh.old
2901 myuname="$newmyuname"
2903 *) echo "Fetching default answers from your old config.sh file..." >&4
2911 : Older versions did not always set $sh. Catch re-use of such
2921 if test ! -f config.sh; then
2924 First time through, eh? I have some defaults handy for some systems
2925 that need some extra help getting the Configure answers right:
2928 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2930 : Half the following guesses are probably wrong... If you have better
2931 : tests or hints, please send them to perlbug@perl.org
2932 : The metaconfig authors would also appreciate a copy...
2933 $test -f /irix && osname=irix
2934 $test -f /xenix && osname=sco_xenix
2935 $test -f /dynix && osname=dynix
2936 $test -f /dnix && osname=dnix
2937 $test -f /lynx.os && osname=lynxos
2938 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2939 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2940 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2941 $test -f /bin/mips && /bin/mips && osname=mips
2942 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2943 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2944 $test -d /usr/apollo/bin && osname=apollo
2945 $test -f /etc/saf/_sactab && osname=svr4
2946 $test -d /usr/include/minix && osname=minix
2947 $test -f /system/gnu_library/bin/ar.pm && osname=vos
2948 if $test -d /MachTen -o -d /MachTen_Folder; then
2950 if $test -x /sbin/version; then
2951 osvers=`/sbin/version | $awk '{print $2}' |
2952 $sed -e 's/[A-Za-z]$//'`
2953 elif $test -x /usr/etc/version; then
2954 osvers=`/usr/etc/version | $awk '{print $2}' |
2955 $sed -e 's/[A-Za-z]$//'`
2961 $test -f /sys/posix.dll &&
2962 $test -f /usr/bin/what &&
2963 set X `/usr/bin/what /sys/posix.dll` &&
2964 $test "$3" = UWIN &&
2968 if $test -f $uname; then
2976 umips) osname=umips ;;
2979 [23]100) osname=mips ;;
2980 next*) osname=next ;;
2982 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2983 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2986 elif $test -f /etc/kconfig; then
2988 if test "$lns" = "$ln -s"; then
2990 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2992 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
2999 if test -n "$DJGPP"; then
3008 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3010 'not found') osvers="$4"."$3" ;;
3011 '<3240'|'<>3240') osvers=3.2.0 ;;
3012 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3013 '=3250'|'>3250') osvers=3.2.5 ;;
3017 bsd386) osname=bsd386
3020 cygwin*) osname=cygwin
3023 *dc.osx) osname=dcosx
3029 domainos) osname=apollo
3035 dynixptx*) osname=dynixptx
3036 osvers=`echo "$4"|sed 's/^v//'`
3038 freebsd) osname=freebsd
3040 genix) osname=genix ;;
3042 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3058 netbsd*) osname=netbsd
3061 news-os) osvers="$3"
3063 4*) osname=newsos4 ;;
3067 next*) osname=next ;;
3068 nonstop-ux) osname=nonstopux ;;
3069 POSIX-BC | posix-bc ) osname=posix-bc
3072 powerux | power_ux | powermax_os | powermaxos | \
3073 powerunix | power_unix) osname=powerux
3079 solaris) osname=solaris
3081 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3088 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3092 titanos) osname=titanos
3101 ultrix) osname=ultrix
3104 osf1|mls+) case "$5" in
3107 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3110 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3113 hp*) osname=hp_osf1 ;;
3114 mips) osname=mips_osf1 ;;
3117 unixware) osname=svr5
3125 $2) case "$osname" in
3129 : svr4.x or possibly later
3139 if test -f /stand/boot ; then
3140 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3141 if test -n "$INITPROG" -a -f "$INITPROG"; then
3142 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3143 if test -n "$isesix"; then
3151 *) if test -f /etc/systemid; then
3153 set `echo $3 | $sed 's/\./ /g'` $4
3154 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3156 elif $test -f $src/hints/sco_$1_$2.sh; then
3158 elif $test -f $src/hints/sco_$1.sh; then
3163 '') : Still unknown. Probably a generic Sys V.
3172 *) case "$osname" in
3173 '') : Still unknown. Probably a generic BSD.
3181 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3182 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3183 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3186 $rm -f UU/kernel.what
3187 elif test -d c:/.; then
3194 case "$targetarch" in
3197 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3202 : Now look for a hint file osname_osvers, unless one has been
3203 : specified already.
3206 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3207 : Also try without trailing minor version numbers.
3208 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3209 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3210 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3211 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3214 *) case "$osvers" in
3217 *) if $test -f $src/hints/$file.sh ; then
3219 elif $test -f $src/hints/$xfile.sh ; then
3221 elif $test -f $src/hints/$xxfile.sh ; then
3223 elif $test -f $src/hints/$xxxfile.sh ; then
3225 elif $test -f $src/hints/$xxxxfile.sh ; then
3227 elif $test -f "$src/hints/${osname}.sh" ; then
3236 if $test -f Policy.sh ; then
3239 none) dflt="Policy" ;;
3240 *) dflt="Policy $dflt" ;;
3245 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3249 if $test -f Policy.sh ; then
3252 There's also a Policy hint file available, which should make the
3253 site-specific (policy) questions easier to answer.
3260 You may give one or more space-separated answers, or "none" if appropriate.
3261 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3262 is a good thing. DO NOT give a wrong version or a wrong OS.
3266 rp="Which of these apply, if any?"
3269 for file in $tans; do
3270 if $test X$file = XPolicy -a -f Policy.sh; then
3272 $cat Policy.sh >> UU/config.sh
3273 elif $test -f $src/hints/$file.sh; then
3274 . $src/hints/$file.sh
3275 $cat $src/hints/$file.sh >> UU/config.sh
3276 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3279 : Give one chance to correct a possible typo.
3280 echo "$file.sh does not exist"
3282 rp="hint to use instead?"
3284 for file in $ans; do
3285 if $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$ans = X -o X$ans = Xnone ; then
3291 echo "$file.sh does not exist -- ignored."
3298 : Remember our hint file for later.
3299 if $test -f "$src/hints/$file.sh" ; then
3309 echo "Fetching default answers from $config_sh..." >&4
3313 cp $config_sh config.sh 2>/dev/null
3323 test "$override" && . ./optdef.sh
3325 : Restore computed paths
3326 for file in $loclist $trylist; do
3327 eval $file="\$_$file"
3332 Configure uses the operating system name and version to set some defaults.
3333 The default value is probably right if the name rings a bell. Otherwise,
3334 since spelling matters for me, either accept the default or answer "none"
3341 ''|' '|none) dflt=none ;;
3342 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3345 *) dflt="$osname" ;;
3347 rp="Operating system name?"
3351 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3357 ''|' '|none) dflt=none ;;
3358 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3359 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3361 ''|' ') dflt=none ;;
3366 *) dflt="$osvers" ;;
3368 rp="Operating system version?"
3378 : who configured the system
3379 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3380 cf_by=`(logname) 2>/dev/null`
3383 cf_by=`(whoami) 2>/dev/null`
3385 "") cf_by=unknown ;;
3389 : set up the script used to warn in case of inconsistency
3396 echo "*** WHOA THERE!!! ***" >&4
3397 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3398 rp=" Keep the $hint value?"
3401 y) td=$was; tu=$was;;
3405 : function used to set $1 to $val
3406 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3408 $define$undef) . ./whoa; eval "$var=\$td";;
3409 $undef$define) . ./whoa; eval "$var=\$tu";;
3410 *) eval "$var=$val";;
3413 case "$usethreads" in
3414 $define|true|[yY]*) dflt='y';;
3419 Perl can be built to take advantage of threads on some systems.
3420 To do so, Configure can be run with -Dusethreads.
3422 Note that threading is a highly experimental feature, and
3423 some known race conditions still remain. If you choose to try
3424 it, be very sure to not actually deploy it for production
3425 purposes. README.threads has more details, and is required
3426 reading if you enable threads.
3428 If this doesn't make any sense to you, just accept the default '$dflt'.
3430 rp='Build a threading Perl?'
3433 y|Y) val="$define" ;;
3439 case "$usethreads" in
3443 As of 5.5.640, Perl has two different internal threading implementations,
3444 the 5.005 version (5005threads) and an interpreter-based version
3445 (ithreads) that has one interpreter per thread. Both are very
3446 experimental. This arrangement exists to help developers work out
3447 which one is better.
3449 If you're a casual user, you probably don't want interpreter-threads
3450 at this time. But if you do, the 'threads' module allows their use,
3451 and the 'Thread' module offers an interface to both 5005threads and
3452 ithreads (whichever has been configured).
3454 : Default to ithreads unless overridden on command line or with
3457 case "$use5005threads" in
3458 $define|true|[yY]*) dflt='n';;
3460 case "$useithreads" in
3461 $undef|false|[nN]*) dflt='n';;
3463 rp='Use interpreter-based ithreads?'
3466 y|Y) val="$define" ;;
3471 : Now set use5005threads to the opposite value.
3472 case "$useithreads" in
3473 $define) val="$undef" ;;
3480 useithreads="$undef"
3481 use5005threads="$undef"
3485 case "$useithreads$use5005threads" in
3489 You cannot have both the ithreads and the 5.005 threads enabled
3490 at the same time. Disabling the 5.005 threads since they are
3491 much less stable than the ithreads.
3494 use5005threads="$undef"
3498 case "$d_oldpthreads" in
3499 '') : Configure tests would be welcome here. For now, assume undef.
3501 *) val="$d_oldpthreads" ;;
3507 case "$usethreads" in
3508 "$define"|true|[yY]*)
3509 : Look for a hint-file generated 'call-back-unit'. If the
3510 : user has specified that a threading perl is to be built,
3511 : we may need to set or change some other defaults.
3512 if $test -f usethreads.cbu; then
3513 echo "Your platform has some specific hints for threaded builds, using them..."
3517 (Your platform doesn't have any specific hints for threaded builds.
3518 Assuming POSIX threads, then.)
3526 Perl can be built so that multiple Perl interpreters can coexist
3527 within the same Perl executable.
3530 case "$useithreads" in
3533 This multiple interpreter support is required for interpreter-based threads.
3537 *) case "$usemultiplicity" in
3538 $define|true|[yY]*) dflt='y';;
3542 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3543 rp='Build Perl for multiplicity?'
3546 y|Y) val="$define" ;;
3555 case "$usemorebits" in
3556 "$define"|true|[yY]*)
3557 use64bitint="$define"
3558 uselongdouble="$define"
3559 usemorebits="$define"
3561 *) usemorebits="$undef"
3565 : make some quick guesses about what we are up against
3567 $echo $n "Hmm... $c"
3577 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3578 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3580 echo "Looks kind of like an OSF/1 system, but we'll see..."
3582 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3583 xxx=`./loc addbib blurfl $pth`
3584 if $test -f $xxx; then
3585 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3589 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3590 echo "Looks kind of like an extended USG system, but we'll see..."
3592 echo "Looks kind of like a USG system, but we'll see..."
3596 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3597 echo "Looks kind of like a BSD system, but we'll see..."
3601 echo "Looks kind of like a Version 7 system, but we'll see..."
3604 case "$eunicefix" in
3607 There is, however, a strange, musty smell in the air that reminds me of
3608 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3612 : it so happens the Eunice I know will not run shell scripts in Unix format
3616 echo "Congratulations. You aren't running Eunice."
3620 : Detect OS2. The p_ variable is set above in the Head.U unit.
3621 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3622 : semicolon as a patch separator
3627 I have the feeling something is not exactly right, however...don't tell me...
3628 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3629 (Or you may be running DOS with DJGPP.)
3634 if test -f /xenix; then
3635 echo "Actually, this looks more like a XENIX system..."
3640 echo "It's not Xenix..."
3645 if test -f /venix; then
3646 echo "Actually, this looks more like a VENIX system..."
3653 echo "Nor is it Venix..."
3656 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3657 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3664 rp="Use which C compiler?"
3668 : See if they have not cc but they do have gcc
3670 : Look for a hint-file generated 'call-back-unit'. Now that the
3671 : user has specified the compiler, we may need to set or change some
3673 if $test -f cc.cbu; then
3679 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3685 printf("%s\n", __VERSION__);
3687 printf("%s\n", "1");
3693 if $cc -o try $ccflags $ldflags try.c; then
3694 gccversion=`$run ./try`
3695 case "$gccversion" in
3696 '') echo "You are not using GNU cc." ;;
3697 *) echo "You are using GNU cc $gccversion."
3703 echo "*** WHOA THERE!!! ***" >&4
3704 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3705 case "$knowitall" in
3707 echo " You'd better start hunting for one and let me know about it." >&4
3713 case "$gccversion" in
3714 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3716 case "$gccversion" in
3717 '') gccosandvers='' ;;
3718 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3719 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3721 case "$gccosandvers" in
3722 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3723 $osname$osvers) ;; # looking good
3724 $osname*) cat <<EOM >&4
3726 *** WHOA THERE!!! ***
3728 Your gcc has not been compiled for the exact release of
3729 your operating system ($gccosandvers versus $osname$osvers).
3731 In general it is a good idea to keep gcc synchronized with
3732 the operating system because otherwise serious problems
3733 may ensue when trying to compile software, like Perl.
3735 I'm trying to be optimistic here, though, and will continue.
3736 If later during the configuration and build icky compilation
3737 problems appear (headerfile conflicts being the most common
3738 manifestation), I suggest reinstalling the gcc to match
3739 your operating system release.
3743 *) gccosandvers='' ;; # failed to parse, better be silent
3752 : decide how portable to be. Allow command line overrides.
3753 case "$d_portable" in
3755 *) d_portable="$define" ;;
3758 : set up shell script to do ~ expansion
3764 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3767 if $test -f /bin/csh; then
3768 /bin/csh -f -c "glob \$1"
3773 name=\`$expr x\$1 : '..\([^/]*\)'\`
3774 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3775 if $test ! -d "\$dir"; then
3777 echo "\$me: can't locate home directory for: \$name" >&2
3782 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3798 : now set up to get a file name
3802 cat <<'EOSC' >>getfile
3818 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3819 fn=`echo $fn | sed 's/(.*)//'`
3825 loc_file=`expr $fn : '.*:\(.*\)'`
3826 fn=`expr $fn : '\(.*\):.*'`
3834 */*) fullpath=true;;
3843 *e*) exp_file=true;;
3846 *p*) nopath_ok=true;;
3851 *d*) type='Directory';;
3852 *l*) type='Locate';;
3857 Locate) what='File';;
3862 case "$d_portable" in
3870 while test "$type"; do
3875 true) rp="$rp (~name ok)";;
3878 if test -f UU/getfile.ok && \
3879 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3898 value=`UU/filexp $ans`
3901 if test "$ans" != "$value"; then
3902 echo "(That expands to $value on this system.)"
3916 /*) value="$ansexp" ;;
3917 [a-zA-Z]:/*) value="$ansexp" ;;
3922 echo "I shall only accept a full path name, as in /bin/ls." >&4
3923 echo "Use a ! shell escape if you wish to check pathnames." >&4
3926 echo "Please give a full path name, starting with slash." >&4
3929 echo "Note that using ~name is ok provided it expands well." >&4
3942 for fp in $gfpth; do
3943 if test "X$fp" = X.; then
3948 if test -f "$pf"; then
3950 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3952 echo "($value is not a plain file, but that's ok.)"
3955 if test X"$type" = X; then
3962 for fp in $gfpth; do
3963 if test "X$fp" = X.; then
3968 direxp="$fp/$ansexp"
3970 if test -d "$direxp"; then
3978 if test -d "$ansexp"; then
3979 echo "(Looking for $loc_file in directory $value.)"
3980 value="$value/$loc_file"
3981 ansexp="$ansexp/$loc_file"
3983 if test -f "$ansexp"; then
3986 case "$nopath_ok" in
3987 true) case "$value" in
3989 *) echo "Assuming $value will be in people's path."
4005 if test "$fastread" = yes; then
4010 rp="$what $value doesn't exist. Use that name anyway?"
4029 test "X$gfpthkeep" != Xy && gfpth=""
4032 : What should the include directory be ?
4034 $echo $n "Hmm... $c"
4038 if $test -f /bin/mips && /bin/mips; then
4039 echo "Looks like a MIPS system..."
4040 $cat >usr.c <<'EOCP'
4041 #ifdef SYSTYPE_BSD43
4045 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4046 dflt='/bsd43/usr/include'
4050 mips_type='System V'
4052 $rm -f usr.c usr.out
4053 echo "and you're compiling with the $mips_type compiler and libraries."
4057 echo "Doesn't look like a MIPS system."
4067 case "$xxx_prompt" in
4070 rp='Where are the include files you want to use?'
4078 : see how we invoke the C preprocessor
4080 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4081 cat <<'EOT' >testcpp.c
4087 if test ! -f cppstdin; then
4088 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4089 # AIX cc -E doesn't show the absolute headerfile
4090 # locations but we'll cheat by using the -M flag.
4091 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
4093 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4096 echo "Keeping your $hint cppstdin wrapper."
4099 wrapper=`pwd`/cppstdin
4103 if $test "X$cppstdin" != "X" && \
4104 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4105 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4107 echo "You used to use $cppstdin $cppminus so we'll use that again."
4109 '') echo "But let's see if we can live without a wrapper..." ;;
4111 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4112 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4114 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4117 echo "(However, $cpprun $cpplast does not work, let's see...)"
4125 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4132 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4133 $cc -E <testcpp.c >testcpp.out 2>&1; \
4134 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4135 echo "Yup, it does."
4138 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4139 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4140 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4141 echo "Yup, it does."
4144 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4145 $cc -P <testcpp.c >testcpp.out 2>&1; \
4146 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4147 echo "Yipee, that works!"
4150 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4151 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4152 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4153 echo "At long last!"
4156 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4157 $cpp <testcpp.c >testcpp.out 2>&1; \
4158 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4162 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4163 $cpp - <testcpp.c >testcpp.out 2>&1; \
4164 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4165 echo "Hooray, it works! I was beginning to wonder."
4168 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4169 $wrapper <testcpp.c >testcpp.out 2>&1; \
4170 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4176 rp="No dice. I can't find a C preprocessor. Name one:"
4180 $x_cpp <testcpp.c >testcpp.out 2>&1
4181 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4182 echo "OK, that will do." >&4
4184 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4199 echo "Perhaps can we force $cc -E using a wrapper..."
4200 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4201 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4207 echo "Nope, we'll have to live without it..."
4221 "$wrapper"|'cppstdin') ;;
4222 *) $rm -f $wrapper;;
4224 $rm -f testcpp.c testcpp.out
4226 : Set private lib path
4229 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4234 '') dlist="$loclibpth $plibpth $glibpth";;
4235 *) dlist="$libpth";;
4238 : Now check and see which directories actually exist, avoiding duplicates
4242 if $test -d $xxx; then
4245 *) libpth="$libpth $xxx";;
4251 Some systems have incompatible or broken versions of libraries. Among
4252 the directories listed in the question below, please remove any you
4253 know not to be holding relevant libraries, and add any that are needed.
4254 Say "none" for none.
4265 rp="Directories to use for library searches?"
4272 : compute shared library extension
4275 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4285 On some systems, shared libraries may be available. Answer 'none' if
4286 you want to suppress searching of shared libraries for the remainder
4287 of this configuration.
4290 rp='What is the file extension used for shared libraries?'
4294 : Define several unixisms.
4295 : Hints files or command line option can be used to override them.
4296 : The convoluted testing is in case hints files set either the old
4299 '') case "$exe_ext" in
4301 *) _exe="$exe_ext" ;;
4306 '') case "$lib_ext" in
4313 '') case "$obj_ext" in
4320 '') case "$path_sep" in
4331 : Which makefile gets called first. This is used by make depend.
4332 case "$firstmakefile" in
4333 '') firstmakefile='makefile';;
4337 $define|true|[yY]*) dflt='y';;
4342 Perl can be built to use the SOCKS proxy protocol library. To do so,
4343 Configure must be run with -Dusesocks. If you use SOCKS you also need
4344 to use the PerlIO abstraction layer, this will be implicitly selected.
4346 If this doesn't make any sense to you, just accept the default '$dflt'.
4348 rp='Build Perl for SOCKS?'
4351 y|Y) val="$define" ;;
4358 $define|true|[yY]*) useperlio="$define";;
4361 : Looking for optional libraries
4363 echo "Checking for optional libraries..." >&4
4368 case "$libswanted" in
4369 '') libswanted='c_s';;
4372 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4378 for thisdir in $libpth $xlibpth; do
4379 test -d $thisdir && libspath="$libspath $thisdir"
4381 for thislib in $libswanted; do
4382 for thisdir in $libspath; do
4384 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4385 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4386 $test -f "$xxx" && eval $libscheck
4387 $test -f "$xxx" && libstyle=shared
4389 if test ! -f "$xxx"; then
4390 xxx=$thisdir/lib$thislib.$so
4391 $test -f "$xxx" && eval $libscheck
4392 $test -f "$xxx" && libstyle=shared
4394 if test ! -f "$xxx"; then
4395 xxx=$thisdir/lib$thislib$_a
4396 $test -f "$xxx" && eval $libscheck
4397 $test -f "$xxx" && libstyle=static
4399 if test ! -f "$xxx"; then
4400 xxx=$thisdir/$thislib$_a
4401 $test -f "$xxx" && eval $libscheck
4402 $test -f "$xxx" && libstyle=static
4404 if test ! -f "$xxx"; then
4405 xxx=$thisdir/lib${thislib}_s$_a
4406 $test -f "$xxx" && eval $libscheck
4407 $test -f "$xxx" && libstyle=static
4408 $test -f "$xxx" && thislib=${thislib}_s
4410 if test ! -f "$xxx"; then
4411 xxx=$thisdir/Slib$thislib$_a
4412 $test -f "$xxx" && eval $libscheck
4413 $test -f "$xxx" && libstyle=static
4415 if $test -f "$xxx"; then
4417 shared) echo "Found -l$thislib (shared)." ;;
4418 static) echo "Found -l$thislib." ;;
4419 *) echo "Found -l$thislib ($libstyle)." ;;
4423 *) dflt="$dflt -l$thislib"
4424 libsfound="$libsfound $xxx"
4426 libsfiles="$libsfiles $yyy"
4427 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4428 case " $libsdirs " in
4430 *) libsdirs="$libsdirs $yyy" ;;
4437 if $test ! -f "$xxx"; then
4438 echo "No -l$thislib."
4449 ' '|'') dflt='none';;
4454 In order to compile $package on your machine, a number of libraries
4455 are usually needed. Include any other special libraries here as well.
4456 Say "none" for none. The default list is almost always right.
4460 rp="What libraries to use?"
4467 : determine optimization, if desired, or use for debug flag also
4469 ' '|$undef) dflt='none';;
4471 *) dflt="$optimize";;
4475 By default, $package compiles with the -O flag to use the optimizer.
4476 Alternately, you might want to use the symbolic debugger, which uses
4477 the -g flag (on traditional Unix systems). Either flag can be
4478 specified here. To use neither flag, specify the word "none".
4481 rp="What optimizer/debugger flag should be used?"
4485 'none') optimize=" ";;
4489 : We will not override a previous value, but we might want to
4490 : augment a hint file
4492 default|recommended)
4493 case "$gccversion" in
4494 1*) dflt='-fpcc-struct-return' ;;
4497 *-g*) dflt="$dflt -DDEBUGGING";;
4499 case "$gccversion" in
4500 2*) if test -d /etc/conf/kconfig.d &&
4501 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4507 case "$gccversion" in
4511 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4512 echo 'int main(void) { return 0; }' > gcctest.c
4513 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4514 echo "Yes, it does." 2>&1
4517 echo "Leaving current flags $ccflags alone." 2>&1
4519 *) dflt="$dflt -fno-strict-aliasing" ;;
4522 echo "Nope, it doesn't, but that's ok." 2>&1
4529 case "$mips_type" in
4530 *BSD*|'') inclwanted="$locincpth $usrinc";;
4531 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4533 for thisincl in $inclwanted; do
4534 if $test -d $thisincl; then
4535 if $test x$thisincl != x$usrinc; then
4537 *" -I$thisincl "*);;
4538 *) dflt="$dflt -I$thisincl ";;
4544 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4546 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4554 *) dflt="$dflt -D$2";;
4558 set signal.h LANGUAGE_C; eval $inctest
4562 ccflags="$ccflags -DSOCKS"
4567 default|recommended) dflt="$ccflags $dflt" ;;
4568 *) dflt="$ccflags";;
4577 Your C compiler may want other flags. For this question you should include
4578 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4579 but you should NOT include libraries or ld flags like -lwhatever. If you
4580 want $package to honor its debug switch, you should include -DDEBUGGING here.
4581 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4583 To use no flags, specify the word "none".
4589 rp="Any additional cc flags?"
4596 : the following weeds options from ccflags that are of no interest to cpp
4598 '') cppflags="$ccflags" ;;
4599 *) cppflags="$cppflags $ccflags" ;;
4601 case "$gccversion" in
4602 1*) cppflags="$cppflags -D__GNUC__"
4604 case "$mips_type" in
4606 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4612 echo "Let me guess what the preprocessor flags are..." >&4
4626 *) ftry="$previous $flag";;
4628 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4629 >cpp1.out 2>/dev/null && \
4630 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4631 >cpp2.out 2>/dev/null && \
4632 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4633 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4635 cppflags="$cppflags $ftry"
4645 *-*) echo "They appear to be: $cppflags";;
4647 $rm -f cpp.c cpp?.out
4651 : flags used in final linking phase
4653 '') if ./venix; then
4659 *-posix*) dflt="$dflt -posix" ;;
4662 *) dflt="$ldflags";;
4665 : Try to guess additional flags to pick up local libraries.
4666 for thislibdir in $libpth; do
4667 case " $loclibpth " in
4670 *"-L$thislibdir "*) ;;
4671 *) dflt="$dflt -L$thislibdir" ;;
4683 Your C linker may need flags. For this question you should
4684 include -L/whatever and any other flags used by the C linker, but you
4685 should NOT include libraries like -lwhatever.
4687 Make sure you include the appropriate -L/path flags if your C linker
4688 does not normally search all of the directories you specified above,
4691 To use no flags, specify the word "none".
4695 rp="Any additional ld flags (NOT including libraries)?"
4701 rmlist="$rmlist pdp11"
4705 echo "Checking your choice of C compiler and flags for coherency..." >&4
4706 $cat > try.c <<'EOF'
4708 int main() { printf("Ok\n"); exit(0); }
4710 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4712 $cat >try.msg <<'EOM'
4713 I've tried to compile and run the following simple program:
4716 $cat try.c >> try.msg
4718 $cat >> try.msg <<EOM
4725 and I got the following output:
4729 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4730 if $sh -c "$run ./try" >>try.msg 2>&1; then
4734 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4737 cat >> try.msg <<'EOQS'
4738 If $libs contains -lsfio, and sfio is mis-configured, then it
4739 sometimes (apparently) runs and exits with a 0 status, but with no
4740 output! It may have to do with sfio's use of _exit vs. exit.
4743 rp="You have a big problem. Shall I abort Configure"
4750 echo "The program compiled OK, but exited with status $?." >>try.msg
4751 rp="You have a problem. Shall I abort Configure"
4755 echo "I can't compile the test program." >>try.msg
4756 rp="You have a BIG problem. Shall I abort Configure"
4762 case "$knowitall" in
4764 echo "(The supplied flags or libraries might be incorrect.)"
4772 *) echo "Ok. Stopping Configure." >&4
4777 n) echo "OK, that should do.";;
4779 $rm -f try try.* core
4781 : define a shorthand compile call
4785 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4786 : define a shorthand compile call for compilations that should be ok.
4790 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4792 : check for lengths of integral types
4796 echo "Checking to see how big your integers are..." >&4
4797 $cat >try.c <<'EOCP'
4801 printf("intsize=%d;\n", (int)sizeof(int));
4802 printf("longsize=%d;\n", (int)sizeof(long));
4803 printf("shortsize=%d;\n", (int)sizeof(short));
4808 if eval $compile_ok && $run ./try > /dev/null; then
4810 echo "Your integers are $intsize bytes long."
4811 echo "Your long integers are $longsize bytes long."
4812 echo "Your short integers are $shortsize bytes long."
4816 Help! I can't compile and run the intsize test program: please enlighten me!
4817 (This is probably a misconfiguration in your system or libraries, and
4818 you really ought to fix it. Still, I'll try anyway.)
4822 rp="What is the size of an integer (in bytes)?"
4826 rp="What is the size of a long integer (in bytes)?"
4830 rp="What is the size of a short integer (in bytes)?"
4838 : check for void type
4840 echo "Checking to see how well your C compiler groks the void type..." >&4
4841 case "$voidflags" in
4843 $cat >try.c <<'EOCP'
4849 extern void moo(); /* function returning void */
4850 void (*goo)(); /* ptr to func returning void */
4852 void *hue; /* generic ptr */
4865 int main() { sub(); }
4867 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
4868 voidflags=$defvoidused
4869 echo "Good. It appears to support void to the level $package wants.">&4
4870 if $contains warning .out >/dev/null 2>&1; then
4871 echo "However, you might get some warnings that look like this:"
4875 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
4876 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
4877 echo "It supports 1..."
4878 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
4879 echo "It also supports 2..."
4880 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
4882 echo "And it supports 4 but not 8 definitely."
4884 echo "It doesn't support 4..."
4885 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
4887 echo "But it supports 8."
4890 echo "Neither does it support 8."
4894 echo "It does not support 2..."
4895 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
4897 echo "But it supports 4 and 8."
4899 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
4901 echo "And it supports 4 but has not heard about 8."
4903 echo "However it supports 8 but not 4."
4908 echo "There is no support at all for void."
4913 case "$voidflags" in
4916 Support flag bits are:
4917 1: basic void declarations.
4918 2: arrays of pointers to functions returning void.
4919 4: operations between pointers to and addresses of void functions.
4920 8: generic void pointers.
4923 rp="Your void support flags add up to what?"
4930 : check for length of pointer
4934 echo "Checking to see how big your pointers are..." >&4
4935 if test "$voidflags" -gt 7; then
4936 echo '#define VOID_PTR char *' > try.c
4938 echo '#define VOID_PTR void *' > try.c
4940 $cat >>try.c <<'EOCP'
4944 printf("%d\n", (int)sizeof(VOID_PTR));
4949 if eval $compile_ok; then
4950 ptrsize=`$run ./try`
4951 echo "Your pointers are $ptrsize bytes long."
4954 echo "(I can't seem to compile the test program. Guessing...)" >&4
4955 rp="What is the size of a pointer (in bytes)?"
4963 : check for long long
4965 echo "Checking to see if you have long long..." >&4
4966 echo 'int main() { long long x = 7; return 0; }' > try.c
4968 if eval $compile; then
4970 echo "You have long long."
4973 echo "You do not have long long."
4979 : check for length of long long
4980 case "${d_longlong}${longlongsize}" in
4983 echo "Checking to see how big your long longs are..." >&4
4984 $cat >try.c <<'EOCP'
4988 printf("%d\n", (int)sizeof(long long));
4993 if eval $compile_ok; then
4994 longlongsize=`$run ./try`
4995 echo "Your long longs are $longlongsize bytes long."
4999 echo "(I can't seem to compile the test program. Guessing...)"
5000 rp="What is the size of a long long (in bytes)?"
5004 if $test "X$longsize" = "X$longlongsize"; then
5005 echo "(That isn't any different from an ordinary long.)"
5011 : determine filename position in cpp output
5013 echo "Computing filename position in cpp output for #include directives..." >&4
5015 vos) testaccess=-e ;;
5018 echo '#include <stdio.h>' > foo.c
5021 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5022 $grep '^[ ]*#.*stdio\.h' | \
5023 while read cline; do
5026 while $test \$# -gt 0; do
5027 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5032 pos=\`expr \$pos + 1\`
5044 *) pos="${fieldn}th";;
5046 echo "Your cpp writes the filename in the $pos field of the line."
5049 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5052 : locate header file
5057 for usrincdir in $usrinc
5059 if test -f \$usrincdir/\$wanted; then
5060 echo "\$usrincdir/\$wanted"
5064 awkprg='{ print \$$fieldn }'
5065 echo "#include <\$wanted>" > foo\$\$.c
5066 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5067 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5068 while read cline; do
5069 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5071 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5072 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5077 # status = 0: grep returned 0 lines, case statement not executed
5078 # status = 1: headerfile found
5079 # status = 2: while loop executed, no headerfile found
5083 if test \$status -eq 1; then
5090 : define an alternate in-header-list? function
5091 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5092 cont=true; xxf="echo \"<\$1> found.\" >&4";
5093 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5094 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5096 case $# in 4) instead=instead;; *) instead="at last";; esac;
5097 while $test "$cont"; do
5099 var=$2; eval "was=\$$2";
5100 if $test "$xxx" && $test -r "$xxx";
5102 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5105 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5106 set $yyy; shift; shift; yyy=$@;
5107 case $# in 0) cont="";;
5108 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5109 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5110 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5111 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5115 do set $yyy; var=$2; eval "was=\$$2";
5116 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5117 set $yyy; shift; shift; yyy=$@;
5120 : see if inttypes.h is available
5121 : we want a real compile instead of Inhdr because some systems
5122 : have an inttypes.h which includes non-existent headers
5125 #include <inttypes.h>
5127 static int32_t foo32 = 0x12345678;
5131 if eval $compile; then
5132 echo "<inttypes.h> found." >&4
5135 echo "<inttypes.h> NOT found." >&4
5144 echo "Checking to see if you have int64_t..." >&4
5146 #include <sys/types.h>
5147 #$i_inttypes I_INTTYPES
5149 #include <inttypes.h>
5151 int main() { int64_t x = 7; }
5154 if eval $compile; then
5156 echo "You have int64_t."
5159 echo "You do not have int64_t."
5167 echo "Checking which 64-bit integer type we could use..." >&4
5173 val='"unsigned int"'
5178 *) case "$longsize" in
5182 val='"unsigned long"'
5187 *) case "$d_longlong:$longlongsize" in
5192 val='"unsigned long long"'
5197 *) case "$d_int64_t" in
5216 '') echo "Alas, no 64-bit integer types in sight." >&4
5219 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5225 case "$uselonglong" in
5226 "$define"|true|[yY]*)
5229 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5231 use64bitint="$define"
5234 case "$use64bits" in
5235 "$define"|true|[yY]*)
5238 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5240 use64bitint="$define"
5243 case "$use64bitints" in
5244 "$define"|true|[yY]*)
5247 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5249 use64bitint="$define"
5252 case "$use64bitsint" in
5253 "$define"|true|[yY]*)
5256 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5258 use64bitint="$define"
5261 case "$uselonglongs" in
5262 "$define"|true|[yY]*)
5265 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5267 use64bitint="$define"
5270 case "$use64bitsall" in
5271 "$define"|true|[yY]*)
5274 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5276 use64bitall="$define"
5281 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5283 case "$use64bitall" in
5284 "$define"|true|[yY]*) use64bitint="$define" ;;
5290 You have natively 64-bit long integers.
5294 *) case "$use64bitint" in
5295 "$define"|true|[yY]*) dflt='y';;
5304 Perl can be built to take advantage of 64-bit integer types
5305 on some systems. To do so, Configure can be run with -Duse64bitint.
5306 Choosing this option will most probably introduce binary incompatibilities.
5308 If this doesn't make any sense to you, just accept the default '$dflt'.
5309 (The default has been chosen based on your configuration.)
5311 rp='Try to use 64-bit integers, if available?'
5314 [yY]*) val="$define" ;;
5322 case "$use64bitall" in
5323 "$define"|true|[yY]*) dflt='y' ;;
5324 *) case "$longsize" in
5332 You may also choose to try maximal 64-bitness. It means using as much
5333 64-bitness as possible on the platform. This in turn means even more
5334 binary incompatibilities. On the other hand, your platform may not
5335 have any more 64-bitness available than what you already have chosen.
5337 If this doesn't make any sense to you, just accept the default '$dflt'.
5338 (The default has been chosen based on your configuration.)
5340 rp='Try to use maximal 64-bit support, if available?'
5343 [yY]*) val="$define" ;;
5348 case "$use64bitall" in
5350 case "$use64bitint" in
5354 Since you have chosen a maximally 64-bit build, I'm also turning on
5355 the use of 64-bit integers.
5357 use64bitint="$define" ;;
5362 case "$use64bitall" in
5363 "$define"|true|[yY]*)
5367 *** You have chosen a maximally 64-bit build, but your pointers
5368 *** are only 4 bytes wide, disabling maximal 64-bitness.
5371 use64bitall="$undef"
5372 case "$use64bitint" in
5373 "$define"|true|[yY]*) ;;
5376 *** Downgrading from maximal 64-bitness to using 64-bit integers.
5379 use64bitint="$define"
5387 case "$use64bitint" in
5388 "$define"|true|[yY]*)
5389 : Look for a hint-file generated 'call-back-unit'. If the
5390 : user has specified that a 64-bit perl is to be built,
5391 : we may need to set or change some other defaults.
5392 if $test -f use64bitint.cbu; then
5393 echo "Your platform has some specific hints for 64-bit integers, using them..."
5397 4) case "$archname64" in
5398 '') archname64=64int ;;
5405 case "$use64bitall" in
5406 "$define"|true|[yY]*)
5407 : Look for a hint-file generated 'call-back-unit'. If the
5408 : user has specified that a maximally 64-bit perl is to be built,
5409 : we may need to set or change some other defaults.
5410 if $test -f use64bitall.cbu; then
5411 echo "Your platform has some specific hints for 64-bit builds, using them..."
5415 4) case "$archname64" in
5416 ''|64int) archname64=64all ;;
5424 echo "Checking for GNU C Library..." >&4
5437 if eval $compile_ok && $run ./try; then
5439 echo "You are using the GNU C Library"
5442 echo "You are not using the GNU C Library"
5448 : see if nm is to be used to determine whether a symbol is defined or not
5452 case "$d_gnulibc" in
5455 echo "nm probably won't work on the GNU C Library." >&4
5461 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5463 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5464 echo "'nm' won't be sufficient on this sytem." >&4
5470 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5471 if $test $dflt -gt 20; then
5481 true|$define) dflt=y;;
5488 I can use $nm to extract the symbols from your C libraries. This
5489 is a time consuming task which may generate huge output on the disk (up
5490 to 3 megabytes) but that should make the symbols extraction faster. The
5491 alternative is to skip the 'nm' extraction part and to compile a small
5492 test program instead to determine whether each symbol is present. If
5493 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5494 this may be the best solution.
5496 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5499 rp="Shall I use $nm to extract C symbols from the libraries?"
5502 [Nn]*) usenm=false;;
5511 : nm options which may be necessary
5513 '') if $test -f /mach_boot; then
5515 elif $test -d /usr/ccs/lib; then
5516 nm_opt='-p' # Solaris (and SunOS?)
5517 elif $test -f /dgux; then
5519 elif $test -f /lib64/rld; then
5520 nm_opt='-p' # 64-bit Irix
5526 : nm options which may be necessary for shared libraries but illegal
5527 : for archive libraries. Thank you, Linux.
5528 case "$nm_so_opt" in
5529 '') case "$myuname" in
5531 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5532 nm_so_opt='--dynamic'
5541 : get list of predefined functions in a handy place
5546 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5552 *) for thislib in $libs; do
5555 : Handle C library specially below.
5558 thislib=`echo $thislib | $sed -e 's/^-l//'`
5559 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5561 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5563 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5565 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5567 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5569 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5571 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5576 libnames="$libnames $try"
5578 *) libnames="$libnames $thislib" ;;
5587 for xxx in $libpth; do
5588 $test -r $1 || set $xxx/libc.$so
5589 : The messy sed command sorts on library version numbers.
5591 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5592 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5594 s/[0-9][0-9]*/0000&/g
5595 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5598 $sort | $sed -e 's/^.* //'`
5601 $test -r $1 || set /usr/ccs/lib/libc.$so
5602 $test -r $1 || set /lib/libsys_s$_a
5608 if $test -r "$1"; then
5609 echo "Your (shared) C library seems to be in $1."
5611 elif $test -r /lib/libc && $test -r /lib/clib; then
5612 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5614 libc='/lib/clib /lib/libc'
5615 if $test -r /lib/syslib; then
5616 echo "(Your math library is in /lib/syslib.)"
5617 libc="$libc /lib/syslib"
5619 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5620 echo "Your C library seems to be in $libc, as you said before."
5621 elif $test -r $incpath/usr/lib/libc$_a; then
5622 libc=$incpath/usr/lib/libc$_a;
5623 echo "Your C library seems to be in $libc. That's fine."
5624 elif $test -r /lib/libc$_a; then
5626 echo "Your C library seems to be in $libc. You're normal."
5628 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5630 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5631 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5632 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5634 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5636 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5639 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5641 if $test -r "$tans"; then
5642 echo "Your C library seems to be in $tans, of all places."
5648 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5652 If the guess above is wrong (which it might be if you're using a strange
5653 compiler, or your machine supports multiple models), you can override it here.
5658 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5660 I can't seem to find your C library. I've looked in the following places:
5663 $sed 's/^/ /' libpath
5666 None of these seems to contain your C library. I need to get its name...
5671 rp='Where is your C library?'
5676 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5677 set X `cat libnames`
5680 case $# in 1) xxx=file; esac
5681 echo "Extracting names from the following $xxx for later perusal:" >&4
5683 $sed 's/^/ /' libnames >&4
5685 $echo $n "This may take a while...$c" >&4
5689 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5690 *) $nm $nm_opt $file 2>/dev/null;;
5695 $grep fprintf libc.tmp > libc.ptf
5696 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5697 xrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
5699 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5701 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5703 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5705 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5707 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5709 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5711 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5713 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5715 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5717 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5719 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5721 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5723 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5724 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5726 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5728 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5730 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5732 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5734 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5736 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5738 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5740 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5742 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5744 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5746 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5748 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5750 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5752 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5754 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5757 $nm -p $* 2>/dev/null >libc.tmp
5758 $grep fprintf libc.tmp > libc.ptf
5759 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5760 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5766 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5768 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5769 for thisname in $libnames $libc; do
5770 $ar t $thisname >>libc.tmp
5772 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5774 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5775 # Repeat libc to extract forwarders to DLL entries too
5776 for thisname in $libnames $libc; do
5777 $ar tv $thisname >>libc.tmp
5778 # Revision 50 of EMX has bug in $ar.
5779 # it will not extract forwarders to DLL entries
5780 # Use emximp which will extract exactly them.
5781 emximp -o tmp.imp $thisname \
5783 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5784 < tmp.imp >>libc.tmp
5787 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5790 echo "$ar didn't seem to work right." >&4
5791 echo "Maybe this is a Cray...trying bld instead..." >&4
5792 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5794 for thisname in $libnames; do
5796 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5797 $ar t $thisname >>libc.tmp
5801 echo "That didn't work either. Giving up." >&4
5808 if $test -f /lib/syscalls.exp; then
5810 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5811 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
5815 $rm -f libnames libpath
5817 : is a C symbol defined?
5820 -v) tf=libc.tmp; tc=""; tdc="";;
5821 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5822 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5825 case "$reuseval-$4" in
5827 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5833 if $contains $tlook $tf >/dev/null 2>&1;
5838 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5839 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5847 $define) tval=true;;
5853 : define an is-in-libc? function
5854 inlibc='echo " "; td=$define; tu=$undef;
5855 sym=$1; var=$2; eval "was=\$$2";
5857 case "$reuseval$was" in
5867 echo "$sym() found." >&4;
5868 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5870 echo "$sym() NOT found." >&4;
5871 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5875 $define) echo "$sym() found." >&4;;
5876 *) echo "$sym() NOT found." >&4;;
5880 : see if sqrtl exists
5884 : check for length of double
5886 case "$doublesize" in
5888 echo "Checking to see how big your double precision numbers are..." >&4
5889 $cat >try.c <<'EOCP'
5893 printf("%d\n", (int)sizeof(double));
5898 if eval $compile_ok; then
5899 doublesize=`$run ./try`
5900 echo "Your double is $doublesize bytes long."
5903 echo "(I can't seem to compile the test program. Guessing...)"
5904 rp="What is the size of a double precision number (in bytes)?"
5912 : check for long doubles
5914 echo "Checking to see if you have long double..." >&4
5915 echo 'int main() { long double x = 7.0; }' > try.c
5917 if eval $compile; then
5919 echo "You have long double."
5922 echo "You do not have long double."
5928 : check for length of long double
5929 case "${d_longdbl}${longdblsize}" in
5932 echo "Checking to see how big your long doubles are..." >&4
5933 $cat >try.c <<'EOCP'
5937 printf("%d\n", sizeof(long double));
5942 if eval $compile; then
5943 longdblsize=`$run ./try`
5944 echo "Your long doubles are $longdblsize bytes long."
5948 echo "(I can't seem to compile the test program. Guessing...)" >&4
5949 rp="What is the size of a long double (in bytes)?"
5953 if $test "X$doublesize" = "X$longdblsize"; then
5954 echo "(That isn't any different from an ordinary double.)"
5962 if $test X"$d_longdbl" = X"$define"; then
5964 echo "Checking how to print long doubles..." >&4
5966 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
5967 $cat >try.c <<'EOCP'
5968 #include <sys/types.h>
5972 printf("%.3f\n", d);
5976 if eval $compile; then
5980 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
5981 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
5982 echo "We will use %f."
5988 if $test X"$sPRIfldbl" = X; then
5989 $cat >try.c <<'EOCP'
5990 #include <sys/types.h>
5993 long double d = 123.456;
5994 printf("%.3Lf\n", d);
5998 if eval $compile; then
6002 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
6003 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
6004 echo "We will use %Lf."
6010 if $test X"$sPRIfldbl" = X; then
6011 $cat >try.c <<'EOCP'
6012 #include <sys/types.h>
6015 long double d = 123.456;
6016 printf("%.3llf\n", d);
6020 if eval $compile; then
6024 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
6025 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
6026 echo "We will use %llf."
6032 if $test X"$sPRIfldbl" = X; then
6033 $cat >try.c <<'EOCP'
6034 #include <sys/types.h>
6037 long double d = 123.456;
6038 printf("%.3lf\n", d);
6042 if eval $compile; then
6046 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
6047 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
6048 echo "We will use %lf."
6054 if $test X"$sPRIfldbl" = X; then
6055 echo "Cannot figure out how to print long doubles." >&4
6057 sSCNfldbl=$sPRIfldbl # expect consistency
6064 case "$sPRIfldbl" in
6065 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
6066 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
6067 d_SCNfldbl="$undef";
6069 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
6070 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
6071 d_SCNfldbl="$define";
6075 : see if modfl exists
6079 d_modfl_pow32_bug="$undef"
6081 case "$d_longdbl$d_modfl" in
6084 Checking to see whether your modfl() is okay for large values...
6090 long double nv = 4294967303.15;
6096 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
6100 case "$osname:$gccversion" in
6101 aix:) saveccflags="$ccflags"
6102 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
6105 if eval $compile; then
6108 *" 4294967303.150000 1.150000 4294967302.000000")
6109 echo >&4 "Your modfl() is broken for large values."
6110 d_modfl_pow32_bug="$define"
6112 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
6116 *" 4294967303.150000 0.150000 4294967303.000000")
6117 echo >&4 "Your modfl() seems okay for large values."
6119 *) echo >&4 "I don't understand your modfl() at all."
6123 $rm -f try.* try core core.try.*
6125 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
6128 case "$osname:$gccversion" in
6129 aix:) ccflags="$saveccflags" ;; # restore
6135 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6138 case "$uselongdouble" in
6139 $define|true|[yY]*) dflt='y';;
6144 Perl can be built to take advantage of long doubles which
6145 (if available) may give more accuracy and range for floating point numbers.
6147 If this doesn't make any sense to you, just accept the default '$dflt'.
6149 rp='Try to use long doubles if available?'
6152 y|Y) val="$define" ;;
6158 case "$uselongdouble" in
6159 true|[yY]*) uselongdouble="$define" ;;
6162 case "$uselongdouble" in
6164 : Look for a hint-file generated 'call-back-unit'. If the
6165 : user has specified that long doubles should be used,
6166 : we may need to set or change some other defaults.
6167 if $test -f uselongdouble.cbu; then
6168 echo "Your platform has some specific hints for long doubles, using them..."
6169 . ./uselongdouble.cbu
6172 (Your platform doesn't have any specific hints for long doubles.)
6179 case "$uselongdouble:$d_sqrtl:$d_modfl" in
6180 $define:$define:$define)
6183 $define:$define:$undef)
6184 message="I could not find modfl"
6186 $define:$undef:$define)
6187 message="I could not find sqrtl"
6189 $define:$undef:$undef)
6190 message="I found neither sqrtl nor modfl"
6194 if $test "$message" != X; then
6197 *** You requested the use of long doubles but you do not seem to have
6198 *** the mathematic functions for long doubles.
6200 *** I'm disabling the use of long doubles.
6204 uselongdouble=$undef
6207 case "$useperlio" in
6208 $define|true|[yY]*|'') dflt='y';;
6213 Previous version of $package used the standard IO mechanisms as
6214 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
6215 alternate IO mechanisms via the PerlIO abstraction layer, but the
6216 stdio mechanism is still available if needed. The abstraction layer
6217 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
6218 Using PerlIO with sfio may cause problems with some extension modules.
6220 If this doesn't make any sense to you, just accept the default '$dflt'.
6222 rp='Use the PerlIO abstraction layer?'
6229 echo "Ok, doing things the stdio way."
6238 case "$useperlio" in
6239 $define|true|[yY]*) ;;
6242 You are using the SOCKS proxy protocol library which means that you
6243 should also use the PerlIO layer. You may be headed for trouble.
6252 : determine the architecture name
6254 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6255 tarch=`arch`"-$osname"
6256 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6257 if uname -m > tmparch 2>&1 ; then
6258 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6259 -e 's/$/'"-$osname/" tmparch`
6267 case "$myarchname" in
6270 echo "(Your architecture name used to be $myarchname.)"
6274 case "$targetarch" in
6276 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6281 *) dflt="$archname";;
6283 rp='What is your architecture name'
6286 case "$usethreads" in
6288 echo "Threads selected." >&4
6290 *-thread*) echo "...and architecture name already has -thread." >&4
6292 *) archname="$archname-thread"
6293 echo "...setting architecture name to $archname." >&4
6298 case "$usemultiplicity" in
6300 echo "Multiplicity selected." >&4
6302 *-multi*) echo "...and architecture name already has -multi." >&4
6304 *) archname="$archname-multi"
6305 echo "...setting architecture name to $archname." >&4
6310 case "$use64bitint$use64bitall" in
6312 case "$archname64" in
6314 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6317 case "$use64bitint" in
6318 "$define") echo "64 bit integers selected." >&4 ;;
6320 case "$use64bitall" in
6321 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6324 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6326 *) archname="$archname-$archname64"
6327 echo "...setting architecture name to $archname." >&4
6333 case "$uselongdouble" in
6335 echo "Long doubles selected." >&4
6336 case "$longdblsize" in
6338 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6342 *-ld*) echo "...and architecture name already has -ld." >&4
6344 *) archname="$archname-ld"
6345 echo "...setting architecture name to $archname." >&4
6352 case "$useperlio" in
6354 echo "Perlio selected." >&4
6357 echo "Perlio not selected, using stdio." >&4
6359 *-stdio*) echo "...and architecture name already has -stdio." >&4
6361 *) archname="$archname-stdio"
6362 echo "...setting architecture name to $archname." >&4
6368 : determine root of directory hierarchy where package will be installed.
6371 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
6379 By default, $package will be installed in $dflt/bin, manual pages
6380 under $dflt/man, etc..., i.e. with $dflt as prefix for all
6381 installation directories. Typically this is something like /usr/local.
6382 If you wish to have binaries under /usr/bin but other parts of the
6383 installation under /usr/local, that's ok: you will be prompted
6384 separately for each of the installation directories, the prefix being
6385 only used to set the defaults.
6389 rp='Installation prefix to use?'
6397 *) oldprefix="$prefix";;
6406 *) afsroot=$afsroot ;;
6412 $define|true) afs=true ;;
6413 $undef|false) afs=false ;;
6414 *) if test -d $afsroot; then
6422 echo "AFS may be running... I'll be extra cautious then..." >&4
6424 echo "AFS does not seem to be running..." >&4
6427 : determine installation prefix for where package is to be installed.
6431 Since you are running AFS, I need to distinguish the directory in which
6432 files will reside from the directory in which they are installed (and from
6433 which they are presumably copied to the former directory by occult means).
6436 case "$installprefix" in
6437 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
6438 *) dflt="$installprefix";;
6443 In some special cases, particularly when building $package for distribution,
6444 it is convenient to distinguish between the directory in which files should
6445 be installed from the directory ($prefix) in which they
6446 will eventually reside. For most users, these two directories are the same.
6449 case "$installprefix" in
6451 *) dflt=$installprefix;;
6455 rp='What installation prefix should I use for installing files?'
6457 installprefix="$ans"
6458 installprefixexp="$ansexp"
6460 : set the prefixit variable, to compute a suitable default value
6461 prefixit='case "$3" in
6463 case "$oldprefix" in
6464 "") eval "$1=\"\$$2\"";;
6471 ""|" ") eval "$1=\"\$$2\"";;
6477 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6479 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6480 /*-$oldprefix/*|\~*-$oldprefix/*)
6481 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6482 *) eval "$1=\"\$$2\"";;
6486 : get the patchlevel
6488 echo "Getting the current patchlevel..." >&4
6489 if $test -r $rsrc/patchlevel.h;then
6490 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6491 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6492 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6493 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6494 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6495 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6496 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6505 $echo "(You do not have patchlevel.h. Eek.)"
6507 if $test -r $rsrc/.patch ; then
6508 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6509 perl_patchlevel=`cat $rsrc/.patch`
6512 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6513 version_patchlevel_string="version $patchlevel subversion $subversion"
6514 case "$perl_patchlevel" in
6516 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6519 $echo "(You have $package $version_patchlevel_string.)"
6523 : XXX Should be a Configure test for double-dots in filenames.
6524 version=`echo $revision $patchlevel $subversion | \
6525 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6526 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6527 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6530 version=`echo $revision $patchlevel $subversion | \
6531 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6532 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6533 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6536 : Special case the 5.005_xx maintenance series, which used 5.005
6537 : without any subversion label as a subdirectory in $sitelib
6538 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6539 api_versionstring='5.005'
6542 : determine installation style
6543 : For now, try to deduce it from prefix unless it is already set.
6544 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6545 case "$installstyle" in
6546 '') case "$prefix" in
6547 *perl*) dflt='lib';;
6548 *) dflt='lib/perl5' ;;
6551 *) dflt="$installstyle" ;;
6553 : Probably not worth prompting for this since we prompt for all
6554 : the directories individually, and the prompt would be too long and
6558 : determine where private library files go
6559 : Usual default is /usr/local/lib/perl5/$version.
6560 : Also allow things like /opt/perl/lib/$version, since
6561 : /opt/perl/lib/perl5... would be redundant.
6562 : The default "style" setting is made in installstyle.U
6563 case "$installstyle" in
6564 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6565 *) set dflt privlib lib/$version ;;
6570 There are some auxiliary files for $package that need to be put into a
6571 private library directory that is accessible by everyone.
6575 rp='Pathname where the private library files will reside?'
6578 privlibexp="$ansexp"
6579 : Change installation prefix, if necessary.
6580 if $test X"$prefix" != X"$installprefix"; then
6581 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6583 installprivlib="$privlibexp"
6586 : set the prefixup variable, to restore leading tilda escape
6587 prefixup='case "$prefixexp" in
6589 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6592 : determine where public architecture dependent libraries go
6595 : privlib default is /usr/local/lib/$package/$version
6596 : archlib default is /usr/local/lib/$package/$version/$archname
6597 : privlib may have an optional trailing /share.
6598 tdflt=`echo $privlib | $sed 's,/share$,,'`
6599 tdflt=$tdflt/$archname
6608 $spackage contains architecture-dependent library files. If you are
6609 sharing libraries in a heterogeneous environment, you might store
6610 these files in a separate location. Otherwise, you can just include
6611 them with the rest of the public library files.
6615 rp='Where do you want to put the public architecture-dependent libraries?'
6618 archlibexp="$ansexp"
6619 if $test X"$archlib" = X"$privlib"; then
6624 : Change installation prefix, if necessary.
6625 if $test X"$prefix" != X"$installprefix"; then
6626 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6628 installarchlib="$archlibexp"
6632 : Binary compatibility with 5.005 is not possible for builds
6633 : with advanced features
6634 case "$usethreads$usemultiplicity" in
6636 bincompat5005="$undef"
6637 d_bincompat5005="$undef"
6641 This version of Perl can be compiled for binary compatibility with 5.005.
6642 If you decide to do so, you will be able to continue using most of the
6643 extensions that were compiled for Perl 5.005.
6646 case "$bincompat5005$d_bincompat5005" in
6647 *"$undef"*) dflt=n ;;
6650 rp='Binary compatibility with Perl 5.005?'
6653 y*) val="$define" ;;
6658 case "$d_bincompat5005" in
6660 bincompat5005="$define"
6662 *) bincompat5005="$undef"
6663 d_bincompat5005="$undef"
6670 : see if setuid scripts can be secure
6673 Some kernels have a bug that prevents setuid #! scripts from being
6674 secure. Some sites have disabled setuid #! scripts because of this.
6676 First let's decide if your kernel supports secure setuid #! scripts.
6677 (If setuid #! scripts would be secure but have been disabled anyway,
6678 don't say that they are secure if asked.)
6683 if $test -d /dev/fd; then
6684 echo "#!$ls" >reflect
6685 chmod +x,u+s reflect
6686 ./reflect >flect 2>&1
6687 if $contains "/dev/fd" flect >/dev/null; then
6688 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6692 If you are not sure if they are secure, I can check but I'll need a
6693 username and password different from the one you are using right now.
6694 If you don't have such a username or don't want me to test, simply
6698 rp='Other username to test security of setuid scripts with?'
6703 case "$d_suidsafe" in
6704 '') echo "I'll assume setuid scripts are *not* secure." >&4
6707 echo "Well, the $hint value is *not* secure." >&4
6709 *) echo "Well, the $hint value *is* secure." >&4
6714 $rm -f reflect flect
6715 echo "#!$ls" >reflect
6716 chmod +x,u+s reflect
6719 echo '"su" will (probably) prompt you for '"$ans's password."
6720 su $ans -c './reflect >flect'
6721 if $contains "/dev/fd" flect >/dev/null; then
6722 echo "Okay, it looks like setuid scripts are secure." >&4
6725 echo "I don't think setuid scripts are secure." >&4
6730 rp='Does your kernel have *secure* setuid scripts?'
6733 [yY]*) val="$define";;
6738 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6739 echo "(That's for file descriptors, not floppy disks.)"
6745 $rm -f reflect flect
6747 : now see if they want to do setuid emulation
6750 case "$d_suidsafe" in
6753 echo "No need to emulate SUID scripts since they are secure here." >&4
6757 Some systems have disabled setuid scripts, especially systems where
6758 setuid scripts cannot be secure. On systems where setuid scripts have
6759 been disabled, the setuid/setgid bits on scripts are currently
6760 useless. It is possible for $package to detect those bits and emulate
6761 setuid/setgid in a secure fashion. This emulation will only work if
6762 setuid scripts have been disabled in your kernel.
6766 "$define") dflt=y ;;
6769 rp="Do you want to do setuid/setgid emulation?"
6772 [yY]*) val="$define";;
6780 : see if this is a malloc.h system
6781 set malloc.h i_malloc
6784 : see if stdlib is available
6785 set stdlib.h i_stdlib
6788 : determine which malloc to compile in
6790 case "$usemymalloc" in
6791 [yY]*|true|$define) dflt='y' ;;
6792 [nN]*|false|$undef) dflt='n' ;;
6793 *) case "$ptrsize" in
6799 rp="Do you wish to attempt to use the malloc that comes with $package?"
6805 mallocsrc='malloc.c'
6806 mallocobj="malloc$_o"
6807 d_mymalloc="$define"
6810 : Remove malloc from list of libraries to use
6811 echo "Removing unneeded -lmalloc from library list" >&4
6812 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6815 echo "libs = $libs" >&4
6827 : compute the return types of malloc and free
6829 $cat >malloc.c <<END
6833 #include <sys/types.h>
6847 case "$malloctype" in
6849 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6856 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6860 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6867 echo "Your system uses $freetype free(), it would seem." >&4
6871 After $package is installed, you may wish to install various
6872 add-on modules and utilities. Typically, these add-ons will
6873 be installed under $prefix with the rest
6874 of this package. However, you may wish to install such add-ons
6875 elsewhere under a different prefix.
6877 If you do not wish to put everything under a single prefix, that's
6878 ok. You will be prompted for the individual locations; this siteprefix
6879 is only used to suggest the defaults.
6881 The default should be fine for most people.
6885 rp='Installation prefix to use for add-on modules and utilities?'
6886 : XXX Here might be another good place for an installstyle setting.
6887 case "$siteprefix" in
6889 *) dflt=$siteprefix ;;
6892 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6894 case "$siteprefix" in
6898 *) oldsiteprefix="$prefix";;
6903 siteprefixexp="$ansexp"
6905 : determine where site specific libraries go.
6906 : Usual default is /usr/local/lib/perl5/site_perl/$version
6907 : The default "style" setting is made in installstyle.U
6908 : XXX No longer works with Prefixit stuff.
6909 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6911 '') case "$installstyle" in
6912 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6913 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6921 The installation process will create a directory for
6922 site-specific extensions and modules. Most users find it convenient
6923 to place all site-specific files in this directory rather than in the
6924 main distribution directory.
6928 rp='Pathname for the site-specific library files?'
6931 sitelibexp="$ansexp"
6932 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6933 : Change installation prefix, if necessary.
6934 if $test X"$prefix" != X"$installprefix"; then
6935 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6937 installsitelib="$sitelibexp"
6940 : determine where site specific architecture-dependent libraries go.
6941 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6942 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6943 : sitelib may have an optional trailing /share.
6945 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6946 dflt="$dflt/$archname"
6951 set sitearch sitearch none
6955 The installation process will also create a directory for
6956 architecture-dependent site-specific extensions and modules.
6960 rp='Pathname for the site-specific architecture-dependent library files?'
6963 sitearchexp="$ansexp"
6964 : Change installation prefix, if necessary.
6965 if $test X"$prefix" != X"$installprefix"; then
6966 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6968 installsitearch="$sitearchexp"
6973 The installation process will also create a directory for
6974 vendor-supplied add-ons. Vendors who supply perl with their system
6975 may find it convenient to place all vendor-supplied files in this
6976 directory rather than in the main distribution directory. This will
6977 ease upgrades between binary-compatible maintenance versions of perl.
6979 Of course you may also use these directories in whatever way you see
6980 fit. For example, you might use them to access modules shared over a
6981 company-wide network.
6983 The default answer should be fine for most people.
6984 This causes further questions about vendor add-ons to be skipped
6985 and no vendor-specific directories will be configured for perl.
6988 rp='Do you want to configure vendor-specific add-on directories?'
6989 case "$usevendorprefix" in
6990 define|true|[yY]*) dflt=y ;;
6991 *) : User may have set vendorprefix directly on Configure command line.
6992 case "$vendorprefix" in
7001 rp='Installation prefix to use for vendor-supplied add-ons?'
7002 case "$vendorprefix" in
7004 *) dflt=$vendorprefix ;;
7007 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7009 case "$vendorprefix" in
7013 *) oldvendorprefix="$prefix";;
7017 usevendorprefix="$define"
7019 vendorprefixexp="$ansexp"
7021 *) usevendorprefix="$undef"
7027 case "$vendorprefix" in
7028 '') d_vendorlib="$undef"
7032 *) d_vendorlib="$define"
7033 : determine where vendor-supplied modules go.
7034 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7035 case "$vendorlib" in
7037 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7038 case "$installstyle" in
7039 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7040 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7043 *) dflt="$vendorlib"
7047 rp='Pathname for the vendor-supplied library files?'
7050 vendorlibexp="$ansexp"
7053 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7054 : Change installation prefix, if necessary.
7055 if $test X"$prefix" != X"$installprefix"; then
7056 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
7058 installvendorlib="$vendorlibexp"
7061 case "$vendorprefix" in
7062 '') d_vendorarch="$undef"
7066 *) d_vendorarch="$define"
7067 : determine where vendor-supplied architecture-dependent libraries go.
7068 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7069 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7070 : vendorlib may have an optional trailing /share.
7071 case "$vendorarch" in
7072 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7073 dflt="$dflt/$archname"
7075 *) dflt="$vendorarch" ;;
7078 rp='Pathname for vendor-supplied architecture-dependent files?'
7081 vendorarchexp="$ansexp"
7084 : Change installation prefix, if necessary.
7085 if $test X"$prefix" != X"$installprefix"; then
7086 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
7088 installvendorarch="$vendorarchexp"
7091 : Final catch-all directories to search
7094 Lastly, you can have perl look in other directories for extensions and
7095 modules in addition to those already specified.
7096 These directories will be searched after
7100 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7101 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7103 case "$otherlibdirs" in
7104 ''|' ') dflt='none' ;;
7105 *) dflt="$otherlibdirs" ;;
7108 Enter a colon-separated set of extra paths to include in perl's @INC
7109 search path, or enter 'none' for no extra paths.
7113 rp='Colon-separated list of additional directories for perl to search?'
7116 ' '|''|none) otherlibdirs=' ' ;;
7117 *) otherlibdirs="$ans" ;;
7119 case "$otherlibdirs" in
7123 set d_perl_otherlibdirs
7126 : Cruising for prototypes
7128 echo "Checking out function prototypes..." >&4
7129 $cat >prototype.c <<'EOCP'
7130 int main(int argc, char *argv[]) {
7133 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7134 echo "Your C compiler appears to support function prototypes."
7137 echo "Your C compiler doesn't seem to understand function prototypes."
7144 case "$prototype" in
7146 *) ansi2knr='ansi2knr'
7151 This version of $package can only be compiled by a compiler that
7152 understands function prototypes. Unfortunately, your C compiler
7154 doesn't seem to understand them. Sorry about that.
7156 If GNU cc is available for your system, perhaps you could try that instead.
7158 Eventually, we hope to support building Perl with pre-ANSI compilers.
7159 If you would like to help in that effort, please contact <perlbug@perl.org>.
7161 Aborting Configure now.
7167 : determine where public executables go
7172 rp='Pathname where the public executables will reside?'
7174 if $test "X$ansexp" != "X$binexp"; then
7179 : Change installation prefix, if necessary.
7180 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7181 if $test X"$prefix" != X"$installprefix"; then
7182 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
7184 installbin="$binexp"
7193 Perl can be built with extra modules or bundles of modules which
7194 will be fetched from the CPAN and installed alongside Perl.
7196 Notice that you will need access to the CPAN; either via the Internet,
7197 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7198 be asked later to configure the CPAN.pm module which will in turn do
7199 the installation of the rest of the extra modules or bundles.)
7201 Notice also that if the modules require any external software such as
7202 libraries and headers (the libz library and the zlib.h header for the
7203 Compress::Zlib module, for example) you MUST have any such software
7204 already installed, this configuration process will NOT install such
7207 If this doesn't make any sense to you, just accept the default '$dflt'.
7209 rp='Install any extra modules (y or n)?'
7215 Please list any extra modules or bundles to be installed from CPAN,
7216 with spaces between the names. The names can be in any format the
7217 'install' command of CPAN.pm will understand. (Answer 'none',
7218 without the quotes, to install no extra modules or bundles.)
7228 $rm -f ../extras.lst
7230 *) echo "(Saving the list of extras for later...)"
7231 echo "$extras" > ../extras.lst
7239 : Find perl5.005 or later.
7240 echo "Looking for a previously installed perl5.005 or later... "
7242 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7243 : Check if this perl is recent and can load a simple module
7244 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7247 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7257 '') echo "None found. That's ok.";;
7258 *) echo "Using $perl5." ;;
7261 : Determine list of previous versions to include in @INC
7262 $cat > getverlist <<EOPL
7265 \$api_versionstring = "$api_versionstring";
7266 \$version = "$version";
7267 \$stem = "$sitelib_stem";
7268 \$archname = "$archname";
7270 $cat >> getverlist <<'EOPL'
7271 # Can't have leading @ because metaconfig interprets it as a command!
7272 ;@inc_version_list=();
7273 # XXX Redo to do opendir/readdir?
7276 ;@candidates = glob("5.*");
7282 # XXX ToDo: These comparisons must be reworked when two-digit
7283 # subversions come along, so that 5.7.10 compares as greater than
7284 # 5.7.3! By that time, hope that 5.6.x is sufficiently
7285 # widespread that we can use the built-in version vectors rather
7286 # than reinventing them here. For 5.6.0, however, we must
7287 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
7288 foreach $d (@candidates) {
7289 if ($d lt $version) {
7290 if ($d ge $api_versionstring) {
7291 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
7293 elsif ($d ge "5.005") {
7294 unshift(@inc_version_list, grep { -d } $d);
7298 # Skip newer version. I.e. don't look in
7299 # 5.7.0 if we're installing 5.6.1.
7303 if (@inc_version_list) {
7304 print join(' ', @inc_version_list);
7307 # Blank space to preserve value for next Configure run.
7312 case "$inc_version_list" in
7313 '') if test -x "$perl5$exe_ext"; then
7314 dflt=`$perl5 getverlist`
7319 $undef) dflt='none' ;;
7320 *) eval dflt=\"$inc_version_list\" ;;
7323 ''|' ') dflt=none ;;
7326 5.005) case "$bincompat5005" in
7327 $define|true|[yY]*) ;;
7334 In order to ease the process of upgrading, this version of perl
7335 can be configured to use modules built and installed with earlier
7336 versions of perl that were installed under $prefix. Specify here
7337 the list of earlier versions that this version of perl should check.
7338 If Configure detected no earlier versions of perl installed under
7339 $prefix, then the list will be empty. Answer 'none' to tell perl
7340 to not search earlier versions.
7342 The default should almost always be sensible, so if you're not sure,
7343 just accept the default.
7346 rp='List of earlier versions to include in @INC?'
7349 [Nn]one|''|' ') inc_version_list=' ' ;;
7350 *) inc_version_list="$ans" ;;
7352 case "$inc_version_list" in
7354 inc_version_list_init='0';;
7355 *) inc_version_list_init=`echo $inc_version_list |
7356 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7361 : determine whether to install perl also as /usr/bin/perl
7364 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7366 Many scripts expect perl to be installed as /usr/bin/perl.
7367 I can install the perl you are about to compile also as /usr/bin/perl
7368 (in addition to $installbin/perl).
7370 case "$installusrbinperl" in
7371 "$undef"|[nN]*) dflt='n';;
7374 rp="Do you want to install perl as /usr/bin/perl?"
7377 [yY]*) val="$define";;
7383 set installusrbinperl
7386 : see if dld is available
7390 : see if dlopen exists
7397 : determine which dynamic loading, if any, to compile in
7399 dldir="ext/DynaLoader"
7412 $define) dflt='y' ;;
7415 $define) dflt='y' ;;
7417 : Does a dl_xxx.xs file exist for this operating system
7418 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7421 rp="Do you wish to use dynamic loading?"
7428 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7429 dflt="$dldir/dl_${osname}.xs"
7430 elif $test "$d_dlopen" = "$define" ; then
7431 dflt="$dldir/dl_dlopen.xs"
7432 elif $test "$i_dld" = "$define" ; then
7433 dflt="$dldir/dl_dld.xs"
7438 *) dflt="$dldir/$dlsrc"
7441 echo "The following dynamic loading files are available:"
7442 : Can not go over to $dldir because getfile has path hard-coded in.
7443 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7444 rp="Source file to use for dynamic loading"
7450 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7454 Some systems may require passing special flags to $cc -c to
7455 compile modules that will be used to create a shared library.
7456 To use no flags, say "none".
7459 case "$cccdlflags" in
7460 '') case "$gccversion" in
7461 '') case "$osname" in
7463 next) dflt='none' ;;
7464 irix*) dflt='-KPIC' ;;
7465 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7466 sunos) dflt='-pic' ;;
7470 *) case "$osname" in
7471 darwin) dflt='none' ;;
7472 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7477 *) dflt="$cccdlflags" ;;
7479 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7482 none) cccdlflags=' ' ;;
7483 *) cccdlflags="$ans" ;;
7488 Some systems use ld to create libraries that can be dynamically loaded,
7489 while other systems (such as those using ELF) use $cc.
7493 '') $cat >try.c <<'EOM'
7494 /* Test for whether ELF binaries are produced */
7499 int i = open("a.out",O_RDONLY);
7502 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7503 exit(0); /* succeed (yes, it's ELF) */
7508 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7510 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7514 echo "I'll use ld to build dynamic libraries."
7523 rp="What command should be used to create dynamic libraries?"
7529 Some systems may require passing special flags to $ld to create a
7530 library that can be dynamically loaded. If your ld flags include
7531 -L/other/path options to locate libraries outside your loader's normal
7532 search path, you may need to specify those -L options here as well. To
7533 use no flags, say "none".
7536 case "$lddlflags" in
7537 '') case "$osname" in
7538 beos) dflt='-nostart' ;;
7540 case "$gccversion" in
7541 '') dflt="$dflt +vnocompatwarnings" ;;
7544 linux|irix*) dflt='-shared' ;;
7545 next) dflt='none' ;;
7546 solaris) dflt='-G' ;;
7547 sunos) dflt='-assert nodefinitions' ;;
7548 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7552 *) dflt="$lddlflags" ;;
7555 : Try to guess additional flags to pick up local libraries.
7556 : Be careful not to append to a plain 'none'
7560 for thisflag in $ldflags; do
7565 *) dflt="$dflt $thisflag" ;;
7572 ''|' ') dflt='none' ;;
7575 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7578 none) lddlflags=' ' ;;
7579 *) lddlflags="$ans" ;;
7584 Some systems may require passing special flags to $cc to indicate that
7585 the resulting executable will use dynamic linking. To use no flags,
7589 case "$ccdlflags" in
7590 '') case "$osname" in
7591 hpux) dflt='-Wl,-E' ;;
7592 linux) dflt='-rdynamic' ;;
7593 next) dflt='none' ;;
7594 sunos) dflt='none' ;;
7598 *) dflt="$ccdlflags" ;;
7600 rp="Any special flags to pass to $cc to use dynamic linking?"
7603 none) ccdlflags=' ' ;;
7604 *) ccdlflags="$ans" ;;
7618 # No dynamic loading being used, so don't bother even to prompt.
7621 *) case "$useshrplib" in
7622 '') case "$osname" in
7623 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7625 also='Building a shared libperl is required for dynamic loading to work on your system.'
7630 also='Building a shared libperl is needed for MAB support.'
7648 The perl executable is normally obtained by linking perlmain.c with
7649 libperl${_a}, any static extensions (usually just DynaLoader), and
7650 any other libraries needed on this system (such as -lm, etc.). Since
7651 your system supports dynamic loading, it is probably possible to build
7652 a shared libperl.$so. If you will have more than one executable linked
7653 to libperl.$so, this will significantly reduce the size of each
7654 executable, but it may have a noticeable affect on performance. The
7655 default is probably sensible for your system.
7659 rp="Build a shared libperl.$so (y/n)"
7663 useshrplib='true' ;;
7664 *) useshrplib='false' ;;
7669 case "$useshrplib" in
7673 # Figure out a good name for libperl.so. Since it gets stored in
7674 # a version-specific architecture-dependent library, the version
7675 # number isn't really that important, except for making cc/ld happy.
7677 # A name such as libperl.so.3.1
7678 majmin="libperl.$so.$patchlevel.$subversion"
7679 # A name such as libperl.so.301
7680 majonly=`echo $patchlevel $subversion |
7681 $awk '{printf "%d%02d", $1, $2}'`
7682 majonly=libperl.$so.$majonly
7683 # I'd prefer to keep the os-specific stuff here to a minimum, and
7684 # rely on figuring it out from the naming of libc.
7685 case "${osname}${osvers}" in
7688 # XXX How handle the --version stuff for MAB?
7690 linux*) # ld won't link with a bare -lperl otherwise.
7693 cygwin*) # ld links against an importlib
7694 dflt=libperl$lib_ext
7696 *) # Try to guess based on whether libc has major.minor.
7698 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7699 *libc.$so.[0-9]*) dflt=$majonly ;;
7700 *) dflt=libperl.$so ;;
7710 I need to select a good name for the shared libperl. If your system uses
7711 library names with major and minor numbers, then you might want something
7712 like $majmin. Alternatively, if your system uses a single version
7713 number for shared libraries, then you might want to use $majonly.
7714 Or, your system might be quite happy with a simple libperl.$so.
7716 Since the shared libperl will get installed into a version-specific
7717 architecture-dependent directory, the version number of the shared perl
7718 library probably isn't important, so the default should be o.k.
7721 rp='What name do you want to give to the shared libperl?'
7724 echo "Ok, I'll use $libperl"
7727 libperl="libperl${_a}"
7731 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7735 WARNING: Use of the shrpdir variable for the installation location of
7736 the shared $libperl is not supported. It was never documented and
7737 will not work in this version. Let me (perlbug@perl.org)
7738 know of any problems this may cause.
7744 But your current setting of $shrpdir is
7745 the default anyway, so it's harmless.
7750 Further, your current attempted setting of $shrpdir
7751 conflicts with the value of $archlibexp/CORE
7752 that installperl will use.
7759 # How will the perl executable find the installed shared $libperl?
7760 # Add $xxx to ccdlflags.
7761 # If we can't figure out a command-line option, use $shrpenv to
7762 # set env LD_RUN_PATH. The main perl makefile uses this.
7763 shrpdir=$archlibexp/CORE
7766 if "$useshrplib"; then
7769 # We'll set it in Makefile.SH...
7775 xxx="-Wl,-R$shrpdir"
7777 bsdos|linux|irix*|dec_osf)
7778 xxx="-Wl,-rpath,$shrpdir"
7781 # next doesn't like the default...
7784 # beos doesn't like the default, either.
7787 # hpux doesn't like the default, either.
7788 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7791 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7797 # Only add $xxx if it isn't already in ccdlflags.
7798 case " $ccdlflags " in
7800 *) ccdlflags="$ccdlflags $xxx"
7803 Adding $xxx to the flags
7804 passed to $ld so that the perl executable will find the
7805 installed shared $libperl.
7813 # Fix ccdlflags in AIX for building external extensions.
7814 # (For building Perl itself bare -bE:perl.exp is needed,
7815 # Makefile.SH takes care of this.)
7817 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7819 # Respect a hint or command-line value.
7821 '') shrpenv="$tmp_shrpenv" ;;
7823 case "$ldlibpthname" in
7824 '') ldlibpthname=LD_LIBRARY_PATH ;;
7825 none) ldlibpthname='' ;;
7828 : determine where manual pages are on this system
7832 syspath='/usr/share/man/man1 /usr/man/man1'
7833 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7834 syspath="$syspath /usr/man/u_man/man1"
7835 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7836 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7837 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7838 sysman=`./loc . /usr/man/man1 $syspath`
7841 if $test -d "$sysman"; then
7842 echo "System manual is in $sysman." >&4
7844 echo "Could not find manual pages in source form." >&4
7847 : determine where manual pages go
7848 set man1dir man1dir none
7852 $spackage has manual pages available in source form.
7856 echo "However, you don't have nroff, so they're probably useless to you."
7858 '') man1dir="none";;
7861 echo "If you don't want the manual sources installed, answer 'none'."
7866 lookpath="$prefixexp/share/man/man1"
7867 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7868 lookpath="$lookpath $prefixexp/man/p_man/man1"
7869 lookpath="$lookpath $prefixexp/man/u_man/man1"
7870 lookpath="$lookpath $prefixexp/man/man.1"
7872 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7873 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7883 rp="Where do the main $spackage manual pages (source) go?"
7885 if $test "X$man1direxp" != "X$ansexp"; then
7889 man1direxp="$ansexp"
7895 : Change installation prefix, if necessary.
7896 if $test X"$prefix" != X"$installprefix"; then
7897 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7899 installman1dir="$man1direxp"
7902 : What suffix to use on installed man pages
7909 rp="What suffix should be used for the main $spackage man pages?"
7911 '') case "$man1dir" in
7925 *) dflt="$man1ext";;
7932 : see if we can have long filenames
7934 first=123456789abcdef
7936 if (echo hi >$first) 2>/dev/null; then
7937 if $test -f 123456789abcde; then
7938 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7941 echo 'You can have filenames longer than 14 characters.'>&4
7946 You can't have filenames longer than 14 chars.
7947 You can't even think about them!
7953 $rm -rf 123456789abcde*
7955 : determine where library module manual pages go
7956 set man3dir man3dir none
7960 $spackage has manual pages for many of the library modules.
7966 However, you don't have nroff, so they're probably useless to you.
7969 '') man3dir="none";;
7973 case "$d_flexfnam" in
7976 However, your system can't handle the long file names like File::Basename.3.
7979 '') man3dir="none";;
7983 echo "If you don't want the manual sources installed, answer 'none'."
7984 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7986 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7987 if $test -d "$privlib/man/man3"; then
7990 WARNING: Previous versions of perl installed man3 pages into
7991 $privlib/man/man3. This version will suggest a
7992 new default of $dflt.
7996 rp='Do you wish to preserve the old behavior?(y/n)'
7999 y*) dflt="$privlib/man/man3" ;;
8004 *) dflt="$man3dir" ;;
8011 rp="Where do the $package library man pages (source) go?"
8014 man3direxp="$ansexp"
8020 : Change installation prefix, if necessary.
8021 if $test X"$prefix" != X"$installprefix"; then
8022 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8024 installman3dir="$man3direxp"
8027 : What suffix to use on installed man pages
8033 rp="What suffix should be used for the $package library man pages?"
8035 '') case "$man3dir" in
8049 *) dflt="$man3ext";;
8056 : see if we have to deal with yellow pages, now NIS.
8057 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8058 if $test -f /usr/etc/nibindd; then
8060 echo "I'm fairly confident you're on a NeXT."
8062 rp='Do you get the hosts file via NetInfo?'
8071 y*) hostcat='nidump hosts .';;
8072 *) case "$hostcat" in
8073 nidump*) hostcat='';;
8083 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8091 rp='Are you getting the hosts file via yellow pages?'
8094 y*) hostcat='ypcat hosts';;
8095 *) hostcat='cat /etc/hosts';;
8101 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8104 '') test -f /etc/group && groupcat='cat /etc/group';;
8107 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8110 : now get the host name
8112 echo "Figuring out host name..." >&4
8113 case "$myhostname" in
8115 echo 'Maybe "hostname" will work...'
8116 if tans=`sh -c hostname 2>&1` ; then
8124 if $test "$cont"; then
8126 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8127 if tans=`cat /etc/systemid 2>&1` ; then
8129 phostname='cat /etc/systemid'
8130 echo "Whadyaknow. Xenix always was a bit strange..."
8133 elif $test -r /etc/systemid; then
8134 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8137 if $test "$cont"; then
8138 echo 'No, maybe "uuname -l" will work...'
8139 if tans=`sh -c 'uuname -l' 2>&1` ; then
8141 phostname='uuname -l'
8143 echo 'Strange. Maybe "uname -n" will work...'
8144 if tans=`sh -c 'uname -n' 2>&1` ; then
8146 phostname='uname -n'
8148 echo 'Oh well, maybe I can mine it out of whoami.h...'
8149 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8150 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8151 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8153 case "$myhostname" in
8154 '') echo "Does this machine have an identity crisis or something?"
8157 echo "Well, you said $myhostname before..."
8158 phostname='echo $myhostname';;
8164 case "$myhostname" in
8165 '') myhostname=noname ;;
8167 : you do not want to know about this
8172 if $test "$myhostname" ; then
8174 rp='Your host name appears to be "'$myhostname'".'" Right?"
8182 : bad guess or no guess
8183 while $test "X$myhostname" = X ; do
8185 rp="Please type the (one word) name of your host:"
8190 : translate upper to lower if necessary
8191 case "$myhostname" in
8193 echo "(Normalizing case in your host name)"
8194 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8198 case "$myhostname" in
8200 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8201 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8202 echo "(Trimming domain name from host name--host name is now $myhostname)"
8204 *) case "$mydomain" in
8207 test "X$hostcat" = "Xypcat hosts" &&
8208 ypmatch "$myhostname" hosts 2>/dev/null |\
8209 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8212 test "X$hostcat" != "X" &&
8213 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8214 /[ ]$myhostname[ . ]/p" > hosts
8217 if $test -f hosts; then
8218 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8219 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8220 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8221 hosts | $sort | $uniq | \
8222 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8223 case `$echo X$dflt` in
8224 X*\ *) echo "(Several hosts in the database matched hostname)"
8227 X.) echo "(You do not have fully-qualified names in the hosts database)"
8231 echo "(I cannot locate a hosts database anywhere)"
8236 tans=`./loc resolv.conf X /etc /usr/etc`
8237 if $test -f "$tans"; then
8238 echo "(Attempting domain name extraction from $tans)"
8239 dflt=.`$sed -n -e 's/ / /g' \
8240 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8241 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8243 .) dflt=.`$sed -n -e 's/ / /g' \
8244 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8245 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8252 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8253 dflt=.`sh -c domainname 2>/dev/null`
8256 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8260 case "$dflt$osname" in
8261 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8262 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8266 .) echo "(Lost all hope -- silly guess then)"
8272 *) dflt="$mydomain";;
8276 rp="What is your domain name?"
8286 : translate upper to lower if necessary
8289 echo "(Normalizing case in your domain name)"
8290 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8294 : a little sanity check here
8295 case "$phostname" in
8298 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8299 $myhostname$mydomain|$myhostname) ;;
8301 case "$phostname" in
8303 echo "(That doesn't agree with your whoami.h file, by the way.)"
8306 echo "(That doesn't agree with your $phostname command, by the way.)"
8316 I need to get your e-mail address in Internet format if possible, i.e.
8317 something like user@host.domain. Please answer accurately since I have
8318 no easy means to double check it. The default value provided below
8319 is most probably close to reality but may not be valid from outside
8320 your organization...
8324 while test "$cont"; do
8326 '') dflt="$cf_by@$myhostname$mydomain";;
8327 *) dflt="$cf_email";;
8329 rp='What is your e-mail address?'
8335 rp='Address does not look like an Internet one. Use it anyway?'
8351 If you or somebody else will be maintaining perl at your site, please
8352 fill in the correct e-mail address here so that they may be contacted
8353 if necessary. Currently, the "perlbug" program included with perl
8354 will send mail to this address in addition to perlbug@perl.org. You may
8355 enter "none" for no administrator.
8358 case "$perladmin" in
8359 '') dflt="$cf_email";;
8360 *) dflt="$perladmin";;
8362 rp='Perl administrator e-mail address'
8366 : determine whether to only install version-specific parts.
8369 Do you want to install only the version-specific parts of the perl
8370 distribution? Usually you do *not* want to do this.
8372 case "$versiononly" in
8373 "$define"|[Yy]*|true) dflt='y' ;;
8376 rp="Do you want to install only the version-specific parts of perl?"
8379 [yY]*) val="$define";;
8385 : figure out how to guarantee perl startup
8386 case "$startperl" in
8388 case "$sharpbang" in
8392 I can use the #! construct to start perl on your system. This will
8393 make startup of perl scripts faster, but may cause problems if you
8394 want to share those scripts and perl is not in a standard place
8395 ($binexp/perl) on all your platforms. The alternative is to force
8396 a shell by starting the script with a single ':' character.
8399 case "$versiononly" in
8400 "$define") dflt="$binexp/perl$version";;
8401 *) dflt="$binexp/perl";;
8403 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8406 none) startperl=": # use perl";;
8407 *) startperl="#!$ans"
8408 if $test 30 -lt `echo "$ans" | wc -c`; then
8411 WARNING: Some systems limit the #! command to 32 characters.
8412 If you experience difficulty running Perl scripts with #!, try
8413 installing Perl in a directory with a shorter pathname.
8419 *) startperl=": # use perl"
8424 echo "I'll use $startperl to start perl scripts."
8426 : figure best path for perl in scripts
8429 case "$versiononly" in
8430 "$define") perlpath="$binexp/perl$version";;
8431 *) perlpath="$binexp/perl";;
8433 case "$startperl" in
8438 I will use the "eval 'exec'" idiom to start Perl on your system.
8439 I can use the full path of your Perl binary for this purpose, but
8440 doing so may cause problems if you want to share those scripts and
8441 Perl is not always in a standard place ($binexp/perl).
8445 rp="What path shall I use in \"eval 'exec'\"?"
8452 case "$startperl" in
8454 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8457 : determine where public executable scripts go
8458 set scriptdir scriptdir
8460 case "$scriptdir" in
8463 : guess some guesses
8464 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8465 $test -d /usr/share/bin && dflt=/usr/share/bin
8466 $test -d /usr/local/script && dflt=/usr/local/script
8467 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8468 $test -d $prefixexp/script && dflt=$prefixexp/script
8472 *) dflt="$scriptdir"
8477 Some installations have a separate directory just for executable scripts so
8478 that they can mount it across multiple architectures but keep the scripts in
8479 one spot. You might, for example, have a subdirectory of /usr/share for this.
8480 Or you might just lump your scripts in with all your other executables.
8484 rp='Where do you keep publicly executable scripts?'
8486 if $test "X$ansexp" != "X$scriptdirexp"; then
8490 scriptdirexp="$ansexp"
8491 : Change installation prefix, if necessary.
8492 if $test X"$prefix" != X"$installprefix"; then
8493 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8495 installscript="$scriptdirexp"
8498 : determine where add-on public executables go
8500 '') dflt=$siteprefix/bin ;;
8504 rp='Pathname where the add-on public executables should be installed?'
8507 sitebinexp="$ansexp"
8508 : Change installation prefix, if necessary.
8509 if $test X"$prefix" != X"$installprefix"; then
8510 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8512 installsitebin="$sitebinexp"
8515 : define an is-a-typedef? function
8516 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8518 "") inclist="sys/types.h";;
8520 eval "varval=\$$var";
8524 for inc in $inclist; do
8525 echo "#include <$inc>" >>temp.c;
8527 echo "#ifdef $type" >> temp.c;
8528 echo "printf(\"We have $type\");" >> temp.c;
8529 echo "#endif" >> temp.c;
8530 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8531 if $contains $type temp.E >/dev/null 2>&1; then
8537 *) eval "$var=\$varval";;
8540 : define an is-a-typedef? function that prompts if the type is not available.
8541 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8543 "") inclist="sys/types.h";;
8545 eval "varval=\$$var";
8549 for inc in $inclist; do
8550 echo "#include <$inc>" >>temp.c;
8552 echo "#ifdef $type" >> temp.c;
8553 echo "printf(\"We have $type\");" >> temp.c;
8554 echo "#endif" >> temp.c;
8555 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8557 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8558 if $contains $type temp.E >/dev/null 2>&1; then
8559 echo "$type found." >&4;
8562 echo "$type NOT found." >&4;
8568 *) eval "$var=\$varval";;
8571 : see what type lseek is declared as in the kernel
8572 rp="What is the type used for lseek's offset on this system?"
8573 set off_t lseektype long stdio.h sys/types.h
8577 echo "Checking to see how big your file offsets are..." >&4
8579 #include <sys/types.h>
8583 printf("%d\n", (int)sizeof($lseektype));
8588 if eval $compile_ok; then
8589 lseeksize=`$run ./try`
8590 echo "Your file offsets are $lseeksize bytes long."
8594 echo "(I can't seem to compile the test program. Guessing...)"
8595 rp="What is the size of your file offsets (in bytes)?"
8601 : see what type file positions are declared as in the library
8602 rp="What is the type for file position used by fsetpos()?"
8603 set fpos_t fpostype long stdio.h sys/types.h
8608 *_t) zzz="$fpostype" ;;
8611 echo "Checking the size of $zzz..." >&4
8613 #include <sys/types.h>
8616 printf("%d\n", (int)sizeof($fpostype));
8621 if eval $compile_ok; then
8625 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8628 echo "Your $zzz is $fpossize bytes long."
8634 echo "(I can't compile the test program. Guessing...)" >&4
8635 rp="What is the size of your file positions (in bytes)?"
8642 # Backward compatibility (uselfs is deprecated).
8644 "$define"|true|[yY]*)
8647 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8649 uselargefiles="$define"
8653 case "$lseeksize:$fpossize" in
8656 You can have files larger than 2 gigabytes.
8659 *) case "$uselargefiles" in
8660 "$undef"|false|[nN]*) dflt='n' ;;
8665 Perl can be built to understand large files (files larger than 2 gigabytes)
8666 on some systems. To do so, Configure can be run with -Duselargefiles.
8668 If this doesn't make any sense to you, just accept the default '$dflt'.
8670 rp='Try to understand large files, if available?'
8673 y|Y) val="$define" ;;
8680 case "$uselargefiles" in
8682 : Look for a hint-file generated 'call-back-unit'. If the
8683 : user has specified that a large files perl is to be built,
8684 : we may need to set or change some other defaults.
8685 if $test -f uselargefiles.cbu; then
8686 echo "Your platform has some specific hints for large file builds, using them..."
8687 . ./uselargefiles.cbu
8689 echo "Rechecking to see how big your file offsets are..." >&4
8691 #include <sys/types.h>
8695 printf("%d\n", (int)sizeof($lseektype));
8700 if eval $compile_ok; then
8701 lseeksize=`$run ./try`
8702 $echo "Your file offsets are now $lseeksize bytes long."
8706 echo "(I can't seem to compile the test program. Guessing...)"
8707 rp="What is the size of your file offsets (in bytes)?"
8712 *_t) zzz="$fpostype" ;;
8715 $echo $n "Rechecking the size of $zzz...$c" >&4
8717 #include <sys/types.h>
8720 printf("%d\n", (int)sizeof($fpostype));
8725 if eval $compile_ok; then
8730 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8733 echo " $fpossize bytes." >&4
8739 echo "(I can't compile the test program. Guessing...)" >&4
8740 rp="What is the size of your file positions (in bytes)?"
8749 case "$vendorprefix" in
8750 '') d_vendorbin="$undef"
8754 *) d_vendorbin="$define"
8755 : determine where vendor-supplied executables go.
8756 case "$vendorbin" in
8757 '') dflt=$vendorprefix/bin ;;
8758 *) dflt="$vendorbin" ;;
8761 rp='Pathname for the vendor-supplied executables directory?'
8764 vendorbinexp="$ansexp"
8767 : Change installation prefix, if necessary.
8768 if $test X"$prefix" != X"$installprefix"; then
8769 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
8771 installvendorbin="$vendorbinexp"
8774 : see if qgcvt exists
8778 : Check how to convert floats to strings.
8780 if test "X$d_Gconvert" = X; then
8783 echo "Checking for an efficient way to convert floats to strings."
8785 case "$uselongdouble" in
8786 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8788 case "$d_longdbl" in
8789 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8791 case "$d_PRIgldbl" in
8792 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8796 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8797 char *myname = "gconvert";
8800 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8801 char *myname = "gcvt";
8804 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8805 char *myname = "qgcvt";
8806 #define DOUBLETYPE long double
8809 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8811 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8813 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
8816 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8818 char *myname = "sprintf";
8822 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8823 #define DOUBLETYPE long double
8825 #define DOUBLETYPE double
8831 #define I_STDLIB $i_stdlib
8837 checkit(expect, got)
8841 if (strcmp(expect, got)) {
8842 printf("%s oddity: Expected %s, got %s\n",
8843 myname, expect, got);
8853 /* This must be 1st test on (which?) platform */
8854 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8855 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8856 checkit("0.1", buf);
8858 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
8859 checkit("0.01", buf);
8861 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
8862 checkit("0.001", buf);
8864 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
8865 checkit("0.0001", buf);
8867 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
8868 if (strlen(buf) > 5)
8869 checkit("9e-005", buf); /* for Microsoft ?? */
8871 checkit("9e-05", buf);
8873 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8876 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8877 checkit("1.1", buf);
8879 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8880 checkit("1.01", buf);
8882 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8883 checkit("1.001", buf);
8885 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8886 checkit("1.0001", buf);
8888 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8889 checkit("1.00001", buf);
8891 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8892 checkit("1.000001", buf);
8894 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8897 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8900 /* Some Linux gcvt's give 1.e+5 here. */
8901 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8902 checkit("100000", buf);
8904 /* Some Linux gcvt's give -1.e+5 here. */
8905 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8906 checkit("-100000", buf);
8908 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8909 checkit("123.456", buf);
8911 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
8912 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
8913 /* 34 should be enough to scare even long double
8914 * places into using the e notation. */
8915 if (strlen(buf) > 5)
8916 checkit("1e+034", buf); /* for Microsoft */
8918 checkit("1e+34", buf);
8920 /* For Perl, if you add additional tests here, also add them to
8921 * t/base/num.t for benefit of platforms not using Configure or
8922 * overriding d_Gconvert */
8927 : first add preferred functions to our list
8929 for xxx_convert in $gconvert_preference; do
8930 case $xxx_convert in
8931 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
8932 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
8935 : then add any others
8936 for xxx_convert in gconvert gcvt sprintf; do
8939 *) xxx_list="$xxx_list $xxx_convert" ;;
8943 case "$d_longdbl$uselongdouble" in
8945 : again, add prefered functions to our list first
8947 for xxx_convert in $gconvert_ld_preference; do
8948 case $xxx_convert in
8949 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
8950 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
8953 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
8954 for xxx_convert in qgcvt sprintf $xxx_list; do
8955 case "$xxx_ld_list" in
8956 $xxx_convert*|*" $xxx_convert"*) ;;
8957 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
8960 : if sprintf cannot do long doubles, move it to the end
8961 if test "$d_PRIgldbl" != "$define"; then
8962 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
8964 : if no qgcvt, remove it
8965 if test "$d_qgcvt" != "$define"; then
8966 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
8969 xxx_list="$xxx_ld_list"
8973 for xxx_convert in $xxx_list; do
8974 echo "Trying $xxx_convert..."
8976 set try -DTRY_$xxx_convert
8977 if eval $compile; then
8978 echo "$xxx_convert() found." >&4
8980 echo "I'll use $xxx_convert to convert floats into a string." >&4
8983 echo "...But $xxx_convert didn't work as I expected."
8987 echo "$xxx_convert NOT found." >&4
8991 if test X$xxx_convert = X; then
8992 echo "*** WHOA THERE!!! ***" >&4
8993 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
8997 case "$xxx_convert" in
8998 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8999 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9000 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9001 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9002 "$define$define$define")
9003 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9004 "$define$define$undef")
9005 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9006 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9013 : see if _fwalk exists
9017 : Initialize h_fcntl
9020 : Initialize h_sysfile
9023 : access call always available on UNIX
9027 : locate the flags for 'access()'
9031 $cat >access.c <<'EOCP'
9032 #include <sys/types.h>
9037 #include <sys/file.h>
9046 : check sys/file.h first, no particular reason here
9047 if $test `./findhdr sys/file.h` && \
9048 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9050 echo "<sys/file.h> defines the *_OK access constants." >&4
9051 elif $test `./findhdr fcntl.h` && \
9052 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9054 echo "<fcntl.h> defines the *_OK access constants." >&4
9055 elif $test `./findhdr unistd.h` && \
9056 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9057 echo "<unistd.h> defines the *_OK access constants." >&4
9059 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9065 : see if accessx exists
9066 set accessx d_accessx
9069 : see if alarm exists
9073 : define a fucntion to check prototypes
9074 $cat > protochk <<EOSH
9077 optimize="$optimize"
9079 prototype="$prototype"
9084 $cat >> protochk <<'EOSH'
9089 while test $# -ge 2; do
9091 $define) echo "#include <$2>" >> try.c ;;
9092 literal) echo "$2" >> try.c ;;
9096 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9097 cat >> try.c <<'EOCP'
9098 #ifdef CAN_PROTOTYPE
9099 #define _(args) args
9104 echo "$foo" >> try.c
9105 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9106 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9114 hasproto='varname=$1; func=$2; shift; shift;
9115 while $test $# -ge 2; do
9117 $define) echo "#include <$2>";;
9121 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9122 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9123 echo "$func() prototype found.";
9126 echo "$func() prototype NOT found.";
9131 $rm -f try.c tryout.c'
9133 : see if sys/types.h has to be included
9134 set sys/types.h i_systypes
9137 : see if sys/select.h has to be included
9138 set sys/select.h i_sysselct
9141 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9142 while $test $# -ge 2; do
9144 $define) echo "#include <$2>";;
9148 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9150 if eval $compile; then
9159 : see if we should include time.h, sys/time.h, or both
9161 if test "X$timeincl" = X; then
9162 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9163 $echo $n "I'm now running the test program...$c"
9164 $cat >try.c <<'EOCP'
9165 #include <sys/types.h>
9170 #ifdef SYSTIMEKERNEL
9173 #include <sys/time.h>
9176 #include <sys/select.h>
9185 struct timezone tzp;
9187 if (foo.tm_sec == foo.tm_sec)
9190 if (bar.tv_sec == bar.tv_sec)
9197 for s_timezone in '-DS_TIMEZONE' ''; do
9199 for s_timeval in '-DS_TIMEVAL' ''; do
9200 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9201 for i_time in '' '-DI_TIME'; do
9202 for i_systime in '-DI_SYSTIME' ''; do
9205 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9206 if eval $compile; then
9207 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9211 $echo $n "Succeeded with $flags$c"
9223 *SYSTIMEKERNEL*) i_systimek="$define"
9224 timeincl=`./findhdr sys/time.h`
9225 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9226 *) i_systimek="$undef";;
9229 *I_TIME*) i_time="$define"
9230 timeincl=`./findhdr time.h`" $timeincl"
9231 echo "We'll include <time.h>." >&4;;
9232 *) i_time="$undef";;
9235 *I_SYSTIME*) i_systime="$define"
9236 timeincl=`./findhdr sys/time.h`" $timeincl"
9237 echo "We'll include <sys/time.h>." >&4;;
9238 *) i_systime="$undef";;
9242 : see if struct tm knows about tm_zone
9243 case "$i_systime$i_time" in
9246 echo "Checking to see if your struct tm has tm_zone field..." >&4
9247 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9255 case "$d_tm_tm_zone" in
9256 "$define") echo "Yes, it does." ;;
9257 *) echo "No, it doesn't." ;;
9259 : see if struct tm knows about tm_gmtoff
9260 case "$i_systime$i_time" in
9263 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9264 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9272 case "$d_tm_tm_gmtoff" in
9273 "$define") echo "Yes, it does." ;;
9274 *) echo "No, it doesn't." ;;
9277 : see if asctime_r exists
9278 set asctime_r d_asctime_r
9280 case "$d_asctime_r" in
9282 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h"
9283 case "$d_asctime_r_proto:$usethreads" in
9284 ":define") d_asctime_r_proto=define
9285 set d_asctime_r_proto asctime_r $hdrs
9289 case "$d_asctime_r_proto" in
9291 case "$asctime_r_proto" in
9292 ''|0) try='char* asctime_r(const struct tm*, char*);'
9293 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9295 case "$asctime_r_proto" in
9296 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9297 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9299 case "$asctime_r_proto" in
9300 ''|0) try='int asctime_r(const struct tm*, char*);'
9301 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9303 case "$asctime_r_proto" in
9304 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9305 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9307 case "$asctime_r_proto" in
9308 '') d_asctime_r=undef
9310 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9311 * ) case "$asctime_r_proto" in
9312 REENTRANT_PROTO*) ;;
9313 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9315 echo "Prototype: $try" ;;
9318 *) case "$usethreads" in
9319 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9324 *) asctime_r_proto=0
9328 : see if atolf exists
9332 : see if atoll exists
9336 : Look for GNU-cc style attribute checking
9338 echo "Checking whether your compiler can handle __attribute__ ..." >&4
9339 $cat >attrib.c <<'EOCP'
9341 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
9343 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9344 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9345 echo "Your C compiler doesn't fully support __attribute__."
9348 echo "Your C compiler supports __attribute__."
9352 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9359 : see if bcmp exists
9363 : see if bcopy exists
9367 : see if this is a unistd.h system
9368 set unistd.h i_unistd
9371 : see if getpgrp exists
9372 set getpgrp d_getpgrp
9375 case "$d_getpgrp" in
9378 echo "Checking to see which flavor of getpgrp is in use..."
9381 #include <sys/types.h>
9383 # include <unistd.h>
9387 if (getuid() == 0) {
9388 printf("(I see you are running Configure as super-user...)\n");
9392 if (getpgrp(1) == 0)
9401 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9402 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
9404 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9405 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
9408 echo "I can't seem to compile and run the test program."
9410 xxx="a USG one, i.e. you use getpgrp()."
9412 # SVR4 systems can appear rather BSD-ish.
9415 xxx="a BSD one, i.e. you use getpgrp(pid)."
9419 xxx="probably a USG one, i.e. you use getpgrp()."
9424 echo "Assuming your getpgrp is $xxx" >&4
9433 : see if setpgrp exists
9434 set setpgrp d_setpgrp
9437 case "$d_setpgrp" in
9440 echo "Checking to see which flavor of setpgrp is in use..."
9443 #include <sys/types.h>
9445 # include <unistd.h>
9449 if (getuid() == 0) {
9450 printf("(I see you are running Configure as super-user...)\n");
9454 if (-1 == setpgrp(1, 1))
9457 if (setpgrp() != -1)
9463 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9464 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
9466 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9467 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
9470 echo "(I can't seem to compile and run the test program.)"
9472 xxx="a USG one, i.e. you use setpgrp()."
9474 # SVR4 systems can appear rather BSD-ish.
9477 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
9481 xxx="probably a USG one, i.e. you use setpgrp()."
9486 echo "Assuming your setpgrp is $xxx" >&4
9494 : see if bzero exists
9498 : see if signal is declared as pointer to function returning int or void
9500 xxx=`./findhdr signal.h`
9501 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
9502 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9503 echo "You have int (*signal())() instead of void." >&4
9505 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9506 echo "You have void (*signal())()." >&4
9508 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
9509 echo "You have int (*signal())() instead of void." >&4
9511 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
9512 echo "You have void (*signal())()." >&4
9515 case "$d_voidsig" in
9517 echo "I can't determine whether signal handler returns void or int..." >&4
9519 rp="What type does your signal handler return?"
9526 echo "As you already told me, signal handler returns void." >&4
9529 *) echo "As you already told me, signal handler returns int." >&4
9536 case "$d_voidsig" in
9537 "$define") signal_t="void";;
9542 : check for ability to cast large floats to 32-bit ints.
9544 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
9545 if $test "$intsize" -ge 4; then
9552 #include <sys/types.h>
9554 $signal_t blech(s) int s; { exit(3); }
9561 signal(SIGFPE, blech);
9563 /* Don't let compiler optimize the test away. Store the number
9564 in a writable string for gcc to pass to sscanf under HP/UX.
9566 sprintf(str, "2147483647");
9567 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
9571 /* x86 processors will probably give 0x8000 0000, which is a
9572 sign change. We don't want that. We want to mimic SPARC
9573 behavior here, which is to preserve the sign and give
9576 if (i32 != ($xxx) f)
9582 if eval $compile_ok; then
9586 echo "(I can't seem to compile the test program--assuming it can't)"
9594 echo "Nope, it can't."
9601 : check for ability to cast negative floats to unsigned
9603 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
9606 #include <sys/types.h>
9608 $signal_t blech(s) int s; { exit(7); }
9609 $signal_t blech_in_list(s) int s; { exit(4); }
9610 unsigned long dummy_long(p) unsigned long p; { return p; }
9611 unsigned int dummy_int(p) unsigned int p; { return p; }
9612 unsigned short dummy_short(p) unsigned short p; { return p; }
9616 unsigned long along;
9618 unsigned short ashort;
9622 /* Frustrate gcc-2.7.2's optimizer which failed this test with
9623 a direct f = -123. assignment. gcc-2.8.0 reportedly
9624 optimized the whole file away
9626 /* Store the number in a writable string for gcc to pass to
9629 sprintf(str, "-123");
9630 sscanf(str, "%lf", &f); /* f = -123.; */
9632 signal(SIGFPE, blech);
9633 along = (unsigned long)f;
9634 aint = (unsigned int)f;
9635 ashort = (unsigned short)f;
9636 if (along != (unsigned long)-123)
9638 if (aint != (unsigned int)-123)
9640 if (ashort != (unsigned short)-123)
9642 sprintf(str, "1073741824.");
9643 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
9646 along = (unsigned long)f;
9647 if (along != 0x80000000)
9651 along = (unsigned long)f;
9652 if (along != 0x7fffffff)
9656 along = (unsigned long)f;
9657 if (along != 0x80000001)
9661 signal(SIGFPE, blech_in_list);
9662 sprintf(str, "123.");
9663 sscanf(str, "%lf", &f); /* f = 123.; */
9664 along = dummy_long((unsigned long)f);
9665 aint = dummy_int((unsigned int)f);
9666 ashort = dummy_short((unsigned short)f);
9667 if (along != (unsigned long)123)
9669 if (aint != (unsigned int)123)
9671 if (ashort != (unsigned short)123)
9678 if eval $compile_ok; then
9682 echo "(I can't seem to compile the test program--assuming it can't)"
9685 case "$castflags" in
9690 echo "Nope, it can't."
9697 : see if vprintf exists
9699 if set vprintf val -f d_vprintf; eval $csym; $val; then
9700 echo 'vprintf() found.' >&4
9703 #include <varargs.h>
9705 int main() { xxx("foo"); }
9714 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
9718 if eval $compile && $run ./try; then
9719 echo "Your vsprintf() returns (int)." >&4
9722 echo "Your vsprintf() returns (char*)." >&4
9726 echo 'vprintf() NOT found.' >&4
9737 : see if chown exists
9741 : see if chroot exists
9745 : see if chsize exists
9749 : see if class exists
9753 hasstruct='varname=$1; struct=$2; shift; shift;
9754 while $test $# -ge 2; do
9756 $define) echo "#include <$2>";;
9760 echo "int main () { struct $struct foo; }" >> try.c;
9762 if eval $compile; then
9773 : see whether socket exists
9775 $echo $n "Hmm... $c" >&4
9776 if set socket val -f d_socket; eval $csym; $val; then
9777 echo "Looks like you have Berkeley networking support." >&4
9779 if set setsockopt val -f; eval $csym; $val; then
9782 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9786 if $contains socklib libc.list >/dev/null 2>&1; then
9787 echo "Looks like you have Berkeley networking support." >&4
9789 : we will have to assume that it supports the 4.2 BSD interface
9792 echo "You don't have Berkeley networking in libc$_a..." >&4
9793 if test "X$d_socket" = "X$define"; then
9794 echo "...but you seem to believe that you have sockets." >&4
9796 for net in net socket
9798 if test -f /usr/lib/lib$net$_a; then
9799 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9800 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9801 if $contains socket libc.list >/dev/null 2>&1; then
9806 echo "...but the Wollongong group seems to have hacked it in." >&4
9807 sockethdr="-I/usr/netinclude"
9810 echo "Found Berkeley sockets interface in lib$net." >&4
9811 if $contains setsockopt libc.list >/dev/null 2>&1; then
9814 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9821 if test "X$d_socket" != "X$define"; then
9822 echo "or anywhere else I see." >&4
9830 : see if socketpair exists
9831 set socketpair d_sockpair
9836 echo "Checking the availability of certain socket constants..." >&4
9837 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9838 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9840 #include <sys/types.h>
9841 #include <sys/socket.h>
9847 set try; if eval $compile; then
9850 set d_${enum}; eval $setvar
9854 : see if this is a sys/uio.h system
9855 set sys/uio.h i_sysuio
9860 echo "Checking to see if your system supports struct cmsghdr..." >&4
9861 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
9863 case "$d_cmsghdr_s" in
9864 "$define") echo "Yes, it does." ;;
9865 *) echo "No, it doesn't." ;;
9869 : check for const keyword
9871 echo 'Checking to see if your C compiler knows about "const"...' >&4
9872 $cat >const.c <<'EOCP'
9873 typedef struct spug { int drokk; } spug;
9880 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
9882 echo "Yup, it does."
9885 echo "Nope, it doesn't."
9890 : see if crypt exists
9895 $define) cryptlib='' ;;
9896 *) if set crypt val -f d_crypt; eval $csym; $val; then
9897 echo 'crypt() found.' >&4
9901 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
9902 if $test -z "$cryptlib"; then
9903 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
9907 if $test -z "$cryptlib"; then
9908 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
9912 if $test -z "$cryptlib"; then
9913 cryptlib=`./loc libcrypt$_a "" $libpth`
9917 if $test -z "$cryptlib"; then
9918 echo 'crypt() NOT found.' >&4
9929 : see if this is a crypt.h system
9933 : see if crypt_r exists
9934 set crypt_r d_crypt_r
9936 case "$d_crypt_r" in
9938 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
9939 case "$d_crypt_r_proto:$usethreads" in
9940 ":define") d_crypt_r_proto=define
9941 set d_crypt_r_proto crypt_r $hdrs
9945 case "$d_crypt_r_proto" in
9947 case "$crypt_r_proto" in
9948 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
9949 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
9951 case "$crypt_r_proto" in
9952 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
9953 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
9955 case "$crypt_r_proto" in
9958 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
9959 * ) case "$crypt_r_proto" in
9960 REENTRANT_PROTO*) ;;
9961 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
9963 echo "Prototype: $try" ;;
9966 *) case "$usethreads" in
9967 define) echo "crypt_r has no prototype, not using it." >&4 ;;
9976 : get csh whereabouts
9978 'csh') val="$undef" ;;
9983 : Respect a hint or command line value for full_csh.
9985 '') full_csh=$csh ;;
9988 : see if ctermid_r exists
9989 set ctermid_r d_ctermid_r
9991 case "$d_ctermid_r" in
9993 hdrs="$i_systypes sys/types.h define stdio.h $i_stdio stdio.h"
9994 case "$d_ctermid_r_proto:$usethreads" in
9995 ":define") d_ctermid_r_proto=define
9996 set d_ctermid_r_proto ctermid_r $hdrs
10000 case "$d_ctermid_r_proto" in
10002 case "$ctermid_r_proto" in
10003 ''|0) try='char* ctermid_r(char*);'
10004 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10006 case "$ctermid_r_proto" in
10007 '') d_ctermid_r=undef
10009 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10010 * ) case "$ctermid_r_proto" in
10011 REENTRANT_PROTO*) ;;
10012 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10014 echo "Prototype: $try" ;;
10017 *) case "$usethreads" in
10018 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10023 *) ctermid_r_proto=0
10027 : see if ctime_r exists
10028 set ctime_r d_ctime_r
10030 case "$d_ctime_r" in
10032 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h"
10033 case "$d_ctime_r_proto:$usethreads" in
10034 ":define") d_ctime_r_proto=define
10035 set d_ctime_r_proto ctime_r $hdrs
10039 case "$d_ctime_r_proto" in
10041 case "$ctime_r_proto" in
10042 ''|0) try='char* ctime_r(const time_t*, char*);'
10043 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10045 case "$ctime_r_proto" in
10046 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10047 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10049 case "$ctime_r_proto" in
10050 ''|0) try='int ctime_r(const time_t*, char*);'
10051 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10053 case "$ctime_r_proto" in
10054 ''|0) try='int ctime_r(const time_t*, char*, int);'
10055 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10057 case "$ctime_r_proto" in
10058 '') d_ctime_r=undef
10060 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10061 * ) case "$ctime_r_proto" in
10062 REENTRANT_PROTO*) ;;
10063 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10065 echo "Prototype: $try" ;;
10068 *) case "$usethreads" in
10069 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10078 : see if cuserid exists
10079 set cuserid d_cuserid
10082 : see if this is a limits.h system
10083 set limits.h i_limits
10086 : see if this is a float.h system
10087 set float.h i_float
10090 : See if number of significant digits in a double precision number is known
10092 $cat >dbl_dig.c <<EOM
10093 #$i_limits I_LIMITS
10096 #include <limits.h>
10102 printf("Contains DBL_DIG");
10105 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10106 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10107 echo "DBL_DIG found." >&4
10110 echo "DBL_DIG NOT found." >&4
10117 : see if dbm.h is available
10118 : see if dbmclose exists
10119 set dbmclose d_dbmclose
10122 case "$d_dbmclose" in
10132 *) set rpcsvc/dbm.h i_rpcsvcdbm
10137 *) echo "We won't be including <dbm.h>"
10147 : see if prototype for dbminit is available
10149 set d_dbminitproto dbminit $i_dbm dbm.h
10152 : see if difftime exists
10153 set difftime d_difftime
10156 : see if this is a dirent system
10158 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10160 echo "<dirent.h> found." >&4
10163 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10164 echo "<sys/dir.h> found." >&4
10167 xinc=`./findhdr sys/ndir.h`
10169 echo "<dirent.h> NOT found." >&4
10174 : Look for type of directory structure.
10176 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10178 case "$direntrytype" in
10180 case "$i_dirent" in
10181 $define) guess1='struct dirent' ;;
10182 *) guess1='struct direct' ;;
10185 *) guess1="$direntrytype"
10190 'struct dirent') guess2='struct direct' ;;
10191 *) guess2='struct dirent' ;;
10194 if $contains "$guess1" try.c >/dev/null 2>&1; then
10195 direntrytype="$guess1"
10196 echo "Your directory entries are $direntrytype." >&4
10197 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10198 direntrytype="$guess2"
10199 echo "Your directory entries seem to be $direntrytype." >&4
10201 echo "I don't recognize your system's directory entries." >&4
10202 rp="What type is used for directory entries on this system?"
10205 direntrytype="$ans"
10210 : see if the directory entry stores field length
10212 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10213 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10214 echo "Good, your directory entry keeps length information in d_namlen." >&4
10217 echo "Your directory entry does not know about the d_namlen field." >&4
10224 : see if this is an sysdir system
10225 set sys/dir.h i_sysdir
10228 : see if this is an sysndir system
10229 set sys/ndir.h i_sysndir
10234 $cat >dirfd.c <<EOM
10236 #$i_dirent I_DIRENT /**/
10237 #$i_sysdir I_SYS_DIR /**/
10238 #$i_sysndir I_SYS_NDIR /**/
10239 #$i_systypes I_SYS_TYPES /**/
10240 #if defined(I_SYS_TYPES)
10241 #include <sys/types.h>
10243 #if defined(I_DIRENT)
10244 #include <dirent.h>
10245 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10246 #include <sys/dir.h>
10250 #include <sys/ndir.h>
10254 #include <ndir.h> /* may be wrong in the future */
10256 #include <sys/dir.h>
10262 DIR *dirp = opendir(".");
10263 if (dirfd(dirp) >= 0)
10270 if eval $compile; then
10274 $define) echo "dirfd() found." >&4 ;;
10275 *) echo "dirfd() NOT found." >&4 ;;
10281 : see if dlerror exists
10284 set dlerror d_dlerror
10288 : see if dlfcn is available
10289 set dlfcn.h i_dlfcn
10296 On a few systems, the dynamically loaded modules that perl generates and uses
10297 will need a different extension than shared libs. The default will probably
10303 *) dflt="$dlext" ;;
10305 rp='What is the extension of dynamically loaded modules'
10314 : Check if dlsym need a leading underscore
10320 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
10321 $cat >dyna.c <<'EOM'
10330 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
10332 #include <sys/types.h>
10337 extern int fred() ;
10346 int mode = RTLD_LAZY ;
10348 handle = dlopen("./dyna.$dlext", mode) ;
10349 if (handle == NULL) {
10354 symbol = dlsym(handle, "fred") ;
10355 if (symbol == NULL) {
10356 /* try putting a leading underscore */
10357 symbol = dlsym(handle, "_fred") ;
10358 if (symbol == NULL) {
10371 : Call the object file tmp-dyna.o in case dlext=o.
10372 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
10373 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
10374 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
10375 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
10378 1) echo "Test program failed using dlopen." >&4
10379 echo "Perhaps you should not use dynamic loading." >&4;;
10380 2) echo "Test program failed using dlsym." >&4
10381 echo "Perhaps you should not use dynamic loading." >&4;;
10382 3) echo "dlsym needs a leading underscore" >&4
10384 4) echo "dlsym doesn't need a leading underscore." >&4;;
10387 echo "I can't compile and run the test program." >&4
10388 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
10393 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
10398 : see if drand48_r exists
10399 set drand48_r d_drand48_r
10401 case "$d_drand48_r" in
10403 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
10404 case "$d_drand48_r_proto:$usethreads" in
10405 ":define") d_drand48_r_proto=define
10406 set d_drand48_r_proto drand48_r $hdrs
10410 case "$d_drand48_r_proto" in
10412 case "$drand48_r_proto" in
10413 ''|0) try='int drand48_r(struct drand48_data*, double*);'
10414 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
10416 case "$drand48_r_proto" in
10417 '') d_drand48_r=undef
10419 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
10420 * ) case "$drand48_r_proto" in
10421 REENTRANT_PROTO*) ;;
10422 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
10424 echo "Prototype: $try" ;;
10427 *) case "$usethreads" in
10428 define) echo "drand48_r has no prototype, not using it." >&4 ;;
10433 *) drand48_r_proto=0
10437 : see if prototype for drand48 is available
10439 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
10442 : see if dup2 exists
10446 : see if eaccess exists
10447 set eaccess d_eaccess
10450 : see if endgrent exists
10451 set endgrent d_endgrent
10454 : see if this is an grp system
10460 xxx=`./findhdr grp.h`
10461 $cppstdin $cppflags $cppminus < $xxx >$$.h
10463 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10475 set d_grpasswd; eval $setvar
10479 : see if endgrent_r exists
10480 set endgrent_r d_endgrent_r
10482 case "$d_endgrent_r" in
10484 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
10485 case "$d_endgrent_r_proto:$usethreads" in
10486 ":define") d_endgrent_r_proto=define
10487 set d_endgrent_r_proto endgrent_r $hdrs
10491 case "$d_endgrent_r_proto" in
10493 case "$endgrent_r_proto" in
10494 ''|0) try='int endgrent_r(FILE**);'
10495 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
10497 case "$endgrent_r_proto" in
10498 ''|0) try='void endgrent_r(FILE**);'
10499 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
10501 case "$endgrent_r_proto" in
10502 '') d_endgrent_r=undef
10504 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
10505 * ) case "$endgrent_r_proto" in
10506 REENTRANT_PROTO*) ;;
10507 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
10509 echo "Prototype: $try" ;;
10512 *) case "$usethreads" in
10513 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
10518 *) endgrent_r_proto=0
10522 : see if endhostent exists
10523 set endhostent d_endhent
10526 : see if this is a netdb.h system
10527 set netdb.h i_netdb
10530 : see if endhostent_r exists
10531 set endhostent_r d_endhostent_r
10533 case "$d_endhostent_r" in
10535 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10536 case "$d_endhostent_r_proto:$usethreads" in
10537 ":define") d_endhostent_r_proto=define
10538 set d_endhostent_r_proto endhostent_r $hdrs
10542 case "$d_endhostent_r_proto" in
10544 case "$endhostent_r_proto" in
10545 ''|0) try='int endhostent_r(struct hostent_data*);'
10546 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_S ;;
10548 case "$endhostent_r_proto" in
10549 ''|0) try='void endhostent_r(struct hostent_data*);'
10550 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_S ;;
10552 case "$endhostent_r_proto" in
10553 '') d_endhostent_r=undef
10554 endhostent_r_proto=0
10555 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
10556 * ) case "$endhostent_r_proto" in
10557 REENTRANT_PROTO*) ;;
10558 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
10560 echo "Prototype: $try" ;;
10563 *) case "$usethreads" in
10564 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
10569 *) endhostent_r_proto=0
10573 : see if endnetent exists
10574 set endnetent d_endnent
10577 : see if endnetent_r exists
10578 set endnetent_r d_endnetent_r
10580 case "$d_endnetent_r" in
10582 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10583 case "$d_endnetent_r_proto:$usethreads" in
10584 ":define") d_endnetent_r_proto=define
10585 set d_endnetent_r_proto endnetent_r $hdrs
10589 case "$d_endnetent_r_proto" in
10591 case "$endnetent_r_proto" in
10592 ''|0) try='int endnetent_r(struct netent_data*);'
10593 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_S ;;
10595 case "$endnetent_r_proto" in
10596 ''|0) try='void endnetent_r(struct netent_data*);'
10597 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_S ;;
10599 case "$endnetent_r_proto" in
10600 '') d_endnetent_r=undef
10601 endnetent_r_proto=0
10602 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
10603 * ) case "$endnetent_r_proto" in
10604 REENTRANT_PROTO*) ;;
10605 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
10607 echo "Prototype: $try" ;;
10610 *) case "$usethreads" in
10611 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
10616 *) endnetent_r_proto=0
10620 : see if endprotoent exists
10621 set endprotoent d_endpent
10624 : see if endprotoent_r exists
10625 set endprotoent_r d_endprotoent_r
10627 case "$d_endprotoent_r" in
10629 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10630 case "$d_endprotoent_r_proto:$usethreads" in
10631 ":define") d_endprotoent_r_proto=define
10632 set d_endprotoent_r_proto endprotoent_r $hdrs
10636 case "$d_endprotoent_r_proto" in
10638 case "$endprotoent_r_proto" in
10639 ''|0) try='int endprotoent_r(struct protoent_data*);'
10640 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_S ;;
10642 case "$endprotoent_r_proto" in
10643 ''|0) try='void endprotoent_r(struct protoent_data*);'
10644 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_S ;;
10646 case "$endprotoent_r_proto" in
10647 '') d_endprotoent_r=undef
10648 endprotoent_r_proto=0
10649 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
10650 * ) case "$endprotoent_r_proto" in
10651 REENTRANT_PROTO*) ;;
10652 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
10654 echo "Prototype: $try" ;;
10657 *) case "$usethreads" in
10658 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
10663 *) endprotoent_r_proto=0
10667 : see if endpwent exists
10668 set endpwent d_endpwent
10671 : see if this is a pwd.h system
10677 xxx=`./findhdr pwd.h`
10678 $cppstdin $cppflags $cppminus < $xxx >$$.h
10680 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10688 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10696 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10704 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10712 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10720 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10728 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10736 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10748 set d_pwquota; eval $setvar
10749 set d_pwage; eval $setvar
10750 set d_pwchange; eval $setvar
10751 set d_pwclass; eval $setvar
10752 set d_pwexpire; eval $setvar
10753 set d_pwcomment; eval $setvar
10754 set d_pwgecos; eval $setvar
10755 set d_pwpasswd; eval $setvar
10759 : see if endpwent_r exists
10760 set endpwent_r d_endpwent_r
10762 case "$d_endpwent_r" in
10764 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
10765 case "$d_endpwent_r_proto:$usethreads" in
10766 ":define") d_endpwent_r_proto=define
10767 set d_endpwent_r_proto endpwent_r $hdrs
10771 case "$d_endpwent_r_proto" in
10773 case "$endpwent_r_proto" in
10774 ''|0) try='int endpwent_r(FILE**);'
10775 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
10777 case "$endpwent_r_proto" in
10778 ''|0) try='void endpwent_r(FILE**);'
10779 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
10781 case "$endpwent_r_proto" in
10782 '') d_endpwent_r=undef
10784 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
10785 * ) case "$endpwent_r_proto" in
10786 REENTRANT_PROTO*) ;;
10787 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
10789 echo "Prototype: $try" ;;
10792 *) case "$usethreads" in
10793 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
10798 *) endpwent_r_proto=0
10802 : see if endservent exists
10803 set endservent d_endsent
10806 : see if endservent_r exists
10807 set endservent_r d_endservent_r
10809 case "$d_endservent_r" in
10811 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10812 case "$d_endservent_r_proto:$usethreads" in
10813 ":define") d_endservent_r_proto=define
10814 set d_endservent_r_proto endservent_r $hdrs
10818 case "$d_endservent_r_proto" in
10820 case "$endservent_r_proto" in
10821 ''|0) try='int endservent_r(struct servent_data*);'
10822 ./protochk "extern $try" $hdrs && endservent_r_proto=I_S ;;
10824 case "$endservent_r_proto" in
10825 ''|0) try='void endservent_r(struct servent_data*);'
10826 ./protochk "extern $try" $hdrs && endservent_r_proto=V_S ;;
10828 case "$endservent_r_proto" in
10829 '') d_endservent_r=undef
10830 endservent_r_proto=0
10831 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
10832 * ) case "$endservent_r_proto" in
10833 REENTRANT_PROTO*) ;;
10834 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
10836 echo "Prototype: $try" ;;
10839 *) case "$usethreads" in
10840 define) echo "endservent_r has no prototype, not using it." >&4 ;;
10845 *) endservent_r_proto=0
10849 : Locate the flags for 'open()'
10851 $cat >try.c <<'EOCP'
10852 #include <sys/types.h>
10857 #include <sys/file.h>
10868 : check sys/file.h first to get FREAD on Sun
10869 if $test `./findhdr sys/file.h` && \
10870 set try -DI_SYS_FILE && eval $compile; then
10872 echo "<sys/file.h> defines the O_* constants..." >&4
10873 if $run ./try; then
10874 echo "and you have the 3 argument form of open()." >&4
10877 echo "but not the 3 argument form of open(). Oh, well." >&4
10880 elif $test `./findhdr fcntl.h` && \
10881 set try -DI_FCNTL && eval $compile; then
10883 echo "<fcntl.h> defines the O_* constants..." >&4
10884 if $run ./try; then
10885 echo "and you have the 3 argument form of open()." >&4
10888 echo "but not the 3 argument form of open(). Oh, well." >&4
10893 echo "I can't find the O_* constant definitions! You got problems." >&4
10899 : see which of string.h or strings.h is needed
10901 strings=`./findhdr string.h`
10902 if $test "$strings" && $test -r "$strings"; then
10903 echo "Using <string.h> instead of <strings.h>." >&4
10907 strings=`./findhdr strings.h`
10908 if $test "$strings" && $test -r "$strings"; then
10909 echo "Using <strings.h> instead of <string.h>." >&4
10911 echo "No string header found -- You'll surely have problems." >&4
10916 case "$i_string" in
10917 "$undef") strings=`./findhdr strings.h`;;
10918 *) strings=`./findhdr string.h`;;
10921 : see if this is a sys/file.h system
10926 : do we need to include sys/file.h ?
10930 if $h_sysfile; then
10932 echo "We'll be including <sys/file.h>." >&4
10935 echo "We won't be including <sys/file.h>." >&4
10945 : see if fcntl.h is there
10950 : see if we can include fcntl.h
10956 echo "We'll be including <fcntl.h>." >&4
10959 if $h_sysfile; then
10960 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
10962 echo "We won't be including <fcntl.h>." >&4
10974 : check for non-blocking I/O stuff
10975 case "$h_sysfile" in
10976 true) echo "#include <sys/file.h>" > head.c;;
10979 true) echo "#include <fcntl.h>" > head.c;;
10980 *) echo "#include <sys/fcntl.h>" > head.c;;
10985 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
10986 case "$o_nonblock" in
10988 $cat head.c > try.c
10989 $cat >>try.c <<EOCP
10991 #include <stdlib.h>
10998 printf("O_NONBLOCK\n");
11002 printf("O_NDELAY\n");
11006 printf("FNDELAY\n");
11013 if eval $compile_ok; then
11014 o_nonblock=`$run ./try`
11015 case "$o_nonblock" in
11016 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11017 *) echo "Seems like we can use $o_nonblock.";;
11020 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11023 *) echo "Using $hint value $o_nonblock.";;
11025 $rm -f try try.* .out core
11028 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11031 $cat head.c > try.c
11032 $cat >>try.c <<EOCP
11034 #include <sys/types.h>
11035 #include <signal.h>
11037 #include <stdlib.h>
11042 #define MY_O_NONBLOCK $o_nonblock
11043 #ifndef errno /* XXX need better Configure test */
11046 #$i_unistd I_UNISTD
11048 #include <unistd.h>
11050 #$i_string I_STRING
11052 #include <string.h>
11054 #include <strings.h>
11056 $signal_t blech(x) int x; { exit(3); }
11058 $cat >> try.c <<'EOCP'
11066 pipe(pd); /* Down: child -> parent */
11067 pipe(pu); /* Up: parent -> child */
11070 close(pd[1]); /* Parent reads from pd[0] */
11071 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11073 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11078 signal(SIGALRM, blech);
11080 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11082 sprintf(string, "%d\n", ret);
11083 write(2, string, strlen(string));
11086 if (errno == EAGAIN) {
11087 printf("EAGAIN\n");
11092 if (errno == EWOULDBLOCK)
11093 printf("EWOULDBLOCK\n");
11096 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11097 sleep(2); /* Give it time to close our pipe */
11099 ret = read(pd[0], buf, 1); /* Should read EOF */
11101 sprintf(string, "%d\n", ret);
11102 write(4, string, strlen(string));
11106 close(pd[0]); /* We write to pd[1] */
11107 close(pu[1]); /* We read from pu[0] */
11108 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11109 close(pd[1]); /* Pipe pd is now fully closed! */
11110 exit(0); /* Bye bye, thank you for playing! */
11114 if eval $compile_ok; then
11115 echo "$startsh" >mtry
11116 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11118 ./mtry >/dev/null 2>&1
11120 0) eagain=`$cat try.out`;;
11121 1) echo "Could not perform non-blocking setting!";;
11122 2) echo "I did a successful read() for something that was not there!";;
11123 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11124 4) echo "Could not find F_SETFL!";;
11125 *) echo "Something terribly wrong happened during testing.";;
11127 rd_nodata=`$cat try.ret`
11128 echo "A read() system call with no data present returns $rd_nodata."
11129 case "$rd_nodata" in
11132 echo "(That's peculiar, fixing that to be -1.)"
11138 echo "Forcing errno EAGAIN on read() with no data available."
11142 echo "Your read() sets errno to $eagain when no data is available."
11145 status=`$cat try.err`
11147 0) echo "And it correctly returns 0 to signal EOF.";;
11148 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11149 *) echo "However, your read() returns '$status' on EOF??";;
11152 if test "$status" = "$rd_nodata"; then
11153 echo "WARNING: you can't distinguish between EOF and no data!"
11157 echo "I can't compile the test program--assuming errno EAGAIN will do."
11164 echo "Using $hint value $eagain."
11165 echo "Your read() returns $rd_nodata when no data is present."
11166 case "$d_eofnblk" in
11167 "$define") echo "And you can see EOF because read() returns 0.";;
11168 "$undef") echo "But you can't see EOF status from read() returned value.";;
11170 echo "(Assuming you can't see EOF status from read anyway.)"
11176 $rm -f try try.* .out core head.c mtry
11178 : see if fchdir exists
11179 set fchdir d_fchdir
11182 : see if fchmod exists
11183 set fchmod d_fchmod
11186 : see if fchown exists
11187 set fchown d_fchown
11190 : see if this is an fcntl system
11195 : See if fcntl-based locking works.
11197 #include <stdlib.h>
11198 #include <unistd.h>
11200 #include <signal.h>
11201 $signal_t blech(x) int x; { exit(3); }
11203 #if defined(F_SETLK) && defined(F_SETLKW)
11204 struct flock flock;
11206 fd = open("try.c", O_RDONLY);
11207 flock.l_type = F_RDLCK;
11208 flock.l_whence = SEEK_SET;
11209 flock.l_start = flock.l_len = 0;
11210 signal(SIGALRM, blech);
11212 retval = fcntl(fd, F_SETLK, &flock);
11214 (retval < 0 ? exit(2) : exit(0));
11220 echo "Checking if fcntl-based file locking works... "
11224 if eval $compile_ok; then
11225 if $run ./try; then
11226 echo "Yes, it seems to work."
11229 echo "Nope, it didn't work."
11234 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
11235 *** This is (almost) impossible.
11236 *** If your NFS lock daemons are not feeling well, something like
11237 *** this may happen, please investigate. Cannot continue, aborting.
11245 echo "I'm unable to compile the test program, so I'll assume not."
11250 echo "Nope, since you don't even have fcntl()."
11253 set d_fcntl_can_lock
11258 : check for fd_set items
11261 Checking to see how well your C compiler handles fd_set and friends ...
11264 #$i_systime I_SYS_TIME
11265 #$i_sysselct I_SYS_SELECT
11266 #$d_socket HAS_SOCKET
11267 #include <sys/types.h>
11269 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
11272 #include <sys/time.h>
11274 #ifdef I_SYS_SELECT
11275 #include <sys/select.h>
11284 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
11292 if eval $compile; then
11293 d_fds_bits="$define"
11295 echo "Well, your system knows about the normal fd_set typedef..." >&4
11296 if $run ./try; then
11297 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
11298 d_fd_macros="$define"
11301 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
11303 d_fd_macros="$undef"
11307 Hmm, your compiler has some difficulty with fd_set. Checking further...
11310 if eval $compile; then
11311 d_fds_bits="$undef"
11313 echo "Well, your system has some sort of fd_set available..." >&4
11314 if $run ./try; then
11315 echo "and you have the normal fd_set macros." >&4
11316 d_fd_macros="$define"
11319 but not the normal fd_set macros! Gross! More work for me...
11321 d_fd_macros="$undef"
11324 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
11326 d_fds_bits="$undef"
11327 d_fd_macros="$undef"
11332 : see if fgetpos exists
11333 set fgetpos d_fgetpos
11336 : see if finite exists
11337 set finite d_finite
11340 : see if finitel exists
11341 set finitel d_finitel
11344 : see if flock exists
11348 : see if prototype for flock is available
11350 set d_flockproto flock $i_sysfile sys/file.h
11353 : see if fork exists
11357 : see if fp_class exists
11358 set fp_class d_fp_class
11361 : see if pathconf exists
11362 set pathconf d_pathconf
11365 : see if fpathconf exists
11366 set fpathconf d_fpathconf
11369 : see if fpclass exists
11370 set fpclass d_fpclass
11373 : see if fpclassify exists
11374 set fpclassify d_fpclassify
11377 : see if fpclassl exists
11378 set fpclassl d_fpclassl
11382 : check for fpos64_t
11384 echo "Checking to see if you have fpos64_t..." >&4
11387 int main() { fpos64_t x = 7; }
11390 if eval $compile; then
11392 echo "You have fpos64_t."
11395 echo "You do not have fpos64_t."
11396 case "$fpossize" in
11397 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
11404 : see if frexpl exists
11405 set frexpl d_frexpl
11408 : see if this is a sys/param system
11409 set sys/param.h i_sysparam
11412 : see if this is a sys/mount.h system
11413 set sys/mount.h i_sysmount
11418 echo "Checking to see if your system supports struct fs_data..." >&4
11419 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
11421 case "$d_fs_data_s" in
11422 "$define") echo "Yes, it does." ;;
11423 *) echo "No, it doesn't." ;;
11426 : see if fseeko exists
11427 set fseeko d_fseeko
11429 case "$longsize" in
11430 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
11433 : see if fsetpos exists
11434 set fsetpos d_fsetpos
11438 : see if fstatfs exists
11439 set fstatfs d_fstatfs
11443 : see if statvfs exists
11444 set statvfs d_statvfs
11447 : see if fstatvfs exists
11448 set fstatvfs d_fstatvfs
11452 : see if fsync exists
11456 : see if ftello exists
11457 set ftello d_ftello
11459 case "$longsize" in
11460 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
11463 : see if getcwd exists
11464 set getcwd d_getcwd
11467 : see if getespwnam exists
11468 set getespwnam d_getespwnam
11472 : see if getfsstat exists
11473 set getfsstat d_getfsstat
11476 : see if getgrent exists
11477 set getgrent d_getgrent
11480 : see if getgrent_r exists
11481 set getgrent_r d_getgrent_r
11483 case "$d_getgrent_r" in
11485 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11486 case "$d_getgrent_r_proto:$usethreads" in
11487 ":define") d_getgrent_r_proto=define
11488 set d_getgrent_r_proto getgrent_r $hdrs
11492 case "$d_getgrent_r_proto" in
11494 case "$getgrent_r_proto" in
11495 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
11496 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
11498 case "$getgrent_r_proto" in
11499 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
11500 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
11502 case "$getgrent_r_proto" in
11503 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
11504 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
11506 case "$getgrent_r_proto" in
11507 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
11508 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
11510 case "$getgrent_r_proto" in
11511 ''|0) try='int getgrent_r(struct group*, char*, int);'
11512 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
11514 case "$getgrent_r_proto" in
11515 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
11516 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
11518 case "$getgrent_r_proto" in
11519 '') d_getgrent_r=undef
11521 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
11522 * ) case "$getgrent_r_proto" in
11523 REENTRANT_PROTO*) ;;
11524 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
11526 echo "Prototype: $try" ;;
11529 *) case "$usethreads" in
11530 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
11535 *) getgrent_r_proto=0
11539 : see if getgrgid_r exists
11540 set getgrgid_r d_getgrgid_r
11542 case "$d_getgrgid_r" in
11544 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11545 case "$d_getgrgid_r_proto:$usethreads" in
11546 ":define") d_getgrgid_r_proto=define
11547 set d_getgrgid_r_proto getgrgid_r $hdrs
11551 case "$d_getgrgid_r_proto" in
11553 case "$getgrgid_r_proto" in
11554 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
11555 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
11557 case "$getgrgid_r_proto" in
11558 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
11559 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
11561 case "$getgrgid_r_proto" in
11562 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
11563 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
11565 case "$getgrgid_r_proto" in
11566 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
11567 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
11569 case "$getgrgid_r_proto" in
11570 '') d_getgrgid_r=undef
11572 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
11573 * ) case "$getgrgid_r_proto" in
11574 REENTRANT_PROTO*) ;;
11575 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
11577 echo "Prototype: $try" ;;
11580 *) case "$usethreads" in
11581 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
11586 *) getgrgid_r_proto=0
11590 : see if getgrnam_r exists
11591 set getgrnam_r d_getgrnam_r
11593 case "$d_getgrnam_r" in
11595 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11596 case "$d_getgrnam_r_proto:$usethreads" in
11597 ":define") d_getgrnam_r_proto=define
11598 set d_getgrnam_r_proto getgrnam_r $hdrs
11602 case "$d_getgrnam_r_proto" in
11604 case "$getgrnam_r_proto" in
11605 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
11606 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
11608 case "$getgrnam_r_proto" in
11609 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
11610 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
11612 case "$getgrnam_r_proto" in
11613 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
11614 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
11616 case "$getgrnam_r_proto" in
11617 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
11618 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
11620 case "$getgrnam_r_proto" in
11621 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
11622 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
11624 case "$getgrnam_r_proto" in
11625 '') d_getgrnam_r=undef
11627 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
11628 * ) case "$getgrnam_r_proto" in
11629 REENTRANT_PROTO*) ;;
11630 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
11632 echo "Prototype: $try" ;;
11635 *) case "$usethreads" in
11636 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
11641 *) getgrnam_r_proto=0
11645 : see if gethostbyaddr exists
11646 set gethostbyaddr d_gethbyaddr
11649 : see if gethostbyname exists
11650 set gethostbyname d_gethbyname
11653 : see if gethostent exists
11654 set gethostent d_gethent
11657 : see how we will look up host name
11660 if set gethostname val -f d_gethname; eval $csym; $val; then
11661 echo 'gethostname() found.' >&4
11662 d_gethname="$define"
11665 if set uname val -f d_uname; eval $csym; $val; then
11668 uname() was found, but you're running xenix, and older versions of xenix
11669 have a broken uname(). If you don't really know whether your xenix is old
11670 enough to have a broken system call, use the default answer.
11675 "$define") dflt=n;;
11677 rp='Is your uname() broken?'
11680 n*) d_uname="$define"; call=uname;;
11683 echo 'uname() found.' >&4
11690 case "$d_gethname" in
11691 '') d_gethname="$undef";;
11694 '') d_uname="$undef";;
11696 case "$d_uname$d_gethname" in
11701 Every now and then someone has a $call() that lies about the hostname
11702 but can't be fixed for political or economic reasons. If you wish, I can
11703 pretend $call() isn't there and maybe compute hostname at run-time
11704 thanks to the '$phostname' command.
11707 rp="Shall I ignore $call() from now on?"
11710 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
11713 case "$phostname" in
11714 '') aphostname='';;
11715 *) case "$aphostname" in
11717 *) set X $phostname
11721 file=`./loc $file $file $pth`
11722 aphostname=`echo $file $*`
11727 case "$d_uname$d_gethname" in
11730 case "$phostname" in
11732 echo "There will be no way for $package to get your hostname." >&4;;
11734 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
11738 case "$d_phostname" in
11739 '') d_phostname="$undef";;
11742 : see if gethostbyaddr_r exists
11743 set gethostbyaddr_r d_gethostbyaddr_r
11745 case "$d_gethostbyaddr_r" in
11747 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11748 case "$d_gethostbyaddr_r_proto:$usethreads" in
11749 ":define") d_gethostbyaddr_r_proto=define
11750 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
11754 case "$d_gethostbyaddr_r_proto" in
11756 case "$gethostbyaddr_r_proto" in
11757 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
11758 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
11760 case "$gethostbyaddr_r_proto" in
11761 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
11762 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
11764 case "$gethostbyaddr_r_proto" in
11765 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
11766 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
11768 case "$gethostbyaddr_r_proto" in
11769 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
11770 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
11772 case "$gethostbyaddr_r_proto" in
11773 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
11774 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
11776 case "$gethostbyaddr_r_proto" in
11777 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
11778 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
11780 case "$gethostbyaddr_r_proto" in
11781 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
11782 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
11784 case "$gethostbyaddr_r_proto" in
11785 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
11786 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
11788 case "$gethostbyaddr_r_proto" in
11789 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
11790 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
11792 case "$gethostbyaddr_r_proto" in
11793 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
11794 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
11796 case "$gethostbyaddr_r_proto" in
11797 '') d_gethostbyaddr_r=undef
11798 gethostbyaddr_r_proto=0
11799 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
11800 * ) case "$gethostbyaddr_r_proto" in
11801 REENTRANT_PROTO*) ;;
11802 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
11804 echo "Prototype: $try" ;;
11807 *) case "$usethreads" in
11808 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
11813 *) gethostbyaddr_r_proto=0
11817 : see if gethostbyname_r exists
11818 set gethostbyname_r d_gethostbyname_r
11820 case "$d_gethostbyname_r" in
11822 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11823 case "$d_gethostbyname_r_proto:$usethreads" in
11824 ":define") d_gethostbyname_r_proto=define
11825 set d_gethostbyname_r_proto gethostbyname_r $hdrs
11829 case "$d_gethostbyname_r_proto" in
11831 case "$gethostbyname_r_proto" in
11832 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
11833 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
11835 case "$gethostbyname_r_proto" in
11836 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
11837 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
11839 case "$gethostbyname_r_proto" in
11840 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
11841 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
11843 case "$gethostbyname_r_proto" in
11844 '') d_gethostbyname_r=undef
11845 gethostbyname_r_proto=0
11846 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
11847 * ) case "$gethostbyname_r_proto" in
11848 REENTRANT_PROTO*) ;;
11849 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
11851 echo "Prototype: $try" ;;
11854 *) case "$usethreads" in
11855 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
11860 *) gethostbyname_r_proto=0
11864 : see if gethostent_r exists
11865 set gethostent_r d_gethostent_r
11867 case "$d_gethostent_r" in
11869 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11870 case "$d_gethostent_r_proto:$usethreads" in
11871 ":define") d_gethostent_r_proto=define
11872 set d_gethostent_r_proto gethostent_r $hdrs
11876 case "$d_gethostent_r_proto" in
11878 case "$gethostent_r_proto" in
11879 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
11880 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
11882 case "$gethostent_r_proto" in
11883 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
11884 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
11886 case "$gethostent_r_proto" in
11887 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
11888 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
11890 case "$gethostent_r_proto" in
11891 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
11892 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
11894 case "$gethostent_r_proto" in
11895 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
11896 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
11898 case "$gethostent_r_proto" in
11899 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
11900 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
11902 case "$gethostent_r_proto" in
11903 '') d_gethostent_r=undef
11904 gethostent_r_proto=0
11905 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
11906 * ) case "$gethostent_r_proto" in
11907 REENTRANT_PROTO*) ;;
11908 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
11910 echo "Prototype: $try" ;;
11913 *) case "$usethreads" in
11914 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
11919 *) gethostent_r_proto=0
11923 : see if prototypes for various gethostxxx netdb.h functions are available
11925 set d_gethostprotos gethostent $i_netdb netdb.h
11928 : see if getitimer exists
11929 set getitimer d_getitimer
11932 : see if getlogin exists
11933 set getlogin d_getlogin
11936 : see if getlogin_r exists
11937 set getlogin_r d_getlogin_r
11939 case "$d_getlogin_r" in
11941 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
11942 case "$d_getlogin_r_proto:$usethreads" in
11943 ":define") d_getlogin_r_proto=define
11944 set d_getlogin_r_proto getlogin_r $hdrs
11948 case "$d_getlogin_r_proto" in
11950 case "$getlogin_r_proto" in
11951 ''|0) try='int getlogin_r(char*, size_t);'
11952 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
11954 case "$getlogin_r_proto" in
11955 ''|0) try='int getlogin_r(char*, int);'
11956 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
11958 case "$getlogin_r_proto" in
11959 ''|0) try='char* getlogin_r(char*, size_t);'
11960 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
11962 case "$getlogin_r_proto" in
11963 ''|0) try='char* getlogin_r(char*, int);'
11964 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
11966 case "$getlogin_r_proto" in
11967 '') d_getlogin_r=undef
11969 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
11970 * ) case "$getlogin_r_proto" in
11971 REENTRANT_PROTO*) ;;
11972 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
11974 echo "Prototype: $try" ;;
11977 *) case "$usethreads" in
11978 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
11983 *) getlogin_r_proto=0
11987 : see if getmnt exists
11988 set getmnt d_getmnt
11991 : see if getmntent exists
11992 set getmntent d_getmntent
11995 : see if getnetbyaddr exists
11996 set getnetbyaddr d_getnbyaddr
11999 : see if getnetbyname exists
12000 set getnetbyname d_getnbyname
12003 : see if getnetent exists
12004 set getnetent d_getnent
12007 : see if getnetbyaddr_r exists
12008 set getnetbyaddr_r d_getnetbyaddr_r
12010 case "$d_getnetbyaddr_r" in
12012 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12013 case "$d_getnetbyaddr_r_proto:$usethreads" in
12014 ":define") d_getnetbyaddr_r_proto=define
12015 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
12019 case "$d_getnetbyaddr_r_proto" in
12021 case "$getnetbyaddr_r_proto" in
12022 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
12023 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
12025 case "$getnetbyaddr_r_proto" in
12026 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
12027 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
12029 case "$getnetbyaddr_r_proto" in
12030 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
12031 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
12033 case "$getnetbyaddr_r_proto" in
12034 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
12035 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
12037 case "$getnetbyaddr_r_proto" in
12038 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
12039 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
12041 case "$getnetbyaddr_r_proto" in
12042 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
12043 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
12045 case "$getnetbyaddr_r_proto" in
12046 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
12047 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
12049 case "$getnetbyaddr_r_proto" in
12050 '') d_getnetbyaddr_r=undef
12051 getnetbyaddr_r_proto=0
12052 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
12053 * ) case "$getnetbyaddr_r_proto" in
12054 REENTRANT_PROTO*) ;;
12055 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
12057 echo "Prototype: $try" ;;
12060 *) case "$usethreads" in
12061 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
12066 *) getnetbyaddr_r_proto=0
12070 : see if getnetbyname_r exists
12071 set getnetbyname_r d_getnetbyname_r
12073 case "$d_getnetbyname_r" in
12075 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12076 case "$d_getnetbyname_r_proto:$usethreads" in
12077 ":define") d_getnetbyname_r_proto=define
12078 set d_getnetbyname_r_proto getnetbyname_r $hdrs
12082 case "$d_getnetbyname_r_proto" in
12084 case "$getnetbyname_r_proto" in
12085 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
12086 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
12088 case "$getnetbyname_r_proto" in
12089 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
12090 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
12092 case "$getnetbyname_r_proto" in
12093 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
12094 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
12096 case "$getnetbyname_r_proto" in
12097 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
12098 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
12100 case "$getnetbyname_r_proto" in
12101 '') d_getnetbyname_r=undef
12102 getnetbyname_r_proto=0
12103 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
12104 * ) case "$getnetbyname_r_proto" in
12105 REENTRANT_PROTO*) ;;
12106 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
12108 echo "Prototype: $try" ;;
12111 *) case "$usethreads" in
12112 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
12117 *) getnetbyname_r_proto=0
12121 : see if getnetent_r exists
12122 set getnetent_r d_getnetent_r
12124 case "$d_getnetent_r" in
12126 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12127 case "$d_getnetent_r_proto:$usethreads" in
12128 ":define") d_getnetent_r_proto=define
12129 set d_getnetent_r_proto getnetent_r $hdrs
12133 case "$d_getnetent_r_proto" in
12135 case "$getnetent_r_proto" in
12136 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
12137 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
12139 case "$getnetent_r_proto" in
12140 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
12141 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
12143 case "$getnetent_r_proto" in
12144 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
12145 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
12147 case "$getnetent_r_proto" in
12148 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
12149 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
12151 case "$getnetent_r_proto" in
12152 ''|0) try='int getnetent_r(struct netent*, char*, int);'
12153 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
12155 case "$getnetent_r_proto" in
12156 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
12157 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
12159 case "$getnetent_r_proto" in
12160 '') d_getnetent_r=undef
12161 getnetent_r_proto=0
12162 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
12163 * ) case "$getnetent_r_proto" in
12164 REENTRANT_PROTO*) ;;
12165 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
12167 echo "Prototype: $try" ;;
12170 *) case "$usethreads" in
12171 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
12176 *) getnetent_r_proto=0
12180 : see if prototypes for various getnetxxx netdb.h functions are available
12182 set d_getnetprotos getnetent $i_netdb netdb.h
12185 : see if getpagesize exists
12186 set getpagesize d_getpagsz
12190 : see if getprotobyname exists
12191 set getprotobyname d_getpbyname
12194 : see if getprotobynumber exists
12195 set getprotobynumber d_getpbynumber
12198 : see if getprotoent exists
12199 set getprotoent d_getpent
12202 : see if getpgid exists
12203 set getpgid d_getpgid
12206 : see if getpgrp2 exists
12207 set getpgrp2 d_getpgrp2
12210 : see if getppid exists
12211 set getppid d_getppid
12214 : see if getpriority exists
12215 set getpriority d_getprior
12218 : see if getprotobyname_r exists
12219 set getprotobyname_r d_getprotobyname_r
12221 case "$d_getprotobyname_r" in
12223 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12224 case "$d_getprotobyname_r_proto:$usethreads" in
12225 ":define") d_getprotobyname_r_proto=define
12226 set d_getprotobyname_r_proto getprotobyname_r $hdrs
12230 case "$d_getprotobyname_r_proto" in
12232 case "$getprotobyname_r_proto" in
12233 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
12234 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
12236 case "$getprotobyname_r_proto" in
12237 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
12238 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
12240 case "$getprotobyname_r_proto" in
12241 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
12242 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
12244 case "$getprotobyname_r_proto" in
12245 '') d_getprotobyname_r=undef
12246 getprotobyname_r_proto=0
12247 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
12248 * ) case "$getprotobyname_r_proto" in
12249 REENTRANT_PROTO*) ;;
12250 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
12252 echo "Prototype: $try" ;;
12255 *) case "$usethreads" in
12256 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
12261 *) getprotobyname_r_proto=0
12265 : see if getprotobynumber_r exists
12266 set getprotobynumber_r d_getprotobynumber_r
12268 case "$d_getprotobynumber_r" in
12270 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12271 case "$d_getprotobynumber_r_proto:$usethreads" in
12272 ":define") d_getprotobynumber_r_proto=define
12273 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
12277 case "$d_getprotobynumber_r_proto" in
12279 case "$getprotobynumber_r_proto" in
12280 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
12281 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
12283 case "$getprotobynumber_r_proto" in
12284 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
12285 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
12287 case "$getprotobynumber_r_proto" in
12288 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
12289 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
12291 case "$getprotobynumber_r_proto" in
12292 '') d_getprotobynumber_r=undef
12293 getprotobynumber_r_proto=0
12294 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
12295 * ) case "$getprotobynumber_r_proto" in
12296 REENTRANT_PROTO*) ;;
12297 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
12299 echo "Prototype: $try" ;;
12302 *) case "$usethreads" in
12303 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
12308 *) getprotobynumber_r_proto=0
12312 : see if getprotoent_r exists
12313 set getprotoent_r d_getprotoent_r
12315 case "$d_getprotoent_r" in
12317 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12318 case "$d_getprotoent_r_proto:$usethreads" in
12319 ":define") d_getprotoent_r_proto=define
12320 set d_getprotoent_r_proto getprotoent_r $hdrs
12324 case "$d_getprotoent_r_proto" in
12326 case "$getprotoent_r_proto" in
12327 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
12328 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
12330 case "$getprotoent_r_proto" in
12331 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
12332 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
12334 case "$getprotoent_r_proto" in
12335 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
12336 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
12338 case "$getprotoent_r_proto" in
12339 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
12340 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
12342 case "$getprotoent_r_proto" in
12343 '') d_getprotoent_r=undef
12344 getprotoent_r_proto=0
12345 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
12346 * ) case "$getprotoent_r_proto" in
12347 REENTRANT_PROTO*) ;;
12348 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
12350 echo "Prototype: $try" ;;
12353 *) case "$usethreads" in
12354 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
12359 *) getprotoent_r_proto=0
12363 : see if prototypes for various getprotoxxx netdb.h functions are available
12365 set d_getprotoprotos getprotoent $i_netdb netdb.h
12368 : see if getprpwnam exists
12369 set getprpwnam d_getprpwnam
12372 : see if getpwent exists
12373 set getpwent d_getpwent
12376 : see if getpwent_r exists
12377 set getpwent_r d_getpwent_r
12379 case "$d_getpwent_r" in
12381 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12382 case "$d_getpwent_r_proto:$usethreads" in
12383 ":define") d_getpwent_r_proto=define
12384 set d_getpwent_r_proto getpwent_r $hdrs
12388 case "$d_getpwent_r_proto" in
12390 case "$getpwent_r_proto" in
12391 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
12392 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
12394 case "$getpwent_r_proto" in
12395 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
12396 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
12398 case "$getpwent_r_proto" in
12399 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
12400 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
12402 case "$getpwent_r_proto" in
12403 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
12404 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
12406 case "$getpwent_r_proto" in
12407 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
12408 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
12410 case "$getpwent_r_proto" in
12411 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
12412 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
12414 case "$getpwent_r_proto" in
12415 '') d_getpwent_r=undef
12417 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
12418 * ) case "$getpwent_r_proto" in
12419 REENTRANT_PROTO*) ;;
12420 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
12422 echo "Prototype: $try" ;;
12425 *) case "$usethreads" in
12426 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
12431 *) getpwent_r_proto=0
12435 : see if getpwnam_r exists
12436 set getpwnam_r d_getpwnam_r
12438 case "$d_getpwnam_r" in
12440 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12441 case "$d_getpwnam_r_proto:$usethreads" in
12442 ":define") d_getpwnam_r_proto=define
12443 set d_getpwnam_r_proto getpwnam_r $hdrs
12447 case "$d_getpwnam_r_proto" in
12449 case "$getpwnam_r_proto" in
12450 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
12451 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
12453 case "$getpwnam_r_proto" in
12454 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
12455 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
12457 case "$getpwnam_r_proto" in
12458 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
12459 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
12461 case "$getpwnam_r_proto" in
12462 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
12463 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
12465 case "$getpwnam_r_proto" in
12466 '') d_getpwnam_r=undef
12468 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
12469 * ) case "$getpwnam_r_proto" in
12470 REENTRANT_PROTO*) ;;
12471 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
12473 echo "Prototype: $try" ;;
12476 *) case "$usethreads" in
12477 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
12482 *) getpwnam_r_proto=0
12486 : see if getpwuid_r exists
12487 set getpwuid_r d_getpwuid_r
12489 case "$d_getpwuid_r" in
12491 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12492 case "$d_getpwuid_r_proto:$usethreads" in
12493 ":define") d_getpwuid_r_proto=define
12494 set d_getpwuid_r_proto getpwuid_r $hdrs
12498 case "$d_getpwuid_r_proto" in
12500 case "$getpwuid_r_proto" in
12501 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
12502 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
12504 case "$getpwuid_r_proto" in
12505 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
12506 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
12508 case "$getpwuid_r_proto" in
12509 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
12510 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
12512 case "$getpwuid_r_proto" in
12513 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
12514 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
12516 case "$getpwuid_r_proto" in
12517 '') d_getpwuid_r=undef
12519 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
12520 * ) case "$getpwuid_r_proto" in
12521 REENTRANT_PROTO*) ;;
12522 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
12524 echo "Prototype: $try" ;;
12527 *) case "$usethreads" in
12528 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
12533 *) getpwuid_r_proto=0
12538 : see if getservbyname exists
12539 set getservbyname d_getsbyname
12542 : see if getservbyport exists
12543 set getservbyport d_getsbyport
12546 : see if getservent exists
12547 set getservent d_getsent
12550 : see if getservbyname_r exists
12551 set getservbyname_r d_getservbyname_r
12553 case "$d_getservbyname_r" in
12555 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12556 case "$d_getservbyname_r_proto:$usethreads" in
12557 ":define") d_getservbyname_r_proto=define
12558 set d_getservbyname_r_proto getservbyname_r $hdrs
12562 case "$d_getservbyname_r_proto" in
12564 case "$getservbyname_r_proto" in
12565 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
12566 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
12568 case "$getservbyname_r_proto" in
12569 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
12570 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
12572 case "$getservbyname_r_proto" in
12573 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
12574 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
12576 case "$getservbyname_r_proto" in
12577 '') d_getservbyname_r=undef
12578 getservbyname_r_proto=0
12579 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
12580 * ) case "$getservbyname_r_proto" in
12581 REENTRANT_PROTO*) ;;
12582 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
12584 echo "Prototype: $try" ;;
12587 *) case "$usethreads" in
12588 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
12593 *) getservbyname_r_proto=0
12597 : see if getservbyport_r exists
12598 set getservbyport_r d_getservbyport_r
12600 case "$d_getservbyport_r" in
12602 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12603 case "$d_getservbyport_r_proto:$usethreads" in
12604 ":define") d_getservbyport_r_proto=define
12605 set d_getservbyport_r_proto getservbyport_r $hdrs
12609 case "$d_getservbyport_r_proto" in
12611 case "$getservbyport_r_proto" in
12612 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
12613 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
12615 case "$getservbyport_r_proto" in
12616 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
12617 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
12619 case "$getservbyport_r_proto" in
12620 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
12621 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
12623 case "$getservbyport_r_proto" in
12624 '') d_getservbyport_r=undef
12625 getservbyport_r_proto=0
12626 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
12627 * ) case "$getservbyport_r_proto" in
12628 REENTRANT_PROTO*) ;;
12629 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
12631 echo "Prototype: $try" ;;
12634 *) case "$usethreads" in
12635 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
12640 *) getservbyport_r_proto=0
12644 : see if getservent_r exists
12645 set getservent_r d_getservent_r
12647 case "$d_getservent_r" in
12649 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12650 case "$d_getservent_r_proto:$usethreads" in
12651 ":define") d_getservent_r_proto=define
12652 set d_getservent_r_proto getservent_r $hdrs
12656 case "$d_getservent_r_proto" in
12658 case "$getservent_r_proto" in
12659 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
12660 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
12662 case "$getservent_r_proto" in
12663 ''|0) try='int getservent_r(struct servent*, char*, int);'
12664 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
12666 case "$getservent_r_proto" in
12667 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
12668 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
12670 case "$getservent_r_proto" in
12671 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
12672 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
12674 case "$getservent_r_proto" in
12675 '') d_getservent_r=undef
12676 getservent_r_proto=0
12677 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
12678 * ) case "$getservent_r_proto" in
12679 REENTRANT_PROTO*) ;;
12680 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
12682 echo "Prototype: $try" ;;
12685 *) case "$usethreads" in
12686 define) echo "getservent_r has no prototype, not using it." >&4 ;;
12691 *) getservent_r_proto=0
12695 : see if prototypes for various getservxxx netdb.h functions are available
12697 set d_getservprotos getservent $i_netdb netdb.h
12700 : see if getspnam exists
12701 set getspnam d_getspnam
12704 : see if this is a shadow.h system
12705 set shadow.h i_shadow
12708 : see if getspnam_r exists
12709 set getspnam_r d_getspnam_r
12711 case "$d_getspnam_r" in
12713 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
12714 case "$d_getspnam_r_proto:$usethreads" in
12715 ":define") d_getspnam_r_proto=define
12716 set d_getspnam_r_proto getspnam_r $hdrs
12720 case "$d_getspnam_r_proto" in
12722 case "$getspnam_r_proto" in
12723 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
12724 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
12726 case "$getspnam_r_proto" in
12727 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
12728 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
12730 case "$getspnam_r_proto" in
12731 '') d_getspnam_r=undef
12733 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
12734 * ) case "$getspnam_r_proto" in
12735 REENTRANT_PROTO*) ;;
12736 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
12738 echo "Prototype: $try" ;;
12741 *) case "$usethreads" in
12742 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
12747 *) getspnam_r_proto=0
12751 : see if gettimeofday or ftime exists
12752 set gettimeofday d_gettimeod
12754 case "$d_gettimeod" in
12760 val="$undef"; set d_ftime; eval $setvar
12763 case "$d_gettimeod$d_ftime" in
12766 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
12770 : see if gmtime_r exists
12771 set gmtime_r d_gmtime_r
12773 case "$d_gmtime_r" in
12775 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h"
12776 case "$d_gmtime_r_proto:$usethreads" in
12777 ":define") d_gmtime_r_proto=define
12778 set d_gmtime_r_proto gmtime_r $hdrs
12782 case "$d_gmtime_r_proto" in
12784 case "$gmtime_r_proto" in
12785 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
12786 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
12788 case "$gmtime_r_proto" in
12789 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
12790 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
12792 case "$gmtime_r_proto" in
12793 '') d_gmtime_r=undef
12795 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
12796 * ) case "$gmtime_r_proto" in
12797 REENTRANT_PROTO*) ;;
12798 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
12800 echo "Prototype: $try" ;;
12803 *) case "$usethreads" in
12804 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
12809 *) gmtime_r_proto=0
12813 : see if hasmntopt exists
12814 set hasmntopt d_hasmntopt
12817 : see if this is a netinet/in.h or sys/in.h system
12818 set netinet/in.h i_niin sys/in.h i_sysin
12821 : see if arpa/inet.h has to be included
12822 set arpa/inet.h i_arpainet
12825 : see if htonl --and friends-- exists
12830 : Maybe they are macros.
12833 $cat >htonl.c <<EOM
12835 #include <sys/types.h>
12836 #$i_niin I_NETINET_IN
12838 #$i_arpainet I_ARPA_INET
12839 #ifdef I_NETINET_IN
12840 #include <netinet/in.h>
12843 #include <sys/in.h>
12846 #include <arpa/inet.h>
12849 printf("Defined as a macro.");
12852 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
12853 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
12855 echo "But it seems to be defined as a macro." >&4
12865 if set index val -f; eval $csym; $val; then
12866 if set strchr val -f d_strchr; eval $csym; $val; then
12867 if $contains strchr "$strings" >/dev/null 2>&1 ; then
12870 echo "strchr() found." >&4
12874 echo "index() found." >&4
12879 echo "index() found." >&4
12882 if set strchr val -f d_strchr; eval $csym; $val; then
12885 echo "strchr() found." >&4
12887 echo "No index() or strchr() found!" >&4
12892 set d_strchr; eval $setvar
12894 set d_index; eval $setvar
12896 : check whether inet_aton exists
12897 set inet_aton d_inetaton
12902 $cat >isascii.c <<'EOCP'
12914 if eval $compile; then
12915 echo "isascii() found." >&4
12918 echo "isascii() NOT found." >&4
12925 : see if isfinite exists
12926 set isfinite d_isfinite
12929 : see if isinf exists
12933 : see if isnan exists
12937 : see if isnanl exists
12938 set isnanl d_isnanl
12941 : see if killpg exists
12942 set killpg d_killpg
12945 : see if lchown exists
12947 $cat > try.c <<'EOCP'
12948 /* System header to define __stub macros and hopefully few prototypes,
12949 which can conflict with char lchown(); below. */
12950 #include <assert.h>
12951 /* Override any gcc2 internal prototype to avoid an error. */
12952 /* We use char because int might match the return type of a gcc2
12953 builtin and then its argument prototype would still apply. */
12956 /* The GNU C library defines this for functions which it implements
12957 to always fail with ENOSYS. Some functions are actually named
12958 something starting with __ and the normal name is an alias. */
12959 #if defined (__stub_lchown) || defined (__stub___lchown)
12967 if eval $compile; then
12968 $echo "lchown() found." >&4
12971 $echo "lchown() NOT found." >&4
12977 : See if number of significant digits in a double precision number is known
12979 $cat >ldbl_dig.c <<EOM
12980 #$i_limits I_LIMITS
12983 #include <limits.h>
12989 printf("Contains LDBL_DIG");
12992 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
12993 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
12994 echo "LDBL_DIG found." >&4
12997 echo "LDBL_DIG NOT found." >&4
13004 : see if link exists
13008 : see if localtime_r exists
13009 set localtime_r d_localtime_r
13011 case "$d_localtime_r" in
13013 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h"
13014 case "$d_localtime_r_proto:$usethreads" in
13015 ":define") d_localtime_r_proto=define
13016 set d_localtime_r_proto localtime_r $hdrs
13020 case "$d_localtime_r_proto" in
13022 case "$localtime_r_proto" in
13023 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
13024 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
13026 case "$localtime_r_proto" in
13027 ''|0) try='int localtime_r(const time_t*, struct tm*);'
13028 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
13030 case "$localtime_r_proto" in
13031 '') d_localtime_r=undef
13032 localtime_r_proto=0
13033 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
13034 * ) case "$localtime_r_proto" in
13035 REENTRANT_PROTO*) ;;
13036 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
13038 echo "Prototype: $try" ;;
13041 *) case "$usethreads" in
13042 define) echo "localtime_r has no prototype, not using it." >&4 ;;
13047 *) localtime_r_proto=0
13051 : see if localeconv exists
13052 set localeconv d_locconv
13055 : see if lockf exists
13059 : see if prototype for lseek is available
13061 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
13064 : see if lstat exists
13068 : see if madvise exists
13069 set madvise d_madvise
13072 : see if mblen exists
13076 : see if mbstowcs exists
13077 set mbstowcs d_mbstowcs
13080 : see if mbtowc exists
13081 set mbtowc d_mbtowc
13084 : see if memchr exists
13085 set memchr d_memchr
13088 : see if memcmp exists
13089 set memcmp d_memcmp
13092 : see if memcpy exists
13093 set memcpy d_memcpy
13096 : see if memmove exists
13097 set memmove d_memmove
13100 : see if memset exists
13101 set memset d_memset
13104 : see if mkdir exists
13108 : see if mkdtemp exists
13109 set mkdtemp d_mkdtemp
13112 : see if mkfifo exists
13113 set mkfifo d_mkfifo
13116 : see if mkstemp exists
13117 set mkstemp d_mkstemp
13120 : see if mkstemps exists
13121 set mkstemps d_mkstemps
13124 : see if mktime exists
13125 set mktime d_mktime
13128 : see if this is a sys/mman.h system
13129 set sys/mman.h i_sysmman
13132 : see if mmap exists
13135 : see what shmat returns
13136 : default to something harmless
13138 case "$i_sysmman$d_mmap" in
13140 $cat >mmap.c <<'END'
13141 #include <sys/mman.h>
13144 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
13149 echo "and it returns ($mmaptype)." >&4
13155 : see if mprotect exists
13156 set mprotect d_mprotect
13159 : see if msgctl exists
13160 set msgctl d_msgctl
13163 : see if msgget exists
13164 set msgget d_msgget
13167 : see if msgsnd exists
13168 set msgsnd d_msgsnd
13171 : see if msgrcv exists
13172 set msgrcv d_msgrcv
13175 : see how much of the 'msg*(2)' library is present.
13178 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
13179 *"$undef"*) h_msg=false;;
13183 case "`ipcs 2>&1`" in
13184 "SVID messages"*"not configured"*)
13185 echo "Your $osname does not have the msg*(2) configured." >&4
13188 set msgctl d_msgctl
13190 set msgget d_msgget
13192 set msgsnd d_msgsnd
13194 set msgrcv d_msgrcv
13200 : we could also check for sys/ipc.h ...
13201 if $h_msg && $test `./findhdr sys/msg.h`; then
13202 echo "You have the full msg*(2) library." >&4
13205 echo "You don't have the full msg*(2) library." >&4
13213 echo "Checking to see if your system supports struct msghdr..." >&4
13214 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
13216 case "$d_msghdr_s" in
13217 "$define") echo "Yes, it does." ;;
13218 *) echo "No, it doesn't." ;;
13222 : see if msync exists
13226 : see if munmap exists
13227 set munmap d_munmap
13230 : see if nice exists
13234 : see if this is a langinfo.h system
13235 set langinfo.h i_langinfo
13238 : see if nl_langinfo exists
13239 set nl_langinfo d_nl_langinfo
13242 : check for length of character
13244 case "$charsize" in
13246 echo "Checking to see how big your characters are (hey, you never know)..." >&4
13247 $cat >try.c <<'EOCP'
13251 printf("%d\n", (int)sizeof(char));
13256 if eval $compile_ok; then
13260 echo "(I can't seem to compile the test program. Guessing...)"
13267 rp="What is the size of a character (in bytes)?"
13272 : check for volatile keyword
13274 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
13275 $cat >try.c <<'EOCP'
13278 typedef struct _goo_struct goo_struct;
13279 goo_struct * volatile goo = ((goo_struct *)0);
13280 struct _goo_struct {
13285 typedef unsigned short foo_t;
13286 char *volatile foo;
13288 volatile foo_t blech;
13292 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
13294 echo "Yup, it does."
13297 echo "Nope, it doesn't."
13305 $echo "Choosing the C types to be used for Perl's internal types..." >&4
13307 case "$use64bitint:$d_quad:$quadtype" in
13310 uvtype="$uquadtype"
13315 uvtype="unsigned long"
13321 case "$uselongdouble:$d_longdbl" in
13323 nvtype="long double"
13324 nvsize=$longdblsize
13331 $echo "(IV will be "$ivtype", $ivsize bytes)"
13332 $echo "(UV will be "$uvtype", $uvsize bytes)"
13333 $echo "(NV will be "$nvtype", $nvsize bytes)"
13336 #$i_inttypes I_INTTYPES
13338 #include <inttypes.h>
13343 int8_t i = INT8_MAX;
13344 uint8_t u = UINT8_MAX;
13345 printf("int8_t\n");
13348 int16_t i = INT16_MAX;
13349 uint16_t i = UINT16_MAX;
13350 printf("int16_t\n");
13353 int32_t i = INT32_MAX;
13354 uint32_t u = UINT32_MAX;
13355 printf("int32_t\n");
13361 '') case "$charsize" in
13363 u8type="unsigned char"
13372 if eval $compile; then
13373 case "`$run ./try`" in
13374 int8_t) i8type=int8_t
13384 '') if $test $charsize -ge 1; then
13386 u8type="unsigned char"
13394 '') case "$shortsize" in
13396 u16type="unsigned short"
13404 '') set try -DINT16
13405 if eval $compile; then
13406 case "`$run ./try`" in
13418 '') if $test $shortsize -ge 2; then
13420 u16type="unsigned short"
13428 '') case "$longsize" in
13430 u32type="unsigned long"
13434 *) case "$intsize" in
13436 u32type="unsigned int"
13446 '') set try -DINT32
13447 if eval $compile; then
13448 case "`$run ./try`" in
13460 '') if $test $intsize -ge 4; then
13462 u32type="unsigned int"
13470 '') case "$d_quad:$quadtype" in
13472 i64type="$quadtype"
13473 u64type="$uquadtype"
13481 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
13482 : volatile so that the compiler has to store it out to memory.
13483 if test X"$d_volatile" = X"$define"; then
13488 #include <sys/types.h>
13489 #include <signal.h>
13491 $volatile int bletched = 0;
13492 $signal_t blech(s) int s; { bletched = 1; }
13497 int n = 8 * $uvsize;
13500 signal(SIGFPE, blech);
13503 for (i = 0; i < n; i++) {
13504 u = u << 1 | ($uvtype)1;
13506 if (($uvtype)d != u)
13510 d = ($nvtype)(u - 1);
13511 if (($uvtype)d != (u - 1))
13519 printf("%d\n", ((i == n) ? -n : i));
13525 d_nv_preserves_uv="$undef"
13526 if eval $compile; then
13527 nv_preserves_uv_bits="`$run ./try`"
13529 case "$nv_preserves_uv_bits" in
13531 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
13532 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
13533 d_nv_preserves_uv="$define"
13535 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
13536 d_nv_preserves_uv="$undef" ;;
13537 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
13538 nv_preserves_uv_bits="$undef" ;;
13544 : check for off64_t
13546 echo "Checking to see if you have off64_t..." >&4
13548 #include <sys/types.h>
13549 #include <unistd.h>
13550 int main() { off64_t x = 7; }
13553 if eval $compile; then
13555 echo "You have off64_t."
13558 echo "You do not have off64_t."
13559 case "$lseeksize" in
13560 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
13567 : see if POSIX threads are available
13568 set pthread.h i_pthread
13574 : how to create joinable pthreads
13575 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
13577 echo "Checking what constant to use for creating joinable pthreads..." >&4
13578 $cat >try.c <<'EOCP'
13579 #include <pthread.h>
13581 int detachstate = JOINABLE;
13584 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
13585 if eval $compile; then
13586 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
13587 val="$undef" # Yes, undef.
13588 set d_old_pthread_create_joinable
13591 set old_pthread_create_joinable
13594 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
13595 if eval $compile; then
13596 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
13598 set d_old_pthread_create_joinable
13600 val=PTHREAD_CREATE_UNDETACHED
13601 set old_pthread_create_joinable
13604 set try -DJOINABLE=__UNDETACHED
13605 if eval $compile; then
13606 echo "You seem to use __UNDETACHED." >&4
13608 set d_old_pthread_create_joinable
13611 set old_pthread_create_joinable
13614 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
13616 set d_old_pthread_create_joinable
13619 set old_pthread_create_joinable
13626 d_old_pthread_create_joinable="$undef"
13627 old_pthread_create_joinable=""
13630 : see if pause exists
13634 : see if pipe exists
13638 : see if poll exists
13642 : see if readlink exists
13643 set readlink d_readlink
13649 case "$d_readlink" in
13651 if $issymlink /proc/self/exe ; then
13652 $ls -l /proc/self/exe > reflect
13653 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
13654 echo "You have Linux-like /proc/self/exe."
13655 procselfexe='"/proc/self/exe"'
13659 if $issymlink /proc/curproc/file ; then
13660 $ls -l /proc/curproc/file > reflect
13661 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
13662 echo "You have BSD-like /proc/curproc/file."
13663 procselfexe='"/proc/curproc/file"'
13673 : see whether the pthread_atfork exists
13675 #include <pthread.h>
13678 #ifdef PTHREAD_ATFORK
13679 pthread_atfork(NULL,NULL,NULL);
13684 : see if pthread_atfork exists
13685 set try -DPTHREAD_ATFORK
13686 if eval $compile; then
13691 case "$usethreads" in
13694 $define) echo 'pthread_atfork found.' >&4 ;;
13695 *) echo 'pthread_atfork NOT found.' >&4 ;;
13698 set d_pthread_atfork
13702 : see whether the various POSIXish _yields exist
13704 #include <pthread.h>
13710 #ifdef PTHREAD_YIELD
13713 #ifdef PTHREAD_YIELD_NULL
13714 pthread_yield(NULL);
13720 : see if sched_yield exists
13721 set try -DSCHED_YIELD
13722 if eval $compile; then
13724 sched_yield='sched_yield()'
13728 case "$usethreads" in
13731 $define) echo 'sched_yield() found.' >&4 ;;
13732 *) echo 'sched_yield() NOT found.' >&4 ;;
13738 : see if pthread_yield exists
13739 set try -DPTHREAD_YIELD
13740 if eval $compile; then
13742 case "$sched_yield" in
13743 '') sched_yield='pthread_yield()' ;;
13746 set try -DPTHREAD_YIELD_NULL
13747 if eval $compile; then
13749 case "$sched_yield" in
13750 '') sched_yield='pthread_yield(NULL)' ;;
13756 case "$usethreads" in
13759 $define) echo 'pthread_yield() found.' >&4 ;;
13760 *) echo 'pthread_yield() NOT found.' >&4 ;;
13764 set d_pthread_yield
13767 case "$sched_yield" in
13768 '') sched_yield=undef ;;
13773 : see if random_r exists
13774 set random_r d_random_r
13776 case "$d_random_r" in
13778 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
13779 case "$d_random_r_proto:$usethreads" in
13780 ":define") d_random_r_proto=define
13781 set d_random_r_proto random_r $hdrs
13785 case "$d_random_r_proto" in
13787 case "$random_r_proto" in
13788 ''|0) try='int random_r(int*, struct random_data*);'
13789 ./protochk "extern $try" $hdrs && random_r_proto=I_TS ;;
13791 case "$random_r_proto" in
13792 '') d_random_r=undef
13794 echo "Disabling random_r, cannot determine prototype." >&4 ;;
13795 * ) case "$random_r_proto" in
13796 REENTRANT_PROTO*) ;;
13797 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
13799 echo "Prototype: $try" ;;
13802 *) case "$usethreads" in
13803 define) echo "random_r has no prototype, not using it." >&4 ;;
13808 *) random_r_proto=0
13812 : see if readdir and friends exist
13813 set readdir d_readdir
13815 set seekdir d_seekdir
13817 set telldir d_telldir
13819 set rewinddir d_rewinddir
13822 : see if readdir64_r exists
13823 set readdir64_r d_readdir64_r
13825 case "$d_readdir64_r" in
13827 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
13828 case "$d_readdir64_r_proto:$usethreads" in
13829 ":define") d_readdir64_r_proto=define
13830 set d_readdir64_r_proto readdir64_r $hdrs
13834 case "$d_readdir64_r_proto" in
13836 case "$readdir64_r_proto" in
13837 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
13838 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
13840 case "$readdir64_r_proto" in
13841 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
13842 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
13844 case "$readdir64_r_proto" in
13845 '') d_readdir64_r=undef
13846 readdir64_r_proto=0
13847 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
13848 * ) case "$readdir64_r_proto" in
13849 REENTRANT_PROTO*) ;;
13850 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
13852 echo "Prototype: $try" ;;
13855 *) case "$usethreads" in
13856 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
13861 *) readdir64_r_proto=0
13865 : see if readdir_r exists
13866 set readdir_r d_readdir_r
13868 case "$d_readdir_r" in
13870 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
13871 case "$d_readdir_r_proto:$usethreads" in
13872 ":define") d_readdir_r_proto=define
13873 set d_readdir_r_proto readdir_r $hdrs
13877 case "$d_readdir_r_proto" in
13879 case "$readdir_r_proto" in
13880 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
13881 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
13883 case "$readdir_r_proto" in
13884 ''|0) try='int readdir_r(DIR*, struct dirent*);'
13885 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
13887 case "$readdir_r_proto" in
13888 '') d_readdir_r=undef
13890 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
13891 * ) case "$readdir_r_proto" in
13892 REENTRANT_PROTO*) ;;
13893 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
13895 echo "Prototype: $try" ;;
13898 *) case "$usethreads" in
13899 define) echo "readdir_r has no prototype, not using it." >&4 ;;
13904 *) readdir_r_proto=0
13908 : see if readv exists
13912 : see if recvmsg exists
13913 set recvmsg d_recvmsg
13916 : see if rename exists
13917 set rename d_rename
13920 : see if rmdir exists
13924 : see if memory.h is available.
13929 : See if it conflicts with string.h
13935 $cppstdin $cppflags $cppminus < $strings > mem.h
13936 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
13938 echo "We won't be including <memory.h>."
13948 : can bcopy handle overlapping blocks?
13951 case "$d_memmove" in
13952 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
13953 *) case "$d_bcopy" in
13955 echo "Checking to see if bcopy() can do overlapping copies..." >&4
13957 #$i_memory I_MEMORY
13958 #$i_stdlib I_STDLIB
13959 #$i_string I_STRING
13960 #$i_unistd I_UNISTD
13962 $cat >>try.c <<'EOCP'
13965 # include <memory.h>
13968 # include <stdlib.h>
13971 # include <string.h>
13973 # include <strings.h>
13976 # include <unistd.h> /* Needed for NetBSD */
13980 char buf[128], abc[128];
13986 /* Copy "abcde..." string to char abc[] so that gcc doesn't
13987 try to store the string in read-only memory. */
13988 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
13990 for (align = 7; align >= 0; align--) {
13991 for (len = 36; len; len--) {
13993 bcopy(abc, b, len);
13994 for (off = 1; off <= len; off++) {
13995 bcopy(b, b+off, len);
13996 bcopy(b+off, b, len);
13997 if (bcmp(b, abc, len))
14006 if eval $compile_ok; then
14007 if ./try 2>/dev/null; then
14008 echo "Yes, it can."
14011 echo "It can't, sorry."
14014 echo "(I can't compile the test program, so we'll assume not...)"
14018 $rm -f try.* try core
14024 : can memcpy handle overlapping blocks?
14027 case "$d_memmove" in
14028 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
14029 *) case "$d_memcpy" in
14031 echo "Checking to see if memcpy() can do overlapping copies..." >&4
14033 #$i_memory I_MEMORY
14034 #$i_stdlib I_STDLIB
14035 #$i_string I_STRING
14036 #$i_unistd I_UNISTD
14038 $cat >>try.c <<'EOCP'
14041 # include <memory.h>
14044 # include <stdlib.h>
14047 # include <string.h>
14049 # include <strings.h>
14052 # include <unistd.h> /* Needed for NetBSD */
14056 char buf[128], abc[128];
14062 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14063 try to store the string in read-only memory. */
14064 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
14066 for (align = 7; align >= 0; align--) {
14067 for (len = 36; len; len--) {
14069 memcpy(b, abc, len);
14070 for (off = 1; off <= len; off++) {
14071 memcpy(b+off, b, len);
14072 memcpy(b, b+off, len);
14073 if (memcmp(b, abc, len))
14082 if eval $compile_ok; then
14083 if ./try 2>/dev/null; then
14084 echo "Yes, it can."
14087 echo "It can't, sorry."
14090 echo "(I can't compile the test program, so we'll assume not...)"
14094 $rm -f try.* try core
14100 : can memcmp be trusted to compare relative magnitude?
14102 case "$d_memcmp" in
14105 echo "Checking if your memcmp() can compare relative magnitude..." >&4
14107 #$i_memory I_MEMORY
14108 #$i_stdlib I_STDLIB
14109 #$i_string I_STRING
14110 #$i_unistd I_UNISTD
14112 $cat >>try.c <<'EOCP'
14115 # include <memory.h>
14118 # include <stdlib.h>
14121 # include <string.h>
14123 # include <strings.h>
14126 # include <unistd.h> /* Needed for NetBSD */
14132 if ((a < b) && memcmp(&a, &b, 1) < 0)
14138 if eval $compile_ok; then
14139 if $run ./try 2>/dev/null; then
14140 echo "Yes, it can."
14143 echo "No, it can't (it uses signed chars)."
14146 echo "(I can't compile the test program, so we'll assume not...)"
14150 $rm -f try.* try core
14154 : see if prototype for sbrk is available
14156 set d_sbrkproto sbrk $i_unistd unistd.h
14159 : see if select exists
14160 set select d_select
14163 : see if semctl exists
14164 set semctl d_semctl
14167 : see if semget exists
14168 set semget d_semget
14171 : see if semop exists
14175 : see how much of the 'sem*(2)' library is present.
14178 case "$d_semctl$d_semget$d_semop" in
14179 *"$undef"*) h_sem=false;;
14183 case "`ipcs 2>&1`" in
14184 "SVID messages"*"not configured"*)
14185 echo "Your $osname does not have the sem*(2) configured." >&4
14188 set semctl d_semctl
14190 set semget d_semget
14198 : we could also check for sys/ipc.h ...
14199 if $h_sem && $test `./findhdr sys/sem.h`; then
14200 echo "You have the full sem*(2) library." >&4
14203 echo "You don't have the full sem*(2) library." >&4
14209 : see whether sys/sem.h defines union semun
14211 $cat > try.c <<'END'
14212 #include <sys/types.h>
14213 #include <sys/ipc.h>
14214 #include <sys/sem.h>
14215 int main () { union semun semun; semun.buf = 0; }
14218 if eval $compile; then
14219 echo "You have union semun in <sys/sem.h>." >&4
14222 echo "You do not have union semun in <sys/sem.h>." >&4
14225 $rm -f try try.c try.h
14229 : see how to do semctl IPC_STAT
14232 : see whether semctl IPC_STAT can use union semun
14237 # define S_IRUSR S_IREAD
14238 # define S_IWUSR S_IWRITE
14239 # define S_IXUSR S_IEXEC
14241 # define S_IRUSR 0400
14242 # define S_IWUSR 0200
14243 # define S_IXUSR 0100
14245 # define S_IRGRP (S_IRUSR>>3)
14246 # define S_IWGRP (S_IWUSR>>3)
14247 # define S_IXGRP (S_IXUSR>>3)
14248 # define S_IROTH (S_IRUSR>>6)
14249 # define S_IWOTH (S_IWUSR>>6)
14250 # define S_IXOTH (S_IXUSR>>6)
14253 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
14254 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
14255 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
14260 #include <sys/types.h>
14261 #include <sys/ipc.h>
14262 #include <sys/sem.h>
14263 #include <sys/stat.h>
14270 #$d_union_semun HAS_UNION_SEMUN
14273 #ifndef HAS_UNION_SEMUN
14276 struct semid_ds *buf;
14277 unsigned short *array;
14283 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14284 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14286 struct semid_ds argbuf;
14289 st = semctl(sem, 0, IPC_STAT, arg);
14293 # endif /* IPC_STAT */
14294 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14296 if (semctl(sem, 0, IPC_RMID, arg) != 0)
14297 # endif /* IPC_RMID */
14298 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14300 #endif /* IPC_PRIVATE && ... */
14301 printf("semget failed: errno = %d\n", errno);
14307 if eval $compile; then
14310 semun) val="$define" ;;
14316 case "$d_semctl_semun" in
14318 echo "You can use union semun for semctl IPC_STAT." >&4
14321 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
14326 : see whether semctl IPC_STAT can use struct semid_ds pointer
14327 $cat > try.c <<'END'
14328 #include <sys/types.h>
14329 #include <sys/ipc.h>
14330 #include <sys/sem.h>
14331 #include <sys/stat.h>
14339 struct semid_ds arg;
14342 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14343 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14346 st = semctl(sem, 0, IPC_STAT, &arg);
14348 printf("semid_ds\n");
14350 # endif /* IPC_STAT */
14351 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14353 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
14354 # endif /* IPC_RMID */
14355 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14357 #endif /* IPC_PRIVATE && ... */
14358 printf("semget failed: errno = %d\n", errno);
14365 if eval $compile; then
14368 semid_ds) val="$define" ;;
14372 set d_semctl_semid_ds
14374 case "$d_semctl_semid_ds" in
14376 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
14378 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
14385 # We do not have the full sem*(2) library, so assume we can not
14391 set d_semctl_semid_ds
14396 : see if sendmsg exists
14397 set sendmsg d_sendmsg
14400 : see if setegid exists
14401 set setegid d_setegid
14404 : see if seteuid exists
14405 set seteuid d_seteuid
14408 : see if setgrent exists
14409 set setgrent d_setgrent
14412 : see if setgrent_r exists
14413 set setgrent_r d_setgrent_r
14415 case "$d_setgrent_r" in
14417 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14418 case "$d_setgrent_r_proto:$usethreads" in
14419 ":define") d_setgrent_r_proto=define
14420 set d_setgrent_r_proto setgrent_r $hdrs
14424 case "$d_setgrent_r_proto" in
14426 case "$setgrent_r_proto" in
14427 ''|0) try='int setgrent_r(FILE**);'
14428 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
14430 case "$setgrent_r_proto" in
14431 ''|0) try='void setgrent_r(FILE**);'
14432 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
14434 case "$setgrent_r_proto" in
14435 '') d_setgrent_r=undef
14437 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
14438 * ) case "$setgrent_r_proto" in
14439 REENTRANT_PROTO*) ;;
14440 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
14442 echo "Prototype: $try" ;;
14445 *) case "$usethreads" in
14446 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
14451 *) setgrent_r_proto=0
14455 : see if sethostent exists
14456 set sethostent d_sethent
14459 : see if sethostent_r exists
14460 set sethostent_r d_sethostent_r
14462 case "$d_sethostent_r" in
14464 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14465 case "$d_sethostent_r_proto:$usethreads" in
14466 ":define") d_sethostent_r_proto=define
14467 set d_sethostent_r_proto sethostent_r $hdrs
14471 case "$d_sethostent_r_proto" in
14473 case "$sethostent_r_proto" in
14474 ''|0) try='int sethostent_r(int, struct hostent_data*);'
14475 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
14477 case "$sethostent_r_proto" in
14478 ''|0) try='void sethostent_r(int, struct hostent_data*);'
14479 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
14481 case "$sethostent_r_proto" in
14482 '') d_sethostent_r=undef
14483 sethostent_r_proto=0
14484 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
14485 * ) case "$sethostent_r_proto" in
14486 REENTRANT_PROTO*) ;;
14487 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
14489 echo "Prototype: $try" ;;
14492 *) case "$usethreads" in
14493 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
14498 *) sethostent_r_proto=0
14502 : see if setitimer exists
14503 set setitimer d_setitimer
14506 : see if setlinebuf exists
14507 set setlinebuf d_setlinebuf
14510 : see if setlocale exists
14511 set setlocale d_setlocale
14514 : see if locale.h is available
14515 set locale.h i_locale
14518 : see if setlocale_r exists
14519 set setlocale_r d_setlocale_r
14521 case "$d_setlocale_r" in
14523 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
14524 case "$d_setlocale_r_proto:$usethreads" in
14525 ":define") d_setlocale_r_proto=define
14526 set d_setlocale_r_proto setlocale_r $hdrs
14530 case "$d_setlocale_r_proto" in
14532 case "$setlocale_r_proto" in
14533 ''|0) try='int setlocale_r(int, const char*, char*, int);'
14534 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
14536 case "$setlocale_r_proto" in
14537 '') d_setlocale_r=undef
14538 setlocale_r_proto=0
14539 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
14540 * ) case "$setlocale_r_proto" in
14541 REENTRANT_PROTO*) ;;
14542 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
14544 echo "Prototype: $try" ;;
14547 *) case "$usethreads" in
14548 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
14553 *) setlocale_r_proto=0
14557 : see if setnetent exists
14558 set setnetent d_setnent
14561 : see if setnetent_r exists
14562 set setnetent_r d_setnetent_r
14564 case "$d_setnetent_r" in
14566 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14567 case "$d_setnetent_r_proto:$usethreads" in
14568 ":define") d_setnetent_r_proto=define
14569 set d_setnetent_r_proto setnetent_r $hdrs
14573 case "$d_setnetent_r_proto" in
14575 case "$setnetent_r_proto" in
14576 ''|0) try='int setnetent_r(int, struct netent_data*);'
14577 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
14579 case "$setnetent_r_proto" in
14580 ''|0) try='void setnetent_r(int, struct netent_data*);'
14581 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
14583 case "$setnetent_r_proto" in
14584 '') d_setnetent_r=undef
14585 setnetent_r_proto=0
14586 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
14587 * ) case "$setnetent_r_proto" in
14588 REENTRANT_PROTO*) ;;
14589 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
14591 echo "Prototype: $try" ;;
14594 *) case "$usethreads" in
14595 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
14600 *) setnetent_r_proto=0
14604 : see if setprotoent exists
14605 set setprotoent d_setpent
14608 : see if setpgid exists
14609 set setpgid d_setpgid
14612 : see if setpgrp2 exists
14613 set setpgrp2 d_setpgrp2
14616 : see if setpriority exists
14617 set setpriority d_setprior
14620 : see if setproctitle exists
14621 set setproctitle d_setproctitle
14624 : see if setprotoent_r exists
14625 set setprotoent_r d_setprotoent_r
14627 case "$d_setprotoent_r" in
14629 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14630 case "$d_setprotoent_r_proto:$usethreads" in
14631 ":define") d_setprotoent_r_proto=define
14632 set d_setprotoent_r_proto setprotoent_r $hdrs
14636 case "$d_setprotoent_r_proto" in
14638 case "$setprotoent_r_proto" in
14639 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
14640 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
14642 case "$setprotoent_r_proto" in
14643 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
14644 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
14646 case "$setprotoent_r_proto" in
14647 '') d_setprotoent_r=undef
14648 setprotoent_r_proto=0
14649 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
14650 * ) case "$setprotoent_r_proto" in
14651 REENTRANT_PROTO*) ;;
14652 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
14654 echo "Prototype: $try" ;;
14657 *) case "$usethreads" in
14658 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
14663 *) setprotoent_r_proto=0
14667 : see if setpwent exists
14668 set setpwent d_setpwent
14671 : see if setpwent_r exists
14672 set setpwent_r d_setpwent_r
14674 case "$d_setpwent_r" in
14676 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14677 case "$d_setpwent_r_proto:$usethreads" in
14678 ":define") d_setpwent_r_proto=define
14679 set d_setpwent_r_proto setpwent_r $hdrs
14683 case "$d_setpwent_r_proto" in
14685 case "$setpwent_r_proto" in
14686 ''|0) try='int setpwent_r(FILE**);'
14687 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
14689 case "$setpwent_r_proto" in
14690 ''|0) try='void setpwent_r(FILE**);'
14691 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
14693 case "$setpwent_r_proto" in
14694 '') d_setpwent_r=undef
14696 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
14697 * ) case "$setpwent_r_proto" in
14698 REENTRANT_PROTO*) ;;
14699 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
14701 echo "Prototype: $try" ;;
14704 *) case "$usethreads" in
14705 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
14710 *) setpwent_r_proto=0
14714 : see if setregid exists
14715 set setregid d_setregid
14717 set setresgid d_setresgid
14720 : see if setreuid exists
14721 set setreuid d_setreuid
14723 set setresuid d_setresuid
14726 : see if setrgid exists
14727 set setrgid d_setrgid
14730 : see if setruid exists
14731 set setruid d_setruid
14734 : see if setservent exists
14735 set setservent d_setsent
14738 : see if setservent_r exists
14739 set setservent_r d_setservent_r
14741 case "$d_setservent_r" in
14743 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14744 case "$d_setservent_r_proto:$usethreads" in
14745 ":define") d_setservent_r_proto=define
14746 set d_setservent_r_proto setservent_r $hdrs
14750 case "$d_setservent_r_proto" in
14752 case "$setservent_r_proto" in
14753 ''|0) try='int setservent_r(int, struct servent_data*);'
14754 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
14756 case "$setservent_r_proto" in
14757 ''|0) try='void setservent_r(int, struct servent_data*);'
14758 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
14760 case "$setservent_r_proto" in
14761 '') d_setservent_r=undef
14762 setservent_r_proto=0
14763 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
14764 * ) case "$setservent_r_proto" in
14765 REENTRANT_PROTO*) ;;
14766 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
14768 echo "Prototype: $try" ;;
14771 *) case "$usethreads" in
14772 define) echo "setservent_r has no prototype, not using it." >&4 ;;
14777 *) setservent_r_proto=0
14781 : see if setsid exists
14782 set setsid d_setsid
14785 : see if setvbuf exists
14786 set setvbuf d_setvbuf
14789 : see if sfio.h is available
14794 : see if sfio library is available
14805 : Ok, but do we want to use it.
14809 true|$define|[yY]*) dflt='y';;
14812 echo "$package can use the sfio library, but it is experimental."
14813 case "$useperlio" in
14815 echo "For sfio also the PerlIO abstraction layer is needed."
14816 echo "Earlier you said you wouldn't want that."
14819 rp="You seem to have sfio available, do you want to try using it?"
14822 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
14823 useperlio="$define"
14826 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
14831 *) case "$usesfio" in
14832 true|$define|[yY]*)
14833 echo "Sorry, cannot find sfio on this machine." >&4
14834 echo "Ignoring your setting of usesfio=$usesfio." >&4
14843 $define) usesfio='true';;
14844 *) usesfio='false';;
14848 *) : Remove sfio from list of libraries to use
14851 echo "Removing unneeded -lsfio from library list" >&4
14852 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
14855 echo "libs = $libs" >&4
14862 : see if shmctl exists
14863 set shmctl d_shmctl
14866 : see if shmget exists
14867 set shmget d_shmget
14870 : see if shmat exists
14873 : see what shmat returns
14876 $cat >shmat.c <<'END'
14877 #include <sys/shm.h>
14880 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
14885 echo "and it returns ($shmattype)." >&4
14886 : see if a prototype for shmat is available
14887 xxx=`./findhdr sys/shm.h`
14888 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
14889 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
14900 set d_shmatprototype
14903 : see if shmdt exists
14907 : see how much of the 'shm*(2)' library is present.
14910 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
14911 *"$undef"*) h_shm=false;;
14915 case "`ipcs 2>&1`" in
14916 "SVID shared memory"*"not configured"*)
14917 echo "Your $osname does not have the shm*(2) configured." >&4
14920 set shmctl d_shmctl
14922 set shmget d_shmget
14932 : we could also check for sys/ipc.h ...
14933 if $h_shm && $test `./findhdr sys/shm.h`; then
14934 echo "You have the full shm*(2) library." >&4
14937 echo "You don't have the full shm*(2) library." >&4
14944 : see if we have sigaction
14945 if set sigaction val -f d_sigaction; eval $csym; $val; then
14946 echo 'sigaction() found.' >&4
14947 $cat > try.c <<'EOP'
14949 #include <sys/types.h>
14950 #include <signal.h>
14953 struct sigaction act, oact;
14955 oact.sa_handler = 0;
14956 /* so that act and oact are used */
14957 exit(act.sa_flags == 0 && oact.sa_handler == 0);
14961 if eval $compile_ok; then
14964 echo "But you don't seem to have a useable struct sigaction." >&4
14968 echo 'sigaction NOT found.' >&4
14971 set d_sigaction; eval $setvar
14972 $rm -f try try$_o try.c
14974 : see if sigprocmask exists
14975 set sigprocmask d_sigprocmask
14978 : see if sigsetjmp exists
14980 case "$d_sigsetjmp" in
14982 $cat >try.c <<'EOP'
14983 #include <setjmp.h>
14988 if (sigsetjmp(env,1))
14991 siglongjmp(env, 1);
14996 if eval $compile; then
14997 if $run ./try >/dev/null 2>&1; then
14998 echo "POSIX sigsetjmp found." >&4
15002 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
15008 echo "sigsetjmp not found." >&4
15012 *) val="$d_sigsetjmp"
15013 case "$d_sigsetjmp" in
15014 $define) echo "POSIX sigsetjmp found." >&4;;
15015 $undef) echo "sigsetjmp not found." >&4;;
15023 : see if sockatmark exists
15024 set sockatmark d_sockatmark
15027 : see if prototype for sockatmark is available
15029 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
15032 : see if socks5_init exists
15033 set socks5_init d_socks5_init
15036 : see if srand48_r exists
15037 set srand48_r d_srand48_r
15039 case "$d_srand48_r" in
15041 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15042 case "$d_srand48_r_proto:$usethreads" in
15043 ":define") d_srand48_r_proto=define
15044 set d_srand48_r_proto srand48_r $hdrs
15048 case "$d_srand48_r_proto" in
15050 case "$srand48_r_proto" in
15051 ''|0) try='int srand48_r(long, struct drand48_data*);'
15052 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
15054 case "$srand48_r_proto" in
15055 '') d_srand48_r=undef
15057 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
15058 * ) case "$srand48_r_proto" in
15059 REENTRANT_PROTO*) ;;
15060 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
15062 echo "Prototype: $try" ;;
15065 *) case "$usethreads" in
15066 define) echo "srand48_r has no prototype, not using it." >&4 ;;
15071 *) srand48_r_proto=0
15075 : see if srandom_r exists
15076 set srandom_r d_srandom_r
15078 case "$d_srandom_r" in
15080 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15081 case "$d_srandom_r_proto:$usethreads" in
15082 ":define") d_srandom_r_proto=define
15083 set d_srandom_r_proto srandom_r $hdrs
15087 case "$d_srandom_r_proto" in
15089 case "$srandom_r_proto" in
15090 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
15091 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
15093 case "$srandom_r_proto" in
15094 '') d_srandom_r=undef
15096 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
15097 * ) case "$srandom_r_proto" in
15098 REENTRANT_PROTO*) ;;
15099 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
15101 echo "Prototype: $try" ;;
15104 *) case "$usethreads" in
15105 define) echo "srandom_r has no prototype, not using it." >&4 ;;
15110 *) srandom_r_proto=0
15114 : see if prototype for setresgid is available
15116 set d_sresgproto setresgid $i_unistd unistd.h
15119 : see if prototype for setresuid is available
15121 set d_sresuproto setresuid $i_unistd unistd.h
15124 : see if sys/stat.h is available
15125 set sys/stat.h i_sysstat
15129 : see if stat knows about block sizes
15131 echo "Checking to see if your struct stat has st_blocks field..." >&4
15132 set d_statblks stat st_blocks $i_sysstat sys/stat.h
15136 : see if this is a sys/vfs.h system
15137 set sys/vfs.h i_sysvfs
15141 : see if this is a sys/statfs.h system
15142 set sys/statfs.h i_sysstatfs
15147 echo "Checking to see if your system supports struct statfs..." >&4
15148 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
15150 case "$d_statfs_s" in
15151 "$define") echo "Yes, it does." ;;
15152 *) echo "No, it doesn't." ;;
15157 : see if struct statfs knows about f_flags
15158 case "$d_statfs_s" in
15161 echo "Checking to see if your struct statfs has f_flags field..." >&4
15162 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
15166 set d_statfs_f_flags
15170 case "$d_statfs_f_flags" in
15171 "$define") echo "Yes, it does." ;;
15172 *) echo "No, it doesn't." ;;
15175 : see if _ptr and _cnt from stdio act std
15178 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
15179 echo "(Looks like you have stdio.h from BSD.)"
15180 case "$stdio_ptr" in
15181 '') stdio_ptr='((fp)->_p)'
15184 *) ptr_lval=$d_stdio_ptr_lval;;
15186 case "$stdio_cnt" in
15187 '') stdio_cnt='((fp)->_r)'
15190 *) cnt_lval=$d_stdio_cnt_lval;;
15192 case "$stdio_base" in
15193 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
15195 case "$stdio_bufsiz" in
15196 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
15198 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
15199 echo "(Looks like you have stdio.h from Linux.)"
15200 case "$stdio_ptr" in
15201 '') stdio_ptr='((fp)->_IO_read_ptr)'
15204 *) ptr_lval=$d_stdio_ptr_lval;;
15206 case "$stdio_cnt" in
15207 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
15210 *) cnt_lval=$d_stdio_cnt_lval;;
15212 case "$stdio_base" in
15213 '') stdio_base='((fp)->_IO_read_base)';;
15215 case "$stdio_bufsiz" in
15216 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
15219 case "$stdio_ptr" in
15220 '') stdio_ptr='((fp)->_ptr)'
15223 *) ptr_lval=$d_stdio_ptr_lval;;
15225 case "$stdio_cnt" in
15226 '') stdio_cnt='((fp)->_cnt)'
15229 *) cnt_lval=$d_stdio_cnt_lval;;
15231 case "$stdio_base" in
15232 '') stdio_base='((fp)->_base)';;
15234 case "$stdio_bufsiz" in
15235 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
15239 : test whether _ptr and _cnt really work
15240 echo "Checking how std your stdio is..." >&4
15243 #define FILE_ptr(fp) $stdio_ptr
15244 #define FILE_cnt(fp) $stdio_cnt
15246 FILE *fp = fopen("try.c", "r");
15249 18 <= FILE_cnt(fp) &&
15250 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15258 if eval $compile && $to try.c; then
15259 if $run ./try; then
15260 echo "Your stdio acts pretty std."
15263 echo "Your stdio isn't very std."
15266 echo "Your stdio doesn't appear very std."
15272 : Can _ptr be used as an lvalue?
15273 case "$d_stdstdio$ptr_lval" in
15274 $define$define) val=$define ;;
15277 set d_stdio_ptr_lval
15280 : Can _cnt be used as an lvalue?
15281 case "$d_stdstdio$cnt_lval" in
15282 $define$define) val=$define ;;
15285 set d_stdio_cnt_lval
15289 : test whether setting _ptr sets _cnt as a side effect
15290 d_stdio_ptr_lval_sets_cnt="$undef"
15291 d_stdio_ptr_lval_nochange_cnt="$undef"
15292 case "$d_stdio_ptr_lval$d_stdstdio" in
15294 echo "Checking to see what happens if we set the stdio ptr..." >&4
15297 /* Can we scream? */
15298 /* Eat dust sed :-) */
15299 /* In the buffer space, no one can hear you scream. */
15300 #define FILE_ptr(fp) $stdio_ptr
15301 #define FILE_cnt(fp) $stdio_cnt
15302 #include <sys/types.h>
15304 FILE *fp = fopen("try.c", "r");
15309 puts("Fail even to read");
15312 c = getc(fp); /* Read away the first # */
15314 puts("Fail even to read");
15318 18 <= FILE_cnt(fp) &&
15319 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15321 puts("Fail even to read");
15324 ptr = (char*) FILE_ptr(fp);
15325 cnt = (size_t)FILE_cnt(fp);
15327 FILE_ptr(fp) += 42;
15329 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
15330 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
15333 if (FILE_cnt(fp) <= 20) {
15334 printf ("Fail (<20 chars to test)");
15337 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
15338 puts("Fail compare");
15341 if (cnt == FILE_cnt(fp)) {
15342 puts("Pass_unchanged");
15345 if (FILE_cnt(fp) == (cnt - 42)) {
15346 puts("Pass_changed");
15349 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
15355 if eval $compile && $to try.c; then
15356 case `$run ./try` in
15358 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
15359 d_stdio_ptr_lval_sets_cnt="$define" ;;
15361 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
15362 d_stdio_ptr_lval_nochange_cnt="$define" ;;
15364 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
15366 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
15369 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
15375 : see if _base is also standard
15377 case "$d_stdstdio" in
15381 #define FILE_base(fp) $stdio_base
15382 #define FILE_bufsiz(fp) $stdio_bufsiz
15384 FILE *fp = fopen("try.c", "r");
15387 19 <= FILE_bufsiz(fp) &&
15388 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
15395 if eval $compile && $to try.c; then
15396 if $run ./try; then
15397 echo "And its _base field acts std."
15400 echo "But its _base field isn't std."
15403 echo "However, it seems to be lacking the _base field."
15412 Checking how to access stdio streams by file descriptor number...
15414 case "$stdio_stream_array" in
15415 '') $cat >try.c <<EOCP
15418 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
15422 for s in _iob __iob __sF
15424 set try -DSTDIO_STREAM_ARRAY=$s
15425 if eval $compile; then
15426 case "`$run ./try`" in
15427 yes) stdio_stream_array=$s; break ;;
15431 $rm -f try.* try$exe_ext
15433 case "$stdio_stream_array" in
15435 I can't figure out how to access stdio streams by file descriptor number.
15437 d_stdio_stream_array="$undef"
15440 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
15442 d_stdio_stream_array="$define"
15446 : see if strcoll exists
15447 set strcoll d_strcoll
15450 : check for structure copying
15452 echo "Checking to see if your C compiler can copy structs..." >&4
15453 $cat >try.c <<'EOCP'
15463 if $cc -c try.c >/dev/null 2>&1 ; then
15465 echo "Yup, it can."
15468 echo "Nope, it can't."
15474 : see if strerror and/or sys_errlist[] exist
15476 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
15477 if set strerror val -f d_strerror; eval $csym; $val; then
15478 echo 'strerror() found.' >&4
15479 d_strerror="$define"
15480 d_strerrm='strerror(e)'
15481 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15482 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
15483 d_syserrlst="$define"
15485 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
15486 d_syserrlst="$undef"
15488 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
15489 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
15490 echo 'strerror() found in string header.' >&4
15491 d_strerror="$define"
15492 d_strerrm='strerror(e)'
15493 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15494 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
15495 d_syserrlst="$define"
15497 echo "(You don't appear to have any sys_errlist[], how can this be?)"
15498 d_syserrlst="$undef"
15500 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15501 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
15502 d_strerror="$undef"
15503 d_syserrlst="$define"
15504 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
15506 echo 'strerror() and sys_errlist[] NOT found.' >&4
15507 d_strerror="$undef"
15508 d_syserrlst="$undef"
15509 d_strerrm='"unknown"'
15513 : see if strerror_r exists
15514 set strerror_r d_strerror_r
15516 case "$d_strerror_r" in
15518 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
15519 case "$d_strerror_r_proto:$usethreads" in
15520 ":define") d_strerror_r_proto=define
15521 set d_strerror_r_proto strerror_r $hdrs
15525 case "$d_strerror_r_proto" in
15527 case "$strerror_r_proto" in
15528 ''|0) try='int strerror_r(int, char*, size_t);'
15529 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
15531 case "$strerror_r_proto" in
15532 ''|0) try='int strerror_r(int, char*, int);'
15533 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
15535 case "$strerror_r_proto" in
15536 ''|0) try='char* strerror_r(int, char*, size_t);'
15537 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
15539 case "$strerror_r_proto" in
15540 '') d_strerror_r=undef
15542 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
15543 * ) case "$strerror_r_proto" in
15544 REENTRANT_PROTO*) ;;
15545 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
15547 echo "Prototype: $try" ;;
15550 *) case "$usethreads" in
15551 define) echo "strerror_r has no prototype, not using it." >&4 ;;
15556 *) strerror_r_proto=0
15560 : see if strftime exists
15561 set strftime d_strftime
15564 : see if strtod exists
15565 set strtod d_strtod
15568 : see if strtol exists
15569 set strtol d_strtol
15572 : see if strtold exists
15573 set strtold d_strtold
15576 : see if strtoll exists
15577 set strtoll d_strtoll
15580 case "$d_longlong-$d_strtoll" in
15583 Checking whether your strtoll() works okay...
15585 $cat >try.c <<'EOCP'
15588 #define strtoll __strtoll
15591 #define strtoll _strtoll
15594 extern long long int strtoll(char *s, char **, int);
15595 static int bad = 0;
15596 int check(char *s, long long ell, int een) {
15599 gll = strtoll(s, 0, 10);
15600 if (!((gll == ell) && (errno == een)))
15604 check(" 1", 1LL, 0);
15605 check(" 0", 0LL, 0);
15606 check("-1", -1LL, 0);
15607 check("-9223372036854775808", -9223372036854775808LL, 0);
15608 check("-9223372036854775808", -9223372036854775808LL, 0);
15609 check(" 9223372036854775807", 9223372036854775807LL, 0);
15610 check("-9223372036854775808", -9223372036854775808LL, 0);
15611 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
15612 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
15618 if eval $compile; then
15621 ok) echo "Your strtoll() seems to be working okay." ;;
15623 Your strtoll() doesn't seem to be working okay.
15629 echo "(I can't seem to compile the test program--assuming it doesn't)"
15635 : see if strtoq exists
15636 set strtoq d_strtoq
15639 : see if strtoul exists
15640 set strtoul d_strtoul
15643 case "$d_strtoul" in
15646 Checking whether your strtoul() works okay...
15648 $cat >try.c <<'EOCP'
15651 extern unsigned long int strtoul(char *s, char **, int);
15652 static int bad = 0;
15653 void check(char *s, unsigned long eul, int een) {
15656 gul = strtoul(s, 0, 10);
15657 if (!((gul == eul) && (errno == een)))
15661 check(" 1", 1L, 0);
15662 check(" 0", 0L, 0);
15664 case "$longsize" in
15666 $cat >>try.c <<'EOCP'
15667 check("18446744073709551615", 18446744073709551615UL, 0);
15668 check("18446744073709551616", 18446744073709551615UL, ERANGE);
15669 #if 0 /* strtoul() for /^-/ strings is undefined. */
15670 check("-1", 18446744073709551615UL, 0);
15671 check("-18446744073709551614", 2, 0);
15672 check("-18446744073709551615", 1, 0);
15673 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
15674 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
15679 $cat >>try.c <<'EOCP'
15680 check("4294967295", 4294967295UL, 0);
15681 check("4294967296", 4294967295UL, ERANGE);
15682 #if 0 /* strtoul() for /^-/ strings is undefined. */
15683 check("-1", 4294967295UL, 0);
15684 check("-4294967294", 2, 0);
15685 check("-4294967295", 1, 0);
15686 check("-4294967296", 4294967295UL, ERANGE);
15687 check("-4294967297", 4294967295UL, ERANGE);
15692 : Should we write these tests to be more portable by sprintf-ing
15693 : ~0 and then manipulating that char string as input for strtol?
15696 $cat >>try.c <<'EOCP'
15703 if eval $compile; then
15704 case "`$run ./try`" in
15705 ok) echo "Your strtoul() seems to be working okay." ;;
15707 Your strtoul() doesn't seem to be working okay.
15716 : see if strtoull exists
15717 set strtoull d_strtoull
15720 case "$d_longlong-$d_strtoull" in
15723 Checking whether your strtoull() works okay...
15725 $cat >try.c <<'EOCP'
15728 #define strtoull __strtoull
15731 extern unsigned long long int strtoull(char *s, char **, int);
15732 static int bad = 0;
15733 int check(char *s, long long eull, int een) {
15736 gull = strtoull(s, 0, 10);
15737 if (!((gull == eull) && (errno == een)))
15741 check(" 1", 1LL, 0);
15742 check(" 0", 0LL, 0);
15743 check("18446744073709551615", 18446744073709551615ULL, 0);
15744 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
15745 #if 0 /* strtoull() for /^-/ strings is undefined. */
15746 check("-1", 18446744073709551615ULL, 0);
15747 check("-18446744073709551614", 2LL, 0);
15748 check("-18446744073709551615", 1LL, 0);
15749 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
15750 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
15757 if eval $compile; then
15758 case "`$run ./try`" in
15759 ok) echo "Your strtoull() seems to be working okay." ;;
15761 Your strtoull() doesn't seem to be working okay.
15763 d_strtoull="$undef"
15770 : see if strtouq exists
15771 set strtouq d_strtouq
15774 case "$d_strtouq" in
15777 Checking whether your strtouq() works okay...
15779 $cat >try.c <<'EOCP'
15782 extern unsigned long long int strtouq(char *s, char **, int);
15783 static int bad = 0;
15784 void check(char *s, unsigned long long eull, int een) {
15785 unsigned long long gull;
15787 gull = strtouq(s, 0, 10);
15788 if (!((gull == eull) && (errno == een)))
15792 check(" 1", 1LL, 0);
15793 check(" 0", 0LL, 0);
15794 check("18446744073709551615", 18446744073709551615ULL, 0);
15795 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
15796 #if 0 /* strtouq() for /^-/ strings is undefined. */
15797 check("-1", 18446744073709551615ULL, 0);
15798 check("-18446744073709551614", 2LL, 0);
15799 check("-18446744073709551615", 1LL, 0);
15800 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
15801 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
15809 if eval $compile; then
15810 case "`$run ./try`" in
15811 ok) echo "Your strtouq() seems to be working okay." ;;
15813 Your strtouq() doesn't seem to be working okay.
15822 : see if strxfrm exists
15823 set strxfrm d_strxfrm
15826 : see if symlink exists
15827 set symlink d_symlink
15830 : see if syscall exists
15831 set syscall d_syscall
15834 : see if prototype for syscall is available
15836 set d_syscallproto syscall $i_unistd unistd.h
15839 : see if sysconf exists
15840 set sysconf d_sysconf
15843 : see if system exists
15844 set system d_system
15847 : see if tcgetpgrp exists
15848 set tcgetpgrp d_tcgetpgrp
15851 : see if tcsetpgrp exists
15852 set tcsetpgrp d_tcsetpgrp
15855 : see if prototype for telldir is available
15857 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
15860 : see if this is a sys/times.h system
15861 set sys/times.h i_systimes
15864 : see if times exists
15866 if set times val -f d_times; eval $csym; $val; then
15867 echo 'times() found.' >&4
15870 case "$i_systimes" in
15871 "$define") inc='sys/times.h';;
15873 rp="What is the type returned by times() on this system?"
15874 set clock_t clocktype long stdio.h sys/types.h $inc
15877 echo 'times() NOT found, hope that will do.' >&4
15882 : see if tmpnam_r exists
15883 set tmpnam_r d_tmpnam_r
15885 case "$d_tmpnam_r" in
15887 hdrs="$i_systypes sys/types.h define stdio.h $i_stdio stdio.h"
15888 case "$d_tmpnam_r_proto:$usethreads" in
15889 ":define") d_tmpnam_r_proto=define
15890 set d_tmpnam_r_proto tmpnam_r $hdrs
15894 case "$d_tmpnam_r_proto" in
15896 case "$tmpnam_r_proto" in
15897 ''|0) try='char* tmpnam_r(char*);'
15898 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
15900 case "$tmpnam_r_proto" in
15901 '') d_tmpnam_r=undef
15903 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
15904 * ) case "$tmpnam_r_proto" in
15905 REENTRANT_PROTO*) ;;
15906 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
15908 echo "Prototype: $try" ;;
15911 *) case "$usethreads" in
15912 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
15917 *) tmpnam_r_proto=0
15921 : see if truncate exists
15922 set truncate d_truncate
15925 : see if ttyname_r exists
15926 set ttyname_r d_ttyname_r
15928 case "$d_ttyname_r" in
15930 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
15931 case "$d_ttyname_r_proto:$usethreads" in
15932 ":define") d_ttyname_r_proto=define
15933 set d_ttyname_r_proto ttyname_r $hdrs
15937 case "$d_ttyname_r_proto" in
15939 case "$ttyname_r_proto" in
15940 ''|0) try='int ttyname_r(int, char*, size_t);'
15941 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
15943 case "$ttyname_r_proto" in
15944 ''|0) try='int ttyname_r(int, char*, int);'
15945 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
15947 case "$ttyname_r_proto" in
15948 ''|0) try='char* ttyname_r(int, char*, int);'
15949 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
15951 case "$ttyname_r_proto" in
15952 '') d_ttyname_r=undef
15954 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
15955 * ) case "$ttyname_r_proto" in
15956 REENTRANT_PROTO*) ;;
15957 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
15959 echo "Prototype: $try" ;;
15962 *) case "$usethreads" in
15963 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
15968 *) ttyname_r_proto=0
15972 : see if tzname[] exists
15974 if set tzname val -a d_tzname; eval $csym; $val; then
15976 echo 'tzname[] found.' >&4
15979 echo 'tzname[] NOT found.' >&4
15985 next|rhapsody|darwin) multiarch="$define" ;;
15987 case "$multiarch" in
15988 ''|[nN]*) multiarch="$undef" ;;
15991 : check for ordering of bytes in a long
15993 case "$usecrosscompile$multiarch" in
15996 You seem to be either cross-compiling or doing a multiarchitecture build,
15997 skipping the byteorder check.
16003 case "$byteorder" in
16006 In the following, larger digits indicate more significance. A big-endian
16007 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
16008 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
16009 machines may have weird orders like 3412. A Cray will report 87654321,
16010 an Alpha will report 12345678. If the test program works the default is
16012 I'm now running the test program...
16014 $cat >try.c <<'EOCP'
16021 char c[sizeof(long)];
16024 if (sizeof(long) > 4)
16025 u.l = (0x08070605L << 32) | 0x04030201L;
16028 for (i = 0; i < sizeof(long); i++)
16029 printf("%c", u.c[i]+'0');
16036 if eval $compile && ./try > /dev/null; then
16039 [1-4][1-4][1-4][1-4]|12345678|87654321)
16040 echo "(The test program ran ok.)"
16041 echo "byteorder=$dflt"
16044 ????|????????) echo "(The test program ran ok.)" ;;
16045 *) echo "(The test program didn't run right for some reason.)" ;;
16050 (I can't seem to compile the test program. Guessing big-endian...)
16053 case "$xxx_prompt" in
16055 rp="What is the order of bytes in a long?"
16071 Checking to see whether you can access character data unalignedly...
16073 case "$d_u32align" in
16074 '') $cat >try.c <<EOCP
16076 #define U32 $u32type
16077 #define BYTEORDER 0x$byteorder
16079 #include <signal.h>
16081 $signal_t bletch(s) int s; { exit(4); }
16084 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
16089 if (sizeof(U32) != 4) {
16090 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
16097 signal(SIGBUS, bletch);
16109 for (i = 0; i < 4; i++) {
16110 up = (U32*)(buf + i);
16111 if (! ((*up == 1 << (8*i)) || /* big-endian */
16112 (*up == 1 << (8*(3-i))) /* little-endian */
16116 printf("read failed (%x)\n", *up);
16122 for (i = 0; i < 4; i++) {
16123 up = (U32*)(buf + i);
16125 if (*up != 0xBeef) {
16126 printf("write failed (%x)\n", *up);
16140 if eval $compile_ok; then
16141 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
16142 $run ./try 2>&1 >/dev/null
16145 You can access character data pretty unalignedly.
16147 d_u32align="$undef"
16150 It seems that you must access character data in an aligned manner.
16152 d_u32align="$define"
16156 rp='Can you access character data at unaligned addresses?'
16160 [yY]*) d_u32align="$undef" ;;
16161 *) d_u32align="$define" ;;
16164 $rm -f core core.try.* try.core
16168 : see if ualarm exists
16169 set ualarm d_ualarm
16172 : see if umask exists
16176 : see if unordered exists
16177 set unordered d_unordered
16180 : see if usleep exists
16181 set usleep d_usleep
16184 : see if prototype for usleep is available
16186 set d_usleepproto usleep $i_unistd unistd.h
16189 : see if ustat exists
16193 : backward compatibility for d_hvfork
16194 if test X$d_hvfork != X; then
16195 d_vfork="$d_hvfork"
16198 : see if there is a vfork
16203 : Ok, but do we want to use it. vfork is reportedly unreliable in
16204 : perl on Solaris 2.x, and probably elsewhere.
16208 case "$usevfork" in
16214 Perl can only use a vfork() that doesn't suffer from strict
16215 restrictions on calling functions or modifying global data in
16216 the child. For example, glibc-2.1 contains such a vfork()
16217 that is unsuitable. If your system provides a proper fork()
16218 call, chances are that you do NOT want perl to use vfork().
16221 rp="Do you still want to use vfork()?"
16226 echo "Ok, we won't use vfork()."
16235 $define) usevfork='true';;
16236 *) usevfork='false';;
16239 : see if closedir exists
16240 set closedir d_closedir
16243 case "$d_closedir" in
16246 echo "Checking whether closedir() returns a status..." >&4
16248 #$i_dirent I_DIRENT /**/
16249 #$i_sysdir I_SYS_DIR /**/
16250 #$i_sysndir I_SYS_NDIR /**/
16251 #$i_systypes I_SYS_TYPES /**/
16253 #if defined(I_SYS_TYPES)
16254 #include <sys/types.h>
16256 #if defined(I_DIRENT)
16257 #include <dirent.h>
16258 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
16259 #include <sys/dir.h>
16263 #include <sys/ndir.h>
16267 #include <ndir.h> /* may be wrong in the future */
16269 #include <sys/dir.h>
16274 int main() { return closedir(opendir(".")); }
16277 if eval $compile_ok; then
16278 if $run ./try > /dev/null 2>&1 ; then
16279 echo "Yes, it does."
16282 echo "No, it doesn't."
16286 echo "(I can't seem to compile the test program--assuming it doesn't)"
16294 set d_void_closedir
16297 : see if there is a wait4
16301 : see if waitpid exists
16302 set waitpid d_waitpid
16305 : see if wcstombs exists
16306 set wcstombs d_wcstombs
16309 : see if wctomb exists
16310 set wctomb d_wctomb
16313 : see if writev exists
16314 set writev d_writev
16317 : preserve RCS keywords in files with variable substitution, grrr
16322 Revision='$Revision'
16324 : check for alignment requirements
16326 case "$usecrosscompile$multiarch" in
16329 You seem to be either cross-compiling or doing a multiarchitecture build,
16330 skipping the memory alignment check.
16333 case "$alignbytes" in
16334 '') alignbytes=8 ;;
16338 case "$alignbytes" in
16339 '') echo "Checking alignment constraints..." >&4
16340 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
16341 $cat >try.c <<'EOCP'
16342 typedef long double NV;
16345 $cat >try.c <<'EOCP'
16349 $cat >>try.c <<'EOCP'
16357 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
16362 if eval $compile_ok; then
16366 echo "(I can't seem to compile the test program...)"
16369 *) dflt="$alignbytes"
16372 rp="Doubles must be aligned on a how-many-byte boundary?"
16380 : set the base revision
16383 : how do we catenate cpp tokens here?
16385 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
16386 $cat >cpp_stuff.c <<'EOCP'
16387 #define RCAT(a,b)a/**/b
16388 #define ACAT(a,b)a ## b
16392 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
16393 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
16394 echo "Oh! Smells like ANSI's been here." >&4
16395 echo "We can catify or stringify, separately or together!"
16397 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
16398 echo "Ah, yes! The good old days!" >&4
16399 echo "However, in the good old days we don't know how to stringify and"
16400 echo "catify at the same time."
16404 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
16405 to have to edit the values of CAT[2-5] in config.h...
16407 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
16411 : see if this is a db.h system
16417 : Check db version.
16419 echo "Checking Berkeley DB version ..." >&4
16425 #include <sys/types.h>
16428 int main(int argc, char *argv[])
16430 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
16431 int Major, Minor, Patch ;
16432 unsigned long Version ;
16433 (void)db_version(&Major, &Minor, &Patch) ;
16435 printf("%d %d %d %d %d %d\n",
16436 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
16437 Major, Minor, Patch);
16440 printf("You have Berkeley DB Version 2 or greater.\n");
16442 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
16443 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
16444 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
16445 Major, Minor, Patch) ;
16447 /* check that db.h & libdb are compatible */
16448 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
16449 printf("db.h and libdb are incompatible.\n") ;
16453 printf("db.h and libdb are compatible.\n") ;
16455 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
16456 + DB_VERSION_PATCH ;
16458 /* needs to be >= 2.3.4 */
16459 if (Version < 2003004) {
16460 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
16461 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
16467 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
16472 printf("You have Berkeley DB Version 1.\n");
16473 exit(0); /* DB version < 2: the coast is clear. */
16475 exit(1); /* <db.h> not Berkeley DB? */
16481 if eval $compile_ok && $run ./try; then
16482 echo 'Looks OK.' >&4
16484 db_version_major=$1
16485 db_version_minor=$2
16486 db_version_patch=$3
16488 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
16492 : Remove db from list of libraries to use
16493 echo "Removing unusable -ldb from library list" >&4
16494 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
16497 echo "libs = $libs" >&4
16507 : Check the return type needed for hash
16509 echo "Checking return type needed for hash for Berkeley DB ..." >&4
16515 #include <sys/types.h>
16518 #ifndef DB_VERSION_MAJOR
16519 u_int32_t hash_cb (ptr, size)
16527 info.hash = hash_cb;
16531 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16532 if $contains warning try.out >>/dev/null 2>&1 ; then
16535 db_hashtype='u_int32_t'
16538 : XXX Maybe we should just give up here.
16539 db_hashtype=u_int32_t
16541 echo "Help: I can't seem to compile the db test program." >&4
16542 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
16545 echo "Your version of Berkeley DB uses $db_hashtype for hash."
16547 *) db_hashtype=u_int32_t
16552 : Check the return type needed for prefix
16554 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
16560 #include <sys/types.h>
16563 #ifndef DB_VERSION_MAJOR
16564 size_t prefix_cb (key1, key2)
16572 info.prefix = prefix_cb;
16576 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16577 if $contains warning try.out >>/dev/null 2>&1 ; then
16578 db_prefixtype='int'
16580 db_prefixtype='size_t'
16583 db_prefixtype='size_t'
16584 : XXX Maybe we should just give up here.
16586 echo "Help: I can't seem to compile the db test program." >&4
16587 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
16590 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
16592 *) db_prefixtype='size_t'
16597 : How can we generate normalized random numbers ?
16599 echo "Looking for a random number function..." >&4
16600 case "$randfunc" in
16602 if set drand48 val -f; eval $csym; $val; then
16604 echo "Good, found drand48()." >&4
16605 elif set random val -f; eval $csym; $val; then
16607 echo "OK, found random()." >&4
16610 echo "Yick, looks like I have to use rand()." >&4
16621 *-Dmy_rand=*|*-Dmy_srand=*)
16622 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
16623 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
16624 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
16625 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
16629 while $test "$cont"; do
16630 rp="Use which function to generate random numbers?"
16632 if $test "$ans" = "$dflt"; then
16638 if set $ans val -f; eval $csym; $val; then
16642 rp="I cannot find function $ans. Use that name anyway?"
16651 case "$randfunc" in
16653 drand01="drand48()"
16659 case "$randbits" in
16661 echo "Checking to see how many bits your $randfunc() function produces..." >&4
16663 #$i_unistd I_UNISTD
16664 #$i_stdlib I_STDLIB
16667 # include <unistd.h>
16670 # include <stdlib.h>
16675 register unsigned long tmp;
16676 register unsigned long max = 0L;
16678 for (i = 1000; i; i--) {
16679 tmp = (unsigned long) $randfunc();
16680 if (tmp > max) max = tmp;
16682 for (i = 0; max; i++)
16688 if eval $compile_ok; then
16692 echo "(I can't seem to compile the test program...)"
16699 rp="How many bits does your $randfunc() function produce?"
16703 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
16704 seedfunc="s$randfunc"
16705 randseedtype=unsigned
16709 rp="How many bits does your $randfunc() function produce?"
16712 seedfunc="s$randfunc"
16713 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
16714 if set $seedfunc val -f; eval $csym; $val; then
16715 echo "(Using $seedfunc() to seed random generator)"
16717 echo "(Warning: no $seedfunc() to seed random generator)"
16720 randseedtype=unsigned
16728 echo "Determining whether or not we are on an EBCDIC system..." >&4
16729 $cat >try.c <<'EOM'
16732 if ('M'==0xd4) return 0;
16739 if eval $compile_ok; then
16740 if $run ./try; then
16741 echo "You seem to speak EBCDIC." >&4
16744 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
16747 echo "I'm unable to compile the test program." >&4
16748 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
16756 Checking how to flush all pending stdio output...
16758 # I only know how to find the first 32 possibly open files on SunOS.
16759 # See also hints/sunos_4_1.sh and util.c --AD
16761 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
16763 $cat >>try.c <<EOCP
16765 #$i_unistd I_UNISTD
16767 # include <unistd.h>
16769 #$d_sysconf HAS_SYSCONF
16770 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
16771 #ifdef HAS_STDIO_STREAM_ARRAY
16772 # define STDIO_STREAM_ARRAY $stdio_stream_array
16777 p = fopen("try.out", "w");
16781 # ifdef TRY_FPRINTF
16785 #ifdef TRY_FFLUSH_NULL
16788 #ifdef TRY_FFLUSH_ALL
16790 long open_max = -1;
16791 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
16792 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
16794 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
16795 open_max = sysconf(_SC_OPEN_MAX);
16798 open_max = FOPEN_MAX;
16801 open_max = OPEN_MAX;
16810 # ifdef HAS_STDIO_STREAM_ARRAY
16811 if (open_max > 0) {
16813 for (i = 0; i < open_max; i++)
16814 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
16815 STDIO_STREAM_ARRAY[i]._file < open_max &&
16816 STDIO_STREAM_ARRAY[i]._flag)
16817 fflush(&STDIO_STREAM_ARRAY[i]);
16825 : first we have to find out how _not_ to flush
16827 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
16829 set try -DTRY_FPUTC
16830 if eval $compile; then
16831 $run ./try 2>/dev/null
16834 if $test ! -s try.out -a "X$code" = X42; then
16840 set try -DTRY_FPRINTF
16841 if eval $compile; then
16842 $run ./try 2>/dev/null
16845 if $test ! -s try.out -a "X$code" = X42; then
16846 output=-DTRY_FPRINTF
16852 : check for fflush NULL behaviour
16853 case "$fflushNULL" in
16854 '') set try -DTRY_FFLUSH_NULL $output
16855 if eval $compile; then
16856 $run ./try 2>/dev/null
16859 if $test -s try.out -a "X$code" = X42; then
16860 fflushNULL="`$cat try.out`"
16862 if $test "X$code" != X42; then
16864 (If this test failed, don't worry, we'll try another method shortly.)
16869 $rm -f core try.core core.try.*
16870 case "$fflushNULL" in
16872 Your fflush(NULL) works okay for output streams.
16873 Let's see if it clobbers input pipes...
16875 # As of mid-March 2000 all versions of Solaris appear to have a stdio
16876 # bug that improperly flushes the input end of pipes. So we avoid the
16877 # autoflush on fork/system/exec support for now. :-(
16878 $cat >tryp.c <<EOCP
16881 main(int argc, char **argv)
16887 while ((i = getc(stdin)) != -1
16888 && (*bp++ = i) != '\n'
16889 && bp < &buf[1024])
16892 fprintf(stdout, "%s", buf);
16900 fflushNULL="$define"
16902 if eval $compile; then
16904 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
16905 if cmp tryp.c tryp.out >/dev/null 2>&1; then
16907 fflush(NULL) seems to behave okay with input streams.
16909 fflushNULL="$define"
16912 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
16914 fflushNULL="$undef"
16917 $rm -f core tryp.c tryp.core core.tryp.*
16920 Your fflush(NULL) isn't working (contrary to ANSI C).
16922 fflushNULL="$undef"
16925 Cannot figure out whether your fflush(NULL) works or not.
16926 I'm assuming it doesn't (contrary to ANSI C).
16928 fflushNULL="$undef"
16932 $define|true|[yY]*)
16933 fflushNULL="$define"
16936 fflushNULL="$undef"
16939 : check explicit looping only if NULL did not work, and if the pipe
16940 : bug does not show up on an explicit flush too
16941 case "$fflushNULL" in
16943 $cat >tryp.c <<EOCP
16946 main(int argc, char **argv)
16952 while ((i = getc(stdin)) != -1
16953 && (*bp++ = i) != '\n'
16954 && bp < &buf[1024])
16957 fprintf(stdout, "%s", buf);
16966 if eval $compile; then
16968 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
16969 if cmp tryp.c tryp.out >/dev/null 2>&1; then
16971 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
16973 : now check for fflushall behaviour
16974 case "$fflushall" in
16975 '') set try -DTRY_FFLUSH_ALL $output
16976 if eval $compile; then
16978 (Now testing the other method--but note that this also may fail.)
16980 $run ./try 2>/dev/null
16983 if $test -s try.out -a "X$code" = X42; then
16984 fflushall="`$cat try.out`"
16987 $rm -f core try.core core.try.*
16988 case "$fflushall" in
16990 Whew. Flushing explicitly all the stdio streams works.
16992 fflushall="$define"
16995 Sigh. Flushing explicitly all the stdio streams doesn't work.
17000 Cannot figure out whether flushing stdio streams explicitly works or not.
17001 I'm assuming it doesn't.
17007 "$define"|true|[yY]*)
17008 fflushall="$define"
17016 All is futile. Even fflush(stdin) clobbers input pipes!
17023 $rm -f core tryp.c tryp.core core.tryp.*
17025 *) fflushall="$undef"
17029 case "$fflushNULL$fflushall" in
17032 OK, I give up. I cannot figure out how to flush pending stdio output.
17033 We won't be flushing handles at all before fork/exec/popen.
17037 $rm -f try.* try$exe_ext
17039 : Store the full pathname to the ar program for use in the C program
17040 : Respect a hint or command line value for full_ar.
17045 : Store the full pathname to the sed program for use in the C program
17048 : see what type gids are declared as in the kernel
17050 echo "Looking for the type for group ids returned by getgid()."
17051 set gid_t gidtype xxx stdio.h sys/types.h
17055 xxx=`./findhdr sys/user.h`
17056 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
17058 unsigned) dflt="$1 $2" ;;
17062 *) dflt="$gidtype";;
17065 gid_t) echo "gid_t found." ;;
17066 *) rp="What is the type for group ids returned by getgid()?"
17074 *_t) zzz="$gidtype" ;;
17077 echo "Checking the size of $zzz..." >&4
17079 #include <sys/types.h>
17082 printf("%d\n", (int)sizeof($gidtype));
17087 if eval $compile_ok; then
17091 echo "(I can't execute the test program--guessing $gidsize.)" >&4
17094 echo "Your $zzz is $gidsize bytes long."
17099 echo "(I can't compile the test program--guessing $gidsize.)" >&4
17105 *_t) zzz="$gidtype" ;;
17108 echo "Checking the sign of $zzz..." >&4
17110 #include <sys/types.h>
17121 if eval $compile; then
17125 echo "(I can't execute the test program--guessing unsigned.)" >&4
17129 1) echo "Your $zzz is unsigned." ;;
17130 -1) echo "Your $zzz is signed." ;;
17136 echo "(I can't compile the test program--guessing unsigned.)" >&4
17142 if $test X"$quadtype" != X; then
17144 echo "Checking how to print 64-bit integers..." >&4
17146 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
17147 $cat >try.c <<'EOCP'
17148 #include <sys/types.h>
17151 int q = 12345678901;
17152 printf("%ld\n", q);
17156 if eval $compile; then
17160 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
17161 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
17162 echo "We will use %d."
17168 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
17169 $cat >try.c <<'EOCP'
17170 #include <sys/types.h>
17173 long q = 12345678901;
17174 printf("%ld\n", q);
17178 if eval $compile; then
17182 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
17183 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
17184 echo "We will use %ld."
17190 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
17191 $cat >try.c <<'EOCP'
17192 #include <sys/types.h>
17193 #include <inttypes.h>
17196 int64_t q = 12345678901;
17197 printf("%" PRId64 "\n", q);
17201 if eval $compile; then
17205 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
17206 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
17207 echo "We will use the C9X style."
17213 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17215 #include <sys/types.h>
17218 $quadtype q = 12345678901;
17219 printf("%Ld\n", q);
17223 if eval $compile; then
17227 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
17228 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
17229 echo "We will use %Ld."
17235 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
17236 $cat >try.c <<'EOCP'
17237 #include <sys/types.h>
17240 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
17241 printf("%lld\n", q);
17245 if eval $compile; then
17249 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
17250 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
17251 echo "We will use the %lld style."
17257 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17259 #include <sys/types.h>
17262 $quadtype q = 12345678901;
17263 printf("%qd\n", q);
17267 if eval $compile; then
17271 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
17272 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
17273 echo "We will use %qd."
17279 if $test X"$sPRId64" = X; then
17280 echo "Cannot figure out how to print 64-bit integers." >&4
17288 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
17289 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
17291 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
17292 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
17298 $echo "Checking the format strings to be used for Perl's internal types..." >&4
17300 if $test X"$ivsize" = X8; then
17301 ivdformat="$sPRId64"
17302 uvuformat="$sPRIu64"
17303 uvoformat="$sPRIo64"
17304 uvxformat="$sPRIx64"
17305 uvXUformat="$sPRIXU64"
17307 if $test X"$ivsize" = X"$longsize"; then
17314 if $test X"$ivsize" = X"$intsize"; then
17322 if $test X"$ivsize" = X"$shortsize"; then
17333 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
17334 nveformat="$sPRIeldbl"
17335 nvfformat="$sPRIfldbl"
17336 nvgformat="$sPRIgldbl"
17337 nvEUformat="$sPRIEUldbl"
17338 nvFUformat="$sPRIFUldbl"
17339 nvGUformat="$sPRIGUldbl"
17349 case "$ivdformat" in
17350 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
17357 $echo "Checking the format string to be used for gids..." >&4
17360 -1) if $test X"$gidsize" = X"$ivsize"; then
17361 gidformat="$ivdformat"
17363 if $test X"$gidsize" = X"$longsize"; then
17366 if $test X"$gidsize" = X"$intsize"; then
17369 if $test X"$gidsize" = X"$shortsize"; then
17376 *) if $test X"$gidsize" = X"$uvsize"; then
17377 gidformat="$uvuformat"
17379 if $test X"$gidsize" = X"$longsize"; then
17382 if $test X"$gidsize" = X"$intsize"; then
17385 if $test X"$gidsize" = X"$shortsize"; then
17394 : see if getgroups exists
17395 set getgroups d_getgrps
17398 : see if setgroups exists
17399 set setgroups d_setgrps
17403 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
17405 case "$d_getgrps$d_setgrps" in
17407 case "$groupstype" in
17408 '') dflt="$gidtype" ;;
17409 *) dflt="$groupstype" ;;
17412 What type of pointer is the second argument to getgroups() and setgroups()?
17413 Usually this is the same as group ids, $gidtype, but not always.
17416 rp='What type pointer is the second argument to getgroups() and setgroups()?'
17420 *) groupstype="$gidtype";;
17424 echo "Checking if your $make program sets \$(MAKE)..." >&4
17425 case "$make_set_make" in
17427 $sed 's/^X //' > testmake.mak << 'EOF'
17429 X @echo 'maketemp="$(MAKE)"'
17431 case "`$make -f testmake.mak 2>/dev/null`" in
17432 *maketemp=*) make_set_make='#' ;;
17433 *) make_set_make="MAKE=$make" ;;
17435 $rm -f testmake.mak
17438 case "$make_set_make" in
17439 '#') echo "Yup, it does.";;
17440 *) echo "Nope, it doesn't.";;
17443 : see what type is used for mode_t
17444 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
17445 set mode_t modetype int stdio.h sys/types.h
17448 : see if stdarg is available
17450 if $test `./findhdr stdarg.h`; then
17451 echo "<stdarg.h> found." >&4
17454 echo "<stdarg.h> NOT found." >&4
17458 : see if varags is available
17460 if $test `./findhdr varargs.h`; then
17461 echo "<varargs.h> found." >&4
17463 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
17466 : set up the varargs testing programs
17467 $cat > varargs.c <<EOP
17469 #include <stdarg.h>
17472 #include <varargs.h>
17476 int f(char *p, ...)
17490 p = va_arg(ap, char *);
17495 $cat > varargs <<EOP
17497 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
17506 : now check which varargs header should be included
17511 if `./varargs I_STDARG`; then
17513 elif `./varargs I_VARARGS`; then
17518 if `./varargs I_VARARGS`; then
17525 echo "I could not find the definition for va_dcl... You have problems..." >&4
17526 val="$undef"; set i_stdarg; eval $setvar
17527 val="$undef"; set i_varargs; eval $setvar
17532 case "$i_varhdr" in
17534 val="$define"; set i_stdarg; eval $setvar
17535 val="$undef"; set i_varargs; eval $setvar
17538 val="$undef"; set i_stdarg; eval $setvar
17539 val="$define"; set i_varargs; eval $setvar
17542 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
17546 : see if we need va_copy
17548 case "$i_stdarg" in
17551 #include <stdarg.h>
17553 #$i_stdlib I_STDLIB
17555 #include <stdlib.h>
17557 #include <signal.h>
17560 ivfprintf(FILE *f, const char *fmt, va_list *valp)
17562 return vfprintf(f, fmt, *valp);
17566 myvfprintf(FILE *f, const char *fmt, va_list val)
17568 return ivfprintf(f, fmt, &val);
17572 myprintf(char *fmt, ...)
17575 va_start(val, fmt);
17576 return myvfprintf(stdout, fmt, val);
17580 main(int ac, char **av)
17582 signal(SIGSEGV, exit);
17584 myprintf("%s%cs all right, then\n", "that", '\'');
17589 if eval $compile && $run ./try 2>&1 >/dev/null; then
17590 case "`$run ./try`" in
17591 "that's all right, then")
17597 yes) echo "It seems that you don't need va_copy()." >&4
17598 need_va_copy="$undef"
17600 *) echo "It seems that va_copy() or similar will be needed." >&4
17601 need_va_copy="$define"
17604 $rm -f try.* core core.* *.core *.core.*
17606 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
17610 : see what type is used for size_t
17611 rp="What is the type used for the length parameter for string functions?"
17612 set size_t sizetype 'unsigned int' stdio.h sys/types.h
17615 : check for type of arguments to gethostbyaddr.
17616 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
17617 case "$d_gethbyaddr" in
17621 Checking to see what type of arguments are accepted by gethostbyaddr().
17623 hdrs="$define sys/types.h
17624 $d_socket sys/socket.h
17625 $i_niin netinet/in.h
17627 $i_unistd unistd.h"
17628 : The first arg can 'char *' or 'void *'
17629 : The second arg is some of integral type
17630 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
17631 for yyy in size_t long int; do
17632 case "$netdb_host_type" in
17633 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
17634 if ./protochk "$try" $hdrs; then
17635 echo "Your system accepts $xxx for the first arg."
17636 echo "...and $yyy for the second arg."
17637 netdb_host_type="$xxx"
17638 netdb_hlen_type="$yyy"
17644 : In case none of those worked, prompt the user.
17645 case "$netdb_host_type" in
17646 '') rp='What is the type for the 1st argument to gethostbyaddr?'
17649 netdb_host_type=$ans
17650 rp='What is the type for the 2nd argument to gethostbyaddr?'
17653 netdb_hlen_type=$ans
17657 *) : no gethostbyaddr, so pick harmless defaults
17658 netdb_host_type='char *'
17659 netdb_hlen_type="$sizetype"
17662 # Remove the "const" if needed. -- but then we'll have a
17664 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
17667 : check for type of argument to gethostbyname.
17668 if test "X$netdb_name_type" = X ; then
17669 case "$d_gethbyname" in
17673 Checking to see what type of argument is accepted by gethostbyname().
17675 hdrs="$define sys/types.h
17676 $d_socket sys/socket.h
17677 $i_niin netinet/in.h
17679 $i_unistd unistd.h"
17680 for xxx in "const char *" "char *"; do
17681 case "$netdb_name_type" in
17682 '') try="extern struct hostent *gethostbyname($xxx);"
17683 if ./protochk "$try" $hdrs; then
17684 echo "Your system accepts $xxx."
17685 netdb_name_type="$xxx"
17690 : In case none of those worked, prompt the user.
17691 case "$netdb_name_type" in
17692 '') rp='What is the type for the 1st argument to gethostbyname?'
17695 netdb_name_type=$ans
17699 *) : no gethostbyname, so pick harmless default
17700 netdb_name_type='char *'
17705 : check for type of 1st argument to getnetbyaddr.
17706 if test "X$netdb_net_type" = X ; then
17707 case "$d_getnbyaddr" in
17711 Checking to see what type of 1st argument is accepted by getnetbyaddr().
17713 hdrs="$define sys/types.h
17714 $d_socket sys/socket.h
17715 $i_niin netinet/in.h
17717 $i_unistd unistd.h"
17718 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
17719 case "$netdb_net_type" in
17720 '') try="extern struct netent *getnetbyaddr($xxx, int);"
17721 if ./protochk "$try" $hdrs; then
17722 echo "Your system accepts $xxx."
17723 netdb_net_type="$xxx"
17728 : In case none of those worked, prompt the user.
17729 case "$netdb_net_type" in
17730 '') rp='What is the type for the 1st argument to getnetbyaddr?'
17733 netdb_net_type=$ans
17737 *) : no getnetbyaddr, so pick harmless default
17738 netdb_net_type='long'
17742 : locate the preferred pager for this system
17748 [a-zA-Z]:/*) dflt=$pg;;
17752 [a-zA-Z]:/*) dflt=$more;;
17756 [a-zA-Z]:/*) dflt=$less;;
17759 '') dflt=/usr/ucb/more;;
17766 rp='What pager is used on your system?'
17770 : see what type pids are declared as in the kernel
17771 rp="What is the type of process ids on this system?"
17772 set pid_t pidtype int stdio.h sys/types.h
17775 : Find earliest binary compatible site_perl subdirectory perl can use.
17776 case "$bincompat5005" in
17777 "$define") xs_apiversion='5.005' ;;
17778 *) xs_apiversion=$version ;; # The current site_perl version.
17780 : Find earliest pure perl site_perl subdirectory perl can use.
17781 : The versioned directories started at 5.005.
17782 pm_apiversion='5.005'
17784 : see if ar generates random libraries by itself
17786 echo "Checking how to generate random libraries on your machine..." >&4
17787 echo 'int bar1() { return bar2(); }' > bar1.c
17788 echo 'int bar2() { return 2; }' > bar2.c
17789 $cat > foo.c <<'EOP'
17790 int main() { printf("%d\n", bar1()); exit(0); }
17792 $cc $ccflags -c bar1.c >/dev/null 2>&1
17793 $cc $ccflags -c bar2.c >/dev/null 2>&1
17794 $cc $ccflags -c foo.c >/dev/null 2>&1
17795 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
17796 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
17797 $run ./foobar >/dev/null 2>&1; then
17798 echo "$ar appears to generate random libraries itself."
17801 elif $ar ts bar$_a >/dev/null 2>&1 &&
17802 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
17803 $run ./foobar >/dev/null 2>&1; then
17804 echo "a table of contents needs to be added with '$ar ts'."
17811 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
17812 $test -f $ranlib || ranlib=''
17815 if $test -n "$ranlib"; then
17816 echo "your system has '$ranlib'; we'll use that."
17819 echo "your system doesn't seem to support random libraries"
17820 echo "so we'll use lorder and tsort to order the libraries."
17827 : check for type of arguments to select.
17828 case "$selecttype" in
17829 '') case "$d_select" in
17833 Checking to see what type of arguments are accepted by select().
17835 hdrs="$define sys/types.h
17836 $i_systime sys/time.h
17837 $i_sysselct sys/select.h
17838 $d_socket sys/socket.h"
17839 : The first arg can be int, unsigned, or size_t
17840 : The last arg may or may not be 'const'
17842 : void pointer has been seen but using that
17843 : breaks the selectminbits test
17844 for xxx in 'fd_set *' 'int *'; do
17845 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
17846 for tmo in 'struct timeval *' 'const struct timeval *'; do
17848 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
17849 if ./protochk "$try" $hdrs; then
17850 echo "Your system accepts $xxx."
17859 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
17860 case "$d_fd_set" in
17861 $define) dflt="fd_set *" ;;
17870 *) : no select, so pick a harmless default
17877 : check for the select 'width'
17878 case "$selectminbits" in
17879 '') case "$d_select" in
17883 Checking to see on how many bits at a time your select() operates...
17886 #include <sys/types.h>
17888 #$i_systime I_SYS_TIME
17889 #$i_systimek I_SYS_TIME_KERNEL
17894 # ifdef I_SYS_TIME_KERNEL
17897 # include <sys/time.h>
17898 # ifdef I_SYS_TIME_KERNEL
17902 #$i_sysselct I_SYS_SELECT
17903 #ifdef I_SYS_SELECT
17904 #include <sys/select.h>
17906 #$d_socket HAS_SOCKET
17908 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
17912 #define S sizeof(*(b))
17914 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
17915 #define NBITS (NBYTES * 8)
17924 fp = fopen("try.c", "r");
17930 b = ($selecttype)s;
17931 for (i = 0; i < NBITS; i++)
17935 select(fd + 1, b, 0, 0, &t);
17936 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
17937 printf("%d\n", i + 1);
17942 if eval $compile_ok; then
17943 selectminbits=`$run ./try`
17944 case "$selectminbits" in
17946 Cannot figure out on how many bits at a time your select() operates.
17947 I'll play safe and guess it is 32 bits.
17953 *) bits="$selectminbits bits" ;;
17955 echo "Your select() operates on $bits at a time." >&4
17957 rp='What is the minimum number of bits your select() operates on?'
17958 case "$byteorder" in
17959 1234|12345678) dflt=32 ;;
17964 selectminbits="$val"
17968 *) : no select, so pick a harmless default
17975 : Trace out the files included by signal.h, then look for SIGxxx names.
17976 : Remove SIGARRAYSIZE used by HPUX.
17977 : Remove SIGSTKSIZE used by Linux.
17978 : Remove SIGSTKSZ used by Posix.
17979 : Remove SIGTYP void lines used by OS2.
17980 : Some cpps, like os390, dont give the file name anywhere
17981 if [ "X$fieldn" = X ]; then
17982 : Just make some guesses. We check them later.
17983 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
17985 xxx=`echo '#include <signal.h>' |
17986 $cppstdin $cppminus $cppflags 2>/dev/null |
17987 $grep '^[ ]*#.*include' |
17988 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
17990 : Check this list of files to be sure we have parsed the cpp output ok.
17991 : This will also avoid potentially non-existent files, such
17994 for xx in $xxx /dev/null ; do
17995 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
17997 : If we have found no files, at least try signal.h
17998 case "$xxxfiles" in
17999 '') xxxfiles=`./findhdr signal.h` ;;
18002 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
18003 print substr($2, 4, 20)
18005 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
18006 print substr($3, 4, 20)
18008 : Append some common names just in case the awk scan failed.
18009 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
18010 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
18011 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
18012 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
18013 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
18015 : generate a few handy files for later
18016 $cat > signal.c <<'EOCP'
18017 #include <sys/types.h>
18018 #include <signal.h>
18022 /* Strange style to avoid deeply-nested #if/#else/#endif */
18025 # define NSIG (_NSIG)
18031 # define NSIG (SIGMAX+1)
18037 # define NSIG (SIG_MAX+1)
18043 # define NSIG (MAXSIG+1)
18049 # define NSIG (MAX_SIG+1)
18054 # ifdef SIGARRAYSIZE
18055 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
18061 # define NSIG (_sys_nsig) /* Solaris 2.5 */
18065 /* Default to some arbitrary number that's big enough to get most
18066 of the common signals.
18072 printf("NSIG %d\n", NSIG);
18078 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
18080 printf "#ifdef SIG"; printf $1; printf "\n"
18081 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
18082 printf $1; printf ");\n"
18086 printf "#endif /* JUST_NSIG */\n";
18087 printf "exit(0);\n}\n";
18090 $cat >signal.awk <<'EOP'
18091 BEGIN { ndups = 0 }
18092 $1 ~ /^NSIG$/ { nsig = $2 }
18093 ($1 !~ /^NSIG$/) && (NF == 2) {
18094 if ($2 > maxsig) { maxsig = $2 }
18095 if (sig_name[$2]) {
18096 dup_name[ndups] = $1
18097 dup_num[ndups] = $2
18109 printf("NSIG %d\n", nsig);
18110 for (n = 1; n < nsig; n++) {
18112 printf("%s %d\n", sig_name[n], sig_num[n])
18115 printf("NUM%d %d\n", n, n)
18118 for (n = 0; n < ndups; n++) {
18119 printf("%s %d\n", dup_name[n], dup_num[n])
18123 $cat >signal_cmd <<EOS
18125 if $test -s signal.lst; then
18126 echo "Using your existing signal.lst file"
18131 $cat >>signal_cmd <<'EOS'
18134 if eval $compile_ok; then
18135 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
18137 echo "(I can't seem be able to compile the whole test program)" >&4
18138 echo "(I'll try it in little pieces.)" >&4
18139 set signal -DJUST_NSIG
18140 if eval $compile_ok; then
18141 $run ./signal$_exe > signal.nsg
18144 echo "I can't seem to figure out how many signals you have." >&4
18145 echo "Guessing 50." >&4
18146 echo 'NSIG 50' > signal.nsg
18148 : Now look at all the signal names, one at a time.
18149 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
18150 $cat > signal.c <<EOCP
18151 #include <sys/types.h>
18152 #include <signal.h>
18155 printf("$xx %d\n", SIG${xx});
18160 if eval $compile; then
18161 echo "SIG${xx} found."
18162 $run ./signal$_exe >> signal.ls1
18164 echo "SIG${xx} NOT found."
18167 if $test -s signal.ls1; then
18168 $cat signal.nsg signal.ls1 |
18169 $sort -n | $uniq | $awk -f signal.awk >signal.lst
18173 if $test -s signal.lst; then
18176 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
18177 echo 'kill -l' >signal
18178 set X `csh -f <signal`
18182 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
18184 echo $@ | $tr ' ' $trnl | \
18185 $awk '{ printf "%s %d\n", $1, ++s; }
18186 END { printf "NSIG %d\n", ++s }' >signal.lst
18188 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
18190 chmod a+x signal_cmd
18191 $eunicefix signal_cmd
18193 : generate list of signal names
18195 case "$sig_name_init" in
18197 *) case "$sig_num_init" in
18198 ''|*,*) doinit=yes ;;
18203 echo "Generating a list of signal names and numbers..." >&4
18205 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
18206 sig_name=`$awk 'BEGIN { printf "ZERO " }
18207 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
18208 sig_num=`$awk 'BEGIN { printf "0 " }
18209 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
18210 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
18211 !/^NSIG/ { printf "\"%s\", ", $1 }
18212 END { printf "0\n" }' signal.lst`
18213 sig_num_init=`$awk 'BEGIN { printf "0, " }
18214 !/^NSIG/ { printf "%d, ", $2}
18215 END { printf "0\n"}' signal.lst`
18218 echo "The following $sig_count signals are available:"
18220 echo $sig_name | $awk \
18221 'BEGIN { linelen = 0 }
18223 for (i = 1; i <= NF; i++) {
18224 name = "SIG" $i " "
18225 linelen = linelen + length(name)
18226 if (linelen > 70) {
18228 linelen = length(name)
18234 sig_size=`echo $sig_name | awk '{print NF}'`
18235 $rm -f signal signal.c signal.awk signal.lst signal_cmd
18238 case "$sizetype" in
18239 *_t) zzz="$sizetype" ;;
18240 *) zzz="filesize" ;;
18242 echo "Checking the size of $zzz..." >&4
18244 #include <sys/types.h>
18247 printf("%d\n", (int)sizeof($sizetype));
18252 if eval $compile_ok; then
18256 echo "(I can't execute the test program--guessing $sizesize.)" >&4
18259 echo "Your $zzz size is $sizesize bytes."
18264 echo "(I can't compile the test program--guessing $sizesize.)" >&4
18268 : check for socklen_t
18270 echo "Checking to see if you have socklen_t..." >&4
18272 #include <sys/types.h>
18273 #$d_socket HAS_SOCKET
18275 #include <sys/socket.h>
18277 int main() { socklen_t x = 16; }
18280 if eval $compile; then
18282 echo "You have socklen_t."
18285 echo "You do not have socklen_t."
18286 case "$sizetype" in
18287 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
18294 : see if this is a socks.h system
18295 set socks.h i_socks
18298 : check for type of the size argument to socket calls
18299 case "$d_socket" in
18303 Checking to see what type is the last argument of accept().
18306 case "$d_socklen_t" in
18307 "$define") yyy="$yyy socklen_t"
18309 yyy="$yyy $sizetype int long unsigned"
18310 for xxx in $yyy; do
18311 case "$socksizetype" in
18312 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
18313 case "$usesocks" in
18315 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
18316 echo "Your system accepts '$xxx *' for the last argument of accept()."
18317 socksizetype="$xxx"
18320 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
18321 echo "Your system accepts '$xxx *' for the last argument of accept()."
18322 socksizetype="$xxx"
18329 : In case none of those worked, prompt the user.
18330 case "$socksizetype" in
18331 '') rp='What is the type for socket address structure sizes?'
18338 *) : no sockets, so pick relatively harmless default
18343 : see what type is used for signed size_t
18344 set ssize_t ssizetype int stdio.h sys/types.h
18349 #include <sys/types.h>
18350 #define Size_t $sizetype
18351 #define SSize_t $dflt
18354 if (sizeof(Size_t) == sizeof(SSize_t))
18356 else if (sizeof(Size_t) == sizeof(int))
18365 if eval $compile_ok && $run ./try > /dev/null; then
18366 ssizetype=`$run ./try`
18367 echo "I'll be using $ssizetype for functions returning a byte count." >&4
18370 Help! I can't compile and run the ssize_t test program: please enlighten me!
18371 (This is probably a misconfiguration in your system or libraries, and
18372 you really ought to fix it. Still, I'll try anyway.)
18374 I need a type that is the same size as $sizetype, but is guaranteed to
18375 be signed. Common values are ssize_t, int and long.
18378 rp="What signed type is the same size as $sizetype?"
18384 : see what type of char stdio uses.
18386 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
18387 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
18388 echo "Your stdio uses unsigned chars." >&4
18389 stdchar="unsigned char"
18391 echo "Your stdio uses signed chars." >&4
18398 : see if time exists
18400 if test "X$d_time" = X -o X"$timetype" = X; then
18401 if set time val -f d_time; eval $csym; $val; then
18402 echo 'time() found.' >&4
18404 rp="What is the type returned by time() on this system?"
18405 set time_t timetype long stdio.h sys/types.h
18408 echo 'time() not found, hope that will do.' >&4
18416 : see what type uids are declared as in the kernel
18418 echo "Looking for the type for user ids returned by getuid()."
18419 set uid_t uidtype xxx stdio.h sys/types.h
18423 xxx=`./findhdr sys/user.h`
18424 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18426 unsigned) dflt="$1 $2" ;;
18430 *) dflt="$uidtype";;
18433 uid_t) echo "uid_t found." ;;
18434 *) rp="What is the type for user ids returned by getuid()?"
18442 *_t) zzz="$uidtype" ;;
18445 echo "Checking the size of $zzz..." >&4
18447 #include <sys/types.h>
18450 printf("%d\n", (int)sizeof($uidtype));
18455 if eval $compile_ok; then
18459 echo "(I can't execute the test program--guessing $uidsize.)" >&4
18462 echo "Your $zzz is $uidsize bytes long."
18467 echo "(I can't compile the test program--guessing $uidsize.)" >&4
18472 *_t) zzz="$uidtype" ;;
18475 echo "Checking the sign of $zzz..." >&4
18477 #include <sys/types.h>
18488 if eval $compile; then
18492 echo "(I can't execute the test program--guessing unsigned.)" >&4
18496 1) echo "Your $zzz is unsigned." ;;
18497 -1) echo "Your $zzz is signed." ;;
18503 echo "(I can't compile the test program--guessing unsigned.)" >&4
18509 $echo "Checking the format string to be used for uids..." >&4
18512 -1) if $test X"$uidsize" = X"$ivsize"; then
18513 uidformat="$ivdformat"
18515 if $test X"$uidsize" = X"$longsize"; then
18518 if $test X"$uidsize" = X"$intsize"; then
18521 if $test X"$uidsize" = X"$shortsize"; then
18528 *) if $test X"$uidsize" = X"$uvsize"; then
18529 uidformat="$uvuformat"
18531 if $test X"$uidsize" = X"$longsize"; then
18534 if $test X"$uidsize" = X"$intsize"; then
18537 if $test X"$uidsize" = X"$shortsize"; then
18546 : determine compiler compiler
18555 if $test -f "$byacc$_exe"; then
18557 comp="byacc or $comp"
18559 if $test -f "$bison$_exe"; then
18560 comp="$comp or bison -y"
18562 rp="Which compiler compiler ($comp) shall I use?"
18571 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
18577 : see if this is a fp.h system
18581 : see if this is a fp_class.h system
18582 set fp_class.h i_fp_class
18585 : see if this is a ieeefp.h system
18586 case "$i_ieeefp" in
18587 '' ) set ieeefp.h i_ieeefp
18592 : see if this is a libutil.h system
18593 set libutil.h i_libutil
18596 : see if mach cthreads are available
18597 if test "X$usethreads" = "X$define"; then
18598 set mach/cthreads.h i_machcthr
18601 i_machcthr="$undef"
18606 : see if this is a math.h system
18610 : see if this is a mntent.h system
18611 set mntent.h i_mntent
18614 : see if ndbm.h is available
18620 # Some Linux distributions such as RedHat 7.1 put the
18621 # ndbm.h header in /usr/include/gdbm/ndbm.h.
18622 if $test -f /usr/include/gdbm/ndbm.h; then
18623 echo '<gdbm/ndbm.h> found.'
18624 ccflags="$ccflags -I/usr/include/gdbm"
18625 cppflags="$cppflags -I/usr/include/gdbm"
18633 : see if dbm_open exists
18634 set dbm_open d_dbm_open
18636 case "$d_dbm_open" in
18639 echo "We won't be including <ndbm.h>"
18648 : see if net/errno.h is available
18650 set net/errno.h val
18653 : Unfortunately, it causes problems on some systems. Arrgh.
18656 cat > try.c <<'EOM'
18659 #include <net/errno.h>
18665 if $cc $ccflags -c try.c >/dev/null 2>&1; then
18666 echo "We'll be including <net/errno.h>." >&4
18668 echo "We won't be including <net/errno.h>." >&4
18677 : see if netinet/tcp.h is available
18678 set netinet/tcp.h i_netinettcp
18681 : see if this is a poll.h system
18685 : see if this is a prot.h system
18690 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
18691 $cat <<'EOSH' > Cppsym.know
18692 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
18693 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
18694 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
18695 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
18696 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
18697 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
18698 bull c cadmus clipper CMU COFF COMPILER_VERSION
18699 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
18700 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
18701 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
18702 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
18704 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
18705 H3050R H3050RX hbullx20 hcx host_mips
18706 hp200 hp300 hp700 HP700 hp800 hp9000
18707 hp9000s200 hp9000s300 hp9000s400 hp9000s500
18708 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
18709 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
18710 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
18711 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
18712 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
18713 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
18714 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
18715 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
18716 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
18717 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
18718 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
18719 MATH_HAS_NO_SIDE_EFFECTS
18720 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
18721 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
18722 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
18723 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
18724 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
18725 NetBSD news1500 news1700 news1800 news1900 news3700
18726 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
18727 ns32016 ns32332 ns32k nsc32000
18728 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
18729 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
18730 pc532 pdp11 PGC PIC plexus PORTAR posix
18731 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
18732 POSIX_C_SOURCE POSIX_SOURCE POWER
18733 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
18734 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
18735 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
18736 sony sony_news sonyrisc sparc sparclite spectrum
18737 stardent stdc STDC_EXT stratos sun sun3 sun386
18738 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
18739 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
18740 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
18741 sysV68 sysV88 Tek4132 Tek4300 titan
18742 TM3200 TM5400 TM5600
18743 tower tower32 tower32_200 tower32_600 tower32_700
18744 tower32_800 tower32_850 tss
18745 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
18746 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
18747 unix UNIX95 UNIX99 unixpc unos
18748 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
18749 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
18750 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
18752 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
18753 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
18754 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
18757 # Maybe put other stuff here too.
18758 cat <<EOSH >>Cppsym.know
18761 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
18762 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
18763 $cat Cppsym.know > Cppsym.c
18764 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
18765 $rm -f Cppsym.a Cppsym.b Cppsym.c
18766 cat <<EOSH > Cppsym
18768 if $test \$# -gt 0; then
18769 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
18770 if $test -s Cppsym.got; then
18777 $tr " " "$trnl" | ./Cppsym.try
18783 cat <<EOSH > Cppsym.try
18785 cat <<'EOCP' > try.c
18791 cat <<'EOSH' >> Cppsym.try
18793 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
18794 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
18795 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
18796 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
18798 echo 'return 0;}' >> try.c
18800 cat <<EOSH >> Cppsym.try
18802 case "$osname-$gccversion" in
18803 irix-) ccflags="\$ccflags -woff 1178" ;;
18804 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
18806 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
18808 chmod +x Cppsym.try
18809 $eunicefix Cppsym.try
18810 ./Cppsym < Cppsym.know > Cppsym.true
18811 : now check the C compiler for additional symbols
18812 postprocess_cc_v=''
18814 aix) postprocess_cc_v="|$tr , ' '" ;;
18821 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
18824 -D*) echo "\$i" | $sed 's/^-D//';;
18825 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A\(.*\)(\(.*\))/\1=\2/';;
18830 postprocess_cc_v=''
18833 ./ccsym > ccsym1.raw
18834 if $test -s ccsym1.raw; then
18835 $sort ccsym1.raw | $uniq >ccsym.raw
18837 mv ccsym1.raw ccsym.raw
18840 $awk '/\=/ { print $0; next }
18841 { print $0"=1" }' ccsym.raw >ccsym.list
18842 $awk '/\=/ { print $0; next }
18843 { print $0"=1" }' Cppsym.true >ccsym.true
18844 $comm -13 ccsym.true ccsym.list >ccsym.own
18845 $comm -12 ccsym.true ccsym.list >ccsym.com
18846 $comm -23 ccsym.true ccsym.list >ccsym.cpp
18848 if $test -z ccsym.raw; then
18849 echo "Your C compiler doesn't seem to define any symbols!" >&4
18851 echo "However, your C preprocessor defines the following symbols:"
18854 cppsymbols=`$cat Cppsym.true`
18855 cppsymbols=`echo $cppsymbols`
18856 cppccsymbols="$cppsymbols"
18858 if $test -s ccsym.com; then
18859 echo "Your C compiler and pre-processor define these symbols:"
18860 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
18863 cppccsymbols=`$cat ccsym.com`
18864 cppccsymbols=`echo $cppccsymbols`
18865 $test "$silent" || sleep 1
18867 if $test -s ccsym.cpp; then
18868 $test "$also" && echo " "
18869 echo "Your C pre-processor ${also}defines the following symbols:"
18870 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
18872 cppsymbols=`$cat ccsym.cpp`
18873 cppsymbols=`echo $cppsymbols`
18874 $test "$silent" || sleep 1
18876 if $test -s ccsym.own; then
18877 $test "$also" && echo " "
18878 echo "Your C compiler ${also}defines the following cpp symbols:"
18879 $sed -e 's/\(..*\)=1/\1/' ccsym.own
18880 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
18881 ccsymbols=`$cat ccsym.own`
18882 ccsymbols=`echo $ccsymbols`
18883 $test "$silent" || sleep 1
18887 : see if this is a termio system
18891 if $test `./findhdr termios.h`; then
18892 set tcsetattr i_termios
18898 "$define") echo "You have POSIX termios.h... good!" >&4;;
18899 *) if ./Cppsym pyr; then
18900 case "`/bin/universe`" in
18901 ucb) if $test `./findhdr sgtty.h`; then
18903 echo "<sgtty.h> found." >&4
18905 echo "System is pyramid with BSD universe."
18906 echo "<sgtty.h> not found--you could have problems." >&4
18908 *) if $test `./findhdr termio.h`; then
18910 echo "<termio.h> found." >&4
18912 echo "System is pyramid with USG universe."
18913 echo "<termio.h> not found--you could have problems." >&4
18917 if $test `./findhdr termio.h`; then
18918 echo "<termio.h> found." >&4
18920 elif $test `./findhdr sgtty.h`; then
18921 echo "<sgtty.h> found." >&4
18924 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
18927 if $test `./findhdr sgtty.h`; then
18928 echo "<sgtty.h> found." >&4
18930 elif $test `./findhdr termio.h`; then
18931 echo "<termio.h> found." >&4
18934 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
18938 set i_termio; eval $setvar
18939 val=$val2; set i_sgtty; eval $setvar
18940 val=$val3; set i_termios; eval $setvar
18942 : see if stddef is available
18943 set stddef.h i_stddef
18946 : see if this is a sunmath.h system
18947 set sunmath.h i_sunmath
18950 : see if sys/access.h is available
18951 set sys/access.h i_sysaccess
18954 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
18955 set sys/filio.h i_sysfilio
18958 if $test `./findhdr sys/ioctl.h`; then
18960 echo '<sys/ioctl.h> found.' >&4
18963 if $test $i_sysfilio = "$define"; then
18964 echo '<sys/ioctl.h> NOT found.' >&4
18966 $test $i_sgtty = "$define" && xxx="sgtty.h"
18967 $test $i_termio = "$define" && xxx="termio.h"
18968 $test $i_termios = "$define" && xxx="termios.h"
18969 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
18975 : see if socket ioctl defs are in sys/sockio.h
18977 xxx=`./findhdr sys/sockio.h`
18978 if $test "$xxx"; then
18979 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
18981 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
18984 echo "No socket ioctls found in <sys/sockio.h>." >&4
18989 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
18996 : see if this is a syslog.h system
18997 set syslog.h i_syslog
19001 : see if this is a sys/mode.h system
19002 set sys/mode.h i_sysmode
19005 : see if sys/resource.h has to be included
19006 set sys/resource.h i_sysresrc
19009 : see if sys/security.h is available
19010 set sys/security.h i_syssecrt
19013 : see if this is a sys/statvfs.h system
19014 set sys/statvfs.h i_sysstatvfs
19017 : see if this is a sys/un.h system
19018 set sys/un.h i_sysun
19022 : see if this is a sys/utsname.h system
19023 set sys/utsname.h i_sysutsname
19026 : see if this is a syswait system
19027 set sys/wait.h i_syswait
19030 : see if this is a ustat.h system
19031 set ustat.h i_ustat
19034 : see if this is an utime system
19035 set utime.h i_utime
19038 : see if this is a values.h system
19039 set values.h i_values
19042 : see if this is a vfork system
19045 set vfork.h i_vfork
19053 : see if gdbm.h is available
19058 : see if gdbm_open exists
19059 set gdbm_open d_gdbm_open
19061 case "$d_gdbm_open" in
19064 echo "We won't be including <gdbm.h>"
19074 echo "Looking for extensions..." >&4
19075 : If we are using the old config.sh, known_extensions may contain
19076 : old or inaccurate or duplicate values.
19077 known_extensions=''
19078 nonxs_extensions=''
19079 : We do not use find because it might not be available.
19080 : We do not just use MANIFEST because the user may have dropped
19081 : some additional extensions into the source tree and expect them
19084 : Function to recursively find available extensions, ignoring DynaLoader
19085 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
19089 DynaLoader|dynaload) ;;
19091 if $test -f $xxx/$xxx.xs; then
19092 known_extensions="$known_extensions $1$xxx";
19093 elif $test -f $xxx/Makefile.PL; then
19094 nonxs_extensions="$nonxs_extensions $1$xxx";
19096 if $test -d $xxx -a $# -lt 10; then
19099 eval $find_extensions;
19111 eval $find_extensions
19112 # Special case: Add in threads/shared since it is not picked up by the
19113 # recursive find above (and adding in general recursive finding breaks
19114 # SDBM_File/sdbm). A.D. 10/25/2001.
19115 # Encode::XX need explicit mentions for the same reason.
19117 known_extensions="$known_extensions threads/shared Encode/CN Encode/JP Encode/KR Encode/TW"
19118 set X $nonxs_extensions
19120 nonxs_extensions="$*"
19121 set X $known_extensions
19123 known_extensions="$*"
19126 : Now see which are supported on this system.
19128 for xxx in $known_extensions ; do
19132 $define) avail_ext="$avail_ext $xxx" ;;
19135 GDBM_File|gdbm_fil)
19137 $define) avail_ext="$avail_ext $xxx" ;;
19140 I18N/Langinfo|i18n_lan)
19141 case "$i_langinfo$d_nl_langinfo" in
19142 $define$define) avail_ext="$avail_ext $xxx" ;;
19145 NDBM_File|ndbm_fil)
19148 case "$osname-$use64bitint" in
19149 cygwin-*|hpux-define)
19151 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
19154 *) avail_ext="$avail_ext $xxx" ;;
19159 ODBM_File|odbm_fil)
19160 case "${i_dbm}${i_rpcsvcdbm}" in
19162 case "$osname-$use64bitint" in
19163 cygwin-*|hpux-define)
19165 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
19168 *) avail_ext="$avail_ext $xxx" ;;
19174 case "$useposix" in
19175 true|define|y) avail_ext="$avail_ext $xxx" ;;
19179 case "$useopcode" in
19180 true|define|y) avail_ext="$avail_ext $xxx" ;;
19184 case "$d_socket" in
19187 beos) ;; # not unless BONE
19188 *) avail_ext="$avail_ext $xxx" ;;
19193 Sys/Syslog|sys/syslog)
19194 : XXX syslog requires socket
19195 case "$d_socket" in
19196 true|$define|y) avail_ext="$avail_ext $xxx" ;;
19200 case "$usethreads" in
19202 case "$useithreads" in
19203 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
19207 threads|threads/shared)
19208 case "$usethreads" in
19210 case "$useithreads" in
19211 $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
19216 : XXX Do we need a useipcsysv variable here
19217 case "${d_msg}${d_sem}${d_shm}" in
19218 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
19221 *) avail_ext="$avail_ext $xxx"
19230 : Now see which nonxs extensions are supported on this system.
19231 : For now assume all are.
19233 for xxx in $nonxs_extensions ; do
19235 *) nonxs_ext="$nonxs_ext $xxx"
19247 A number of extensions are supplied with $package. You may choose to
19248 compile these extensions for dynamic loading (the default), compile
19249 them into the $package executable (static loading), or not include
19250 them at all. Answer "none" to include no extensions.
19251 Note that DynaLoader is always built and need not be mentioned here.
19254 case "$dynamic_ext" in
19255 '') dflt="$avail_ext" ;;
19256 *) dflt="$dynamic_ext"
19257 # Perhaps we are reusing an old out-of-date config.sh.
19260 if test X"$dynamic_ext" != X"$avail_ext"; then
19262 NOTICE: Your previous config.sh list may be incorrect.
19263 The extensions now available to you are
19265 but the default list from your previous config.sh is
19277 rp="What extensions do you wish to load dynamically?"
19280 none) dynamic_ext=' ' ;;
19281 *) dynamic_ext="$ans" ;;
19284 case "$static_ext" in
19286 : Exclude those already listed in dynamic linking
19288 for xxx in $avail_ext; do
19289 case " $dynamic_ext " in
19291 *) dflt="$dflt $xxx" ;;
19298 *) dflt="$static_ext"
19305 rp="What extensions do you wish to load statically?"
19308 none) static_ext=' ' ;;
19309 *) static_ext="$ans" ;;
19314 A number of extensions are supplied with $package. Answer "none"
19315 to include no extensions.
19316 Note that DynaLoader is always built and need not be mentioned here.
19319 case "$static_ext" in
19320 '') dflt="$avail_ext" ;;
19321 *) dflt="$static_ext"
19322 # Perhaps we are reusing an old out-of-date config.sh.
19325 if test X"$static_ext" != X"$avail_ext"; then
19327 NOTICE: Your previous config.sh list may be incorrect.
19328 The extensions now available to you are
19330 but the default list from your previous config.sh is
19339 : Exclude those that are not xs extensions
19343 rp="What extensions do you wish to include?"
19346 none) static_ext=' ' ;;
19347 *) static_ext="$ans" ;;
19352 set X $dynamic_ext $static_ext $nonxs_ext
19356 : Remove libraries needed only for extensions
19357 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
19358 : The exception is SunOS 4.x, which needs them.
19359 case "${osname}X${osvers}" in
19363 *) case "$usedl" in
19364 $define|true|[yY]*)
19365 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
19369 *) perllibs="$libs"
19375 : Remove build directory name from cppstdin so it can be used from
19376 : either the present location or the final installed location.
19378 : Get out of the UU directory to get correct path name.
19380 case "$cppstdin" in
19382 echo "Stripping down cppstdin path name"
19388 : end of configuration questions
19390 echo "End of configuration questions."
19393 : back to where it started
19394 if test -d ../UU; then
19398 : configuration may be patched via a 'config.arch' file
19399 if $test -f config.arch; then
19400 echo "I see a config.arch file, loading it."
19404 : configuration may be patched via a 'config.over' file
19405 if $test -f config.over; then
19408 rp='I see a config.over file. Do you wish to load it?'
19411 n*) echo "OK, I'll ignore it.";;
19413 echo "Configuration override changes have been loaded."
19418 : in case they want portability, strip down executable paths
19419 case "$d_portable" in
19422 echo "Stripping down executable paths..." >&4
19423 for file in $loclist $trylist; do
19425 eval $file=`basename $temp`
19430 : create config.sh file
19432 echo "Creating config.sh..." >&4
19433 $spitshell <<EOT >config.sh
19436 # This file was produced by running the Configure script. It holds all the
19437 # definitions figured out by Configure. Should you modify one of these values,
19438 # do not forget to propagate your changes by running "Configure -der". You may
19439 # instead choose to run each of the .SH files by yourself, or "Configure -S".
19442 # Package name : $package
19443 # Source directory : $src
19444 # Configuration time: $cf_time
19445 # Configured by : $cf_by
19446 # Target system : $myuname
19456 Revision='$Revision'
19464 alignbytes='$alignbytes'
19465 ansi2knr='$ansi2knr'
19466 aphostname='$aphostname'
19467 api_revision='$api_revision'
19468 api_subversion='$api_subversion'
19469 api_version='$api_version'
19470 api_versionstring='$api_versionstring'
19473 archlibexp='$archlibexp'
19474 archname64='$archname64'
19475 archname='$archname'
19476 archobjs='$archobjs'
19477 asctime_r_proto='$asctime_r_proto'
19482 bincompat5005='$bincompat5005'
19486 byteorder='$byteorder'
19488 castflags='$castflags'
19491 cccdlflags='$cccdlflags'
19492 ccdlflags='$ccdlflags'
19494 ccflags_uselargefiles='$ccflags_uselargefiles'
19496 ccsymbols='$ccsymbols'
19497 ccversion='$ccversion'
19499 cf_email='$cf_email'
19501 charsize='$charsize'
19505 clocktype='$clocktype'
19507 compress='$compress'
19508 contains='$contains'
19512 cpp_stuff='$cpp_stuff'
19513 cppccsymbols='$cppccsymbols'
19514 cppflags='$cppflags'
19516 cppminus='$cppminus'
19518 cppstdin='$cppstdin'
19519 cppsymbols='$cppsymbols'
19520 crypt_r_proto='$crypt_r_proto'
19521 cryptlib='$cryptlib'
19523 ctermid_r_proto='$ctermid_r_proto'
19524 ctime_r_proto='$ctime_r_proto'
19525 d_Gconvert='$d_Gconvert'
19526 d_PRIEUldbl='$d_PRIEUldbl'
19527 d_PRIFUldbl='$d_PRIFUldbl'
19528 d_PRIGUldbl='$d_PRIGUldbl'
19529 d_PRIXU64='$d_PRIXU64'
19530 d_PRId64='$d_PRId64'
19531 d_PRIeldbl='$d_PRIeldbl'
19532 d_PRIfldbl='$d_PRIfldbl'
19533 d_PRIgldbl='$d_PRIgldbl'
19534 d_PRIi64='$d_PRIi64'
19535 d_PRIo64='$d_PRIo64'
19536 d_PRIu64='$d_PRIu64'
19537 d_PRIx64='$d_PRIx64'
19538 d_SCNfldbl='$d_SCNfldbl'
19539 d__fwalk='$d__fwalk'
19540 d_access='$d_access'
19541 d_accessx='$d_accessx'
19543 d_archlib='$d_archlib'
19544 d_asctime_r='$d_asctime_r'
19547 d_attribut='$d_attribut'
19550 d_bincompat5005='$d_bincompat5005'
19552 d_bsdgetpgrp='$d_bsdgetpgrp'
19553 d_bsdsetpgrp='$d_bsdsetpgrp'
19555 d_casti32='$d_casti32'
19556 d_castneg='$d_castneg'
19557 d_charvspr='$d_charvspr'
19559 d_chroot='$d_chroot'
19560 d_chsize='$d_chsize'
19562 d_closedir='$d_closedir'
19563 d_cmsghdr_s='$d_cmsghdr_s'
19566 d_crypt_r='$d_crypt_r'
19568 d_ctermid_r='$d_ctermid_r'
19569 d_ctime_r='$d_ctime_r'
19570 d_cuserid='$d_cuserid'
19571 d_dbl_dig='$d_dbl_dig'
19572 d_dbminitproto='$d_dbminitproto'
19573 d_difftime='$d_difftime'
19575 d_dirnamlen='$d_dirnamlen'
19576 d_dlerror='$d_dlerror'
19577 d_dlopen='$d_dlopen'
19578 d_dlsymun='$d_dlsymun'
19579 d_dosuid='$d_dosuid'
19580 d_drand48_r='$d_drand48_r'
19581 d_drand48proto='$d_drand48proto'
19583 d_eaccess='$d_eaccess'
19584 d_endgrent='$d_endgrent'
19585 d_endgrent_r='$d_endgrent_r'
19586 d_endhent='$d_endhent'
19587 d_endhostent_r='$d_endhostent_r'
19588 d_endnent='$d_endnent'
19589 d_endnetent_r='$d_endnetent_r'
19590 d_endpent='$d_endpent'
19591 d_endprotoent_r='$d_endprotoent_r'
19592 d_endpwent='$d_endpwent'
19593 d_endpwent_r='$d_endpwent_r'
19594 d_endsent='$d_endsent'
19595 d_endservent_r='$d_endservent_r'
19596 d_eofnblk='$d_eofnblk'
19597 d_eunice='$d_eunice'
19598 d_fchdir='$d_fchdir'
19599 d_fchmod='$d_fchmod'
19600 d_fchown='$d_fchown'
19602 d_fcntl_can_lock='$d_fcntl_can_lock'
19603 d_fd_macros='$d_fd_macros'
19604 d_fd_set='$d_fd_set'
19605 d_fds_bits='$d_fds_bits'
19606 d_fgetpos='$d_fgetpos'
19607 d_finite='$d_finite'
19608 d_finitel='$d_finitel'
19609 d_flexfnam='$d_flexfnam'
19611 d_flockproto='$d_flockproto'
19613 d_fp_class='$d_fp_class'
19614 d_fpathconf='$d_fpathconf'
19615 d_fpclass='$d_fpclass'
19616 d_fpclassify='$d_fpclassify'
19617 d_fpclassl='$d_fpclassl'
19618 d_fpos64_t='$d_fpos64_t'
19619 d_frexpl='$d_frexpl'
19620 d_fs_data_s='$d_fs_data_s'
19621 d_fseeko='$d_fseeko'
19622 d_fsetpos='$d_fsetpos'
19623 d_fstatfs='$d_fstatfs'
19624 d_fstatvfs='$d_fstatvfs'
19626 d_ftello='$d_ftello'
19628 d_getcwd='$d_getcwd'
19629 d_getespwnam='$d_getespwnam'
19630 d_getfsstat='$d_getfsstat'
19631 d_getgrent='$d_getgrent'
19632 d_getgrent_r='$d_getgrent_r'
19633 d_getgrgid_r='$d_getgrgid_r'
19634 d_getgrnam_r='$d_getgrnam_r'
19635 d_getgrps='$d_getgrps'
19636 d_gethbyaddr='$d_gethbyaddr'
19637 d_gethbyname='$d_gethbyname'
19638 d_gethent='$d_gethent'
19639 d_gethname='$d_gethname'
19640 d_gethostbyaddr_r='$d_gethostbyaddr_r'
19641 d_gethostbyname_r='$d_gethostbyname_r'
19642 d_gethostent_r='$d_gethostent_r'
19643 d_gethostprotos='$d_gethostprotos'
19644 d_getitimer='$d_getitimer'
19645 d_getlogin='$d_getlogin'
19646 d_getlogin_r='$d_getlogin_r'
19647 d_getmnt='$d_getmnt'
19648 d_getmntent='$d_getmntent'
19649 d_getnbyaddr='$d_getnbyaddr'
19650 d_getnbyname='$d_getnbyname'
19651 d_getnent='$d_getnent'
19652 d_getnetbyaddr_r='$d_getnetbyaddr_r'
19653 d_getnetbyname_r='$d_getnetbyname_r'
19654 d_getnetent_r='$d_getnetent_r'
19655 d_getnetprotos='$d_getnetprotos'
19656 d_getpagsz='$d_getpagsz'
19657 d_getpbyname='$d_getpbyname'
19658 d_getpbynumber='$d_getpbynumber'
19659 d_getpent='$d_getpent'
19660 d_getpgid='$d_getpgid'
19661 d_getpgrp2='$d_getpgrp2'
19662 d_getpgrp='$d_getpgrp'
19663 d_getppid='$d_getppid'
19664 d_getprior='$d_getprior'
19665 d_getprotobyname_r='$d_getprotobyname_r'
19666 d_getprotobynumber_r='$d_getprotobynumber_r'
19667 d_getprotoent_r='$d_getprotoent_r'
19668 d_getprotoprotos='$d_getprotoprotos'
19669 d_getprpwnam='$d_getprpwnam'
19670 d_getpwent='$d_getpwent'
19671 d_getpwent_r='$d_getpwent_r'
19672 d_getpwnam_r='$d_getpwnam_r'
19673 d_getpwuid_r='$d_getpwuid_r'
19674 d_getsbyname='$d_getsbyname'
19675 d_getsbyport='$d_getsbyport'
19676 d_getsent='$d_getsent'
19677 d_getservbyname_r='$d_getservbyname_r'
19678 d_getservbyport_r='$d_getservbyport_r'
19679 d_getservent_r='$d_getservent_r'
19680 d_getservprotos='$d_getservprotos'
19681 d_getspnam='$d_getspnam'
19682 d_getspnam_r='$d_getspnam_r'
19683 d_gettimeod='$d_gettimeod'
19684 d_gmtime_r='$d_gmtime_r'
19685 d_gnulibc='$d_gnulibc'
19686 d_grpasswd='$d_grpasswd'
19687 d_hasmntopt='$d_hasmntopt'
19690 d_inetaton='$d_inetaton'
19691 d_int64_t='$d_int64_t'
19692 d_isascii='$d_isascii'
19693 d_isfinite='$d_isfinite'
19696 d_isnanl='$d_isnanl'
19697 d_killpg='$d_killpg'
19698 d_lchown='$d_lchown'
19699 d_ldbl_dig='$d_ldbl_dig'
19701 d_localtime_r='$d_localtime_r'
19702 d_locconv='$d_locconv'
19704 d_longdbl='$d_longdbl'
19705 d_longlong='$d_longlong'
19706 d_lseekproto='$d_lseekproto'
19708 d_madvise='$d_madvise'
19710 d_mbstowcs='$d_mbstowcs'
19711 d_mbtowc='$d_mbtowc'
19712 d_memchr='$d_memchr'
19713 d_memcmp='$d_memcmp'
19714 d_memcpy='$d_memcpy'
19715 d_memmove='$d_memmove'
19716 d_memset='$d_memset'
19718 d_mkdtemp='$d_mkdtemp'
19719 d_mkfifo='$d_mkfifo'
19720 d_mkstemp='$d_mkstemp'
19721 d_mkstemps='$d_mkstemps'
19722 d_mktime='$d_mktime'
19725 d_modfl_pow32_bug='$d_modfl_pow32_bug'
19726 d_mprotect='$d_mprotect'
19728 d_msg_ctrunc='$d_msg_ctrunc'
19729 d_msg_dontroute='$d_msg_dontroute'
19730 d_msg_oob='$d_msg_oob'
19731 d_msg_peek='$d_msg_peek'
19732 d_msg_proxy='$d_msg_proxy'
19733 d_msgctl='$d_msgctl'
19734 d_msgget='$d_msgget'
19735 d_msghdr_s='$d_msghdr_s'
19736 d_msgrcv='$d_msgrcv'
19737 d_msgsnd='$d_msgsnd'
19739 d_munmap='$d_munmap'
19740 d_mymalloc='$d_mymalloc'
19742 d_nl_langinfo='$d_nl_langinfo'
19743 d_nv_preserves_uv='$d_nv_preserves_uv'
19744 d_off64_t='$d_off64_t'
19745 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
19746 d_oldpthreads='$d_oldpthreads'
19747 d_oldsock='$d_oldsock'
19749 d_pathconf='$d_pathconf'
19751 d_perl_otherlibdirs='$d_perl_otherlibdirs'
19752 d_phostname='$d_phostname'
19755 d_portable='$d_portable'
19756 d_procselfexe='$d_procselfexe'
19757 d_pthread_atfork='$d_pthread_atfork'
19758 d_pthread_yield='$d_pthread_yield'
19760 d_pwchange='$d_pwchange'
19761 d_pwclass='$d_pwclass'
19762 d_pwcomment='$d_pwcomment'
19763 d_pwexpire='$d_pwexpire'
19764 d_pwgecos='$d_pwgecos'
19765 d_pwpasswd='$d_pwpasswd'
19766 d_pwquota='$d_pwquota'
19769 d_random_r='$d_random_r'
19770 d_readdir64_r='$d_readdir64_r'
19771 d_readdir='$d_readdir'
19772 d_readdir_r='$d_readdir_r'
19773 d_readlink='$d_readlink'
19775 d_recvmsg='$d_recvmsg'
19776 d_rename='$d_rename'
19777 d_rewinddir='$d_rewinddir'
19779 d_safebcpy='$d_safebcpy'
19780 d_safemcpy='$d_safemcpy'
19781 d_sanemcmp='$d_sanemcmp'
19782 d_sbrkproto='$d_sbrkproto'
19783 d_sched_yield='$d_sched_yield'
19784 d_scm_rights='$d_scm_rights'
19785 d_seekdir='$d_seekdir'
19786 d_select='$d_select'
19788 d_semctl='$d_semctl'
19789 d_semctl_semid_ds='$d_semctl_semid_ds'
19790 d_semctl_semun='$d_semctl_semun'
19791 d_semget='$d_semget'
19793 d_sendmsg='$d_sendmsg'
19794 d_setegid='$d_setegid'
19795 d_seteuid='$d_seteuid'
19796 d_setgrent='$d_setgrent'
19797 d_setgrent_r='$d_setgrent_r'
19798 d_setgrps='$d_setgrps'
19799 d_sethent='$d_sethent'
19800 d_sethostent_r='$d_sethostent_r'
19801 d_setitimer='$d_setitimer'
19802 d_setlinebuf='$d_setlinebuf'
19803 d_setlocale='$d_setlocale'
19804 d_setlocale_r='$d_setlocale_r'
19805 d_setnent='$d_setnent'
19806 d_setnetent_r='$d_setnetent_r'
19807 d_setpent='$d_setpent'
19808 d_setpgid='$d_setpgid'
19809 d_setpgrp2='$d_setpgrp2'
19810 d_setpgrp='$d_setpgrp'
19811 d_setprior='$d_setprior'
19812 d_setproctitle='$d_setproctitle'
19813 d_setprotoent_r='$d_setprotoent_r'
19814 d_setpwent='$d_setpwent'
19815 d_setpwent_r='$d_setpwent_r'
19816 d_setregid='$d_setregid'
19817 d_setresgid='$d_setresgid'
19818 d_setresuid='$d_setresuid'
19819 d_setreuid='$d_setreuid'
19820 d_setrgid='$d_setrgid'
19821 d_setruid='$d_setruid'
19822 d_setsent='$d_setsent'
19823 d_setservent_r='$d_setservent_r'
19824 d_setsid='$d_setsid'
19825 d_setvbuf='$d_setvbuf'
19829 d_shmatprototype='$d_shmatprototype'
19830 d_shmctl='$d_shmctl'
19832 d_shmget='$d_shmget'
19833 d_sigaction='$d_sigaction'
19834 d_sigprocmask='$d_sigprocmask'
19835 d_sigsetjmp='$d_sigsetjmp'
19836 d_sockatmark='$d_sockatmark'
19837 d_sockatmarkproto='$d_sockatmarkproto'
19838 d_socket='$d_socket'
19839 d_socklen_t='$d_socklen_t'
19840 d_sockpair='$d_sockpair'
19841 d_socks5_init='$d_socks5_init'
19843 d_srand48_r='$d_srand48_r'
19844 d_srandom_r='$d_srandom_r'
19845 d_sresgproto='$d_sresgproto'
19846 d_sresuproto='$d_sresuproto'
19847 d_statblks='$d_statblks'
19848 d_statfs_f_flags='$d_statfs_f_flags'
19849 d_statfs_s='$d_statfs_s'
19850 d_statvfs='$d_statvfs'
19851 d_stdio_cnt_lval='$d_stdio_cnt_lval'
19852 d_stdio_ptr_lval='$d_stdio_ptr_lval'
19853 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
19854 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
19855 d_stdio_stream_array='$d_stdio_stream_array'
19856 d_stdiobase='$d_stdiobase'
19857 d_stdstdio='$d_stdstdio'
19858 d_strchr='$d_strchr'
19859 d_strcoll='$d_strcoll'
19860 d_strctcpy='$d_strctcpy'
19861 d_strerrm='$d_strerrm'
19862 d_strerror='$d_strerror'
19863 d_strerror_r='$d_strerror_r'
19864 d_strftime='$d_strftime'
19865 d_strtod='$d_strtod'
19866 d_strtol='$d_strtol'
19867 d_strtold='$d_strtold'
19868 d_strtoll='$d_strtoll'
19869 d_strtoq='$d_strtoq'
19870 d_strtoul='$d_strtoul'
19871 d_strtoull='$d_strtoull'
19872 d_strtouq='$d_strtouq'
19873 d_strxfrm='$d_strxfrm'
19874 d_suidsafe='$d_suidsafe'
19875 d_symlink='$d_symlink'
19876 d_syscall='$d_syscall'
19877 d_syscallproto='$d_syscallproto'
19878 d_sysconf='$d_sysconf'
19879 d_sysernlst='$d_sysernlst'
19880 d_syserrlst='$d_syserrlst'
19881 d_system='$d_system'
19882 d_tcgetpgrp='$d_tcgetpgrp'
19883 d_tcsetpgrp='$d_tcsetpgrp'
19884 d_telldir='$d_telldir'
19885 d_telldirproto='$d_telldirproto'
19888 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
19889 d_tm_tm_zone='$d_tm_tm_zone'
19890 d_tmpnam_r='$d_tmpnam_r'
19891 d_truncate='$d_truncate'
19892 d_ttyname_r='$d_ttyname_r'
19893 d_tzname='$d_tzname'
19894 d_u32align='$d_u32align'
19895 d_ualarm='$d_ualarm'
19898 d_union_semun='$d_union_semun'
19899 d_unordered='$d_unordered'
19900 d_usleep='$d_usleep'
19901 d_usleepproto='$d_usleepproto'
19903 d_vendorarch='$d_vendorarch'
19904 d_vendorbin='$d_vendorbin'
19905 d_vendorlib='$d_vendorlib'
19907 d_void_closedir='$d_void_closedir'
19908 d_voidsig='$d_voidsig'
19909 d_voidtty='$d_voidtty'
19910 d_volatile='$d_volatile'
19911 d_vprintf='$d_vprintf'
19913 d_waitpid='$d_waitpid'
19914 d_wcstombs='$d_wcstombs'
19915 d_wctomb='$d_wctomb'
19916 d_writev='$d_writev'
19919 db_hashtype='$db_hashtype'
19920 db_prefixtype='$db_prefixtype'
19921 db_version_major='$db_version_major'
19922 db_version_minor='$db_version_minor'
19923 db_version_patch='$db_version_patch'
19924 defvoidused='$defvoidused'
19925 direntrytype='$direntrytype'
19928 doublesize='$doublesize'
19930 drand48_r_proto='$drand48_r_proto'
19931 dynamic_ext='$dynamic_ext'
19937 endgrent_r_proto='$endgrent_r_proto'
19938 endhostent_r_proto='$endhostent_r_proto'
19939 endnetent_r_proto='$endnetent_r_proto'
19940 endprotoent_r_proto='$endprotoent_r_proto'
19941 endpwent_r_proto='$endpwent_r_proto'
19942 endservent_r_proto='$endservent_r_proto'
19943 eunicefix='$eunicefix'
19946 extensions='$extensions'
19948 fflushNULL='$fflushNULL'
19949 fflushall='$fflushall'
19951 firstmakefile='$firstmakefile'
19953 fpossize='$fpossize'
19954 fpostype='$fpostype'
19955 freetype='$freetype'
19958 full_csh='$full_csh'
19959 full_sed='$full_sed'
19960 gccosandvers='$gccosandvers'
19961 gccversion='$gccversion'
19962 getgrent_r_proto='$getgrent_r_proto'
19963 getgrgid_r_proto='$getgrgid_r_proto'
19964 getgrnam_r_proto='$getgrnam_r_proto'
19965 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
19966 gethostbyname_r_proto='$gethostbyname_r_proto'
19967 gethostent_r_proto='$gethostent_r_proto'
19968 getlogin_r_proto='$getlogin_r_proto'
19969 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
19970 getnetbyname_r_proto='$getnetbyname_r_proto'
19971 getnetent_r_proto='$getnetent_r_proto'
19972 getprotobyname_r_proto='$getprotobyname_r_proto'
19973 getprotobynumber_r_proto='$getprotobynumber_r_proto'
19974 getprotoent_r_proto='$getprotoent_r_proto'
19975 getpwent_r_proto='$getpwent_r_proto'
19976 getpwnam_r_proto='$getpwnam_r_proto'
19977 getpwuid_r_proto='$getpwuid_r_proto'
19978 getservbyname_r_proto='$getservbyname_r_proto'
19979 getservbyport_r_proto='$getservbyport_r_proto'
19980 getservent_r_proto='$getservent_r_proto'
19981 getspnam_r_proto='$getspnam_r_proto'
19982 gidformat='$gidformat'
19988 gmtime_r_proto='$gmtime_r_proto'
19990 groupcat='$groupcat'
19991 groupstype='$groupstype'
19994 h_sysfile='$h_sysfile'
20005 i_arpainet='$i_arpainet'
20006 i_bsdioctl='$i_bsdioctl'
20010 i_dirent='$i_dirent'
20016 i_fp_class='$i_fp_class'
20019 i_ieeefp='$i_ieeefp'
20020 i_inttypes='$i_inttypes'
20021 i_langinfo='$i_langinfo'
20022 i_libutil='$i_libutil'
20023 i_limits='$i_limits'
20024 i_locale='$i_locale'
20025 i_machcthr='$i_machcthr'
20026 i_malloc='$i_malloc'
20028 i_memory='$i_memory'
20029 i_mntent='$i_mntent'
20032 i_neterrno='$i_neterrno'
20033 i_netinettcp='$i_netinettcp'
20037 i_pthread='$i_pthread'
20039 i_rpcsvcdbm='$i_rpcsvcdbm'
20042 i_shadow='$i_shadow'
20044 i_stdarg='$i_stdarg'
20045 i_stddef='$i_stddef'
20046 i_stdlib='$i_stdlib'
20047 i_string='$i_string'
20048 i_sunmath='$i_sunmath'
20049 i_sysaccess='$i_sysaccess'
20050 i_sysdir='$i_sysdir'
20051 i_sysfile='$i_sysfile'
20052 i_sysfilio='$i_sysfilio'
20054 i_sysioctl='$i_sysioctl'
20055 i_syslog='$i_syslog'
20056 i_sysmman='$i_sysmman'
20057 i_sysmode='$i_sysmode'
20058 i_sysmount='$i_sysmount'
20059 i_sysndir='$i_sysndir'
20060 i_sysparam='$i_sysparam'
20061 i_sysresrc='$i_sysresrc'
20062 i_syssecrt='$i_syssecrt'
20063 i_sysselct='$i_sysselct'
20064 i_syssockio='$i_syssockio'
20065 i_sysstat='$i_sysstat'
20066 i_sysstatfs='$i_sysstatfs'
20067 i_sysstatvfs='$i_sysstatvfs'
20068 i_systime='$i_systime'
20069 i_systimek='$i_systimek'
20070 i_systimes='$i_systimes'
20071 i_systypes='$i_systypes'
20072 i_sysuio='$i_sysuio'
20074 i_sysutsname='$i_sysutsname'
20075 i_sysvfs='$i_sysvfs'
20076 i_syswait='$i_syswait'
20077 i_termio='$i_termio'
20078 i_termios='$i_termios'
20080 i_unistd='$i_unistd'
20083 i_values='$i_values'
20084 i_varargs='$i_varargs'
20085 i_varhdr='$i_varhdr'
20087 ignore_versioned_solibs='$ignore_versioned_solibs'
20088 inc_version_list='$inc_version_list'
20089 inc_version_list_init='$inc_version_list_init'
20092 installarchlib='$installarchlib'
20093 installbin='$installbin'
20094 installman1dir='$installman1dir'
20095 installman3dir='$installman3dir'
20096 installprefix='$installprefix'
20097 installprefixexp='$installprefixexp'
20098 installprivlib='$installprivlib'
20099 installscript='$installscript'
20100 installsitearch='$installsitearch'
20101 installsitebin='$installsitebin'
20102 installsitelib='$installsitelib'
20103 installstyle='$installstyle'
20104 installusrbinperl='$installusrbinperl'
20105 installvendorarch='$installvendorarch'
20106 installvendorbin='$installvendorbin'
20107 installvendorlib='$installvendorlib'
20109 issymlink='$issymlink'
20110 ivdformat='$ivdformat'
20113 known_extensions='$known_extensions'
20116 lddlflags='$lddlflags'
20118 ldflags_uselargefiles='$ldflags_uselargefiles'
20119 ldlibpthname='$ldlibpthname'
20126 libsdirs='$libsdirs'
20127 libsfiles='$libsfiles'
20128 libsfound='$libsfound'
20129 libspath='$libspath'
20130 libswanted='$libswanted'
20131 libswanted_uselargefiles='$libswanted_uselargefiles'
20137 localtime_r_proto='$localtime_r_proto'
20138 locincpth='$locincpth'
20139 loclibpth='$loclibpth'
20140 longdblsize='$longdblsize'
20141 longlongsize='$longlongsize'
20142 longsize='$longsize'
20146 lseeksize='$lseeksize'
20147 lseektype='$lseektype'
20151 make_set_make='$make_set_make'
20152 mallocobj='$mallocobj'
20153 mallocsrc='$mallocsrc'
20154 malloctype='$malloctype'
20156 man1direxp='$man1direxp'
20159 man3direxp='$man3direxp'
20161 mips_type='$mips_type'
20163 mmaptype='$mmaptype'
20164 modetype='$modetype'
20166 multiarch='$multiarch'
20168 myarchname='$myarchname'
20169 mydomain='$mydomain'
20170 myhostname='$myhostname'
20173 need_va_copy='$need_va_copy'
20174 netdb_hlen_type='$netdb_hlen_type'
20175 netdb_host_type='$netdb_host_type'
20176 netdb_name_type='$netdb_name_type'
20177 netdb_net_type='$netdb_net_type'
20180 nm_so_opt='$nm_so_opt'
20181 nonxs_ext='$nonxs_ext'
20183 nvEUformat='$nvEUformat'
20184 nvFUformat='$nvFUformat'
20185 nvGUformat='$nvGUformat'
20186 nv_preserves_uv_bits='$nv_preserves_uv_bits'
20187 nveformat='$nveformat'
20188 nvfformat='$nvfformat'
20189 nvgformat='$nvgformat'
20192 o_nonblock='$o_nonblock'
20194 old_pthread_create_joinable='$old_pthread_create_joinable'
20195 optimize='$optimize'
20196 orderlib='$orderlib'
20199 otherlibdirs='$otherlibdirs'
20203 patchlevel='$patchlevel'
20204 path_sep='$path_sep'
20207 perl_patchlevel='$perl_patchlevel'
20208 perladmin='$perladmin'
20209 perllibs='$perllibs'
20210 perlpath='$perlpath'
20212 phostname='$phostname'
20215 pm_apiversion='$pm_apiversion'
20219 prefixexp='$prefixexp'
20221 privlibexp='$privlibexp'
20222 procselfexe='$procselfexe'
20223 prototype='$prototype'
20225 quadkind='$quadkind'
20226 quadtype='$quadtype'
20227 randbits='$randbits'
20228 randfunc='$randfunc'
20229 random_r_proto='$random_r_proto'
20230 randseedtype='$randseedtype'
20232 rd_nodata='$rd_nodata'
20233 readdir64_r_proto='$readdir64_r_proto'
20234 readdir_r_proto='$readdir_r_proto'
20235 revision='$revision'
20240 sPRIEUldbl='$sPRIEUldbl'
20241 sPRIFUldbl='$sPRIFUldbl'
20242 sPRIGUldbl='$sPRIGUldbl'
20243 sPRIXU64='$sPRIXU64'
20245 sPRIeldbl='$sPRIeldbl'
20246 sPRIfldbl='$sPRIfldbl'
20247 sPRIgldbl='$sPRIgldbl'
20252 sSCNfldbl='$sSCNfldbl'
20253 sched_yield='$sched_yield'
20254 scriptdir='$scriptdir'
20255 scriptdirexp='$scriptdirexp'
20257 seedfunc='$seedfunc'
20258 selectminbits='$selectminbits'
20259 selecttype='$selecttype'
20260 sendmail='$sendmail'
20261 setgrent_r_proto='$setgrent_r_proto'
20262 sethostent_r_proto='$sethostent_r_proto'
20263 setlocale_r_proto='$setlocale_r_proto'
20264 setnetent_r_proto='$setnetent_r_proto'
20265 setprotoent_r_proto='$setprotoent_r_proto'
20266 setpwent_r_proto='$setpwent_r_proto'
20267 setservent_r_proto='$setservent_r_proto'
20270 sharpbang='$sharpbang'
20271 shmattype='$shmattype'
20272 shortsize='$shortsize'
20275 sig_count='$sig_count'
20276 sig_name='$sig_name'
20277 sig_name_init='$sig_name_init'
20279 sig_num_init='$sig_num_init'
20280 sig_size='$sig_size'
20281 signal_t='$signal_t'
20282 sitearch='$sitearch'
20283 sitearchexp='$sitearchexp'
20285 sitebinexp='$sitebinexp'
20287 sitelib_stem='$sitelib_stem'
20288 sitelibexp='$sitelibexp'
20289 siteprefix='$siteprefix'
20290 siteprefixexp='$siteprefixexp'
20291 sizesize='$sizesize'
20292 sizetype='$sizetype'
20296 sockethdr='$sockethdr'
20297 socketlib='$socketlib'
20298 socksizetype='$socksizetype'
20300 spackage='$spackage'
20301 spitshell='$spitshell'
20302 srand48_r_proto='$srand48_r_proto'
20303 srandom_r_proto='$srandom_r_proto'
20305 ssizetype='$ssizetype'
20306 startperl='$startperl'
20308 static_ext='$static_ext'
20310 stdio_base='$stdio_base'
20311 stdio_bufsiz='$stdio_bufsiz'
20312 stdio_cnt='$stdio_cnt'
20313 stdio_filbuf='$stdio_filbuf'
20314 stdio_ptr='$stdio_ptr'
20315 stdio_stream_array='$stdio_stream_array'
20316 strerror_r_proto='$strerror_r_proto'
20319 subversion='$subversion'
20323 targetarch='$targetarch'
20327 timeincl='$timeincl'
20328 timetype='$timetype'
20329 tmpnam_r_proto='$tmpnam_r_proto'
20335 ttyname_r_proto='$ttyname_r_proto'
20344 uidformat='$uidformat'
20350 uquadtype='$uquadtype'
20351 use5005threads='$use5005threads'
20352 use64bitall='$use64bitall'
20353 use64bitint='$use64bitint'
20354 usecrosscompile='$usecrosscompile'
20356 useithreads='$useithreads'
20357 uselargefiles='$uselargefiles'
20358 uselongdouble='$uselongdouble'
20359 usemorebits='$usemorebits'
20360 usemultiplicity='$usemultiplicity'
20361 usemymalloc='$usemymalloc'
20363 useopcode='$useopcode'
20364 useperlio='$useperlio'
20365 useposix='$useposix'
20366 usereentrant='$usereentrant'
20368 useshrplib='$useshrplib'
20369 usesocks='$usesocks'
20370 usethreads='$usethreads'
20371 usevendorprefix='$usevendorprefix'
20372 usevfork='$usevfork'
20375 uvXUformat='$uvXUformat'
20376 uvoformat='$uvoformat'
20379 uvuformat='$uvuformat'
20380 uvxformat='$uvxformat'
20381 vendorarch='$vendorarch'
20382 vendorarchexp='$vendorarchexp'
20383 vendorbin='$vendorbin'
20384 vendorbinexp='$vendorbinexp'
20385 vendorlib='$vendorlib'
20386 vendorlib_stem='$vendorlib_stem'
20387 vendorlibexp='$vendorlibexp'
20388 vendorprefix='$vendorprefix'
20389 vendorprefixexp='$vendorprefixexp'
20391 version_patchlevel_string='$version_patchlevel_string'
20392 versiononly='$versiononly'
20394 voidflags='$voidflags'
20396 xs_apiversion='$xs_apiversion'
20398 yaccflags='$yaccflags'
20403 : Add in command line options if available
20404 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
20406 : add special variables
20407 $test -f $src/patchlevel.h && \
20408 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
20409 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
20410 echo "PERL_CONFIG_SH=true" >>config.sh
20412 : propagate old symbols
20413 if $test -f UU/config.sh; then
20414 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
20415 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
20416 $sort | $uniq -u >UU/oldsyms
20417 set X `cat UU/oldsyms`
20423 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
20425 echo "# Variables propagated from previous config.sh file." >>config.sh
20426 for sym in `cat UU/oldsyms`; do
20427 echo " Propagating $hint variable "'$'"$sym..."
20428 eval 'tmp="$'"${sym}"'"'
20430 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
20436 : Finish up by extracting the .SH files
20440 echo "Extraction done."
20450 If you'd like to make any changes to the config.sh file before I begin
20451 to configure things, do it as a shell escape now (e.g. !vi config.sh).
20454 rp="Press return or use a shell escape to edit config.sh:"
20459 *) : in case they cannot read
20460 sh 1>&4 -c "$ans";;
20465 : if this fails, just run all the .SH files by hand
20474 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
20481 Now you need to generate make dependencies by running "$make depend".
20482 You might prefer to run it in background: "$make depend > makedepend.out &"
20483 It can take a while, so you might not want to run it right now.
20488 rp="Run $make depend now?"
20492 $make depend && echo "Now you must run '$make'."
20495 echo "You must run '$make depend' then '$make'."
20498 elif test -f [Mm]akefile; then
20500 echo "Now you must run a $make."
20502 echo "Configure done."
20505 if $test -f Policy.sh; then
20508 If you compile $package on a different machine or from a different object
20509 directory, copy the Policy.sh file from this object directory to the
20510 new one before you run Configure -- this will help you with most of
20511 the policy defaults.
20515 if $test -f config.msg; then
20516 echo "Hmm. I also noted the following information while running:"
20518 $cat config.msg >&4
20521 $rm -f kit*isdone ark*isdone