3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Mon Apr 11 12:33:25 CEST 2005 [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 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
53 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
54 *** Configure that well. (Plan 9 is close to UNIX but not close enough.)
55 *** Please read the README.plan9 for further instructions.
56 *** Cannot continue, aborting.
62 : compute my invocation name
66 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
71 : Proper separator for the PATH environment variable
73 : On OS/2 this directory should exist if this is not floppy only system :-]
74 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
75 if test -n "$OS2_SHELL"; then
77 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
78 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
80 elif test -n "$DJGPP"; then
81 case "X${MACHTYPE:-nonesuchmach}" in
89 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
90 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
91 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
92 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
93 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
94 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
95 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
96 paths="$paths /sbin /usr/sbin /usr/libexec"
97 paths="$paths /system/gnu_library/bin"
101 case "$p_$PATH$p_" in
103 *) test -d $p && PATH=$PATH$p_$p ;;
110 : shall we be using ksh?
116 if (PATH=.; alias -x) >/dev/null 2>&1; then
119 if test -f /hp-ux -a -f /bin/ksh; then
120 needksh='to avoid sh bug in "here document" expansion'
122 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
123 if test X`/usr/bin/uname -v` = X4; then
124 avoidksh="to avoid AIX 4's /bin/sh"
128 if test -f /osf_boot -a -f /usr/sbin/setld; then
129 if test X`/usr/bin/uname -s` = XOSF1; then
130 avoidksh="to avoid Digital UNIX' ksh"
132 unset BIN_SH # if this is 'xpg4' sh will start up ksh
135 case "$inksh/$needksh" in
142 case "$inksh/$avoidksh" in
148 case "$inksh/$needksh-$avoidksh-" in
151 (I see you are using the Korn shell. Some ksh's blow up on $me,
152 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
159 echo "(Feeding myself to $newsh $reason.)"
161 Configure|*/Configure) exec $newsh $0 "$@";;
162 *) exec $newsh Configure "$@";;
167 : if needed set CDPATH to a harmless value that is not chatty
168 : avoid bash 2.02 problems with empty CDPATH.
172 *bash*) CDPATH='.' ;;
177 : Configure runs within the UU subdirectory
178 test -d UU || mkdir UU
388 endhostent_r_proto=''
394 endprotoent_r_proto=''
400 endservent_r_proto=''
451 gethostbyaddr_r_proto=''
453 gethostbyname_r_proto=''
455 gethostent_r_proto=''
467 getnetbyaddr_r_proto=''
469 getnetbyname_r_proto=''
483 d_getprotobyname_r=''
484 getprotobyname_r_proto=''
485 d_getprotobynumber_r=''
486 getprotobynumber_r_proto=''
488 getprotoent_r_proto=''
500 getservbyname_r_proto=''
502 getservbyport_r_proto=''
504 getservent_r_proto=''
528 d_libm_lib_version=''
581 d_old_pthread_create_joinable=''
582 old_pthread_create_joinable=''
584 d_pthread_attr_setscope=''
623 sethostent_r_proto=''
640 setprotoent_r_proto=''
652 setservent_r_proto=''
697 d_stdio_ptr_lval_nochange_cnt=''
698 d_stdio_ptr_lval_sets_cnt=''
901 inc_version_list_init=''
920 ignore_versioned_solibs=''
980 d_perl_otherlibdirs=''
994 version_patchlevel_string=''
1009 nv_preserves_uv_bits=''
1080 installsitehtml1dir=''
1083 installsitehtml3dir=''
1090 installsiteman1dir=''
1093 installsiteman3dir=''
1098 installsitescript=''
1113 d_stdio_stream_array=''
1114 stdio_stream_array=''
1125 ccflags_uselargefiles=''
1126 ldflags_uselargefiles=''
1127 libswanted_uselargefiles=''
1137 userelocatableinc=''
1148 installvendorarch=''
1155 installvendorhtml1dir=''
1157 vendorhtml1direxp=''
1158 installvendorhtml3dir=''
1160 vendorhtml3direxp=''
1166 installvendorman1dir=''
1169 installvendorman3dir=''
1176 installvendorscript=''
1188 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1191 : We must find out about Eunice early
1193 if test -f /etc/unixtovms; then
1194 eunicefix=/etc/unixtovms
1196 if test -f /etc/unixtovms.exe; then
1197 eunicefix=/etc/unixtovms.exe
1200 : Set executable suffix now -- needed before hints available
1201 if test -f "/libs/version.library"; then
1204 elif test -f "/system/gnu_library/bin/ar.pm"; then
1207 elif test -n "$DJGPP"; then
1210 elif test -d c:/. -o -n "$is_os2" ; then
1219 : set useposix=false in your hint file to disable the POSIX extension.
1221 : set useopcode=false in your hint file to disable the Opcode extension.
1223 : Trailing extension. Override this in a hint file, if needed.
1224 : Extra object files, if any, needed on this platform.
1227 : Possible local include directories to search.
1228 : Set locincpth to "" in a hint file to defeat local include searches.
1229 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1230 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1232 : no include file wanted by default
1237 : change the next line if compiling for Xenix/286 on Xenix/386
1238 xlibpth='/usr/lib/386 /lib/386'
1239 : Possible local library directories to search.
1240 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1241 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1243 : general looking path for locating libraries
1244 glibpth="/lib /usr/lib $xlibpth"
1245 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1246 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1247 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1249 : Private path used by Configure to find libraries. Its value
1250 : is prepended to libpth. This variable takes care of special
1251 : machines, like the mips. Usually, it should be empty.
1254 : default library list
1256 : some systems want to use only the non-versioned libso:s
1257 ignore_versioned_solibs=''
1262 ccflags_uselargefiles=''
1263 ldflags_uselargefiles=''
1264 libswanted_uselargefiles=''
1265 : set usemultiplicity on the Configure command line to enable multiplicity.
1266 : set usesocks on the Configure command line to enable socks.
1267 : set usethreads on the Configure command line to enable threads.
1268 usereentrant='undef'
1269 : full support for void wanted by default
1272 : List of libraries we want.
1273 : If anyone needs extra -lxxx, put those in a hint file.
1274 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1275 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1276 : We probably want to search /usr/shlib before most other libraries.
1277 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1278 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1279 glibpth="/usr/shlib $glibpth"
1280 : Do not use vfork unless overridden by a hint file.
1283 : Find the basic shell for Bourne shell scripts
1287 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1290 if test -f "$xxx"; then
1293 : Build up a list and do a single loop so we can 'break' out.
1294 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1295 for xxx in sh bash ksh pdksh ash; do
1297 try="$try ${p}/${xxx}"
1301 if test -f "$xxx"; then
1304 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1307 elif test -f "$xxx.exe"; then
1318 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1320 Usually it's in /bin/sh. How did you even get this far?
1321 Please contact me (Perl Maintainers) at perlbug@perl.org and
1322 we'll try to straighten this all out.
1328 : see if sh knows # comments
1329 if `$sh -c '#' >/dev/null 2>&1`; then
1333 test -f $xcat$_exe || xcat=/usr/bin/cat
1334 if test ! -f $xcat$_exe; then
1335 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1336 if test -f $p/cat$_exe; then
1341 if test ! -f $xcat$_exe; then
1342 echo "Can't find cat anywhere!"
1346 echo "#!$xcat" >sharp
1350 if test -s today; then
1353 echo "#! $xcat" > sharp
1357 if test -s today; then
1365 echo "Your $sh doesn't grok # comments--I will strip them later on."
1368 echo "exec grep -v '^[ ]*#'" >spitshell
1370 $eunicefix spitshell
1371 spitshell=`pwd`/spitshell
1373 echo "I presume that if # doesn't work, #! won't work either!"
1378 : figure out how to guarantee sh startup
1380 '') startsh=${sharpbang}${sh} ;;
1392 : echo "Yup, it does."
1394 echo "Hmm... '$startsh' does not guarantee sh startup..."
1395 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1400 : Save command line options in file UU/cmdline.opt for later use in
1401 : generating config.sh.
1402 cat > cmdline.opt <<EOSH
1403 # Configure command line arguments.
1412 cat >>cmdline.opt <<EOSH
1413 config_arg$argn='$arg'
1415 # Extreme backslashitis: replace each ' by '"'"'
1416 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1419 arg_exp=`cat cmdl.opt`
1420 args_exp="$args_exp$args_sep'$arg_exp'"
1421 argn=`expr $argn + 1`
1424 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1425 # used by ./hints/os2.sh
1428 : produce awk script to parse command line options
1429 cat >options.awk <<'EOF'
1431 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1433 len = length(optstr);
1434 for (i = 1; i <= len; i++) {
1435 c = substr(optstr, i, 1);
1436 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1447 if (substr(str, 1, 1) != "-") {
1448 printf("'%s'\n", str);
1452 for (i = 2; i <= len; i++) {
1453 c = substr(str, i, 1);
1455 printf("-%s\n", substr(str, i));
1461 printf("'%s'\n", substr(str, i + 1));
1474 : process the command line options
1475 set X `for arg in "$@"; do echo "X$arg"; done |
1476 sed -e s/X// | awk -f options.awk`
1481 : set up default values
1491 rm -f optdef.sh posthint.sh
1492 cat >optdef.sh <<EOS
1498 while test $# -gt 0; do
1500 -d) shift; fastread=yes;;
1501 -e) shift; alldone=cont;;
1505 if test -r "$1"; then
1508 echo "$me: cannot read config file $1." >&2
1513 -h) shift; error=true;;
1514 -r) shift; reuseval=true;;
1515 -s) shift; silent=true; realsilent=true;;
1516 -E) shift; alldone=exit;;
1517 -K) shift; knowitall=true;;
1518 -O) shift; override=true;;
1519 -S) shift; silent=true; extractsh=true;;
1524 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1525 echo "$me: ignoring -D $1" >&2
1528 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1529 *) echo "$1='define'" >> optdef.sh;;
1536 *=) echo "$1" >> optdef.sh;;
1538 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1539 echo "$me: ignoring -U $1" >&2
1541 *) echo "$1='undef'" >> optdef.sh;;
1552 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1556 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1557 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1563 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1564 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1565 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1566 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1567 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1568 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1574 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1576 echo "$yyy=''" >> posthint.sh ;;
1581 echo "$yyy='$zzz'" >> posthint.sh ;;
1583 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1585 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1590 echo "$yyy=$zzz" >> posthint.sh ;;
1591 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1595 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1598 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1606 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1607 [-U symbol] [-U symbol=] [-A command:symbol...]
1608 -d : use defaults for all answers.
1609 -e : go on without questioning past the production of config.sh.
1610 -f : specify an alternate default configuration file.
1611 -h : print this help message and exit (with an error status).
1612 -r : reuse C symbols value if possible (skips costly nm extraction).
1613 -s : silent mode, only echoes questions and essential information.
1614 -D : define symbol to have some value:
1615 -D symbol symbol gets the value 'define'
1616 -D symbol=value symbol gets the value 'value'
1617 -E : stop at the end of questions, after having produced config.sh.
1618 -K : do not use unless you know what you are doing.
1619 -O : let -D and -U override definitions from loaded configuration file.
1620 -S : perform variable substitutions on all .SH files (can mix with -f)
1621 -U : undefine symbol:
1622 -U symbol symbol gets the value 'undef'
1623 -U symbol= symbol gets completely empty
1624 -A : manipulate symbol after the platform specific hints have been applied:
1625 -A symbol=value append " "value to symbol
1626 -A append:symbol=value append value to symbol
1627 -A define:symbol=value define symbol to have value
1628 -A clear:symbol define symbol to be ''
1629 -A define:symbol define symbol to be 'define'
1630 -A eval:symbol=value define symbol to be eval of value
1631 -A prepend:symbol=value prepend value to symbol
1632 -A undef:symbol define symbol to be 'undef'
1633 -A undef:symbol= define symbol to be ''
1634 -V : print version number and exit (with a zero status).
1641 case "$fastread$alldone" in
1644 case "$extractsh" in
1647 if test ! -t 0; then
1648 echo "Say 'sh Configure', not 'sh <Configure'"
1658 true) exec 1>/dev/null;;
1661 : run the defines and the undefines, if any, but leave the file out there...
1664 : create the posthint manipulation script and leave the file out there...
1669 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1670 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1671 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1672 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1673 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1676 : Some greps do not return status, grrr.
1677 echo "grimblepritz" >grimble
1678 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1680 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1686 : the following should work in any shell
1690 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1691 cat >contains <<'EOSS'
1692 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1697 : Find the path to the source tree
1700 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1704 *) src=`cd ../$src && pwd` ;;
1717 if test -f $rsrc/Configure && \
1718 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1720 : found it, so we are ok.
1723 for src in . .. ../.. ../../.. ../../../..; do
1724 if test -f ../$src/Configure && \
1725 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1736 Sorry, I can't seem to locate the source dir for $package. Please start
1737 Configure with an explicit path -- i.e. /some/path/Configure.
1745 echo "Sources for $package found in \"$src\"." >&4
1749 : script used to extract .SH files with variable substitutions
1750 cat >extract <<'EOS'
1752 echo "Doing variable substitutions on .SH files..."
1753 if test -f MANIFEST; then
1754 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1756 echo "(Looking for .SH files under the source directory.)"
1757 set x `(cd "$src"; find . -name "*.SH" -print)`
1761 0) set x `(cd "$src"; echo *.SH)`; shift;;
1763 if test ! -f "$src/$1"; then
1769 while test $name; do
1770 if test ! -d "$name"; then
1771 create="$name $create";
1772 name=`echo $name | sed -e "s|^[^/]*$||"`;
1773 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1778 for file in $create; do
1787 dir=`expr X$file : 'X\(.*\)/'`
1788 file=`expr X$file : 'X.*/\(.*\)'`
1789 (cd "$dir" && . ./$file)
1799 dir=`expr X$file : 'X\(.*\)/'`
1800 file=`expr X$file : 'X.*/\(.*\)'`
1801 (set x $dir; shift; eval $mkdir_p)
1802 sh <"$src/$dir/$file"
1811 if test -f "$src/config_h.SH"; then
1812 if test ! -f config.h; then
1813 : oops, they left it out of MANIFEST, probably, so do it anyway.
1814 . "$src/config_h.SH"
1819 : extract files and exit if asked to do so
1820 case "$extractsh" in
1822 case "$realsilent" in
1826 case "$config_sh" in
1827 '') config_sh='config.sh';;
1830 echo "Fetching answers from $config_sh..."
1833 test "$override" && . ./optdef.sh
1837 echo "Extraction done."
1842 : Eunice requires " " instead of "", can you believe it
1845 echo "Beginning of configuration questions for $package."
1847 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1849 : first determine how to suppress newline on echo command
1851 echo "Checking echo to see how to suppress newlines..."
1852 (echo "hi there\c" ; echo " ") >.echotmp
1853 if $contains c .echotmp >/dev/null 2>&1 ; then
1864 echo $n "The star should be here-->$c"
1868 : Now test for existence of everything in MANIFEST
1870 if test -f "$rsrc/MANIFEST"; then
1871 echo "First let's make sure your kit is complete. Checking..." >&4
1872 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1875 for filelist in x??; do
1876 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1878 if test -s missing; then
1882 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1884 You have the option of continuing the configuration process, despite the
1885 distinct possibility that your kit is damaged, by typing 'y'es. If you
1886 do, don't blame me if something goes wrong. I advise you to type 'n'o
1887 and contact the author (perlbug@perl.org).
1890 echo $n "Continue? [n] $c" >&4
1894 echo "Continuing..." >&4
1898 echo "ABORTING..." >&4
1903 echo "Looks good..."
1906 echo "There is no MANIFEST file. I hope your kit is complete !"
1911 : Find the appropriate value for a newline for tr
1912 if test -n "$DJGPP"; then
1915 if test X"$trnl" = X; then
1916 case "`echo foo|tr '\n' x 2>/dev/null`" in
1920 if test X"$trnl" = X; then
1921 case "`echo foo|tr '\012' x 2>/dev/null`" in
1922 foox) trnl='\012' ;;
1925 if test X"$trnl" = X; then
1926 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1927 fooxy) trnl='\n\r' ;;
1930 if test X"$trnl" = X; then
1933 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1939 : compute the number of columns on the terminal for proper question formatting
1944 : set up the echo used in my read
1945 myecho="case \"\$xxxm\" in
1946 '') echo $n \"\$rp $c\" >&4;;
1948 '') echo $n \"[\$xxxm] $c\";;
1950 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1952 echo $n \"[\$xxxm] $c\" >&4
1954 echo $n \"\$rp [\$xxxm] $c\" >&4
1960 : now set up to do reads with possible shell escape and default assignment
1966 case "\$fastread" in
1967 yes) case "\$dflt" in
1970 case "\$silent-\$rp" in
1975 *) case "\$silent" in
1976 true) case "\$rp" in
1981 while expr "X\$ans" : "X!" >/dev/null; do
1985 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1993 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2002 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2007 echo "(OK, I'll run with -d after this question.)" >&4
2010 echo "*** Sorry, \$1 not supported yet." >&4
2020 echo "*** Substitution done -- please confirm."
2022 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2027 echo "*** Error -- try again."
2034 case "\$ans\$xxxm\$nostick" in
2046 : create .config dir to save info across Configure sessions
2047 test -d ../.config || mkdir ../.config
2048 cat >../.config/README <<EOF
2049 This directory created by Configure to save information that should
2050 persist across sessions for $package.
2052 You may safely delete it if you wish.
2055 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2057 $define|true|[yY]*) ;;
2058 *) case "$xversion" in
2061 *** WHOA THERE!!! ***
2063 This is an UNSTABLE DEVELOPMENT release.
2064 The version of this $package distribution is $xversion, that is, odd,
2065 (as opposed to even) and that signifies a development release.
2066 If you want a maintenance release, you want an even-numbered version.
2068 Do ***NOT*** install this into production use.
2069 Data corruption and crashes are possible.
2071 It is most seriously suggested that you do not continue any further
2072 unless you want to help in developing and debugging Perl.
2074 If you *still* want to build perl, you can answer 'y' now,
2075 or pass -Dusedevel to Configure.
2078 rp='Do you really want to continue?'
2082 [yY]) echo >&4 "Okay, continuing."
2083 usedevel="$define" ;;
2084 *) echo >&4 "Okay, bye."
2094 case "$versiononly" in
2095 '') versiononly="$define" ;;
2097 case "$installusrbinperl" in
2098 '') installusrbinperl="$undef" ;;
2103 : general instructions
2106 user=`(logname) 2>/dev/null`
2108 '') user=`whoami 2>&1`;;
2110 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2113 rp='Would you like to see the instructions?'
2124 This installation shell script will examine your system and ask you questions
2125 to determine how the perl5 package should be installed. If you get
2126 stuck on a question, you may use a ! shell escape to start a subshell or
2127 execute a command. Many of the questions will have default answers in square
2128 brackets; typing carriage return will give you the default.
2130 On some of the questions which ask for file or directory names you are allowed
2131 to use the ~name construct to specify the login directory belonging to "name",
2132 even if you don't have a shell which knows about that. Questions where this is
2133 allowed will be marked "(~name ok)".
2137 dflt='Type carriage return to continue'
2141 The prompter used in this script allows you to use shell variables and
2142 backticks in your answers. You may use $1, $2, etc... to refer to the words
2143 in the default answer, as if the default line was a set of arguments given to a
2144 script shell. This means you may also use $* to repeat the whole default line,
2145 so you do not have to re-type everything to add something to the default.
2147 Everytime there is a substitution, you will have to confirm. If there is an
2148 error (e.g. an unmatched backtick), the default answer will remain unchanged
2149 and you will be prompted again.
2151 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2152 the questions and use the computed defaults (or the previous answers if there
2153 was already a config.sh file). Type 'Configure -h' for a list of options.
2154 You may also start interactively and then answer '& -d' at any prompt to turn
2155 on the non-interactive behaviour for the remainder of the execution.
2161 Much effort has been expended to ensure that this shell script will run on any
2162 Unix system. If despite that it blows up on yours, your best bet is to edit
2163 Configure and run it again. If you can't run Configure for some reason,
2164 you'll have to generate a config.sh file by hand. Whatever problems you
2165 have, let me (perlbug@perl.org) know how I blew it.
2167 This installation script affects things in two ways:
2169 1) it may do direct variable substitutions on some of the files included
2171 2) it builds a config.h file for inclusion in C programs. You may edit
2172 any of these files as the need arises after running this script.
2174 If you make a mistake on a question, there is no easy way to back up to it
2175 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2176 files. Configure will offer to let you do this before it runs the SH files.
2179 dflt='Type carriage return to continue'
2181 case "$firsttime" in
2182 true) echo $user >>../.config/instruct;;
2186 : find out where common programs are
2188 echo "Locating common programs..." >&4
2201 if test -d \$dir/\$thing; then
2207 for thisthing in \$dir/\$thing; do
2208 : just loop through to pick last item
2210 if test -f \$thisthing; then
2213 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2216 elif test -f \$dir/\$thing.exe; then
2217 if test -n "$DJGPP"; then
2218 echo \$dir/\$thing.exe
2219 elif test "$eunicefix" != ":"; then
2220 : on Eunice apparently
2274 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2275 pth="$pth /lib /usr/lib"
2276 for file in $loclist; do
2280 if test -f "$xxx"; then
2283 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2284 xxx=`./loc $file $file $pth`
2287 '') xxx=`./loc $file $file $pth`;;
2288 *) xxx=`./loc $xxx $xxx $pth`;;
2290 eval $file=$xxx$_exe
2294 echo $file is in $xxx.
2297 echo $file is in $xxx.
2300 echo "I don't know where '$file' is, and my life depends on it." >&4
2301 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2307 echo "Don't worry if any of the following aren't found..."
2309 for file in $trylist; do
2313 if test -f "$xxx"; then
2316 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2317 xxx=`./loc $file $file $pth`
2320 '') xxx=`./loc $file $file $pth`;;
2321 *) xxx=`./loc $xxx $xxx $pth`;;
2323 eval $file=$xxx$_exe
2327 echo $file is in $xxx.
2330 echo $file is in $xxx.
2333 echo "I don't see $file out there, $say."
2340 echo "Substituting grep for egrep."
2347 echo "Substituting cp for ln."
2356 echo "I can't find make or gmake, and my life depends on it." >&4
2357 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2365 *) # We can't have osname yet.
2366 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2367 # Assume that gmake, if found, is definitely GNU make
2368 # and prefer it over the system make.
2369 echo "Substituting gmake for make."
2377 echo "Hopefully test is built into your sh."
2380 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2381 echo "Using the test built into your sh."
2389 echo "Hopefully echo is built into your sh."
2394 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2395 $echo $n "hi there$c" >foo1
2396 echo $n "hi there$c" >foo2
2397 if cmp foo1 foo2 >/dev/null 2>&1; then
2398 echo "They are compatible. In fact, they may be identical."
2405 They are not compatible! You are probably running ksh on a non-USG system.
2406 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2407 have echo built in and we may have to run some Bourne shell scripts. That
2408 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2411 $echo $n "The star should be here-->$c"
2421 cat <<'EOSC' >>trygcc
2426 int main(int argc, char *argv[]) {
2430 if $cc -o try $ccflags $ldflags try.c; then
2433 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2439 case "`$cc -v -c try.c 2>&1`" in
2442 if $test X"$trygcc" = Xyes; then
2443 if gcc -o try -c try.c; then
2445 echo "You seem to have a working gcc, though." >&4
2446 rp="Would you like to use it?"
2448 if $test -f myread; then
2451 if $test -f UU/myread; then
2454 echo "Cannot find myread, sorry. Aborting." >&2
2459 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2460 if $test -f usethreads.cbu; then
2463 *** However, any setting of the C compiler flags (e.g. for thread support)
2464 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2465 *** (together with e.g. -Dusethreads).
2481 cat <<'EOSC' >>checkcc
2486 int main(int argc, char *argv[]) {
2490 if $cc -o try $ccflags $ldflags try.c; then
2493 if $test X"$despair" = Xyes; then
2494 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2497 You need to find a working C compiler.
2498 Either (purchase and) install the C compiler supplied by your OS vendor,
2499 or for a free C compiler try http://gcc.gnu.org/
2500 I cannot continue any further, aborting.
2509 : determine whether symbolic links are supported
2512 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2513 echo "Symbolic links are supported." >&4
2516 echo "Symbolic links are NOT supported." >&4
2521 : determine whether symbolic links are supported
2525 echo "Checking how to test for symbolic links..." >&4
2527 if $test "X$issymlink" = X; then
2529 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2530 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2532 if test $? = 0; then
2535 echo "Your builtin 'test -h' may be broken." >&4
2538 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2541 if test -f "$p/$test"; then
2550 echo "Trying external '$test -h'." >&4
2551 issymlink="$test -h"
2552 if $test ! -h sym >/dev/null 2>&1; then
2553 echo "External '$test -h' is broken, too." >&4
2561 if $test "X$issymlink" = X; then
2562 if $test -L sym 2>/dev/null; then
2563 issymlink="$test -L"
2564 echo "The builtin '$test -L' worked." >&4
2567 if $test "X$issymlink" != X; then
2568 echo "You can test for symbolic links with '$issymlink'." >&4
2570 echo "I do not know how you can test for symbolic links." >&4
2574 *) echo "No symbolic links, so not testing for their testing..." >&4
2580 case "$mksymlinks" in
2583 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2586 *) case "$lns:$issymlink" in
2587 *"ln"*" -s:"*"test -"?)
2588 echo "Creating the symbolic links..." >&4
2589 echo "(First creating the subdirectories...)" >&4
2591 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2593 test -z "$directory" && break
2597 if test ! -d t/base; then
2598 echo "Failed to create the subdirectories. Aborting." >&4
2601 echo "(Then creating the symlinks...)" >&4
2602 awk '{print $1}' $src/MANIFEST | while true; do
2604 test -z "$filename" && break
2605 if test -f $filename; then
2606 if $issymlink $filename; then
2610 if test -f $filename; then
2611 echo "$filename already exists, not symlinking."
2613 ln -s $src/$filename $filename
2617 if test ! -f t/base/lex.t; then
2618 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2623 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2632 case "$usecrosscompile" in
2634 $echo "Cross-compiling..."
2637 *-*-gcc) # A cross-compiling gcc, probably.
2638 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2640 # leave out ld, choosing it is more complex
2642 ranlib=$targetarch-ranlib
2643 $echo 'extern int foo;' > try.c
2644 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2646 if $test $# -gt 0; then
2648 incpth="`$echo $incpth|$sed 's/^ //'`"
2649 echo "Guessing incpth '$incpth'." >&4
2651 j="`$echo $i|$sed 's,/include$,/lib,'`"
2652 if $test -d $j; then
2656 libpth="`$echo $libpth|$sed 's/^ //'`"
2657 echo "Guessing libpth '$libpth'." >&4
2662 case "$targetarch" in
2663 '') echo "Targetarch not defined." >&4; croak=y ;;
2664 *) echo "Using targetarch $targetarch." >&4 ;;
2667 '') echo "Incpth not defined." >&4; croak=y ;;
2668 *) echo "Using incpth '$incpth'." >&4 ;;
2671 '') echo "Libpth not defined." >&4; croak=y ;;
2672 *) echo "Using libpth '$libpth'." >&4 ;;
2675 '') for i in $incpth; do
2676 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2678 echo "Guessing usrinc $usrinc." >&4
2683 '') echo "Usrinc not defined." >&4; croak=y ;;
2686 *) echo "Using usrinc $usrinc." >&4 ;;
2688 case "$targethost" in
2689 '') echo "Targethost not defined." >&4; croak=y ;;
2690 *) echo "Using targethost $targethost." >&4
2695 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2698 /*) run=$src/Cross/run
2699 targetmkdir=$src/Cross/mkdir
2701 from=$src/Cross/from
2703 *) pwd=`$test -f ../Configure & cd ..; pwd`
2705 targetmkdir=$pwd/Cross/mkdir
2707 from=$pwd/Cross/from
2710 case "$targetrun" in
2711 '') targetrun=ssh ;;
2716 case "$targetfrom" in
2717 '') targetfrom=scp ;;
2721 from=$from-$targetfrom
2722 case "$targetdir" in
2724 echo "Guessing targetdir $targetdir." >&4
2727 case "$targetuser" in
2729 echo "Guessing targetuser $targetuser." >&4
2732 case "$targetfrom" in
2736 case "$targetrun" in
2748 '') cwd=$targetdir ;;
2752 if $test ! -f \$exe.xok; then
2756 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2759 *) echo "Unknown targetrun '$targetrun'" >&4
2763 case "$targetmkdir" in
2765 cat >$targetmkdir <<EOF
2767 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2769 $chmod a+rx $targetmkdir
2771 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2783 $targetmkdir \`dirname \$f\`
2784 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2787 $targetmkdir $targetdir/\`dirname \$f\`
2788 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2801 $mkdir -p $targetdir/\`dirname \$f\`
2802 $cp \$f $targetdir/\$f || exit 1
2805 $targetmkdir $targetdir/\`dirname \$f\`
2806 $cp \$f $targetdir/\$f || exit 1
2813 *) echo "Unknown targetto '$targetto'" >&4
2817 case "$targetfrom" in
2824 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2829 cp) cat >$from <<EOF
2834 cp $targetdir/\$f . || exit 1
2839 *) echo "Unknown targetfrom '$targetfrom'" >&4
2843 if $test ! -f $run; then
2844 echo "Target 'run' script '$run' not found." >&4
2848 if $test ! -f $to; then
2849 echo "Target 'to' script '$to' not found." >&4
2853 if $test ! -f $from; then
2854 echo "Target 'from' script '$from' not found." >&4
2858 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2862 Using '$run' for remote execution,
2863 and '$from' and '$to'
2864 for remote file transfer.
2870 usecrosscompile='undef'
2875 : see whether [:lower:] and [:upper:] are supported character classes
2877 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2879 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2883 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2884 # (0xd9 and 0xe2), therefore that is a nice testing point.
2885 if test "X$up" = X -o "X$low" = X; then
2886 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2892 if test "X$up" = X -o "X$low" = X; then
2893 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2899 if test "X$up" = X -o "X$low" = X; then
2900 case "`echo RS | od -x 2>/dev/null`" in
2902 echo "Hey, this might be EBCDIC." >&4
2903 if test "X$up" = X -o "X$low" = X; then
2904 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2905 rs) up='[A-IJ-RS-Z]'
2910 if test "X$up" = X -o "X$low" = X; then
2911 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2921 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2923 echo "Using $up and $low to convert case." >&4
2926 echo "I don't know how to translate letters from upper to lower case." >&4
2927 echo "Your tr is not acting any way I know of." >&4
2931 : set up the translation script tr, must be called with ./tr of course
2935 '[A-Z][a-z]') exec $tr '$up' '$low';;
2936 '[a-z][A-Z]') exec $tr '$low' '$up';;
2943 : Try to determine whether config.sh was made on this system
2944 case "$config_sh" in
2946 myuname=`$uname -a 2>/dev/null`
2947 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2948 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2949 # because the A-Z/a-z are not consecutive.
2950 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2951 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2952 newmyuname="$myuname"
2954 case "$knowitall" in
2956 if test -f ../config.sh; then
2957 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2958 eval "`grep myuname= ../config.sh`"
2960 if test "X$myuname" = "X$newmyuname"; then
2968 : Get old answers from old config file if Configure was run on the
2969 : same system, otherwise use the hints.
2972 if test -f config.sh; then
2974 rp="I see a config.sh file. Shall I use it to set the defaults?"
2977 n*|N*) echo "OK, I'll ignore it."
2978 mv config.sh config.sh.old
2979 myuname="$newmyuname"
2981 *) echo "Fetching default answers from your old config.sh file..." >&4
2989 : Older versions did not always set $sh. Catch re-use of such
2999 if test ! -f config.sh; then
3002 First time through, eh? I have some defaults handy for some systems
3003 that need some extra help getting the Configure answers right:
3006 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3008 : Half the following guesses are probably wrong... If you have better
3009 : tests or hints, please send them to perlbug@perl.org
3010 : The metaconfig authors would also appreciate a copy...
3011 $test -f /irix && osname=irix
3012 $test -f /xenix && osname=sco_xenix
3013 $test -f /dynix && osname=dynix
3014 $test -f /dnix && osname=dnix
3015 $test -f /lynx.os && osname=lynxos
3016 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3017 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3018 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3019 $test -f /bin/mips && /bin/mips && osname=mips
3020 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3021 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3022 $test -d /usr/apollo/bin && osname=apollo
3023 $test -f /etc/saf/_sactab && osname=svr4
3024 $test -d /usr/include/minix && osname=minix
3025 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3026 if $test -d /MachTen -o -d /MachTen_Folder; then
3028 if $test -x /sbin/version; then
3029 osvers=`/sbin/version | $awk '{print $2}' |
3030 $sed -e 's/[A-Za-z]$//'`
3031 elif $test -x /usr/etc/version; then
3032 osvers=`/usr/etc/version | $awk '{print $2}' |
3033 $sed -e 's/[A-Za-z]$//'`
3039 $test -f /sys/posix.dll &&
3040 $test -f /usr/bin/what &&
3041 set X `/usr/bin/what /sys/posix.dll` &&
3042 $test "$3" = UWIN &&
3046 if $test -f $uname; then
3054 umips) osname=umips ;;
3057 [23]100) osname=mips ;;
3058 next*) osname=next ;;
3060 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3061 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3064 elif $test -f /etc/kconfig; then
3066 if test "$lns" = "$ln -s"; then
3068 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3070 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3077 if test -n "$DJGPP"; then
3086 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3088 # oslevel can fail with:
3089 # oslevel: Unable to acquire lock.
3090 *not\ found) osvers="$4"."$3" ;;
3091 '<3240'|'<>3240') osvers=3.2.0 ;;
3092 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3093 '=3250'|'>3250') osvers=3.2.5 ;;
3097 bsd386) osname=bsd386
3100 cygwin*) osname=cygwin
3103 *dc.osx) osname=dcosx
3109 domainos) osname=apollo
3115 dynixptx*) osname=dynixptx
3116 osvers=`echo "$4"|sed 's/^v//'`
3118 freebsd) osname=freebsd
3120 genix) osname=genix ;;
3124 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3140 netbsd*) osname=netbsd
3143 news-os) osvers="$3"
3145 4*) osname=newsos4 ;;
3149 next*) osname=next ;;
3150 nonstop-ux) osname=nonstopux ;;
3151 openbsd) osname=openbsd
3157 POSIX-BC | posix-bc ) osname=posix-bc
3160 powerux | power_ux | powermax_os | powermaxos | \
3161 powerunix | power_unix) osname=powerux
3167 solaris) osname=solaris
3169 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3176 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3180 titanos) osname=titanos
3189 ultrix) osname=ultrix
3192 osf1|mls+) case "$5" in
3195 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3198 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3201 hp*) osname=hp_osf1 ;;
3202 mips) osname=mips_osf1 ;;
3205 # UnixWare 7.1.2 is known as Open UNIX 8
3206 openunix|unixware) osname=svr5
3214 $2) case "$osname" in
3218 : svr4.x or possibly later
3228 if test -f /stand/boot ; then
3229 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3230 if test -n "$INITPROG" -a -f "$INITPROG"; then
3231 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3232 if test -n "$isesix"; then
3240 *) if test -f /etc/systemid; then
3242 set `echo $3 | $sed 's/\./ /g'` $4
3243 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3245 elif $test -f $src/hints/sco_$1_$2.sh; then
3247 elif $test -f $src/hints/sco_$1.sh; then
3252 '') : Still unknown. Probably a generic Sys V.
3261 *) case "$osname" in
3262 '') : Still unknown. Probably a generic BSD.
3270 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3271 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3272 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3275 $rm -f UU/kernel.what
3276 elif test -d c:/. -o -n "$is_os2" ; then
3283 case "$targetarch" in
3286 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3291 : Now look for a hint file osname_osvers, unless one has been
3292 : specified already.
3295 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3296 : Also try without trailing minor version numbers.
3297 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3298 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3299 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3300 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3303 *) case "$osvers" in
3306 *) if $test -f $src/hints/$file.sh ; then
3308 elif $test -f $src/hints/$xfile.sh ; then
3310 elif $test -f $src/hints/$xxfile.sh ; then
3312 elif $test -f $src/hints/$xxxfile.sh ; then
3314 elif $test -f $src/hints/$xxxxfile.sh ; then
3316 elif $test -f "$src/hints/${osname}.sh" ; then
3325 if $test -f Policy.sh ; then
3328 none) dflt="Policy" ;;
3329 *) dflt="Policy $dflt" ;;
3334 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3338 if $test -f Policy.sh ; then
3341 There's also a Policy hint file available, which should make the
3342 site-specific (policy) questions easier to answer.
3349 You may give one or more space-separated answers, or "none" if appropriate.
3350 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3351 is a good thing. DO NOT give a wrong version or a wrong OS.
3355 rp="Which of these apply, if any?"
3358 for file in $tans; do
3359 if $test X$file = XPolicy -a -f Policy.sh; then
3361 $cat Policy.sh >> UU/config.sh
3362 elif $test -f $src/hints/$file.sh; then
3363 . $src/hints/$file.sh
3364 $cat $src/hints/$file.sh >> UU/config.sh
3365 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3368 : Give one chance to correct a possible typo.
3369 echo "$file.sh does not exist"
3371 rp="hint to use instead?"
3373 for file in $ans; do
3374 if $test -f "$src/hints/$file.sh"; then
3375 . $src/hints/$file.sh
3376 $cat $src/hints/$file.sh >> UU/config.sh
3377 elif $test X$ans = X -o X$ans = Xnone ; then
3380 echo "$file.sh does not exist -- ignored."
3387 : Remember our hint file for later.
3388 if $test -f "$src/hints/$file.sh" ; then
3398 echo "Fetching default answers from $config_sh..." >&4
3402 cp $config_sh config.sh 2>/dev/null
3412 test "$override" && . ./optdef.sh
3414 : Restore computed paths
3415 for file in $loclist $trylist; do
3416 eval $file="\$_$file"
3421 Configure uses the operating system name and version to set some defaults.
3422 The default value is probably right if the name rings a bell. Otherwise,
3423 since spelling matters for me, either accept the default or answer "none"
3430 ''|' '|none) dflt=none ;;
3431 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3434 *) dflt="$osname" ;;
3436 rp="Operating system name?"
3440 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3446 ''|' '|none) dflt=none ;;
3447 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3448 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3450 ''|' ') dflt=none ;;
3455 *) dflt="$osvers" ;;
3457 rp="Operating system version?"
3467 : who configured the system
3468 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3471 cf_by=`(logname) 2>/dev/null`
3474 cf_by=`(whoami) 2>/dev/null`
3476 "") cf_by=unknown ;;
3481 : set up the script used to warn in case of inconsistency
3488 echo "*** WHOA THERE!!! ***" >&4
3489 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3490 rp=" Keep the $hint value?"
3493 y) td=$was; tu=$was;;
3497 : function used to set $1 to $val
3498 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3500 $define$undef) . ./whoa; eval "$var=\$td";;
3501 $undef$define) . ./whoa; eval "$var=\$tu";;
3502 *) eval "$var=$val";;
3506 $define|true|[yY]*) dflt='y';;
3511 Perl can be built to use the SOCKS proxy protocol library. To do so,
3512 Configure must be run with -Dusesocks. If you use SOCKS you also need
3513 to use the PerlIO abstraction layer, this will be implicitly selected.
3515 If this doesn't make any sense to you, just accept the default '$dflt'.
3517 rp='Build Perl for SOCKS?'
3520 y|Y) val="$define" ;;
3527 $define|true|[yY]*) useperlio="$define";;
3530 case "$useperlio" in
3531 $define|true|[yY]*|'') dflt='y';;
3536 Previous version of $package used the standard IO mechanisms as
3537 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3538 alternate IO mechanisms via the PerlIO abstraction layer, but the
3539 stdio mechanism is still available if needed. The abstraction layer
3540 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3541 Using PerlIO with sfio may cause problems with some extension modules.
3543 If this doesn't make any sense to you, just accept the default '$dflt'.
3545 rp='Use the PerlIO abstraction layer?'
3552 echo "Ok, doing things the stdio way."
3561 case "$useperlio" in
3562 $define|true|[yY]*) ;;
3565 You are using the SOCKS proxy protocol library which means that you
3566 should also use the PerlIO layer. You may be headed for trouble.
3575 case "$usethreads" in
3576 $define|true|[yY]*) dflt='y';;
3577 *) # Catch case where user specified ithreads or 5005threads but
3578 # forgot -Dusethreads (A.D. 4/2002)
3579 case "$useithreads$use5005threads" in
3581 case "$useperlio" in
3582 "$define") dflt='y' ;;
3592 Perl can be built to take advantage of threads on some systems.
3593 To do so, Configure can be run with -Dusethreads.
3595 Note that Perl built with threading support runs slightly slower
3596 and uses more memory than plain Perl. The current implementation
3597 is believed to be stable, but it is fairly new, and so should be
3598 treated with caution.
3600 If this doesn't make any sense to you, just accept the default '$dflt'.
3602 rp='Build a threading Perl?'
3605 y|Y) val="$define" ;;
3611 case "$usethreads" in
3615 Since release 5.6, Perl has had two different threading implementations,
3616 the newer interpreter-based version (ithreads) with one interpreter per
3617 thread, and the older 5.005 version (5005threads).
3618 The 5005threads version is effectively unmaintained and will probably be
3619 removed in Perl 5.10, so there should be no need to build a Perl using it
3620 unless needed for backwards compatibility with some existing 5.005threads
3624 : Default to ithreads unless overridden on command line or with
3627 case "$use5005threads" in
3628 $define|true|[yY]*) dflt='n';;
3630 case "$useithreads" in
3631 $undef|false|[nN]*) dflt='n';;
3633 rp='Use the newer interpreter-based ithreads?'
3636 y|Y) val="$define" ;;
3641 : Now set use5005threads to the opposite value.
3642 case "$useithreads" in
3643 $define) val="$undef" ;;
3650 useithreads="$undef"
3651 use5005threads="$undef"
3655 case "$useithreads$use5005threads" in
3659 You cannot have both the ithreads and the 5.005 threads enabled
3660 at the same time. Disabling the 5.005 threads since they are
3661 much less stable than the ithreads.
3664 use5005threads="$undef"
3668 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3671 *** To build with ithreads you must also use the PerlIO layer.
3672 *** Cannot continue, aborting.
3678 case "$d_oldpthreads" in
3679 '') : Configure tests would be welcome here. For now, assume undef.
3681 *) val="$d_oldpthreads" ;;
3687 : Look for a hint-file generated 'call-back-unit'. If the
3688 : user has specified that a threading perl is to be built,
3689 : we may need to set or change some other defaults.
3690 if $test -f usethreads.cbu; then
3691 echo "Your platform has some specific hints regarding threaded builds, using them..."
3694 case "$usethreads" in
3695 "$define"|true|[yY]*)
3697 (Your platform does not have any specific hints for threaded builds.
3698 Assuming POSIX threads, then.)
3706 Perl can be built so that multiple Perl interpreters can coexist
3707 within the same Perl executable.
3710 case "$useithreads" in
3713 This multiple interpreter support is required for interpreter-based threads.
3717 *) case "$usemultiplicity" in
3718 $define|true|[yY]*) dflt='y';;
3722 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3723 rp='Build Perl for multiplicity?'
3726 y|Y) val="$define" ;;
3735 case "$usemorebits" in
3736 "$define"|true|[yY]*)
3737 use64bitint="$define"
3738 uselongdouble="$define"
3739 usemorebits="$define"
3741 *) usemorebits="$undef"
3745 : make some quick guesses about what we are up against
3747 $echo $n "Hmm... $c"
3757 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3758 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3760 echo "Looks kind of like an OSF/1 system, but we'll see..."
3762 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3763 xxx=`./loc addbib blurfl $pth`
3764 if $test -f $xxx; then
3765 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3769 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3770 echo "Looks kind of like an extended USG system, but we'll see..."
3772 echo "Looks kind of like a USG system, but we'll see..."
3776 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3777 echo "Looks kind of like a BSD system, but we'll see..."
3781 echo "Looks kind of like a Version 7 system, but we'll see..."
3784 case "$eunicefix" in
3787 There is, however, a strange, musty smell in the air that reminds me of
3788 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3792 : it so happens the Eunice I know will not run shell scripts in Unix format
3796 echo "Congratulations. You aren't running Eunice."
3800 : Detect OS2. The p_ variable is set above in the Head.U unit.
3801 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3802 : semicolon as a patch separator
3807 I have the feeling something is not exactly right, however...don't tell me...
3808 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3809 (Or you may be running DOS with DJGPP.)
3814 if test -f /xenix; then
3815 echo "Actually, this looks more like a XENIX system..."
3820 echo "It's not Xenix..."
3825 if test -f /venix; then
3826 echo "Actually, this looks more like a VENIX system..."
3833 echo "Nor is it Venix..."
3836 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3837 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3844 rp="Use which C compiler?"
3848 : See if they have not cc but they do have gcc
3850 : Look for a hint-file generated 'call-back-unit'. Now that the
3851 : user has specified the compiler, we may need to set or change some
3853 if $test -f cc.cbu; then
3859 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3865 printf("%s\n", __VERSION__);
3867 printf("%s\n", "1");
3873 if $cc -o try $ccflags $ldflags try.c; then
3874 gccversion=`$run ./try`
3875 case "$gccversion" in
3876 '') echo "You are not using GNU cc." ;;
3877 *) echo "You are using GNU cc $gccversion."
3883 echo "*** WHOA THERE!!! ***" >&4
3884 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3885 case "$knowitall" in
3887 echo " You'd better start hunting for one and let me know about it." >&4
3893 case "$gccversion" in
3894 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3896 case "$gccversion" in
3897 '') gccosandvers='' ;;
3898 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3899 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3901 case "$gccosandvers" in
3902 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3903 $osname$osvers) ;; # looking good
3904 $osname*) cat <<EOM >&4
3906 *** WHOA THERE!!! ***
3908 Your gcc has not been compiled for the exact release of
3909 your operating system ($gccosandvers versus $osname$osvers).
3911 In general it is a good idea to keep gcc synchronized with
3912 the operating system because otherwise serious problems
3913 may ensue when trying to compile software, like Perl.
3915 I'm trying to be optimistic here, though, and will continue.
3916 If later during the configuration and build icky compilation
3917 problems appear (headerfile conflicts being the most common
3918 manifestation), I suggest reinstalling the gcc to match
3919 your operating system release.
3923 *) gccosandvers='' ;; # failed to parse, better be silent
3931 # gcc 3.* complain about adding -Idirectories that they already know about,
3932 # so we will take those off from locincpth.
3933 case "$gccversion" in
3935 echo "main(){}">try.c
3936 for incdir in $locincpth; do
3937 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3938 grep '^c[cp]p*[01]: warning: changing search order '`
3939 if test "X$warn" != X; then
3940 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3946 : decide how portable to be. Allow command line overrides.
3947 case "$d_portable" in
3949 *) d_portable="$define" ;;
3952 : set up shell script to do ~ expansion
3958 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3961 if $test -f /bin/csh; then
3962 /bin/csh -f -c "glob \$1"
3967 name=\`$expr x\$1 : '..\([^/]*\)'\`
3968 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3969 if $test ! -d "\$dir"; then
3971 echo "\$me: can't locate home directory for: \$name" >&2
3976 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3992 : now set up to get a file name
3996 cat <<'EOSC' >>getfile
4012 : getfile will accept an answer from the comma-separated list
4013 : enclosed in parentheses even if it does not meet other criteria.
4014 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4015 fn=`echo $fn | sed 's/(.*)//'`
4021 loc_file=`expr $fn : '.*:\(.*\)'`
4022 fn=`expr $fn : '\(.*\):.*'`
4030 */*) fullpath=true;;
4039 *e*) exp_file=true;;
4042 *p*) nopath_ok=true;;
4047 *d*) type='Directory';;
4048 *l*) type='Locate';;
4053 Locate) what='File';;
4058 case "$d_portable" in
4066 while test "$type"; do
4071 true) rp="$rp (~name ok)";;
4074 if test -f UU/getfile.ok && \
4075 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4094 value=`UU/filexp $ans`
4097 if test "$ans" != "$value"; then
4098 echo "(That expands to $value on this system.)"
4112 /*) value="$ansexp" ;;
4113 [a-zA-Z]:/*) value="$ansexp" ;;
4118 echo "I shall only accept a full path name, as in /bin/ls." >&4
4119 echo "Use a ! shell escape if you wish to check pathnames." >&4
4122 echo "Please give a full path name, starting with slash." >&4
4125 echo "Note that using ~name is ok provided it expands well." >&4
4138 for fp in $gfpth; do
4139 if test "X$fp" = X.; then
4144 if test -f "$pf"; then
4146 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4148 echo "($value is not a plain file, but that's ok.)"
4151 if test X"$type" = X; then
4158 for fp in $gfpth; do
4159 if test "X$fp" = X.; then
4164 direxp="$fp/$ansexp"
4166 if test -d "$direxp"; then
4174 if test -d "$ansexp"; then
4175 echo "(Looking for $loc_file in directory $value.)"
4176 value="$value/$loc_file"
4177 ansexp="$ansexp/$loc_file"
4179 if test -f "$ansexp"; then
4182 case "$nopath_ok" in
4183 true) case "$value" in
4185 *) echo "Assuming $value will be in people's path."
4201 if test "$fastread" = yes; then
4206 rp="$what $value doesn't exist. Use that name anyway?"
4225 test "X$gfpthkeep" != Xy && gfpth=""
4228 : What should the include directory be ?
4230 $echo $n "Hmm... $c"
4234 if $test -f /bin/mips && /bin/mips; then
4235 echo "Looks like a MIPS system..."
4236 $cat >usr.c <<'EOCP'
4237 #ifdef SYSTYPE_BSD43
4241 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4242 dflt='/bsd43/usr/include'
4246 mips_type='System V'
4248 $rm -f usr.c usr.out
4249 echo "and you're compiling with the $mips_type compiler and libraries."
4253 echo "Doesn't look like a MIPS system."
4263 case "$xxx_prompt" in
4266 rp='Where are the include files you want to use?'
4274 : see how we invoke the C preprocessor
4276 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4277 cat <<'EOT' >testcpp.c
4283 if test ! -f cppstdin; then
4284 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4285 # AIX cc -E doesn't show the absolute headerfile
4286 # locations but we'll cheat by using the -M flag.
4287 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
4289 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4292 echo "Keeping your $hint cppstdin wrapper."
4295 wrapper=`pwd`/cppstdin
4299 if $test "X$cppstdin" != "X" && \
4300 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4301 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4303 echo "You used to use $cppstdin $cppminus so we'll use that again."
4305 '') echo "But let's see if we can live without a wrapper..." ;;
4307 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4308 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4310 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4313 echo "(However, $cpprun $cpplast does not work, let's see...)"
4321 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4328 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4329 $cc -E <testcpp.c >testcpp.out 2>&1; \
4330 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4331 echo "Yup, it does."
4334 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4335 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4336 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4337 echo "Yup, it does."
4340 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4341 $cc -P <testcpp.c >testcpp.out 2>&1; \
4342 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4343 echo "Yipee, that works!"
4346 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4347 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4348 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4349 echo "At long last!"
4352 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4353 $cpp <testcpp.c >testcpp.out 2>&1; \
4354 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4358 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4359 $cpp - <testcpp.c >testcpp.out 2>&1; \
4360 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4361 echo "Hooray, it works! I was beginning to wonder."
4364 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4365 $wrapper <testcpp.c >testcpp.out 2>&1; \
4366 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4372 rp="No dice. I can't find a C preprocessor. Name one:"
4376 $x_cpp <testcpp.c >testcpp.out 2>&1
4377 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4378 echo "OK, that will do." >&4
4380 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4395 echo "Perhaps can we force $cc -E using a wrapper..."
4396 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4397 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4403 echo "Nope, we'll have to live without it..."
4417 "$wrapper"|'cppstdin') ;;
4418 *) $rm -f $wrapper;;
4420 $rm -f testcpp.c testcpp.out
4422 : Set private lib path
4425 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4430 '') dlist="$loclibpth $plibpth $glibpth";;
4431 *) dlist="$libpth";;
4434 : Now check and see which directories actually exist, avoiding duplicates
4438 if $test -d $xxx; then
4441 *) libpth="$libpth $xxx";;
4447 Some systems have incompatible or broken versions of libraries. Among
4448 the directories listed in the question below, please remove any you
4449 know not to be holding relevant libraries, and add any that are needed.
4450 Say "none" for none.
4461 rp="Directories to use for library searches?"
4468 : compute shared library extension
4471 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4481 On some systems, shared libraries may be available. Answer 'none' if
4482 you want to suppress searching of shared libraries for the remainder
4483 of this configuration.
4486 rp='What is the file extension used for shared libraries?'
4490 : Define several unixisms.
4491 : Hints files or command line option can be used to override them.
4492 : The convoluted testing is in case hints files set either the old
4495 '') case "$exe_ext" in
4497 *) _exe="$exe_ext" ;;
4502 '') case "$lib_ext" in
4509 '') case "$obj_ext" in
4516 '') case "$path_sep" in
4527 : Which makefile gets called first. This is used by make depend.
4528 case "$firstmakefile" in
4529 '') firstmakefile='makefile';;
4533 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4536 case "$uselongdouble" in
4537 $define|true|[yY]*) dflt='y';;
4542 Perl can be built to take advantage of long doubles which
4543 (if available) may give more accuracy and range for floating point numbers.
4545 If this doesn't make any sense to you, just accept the default '$dflt'.
4547 rp='Try to use long doubles if available?'
4550 y|Y) val="$define" ;;
4556 case "$uselongdouble" in
4557 true|[yY]*) uselongdouble="$define" ;;
4560 : Look for a hint-file generated 'call-back-unit'. If the
4561 : user has specified that long doubles should be used,
4562 : we may need to set or change some other defaults.
4563 if $test -f uselongdouble.cbu; then
4564 echo "Your platform has some specific hints regarding long doubles, using them..."
4565 . ./uselongdouble.cbu
4567 case "$uselongdouble" in
4570 (Your platform does not have any specific hints for long doubles.)
4576 : Looking for optional libraries
4578 echo "Checking for optional libraries..." >&4
4583 case "$libswanted" in
4584 '') libswanted='c_s';;
4587 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4593 for thisdir in $libpth $xlibpth; do
4594 test -d $thisdir && libspath="$libspath $thisdir"
4596 for thislib in $libswanted; do
4597 for thisdir in $libspath; do
4599 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4600 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4601 $test -f "$xxx" && eval $libscheck
4602 $test -f "$xxx" && libstyle=shared
4604 if test ! -f "$xxx"; then
4605 xxx=$thisdir/lib$thislib.$so
4606 $test -f "$xxx" && eval $libscheck
4607 $test -f "$xxx" && libstyle=shared
4609 if test ! -f "$xxx"; then
4610 xxx=$thisdir/lib$thislib$_a
4611 $test -f "$xxx" && eval $libscheck
4612 $test -f "$xxx" && libstyle=static
4614 if test ! -f "$xxx"; then
4615 xxx=$thisdir/$thislib$_a
4616 $test -f "$xxx" && eval $libscheck
4617 $test -f "$xxx" && libstyle=static
4619 if test ! -f "$xxx"; then
4620 xxx=$thisdir/lib${thislib}_s$_a
4621 $test -f "$xxx" && eval $libscheck
4622 $test -f "$xxx" && libstyle=static
4623 $test -f "$xxx" && thislib=${thislib}_s
4625 if test ! -f "$xxx"; then
4626 xxx=$thisdir/Slib$thislib$_a
4627 $test -f "$xxx" && eval $libscheck
4628 $test -f "$xxx" && libstyle=static
4630 if $test -f "$xxx"; then
4632 shared) echo "Found -l$thislib (shared)." ;;
4633 static) echo "Found -l$thislib." ;;
4634 *) echo "Found -l$thislib ($libstyle)." ;;
4638 *) dflt="$dflt -l$thislib"
4639 libsfound="$libsfound $xxx"
4641 libsfiles="$libsfiles $yyy"
4642 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4643 case " $libsdirs " in
4645 *) libsdirs="$libsdirs $yyy" ;;
4652 if $test ! -f "$xxx"; then
4653 echo "No -l$thislib."
4664 ' '|'') dflt='none';;
4669 In order to compile $package on your machine, a number of libraries
4670 are usually needed. Include any other special libraries here as well.
4671 Say "none" for none. The default list is almost always right.
4675 rp="What libraries to use?"
4682 : determine optimization, if desired, or use for debug flag also
4684 ' '|$undef) dflt='none';;
4686 *) dflt="$optimize";;
4690 By default, $package compiles with the -O flag to use the optimizer.
4691 Alternately, you might want to use the symbolic debugger, which uses
4692 the -g flag (on traditional Unix systems). Either flag can be
4693 specified here. To use neither flag, specify the word "none".
4696 rp="What optimizer/debugger flag should be used?"
4700 'none') optimize=" ";;
4704 : We will not override a previous value, but we might want to
4705 : augment a hint file
4707 default|recommended)
4708 case "$gccversion" in
4709 1*) dflt='-fpcc-struct-return' ;;
4712 *-g*) dflt="$dflt -DDEBUGGING";;
4714 case "$gccversion" in
4715 2*) if test -d /etc/conf/kconfig.d &&
4716 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4718 # Interactive Systems (ISC) POSIX mode.
4723 case "$gccversion" in
4727 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4728 echo 'int main(void) { return 0; }' > gcctest.c
4729 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4730 echo "Yes, it does." 2>&1
4733 echo "Leaving current flags $ccflags alone." 2>&1
4735 *) dflt="$dflt -fno-strict-aliasing" ;;
4738 echo "Nope, it doesn't, but that's ok." 2>&1
4742 # For gcc, adding -pipe speeds up compilations for some, but apparently
4743 # some assemblers can't read from stdin. (It also slows down compilations
4744 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4745 case "$gccversion" in
4747 echo "Checking if your compiler accepts -pipe" 2>&1
4748 echo 'int main(void) { return 0; }' > gcctest.c
4749 if $cc -O2 -pipe -o gcctest gcctest.c; then
4750 echo "Yes, it does." 2>&1
4753 echo "Leaving current flags $ccflags alone." 2>&1
4755 *) dflt="$dflt -pipe" ;;
4758 echo "Nope, it doesn't, but that's ok." 2>&1
4765 case "$mips_type" in
4766 *BSD*|'') inclwanted="$locincpth $usrinc";;
4767 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4769 for thisincl in $inclwanted; do
4770 if $test -d $thisincl; then
4771 if $test x$thisincl != x$usrinc; then
4773 *" -I$thisincl "*);;
4774 *) dflt="$dflt -I$thisincl ";;
4780 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4782 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4790 *) dflt="$dflt -D$2";;
4794 set signal.h LANGUAGE_C; eval $inctest
4798 ccflags="$ccflags -DSOCKS"
4803 default|recommended) dflt="$ccflags $dflt" ;;
4804 *) dflt="$ccflags";;
4813 Your C compiler may want other flags. For this question you should include
4814 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4815 but you should NOT include libraries or ld flags like -lwhatever. If you
4816 want $package to honor its debug switch, you should include -DDEBUGGING here.
4817 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4819 To use no flags, specify the word "none".
4825 rp="Any additional cc flags?"
4832 : the following weeds options from ccflags that are of no interest to cpp
4834 '') cppflags="$ccflags" ;;
4835 *) cppflags="$cppflags $ccflags" ;;
4837 case "$gccversion" in
4838 1*) cppflags="$cppflags -D__GNUC__"
4840 case "$mips_type" in
4842 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4848 echo "Let me guess what the preprocessor flags are..." >&4
4862 *) ftry="$previous $flag";;
4864 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4865 >cpp1.out 2>/dev/null && \
4866 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4867 >cpp2.out 2>/dev/null && \
4868 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4869 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4871 cppflags="$cppflags $ftry"
4881 *-*) echo "They appear to be: $cppflags";;
4883 $rm -f cpp.c cpp?.out
4887 : flags used in final linking phase
4889 '') if ./venix; then
4895 *-posix*) dflt="$dflt -posix" ;;
4898 *) dflt="$ldflags";;
4901 : Try to guess additional flags to pick up local libraries.
4902 for thislibdir in $libpth; do
4903 case " $loclibpth " in
4906 *"-L$thislibdir "*) ;;
4907 *) dflt="$dflt -L$thislibdir" ;;
4919 Your C linker may need flags. For this question you should
4920 include -L/whatever and any other flags used by the C linker, but you
4921 should NOT include libraries like -lwhatever.
4923 Make sure you include the appropriate -L/path flags if your C linker
4924 does not normally search all of the directories you specified above,
4927 To use no flags, specify the word "none".
4931 rp="Any additional ld flags (NOT including libraries)?"
4937 rmlist="$rmlist pdp11"
4941 echo "Checking your choice of C compiler and flags for coherency..." >&4
4942 $cat > try.c <<'EOF'
4944 int main() { printf("Ok\n"); return(0); }
4946 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4948 $cat >try.msg <<'EOM'
4949 I've tried to compile and run the following simple program:
4952 $cat try.c >> try.msg
4954 $cat >> try.msg <<EOM
4961 and I got the following output:
4965 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4966 if $sh -c "$run ./try" >>try.msg 2>&1; then
4970 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4973 cat >> try.msg <<'EOQS'
4974 If $libs contains -lsfio, and sfio is mis-configured, then it
4975 sometimes (apparently) runs and exits with a 0 status, but with no
4976 output! It may have to do with sfio's use of _exit vs. exit.
4979 rp="You have a big problem. Shall I abort Configure"
4986 echo "The program compiled OK, but exited with status $?." >>try.msg
4987 rp="You have a problem. Shall I abort Configure"
4991 echo "I can't compile the test program." >>try.msg
4992 rp="You have a BIG problem. Shall I abort Configure"
4998 case "$knowitall" in
5000 echo "(The supplied flags or libraries might be incorrect.)"
5008 *) echo "Ok. Stopping Configure." >&4
5013 n) echo "OK, that should do.";;
5015 $rm -f try try.* core
5017 : define a shorthand compile call
5021 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5022 : define a shorthand compile call for compilations that should be ok.
5026 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5028 : determine filename position in cpp output
5030 echo "Computing filename position in cpp output for #include directives..." >&4
5032 vos) testaccess=-e ;;
5035 echo '#include <stdio.h>' > foo.c
5038 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5039 $grep '^[ ]*#.*stdio\.h' | \
5040 while read cline; do
5043 while $test \$# -gt 0; do
5044 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5049 pos=\`expr \$pos + 1\`
5061 *) pos="${fieldn}th";;
5063 echo "Your cpp writes the filename in the $pos field of the line."
5066 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5067 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5070 : locate header file
5075 for usrincdir in $usrinc
5077 if test -f \$usrincdir/\$wanted; then
5078 echo "\$usrincdir/\$wanted"
5082 awkprg='{ print \$$fieldn }'
5083 echo "#include <\$wanted>" > foo\$\$.c
5084 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5085 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5086 while read cline; do
5087 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5089 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5090 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5095 # status = 0: grep returned 0 lines, case statement not executed
5096 # status = 1: headerfile found
5097 # status = 2: while loop executed, no headerfile found
5101 if test \$status -eq 1; then
5108 : define an alternate in-header-list? function
5109 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5110 cont=true; xxf="echo \"<\$1> found.\" >&4";
5111 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5112 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5114 case $# in 4) instead=instead;; *) instead="at last";; esac;
5115 while $test "$cont"; do
5117 var=$2; eval "was=\$$2";
5118 if $test "$xxx" && $test -r "$xxx";
5120 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5123 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5124 set $yyy; shift; shift; yyy=$@;
5125 case $# in 0) cont="";;
5126 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5127 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5128 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5129 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5133 do set $yyy; var=$2; eval "was=\$$2";
5134 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5135 set $yyy; shift; shift; yyy=$@;
5138 : see if stdlib is available
5139 set stdlib.h i_stdlib
5142 : check for lengths of integral types
5146 echo "Checking to see how big your integers are..." >&4
5155 printf("intsize=%d;\n", (int)sizeof(int));
5156 printf("longsize=%d;\n", (int)sizeof(long));
5157 printf("shortsize=%d;\n", (int)sizeof(short));
5162 if eval $compile_ok && $run ./try > /dev/null; then
5164 echo "Your integers are $intsize bytes long."
5165 echo "Your long integers are $longsize bytes long."
5166 echo "Your short integers are $shortsize bytes long."
5170 Help! I can't compile and run the intsize test program: please enlighten me!
5171 (This is probably a misconfiguration in your system or libraries, and
5172 you really ought to fix it. Still, I'll try anyway.)
5176 rp="What is the size of an integer (in bytes)?"
5180 rp="What is the size of a long integer (in bytes)?"
5184 rp="What is the size of a short integer (in bytes)?"
5192 : check for long long
5194 echo "Checking to see if you have long long..." >&4
5195 echo 'int main() { long long x = 7; return 0; }' > try.c
5197 if eval $compile; then
5199 echo "You have long long."
5202 echo "You do not have long long."
5208 : check for length of long long
5209 case "${d_longlong}${longlongsize}" in
5212 echo "Checking to see how big your long longs are..." >&4
5213 $cat >try.c <<'EOCP'
5217 printf("%d\n", (int)sizeof(long long));
5222 if eval $compile_ok; then
5223 longlongsize=`$run ./try`
5224 echo "Your long longs are $longlongsize bytes long."
5228 echo "(I can't seem to compile the test program. Guessing...)"
5229 rp="What is the size of a long long (in bytes)?"
5233 if $test "X$longsize" = "X$longlongsize"; then
5234 echo "(That isn't any different from an ordinary long.)"
5240 : see if inttypes.h is available
5241 : we want a real compile instead of Inhdr because some systems
5242 : have an inttypes.h which includes non-existent headers
5245 #include <inttypes.h>
5247 static int32_t foo32 = 0x12345678;
5251 if eval $compile; then
5252 echo "<inttypes.h> found." >&4
5255 echo "<inttypes.h> NOT found." >&4
5264 echo "Checking to see if you have int64_t..." >&4
5266 #include <sys/types.h>
5267 #$i_inttypes I_INTTYPES
5269 #include <inttypes.h>
5271 int main() { int64_t x = 7; }
5274 if eval $compile; then
5276 echo "You have int64_t."
5279 echo "You do not have int64_t."
5287 echo "Checking which 64-bit integer type we could use..." >&4
5293 val='"unsigned int"'
5298 *) case "$longsize" in
5302 val='"unsigned long"'
5307 *) case "$d_longlong:$longlongsize" in
5312 val='"unsigned long long"'
5317 *) case "$d_int64_t" in
5336 '') echo "Alas, no 64-bit integer types in sight." >&4
5339 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5345 case "$uselonglong" in
5346 "$define"|true|[yY]*)
5349 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5351 use64bitint="$define"
5354 case "$use64bits" in
5355 "$define"|true|[yY]*)
5358 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5360 use64bitint="$define"
5363 case "$use64bitints" in
5364 "$define"|true|[yY]*)
5367 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5369 use64bitint="$define"
5372 case "$use64bitsint" in
5373 "$define"|true|[yY]*)
5376 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5378 use64bitint="$define"
5381 case "$uselonglongs" in
5382 "$define"|true|[yY]*)
5385 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5387 use64bitint="$define"
5390 case "$use64bitsall" in
5391 "$define"|true|[yY]*)
5394 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5396 use64bitall="$define"
5401 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5403 case "$use64bitall" in
5404 "$define"|true|[yY]*) use64bitint="$define" ;;
5410 You have natively 64-bit long integers.
5414 *) case "$use64bitint" in
5415 "$define"|true|[yY]*) dflt='y';;
5424 Perl can be built to take advantage of 64-bit integer types
5425 on some systems. To do so, Configure can be run with -Duse64bitint.
5426 Choosing this option will most probably introduce binary incompatibilities.
5428 If this doesn't make any sense to you, just accept the default '$dflt'.
5429 (The default has been chosen based on your configuration.)
5431 rp='Try to use 64-bit integers, if available?'
5434 [yY]*) val="$define" ;;
5442 case "$use64bitall" in
5443 "$define"|true|[yY]*) dflt='y' ;;
5444 *) case "$longsize" in
5452 You may also choose to try maximal 64-bitness. It means using as much
5453 64-bitness as possible on the platform. This in turn means even more
5454 binary incompatibilities. On the other hand, your platform may not
5455 have any more 64-bitness available than what you already have chosen.
5457 If this doesn't make any sense to you, just accept the default '$dflt'.
5458 (The default has been chosen based on your configuration.)
5460 rp='Try to use maximal 64-bit support, if available?'
5463 [yY]*) val="$define" ;;
5468 case "$use64bitall" in
5470 case "$use64bitint" in
5474 Since you have chosen a maximally 64-bit build, I'm also turning on
5475 the use of 64-bit integers.
5477 use64bitint="$define" ;;
5482 : Look for a hint-file generated 'call-back-unit'. If the
5483 : user has specified that a 64-bit perl is to be built,
5484 : we may need to set or change some other defaults.
5485 if $test -f use64bitint.cbu; then
5486 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5489 case "$use64bitint" in
5490 "$define"|true|[yY]*)
5492 4) case "$archname64" in
5493 '') archname64=64int ;;
5500 : Look for a hint-file generated 'call-back-unit'. If the
5501 : user has specified that a maximally 64-bit perl is to be built,
5502 : we may need to set or change some other defaults.
5503 if $test -f use64bitall.cbu; then
5504 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5507 case "$use64bitall" in
5508 "$define"|true|[yY]*)
5510 4) case "$archname64" in
5511 ''|64int) archname64=64all ;;
5518 case "$d_quad:$use64bitint" in
5522 *** You have chosen to use 64-bit integers,
5523 *** but none can be found.
5524 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5525 *** Cannot continue, aborting.
5532 : check for length of double
5534 case "$doublesize" in
5536 echo "Checking to see how big your double precision numbers are..." >&4
5545 printf("%d\n", (int)sizeof(double));
5550 if eval $compile_ok; then
5551 doublesize=`$run ./try`
5552 echo "Your double is $doublesize bytes long."
5555 echo "(I can't seem to compile the test program. Guessing...)"
5556 rp="What is the size of a double precision number (in bytes)?"
5564 : check for long doubles
5566 echo "Checking to see if you have long double..." >&4
5567 echo 'int main() { long double x = 7.0; }' > try.c
5569 if eval $compile; then
5571 echo "You have long double."
5574 echo "You do not have long double."
5580 : check for length of long double
5581 case "${d_longdbl}${longdblsize}" in
5584 echo "Checking to see how big your long doubles are..." >&4
5585 $cat >try.c <<'EOCP'
5589 printf("%d\n", sizeof(long double));
5594 if eval $compile; then
5595 longdblsize=`$run ./try`
5596 echo "Your long doubles are $longdblsize bytes long."
5600 echo "(I can't seem to compile the test program. Guessing...)" >&4
5601 rp="What is the size of a long double (in bytes)?"
5605 if $test "X$doublesize" = "X$longdblsize"; then
5606 echo "That isn't any different from an ordinary double."
5607 echo "I'll keep your setting anyway, but you may see some"
5608 echo "harmless compilation warnings."
5614 : determine the architecture name
5616 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5617 tarch=`arch`"-$osname"
5618 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5619 if uname -m > tmparch 2>&1 ; then
5620 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5621 -e 's/$/'"-$osname/" tmparch`
5629 case "$myarchname" in
5632 echo "(Your architecture name used to be $myarchname.)"
5636 case "$targetarch" in
5638 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5643 *) dflt="$archname";;
5645 rp='What is your architecture name'
5648 case "$usethreads" in
5650 echo "Threads selected." >&4
5652 *-thread*) echo "...and architecture name already has -thread." >&4
5654 *) archname="$archname-thread"
5655 echo "...setting architecture name to $archname." >&4
5660 case "$usemultiplicity" in
5662 echo "Multiplicity selected." >&4
5664 *-multi*) echo "...and architecture name already has -multi." >&4
5666 *) archname="$archname-multi"
5667 echo "...setting architecture name to $archname." >&4
5672 case "$use64bitint$use64bitall" in
5674 case "$archname64" in
5676 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5679 case "$use64bitint" in
5680 "$define") echo "64 bit integers selected." >&4 ;;
5682 case "$use64bitall" in
5683 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5686 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5688 *) archname="$archname-$archname64"
5689 echo "...setting architecture name to $archname." >&4
5695 case "$uselongdouble" in
5697 echo "Long doubles selected." >&4
5698 case "$longdblsize" in
5700 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5704 *-ld*) echo "...and architecture name already has -ld." >&4
5706 *) archname="$archname-ld"
5707 echo "...setting architecture name to $archname." >&4
5714 case "$useperlio" in
5716 echo "Perlio selected." >&4
5719 echo "Perlio not selected, using stdio." >&4
5721 *-stdio*) echo "...and architecture name already has -stdio." >&4
5723 *) archname="$archname-stdio"
5724 echo "...setting architecture name to $archname." >&4
5729 if $test -f archname.cbu; then
5730 echo "Your platform has some specific hints for architecture name, using them..."
5734 : determine root of directory hierarchy where package will be installed.
5737 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5740 dflt=`echo "$prefix" | sed 's/.$//'`
5748 By default, $package will be installed in $dflt/bin, manual pages
5749 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5750 installation directories. Typically this is something like /usr/local.
5751 If you wish to have binaries under /usr/bin but other parts of the
5752 installation under /usr/local, that's ok: you will be prompted
5753 separately for each of the installation directories, the prefix being
5754 only used to set the defaults.
5758 rp='Installation prefix to use?'
5766 *) oldprefix="$prefix";;
5775 *) afsroot=$afsroot ;;
5781 $define|true) afs=true ;;
5782 $undef|false) afs=false ;;
5783 *) if test -d $afsroot; then
5791 echo "AFS may be running... I'll be extra cautious then..." >&4
5793 echo "AFS does not seem to be running..." >&4
5796 : determine installation prefix for where package is to be installed.
5800 Since you are running AFS, I need to distinguish the directory in which
5801 files will reside from the directory in which they are installed (and from
5802 which they are presumably copied to the former directory by occult means).
5805 case "$installprefix" in
5806 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5807 *) dflt="$installprefix";;
5812 In some special cases, particularly when building $package for distribution,
5813 it is convenient to distinguish the directory in which files should be
5814 installed from the directory ($prefix) in which they will
5815 eventually reside. For most users, these two directories are the same.
5818 case "$installprefix" in
5820 *) dflt=$installprefix;;
5824 rp='What installation prefix should I use for installing files?'
5826 installprefix="$ans"
5827 installprefixexp="$ansexp"
5829 : set the prefixit variable, to compute a suitable default value
5830 prefixit='case "$3" in
5832 case "$oldprefix" in
5833 "") eval "$1=\"\$$2\"";;
5840 ""|" ") eval "$1=\"\$$2\"";;
5846 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5848 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5849 /*-$oldprefix/*|\~*-$oldprefix/*)
5850 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5851 *) eval "$1=\"\$$2\"";;
5855 : get the patchlevel
5857 echo "Getting the current patchlevel..." >&4
5858 if $test -r $rsrc/patchlevel.h;then
5859 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5860 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5861 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5862 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5863 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5864 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5865 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5874 $echo "(You do not have patchlevel.h. Eek.)"
5876 if $test -r $rsrc/.patch ; then
5877 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5878 perl_patchlevel=`cat $rsrc/.patch`
5881 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5882 version_patchlevel_string="version $patchlevel subversion $subversion"
5883 case "$perl_patchlevel" in
5885 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5888 $echo "(You have $package $version_patchlevel_string.)"
5892 : XXX Should be a Configure test for double-dots in filenames.
5893 version=`echo $revision $patchlevel $subversion | \
5894 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5895 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5896 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5899 version=`echo $revision $patchlevel $subversion | \
5900 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5901 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5902 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5905 : Special case the 5.005_xx maintenance series, which used 5.005
5906 : without any subversion label as a subdirectory in $sitelib
5907 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5908 api_versionstring='5.005'
5911 : determine installation style
5912 : For now, try to deduce it from prefix unless it is already set.
5913 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5914 case "$installstyle" in
5915 '') case "$prefix" in
5916 *perl*) dflt='lib';;
5917 *) dflt='lib/perl5' ;;
5920 *) dflt="$installstyle" ;;
5922 : Probably not worth prompting for this since we prompt for all
5923 : the directories individually, and the prompt would be too long and
5927 : determine where private library files go
5928 : Usual default is /usr/local/lib/perl5/$version.
5929 : Also allow things like /opt/perl/lib/$version, since
5930 : /opt/perl/lib/perl5... would be redundant.
5931 : The default "style" setting is made in installstyle.U
5932 case "$installstyle" in
5933 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5934 *) set dflt privlib lib/$version ;;
5939 There are some auxiliary files for $package that need to be put into a
5940 private library directory that is accessible by everyone.
5944 rp='Pathname where the private library files will reside?'
5947 privlibexp="$ansexp"
5948 : Change installation prefix, if necessary.
5949 if $test X"$prefix" != X"$installprefix"; then
5950 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5952 installprivlib="$privlibexp"
5955 : set the prefixup variable, to restore leading tilda escape
5956 prefixup='case "$prefixexp" in
5958 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5961 : determine where public architecture dependent libraries go
5964 : privlib default is /usr/local/lib/$package/$version
5965 : archlib default is /usr/local/lib/$package/$version/$archname
5966 : privlib may have an optional trailing /share.
5967 tdflt=`echo $privlib | $sed 's,/share$,,'`
5968 tdflt=$tdflt/$archname
5977 $spackage contains architecture-dependent library files. If you are
5978 sharing libraries in a heterogeneous environment, you might store
5979 these files in a separate location. Otherwise, you can just include
5980 them with the rest of the public library files.
5984 rp='Where do you want to put the public architecture-dependent libraries?'
5987 archlibexp="$ansexp"
5988 if $test X"$archlib" = X"$privlib"; then
5993 : Change installation prefix, if necessary.
5994 if $test X"$prefix" != X"$installprefix"; then
5995 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
5997 installarchlib="$archlibexp"
6000 : see if setuid scripts can be secure
6003 Some kernels have a bug that prevents setuid #! scripts from being
6004 secure. Some sites have disabled setuid #! scripts because of this.
6006 First let's decide if your kernel supports secure setuid #! scripts.
6007 (If setuid #! scripts would be secure but have been disabled anyway,
6008 don't say that they are secure if asked.)
6013 if $test -d /dev/fd; then
6014 echo "#!$ls" >reflect
6015 chmod +x,u+s reflect
6016 ./reflect >flect 2>&1
6017 if $contains "/dev/fd" flect >/dev/null; then
6018 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6022 If you are not sure if they are secure, I can check but I'll need a
6023 username and password different from the one you are using right now.
6024 If you don't have such a username or don't want me to test, simply
6028 rp='Other username to test security of setuid scripts with?'
6033 case "$d_suidsafe" in
6034 '') echo "I'll assume setuid scripts are *not* secure." >&4
6037 echo "Well, the $hint value is *not* secure." >&4
6039 *) echo "Well, the $hint value *is* secure." >&4
6044 $rm -f reflect flect
6045 echo "#!$ls" >reflect
6046 chmod +x,u+s reflect
6049 echo '"su" will (probably) prompt you for '"$ans's password."
6050 su $ans -c './reflect >flect'
6051 if $contains "/dev/fd" flect >/dev/null; then
6052 echo "Okay, it looks like setuid scripts are secure." >&4
6055 echo "I don't think setuid scripts are secure." >&4
6060 rp='Does your kernel have *secure* setuid scripts?'
6063 [yY]*) val="$define";;
6068 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6069 echo "(That's for file descriptors, not floppy disks.)"
6075 $rm -f reflect flect
6077 : now see if they want to do setuid emulation
6080 case "$d_suidsafe" in
6083 echo "No need to emulate SUID scripts since they are secure here." >&4
6087 Some systems have disabled setuid scripts, especially systems where
6088 setuid scripts cannot be secure. On systems where setuid scripts have
6089 been disabled, the setuid/setgid bits on scripts are currently
6090 useless. It is possible for $package to detect those bits and emulate
6091 setuid/setgid in a secure fashion. This emulation will only work if
6092 setuid scripts have been disabled in your kernel.
6096 "$define") dflt=y ;;
6099 rp="Do you want to do setuid/setgid emulation?"
6102 [yY]*) val="$define";;
6110 : see if this is a malloc.h system
6111 : we want a real compile instead of Inhdr because some systems have a
6112 : malloc.h that just gives a compile error saying to use stdlib.h instead
6117 int main () { return 0; }
6120 if eval $compile; then
6121 echo "<malloc.h> found." >&4
6124 echo "<malloc.h> NOT found." >&4
6131 : check for void type
6133 echo "Checking to see how well your C compiler groks the void type..." >&4
6134 case "$voidflags" in
6146 extern void moo(); /* function returning void */
6147 void (*goo)(); /* ptr to func returning void */
6149 void *hue; /* generic ptr */
6162 int main() { sub(); }
6164 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6165 voidflags=$defvoidused
6166 echo "Good. It appears to support void to the level $package wants.">&4
6167 if $contains warning .out >/dev/null 2>&1; then
6168 echo "However, you might get some warnings that look like this:"
6172 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6173 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6174 echo "It supports 1..."
6175 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6176 echo "It also supports 2..."
6177 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6179 echo "And it supports 4 but not 8 definitely."
6181 echo "It doesn't support 4..."
6182 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6184 echo "But it supports 8."
6187 echo "Neither does it support 8."
6191 echo "It does not support 2..."
6192 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6194 echo "But it supports 4 and 8."
6196 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6198 echo "And it supports 4 but has not heard about 8."
6200 echo "However it supports 8 but not 4."
6205 echo "There is no support at all for void."
6210 case "$voidflags" in
6213 Support flag bits are:
6214 1: basic void declarations.
6215 2: arrays of pointers to functions returning void.
6216 4: operations between pointers to and addresses of void functions.
6217 8: generic void pointers.
6220 rp="Your void support flags add up to what?"
6227 : check for length of pointer
6231 echo "Checking to see how big your pointers are..." >&4
6232 if test "$voidflags" -gt 7; then
6233 echo '#define VOID_PTR char *' > try.c
6235 echo '#define VOID_PTR void *' > try.c
6245 printf("%d\n", (int)sizeof(VOID_PTR));
6250 if eval $compile_ok; then
6251 ptrsize=`$run ./try`
6252 echo "Your pointers are $ptrsize bytes long."
6255 echo "(I can't seem to compile the test program. Guessing...)" >&4
6256 rp="What is the size of a pointer (in bytes)?"
6263 case "$use64bitall" in
6264 "$define"|true|[yY]*)
6268 *** You have chosen a maximally 64-bit build,
6269 *** but your pointers are only 4 bytes wide.
6270 *** Please rerun Configure without -Duse64bitall.
6275 *** Since you have quads, you could possibly try with -Duse64bitint.
6280 *** Cannot continue, aborting.
6291 : determine whether to use malloc wrapping
6293 case "$usemallocwrap" in
6294 [yY]*|true|$define) dflt='y' ;;
6295 [nN]*|false|$undef) dflt='n' ;;
6296 *) case "$usedevel" in
6297 [yY]*|true|$define) dflt='y' ;;
6302 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6304 usemallocwrap="$ans"
6307 usemallocwrap="$define" ;;
6309 usemallocwrap="$undef" ;;
6312 : determine which malloc to compile in
6314 case "$usemymalloc" in
6315 [yY]*|true|$define) dflt='y' ;;
6316 [nN]*|false|$undef) dflt='n' ;;
6317 *) case "$ptrsize" in
6323 rp="Do you wish to attempt to use the malloc that comes with $package?"
6329 mallocsrc='malloc.c'
6330 mallocobj="malloc$_o"
6331 d_mymalloc="$define"
6334 : Remove malloc from list of libraries to use
6335 echo "Removing unneeded -lmalloc from library list" >&4
6336 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6339 echo "libs = $libs" >&4
6351 : compute the return types of malloc and free
6353 $cat >malloc.c <<END
6357 #include <sys/types.h>
6371 case "$malloctype" in
6373 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6380 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6384 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6391 echo "Your system uses $freetype free(), it would seem." >&4
6395 After $package is installed, you may wish to install various
6396 add-on modules and utilities. Typically, these add-ons will
6397 be installed under $prefix with the rest
6398 of this package. However, you may wish to install such add-ons
6399 elsewhere under a different prefix.
6401 If you do not wish to put everything under a single prefix, that's
6402 ok. You will be prompted for the individual locations; this siteprefix
6403 is only used to suggest the defaults.
6405 The default should be fine for most people.
6409 rp='Installation prefix to use for add-on modules and utilities?'
6410 : XXX Here might be another good place for an installstyle setting.
6411 case "$siteprefix" in
6413 *) dflt=$siteprefix ;;
6416 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6418 case "$siteprefix" in
6422 *) oldsiteprefix="$prefix";;
6427 siteprefixexp="$ansexp"
6429 : determine where site specific libraries go.
6430 : Usual default is /usr/local/lib/perl5/site_perl/$version
6431 : The default "style" setting is made in installstyle.U
6432 : XXX No longer works with Prefixit stuff.
6433 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6435 '') case "$installstyle" in
6436 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6437 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6445 The installation process will create a directory for
6446 site-specific extensions and modules. Most users find it convenient
6447 to place all site-specific files in this directory rather than in the
6448 main distribution directory.
6452 rp='Pathname for the site-specific library files?'
6455 sitelibexp="$ansexp"
6456 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6457 : Change installation prefix, if necessary.
6458 if $test X"$prefix" != X"$installprefix"; then
6459 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6461 installsitelib="$sitelibexp"
6464 : determine where site specific architecture-dependent libraries go.
6465 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6466 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6467 : sitelib may have an optional trailing /share.
6469 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6470 dflt="$dflt/$archname"
6475 set sitearch sitearch none
6479 The installation process will also create a directory for
6480 architecture-dependent site-specific extensions and modules.
6484 rp='Pathname for the site-specific architecture-dependent library files?'
6487 sitearchexp="$ansexp"
6488 : Change installation prefix, if necessary.
6489 if $test X"$prefix" != X"$installprefix"; then
6490 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6492 installsitearch="$sitearchexp"
6497 The installation process will also create a directory for
6498 vendor-supplied add-ons. Vendors who supply perl with their system
6499 may find it convenient to place all vendor-supplied files in this
6500 directory rather than in the main distribution directory. This will
6501 ease upgrades between binary-compatible maintenance versions of perl.
6503 Of course you may also use these directories in whatever way you see
6504 fit. For example, you might use them to access modules shared over a
6505 company-wide network.
6507 The default answer should be fine for most people.
6508 This causes further questions about vendor add-ons to be skipped
6509 and no vendor-specific directories will be configured for perl.
6512 rp='Do you want to configure vendor-specific add-on directories?'
6513 case "$usevendorprefix" in
6514 define|true|[yY]*) dflt=y ;;
6515 *) : User may have set vendorprefix directly on Configure command line.
6516 case "$vendorprefix" in
6525 rp='Installation prefix to use for vendor-supplied add-ons?'
6526 case "$vendorprefix" in
6528 *) dflt=$vendorprefix ;;
6531 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6533 case "$vendorprefix" in
6537 *) oldvendorprefix="$prefix";;
6541 usevendorprefix="$define"
6543 vendorprefixexp="$ansexp"
6545 *) usevendorprefix="$undef"
6551 case "$vendorprefix" in
6552 '') d_vendorlib="$undef"
6556 *) d_vendorlib="$define"
6557 : determine where vendor-supplied modules go.
6558 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6559 case "$vendorlib" in
6561 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6562 case "$installstyle" in
6563 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6564 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6567 *) dflt="$vendorlib"
6571 rp='Pathname for the vendor-supplied library files?'
6574 vendorlibexp="$ansexp"
6577 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6578 : Change installation prefix, if necessary.
6579 if $test X"$prefix" != X"$installprefix"; then
6580 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6582 installvendorlib="$vendorlibexp"
6585 case "$vendorprefix" in
6586 '') d_vendorarch="$undef"
6590 *) d_vendorarch="$define"
6591 : determine where vendor-supplied architecture-dependent libraries go.
6592 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6593 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6594 : vendorlib may have an optional trailing /share.
6595 case "$vendorarch" in
6596 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6597 dflt="$dflt/$archname"
6599 *) dflt="$vendorarch" ;;
6602 rp='Pathname for vendor-supplied architecture-dependent files?'
6605 vendorarchexp="$ansexp"
6608 : Change installation prefix, if necessary.
6609 if $test X"$prefix" != X"$installprefix"; then
6610 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6612 installvendorarch="$vendorarchexp"
6615 : Final catch-all directories to search
6618 Lastly, you can have perl look in other directories for extensions and
6619 modules in addition to those already specified.
6620 These directories will be searched after
6624 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6625 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6627 case "$otherlibdirs" in
6628 ''|' ') dflt='none' ;;
6629 *) dflt="$otherlibdirs" ;;
6632 Enter a colon-separated set of extra paths to include in perl's @INC
6633 search path, or enter 'none' for no extra paths.
6637 rp='Colon-separated list of additional directories for perl to search?'
6640 ' '|''|none) otherlibdirs=' ' ;;
6641 *) otherlibdirs="$ans" ;;
6643 case "$otherlibdirs" in
6647 set d_perl_otherlibdirs
6650 : Cruising for prototypes
6652 echo "Checking out function prototypes..." >&4
6653 $cat >prototype.c <<EOCP
6658 int main(int argc, char *argv[]) {
6661 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6662 echo "Your C compiler appears to support function prototypes."
6665 echo "Your C compiler doesn't seem to understand function prototypes."
6672 case "$prototype" in
6674 *) ansi2knr='ansi2knr'
6679 This version of $package can only be compiled by a compiler that
6680 understands function prototypes. Unfortunately, your C compiler
6682 doesn't seem to understand them. Sorry about that.
6684 If GNU cc is available for your system, perhaps you could try that instead.
6686 Eventually, we hope to support building Perl with pre-ANSI compilers.
6687 If you would like to help in that effort, please contact <perlbug@perl.org>.
6689 Aborting Configure now.
6695 : determine where public executables go
6700 rp='Pathname where the public executables will reside?'
6702 if $test "X$ansexp" != "X$binexp"; then
6707 : Change installation prefix, if necessary.
6708 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6709 if $test X"$prefix" != X"$installprefix"; then
6710 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6712 installbin="$binexp"
6721 Perl can be built with extra modules or bundles of modules which
6722 will be fetched from the CPAN and installed alongside Perl.
6724 Notice that you will need access to the CPAN; either via the Internet,
6725 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6726 be asked later to configure the CPAN.pm module which will in turn do
6727 the installation of the rest of the extra modules or bundles.)
6729 Notice also that if the modules require any external software such as
6730 libraries and headers (the libz library and the zlib.h header for the
6731 Compress::Zlib module, for example) you MUST have any such software
6732 already installed, this configuration process will NOT install such
6735 If this doesn't make any sense to you, just accept the default '$dflt'.
6737 rp='Install any extra modules (y or n)?'
6743 Please list any extra modules or bundles to be installed from CPAN,
6744 with spaces between the names. The names can be in any format the
6745 'install' command of CPAN.pm will understand. (Answer 'none',
6746 without the quotes, to install no extra modules or bundles.)
6756 $rm -f ../extras.lst
6758 *) echo "(Saving the list of extras for later...)"
6759 echo "$extras" > ../extras.lst
6767 : determine where html pages for programs go
6768 set html1dir html1dir none
6772 If you wish to install html files for programs in $spackage, indicate
6773 the appropriate directory here. To skip installing html files,
6777 ''|none|$undef|' ') dflt=none ;;
6778 *) dflt=$html1dir ;;
6781 rp="Directory for the main $spackage html pages?"
6784 html1direxp="$ansexp"
6785 : Use ' ' for none so value is preserved next time through Configure
6786 $test X"$html1dir" = "X" && html1dir=' '
6787 : Change installation prefix, if necessary.
6788 if $test X"$prefix" != X"$installprefix"; then
6789 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
6791 installhtml1dir="$html1direxp"
6794 : determine where html pages for libraries and modules go
6795 set html3dir html3dir none
6799 If you wish to install html files for modules associated with $spackage,
6800 indicate the appropriate directory here. To skip installing html files,
6803 : There is no obvious default. If they have specified html1dir, then
6804 : try to key off that, possibly changing .../html1 into .../html3.
6806 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6807 *) dflt=$html3dir ;;
6810 rp="Directory for the $spackage module html pages?"
6813 html3direxp="$ansexp"
6814 : Use ' ' for none so value is preserved next time through Configure
6815 $test X"$html3dir" = "X" && html3dir=' '
6816 : Change installation prefix, if necessary.
6817 if $test X"$prefix" != X"$installprefix"; then
6818 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
6820 installhtml3dir="$html3direxp"
6823 : Find perl5.005 or later.
6824 echo "Looking for a previously installed perl5.005 or later... "
6826 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6827 : Check if this perl is recent and can load a simple module
6828 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6831 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6841 '') echo "None found. That's ok.";;
6842 *) echo "Using $perl5." ;;
6845 : Determine list of previous versions to include in @INC
6846 $cat > getverlist <<EOPL
6849 \$api_versionstring = "$api_versionstring";
6850 \$version = "$version";
6851 \$stem = "$sitelib_stem";
6852 \$archname = "$archname";
6854 $cat >> getverlist <<'EOPL'
6855 # Can't have leading @ because metaconfig interprets it as a command!
6856 ;@inc_version_list=();
6857 # XXX Redo to do opendir/readdir?
6860 ;@candidates = glob("5.*");
6866 # XXX ToDo: These comparisons must be reworked when two-digit
6867 # subversions come along, so that 5.7.10 compares as greater than
6868 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6869 # widespread that we can use the built-in version vectors rather
6870 # than reinventing them here. For 5.6.0, however, we must
6871 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6872 foreach $d (@candidates) {
6873 if ($d lt $version) {
6874 if ($d ge $api_versionstring) {
6875 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6877 elsif ($d ge "5.005") {
6878 unshift(@inc_version_list, grep { -d } $d);
6882 # Skip newer version. I.e. don't look in
6883 # 5.7.0 if we're installing 5.6.1.
6887 if (@inc_version_list) {
6888 print join(' ', @inc_version_list);
6891 # Blank space to preserve value for next Configure run.
6896 case "$inc_version_list" in
6897 '') if test -x "$perl5$exe_ext"; then
6898 dflt=`$perl5 getverlist`
6903 $undef) dflt='none' ;;
6904 *) eval dflt=\"$inc_version_list\" ;;
6907 ''|' ') dflt=none ;;
6914 In order to ease the process of upgrading, this version of perl
6915 can be configured to use modules built and installed with earlier
6916 versions of perl that were installed under $prefix. Specify here
6917 the list of earlier versions that this version of perl should check.
6918 If Configure detected no earlier versions of perl installed under
6919 $prefix, then the list will be empty. Answer 'none' to tell perl
6920 to not search earlier versions.
6922 The default should almost always be sensible, so if you're not sure,
6923 just accept the default.
6926 rp='List of earlier versions to include in @INC?'
6929 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6930 *) inc_version_list="$ans" ;;
6932 case "$inc_version_list" in
6934 inc_version_list_init='0';;
6935 *) inc_version_list_init=`echo $inc_version_list |
6936 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6941 : determine whether to install perl also as /usr/bin/perl
6944 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6946 Many scripts expect perl to be installed as /usr/bin/perl.
6948 If you want to, I can install the perl you are about to compile
6949 as /usr/bin/perl (in addition to $bin/perl).
6951 if test -f /usr/bin/perl; then
6954 However, please note that because you already have a /usr/bin/perl,
6955 overwriting that with a new Perl would very probably cause problems.
6956 Therefore I'm assuming you don't want to do that (unless you insist).
6959 case "$installusrbinperl" in
6960 "$define"|[yY]*) dflt='y';;
6966 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
6969 case "$installusrbinperl" in
6970 "$undef"|[nN]*) dflt='n';;
6974 rp="Do you want to install perl as /usr/bin/perl?"
6977 [yY]*) val="$define";;
6983 set installusrbinperl
6987 echo "Checking for GNU C Library..." >&4
6989 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6990 alone are insufficient to distinguish different versions, such as
6991 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6992 libc version 2.1.0. A. Dougherty, June 3, 2002.
6998 # ifdef __GLIBC_MINOR__
6999 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7000 # include <gnu/libc-version.h>
7001 printf("%s\n", gnu_get_libc_version());
7003 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7006 printf("%d\n", __GLIBC__);
7015 if eval $compile_ok && $run ./try > glibc.ver; then
7017 gnulibc_version=`$cat glibc.ver`
7018 echo "You are using the GNU C Library version $gnulibc_version"
7022 echo "You are not using the GNU C Library"
7024 $rm -f try try.* glibc.ver
7028 : see if nm is to be used to determine whether a symbol is defined or not
7032 case "$d_gnulibc" in
7035 echo "nm probably won't work on the GNU C Library." >&4
7041 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7043 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7044 echo "'nm' won't be sufficient on this sytem." >&4
7050 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7051 if $test $dflt -gt 20; then
7061 true|$define) dflt=y;;
7068 I can use $nm to extract the symbols from your C libraries. This
7069 is a time consuming task which may generate huge output on the disk (up
7070 to 3 megabytes) but that should make the symbols extraction faster. The
7071 alternative is to skip the 'nm' extraction part and to compile a small
7072 test program instead to determine whether each symbol is present. If
7073 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7074 this may be the best solution.
7076 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7079 rp="Shall I use $nm to extract C symbols from the libraries?"
7082 [Nn]*) usenm=false;;
7091 : nm options which may be necessary
7093 '') if $test -f /mach_boot; then
7095 elif $test -d /usr/ccs/lib; then
7096 nm_opt='-p' # Solaris (and SunOS?)
7097 elif $test -f /dgux; then
7099 elif $test -f /lib64/rld; then
7100 nm_opt='-p' # 64-bit Irix
7106 : nm options which may be necessary for shared libraries but illegal
7107 : for archive libraries. Thank you, Linux.
7108 case "$nm_so_opt" in
7109 '') case "$myuname" in
7111 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7112 nm_so_opt='--dynamic'
7121 : get list of predefined functions in a handy place
7126 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7132 *) for thislib in $libs; do
7135 : Handle C library specially below.
7138 thislib=`echo $thislib | $sed -e 's/^-l//'`
7139 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7141 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7143 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7145 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7147 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7149 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7151 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7156 libnames="$libnames $try"
7158 *) libnames="$libnames $thislib" ;;
7167 for xxx in $libpth; do
7168 $test -r $1 || set $xxx/libc.$so
7169 : The messy sed command sorts on library version numbers.
7171 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7172 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7174 s/[0-9][0-9]*/0000&/g
7175 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7178 $sort | $sed -e 's/^.* //'`
7181 $test -r $1 || set /usr/ccs/lib/libc.$so
7182 $test -r $1 || set /lib/libsys_s$_a
7188 if $test -r "$1"; then
7189 echo "Your (shared) C library seems to be in $1."
7191 elif $test -r /lib/libc && $test -r /lib/clib; then
7192 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7194 libc='/lib/clib /lib/libc'
7195 if $test -r /lib/syslib; then
7196 echo "(Your math library is in /lib/syslib.)"
7197 libc="$libc /lib/syslib"
7199 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7200 echo "Your C library seems to be in $libc, as you said before."
7201 elif $test -r $incpath/usr/lib/libc$_a; then
7202 libc=$incpath/usr/lib/libc$_a;
7203 echo "Your C library seems to be in $libc. That's fine."
7204 elif $test -r /lib/libc$_a; then
7206 echo "Your C library seems to be in $libc. You're normal."
7208 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7210 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7211 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7212 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7214 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7216 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7219 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7221 if $test -r "$tans"; then
7222 echo "Your C library seems to be in $tans, of all places."
7228 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7232 If the guess above is wrong (which it might be if you're using a strange
7233 compiler, or your machine supports multiple models), you can override it here.
7238 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7240 I can't seem to find your C library. I've looked in the following places:
7243 $sed 's/^/ /' libpath
7246 None of these seems to contain your C library. I need to get its name...
7251 rp='Where is your C library?'
7256 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7257 set X `cat libnames`
7260 case $# in 1) xxx=file; esac
7261 echo "Extracting names from the following $xxx for later perusal:" >&4
7263 $sed 's/^/ /' libnames >&4
7265 $echo $n "This may take a while...$c" >&4
7269 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7270 *) $nm $nm_opt $file 2>/dev/null;;
7275 $grep fprintf libc.tmp > libc.ptf
7276 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7277 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7279 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7281 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7283 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7285 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7287 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7289 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7291 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7293 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7295 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7297 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7299 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7301 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7303 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7304 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7306 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7308 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7310 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7312 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7314 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7316 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7318 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7320 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7322 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7324 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7326 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7328 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7330 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7332 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7334 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7337 $nm -p $* 2>/dev/null >libc.tmp
7338 $grep fprintf libc.tmp > libc.ptf
7339 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7340 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7346 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7348 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7349 for thisname in $libnames $libc; do
7350 $ar t $thisname >>libc.tmp
7352 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7354 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7355 # Repeat libc to extract forwarders to DLL entries too
7356 for thisname in $libnames $libc; do
7357 $ar tv $thisname >>libc.tmp
7358 # Revision 50 of EMX has bug in $ar.
7359 # it will not extract forwarders to DLL entries
7360 # Use emximp which will extract exactly them.
7361 emximp -o tmp.imp $thisname \
7363 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7364 < tmp.imp >>libc.tmp
7367 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7370 echo "$ar didn't seem to work right." >&4
7371 echo "Maybe this is a Cray...trying bld instead..." >&4
7372 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7374 for thisname in $libnames; do
7376 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7377 $ar t $thisname >>libc.tmp
7381 echo "That didn't work either. Giving up." >&4
7391 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7392 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7394 *) if $test -f /lib/syscalls.exp; then
7396 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7397 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7403 $rm -f libnames libpath
7405 : see if dld is available
7409 : is a C symbol defined?
7412 -v) tf=libc.tmp; tdc="";;
7413 -a) tf=libc.tmp; tdc="[]";;
7414 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7417 case "$reuseval-$4" in
7419 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7424 if $test "$runnm" = true; then
7425 if $contains $tlook $tf >/dev/null 2>&1; then
7427 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7428 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7429 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7430 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7431 $rm -f try$_exe try.c core core.* try.core;
7434 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7435 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7436 $rm -f try$_exe try.c;
7441 $define) tval=true;;
7448 : define an is-in-libc? function
7449 inlibc='echo " "; td=$define; tu=$undef;
7450 sym=$1; var=$2; eval "was=\$$2";
7452 case "$reuseval$was" in
7462 echo "$sym() found." >&4;
7463 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7465 echo "$sym() NOT found." >&4;
7466 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7470 $define) echo "$sym() found." >&4;;
7471 *) echo "$sym() NOT found." >&4;;
7475 : see if dlopen exists
7482 : determine which dynamic loading, if any, to compile in
7484 dldir="ext/DynaLoader"
7497 $define) dflt='y' ;;
7500 $define) dflt='y' ;;
7502 : Does a dl_xxx.xs file exist for this operating system
7503 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7506 rp="Do you wish to use dynamic loading?"
7513 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7514 dflt="$dldir/dl_${osname}.xs"
7515 elif $test "$d_dlopen" = "$define" ; then
7516 dflt="$dldir/dl_dlopen.xs"
7517 elif $test "$i_dld" = "$define" ; then
7518 dflt="$dldir/dl_dld.xs"
7523 *) dflt="$dldir/$dlsrc"
7526 echo "The following dynamic loading files are available:"
7527 : Can not go over to $dldir because getfile has path hard-coded in.
7528 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7529 rp="Source file to use for dynamic loading"
7535 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7539 Some systems may require passing special flags to $cc -c to
7540 compile modules that will be used to create a shared library.
7541 To use no flags, say "none".
7544 case "$cccdlflags" in
7545 '') case "$gccversion" in
7546 '') case "$osname" in
7548 next) dflt='none' ;;
7549 irix*) dflt='-KPIC' ;;
7550 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7551 sunos) dflt='-pic' ;;
7555 *) case "$osname" in
7556 darwin) dflt='none' ;;
7557 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7562 *) dflt="$cccdlflags" ;;
7564 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7567 none) cccdlflags=' ' ;;
7568 *) cccdlflags="$ans" ;;
7573 Some systems use ld to create libraries that can be dynamically loaded,
7574 while other systems (such as those using ELF) use $cc.
7578 '') $cat >try.c <<EOM
7579 /* Test for whether ELF binaries are produced */
7587 int i = open("a.out",O_RDONLY);
7590 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7591 exit(0); /* succeed (yes, it's ELF) */
7596 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7598 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7602 echo "I'll use ld to build dynamic libraries."
7611 rp="What command should be used to create dynamic libraries?"
7617 Some systems may require passing special flags to $ld to create a
7618 library that can be dynamically loaded. If your ld flags include
7619 -L/other/path options to locate libraries outside your loader's normal
7620 search path, you may need to specify those -L options here as well. To
7621 use no flags, say "none".
7624 case "$lddlflags" in
7625 '') case "$osname" in
7626 beos) dflt='-nostart' ;;
7628 case "$gccversion" in
7629 '') dflt="$dflt +vnocompatwarnings" ;;
7632 linux|irix*|gnu*) dflt='-shared' ;;
7633 next) dflt='none' ;;
7634 solaris) dflt='-G' ;;
7635 sunos) dflt='-assert nodefinitions' ;;
7636 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7640 *) dflt="$lddlflags" ;;
7643 : Try to guess additional flags to pick up local libraries.
7644 : Be careful not to append to a plain 'none'
7648 for thisflag in $ldflags; do
7653 *) dflt="$dflt $thisflag" ;;
7660 ''|' ') dflt='none' ;;
7663 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7666 none) lddlflags=' ' ;;
7667 *) lddlflags="$ans" ;;
7672 Some systems may require passing special flags to $cc to indicate that
7673 the resulting executable will use dynamic linking. To use no flags,
7677 case "$ccdlflags" in
7678 '') case "$osname" in
7679 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7680 next|sunos) dflt='none' ;;
7684 *) dflt="$ccdlflags" ;;
7686 rp="Any special flags to pass to $cc to use dynamic linking?"
7689 none) ccdlflags=' ' ;;
7690 *) ccdlflags="$ans" ;;
7704 # No dynamic loading being used, so don't bother even to prompt.
7707 *) case "$useshrplib" in
7708 '') case "$osname" in
7709 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7711 also='Building a shared libperl is required for dynamic loading to work on your system.'
7716 also='Building a shared libperl is needed for MAB support.'
7734 The perl executable is normally obtained by linking perlmain.c with
7735 libperl${_a}, any static extensions (usually just DynaLoader), and
7736 any other libraries needed on this system (such as -lm, etc.). Since
7737 your system supports dynamic loading, it is probably possible to build
7738 a shared libperl.$so. If you will have more than one executable linked
7739 to libperl.$so, this will significantly reduce the size of each
7740 executable, but it may have a noticeable affect on performance. The
7741 default is probably sensible for your system.
7745 rp="Build a shared libperl.$so (y/n)"
7749 useshrplib='true' ;;
7750 *) useshrplib='false' ;;
7755 case "$useshrplib" in
7759 # Figure out a good name for libperl.so. Since it gets stored in
7760 # a version-specific architecture-dependent library, the version
7761 # number isn't really that important, except for making cc/ld happy.
7763 # A name such as libperl.so.3.1
7764 majmin="libperl.$so.$patchlevel.$subversion"
7765 # A name such as libperl.so.301
7766 majonly=`echo $patchlevel $subversion |
7767 $awk '{printf "%d%02d", $1, $2}'`
7768 majonly=libperl.$so.$majonly
7769 # I'd prefer to keep the os-specific stuff here to a minimum, and
7770 # rely on figuring it out from the naming of libc.
7771 case "${osname}${osvers}" in
7774 # XXX How handle the --version stuff for MAB?
7776 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7779 cygwin*) # ld links against an importlib
7780 dflt=libperl$lib_ext
7782 *) # Try to guess based on whether libc has major.minor.
7784 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7785 *libc.$so.[0-9]*) dflt=$majonly ;;
7786 *) dflt=libperl.$so ;;
7796 I need to select a good name for the shared libperl. If your system uses
7797 library names with major and minor numbers, then you might want something
7798 like $majmin. Alternatively, if your system uses a single version
7799 number for shared libraries, then you might want to use $majonly.
7800 Or, your system might be quite happy with a simple libperl.$so.
7802 Since the shared libperl will get installed into a version-specific
7803 architecture-dependent directory, the version number of the shared perl
7804 library probably isn't important, so the default should be o.k.
7807 rp='What name do you want to give to the shared libperl?'
7810 echo "Ok, I'll use $libperl"
7813 libperl="libperl${_a}"
7817 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7821 WARNING: Use of the shrpdir variable for the installation location of
7822 the shared $libperl is not supported. It was never documented and
7823 will not work in this version. Let me (perlbug@perl.org)
7824 know of any problems this may cause.
7830 But your current setting of $shrpdir is
7831 the default anyway, so it's harmless.
7836 Further, your current attempted setting of $shrpdir
7837 conflicts with the value of $archlibexp/CORE
7838 that installperl will use.
7845 # How will the perl executable find the installed shared $libperl?
7846 # Add $xxx to ccdlflags.
7847 # If we can't figure out a command-line option, use $shrpenv to
7848 # set env LD_RUN_PATH. The main perl makefile uses this.
7849 shrpdir=$archlibexp/CORE
7852 if "$useshrplib"; then
7855 # We'll set it in Makefile.SH...
7860 freebsd|netbsd|openbsd|interix)
7861 xxx="-Wl,-R$shrpdir"
7863 bsdos|linux|irix*|dec_osf|gnu*)
7864 xxx="-Wl,-rpath,$shrpdir"
7867 # next doesn't like the default...
7870 # beos doesn't like the default, either.
7873 # hpux doesn't like the default, either.
7874 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7877 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7883 # Only add $xxx if it isn't already in ccdlflags.
7884 case " $ccdlflags " in
7886 *) ccdlflags="$ccdlflags $xxx"
7889 Adding $xxx to the flags
7890 passed to $ld so that the perl executable will find the
7891 installed shared $libperl.
7899 # Fix ccdlflags in AIX for building external extensions.
7900 # (For building Perl itself bare -bE:perl.exp is needed,
7901 # Makefile.SH takes care of this.)
7903 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7905 # Respect a hint or command-line value.
7907 '') shrpenv="$tmp_shrpenv" ;;
7909 case "$ldlibpthname" in
7910 '') ldlibpthname=LD_LIBRARY_PATH ;;
7911 none) ldlibpthname='' ;;
7914 : determine where manual pages are on this system
7918 syspath='/usr/share/man/man1 /usr/man/man1'
7919 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7920 syspath="$syspath /usr/man/u_man/man1"
7921 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7922 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7923 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7924 sysman=`./loc . /usr/man/man1 $syspath`
7927 if $test -d "$sysman"; then
7928 echo "System manual is in $sysman." >&4
7930 echo "Could not find manual pages in source form." >&4
7933 : determine where manual pages go
7934 set man1dir man1dir none
7938 $spackage has manual pages available in source form.
7942 echo "However, you don't have nroff, so they're probably useless to you."
7944 '') man1dir="none";;
7947 echo "If you don't want the manual sources installed, answer 'none'."
7952 lookpath="$prefixexp/share/man/man1"
7953 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7954 lookpath="$lookpath $prefixexp/man/p_man/man1"
7955 lookpath="$lookpath $prefixexp/man/u_man/man1"
7956 lookpath="$lookpath $prefixexp/man/man.1"
7958 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7959 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7969 rp="Where do the main $spackage manual pages (source) go?"
7971 if $test "X$man1direxp" != "X$ansexp"; then
7975 man1direxp="$ansexp"
7981 : Change installation prefix, if necessary.
7982 if $test X"$prefix" != X"$installprefix"; then
7983 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7985 installman1dir="$man1direxp"
7988 : What suffix to use on installed man pages
7995 rp="What suffix should be used for the main $spackage man pages?"
7997 '') case "$man1dir" in
8011 *) dflt="$man1ext";;
8018 : see if we can have long filenames
8020 first=123456789abcdef
8022 if (echo hi >$first) 2>/dev/null; then
8023 if $test -f 123456789abcde; then
8024 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8027 echo 'You can have filenames longer than 14 characters.'>&4
8032 You can't have filenames longer than 14 chars.
8033 You can't even think about them!
8039 $rm -rf 123456789abcde*
8041 : determine where library module manual pages go
8042 set man3dir man3dir none
8046 $spackage has manual pages for many of the library modules.
8052 However, you don't have nroff, so they're probably useless to you.
8055 '') man3dir="none";;
8059 case "$d_flexfnam" in
8062 However, your system can't handle the long file names like File::Basename.3.
8065 '') man3dir="none";;
8069 echo "If you don't want the manual sources installed, answer 'none'."
8070 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8072 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8073 if $test -d "$privlib/man/man3"; then
8076 WARNING: Previous versions of perl installed man3 pages into
8077 $privlib/man/man3. This version will suggest a
8078 new default of $dflt.
8082 rp='Do you wish to preserve the old behavior?(y/n)'
8085 y*) dflt="$privlib/man/man3" ;;
8090 *) dflt="$man3dir" ;;
8097 rp="Where do the $package library man pages (source) go?"
8100 man3direxp="$ansexp"
8106 : Change installation prefix, if necessary.
8107 if $test X"$prefix" != X"$installprefix"; then
8108 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8110 installman3dir="$man3direxp"
8113 : What suffix to use on installed man pages
8119 rp="What suffix should be used for the $package library man pages?"
8121 '') case "$man3dir" in
8135 *) dflt="$man3ext";;
8142 : see if we have to deal with yellow pages, now NIS.
8143 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8144 if $test -f /usr/etc/nibindd; then
8146 echo "I'm fairly confident you're on a NeXT."
8148 rp='Do you get the hosts file via NetInfo?'
8157 y*) hostcat='nidump hosts .';;
8158 *) case "$hostcat" in
8159 nidump*) hostcat='';;
8169 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8177 rp='Are you getting the hosts file via yellow pages?'
8180 y*) hostcat='ypcat hosts';;
8181 *) hostcat='cat /etc/hosts';;
8187 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8190 '') test -f /etc/group && groupcat='cat /etc/group';;
8193 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8196 : now get the host name
8198 echo "Figuring out host name..." >&4
8199 case "$myhostname" in
8201 echo 'Maybe "hostname" will work...'
8202 if tans=`sh -c hostname 2>&1` ; then
8210 if $test "$cont"; then
8212 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8213 if tans=`cat /etc/systemid 2>&1` ; then
8215 phostname='cat /etc/systemid'
8216 echo "Whadyaknow. Xenix always was a bit strange..."
8219 elif $test -r /etc/systemid; then
8220 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8223 if $test "$cont"; then
8224 echo 'No, maybe "uuname -l" will work...'
8225 if tans=`sh -c 'uuname -l' 2>&1` ; then
8227 phostname='uuname -l'
8229 echo 'Strange. Maybe "uname -n" will work...'
8230 if tans=`sh -c 'uname -n' 2>&1` ; then
8232 phostname='uname -n'
8234 echo 'Oh well, maybe I can mine it out of whoami.h...'
8235 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8236 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8237 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8239 case "$myhostname" in
8240 '') echo "Does this machine have an identity crisis or something?"
8243 echo "Well, you said $myhostname before..."
8244 phostname='echo $myhostname';;
8250 case "$myhostname" in
8251 '') myhostname=noname ;;
8253 : you do not want to know about this
8258 if $test "$myhostname" ; then
8260 rp='Your host name appears to be "'$myhostname'".'" Right?"
8268 : bad guess or no guess
8269 while $test "X$myhostname" = X ; do
8271 rp="Please type the (one word) name of your host:"
8276 : translate upper to lower if necessary
8277 case "$myhostname" in
8279 echo "(Normalizing case in your host name)"
8280 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8284 case "$myhostname" in
8286 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8287 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8288 echo "(Trimming domain name from host name--host name is now $myhostname)"
8290 *) case "$mydomain" in
8293 test "X$hostcat" = "Xypcat hosts" &&
8294 ypmatch "$myhostname" hosts 2>/dev/null |\
8295 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8298 test "X$hostcat" != "X" &&
8299 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8300 /[ ]$myhostname[ . ]/p" > hosts
8303 if $test -f hosts; then
8304 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8305 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8306 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8307 hosts | $sort | $uniq | \
8308 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8309 case `$echo X$dflt` in
8310 X*\ *) echo "(Several hosts in the database matched hostname)"
8313 X.) echo "(You do not have fully-qualified names in the hosts database)"
8317 echo "(I cannot locate a hosts database anywhere)"
8322 tans=`./loc resolv.conf X /etc /usr/etc`
8323 if $test -f "$tans"; then
8324 echo "(Attempting domain name extraction from $tans)"
8325 dflt=.`$sed -n -e 's/ / /g' \
8326 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8327 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8329 .) dflt=.`$sed -n -e 's/ / /g' \
8330 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8331 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8338 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8339 dflt=.`sh -c domainname 2>/dev/null`
8342 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8346 case "$dflt$osname" in
8347 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8348 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8352 .) echo "(Lost all hope -- silly guess then)"
8358 *) dflt="$mydomain";;
8362 rp="What is your domain name?"
8372 : translate upper to lower if necessary
8375 echo "(Normalizing case in your domain name)"
8376 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8380 : a little sanity check here
8381 case "$phostname" in
8384 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8385 $myhostname$mydomain|$myhostname) ;;
8387 case "$phostname" in
8389 echo "(That doesn't agree with your whoami.h file, by the way.)"
8392 echo "(That doesn't agree with your $phostname command, by the way.)"
8402 I need to get your e-mail address in Internet format if possible, i.e.
8403 something like user@host.domain. Please answer accurately since I have
8404 no easy means to double check it. The default value provided below
8405 is most probably close to reality but may not be valid from outside
8406 your organization...
8410 while test "$cont"; do
8412 '') dflt="$cf_by@$myhostname$mydomain";;
8413 *) dflt="$cf_email";;
8415 rp='What is your e-mail address?'
8421 rp='Address does not look like an Internet one. Use it anyway?'
8437 If you or somebody else will be maintaining perl at your site, please
8438 fill in the correct e-mail address here so that they may be contacted
8439 if necessary. Currently, the "perlbug" program included with perl
8440 will send mail to this address in addition to perlbug@perl.org. You may
8441 enter "none" for no administrator.
8444 case "$perladmin" in
8445 '') dflt="$cf_email";;
8446 *) dflt="$perladmin";;
8448 rp='Perl administrator e-mail address'
8452 : determine whether to only install version-specific parts.
8455 Do you want to install only the version-specific parts of the perl
8456 distribution? Usually you do *not* want to do this.
8458 case "$versiononly" in
8459 "$define"|[Yy]*|true) dflt='y' ;;
8462 rp="Do you want to install only the version-specific parts of perl?"
8465 [yY]*) val="$define";;
8471 case "$versiononly" in
8472 "$define") inc_version_list=''
8473 inc_version_list_init=0
8477 : figure out how to guarantee perl startup
8478 case "$startperl" in
8480 case "$sharpbang" in
8484 I can use the #! construct to start perl on your system. This will
8485 make startup of perl scripts faster, but may cause problems if you
8486 want to share those scripts and perl is not in a standard place
8487 ($binexp/perl) on all your platforms. The alternative is to force
8488 a shell by starting the script with a single ':' character.
8491 case "$versiononly" in
8492 "$define") dflt="$binexp/perl$version";;
8493 *) dflt="$binexp/perl";;
8495 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8498 none) startperl=": # use perl";;
8499 *) startperl="#!$ans"
8500 if $test 30 -lt `echo "$ans" | wc -c`; then
8503 WARNING: Some systems limit the #! command to 32 characters.
8504 If you experience difficulty running Perl scripts with #!, try
8505 installing Perl in a directory with a shorter pathname.
8511 *) startperl=": # use perl"
8516 echo "I'll use $startperl to start perl scripts."
8518 : figure best path for perl in scripts
8521 case "$versiononly" in
8522 "$define") perlpath="$binexp/perl$version";;
8523 *) perlpath="$binexp/perl";;
8525 case "$startperl" in
8530 I will use the "eval 'exec'" idiom to start Perl on your system.
8531 I can use the full path of your Perl binary for this purpose, but
8532 doing so may cause problems if you want to share those scripts and
8533 Perl is not always in a standard place ($binexp/perl).
8537 rp="What path shall I use in \"eval 'exec'\"?"
8544 case "$startperl" in
8546 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8549 : determine where public executable scripts go
8550 set scriptdir scriptdir
8552 case "$scriptdir" in
8555 : guess some guesses
8556 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8557 $test -d /usr/share/bin && dflt=/usr/share/bin
8558 $test -d /usr/local/script && dflt=/usr/local/script
8559 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8560 $test -d $prefixexp/script && dflt=$prefixexp/script
8564 *) dflt="$scriptdir"
8569 Some installations have a separate directory just for executable scripts so
8570 that they can mount it across multiple architectures but keep the scripts in
8571 one spot. You might, for example, have a subdirectory of /usr/share for this.
8572 Or you might just lump your scripts in with all your other executables.
8576 rp='Where do you keep publicly executable scripts?'
8578 if $test "X$ansexp" != "X$scriptdirexp"; then
8582 scriptdirexp="$ansexp"
8583 : Change installation prefix, if necessary.
8584 if $test X"$prefix" != X"$installprefix"; then
8585 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8587 installscript="$scriptdirexp"
8590 : determine where add-on public executables go
8592 '') dflt=$siteprefix/bin ;;
8596 rp='Pathname where the add-on public executables should be installed?'
8599 sitebinexp="$ansexp"
8600 : Change installation prefix, if necessary.
8601 if $test X"$prefix" != X"$installprefix"; then
8602 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8604 installsitebin="$sitebinexp"
8607 : determine where add-on html pages go
8608 : There is no standard location, so try to copy the previously-selected
8609 : directory structure for the core html pages.
8610 case "$sitehtml1dir" in
8611 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8612 *) dflt=$sitehtml1dir ;;
8615 ''|' ') dflt=none ;;
8618 rp='Pathname where the site-specific html pages should be installed?'
8621 sitehtml1direxp="$ansexp"
8622 : Change installation prefix, if necessary.
8623 if $test X"$prefix" != X"$installprefix"; then
8624 installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
8626 installsitehtml1dir="$sitehtml1direxp"
8629 : determine where add-on library html pages go
8630 : There is no standard location, so try to copy the previously-selected
8631 : directory structure for the core html pages.
8632 case "$sitehtml3dir" in
8633 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8634 *) dflt=$sitehtml3dir ;;
8637 ''|' ') dflt=none ;;
8640 rp='Pathname where the site-specific library html pages should be installed?'
8643 sitehtml3direxp="$ansexp"
8644 : Change installation prefix, if necessary.
8645 if $test X"$prefix" != X"$installprefix"; then
8646 installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
8648 installsitehtml3dir="$sitehtml3direxp"
8651 : determine where add-on manual pages go
8652 case "$siteman1dir" in
8653 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8654 *) dflt=$siteman1dir ;;
8657 ''|' ') dflt=none ;;
8660 rp='Pathname where the site-specific manual pages should be installed?'
8663 siteman1direxp="$ansexp"
8664 : Change installation prefix, if necessary.
8665 if $test X"$prefix" != X"$installprefix"; then
8666 installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
8668 installsiteman1dir="$siteman1direxp"
8671 : determine where add-on library man pages go
8672 case "$siteman3dir" in
8673 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8674 *) dflt=$siteman3dir ;;
8677 ''|' ') dflt=none ;;
8680 rp='Pathname where the site-specific library manual pages should be installed?'
8683 siteman3direxp="$ansexp"
8684 : Change installation prefix, if necessary.
8685 if $test X"$prefix" != X"$installprefix"; then
8686 installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
8688 installsiteman3dir="$siteman3direxp"
8691 : determine where add-on public executable scripts go
8692 case "$sitescript" in
8693 '') dflt=$siteprefix/script
8694 $test -d $dflt || dflt=$sitebin ;;
8695 *) dflt="$sitescript" ;;
8698 rp='Pathname where add-on public executable scripts should be installed?'
8701 sitescriptexp="$ansexp"
8702 : Change installation prefix, if necessary.
8703 if $test X"$prefix" != X"$installprefix"; then
8704 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8706 installsitescript="$sitescriptexp"
8709 case "$usefaststdio" in
8710 $define|true|[yY]*|'')
8711 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8721 Perl can be built to use 'fast stdio', which means using the stdio
8722 library but also directly manipulating the stdio buffers to enable
8723 faster I/O. Using stdio is better for backward compatibility (especially
8724 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8725 interface has been preferred instead of stdio.
8727 If this doesn't make any sense to you, just accept the default '$dflt'.
8729 rp='Use the "fast stdio" if available?'
8732 y|Y) val="$define" ;;
8739 : define an is-a-typedef? function
8740 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8742 "") inclist="sys/types.h";;
8744 eval "varval=\$$var";
8748 for inc in $inclist; do
8749 echo "#include <$inc>" >>temp.c;
8751 echo "#ifdef $type" >> temp.c;
8752 echo "printf(\"We have $type\");" >> temp.c;
8753 echo "#endif" >> temp.c;
8754 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8755 if $contains $type temp.E >/dev/null 2>&1; then
8761 *) eval "$var=\$varval";;
8764 : define an is-a-typedef? function that prompts if the type is not available.
8765 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8767 "") inclist="sys/types.h";;
8769 eval "varval=\$$var";
8773 for inc in $inclist; do
8774 echo "#include <$inc>" >>temp.c;
8776 echo "#ifdef $type" >> temp.c;
8777 echo "printf(\"We have $type\");" >> temp.c;
8778 echo "#endif" >> temp.c;
8779 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8781 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8782 if $contains $type temp.E >/dev/null 2>&1; then
8783 echo "$type found." >&4;
8786 echo "$type NOT found." >&4;
8792 *) eval "$var=\$varval";;
8795 : see what type lseek is declared as in the kernel
8796 rp="What is the type used for lseek's offset on this system?"
8797 set off_t lseektype long stdio.h sys/types.h
8801 echo "Checking to see how big your file offsets are..." >&4
8803 #include <sys/types.h>
8807 printf("%d\n", (int)sizeof($lseektype));
8812 if eval $compile_ok; then
8813 lseeksize=`$run ./try`
8814 echo "Your file offsets are $lseeksize bytes long."
8818 echo "(I can't seem to compile the test program. Guessing...)"
8819 rp="What is the size of your file offsets (in bytes)?"
8825 : see what type file positions are declared as in the library
8826 rp="What is the type for file position used by fsetpos()?"
8827 set fpos_t fpostype long stdio.h sys/types.h
8832 *_t) zzz="$fpostype" ;;
8835 echo "Checking the size of $zzz..." >&4
8837 #include <sys/types.h>
8844 printf("%d\n", (int)sizeof($fpostype));
8849 if eval $compile_ok; then
8853 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8856 echo "Your $zzz is $fpossize bytes long."
8862 echo "(I can't compile the test program. Guessing...)" >&4
8863 rp="What is the size of your file positions (in bytes)?"
8868 # Backward compatibility (uselfs is deprecated).
8870 "$define"|true|[yY]*)
8873 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8875 uselargefiles="$define"
8879 case "$lseeksize:$fpossize" in
8882 You can have files larger than 2 gigabytes.
8885 *) case "$uselargefiles" in
8886 "$undef"|false|[nN]*) dflt='n' ;;
8891 Perl can be built to understand large files (files larger than 2 gigabytes)
8892 on some systems. To do so, Configure can be run with -Duselargefiles.
8894 If this doesn't make any sense to you, just accept the default '$dflt'.
8896 rp='Try to understand large files, if available?'
8899 y|Y) val="$define" ;;
8906 : Look for a hint-file generated 'call-back-unit'. If the
8907 : user has specified that a large files perl is to be built,
8908 : we may need to set or change some other defaults.
8909 if $test -f uselargefiles.cbu; then
8910 echo "Your platform has some specific hints regarding large file builds, using them..."
8911 . ./uselargefiles.cbu
8913 case "$uselargefiles" in
8915 if $test -f uselargefiles.cbu; then
8917 echo "Rechecking to see how big your file offsets are..." >&4
8919 #include <sys/types.h>
8923 printf("%d\n", (int)sizeof($lseektype));
8928 if eval $compile_ok; then
8929 lseeksize=`$run ./try`
8930 $echo "Your file offsets are now $lseeksize bytes long."
8934 echo "(I can't seem to compile the test program. Guessing...)"
8935 rp="What is the size of your file offsets (in bytes)?"
8940 *_t) zzz="$fpostype" ;;
8943 $echo $n "Rechecking the size of $zzz...$c" >&4
8945 #include <sys/types.h>
8952 printf("%d\n", (int)sizeof($fpostype));
8957 if eval $compile_ok; then
8962 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8965 echo " $fpossize bytes." >&4
8971 echo "(I can't compile the test program. Guessing...)" >&4
8972 rp="What is the size of your file positions (in bytes)?"
8981 # probably will refer to
8982 # $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
8984 userelocatableinc=undef
8986 case "$vendorprefix" in
8987 '') d_vendorbin="$undef"
8991 *) d_vendorbin="$define"
8992 : determine where vendor-supplied executables go.
8993 case "$vendorbin" in
8994 '') dflt=$vendorprefix/bin ;;
8995 *) dflt="$vendorbin" ;;
8998 rp='Pathname for the vendor-supplied executables directory?'
9001 vendorbinexp="$ansexp"
9004 : Change installation prefix, if necessary.
9005 if $test X"$prefix" != X"$installprefix"; then
9006 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9008 installvendorbin="$vendorbinexp"
9011 case "$vendorprefix" in
9012 '') vendorhtml1dir=''
9013 vendorhtml1direxp=''
9015 *) : determine where vendor-supplied html pages go.
9016 : There is no standard location, so try to copy the previously-selected
9017 : directory structure for the core html pages.
9018 : XXX Better default suggestions would be welcome.
9019 case "$vendorhtml1dir" in
9020 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9021 *) dflt=$vendorhtml1dir ;;
9024 ''|' ') dflt=none ;;
9027 rp='Pathname for the vendor-supplied html pages?'
9029 vendorhtml1dir="$ans"
9030 vendorhtml1direxp="$ansexp"
9033 : Use ' ' for none so value is preserved next time through Configure
9034 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9035 : Change installation prefix, if necessary.
9036 if $test X"$prefix" != X"$installprefix"; then
9037 installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
9039 installvendorhtml1dir="$vendorhtml1direxp"
9042 case "$vendorprefix" in
9043 '') vendorhtml3dir=''
9044 vendorhtml3direxp=''
9046 *) : determine where vendor-supplied module html pages go.
9047 : There is no standard location, so try to copy the previously-selected
9048 : directory structure for the core html pages.
9049 : XXX Better default suggestions would be welcome.
9050 case "$vendorhtml3dir" in
9051 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9052 *) dflt=$vendorhtml3dir ;;
9055 ''|' ') dflt=none ;;
9058 rp='Pathname for the vendor-supplied html pages?'
9060 vendorhtml3dir="$ans"
9061 vendorhtml3direxp="$ansexp"
9064 : Use ' ' for none so value is preserved next time through Configure
9065 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9066 : Change installation prefix, if necessary.
9067 if $test X"$prefix" != X"$installprefix"; then
9068 installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
9070 installvendorhtml3dir="$vendorhtml3direxp"
9073 case "$vendorprefix" in
9074 '') vendorman1dir=''
9077 *) : determine where vendor-supplied manual pages go.
9078 case "$vendorman1dir" in
9079 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9080 *) dflt=$vendorman1dir ;;
9083 ''|' ') dflt=none ;;
9086 rp='Pathname for the vendor-supplied manual section 1 pages?'
9088 vendorman1dir="$ans"
9089 vendorman1direxp="$ansexp"
9092 : Use ' ' for none so value is preserved next time through Configure
9093 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9094 : Change installation prefix, if necessary.
9095 if $test X"$prefix" != X"$installprefix"; then
9096 installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
9098 installvendorman1dir="$vendorman1direxp"
9101 case "$vendorprefix" in
9102 '') vendorman3dir=''
9105 *) : determine where vendor-supplied module manual pages go.
9106 case "$vendorman3dir" in
9107 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9108 *) dflt=$vendorman3dir ;;
9111 ''|' ') dflt=none ;;
9114 rp='Pathname for the vendor-supplied manual section 3 pages?'
9116 vendorman3dir="$ans"
9117 vendorman3direxp="$ansexp"
9120 : Use ' ' for none so value is preserved next time through Configure
9121 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9122 : Change installation prefix, if necessary.
9123 if $test X"$prefix" != X"$installprefix"; then
9124 installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
9126 installvendorman3dir="$vendorman3direxp"
9129 case "$vendorprefix" in
9130 '') d_vendorscript="$undef"
9134 *) d_vendorscript="$define"
9135 : determine where vendor-supplied scripts go.
9136 case "$vendorscript" in
9137 '') dflt=$vendorprefix/script
9138 $test -d $dflt || dflt=$vendorbin ;;
9139 *) dflt="$vendorscript" ;;
9143 The installation process will create a directory for
9144 vendor-supplied scripts.
9148 rp='Pathname for the vendor-supplied scripts directory?'
9151 vendorscriptexp="$ansexp"
9154 : Change installation prefix, if necessary.
9155 if $test X"$prefix" != X"$installprefix"; then
9156 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9158 installvendorscript="$vendorscriptexp"
9161 : see if qgcvt exists
9167 if $test X"$d_longdbl" = X"$define"; then
9169 echo "Checking how to print long doubles..." >&4
9171 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9172 $cat >try.c <<'EOCP'
9173 #include <sys/types.h>
9177 printf("%.3f\n", d);
9181 if eval $compile; then
9185 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9186 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9187 echo "We will use %f."
9193 if $test X"$sPRIfldbl" = X; then
9194 $cat >try.c <<'EOCP'
9195 #include <sys/types.h>
9198 long double d = 123.456;
9199 printf("%.3Lf\n", d);
9203 if eval $compile; then
9207 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9208 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9209 echo "We will use %Lf."
9215 if $test X"$sPRIfldbl" = X; then
9216 $cat >try.c <<'EOCP'
9217 #include <sys/types.h>
9220 long double d = 123.456;
9221 printf("%.3llf\n", d);
9225 if eval $compile; then
9229 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9230 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9231 echo "We will use %llf."
9237 if $test X"$sPRIfldbl" = X; then
9238 $cat >try.c <<'EOCP'
9239 #include <sys/types.h>
9242 long double d = 123.456;
9243 printf("%.3lf\n", d);
9247 if eval $compile; then
9251 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9252 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9253 echo "We will use %lf."
9259 if $test X"$sPRIfldbl" = X; then
9260 echo "Cannot figure out how to print long doubles." >&4
9262 sSCNfldbl=$sPRIfldbl # expect consistency
9269 case "$sPRIfldbl" in
9270 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9271 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9272 d_SCNfldbl="$undef";
9274 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9275 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9276 d_SCNfldbl="$define";
9280 : Check how to convert floats to strings.
9282 if test "X$d_Gconvert" = X; then
9285 echo "Checking for an efficient way to convert floats to strings."
9287 case "$uselongdouble" in
9288 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9290 case "$d_longdbl" in
9291 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9293 case "$d_PRIgldbl" in
9294 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9298 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9299 char *myname = "gconvert";
9302 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9303 char *myname = "gcvt";
9306 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9307 char *myname = "qgcvt";
9308 #define DOUBLETYPE long double
9311 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9313 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9315 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9318 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9320 char *myname = "sprintf";
9324 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9325 #define DOUBLETYPE long double
9327 #define DOUBLETYPE double
9333 #define I_STDLIB $i_stdlib
9339 checkit(expect, got)
9343 if (strcmp(expect, got)) {
9344 printf("%s oddity: Expected %s, got %s\n",
9345 myname, expect, got);
9355 /* This must be 1st test on (which?) platform */
9356 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9357 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9358 checkit("0.1", buf);
9360 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9361 checkit("0.01", buf);
9363 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9364 checkit("0.001", buf);
9366 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9367 checkit("0.0001", buf);
9369 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9370 if (strlen(buf) > 5)
9371 checkit("9e-005", buf); /* for Microsoft ?? */
9373 checkit("9e-05", buf);
9375 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9378 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9379 checkit("1.1", buf);
9381 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9382 checkit("1.01", buf);
9384 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9385 checkit("1.001", buf);
9387 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9388 checkit("1.0001", buf);
9390 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9391 checkit("1.00001", buf);
9393 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9394 checkit("1.000001", buf);
9396 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9399 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9402 /* Some Linux gcvt's give 1.e+5 here. */
9403 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9404 checkit("100000", buf);
9406 /* Some Linux gcvt's give -1.e+5 here. */
9407 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9408 checkit("-100000", buf);
9410 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9411 checkit("123.456", buf);
9413 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9414 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9415 /* 34 should be enough to scare even long double
9416 * places into using the e notation. */
9417 if (strlen(buf) > 5)
9418 checkit("1e+034", buf); /* for Microsoft */
9420 checkit("1e+34", buf);
9422 /* For Perl, if you add additional tests here, also add them to
9423 * t/base/num.t for benefit of platforms not using Configure or
9424 * overriding d_Gconvert */
9429 : first add preferred functions to our list
9431 for xxx_convert in $gconvert_preference; do
9432 case $xxx_convert in
9433 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9434 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9437 : then add any others
9438 for xxx_convert in gconvert gcvt sprintf; do
9441 *) xxx_list="$xxx_list $xxx_convert" ;;
9445 case "$d_longdbl$uselongdouble" in
9447 : again, add prefered functions to our list first
9449 for xxx_convert in $gconvert_ld_preference; do
9450 case $xxx_convert in
9451 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9452 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9455 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9456 for xxx_convert in qgcvt sprintf $xxx_list; do
9457 case "$xxx_ld_list" in
9458 $xxx_convert*|*" $xxx_convert"*) ;;
9459 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9462 : if sprintf cannot do long doubles, move it to the end
9463 if test "$d_PRIgldbl" != "$define"; then
9464 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9466 : if no qgcvt, remove it
9467 if test "$d_qgcvt" != "$define"; then
9468 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9471 xxx_list="$xxx_ld_list"
9475 for xxx_convert in $xxx_list; do
9476 echo "Trying $xxx_convert..."
9478 set try -DTRY_$xxx_convert
9479 if eval $compile; then
9480 echo "$xxx_convert() found." >&4
9482 echo "I'll use $xxx_convert to convert floats into a string." >&4
9485 echo "...But $xxx_convert didn't work as I expected."
9489 echo "$xxx_convert NOT found." >&4
9493 if test X$xxx_convert = X; then
9494 echo "*** WHOA THERE!!! ***" >&4
9495 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9499 case "$xxx_convert" in
9500 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9501 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9502 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9503 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9504 "$define$define$define")
9505 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9506 "$define$define$undef")
9507 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9508 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9515 : see if _fwalk exists
9519 : Initialize h_fcntl
9522 : Initialize h_sysfile
9525 : access call always available on UNIX
9529 : locate the flags for 'access()'
9533 $cat >access.c <<EOCP
9534 #include <sys/types.h>
9539 #include <sys/file.h>
9552 : check sys/file.h first, no particular reason here
9553 if $test `./findhdr sys/file.h` && \
9554 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9556 echo "<sys/file.h> defines the *_OK access constants." >&4
9557 elif $test `./findhdr fcntl.h` && \
9558 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9560 echo "<fcntl.h> defines the *_OK access constants." >&4
9561 elif $test `./findhdr unistd.h` && \
9562 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9563 echo "<unistd.h> defines the *_OK access constants." >&4
9565 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9571 : see if accessx exists
9572 set accessx d_accessx
9575 : see if aintl exists
9579 : see if alarm exists
9583 : see if POSIX threads are available
9584 set pthread.h i_pthread
9587 : define a fucntion to check prototypes
9588 $cat > protochk <<EOSH
9591 optimize="$optimize"
9593 prototype="$prototype"
9596 usethreads=$usethreads
9597 i_pthread=$i_pthread
9598 pthread_h_first=$pthread_h_first
9601 $cat >> protochk <<'EOSH'
9606 while test $# -ge 2; do
9608 $define) echo "#include <$2>" >> try.c ;;
9609 literal) echo "$2" >> try.c ;;
9611 # Extra magic for the benefit of systems that need pthread.h
9612 # to be included early to correctly detect threadsafe functions.
9613 # Such functions must guarantee themselves, though, that the usethreads
9614 # and i_pthread have been defined, before calling protochk.
9615 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9616 echo "#include <pthread.h>" >> try.c
9621 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9622 cat >> try.c <<'EOCP'
9623 #ifdef CAN_PROTOTYPE
9624 #define _(args) args
9629 echo "$foo" >> try.c
9630 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9631 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9639 hasproto='varname=$1; func=$2; shift; shift;
9640 while $test $# -ge 2; do
9642 $define) echo "#include <$2>";;
9646 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9647 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9648 echo "$func() prototype found.";
9651 echo "$func() prototype NOT found.";
9656 $rm -f try.c tryout.c'
9658 : see if sys/types.h has to be included
9659 set sys/types.h i_systypes
9662 : see if sys/select.h has to be included
9663 set sys/select.h i_sysselct
9666 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9667 while $test $# -ge 2; do
9669 $define) echo "#include <$2>";;
9673 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9675 if eval $compile; then
9684 : see if we should include time.h, sys/time.h, or both
9686 if test "X$timeincl" = X; then
9687 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9688 $echo $n "I'm now running the test program...$c"
9690 #include <sys/types.h>
9695 #ifdef SYSTIMEKERNEL
9698 #include <sys/time.h>
9701 #include <sys/select.h>
9714 struct timezone tzp;
9716 if (foo.tm_sec == foo.tm_sec)
9719 if (bar.tv_sec == bar.tv_sec)
9726 for s_timezone in '-DS_TIMEZONE' ''; do
9728 for s_timeval in '-DS_TIMEVAL' ''; do
9729 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9730 for i_time in '' '-DI_TIME'; do
9731 for i_systime in '-DI_SYSTIME' ''; do
9734 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9735 if eval $compile; then
9736 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9740 $echo $n "Succeeded with $flags$c"
9752 *SYSTIMEKERNEL*) i_systimek="$define"
9753 timeincl=`./findhdr sys/time.h`
9754 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9755 *) i_systimek="$undef";;
9758 *I_TIME*) i_time="$define"
9759 timeincl=`./findhdr time.h`" $timeincl"
9760 echo "We'll include <time.h>." >&4;;
9761 *) i_time="$undef";;
9764 *I_SYSTIME*) i_systime="$define"
9765 timeincl=`./findhdr sys/time.h`" $timeincl"
9766 echo "We'll include <sys/time.h>." >&4;;
9767 *) i_systime="$undef";;
9771 : see if struct tm knows about tm_zone
9772 case "$i_systime$i_time" in
9775 echo "Checking to see if your struct tm has tm_zone field..." >&4
9776 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9784 case "$d_tm_tm_zone" in
9785 "$define") echo "Yes, it does." ;;
9786 *) echo "No, it doesn't." ;;
9788 : see if struct tm knows about tm_gmtoff
9789 case "$i_systime$i_time" in
9792 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9793 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9801 case "$d_tm_tm_gmtoff" in
9802 "$define") echo "Yes, it does." ;;
9803 *) echo "No, it doesn't." ;;
9806 : see if asctime_r exists
9807 set asctime_r d_asctime_r
9809 case "$d_asctime_r" in
9811 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9812 case "$d_asctime_r_proto:$usethreads" in
9813 ":define") d_asctime_r_proto=define
9814 set d_asctime_r_proto asctime_r $hdrs
9818 case "$d_asctime_r_proto" in
9820 case "$asctime_r_proto" in
9821 ''|0) try='char* asctime_r(const struct tm*, char*);'
9822 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9824 case "$asctime_r_proto" in
9825 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9826 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9828 case "$asctime_r_proto" in
9829 ''|0) try='int asctime_r(const struct tm*, char*);'
9830 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9832 case "$asctime_r_proto" in
9833 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9834 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9836 case "$asctime_r_proto" in
9837 ''|0) d_asctime_r=undef
9839 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9840 * ) case "$asctime_r_proto" in
9841 REENTRANT_PROTO*) ;;
9842 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9844 echo "Prototype: $try" ;;
9847 *) case "$usethreads" in
9848 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9855 *) asctime_r_proto=0
9859 : see if atolf exists
9863 : see if atoll exists
9867 : Look for GNU-cc style attribute checking
9868 case "$d_attribut" in
9871 echo "Checking whether your compiler can handle __attribute__ ..." >&4
9872 $cat >attrib.c <<'EOCP'
9874 void croak (char* pat,...) __attribute__((__format__(__printf__,1,2),noreturn));
9876 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9877 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9878 echo "Your C compiler doesn't fully support __attribute__."
9881 echo "Your C compiler supports __attribute__."
9885 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9889 *) val="$d_attribut" ;;
9895 : see if bcmp exists
9899 : see if bcopy exists
9903 : see if this is a unistd.h system
9904 set unistd.h i_unistd
9907 : see if getpgrp exists
9908 set getpgrp d_getpgrp
9911 case "$d_getpgrp" in
9914 echo "Checking to see which flavor of getpgrp is in use..."
9917 #include <sys/types.h>
9919 # include <unistd.h>
9927 if (getuid() == 0) {
9928 printf("(I see you are running Configure as super-user...)\n");
9932 if (getpgrp(1) == 0)
9941 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9942 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
9944 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9945 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
9948 echo "I can't seem to compile and run the test program."
9950 xxx="a USG one, i.e. you use getpgrp()."
9952 # SVR4 systems can appear rather BSD-ish.
9955 xxx="a BSD one, i.e. you use getpgrp(pid)."
9959 xxx="probably a USG one, i.e. you use getpgrp()."
9964 echo "Assuming your getpgrp is $xxx" >&4
9973 : see if setpgrp exists
9974 set setpgrp d_setpgrp
9977 case "$d_setpgrp" in
9980 echo "Checking to see which flavor of setpgrp is in use..."
9983 #include <sys/types.h>
9985 # include <unistd.h>
9993 if (getuid() == 0) {
9994 printf("(I see you are running Configure as super-user...)\n");
9998 if (-1 == setpgrp(1, 1))
10001 if (setpgrp() != -1)
10007 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10008 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10010 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10011 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10014 echo "(I can't seem to compile and run the test program.)"
10016 xxx="a USG one, i.e. you use setpgrp()."
10018 # SVR4 systems can appear rather BSD-ish.
10019 case "$i_unistd" in
10021 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10025 xxx="probably a USG one, i.e. you use setpgrp()."
10030 echo "Assuming your setpgrp is $xxx" >&4
10038 : see if bzero exists
10042 : see if signal is declared as pointer to function returning int or void
10044 xxx=`./findhdr signal.h`
10045 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10046 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10047 echo "You have int (*signal())() instead of void." >&4
10049 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10050 echo "You have void (*signal())()." >&4
10052 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10053 echo "You have int (*signal())() instead of void." >&4
10055 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10056 echo "You have void (*signal())()." >&4
10059 case "$d_voidsig" in
10061 echo "I can't determine whether signal handler returns void or int..." >&4
10063 rp="What type does your signal handler return?"
10066 v*) val="$define";;
10070 echo "As you already told me, signal handler returns void." >&4
10073 *) echo "As you already told me, signal handler returns int." >&4
10080 case "$d_voidsig" in
10081 "$define") signal_t="void";;
10082 *) signal_t="int";;
10086 : check for ability to cast large floats to 32-bit ints.
10088 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10089 if $test "$intsize" -ge 4; then
10096 #$i_stdlib I_STDLIB
10098 #include <stdlib.h>
10100 #include <sys/types.h>
10101 #include <signal.h>
10102 $signal_t blech(s) int s; { exit(3); }
10109 signal(SIGFPE, blech);
10111 /* Don't let compiler optimize the test away. Store the number
10112 in a writable string for gcc to pass to sscanf under HP/UX.
10114 sprintf(str, "2147483647");
10115 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10119 /* x86 processors will probably give 0x8000 0000, which is a
10120 sign change. We don't want that. We want to mimic SPARC
10121 behavior here, which is to preserve the sign and give
10124 if (i32 != ($xxx) f)
10130 if eval $compile_ok; then
10134 echo "(I can't seem to compile the test program--assuming it can't)"
10139 echo "Yup, it can."
10142 echo "Nope, it can't."
10149 : check for ability to cast negative floats to unsigned
10151 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10154 #$i_stdlib I_STDLIB
10156 #include <stdlib.h>
10158 #include <sys/types.h>
10159 #include <signal.h>
10160 $signal_t blech(s) int s; { exit(7); }
10161 $signal_t blech_in_list(s) int s; { exit(4); }
10162 unsigned long dummy_long(p) unsigned long p; { return p; }
10163 unsigned int dummy_int(p) unsigned int p; { return p; }
10164 unsigned short dummy_short(p) unsigned short p; { return p; }
10168 unsigned long along;
10170 unsigned short ashort;
10174 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10175 a direct f = -123. assignment. gcc-2.8.0 reportedly
10176 optimized the whole file away
10178 /* Store the number in a writable string for gcc to pass to
10179 sscanf under HP/UX.
10181 sprintf(str, "-123");
10182 sscanf(str, "%lf", &f); /* f = -123.; */
10184 signal(SIGFPE, blech);
10185 along = (unsigned long)f;
10186 aint = (unsigned int)f;
10187 ashort = (unsigned short)f;
10188 if (along != (unsigned long)-123)
10190 if (aint != (unsigned int)-123)
10192 if (ashort != (unsigned short)-123)
10194 sprintf(str, "1073741824.");
10195 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10198 along = (unsigned long)f;
10199 if (along != 0x80000000)
10203 along = (unsigned long)f;
10204 if (along != 0x7fffffff)
10208 along = (unsigned long)f;
10209 if (along != 0x80000001)
10213 signal(SIGFPE, blech_in_list);
10214 sprintf(str, "123.");
10215 sscanf(str, "%lf", &f); /* f = 123.; */
10216 along = dummy_long((unsigned long)f);
10217 aint = dummy_int((unsigned int)f);
10218 ashort = dummy_short((unsigned short)f);
10219 if (along != (unsigned long)123)
10221 if (aint != (unsigned int)123)
10223 if (ashort != (unsigned short)123)
10230 if eval $compile_ok; then
10234 echo "(I can't seem to compile the test program--assuming it can't)"
10237 case "$castflags" in
10239 echo "Yup, it can."
10242 echo "Nope, it can't."
10249 : see if vprintf exists
10251 if set vprintf val -f d_vprintf; eval $csym; $val; then
10252 echo 'vprintf() found.' >&4
10255 #include <varargs.h>
10256 #$i_stdlib I_STDLIB
10258 #include <stdlib.h>
10261 int main() { xxx("foo"); }
10270 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10274 if eval $compile && $run ./try; then
10275 echo "Your vsprintf() returns (int)." >&4
10278 echo "Your vsprintf() returns (char*)." >&4
10282 echo 'vprintf() NOT found.' >&4
10293 : see if chown exists
10297 : see if chroot exists
10298 set chroot d_chroot
10301 : see if chsize exists
10302 set chsize d_chsize
10305 : see if class exists
10309 hasstruct='varname=$1; struct=$2; shift; shift;
10310 while $test $# -ge 2; do
10312 $define) echo "#include <$2>";;
10316 echo "int main () { struct $struct foo; }" >> try.c;
10318 if eval $compile; then
10325 $rm -f try.c try.o'
10329 : see whether socket exists
10331 $echo $n "Hmm... $c" >&4
10332 if set socket val -f d_socket; eval $csym; $val; then
10333 echo "Looks like you have Berkeley networking support." >&4
10335 if set setsockopt val -f; eval $csym; $val; then
10338 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10339 d_oldsock="$define"
10342 if $contains socklib libc.list >/dev/null 2>&1; then
10343 echo "Looks like you have Berkeley networking support." >&4
10345 : we will have to assume that it supports the 4.2 BSD interface
10348 echo "You don't have Berkeley networking in libc$_a..." >&4
10349 if test "X$d_socket" = "X$define"; then
10350 echo "...but you seem to believe that you have sockets." >&4
10352 for net in net socket
10354 if test -f /usr/lib/lib$net$_a; then
10355 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10356 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10357 if $contains socket libc.list >/dev/null 2>&1; then
10362 echo "...but the Wollongong group seems to have hacked it in." >&4
10363 sockethdr="-I/usr/netinclude"
10366 echo "Found Berkeley sockets interface in lib$net." >&4
10367 if $contains setsockopt libc.list >/dev/null 2>&1; then
10370 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10371 d_oldsock="$define"
10377 if test "X$d_socket" != "X$define"; then
10378 echo "or anywhere else I see." >&4
10386 : see if socketpair exists
10387 set socketpair d_sockpair
10392 echo "Checking the availability of certain socket constants..." >&4
10393 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10394 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10396 #include <sys/types.h>
10397 #include <sys/socket.h>
10403 set try; if eval $compile; then
10406 set d_${enum}; eval $setvar
10410 : see if this is a sys/uio.h system
10411 set sys/uio.h i_sysuio
10416 echo "Checking to see if your system supports struct cmsghdr..." >&4
10417 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10419 case "$d_cmsghdr_s" in
10420 "$define") echo "Yes, it does." ;;
10421 *) echo "No, it doesn't." ;;
10425 : check for const keyword
10427 echo 'Checking to see if your C compiler knows about "const"...' >&4
10428 $cat >const.c <<'EOCP'
10429 typedef struct spug { int drokk; } spug;
10436 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10438 echo "Yup, it does."
10441 echo "Nope, it doesn't."
10446 : see if copysignl exists
10447 set copysignl d_copysignl
10450 : see if crypt exists
10455 $define) cryptlib='' ;;
10456 *) if set crypt val -f d_crypt; eval $csym; $val; then
10457 echo 'crypt() found.' >&4
10461 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10462 if $test -z "$cryptlib"; then
10463 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10467 if $test -z "$cryptlib"; then
10468 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10472 if $test -z "$cryptlib"; then
10473 cryptlib=`./loc libcrypt$_a "" $libpth`
10477 if $test -z "$cryptlib"; then
10478 echo 'crypt() NOT found.' >&4
10489 : see if this is a crypt.h system
10490 set crypt.h i_crypt
10493 : see if crypt_r exists
10494 set crypt_r d_crypt_r
10496 case "$d_crypt_r" in
10498 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10499 case "$d_crypt_r_proto:$usethreads" in
10500 ":define") d_crypt_r_proto=define
10501 set d_crypt_r_proto crypt_r $hdrs
10505 case "$d_crypt_r_proto" in
10507 case "$crypt_r_proto" in
10508 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10509 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10511 case "$crypt_r_proto" in
10512 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10513 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10515 case "$crypt_r_proto" in
10516 ''|0) d_crypt_r=undef
10518 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10519 * ) case "$crypt_r_proto" in
10520 REENTRANT_PROTO*) ;;
10521 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10523 echo "Prototype: $try" ;;
10526 *) case "$usethreads" in
10527 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10538 : get csh whereabouts
10540 'csh') val="$undef" ;;
10541 *) val="$define" ;;
10545 : Respect a hint or command line value for full_csh.
10546 case "$full_csh" in
10547 '') full_csh=$csh ;;
10550 : see if ctermid_r exists
10551 set ctermid_r d_ctermid_r
10553 case "$d_ctermid_r" in
10555 hdrs="$i_systypes sys/types.h define stdio.h "
10556 case "$d_ctermid_r_proto:$usethreads" in
10557 ":define") d_ctermid_r_proto=define
10558 set d_ctermid_r_proto ctermid_r $hdrs
10562 case "$d_ctermid_r_proto" in
10564 case "$ctermid_r_proto" in
10565 ''|0) try='char* ctermid_r(char*);'
10566 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10568 case "$ctermid_r_proto" in
10569 ''|0) d_ctermid_r=undef
10571 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10572 * ) case "$ctermid_r_proto" in
10573 REENTRANT_PROTO*) ;;
10574 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10576 echo "Prototype: $try" ;;
10579 *) case "$usethreads" in
10580 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10587 *) ctermid_r_proto=0
10591 : see if ctime_r exists
10592 set ctime_r d_ctime_r
10594 case "$d_ctime_r" in
10596 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10597 case "$d_ctime_r_proto:$usethreads" in
10598 ":define") d_ctime_r_proto=define
10599 set d_ctime_r_proto ctime_r $hdrs
10603 case "$d_ctime_r_proto" in
10605 case "$ctime_r_proto" in
10606 ''|0) try='char* ctime_r(const time_t*, char*);'
10607 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10609 case "$ctime_r_proto" in
10610 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10611 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10613 case "$ctime_r_proto" in
10614 ''|0) try='int ctime_r(const time_t*, char*);'
10615 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10617 case "$ctime_r_proto" in
10618 ''|0) try='int ctime_r(const time_t*, char*, int);'
10619 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10621 case "$ctime_r_proto" in
10622 ''|0) d_ctime_r=undef
10624 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10625 * ) case "$ctime_r_proto" in
10626 REENTRANT_PROTO*) ;;
10627 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10629 echo "Prototype: $try" ;;
10632 *) case "$usethreads" in
10633 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10644 : see if cuserid exists
10645 set cuserid d_cuserid
10648 : see if this is a limits.h system
10649 set limits.h i_limits
10652 : see if this is a float.h system
10653 set float.h i_float
10656 : See if number of significant digits in a double precision number is known
10658 $cat >dbl_dig.c <<EOM
10659 #$i_limits I_LIMITS
10662 #include <limits.h>
10668 printf("Contains DBL_DIG");
10671 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10672 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10673 echo "DBL_DIG found." >&4
10676 echo "DBL_DIG NOT found." >&4
10683 : see if dbm.h is available
10684 : see if dbmclose exists
10685 set dbmclose d_dbmclose
10688 case "$d_dbmclose" in
10698 *) set rpcsvc/dbm.h i_rpcsvcdbm
10703 *) echo "We won't be including <dbm.h>"
10713 : see if prototype for dbminit is available
10715 set d_dbminitproto dbminit $i_dbm dbm.h
10718 : see if difftime exists
10719 set difftime d_difftime
10722 : see if this is a dirent system
10724 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10726 echo "<dirent.h> found." >&4
10729 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10730 echo "<sys/dir.h> found." >&4
10733 xinc=`./findhdr sys/ndir.h`
10735 echo "<dirent.h> NOT found." >&4
10740 : Look for type of directory structure.
10742 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10744 case "$direntrytype" in
10746 case "$i_dirent" in
10747 $define) guess1='struct dirent' ;;
10748 *) guess1='struct direct' ;;
10751 *) guess1="$direntrytype"
10756 'struct dirent') guess2='struct direct' ;;
10757 *) guess2='struct dirent' ;;
10760 if $contains "$guess1" try.c >/dev/null 2>&1; then
10761 direntrytype="$guess1"
10762 echo "Your directory entries are $direntrytype." >&4
10763 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10764 direntrytype="$guess2"
10765 echo "Your directory entries seem to be $direntrytype." >&4
10767 echo "I don't recognize your system's directory entries." >&4
10768 rp="What type is used for directory entries on this system?"
10771 direntrytype="$ans"
10776 : see if the directory entry stores field length
10778 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10779 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10780 echo "Good, your directory entry keeps length information in d_namlen." >&4
10783 echo "Your directory entry does not know about the d_namlen field." >&4
10790 : see if this is an sysdir system
10791 set sys/dir.h i_sysdir
10794 : see if this is an sysndir system
10795 set sys/ndir.h i_sysndir
10800 $cat >dirfd.c <<EOM
10802 #$i_stdlib I_STDLIB
10804 #include <stdlib.h>
10806 #$i_dirent I_DIRENT /**/
10807 #$i_sysdir I_SYS_DIR /**/
10808 #$i_sysndir I_SYS_NDIR /**/
10809 #$i_systypes I_SYS_TYPES /**/
10810 #if defined(I_SYS_TYPES)
10811 #include <sys/types.h>
10813 #if defined(I_DIRENT)
10814 #include <dirent.h>
10815 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10816 #include <sys/dir.h>
10820 #include <sys/ndir.h>
10824 #include <ndir.h> /* may be wrong in the future */
10826 #include <sys/dir.h>
10832 DIR *dirp = opendir(".");
10833 if (dirfd(dirp) >= 0)
10840 if eval $compile; then
10844 $define) echo "dirfd() found." >&4 ;;
10845 *) echo "dirfd() NOT found." >&4 ;;
10851 : see if dlerror exists
10854 set dlerror d_dlerror
10858 : see if dlfcn is available
10859 set dlfcn.h i_dlfcn
10866 On a few systems, the dynamically loaded modules that perl generates and uses
10867 will need a different extension than shared libs. The default will probably
10873 *) dflt="$dlext" ;;
10875 rp='What is the extension of dynamically loaded modules'
10884 : Check if dlsym need a leading underscore
10890 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
10891 $cat >dyna.c <<'EOM'
10898 #$i_stdlib I_STDLIB
10900 #include <stdlib.h>
10904 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
10906 #include <sys/types.h>
10911 extern int fred() ;
10920 int mode = RTLD_LAZY ;
10922 handle = dlopen("./dyna.$dlext", mode) ;
10923 if (handle == NULL) {
10928 symbol = dlsym(handle, "fred") ;
10929 if (symbol == NULL) {
10930 /* try putting a leading underscore */
10931 symbol = dlsym(handle, "_fred") ;
10932 if (symbol == NULL) {
10945 : Call the object file tmp-dyna.o in case dlext=o.
10946 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
10947 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
10948 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
10949 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
10952 1) echo "Test program failed using dlopen." >&4
10953 echo "Perhaps you should not use dynamic loading." >&4;;
10954 2) echo "Test program failed using dlsym." >&4
10955 echo "Perhaps you should not use dynamic loading." >&4;;
10956 3) echo "dlsym needs a leading underscore" >&4
10958 4) echo "dlsym doesn't need a leading underscore." >&4;;
10961 echo "I can't compile and run the test program." >&4
10962 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
10967 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
10972 : see if drand48_r exists
10973 set drand48_r d_drand48_r
10975 case "$d_drand48_r" in
10977 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
10978 case "$d_drand48_r_proto:$usethreads" in
10979 ":define") d_drand48_r_proto=define
10980 set d_drand48_r_proto drand48_r $hdrs
10984 case "$d_drand48_r_proto" in
10986 case "$drand48_r_proto" in
10987 ''|0) try='int drand48_r(struct drand48_data*, double*);'
10988 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
10990 case "$drand48_r_proto" in
10991 ''|0) d_drand48_r=undef
10993 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
10994 * ) case "$drand48_r_proto" in
10995 REENTRANT_PROTO*) ;;
10996 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
10998 echo "Prototype: $try" ;;
11001 *) case "$usethreads" in
11002 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11009 *) drand48_r_proto=0
11013 : see if prototype for drand48 is available
11015 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11018 : see if dup2 exists
11022 : see if eaccess exists
11023 set eaccess d_eaccess
11026 : see if endgrent exists
11027 set endgrent d_endgrent
11030 : see if this is an grp system
11036 xxx=`./findhdr grp.h`
11037 $cppstdin $cppflags $cppminus < $xxx >$$.h
11039 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11051 set d_grpasswd; eval $setvar
11055 : see if endgrent_r exists
11056 set endgrent_r d_endgrent_r
11058 case "$d_endgrent_r" in
11060 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11061 case "$d_endgrent_r_proto:$usethreads" in
11062 ":define") d_endgrent_r_proto=define
11063 set d_endgrent_r_proto endgrent_r $hdrs
11067 case "$d_endgrent_r_proto" in
11069 case "$endgrent_r_proto" in
11070 ''|0) try='int endgrent_r(FILE**);'
11071 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11073 case "$endgrent_r_proto" in
11074 ''|0) try='void endgrent_r(FILE**);'
11075 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11077 case "$endgrent_r_proto" in
11078 ''|0) d_endgrent_r=undef
11080 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11081 * ) case "$endgrent_r_proto" in
11082 REENTRANT_PROTO*) ;;
11083 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11085 echo "Prototype: $try" ;;
11088 *) case "$usethreads" in
11089 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11096 *) endgrent_r_proto=0
11100 : see if endhostent exists
11101 set endhostent d_endhent
11104 : see if this is a netdb.h system
11105 set netdb.h i_netdb
11108 : see if endhostent_r exists
11109 set endhostent_r d_endhostent_r
11111 case "$d_endhostent_r" in
11113 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11114 case "$d_endhostent_r_proto:$usethreads" in
11115 ":define") d_endhostent_r_proto=define
11116 set d_endhostent_r_proto endhostent_r $hdrs
11120 case "$d_endhostent_r_proto" in
11122 case "$endhostent_r_proto" in
11123 ''|0) try='int endhostent_r(struct hostent_data*);'
11124 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11126 case "$endhostent_r_proto" in
11127 ''|0) try='void endhostent_r(struct hostent_data*);'
11128 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11130 case "$endhostent_r_proto" in
11131 ''|0) d_endhostent_r=undef
11132 endhostent_r_proto=0
11133 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11134 * ) case "$endhostent_r_proto" in
11135 REENTRANT_PROTO*) ;;
11136 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11138 echo "Prototype: $try" ;;
11141 *) case "$usethreads" in
11142 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11144 d_endhostent_r=undef
11145 endhostent_r_proto=0
11149 *) endhostent_r_proto=0
11153 : see if endnetent exists
11154 set endnetent d_endnent
11157 : see if endnetent_r exists
11158 set endnetent_r d_endnetent_r
11160 case "$d_endnetent_r" in
11162 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11163 case "$d_endnetent_r_proto:$usethreads" in
11164 ":define") d_endnetent_r_proto=define
11165 set d_endnetent_r_proto endnetent_r $hdrs
11169 case "$d_endnetent_r_proto" in
11171 case "$endnetent_r_proto" in
11172 ''|0) try='int endnetent_r(struct netent_data*);'
11173 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11175 case "$endnetent_r_proto" in
11176 ''|0) try='void endnetent_r(struct netent_data*);'
11177 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11179 case "$endnetent_r_proto" in
11180 ''|0) d_endnetent_r=undef
11181 endnetent_r_proto=0
11182 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11183 * ) case "$endnetent_r_proto" in
11184 REENTRANT_PROTO*) ;;
11185 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11187 echo "Prototype: $try" ;;
11190 *) case "$usethreads" in
11191 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11193 d_endnetent_r=undef
11194 endnetent_r_proto=0
11198 *) endnetent_r_proto=0
11202 : see if endprotoent exists
11203 set endprotoent d_endpent
11206 : see if endprotoent_r exists
11207 set endprotoent_r d_endprotoent_r
11209 case "$d_endprotoent_r" in
11211 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11212 case "$d_endprotoent_r_proto:$usethreads" in
11213 ":define") d_endprotoent_r_proto=define
11214 set d_endprotoent_r_proto endprotoent_r $hdrs
11218 case "$d_endprotoent_r_proto" in
11220 case "$endprotoent_r_proto" in
11221 ''|0) try='int endprotoent_r(struct protoent_data*);'
11222 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11224 case "$endprotoent_r_proto" in
11225 ''|0) try='void endprotoent_r(struct protoent_data*);'
11226 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11228 case "$endprotoent_r_proto" in
11229 ''|0) d_endprotoent_r=undef
11230 endprotoent_r_proto=0
11231 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11232 * ) case "$endprotoent_r_proto" in
11233 REENTRANT_PROTO*) ;;
11234 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11236 echo "Prototype: $try" ;;
11239 *) case "$usethreads" in
11240 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11242 d_endprotoent_r=undef
11243 endprotoent_r_proto=0
11247 *) endprotoent_r_proto=0
11251 : see if endpwent exists
11252 set endpwent d_endpwent
11255 : see if this is a pwd.h system
11261 xxx=`./findhdr pwd.h`
11262 $cppstdin $cppflags $cppminus < $xxx >$$.h
11264 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11272 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11280 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11288 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11296 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11304 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11312 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11320 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11332 set d_pwquota; eval $setvar
11333 set d_pwage; eval $setvar
11334 set d_pwchange; eval $setvar
11335 set d_pwclass; eval $setvar
11336 set d_pwexpire; eval $setvar
11337 set d_pwcomment; eval $setvar
11338 set d_pwgecos; eval $setvar
11339 set d_pwpasswd; eval $setvar
11343 : see if endpwent_r exists
11344 set endpwent_r d_endpwent_r
11346 case "$d_endpwent_r" in
11348 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11349 case "$d_endpwent_r_proto:$usethreads" in
11350 ":define") d_endpwent_r_proto=define
11351 set d_endpwent_r_proto endpwent_r $hdrs
11355 case "$d_endpwent_r_proto" in
11357 case "$endpwent_r_proto" in
11358 ''|0) try='int endpwent_r(FILE**);'
11359 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11361 case "$endpwent_r_proto" in
11362 ''|0) try='void endpwent_r(FILE**);'
11363 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11365 case "$endpwent_r_proto" in
11366 ''|0) d_endpwent_r=undef
11368 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11369 * ) case "$endpwent_r_proto" in
11370 REENTRANT_PROTO*) ;;
11371 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11373 echo "Prototype: $try" ;;
11376 *) case "$usethreads" in
11377 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11384 *) endpwent_r_proto=0
11388 : see if endservent exists
11389 set endservent d_endsent
11392 : see if endservent_r exists
11393 set endservent_r d_endservent_r
11395 case "$d_endservent_r" in
11397 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11398 case "$d_endservent_r_proto:$usethreads" in
11399 ":define") d_endservent_r_proto=define
11400 set d_endservent_r_proto endservent_r $hdrs
11404 case "$d_endservent_r_proto" in
11406 case "$endservent_r_proto" in
11407 ''|0) try='int endservent_r(struct servent_data*);'
11408 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11410 case "$endservent_r_proto" in
11411 ''|0) try='void endservent_r(struct servent_data*);'
11412 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11414 case "$endservent_r_proto" in
11415 ''|0) d_endservent_r=undef
11416 endservent_r_proto=0
11417 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11418 * ) case "$endservent_r_proto" in
11419 REENTRANT_PROTO*) ;;
11420 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11422 echo "Prototype: $try" ;;
11425 *) case "$usethreads" in
11426 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11428 d_endservent_r=undef
11429 endservent_r_proto=0
11433 *) endservent_r_proto=0
11437 : Locate the flags for 'open()'
11440 #include <sys/types.h>
11445 #include <sys/file.h>
11447 #$i_stdlib I_STDLIB
11449 #include <stdlib.h>
11460 : check sys/file.h first to get FREAD on Sun
11461 if $test `./findhdr sys/file.h` && \
11462 set try -DI_SYS_FILE && eval $compile; then
11464 echo "<sys/file.h> defines the O_* constants..." >&4
11465 if $run ./try; then
11466 echo "and you have the 3 argument form of open()." >&4
11469 echo "but not the 3 argument form of open(). Oh, well." >&4
11472 elif $test `./findhdr fcntl.h` && \
11473 set try -DI_FCNTL && eval $compile; then
11475 echo "<fcntl.h> defines the O_* constants..." >&4
11476 if $run ./try; then
11477 echo "and you have the 3 argument form of open()." >&4
11480 echo "but not the 3 argument form of open(). Oh, well." >&4
11485 echo "I can't find the O_* constant definitions! You got problems." >&4
11491 : see which of string.h or strings.h is needed
11493 strings=`./findhdr string.h`
11494 if $test "$strings" && $test -r "$strings"; then
11495 echo "Using <string.h> instead of <strings.h>." >&4
11499 strings=`./findhdr strings.h`
11500 if $test "$strings" && $test -r "$strings"; then
11501 echo "Using <strings.h> instead of <string.h>." >&4
11503 echo "No string header found -- You'll surely have problems." >&4
11508 case "$i_string" in
11509 "$undef") strings=`./findhdr strings.h`;;
11510 *) strings=`./findhdr string.h`;;
11513 : see if this is a sys/file.h system
11518 : do we need to include sys/file.h ?
11522 if $h_sysfile; then
11524 echo "We'll be including <sys/file.h>." >&4
11527 echo "We won't be including <sys/file.h>." >&4
11537 : see if fcntl.h is there
11542 : see if we can include fcntl.h
11548 echo "We'll be including <fcntl.h>." >&4
11551 if $h_sysfile; then
11552 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11554 echo "We won't be including <fcntl.h>." >&4
11566 : check for non-blocking I/O stuff
11567 case "$h_sysfile" in
11568 true) echo "#include <sys/file.h>" > head.c;;
11571 true) echo "#include <fcntl.h>" > head.c;;
11572 *) echo "#include <sys/fcntl.h>" > head.c;;
11577 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11578 case "$o_nonblock" in
11580 $cat head.c > try.c
11581 $cat >>try.c <<EOCP
11583 #$i_stdlib I_STDLIB
11585 #include <stdlib.h>
11593 printf("O_NONBLOCK\n");
11597 printf("O_NDELAY\n");
11601 printf("FNDELAY\n");
11608 if eval $compile_ok; then
11609 o_nonblock=`$run ./try`
11610 case "$o_nonblock" in
11611 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11612 *) echo "Seems like we can use $o_nonblock.";;
11615 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11618 *) echo "Using $hint value $o_nonblock.";;
11620 $rm -f try try.* .out core
11623 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11626 $cat head.c > try.c
11627 $cat >>try.c <<EOCP
11629 #include <sys/types.h>
11630 #include <signal.h>
11632 #$i_stdlib I_STDLIB
11634 #include <stdlib.h>
11640 #define MY_O_NONBLOCK $o_nonblock
11641 #ifndef errno /* XXX need better Configure test */
11644 #$i_unistd I_UNISTD
11646 #include <unistd.h>
11648 #$i_string I_STRING
11650 #include <string.h>
11652 #include <strings.h>
11654 $signal_t blech(x) int x; { exit(3); }
11656 $cat >> try.c <<'EOCP'
11664 pipe(pd); /* Down: child -> parent */
11665 pipe(pu); /* Up: parent -> child */
11668 close(pd[1]); /* Parent reads from pd[0] */
11669 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11671 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11676 signal(SIGALRM, blech);
11678 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11680 sprintf(string, "%d\n", ret);
11681 write(2, string, strlen(string));
11684 if (errno == EAGAIN) {
11685 printf("EAGAIN\n");
11690 if (errno == EWOULDBLOCK)
11691 printf("EWOULDBLOCK\n");
11694 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11695 sleep(2); /* Give it time to close our pipe */
11697 ret = read(pd[0], buf, 1); /* Should read EOF */
11699 sprintf(string, "%d\n", ret);
11700 write(4, string, strlen(string));
11704 close(pd[0]); /* We write to pd[1] */
11705 close(pu[1]); /* We read from pu[0] */
11706 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11707 close(pd[1]); /* Pipe pd is now fully closed! */
11708 exit(0); /* Bye bye, thank you for playing! */
11712 if eval $compile_ok; then
11713 echo "$startsh" >mtry
11714 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11716 ./mtry >/dev/null 2>&1
11718 0) eagain=`$cat try.out`;;
11719 1) echo "Could not perform non-blocking setting!";;
11720 2) echo "I did a successful read() for something that was not there!";;
11721 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11722 4) echo "Could not find F_SETFL!";;
11723 *) echo "Something terribly wrong happened during testing.";;
11725 rd_nodata=`$cat try.ret`
11726 echo "A read() system call with no data present returns $rd_nodata."
11727 case "$rd_nodata" in
11730 echo "(That's peculiar, fixing that to be -1.)"
11736 echo "Forcing errno EAGAIN on read() with no data available."
11740 echo "Your read() sets errno to $eagain when no data is available."
11743 status=`$cat try.err`
11745 0) echo "And it correctly returns 0 to signal EOF.";;
11746 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11747 *) echo "However, your read() returns '$status' on EOF??";;
11750 if test "$status" = "$rd_nodata"; then
11751 echo "WARNING: you can't distinguish between EOF and no data!"
11755 echo "I can't compile the test program--assuming errno EAGAIN will do."
11762 echo "Using $hint value $eagain."
11763 echo "Your read() returns $rd_nodata when no data is present."
11764 case "$d_eofnblk" in
11765 "$define") echo "And you can see EOF because read() returns 0.";;
11766 "$undef") echo "But you can't see EOF status from read() returned value.";;
11768 echo "(Assuming you can't see EOF status from read anyway.)"
11774 $rm -f try try.* .out core head.c mtry
11776 : see if _ptr and _cnt from stdio act std
11779 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11780 echo "(Looks like you have stdio.h from BSD.)"
11781 case "$stdio_ptr" in
11782 '') stdio_ptr='((fp)->_p)'
11785 *) ptr_lval=$d_stdio_ptr_lval;;
11787 case "$stdio_cnt" in
11788 '') stdio_cnt='((fp)->_r)'
11791 *) cnt_lval=$d_stdio_cnt_lval;;
11793 case "$stdio_base" in
11794 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11796 case "$stdio_bufsiz" in
11797 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11799 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11800 echo "(Looks like you have stdio.h from Linux.)"
11801 case "$stdio_ptr" in
11802 '') stdio_ptr='((fp)->_IO_read_ptr)'
11805 *) ptr_lval=$d_stdio_ptr_lval;;
11807 case "$stdio_cnt" in
11808 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11811 *) cnt_lval=$d_stdio_cnt_lval;;
11813 case "$stdio_base" in
11814 '') stdio_base='((fp)->_IO_read_base)';;
11816 case "$stdio_bufsiz" in
11817 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11820 case "$stdio_ptr" in
11821 '') stdio_ptr='((fp)->_ptr)'
11824 *) ptr_lval=$d_stdio_ptr_lval;;
11826 case "$stdio_cnt" in
11827 '') stdio_cnt='((fp)->_cnt)'
11830 *) cnt_lval=$d_stdio_cnt_lval;;
11832 case "$stdio_base" in
11833 '') stdio_base='((fp)->_base)';;
11835 case "$stdio_bufsiz" in
11836 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11840 : test whether _ptr and _cnt really work
11841 echo "Checking how std your stdio is..." >&4
11844 #$i_stdlib I_STDLIB
11846 #include <stdlib.h>
11848 #define FILE_ptr(fp) $stdio_ptr
11849 #define FILE_cnt(fp) $stdio_cnt
11851 FILE *fp = fopen("try.c", "r");
11854 18 <= FILE_cnt(fp) &&
11855 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11863 if eval $compile && $to try.c; then
11864 if $run ./try; then
11865 echo "Your stdio acts pretty std."
11868 echo "Your stdio isn't very std."
11871 echo "Your stdio doesn't appear very std."
11875 # glibc 2.2.90 and above apparently change stdio streams so Perl's
11876 # direct buffer manipulation no longer works. The Configure tests
11877 # should be changed to correctly detect this, but until then,
11878 # the following check should at least let perl compile and run.
11879 # (This quick fix should be updated before 5.8.1.)
11880 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
11881 # A. Dougherty, June 3, 2002.
11882 case "$d_gnulibc" in
11884 case "$gnulibc_version" in
11888 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
11897 : Can _ptr be used as an lvalue?
11898 case "$d_stdstdio$ptr_lval" in
11899 $define$define) val=$define ;;
11902 set d_stdio_ptr_lval
11905 : Can _cnt be used as an lvalue?
11906 case "$d_stdstdio$cnt_lval" in
11907 $define$define) val=$define ;;
11910 set d_stdio_cnt_lval
11914 : test whether setting _ptr sets _cnt as a side effect
11915 d_stdio_ptr_lval_sets_cnt="$undef"
11916 d_stdio_ptr_lval_nochange_cnt="$undef"
11917 case "$d_stdio_ptr_lval$d_stdstdio" in
11919 echo "Checking to see what happens if we set the stdio ptr..." >&4
11922 /* Can we scream? */
11923 /* Eat dust sed :-) */
11924 /* In the buffer space, no one can hear you scream. */
11925 #$i_stdlib I_STDLIB
11927 #include <stdlib.h>
11929 #define FILE_ptr(fp) $stdio_ptr
11930 #define FILE_cnt(fp) $stdio_cnt
11931 #include <sys/types.h>
11933 FILE *fp = fopen("try.c", "r");
11938 puts("Fail even to read");
11941 c = getc(fp); /* Read away the first # */
11943 puts("Fail even to read");
11947 18 <= FILE_cnt(fp) &&
11948 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11950 puts("Fail even to read");
11953 ptr = (char*) FILE_ptr(fp);
11954 cnt = (size_t)FILE_cnt(fp);
11956 FILE_ptr(fp) += 42;
11958 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
11959 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
11962 if (FILE_cnt(fp) <= 20) {
11963 printf ("Fail (<20 chars to test)");
11966 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
11967 puts("Fail compare");
11970 if (cnt == FILE_cnt(fp)) {
11971 puts("Pass_unchanged");
11974 if (FILE_cnt(fp) == (cnt - 42)) {
11975 puts("Pass_changed");
11978 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
11984 if eval $compile && $to try.c; then
11985 case `$run ./try` in
11987 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
11988 d_stdio_ptr_lval_sets_cnt="$define" ;;
11990 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
11991 d_stdio_ptr_lval_nochange_cnt="$define" ;;
11993 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
11995 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
11998 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12004 : see if _base is also standard
12006 case "$d_stdstdio" in
12010 #$i_stdlib I_STDLIB
12012 #include <stdlib.h>
12014 #define FILE_base(fp) $stdio_base
12015 #define FILE_bufsiz(fp) $stdio_bufsiz
12017 FILE *fp = fopen("try.c", "r");
12020 19 <= FILE_bufsiz(fp) &&
12021 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12028 if eval $compile && $to try.c; then
12029 if $run ./try; then
12030 echo "And its _base field acts std."
12033 echo "But its _base field isn't std."
12036 echo "However, it seems to be lacking the _base field."
12044 : see if fast_stdio exists
12046 case "$d_stdstdio:$d_stdio_ptr_lval" in
12048 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12050 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12061 : see if fchdir exists
12062 set fchdir d_fchdir
12065 : see if fchmod exists
12066 set fchmod d_fchmod
12069 : see if fchown exists
12070 set fchown d_fchown
12073 : see if this is an fcntl system
12078 : See if fcntl-based locking works.
12080 #$i_stdlib I_STDLIB
12082 #include <stdlib.h>
12084 #include <unistd.h>
12086 #include <signal.h>
12087 $signal_t blech(x) int x; { exit(3); }
12089 #if defined(F_SETLK) && defined(F_SETLKW)
12090 struct flock flock;
12092 fd = open("try.c", O_RDONLY);
12093 flock.l_type = F_RDLCK;
12094 flock.l_whence = SEEK_SET;
12095 flock.l_start = flock.l_len = 0;
12096 signal(SIGALRM, blech);
12098 retval = fcntl(fd, F_SETLK, &flock);
12100 (retval < 0 ? exit(2) : exit(0));
12106 echo "Checking if fcntl-based file locking works... "
12110 if eval $compile_ok; then
12111 if $run ./try; then
12112 echo "Yes, it seems to work."
12115 echo "Nope, it didn't work."
12120 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12121 *** This is (almost) impossible.
12122 *** If your NFS lock daemons are not feeling well, something like
12123 *** this may happen, please investigate. Cannot continue, aborting.
12131 echo "I'm unable to compile the test program, so I'll assume not."
12136 echo "Nope, since you don't even have fcntl()."
12139 set d_fcntl_can_lock
12144 : check for fd_set items
12147 Checking to see how well your C compiler handles fd_set and friends ...
12150 #$i_stdlib I_STDLIB
12152 #include <stdlib.h>
12154 #$i_systime I_SYS_TIME
12155 #$i_sysselct I_SYS_SELECT
12156 #$d_socket HAS_SOCKET
12157 #include <sys/types.h>
12159 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12162 #include <sys/time.h>
12164 #ifdef I_SYS_SELECT
12165 #include <sys/select.h>
12174 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12182 if eval $compile; then
12183 d_fds_bits="$define"
12185 echo "Well, your system knows about the normal fd_set typedef..." >&4
12186 if $run ./try; then
12187 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12188 d_fd_macros="$define"
12191 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12193 d_fd_macros="$undef"
12197 Hmm, your compiler has some difficulty with fd_set. Checking further...
12200 if eval $compile; then
12201 d_fds_bits="$undef"
12203 echo "Well, your system has some sort of fd_set available..." >&4
12204 if $run ./try; then
12205 echo "and you have the normal fd_set macros." >&4
12206 d_fd_macros="$define"
12209 but not the normal fd_set macros! Gross! More work for me...
12211 d_fd_macros="$undef"
12214 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12216 d_fds_bits="$undef"
12217 d_fd_macros="$undef"
12222 : see if fgetpos exists
12223 set fgetpos d_fgetpos
12226 : see if finite exists
12227 set finite d_finite
12230 : see if finitel exists
12231 set finitel d_finitel
12234 : see if flock exists
12238 : see if prototype for flock is available
12240 set d_flockproto flock $i_sysfile sys/file.h
12243 : see if fork exists
12247 : see if fp_class exists
12248 set fp_class d_fp_class
12251 : see if pathconf exists
12252 set pathconf d_pathconf
12255 : see if fpathconf exists
12256 set fpathconf d_fpathconf
12259 : see if fpclass exists
12260 set fpclass d_fpclass
12263 : see if fpclassify exists
12264 set fpclassify d_fpclassify
12267 : see if fpclassl exists
12268 set fpclassl d_fpclassl
12272 : check for fpos64_t
12274 echo "Checking to see if you have fpos64_t..." >&4
12277 int main() { fpos64_t x = 7; }
12280 if eval $compile; then
12282 echo "You have fpos64_t."
12285 echo "You do not have fpos64_t."
12286 case "$fpossize" in
12287 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12294 : see if frexpl exists
12295 set frexpl d_frexpl
12298 : see if this is a sys/param system
12299 set sys/param.h i_sysparam
12302 : see if this is a sys/mount.h system
12303 set sys/mount.h i_sysmount
12308 echo "Checking to see if your system supports struct fs_data..." >&4
12309 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12311 case "$d_fs_data_s" in
12312 "$define") echo "Yes, it does." ;;
12313 *) echo "No, it doesn't." ;;
12316 : see if fseeko exists
12317 set fseeko d_fseeko
12319 case "$longsize" in
12320 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12323 : see if fsetpos exists
12324 set fsetpos d_fsetpos
12328 : see if fstatfs exists
12329 set fstatfs d_fstatfs
12333 : see if statvfs exists
12334 set statvfs d_statvfs
12337 : see if fstatvfs exists
12338 set fstatvfs d_fstatvfs
12342 : see if fsync exists
12346 : see if ftello exists
12347 set ftello d_ftello
12349 case "$longsize" in
12350 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12353 : see if getcwd exists
12354 set getcwd d_getcwd
12357 : see if getespwnam exists
12358 set getespwnam d_getespwnam
12362 : see if getfsstat exists
12363 set getfsstat d_getfsstat
12366 : see if getgrent exists
12367 set getgrent d_getgrent
12370 : see if getgrent_r exists
12371 set getgrent_r d_getgrent_r
12373 case "$d_getgrent_r" in
12375 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12376 case "$d_getgrent_r_proto:$usethreads" in
12377 ":define") d_getgrent_r_proto=define
12378 set d_getgrent_r_proto getgrent_r $hdrs
12382 case "$d_getgrent_r_proto" in
12384 case "$getgrent_r_proto" in
12385 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12386 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12388 case "$getgrent_r_proto" in
12389 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12390 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12392 case "$getgrent_r_proto" in
12393 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12394 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12396 case "$getgrent_r_proto" in
12397 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12398 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12400 case "$getgrent_r_proto" in
12401 ''|0) try='int getgrent_r(struct group*, char*, int);'
12402 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12404 case "$getgrent_r_proto" in
12405 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12406 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12408 case "$getgrent_r_proto" in
12409 ''|0) d_getgrent_r=undef
12411 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12412 * ) case "$getgrent_r_proto" in
12413 REENTRANT_PROTO*) ;;
12414 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12416 echo "Prototype: $try" ;;
12419 *) case "$usethreads" in
12420 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12427 *) getgrent_r_proto=0
12431 : see if getgrgid_r exists
12432 set getgrgid_r d_getgrgid_r
12434 case "$d_getgrgid_r" in
12436 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12437 case "$d_getgrgid_r_proto:$usethreads" in
12438 ":define") d_getgrgid_r_proto=define
12439 set d_getgrgid_r_proto getgrgid_r $hdrs
12443 case "$d_getgrgid_r_proto" in
12445 case "$getgrgid_r_proto" in
12446 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12447 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12449 case "$getgrgid_r_proto" in
12450 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12451 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12453 case "$getgrgid_r_proto" in
12454 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12455 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12457 case "$getgrgid_r_proto" in
12458 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12459 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12461 case "$getgrgid_r_proto" in
12462 ''|0) d_getgrgid_r=undef
12464 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12465 * ) case "$getgrgid_r_proto" in
12466 REENTRANT_PROTO*) ;;
12467 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12469 echo "Prototype: $try" ;;
12472 *) case "$usethreads" in
12473 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12480 *) getgrgid_r_proto=0
12484 : see if getgrnam_r exists
12485 set getgrnam_r d_getgrnam_r
12487 case "$d_getgrnam_r" in
12489 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12490 case "$d_getgrnam_r_proto:$usethreads" in
12491 ":define") d_getgrnam_r_proto=define
12492 set d_getgrnam_r_proto getgrnam_r $hdrs
12496 case "$d_getgrnam_r_proto" in
12498 case "$getgrnam_r_proto" in
12499 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12500 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12502 case "$getgrnam_r_proto" in
12503 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12504 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12506 case "$getgrnam_r_proto" in
12507 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12508 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12510 case "$getgrnam_r_proto" in
12511 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12512 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12514 case "$getgrnam_r_proto" in
12515 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12516 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12518 case "$getgrnam_r_proto" in
12519 ''|0) d_getgrnam_r=undef
12521 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12522 * ) case "$getgrnam_r_proto" in
12523 REENTRANT_PROTO*) ;;
12524 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12526 echo "Prototype: $try" ;;
12529 *) case "$usethreads" in
12530 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12537 *) getgrnam_r_proto=0
12541 : see if gethostbyaddr exists
12542 set gethostbyaddr d_gethbyaddr
12545 : see if gethostbyname exists
12546 set gethostbyname d_gethbyname
12549 : see if gethostent exists
12550 set gethostent d_gethent
12553 : see how we will look up host name
12556 if set gethostname val -f d_gethname; eval $csym; $val; then
12557 echo 'gethostname() found.' >&4
12558 d_gethname="$define"
12561 if set uname val -f d_uname; eval $csym; $val; then
12564 uname() was found, but you're running xenix, and older versions of xenix
12565 have a broken uname(). If you don't really know whether your xenix is old
12566 enough to have a broken system call, use the default answer.
12571 "$define") dflt=n;;
12573 rp='Is your uname() broken?'
12576 n*) d_uname="$define"; call=uname;;
12579 echo 'uname() found.' >&4
12586 case "$d_gethname" in
12587 '') d_gethname="$undef";;
12590 '') d_uname="$undef";;
12592 case "$d_uname$d_gethname" in
12597 Every now and then someone has a $call() that lies about the hostname
12598 but can't be fixed for political or economic reasons. If you wish, I can
12599 pretend $call() isn't there and maybe compute hostname at run-time
12600 thanks to the '$phostname' command.
12603 rp="Shall I ignore $call() from now on?"
12606 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12609 case "$phostname" in
12610 '') aphostname='';;
12611 *) case "$aphostname" in
12613 *) set X $phostname
12617 file=`./loc $file $file $pth`
12618 aphostname=`echo $file $*`
12623 case "$d_uname$d_gethname" in
12626 case "$phostname" in
12628 echo "There will be no way for $package to get your hostname." >&4;;
12630 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12634 case "$d_phostname" in
12635 '') d_phostname="$undef";;
12638 : see if gethostbyaddr_r exists
12639 set gethostbyaddr_r d_gethostbyaddr_r
12641 case "$d_gethostbyaddr_r" in
12643 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12644 case "$d_gethostbyaddr_r_proto:$usethreads" in
12645 ":define") d_gethostbyaddr_r_proto=define
12646 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12650 case "$d_gethostbyaddr_r_proto" in
12652 case "$gethostbyaddr_r_proto" in
12653 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12654 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12656 case "$gethostbyaddr_r_proto" in
12657 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12658 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12660 case "$gethostbyaddr_r_proto" in
12661 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12662 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12664 case "$gethostbyaddr_r_proto" in
12665 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12666 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12668 case "$gethostbyaddr_r_proto" in
12669 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12670 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12672 case "$gethostbyaddr_r_proto" in
12673 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12674 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12676 case "$gethostbyaddr_r_proto" in
12677 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12678 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12680 case "$gethostbyaddr_r_proto" in
12681 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12682 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12684 case "$gethostbyaddr_r_proto" in
12685 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12686 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12688 case "$gethostbyaddr_r_proto" in
12689 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12690 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12692 case "$gethostbyaddr_r_proto" in
12693 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12694 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12696 case "$gethostbyaddr_r_proto" in
12697 ''|0) d_gethostbyaddr_r=undef
12698 gethostbyaddr_r_proto=0
12699 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12700 * ) case "$gethostbyaddr_r_proto" in
12701 REENTRANT_PROTO*) ;;
12702 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12704 echo "Prototype: $try" ;;
12707 *) case "$usethreads" in
12708 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12710 d_gethostbyaddr_r=undef
12711 gethostbyaddr_r_proto=0
12715 *) gethostbyaddr_r_proto=0
12719 : see if gethostbyname_r exists
12720 set gethostbyname_r d_gethostbyname_r
12722 case "$d_gethostbyname_r" in
12724 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12725 case "$d_gethostbyname_r_proto:$usethreads" in
12726 ":define") d_gethostbyname_r_proto=define
12727 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12731 case "$d_gethostbyname_r_proto" in
12733 case "$gethostbyname_r_proto" in
12734 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12735 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12737 case "$gethostbyname_r_proto" in
12738 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12739 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12741 case "$gethostbyname_r_proto" in
12742 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12743 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
12745 case "$gethostbyname_r_proto" in
12746 ''|0) d_gethostbyname_r=undef
12747 gethostbyname_r_proto=0
12748 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
12749 * ) case "$gethostbyname_r_proto" in
12750 REENTRANT_PROTO*) ;;
12751 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
12753 echo "Prototype: $try" ;;
12756 *) case "$usethreads" in
12757 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
12759 d_gethostbyname_r=undef
12760 gethostbyname_r_proto=0
12764 *) gethostbyname_r_proto=0
12768 : see if gethostent_r exists
12769 set gethostent_r d_gethostent_r
12771 case "$d_gethostent_r" in
12773 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12774 case "$d_gethostent_r_proto:$usethreads" in
12775 ":define") d_gethostent_r_proto=define
12776 set d_gethostent_r_proto gethostent_r $hdrs
12780 case "$d_gethostent_r_proto" in
12782 case "$gethostent_r_proto" in
12783 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
12784 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
12786 case "$gethostent_r_proto" in
12787 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
12788 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
12790 case "$gethostent_r_proto" in
12791 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
12792 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
12794 case "$gethostent_r_proto" in
12795 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
12796 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
12798 case "$gethostent_r_proto" in
12799 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
12800 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
12802 case "$gethostent_r_proto" in
12803 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
12804 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
12806 case "$gethostent_r_proto" in
12807 ''|0) d_gethostent_r=undef
12808 gethostent_r_proto=0
12809 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
12810 * ) case "$gethostent_r_proto" in
12811 REENTRANT_PROTO*) ;;
12812 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
12814 echo "Prototype: $try" ;;
12817 *) case "$usethreads" in
12818 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
12820 d_gethostent_r=undef
12821 gethostent_r_proto=0
12825 *) gethostent_r_proto=0
12829 : see if prototypes for various gethostxxx netdb.h functions are available
12831 set d_gethostprotos gethostent $i_netdb netdb.h
12834 : see if getitimer exists
12835 set getitimer d_getitimer
12838 : see if getlogin exists
12839 set getlogin d_getlogin
12842 : see if getlogin_r exists
12843 set getlogin_r d_getlogin_r
12845 case "$d_getlogin_r" in
12847 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
12848 case "$d_getlogin_r_proto:$usethreads" in
12849 ":define") d_getlogin_r_proto=define
12850 set d_getlogin_r_proto getlogin_r $hdrs
12854 case "$d_getlogin_r_proto" in
12856 case "$getlogin_r_proto" in
12857 ''|0) try='int getlogin_r(char*, size_t);'
12858 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
12860 case "$getlogin_r_proto" in
12861 ''|0) try='int getlogin_r(char*, int);'
12862 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
12864 case "$getlogin_r_proto" in
12865 ''|0) try='char* getlogin_r(char*, size_t);'
12866 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
12868 case "$getlogin_r_proto" in
12869 ''|0) try='char* getlogin_r(char*, int);'
12870 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
12872 case "$getlogin_r_proto" in
12873 ''|0) d_getlogin_r=undef
12875 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
12876 * ) case "$getlogin_r_proto" in
12877 REENTRANT_PROTO*) ;;
12878 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
12880 echo "Prototype: $try" ;;
12883 *) case "$usethreads" in
12884 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
12891 *) getlogin_r_proto=0
12895 : see if getmnt exists
12896 set getmnt d_getmnt
12899 : see if getmntent exists
12900 set getmntent d_getmntent
12903 : see if getnetbyaddr exists
12904 set getnetbyaddr d_getnbyaddr
12907 : see if getnetbyname exists
12908 set getnetbyname d_getnbyname
12911 : see if getnetent exists
12912 set getnetent d_getnent
12915 : see if getnetbyaddr_r exists
12916 set getnetbyaddr_r d_getnetbyaddr_r
12918 case "$d_getnetbyaddr_r" in
12920 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12921 case "$d_getnetbyaddr_r_proto:$usethreads" in
12922 ":define") d_getnetbyaddr_r_proto=define
12923 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
12927 case "$d_getnetbyaddr_r_proto" in
12929 case "$getnetbyaddr_r_proto" in
12930 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
12931 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
12933 case "$getnetbyaddr_r_proto" in
12934 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
12935 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
12937 case "$getnetbyaddr_r_proto" in
12938 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
12939 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
12941 case "$getnetbyaddr_r_proto" in
12942 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
12943 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
12945 case "$getnetbyaddr_r_proto" in
12946 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
12947 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
12949 case "$getnetbyaddr_r_proto" in
12950 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
12951 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
12953 case "$getnetbyaddr_r_proto" in
12954 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
12955 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
12957 case "$getnetbyaddr_r_proto" in
12958 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
12959 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
12961 case "$getnetbyaddr_r_proto" in
12962 ''|0) d_getnetbyaddr_r=undef
12963 getnetbyaddr_r_proto=0
12964 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
12965 * ) case "$getnetbyaddr_r_proto" in
12966 REENTRANT_PROTO*) ;;
12967 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
12969 echo "Prototype: $try" ;;
12972 *) case "$usethreads" in
12973 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
12975 d_getnetbyaddr_r=undef
12976 getnetbyaddr_r_proto=0
12980 *) getnetbyaddr_r_proto=0
12984 : see if getnetbyname_r exists
12985 set getnetbyname_r d_getnetbyname_r
12987 case "$d_getnetbyname_r" in
12989 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12990 case "$d_getnetbyname_r_proto:$usethreads" in
12991 ":define") d_getnetbyname_r_proto=define
12992 set d_getnetbyname_r_proto getnetbyname_r $hdrs
12996 case "$d_getnetbyname_r_proto" in
12998 case "$getnetbyname_r_proto" in
12999 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13000 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13002 case "$getnetbyname_r_proto" in
13003 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13004 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13006 case "$getnetbyname_r_proto" in
13007 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13008 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13010 case "$getnetbyname_r_proto" in
13011 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13012 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13014 case "$getnetbyname_r_proto" in
13015 ''|0) d_getnetbyname_r=undef
13016 getnetbyname_r_proto=0
13017 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13018 * ) case "$getnetbyname_r_proto" in
13019 REENTRANT_PROTO*) ;;
13020 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13022 echo "Prototype: $try" ;;
13025 *) case "$usethreads" in
13026 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13028 d_getnetbyname_r=undef
13029 getnetbyname_r_proto=0
13033 *) getnetbyname_r_proto=0
13037 : see if getnetent_r exists
13038 set getnetent_r d_getnetent_r
13040 case "$d_getnetent_r" in
13042 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13043 case "$d_getnetent_r_proto:$usethreads" in
13044 ":define") d_getnetent_r_proto=define
13045 set d_getnetent_r_proto getnetent_r $hdrs
13049 case "$d_getnetent_r_proto" in
13051 case "$getnetent_r_proto" in
13052 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13053 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13055 case "$getnetent_r_proto" in
13056 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13057 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13059 case "$getnetent_r_proto" in
13060 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13061 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13063 case "$getnetent_r_proto" in
13064 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13065 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13067 case "$getnetent_r_proto" in
13068 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13069 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13071 case "$getnetent_r_proto" in
13072 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13073 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13075 case "$getnetent_r_proto" in
13076 ''|0) d_getnetent_r=undef
13077 getnetent_r_proto=0
13078 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13079 * ) case "$getnetent_r_proto" in
13080 REENTRANT_PROTO*) ;;
13081 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13083 echo "Prototype: $try" ;;
13086 *) case "$usethreads" in
13087 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13089 d_getnetent_r=undef
13090 getnetent_r_proto=0
13094 *) getnetent_r_proto=0
13098 : see if prototypes for various getnetxxx netdb.h functions are available
13100 set d_getnetprotos getnetent $i_netdb netdb.h
13103 : see if getpagesize exists
13104 set getpagesize d_getpagsz
13108 : see if getprotobyname exists
13109 set getprotobyname d_getpbyname
13112 : see if getprotobynumber exists
13113 set getprotobynumber d_getpbynumber
13116 : see if getprotoent exists
13117 set getprotoent d_getpent
13120 : see if getpgid exists
13121 set getpgid d_getpgid
13124 : see if getpgrp2 exists
13125 set getpgrp2 d_getpgrp2
13128 : see if getppid exists
13129 set getppid d_getppid
13132 : see if getpriority exists
13133 set getpriority d_getprior
13136 : see if getprotobyname_r exists
13137 set getprotobyname_r d_getprotobyname_r
13139 case "$d_getprotobyname_r" in
13141 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13142 case "$d_getprotobyname_r_proto:$usethreads" in
13143 ":define") d_getprotobyname_r_proto=define
13144 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13148 case "$d_getprotobyname_r_proto" in
13150 case "$getprotobyname_r_proto" in
13151 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13152 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13154 case "$getprotobyname_r_proto" in
13155 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13156 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13158 case "$getprotobyname_r_proto" in
13159 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13160 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13162 case "$getprotobyname_r_proto" in
13163 ''|0) d_getprotobyname_r=undef
13164 getprotobyname_r_proto=0
13165 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13166 * ) case "$getprotobyname_r_proto" in
13167 REENTRANT_PROTO*) ;;
13168 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13170 echo "Prototype: $try" ;;
13173 *) case "$usethreads" in
13174 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13176 d_getprotobyname_r=undef
13177 getprotobyname_r_proto=0
13181 *) getprotobyname_r_proto=0
13185 : see if getprotobynumber_r exists
13186 set getprotobynumber_r d_getprotobynumber_r
13188 case "$d_getprotobynumber_r" in
13190 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13191 case "$d_getprotobynumber_r_proto:$usethreads" in
13192 ":define") d_getprotobynumber_r_proto=define
13193 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13197 case "$d_getprotobynumber_r_proto" in
13199 case "$getprotobynumber_r_proto" in
13200 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13201 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13203 case "$getprotobynumber_r_proto" in
13204 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13205 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13207 case "$getprotobynumber_r_proto" in
13208 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13209 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13211 case "$getprotobynumber_r_proto" in
13212 ''|0) d_getprotobynumber_r=undef
13213 getprotobynumber_r_proto=0
13214 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13215 * ) case "$getprotobynumber_r_proto" in
13216 REENTRANT_PROTO*) ;;
13217 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13219 echo "Prototype: $try" ;;
13222 *) case "$usethreads" in
13223 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13225 d_getprotobynumber_r=undef
13226 getprotobynumber_r_proto=0
13230 *) getprotobynumber_r_proto=0
13234 : see if getprotoent_r exists
13235 set getprotoent_r d_getprotoent_r
13237 case "$d_getprotoent_r" in
13239 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13240 case "$d_getprotoent_r_proto:$usethreads" in
13241 ":define") d_getprotoent_r_proto=define
13242 set d_getprotoent_r_proto getprotoent_r $hdrs
13246 case "$d_getprotoent_r_proto" in
13248 case "$getprotoent_r_proto" in
13249 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13250 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13252 case "$getprotoent_r_proto" in
13253 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13254 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13256 case "$getprotoent_r_proto" in
13257 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13258 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13260 case "$getprotoent_r_proto" in
13261 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13262 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13264 case "$getprotoent_r_proto" in
13265 ''|0) d_getprotoent_r=undef
13266 getprotoent_r_proto=0
13267 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13268 * ) case "$getprotoent_r_proto" in
13269 REENTRANT_PROTO*) ;;
13270 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13272 echo "Prototype: $try" ;;
13275 *) case "$usethreads" in
13276 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13278 d_getprotoent_r=undef
13279 getprotoent_r_proto=0
13283 *) getprotoent_r_proto=0
13287 : see if prototypes for various getprotoxxx netdb.h functions are available
13289 set d_getprotoprotos getprotoent $i_netdb netdb.h
13292 : see if getprpwnam exists
13293 set getprpwnam d_getprpwnam
13296 : see if getpwent exists
13297 set getpwent d_getpwent
13300 : see if getpwent_r exists
13301 set getpwent_r d_getpwent_r
13303 case "$d_getpwent_r" in
13305 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13306 case "$d_getpwent_r_proto:$usethreads" in
13307 ":define") d_getpwent_r_proto=define
13308 set d_getpwent_r_proto getpwent_r $hdrs
13312 case "$d_getpwent_r_proto" in
13314 case "$getpwent_r_proto" in
13315 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13316 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13318 case "$getpwent_r_proto" in
13319 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13320 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13322 case "$getpwent_r_proto" in
13323 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13324 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13326 case "$getpwent_r_proto" in
13327 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13328 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13330 case "$getpwent_r_proto" in
13331 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13332 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13334 case "$getpwent_r_proto" in
13335 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13336 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13338 case "$getpwent_r_proto" in
13339 ''|0) d_getpwent_r=undef
13341 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13342 * ) case "$getpwent_r_proto" in
13343 REENTRANT_PROTO*) ;;
13344 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13346 echo "Prototype: $try" ;;
13349 *) case "$usethreads" in
13350 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13357 *) getpwent_r_proto=0
13361 : see if getpwnam_r exists
13362 set getpwnam_r d_getpwnam_r
13364 case "$d_getpwnam_r" in
13366 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13367 case "$d_getpwnam_r_proto:$usethreads" in
13368 ":define") d_getpwnam_r_proto=define
13369 set d_getpwnam_r_proto getpwnam_r $hdrs
13373 case "$d_getpwnam_r_proto" in
13375 case "$getpwnam_r_proto" in
13376 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13377 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13379 case "$getpwnam_r_proto" in
13380 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13381 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13383 case "$getpwnam_r_proto" in
13384 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13385 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13387 case "$getpwnam_r_proto" in
13388 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13389 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13391 case "$getpwnam_r_proto" in
13392 ''|0) d_getpwnam_r=undef
13394 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13395 * ) case "$getpwnam_r_proto" in
13396 REENTRANT_PROTO*) ;;
13397 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13399 echo "Prototype: $try" ;;
13402 *) case "$usethreads" in
13403 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13410 *) getpwnam_r_proto=0
13414 : see if getpwuid_r exists
13415 set getpwuid_r d_getpwuid_r
13417 case "$d_getpwuid_r" in
13419 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13420 case "$d_getpwuid_r_proto:$usethreads" in
13421 ":define") d_getpwuid_r_proto=define
13422 set d_getpwuid_r_proto getpwuid_r $hdrs
13426 case "$d_getpwuid_r_proto" in
13428 case "$getpwuid_r_proto" in
13429 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13430 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13432 case "$getpwuid_r_proto" in
13433 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13434 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13436 case "$getpwuid_r_proto" in
13437 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13438 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13440 case "$getpwuid_r_proto" in
13441 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13442 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13444 case "$getpwuid_r_proto" in
13445 ''|0) d_getpwuid_r=undef
13447 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13448 * ) case "$getpwuid_r_proto" in
13449 REENTRANT_PROTO*) ;;
13450 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13452 echo "Prototype: $try" ;;
13455 *) case "$usethreads" in
13456 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13463 *) getpwuid_r_proto=0
13468 : see if getservbyname exists
13469 set getservbyname d_getsbyname
13472 : see if getservbyport exists
13473 set getservbyport d_getsbyport
13476 : see if getservent exists
13477 set getservent d_getsent
13480 : see if getservbyname_r exists
13481 set getservbyname_r d_getservbyname_r
13483 case "$d_getservbyname_r" in
13485 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13486 case "$d_getservbyname_r_proto:$usethreads" in
13487 ":define") d_getservbyname_r_proto=define
13488 set d_getservbyname_r_proto getservbyname_r $hdrs
13492 case "$d_getservbyname_r_proto" in
13494 case "$getservbyname_r_proto" in
13495 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13496 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13498 case "$getservbyname_r_proto" in
13499 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13500 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13502 case "$getservbyname_r_proto" in
13503 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13504 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13506 case "$getservbyname_r_proto" in
13507 ''|0) d_getservbyname_r=undef
13508 getservbyname_r_proto=0
13509 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13510 * ) case "$getservbyname_r_proto" in
13511 REENTRANT_PROTO*) ;;
13512 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13514 echo "Prototype: $try" ;;
13517 *) case "$usethreads" in
13518 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13520 d_getservbyname_r=undef
13521 getservbyname_r_proto=0
13525 *) getservbyname_r_proto=0
13529 : see if getservbyport_r exists
13530 set getservbyport_r d_getservbyport_r
13532 case "$d_getservbyport_r" in
13534 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13535 case "$d_getservbyport_r_proto:$usethreads" in
13536 ":define") d_getservbyport_r_proto=define
13537 set d_getservbyport_r_proto getservbyport_r $hdrs
13541 case "$d_getservbyport_r_proto" in
13543 case "$getservbyport_r_proto" in
13544 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13545 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13547 case "$getservbyport_r_proto" in
13548 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13549 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13551 case "$getservbyport_r_proto" in
13552 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13553 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13555 case "$getservbyport_r_proto" in
13556 ''|0) d_getservbyport_r=undef
13557 getservbyport_r_proto=0
13558 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13559 * ) case "$getservbyport_r_proto" in
13560 REENTRANT_PROTO*) ;;
13561 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13563 echo "Prototype: $try" ;;
13566 *) case "$usethreads" in
13567 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13569 d_getservbyport_r=undef
13570 getservbyport_r_proto=0
13574 *) getservbyport_r_proto=0
13578 : see if getservent_r exists
13579 set getservent_r d_getservent_r
13581 case "$d_getservent_r" in
13583 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13584 case "$d_getservent_r_proto:$usethreads" in
13585 ":define") d_getservent_r_proto=define
13586 set d_getservent_r_proto getservent_r $hdrs
13590 case "$d_getservent_r_proto" in
13592 case "$getservent_r_proto" in
13593 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13594 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13596 case "$getservent_r_proto" in
13597 ''|0) try='int getservent_r(struct servent*, char*, int);'
13598 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13600 case "$getservent_r_proto" in
13601 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13602 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13604 case "$getservent_r_proto" in
13605 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13606 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13608 case "$getservent_r_proto" in
13609 ''|0) d_getservent_r=undef
13610 getservent_r_proto=0
13611 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13612 * ) case "$getservent_r_proto" in
13613 REENTRANT_PROTO*) ;;
13614 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13616 echo "Prototype: $try" ;;
13619 *) case "$usethreads" in
13620 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13622 d_getservent_r=undef
13623 getservent_r_proto=0
13627 *) getservent_r_proto=0
13631 : see if prototypes for various getservxxx netdb.h functions are available
13633 set d_getservprotos getservent $i_netdb netdb.h
13636 : see if getspnam exists
13637 set getspnam d_getspnam
13640 : see if this is a shadow.h system
13641 set shadow.h i_shadow
13644 : see if getspnam_r exists
13645 set getspnam_r d_getspnam_r
13647 case "$d_getspnam_r" in
13649 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13650 case "$d_getspnam_r_proto:$usethreads" in
13651 ":define") d_getspnam_r_proto=define
13652 set d_getspnam_r_proto getspnam_r $hdrs
13656 case "$d_getspnam_r_proto" in
13658 case "$getspnam_r_proto" in
13659 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13660 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13662 case "$getspnam_r_proto" in
13663 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13664 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13666 case "$getspnam_r_proto" in
13667 ''|0) d_getspnam_r=undef
13669 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13670 * ) case "$getspnam_r_proto" in
13671 REENTRANT_PROTO*) ;;
13672 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13674 echo "Prototype: $try" ;;
13677 *) case "$usethreads" in
13678 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13685 *) getspnam_r_proto=0
13689 : see if gettimeofday or ftime exists
13690 set gettimeofday d_gettimeod
13692 case "$d_gettimeod" in
13698 val="$undef"; set d_ftime; eval $setvar
13701 case "$d_gettimeod$d_ftime" in
13704 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13708 : see if gmtime_r exists
13709 set gmtime_r d_gmtime_r
13711 case "$d_gmtime_r" in
13713 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13714 case "$d_gmtime_r_proto:$usethreads" in
13715 ":define") d_gmtime_r_proto=define
13716 set d_gmtime_r_proto gmtime_r $hdrs
13720 case "$d_gmtime_r_proto" in
13722 case "$gmtime_r_proto" in
13723 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13724 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13726 case "$gmtime_r_proto" in
13727 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13728 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13730 case "$gmtime_r_proto" in
13731 ''|0) d_gmtime_r=undef
13733 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13734 * ) case "$gmtime_r_proto" in
13735 REENTRANT_PROTO*) ;;
13736 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13738 echo "Prototype: $try" ;;
13741 *) case "$usethreads" in
13742 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13749 *) gmtime_r_proto=0
13753 : see if hasmntopt exists
13754 set hasmntopt d_hasmntopt
13757 : see if this is a netinet/in.h or sys/in.h system
13758 set netinet/in.h i_niin sys/in.h i_sysin
13761 : see if arpa/inet.h has to be included
13762 set arpa/inet.h i_arpainet
13765 : see if htonl --and friends-- exists
13770 : Maybe they are macros.
13773 $cat >htonl.c <<EOM
13775 #include <sys/types.h>
13776 #$i_niin I_NETINET_IN
13778 #$i_arpainet I_ARPA_INET
13779 #ifdef I_NETINET_IN
13780 #include <netinet/in.h>
13783 #include <sys/in.h>
13786 #include <arpa/inet.h>
13789 printf("Defined as a macro.");
13792 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
13793 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
13795 echo "But it seems to be defined as a macro." >&4
13803 : see if ilogbl exists
13804 set ilogbl d_ilogbl
13809 if set index val -f; eval $csym; $val; then
13810 if set strchr val -f d_strchr; eval $csym; $val; then
13811 if $contains strchr "$strings" >/dev/null 2>&1 ; then
13814 echo "strchr() found." >&4
13818 echo "index() found." >&4
13823 echo "index() found." >&4
13826 if set strchr val -f d_strchr; eval $csym; $val; then
13829 echo "strchr() found." >&4
13831 echo "No index() or strchr() found!" >&4
13836 set d_strchr; eval $setvar
13838 set d_index; eval $setvar
13840 : check whether inet_aton exists
13841 set inet_aton d_inetaton
13846 $cat >isascii.c <<EOCP
13849 #$i_stdlib I_STDLIB
13851 #include <stdlib.h>
13862 if eval $compile; then
13863 echo "isascii() found." >&4
13866 echo "isascii() NOT found." >&4
13873 : see if isfinite exists
13874 set isfinite d_isfinite
13877 : see if isinf exists
13881 : see if isnan exists
13885 : see if isnanl exists
13886 set isnanl d_isnanl
13889 : see if killpg exists
13890 set killpg d_killpg
13893 : see if lchown exists
13895 $cat > try.c <<'EOCP'
13896 /* System header to define __stub macros and hopefully few prototypes,
13897 which can conflict with char lchown(); below. */
13898 #include <assert.h>
13899 /* Override any gcc2 internal prototype to avoid an error. */
13900 /* We use char because int might match the return type of a gcc2
13901 builtin and then its argument prototype would still apply. */
13904 /* The GNU C library defines this for functions which it implements
13905 to always fail with ENOSYS. Some functions are actually named
13906 something starting with __ and the normal name is an alias. */
13907 #if defined (__stub_lchown) || defined (__stub___lchown)
13915 if eval $compile; then
13916 $echo "lchown() found." >&4
13919 $echo "lchown() NOT found." >&4
13925 : See if number of significant digits in a double precision number is known
13927 $cat >ldbl_dig.c <<EOM
13928 #$i_limits I_LIMITS
13931 #include <limits.h>
13937 printf("Contains LDBL_DIG");
13940 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
13941 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
13942 echo "LDBL_DIG found." >&4
13945 echo "LDBL_DIG NOT found." >&4
13952 : see if this is a math.h system
13956 d_libm_lib_version="$undef"
13959 : check to see if math.h defines _LIB_VERSION
13961 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
13963 #include <unistd.h>
13965 int main (int argc, char *argv[])
13967 printf ("%d\n", _LIB_VERSION);
13972 if eval $compile; then
13974 echo "Yes, it does ($foo)" >&4
13975 d_libm_lib_version="$define"
13977 echo "No, it does not (probably harmless)\n" >&4
13979 $rm -f try.* try core core.try.*
13984 : see if link exists
13988 : see if localtime_r exists
13989 set localtime_r d_localtime_r
13991 case "$d_localtime_r" in
13993 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13994 case "$d_localtime_r_proto:$usethreads" in
13995 ":define") d_localtime_r_proto=define
13996 set d_localtime_r_proto localtime_r $hdrs
14000 case "$d_localtime_r_proto" in
14002 case "$localtime_r_proto" in
14003 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14004 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14006 case "$localtime_r_proto" in
14007 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14008 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14010 case "$localtime_r_proto" in
14011 ''|0) d_localtime_r=undef
14012 localtime_r_proto=0
14013 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14014 * ) case "$localtime_r_proto" in
14015 REENTRANT_PROTO*) ;;
14016 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14018 echo "Prototype: $try" ;;
14021 *) case "$usethreads" in
14022 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14024 d_localtime_r=undef
14025 localtime_r_proto=0
14029 *) localtime_r_proto=0
14033 : see if localeconv exists
14034 set localeconv d_locconv
14037 : see if lockf exists
14041 : see if prototype for lseek is available
14043 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14046 : see if lstat exists
14050 : see if madvise exists
14051 set madvise d_madvise
14054 : see if mblen exists
14058 : see if mbstowcs exists
14059 set mbstowcs d_mbstowcs
14062 : see if mbtowc exists
14063 set mbtowc d_mbtowc
14066 : see if memchr exists
14067 set memchr d_memchr
14070 : see if memcmp exists
14071 set memcmp d_memcmp
14074 : see if memcpy exists
14075 set memcpy d_memcpy
14078 : see if memmove exists
14079 set memmove d_memmove
14082 : see if memset exists
14083 set memset d_memset
14086 : see if mkdir exists
14090 : see if mkdtemp exists
14091 set mkdtemp d_mkdtemp
14094 : see if mkfifo exists
14095 set mkfifo d_mkfifo
14098 : see if mkstemp exists
14099 set mkstemp d_mkstemp
14102 : see if mkstemps exists
14103 set mkstemps d_mkstemps
14106 : see if mktime exists
14107 set mktime d_mktime
14110 : see if this is a sys/mman.h system
14111 set sys/mman.h i_sysmman
14114 : see if mmap exists
14117 : see what shmat returns
14118 : default to something harmless
14120 case "$i_sysmman$d_mmap" in
14122 $cat >mmap.c <<'END'
14123 #include <sys/mman.h>
14126 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14131 echo "and it returns ($mmaptype)." >&4
14137 : see if sqrtl exists
14141 : see if scalbnl exists
14142 set scalbnl d_scalbnl
14145 : see if modfl exists
14149 : see if prototype for modfl is available
14151 set d_modflproto modfl $i_math math.h
14154 d_modfl_pow32_bug="$undef"
14156 case "$d_longdbl$d_modfl" in
14159 Checking to see whether your modfl() is okay for large values...
14165 if $test "X$d_modflproto" != "X$define"; then
14166 $cat >>try.c <<EOCP
14167 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14168 long double modfl (long double, long double *);
14171 $cat >>try.c <<EOCP
14173 long double nv = 4294967303.15;
14179 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14183 case "$osname:$gccversion" in
14184 aix:) saveccflags="$ccflags"
14185 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14188 if eval $compile; then
14191 *" 4294967303.150000 1.150000 4294967302.000000")
14192 echo >&4 "Your modfl() is broken for large values."
14193 d_modfl_pow32_bug="$define"
14195 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14199 *" 4294967303.150000 0.150000 4294967303.000000")
14200 echo >&4 "Your modfl() seems okay for large values."
14202 *) echo >&4 "I don't understand your modfl() at all."
14206 $rm -f try.* try core core.try.*
14208 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14211 case "$osname:$gccversion" in
14212 aix:) ccflags="$saveccflags" ;; # restore
14217 if $test "$uselongdouble" = "$define"; then
14219 if $test "$d_sqrtl" != "$define"; then
14220 message="$message sqrtl"
14222 if $test "$d_modfl" != "$define"; then
14223 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14224 echo "You have both aintl and copysignl, so I can emulate modfl."
14226 message="$message modfl"
14229 if $test "$d_frexpl" != "$define"; then
14230 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14231 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14233 message="$message frexpl"
14237 if $test "$message" != ""; then
14240 *** You requested the use of long doubles but you do not seem to have
14241 *** the following mathematical functions needed for long double support:
14243 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14244 *** Cannot continue, aborting.
14252 : see if mprotect exists
14253 set mprotect d_mprotect
14256 : see if msgctl exists
14257 set msgctl d_msgctl
14260 : see if msgget exists
14261 set msgget d_msgget
14264 : see if msgsnd exists
14265 set msgsnd d_msgsnd
14268 : see if msgrcv exists
14269 set msgrcv d_msgrcv
14272 : see how much of the 'msg*(2)' library is present.
14275 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14276 *"$undef"*) h_msg=false;;
14280 case "`ipcs 2>&1`" in
14281 "SVID messages"*"not configured"*)
14282 echo "Your $osname does not have the msg*(2) configured." >&4
14285 set msgctl d_msgctl
14287 set msgget d_msgget
14289 set msgsnd d_msgsnd
14291 set msgrcv d_msgrcv
14297 : we could also check for sys/ipc.h ...
14298 if $h_msg && $test `./findhdr sys/msg.h`; then
14299 echo "You have the full msg*(2) library." >&4
14302 echo "You don't have the full msg*(2) library." >&4
14310 echo "Checking to see if your system supports struct msghdr..." >&4
14311 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14313 case "$d_msghdr_s" in
14314 "$define") echo "Yes, it does." ;;
14315 *) echo "No, it doesn't." ;;
14319 : see if msync exists
14323 : see if munmap exists
14324 set munmap d_munmap
14327 : see if nice exists
14331 : see if this is a langinfo.h system
14332 set langinfo.h i_langinfo
14335 : see if nl_langinfo exists
14336 set nl_langinfo d_nl_langinfo
14339 : check for length of character
14341 case "$charsize" in
14343 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14346 #$i_stdlib I_STDLIB
14348 #include <stdlib.h>
14352 printf("%d\n", (int)sizeof(char));
14357 if eval $compile_ok; then
14361 echo "(I can't seem to compile the test program. Guessing...)"
14368 rp="What is the size of a character (in bytes)?"
14373 : check for volatile keyword
14375 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14376 $cat >try.c <<'EOCP'
14379 typedef struct _goo_struct goo_struct;
14380 goo_struct * volatile goo = ((goo_struct *)0);
14381 struct _goo_struct {
14386 typedef unsigned short foo_t;
14387 char *volatile foo;
14389 volatile foo_t blech;
14393 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14395 echo "Yup, it does."
14398 echo "Nope, it doesn't."
14406 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14408 case "$use64bitint:$d_quad:$quadtype" in
14411 uvtype="$uquadtype"
14416 uvtype="unsigned long"
14422 case "$uselongdouble:$d_longdbl" in
14424 nvtype="long double"
14425 nvsize=$longdblsize
14432 $echo "(IV will be "$ivtype", $ivsize bytes)"
14433 $echo "(UV will be "$uvtype", $uvsize bytes)"
14434 $echo "(NV will be "$nvtype", $nvsize bytes)"
14437 #$i_inttypes I_INTTYPES
14439 #include <inttypes.h>
14444 int8_t i = INT8_MAX;
14445 uint8_t u = UINT8_MAX;
14446 printf("int8_t\n");
14449 int16_t i = INT16_MAX;
14450 uint16_t i = UINT16_MAX;
14451 printf("int16_t\n");
14454 int32_t i = INT32_MAX;
14455 uint32_t u = UINT32_MAX;
14456 printf("int32_t\n");
14462 '') case "$charsize" in
14464 u8type="unsigned char"
14473 if eval $compile; then
14474 case "`$run ./try`" in
14475 int8_t) i8type=int8_t
14485 '') if $test $charsize -ge 1; then
14487 u8type="unsigned char"
14495 '') case "$shortsize" in
14497 u16type="unsigned short"
14505 '') set try -DINT16
14506 if eval $compile; then
14507 case "`$run ./try`" in
14519 '') if $test $shortsize -ge 2; then
14521 u16type="unsigned short"
14529 '') case "$longsize" in
14531 u32type="unsigned long"
14535 *) case "$intsize" in
14537 u32type="unsigned int"
14547 '') set try -DINT32
14548 if eval $compile; then
14549 case "`$run ./try`" in
14561 '') if $test $intsize -ge 4; then
14563 u32type="unsigned int"
14571 '') case "$d_quad:$quadtype" in
14573 i64type="$quadtype"
14574 u64type="$uquadtype"
14582 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14583 : volatile so that the compiler has to store it out to memory.
14584 if test X"$d_volatile" = X"$define"; then
14589 #$i_stdlib I_STDLIB
14591 #include <stdlib.h>
14593 #include <sys/types.h>
14594 #include <signal.h>
14596 $volatile int bletched = 0;
14597 $signal_t blech(s) int s; { bletched = 1; }
14602 int n = 8 * $uvsize;
14605 signal(SIGFPE, blech);
14608 for (i = 0; i < n; i++) {
14609 u = u << 1 | ($uvtype)1;
14611 if (($uvtype)d != u)
14615 d = ($nvtype)(u - 1);
14616 if (($uvtype)d != (u - 1))
14624 printf("%d\n", ((i == n) ? -n : i));
14630 d_nv_preserves_uv="$undef"
14631 if eval $compile; then
14632 nv_preserves_uv_bits="`$run ./try`"
14634 case "$nv_preserves_uv_bits" in
14636 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14637 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14638 d_nv_preserves_uv="$define"
14640 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14641 d_nv_preserves_uv="$undef" ;;
14642 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14643 nv_preserves_uv_bits="$undef" ;;
14649 : check for off64_t
14651 echo "Checking to see if you have off64_t..." >&4
14653 #include <sys/types.h>
14654 #include <unistd.h>
14655 int main() { off64_t x = 7; }
14658 if eval $compile; then
14660 echo "You have off64_t."
14663 echo "You do not have off64_t."
14664 case "$lseeksize" in
14665 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
14672 : how to create joinable pthreads
14673 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
14675 echo "Checking what constant to use for creating joinable pthreads..." >&4
14676 $cat >try.c <<'EOCP'
14677 #include <pthread.h>
14679 int detachstate = JOINABLE;
14682 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
14683 if eval $compile; then
14684 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
14685 val="$undef" # Yes, undef.
14686 set d_old_pthread_create_joinable
14689 set old_pthread_create_joinable
14692 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
14693 if eval $compile; then
14694 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
14696 set d_old_pthread_create_joinable
14698 val=PTHREAD_CREATE_UNDETACHED
14699 set old_pthread_create_joinable
14702 set try -DJOINABLE=__UNDETACHED
14703 if eval $compile; then
14704 echo "You seem to use __UNDETACHED." >&4
14706 set d_old_pthread_create_joinable
14709 set old_pthread_create_joinable
14712 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
14714 set d_old_pthread_create_joinable
14717 set old_pthread_create_joinable
14724 d_old_pthread_create_joinable="$undef"
14725 old_pthread_create_joinable=""
14728 : see if pause exists
14732 : see if pipe exists
14736 : see if poll exists
14740 : see if readlink exists
14741 set readlink d_readlink
14747 case "$d_readlink" in
14749 if $issymlink /proc/self/exe ; then
14750 $ls -l /proc/self/exe > reflect
14751 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
14752 echo "You have Linux-like /proc/self/exe."
14753 procselfexe='"/proc/self/exe"'
14757 if $issymlink /proc/curproc/file ; then
14758 $ls -l /proc/curproc/file > reflect
14759 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
14760 echo "You have BSD-like /proc/curproc/file."
14761 procselfexe='"/proc/curproc/file"'
14771 : see whether the pthread_atfork exists
14773 #include <pthread.h>
14776 #ifdef PTHREAD_ATFORK
14777 pthread_atfork(NULL,NULL,NULL);
14782 : see if pthread_atfork exists
14783 set try -DPTHREAD_ATFORK
14784 if eval $compile; then
14789 case "$usethreads" in
14792 $define) echo 'pthread_atfork found.' >&4 ;;
14793 *) echo 'pthread_atfork NOT found.' >&4 ;;
14796 set d_pthread_atfork
14799 : see if pthread_attr_setscope exists
14800 set pthread_attr_setscope d_pthread_attr_setscope
14804 : see whether the various POSIXish _yields exist
14806 #include <pthread.h>
14812 #ifdef PTHREAD_YIELD
14815 #ifdef PTHREAD_YIELD_NULL
14816 pthread_yield(NULL);
14822 : see if sched_yield exists
14823 set try -DSCHED_YIELD
14824 if eval $compile; then
14826 sched_yield='sched_yield()'
14830 case "$usethreads" in
14833 $define) echo 'sched_yield() found.' >&4 ;;
14834 *) echo 'sched_yield() NOT found.' >&4 ;;
14840 : see if pthread_yield exists
14841 set try -DPTHREAD_YIELD
14842 if eval $compile; then
14844 case "$sched_yield" in
14845 '') sched_yield='pthread_yield()' ;;
14848 set try -DPTHREAD_YIELD_NULL
14849 if eval $compile; then
14851 case "$sched_yield" in
14852 '') sched_yield='pthread_yield(NULL)' ;;
14858 case "$usethreads" in
14861 $define) echo 'pthread_yield() found.' >&4 ;;
14862 *) echo 'pthread_yield() NOT found.' >&4 ;;
14866 set d_pthread_yield
14869 case "$sched_yield" in
14870 '') sched_yield=undef ;;
14875 : see if random_r exists
14876 set random_r d_random_r
14878 case "$d_random_r" in
14880 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
14881 case "$d_random_r_proto:$usethreads" in
14882 ":define") d_random_r_proto=define
14883 set d_random_r_proto random_r $hdrs
14887 case "$d_random_r_proto" in
14889 case "$random_r_proto" in
14890 ''|0) try='int random_r(int*, struct random_data*);'
14891 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
14893 case "$random_r_proto" in
14894 ''|0) try='int random_r(long*, struct random_data*);'
14895 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
14897 case "$random_r_proto" in
14898 ''|0) try='int random_r(struct random_data*, int32_t*);'
14899 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
14901 case "$random_r_proto" in
14902 ''|0) d_random_r=undef
14904 echo "Disabling random_r, cannot determine prototype." >&4 ;;
14905 * ) case "$random_r_proto" in
14906 REENTRANT_PROTO*) ;;
14907 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
14909 echo "Prototype: $try" ;;
14912 *) case "$usethreads" in
14913 define) echo "random_r has no prototype, not using it." >&4 ;;
14920 *) random_r_proto=0
14924 : see if readdir and friends exist
14925 set readdir d_readdir
14927 set seekdir d_seekdir
14929 set telldir d_telldir
14931 set rewinddir d_rewinddir
14934 : see if readdir64_r exists
14935 set readdir64_r d_readdir64_r
14937 case "$d_readdir64_r" in
14939 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
14940 case "$d_readdir64_r_proto:$usethreads" in
14941 ":define") d_readdir64_r_proto=define
14942 set d_readdir64_r_proto readdir64_r $hdrs
14946 case "$d_readdir64_r_proto" in
14948 case "$readdir64_r_proto" in
14949 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
14950 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
14952 case "$readdir64_r_proto" in
14953 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
14954 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
14956 case "$readdir64_r_proto" in
14957 ''|0) d_readdir64_r=undef
14958 readdir64_r_proto=0
14959 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
14960 * ) case "$readdir64_r_proto" in
14961 REENTRANT_PROTO*) ;;
14962 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
14964 echo "Prototype: $try" ;;
14967 *) case "$usethreads" in
14968 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
14970 d_readdir64_r=undef
14971 readdir64_r_proto=0
14975 *) readdir64_r_proto=0
14979 : see if readdir_r exists
14980 set readdir_r d_readdir_r
14982 case "$d_readdir_r" in
14984 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
14985 case "$d_readdir_r_proto:$usethreads" in
14986 ":define") d_readdir_r_proto=define
14987 set d_readdir_r_proto readdir_r $hdrs
14991 case "$d_readdir_r_proto" in
14993 case "$readdir_r_proto" in
14994 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
14995 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
14997 case "$readdir_r_proto" in
14998 ''|0) try='int readdir_r(DIR*, struct dirent*);'
14999 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15001 case "$readdir_r_proto" in
15002 ''|0) d_readdir_r=undef
15004 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15005 * ) case "$readdir_r_proto" in
15006 REENTRANT_PROTO*) ;;
15007 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15009 echo "Prototype: $try" ;;
15012 *) case "$usethreads" in
15013 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15020 *) readdir_r_proto=0
15024 : see if readv exists
15028 : see if recvmsg exists
15029 set recvmsg d_recvmsg
15032 : see if rename exists
15033 set rename d_rename
15036 : see if rmdir exists
15040 : see if memory.h is available.
15045 : See if it conflicts with string.h
15051 $cppstdin $cppflags $cppminus < $strings > mem.h
15052 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15054 echo "We won't be including <memory.h>."
15064 : can bcopy handle overlapping blocks?
15067 case "$d_memmove" in
15068 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15069 *) case "$d_bcopy" in
15071 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15073 #$i_memory I_MEMORY
15074 #$i_stdlib I_STDLIB
15075 #$i_string I_STRING
15076 #$i_unistd I_UNISTD
15078 $cat >>try.c <<'EOCP'
15081 # include <memory.h>
15084 # include <stdlib.h>
15087 # include <string.h>
15089 # include <strings.h>
15092 # include <unistd.h> /* Needed for NetBSD */
15096 char buf[128], abc[128];
15102 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15103 try to store the string in read-only memory. */
15104 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15106 for (align = 7; align >= 0; align--) {
15107 for (len = 36; len; len--) {
15109 bcopy(abc, b, len);
15110 for (off = 1; off <= len; off++) {
15111 bcopy(b, b+off, len);
15112 bcopy(b+off, b, len);
15113 if (bcmp(b, abc, len))
15122 if eval $compile_ok; then
15123 if ./try 2>/dev/null; then
15124 echo "Yes, it can."
15127 echo "It can't, sorry."
15130 echo "(I can't compile the test program, so we'll assume not...)"
15134 $rm -f try.* try core
15140 : can memcpy handle overlapping blocks?
15143 case "$d_memmove" in
15144 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15145 *) case "$d_memcpy" in
15147 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15149 #$i_memory I_MEMORY
15150 #$i_stdlib I_STDLIB
15151 #$i_string I_STRING
15152 #$i_unistd I_UNISTD
15154 $cat >>try.c <<'EOCP'
15157 # include <memory.h>
15160 # include <stdlib.h>
15163 # include <string.h>
15165 # include <strings.h>
15168 # include <unistd.h> /* Needed for NetBSD */
15172 char buf[128], abc[128];
15178 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15179 try to store the string in read-only memory. */
15180 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15182 for (align = 7; align >= 0; align--) {
15183 for (len = 36; len; len--) {
15185 memcpy(b, abc, len);
15186 for (off = 1; off <= len; off++) {
15187 memcpy(b+off, b, len);
15188 memcpy(b, b+off, len);
15189 if (memcmp(b, abc, len))
15198 if eval $compile_ok; then
15199 if ./try 2>/dev/null; then
15200 echo "Yes, it can."
15203 echo "It can't, sorry."
15206 echo "(I can't compile the test program, so we'll assume not...)"
15210 $rm -f try.* try core
15216 : can memcmp be trusted to compare relative magnitude?
15218 case "$d_memcmp" in
15221 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15223 #$i_memory I_MEMORY
15224 #$i_stdlib I_STDLIB
15225 #$i_string I_STRING
15226 #$i_unistd I_UNISTD
15228 $cat >>try.c <<'EOCP'
15231 # include <memory.h>
15234 # include <stdlib.h>
15237 # include <string.h>
15239 # include <strings.h>
15242 # include <unistd.h> /* Needed for NetBSD */
15248 if ((a < b) && memcmp(&a, &b, 1) < 0)
15254 if eval $compile_ok; then
15255 if $run ./try 2>/dev/null; then
15256 echo "Yes, it can."
15259 echo "No, it can't (it uses signed chars)."
15262 echo "(I can't compile the test program, so we'll assume not...)"
15266 $rm -f try.* try core
15270 : see if prototype for sbrk is available
15272 set d_sbrkproto sbrk $i_unistd unistd.h
15275 : see if select exists
15276 set select d_select
15279 : see if semctl exists
15280 set semctl d_semctl
15283 : see if semget exists
15284 set semget d_semget
15287 : see if semop exists
15291 : see how much of the 'sem*(2)' library is present.
15294 case "$d_semctl$d_semget$d_semop" in
15295 *"$undef"*) h_sem=false;;
15299 case "`ipcs 2>&1`" in
15300 "SVID messages"*"not configured"*)
15301 echo "Your $osname does not have the sem*(2) configured." >&4
15304 set semctl d_semctl
15306 set semget d_semget
15314 : we could also check for sys/ipc.h ...
15315 if $h_sem && $test `./findhdr sys/sem.h`; then
15316 echo "You have the full sem*(2) library." >&4
15319 echo "You don't have the full sem*(2) library." >&4
15325 : see whether sys/sem.h defines union semun
15327 $cat > try.c <<'END'
15328 #include <sys/types.h>
15329 #include <sys/ipc.h>
15330 #include <sys/sem.h>
15331 int main () { union semun semun; semun.buf = 0; }
15334 if eval $compile; then
15335 echo "You have union semun in <sys/sem.h>." >&4
15338 echo "You do not have union semun in <sys/sem.h>." >&4
15345 : see how to do semctl IPC_STAT
15352 # define S_IRUSR S_IREAD
15353 # define S_IWUSR S_IWRITE
15354 # define S_IXUSR S_IEXEC
15356 # define S_IRUSR 0400
15357 # define S_IWUSR 0200
15358 # define S_IXUSR 0100
15360 # define S_IRGRP (S_IRUSR>>3)
15361 # define S_IWGRP (S_IWUSR>>3)
15362 # define S_IXGRP (S_IXUSR>>3)
15363 # define S_IROTH (S_IRUSR>>6)
15364 # define S_IWOTH (S_IWUSR>>6)
15365 # define S_IXOTH (S_IXUSR>>6)
15368 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15369 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15370 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15373 : see whether semctl IPC_STAT can use union semun
15375 case "$d_semctl_semun" in
15378 #include <sys/types.h>
15379 #include <sys/ipc.h>
15380 #include <sys/sem.h>
15381 #include <sys/stat.h>
15388 #$d_union_semun HAS_UNION_SEMUN
15391 #ifndef HAS_UNION_SEMUN
15394 struct semid_ds *buf;
15395 unsigned short *array;
15401 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15402 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15404 struct semid_ds argbuf;
15407 st = semctl(sem, 0, IPC_STAT, arg);
15411 # endif /* IPC_STAT */
15412 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15414 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15415 # endif /* IPC_RMID */
15416 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15418 #endif /* IPC_PRIVATE && ... */
15419 printf("semget failed: errno = %d\n", errno);
15424 if eval $compile; then
15427 semun) val="$define" ;;
15435 case "$d_semctl_semun" in
15437 echo "You can use union semun for semctl IPC_STAT." >&4
15440 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15445 : see whether semctl IPC_STAT can use struct semid_ds pointer
15447 case "$d_semctl_semid_ds" in
15449 $cat > try.c <<'END'
15450 #include <sys/types.h>
15451 #include <sys/ipc.h>
15452 #include <sys/sem.h>
15453 #include <sys/stat.h>
15461 struct semid_ds arg;
15464 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15465 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15468 st = semctl(sem, 0, IPC_STAT, &arg);
15470 printf("semid_ds\n");
15472 # endif /* IPC_STAT */
15473 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15475 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15476 # endif /* IPC_RMID */
15477 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15479 #endif /* IPC_PRIVATE && ... */
15480 printf("semget failed: errno = %d\n", errno);
15486 if eval $compile; then
15489 semid_ds) val="$define" ;;
15495 set d_semctl_semid_ds
15497 case "$d_semctl_semid_ds" in
15499 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15501 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15508 # We do not have the full sem*(2) library, so assume we can not
15514 set d_semctl_semid_ds
15519 : see if sendmsg exists
15520 set sendmsg d_sendmsg
15523 : see if setegid exists
15524 set setegid d_setegid
15527 : see if seteuid exists
15528 set seteuid d_seteuid
15531 : see if setgrent exists
15532 set setgrent d_setgrent
15535 : see if setgrent_r exists
15536 set setgrent_r d_setgrent_r
15538 case "$d_setgrent_r" in
15540 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15541 case "$d_setgrent_r_proto:$usethreads" in
15542 ":define") d_setgrent_r_proto=define
15543 set d_setgrent_r_proto setgrent_r $hdrs
15547 case "$d_setgrent_r_proto" in
15549 case "$setgrent_r_proto" in
15550 ''|0) try='int setgrent_r(FILE**);'
15551 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15553 case "$setgrent_r_proto" in
15554 ''|0) try='void setgrent_r(FILE**);'
15555 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15557 case "$setgrent_r_proto" in
15558 ''|0) d_setgrent_r=undef
15560 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15561 * ) case "$setgrent_r_proto" in
15562 REENTRANT_PROTO*) ;;
15563 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15565 echo "Prototype: $try" ;;
15568 *) case "$usethreads" in
15569 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15576 *) setgrent_r_proto=0
15580 : see if sethostent exists
15581 set sethostent d_sethent
15584 : see if sethostent_r exists
15585 set sethostent_r d_sethostent_r
15587 case "$d_sethostent_r" in
15589 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15590 case "$d_sethostent_r_proto:$usethreads" in
15591 ":define") d_sethostent_r_proto=define
15592 set d_sethostent_r_proto sethostent_r $hdrs
15596 case "$d_sethostent_r_proto" in
15598 case "$sethostent_r_proto" in
15599 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15600 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15602 case "$sethostent_r_proto" in
15603 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15604 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15606 case "$sethostent_r_proto" in
15607 ''|0) d_sethostent_r=undef
15608 sethostent_r_proto=0
15609 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15610 * ) case "$sethostent_r_proto" in
15611 REENTRANT_PROTO*) ;;
15612 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
15614 echo "Prototype: $try" ;;
15617 *) case "$usethreads" in
15618 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
15620 d_sethostent_r=undef
15621 sethostent_r_proto=0
15625 *) sethostent_r_proto=0
15629 : see if setitimer exists
15630 set setitimer d_setitimer
15633 : see if setlinebuf exists
15634 set setlinebuf d_setlinebuf
15637 : see if setlocale exists
15638 set setlocale d_setlocale
15641 : see if locale.h is available
15642 set locale.h i_locale
15645 : see if setlocale_r exists
15646 set setlocale_r d_setlocale_r
15648 case "$d_setlocale_r" in
15650 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
15651 case "$d_setlocale_r_proto:$usethreads" in
15652 ":define") d_setlocale_r_proto=define
15653 set d_setlocale_r_proto setlocale_r $hdrs
15657 case "$d_setlocale_r_proto" in
15659 case "$setlocale_r_proto" in
15660 ''|0) try='int setlocale_r(int, const char*, char*, int);'
15661 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
15663 case "$setlocale_r_proto" in
15664 ''|0) d_setlocale_r=undef
15665 setlocale_r_proto=0
15666 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
15667 * ) case "$setlocale_r_proto" in
15668 REENTRANT_PROTO*) ;;
15669 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
15671 echo "Prototype: $try" ;;
15674 *) case "$usethreads" in
15675 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
15677 d_setlocale_r=undef
15678 setlocale_r_proto=0
15682 *) setlocale_r_proto=0
15686 : see if setnetent exists
15687 set setnetent d_setnent
15690 : see if setnetent_r exists
15691 set setnetent_r d_setnetent_r
15693 case "$d_setnetent_r" in
15695 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15696 case "$d_setnetent_r_proto:$usethreads" in
15697 ":define") d_setnetent_r_proto=define
15698 set d_setnetent_r_proto setnetent_r $hdrs
15702 case "$d_setnetent_r_proto" in
15704 case "$setnetent_r_proto" in
15705 ''|0) try='int setnetent_r(int, struct netent_data*);'
15706 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
15708 case "$setnetent_r_proto" in
15709 ''|0) try='void setnetent_r(int, struct netent_data*);'
15710 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
15712 case "$setnetent_r_proto" in
15713 ''|0) d_setnetent_r=undef
15714 setnetent_r_proto=0
15715 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
15716 * ) case "$setnetent_r_proto" in
15717 REENTRANT_PROTO*) ;;
15718 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
15720 echo "Prototype: $try" ;;
15723 *) case "$usethreads" in
15724 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
15726 d_setnetent_r=undef
15727 setnetent_r_proto=0
15731 *) setnetent_r_proto=0
15735 : see if setprotoent exists
15736 set setprotoent d_setpent
15739 : see if setpgid exists
15740 set setpgid d_setpgid
15743 : see if setpgrp2 exists
15744 set setpgrp2 d_setpgrp2
15747 : see if setpriority exists
15748 set setpriority d_setprior
15751 : see if setproctitle exists
15752 set setproctitle d_setproctitle
15755 : see if setprotoent_r exists
15756 set setprotoent_r d_setprotoent_r
15758 case "$d_setprotoent_r" in
15760 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15761 case "$d_setprotoent_r_proto:$usethreads" in
15762 ":define") d_setprotoent_r_proto=define
15763 set d_setprotoent_r_proto setprotoent_r $hdrs
15767 case "$d_setprotoent_r_proto" in
15769 case "$setprotoent_r_proto" in
15770 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
15771 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
15773 case "$setprotoent_r_proto" in
15774 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
15775 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
15777 case "$setprotoent_r_proto" in
15778 ''|0) d_setprotoent_r=undef
15779 setprotoent_r_proto=0
15780 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
15781 * ) case "$setprotoent_r_proto" in
15782 REENTRANT_PROTO*) ;;
15783 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
15785 echo "Prototype: $try" ;;
15788 *) case "$usethreads" in
15789 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
15791 d_setprotoent_r=undef
15792 setprotoent_r_proto=0
15796 *) setprotoent_r_proto=0
15800 : see if setpwent exists
15801 set setpwent d_setpwent
15804 : see if setpwent_r exists
15805 set setpwent_r d_setpwent_r
15807 case "$d_setpwent_r" in
15809 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15810 case "$d_setpwent_r_proto:$usethreads" in
15811 ":define") d_setpwent_r_proto=define
15812 set d_setpwent_r_proto setpwent_r $hdrs
15816 case "$d_setpwent_r_proto" in
15818 case "$setpwent_r_proto" in
15819 ''|0) try='int setpwent_r(FILE**);'
15820 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
15822 case "$setpwent_r_proto" in
15823 ''|0) try='void setpwent_r(FILE**);'
15824 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
15826 case "$setpwent_r_proto" in
15827 ''|0) d_setpwent_r=undef
15829 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
15830 * ) case "$setpwent_r_proto" in
15831 REENTRANT_PROTO*) ;;
15832 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
15834 echo "Prototype: $try" ;;
15837 *) case "$usethreads" in
15838 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
15845 *) setpwent_r_proto=0
15849 : see if setregid exists
15850 set setregid d_setregid
15852 set setresgid d_setresgid
15855 : see if setreuid exists
15856 set setreuid d_setreuid
15858 set setresuid d_setresuid
15861 : see if setrgid exists
15862 set setrgid d_setrgid
15865 : see if setruid exists
15866 set setruid d_setruid
15869 : see if setservent exists
15870 set setservent d_setsent
15873 : see if setservent_r exists
15874 set setservent_r d_setservent_r
15876 case "$d_setservent_r" in
15878 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15879 case "$d_setservent_r_proto:$usethreads" in
15880 ":define") d_setservent_r_proto=define
15881 set d_setservent_r_proto setservent_r $hdrs
15885 case "$d_setservent_r_proto" in
15887 case "$setservent_r_proto" in
15888 ''|0) try='int setservent_r(int, struct servent_data*);'
15889 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
15891 case "$setservent_r_proto" in
15892 ''|0) try='void setservent_r(int, struct servent_data*);'
15893 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
15895 case "$setservent_r_proto" in
15896 ''|0) d_setservent_r=undef
15897 setservent_r_proto=0
15898 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
15899 * ) case "$setservent_r_proto" in
15900 REENTRANT_PROTO*) ;;
15901 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
15903 echo "Prototype: $try" ;;
15906 *) case "$usethreads" in
15907 define) echo "setservent_r has no prototype, not using it." >&4 ;;
15909 d_setservent_r=undef
15910 setservent_r_proto=0
15914 *) setservent_r_proto=0
15918 : see if setsid exists
15919 set setsid d_setsid
15922 : see if setvbuf exists
15923 set setvbuf d_setvbuf
15926 : see if sfio.h is available
15931 : see if sfio library is available
15942 : Ok, but do we want to use it.
15946 true|$define|[yY]*) dflt='y';;
15949 echo "$package can use the sfio library, but it is experimental."
15950 case "$useperlio" in
15952 echo "For sfio also the PerlIO abstraction layer is needed."
15953 echo "Earlier you said you wouldn't want that."
15956 rp="You seem to have sfio available, do you want to try using it?"
15959 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
15960 useperlio="$define"
15963 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
15968 *) case "$usesfio" in
15969 true|$define|[yY]*)
15970 echo "Sorry, cannot find sfio on this machine." >&4
15971 echo "Ignoring your setting of usesfio=$usesfio." >&4
15980 $define) usesfio='true';;
15981 *) usesfio='false';;
15985 *) : Remove sfio from list of libraries to use
15988 echo "Removing unneeded -lsfio from library list" >&4
15989 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
15992 echo "libs = $libs" >&4
15999 : see if shmctl exists
16000 set shmctl d_shmctl
16003 : see if shmget exists
16004 set shmget d_shmget
16007 : see if shmat exists
16010 : see what shmat returns
16013 $cat >shmat.c <<'END'
16014 #include <sys/shm.h>
16017 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16022 echo "and it returns ($shmattype)." >&4
16023 : see if a prototype for shmat is available
16024 xxx=`./findhdr sys/shm.h`
16025 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16026 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16037 set d_shmatprototype
16040 : see if shmdt exists
16044 : see how much of the 'shm*(2)' library is present.
16047 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16048 *"$undef"*) h_shm=false;;
16052 case "`ipcs 2>&1`" in
16053 "SVID shared memory"*"not configured"*)
16054 echo "Your $osname does not have the shm*(2) configured." >&4
16057 set shmctl d_shmctl
16059 set shmget d_shmget
16069 : we could also check for sys/ipc.h ...
16070 if $h_shm && $test `./findhdr sys/shm.h`; then
16071 echo "You have the full shm*(2) library." >&4
16074 echo "You don't have the full shm*(2) library." >&4
16081 : see if we have sigaction
16082 if set sigaction val -f d_sigaction; eval $csym; $val; then
16083 echo 'sigaction() found.' >&4
16086 #include <sys/types.h>
16087 #include <signal.h>
16088 #$i_stdlib I_STDLIB
16090 #include <stdlib.h>
16094 struct sigaction act, oact;
16096 oact.sa_handler = 0;
16097 /* so that act and oact are used */
16098 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16102 if eval $compile_ok; then
16105 echo "But you don't seem to have a useable struct sigaction." >&4
16109 echo 'sigaction NOT found.' >&4
16112 set d_sigaction; eval $setvar
16113 $rm -f try try$_o try.c
16115 : see if sigprocmask exists
16116 set sigprocmask d_sigprocmask
16119 : see if sigsetjmp exists
16121 case "$d_sigsetjmp" in
16124 #include <setjmp.h>
16125 #$i_stdlib I_STDLIB
16127 #include <stdlib.h>
16133 if (sigsetjmp(env,1))
16136 siglongjmp(env, 1);
16141 if eval $compile; then
16142 if $run ./try >/dev/null 2>&1; then
16143 echo "POSIX sigsetjmp found." >&4
16147 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16153 echo "sigsetjmp not found." >&4
16157 *) val="$d_sigsetjmp"
16158 case "$d_sigsetjmp" in
16159 $define) echo "POSIX sigsetjmp found." >&4;;
16160 $undef) echo "sigsetjmp not found." >&4;;
16168 : see if sockatmark exists
16169 set sockatmark d_sockatmark
16172 : see if prototype for sockatmark is available
16174 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16177 : see if socks5_init exists
16178 set socks5_init d_socks5_init
16181 : see if srand48_r exists
16182 set srand48_r d_srand48_r
16184 case "$d_srand48_r" in
16186 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16187 case "$d_srand48_r_proto:$usethreads" in
16188 ":define") d_srand48_r_proto=define
16189 set d_srand48_r_proto srand48_r $hdrs
16193 case "$d_srand48_r_proto" in
16195 case "$srand48_r_proto" in
16196 ''|0) try='int srand48_r(long, struct drand48_data*);'
16197 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16199 case "$srand48_r_proto" in
16200 ''|0) d_srand48_r=undef
16202 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16203 * ) case "$srand48_r_proto" in
16204 REENTRANT_PROTO*) ;;
16205 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16207 echo "Prototype: $try" ;;
16210 *) case "$usethreads" in
16211 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16218 *) srand48_r_proto=0
16222 : see if srandom_r exists
16223 set srandom_r d_srandom_r
16225 case "$d_srandom_r" in
16227 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16228 case "$d_srandom_r_proto:$usethreads" in
16229 ":define") d_srandom_r_proto=define
16230 set d_srandom_r_proto srandom_r $hdrs
16234 case "$d_srandom_r_proto" in
16236 case "$srandom_r_proto" in
16237 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16238 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16240 case "$srandom_r_proto" in
16241 ''|0) d_srandom_r=undef
16243 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16244 * ) case "$srandom_r_proto" in
16245 REENTRANT_PROTO*) ;;
16246 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16248 echo "Prototype: $try" ;;
16251 *) case "$usethreads" in
16252 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16259 *) srandom_r_proto=0
16263 : see if prototype for setresgid is available
16265 set d_sresgproto setresgid $i_unistd unistd.h
16268 : see if prototype for setresuid is available
16270 set d_sresuproto setresuid $i_unistd unistd.h
16273 : see if sys/stat.h is available
16274 set sys/stat.h i_sysstat
16278 : see if stat knows about block sizes
16280 echo "Checking to see if your struct stat has st_blocks field..." >&4
16281 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16285 : see if this is a sys/vfs.h system
16286 set sys/vfs.h i_sysvfs
16290 : see if this is a sys/statfs.h system
16291 set sys/statfs.h i_sysstatfs
16296 echo "Checking to see if your system supports struct statfs..." >&4
16297 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
16299 case "$d_statfs_s" in
16300 "$define") echo "Yes, it does." ;;
16301 *) echo "No, it doesn't." ;;
16306 : see if struct statfs knows about f_flags
16307 case "$d_statfs_s" in
16310 echo "Checking to see if your struct statfs has f_flags field..." >&4
16311 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
16315 set d_statfs_f_flags
16319 case "$d_statfs_f_flags" in
16320 "$define") echo "Yes, it does." ;;
16321 *) echo "No, it doesn't." ;;
16325 Checking how to access stdio streams by file descriptor number...
16327 case "$stdio_stream_array" in
16328 '') $cat >try.c <<EOCP
16331 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16335 for s in _iob __iob __sF
16337 set try -DSTDIO_STREAM_ARRAY=$s
16338 if eval $compile; then
16339 case "`$run ./try`" in
16340 yes) stdio_stream_array=$s; break ;;
16344 $rm -f try.* try$exe_ext
16346 case "$stdio_stream_array" in
16348 I can't figure out how to access stdio streams by file descriptor number.
16350 d_stdio_stream_array="$undef"
16353 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16355 d_stdio_stream_array="$define"
16359 : see if strcoll exists
16360 set strcoll d_strcoll
16363 : check for structure copying
16365 echo "Checking to see if your C compiler can copy structs..." >&4
16366 $cat >try.c <<'EOCP'
16376 if $cc -c try.c >/dev/null 2>&1 ; then
16378 echo "Yup, it can."
16381 echo "Nope, it can't."
16387 : see if strerror and/or sys_errlist[] exist
16389 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16390 if set strerror val -f d_strerror; eval $csym; $val; then
16391 echo 'strerror() found.' >&4
16392 d_strerror="$define"
16393 d_strerrm='strerror(e)'
16394 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16395 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16396 d_syserrlst="$define"
16398 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16399 d_syserrlst="$undef"
16401 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16402 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16403 echo 'strerror() found in string header.' >&4
16404 d_strerror="$define"
16405 d_strerrm='strerror(e)'
16406 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16407 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16408 d_syserrlst="$define"
16410 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16411 d_syserrlst="$undef"
16413 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16414 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16415 d_strerror="$undef"
16416 d_syserrlst="$define"
16417 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16419 echo 'strerror() and sys_errlist[] NOT found.' >&4
16420 d_strerror="$undef"
16421 d_syserrlst="$undef"
16422 d_strerrm='"unknown"'
16426 : see if strerror_r exists
16427 set strerror_r d_strerror_r
16429 case "$d_strerror_r" in
16431 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16432 case "$d_strerror_r_proto:$usethreads" in
16433 ":define") d_strerror_r_proto=define
16434 set d_strerror_r_proto strerror_r $hdrs
16438 case "$d_strerror_r_proto" in
16440 case "$strerror_r_proto" in
16441 ''|0) try='int strerror_r(int, char*, size_t);'
16442 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16444 case "$strerror_r_proto" in
16445 ''|0) try='int strerror_r(int, char*, int);'
16446 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16448 case "$strerror_r_proto" in
16449 ''|0) try='char* strerror_r(int, char*, size_t);'
16450 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16452 case "$strerror_r_proto" in
16453 ''|0) d_strerror_r=undef
16455 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16456 * ) case "$strerror_r_proto" in
16457 REENTRANT_PROTO*) ;;
16458 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16460 echo "Prototype: $try" ;;
16463 *) case "$usethreads" in
16464 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16471 *) strerror_r_proto=0
16475 : see if strftime exists
16476 set strftime d_strftime
16479 : see if strlcat exists
16480 set strlcat d_strlcat
16483 : see if strlcpy exists
16484 set strlcpy d_strlcpy
16487 : see if strtod exists
16488 set strtod d_strtod
16491 : see if strtol exists
16492 set strtol d_strtol
16495 : see if strtold exists
16496 set strtold d_strtold
16499 : see if strtoll exists
16500 set strtoll d_strtoll
16503 case "$d_longlong-$d_strtoll" in
16506 Checking whether your strtoll() works okay...
16508 $cat >try.c <<'EOCP'
16511 #define strtoll __strtoll
16514 #define strtoll _strtoll
16517 extern long long int strtoll(char *s, char **, int);
16518 static int bad = 0;
16519 int check(char *s, long long ell, int een) {
16522 gll = strtoll(s, 0, 10);
16523 if (!((gll == ell) && (errno == een)))
16527 check(" 1", 1LL, 0);
16528 check(" 0", 0LL, 0);
16529 check("-1", -1LL, 0);
16530 check("-9223372036854775808", -9223372036854775808LL, 0);
16531 check("-9223372036854775808", -9223372036854775808LL, 0);
16532 check(" 9223372036854775807", 9223372036854775807LL, 0);
16533 check("-9223372036854775808", -9223372036854775808LL, 0);
16534 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
16535 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
16541 if eval $compile; then
16544 ok) echo "Your strtoll() seems to be working okay." ;;
16546 Your strtoll() doesn't seem to be working okay.
16552 echo "(I can't seem to compile the test program--assuming it doesn't)"
16558 : see if strtoq exists
16559 set strtoq d_strtoq
16562 : see if strtoul exists
16563 set strtoul d_strtoul
16566 case "$d_strtoul" in
16569 Checking whether your strtoul() works okay...
16571 $cat >try.c <<'EOCP'
16574 extern unsigned long int strtoul(char *s, char **, int);
16575 static int bad = 0;
16576 void check(char *s, unsigned long eul, int een) {
16579 gul = strtoul(s, 0, 10);
16580 if (!((gul == eul) && (errno == een)))
16584 check(" 1", 1L, 0);
16585 check(" 0", 0L, 0);
16587 case "$longsize" in
16589 $cat >>try.c <<'EOCP'
16590 check("18446744073709551615", 18446744073709551615UL, 0);
16591 check("18446744073709551616", 18446744073709551615UL, ERANGE);
16592 #if 0 /* strtoul() for /^-/ strings is undefined. */
16593 check("-1", 18446744073709551615UL, 0);
16594 check("-18446744073709551614", 2, 0);
16595 check("-18446744073709551615", 1, 0);
16596 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
16597 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
16602 $cat >>try.c <<'EOCP'
16603 check("4294967295", 4294967295UL, 0);
16604 check("4294967296", 4294967295UL, ERANGE);
16605 #if 0 /* strtoul() for /^-/ strings is undefined. */
16606 check("-1", 4294967295UL, 0);
16607 check("-4294967294", 2, 0);
16608 check("-4294967295", 1, 0);
16609 check("-4294967296", 4294967295UL, ERANGE);
16610 check("-4294967297", 4294967295UL, ERANGE);
16615 : Should we write these tests to be more portable by sprintf-ing
16616 : ~0 and then manipulating that char string as input for strtol?
16619 $cat >>try.c <<'EOCP'
16626 if eval $compile; then
16627 case "`$run ./try`" in
16628 ok) echo "Your strtoul() seems to be working okay." ;;
16630 Your strtoul() doesn't seem to be working okay.
16639 : see if strtoull exists
16640 set strtoull d_strtoull
16643 case "$d_longlong-$d_strtoull" in
16646 Checking whether your strtoull() works okay...
16648 $cat >try.c <<'EOCP'
16651 #define strtoull __strtoull
16654 extern unsigned long long int strtoull(char *s, char **, int);
16655 static int bad = 0;
16656 int check(char *s, long long eull, int een) {
16659 gull = strtoull(s, 0, 10);
16660 if (!((gull == eull) && (errno == een)))
16664 check(" 1", 1LL, 0);
16665 check(" 0", 0LL, 0);
16666 check("18446744073709551615", 18446744073709551615ULL, 0);
16667 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16668 #if 0 /* strtoull() for /^-/ strings is undefined. */
16669 check("-1", 18446744073709551615ULL, 0);
16670 check("-18446744073709551614", 2LL, 0);
16671 check("-18446744073709551615", 1LL, 0);
16672 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16673 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16680 if eval $compile; then
16681 case "`$run ./try`" in
16682 ok) echo "Your strtoull() seems to be working okay." ;;
16684 Your strtoull() doesn't seem to be working okay.
16686 d_strtoull="$undef"
16693 : see if strtouq exists
16694 set strtouq d_strtouq
16697 case "$d_strtouq" in
16700 Checking whether your strtouq() works okay...
16702 $cat >try.c <<'EOCP'
16705 extern unsigned long long int strtouq(char *s, char **, int);
16706 static int bad = 0;
16707 void check(char *s, unsigned long long eull, int een) {
16708 unsigned long long gull;
16710 gull = strtouq(s, 0, 10);
16711 if (!((gull == eull) && (errno == een)))
16715 check(" 1", 1LL, 0);
16716 check(" 0", 0LL, 0);
16717 check("18446744073709551615", 18446744073709551615ULL, 0);
16718 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16719 #if 0 /* strtouq() for /^-/ strings is undefined. */
16720 check("-1", 18446744073709551615ULL, 0);
16721 check("-18446744073709551614", 2LL, 0);
16722 check("-18446744073709551615", 1LL, 0);
16723 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16724 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16732 if eval $compile; then
16733 case "`$run ./try`" in
16734 ok) echo "Your strtouq() seems to be working okay." ;;
16736 Your strtouq() doesn't seem to be working okay.
16745 : see if strxfrm exists
16746 set strxfrm d_strxfrm
16749 : see if symlink exists
16750 set symlink d_symlink
16753 : see if syscall exists
16754 set syscall d_syscall
16757 : see if prototype for syscall is available
16759 set d_syscallproto syscall $i_unistd unistd.h
16762 : see if sysconf exists
16763 set sysconf d_sysconf
16766 : see if system exists
16767 set system d_system
16770 : see if tcgetpgrp exists
16771 set tcgetpgrp d_tcgetpgrp
16774 : see if tcsetpgrp exists
16775 set tcsetpgrp d_tcsetpgrp
16778 : see if prototype for telldir is available
16780 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
16783 : see if time exists
16785 if test "X$d_time" = X -o X"$timetype" = X; then
16786 if set time val -f d_time; eval $csym; $val; then
16787 echo 'time() found.' >&4
16789 rp="What is the type returned by time() on this system?"
16790 set time_t timetype long stdio.h sys/types.h
16793 echo 'time() not found, hope that will do.' >&4
16801 : see if this is a sys/times.h system
16802 set sys/times.h i_systimes
16805 : see if times exists
16807 if set times val -f d_times; eval $csym; $val; then
16808 echo 'times() found.' >&4
16811 case "$i_systimes" in
16812 "$define") inc='sys/times.h';;
16814 rp="What is the type returned by times() on this system?"
16815 set clock_t clocktype long stdio.h sys/types.h $inc
16818 echo 'times() NOT found, hope that will do.' >&4
16823 : see if tmpnam_r exists
16824 set tmpnam_r d_tmpnam_r
16826 case "$d_tmpnam_r" in
16828 hdrs="$i_systypes sys/types.h define stdio.h "
16829 case "$d_tmpnam_r_proto:$usethreads" in
16830 ":define") d_tmpnam_r_proto=define
16831 set d_tmpnam_r_proto tmpnam_r $hdrs
16835 case "$d_tmpnam_r_proto" in
16837 case "$tmpnam_r_proto" in
16838 ''|0) try='char* tmpnam_r(char*);'
16839 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
16841 case "$tmpnam_r_proto" in
16842 ''|0) d_tmpnam_r=undef
16844 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
16845 * ) case "$tmpnam_r_proto" in
16846 REENTRANT_PROTO*) ;;
16847 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
16849 echo "Prototype: $try" ;;
16852 *) case "$usethreads" in
16853 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
16860 *) tmpnam_r_proto=0
16864 : see if truncate exists
16865 set truncate d_truncate
16868 : see if ttyname_r exists
16869 set ttyname_r d_ttyname_r
16871 case "$d_ttyname_r" in
16873 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
16874 case "$d_ttyname_r_proto:$usethreads" in
16875 ":define") d_ttyname_r_proto=define
16876 set d_ttyname_r_proto ttyname_r $hdrs
16880 case "$d_ttyname_r_proto" in
16882 case "$ttyname_r_proto" in
16883 ''|0) try='int ttyname_r(int, char*, size_t);'
16884 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
16886 case "$ttyname_r_proto" in
16887 ''|0) try='int ttyname_r(int, char*, int);'
16888 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
16890 case "$ttyname_r_proto" in
16891 ''|0) try='char* ttyname_r(int, char*, int);'
16892 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
16894 case "$ttyname_r_proto" in
16895 ''|0) d_ttyname_r=undef
16897 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
16898 * ) case "$ttyname_r_proto" in
16899 REENTRANT_PROTO*) ;;
16900 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
16902 echo "Prototype: $try" ;;
16905 *) case "$usethreads" in
16906 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
16913 *) ttyname_r_proto=0
16917 : see if tzname[] exists
16919 if set tzname val -a d_tzname; eval $csym; $val; then
16921 echo 'tzname[] found.' >&4
16924 echo 'tzname[] NOT found.' >&4
16930 next|rhapsody|darwin) multiarch="$define" ;;
16932 case "$multiarch" in
16933 ''|[nN]*) multiarch="$undef" ;;
16936 : check for ordering of bytes in a UV
16938 case "$usecrosscompile$multiarch" in
16941 You seem to be either cross-compiling or doing a multiarchitecture build,
16942 skipping the byteorder check.
16948 case "$byteorder" in
16951 In the following, larger digits indicate more significance. A big-endian
16952 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
16953 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
16954 machines may have weird orders like 3412. A Cray will report 87654321,
16955 an Alpha will report 12345678. If the test program works the default is
16957 I'm now running the test program...
16961 #$i_stdlib I_STDLIB
16963 #include <stdlib.h>
16965 #include <sys/types.h>
16966 typedef $uvtype UV;
16976 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
16978 u.l = (UV)0x04030201;
16979 for (i = 0; i < $uvsize; i++)
16980 printf("%c", u.c[i]+'0');
16987 if eval $compile && ./try > /dev/null; then
16990 [1-4][1-4][1-4][1-4]|12345678|87654321)
16991 echo "(The test program ran ok.)"
16992 echo "byteorder=$dflt"
16995 ????|????????) echo "(The test program ran ok.)" ;;
16996 *) echo "(The test program didn't run right for some reason.)" ;;
17001 (I can't seem to compile the test program. Guessing big-endian...)
17004 case "$xxx_prompt" in
17006 rp="What is the order of bytes in $uvtype?"
17022 Checking to see whether you can access character data unalignedly...
17024 case "$d_u32align" in
17025 '') $cat >try.c <<EOCP
17027 #$i_stdlib I_STDLIB
17029 #include <stdlib.h>
17031 #define U32 $u32type
17032 #define BYTEORDER 0x$byteorder
17034 #include <signal.h>
17036 $signal_t bletch(s) int s; { exit(4); }
17039 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17044 if (sizeof(U32) != 4) {
17045 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17052 signal(SIGBUS, bletch);
17064 for (i = 0; i < 4; i++) {
17065 up = (U32*)(buf + i);
17066 if (! ((*up == 1 << (8*i)) || /* big-endian */
17067 (*up == 1 << (8*(3-i))) /* little-endian */
17071 printf("read failed (%x)\n", *up);
17077 for (i = 0; i < 4; i++) {
17078 up = (U32*)(buf + i);
17080 if (*up != 0xBeef) {
17081 printf("write failed (%x)\n", *up);
17095 if eval $compile_ok; then
17096 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17097 $run ./try 2>&1 >/dev/null
17100 You can access character data pretty unalignedly.
17102 d_u32align="$undef"
17105 It seems that you must access character data in an aligned manner.
17107 d_u32align="$define"
17111 rp='Can you access character data at unaligned addresses?'
17115 [yY]*) d_u32align="$undef" ;;
17116 *) d_u32align="$define" ;;
17119 $rm -f core core.try.* try.core
17123 : see if ualarm exists
17124 set ualarm d_ualarm
17127 : see if umask exists
17131 : see if unordered exists
17132 set unordered d_unordered
17135 : see if usleep exists
17136 set usleep d_usleep
17139 : see if prototype for usleep is available
17141 set d_usleepproto usleep $i_unistd unistd.h
17144 : see if ustat exists
17148 : backward compatibility for d_hvfork
17149 if test X$d_hvfork != X; then
17150 d_vfork="$d_hvfork"
17153 : see if there is a vfork
17158 : Ok, but do we want to use it. vfork is reportedly unreliable in
17159 : perl on Solaris 2.x, and probably elsewhere.
17163 case "$usevfork" in
17169 Perl can only use a vfork() that doesn't suffer from strict
17170 restrictions on calling functions or modifying global data in
17171 the child. For example, glibc-2.1 contains such a vfork()
17172 that is unsuitable. If your system provides a proper fork()
17173 call, chances are that you do NOT want perl to use vfork().
17176 rp="Do you still want to use vfork()?"
17181 echo "Ok, we won't use vfork()."
17190 $define) usevfork='true';;
17191 *) usevfork='false';;
17194 : see if closedir exists
17195 set closedir d_closedir
17198 case "$d_closedir" in
17201 echo "Checking whether closedir() returns a status..." >&4
17203 #$i_dirent I_DIRENT /**/
17204 #$i_sysdir I_SYS_DIR /**/
17205 #$i_sysndir I_SYS_NDIR /**/
17206 #$i_systypes I_SYS_TYPES /**/
17208 #if defined(I_SYS_TYPES)
17209 #include <sys/types.h>
17211 #if defined(I_DIRENT)
17212 #include <dirent.h>
17213 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17214 #include <sys/dir.h>
17218 #include <sys/ndir.h>
17222 #include <ndir.h> /* may be wrong in the future */
17224 #include <sys/dir.h>
17229 int main() { return closedir(opendir(".")); }
17232 if eval $compile_ok; then
17233 if $run ./try > /dev/null 2>&1 ; then
17234 echo "Yes, it does."
17237 echo "No, it doesn't."
17241 echo "(I can't seem to compile the test program--assuming it doesn't)"
17249 set d_void_closedir
17252 : see if there is a wait4
17256 : see if waitpid exists
17257 set waitpid d_waitpid
17260 : see if wcstombs exists
17261 set wcstombs d_wcstombs
17264 : see if wctomb exists
17265 set wctomb d_wctomb
17268 : see if writev exists
17269 set writev d_writev
17272 : preserve RCS keywords in files with variable substitution, grrr
17277 Revision='$Revision'
17279 : check for alignment requirements
17281 case "$usecrosscompile$multiarch" in
17284 You seem to be either cross-compiling or doing a multiarchitecture build,
17285 skipping the memory alignment check.
17288 case "$alignbytes" in
17289 '') alignbytes=8 ;;
17293 case "$alignbytes" in
17294 '') echo "Checking alignment constraints..." >&4
17295 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17296 $cat >try.c <<'EOCP'
17297 typedef long double NV;
17300 $cat >try.c <<'EOCP'
17304 $cat >>try.c <<'EOCP'
17312 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17317 if eval $compile_ok; then
17321 echo "(I can't seem to compile the test program...)"
17324 *) dflt="$alignbytes"
17327 rp="Doubles must be aligned on a how-many-byte boundary?"
17335 : set the base revision
17338 : how do we concatenate cpp tokens here?
17340 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17341 $cat >cpp_stuff.c <<'EOCP'
17342 #define RCAT(a,b)a/**/b
17343 #define ACAT(a,b)a ## b
17347 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17348 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17349 echo "Oh! Smells like ANSI's been here." >&4
17350 echo "We can catify or stringify, separately or together!"
17352 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17353 echo "Ah, yes! The good old days!" >&4
17354 echo "However, in the good old days we don't know how to stringify and"
17355 echo "catify at the same time."
17359 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17360 You're going to have to edit the values of CAT[2-5] in config.h...
17362 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17366 : see if this is a db.h system
17372 : Check db version.
17374 echo "Checking Berkeley DB version ..." >&4
17380 #include <sys/types.h>
17382 #$i_stdlib I_STDLIB
17384 #include <stdlib.h>
17387 int main(int argc, char *argv[])
17389 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17390 int Major, Minor, Patch ;
17391 unsigned long Version ;
17392 (void)db_version(&Major, &Minor, &Patch) ;
17394 printf("%d %d %d %d %d %d\n",
17395 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17396 Major, Minor, Patch);
17399 printf("You have Berkeley DB Version 2 or greater.\n");
17401 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17402 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17403 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17404 Major, Minor, Patch) ;
17406 /* check that db.h & libdb are compatible */
17407 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17408 printf("db.h and libdb are incompatible.\n") ;
17412 printf("db.h and libdb are compatible.\n") ;
17414 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17415 + DB_VERSION_PATCH ;
17417 /* needs to be >= 2.3.4 */
17418 if (Version < 2003004) {
17419 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17420 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17426 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17431 printf("You have Berkeley DB Version 1.\n");
17432 exit(0); /* DB version < 2: the coast is clear. */
17434 exit(1); /* <db.h> not Berkeley DB? */
17440 if eval $compile_ok && $run ./try; then
17441 echo 'Looks OK.' >&4
17443 db_version_major=$1
17444 db_version_minor=$2
17445 db_version_patch=$3
17447 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17451 : Remove db from list of libraries to use
17452 echo "Removing unusable -ldb from library list" >&4
17453 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17456 echo "libs = $libs" >&4
17466 : Check the return type needed for hash
17468 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17474 #include <sys/types.h>
17477 #ifndef DB_VERSION_MAJOR
17478 u_int32_t hash_cb (ptr, size)
17486 info.hash = hash_cb;
17490 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17491 if $contains warning try.out >>/dev/null 2>&1 ; then
17494 db_hashtype='u_int32_t'
17497 : XXX Maybe we should just give up here.
17498 db_hashtype=u_int32_t
17500 echo "Help: I can't seem to compile the db test program." >&4
17501 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
17504 echo "Your version of Berkeley DB uses $db_hashtype for hash."
17506 *) db_hashtype=u_int32_t
17511 : Check the return type needed for prefix
17513 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
17519 #include <sys/types.h>
17522 #ifndef DB_VERSION_MAJOR
17523 size_t prefix_cb (key1, key2)
17531 info.prefix = prefix_cb;
17535 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17536 if $contains warning try.out >>/dev/null 2>&1 ; then
17537 db_prefixtype='int'
17539 db_prefixtype='size_t'
17542 db_prefixtype='size_t'
17543 : XXX Maybe we should just give up here.
17545 echo "Help: I can't seem to compile the db test program." >&4
17546 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
17549 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
17551 *) db_prefixtype='size_t'
17556 : How can we generate normalized random numbers ?
17558 echo "Looking for a random number function..." >&4
17559 case "$randfunc" in
17561 if set drand48 val -f; eval $csym; $val; then
17563 echo "Good, found drand48()." >&4
17564 elif set random val -f; eval $csym; $val; then
17566 echo "OK, found random()." >&4
17569 echo "Yick, looks like I have to use rand()." >&4
17580 *-Dmy_rand=*|*-Dmy_srand=*)
17581 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
17582 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
17583 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
17584 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
17588 while $test "$cont"; do
17589 rp="Use which function to generate random numbers?"
17591 if $test "$ans" = "$dflt"; then
17597 if set $ans val -f; eval $csym; $val; then
17601 rp="I cannot find function $ans. Use that name anyway?"
17610 case "$randfunc" in
17612 drand01="drand48()"
17618 case "$randbits" in
17620 echo "Checking to see how many bits your $randfunc() function produces..." >&4
17622 #$i_unistd I_UNISTD
17623 #$i_stdlib I_STDLIB
17626 # include <unistd.h>
17629 # include <stdlib.h>
17634 register unsigned long tmp;
17635 register unsigned long max = 0L;
17637 for (i = 1000; i; i--) {
17638 tmp = (unsigned long) $randfunc();
17639 if (tmp > max) max = tmp;
17641 for (i = 0; max; i++)
17647 if eval $compile_ok; then
17651 echo "(I can't seem to compile the test program...)"
17658 rp="How many bits does your $randfunc() function produce?"
17662 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17663 seedfunc="s$randfunc"
17664 randseedtype=unsigned
17668 rp="How many bits does your $randfunc() function produce?"
17671 seedfunc="s$randfunc"
17672 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17673 if set $seedfunc val -f; eval $csym; $val; then
17674 echo "(Using $seedfunc() to seed random generator)"
17676 echo "(Warning: no $seedfunc() to seed random generator)"
17679 randseedtype=unsigned
17687 echo "Determining whether or not we are on an EBCDIC system..." >&4
17688 $cat >try.c <<'EOM'
17691 if ('M'==0xd4) return 0;
17698 if eval $compile_ok; then
17699 if $run ./try; then
17700 echo "You seem to speak EBCDIC." >&4
17703 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
17706 echo "I'm unable to compile the test program." >&4
17707 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
17715 Checking how to flush all pending stdio output...
17717 # I only know how to find the first 32 possibly open files on SunOS.
17718 # See also hints/sunos_4_1.sh and util.c --AD
17720 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
17722 $cat >>try.c <<EOCP
17724 #$i_stdlib I_STDLIB
17726 #include <stdlib.h>
17728 #$i_unistd I_UNISTD
17730 # include <unistd.h>
17732 #$d_sysconf HAS_SYSCONF
17733 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
17734 #ifdef HAS_STDIO_STREAM_ARRAY
17735 # define STDIO_STREAM_ARRAY $stdio_stream_array
17740 p = fopen("try.out", "w");
17744 # ifdef TRY_FPRINTF
17748 #ifdef TRY_FFLUSH_NULL
17751 #ifdef TRY_FFLUSH_ALL
17753 long open_max = -1;
17754 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
17755 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
17757 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
17758 open_max = sysconf(_SC_OPEN_MAX);
17761 open_max = FOPEN_MAX;
17764 open_max = OPEN_MAX;
17773 # ifdef HAS_STDIO_STREAM_ARRAY
17774 if (open_max > 0) {
17776 for (i = 0; i < open_max; i++)
17777 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
17778 STDIO_STREAM_ARRAY[i]._file < open_max &&
17779 STDIO_STREAM_ARRAY[i]._flag)
17780 fflush(&STDIO_STREAM_ARRAY[i]);
17788 : first we have to find out how _not_ to flush
17790 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
17792 set try -DTRY_FPUTC
17793 if eval $compile; then
17794 $run ./try 2>/dev/null
17797 if $test ! -s try.out -a "X$code" = X42; then
17803 set try -DTRY_FPRINTF
17804 if eval $compile; then
17805 $run ./try 2>/dev/null
17808 if $test ! -s try.out -a "X$code" = X42; then
17809 output=-DTRY_FPRINTF
17815 : check for fflush NULL behaviour
17816 case "$fflushNULL" in
17817 '') set try -DTRY_FFLUSH_NULL $output
17818 if eval $compile; then
17819 $run ./try 2>/dev/null
17822 if $test -s try.out -a "X$code" = X42; then
17823 fflushNULL="`$cat try.out`"
17825 if $test "X$code" != X42; then
17827 (If this test failed, don't worry, we'll try another method shortly.)
17832 $rm -f core try.core core.try.*
17833 case "$fflushNULL" in
17835 Your fflush(NULL) works okay for output streams.
17836 Let's see if it clobbers input pipes...
17838 # As of mid-March 2000 all versions of Solaris appear to have a stdio
17839 # bug that improperly flushes the input end of pipes. So we avoid the
17840 # autoflush on fork/system/exec support for now. :-(
17841 $cat >tryp.c <<EOCP
17844 main(int argc, char **argv)
17850 while ((i = getc(stdin)) != -1
17851 && (*bp++ = i) != '\n'
17852 && bp < &buf[1024])
17855 fprintf(stdout, "%s", buf);
17863 fflushNULL="$define"
17865 if eval $compile; then
17867 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17868 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17870 fflush(NULL) seems to behave okay with input streams.
17872 fflushNULL="$define"
17875 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
17877 fflushNULL="$undef"
17880 $rm -f core tryp.c tryp.core core.tryp.*
17883 Your fflush(NULL) isn't working (contrary to ANSI C).
17885 fflushNULL="$undef"
17888 Cannot figure out whether your fflush(NULL) works or not.
17889 I'm assuming it doesn't (contrary to ANSI C).
17891 fflushNULL="$undef"
17895 $define|true|[yY]*)
17896 fflushNULL="$define"
17899 fflushNULL="$undef"
17902 : check explicit looping only if NULL did not work, and if the pipe
17903 : bug does not show up on an explicit flush too
17904 case "$fflushNULL" in
17906 $cat >tryp.c <<EOCP
17909 main(int argc, char **argv)
17915 while ((i = getc(stdin)) != -1
17916 && (*bp++ = i) != '\n'
17917 && bp < &buf[1024])
17920 fprintf(stdout, "%s", buf);
17929 if eval $compile; then
17931 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17932 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17934 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
17936 : now check for fflushall behaviour
17937 case "$fflushall" in
17938 '') set try -DTRY_FFLUSH_ALL $output
17939 if eval $compile; then
17941 (Now testing the other method--but note that this also may fail.)
17943 $run ./try 2>/dev/null
17946 if $test -s try.out -a "X$code" = X42; then
17947 fflushall="`$cat try.out`"
17950 $rm -f core try.core core.try.*
17951 case "$fflushall" in
17953 Whew. Flushing explicitly all the stdio streams works.
17955 fflushall="$define"
17958 Sigh. Flushing explicitly all the stdio streams doesn't work.
17963 Cannot figure out whether flushing stdio streams explicitly works or not.
17964 I'm assuming it doesn't.
17970 "$define"|true|[yY]*)
17971 fflushall="$define"
17979 All is futile. Even fflush(stdin) clobbers input pipes!
17986 $rm -f core tryp.c tryp.core core.tryp.*
17988 *) fflushall="$undef"
17992 case "$fflushNULL$fflushall" in
17995 OK, I give up. I cannot figure out how to flush pending stdio output.
17996 We won't be flushing handles at all before fork/exec/popen.
18000 $rm -f try.* try$exe_ext
18002 : Store the full pathname to the ar program for use in the C program
18003 : Respect a hint or command line value for full_ar.
18008 : Store the full pathname to the sed program for use in the C program
18011 : see what type gids are declared as in the kernel
18013 echo "Looking for the type for group ids returned by getgid()."
18014 set gid_t gidtype xxx stdio.h sys/types.h
18018 xxx=`./findhdr sys/user.h`
18019 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18021 unsigned) dflt="$1 $2" ;;
18025 *) dflt="$gidtype";;
18028 gid_t) echo "gid_t found." ;;
18029 *) rp="What is the type for group ids returned by getgid()?"
18037 *_t) zzz="$gidtype" ;;
18040 echo "Checking the size of $zzz..." >&4
18042 #include <sys/types.h>
18044 #$i_stdlib I_STDLIB
18046 #include <stdlib.h>
18049 printf("%d\n", (int)sizeof($gidtype));
18054 if eval $compile_ok; then
18058 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18061 echo "Your $zzz is $gidsize bytes long."
18066 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18072 *_t) zzz="$gidtype" ;;
18075 echo "Checking the sign of $zzz..." >&4
18077 #include <sys/types.h>
18088 if eval $compile; then
18092 echo "(I can't execute the test program--guessing unsigned.)" >&4
18096 1) echo "Your $zzz is unsigned." ;;
18097 -1) echo "Your $zzz is signed." ;;
18103 echo "(I can't compile the test program--guessing unsigned.)" >&4
18109 if $test X"$quadtype" != X; then
18111 echo "Checking how to print 64-bit integers..." >&4
18113 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18114 $cat >try.c <<'EOCP'
18115 #include <sys/types.h>
18118 int q = 12345678901;
18119 printf("%ld\n", q);
18123 if eval $compile; then
18127 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18128 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18129 echo "We will use %d."
18135 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18136 $cat >try.c <<'EOCP'
18137 #include <sys/types.h>
18140 long q = 12345678901;
18141 printf("%ld\n", q);
18145 if eval $compile; then
18149 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18150 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18151 echo "We will use %ld."
18157 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18158 $cat >try.c <<'EOCP'
18159 #include <sys/types.h>
18160 #include <inttypes.h>
18163 int64_t q = 12345678901;
18164 printf("%" PRId64 "\n", q);
18168 if eval $compile; then
18172 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18173 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18174 echo "We will use the C9X style."
18180 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18182 #include <sys/types.h>
18185 $quadtype q = 12345678901;
18186 printf("%Ld\n", q);
18190 if eval $compile; then
18194 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18195 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18196 echo "We will use %Ld."
18202 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18203 $cat >try.c <<'EOCP'
18204 #include <sys/types.h>
18207 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18208 printf("%lld\n", q);
18212 if eval $compile; then
18216 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18217 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18218 echo "We will use the %lld style."
18224 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18226 #include <sys/types.h>
18229 $quadtype q = 12345678901;
18230 printf("%qd\n", q);
18234 if eval $compile; then
18238 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18239 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18240 echo "We will use %qd."
18246 if $test X"$sPRId64" = X; then
18247 echo "Cannot figure out how to print 64-bit integers." >&4
18255 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18256 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18258 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18259 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18265 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18267 if $test X"$ivsize" = X8; then
18268 ivdformat="$sPRId64"
18269 uvuformat="$sPRIu64"
18270 uvoformat="$sPRIo64"
18271 uvxformat="$sPRIx64"
18272 uvXUformat="$sPRIXU64"
18274 if $test X"$ivsize" = X"$longsize"; then
18281 if $test X"$ivsize" = X"$intsize"; then
18289 if $test X"$ivsize" = X"$shortsize"; then
18300 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18301 nveformat="$sPRIeldbl"
18302 nvfformat="$sPRIfldbl"
18303 nvgformat="$sPRIgldbl"
18304 nvEUformat="$sPRIEUldbl"
18305 nvFUformat="$sPRIFUldbl"
18306 nvGUformat="$sPRIGUldbl"
18316 case "$ivdformat" in
18317 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18324 $echo "Checking the format string to be used for gids..." >&4
18327 -1) if $test X"$gidsize" = X"$ivsize"; then
18328 gidformat="$ivdformat"
18330 if $test X"$gidsize" = X"$longsize"; then
18333 if $test X"$gidsize" = X"$intsize"; then
18336 if $test X"$gidsize" = X"$shortsize"; then
18343 *) if $test X"$gidsize" = X"$uvsize"; then
18344 gidformat="$uvuformat"
18346 if $test X"$gidsize" = X"$longsize"; then
18349 if $test X"$gidsize" = X"$intsize"; then
18352 if $test X"$gidsize" = X"$shortsize"; then
18361 : see if getgroups exists
18362 set getgroups d_getgrps
18365 : see if setgroups exists
18366 set setgroups d_setgrps
18370 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18372 case "$d_getgrps$d_setgrps" in
18374 case "$groupstype" in
18375 '') dflt="$gidtype" ;;
18376 *) dflt="$groupstype" ;;
18379 What type of pointer is the second argument to getgroups() and setgroups()?
18380 Usually this is the same as group ids, $gidtype, but not always.
18383 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18387 *) groupstype="$gidtype";;
18391 echo "Checking if your $make program sets \$(MAKE)..." >&4
18392 case "$make_set_make" in
18394 $sed 's/^X //' > testmake.mak << 'EOF'
18396 X @echo 'maketemp="$(MAKE)"'
18398 case "`$make -f testmake.mak 2>/dev/null`" in
18399 *maketemp=*) make_set_make='#' ;;
18400 *) make_set_make="MAKE=$make" ;;
18402 $rm -f testmake.mak
18405 case "$make_set_make" in
18406 '#') echo "Yup, it does.";;
18407 *) echo "Nope, it doesn't.";;
18410 : see what type is used for mode_t
18411 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18412 set mode_t modetype int stdio.h sys/types.h
18415 : see if stdarg is available
18417 if $test `./findhdr stdarg.h`; then
18418 echo "<stdarg.h> found." >&4
18421 echo "<stdarg.h> NOT found." >&4
18425 : see if varags is available
18427 if $test `./findhdr varargs.h`; then
18428 echo "<varargs.h> found." >&4
18430 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18433 : set up the varargs testing programs
18434 $cat > varargs.c <<EOP
18436 #include <stdarg.h>
18439 #include <varargs.h>
18443 int f(char *p, ...)
18457 p = va_arg(ap, char *);
18462 $cat > varargs <<EOP
18464 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
18473 : now check which varargs header should be included
18478 if `./varargs I_STDARG`; then
18480 elif `./varargs I_VARARGS`; then
18485 if `./varargs I_VARARGS`; then
18492 echo "I could not find the definition for va_dcl... You have problems..." >&4
18493 val="$undef"; set i_stdarg; eval $setvar
18494 val="$undef"; set i_varargs; eval $setvar
18499 case "$i_varhdr" in
18501 val="$define"; set i_stdarg; eval $setvar
18502 val="$undef"; set i_varargs; eval $setvar
18505 val="$undef"; set i_stdarg; eval $setvar
18506 val="$define"; set i_varargs; eval $setvar
18509 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
18513 : see if we need va_copy
18515 case "$i_stdarg" in
18518 #include <stdarg.h>
18520 #$i_stdlib I_STDLIB
18522 #include <stdlib.h>
18524 #include <signal.h>
18527 ivfprintf(FILE *f, const char *fmt, va_list *valp)
18529 return vfprintf(f, fmt, *valp);
18533 myvfprintf(FILE *f, const char *fmt, va_list val)
18535 return ivfprintf(f, fmt, &val);
18539 myprintf(char *fmt, ...)
18542 va_start(val, fmt);
18543 return myvfprintf(stdout, fmt, val);
18547 main(int ac, char **av)
18549 signal(SIGSEGV, exit);
18551 myprintf("%s%cs all right, then\n", "that", '\'');
18556 if eval $compile && $run ./try 2>&1 >/dev/null; then
18557 case "`$run ./try`" in
18558 "that's all right, then")
18564 yes) echo "It seems that you don't need va_copy()." >&4
18565 need_va_copy="$undef"
18567 *) echo "It seems that va_copy() or similar will be needed." >&4
18568 need_va_copy="$define"
18571 $rm -f try.* core core.* *.core *.core.*
18573 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
18577 : see what type is used for size_t
18578 rp="What is the type used for the length parameter for string functions?"
18579 set size_t sizetype 'unsigned int' stdio.h sys/types.h
18582 : check for type of arguments to gethostbyaddr.
18583 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
18584 case "$d_gethbyaddr" in
18588 Checking to see what type of arguments are accepted by gethostbyaddr().
18590 hdrs="$define sys/types.h
18591 $d_socket sys/socket.h
18592 $i_niin netinet/in.h
18594 $i_unistd unistd.h"
18595 : The first arg can 'char *' or 'void *'
18596 : The second arg is some of integral type
18597 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
18598 for yyy in size_t long int; do
18599 case "$netdb_host_type" in
18600 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
18601 if ./protochk "$try" $hdrs; then
18602 echo "Your system accepts $xxx for the first arg."
18603 echo "...and $yyy for the second arg."
18604 netdb_host_type="$xxx"
18605 netdb_hlen_type="$yyy"
18611 : In case none of those worked, prompt the user.
18612 case "$netdb_host_type" in
18613 '') rp='What is the type for the 1st argument to gethostbyaddr?'
18616 netdb_host_type=$ans
18617 rp='What is the type for the 2nd argument to gethostbyaddr?'
18620 netdb_hlen_type=$ans
18624 *) : no gethostbyaddr, so pick harmless defaults
18625 netdb_host_type='char *'
18626 netdb_hlen_type="$sizetype"
18629 # Remove the "const" if needed. -- but then we'll have a
18631 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
18634 : check for type of argument to gethostbyname.
18635 if test "X$netdb_name_type" = X ; then
18636 case "$d_gethbyname" in
18640 Checking to see what type of argument is accepted by gethostbyname().
18642 hdrs="$define sys/types.h
18643 $d_socket sys/socket.h
18644 $i_niin netinet/in.h
18646 $i_unistd unistd.h"
18647 for xxx in "const char *" "char *"; do
18648 case "$netdb_name_type" in
18649 '') try="extern struct hostent *gethostbyname($xxx);"
18650 if ./protochk "$try" $hdrs; then
18651 echo "Your system accepts $xxx."
18652 netdb_name_type="$xxx"
18657 : In case none of those worked, prompt the user.
18658 case "$netdb_name_type" in
18659 '') rp='What is the type for the 1st argument to gethostbyname?'
18662 netdb_name_type=$ans
18666 *) : no gethostbyname, so pick harmless default
18667 netdb_name_type='char *'
18672 : check for type of 1st argument to getnetbyaddr.
18673 if test "X$netdb_net_type" = X ; then
18674 case "$d_getnbyaddr" in
18678 Checking to see what type of 1st argument is accepted by getnetbyaddr().
18680 hdrs="$define sys/types.h
18681 $d_socket sys/socket.h
18682 $i_niin netinet/in.h
18684 $i_unistd unistd.h"
18685 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
18686 case "$netdb_net_type" in
18687 '') try="extern struct netent *getnetbyaddr($xxx, int);"
18688 if ./protochk "$try" $hdrs; then
18689 echo "Your system accepts $xxx."
18690 netdb_net_type="$xxx"
18695 : In case none of those worked, prompt the user.
18696 case "$netdb_net_type" in
18697 '') rp='What is the type for the 1st argument to getnetbyaddr?'
18700 netdb_net_type=$ans
18704 *) : no getnetbyaddr, so pick harmless default
18705 netdb_net_type='long'
18709 : locate the preferred pager for this system
18716 [a-zA-Z]:/*) dflt=$pg;;
18720 [a-zA-Z]:/*) dflt=$more;;
18724 [a-zA-Z]:/*) dflt=$less;;
18727 '') dflt=/usr/ucb/more;;
18731 : Instruct ./getfile to trust the hinted or previous pager value,
18732 : even if it does not begin with a slash. For example, on os2,
18733 : pager might be cmd /c more. See comments in UU/getfile.
18738 rp='What pager is used on your system?'
18742 : see what type pids are declared as in the kernel
18743 rp="What is the type of process ids on this system?"
18744 set pid_t pidtype int stdio.h sys/types.h
18747 : see if ar generates random libraries by itself
18749 echo "Checking how to generate random libraries on your machine..." >&4
18750 echo 'int bar1() { return bar2(); }' > bar1.c
18751 echo 'int bar2() { return 2; }' > bar2.c
18753 #$i_stdlib I_STDLIB
18755 #include <stdlib.h>
18757 int main() { printf("%d\n", bar1()); exit(0); }
18759 $cc $ccflags -c bar1.c >/dev/null 2>&1
18760 $cc $ccflags -c bar2.c >/dev/null 2>&1
18761 $cc $ccflags -c foo.c >/dev/null 2>&1
18762 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
18763 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
18764 $run ./foobar >/dev/null 2>&1; then
18765 echo "$ar appears to generate random libraries itself."
18768 elif $ar ts bar$_a >/dev/null 2>&1 &&
18769 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
18770 $run ./foobar >/dev/null 2>&1; then
18771 echo "a table of contents needs to be added with '$ar ts'."
18778 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
18779 $test -f $ranlib || ranlib=''
18782 if $test -n "$ranlib"; then
18783 echo "your system has '$ranlib'; we'll use that."
18786 echo "your system doesn't seem to support random libraries"
18787 echo "so we'll use lorder and tsort to order the libraries."
18794 : check for type of arguments to select.
18795 case "$selecttype" in
18796 '') case "$d_select" in
18800 Checking to see what type of arguments are accepted by select().
18802 hdrs="$define sys/types.h
18803 $i_systime sys/time.h
18804 $i_sysselct sys/select.h
18805 $d_socket sys/socket.h"
18806 : The first arg can be int, unsigned, or size_t
18807 : The last arg may or may not be 'const'
18809 : void pointer has been seen but using that
18810 : breaks the selectminbits test
18811 for xxx in 'fd_set *' 'int *'; do
18812 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
18813 for tmo in 'struct timeval *' 'const struct timeval *'; do
18815 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
18816 if ./protochk "$try" $hdrs; then
18817 echo "Your system accepts $xxx."
18826 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
18827 case "$d_fd_set" in
18828 $define) dflt="fd_set *" ;;
18837 *) : no select, so pick a harmless default
18844 : check for the select 'width'
18845 case "$selectminbits" in
18846 '') safebits=`expr $ptrsize \* 8`
18847 case "$d_select" in
18851 Checking to see on how many bits at a time your select() operates...
18854 #include <sys/types.h>
18856 #$i_systime I_SYS_TIME
18857 #$i_systimek I_SYS_TIME_KERNEL
18862 # ifdef I_SYS_TIME_KERNEL
18865 # include <sys/time.h>
18866 # ifdef I_SYS_TIME_KERNEL
18870 #$i_sysselct I_SYS_SELECT
18871 #ifdef I_SYS_SELECT
18872 #include <sys/select.h>
18874 #$d_socket HAS_SOCKET
18876 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
18879 #$i_stdlib I_STDLIB
18881 #include <stdlib.h>
18884 #define S sizeof(*(b))
18886 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
18887 #define NBITS (NBYTES * 8)
18889 char *s = malloc(NBYTES);
18898 fp = fopen("try.c", "r");
18904 b = ($selecttype)s;
18905 for (i = 0; i < NBITS; i++)
18909 select(fd + 1, b, 0, 0, &t);
18910 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
18912 printf("%d\n", i + 1);
18917 if eval $compile_ok; then
18918 selectminbits=`$run ./try`
18919 case "$selectminbits" in
18921 Cannot figure out on how many bits at a time your select() operates.
18922 I'll play safe and guess it is $safebits bits.
18924 selectminbits=$safebits
18925 bits="$safebits bits"
18928 *) bits="$selectminbits bits" ;;
18930 echo "Your select() operates on $bits at a time." >&4
18932 rp='What is the minimum number of bits your select() operates on?'
18933 case "$byteorder" in
18934 12345678) dflt=64 ;;
18940 selectminbits="$val"
18944 *) : no select, so pick a harmless default
18945 selectminbits=$safebits
18951 : Trace out the files included by signal.h, then look for SIGxxx names.
18952 : Remove SIGARRAYSIZE used by HPUX.
18953 : Remove SIGSTKSIZE used by Linux.
18954 : Remove SIGSTKSZ used by Posix.
18955 : Remove SIGTYP void lines used by OS2.
18956 : Some cpps, like os390, dont give the file name anywhere
18957 if [ "X$fieldn" = X ]; then
18958 : Just make some guesses. We check them later.
18959 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
18961 xxx=`echo '#include <signal.h>' |
18962 $cppstdin $cppminus $cppflags 2>/dev/null |
18963 $grep '^[ ]*#.*include' |
18964 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
18966 : Check this list of files to be sure we have parsed the cpp output ok.
18967 : This will also avoid potentially non-existent files, such
18970 for xx in $xxx /dev/null ; do
18971 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
18973 : If we have found no files, at least try signal.h
18974 case "$xxxfiles" in
18975 '') xxxfiles=`./findhdr signal.h` ;;
18978 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
18979 print substr($2, 4, 20)
18981 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
18982 print substr($3, 4, 20)
18984 : Append some common names just in case the awk scan failed.
18985 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
18986 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
18987 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
18988 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
18989 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
18991 : generate a few handy files for later
18992 $cat > signal.c <<EOCP
18993 #include <sys/types.h>
18994 #include <signal.h>
18995 #$i_stdlib I_STDLIB
18997 #include <stdlib.h>
19002 /* Strange style to avoid deeply-nested #if/#else/#endif */
19005 # define NSIG (_NSIG)
19011 # define NSIG (SIGMAX+1)
19017 # define NSIG (SIG_MAX+1)
19023 # define NSIG (MAXSIG+1)
19029 # define NSIG (MAX_SIG+1)
19034 # ifdef SIGARRAYSIZE
19035 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
19041 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19045 /* Default to some arbitrary number that's big enough to get most
19046 of the common signals.
19052 printf("NSIG %d\n", NSIG);
19058 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19060 printf "#ifdef SIG"; printf $1; printf "\n"
19061 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19062 printf $1; printf ");\n"
19066 printf "#endif /* JUST_NSIG */\n";
19067 printf "exit(0);\n}\n";
19070 $cat >signal.awk <<'EOP'
19071 BEGIN { ndups = 0 }
19072 $1 ~ /^NSIG$/ { nsig = $2 }
19073 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19074 if ($2 > maxsig) { maxsig = $2 }
19075 if (sig_name[$2]) {
19076 dup_name[ndups] = $1
19077 dup_num[ndups] = $2
19089 printf("NSIG %d\n", nsig);
19090 for (n = 1; n < nsig; n++) {
19092 printf("%s %d\n", sig_name[n], sig_num[n])
19095 printf("NUM%d %d\n", n, n)
19098 for (n = 0; n < ndups; n++) {
19099 printf("%s %d\n", dup_name[n], dup_num[n])
19103 $cat >signal_cmd <<EOS
19105 if $test -s signal.lst; then
19106 echo "Using your existing signal.lst file"
19111 $cat >>signal_cmd <<'EOS'
19114 if eval $compile_ok; then
19115 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19117 echo "(I can't seem be able to compile the whole test program)" >&4
19118 echo "(I'll try it in little pieces.)" >&4
19119 set signal -DJUST_NSIG
19120 if eval $compile_ok; then
19121 $run ./signal$_exe > signal.nsg
19124 echo "I can't seem to figure out how many signals you have." >&4
19125 echo "Guessing 50." >&4
19126 echo 'NSIG 50' > signal.nsg
19128 : Now look at all the signal names, one at a time.
19129 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19130 $cat > signal.c <<EOCP
19131 #include <sys/types.h>
19132 #include <signal.h>
19135 printf("$xx %d\n", SIG${xx});
19140 if eval $compile; then
19141 echo "SIG${xx} found."
19142 $run ./signal$_exe >> signal.ls1
19144 echo "SIG${xx} NOT found."
19147 if $test -s signal.ls1; then
19148 $cat signal.nsg signal.ls1 |
19149 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19153 if $test -s signal.lst; then
19156 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19157 echo 'kill -l' >signal
19158 set X `csh -f <signal`
19162 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19164 echo $@ | $tr ' ' $trnl | \
19165 $awk '{ printf "%s %d\n", $1, ++s; }
19166 END { printf "NSIG %d\n", ++s }' >signal.lst
19168 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19170 chmod a+x signal_cmd
19171 $eunicefix signal_cmd
19173 : generate list of signal names
19175 case "$sig_name_init" in
19177 *) case "$sig_num_init" in
19178 ''|*,*) doinit=yes ;;
19183 echo "Generating a list of signal names and numbers..." >&4
19185 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19186 sig_name=`$awk 'BEGIN { printf "ZERO " }
19187 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19188 sig_num=`$awk 'BEGIN { printf "0 " }
19189 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19190 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19191 !/^NSIG/ { printf "\"%s\", ", $1 }
19192 END { printf "0\n" }' signal.lst`
19193 sig_num_init=`$awk 'BEGIN { printf "0, " }
19194 !/^NSIG/ { printf "%d, ", $2}
19195 END { printf "0\n"}' signal.lst`
19198 echo "The following $sig_count signals are available:"
19200 echo $sig_name | $awk \
19201 'BEGIN { linelen = 0 }
19203 for (i = 1; i <= NF; i++) {
19204 name = "SIG" $i " "
19205 linelen = linelen + length(name)
19206 if (linelen > 70) {
19208 linelen = length(name)
19214 sig_size=`echo $sig_name | awk '{print NF}'`
19215 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19218 case "$sizetype" in
19219 *_t) zzz="$sizetype" ;;
19220 *) zzz="filesize" ;;
19222 echo "Checking the size of $zzz..." >&4
19224 #include <sys/types.h>
19226 #$i_stdlib I_STDLIB
19228 #include <stdlib.h>
19231 printf("%d\n", (int)sizeof($sizetype));
19236 if eval $compile_ok; then
19240 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19243 echo "Your $zzz size is $sizesize bytes."
19248 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19252 : check for socklen_t
19254 echo "Checking to see if you have socklen_t..." >&4
19256 #include <sys/types.h>
19257 #$d_socket HAS_SOCKET
19259 #include <sys/socket.h>
19261 int main() { socklen_t x = 16; }
19264 if eval $compile; then
19266 echo "You have socklen_t."
19269 echo "You do not have socklen_t."
19270 case "$sizetype" in
19271 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19278 : see if this is a socks.h system
19279 set socks.h i_socks
19282 : check for type of the size argument to socket calls
19283 case "$d_socket" in
19287 Checking to see what type is the last argument of accept().
19290 case "$d_socklen_t" in
19291 "$define") yyy="$yyy socklen_t"
19293 yyy="$yyy $sizetype int long unsigned"
19294 for xxx in $yyy; do
19295 case "$socksizetype" in
19296 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19297 case "$usesocks" in
19299 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19300 echo "Your system accepts '$xxx *' for the last argument of accept()."
19301 socksizetype="$xxx"
19304 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19305 echo "Your system accepts '$xxx *' for the last argument of accept()."
19306 socksizetype="$xxx"
19313 : In case none of those worked, prompt the user.
19314 case "$socksizetype" in
19315 '') rp='What is the type for socket address structure sizes?'
19322 *) : no sockets, so pick relatively harmless default
19327 : see what type is used for signed size_t
19328 set ssize_t ssizetype int stdio.h sys/types.h
19333 #$i_stdlib I_STDLIB
19335 #include <stdlib.h>
19337 #include <sys/types.h>
19338 #define Size_t $sizetype
19339 #define SSize_t $dflt
19342 if (sizeof(Size_t) == sizeof(SSize_t))
19344 else if (sizeof(Size_t) == sizeof(int))
19353 if eval $compile_ok && $run ./try > /dev/null; then
19354 ssizetype=`$run ./try`
19355 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19358 Help! I can't compile and run the ssize_t test program: please enlighten me!
19359 (This is probably a misconfiguration in your system or libraries, and
19360 you really ought to fix it. Still, I'll try anyway.)
19362 I need a type that is the same size as $sizetype, but is guaranteed to
19363 be signed. Common values are ssize_t, int and long.
19366 rp="What signed type is the same size as $sizetype?"
19372 : see what type of char stdio uses.
19374 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
19375 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19376 echo "Your stdio uses unsigned chars." >&4
19377 stdchar="unsigned char"
19379 echo "Your stdio uses signed chars." >&4
19386 : see what type uids are declared as in the kernel
19388 echo "Looking for the type for user ids returned by getuid()."
19389 set uid_t uidtype xxx stdio.h sys/types.h
19393 xxx=`./findhdr sys/user.h`
19394 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19396 unsigned) dflt="$1 $2" ;;
19400 *) dflt="$uidtype";;
19403 uid_t) echo "uid_t found." ;;
19404 *) rp="What is the type for user ids returned by getuid()?"
19412 *_t) zzz="$uidtype" ;;
19415 echo "Checking the size of $zzz..." >&4
19417 #include <sys/types.h>
19419 #$i_stdlib I_STDLIB
19421 #include <stdlib.h>
19424 printf("%d\n", (int)sizeof($uidtype));
19429 if eval $compile_ok; then
19433 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19436 echo "Your $zzz is $uidsize bytes long."
19441 echo "(I can't compile the test program--guessing $uidsize.)" >&4
19446 *_t) zzz="$uidtype" ;;
19449 echo "Checking the sign of $zzz..." >&4
19451 #include <sys/types.h>
19462 if eval $compile; then
19466 echo "(I can't execute the test program--guessing unsigned.)" >&4
19470 1) echo "Your $zzz is unsigned." ;;
19471 -1) echo "Your $zzz is signed." ;;
19477 echo "(I can't compile the test program--guessing unsigned.)" >&4
19483 $echo "Checking the format string to be used for uids..." >&4
19486 -1) if $test X"$uidsize" = X"$ivsize"; then
19487 uidformat="$ivdformat"
19489 if $test X"$uidsize" = X"$longsize"; then
19492 if $test X"$uidsize" = X"$intsize"; then
19495 if $test X"$uidsize" = X"$shortsize"; then
19502 *) if $test X"$uidsize" = X"$uvsize"; then
19503 uidformat="$uvuformat"
19505 if $test X"$uidsize" = X"$longsize"; then
19508 if $test X"$uidsize" = X"$intsize"; then
19511 if $test X"$uidsize" = X"$shortsize"; then
19521 case "$usesitecustomize" in
19522 $define|true|[Yy]*)
19523 usesitecustomize="$define"
19526 usesitecustomize="$undef"
19530 : determine compiler compiler
19539 if $test -f "$byacc$_exe"; then
19541 comp="byacc or $comp"
19543 if $test -f "$bison$_exe"; then
19544 comp="$comp or bison -y"
19546 rp="Which compiler compiler ($comp) shall I use?"
19555 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
19561 : see if this is a fp.h system
19565 : see if this is a fp_class.h system
19566 set fp_class.h i_fp_class
19569 : see if this is a ieeefp.h system
19570 case "$i_ieeefp" in
19571 '' ) set ieeefp.h i_ieeefp
19576 : see if this is a libutil.h system
19577 set libutil.h i_libutil
19580 : see if mach cthreads are available
19581 if test "X$usethreads" = "X$define"; then
19582 set mach/cthreads.h i_machcthr
19585 i_machcthr="$undef"
19590 : see if this is a mntent.h system
19591 set mntent.h i_mntent
19594 : see if ndbm.h is available
19600 # Some Linux distributions such as RedHat 7.1 put the
19601 # ndbm.h header in /usr/include/gdbm/ndbm.h.
19602 if $test -f /usr/include/gdbm/ndbm.h; then
19603 echo '<gdbm/ndbm.h> found.'
19604 ccflags="$ccflags -I/usr/include/gdbm"
19605 cppflags="$cppflags -I/usr/include/gdbm"
19613 : see if dbm_open exists
19614 set dbm_open d_dbm_open
19616 case "$d_dbm_open" in
19619 echo "We won't be including <ndbm.h>"
19628 : see if net/errno.h is available
19630 set net/errno.h val
19633 : Unfortunately, it causes problems on some systems. Arrgh.
19636 cat > try.c <<'EOM'
19639 #include <net/errno.h>
19645 if $cc $ccflags -c try.c >/dev/null 2>&1; then
19646 echo "We'll be including <net/errno.h>." >&4
19648 echo "We won't be including <net/errno.h>." >&4
19657 : see if netinet/tcp.h is available
19658 set netinet/tcp.h i_netinettcp
19661 : see if this is a poll.h system
19665 : see if this is a prot.h system
19670 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
19671 $cat <<'EOSH' > Cppsym.know
19672 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
19673 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
19674 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
19675 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
19676 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
19677 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
19678 bull c cadmus clipper CMU COFF COMPILER_VERSION
19679 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
19680 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
19681 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
19682 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
19684 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
19685 H3050R H3050RX hbullx20 hcx host_mips
19686 hp200 hp300 hp700 HP700 hp800 hp9000
19687 hp9000s200 hp9000s300 hp9000s400 hp9000s500
19688 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
19689 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
19690 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
19691 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
19692 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
19693 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
19694 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
19695 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
19696 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
19697 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
19698 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
19699 MATH_HAS_NO_SIDE_EFFECTS
19700 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
19701 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
19702 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
19703 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
19704 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
19705 NetBSD news1500 news1700 news1800 news1900 news3700
19706 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
19707 ns32016 ns32332 ns32k nsc32000
19708 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
19709 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
19710 pc532 pdp11 PGC PIC plexus PORTAR posix
19711 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
19712 POSIX_C_SOURCE POSIX_SOURCE POWER
19713 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
19714 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
19715 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
19716 sony sony_news sonyrisc sparc sparclite spectrum
19717 stardent stdc STDC_EXT stratos sun sun3 sun386
19718 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
19719 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
19720 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
19721 sysV68 sysV88 Tek4132 Tek4300 titan
19722 TM3200 TM5400 TM5600
19723 tower tower32 tower32_200 tower32_600 tower32_700
19724 tower32_800 tower32_850 tss
19725 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
19726 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
19727 unix UNIX95 UNIX99 unixpc unos
19728 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
19729 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
19730 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
19732 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
19733 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
19734 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
19737 # Maybe put other stuff here too.
19738 cat <<EOSH >>Cppsym.know
19741 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
19742 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
19743 $cat Cppsym.know > Cppsym.c
19744 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
19745 $rm -f Cppsym.a Cppsym.b Cppsym.c
19746 cat <<EOSH > Cppsym
19748 if $test \$# -gt 0; then
19749 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
19750 if $test -s Cppsym.got; then
19757 $tr " " "$trnl" | ./Cppsym.try
19763 cat <<EOSH > Cppsym.try
19765 cat <<'EOCP' > try.c
19771 cat <<'EOSH' >> Cppsym.try
19773 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
19774 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
19775 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
19776 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
19778 echo 'return 0;}' >> try.c
19780 cat <<EOSH >> Cppsym.try
19782 case "$osname-$gccversion" in
19783 irix-) ccflags="\$ccflags -woff 1178" ;;
19784 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
19786 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
19788 chmod +x Cppsym.try
19789 $eunicefix Cppsym.try
19790 ./Cppsym < Cppsym.know > Cppsym.true
19791 : now check the C compiler for additional symbols
19792 postprocess_cc_v=''
19794 aix) postprocess_cc_v="|$tr , ' '" ;;
19801 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
19804 -D*) echo "\$i" | $sed 's/^-D//';;
19805 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
19810 postprocess_cc_v=''
19813 ./ccsym > ccsym1.raw
19814 if $test -s ccsym1.raw; then
19815 $sort ccsym1.raw | $uniq >ccsym.raw
19817 mv ccsym1.raw ccsym.raw
19820 $awk '/\=/ { print $0; next }
19821 { print $0"=1" }' ccsym.raw >ccsym.list
19822 $awk '/\=/ { print $0; next }
19823 { print $0"=1" }' Cppsym.true >ccsym.true
19824 $comm -13 ccsym.true ccsym.list >ccsym.own
19825 $comm -12 ccsym.true ccsym.list >ccsym.com
19826 $comm -23 ccsym.true ccsym.list >ccsym.cpp
19828 if $test -z ccsym.raw; then
19829 echo "Your C compiler doesn't seem to define any symbols!" >&4
19831 echo "However, your C preprocessor defines the following symbols:"
19834 cppsymbols=`$cat Cppsym.true`
19835 cppsymbols=`echo $cppsymbols`
19836 cppccsymbols="$cppsymbols"
19838 if $test -s ccsym.com; then
19839 echo "Your C compiler and pre-processor define these symbols:"
19840 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
19843 cppccsymbols=`$cat ccsym.com`
19844 cppccsymbols=`echo $cppccsymbols`
19845 $test "$silent" || sleep 1
19847 if $test -s ccsym.cpp; then
19848 $test "$also" && echo " "
19849 echo "Your C pre-processor ${also}defines the following symbols:"
19850 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
19852 cppsymbols=`$cat ccsym.cpp`
19853 cppsymbols=`echo $cppsymbols`
19854 $test "$silent" || sleep 1
19856 if $test -s ccsym.own; then
19857 $test "$also" && echo " "
19858 echo "Your C compiler ${also}defines the following cpp symbols:"
19859 $sed -e 's/\(..*\)=1/\1/' ccsym.own
19860 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
19861 ccsymbols=`$cat ccsym.own`
19862 ccsymbols=`echo $ccsymbols`
19863 $test "$silent" || sleep 1
19867 : see if this is a termio system
19871 if $test `./findhdr termios.h`; then
19872 set tcsetattr i_termios
19878 "$define") echo "You have POSIX termios.h... good!" >&4;;
19879 *) if ./Cppsym pyr; then
19880 case "`/bin/universe`" in
19881 ucb) if $test `./findhdr sgtty.h`; then
19883 echo "<sgtty.h> found." >&4
19885 echo "System is pyramid with BSD universe."
19886 echo "<sgtty.h> not found--you could have problems." >&4
19888 *) if $test `./findhdr termio.h`; then
19890 echo "<termio.h> found." >&4
19892 echo "System is pyramid with USG universe."
19893 echo "<termio.h> not found--you could have problems." >&4
19897 if $test `./findhdr termio.h`; then
19898 echo "<termio.h> found." >&4
19900 elif $test `./findhdr sgtty.h`; then
19901 echo "<sgtty.h> found." >&4
19904 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
19907 if $test `./findhdr sgtty.h`; then
19908 echo "<sgtty.h> found." >&4
19910 elif $test `./findhdr termio.h`; then
19911 echo "<termio.h> found." >&4
19914 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
19918 set i_termio; eval $setvar
19919 val=$val2; set i_sgtty; eval $setvar
19920 val=$val3; set i_termios; eval $setvar
19922 : see if stddef is available
19923 set stddef.h i_stddef
19926 : see if this is a sunmath.h system
19927 set sunmath.h i_sunmath
19930 : see if sys/access.h is available
19931 set sys/access.h i_sysaccess
19934 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
19935 set sys/filio.h i_sysfilio
19938 if $test `./findhdr sys/ioctl.h`; then
19940 echo '<sys/ioctl.h> found.' >&4
19943 if $test $i_sysfilio = "$define"; then
19944 echo '<sys/ioctl.h> NOT found.' >&4
19946 $test $i_sgtty = "$define" && xxx="sgtty.h"
19947 $test $i_termio = "$define" && xxx="termio.h"
19948 $test $i_termios = "$define" && xxx="termios.h"
19949 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
19955 : see if socket ioctl defs are in sys/sockio.h
19957 xxx=`./findhdr sys/sockio.h`
19958 if $test "$xxx"; then
19959 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
19961 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
19964 echo "No socket ioctls found in <sys/sockio.h>." >&4
19969 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
19976 : see if this is a syslog.h system
19977 set syslog.h i_syslog
19981 : see if this is a sys/mode.h system
19982 set sys/mode.h i_sysmode
19985 : see if sys/resource.h has to be included
19986 set sys/resource.h i_sysresrc
19989 : see if sys/security.h is available
19990 set sys/security.h i_syssecrt
19993 : see if this is a sys/statvfs.h system
19994 set sys/statvfs.h i_sysstatvfs
19997 : see if this is a sys/un.h system
19998 set sys/un.h i_sysun
20002 : see if this is a sys/utsname.h system
20003 set sys/utsname.h i_sysutsname
20006 : see if this is a syswait system
20007 set sys/wait.h i_syswait
20010 : see if this is a ustat.h system
20011 set ustat.h i_ustat
20014 : see if this is an utime system
20015 set utime.h i_utime
20018 : see if this is a values.h system
20019 set values.h i_values
20022 : see if this is a vfork system
20025 set vfork.h i_vfork
20033 : see if gdbm.h is available
20038 : see if gdbm_open exists
20039 set gdbm_open d_gdbm_open
20041 case "$d_gdbm_open" in
20044 echo "We won't be including <gdbm.h>"
20054 echo "Looking for extensions..." >&4
20055 : If we are using the old config.sh, known_extensions may contain
20056 : old or inaccurate or duplicate values.
20057 known_extensions=''
20058 nonxs_extensions=''
20059 : We do not use find because it might not be available.
20060 : We do not just use MANIFEST because the user may have dropped
20061 : some additional extensions into the source tree and expect them
20064 : Function to recursively find available extensions, ignoring DynaLoader
20065 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20069 DynaLoader|dynaload) ;;
20071 if $test -f $xxx/$xxx.xs; then
20072 known_extensions="$known_extensions $1$xxx";
20073 elif $test -f $xxx/Makefile.PL; then
20074 nonxs_extensions="$nonxs_extensions $1$xxx";
20076 if $test -d $xxx -a $# -lt 10; then
20079 eval $find_extensions;
20091 eval $find_extensions
20092 # Special case: Add in threads/shared since it is not picked up by the
20093 # recursive find above (and adding in general recursive finding breaks
20094 # SDBM_File/sdbm). A.D. 10/25/2001.
20095 known_extensions="$known_extensions threads/shared"
20096 set X $nonxs_extensions
20098 nonxs_extensions="$*"
20099 set X $known_extensions
20101 known_extensions="$*"
20104 : Now see which are supported on this system.
20106 for xxx in $known_extensions ; do
20110 $define) avail_ext="$avail_ext $xxx" ;;
20113 GDBM_File|gdbm_fil)
20115 $define) avail_ext="$avail_ext $xxx" ;;
20118 I18N/Langinfo|i18n_lan)
20119 case "$i_langinfo$d_nl_langinfo" in
20120 $define$define) avail_ext="$avail_ext $xxx" ;;
20123 NDBM_File|ndbm_fil)
20126 case "$osname-$use64bitint" in
20129 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20132 *) avail_ext="$avail_ext $xxx" ;;
20137 ODBM_File|odbm_fil)
20138 case "${i_dbm}${i_rpcsvcdbm}" in
20140 case "$osname-$use64bitint" in
20143 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20146 *) avail_ext="$avail_ext $xxx" ;;
20152 case "$useposix" in
20153 true|define|y) avail_ext="$avail_ext $xxx" ;;
20157 case "$useopcode" in
20158 true|define|y) avail_ext="$avail_ext $xxx" ;;
20162 case "$d_socket" in
20165 beos) ;; # not unless BONE
20166 *) avail_ext="$avail_ext $xxx" ;;
20171 Sys/Syslog|sys/syslog)
20172 : XXX syslog requires socket
20173 case "$d_socket" in
20174 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20178 case "$usethreads" in
20180 case "$useithreads" in
20181 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20185 XS/APItest|xs/apitest)
20186 # This is just for testing. Skip it unless we have dynamic loading.
20189 $define) avail_ext="$avail_ext $xxx" ;;
20192 XS/Typemap|xs/typemap)
20193 # This is just for testing. Skip it unless we have dynamic loading.
20195 $define) avail_ext="$avail_ext $xxx" ;;
20198 threads|threads/shared)
20199 # threads and threads::shared are special cases.
20200 # To stop people from asking "Perl 5.8.0 was supposed
20201 # to have this new fancy threads implementation but my
20202 # perl doesn't have it" and from people trying to
20203 # (re)install the threads module using CPAN.pm and
20204 # CPAN.pm then offering to reinstall Perl 5.8.0,
20205 # the threads.pm and threads/shared.pm will always be
20206 # there, croaking informatively ("you need to rebuild
20207 # all of Perl with threads, sorry") when threads haven't
20208 # been compiled in.
20210 avail_ext="$avail_ext $xxx"
20213 : XXX Do we need a useipcsysv variable here
20214 case "${d_msg}${d_sem}${d_shm}" in
20215 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20218 *) avail_ext="$avail_ext $xxx"
20227 case "$onlyextensions" in
20229 *) keepextensions=''
20230 echo "You have requested that only certains extensions be included..." >&4
20231 for i in $onlyextensions; do
20232 case " $avail_ext " in
20234 echo "Keeping extension $i."
20235 keepextensions="$keepextensions $i"
20237 *) echo "Ignoring extension $i." ;;
20240 avail_ext="$keepextensions"
20244 case "$noextensions" in
20246 *) keepextensions=''
20247 echo "You have requested that certain extensions be ignored..." >&4
20248 for i in $avail_ext; do
20249 case " $noextensions " in
20250 *" $i "*) echo "Ignoring extension $i." ;;
20251 *) echo "Keeping extension $i.";
20252 keepextensions="$keepextensions $i"
20256 avail_ext="$keepextensions"
20260 : Now see which nonxs extensions are supported on this system.
20261 : For now assume all are.
20263 for xxx in $nonxs_extensions ; do
20265 *) nonxs_ext="$nonxs_ext $xxx"
20277 A number of extensions are supplied with $package. You may choose to
20278 compile these extensions for dynamic loading (the default), compile
20279 them into the $package executable (static loading), or not include
20280 them at all. Answer "none" to include no extensions.
20281 Note that DynaLoader is always built and need not be mentioned here.
20284 case "$dynamic_ext" in
20286 : Exclude those listed in static_ext
20288 for xxx in $avail_ext; do
20289 case " $static_ext " in
20291 *) dflt="$dflt $xxx" ;;
20298 *) dflt="$dynamic_ext"
20299 # Perhaps we are reusing an old out-of-date config.sh.
20302 if test X"$dynamic_ext" != X"$avail_ext"; then
20304 NOTICE: Your previous config.sh list may be incorrect.
20305 The extensions now available to you are
20307 but the default list from your previous config.sh is
20319 rp="What extensions do you wish to load dynamically?"
20322 none) dynamic_ext=' ' ;;
20323 *) dynamic_ext="$ans" ;;
20326 case "$static_ext" in
20328 : Exclude those already listed in dynamic linking
20330 for xxx in $avail_ext; do
20331 case " $dynamic_ext " in
20333 *) dflt="$dflt $xxx" ;;
20340 *) dflt="$static_ext"
20347 rp="What extensions do you wish to load statically?"
20350 none) static_ext=' ' ;;
20351 *) static_ext="$ans" ;;
20356 A number of extensions are supplied with $package. Answer "none"
20357 to include no extensions.
20358 Note that DynaLoader is always built and need not be mentioned here.
20361 case "$static_ext" in
20362 '') dflt="$avail_ext" ;;
20363 *) dflt="$static_ext"
20364 # Perhaps we are reusing an old out-of-date config.sh.
20367 if test X"$static_ext" != X"$avail_ext"; then
20369 NOTICE: Your previous config.sh list may be incorrect.
20370 The extensions now available to you are
20372 but the default list from your previous config.sh is
20381 : Exclude those that are not xs extensions
20385 rp="What extensions do you wish to include?"
20388 none) static_ext=' ' ;;
20389 *) static_ext="$ans" ;;
20394 # Encode is a special case. If we are building Encode as a static
20395 # extension, we need to explicitly list its subextensions as well.
20396 # For other nested extensions, this is handled automatically by
20397 # the appropriate Makefile.PL.
20398 case " $static_ext " in
20399 *" Encode "*) # Add the subextensions of Encode
20401 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20402 static_ext="$static_ext Encode/$xxx"
20408 set X $dynamic_ext $static_ext $nonxs_ext
20412 # Sanity check: We require an extension suitable for use with
20413 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
20414 # should show up as failures in the test suite, but it's helpful to
20415 # catch them now.) The 'extensions' list is normally sorted
20416 # alphabetically, so we need to accept either
20417 # DB_File ... Fcntl ... IO ....
20418 # or something like
20419 # Fcntl ... NDBM_File ... IO ....
20420 case " $extensions" in
20421 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
20422 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
20423 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
20424 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
20425 echo "WARNING: The Perl you are building will be quite crippled." >& 4
20429 : Remove libraries needed only for extensions
20430 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
20431 : The exception is SunOS 4.x, which needs them.
20432 case "${osname}X${osvers}" in
20436 *) case "$usedl" in
20437 $define|true|[yY]*)
20438 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
20442 *) perllibs="$libs"
20448 : Remove build directory name from cppstdin so it can be used from
20449 : either the present location or the final installed location.
20451 : Get out of the UU directory to get correct path name.
20453 case "$cppstdin" in
20455 echo "Stripping down cppstdin path name"
20461 : end of configuration questions
20463 echo "End of configuration questions."
20466 : back to where it started
20467 if test -d ../UU; then
20471 : configuration may be patched via a 'config.arch' file
20472 if $test -f config.arch; then
20473 echo "I see a config.arch file, loading it."
20477 : configuration may be patched via a 'config.over' file
20478 if $test -f config.over; then
20481 rp='I see a config.over file. Do you wish to load it?'
20484 n*) echo "OK, I'll ignore it.";;
20486 echo "Configuration override changes have been loaded."
20491 : in case they want portability, strip down executable paths
20492 case "$d_portable" in
20495 echo "Stripping down executable paths..." >&4
20496 for file in $loclist $trylist; do
20498 eval $file=`basename $temp`
20503 : create config.sh file
20505 echo "Creating config.sh..." >&4
20506 $spitshell <<EOT >config.sh
20509 # This file was produced by running the Configure script. It holds all the
20510 # definitions figured out by Configure. Should you modify one of these values,
20511 # do not forget to propagate your changes by running "Configure -der". You may
20512 # instead choose to run each of the .SH files by yourself, or "Configure -S".
20515 # Package name : $package
20516 # Source directory : $src
20517 # Configuration time: $cf_time
20518 # Configured by : $cf_by
20519 # Target system : $myuname
20529 Revision='$Revision'
20537 alignbytes='$alignbytes'
20538 ansi2knr='$ansi2knr'
20539 aphostname='$aphostname'
20540 api_revision='$api_revision'
20541 api_subversion='$api_subversion'
20542 api_version='$api_version'
20543 api_versionstring='$api_versionstring'
20546 archlibexp='$archlibexp'
20547 archname64='$archname64'
20548 archname='$archname'
20549 archobjs='$archobjs'
20550 asctime_r_proto='$asctime_r_proto'
20558 byteorder='$byteorder'
20560 castflags='$castflags'
20563 cccdlflags='$cccdlflags'
20564 ccdlflags='$ccdlflags'
20566 ccflags_uselargefiles='$ccflags_uselargefiles'
20568 ccsymbols='$ccsymbols'
20569 ccversion='$ccversion'
20571 cf_email='$cf_email'
20573 charsize='$charsize'
20577 clocktype='$clocktype'
20579 compress='$compress'
20580 contains='$contains'
20584 cpp_stuff='$cpp_stuff'
20585 cppccsymbols='$cppccsymbols'
20586 cppflags='$cppflags'
20588 cppminus='$cppminus'
20590 cppstdin='$cppstdin'
20591 cppsymbols='$cppsymbols'
20592 crypt_r_proto='$crypt_r_proto'
20593 cryptlib='$cryptlib'
20595 ctermid_r_proto='$ctermid_r_proto'
20596 ctime_r_proto='$ctime_r_proto'
20597 d_Gconvert='$d_Gconvert'
20598 d_PRIEUldbl='$d_PRIEUldbl'
20599 d_PRIFUldbl='$d_PRIFUldbl'
20600 d_PRIGUldbl='$d_PRIGUldbl'
20601 d_PRIXU64='$d_PRIXU64'
20602 d_PRId64='$d_PRId64'
20603 d_PRIeldbl='$d_PRIeldbl'
20604 d_PRIfldbl='$d_PRIfldbl'
20605 d_PRIgldbl='$d_PRIgldbl'
20606 d_PRIi64='$d_PRIi64'
20607 d_PRIo64='$d_PRIo64'
20608 d_PRIu64='$d_PRIu64'
20609 d_PRIx64='$d_PRIx64'
20610 d_SCNfldbl='$d_SCNfldbl'
20611 d__fwalk='$d__fwalk'
20612 d_access='$d_access'
20613 d_accessx='$d_accessx'
20616 d_archlib='$d_archlib'
20617 d_asctime_r='$d_asctime_r'
20620 d_attribut='$d_attribut'
20624 d_bsdgetpgrp='$d_bsdgetpgrp'
20625 d_bsdsetpgrp='$d_bsdsetpgrp'
20627 d_casti32='$d_casti32'
20628 d_castneg='$d_castneg'
20629 d_charvspr='$d_charvspr'
20631 d_chroot='$d_chroot'
20632 d_chsize='$d_chsize'
20634 d_closedir='$d_closedir'
20635 d_cmsghdr_s='$d_cmsghdr_s'
20637 d_copysignl='$d_copysignl'
20639 d_crypt_r='$d_crypt_r'
20641 d_ctermid_r='$d_ctermid_r'
20642 d_ctime_r='$d_ctime_r'
20643 d_cuserid='$d_cuserid'
20644 d_dbl_dig='$d_dbl_dig'
20645 d_dbminitproto='$d_dbminitproto'
20646 d_difftime='$d_difftime'
20648 d_dirnamlen='$d_dirnamlen'
20649 d_dlerror='$d_dlerror'
20650 d_dlopen='$d_dlopen'
20651 d_dlsymun='$d_dlsymun'
20652 d_dosuid='$d_dosuid'
20653 d_drand48_r='$d_drand48_r'
20654 d_drand48proto='$d_drand48proto'
20656 d_eaccess='$d_eaccess'
20657 d_endgrent='$d_endgrent'
20658 d_endgrent_r='$d_endgrent_r'
20659 d_endhent='$d_endhent'
20660 d_endhostent_r='$d_endhostent_r'
20661 d_endnent='$d_endnent'
20662 d_endnetent_r='$d_endnetent_r'
20663 d_endpent='$d_endpent'
20664 d_endprotoent_r='$d_endprotoent_r'
20665 d_endpwent='$d_endpwent'
20666 d_endpwent_r='$d_endpwent_r'
20667 d_endsent='$d_endsent'
20668 d_endservent_r='$d_endservent_r'
20669 d_eofnblk='$d_eofnblk'
20670 d_eunice='$d_eunice'
20671 d_faststdio='$d_faststdio'
20672 d_fchdir='$d_fchdir'
20673 d_fchmod='$d_fchmod'
20674 d_fchown='$d_fchown'
20676 d_fcntl_can_lock='$d_fcntl_can_lock'
20677 d_fd_macros='$d_fd_macros'
20678 d_fd_set='$d_fd_set'
20679 d_fds_bits='$d_fds_bits'
20680 d_fgetpos='$d_fgetpos'
20681 d_finite='$d_finite'
20682 d_finitel='$d_finitel'
20683 d_flexfnam='$d_flexfnam'
20685 d_flockproto='$d_flockproto'
20687 d_fp_class='$d_fp_class'
20688 d_fpathconf='$d_fpathconf'
20689 d_fpclass='$d_fpclass'
20690 d_fpclassify='$d_fpclassify'
20691 d_fpclassl='$d_fpclassl'
20692 d_fpos64_t='$d_fpos64_t'
20693 d_frexpl='$d_frexpl'
20694 d_fs_data_s='$d_fs_data_s'
20695 d_fseeko='$d_fseeko'
20696 d_fsetpos='$d_fsetpos'
20697 d_fstatfs='$d_fstatfs'
20698 d_fstatvfs='$d_fstatvfs'
20700 d_ftello='$d_ftello'
20702 d_getcwd='$d_getcwd'
20703 d_getespwnam='$d_getespwnam'
20704 d_getfsstat='$d_getfsstat'
20705 d_getgrent='$d_getgrent'
20706 d_getgrent_r='$d_getgrent_r'
20707 d_getgrgid_r='$d_getgrgid_r'
20708 d_getgrnam_r='$d_getgrnam_r'
20709 d_getgrps='$d_getgrps'
20710 d_gethbyaddr='$d_gethbyaddr'
20711 d_gethbyname='$d_gethbyname'
20712 d_gethent='$d_gethent'
20713 d_gethname='$d_gethname'
20714 d_gethostbyaddr_r='$d_gethostbyaddr_r'
20715 d_gethostbyname_r='$d_gethostbyname_r'
20716 d_gethostent_r='$d_gethostent_r'
20717 d_gethostprotos='$d_gethostprotos'
20718 d_getitimer='$d_getitimer'
20719 d_getlogin='$d_getlogin'
20720 d_getlogin_r='$d_getlogin_r'
20721 d_getmnt='$d_getmnt'
20722 d_getmntent='$d_getmntent'
20723 d_getnbyaddr='$d_getnbyaddr'
20724 d_getnbyname='$d_getnbyname'
20725 d_getnent='$d_getnent'
20726 d_getnetbyaddr_r='$d_getnetbyaddr_r'
20727 d_getnetbyname_r='$d_getnetbyname_r'
20728 d_getnetent_r='$d_getnetent_r'
20729 d_getnetprotos='$d_getnetprotos'
20730 d_getpagsz='$d_getpagsz'
20731 d_getpbyname='$d_getpbyname'
20732 d_getpbynumber='$d_getpbynumber'
20733 d_getpent='$d_getpent'
20734 d_getpgid='$d_getpgid'
20735 d_getpgrp2='$d_getpgrp2'
20736 d_getpgrp='$d_getpgrp'
20737 d_getppid='$d_getppid'
20738 d_getprior='$d_getprior'
20739 d_getprotobyname_r='$d_getprotobyname_r'
20740 d_getprotobynumber_r='$d_getprotobynumber_r'
20741 d_getprotoent_r='$d_getprotoent_r'
20742 d_getprotoprotos='$d_getprotoprotos'
20743 d_getprpwnam='$d_getprpwnam'
20744 d_getpwent='$d_getpwent'
20745 d_getpwent_r='$d_getpwent_r'
20746 d_getpwnam_r='$d_getpwnam_r'
20747 d_getpwuid_r='$d_getpwuid_r'
20748 d_getsbyname='$d_getsbyname'
20749 d_getsbyport='$d_getsbyport'
20750 d_getsent='$d_getsent'
20751 d_getservbyname_r='$d_getservbyname_r'
20752 d_getservbyport_r='$d_getservbyport_r'
20753 d_getservent_r='$d_getservent_r'
20754 d_getservprotos='$d_getservprotos'
20755 d_getspnam='$d_getspnam'
20756 d_getspnam_r='$d_getspnam_r'
20757 d_gettimeod='$d_gettimeod'
20758 d_gmtime_r='$d_gmtime_r'
20759 d_gnulibc='$d_gnulibc'
20760 d_grpasswd='$d_grpasswd'
20761 d_hasmntopt='$d_hasmntopt'
20763 d_ilogbl='$d_ilogbl'
20765 d_inetaton='$d_inetaton'
20766 d_int64_t='$d_int64_t'
20767 d_isascii='$d_isascii'
20768 d_isfinite='$d_isfinite'
20771 d_isnanl='$d_isnanl'
20772 d_killpg='$d_killpg'
20773 d_lchown='$d_lchown'
20774 d_ldbl_dig='$d_ldbl_dig'
20775 d_libm_lib_version='$d_libm_lib_version'
20777 d_localtime_r='$d_localtime_r'
20778 d_locconv='$d_locconv'
20780 d_longdbl='$d_longdbl'
20781 d_longlong='$d_longlong'
20782 d_lseekproto='$d_lseekproto'
20784 d_madvise='$d_madvise'
20786 d_mbstowcs='$d_mbstowcs'
20787 d_mbtowc='$d_mbtowc'
20788 d_memchr='$d_memchr'
20789 d_memcmp='$d_memcmp'
20790 d_memcpy='$d_memcpy'
20791 d_memmove='$d_memmove'
20792 d_memset='$d_memset'
20794 d_mkdtemp='$d_mkdtemp'
20795 d_mkfifo='$d_mkfifo'
20796 d_mkstemp='$d_mkstemp'
20797 d_mkstemps='$d_mkstemps'
20798 d_mktime='$d_mktime'
20801 d_modfl_pow32_bug='$d_modfl_pow32_bug'
20802 d_modflproto='$d_modflproto'
20803 d_mprotect='$d_mprotect'
20805 d_msg_ctrunc='$d_msg_ctrunc'
20806 d_msg_dontroute='$d_msg_dontroute'
20807 d_msg_oob='$d_msg_oob'
20808 d_msg_peek='$d_msg_peek'
20809 d_msg_proxy='$d_msg_proxy'
20810 d_msgctl='$d_msgctl'
20811 d_msgget='$d_msgget'
20812 d_msghdr_s='$d_msghdr_s'
20813 d_msgrcv='$d_msgrcv'
20814 d_msgsnd='$d_msgsnd'
20816 d_munmap='$d_munmap'
20817 d_mymalloc='$d_mymalloc'
20819 d_nl_langinfo='$d_nl_langinfo'
20820 d_nv_preserves_uv='$d_nv_preserves_uv'
20821 d_off64_t='$d_off64_t'
20822 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
20823 d_oldpthreads='$d_oldpthreads'
20824 d_oldsock='$d_oldsock'
20826 d_pathconf='$d_pathconf'
20828 d_perl_otherlibdirs='$d_perl_otherlibdirs'
20829 d_phostname='$d_phostname'
20832 d_portable='$d_portable'
20833 d_procselfexe='$d_procselfexe'
20834 d_pthread_atfork='$d_pthread_atfork'
20835 d_pthread_attr_setscope='$d_pthread_attr_setscope'
20836 d_pthread_yield='$d_pthread_yield'
20838 d_pwchange='$d_pwchange'
20839 d_pwclass='$d_pwclass'
20840 d_pwcomment='$d_pwcomment'
20841 d_pwexpire='$d_pwexpire'
20842 d_pwgecos='$d_pwgecos'
20843 d_pwpasswd='$d_pwpasswd'
20844 d_pwquota='$d_pwquota'
20847 d_random_r='$d_random_r'
20848 d_readdir64_r='$d_readdir64_r'
20849 d_readdir='$d_readdir'
20850 d_readdir_r='$d_readdir_r'
20851 d_readlink='$d_readlink'
20853 d_recvmsg='$d_recvmsg'
20854 d_rename='$d_rename'
20855 d_rewinddir='$d_rewinddir'
20857 d_safebcpy='$d_safebcpy'
20858 d_safemcpy='$d_safemcpy'
20859 d_sanemcmp='$d_sanemcmp'
20860 d_sbrkproto='$d_sbrkproto'
20861 d_scalbnl='$d_scalbnl'
20862 d_sched_yield='$d_sched_yield'
20863 d_scm_rights='$d_scm_rights'
20864 d_seekdir='$d_seekdir'
20865 d_select='$d_select'
20867 d_semctl='$d_semctl'
20868 d_semctl_semid_ds='$d_semctl_semid_ds'
20869 d_semctl_semun='$d_semctl_semun'
20870 d_semget='$d_semget'
20872 d_sendmsg='$d_sendmsg'
20873 d_setegid='$d_setegid'
20874 d_seteuid='$d_seteuid'
20875 d_setgrent='$d_setgrent'
20876 d_setgrent_r='$d_setgrent_r'
20877 d_setgrps='$d_setgrps'
20878 d_sethent='$d_sethent'
20879 d_sethostent_r='$d_sethostent_r'
20880 d_setitimer='$d_setitimer'
20881 d_setlinebuf='$d_setlinebuf'
20882 d_setlocale='$d_setlocale'
20883 d_setlocale_r='$d_setlocale_r'
20884 d_setnent='$d_setnent'
20885 d_setnetent_r='$d_setnetent_r'
20886 d_setpent='$d_setpent'
20887 d_setpgid='$d_setpgid'
20888 d_setpgrp2='$d_setpgrp2'
20889 d_setpgrp='$d_setpgrp'
20890 d_setprior='$d_setprior'
20891 d_setproctitle='$d_setproctitle'
20892 d_setprotoent_r='$d_setprotoent_r'
20893 d_setpwent='$d_setpwent'
20894 d_setpwent_r='$d_setpwent_r'
20895 d_setregid='$d_setregid'
20896 d_setresgid='$d_setresgid'
20897 d_setresuid='$d_setresuid'
20898 d_setreuid='$d_setreuid'
20899 d_setrgid='$d_setrgid'
20900 d_setruid='$d_setruid'
20901 d_setsent='$d_setsent'
20902 d_setservent_r='$d_setservent_r'
20903 d_setsid='$d_setsid'
20904 d_setvbuf='$d_setvbuf'
20908 d_shmatprototype='$d_shmatprototype'
20909 d_shmctl='$d_shmctl'
20911 d_shmget='$d_shmget'
20912 d_sigaction='$d_sigaction'
20913 d_sigprocmask='$d_sigprocmask'
20914 d_sigsetjmp='$d_sigsetjmp'
20915 d_sockatmark='$d_sockatmark'
20916 d_sockatmarkproto='$d_sockatmarkproto'
20917 d_socket='$d_socket'
20918 d_socklen_t='$d_socklen_t'
20919 d_sockpair='$d_sockpair'
20920 d_socks5_init='$d_socks5_init'
20922 d_srand48_r='$d_srand48_r'
20923 d_srandom_r='$d_srandom_r'
20924 d_sresgproto='$d_sresgproto'
20925 d_sresuproto='$d_sresuproto'
20926 d_statblks='$d_statblks'
20927 d_statfs_f_flags='$d_statfs_f_flags'
20928 d_statfs_s='$d_statfs_s'
20929 d_statvfs='$d_statvfs'
20930 d_stdio_cnt_lval='$d_stdio_cnt_lval'
20931 d_stdio_ptr_lval='$d_stdio_ptr_lval'
20932 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
20933 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
20934 d_stdio_stream_array='$d_stdio_stream_array'
20935 d_stdiobase='$d_stdiobase'
20936 d_stdstdio='$d_stdstdio'
20937 d_strchr='$d_strchr'
20938 d_strcoll='$d_strcoll'
20939 d_strctcpy='$d_strctcpy'
20940 d_strerrm='$d_strerrm'
20941 d_strerror='$d_strerror'
20942 d_strerror_r='$d_strerror_r'
20943 d_strftime='$d_strftime'
20944 d_strlcat='$d_strlcat'
20945 d_strlcpy='$d_strlcpy'
20946 d_strtod='$d_strtod'
20947 d_strtol='$d_strtol'
20948 d_strtold='$d_strtold'
20949 d_strtoll='$d_strtoll'
20950 d_strtoq='$d_strtoq'
20951 d_strtoul='$d_strtoul'
20952 d_strtoull='$d_strtoull'
20953 d_strtouq='$d_strtouq'
20954 d_strxfrm='$d_strxfrm'
20955 d_suidsafe='$d_suidsafe'
20956 d_symlink='$d_symlink'
20957 d_syscall='$d_syscall'
20958 d_syscallproto='$d_syscallproto'
20959 d_sysconf='$d_sysconf'
20960 d_sysernlst='$d_sysernlst'
20961 d_syserrlst='$d_syserrlst'
20962 d_system='$d_system'
20963 d_tcgetpgrp='$d_tcgetpgrp'
20964 d_tcsetpgrp='$d_tcsetpgrp'
20965 d_telldir='$d_telldir'
20966 d_telldirproto='$d_telldirproto'
20969 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
20970 d_tm_tm_zone='$d_tm_tm_zone'
20971 d_tmpnam_r='$d_tmpnam_r'
20972 d_truncate='$d_truncate'
20973 d_ttyname_r='$d_ttyname_r'
20974 d_tzname='$d_tzname'
20975 d_u32align='$d_u32align'
20976 d_ualarm='$d_ualarm'
20979 d_union_semun='$d_union_semun'
20980 d_unordered='$d_unordered'
20981 d_usleep='$d_usleep'
20982 d_usleepproto='$d_usleepproto'
20984 d_vendorarch='$d_vendorarch'
20985 d_vendorbin='$d_vendorbin'
20986 d_vendorlib='$d_vendorlib'
20987 d_vendorscript='$d_vendorscript'
20989 d_void_closedir='$d_void_closedir'
20990 d_voidsig='$d_voidsig'
20991 d_voidtty='$d_voidtty'
20992 d_volatile='$d_volatile'
20993 d_vprintf='$d_vprintf'
20995 d_waitpid='$d_waitpid'
20996 d_wcstombs='$d_wcstombs'
20997 d_wctomb='$d_wctomb'
20998 d_writev='$d_writev'
21001 db_hashtype='$db_hashtype'
21002 db_prefixtype='$db_prefixtype'
21003 db_version_major='$db_version_major'
21004 db_version_minor='$db_version_minor'
21005 db_version_patch='$db_version_patch'
21006 defvoidused='$defvoidused'
21007 direntrytype='$direntrytype'
21010 doublesize='$doublesize'
21012 drand48_r_proto='$drand48_r_proto'
21013 dynamic_ext='$dynamic_ext'
21019 endgrent_r_proto='$endgrent_r_proto'
21020 endhostent_r_proto='$endhostent_r_proto'
21021 endnetent_r_proto='$endnetent_r_proto'
21022 endprotoent_r_proto='$endprotoent_r_proto'
21023 endpwent_r_proto='$endpwent_r_proto'
21024 endservent_r_proto='$endservent_r_proto'
21025 eunicefix='$eunicefix'
21028 extensions='$extensions'
21030 fflushNULL='$fflushNULL'
21031 fflushall='$fflushall'
21033 firstmakefile='$firstmakefile'
21035 fpossize='$fpossize'
21036 fpostype='$fpostype'
21037 freetype='$freetype'
21040 full_csh='$full_csh'
21041 full_sed='$full_sed'
21042 gccansipedantic='$gccansipedantic'
21043 gccosandvers='$gccosandvers'
21044 gccversion='$gccversion'
21045 getgrent_r_proto='$getgrent_r_proto'
21046 getgrgid_r_proto='$getgrgid_r_proto'
21047 getgrnam_r_proto='$getgrnam_r_proto'
21048 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21049 gethostbyname_r_proto='$gethostbyname_r_proto'
21050 gethostent_r_proto='$gethostent_r_proto'
21051 getlogin_r_proto='$getlogin_r_proto'
21052 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21053 getnetbyname_r_proto='$getnetbyname_r_proto'
21054 getnetent_r_proto='$getnetent_r_proto'
21055 getprotobyname_r_proto='$getprotobyname_r_proto'
21056 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21057 getprotoent_r_proto='$getprotoent_r_proto'
21058 getpwent_r_proto='$getpwent_r_proto'
21059 getpwnam_r_proto='$getpwnam_r_proto'
21060 getpwuid_r_proto='$getpwuid_r_proto'
21061 getservbyname_r_proto='$getservbyname_r_proto'
21062 getservbyport_r_proto='$getservbyport_r_proto'
21063 getservent_r_proto='$getservent_r_proto'
21064 getspnam_r_proto='$getspnam_r_proto'
21065 gidformat='$gidformat'
21071 gmtime_r_proto='$gmtime_r_proto'
21072 gnulibc_version='$gnulibc_version'
21074 groupcat='$groupcat'
21075 groupstype='$groupstype'
21078 h_sysfile='$h_sysfile'
21081 html1dir='$html1dir'
21082 html1direxp='$html1direxp'
21083 html3dir='$html3dir'
21084 html3direxp='$html3direxp'
21093 i_arpainet='$i_arpainet'
21094 i_bsdioctl='$i_bsdioctl'
21098 i_dirent='$i_dirent'
21104 i_fp_class='$i_fp_class'
21107 i_ieeefp='$i_ieeefp'
21108 i_inttypes='$i_inttypes'
21109 i_langinfo='$i_langinfo'
21110 i_libutil='$i_libutil'
21111 i_limits='$i_limits'
21112 i_locale='$i_locale'
21113 i_machcthr='$i_machcthr'
21114 i_malloc='$i_malloc'
21116 i_memory='$i_memory'
21117 i_mntent='$i_mntent'
21120 i_neterrno='$i_neterrno'
21121 i_netinettcp='$i_netinettcp'
21125 i_pthread='$i_pthread'
21127 i_rpcsvcdbm='$i_rpcsvcdbm'
21130 i_shadow='$i_shadow'
21132 i_stdarg='$i_stdarg'
21133 i_stddef='$i_stddef'
21134 i_stdlib='$i_stdlib'
21135 i_string='$i_string'
21136 i_sunmath='$i_sunmath'
21137 i_sysaccess='$i_sysaccess'
21138 i_sysdir='$i_sysdir'
21139 i_sysfile='$i_sysfile'
21140 i_sysfilio='$i_sysfilio'
21142 i_sysioctl='$i_sysioctl'
21143 i_syslog='$i_syslog'
21144 i_sysmman='$i_sysmman'
21145 i_sysmode='$i_sysmode'
21146 i_sysmount='$i_sysmount'
21147 i_sysndir='$i_sysndir'
21148 i_sysparam='$i_sysparam'
21149 i_sysresrc='$i_sysresrc'
21150 i_syssecrt='$i_syssecrt'
21151 i_sysselct='$i_sysselct'
21152 i_syssockio='$i_syssockio'
21153 i_sysstat='$i_sysstat'
21154 i_sysstatfs='$i_sysstatfs'
21155 i_sysstatvfs='$i_sysstatvfs'
21156 i_systime='$i_systime'
21157 i_systimek='$i_systimek'
21158 i_systimes='$i_systimes'
21159 i_systypes='$i_systypes'
21160 i_sysuio='$i_sysuio'
21162 i_sysutsname='$i_sysutsname'
21163 i_sysvfs='$i_sysvfs'
21164 i_syswait='$i_syswait'
21165 i_termio='$i_termio'
21166 i_termios='$i_termios'
21168 i_unistd='$i_unistd'
21171 i_values='$i_values'
21172 i_varargs='$i_varargs'
21173 i_varhdr='$i_varhdr'
21175 ignore_versioned_solibs='$ignore_versioned_solibs'
21176 inc_version_list='$inc_version_list'
21177 inc_version_list_init='$inc_version_list_init'
21180 installarchlib='$installarchlib'
21181 installbin='$installbin'
21182 installhtml1dir='$installhtml1dir'
21183 installhtml3dir='$installhtml3dir'
21184 installman1dir='$installman1dir'
21185 installman3dir='$installman3dir'
21186 installprefix='$installprefix'
21187 installprefixexp='$installprefixexp'
21188 installprivlib='$installprivlib'
21189 installscript='$installscript'
21190 installsitearch='$installsitearch'
21191 installsitebin='$installsitebin'
21192 installsitehtml1dir='$installsitehtml1dir'
21193 installsitehtml3dir='$installsitehtml3dir'
21194 installsitelib='$installsitelib'
21195 installsiteman1dir='$installsiteman1dir'
21196 installsiteman3dir='$installsiteman3dir'
21197 installsitescript='$installsitescript'
21198 installstyle='$installstyle'
21199 installusrbinperl='$installusrbinperl'
21200 installvendorarch='$installvendorarch'
21201 installvendorbin='$installvendorbin'
21202 installvendorhtml1dir='$installvendorhtml1dir'
21203 installvendorhtml3dir='$installvendorhtml3dir'
21204 installvendorlib='$installvendorlib'
21205 installvendorman1dir='$installvendorman1dir'
21206 installvendorman3dir='$installvendorman3dir'
21207 installvendorscript='$installvendorscript'
21209 issymlink='$issymlink'
21210 ivdformat='$ivdformat'
21213 known_extensions='$known_extensions'
21216 lddlflags='$lddlflags'
21218 ldflags_uselargefiles='$ldflags_uselargefiles'
21219 ldlibpthname='$ldlibpthname'
21226 libsdirs='$libsdirs'
21227 libsfiles='$libsfiles'
21228 libsfound='$libsfound'
21229 libspath='$libspath'
21230 libswanted='$libswanted'
21231 libswanted_uselargefiles='$libswanted_uselargefiles'
21237 localtime_r_proto='$localtime_r_proto'
21238 locincpth='$locincpth'
21239 loclibpth='$loclibpth'
21240 longdblsize='$longdblsize'
21241 longlongsize='$longlongsize'
21242 longsize='$longsize'
21246 lseeksize='$lseeksize'
21247 lseektype='$lseektype'
21251 make_set_make='$make_set_make'
21252 mallocobj='$mallocobj'
21253 mallocsrc='$mallocsrc'
21254 malloctype='$malloctype'
21256 man1direxp='$man1direxp'
21259 man3direxp='$man3direxp'
21261 mips_type='$mips_type'
21262 mistrustnm='$mistrustnm'
21264 mmaptype='$mmaptype'
21265 modetype='$modetype'
21267 multiarch='$multiarch'
21269 myarchname='$myarchname'
21270 mydomain='$mydomain'
21271 myhostname='$myhostname'
21274 need_va_copy='$need_va_copy'
21275 netdb_hlen_type='$netdb_hlen_type'
21276 netdb_host_type='$netdb_host_type'
21277 netdb_name_type='$netdb_name_type'
21278 netdb_net_type='$netdb_net_type'
21281 nm_so_opt='$nm_so_opt'
21282 nonxs_ext='$nonxs_ext'
21284 nvEUformat='$nvEUformat'
21285 nvFUformat='$nvFUformat'
21286 nvGUformat='$nvGUformat'
21287 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21288 nveformat='$nveformat'
21289 nvfformat='$nvfformat'
21290 nvgformat='$nvgformat'
21293 o_nonblock='$o_nonblock'
21295 old_pthread_create_joinable='$old_pthread_create_joinable'
21296 optimize='$optimize'
21297 orderlib='$orderlib'
21300 otherlibdirs='$otherlibdirs'
21304 patchlevel='$patchlevel'
21305 path_sep='$path_sep'
21308 perl_patchlevel='$perl_patchlevel'
21309 perladmin='$perladmin'
21310 perllibs='$perllibs'
21311 perlpath='$perlpath'
21313 phostname='$phostname'
21319 prefixexp='$prefixexp'
21321 privlibexp='$privlibexp'
21322 procselfexe='$procselfexe'
21323 prototype='$prototype'
21325 quadkind='$quadkind'
21326 quadtype='$quadtype'
21327 randbits='$randbits'
21328 randfunc='$randfunc'
21329 random_r_proto='$random_r_proto'
21330 randseedtype='$randseedtype'
21332 rd_nodata='$rd_nodata'
21333 readdir64_r_proto='$readdir64_r_proto'
21334 readdir_r_proto='$readdir_r_proto'
21335 revision='$revision'
21340 sPRIEUldbl='$sPRIEUldbl'
21341 sPRIFUldbl='$sPRIFUldbl'
21342 sPRIGUldbl='$sPRIGUldbl'
21343 sPRIXU64='$sPRIXU64'
21345 sPRIeldbl='$sPRIeldbl'
21346 sPRIfldbl='$sPRIfldbl'
21347 sPRIgldbl='$sPRIgldbl'
21352 sSCNfldbl='$sSCNfldbl'
21353 sched_yield='$sched_yield'
21354 scriptdir='$scriptdir'
21355 scriptdirexp='$scriptdirexp'
21357 seedfunc='$seedfunc'
21358 selectminbits='$selectminbits'
21359 selecttype='$selecttype'
21360 sendmail='$sendmail'
21361 setgrent_r_proto='$setgrent_r_proto'
21362 sethostent_r_proto='$sethostent_r_proto'
21363 setlocale_r_proto='$setlocale_r_proto'
21364 setnetent_r_proto='$setnetent_r_proto'
21365 setprotoent_r_proto='$setprotoent_r_proto'
21366 setpwent_r_proto='$setpwent_r_proto'
21367 setservent_r_proto='$setservent_r_proto'
21370 sharpbang='$sharpbang'
21371 shmattype='$shmattype'
21372 shortsize='$shortsize'
21375 sig_count='$sig_count'
21376 sig_name='$sig_name'
21377 sig_name_init='$sig_name_init'
21379 sig_num_init='$sig_num_init'
21380 sig_size='$sig_size'
21381 signal_t='$signal_t'
21382 sitearch='$sitearch'
21383 sitearchexp='$sitearchexp'
21385 sitebinexp='$sitebinexp'
21386 sitehtml1dir='$sitehtml1dir'
21387 sitehtml1direxp='$sitehtml1direxp'
21388 sitehtml3dir='$sitehtml3dir'
21389 sitehtml3direxp='$sitehtml3direxp'
21391 sitelib_stem='$sitelib_stem'
21392 sitelibexp='$sitelibexp'
21393 siteman1dir='$siteman1dir'
21394 siteman1direxp='$siteman1direxp'
21395 siteman3dir='$siteman3dir'
21396 siteman3direxp='$siteman3direxp'
21397 siteprefix='$siteprefix'
21398 siteprefixexp='$siteprefixexp'
21399 sitescript='$sitescript'
21400 sitescriptexp='$sitescriptexp'
21401 sizesize='$sizesize'
21402 sizetype='$sizetype'
21406 sockethdr='$sockethdr'
21407 socketlib='$socketlib'
21408 socksizetype='$socksizetype'
21410 spackage='$spackage'
21411 spitshell='$spitshell'
21412 srand48_r_proto='$srand48_r_proto'
21413 srandom_r_proto='$srandom_r_proto'
21415 ssizetype='$ssizetype'
21416 startperl='$startperl'
21418 static_ext='$static_ext'
21420 stdio_base='$stdio_base'
21421 stdio_bufsiz='$stdio_bufsiz'
21422 stdio_cnt='$stdio_cnt'
21423 stdio_filbuf='$stdio_filbuf'
21424 stdio_ptr='$stdio_ptr'
21425 stdio_stream_array='$stdio_stream_array'
21426 strerror_r_proto='$strerror_r_proto'
21429 subversion='$subversion'
21433 targetarch='$targetarch'
21437 timeincl='$timeincl'
21438 timetype='$timetype'
21439 tmpnam_r_proto='$tmpnam_r_proto'
21445 ttyname_r_proto='$ttyname_r_proto'
21454 uidformat='$uidformat'
21460 uquadtype='$uquadtype'
21461 use5005threads='$use5005threads'
21462 use64bitall='$use64bitall'
21463 use64bitint='$use64bitint'
21464 usecrosscompile='$usecrosscompile'
21466 usefaststdio='$usefaststdio'
21467 useithreads='$useithreads'
21468 uselargefiles='$uselargefiles'
21469 uselongdouble='$uselongdouble'
21470 usemallocwrap='$usemallocwrap'
21471 usemorebits='$usemorebits'
21472 usemultiplicity='$usemultiplicity'
21473 usemymalloc='$usemymalloc'
21475 useopcode='$useopcode'
21476 useperlio='$useperlio'
21477 useposix='$useposix'
21478 usereentrant='$usereentrant'
21479 userelocatableinc='$userelocatableinc'
21481 useshrplib='$useshrplib'
21482 usesitecustomize='$usesitecustomize'
21483 usesocks='$usesocks'
21484 usethreads='$usethreads'
21485 usevendorprefix='$usevendorprefix'
21486 usevfork='$usevfork'
21489 uvXUformat='$uvXUformat'
21490 uvoformat='$uvoformat'
21493 uvuformat='$uvuformat'
21494 uvxformat='$uvxformat'
21495 vendorarch='$vendorarch'
21496 vendorarchexp='$vendorarchexp'
21497 vendorbin='$vendorbin'
21498 vendorbinexp='$vendorbinexp'
21499 vendorhtml1dir='$vendorhtml1dir'
21500 vendorhtml1direxp='$vendorhtml1direxp'
21501 vendorhtml3dir='$vendorhtml3dir'
21502 vendorhtml3direxp='$vendorhtml3direxp'
21503 vendorlib='$vendorlib'
21504 vendorlib_stem='$vendorlib_stem'
21505 vendorlibexp='$vendorlibexp'
21506 vendorman1dir='$vendorman1dir'
21507 vendorman1direxp='$vendorman1direxp'
21508 vendorman3dir='$vendorman3dir'
21509 vendorman3direxp='$vendorman3direxp'
21510 vendorprefix='$vendorprefix'
21511 vendorprefixexp='$vendorprefixexp'
21512 vendorscript='$vendorscript'
21513 vendorscriptexp='$vendorscriptexp'
21515 version_patchlevel_string='$version_patchlevel_string'
21516 versiononly='$versiononly'
21518 voidflags='$voidflags'
21521 yaccflags='$yaccflags'
21526 : Add in command line options if available
21527 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21529 : add special variables
21530 $test -f $src/patchlevel.h && \
21531 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
21532 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
21533 echo "PERL_CONFIG_SH=true" >>config.sh
21535 : propagate old symbols
21536 if $test -f UU/config.sh; then
21537 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
21538 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
21539 $sort | $uniq -u >UU/oldsyms
21540 set X `cat UU/oldsyms`
21546 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
21548 echo "# Variables propagated from previous config.sh file." >>config.sh
21549 for sym in `cat UU/oldsyms`; do
21550 echo " Propagating $hint variable "'$'"$sym..."
21551 eval 'tmp="$'"${sym}"'"'
21553 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
21559 : Finish up by extracting the .SH files
21563 echo "Extraction done."
21573 If you'd like to make any changes to the config.sh file before I begin
21574 to configure things, do it as a shell escape now (e.g. !vi config.sh).
21577 rp="Press return or use a shell escape to edit config.sh:"
21582 *) : in case they cannot read
21583 sh 1>&4 -c "$ans";;
21588 : if this fails, just run all the .SH files by hand
21597 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
21604 Now you need to generate make dependencies by running "$make depend".
21605 You might prefer to run it in background: "$make depend > makedepend.out &"
21606 It can take a while, so you might not want to run it right now.
21611 rp="Run $make depend now?"
21615 $make depend && echo "Now you must run '$make'."
21618 echo "You must run '$make depend' then '$make'."
21621 elif test -f [Mm]akefile; then
21623 echo "Now you must run a $make."
21625 echo "Configure done."
21628 if $test -f Policy.sh; then
21631 If you compile $package on a different machine or from a different object
21632 directory, copy the Policy.sh file from this object directory to the
21633 new one before you run Configure -- this will help you with most of
21634 the policy defaults.
21638 if $test -f config.msg; then
21639 echo "Hmm. I also noted the following information while running:"
21641 $cat config.msg >&4
21644 $rm -f kit*isdone ark*isdone