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 Sun Apr 10 19:26:39 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=''
698 d_stdio_ptr_lval_nochange_cnt=''
699 d_stdio_ptr_lval_sets_cnt=''
902 inc_version_list_init=''
921 ignore_versioned_solibs=''
981 d_perl_otherlibdirs=''
995 version_patchlevel_string=''
1010 nv_preserves_uv_bits=''
1081 installsitehtml1dir=''
1084 installsitehtml3dir=''
1091 installsiteman1dir=''
1094 installsiteman3dir=''
1099 installsitescript=''
1114 d_stdio_stream_array=''
1115 stdio_stream_array=''
1126 ccflags_uselargefiles=''
1127 ldflags_uselargefiles=''
1128 libswanted_uselargefiles=''
1138 userelocatableinc=''
1149 installvendorarch=''
1156 installvendorhtml1dir=''
1158 vendorhtml1direxp=''
1159 installvendorhtml3dir=''
1161 vendorhtml3direxp=''
1167 installvendorman1dir=''
1170 installvendorman3dir=''
1177 installvendorscript=''
1189 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1192 : We must find out about Eunice early
1194 if test -f /etc/unixtovms; then
1195 eunicefix=/etc/unixtovms
1197 if test -f /etc/unixtovms.exe; then
1198 eunicefix=/etc/unixtovms.exe
1201 : Set executable suffix now -- needed before hints available
1202 if test -f "/libs/version.library"; then
1205 elif test -f "/system/gnu_library/bin/ar.pm"; then
1208 elif test -n "$DJGPP"; then
1211 elif test -d c:/. -o -n "$is_os2" ; then
1220 : set useposix=false in your hint file to disable the POSIX extension.
1222 : set useopcode=false in your hint file to disable the Opcode extension.
1224 : Trailing extension. Override this in a hint file, if needed.
1225 : Extra object files, if any, needed on this platform.
1228 : Possible local include directories to search.
1229 : Set locincpth to "" in a hint file to defeat local include searches.
1230 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1231 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1233 : no include file wanted by default
1238 : change the next line if compiling for Xenix/286 on Xenix/386
1239 xlibpth='/usr/lib/386 /lib/386'
1240 : Possible local library directories to search.
1241 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1242 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1244 : general looking path for locating libraries
1245 glibpth="/lib /usr/lib $xlibpth"
1246 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1247 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1248 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1250 : Private path used by Configure to find libraries. Its value
1251 : is prepended to libpth. This variable takes care of special
1252 : machines, like the mips. Usually, it should be empty.
1255 : default library list
1257 : some systems want to use only the non-versioned libso:s
1258 ignore_versioned_solibs=''
1263 ccflags_uselargefiles=''
1264 ldflags_uselargefiles=''
1265 libswanted_uselargefiles=''
1266 : set usemultiplicity on the Configure command line to enable multiplicity.
1267 : set usesocks on the Configure command line to enable socks.
1268 : set usethreads on the Configure command line to enable threads.
1269 usereentrant='undef'
1270 : full support for void wanted by default
1273 : List of libraries we want.
1274 : If anyone needs extra -lxxx, put those in a hint file.
1275 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1276 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1277 : We probably want to search /usr/shlib before most other libraries.
1278 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1279 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1280 glibpth="/usr/shlib $glibpth"
1281 : Do not use vfork unless overridden by a hint file.
1284 : Find the basic shell for Bourne shell scripts
1288 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1291 if test -f "$xxx"; then
1294 : Build up a list and do a single loop so we can 'break' out.
1295 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1296 for xxx in sh bash ksh pdksh ash; do
1298 try="$try ${p}/${xxx}"
1302 if test -f "$xxx"; then
1305 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1308 elif test -f "$xxx.exe"; then
1319 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1321 Usually it's in /bin/sh. How did you even get this far?
1322 Please contact me (Perl Maintainers) at perlbug@perl.org and
1323 we'll try to straighten this all out.
1329 : see if sh knows # comments
1330 if `$sh -c '#' >/dev/null 2>&1`; then
1334 test -f $xcat$_exe || xcat=/usr/bin/cat
1335 if test ! -f $xcat$_exe; then
1336 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1337 if test -f $p/cat$_exe; then
1342 if test ! -f $xcat$_exe; then
1343 echo "Can't find cat anywhere!"
1347 echo "#!$xcat" >sharp
1351 if test -s today; then
1354 echo "#! $xcat" > sharp
1358 if test -s today; then
1366 echo "Your $sh doesn't grok # comments--I will strip them later on."
1369 echo "exec grep -v '^[ ]*#'" >spitshell
1371 $eunicefix spitshell
1372 spitshell=`pwd`/spitshell
1374 echo "I presume that if # doesn't work, #! won't work either!"
1379 : figure out how to guarantee sh startup
1381 '') startsh=${sharpbang}${sh} ;;
1393 : echo "Yup, it does."
1395 echo "Hmm... '$startsh' does not guarantee sh startup..."
1396 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1401 : Save command line options in file UU/cmdline.opt for later use in
1402 : generating config.sh.
1403 cat > cmdline.opt <<EOSH
1404 # Configure command line arguments.
1413 cat >>cmdline.opt <<EOSH
1414 config_arg$argn='$arg'
1416 # Extreme backslashitis: replace each ' by '"'"'
1417 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1420 arg_exp=`cat cmdl.opt`
1421 args_exp="$args_exp$args_sep'$arg_exp'"
1422 argn=`expr $argn + 1`
1425 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1426 # used by ./hints/os2.sh
1429 : produce awk script to parse command line options
1430 cat >options.awk <<'EOF'
1432 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1434 len = length(optstr);
1435 for (i = 1; i <= len; i++) {
1436 c = substr(optstr, i, 1);
1437 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1448 if (substr(str, 1, 1) != "-") {
1449 printf("'%s'\n", str);
1453 for (i = 2; i <= len; i++) {
1454 c = substr(str, i, 1);
1456 printf("-%s\n", substr(str, i));
1462 printf("'%s'\n", substr(str, i + 1));
1475 : process the command line options
1476 set X `for arg in "$@"; do echo "X$arg"; done |
1477 sed -e s/X// | awk -f options.awk`
1482 : set up default values
1492 rm -f optdef.sh posthint.sh
1493 cat >optdef.sh <<EOS
1499 while test $# -gt 0; do
1501 -d) shift; fastread=yes;;
1502 -e) shift; alldone=cont;;
1506 if test -r "$1"; then
1509 echo "$me: cannot read config file $1." >&2
1514 -h) shift; error=true;;
1515 -r) shift; reuseval=true;;
1516 -s) shift; silent=true; realsilent=true;;
1517 -E) shift; alldone=exit;;
1518 -K) shift; knowitall=true;;
1519 -O) shift; override=true;;
1520 -S) shift; silent=true; extractsh=true;;
1525 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1526 echo "$me: ignoring -D $1" >&2
1529 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1530 *) echo "$1='define'" >> optdef.sh;;
1537 *=) echo "$1" >> optdef.sh;;
1539 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1540 echo "$me: ignoring -U $1" >&2
1542 *) echo "$1='undef'" >> optdef.sh;;
1553 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1557 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1558 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1564 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1565 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1566 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1567 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1568 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1569 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1575 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1577 echo "$yyy=''" >> posthint.sh ;;
1582 echo "$yyy='$zzz'" >> posthint.sh ;;
1584 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1586 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1591 echo "$yyy=$zzz" >> posthint.sh ;;
1592 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1596 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1599 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1607 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1608 [-U symbol] [-U symbol=] [-A command:symbol...]
1609 -d : use defaults for all answers.
1610 -e : go on without questioning past the production of config.sh.
1611 -f : specify an alternate default configuration file.
1612 -h : print this help message and exit (with an error status).
1613 -r : reuse C symbols value if possible (skips costly nm extraction).
1614 -s : silent mode, only echoes questions and essential information.
1615 -D : define symbol to have some value:
1616 -D symbol symbol gets the value 'define'
1617 -D symbol=value symbol gets the value 'value'
1618 -E : stop at the end of questions, after having produced config.sh.
1619 -K : do not use unless you know what you are doing.
1620 -O : let -D and -U override definitions from loaded configuration file.
1621 -S : perform variable substitutions on all .SH files (can mix with -f)
1622 -U : undefine symbol:
1623 -U symbol symbol gets the value 'undef'
1624 -U symbol= symbol gets completely empty
1625 -A : manipulate symbol after the platform specific hints have been applied:
1626 -A symbol=value append " "value to symbol
1627 -A append:symbol=value append value to symbol
1628 -A define:symbol=value define symbol to have value
1629 -A clear:symbol define symbol to be ''
1630 -A define:symbol define symbol to be 'define'
1631 -A eval:symbol=value define symbol to be eval of value
1632 -A prepend:symbol=value prepend value to symbol
1633 -A undef:symbol define symbol to be 'undef'
1634 -A undef:symbol= define symbol to be ''
1635 -V : print version number and exit (with a zero status).
1642 case "$fastread$alldone" in
1645 case "$extractsh" in
1648 if test ! -t 0; then
1649 echo "Say 'sh Configure', not 'sh <Configure'"
1659 true) exec 1>/dev/null;;
1662 : run the defines and the undefines, if any, but leave the file out there...
1665 : create the posthint manipulation script and leave the file out there...
1670 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1671 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1672 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1673 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1674 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1677 : Some greps do not return status, grrr.
1678 echo "grimblepritz" >grimble
1679 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1681 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1687 : the following should work in any shell
1691 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1692 cat >contains <<'EOSS'
1693 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1698 : Find the path to the source tree
1701 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1705 *) src=`cd ../$src && pwd` ;;
1718 if test -f $rsrc/Configure && \
1719 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1721 : found it, so we are ok.
1724 for src in . .. ../.. ../../.. ../../../..; do
1725 if test -f ../$src/Configure && \
1726 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1737 Sorry, I can't seem to locate the source dir for $package. Please start
1738 Configure with an explicit path -- i.e. /some/path/Configure.
1746 echo "Sources for $package found in \"$src\"." >&4
1750 : script used to extract .SH files with variable substitutions
1751 cat >extract <<'EOS'
1753 echo "Doing variable substitutions on .SH files..."
1754 if test -f MANIFEST; then
1755 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1757 echo "(Looking for .SH files under the source directory.)"
1758 set x `(cd "$src"; find . -name "*.SH" -print)`
1762 0) set x `(cd "$src"; echo *.SH)`; shift;;
1764 if test ! -f "$src/$1"; then
1770 while test $name; do
1771 if test ! -d "$name"; then
1772 create="$name $create";
1773 name=`echo $name | sed -e "s|^[^/]*$||"`;
1774 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1779 for file in $create; do
1788 dir=`expr X$file : 'X\(.*\)/'`
1789 file=`expr X$file : 'X.*/\(.*\)'`
1790 (cd "$dir" && . ./$file)
1800 dir=`expr X$file : 'X\(.*\)/'`
1801 file=`expr X$file : 'X.*/\(.*\)'`
1802 (set x $dir; shift; eval $mkdir_p)
1803 sh <"$src/$dir/$file"
1812 if test -f "$src/config_h.SH"; then
1813 if test ! -f config.h; then
1814 : oops, they left it out of MANIFEST, probably, so do it anyway.
1815 . "$src/config_h.SH"
1820 : extract files and exit if asked to do so
1821 case "$extractsh" in
1823 case "$realsilent" in
1827 case "$config_sh" in
1828 '') config_sh='config.sh';;
1831 echo "Fetching answers from $config_sh..."
1834 test "$override" && . ./optdef.sh
1838 echo "Extraction done."
1843 : Eunice requires " " instead of "", can you believe it
1846 echo "Beginning of configuration questions for $package."
1848 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1850 : first determine how to suppress newline on echo command
1852 echo "Checking echo to see how to suppress newlines..."
1853 (echo "hi there\c" ; echo " ") >.echotmp
1854 if $contains c .echotmp >/dev/null 2>&1 ; then
1865 echo $n "The star should be here-->$c"
1869 : Now test for existence of everything in MANIFEST
1871 if test -f "$rsrc/MANIFEST"; then
1872 echo "First let's make sure your kit is complete. Checking..." >&4
1873 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1876 for filelist in x??; do
1877 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1879 if test -s missing; then
1883 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1885 You have the option of continuing the configuration process, despite the
1886 distinct possibility that your kit is damaged, by typing 'y'es. If you
1887 do, don't blame me if something goes wrong. I advise you to type 'n'o
1888 and contact the author (perlbug@perl.org).
1891 echo $n "Continue? [n] $c" >&4
1895 echo "Continuing..." >&4
1899 echo "ABORTING..." >&4
1904 echo "Looks good..."
1907 echo "There is no MANIFEST file. I hope your kit is complete !"
1912 : Find the appropriate value for a newline for tr
1913 if test -n "$DJGPP"; then
1916 if test X"$trnl" = X; then
1917 case "`echo foo|tr '\n' x 2>/dev/null`" in
1921 if test X"$trnl" = X; then
1922 case "`echo foo|tr '\012' x 2>/dev/null`" in
1923 foox) trnl='\012' ;;
1926 if test X"$trnl" = X; then
1927 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1928 fooxy) trnl='\n\r' ;;
1931 if test X"$trnl" = X; then
1934 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1940 : compute the number of columns on the terminal for proper question formatting
1945 : set up the echo used in my read
1946 myecho="case \"\$xxxm\" in
1947 '') echo $n \"\$rp $c\" >&4;;
1949 '') echo $n \"[\$xxxm] $c\";;
1951 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1953 echo $n \"[\$xxxm] $c\" >&4
1955 echo $n \"\$rp [\$xxxm] $c\" >&4
1961 : now set up to do reads with possible shell escape and default assignment
1967 case "\$fastread" in
1968 yes) case "\$dflt" in
1971 case "\$silent-\$rp" in
1976 *) case "\$silent" in
1977 true) case "\$rp" in
1982 while expr "X\$ans" : "X!" >/dev/null; do
1986 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1994 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2003 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2008 echo "(OK, I'll run with -d after this question.)" >&4
2011 echo "*** Sorry, \$1 not supported yet." >&4
2021 echo "*** Substitution done -- please confirm."
2023 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2028 echo "*** Error -- try again."
2035 case "\$ans\$xxxm\$nostick" in
2047 : create .config dir to save info across Configure sessions
2048 test -d ../.config || mkdir ../.config
2049 cat >../.config/README <<EOF
2050 This directory created by Configure to save information that should
2051 persist across sessions for $package.
2053 You may safely delete it if you wish.
2056 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2058 $define|true|[yY]*) ;;
2059 *) case "$xversion" in
2062 *** WHOA THERE!!! ***
2064 This is an UNSTABLE DEVELOPMENT release.
2065 The version of this $package distribution is $xversion, that is, odd,
2066 (as opposed to even) and that signifies a development release.
2067 If you want a maintenance release, you want an even-numbered version.
2069 Do ***NOT*** install this into production use.
2070 Data corruption and crashes are possible.
2072 It is most seriously suggested that you do not continue any further
2073 unless you want to help in developing and debugging Perl.
2075 If you *still* want to build perl, you can answer 'y' now,
2076 or pass -Dusedevel to Configure.
2079 rp='Do you really want to continue?'
2083 [yY]) echo >&4 "Okay, continuing."
2084 usedevel="$define" ;;
2085 *) echo >&4 "Okay, bye."
2095 case "$versiononly" in
2096 '') versiononly="$define" ;;
2098 case "$installusrbinperl" in
2099 '') installusrbinperl="$undef" ;;
2104 : general instructions
2107 user=`(logname) 2>/dev/null`
2109 '') user=`whoami 2>&1`;;
2111 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2114 rp='Would you like to see the instructions?'
2125 This installation shell script will examine your system and ask you questions
2126 to determine how the perl5 package should be installed. If you get
2127 stuck on a question, you may use a ! shell escape to start a subshell or
2128 execute a command. Many of the questions will have default answers in square
2129 brackets; typing carriage return will give you the default.
2131 On some of the questions which ask for file or directory names you are allowed
2132 to use the ~name construct to specify the login directory belonging to "name",
2133 even if you don't have a shell which knows about that. Questions where this is
2134 allowed will be marked "(~name ok)".
2138 dflt='Type carriage return to continue'
2142 The prompter used in this script allows you to use shell variables and
2143 backticks in your answers. You may use $1, $2, etc... to refer to the words
2144 in the default answer, as if the default line was a set of arguments given to a
2145 script shell. This means you may also use $* to repeat the whole default line,
2146 so you do not have to re-type everything to add something to the default.
2148 Everytime there is a substitution, you will have to confirm. If there is an
2149 error (e.g. an unmatched backtick), the default answer will remain unchanged
2150 and you will be prompted again.
2152 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2153 the questions and use the computed defaults (or the previous answers if there
2154 was already a config.sh file). Type 'Configure -h' for a list of options.
2155 You may also start interactively and then answer '& -d' at any prompt to turn
2156 on the non-interactive behaviour for the remainder of the execution.
2162 Much effort has been expended to ensure that this shell script will run on any
2163 Unix system. If despite that it blows up on yours, your best bet is to edit
2164 Configure and run it again. If you can't run Configure for some reason,
2165 you'll have to generate a config.sh file by hand. Whatever problems you
2166 have, let me (perlbug@perl.org) know how I blew it.
2168 This installation script affects things in two ways:
2170 1) it may do direct variable substitutions on some of the files included
2172 2) it builds a config.h file for inclusion in C programs. You may edit
2173 any of these files as the need arises after running this script.
2175 If you make a mistake on a question, there is no easy way to back up to it
2176 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2177 files. Configure will offer to let you do this before it runs the SH files.
2180 dflt='Type carriage return to continue'
2182 case "$firsttime" in
2183 true) echo $user >>../.config/instruct;;
2187 : find out where common programs are
2189 echo "Locating common programs..." >&4
2202 if test -d \$dir/\$thing; then
2208 for thisthing in \$dir/\$thing; do
2209 : just loop through to pick last item
2211 if test -f \$thisthing; then
2214 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2217 elif test -f \$dir/\$thing.exe; then
2218 if test -n "$DJGPP"; then
2219 echo \$dir/\$thing.exe
2220 elif test "$eunicefix" != ":"; then
2221 : on Eunice apparently
2275 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2276 pth="$pth /lib /usr/lib"
2277 for file in $loclist; do
2281 if test -f "$xxx"; then
2284 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2285 xxx=`./loc $file $file $pth`
2288 '') xxx=`./loc $file $file $pth`;;
2289 *) xxx=`./loc $xxx $xxx $pth`;;
2291 eval $file=$xxx$_exe
2295 echo $file is in $xxx.
2298 echo $file is in $xxx.
2301 echo "I don't know where '$file' is, and my life depends on it." >&4
2302 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2308 echo "Don't worry if any of the following aren't found..."
2310 for file in $trylist; do
2314 if test -f "$xxx"; then
2317 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2318 xxx=`./loc $file $file $pth`
2321 '') xxx=`./loc $file $file $pth`;;
2322 *) xxx=`./loc $xxx $xxx $pth`;;
2324 eval $file=$xxx$_exe
2328 echo $file is in $xxx.
2331 echo $file is in $xxx.
2334 echo "I don't see $file out there, $say."
2341 echo "Substituting grep for egrep."
2348 echo "Substituting cp for ln."
2357 echo "I can't find make or gmake, and my life depends on it." >&4
2358 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2366 *) # We can't have osname yet.
2367 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2368 # Assume that gmake, if found, is definitely GNU make
2369 # and prefer it over the system make.
2370 echo "Substituting gmake for make."
2378 echo "Hopefully test is built into your sh."
2381 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2382 echo "Using the test built into your sh."
2390 echo "Hopefully echo is built into your sh."
2395 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2396 $echo $n "hi there$c" >foo1
2397 echo $n "hi there$c" >foo2
2398 if cmp foo1 foo2 >/dev/null 2>&1; then
2399 echo "They are compatible. In fact, they may be identical."
2406 They are not compatible! You are probably running ksh on a non-USG system.
2407 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2408 have echo built in and we may have to run some Bourne shell scripts. That
2409 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2412 $echo $n "The star should be here-->$c"
2422 cat <<'EOSC' >>trygcc
2427 int main(int argc, char *argv[]) {
2431 if $cc -o try $ccflags $ldflags try.c; then
2434 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2440 case "`$cc -v -c try.c 2>&1`" in
2443 if $test X"$trygcc" = Xyes; then
2444 if gcc -o try -c try.c; then
2446 echo "You seem to have a working gcc, though." >&4
2447 rp="Would you like to use it?"
2449 if $test -f myread; then
2452 if $test -f UU/myread; then
2455 echo "Cannot find myread, sorry. Aborting." >&2
2460 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2461 if $test -f usethreads.cbu; then
2464 *** However, any setting of the C compiler flags (e.g. for thread support)
2465 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2466 *** (together with e.g. -Dusethreads).
2482 cat <<'EOSC' >>checkcc
2487 int main(int argc, char *argv[]) {
2491 if $cc -o try $ccflags $ldflags try.c; then
2494 if $test X"$despair" = Xyes; then
2495 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2498 You need to find a working C compiler.
2499 Either (purchase and) install the C compiler supplied by your OS vendor,
2500 or for a free C compiler try http://gcc.gnu.org/
2501 I cannot continue any further, aborting.
2510 : determine whether symbolic links are supported
2513 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2514 echo "Symbolic links are supported." >&4
2517 echo "Symbolic links are NOT supported." >&4
2522 : determine whether symbolic links are supported
2526 echo "Checking how to test for symbolic links..." >&4
2528 if $test "X$issymlink" = X; then
2530 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2531 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2533 if test $? = 0; then
2536 echo "Your builtin 'test -h' may be broken." >&4
2539 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2542 if test -f "$p/$test"; then
2551 echo "Trying external '$test -h'." >&4
2552 issymlink="$test -h"
2553 if $test ! -h sym >/dev/null 2>&1; then
2554 echo "External '$test -h' is broken, too." >&4
2562 if $test "X$issymlink" = X; then
2563 if $test -L sym 2>/dev/null; then
2564 issymlink="$test -L"
2565 echo "The builtin '$test -L' worked." >&4
2568 if $test "X$issymlink" != X; then
2569 echo "You can test for symbolic links with '$issymlink'." >&4
2571 echo "I do not know how you can test for symbolic links." >&4
2575 *) echo "No symbolic links, so not testing for their testing..." >&4
2581 case "$mksymlinks" in
2584 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2587 *) case "$lns:$issymlink" in
2588 *"ln"*" -s:"*"test -"?)
2589 echo "Creating the symbolic links..." >&4
2590 echo "(First creating the subdirectories...)" >&4
2592 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2594 test -z "$directory" && break
2598 if test ! -d t/base; then
2599 echo "Failed to create the subdirectories. Aborting." >&4
2602 echo "(Then creating the symlinks...)" >&4
2603 awk '{print $1}' $src/MANIFEST | while true; do
2605 test -z "$filename" && break
2606 if test -f $filename; then
2607 if $issymlink $filename; then
2611 if test -f $filename; then
2612 echo "$filename already exists, not symlinking."
2614 ln -s $src/$filename $filename
2618 if test ! -f t/base/lex.t; then
2619 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2624 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2633 case "$usecrosscompile" in
2635 $echo "Cross-compiling..."
2638 *-*-gcc) # A cross-compiling gcc, probably.
2639 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2641 # leave out ld, choosing it is more complex
2643 ranlib=$targetarch-ranlib
2644 $echo 'extern int foo;' > try.c
2645 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2647 if $test $# -gt 0; then
2649 incpth="`$echo $incpth|$sed 's/^ //'`"
2650 echo "Guessing incpth '$incpth'." >&4
2652 j="`$echo $i|$sed 's,/include$,/lib,'`"
2653 if $test -d $j; then
2657 libpth="`$echo $libpth|$sed 's/^ //'`"
2658 echo "Guessing libpth '$libpth'." >&4
2663 case "$targetarch" in
2664 '') echo "Targetarch not defined." >&4; croak=y ;;
2665 *) echo "Using targetarch $targetarch." >&4 ;;
2668 '') echo "Incpth not defined." >&4; croak=y ;;
2669 *) echo "Using incpth '$incpth'." >&4 ;;
2672 '') echo "Libpth not defined." >&4; croak=y ;;
2673 *) echo "Using libpth '$libpth'." >&4 ;;
2676 '') for i in $incpth; do
2677 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2679 echo "Guessing usrinc $usrinc." >&4
2684 '') echo "Usrinc not defined." >&4; croak=y ;;
2687 *) echo "Using usrinc $usrinc." >&4 ;;
2689 case "$targethost" in
2690 '') echo "Targethost not defined." >&4; croak=y ;;
2691 *) echo "Using targethost $targethost." >&4
2696 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2699 /*) run=$src/Cross/run
2700 targetmkdir=$src/Cross/mkdir
2702 from=$src/Cross/from
2704 *) pwd=`$test -f ../Configure & cd ..; pwd`
2706 targetmkdir=$pwd/Cross/mkdir
2708 from=$pwd/Cross/from
2711 case "$targetrun" in
2712 '') targetrun=ssh ;;
2717 case "$targetfrom" in
2718 '') targetfrom=scp ;;
2722 from=$from-$targetfrom
2723 case "$targetdir" in
2725 echo "Guessing targetdir $targetdir." >&4
2728 case "$targetuser" in
2730 echo "Guessing targetuser $targetuser." >&4
2733 case "$targetfrom" in
2737 case "$targetrun" in
2749 '') cwd=$targetdir ;;
2753 if $test ! -f \$exe.xok; then
2757 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2760 *) echo "Unknown targetrun '$targetrun'" >&4
2764 case "$targetmkdir" in
2766 cat >$targetmkdir <<EOF
2768 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2770 $chmod a+rx $targetmkdir
2772 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2784 $targetmkdir \`dirname \$f\`
2785 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2788 $targetmkdir $targetdir/\`dirname \$f\`
2789 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2802 $mkdir -p $targetdir/\`dirname \$f\`
2803 $cp \$f $targetdir/\$f || exit 1
2806 $targetmkdir $targetdir/\`dirname \$f\`
2807 $cp \$f $targetdir/\$f || exit 1
2814 *) echo "Unknown targetto '$targetto'" >&4
2818 case "$targetfrom" in
2825 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2830 cp) cat >$from <<EOF
2835 cp $targetdir/\$f . || exit 1
2840 *) echo "Unknown targetfrom '$targetfrom'" >&4
2844 if $test ! -f $run; then
2845 echo "Target 'run' script '$run' not found." >&4
2849 if $test ! -f $to; then
2850 echo "Target 'to' script '$to' not found." >&4
2854 if $test ! -f $from; then
2855 echo "Target 'from' script '$from' not found." >&4
2859 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2863 Using '$run' for remote execution,
2864 and '$from' and '$to'
2865 for remote file transfer.
2871 usecrosscompile='undef'
2876 : see whether [:lower:] and [:upper:] are supported character classes
2878 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2880 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2884 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2885 # (0xd9 and 0xe2), therefore that is a nice testing point.
2886 if test "X$up" = X -o "X$low" = X; then
2887 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2893 if test "X$up" = X -o "X$low" = X; then
2894 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2900 if test "X$up" = X -o "X$low" = X; then
2901 case "`echo RS | od -x 2>/dev/null`" in
2903 echo "Hey, this might be EBCDIC." >&4
2904 if test "X$up" = X -o "X$low" = X; then
2905 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2906 rs) up='[A-IJ-RS-Z]'
2911 if test "X$up" = X -o "X$low" = X; then
2912 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2922 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2924 echo "Using $up and $low to convert case." >&4
2927 echo "I don't know how to translate letters from upper to lower case." >&4
2928 echo "Your tr is not acting any way I know of." >&4
2932 : set up the translation script tr, must be called with ./tr of course
2936 '[A-Z][a-z]') exec $tr '$up' '$low';;
2937 '[a-z][A-Z]') exec $tr '$low' '$up';;
2944 : Try to determine whether config.sh was made on this system
2945 case "$config_sh" in
2947 myuname=`$uname -a 2>/dev/null`
2948 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2949 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2950 # because the A-Z/a-z are not consecutive.
2951 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2952 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2953 newmyuname="$myuname"
2955 case "$knowitall" in
2957 if test -f ../config.sh; then
2958 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2959 eval "`grep myuname= ../config.sh`"
2961 if test "X$myuname" = "X$newmyuname"; then
2969 : Get old answers from old config file if Configure was run on the
2970 : same system, otherwise use the hints.
2973 if test -f config.sh; then
2975 rp="I see a config.sh file. Shall I use it to set the defaults?"
2978 n*|N*) echo "OK, I'll ignore it."
2979 mv config.sh config.sh.old
2980 myuname="$newmyuname"
2982 *) echo "Fetching default answers from your old config.sh file..." >&4
2990 : Older versions did not always set $sh. Catch re-use of such
3000 if test ! -f config.sh; then
3003 First time through, eh? I have some defaults handy for some systems
3004 that need some extra help getting the Configure answers right:
3007 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3009 : Half the following guesses are probably wrong... If you have better
3010 : tests or hints, please send them to perlbug@perl.org
3011 : The metaconfig authors would also appreciate a copy...
3012 $test -f /irix && osname=irix
3013 $test -f /xenix && osname=sco_xenix
3014 $test -f /dynix && osname=dynix
3015 $test -f /dnix && osname=dnix
3016 $test -f /lynx.os && osname=lynxos
3017 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3018 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3019 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3020 $test -f /bin/mips && /bin/mips && osname=mips
3021 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3022 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3023 $test -d /usr/apollo/bin && osname=apollo
3024 $test -f /etc/saf/_sactab && osname=svr4
3025 $test -d /usr/include/minix && osname=minix
3026 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3027 if $test -d /MachTen -o -d /MachTen_Folder; then
3029 if $test -x /sbin/version; then
3030 osvers=`/sbin/version | $awk '{print $2}' |
3031 $sed -e 's/[A-Za-z]$//'`
3032 elif $test -x /usr/etc/version; then
3033 osvers=`/usr/etc/version | $awk '{print $2}' |
3034 $sed -e 's/[A-Za-z]$//'`
3040 $test -f /sys/posix.dll &&
3041 $test -f /usr/bin/what &&
3042 set X `/usr/bin/what /sys/posix.dll` &&
3043 $test "$3" = UWIN &&
3047 if $test -f $uname; then
3055 umips) osname=umips ;;
3058 [23]100) osname=mips ;;
3059 next*) osname=next ;;
3061 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3062 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3065 elif $test -f /etc/kconfig; then
3067 if test "$lns" = "$ln -s"; then
3069 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3071 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3078 if test -n "$DJGPP"; then
3087 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3089 # oslevel can fail with:
3090 # oslevel: Unable to acquire lock.
3091 *not\ found) osvers="$4"."$3" ;;
3092 '<3240'|'<>3240') osvers=3.2.0 ;;
3093 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3094 '=3250'|'>3250') osvers=3.2.5 ;;
3098 bsd386) osname=bsd386
3101 cygwin*) osname=cygwin
3104 *dc.osx) osname=dcosx
3110 domainos) osname=apollo
3116 dynixptx*) osname=dynixptx
3117 osvers=`echo "$4"|sed 's/^v//'`
3119 freebsd) osname=freebsd
3121 genix) osname=genix ;;
3125 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3141 netbsd*) osname=netbsd
3144 news-os) osvers="$3"
3146 4*) osname=newsos4 ;;
3150 next*) osname=next ;;
3151 nonstop-ux) osname=nonstopux ;;
3152 openbsd) osname=openbsd
3158 POSIX-BC | posix-bc ) osname=posix-bc
3161 powerux | power_ux | powermax_os | powermaxos | \
3162 powerunix | power_unix) osname=powerux
3168 solaris) osname=solaris
3170 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3177 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3181 titanos) osname=titanos
3190 ultrix) osname=ultrix
3193 osf1|mls+) case "$5" in
3196 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3199 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3202 hp*) osname=hp_osf1 ;;
3203 mips) osname=mips_osf1 ;;
3206 # UnixWare 7.1.2 is known as Open UNIX 8
3207 openunix|unixware) osname=svr5
3215 $2) case "$osname" in
3219 : svr4.x or possibly later
3229 if test -f /stand/boot ; then
3230 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3231 if test -n "$INITPROG" -a -f "$INITPROG"; then
3232 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3233 if test -n "$isesix"; then
3241 *) if test -f /etc/systemid; then
3243 set `echo $3 | $sed 's/\./ /g'` $4
3244 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3246 elif $test -f $src/hints/sco_$1_$2.sh; then
3248 elif $test -f $src/hints/sco_$1.sh; then
3253 '') : Still unknown. Probably a generic Sys V.
3262 *) case "$osname" in
3263 '') : Still unknown. Probably a generic BSD.
3271 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3272 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3273 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3276 $rm -f UU/kernel.what
3277 elif test -d c:/. -o -n "$is_os2" ; then
3284 case "$targetarch" in
3287 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3292 : Now look for a hint file osname_osvers, unless one has been
3293 : specified already.
3296 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3297 : Also try without trailing minor version numbers.
3298 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3299 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3300 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3301 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3304 *) case "$osvers" in
3307 *) if $test -f $src/hints/$file.sh ; then
3309 elif $test -f $src/hints/$xfile.sh ; then
3311 elif $test -f $src/hints/$xxfile.sh ; then
3313 elif $test -f $src/hints/$xxxfile.sh ; then
3315 elif $test -f $src/hints/$xxxxfile.sh ; then
3317 elif $test -f "$src/hints/${osname}.sh" ; then
3326 if $test -f Policy.sh ; then
3329 none) dflt="Policy" ;;
3330 *) dflt="Policy $dflt" ;;
3335 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3339 if $test -f Policy.sh ; then
3342 There's also a Policy hint file available, which should make the
3343 site-specific (policy) questions easier to answer.
3350 You may give one or more space-separated answers, or "none" if appropriate.
3351 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3352 is a good thing. DO NOT give a wrong version or a wrong OS.
3356 rp="Which of these apply, if any?"
3359 for file in $tans; do
3360 if $test X$file = XPolicy -a -f Policy.sh; then
3362 $cat Policy.sh >> UU/config.sh
3363 elif $test -f $src/hints/$file.sh; then
3364 . $src/hints/$file.sh
3365 $cat $src/hints/$file.sh >> UU/config.sh
3366 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3369 : Give one chance to correct a possible typo.
3370 echo "$file.sh does not exist"
3372 rp="hint to use instead?"
3374 for file in $ans; do
3375 if $test -f "$src/hints/$file.sh"; then
3376 . $src/hints/$file.sh
3377 $cat $src/hints/$file.sh >> UU/config.sh
3378 elif $test X$ans = X -o X$ans = Xnone ; then
3381 echo "$file.sh does not exist -- ignored."
3388 : Remember our hint file for later.
3389 if $test -f "$src/hints/$file.sh" ; then
3399 echo "Fetching default answers from $config_sh..." >&4
3403 cp $config_sh config.sh 2>/dev/null
3413 test "$override" && . ./optdef.sh
3415 : Restore computed paths
3416 for file in $loclist $trylist; do
3417 eval $file="\$_$file"
3422 Configure uses the operating system name and version to set some defaults.
3423 The default value is probably right if the name rings a bell. Otherwise,
3424 since spelling matters for me, either accept the default or answer "none"
3431 ''|' '|none) dflt=none ;;
3432 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3435 *) dflt="$osname" ;;
3437 rp="Operating system name?"
3441 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3447 ''|' '|none) dflt=none ;;
3448 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3449 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3451 ''|' ') dflt=none ;;
3456 *) dflt="$osvers" ;;
3458 rp="Operating system version?"
3468 : who configured the system
3469 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3472 cf_by=`(logname) 2>/dev/null`
3475 cf_by=`(whoami) 2>/dev/null`
3477 "") cf_by=unknown ;;
3482 : set up the script used to warn in case of inconsistency
3489 echo "*** WHOA THERE!!! ***" >&4
3490 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3491 rp=" Keep the $hint value?"
3494 y) td=$was; tu=$was;;
3498 : function used to set $1 to $val
3499 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3501 $define$undef) . ./whoa; eval "$var=\$td";;
3502 $undef$define) . ./whoa; eval "$var=\$tu";;
3503 *) eval "$var=$val";;
3507 $define|true|[yY]*) dflt='y';;
3512 Perl can be built to use the SOCKS proxy protocol library. To do so,
3513 Configure must be run with -Dusesocks. If you use SOCKS you also need
3514 to use the PerlIO abstraction layer, this will be implicitly selected.
3516 If this doesn't make any sense to you, just accept the default '$dflt'.
3518 rp='Build Perl for SOCKS?'
3521 y|Y) val="$define" ;;
3528 $define|true|[yY]*) useperlio="$define";;
3531 case "$useperlio" in
3532 $define|true|[yY]*|'') dflt='y';;
3537 Previous version of $package used the standard IO mechanisms as
3538 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3539 alternate IO mechanisms via the PerlIO abstraction layer, but the
3540 stdio mechanism is still available if needed. The abstraction layer
3541 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3542 Using PerlIO with sfio may cause problems with some extension modules.
3544 If this doesn't make any sense to you, just accept the default '$dflt'.
3546 rp='Use the PerlIO abstraction layer?'
3553 echo "Ok, doing things the stdio way."
3562 case "$useperlio" in
3563 $define|true|[yY]*) ;;
3566 You are using the SOCKS proxy protocol library which means that you
3567 should also use the PerlIO layer. You may be headed for trouble.
3576 case "$usethreads" in
3577 $define|true|[yY]*) dflt='y';;
3578 *) # Catch case where user specified ithreads or 5005threads but
3579 # forgot -Dusethreads (A.D. 4/2002)
3580 case "$useithreads$use5005threads" in
3582 case "$useperlio" in
3583 "$define") dflt='y' ;;
3593 Perl can be built to take advantage of threads on some systems.
3594 To do so, Configure can be run with -Dusethreads.
3596 Note that Perl built with threading support runs slightly slower
3597 and uses more memory than plain Perl. The current implementation
3598 is believed to be stable, but it is fairly new, and so should be
3599 treated with caution.
3601 If this doesn't make any sense to you, just accept the default '$dflt'.
3603 rp='Build a threading Perl?'
3606 y|Y) val="$define" ;;
3612 case "$usethreads" in
3616 Since release 5.6, Perl has had two different threading implementations,
3617 the newer interpreter-based version (ithreads) with one interpreter per
3618 thread, and the older 5.005 version (5005threads).
3619 The 5005threads version is effectively unmaintained and will probably be
3620 removed in Perl 5.10, so there should be no need to build a Perl using it
3621 unless needed for backwards compatibility with some existing 5.005threads
3625 : Default to ithreads unless overridden on command line or with
3628 case "$use5005threads" in
3629 $define|true|[yY]*) dflt='n';;
3631 case "$useithreads" in
3632 $undef|false|[nN]*) dflt='n';;
3634 rp='Use the newer interpreter-based ithreads?'
3637 y|Y) val="$define" ;;
3642 : Now set use5005threads to the opposite value.
3643 case "$useithreads" in
3644 $define) val="$undef" ;;
3651 useithreads="$undef"
3652 use5005threads="$undef"
3656 case "$useithreads$use5005threads" in
3660 You cannot have both the ithreads and the 5.005 threads enabled
3661 at the same time. Disabling the 5.005 threads since they are
3662 much less stable than the ithreads.
3665 use5005threads="$undef"
3669 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3672 *** To build with ithreads you must also use the PerlIO layer.
3673 *** Cannot continue, aborting.
3679 case "$d_oldpthreads" in
3680 '') : Configure tests would be welcome here. For now, assume undef.
3682 *) val="$d_oldpthreads" ;;
3688 : Look for a hint-file generated 'call-back-unit'. If the
3689 : user has specified that a threading perl is to be built,
3690 : we may need to set or change some other defaults.
3691 if $test -f usethreads.cbu; then
3692 echo "Your platform has some specific hints regarding threaded builds, using them..."
3695 case "$usethreads" in
3696 "$define"|true|[yY]*)
3698 (Your platform does not have any specific hints for threaded builds.
3699 Assuming POSIX threads, then.)
3707 Perl can be built so that multiple Perl interpreters can coexist
3708 within the same Perl executable.
3711 case "$useithreads" in
3714 This multiple interpreter support is required for interpreter-based threads.
3718 *) case "$usemultiplicity" in
3719 $define|true|[yY]*) dflt='y';;
3723 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3724 rp='Build Perl for multiplicity?'
3727 y|Y) val="$define" ;;
3736 case "$usemorebits" in
3737 "$define"|true|[yY]*)
3738 use64bitint="$define"
3739 uselongdouble="$define"
3740 usemorebits="$define"
3742 *) usemorebits="$undef"
3746 : make some quick guesses about what we are up against
3748 $echo $n "Hmm... $c"
3758 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3759 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3761 echo "Looks kind of like an OSF/1 system, but we'll see..."
3763 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3764 xxx=`./loc addbib blurfl $pth`
3765 if $test -f $xxx; then
3766 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3770 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3771 echo "Looks kind of like an extended USG system, but we'll see..."
3773 echo "Looks kind of like a USG system, but we'll see..."
3777 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3778 echo "Looks kind of like a BSD system, but we'll see..."
3782 echo "Looks kind of like a Version 7 system, but we'll see..."
3785 case "$eunicefix" in
3788 There is, however, a strange, musty smell in the air that reminds me of
3789 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3793 : it so happens the Eunice I know will not run shell scripts in Unix format
3797 echo "Congratulations. You aren't running Eunice."
3801 : Detect OS2. The p_ variable is set above in the Head.U unit.
3802 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3803 : semicolon as a patch separator
3808 I have the feeling something is not exactly right, however...don't tell me...
3809 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3810 (Or you may be running DOS with DJGPP.)
3815 if test -f /xenix; then
3816 echo "Actually, this looks more like a XENIX system..."
3821 echo "It's not Xenix..."
3826 if test -f /venix; then
3827 echo "Actually, this looks more like a VENIX system..."
3834 echo "Nor is it Venix..."
3837 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3838 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3845 rp="Use which C compiler?"
3849 : See if they have not cc but they do have gcc
3851 : Look for a hint-file generated 'call-back-unit'. Now that the
3852 : user has specified the compiler, we may need to set or change some
3854 if $test -f cc.cbu; then
3860 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3866 printf("%s\n", __VERSION__);
3868 printf("%s\n", "1");
3874 if $cc -o try $ccflags $ldflags try.c; then
3875 gccversion=`$run ./try`
3876 case "$gccversion" in
3877 '') echo "You are not using GNU cc." ;;
3878 *) echo "You are using GNU cc $gccversion."
3884 echo "*** WHOA THERE!!! ***" >&4
3885 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3886 case "$knowitall" in
3888 echo " You'd better start hunting for one and let me know about it." >&4
3894 case "$gccversion" in
3895 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3897 case "$gccversion" in
3898 '') gccosandvers='' ;;
3899 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3900 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3902 case "$gccosandvers" in
3903 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3904 $osname$osvers) ;; # looking good
3905 $osname*) cat <<EOM >&4
3907 *** WHOA THERE!!! ***
3909 Your gcc has not been compiled for the exact release of
3910 your operating system ($gccosandvers versus $osname$osvers).
3912 In general it is a good idea to keep gcc synchronized with
3913 the operating system because otherwise serious problems
3914 may ensue when trying to compile software, like Perl.
3916 I'm trying to be optimistic here, though, and will continue.
3917 If later during the configuration and build icky compilation
3918 problems appear (headerfile conflicts being the most common
3919 manifestation), I suggest reinstalling the gcc to match
3920 your operating system release.
3924 *) gccosandvers='' ;; # failed to parse, better be silent
3932 # gcc 3.* complain about adding -Idirectories that they already know about,
3933 # so we will take those off from locincpth.
3934 case "$gccversion" in
3936 echo "main(){}">try.c
3937 for incdir in $locincpth; do
3938 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3939 grep '^c[cp]p*[01]: warning: changing search order '`
3940 if test "X$warn" != X; then
3941 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3947 : decide how portable to be. Allow command line overrides.
3948 case "$d_portable" in
3950 *) d_portable="$define" ;;
3953 : set up shell script to do ~ expansion
3959 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3962 if $test -f /bin/csh; then
3963 /bin/csh -f -c "glob \$1"
3968 name=\`$expr x\$1 : '..\([^/]*\)'\`
3969 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3970 if $test ! -d "\$dir"; then
3972 echo "\$me: can't locate home directory for: \$name" >&2
3977 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3993 : now set up to get a file name
3997 cat <<'EOSC' >>getfile
4013 : getfile will accept an answer from the comma-separated list
4014 : enclosed in parentheses even if it does not meet other criteria.
4015 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4016 fn=`echo $fn | sed 's/(.*)//'`
4022 loc_file=`expr $fn : '.*:\(.*\)'`
4023 fn=`expr $fn : '\(.*\):.*'`
4031 */*) fullpath=true;;
4040 *e*) exp_file=true;;
4043 *p*) nopath_ok=true;;
4048 *d*) type='Directory';;
4049 *l*) type='Locate';;
4054 Locate) what='File';;
4059 case "$d_portable" in
4067 while test "$type"; do
4072 true) rp="$rp (~name ok)";;
4075 if test -f UU/getfile.ok && \
4076 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4095 value=`UU/filexp $ans`
4098 if test "$ans" != "$value"; then
4099 echo "(That expands to $value on this system.)"
4113 /*) value="$ansexp" ;;
4114 [a-zA-Z]:/*) value="$ansexp" ;;
4119 echo "I shall only accept a full path name, as in /bin/ls." >&4
4120 echo "Use a ! shell escape if you wish to check pathnames." >&4
4123 echo "Please give a full path name, starting with slash." >&4
4126 echo "Note that using ~name is ok provided it expands well." >&4
4139 for fp in $gfpth; do
4140 if test "X$fp" = X.; then
4145 if test -f "$pf"; then
4147 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4149 echo "($value is not a plain file, but that's ok.)"
4152 if test X"$type" = X; then
4159 for fp in $gfpth; do
4160 if test "X$fp" = X.; then
4165 direxp="$fp/$ansexp"
4167 if test -d "$direxp"; then
4175 if test -d "$ansexp"; then
4176 echo "(Looking for $loc_file in directory $value.)"
4177 value="$value/$loc_file"
4178 ansexp="$ansexp/$loc_file"
4180 if test -f "$ansexp"; then
4183 case "$nopath_ok" in
4184 true) case "$value" in
4186 *) echo "Assuming $value will be in people's path."
4202 if test "$fastread" = yes; then
4207 rp="$what $value doesn't exist. Use that name anyway?"
4226 test "X$gfpthkeep" != Xy && gfpth=""
4229 : What should the include directory be ?
4231 $echo $n "Hmm... $c"
4235 if $test -f /bin/mips && /bin/mips; then
4236 echo "Looks like a MIPS system..."
4237 $cat >usr.c <<'EOCP'
4238 #ifdef SYSTYPE_BSD43
4242 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4243 dflt='/bsd43/usr/include'
4247 mips_type='System V'
4249 $rm -f usr.c usr.out
4250 echo "and you're compiling with the $mips_type compiler and libraries."
4254 echo "Doesn't look like a MIPS system."
4264 case "$xxx_prompt" in
4267 rp='Where are the include files you want to use?'
4275 : see how we invoke the C preprocessor
4277 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4278 cat <<'EOT' >testcpp.c
4284 if test ! -f cppstdin; then
4285 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4286 # AIX cc -E doesn't show the absolute headerfile
4287 # locations but we'll cheat by using the -M flag.
4288 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
4290 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4293 echo "Keeping your $hint cppstdin wrapper."
4296 wrapper=`pwd`/cppstdin
4300 if $test "X$cppstdin" != "X" && \
4301 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4302 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4304 echo "You used to use $cppstdin $cppminus so we'll use that again."
4306 '') echo "But let's see if we can live without a wrapper..." ;;
4308 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4309 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4311 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4314 echo "(However, $cpprun $cpplast does not work, let's see...)"
4322 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4329 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4330 $cc -E <testcpp.c >testcpp.out 2>&1; \
4331 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4332 echo "Yup, it does."
4335 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4336 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4337 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4338 echo "Yup, it does."
4341 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4342 $cc -P <testcpp.c >testcpp.out 2>&1; \
4343 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4344 echo "Yipee, that works!"
4347 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4348 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4349 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4350 echo "At long last!"
4353 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4354 $cpp <testcpp.c >testcpp.out 2>&1; \
4355 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4359 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4360 $cpp - <testcpp.c >testcpp.out 2>&1; \
4361 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4362 echo "Hooray, it works! I was beginning to wonder."
4365 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4366 $wrapper <testcpp.c >testcpp.out 2>&1; \
4367 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4373 rp="No dice. I can't find a C preprocessor. Name one:"
4377 $x_cpp <testcpp.c >testcpp.out 2>&1
4378 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4379 echo "OK, that will do." >&4
4381 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4396 echo "Perhaps can we force $cc -E using a wrapper..."
4397 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4398 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4404 echo "Nope, we'll have to live without it..."
4418 "$wrapper"|'cppstdin') ;;
4419 *) $rm -f $wrapper;;
4421 $rm -f testcpp.c testcpp.out
4423 : Set private lib path
4426 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4431 '') dlist="$loclibpth $plibpth $glibpth";;
4432 *) dlist="$libpth";;
4435 : Now check and see which directories actually exist, avoiding duplicates
4439 if $test -d $xxx; then
4442 *) libpth="$libpth $xxx";;
4448 Some systems have incompatible or broken versions of libraries. Among
4449 the directories listed in the question below, please remove any you
4450 know not to be holding relevant libraries, and add any that are needed.
4451 Say "none" for none.
4462 rp="Directories to use for library searches?"
4469 : compute shared library extension
4472 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4482 On some systems, shared libraries may be available. Answer 'none' if
4483 you want to suppress searching of shared libraries for the remainder
4484 of this configuration.
4487 rp='What is the file extension used for shared libraries?'
4491 : Define several unixisms.
4492 : Hints files or command line option can be used to override them.
4493 : The convoluted testing is in case hints files set either the old
4496 '') case "$exe_ext" in
4498 *) _exe="$exe_ext" ;;
4503 '') case "$lib_ext" in
4510 '') case "$obj_ext" in
4517 '') case "$path_sep" in
4528 : Which makefile gets called first. This is used by make depend.
4529 case "$firstmakefile" in
4530 '') firstmakefile='makefile';;
4534 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4537 case "$uselongdouble" in
4538 $define|true|[yY]*) dflt='y';;
4543 Perl can be built to take advantage of long doubles which
4544 (if available) may give more accuracy and range for floating point numbers.
4546 If this doesn't make any sense to you, just accept the default '$dflt'.
4548 rp='Try to use long doubles if available?'
4551 y|Y) val="$define" ;;
4557 case "$uselongdouble" in
4558 true|[yY]*) uselongdouble="$define" ;;
4561 : Look for a hint-file generated 'call-back-unit'. If the
4562 : user has specified that long doubles should be used,
4563 : we may need to set or change some other defaults.
4564 if $test -f uselongdouble.cbu; then
4565 echo "Your platform has some specific hints regarding long doubles, using them..."
4566 . ./uselongdouble.cbu
4568 case "$uselongdouble" in
4571 (Your platform does not have any specific hints for long doubles.)
4577 : Looking for optional libraries
4579 echo "Checking for optional libraries..." >&4
4584 case "$libswanted" in
4585 '') libswanted='c_s';;
4588 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4594 for thisdir in $libpth $xlibpth; do
4595 test -d $thisdir && libspath="$libspath $thisdir"
4597 for thislib in $libswanted; do
4598 for thisdir in $libspath; do
4600 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4601 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4602 $test -f "$xxx" && eval $libscheck
4603 $test -f "$xxx" && libstyle=shared
4605 if test ! -f "$xxx"; then
4606 xxx=$thisdir/lib$thislib.$so
4607 $test -f "$xxx" && eval $libscheck
4608 $test -f "$xxx" && libstyle=shared
4610 if test ! -f "$xxx"; then
4611 xxx=$thisdir/lib$thislib$_a
4612 $test -f "$xxx" && eval $libscheck
4613 $test -f "$xxx" && libstyle=static
4615 if test ! -f "$xxx"; then
4616 xxx=$thisdir/$thislib$_a
4617 $test -f "$xxx" && eval $libscheck
4618 $test -f "$xxx" && libstyle=static
4620 if test ! -f "$xxx"; then
4621 xxx=$thisdir/lib${thislib}_s$_a
4622 $test -f "$xxx" && eval $libscheck
4623 $test -f "$xxx" && libstyle=static
4624 $test -f "$xxx" && thislib=${thislib}_s
4626 if test ! -f "$xxx"; then
4627 xxx=$thisdir/Slib$thislib$_a
4628 $test -f "$xxx" && eval $libscheck
4629 $test -f "$xxx" && libstyle=static
4631 if $test -f "$xxx"; then
4633 shared) echo "Found -l$thislib (shared)." ;;
4634 static) echo "Found -l$thislib." ;;
4635 *) echo "Found -l$thislib ($libstyle)." ;;
4639 *) dflt="$dflt -l$thislib"
4640 libsfound="$libsfound $xxx"
4642 libsfiles="$libsfiles $yyy"
4643 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4644 case " $libsdirs " in
4646 *) libsdirs="$libsdirs $yyy" ;;
4653 if $test ! -f "$xxx"; then
4654 echo "No -l$thislib."
4665 ' '|'') dflt='none';;
4670 In order to compile $package on your machine, a number of libraries
4671 are usually needed. Include any other special libraries here as well.
4672 Say "none" for none. The default list is almost always right.
4676 rp="What libraries to use?"
4683 : determine optimization, if desired, or use for debug flag also
4685 ' '|$undef) dflt='none';;
4687 *) dflt="$optimize";;
4691 By default, $package compiles with the -O flag to use the optimizer.
4692 Alternately, you might want to use the symbolic debugger, which uses
4693 the -g flag (on traditional Unix systems). Either flag can be
4694 specified here. To use neither flag, specify the word "none".
4697 rp="What optimizer/debugger flag should be used?"
4701 'none') optimize=" ";;
4705 : We will not override a previous value, but we might want to
4706 : augment a hint file
4708 default|recommended)
4709 case "$gccversion" in
4710 1*) dflt='-fpcc-struct-return' ;;
4713 *-g*) dflt="$dflt -DDEBUGGING";;
4715 case "$gccversion" in
4716 2*) if test -d /etc/conf/kconfig.d &&
4717 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4719 # Interactive Systems (ISC) POSIX mode.
4724 case "$gccversion" in
4728 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4729 echo 'int main(void) { return 0; }' > gcctest.c
4730 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4731 echo "Yes, it does." 2>&1
4734 echo "Leaving current flags $ccflags alone." 2>&1
4736 *) dflt="$dflt -fno-strict-aliasing" ;;
4739 echo "Nope, it doesn't, but that's ok." 2>&1
4743 # For gcc, adding -pipe speeds up compilations for some, but apparently
4744 # some assemblers can't read from stdin. (It also slows down compilations
4745 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4746 case "$gccversion" in
4748 echo "Checking if your compiler accepts -pipe" 2>&1
4749 echo 'int main(void) { return 0; }' > gcctest.c
4750 if $cc -O2 -pipe -o gcctest gcctest.c; then
4751 echo "Yes, it does." 2>&1
4754 echo "Leaving current flags $ccflags alone." 2>&1
4756 *) dflt="$dflt -pipe" ;;
4759 echo "Nope, it doesn't, but that's ok." 2>&1
4766 case "$mips_type" in
4767 *BSD*|'') inclwanted="$locincpth $usrinc";;
4768 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4770 for thisincl in $inclwanted; do
4771 if $test -d $thisincl; then
4772 if $test x$thisincl != x$usrinc; then
4774 *" -I$thisincl "*);;
4775 *) dflt="$dflt -I$thisincl ";;
4781 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4783 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4791 *) dflt="$dflt -D$2";;
4795 set signal.h LANGUAGE_C; eval $inctest
4799 ccflags="$ccflags -DSOCKS"
4804 default|recommended) dflt="$ccflags $dflt" ;;
4805 *) dflt="$ccflags";;
4814 Your C compiler may want other flags. For this question you should include
4815 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4816 but you should NOT include libraries or ld flags like -lwhatever. If you
4817 want $package to honor its debug switch, you should include -DDEBUGGING here.
4818 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4820 To use no flags, specify the word "none".
4826 rp="Any additional cc flags?"
4833 : the following weeds options from ccflags that are of no interest to cpp
4835 '') cppflags="$ccflags" ;;
4836 *) cppflags="$cppflags $ccflags" ;;
4838 case "$gccversion" in
4839 1*) cppflags="$cppflags -D__GNUC__"
4841 case "$mips_type" in
4843 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4849 echo "Let me guess what the preprocessor flags are..." >&4
4863 *) ftry="$previous $flag";;
4865 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4866 >cpp1.out 2>/dev/null && \
4867 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4868 >cpp2.out 2>/dev/null && \
4869 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4870 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4872 cppflags="$cppflags $ftry"
4882 *-*) echo "They appear to be: $cppflags";;
4884 $rm -f cpp.c cpp?.out
4888 : flags used in final linking phase
4890 '') if ./venix; then
4896 *-posix*) dflt="$dflt -posix" ;;
4899 *) dflt="$ldflags";;
4902 : Try to guess additional flags to pick up local libraries.
4903 for thislibdir in $libpth; do
4904 case " $loclibpth " in
4907 *"-L$thislibdir "*) ;;
4908 *) dflt="$dflt -L$thislibdir" ;;
4920 Your C linker may need flags. For this question you should
4921 include -L/whatever and any other flags used by the C linker, but you
4922 should NOT include libraries like -lwhatever.
4924 Make sure you include the appropriate -L/path flags if your C linker
4925 does not normally search all of the directories you specified above,
4928 To use no flags, specify the word "none".
4932 rp="Any additional ld flags (NOT including libraries)?"
4938 rmlist="$rmlist pdp11"
4942 echo "Checking your choice of C compiler and flags for coherency..." >&4
4943 $cat > try.c <<'EOF'
4945 int main() { printf("Ok\n"); return(0); }
4947 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4949 $cat >try.msg <<'EOM'
4950 I've tried to compile and run the following simple program:
4953 $cat try.c >> try.msg
4955 $cat >> try.msg <<EOM
4962 and I got the following output:
4966 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4967 if $sh -c "$run ./try" >>try.msg 2>&1; then
4971 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4974 cat >> try.msg <<'EOQS'
4975 If $libs contains -lsfio, and sfio is mis-configured, then it
4976 sometimes (apparently) runs and exits with a 0 status, but with no
4977 output! It may have to do with sfio's use of _exit vs. exit.
4980 rp="You have a big problem. Shall I abort Configure"
4987 echo "The program compiled OK, but exited with status $?." >>try.msg
4988 rp="You have a problem. Shall I abort Configure"
4992 echo "I can't compile the test program." >>try.msg
4993 rp="You have a BIG problem. Shall I abort Configure"
4999 case "$knowitall" in
5001 echo "(The supplied flags or libraries might be incorrect.)"
5009 *) echo "Ok. Stopping Configure." >&4
5014 n) echo "OK, that should do.";;
5016 $rm -f try try.* core
5018 : define a shorthand compile call
5022 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5023 : define a shorthand compile call for compilations that should be ok.
5027 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5029 : determine filename position in cpp output
5031 echo "Computing filename position in cpp output for #include directives..." >&4
5033 vos) testaccess=-e ;;
5036 echo '#include <stdio.h>' > foo.c
5039 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5040 $grep '^[ ]*#.*stdio\.h' | \
5041 while read cline; do
5044 while $test \$# -gt 0; do
5045 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5050 pos=\`expr \$pos + 1\`
5062 *) pos="${fieldn}th";;
5064 echo "Your cpp writes the filename in the $pos field of the line."
5067 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5068 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5071 : locate header file
5076 for usrincdir in $usrinc
5078 if test -f \$usrincdir/\$wanted; then
5079 echo "\$usrincdir/\$wanted"
5083 awkprg='{ print \$$fieldn }'
5084 echo "#include <\$wanted>" > foo\$\$.c
5085 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5086 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5087 while read cline; do
5088 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5090 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5091 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5096 # status = 0: grep returned 0 lines, case statement not executed
5097 # status = 1: headerfile found
5098 # status = 2: while loop executed, no headerfile found
5102 if test \$status -eq 1; then
5109 : define an alternate in-header-list? function
5110 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5111 cont=true; xxf="echo \"<\$1> found.\" >&4";
5112 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5113 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5115 case $# in 4) instead=instead;; *) instead="at last";; esac;
5116 while $test "$cont"; do
5118 var=$2; eval "was=\$$2";
5119 if $test "$xxx" && $test -r "$xxx";
5121 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5124 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5125 set $yyy; shift; shift; yyy=$@;
5126 case $# in 0) cont="";;
5127 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5128 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5129 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5130 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5134 do set $yyy; var=$2; eval "was=\$$2";
5135 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5136 set $yyy; shift; shift; yyy=$@;
5139 : see if stdlib is available
5140 set stdlib.h i_stdlib
5143 : check for lengths of integral types
5147 echo "Checking to see how big your integers are..." >&4
5156 printf("intsize=%d;\n", (int)sizeof(int));
5157 printf("longsize=%d;\n", (int)sizeof(long));
5158 printf("shortsize=%d;\n", (int)sizeof(short));
5163 if eval $compile_ok && $run ./try > /dev/null; then
5165 echo "Your integers are $intsize bytes long."
5166 echo "Your long integers are $longsize bytes long."
5167 echo "Your short integers are $shortsize bytes long."
5171 Help! I can't compile and run the intsize test program: please enlighten me!
5172 (This is probably a misconfiguration in your system or libraries, and
5173 you really ought to fix it. Still, I'll try anyway.)
5177 rp="What is the size of an integer (in bytes)?"
5181 rp="What is the size of a long integer (in bytes)?"
5185 rp="What is the size of a short integer (in bytes)?"
5193 : check for long long
5195 echo "Checking to see if you have long long..." >&4
5196 echo 'int main() { long long x = 7; return 0; }' > try.c
5198 if eval $compile; then
5200 echo "You have long long."
5203 echo "You do not have long long."
5209 : check for length of long long
5210 case "${d_longlong}${longlongsize}" in
5213 echo "Checking to see how big your long longs are..." >&4
5214 $cat >try.c <<'EOCP'
5218 printf("%d\n", (int)sizeof(long long));
5223 if eval $compile_ok; then
5224 longlongsize=`$run ./try`
5225 echo "Your long longs are $longlongsize bytes long."
5229 echo "(I can't seem to compile the test program. Guessing...)"
5230 rp="What is the size of a long long (in bytes)?"
5234 if $test "X$longsize" = "X$longlongsize"; then
5235 echo "(That isn't any different from an ordinary long.)"
5241 : see if inttypes.h is available
5242 : we want a real compile instead of Inhdr because some systems
5243 : have an inttypes.h which includes non-existent headers
5246 #include <inttypes.h>
5248 static int32_t foo32 = 0x12345678;
5252 if eval $compile; then
5253 echo "<inttypes.h> found." >&4
5256 echo "<inttypes.h> NOT found." >&4
5265 echo "Checking to see if you have int64_t..." >&4
5267 #include <sys/types.h>
5268 #$i_inttypes I_INTTYPES
5270 #include <inttypes.h>
5272 int main() { int64_t x = 7; }
5275 if eval $compile; then
5277 echo "You have int64_t."
5280 echo "You do not have int64_t."
5288 echo "Checking which 64-bit integer type we could use..." >&4
5294 val='"unsigned int"'
5299 *) case "$longsize" in
5303 val='"unsigned long"'
5308 *) case "$d_longlong:$longlongsize" in
5313 val='"unsigned long long"'
5318 *) case "$d_int64_t" in
5337 '') echo "Alas, no 64-bit integer types in sight." >&4
5340 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5346 case "$uselonglong" in
5347 "$define"|true|[yY]*)
5350 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5352 use64bitint="$define"
5355 case "$use64bits" in
5356 "$define"|true|[yY]*)
5359 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5361 use64bitint="$define"
5364 case "$use64bitints" in
5365 "$define"|true|[yY]*)
5368 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5370 use64bitint="$define"
5373 case "$use64bitsint" in
5374 "$define"|true|[yY]*)
5377 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5379 use64bitint="$define"
5382 case "$uselonglongs" in
5383 "$define"|true|[yY]*)
5386 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5388 use64bitint="$define"
5391 case "$use64bitsall" in
5392 "$define"|true|[yY]*)
5395 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5397 use64bitall="$define"
5402 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5404 case "$use64bitall" in
5405 "$define"|true|[yY]*) use64bitint="$define" ;;
5411 You have natively 64-bit long integers.
5415 *) case "$use64bitint" in
5416 "$define"|true|[yY]*) dflt='y';;
5425 Perl can be built to take advantage of 64-bit integer types
5426 on some systems. To do so, Configure can be run with -Duse64bitint.
5427 Choosing this option will most probably introduce binary incompatibilities.
5429 If this doesn't make any sense to you, just accept the default '$dflt'.
5430 (The default has been chosen based on your configuration.)
5432 rp='Try to use 64-bit integers, if available?'
5435 [yY]*) val="$define" ;;
5443 case "$use64bitall" in
5444 "$define"|true|[yY]*) dflt='y' ;;
5445 *) case "$longsize" in
5453 You may also choose to try maximal 64-bitness. It means using as much
5454 64-bitness as possible on the platform. This in turn means even more
5455 binary incompatibilities. On the other hand, your platform may not
5456 have any more 64-bitness available than what you already have chosen.
5458 If this doesn't make any sense to you, just accept the default '$dflt'.
5459 (The default has been chosen based on your configuration.)
5461 rp='Try to use maximal 64-bit support, if available?'
5464 [yY]*) val="$define" ;;
5469 case "$use64bitall" in
5471 case "$use64bitint" in
5475 Since you have chosen a maximally 64-bit build, I'm also turning on
5476 the use of 64-bit integers.
5478 use64bitint="$define" ;;
5483 : Look for a hint-file generated 'call-back-unit'. If the
5484 : user has specified that a 64-bit perl is to be built,
5485 : we may need to set or change some other defaults.
5486 if $test -f use64bitint.cbu; then
5487 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5490 case "$use64bitint" in
5491 "$define"|true|[yY]*)
5493 4) case "$archname64" in
5494 '') archname64=64int ;;
5501 : Look for a hint-file generated 'call-back-unit'. If the
5502 : user has specified that a maximally 64-bit perl is to be built,
5503 : we may need to set or change some other defaults.
5504 if $test -f use64bitall.cbu; then
5505 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5508 case "$use64bitall" in
5509 "$define"|true|[yY]*)
5511 4) case "$archname64" in
5512 ''|64int) archname64=64all ;;
5519 case "$d_quad:$use64bitint" in
5523 *** You have chosen to use 64-bit integers,
5524 *** but none can be found.
5525 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5526 *** Cannot continue, aborting.
5533 : check for length of double
5535 case "$doublesize" in
5537 echo "Checking to see how big your double precision numbers are..." >&4
5546 printf("%d\n", (int)sizeof(double));
5551 if eval $compile_ok; then
5552 doublesize=`$run ./try`
5553 echo "Your double is $doublesize bytes long."
5556 echo "(I can't seem to compile the test program. Guessing...)"
5557 rp="What is the size of a double precision number (in bytes)?"
5565 : check for long doubles
5567 echo "Checking to see if you have long double..." >&4
5568 echo 'int main() { long double x = 7.0; }' > try.c
5570 if eval $compile; then
5572 echo "You have long double."
5575 echo "You do not have long double."
5581 : check for length of long double
5582 case "${d_longdbl}${longdblsize}" in
5585 echo "Checking to see how big your long doubles are..." >&4
5586 $cat >try.c <<'EOCP'
5590 printf("%d\n", sizeof(long double));
5595 if eval $compile; then
5596 longdblsize=`$run ./try`
5597 echo "Your long doubles are $longdblsize bytes long."
5601 echo "(I can't seem to compile the test program. Guessing...)" >&4
5602 rp="What is the size of a long double (in bytes)?"
5606 if $test "X$doublesize" = "X$longdblsize"; then
5607 echo "That isn't any different from an ordinary double."
5608 echo "I'll keep your setting anyway, but you may see some"
5609 echo "harmless compilation warnings."
5615 : determine the architecture name
5617 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5618 tarch=`arch`"-$osname"
5619 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5620 if uname -m > tmparch 2>&1 ; then
5621 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5622 -e 's/$/'"-$osname/" tmparch`
5630 case "$myarchname" in
5633 echo "(Your architecture name used to be $myarchname.)"
5637 case "$targetarch" in
5639 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5644 *) dflt="$archname";;
5646 rp='What is your architecture name'
5649 case "$usethreads" in
5651 echo "Threads selected." >&4
5653 *-thread*) echo "...and architecture name already has -thread." >&4
5655 *) archname="$archname-thread"
5656 echo "...setting architecture name to $archname." >&4
5661 case "$usemultiplicity" in
5663 echo "Multiplicity selected." >&4
5665 *-multi*) echo "...and architecture name already has -multi." >&4
5667 *) archname="$archname-multi"
5668 echo "...setting architecture name to $archname." >&4
5673 case "$use64bitint$use64bitall" in
5675 case "$archname64" in
5677 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5680 case "$use64bitint" in
5681 "$define") echo "64 bit integers selected." >&4 ;;
5683 case "$use64bitall" in
5684 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5687 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5689 *) archname="$archname-$archname64"
5690 echo "...setting architecture name to $archname." >&4
5696 case "$uselongdouble" in
5698 echo "Long doubles selected." >&4
5699 case "$longdblsize" in
5701 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5705 *-ld*) echo "...and architecture name already has -ld." >&4
5707 *) archname="$archname-ld"
5708 echo "...setting architecture name to $archname." >&4
5715 case "$useperlio" in
5717 echo "Perlio selected." >&4
5720 echo "Perlio not selected, using stdio." >&4
5722 *-stdio*) echo "...and architecture name already has -stdio." >&4
5724 *) archname="$archname-stdio"
5725 echo "...setting architecture name to $archname." >&4
5730 if $test -f archname.cbu; then
5731 echo "Your platform has some specific hints for architecture name, using them..."
5735 : determine root of directory hierarchy where package will be installed.
5738 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5741 dflt=`echo "$prefix" | sed 's/.$//'`
5749 By default, $package will be installed in $dflt/bin, manual pages
5750 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5751 installation directories. Typically this is something like /usr/local.
5752 If you wish to have binaries under /usr/bin but other parts of the
5753 installation under /usr/local, that's ok: you will be prompted
5754 separately for each of the installation directories, the prefix being
5755 only used to set the defaults.
5759 rp='Installation prefix to use?'
5767 *) oldprefix="$prefix";;
5776 *) afsroot=$afsroot ;;
5782 $define|true) afs=true ;;
5783 $undef|false) afs=false ;;
5784 *) if test -d $afsroot; then
5792 echo "AFS may be running... I'll be extra cautious then..." >&4
5794 echo "AFS does not seem to be running..." >&4
5797 : determine installation prefix for where package is to be installed.
5801 Since you are running AFS, I need to distinguish the directory in which
5802 files will reside from the directory in which they are installed (and from
5803 which they are presumably copied to the former directory by occult means).
5806 case "$installprefix" in
5807 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5808 *) dflt="$installprefix";;
5813 In some special cases, particularly when building $package for distribution,
5814 it is convenient to distinguish the directory in which files should be
5815 installed from the directory ($prefix) in which they will
5816 eventually reside. For most users, these two directories are the same.
5819 case "$installprefix" in
5821 *) dflt=$installprefix;;
5825 rp='What installation prefix should I use for installing files?'
5827 installprefix="$ans"
5828 installprefixexp="$ansexp"
5830 : set the prefixit variable, to compute a suitable default value
5831 prefixit='case "$3" in
5833 case "$oldprefix" in
5834 "") eval "$1=\"\$$2\"";;
5841 ""|" ") eval "$1=\"\$$2\"";;
5847 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5849 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5850 /*-$oldprefix/*|\~*-$oldprefix/*)
5851 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5852 *) eval "$1=\"\$$2\"";;
5856 : get the patchlevel
5858 echo "Getting the current patchlevel..." >&4
5859 if $test -r $rsrc/patchlevel.h;then
5860 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5861 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5862 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5863 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5864 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5865 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5866 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5875 $echo "(You do not have patchlevel.h. Eek.)"
5877 if $test -r $rsrc/.patch ; then
5878 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5879 perl_patchlevel=`cat $rsrc/.patch`
5882 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5883 version_patchlevel_string="version $patchlevel subversion $subversion"
5884 case "$perl_patchlevel" in
5886 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5889 $echo "(You have $package $version_patchlevel_string.)"
5893 : XXX Should be a Configure test for double-dots in filenames.
5894 version=`echo $revision $patchlevel $subversion | \
5895 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5896 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5897 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5900 version=`echo $revision $patchlevel $subversion | \
5901 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5902 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5903 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5906 : Special case the 5.005_xx maintenance series, which used 5.005
5907 : without any subversion label as a subdirectory in $sitelib
5908 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5909 api_versionstring='5.005'
5912 : determine installation style
5913 : For now, try to deduce it from prefix unless it is already set.
5914 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5915 case "$installstyle" in
5916 '') case "$prefix" in
5917 *perl*) dflt='lib';;
5918 *) dflt='lib/perl5' ;;
5921 *) dflt="$installstyle" ;;
5923 : Probably not worth prompting for this since we prompt for all
5924 : the directories individually, and the prompt would be too long and
5928 : determine where private library files go
5929 : Usual default is /usr/local/lib/perl5/$version.
5930 : Also allow things like /opt/perl/lib/$version, since
5931 : /opt/perl/lib/perl5... would be redundant.
5932 : The default "style" setting is made in installstyle.U
5933 case "$installstyle" in
5934 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5935 *) set dflt privlib lib/$version ;;
5940 There are some auxiliary files for $package that need to be put into a
5941 private library directory that is accessible by everyone.
5945 rp='Pathname where the private library files will reside?'
5948 privlibexp="$ansexp"
5949 : Change installation prefix, if necessary.
5950 if $test X"$prefix" != X"$installprefix"; then
5951 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5953 installprivlib="$privlibexp"
5956 : set the prefixup variable, to restore leading tilda escape
5957 prefixup='case "$prefixexp" in
5959 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5962 : determine where public architecture dependent libraries go
5965 : privlib default is /usr/local/lib/$package/$version
5966 : archlib default is /usr/local/lib/$package/$version/$archname
5967 : privlib may have an optional trailing /share.
5968 tdflt=`echo $privlib | $sed 's,/share$,,'`
5969 tdflt=$tdflt/$archname
5978 $spackage contains architecture-dependent library files. If you are
5979 sharing libraries in a heterogeneous environment, you might store
5980 these files in a separate location. Otherwise, you can just include
5981 them with the rest of the public library files.
5985 rp='Where do you want to put the public architecture-dependent libraries?'
5988 archlibexp="$ansexp"
5989 if $test X"$archlib" = X"$privlib"; then
5994 : Change installation prefix, if necessary.
5995 if $test X"$prefix" != X"$installprefix"; then
5996 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
5998 installarchlib="$archlibexp"
6001 : see if setuid scripts can be secure
6004 Some kernels have a bug that prevents setuid #! scripts from being
6005 secure. Some sites have disabled setuid #! scripts because of this.
6007 First let's decide if your kernel supports secure setuid #! scripts.
6008 (If setuid #! scripts would be secure but have been disabled anyway,
6009 don't say that they are secure if asked.)
6014 if $test -d /dev/fd; then
6015 echo "#!$ls" >reflect
6016 chmod +x,u+s reflect
6017 ./reflect >flect 2>&1
6018 if $contains "/dev/fd" flect >/dev/null; then
6019 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6023 If you are not sure if they are secure, I can check but I'll need a
6024 username and password different from the one you are using right now.
6025 If you don't have such a username or don't want me to test, simply
6029 rp='Other username to test security of setuid scripts with?'
6034 case "$d_suidsafe" in
6035 '') echo "I'll assume setuid scripts are *not* secure." >&4
6038 echo "Well, the $hint value is *not* secure." >&4
6040 *) echo "Well, the $hint value *is* secure." >&4
6045 $rm -f reflect flect
6046 echo "#!$ls" >reflect
6047 chmod +x,u+s reflect
6050 echo '"su" will (probably) prompt you for '"$ans's password."
6051 su $ans -c './reflect >flect'
6052 if $contains "/dev/fd" flect >/dev/null; then
6053 echo "Okay, it looks like setuid scripts are secure." >&4
6056 echo "I don't think setuid scripts are secure." >&4
6061 rp='Does your kernel have *secure* setuid scripts?'
6064 [yY]*) val="$define";;
6069 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6070 echo "(That's for file descriptors, not floppy disks.)"
6076 $rm -f reflect flect
6078 : now see if they want to do setuid emulation
6081 case "$d_suidsafe" in
6084 echo "No need to emulate SUID scripts since they are secure here." >&4
6088 Some systems have disabled setuid scripts, especially systems where
6089 setuid scripts cannot be secure. On systems where setuid scripts have
6090 been disabled, the setuid/setgid bits on scripts are currently
6091 useless. It is possible for $package to detect those bits and emulate
6092 setuid/setgid in a secure fashion. This emulation will only work if
6093 setuid scripts have been disabled in your kernel.
6097 "$define") dflt=y ;;
6100 rp="Do you want to do setuid/setgid emulation?"
6103 [yY]*) val="$define";;
6111 : see if this is a malloc.h system
6112 : we want a real compile instead of Inhdr because some systems have a
6113 : malloc.h that just gives a compile error saying to use stdlib.h instead
6118 int main () { return 0; }
6121 if eval $compile; then
6122 echo "<malloc.h> found." >&4
6125 echo "<malloc.h> NOT found." >&4
6132 : check for void type
6134 echo "Checking to see how well your C compiler groks the void type..." >&4
6135 case "$voidflags" in
6147 extern void moo(); /* function returning void */
6148 void (*goo)(); /* ptr to func returning void */
6150 void *hue; /* generic ptr */
6163 int main() { sub(); }
6165 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6166 voidflags=$defvoidused
6167 echo "Good. It appears to support void to the level $package wants.">&4
6168 if $contains warning .out >/dev/null 2>&1; then
6169 echo "However, you might get some warnings that look like this:"
6173 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6174 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6175 echo "It supports 1..."
6176 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6177 echo "It also supports 2..."
6178 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6180 echo "And it supports 4 but not 8 definitely."
6182 echo "It doesn't support 4..."
6183 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6185 echo "But it supports 8."
6188 echo "Neither does it support 8."
6192 echo "It does not support 2..."
6193 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6195 echo "But it supports 4 and 8."
6197 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6199 echo "And it supports 4 but has not heard about 8."
6201 echo "However it supports 8 but not 4."
6206 echo "There is no support at all for void."
6211 case "$voidflags" in
6214 Support flag bits are:
6215 1: basic void declarations.
6216 2: arrays of pointers to functions returning void.
6217 4: operations between pointers to and addresses of void functions.
6218 8: generic void pointers.
6221 rp="Your void support flags add up to what?"
6228 : check for length of pointer
6232 echo "Checking to see how big your pointers are..." >&4
6233 if test "$voidflags" -gt 7; then
6234 echo '#define VOID_PTR char *' > try.c
6236 echo '#define VOID_PTR void *' > try.c
6246 printf("%d\n", (int)sizeof(VOID_PTR));
6251 if eval $compile_ok; then
6252 ptrsize=`$run ./try`
6253 echo "Your pointers are $ptrsize bytes long."
6256 echo "(I can't seem to compile the test program. Guessing...)" >&4
6257 rp="What is the size of a pointer (in bytes)?"
6264 case "$use64bitall" in
6265 "$define"|true|[yY]*)
6269 *** You have chosen a maximally 64-bit build,
6270 *** but your pointers are only 4 bytes wide.
6271 *** Please rerun Configure without -Duse64bitall.
6276 *** Since you have quads, you could possibly try with -Duse64bitint.
6281 *** Cannot continue, aborting.
6292 : determine whether to use malloc wrapping
6294 case "$usemallocwrap" in
6295 [yY]*|true|$define) dflt='y' ;;
6296 [nN]*|false|$undef) dflt='n' ;;
6297 *) case "$usedevel" in
6298 [yY]*|true|$define) dflt='y' ;;
6303 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6305 usemallocwrap="$ans"
6308 usemallocwrap="$define" ;;
6310 usemallocwrap="$undef" ;;
6313 : determine which malloc to compile in
6315 case "$usemymalloc" in
6316 [yY]*|true|$define) dflt='y' ;;
6317 [nN]*|false|$undef) dflt='n' ;;
6318 *) case "$ptrsize" in
6324 rp="Do you wish to attempt to use the malloc that comes with $package?"
6330 mallocsrc='malloc.c'
6331 mallocobj="malloc$_o"
6332 d_mymalloc="$define"
6335 : Remove malloc from list of libraries to use
6336 echo "Removing unneeded -lmalloc from library list" >&4
6337 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6340 echo "libs = $libs" >&4
6352 : compute the return types of malloc and free
6354 $cat >malloc.c <<END
6358 #include <sys/types.h>
6372 case "$malloctype" in
6374 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6381 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6385 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6392 echo "Your system uses $freetype free(), it would seem." >&4
6396 After $package is installed, you may wish to install various
6397 add-on modules and utilities. Typically, these add-ons will
6398 be installed under $prefix with the rest
6399 of this package. However, you may wish to install such add-ons
6400 elsewhere under a different prefix.
6402 If you do not wish to put everything under a single prefix, that's
6403 ok. You will be prompted for the individual locations; this siteprefix
6404 is only used to suggest the defaults.
6406 The default should be fine for most people.
6410 rp='Installation prefix to use for add-on modules and utilities?'
6411 : XXX Here might be another good place for an installstyle setting.
6412 case "$siteprefix" in
6414 *) dflt=$siteprefix ;;
6417 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6419 case "$siteprefix" in
6423 *) oldsiteprefix="$prefix";;
6428 siteprefixexp="$ansexp"
6430 : determine where site specific libraries go.
6431 : Usual default is /usr/local/lib/perl5/site_perl/$version
6432 : The default "style" setting is made in installstyle.U
6433 : XXX No longer works with Prefixit stuff.
6434 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6436 '') case "$installstyle" in
6437 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6438 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6446 The installation process will create a directory for
6447 site-specific extensions and modules. Most users find it convenient
6448 to place all site-specific files in this directory rather than in the
6449 main distribution directory.
6453 rp='Pathname for the site-specific library files?'
6456 sitelibexp="$ansexp"
6457 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6458 : Change installation prefix, if necessary.
6459 if $test X"$prefix" != X"$installprefix"; then
6460 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6462 installsitelib="$sitelibexp"
6465 : determine where site specific architecture-dependent libraries go.
6466 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6467 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6468 : sitelib may have an optional trailing /share.
6470 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6471 dflt="$dflt/$archname"
6476 set sitearch sitearch none
6480 The installation process will also create a directory for
6481 architecture-dependent site-specific extensions and modules.
6485 rp='Pathname for the site-specific architecture-dependent library files?'
6488 sitearchexp="$ansexp"
6489 : Change installation prefix, if necessary.
6490 if $test X"$prefix" != X"$installprefix"; then
6491 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6493 installsitearch="$sitearchexp"
6498 The installation process will also create a directory for
6499 vendor-supplied add-ons. Vendors who supply perl with their system
6500 may find it convenient to place all vendor-supplied files in this
6501 directory rather than in the main distribution directory. This will
6502 ease upgrades between binary-compatible maintenance versions of perl.
6504 Of course you may also use these directories in whatever way you see
6505 fit. For example, you might use them to access modules shared over a
6506 company-wide network.
6508 The default answer should be fine for most people.
6509 This causes further questions about vendor add-ons to be skipped
6510 and no vendor-specific directories will be configured for perl.
6513 rp='Do you want to configure vendor-specific add-on directories?'
6514 case "$usevendorprefix" in
6515 define|true|[yY]*) dflt=y ;;
6516 *) : User may have set vendorprefix directly on Configure command line.
6517 case "$vendorprefix" in
6526 rp='Installation prefix to use for vendor-supplied add-ons?'
6527 case "$vendorprefix" in
6529 *) dflt=$vendorprefix ;;
6532 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6534 case "$vendorprefix" in
6538 *) oldvendorprefix="$prefix";;
6542 usevendorprefix="$define"
6544 vendorprefixexp="$ansexp"
6546 *) usevendorprefix="$undef"
6552 case "$vendorprefix" in
6553 '') d_vendorlib="$undef"
6557 *) d_vendorlib="$define"
6558 : determine where vendor-supplied modules go.
6559 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6560 case "$vendorlib" in
6562 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6563 case "$installstyle" in
6564 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6565 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6568 *) dflt="$vendorlib"
6572 rp='Pathname for the vendor-supplied library files?'
6575 vendorlibexp="$ansexp"
6578 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6579 : Change installation prefix, if necessary.
6580 if $test X"$prefix" != X"$installprefix"; then
6581 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6583 installvendorlib="$vendorlibexp"
6586 case "$vendorprefix" in
6587 '') d_vendorarch="$undef"
6591 *) d_vendorarch="$define"
6592 : determine where vendor-supplied architecture-dependent libraries go.
6593 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6594 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6595 : vendorlib may have an optional trailing /share.
6596 case "$vendorarch" in
6597 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6598 dflt="$dflt/$archname"
6600 *) dflt="$vendorarch" ;;
6603 rp='Pathname for vendor-supplied architecture-dependent files?'
6606 vendorarchexp="$ansexp"
6609 : Change installation prefix, if necessary.
6610 if $test X"$prefix" != X"$installprefix"; then
6611 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6613 installvendorarch="$vendorarchexp"
6616 : Final catch-all directories to search
6619 Lastly, you can have perl look in other directories for extensions and
6620 modules in addition to those already specified.
6621 These directories will be searched after
6625 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6626 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6628 case "$otherlibdirs" in
6629 ''|' ') dflt='none' ;;
6630 *) dflt="$otherlibdirs" ;;
6633 Enter a colon-separated set of extra paths to include in perl's @INC
6634 search path, or enter 'none' for no extra paths.
6638 rp='Colon-separated list of additional directories for perl to search?'
6641 ' '|''|none) otherlibdirs=' ' ;;
6642 *) otherlibdirs="$ans" ;;
6644 case "$otherlibdirs" in
6648 set d_perl_otherlibdirs
6651 : Cruising for prototypes
6653 echo "Checking out function prototypes..." >&4
6654 $cat >prototype.c <<EOCP
6659 int main(int argc, char *argv[]) {
6662 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6663 echo "Your C compiler appears to support function prototypes."
6666 echo "Your C compiler doesn't seem to understand function prototypes."
6673 case "$prototype" in
6675 *) ansi2knr='ansi2knr'
6680 This version of $package can only be compiled by a compiler that
6681 understands function prototypes. Unfortunately, your C compiler
6683 doesn't seem to understand them. Sorry about that.
6685 If GNU cc is available for your system, perhaps you could try that instead.
6687 Eventually, we hope to support building Perl with pre-ANSI compilers.
6688 If you would like to help in that effort, please contact <perlbug@perl.org>.
6690 Aborting Configure now.
6696 : determine where public executables go
6701 rp='Pathname where the public executables will reside?'
6703 if $test "X$ansexp" != "X$binexp"; then
6708 : Change installation prefix, if necessary.
6709 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6710 if $test X"$prefix" != X"$installprefix"; then
6711 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6713 installbin="$binexp"
6722 Perl can be built with extra modules or bundles of modules which
6723 will be fetched from the CPAN and installed alongside Perl.
6725 Notice that you will need access to the CPAN; either via the Internet,
6726 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6727 be asked later to configure the CPAN.pm module which will in turn do
6728 the installation of the rest of the extra modules or bundles.)
6730 Notice also that if the modules require any external software such as
6731 libraries and headers (the libz library and the zlib.h header for the
6732 Compress::Zlib module, for example) you MUST have any such software
6733 already installed, this configuration process will NOT install such
6736 If this doesn't make any sense to you, just accept the default '$dflt'.
6738 rp='Install any extra modules (y or n)?'
6744 Please list any extra modules or bundles to be installed from CPAN,
6745 with spaces between the names. The names can be in any format the
6746 'install' command of CPAN.pm will understand. (Answer 'none',
6747 without the quotes, to install no extra modules or bundles.)
6757 $rm -f ../extras.lst
6759 *) echo "(Saving the list of extras for later...)"
6760 echo "$extras" > ../extras.lst
6768 : determine where html pages for programs go
6769 set html1dir html1dir none
6773 If you wish to install html files for programs in $spackage, indicate
6774 the appropriate directory here. To skip installing html files,
6778 ''|none|$undef|' ') dflt=none ;;
6779 *) dflt=$html1dir ;;
6782 rp="Directory for the main $spackage html pages?"
6785 html1direxp="$ansexp"
6786 : Use ' ' for none so value is preserved next time through Configure
6787 $test X"$html1dir" = "X" && html1dir=' '
6788 : Change installation prefix, if necessary.
6789 if $test X"$prefix" != X"$installprefix"; then
6790 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
6792 installhtml1dir="$html1direxp"
6795 : determine where html pages for libraries and modules go
6796 set html3dir html3dir none
6800 If you wish to install html files for modules associated with $spackage,
6801 indicate the appropriate directory here. To skip installing html files,
6804 : There is no obvious default. If they have specified html1dir, then
6805 : try to key off that, possibly changing .../html1 into .../html3.
6807 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6808 *) dflt=$html3dir ;;
6811 rp="Directory for the $spackage module html pages?"
6814 html3direxp="$ansexp"
6815 : Use ' ' for none so value is preserved next time through Configure
6816 $test X"$html3dir" = "X" && html3dir=' '
6817 : Change installation prefix, if necessary.
6818 if $test X"$prefix" != X"$installprefix"; then
6819 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
6821 installhtml3dir="$html3direxp"
6824 : Find perl5.005 or later.
6825 echo "Looking for a previously installed perl5.005 or later... "
6827 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6828 : Check if this perl is recent and can load a simple module
6829 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6832 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6842 '') echo "None found. That's ok.";;
6843 *) echo "Using $perl5." ;;
6846 : Determine list of previous versions to include in @INC
6847 $cat > getverlist <<EOPL
6850 \$api_versionstring = "$api_versionstring";
6851 \$version = "$version";
6852 \$stem = "$sitelib_stem";
6853 \$archname = "$archname";
6855 $cat >> getverlist <<'EOPL'
6856 # Can't have leading @ because metaconfig interprets it as a command!
6857 ;@inc_version_list=();
6858 # XXX Redo to do opendir/readdir?
6861 ;@candidates = glob("5.*");
6867 # XXX ToDo: These comparisons must be reworked when two-digit
6868 # subversions come along, so that 5.7.10 compares as greater than
6869 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6870 # widespread that we can use the built-in version vectors rather
6871 # than reinventing them here. For 5.6.0, however, we must
6872 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6873 foreach $d (@candidates) {
6874 if ($d lt $version) {
6875 if ($d ge $api_versionstring) {
6876 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6878 elsif ($d ge "5.005") {
6879 unshift(@inc_version_list, grep { -d } $d);
6883 # Skip newer version. I.e. don't look in
6884 # 5.7.0 if we're installing 5.6.1.
6888 if (@inc_version_list) {
6889 print join(' ', @inc_version_list);
6892 # Blank space to preserve value for next Configure run.
6897 case "$inc_version_list" in
6898 '') if test -x "$perl5$exe_ext"; then
6899 dflt=`$perl5 getverlist`
6904 $undef) dflt='none' ;;
6905 *) eval dflt=\"$inc_version_list\" ;;
6908 ''|' ') dflt=none ;;
6915 In order to ease the process of upgrading, this version of perl
6916 can be configured to use modules built and installed with earlier
6917 versions of perl that were installed under $prefix. Specify here
6918 the list of earlier versions that this version of perl should check.
6919 If Configure detected no earlier versions of perl installed under
6920 $prefix, then the list will be empty. Answer 'none' to tell perl
6921 to not search earlier versions.
6923 The default should almost always be sensible, so if you're not sure,
6924 just accept the default.
6927 rp='List of earlier versions to include in @INC?'
6930 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6931 *) inc_version_list="$ans" ;;
6933 case "$inc_version_list" in
6935 inc_version_list_init='0';;
6936 *) inc_version_list_init=`echo $inc_version_list |
6937 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6942 : determine whether to install perl also as /usr/bin/perl
6945 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6947 Many scripts expect perl to be installed as /usr/bin/perl.
6949 If you want to, I can install the perl you are about to compile
6950 as /usr/bin/perl (in addition to $bin/perl).
6952 if test -f /usr/bin/perl; then
6955 However, please note that because you already have a /usr/bin/perl,
6956 overwriting that with a new Perl would very probably cause problems.
6957 Therefore I'm assuming you don't want to do that (unless you insist).
6960 case "$installusrbinperl" in
6961 "$define"|[yY]*) dflt='y';;
6967 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
6970 case "$installusrbinperl" in
6971 "$undef"|[nN]*) dflt='n';;
6975 rp="Do you want to install perl as /usr/bin/perl?"
6978 [yY]*) val="$define";;
6984 set installusrbinperl
6988 echo "Checking for GNU C Library..." >&4
6990 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6991 alone are insufficient to distinguish different versions, such as
6992 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6993 libc version 2.1.0. A. Dougherty, June 3, 2002.
6999 # ifdef __GLIBC_MINOR__
7000 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7001 # include <gnu/libc-version.h>
7002 printf("%s\n", gnu_get_libc_version());
7004 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7007 printf("%d\n", __GLIBC__);
7016 if eval $compile_ok && $run ./try > glibc.ver; then
7018 gnulibc_version=`$cat glibc.ver`
7019 echo "You are using the GNU C Library version $gnulibc_version"
7023 echo "You are not using the GNU C Library"
7025 $rm -f try try.* glibc.ver
7029 : see if nm is to be used to determine whether a symbol is defined or not
7033 case "$d_gnulibc" in
7036 echo "nm probably won't work on the GNU C Library." >&4
7042 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7044 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7045 echo "'nm' won't be sufficient on this sytem." >&4
7051 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7052 if $test $dflt -gt 20; then
7062 true|$define) dflt=y;;
7069 I can use $nm to extract the symbols from your C libraries. This
7070 is a time consuming task which may generate huge output on the disk (up
7071 to 3 megabytes) but that should make the symbols extraction faster. The
7072 alternative is to skip the 'nm' extraction part and to compile a small
7073 test program instead to determine whether each symbol is present. If
7074 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7075 this may be the best solution.
7077 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7080 rp="Shall I use $nm to extract C symbols from the libraries?"
7083 [Nn]*) usenm=false;;
7092 : nm options which may be necessary
7094 '') if $test -f /mach_boot; then
7096 elif $test -d /usr/ccs/lib; then
7097 nm_opt='-p' # Solaris (and SunOS?)
7098 elif $test -f /dgux; then
7100 elif $test -f /lib64/rld; then
7101 nm_opt='-p' # 64-bit Irix
7107 : nm options which may be necessary for shared libraries but illegal
7108 : for archive libraries. Thank you, Linux.
7109 case "$nm_so_opt" in
7110 '') case "$myuname" in
7112 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7113 nm_so_opt='--dynamic'
7122 : get list of predefined functions in a handy place
7127 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7133 *) for thislib in $libs; do
7136 : Handle C library specially below.
7139 thislib=`echo $thislib | $sed -e 's/^-l//'`
7140 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7142 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7144 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7146 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7148 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7150 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7152 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7157 libnames="$libnames $try"
7159 *) libnames="$libnames $thislib" ;;
7168 for xxx in $libpth; do
7169 $test -r $1 || set $xxx/libc.$so
7170 : The messy sed command sorts on library version numbers.
7172 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7173 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7175 s/[0-9][0-9]*/0000&/g
7176 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7179 $sort | $sed -e 's/^.* //'`
7182 $test -r $1 || set /usr/ccs/lib/libc.$so
7183 $test -r $1 || set /lib/libsys_s$_a
7189 if $test -r "$1"; then
7190 echo "Your (shared) C library seems to be in $1."
7192 elif $test -r /lib/libc && $test -r /lib/clib; then
7193 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7195 libc='/lib/clib /lib/libc'
7196 if $test -r /lib/syslib; then
7197 echo "(Your math library is in /lib/syslib.)"
7198 libc="$libc /lib/syslib"
7200 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7201 echo "Your C library seems to be in $libc, as you said before."
7202 elif $test -r $incpath/usr/lib/libc$_a; then
7203 libc=$incpath/usr/lib/libc$_a;
7204 echo "Your C library seems to be in $libc. That's fine."
7205 elif $test -r /lib/libc$_a; then
7207 echo "Your C library seems to be in $libc. You're normal."
7209 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7211 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7212 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7213 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7215 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7217 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7220 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7222 if $test -r "$tans"; then
7223 echo "Your C library seems to be in $tans, of all places."
7229 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7233 If the guess above is wrong (which it might be if you're using a strange
7234 compiler, or your machine supports multiple models), you can override it here.
7239 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7241 I can't seem to find your C library. I've looked in the following places:
7244 $sed 's/^/ /' libpath
7247 None of these seems to contain your C library. I need to get its name...
7252 rp='Where is your C library?'
7257 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7258 set X `cat libnames`
7261 case $# in 1) xxx=file; esac
7262 echo "Extracting names from the following $xxx for later perusal:" >&4
7264 $sed 's/^/ /' libnames >&4
7266 $echo $n "This may take a while...$c" >&4
7270 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7271 *) $nm $nm_opt $file 2>/dev/null;;
7276 $grep fprintf libc.tmp > libc.ptf
7277 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7278 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7280 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7282 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7284 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7286 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7288 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7290 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7292 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7294 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7296 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7298 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7300 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7302 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7304 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7305 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7307 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7309 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7311 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7313 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7315 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7317 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7319 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7321 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7323 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7325 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7327 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7329 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7331 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7333 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7335 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7338 $nm -p $* 2>/dev/null >libc.tmp
7339 $grep fprintf libc.tmp > libc.ptf
7340 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7341 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7347 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7349 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7350 for thisname in $libnames $libc; do
7351 $ar t $thisname >>libc.tmp
7353 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7355 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7356 # Repeat libc to extract forwarders to DLL entries too
7357 for thisname in $libnames $libc; do
7358 $ar tv $thisname >>libc.tmp
7359 # Revision 50 of EMX has bug in $ar.
7360 # it will not extract forwarders to DLL entries
7361 # Use emximp which will extract exactly them.
7362 emximp -o tmp.imp $thisname \
7364 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7365 < tmp.imp >>libc.tmp
7368 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7371 echo "$ar didn't seem to work right." >&4
7372 echo "Maybe this is a Cray...trying bld instead..." >&4
7373 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7375 for thisname in $libnames; do
7377 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7378 $ar t $thisname >>libc.tmp
7382 echo "That didn't work either. Giving up." >&4
7392 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7393 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7395 *) if $test -f /lib/syscalls.exp; then
7397 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7398 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7404 $rm -f libnames libpath
7406 : see if dld is available
7410 : is a C symbol defined?
7413 -v) tf=libc.tmp; tdc="";;
7414 -a) tf=libc.tmp; tdc="[]";;
7415 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7418 case "$reuseval-$4" in
7420 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7425 if $test "$runnm" = true; then
7426 if $contains $tlook $tf >/dev/null 2>&1; then
7428 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7429 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7430 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7431 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7432 $rm -f try$_exe try.c core core.* try.core;
7435 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7436 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7437 $rm -f try$_exe try.c;
7442 $define) tval=true;;
7449 : define an is-in-libc? function
7450 inlibc='echo " "; td=$define; tu=$undef;
7451 sym=$1; var=$2; eval "was=\$$2";
7453 case "$reuseval$was" in
7463 echo "$sym() found." >&4;
7464 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7466 echo "$sym() NOT found." >&4;
7467 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7471 $define) echo "$sym() found." >&4;;
7472 *) echo "$sym() NOT found." >&4;;
7476 : see if dlopen exists
7483 : determine which dynamic loading, if any, to compile in
7485 dldir="ext/DynaLoader"
7498 $define) dflt='y' ;;
7501 $define) dflt='y' ;;
7503 : Does a dl_xxx.xs file exist for this operating system
7504 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7507 rp="Do you wish to use dynamic loading?"
7514 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7515 dflt="$dldir/dl_${osname}.xs"
7516 elif $test "$d_dlopen" = "$define" ; then
7517 dflt="$dldir/dl_dlopen.xs"
7518 elif $test "$i_dld" = "$define" ; then
7519 dflt="$dldir/dl_dld.xs"
7524 *) dflt="$dldir/$dlsrc"
7527 echo "The following dynamic loading files are available:"
7528 : Can not go over to $dldir because getfile has path hard-coded in.
7529 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7530 rp="Source file to use for dynamic loading"
7536 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7540 Some systems may require passing special flags to $cc -c to
7541 compile modules that will be used to create a shared library.
7542 To use no flags, say "none".
7545 case "$cccdlflags" in
7546 '') case "$gccversion" in
7547 '') case "$osname" in
7549 next) dflt='none' ;;
7550 irix*) dflt='-KPIC' ;;
7551 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7552 sunos) dflt='-pic' ;;
7556 *) case "$osname" in
7557 darwin) dflt='none' ;;
7558 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7563 *) dflt="$cccdlflags" ;;
7565 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7568 none) cccdlflags=' ' ;;
7569 *) cccdlflags="$ans" ;;
7574 Some systems use ld to create libraries that can be dynamically loaded,
7575 while other systems (such as those using ELF) use $cc.
7579 '') $cat >try.c <<EOM
7580 /* Test for whether ELF binaries are produced */
7588 int i = open("a.out",O_RDONLY);
7591 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7592 exit(0); /* succeed (yes, it's ELF) */
7597 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7599 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7603 echo "I'll use ld to build dynamic libraries."
7612 rp="What command should be used to create dynamic libraries?"
7618 Some systems may require passing special flags to $ld to create a
7619 library that can be dynamically loaded. If your ld flags include
7620 -L/other/path options to locate libraries outside your loader's normal
7621 search path, you may need to specify those -L options here as well. To
7622 use no flags, say "none".
7625 case "$lddlflags" in
7626 '') case "$osname" in
7627 beos) dflt='-nostart' ;;
7629 case "$gccversion" in
7630 '') dflt="$dflt +vnocompatwarnings" ;;
7633 linux|irix*|gnu*) dflt='-shared' ;;
7634 next) dflt='none' ;;
7635 solaris) dflt='-G' ;;
7636 sunos) dflt='-assert nodefinitions' ;;
7637 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7641 *) dflt="$lddlflags" ;;
7644 : Try to guess additional flags to pick up local libraries.
7645 : Be careful not to append to a plain 'none'
7649 for thisflag in $ldflags; do
7654 *) dflt="$dflt $thisflag" ;;
7661 ''|' ') dflt='none' ;;
7664 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7667 none) lddlflags=' ' ;;
7668 *) lddlflags="$ans" ;;
7673 Some systems may require passing special flags to $cc to indicate that
7674 the resulting executable will use dynamic linking. To use no flags,
7678 case "$ccdlflags" in
7679 '') case "$osname" in
7680 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7681 next|sunos) dflt='none' ;;
7685 *) dflt="$ccdlflags" ;;
7687 rp="Any special flags to pass to $cc to use dynamic linking?"
7690 none) ccdlflags=' ' ;;
7691 *) ccdlflags="$ans" ;;
7705 # No dynamic loading being used, so don't bother even to prompt.
7708 *) case "$useshrplib" in
7709 '') case "$osname" in
7710 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7712 also='Building a shared libperl is required for dynamic loading to work on your system.'
7717 also='Building a shared libperl is needed for MAB support.'
7735 The perl executable is normally obtained by linking perlmain.c with
7736 libperl${_a}, any static extensions (usually just DynaLoader), and
7737 any other libraries needed on this system (such as -lm, etc.). Since
7738 your system supports dynamic loading, it is probably possible to build
7739 a shared libperl.$so. If you will have more than one executable linked
7740 to libperl.$so, this will significantly reduce the size of each
7741 executable, but it may have a noticeable affect on performance. The
7742 default is probably sensible for your system.
7746 rp="Build a shared libperl.$so (y/n)"
7750 useshrplib='true' ;;
7751 *) useshrplib='false' ;;
7756 case "$useshrplib" in
7760 # Figure out a good name for libperl.so. Since it gets stored in
7761 # a version-specific architecture-dependent library, the version
7762 # number isn't really that important, except for making cc/ld happy.
7764 # A name such as libperl.so.3.1
7765 majmin="libperl.$so.$patchlevel.$subversion"
7766 # A name such as libperl.so.301
7767 majonly=`echo $patchlevel $subversion |
7768 $awk '{printf "%d%02d", $1, $2}'`
7769 majonly=libperl.$so.$majonly
7770 # I'd prefer to keep the os-specific stuff here to a minimum, and
7771 # rely on figuring it out from the naming of libc.
7772 case "${osname}${osvers}" in
7775 # XXX How handle the --version stuff for MAB?
7777 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7780 cygwin*) # ld links against an importlib
7781 dflt=libperl$lib_ext
7783 *) # Try to guess based on whether libc has major.minor.
7785 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7786 *libc.$so.[0-9]*) dflt=$majonly ;;
7787 *) dflt=libperl.$so ;;
7797 I need to select a good name for the shared libperl. If your system uses
7798 library names with major and minor numbers, then you might want something
7799 like $majmin. Alternatively, if your system uses a single version
7800 number for shared libraries, then you might want to use $majonly.
7801 Or, your system might be quite happy with a simple libperl.$so.
7803 Since the shared libperl will get installed into a version-specific
7804 architecture-dependent directory, the version number of the shared perl
7805 library probably isn't important, so the default should be o.k.
7808 rp='What name do you want to give to the shared libperl?'
7811 echo "Ok, I'll use $libperl"
7814 libperl="libperl${_a}"
7818 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7822 WARNING: Use of the shrpdir variable for the installation location of
7823 the shared $libperl is not supported. It was never documented and
7824 will not work in this version. Let me (perlbug@perl.org)
7825 know of any problems this may cause.
7831 But your current setting of $shrpdir is
7832 the default anyway, so it's harmless.
7837 Further, your current attempted setting of $shrpdir
7838 conflicts with the value of $archlibexp/CORE
7839 that installperl will use.
7846 # How will the perl executable find the installed shared $libperl?
7847 # Add $xxx to ccdlflags.
7848 # If we can't figure out a command-line option, use $shrpenv to
7849 # set env LD_RUN_PATH. The main perl makefile uses this.
7850 shrpdir=$archlibexp/CORE
7853 if "$useshrplib"; then
7856 # We'll set it in Makefile.SH...
7861 freebsd|netbsd|openbsd|interix)
7862 xxx="-Wl,-R$shrpdir"
7864 bsdos|linux|irix*|dec_osf|gnu*)
7865 xxx="-Wl,-rpath,$shrpdir"
7868 # next doesn't like the default...
7871 # beos doesn't like the default, either.
7874 # hpux doesn't like the default, either.
7875 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7878 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7884 # Only add $xxx if it isn't already in ccdlflags.
7885 case " $ccdlflags " in
7887 *) ccdlflags="$ccdlflags $xxx"
7890 Adding $xxx to the flags
7891 passed to $ld so that the perl executable will find the
7892 installed shared $libperl.
7900 # Fix ccdlflags in AIX for building external extensions.
7901 # (For building Perl itself bare -bE:perl.exp is needed,
7902 # Makefile.SH takes care of this.)
7904 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7906 # Respect a hint or command-line value.
7908 '') shrpenv="$tmp_shrpenv" ;;
7910 case "$ldlibpthname" in
7911 '') ldlibpthname=LD_LIBRARY_PATH ;;
7912 none) ldlibpthname='' ;;
7915 : determine where manual pages are on this system
7919 syspath='/usr/share/man/man1 /usr/man/man1'
7920 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7921 syspath="$syspath /usr/man/u_man/man1"
7922 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7923 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7924 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7925 sysman=`./loc . /usr/man/man1 $syspath`
7928 if $test -d "$sysman"; then
7929 echo "System manual is in $sysman." >&4
7931 echo "Could not find manual pages in source form." >&4
7934 : determine where manual pages go
7935 set man1dir man1dir none
7939 $spackage has manual pages available in source form.
7943 echo "However, you don't have nroff, so they're probably useless to you."
7945 '') man1dir="none";;
7948 echo "If you don't want the manual sources installed, answer 'none'."
7953 lookpath="$prefixexp/share/man/man1"
7954 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7955 lookpath="$lookpath $prefixexp/man/p_man/man1"
7956 lookpath="$lookpath $prefixexp/man/u_man/man1"
7957 lookpath="$lookpath $prefixexp/man/man.1"
7959 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7960 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7970 rp="Where do the main $spackage manual pages (source) go?"
7972 if $test "X$man1direxp" != "X$ansexp"; then
7976 man1direxp="$ansexp"
7982 : Change installation prefix, if necessary.
7983 if $test X"$prefix" != X"$installprefix"; then
7984 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7986 installman1dir="$man1direxp"
7989 : What suffix to use on installed man pages
7996 rp="What suffix should be used for the main $spackage man pages?"
7998 '') case "$man1dir" in
8012 *) dflt="$man1ext";;
8019 : see if we can have long filenames
8021 first=123456789abcdef
8023 if (echo hi >$first) 2>/dev/null; then
8024 if $test -f 123456789abcde; then
8025 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8028 echo 'You can have filenames longer than 14 characters.'>&4
8033 You can't have filenames longer than 14 chars.
8034 You can't even think about them!
8040 $rm -rf 123456789abcde*
8042 : determine where library module manual pages go
8043 set man3dir man3dir none
8047 $spackage has manual pages for many of the library modules.
8053 However, you don't have nroff, so they're probably useless to you.
8056 '') man3dir="none";;
8060 case "$d_flexfnam" in
8063 However, your system can't handle the long file names like File::Basename.3.
8066 '') man3dir="none";;
8070 echo "If you don't want the manual sources installed, answer 'none'."
8071 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8073 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8074 if $test -d "$privlib/man/man3"; then
8077 WARNING: Previous versions of perl installed man3 pages into
8078 $privlib/man/man3. This version will suggest a
8079 new default of $dflt.
8083 rp='Do you wish to preserve the old behavior?(y/n)'
8086 y*) dflt="$privlib/man/man3" ;;
8091 *) dflt="$man3dir" ;;
8098 rp="Where do the $package library man pages (source) go?"
8101 man3direxp="$ansexp"
8107 : Change installation prefix, if necessary.
8108 if $test X"$prefix" != X"$installprefix"; then
8109 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8111 installman3dir="$man3direxp"
8114 : What suffix to use on installed man pages
8120 rp="What suffix should be used for the $package library man pages?"
8122 '') case "$man3dir" in
8136 *) dflt="$man3ext";;
8143 : see if we have to deal with yellow pages, now NIS.
8144 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8145 if $test -f /usr/etc/nibindd; then
8147 echo "I'm fairly confident you're on a NeXT."
8149 rp='Do you get the hosts file via NetInfo?'
8158 y*) hostcat='nidump hosts .';;
8159 *) case "$hostcat" in
8160 nidump*) hostcat='';;
8170 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8178 rp='Are you getting the hosts file via yellow pages?'
8181 y*) hostcat='ypcat hosts';;
8182 *) hostcat='cat /etc/hosts';;
8188 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8191 '') test -f /etc/group && groupcat='cat /etc/group';;
8194 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8197 : now get the host name
8199 echo "Figuring out host name..." >&4
8200 case "$myhostname" in
8202 echo 'Maybe "hostname" will work...'
8203 if tans=`sh -c hostname 2>&1` ; then
8211 if $test "$cont"; then
8213 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8214 if tans=`cat /etc/systemid 2>&1` ; then
8216 phostname='cat /etc/systemid'
8217 echo "Whadyaknow. Xenix always was a bit strange..."
8220 elif $test -r /etc/systemid; then
8221 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8224 if $test "$cont"; then
8225 echo 'No, maybe "uuname -l" will work...'
8226 if tans=`sh -c 'uuname -l' 2>&1` ; then
8228 phostname='uuname -l'
8230 echo 'Strange. Maybe "uname -n" will work...'
8231 if tans=`sh -c 'uname -n' 2>&1` ; then
8233 phostname='uname -n'
8235 echo 'Oh well, maybe I can mine it out of whoami.h...'
8236 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8237 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8238 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8240 case "$myhostname" in
8241 '') echo "Does this machine have an identity crisis or something?"
8244 echo "Well, you said $myhostname before..."
8245 phostname='echo $myhostname';;
8251 case "$myhostname" in
8252 '') myhostname=noname ;;
8254 : you do not want to know about this
8259 if $test "$myhostname" ; then
8261 rp='Your host name appears to be "'$myhostname'".'" Right?"
8269 : bad guess or no guess
8270 while $test "X$myhostname" = X ; do
8272 rp="Please type the (one word) name of your host:"
8277 : translate upper to lower if necessary
8278 case "$myhostname" in
8280 echo "(Normalizing case in your host name)"
8281 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8285 case "$myhostname" in
8287 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8288 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8289 echo "(Trimming domain name from host name--host name is now $myhostname)"
8291 *) case "$mydomain" in
8294 test "X$hostcat" = "Xypcat hosts" &&
8295 ypmatch "$myhostname" hosts 2>/dev/null |\
8296 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8299 test "X$hostcat" != "X" &&
8300 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8301 /[ ]$myhostname[ . ]/p" > hosts
8304 if $test -f hosts; then
8305 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8306 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8307 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8308 hosts | $sort | $uniq | \
8309 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8310 case `$echo X$dflt` in
8311 X*\ *) echo "(Several hosts in the database matched hostname)"
8314 X.) echo "(You do not have fully-qualified names in the hosts database)"
8318 echo "(I cannot locate a hosts database anywhere)"
8323 tans=`./loc resolv.conf X /etc /usr/etc`
8324 if $test -f "$tans"; then
8325 echo "(Attempting domain name extraction from $tans)"
8326 dflt=.`$sed -n -e 's/ / /g' \
8327 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8328 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8330 .) dflt=.`$sed -n -e 's/ / /g' \
8331 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8332 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8339 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8340 dflt=.`sh -c domainname 2>/dev/null`
8343 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8347 case "$dflt$osname" in
8348 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8349 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8353 .) echo "(Lost all hope -- silly guess then)"
8359 *) dflt="$mydomain";;
8363 rp="What is your domain name?"
8373 : translate upper to lower if necessary
8376 echo "(Normalizing case in your domain name)"
8377 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8381 : a little sanity check here
8382 case "$phostname" in
8385 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8386 $myhostname$mydomain|$myhostname) ;;
8388 case "$phostname" in
8390 echo "(That doesn't agree with your whoami.h file, by the way.)"
8393 echo "(That doesn't agree with your $phostname command, by the way.)"
8403 I need to get your e-mail address in Internet format if possible, i.e.
8404 something like user@host.domain. Please answer accurately since I have
8405 no easy means to double check it. The default value provided below
8406 is most probably close to reality but may not be valid from outside
8407 your organization...
8411 while test "$cont"; do
8413 '') dflt="$cf_by@$myhostname$mydomain";;
8414 *) dflt="$cf_email";;
8416 rp='What is your e-mail address?'
8422 rp='Address does not look like an Internet one. Use it anyway?'
8438 If you or somebody else will be maintaining perl at your site, please
8439 fill in the correct e-mail address here so that they may be contacted
8440 if necessary. Currently, the "perlbug" program included with perl
8441 will send mail to this address in addition to perlbug@perl.org. You may
8442 enter "none" for no administrator.
8445 case "$perladmin" in
8446 '') dflt="$cf_email";;
8447 *) dflt="$perladmin";;
8449 rp='Perl administrator e-mail address'
8453 : determine whether to only install version-specific parts.
8456 Do you want to install only the version-specific parts of the perl
8457 distribution? Usually you do *not* want to do this.
8459 case "$versiononly" in
8460 "$define"|[Yy]*|true) dflt='y' ;;
8463 rp="Do you want to install only the version-specific parts of perl?"
8466 [yY]*) val="$define";;
8472 case "$versiononly" in
8473 "$define") inc_version_list=''
8474 inc_version_list_init=0
8478 : figure out how to guarantee perl startup
8479 case "$startperl" in
8481 case "$sharpbang" in
8485 I can use the #! construct to start perl on your system. This will
8486 make startup of perl scripts faster, but may cause problems if you
8487 want to share those scripts and perl is not in a standard place
8488 ($binexp/perl) on all your platforms. The alternative is to force
8489 a shell by starting the script with a single ':' character.
8492 case "$versiononly" in
8493 "$define") dflt="$binexp/perl$version";;
8494 *) dflt="$binexp/perl";;
8496 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8499 none) startperl=": # use perl";;
8500 *) startperl="#!$ans"
8501 if $test 30 -lt `echo "$ans" | wc -c`; then
8504 WARNING: Some systems limit the #! command to 32 characters.
8505 If you experience difficulty running Perl scripts with #!, try
8506 installing Perl in a directory with a shorter pathname.
8512 *) startperl=": # use perl"
8517 echo "I'll use $startperl to start perl scripts."
8519 : figure best path for perl in scripts
8522 case "$versiononly" in
8523 "$define") perlpath="$binexp/perl$version";;
8524 *) perlpath="$binexp/perl";;
8526 case "$startperl" in
8531 I will use the "eval 'exec'" idiom to start Perl on your system.
8532 I can use the full path of your Perl binary for this purpose, but
8533 doing so may cause problems if you want to share those scripts and
8534 Perl is not always in a standard place ($binexp/perl).
8538 rp="What path shall I use in \"eval 'exec'\"?"
8545 case "$startperl" in
8547 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8550 : determine where public executable scripts go
8551 set scriptdir scriptdir
8553 case "$scriptdir" in
8556 : guess some guesses
8557 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8558 $test -d /usr/share/bin && dflt=/usr/share/bin
8559 $test -d /usr/local/script && dflt=/usr/local/script
8560 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8561 $test -d $prefixexp/script && dflt=$prefixexp/script
8565 *) dflt="$scriptdir"
8570 Some installations have a separate directory just for executable scripts so
8571 that they can mount it across multiple architectures but keep the scripts in
8572 one spot. You might, for example, have a subdirectory of /usr/share for this.
8573 Or you might just lump your scripts in with all your other executables.
8577 rp='Where do you keep publicly executable scripts?'
8579 if $test "X$ansexp" != "X$scriptdirexp"; then
8583 scriptdirexp="$ansexp"
8584 : Change installation prefix, if necessary.
8585 if $test X"$prefix" != X"$installprefix"; then
8586 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8588 installscript="$scriptdirexp"
8591 : determine where add-on public executables go
8593 '') dflt=$siteprefix/bin ;;
8597 rp='Pathname where the add-on public executables should be installed?'
8600 sitebinexp="$ansexp"
8601 : Change installation prefix, if necessary.
8602 if $test X"$prefix" != X"$installprefix"; then
8603 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8605 installsitebin="$sitebinexp"
8608 : determine where add-on html pages go
8609 : There is no standard location, so try to copy the previously-selected
8610 : directory structure for the core html pages.
8611 case "$sitehtml1dir" in
8612 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8613 *) dflt=$sitehtml1dir ;;
8616 ''|' ') dflt=none ;;
8619 rp='Pathname where the site-specific html pages should be installed?'
8622 sitehtml1direxp="$ansexp"
8623 : Change installation prefix, if necessary.
8624 if $test X"$prefix" != X"$installprefix"; then
8625 installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
8627 installsitehtml1dir="$sitehtml1direxp"
8630 : determine where add-on library html pages go
8631 : There is no standard location, so try to copy the previously-selected
8632 : directory structure for the core html pages.
8633 case "$sitehtml3dir" in
8634 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8635 *) dflt=$sitehtml3dir ;;
8638 ''|' ') dflt=none ;;
8641 rp='Pathname where the site-specific library html pages should be installed?'
8644 sitehtml3direxp="$ansexp"
8645 : Change installation prefix, if necessary.
8646 if $test X"$prefix" != X"$installprefix"; then
8647 installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
8649 installsitehtml3dir="$sitehtml3direxp"
8652 : determine where add-on manual pages go
8653 case "$siteman1dir" in
8654 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8655 *) dflt=$siteman1dir ;;
8658 ''|' ') dflt=none ;;
8661 rp='Pathname where the site-specific manual pages should be installed?'
8664 siteman1direxp="$ansexp"
8665 : Change installation prefix, if necessary.
8666 if $test X"$prefix" != X"$installprefix"; then
8667 installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
8669 installsiteman1dir="$siteman1direxp"
8672 : determine where add-on library man pages go
8673 case "$siteman3dir" in
8674 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8675 *) dflt=$siteman3dir ;;
8678 ''|' ') dflt=none ;;
8681 rp='Pathname where the site-specific library manual pages should be installed?'
8684 siteman3direxp="$ansexp"
8685 : Change installation prefix, if necessary.
8686 if $test X"$prefix" != X"$installprefix"; then
8687 installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
8689 installsiteman3dir="$siteman3direxp"
8692 : determine where add-on public executable scripts go
8693 case "$sitescript" in
8694 '') dflt=$siteprefix/script
8695 $test -d $dflt || dflt=$sitebin ;;
8696 *) dflt="$sitescript" ;;
8699 rp='Pathname where add-on public executable scripts should be installed?'
8702 sitescriptexp="$ansexp"
8703 : Change installation prefix, if necessary.
8704 if $test X"$prefix" != X"$installprefix"; then
8705 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8707 installsitescript="$sitescriptexp"
8710 case "$usefaststdio" in
8711 $define|true|[yY]*|'')
8712 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8722 Perl can be built to use 'fast stdio', which means using the stdio
8723 library but also directly manipulating the stdio buffers to enable
8724 faster I/O. Using stdio is better for backward compatibility (especially
8725 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8726 interface has been preferred instead of stdio.
8728 If this doesn't make any sense to you, just accept the default '$dflt'.
8730 rp='Use the "fast stdio" if available?'
8733 y|Y) val="$define" ;;
8740 : define an is-a-typedef? function
8741 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8743 "") inclist="sys/types.h";;
8745 eval "varval=\$$var";
8749 for inc in $inclist; do
8750 echo "#include <$inc>" >>temp.c;
8752 echo "#ifdef $type" >> temp.c;
8753 echo "printf(\"We have $type\");" >> temp.c;
8754 echo "#endif" >> temp.c;
8755 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8756 if $contains $type temp.E >/dev/null 2>&1; then
8762 *) eval "$var=\$varval";;
8765 : define an is-a-typedef? function that prompts if the type is not available.
8766 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8768 "") inclist="sys/types.h";;
8770 eval "varval=\$$var";
8774 for inc in $inclist; do
8775 echo "#include <$inc>" >>temp.c;
8777 echo "#ifdef $type" >> temp.c;
8778 echo "printf(\"We have $type\");" >> temp.c;
8779 echo "#endif" >> temp.c;
8780 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8782 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8783 if $contains $type temp.E >/dev/null 2>&1; then
8784 echo "$type found." >&4;
8787 echo "$type NOT found." >&4;
8793 *) eval "$var=\$varval";;
8796 : see what type lseek is declared as in the kernel
8797 rp="What is the type used for lseek's offset on this system?"
8798 set off_t lseektype long stdio.h sys/types.h
8802 echo "Checking to see how big your file offsets are..." >&4
8804 #include <sys/types.h>
8808 printf("%d\n", (int)sizeof($lseektype));
8813 if eval $compile_ok; then
8814 lseeksize=`$run ./try`
8815 echo "Your file offsets are $lseeksize bytes long."
8819 echo "(I can't seem to compile the test program. Guessing...)"
8820 rp="What is the size of your file offsets (in bytes)?"
8826 : see what type file positions are declared as in the library
8827 rp="What is the type for file position used by fsetpos()?"
8828 set fpos_t fpostype long stdio.h sys/types.h
8833 *_t) zzz="$fpostype" ;;
8836 echo "Checking the size of $zzz..." >&4
8838 #include <sys/types.h>
8845 printf("%d\n", (int)sizeof($fpostype));
8850 if eval $compile_ok; then
8854 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8857 echo "Your $zzz is $fpossize bytes long."
8863 echo "(I can't compile the test program. Guessing...)" >&4
8864 rp="What is the size of your file positions (in bytes)?"
8869 # Backward compatibility (uselfs is deprecated).
8871 "$define"|true|[yY]*)
8874 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8876 uselargefiles="$define"
8880 case "$lseeksize:$fpossize" in
8883 You can have files larger than 2 gigabytes.
8886 *) case "$uselargefiles" in
8887 "$undef"|false|[nN]*) dflt='n' ;;
8892 Perl can be built to understand large files (files larger than 2 gigabytes)
8893 on some systems. To do so, Configure can be run with -Duselargefiles.
8895 If this doesn't make any sense to you, just accept the default '$dflt'.
8897 rp='Try to understand large files, if available?'
8900 y|Y) val="$define" ;;
8907 : Look for a hint-file generated 'call-back-unit'. If the
8908 : user has specified that a large files perl is to be built,
8909 : we may need to set or change some other defaults.
8910 if $test -f uselargefiles.cbu; then
8911 echo "Your platform has some specific hints regarding large file builds, using them..."
8912 . ./uselargefiles.cbu
8914 case "$uselargefiles" in
8916 if $test -f uselargefiles.cbu; then
8918 echo "Rechecking to see how big your file offsets are..." >&4
8920 #include <sys/types.h>
8924 printf("%d\n", (int)sizeof($lseektype));
8929 if eval $compile_ok; then
8930 lseeksize=`$run ./try`
8931 $echo "Your file offsets are now $lseeksize bytes long."
8935 echo "(I can't seem to compile the test program. Guessing...)"
8936 rp="What is the size of your file offsets (in bytes)?"
8941 *_t) zzz="$fpostype" ;;
8944 $echo $n "Rechecking the size of $zzz...$c" >&4
8946 #include <sys/types.h>
8953 printf("%d\n", (int)sizeof($fpostype));
8958 if eval $compile_ok; then
8963 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8966 echo " $fpossize bytes." >&4
8972 echo "(I can't compile the test program. Guessing...)" >&4
8973 rp="What is the size of your file positions (in bytes)?"
8982 # probably will refer to
8983 # $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
8985 userelocatableinc=undef
8987 case "$vendorprefix" in
8988 '') d_vendorbin="$undef"
8992 *) d_vendorbin="$define"
8993 : determine where vendor-supplied executables go.
8994 case "$vendorbin" in
8995 '') dflt=$vendorprefix/bin ;;
8996 *) dflt="$vendorbin" ;;
8999 rp='Pathname for the vendor-supplied executables directory?'
9002 vendorbinexp="$ansexp"
9005 : Change installation prefix, if necessary.
9006 if $test X"$prefix" != X"$installprefix"; then
9007 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9009 installvendorbin="$vendorbinexp"
9012 case "$vendorprefix" in
9013 '') vendorhtml1dir=''
9014 vendorhtml1direxp=''
9016 *) : determine where vendor-supplied html pages go.
9017 : There is no standard location, so try to copy the previously-selected
9018 : directory structure for the core html pages.
9019 : XXX Better default suggestions would be welcome.
9020 case "$vendorhtml1dir" in
9021 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9022 *) dflt=$vendorhtml1dir ;;
9025 ''|' ') dflt=none ;;
9028 rp='Pathname for the vendor-supplied html pages?'
9030 vendorhtml1dir="$ans"
9031 vendorhtml1direxp="$ansexp"
9034 : Use ' ' for none so value is preserved next time through Configure
9035 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9036 : Change installation prefix, if necessary.
9037 if $test X"$prefix" != X"$installprefix"; then
9038 installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
9040 installvendorhtml1dir="$vendorhtml1direxp"
9043 case "$vendorprefix" in
9044 '') vendorhtml3dir=''
9045 vendorhtml3direxp=''
9047 *) : determine where vendor-supplied module html pages go.
9048 : There is no standard location, so try to copy the previously-selected
9049 : directory structure for the core html pages.
9050 : XXX Better default suggestions would be welcome.
9051 case "$vendorhtml3dir" in
9052 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9053 *) dflt=$vendorhtml3dir ;;
9056 ''|' ') dflt=none ;;
9059 rp='Pathname for the vendor-supplied html pages?'
9061 vendorhtml3dir="$ans"
9062 vendorhtml3direxp="$ansexp"
9065 : Use ' ' for none so value is preserved next time through Configure
9066 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9067 : Change installation prefix, if necessary.
9068 if $test X"$prefix" != X"$installprefix"; then
9069 installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
9071 installvendorhtml3dir="$vendorhtml3direxp"
9074 case "$vendorprefix" in
9075 '') vendorman1dir=''
9078 *) : determine where vendor-supplied manual pages go.
9079 case "$vendorman1dir" in
9080 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9081 *) dflt=$vendorman1dir ;;
9084 ''|' ') dflt=none ;;
9087 rp='Pathname for the vendor-supplied manual section 1 pages?'
9089 vendorman1dir="$ans"
9090 vendorman1direxp="$ansexp"
9093 : Use ' ' for none so value is preserved next time through Configure
9094 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9095 : Change installation prefix, if necessary.
9096 if $test X"$prefix" != X"$installprefix"; then
9097 installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
9099 installvendorman1dir="$vendorman1direxp"
9102 case "$vendorprefix" in
9103 '') vendorman3dir=''
9106 *) : determine where vendor-supplied module manual pages go.
9107 case "$vendorman3dir" in
9108 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9109 *) dflt=$vendorman3dir ;;
9112 ''|' ') dflt=none ;;
9115 rp='Pathname for the vendor-supplied manual section 3 pages?'
9117 vendorman3dir="$ans"
9118 vendorman3direxp="$ansexp"
9121 : Use ' ' for none so value is preserved next time through Configure
9122 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9123 : Change installation prefix, if necessary.
9124 if $test X"$prefix" != X"$installprefix"; then
9125 installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
9127 installvendorman3dir="$vendorman3direxp"
9130 case "$vendorprefix" in
9131 '') d_vendorscript="$undef"
9135 *) d_vendorscript="$define"
9136 : determine where vendor-supplied scripts go.
9137 case "$vendorscript" in
9138 '') dflt=$vendorprefix/script
9139 $test -d $dflt || dflt=$vendorbin ;;
9140 *) dflt="$vendorscript" ;;
9144 The installation process will create a directory for
9145 vendor-supplied scripts.
9149 rp='Pathname for the vendor-supplied scripts directory?'
9152 vendorscriptexp="$ansexp"
9155 : Change installation prefix, if necessary.
9156 if $test X"$prefix" != X"$installprefix"; then
9157 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9159 installvendorscript="$vendorscriptexp"
9162 : see if qgcvt exists
9168 if $test X"$d_longdbl" = X"$define"; then
9170 echo "Checking how to print long doubles..." >&4
9172 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9173 $cat >try.c <<'EOCP'
9174 #include <sys/types.h>
9178 printf("%.3f\n", d);
9182 if eval $compile; then
9186 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9187 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9188 echo "We will use %f."
9194 if $test X"$sPRIfldbl" = X; then
9195 $cat >try.c <<'EOCP'
9196 #include <sys/types.h>
9199 long double d = 123.456;
9200 printf("%.3Lf\n", d);
9204 if eval $compile; then
9208 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9209 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9210 echo "We will use %Lf."
9216 if $test X"$sPRIfldbl" = X; then
9217 $cat >try.c <<'EOCP'
9218 #include <sys/types.h>
9221 long double d = 123.456;
9222 printf("%.3llf\n", d);
9226 if eval $compile; then
9230 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9231 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9232 echo "We will use %llf."
9238 if $test X"$sPRIfldbl" = X; then
9239 $cat >try.c <<'EOCP'
9240 #include <sys/types.h>
9243 long double d = 123.456;
9244 printf("%.3lf\n", d);
9248 if eval $compile; then
9252 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9253 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9254 echo "We will use %lf."
9260 if $test X"$sPRIfldbl" = X; then
9261 echo "Cannot figure out how to print long doubles." >&4
9263 sSCNfldbl=$sPRIfldbl # expect consistency
9270 case "$sPRIfldbl" in
9271 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9272 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9273 d_SCNfldbl="$undef";
9275 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9276 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9277 d_SCNfldbl="$define";
9281 : Check how to convert floats to strings.
9283 if test "X$d_Gconvert" = X; then
9286 echo "Checking for an efficient way to convert floats to strings."
9288 case "$uselongdouble" in
9289 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9291 case "$d_longdbl" in
9292 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9294 case "$d_PRIgldbl" in
9295 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9299 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9300 char *myname = "gconvert";
9303 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9304 char *myname = "gcvt";
9307 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9308 char *myname = "qgcvt";
9309 #define DOUBLETYPE long double
9312 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9314 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9316 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9319 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9321 char *myname = "sprintf";
9325 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9326 #define DOUBLETYPE long double
9328 #define DOUBLETYPE double
9334 #define I_STDLIB $i_stdlib
9340 checkit(expect, got)
9344 if (strcmp(expect, got)) {
9345 printf("%s oddity: Expected %s, got %s\n",
9346 myname, expect, got);
9356 /* This must be 1st test on (which?) platform */
9357 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9358 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9359 checkit("0.1", buf);
9361 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9362 checkit("0.01", buf);
9364 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9365 checkit("0.001", buf);
9367 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9368 checkit("0.0001", buf);
9370 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9371 if (strlen(buf) > 5)
9372 checkit("9e-005", buf); /* for Microsoft ?? */
9374 checkit("9e-05", buf);
9376 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9379 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9380 checkit("1.1", buf);
9382 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9383 checkit("1.01", buf);
9385 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9386 checkit("1.001", buf);
9388 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9389 checkit("1.0001", buf);
9391 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9392 checkit("1.00001", buf);
9394 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9395 checkit("1.000001", buf);
9397 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9400 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9403 /* Some Linux gcvt's give 1.e+5 here. */
9404 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9405 checkit("100000", buf);
9407 /* Some Linux gcvt's give -1.e+5 here. */
9408 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9409 checkit("-100000", buf);
9411 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9412 checkit("123.456", buf);
9414 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9415 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9416 /* 34 should be enough to scare even long double
9417 * places into using the e notation. */
9418 if (strlen(buf) > 5)
9419 checkit("1e+034", buf); /* for Microsoft */
9421 checkit("1e+34", buf);
9423 /* For Perl, if you add additional tests here, also add them to
9424 * t/base/num.t for benefit of platforms not using Configure or
9425 * overriding d_Gconvert */
9430 : first add preferred functions to our list
9432 for xxx_convert in $gconvert_preference; do
9433 case $xxx_convert in
9434 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9435 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9438 : then add any others
9439 for xxx_convert in gconvert gcvt sprintf; do
9442 *) xxx_list="$xxx_list $xxx_convert" ;;
9446 case "$d_longdbl$uselongdouble" in
9448 : again, add prefered functions to our list first
9450 for xxx_convert in $gconvert_ld_preference; do
9451 case $xxx_convert in
9452 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9453 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9456 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9457 for xxx_convert in qgcvt sprintf $xxx_list; do
9458 case "$xxx_ld_list" in
9459 $xxx_convert*|*" $xxx_convert"*) ;;
9460 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9463 : if sprintf cannot do long doubles, move it to the end
9464 if test "$d_PRIgldbl" != "$define"; then
9465 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9467 : if no qgcvt, remove it
9468 if test "$d_qgcvt" != "$define"; then
9469 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9472 xxx_list="$xxx_ld_list"
9476 for xxx_convert in $xxx_list; do
9477 echo "Trying $xxx_convert..."
9479 set try -DTRY_$xxx_convert
9480 if eval $compile; then
9481 echo "$xxx_convert() found." >&4
9483 echo "I'll use $xxx_convert to convert floats into a string." >&4
9486 echo "...But $xxx_convert didn't work as I expected."
9490 echo "$xxx_convert NOT found." >&4
9494 if test X$xxx_convert = X; then
9495 echo "*** WHOA THERE!!! ***" >&4
9496 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9500 case "$xxx_convert" in
9501 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9502 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9503 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9504 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9505 "$define$define$define")
9506 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9507 "$define$define$undef")
9508 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9509 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9516 : see if _fwalk exists
9520 : Initialize h_fcntl
9523 : Initialize h_sysfile
9526 : access call always available on UNIX
9530 : locate the flags for 'access()'
9534 $cat >access.c <<EOCP
9535 #include <sys/types.h>
9540 #include <sys/file.h>
9553 : check sys/file.h first, no particular reason here
9554 if $test `./findhdr sys/file.h` && \
9555 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9557 echo "<sys/file.h> defines the *_OK access constants." >&4
9558 elif $test `./findhdr fcntl.h` && \
9559 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9561 echo "<fcntl.h> defines the *_OK access constants." >&4
9562 elif $test `./findhdr unistd.h` && \
9563 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9564 echo "<unistd.h> defines the *_OK access constants." >&4
9566 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9572 : see if accessx exists
9573 set accessx d_accessx
9576 : see if aintl exists
9580 : see if alarm exists
9584 : see if POSIX threads are available
9585 set pthread.h i_pthread
9588 : define a fucntion to check prototypes
9589 $cat > protochk <<EOSH
9592 optimize="$optimize"
9594 prototype="$prototype"
9597 usethreads=$usethreads
9598 i_pthread=$i_pthread
9599 pthread_h_first=$pthread_h_first
9602 $cat >> protochk <<'EOSH'
9607 while test $# -ge 2; do
9609 $define) echo "#include <$2>" >> try.c ;;
9610 literal) echo "$2" >> try.c ;;
9612 # Extra magic for the benefit of systems that need pthread.h
9613 # to be included early to correctly detect threadsafe functions.
9614 # Such functions must guarantee themselves, though, that the usethreads
9615 # and i_pthread have been defined, before calling protochk.
9616 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9617 echo "#include <pthread.h>" >> try.c
9622 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9623 cat >> try.c <<'EOCP'
9624 #ifdef CAN_PROTOTYPE
9625 #define _(args) args
9630 echo "$foo" >> try.c
9631 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9632 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9640 hasproto='varname=$1; func=$2; shift; shift;
9641 while $test $# -ge 2; do
9643 $define) echo "#include <$2>";;
9647 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9648 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9649 echo "$func() prototype found.";
9652 echo "$func() prototype NOT found.";
9657 $rm -f try.c tryout.c'
9659 : see if sys/types.h has to be included
9660 set sys/types.h i_systypes
9663 : see if sys/select.h has to be included
9664 set sys/select.h i_sysselct
9667 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9668 while $test $# -ge 2; do
9670 $define) echo "#include <$2>";;
9674 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9676 if eval $compile; then
9685 : see if we should include time.h, sys/time.h, or both
9687 if test "X$timeincl" = X; then
9688 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9689 $echo $n "I'm now running the test program...$c"
9691 #include <sys/types.h>
9696 #ifdef SYSTIMEKERNEL
9699 #include <sys/time.h>
9702 #include <sys/select.h>
9715 struct timezone tzp;
9717 if (foo.tm_sec == foo.tm_sec)
9720 if (bar.tv_sec == bar.tv_sec)
9727 for s_timezone in '-DS_TIMEZONE' ''; do
9729 for s_timeval in '-DS_TIMEVAL' ''; do
9730 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9731 for i_time in '' '-DI_TIME'; do
9732 for i_systime in '-DI_SYSTIME' ''; do
9735 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9736 if eval $compile; then
9737 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9741 $echo $n "Succeeded with $flags$c"
9753 *SYSTIMEKERNEL*) i_systimek="$define"
9754 timeincl=`./findhdr sys/time.h`
9755 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9756 *) i_systimek="$undef";;
9759 *I_TIME*) i_time="$define"
9760 timeincl=`./findhdr time.h`" $timeincl"
9761 echo "We'll include <time.h>." >&4;;
9762 *) i_time="$undef";;
9765 *I_SYSTIME*) i_systime="$define"
9766 timeincl=`./findhdr sys/time.h`" $timeincl"
9767 echo "We'll include <sys/time.h>." >&4;;
9768 *) i_systime="$undef";;
9772 : see if struct tm knows about tm_zone
9773 case "$i_systime$i_time" in
9776 echo "Checking to see if your struct tm has tm_zone field..." >&4
9777 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9785 case "$d_tm_tm_zone" in
9786 "$define") echo "Yes, it does." ;;
9787 *) echo "No, it doesn't." ;;
9789 : see if struct tm knows about tm_gmtoff
9790 case "$i_systime$i_time" in
9793 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9794 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9802 case "$d_tm_tm_gmtoff" in
9803 "$define") echo "Yes, it does." ;;
9804 *) echo "No, it doesn't." ;;
9807 : see if asctime_r exists
9808 set asctime_r d_asctime_r
9810 case "$d_asctime_r" in
9812 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9813 case "$d_asctime_r_proto:$usethreads" in
9814 ":define") d_asctime_r_proto=define
9815 set d_asctime_r_proto asctime_r $hdrs
9819 case "$d_asctime_r_proto" in
9821 case "$asctime_r_proto" in
9822 ''|0) try='char* asctime_r(const struct tm*, char*);'
9823 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9825 case "$asctime_r_proto" in
9826 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9827 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9829 case "$asctime_r_proto" in
9830 ''|0) try='int asctime_r(const struct tm*, char*);'
9831 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9833 case "$asctime_r_proto" in
9834 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9835 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9837 case "$asctime_r_proto" in
9838 ''|0) d_asctime_r=undef
9840 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9841 * ) case "$asctime_r_proto" in
9842 REENTRANT_PROTO*) ;;
9843 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9845 echo "Prototype: $try" ;;
9848 *) case "$usethreads" in
9849 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9856 *) asctime_r_proto=0
9860 : see if atolf exists
9864 : see if atoll exists
9868 : Look for GNU-cc style attribute checking
9869 case "$d_attribut" in
9872 echo "Checking whether your compiler can handle __attribute__ ..." >&4
9873 $cat >attrib.c <<'EOCP'
9875 void croak (char* pat,...) __attribute__((__format__(__printf__,1,2),noreturn));
9877 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9878 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9879 echo "Your C compiler doesn't fully support __attribute__."
9882 echo "Your C compiler supports __attribute__."
9886 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9890 *) val="$d_attribut" ;;
9896 : see if bcmp exists
9900 : see if bcopy exists
9904 : see if this is a unistd.h system
9905 set unistd.h i_unistd
9908 : see if getpgrp exists
9909 set getpgrp d_getpgrp
9912 case "$d_getpgrp" in
9915 echo "Checking to see which flavor of getpgrp is in use..."
9918 #include <sys/types.h>
9920 # include <unistd.h>
9928 if (getuid() == 0) {
9929 printf("(I see you are running Configure as super-user...)\n");
9933 if (getpgrp(1) == 0)
9942 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9943 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
9945 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9946 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
9949 echo "I can't seem to compile and run the test program."
9951 xxx="a USG one, i.e. you use getpgrp()."
9953 # SVR4 systems can appear rather BSD-ish.
9956 xxx="a BSD one, i.e. you use getpgrp(pid)."
9960 xxx="probably a USG one, i.e. you use getpgrp()."
9965 echo "Assuming your getpgrp is $xxx" >&4
9974 : see if setpgrp exists
9975 set setpgrp d_setpgrp
9978 case "$d_setpgrp" in
9981 echo "Checking to see which flavor of setpgrp is in use..."
9984 #include <sys/types.h>
9986 # include <unistd.h>
9994 if (getuid() == 0) {
9995 printf("(I see you are running Configure as super-user...)\n");
9999 if (-1 == setpgrp(1, 1))
10002 if (setpgrp() != -1)
10008 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10009 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10011 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10012 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10015 echo "(I can't seem to compile and run the test program.)"
10017 xxx="a USG one, i.e. you use setpgrp()."
10019 # SVR4 systems can appear rather BSD-ish.
10020 case "$i_unistd" in
10022 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10026 xxx="probably a USG one, i.e. you use setpgrp()."
10031 echo "Assuming your setpgrp is $xxx" >&4
10039 : see if bzero exists
10043 : see if signal is declared as pointer to function returning int or void
10045 xxx=`./findhdr signal.h`
10046 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10047 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10048 echo "You have int (*signal())() instead of void." >&4
10050 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10051 echo "You have void (*signal())()." >&4
10053 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10054 echo "You have int (*signal())() instead of void." >&4
10056 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10057 echo "You have void (*signal())()." >&4
10060 case "$d_voidsig" in
10062 echo "I can't determine whether signal handler returns void or int..." >&4
10064 rp="What type does your signal handler return?"
10067 v*) val="$define";;
10071 echo "As you already told me, signal handler returns void." >&4
10074 *) echo "As you already told me, signal handler returns int." >&4
10081 case "$d_voidsig" in
10082 "$define") signal_t="void";;
10083 *) signal_t="int";;
10087 : check for ability to cast large floats to 32-bit ints.
10089 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10090 if $test "$intsize" -ge 4; then
10097 #$i_stdlib I_STDLIB
10099 #include <stdlib.h>
10101 #include <sys/types.h>
10102 #include <signal.h>
10103 $signal_t blech(s) int s; { exit(3); }
10110 signal(SIGFPE, blech);
10112 /* Don't let compiler optimize the test away. Store the number
10113 in a writable string for gcc to pass to sscanf under HP/UX.
10115 sprintf(str, "2147483647");
10116 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10120 /* x86 processors will probably give 0x8000 0000, which is a
10121 sign change. We don't want that. We want to mimic SPARC
10122 behavior here, which is to preserve the sign and give
10125 if (i32 != ($xxx) f)
10131 if eval $compile_ok; then
10135 echo "(I can't seem to compile the test program--assuming it can't)"
10140 echo "Yup, it can."
10143 echo "Nope, it can't."
10150 : check for ability to cast negative floats to unsigned
10152 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10155 #$i_stdlib I_STDLIB
10157 #include <stdlib.h>
10159 #include <sys/types.h>
10160 #include <signal.h>
10161 $signal_t blech(s) int s; { exit(7); }
10162 $signal_t blech_in_list(s) int s; { exit(4); }
10163 unsigned long dummy_long(p) unsigned long p; { return p; }
10164 unsigned int dummy_int(p) unsigned int p; { return p; }
10165 unsigned short dummy_short(p) unsigned short p; { return p; }
10169 unsigned long along;
10171 unsigned short ashort;
10175 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10176 a direct f = -123. assignment. gcc-2.8.0 reportedly
10177 optimized the whole file away
10179 /* Store the number in a writable string for gcc to pass to
10180 sscanf under HP/UX.
10182 sprintf(str, "-123");
10183 sscanf(str, "%lf", &f); /* f = -123.; */
10185 signal(SIGFPE, blech);
10186 along = (unsigned long)f;
10187 aint = (unsigned int)f;
10188 ashort = (unsigned short)f;
10189 if (along != (unsigned long)-123)
10191 if (aint != (unsigned int)-123)
10193 if (ashort != (unsigned short)-123)
10195 sprintf(str, "1073741824.");
10196 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10199 along = (unsigned long)f;
10200 if (along != 0x80000000)
10204 along = (unsigned long)f;
10205 if (along != 0x7fffffff)
10209 along = (unsigned long)f;
10210 if (along != 0x80000001)
10214 signal(SIGFPE, blech_in_list);
10215 sprintf(str, "123.");
10216 sscanf(str, "%lf", &f); /* f = 123.; */
10217 along = dummy_long((unsigned long)f);
10218 aint = dummy_int((unsigned int)f);
10219 ashort = dummy_short((unsigned short)f);
10220 if (along != (unsigned long)123)
10222 if (aint != (unsigned int)123)
10224 if (ashort != (unsigned short)123)
10231 if eval $compile_ok; then
10235 echo "(I can't seem to compile the test program--assuming it can't)"
10238 case "$castflags" in
10240 echo "Yup, it can."
10243 echo "Nope, it can't."
10250 : see if vprintf exists
10252 if set vprintf val -f d_vprintf; eval $csym; $val; then
10253 echo 'vprintf() found.' >&4
10256 #include <varargs.h>
10257 #$i_stdlib I_STDLIB
10259 #include <stdlib.h>
10262 int main() { xxx("foo"); }
10271 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10275 if eval $compile && $run ./try; then
10276 echo "Your vsprintf() returns (int)." >&4
10279 echo "Your vsprintf() returns (char*)." >&4
10283 echo 'vprintf() NOT found.' >&4
10294 : see if chown exists
10298 : see if chroot exists
10299 set chroot d_chroot
10302 : see if chsize exists
10303 set chsize d_chsize
10306 : see if class exists
10310 hasstruct='varname=$1; struct=$2; shift; shift;
10311 while $test $# -ge 2; do
10313 $define) echo "#include <$2>";;
10317 echo "int main () { struct $struct foo; }" >> try.c;
10319 if eval $compile; then
10326 $rm -f try.c try.o'
10330 : see whether socket exists
10332 $echo $n "Hmm... $c" >&4
10333 if set socket val -f d_socket; eval $csym; $val; then
10334 echo "Looks like you have Berkeley networking support." >&4
10336 if set setsockopt val -f; eval $csym; $val; then
10339 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10340 d_oldsock="$define"
10343 if $contains socklib libc.list >/dev/null 2>&1; then
10344 echo "Looks like you have Berkeley networking support." >&4
10346 : we will have to assume that it supports the 4.2 BSD interface
10349 echo "You don't have Berkeley networking in libc$_a..." >&4
10350 if test "X$d_socket" = "X$define"; then
10351 echo "...but you seem to believe that you have sockets." >&4
10353 for net in net socket
10355 if test -f /usr/lib/lib$net$_a; then
10356 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10357 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10358 if $contains socket libc.list >/dev/null 2>&1; then
10363 echo "...but the Wollongong group seems to have hacked it in." >&4
10364 sockethdr="-I/usr/netinclude"
10367 echo "Found Berkeley sockets interface in lib$net." >&4
10368 if $contains setsockopt libc.list >/dev/null 2>&1; then
10371 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10372 d_oldsock="$define"
10378 if test "X$d_socket" != "X$define"; then
10379 echo "or anywhere else I see." >&4
10387 : see if socketpair exists
10388 set socketpair d_sockpair
10393 echo "Checking the availability of certain socket constants..." >&4
10394 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10395 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10397 #include <sys/types.h>
10398 #include <sys/socket.h>
10404 set try; if eval $compile; then
10407 set d_${enum}; eval $setvar
10411 : see if this is a sys/uio.h system
10412 set sys/uio.h i_sysuio
10417 echo "Checking to see if your system supports struct cmsghdr..." >&4
10418 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10420 case "$d_cmsghdr_s" in
10421 "$define") echo "Yes, it does." ;;
10422 *) echo "No, it doesn't." ;;
10426 : check for const keyword
10428 echo 'Checking to see if your C compiler knows about "const"...' >&4
10429 $cat >const.c <<'EOCP'
10430 typedef struct spug { int drokk; } spug;
10437 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10439 echo "Yup, it does."
10442 echo "Nope, it doesn't."
10447 : see if copysignl exists
10448 set copysignl d_copysignl
10451 : see if crypt exists
10456 $define) cryptlib='' ;;
10457 *) if set crypt val -f d_crypt; eval $csym; $val; then
10458 echo 'crypt() found.' >&4
10462 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10463 if $test -z "$cryptlib"; then
10464 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10468 if $test -z "$cryptlib"; then
10469 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10473 if $test -z "$cryptlib"; then
10474 cryptlib=`./loc libcrypt$_a "" $libpth`
10478 if $test -z "$cryptlib"; then
10479 echo 'crypt() NOT found.' >&4
10490 : see if this is a crypt.h system
10491 set crypt.h i_crypt
10494 : see if crypt_r exists
10495 set crypt_r d_crypt_r
10497 case "$d_crypt_r" in
10499 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10500 case "$d_crypt_r_proto:$usethreads" in
10501 ":define") d_crypt_r_proto=define
10502 set d_crypt_r_proto crypt_r $hdrs
10506 case "$d_crypt_r_proto" in
10508 case "$crypt_r_proto" in
10509 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10510 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10512 case "$crypt_r_proto" in
10513 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10514 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10516 case "$crypt_r_proto" in
10517 ''|0) d_crypt_r=undef
10519 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10520 * ) case "$crypt_r_proto" in
10521 REENTRANT_PROTO*) ;;
10522 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10524 echo "Prototype: $try" ;;
10527 *) case "$usethreads" in
10528 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10539 : get csh whereabouts
10541 'csh') val="$undef" ;;
10542 *) val="$define" ;;
10546 : Respect a hint or command line value for full_csh.
10547 case "$full_csh" in
10548 '') full_csh=$csh ;;
10551 : see if ctermid_r exists
10552 set ctermid_r d_ctermid_r
10554 case "$d_ctermid_r" in
10556 hdrs="$i_systypes sys/types.h define stdio.h "
10557 case "$d_ctermid_r_proto:$usethreads" in
10558 ":define") d_ctermid_r_proto=define
10559 set d_ctermid_r_proto ctermid_r $hdrs
10563 case "$d_ctermid_r_proto" in
10565 case "$ctermid_r_proto" in
10566 ''|0) try='char* ctermid_r(char*);'
10567 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10569 case "$ctermid_r_proto" in
10570 ''|0) d_ctermid_r=undef
10572 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10573 * ) case "$ctermid_r_proto" in
10574 REENTRANT_PROTO*) ;;
10575 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10577 echo "Prototype: $try" ;;
10580 *) case "$usethreads" in
10581 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10588 *) ctermid_r_proto=0
10592 : see if ctime_r exists
10593 set ctime_r d_ctime_r
10595 case "$d_ctime_r" in
10597 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10598 case "$d_ctime_r_proto:$usethreads" in
10599 ":define") d_ctime_r_proto=define
10600 set d_ctime_r_proto ctime_r $hdrs
10604 case "$d_ctime_r_proto" in
10606 case "$ctime_r_proto" in
10607 ''|0) try='char* ctime_r(const time_t*, char*);'
10608 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10610 case "$ctime_r_proto" in
10611 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10612 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10614 case "$ctime_r_proto" in
10615 ''|0) try='int ctime_r(const time_t*, char*);'
10616 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10618 case "$ctime_r_proto" in
10619 ''|0) try='int ctime_r(const time_t*, char*, int);'
10620 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10622 case "$ctime_r_proto" in
10623 ''|0) d_ctime_r=undef
10625 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10626 * ) case "$ctime_r_proto" in
10627 REENTRANT_PROTO*) ;;
10628 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10630 echo "Prototype: $try" ;;
10633 *) case "$usethreads" in
10634 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10645 : see if cuserid exists
10646 set cuserid d_cuserid
10649 : see if this is a limits.h system
10650 set limits.h i_limits
10653 : see if this is a float.h system
10654 set float.h i_float
10657 : See if number of significant digits in a double precision number is known
10659 $cat >dbl_dig.c <<EOM
10660 #$i_limits I_LIMITS
10663 #include <limits.h>
10669 printf("Contains DBL_DIG");
10672 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10673 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10674 echo "DBL_DIG found." >&4
10677 echo "DBL_DIG NOT found." >&4
10684 : see if dbm.h is available
10685 : see if dbmclose exists
10686 set dbmclose d_dbmclose
10689 case "$d_dbmclose" in
10699 *) set rpcsvc/dbm.h i_rpcsvcdbm
10704 *) echo "We won't be including <dbm.h>"
10714 : see if prototype for dbminit is available
10716 set d_dbminitproto dbminit $i_dbm dbm.h
10719 : see if difftime exists
10720 set difftime d_difftime
10723 : see if this is a dirent system
10725 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10727 echo "<dirent.h> found." >&4
10730 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10731 echo "<sys/dir.h> found." >&4
10734 xinc=`./findhdr sys/ndir.h`
10736 echo "<dirent.h> NOT found." >&4
10741 : Look for type of directory structure.
10743 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10745 case "$direntrytype" in
10747 case "$i_dirent" in
10748 $define) guess1='struct dirent' ;;
10749 *) guess1='struct direct' ;;
10752 *) guess1="$direntrytype"
10757 'struct dirent') guess2='struct direct' ;;
10758 *) guess2='struct dirent' ;;
10761 if $contains "$guess1" try.c >/dev/null 2>&1; then
10762 direntrytype="$guess1"
10763 echo "Your directory entries are $direntrytype." >&4
10764 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10765 direntrytype="$guess2"
10766 echo "Your directory entries seem to be $direntrytype." >&4
10768 echo "I don't recognize your system's directory entries." >&4
10769 rp="What type is used for directory entries on this system?"
10772 direntrytype="$ans"
10777 : see if the directory entry stores field length
10779 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10780 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10781 echo "Good, your directory entry keeps length information in d_namlen." >&4
10784 echo "Your directory entry does not know about the d_namlen field." >&4
10791 : see if this is an sysdir system
10792 set sys/dir.h i_sysdir
10795 : see if this is an sysndir system
10796 set sys/ndir.h i_sysndir
10801 $cat >dirfd.c <<EOM
10803 #$i_stdlib I_STDLIB
10805 #include <stdlib.h>
10807 #$i_dirent I_DIRENT /**/
10808 #$i_sysdir I_SYS_DIR /**/
10809 #$i_sysndir I_SYS_NDIR /**/
10810 #$i_systypes I_SYS_TYPES /**/
10811 #if defined(I_SYS_TYPES)
10812 #include <sys/types.h>
10814 #if defined(I_DIRENT)
10815 #include <dirent.h>
10816 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10817 #include <sys/dir.h>
10821 #include <sys/ndir.h>
10825 #include <ndir.h> /* may be wrong in the future */
10827 #include <sys/dir.h>
10833 DIR *dirp = opendir(".");
10834 if (dirfd(dirp) >= 0)
10841 if eval $compile; then
10845 $define) echo "dirfd() found." >&4 ;;
10846 *) echo "dirfd() NOT found." >&4 ;;
10852 : see if dlerror exists
10855 set dlerror d_dlerror
10859 : see if dlfcn is available
10860 set dlfcn.h i_dlfcn
10867 On a few systems, the dynamically loaded modules that perl generates and uses
10868 will need a different extension than shared libs. The default will probably
10874 *) dflt="$dlext" ;;
10876 rp='What is the extension of dynamically loaded modules'
10885 : Check if dlsym need a leading underscore
10891 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
10892 $cat >dyna.c <<'EOM'
10899 #$i_stdlib I_STDLIB
10901 #include <stdlib.h>
10905 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
10907 #include <sys/types.h>
10912 extern int fred() ;
10921 int mode = RTLD_LAZY ;
10923 handle = dlopen("./dyna.$dlext", mode) ;
10924 if (handle == NULL) {
10929 symbol = dlsym(handle, "fred") ;
10930 if (symbol == NULL) {
10931 /* try putting a leading underscore */
10932 symbol = dlsym(handle, "_fred") ;
10933 if (symbol == NULL) {
10946 : Call the object file tmp-dyna.o in case dlext=o.
10947 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
10948 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
10949 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
10950 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
10953 1) echo "Test program failed using dlopen." >&4
10954 echo "Perhaps you should not use dynamic loading." >&4;;
10955 2) echo "Test program failed using dlsym." >&4
10956 echo "Perhaps you should not use dynamic loading." >&4;;
10957 3) echo "dlsym needs a leading underscore" >&4
10959 4) echo "dlsym doesn't need a leading underscore." >&4;;
10962 echo "I can't compile and run the test program." >&4
10963 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
10968 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
10973 : see if drand48_r exists
10974 set drand48_r d_drand48_r
10976 case "$d_drand48_r" in
10978 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
10979 case "$d_drand48_r_proto:$usethreads" in
10980 ":define") d_drand48_r_proto=define
10981 set d_drand48_r_proto drand48_r $hdrs
10985 case "$d_drand48_r_proto" in
10987 case "$drand48_r_proto" in
10988 ''|0) try='int drand48_r(struct drand48_data*, double*);'
10989 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
10991 case "$drand48_r_proto" in
10992 ''|0) d_drand48_r=undef
10994 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
10995 * ) case "$drand48_r_proto" in
10996 REENTRANT_PROTO*) ;;
10997 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
10999 echo "Prototype: $try" ;;
11002 *) case "$usethreads" in
11003 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11010 *) drand48_r_proto=0
11014 : see if prototype for drand48 is available
11016 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11019 : see if dup2 exists
11023 : see if eaccess exists
11024 set eaccess d_eaccess
11027 : see if endgrent exists
11028 set endgrent d_endgrent
11031 : see if this is an grp system
11037 xxx=`./findhdr grp.h`
11038 $cppstdin $cppflags $cppminus < $xxx >$$.h
11040 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11052 set d_grpasswd; eval $setvar
11056 : see if endgrent_r exists
11057 set endgrent_r d_endgrent_r
11059 case "$d_endgrent_r" in
11061 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11062 case "$d_endgrent_r_proto:$usethreads" in
11063 ":define") d_endgrent_r_proto=define
11064 set d_endgrent_r_proto endgrent_r $hdrs
11068 case "$d_endgrent_r_proto" in
11070 case "$endgrent_r_proto" in
11071 ''|0) try='int endgrent_r(FILE**);'
11072 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11074 case "$endgrent_r_proto" in
11075 ''|0) try='void endgrent_r(FILE**);'
11076 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11078 case "$endgrent_r_proto" in
11079 ''|0) d_endgrent_r=undef
11081 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11082 * ) case "$endgrent_r_proto" in
11083 REENTRANT_PROTO*) ;;
11084 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11086 echo "Prototype: $try" ;;
11089 *) case "$usethreads" in
11090 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11097 *) endgrent_r_proto=0
11101 : see if endhostent exists
11102 set endhostent d_endhent
11105 : see if this is a netdb.h system
11106 set netdb.h i_netdb
11109 : see if endhostent_r exists
11110 set endhostent_r d_endhostent_r
11112 case "$d_endhostent_r" in
11114 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11115 case "$d_endhostent_r_proto:$usethreads" in
11116 ":define") d_endhostent_r_proto=define
11117 set d_endhostent_r_proto endhostent_r $hdrs
11121 case "$d_endhostent_r_proto" in
11123 case "$endhostent_r_proto" in
11124 ''|0) try='int endhostent_r(struct hostent_data*);'
11125 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11127 case "$endhostent_r_proto" in
11128 ''|0) try='void endhostent_r(struct hostent_data*);'
11129 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11131 case "$endhostent_r_proto" in
11132 ''|0) d_endhostent_r=undef
11133 endhostent_r_proto=0
11134 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11135 * ) case "$endhostent_r_proto" in
11136 REENTRANT_PROTO*) ;;
11137 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11139 echo "Prototype: $try" ;;
11142 *) case "$usethreads" in
11143 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11145 d_endhostent_r=undef
11146 endhostent_r_proto=0
11150 *) endhostent_r_proto=0
11154 : see if endnetent exists
11155 set endnetent d_endnent
11158 : see if endnetent_r exists
11159 set endnetent_r d_endnetent_r
11161 case "$d_endnetent_r" in
11163 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11164 case "$d_endnetent_r_proto:$usethreads" in
11165 ":define") d_endnetent_r_proto=define
11166 set d_endnetent_r_proto endnetent_r $hdrs
11170 case "$d_endnetent_r_proto" in
11172 case "$endnetent_r_proto" in
11173 ''|0) try='int endnetent_r(struct netent_data*);'
11174 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11176 case "$endnetent_r_proto" in
11177 ''|0) try='void endnetent_r(struct netent_data*);'
11178 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11180 case "$endnetent_r_proto" in
11181 ''|0) d_endnetent_r=undef
11182 endnetent_r_proto=0
11183 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11184 * ) case "$endnetent_r_proto" in
11185 REENTRANT_PROTO*) ;;
11186 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11188 echo "Prototype: $try" ;;
11191 *) case "$usethreads" in
11192 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11194 d_endnetent_r=undef
11195 endnetent_r_proto=0
11199 *) endnetent_r_proto=0
11203 : see if endprotoent exists
11204 set endprotoent d_endpent
11207 : see if endprotoent_r exists
11208 set endprotoent_r d_endprotoent_r
11210 case "$d_endprotoent_r" in
11212 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11213 case "$d_endprotoent_r_proto:$usethreads" in
11214 ":define") d_endprotoent_r_proto=define
11215 set d_endprotoent_r_proto endprotoent_r $hdrs
11219 case "$d_endprotoent_r_proto" in
11221 case "$endprotoent_r_proto" in
11222 ''|0) try='int endprotoent_r(struct protoent_data*);'
11223 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11225 case "$endprotoent_r_proto" in
11226 ''|0) try='void endprotoent_r(struct protoent_data*);'
11227 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11229 case "$endprotoent_r_proto" in
11230 ''|0) d_endprotoent_r=undef
11231 endprotoent_r_proto=0
11232 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11233 * ) case "$endprotoent_r_proto" in
11234 REENTRANT_PROTO*) ;;
11235 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11237 echo "Prototype: $try" ;;
11240 *) case "$usethreads" in
11241 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11243 d_endprotoent_r=undef
11244 endprotoent_r_proto=0
11248 *) endprotoent_r_proto=0
11252 : see if endpwent exists
11253 set endpwent d_endpwent
11256 : see if this is a pwd.h system
11262 xxx=`./findhdr pwd.h`
11263 $cppstdin $cppflags $cppminus < $xxx >$$.h
11265 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11273 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11281 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11289 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11297 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11305 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11313 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11321 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11333 set d_pwquota; eval $setvar
11334 set d_pwage; eval $setvar
11335 set d_pwchange; eval $setvar
11336 set d_pwclass; eval $setvar
11337 set d_pwexpire; eval $setvar
11338 set d_pwcomment; eval $setvar
11339 set d_pwgecos; eval $setvar
11340 set d_pwpasswd; eval $setvar
11344 : see if endpwent_r exists
11345 set endpwent_r d_endpwent_r
11347 case "$d_endpwent_r" in
11349 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11350 case "$d_endpwent_r_proto:$usethreads" in
11351 ":define") d_endpwent_r_proto=define
11352 set d_endpwent_r_proto endpwent_r $hdrs
11356 case "$d_endpwent_r_proto" in
11358 case "$endpwent_r_proto" in
11359 ''|0) try='int endpwent_r(FILE**);'
11360 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11362 case "$endpwent_r_proto" in
11363 ''|0) try='void endpwent_r(FILE**);'
11364 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11366 case "$endpwent_r_proto" in
11367 ''|0) d_endpwent_r=undef
11369 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11370 * ) case "$endpwent_r_proto" in
11371 REENTRANT_PROTO*) ;;
11372 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11374 echo "Prototype: $try" ;;
11377 *) case "$usethreads" in
11378 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11385 *) endpwent_r_proto=0
11389 : see if endservent exists
11390 set endservent d_endsent
11393 : see if endservent_r exists
11394 set endservent_r d_endservent_r
11396 case "$d_endservent_r" in
11398 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11399 case "$d_endservent_r_proto:$usethreads" in
11400 ":define") d_endservent_r_proto=define
11401 set d_endservent_r_proto endservent_r $hdrs
11405 case "$d_endservent_r_proto" in
11407 case "$endservent_r_proto" in
11408 ''|0) try='int endservent_r(struct servent_data*);'
11409 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11411 case "$endservent_r_proto" in
11412 ''|0) try='void endservent_r(struct servent_data*);'
11413 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11415 case "$endservent_r_proto" in
11416 ''|0) d_endservent_r=undef
11417 endservent_r_proto=0
11418 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11419 * ) case "$endservent_r_proto" in
11420 REENTRANT_PROTO*) ;;
11421 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11423 echo "Prototype: $try" ;;
11426 *) case "$usethreads" in
11427 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11429 d_endservent_r=undef
11430 endservent_r_proto=0
11434 *) endservent_r_proto=0
11438 : Locate the flags for 'open()'
11441 #include <sys/types.h>
11446 #include <sys/file.h>
11448 #$i_stdlib I_STDLIB
11450 #include <stdlib.h>
11461 : check sys/file.h first to get FREAD on Sun
11462 if $test `./findhdr sys/file.h` && \
11463 set try -DI_SYS_FILE && eval $compile; then
11465 echo "<sys/file.h> defines the O_* constants..." >&4
11466 if $run ./try; then
11467 echo "and you have the 3 argument form of open()." >&4
11470 echo "but not the 3 argument form of open(). Oh, well." >&4
11473 elif $test `./findhdr fcntl.h` && \
11474 set try -DI_FCNTL && eval $compile; then
11476 echo "<fcntl.h> defines the O_* constants..." >&4
11477 if $run ./try; then
11478 echo "and you have the 3 argument form of open()." >&4
11481 echo "but not the 3 argument form of open(). Oh, well." >&4
11486 echo "I can't find the O_* constant definitions! You got problems." >&4
11492 : see which of string.h or strings.h is needed
11494 strings=`./findhdr string.h`
11495 if $test "$strings" && $test -r "$strings"; then
11496 echo "Using <string.h> instead of <strings.h>." >&4
11500 strings=`./findhdr strings.h`
11501 if $test "$strings" && $test -r "$strings"; then
11502 echo "Using <strings.h> instead of <string.h>." >&4
11504 echo "No string header found -- You'll surely have problems." >&4
11509 case "$i_string" in
11510 "$undef") strings=`./findhdr strings.h`;;
11511 *) strings=`./findhdr string.h`;;
11514 : see if this is a sys/file.h system
11519 : do we need to include sys/file.h ?
11523 if $h_sysfile; then
11525 echo "We'll be including <sys/file.h>." >&4
11528 echo "We won't be including <sys/file.h>." >&4
11538 : see if fcntl.h is there
11543 : see if we can include fcntl.h
11549 echo "We'll be including <fcntl.h>." >&4
11552 if $h_sysfile; then
11553 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11555 echo "We won't be including <fcntl.h>." >&4
11567 : check for non-blocking I/O stuff
11568 case "$h_sysfile" in
11569 true) echo "#include <sys/file.h>" > head.c;;
11572 true) echo "#include <fcntl.h>" > head.c;;
11573 *) echo "#include <sys/fcntl.h>" > head.c;;
11578 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11579 case "$o_nonblock" in
11581 $cat head.c > try.c
11582 $cat >>try.c <<EOCP
11584 #$i_stdlib I_STDLIB
11586 #include <stdlib.h>
11594 printf("O_NONBLOCK\n");
11598 printf("O_NDELAY\n");
11602 printf("FNDELAY\n");
11609 if eval $compile_ok; then
11610 o_nonblock=`$run ./try`
11611 case "$o_nonblock" in
11612 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11613 *) echo "Seems like we can use $o_nonblock.";;
11616 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11619 *) echo "Using $hint value $o_nonblock.";;
11621 $rm -f try try.* .out core
11624 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11627 $cat head.c > try.c
11628 $cat >>try.c <<EOCP
11630 #include <sys/types.h>
11631 #include <signal.h>
11633 #$i_stdlib I_STDLIB
11635 #include <stdlib.h>
11641 #define MY_O_NONBLOCK $o_nonblock
11642 #ifndef errno /* XXX need better Configure test */
11645 #$i_unistd I_UNISTD
11647 #include <unistd.h>
11649 #$i_string I_STRING
11651 #include <string.h>
11653 #include <strings.h>
11655 $signal_t blech(x) int x; { exit(3); }
11657 $cat >> try.c <<'EOCP'
11665 pipe(pd); /* Down: child -> parent */
11666 pipe(pu); /* Up: parent -> child */
11669 close(pd[1]); /* Parent reads from pd[0] */
11670 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11672 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11677 signal(SIGALRM, blech);
11679 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11681 sprintf(string, "%d\n", ret);
11682 write(2, string, strlen(string));
11685 if (errno == EAGAIN) {
11686 printf("EAGAIN\n");
11691 if (errno == EWOULDBLOCK)
11692 printf("EWOULDBLOCK\n");
11695 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11696 sleep(2); /* Give it time to close our pipe */
11698 ret = read(pd[0], buf, 1); /* Should read EOF */
11700 sprintf(string, "%d\n", ret);
11701 write(4, string, strlen(string));
11705 close(pd[0]); /* We write to pd[1] */
11706 close(pu[1]); /* We read from pu[0] */
11707 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11708 close(pd[1]); /* Pipe pd is now fully closed! */
11709 exit(0); /* Bye bye, thank you for playing! */
11713 if eval $compile_ok; then
11714 echo "$startsh" >mtry
11715 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11717 ./mtry >/dev/null 2>&1
11719 0) eagain=`$cat try.out`;;
11720 1) echo "Could not perform non-blocking setting!";;
11721 2) echo "I did a successful read() for something that was not there!";;
11722 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11723 4) echo "Could not find F_SETFL!";;
11724 *) echo "Something terribly wrong happened during testing.";;
11726 rd_nodata=`$cat try.ret`
11727 echo "A read() system call with no data present returns $rd_nodata."
11728 case "$rd_nodata" in
11731 echo "(That's peculiar, fixing that to be -1.)"
11737 echo "Forcing errno EAGAIN on read() with no data available."
11741 echo "Your read() sets errno to $eagain when no data is available."
11744 status=`$cat try.err`
11746 0) echo "And it correctly returns 0 to signal EOF.";;
11747 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11748 *) echo "However, your read() returns '$status' on EOF??";;
11751 if test "$status" = "$rd_nodata"; then
11752 echo "WARNING: you can't distinguish between EOF and no data!"
11756 echo "I can't compile the test program--assuming errno EAGAIN will do."
11763 echo "Using $hint value $eagain."
11764 echo "Your read() returns $rd_nodata when no data is present."
11765 case "$d_eofnblk" in
11766 "$define") echo "And you can see EOF because read() returns 0.";;
11767 "$undef") echo "But you can't see EOF status from read() returned value.";;
11769 echo "(Assuming you can't see EOF status from read anyway.)"
11775 $rm -f try try.* .out core head.c mtry
11777 : see if _ptr and _cnt from stdio act std
11780 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11781 echo "(Looks like you have stdio.h from BSD.)"
11782 case "$stdio_ptr" in
11783 '') stdio_ptr='((fp)->_p)'
11786 *) ptr_lval=$d_stdio_ptr_lval;;
11788 case "$stdio_cnt" in
11789 '') stdio_cnt='((fp)->_r)'
11792 *) cnt_lval=$d_stdio_cnt_lval;;
11794 case "$stdio_base" in
11795 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11797 case "$stdio_bufsiz" in
11798 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11800 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11801 echo "(Looks like you have stdio.h from Linux.)"
11802 case "$stdio_ptr" in
11803 '') stdio_ptr='((fp)->_IO_read_ptr)'
11806 *) ptr_lval=$d_stdio_ptr_lval;;
11808 case "$stdio_cnt" in
11809 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11812 *) cnt_lval=$d_stdio_cnt_lval;;
11814 case "$stdio_base" in
11815 '') stdio_base='((fp)->_IO_read_base)';;
11817 case "$stdio_bufsiz" in
11818 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11821 case "$stdio_ptr" in
11822 '') stdio_ptr='((fp)->_ptr)'
11825 *) ptr_lval=$d_stdio_ptr_lval;;
11827 case "$stdio_cnt" in
11828 '') stdio_cnt='((fp)->_cnt)'
11831 *) cnt_lval=$d_stdio_cnt_lval;;
11833 case "$stdio_base" in
11834 '') stdio_base='((fp)->_base)';;
11836 case "$stdio_bufsiz" in
11837 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11841 : test whether _ptr and _cnt really work
11842 echo "Checking how std your stdio is..." >&4
11845 #$i_stdlib I_STDLIB
11847 #include <stdlib.h>
11849 #define FILE_ptr(fp) $stdio_ptr
11850 #define FILE_cnt(fp) $stdio_cnt
11852 FILE *fp = fopen("try.c", "r");
11855 18 <= FILE_cnt(fp) &&
11856 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11864 if eval $compile && $to try.c; then
11865 if $run ./try; then
11866 echo "Your stdio acts pretty std."
11869 echo "Your stdio isn't very std."
11872 echo "Your stdio doesn't appear very std."
11876 # glibc 2.2.90 and above apparently change stdio streams so Perl's
11877 # direct buffer manipulation no longer works. The Configure tests
11878 # should be changed to correctly detect this, but until then,
11879 # the following check should at least let perl compile and run.
11880 # (This quick fix should be updated before 5.8.1.)
11881 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
11882 # A. Dougherty, June 3, 2002.
11883 case "$d_gnulibc" in
11885 case "$gnulibc_version" in
11889 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
11898 : Can _ptr be used as an lvalue?
11899 case "$d_stdstdio$ptr_lval" in
11900 $define$define) val=$define ;;
11903 set d_stdio_ptr_lval
11906 : Can _cnt be used as an lvalue?
11907 case "$d_stdstdio$cnt_lval" in
11908 $define$define) val=$define ;;
11911 set d_stdio_cnt_lval
11915 : test whether setting _ptr sets _cnt as a side effect
11916 d_stdio_ptr_lval_sets_cnt="$undef"
11917 d_stdio_ptr_lval_nochange_cnt="$undef"
11918 case "$d_stdio_ptr_lval$d_stdstdio" in
11920 echo "Checking to see what happens if we set the stdio ptr..." >&4
11923 /* Can we scream? */
11924 /* Eat dust sed :-) */
11925 /* In the buffer space, no one can hear you scream. */
11926 #$i_stdlib I_STDLIB
11928 #include <stdlib.h>
11930 #define FILE_ptr(fp) $stdio_ptr
11931 #define FILE_cnt(fp) $stdio_cnt
11932 #include <sys/types.h>
11934 FILE *fp = fopen("try.c", "r");
11939 puts("Fail even to read");
11942 c = getc(fp); /* Read away the first # */
11944 puts("Fail even to read");
11948 18 <= FILE_cnt(fp) &&
11949 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11951 puts("Fail even to read");
11954 ptr = (char*) FILE_ptr(fp);
11955 cnt = (size_t)FILE_cnt(fp);
11957 FILE_ptr(fp) += 42;
11959 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
11960 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
11963 if (FILE_cnt(fp) <= 20) {
11964 printf ("Fail (<20 chars to test)");
11967 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
11968 puts("Fail compare");
11971 if (cnt == FILE_cnt(fp)) {
11972 puts("Pass_unchanged");
11975 if (FILE_cnt(fp) == (cnt - 42)) {
11976 puts("Pass_changed");
11979 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
11985 if eval $compile && $to try.c; then
11986 case `$run ./try` in
11988 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
11989 d_stdio_ptr_lval_sets_cnt="$define" ;;
11991 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
11992 d_stdio_ptr_lval_nochange_cnt="$define" ;;
11994 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
11996 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
11999 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12005 : see if _base is also standard
12007 case "$d_stdstdio" in
12011 #$i_stdlib I_STDLIB
12013 #include <stdlib.h>
12015 #define FILE_base(fp) $stdio_base
12016 #define FILE_bufsiz(fp) $stdio_bufsiz
12018 FILE *fp = fopen("try.c", "r");
12021 19 <= FILE_bufsiz(fp) &&
12022 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12029 if eval $compile && $to try.c; then
12030 if $run ./try; then
12031 echo "And its _base field acts std."
12034 echo "But its _base field isn't std."
12037 echo "However, it seems to be lacking the _base field."
12045 : see if fast_stdio exists
12047 case "$d_stdstdio:$d_stdio_ptr_lval" in
12049 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12051 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12062 : see if fchdir exists
12063 set fchdir d_fchdir
12066 : see if fchmod exists
12067 set fchmod d_fchmod
12070 : see if fchown exists
12071 set fchown d_fchown
12074 : see if this is an fcntl system
12079 : See if fcntl-based locking works.
12081 #$i_stdlib I_STDLIB
12083 #include <stdlib.h>
12085 #include <unistd.h>
12087 #include <signal.h>
12088 $signal_t blech(x) int x; { exit(3); }
12090 #if defined(F_SETLK) && defined(F_SETLKW)
12091 struct flock flock;
12093 fd = open("try.c", O_RDONLY);
12094 flock.l_type = F_RDLCK;
12095 flock.l_whence = SEEK_SET;
12096 flock.l_start = flock.l_len = 0;
12097 signal(SIGALRM, blech);
12099 retval = fcntl(fd, F_SETLK, &flock);
12101 (retval < 0 ? exit(2) : exit(0));
12107 echo "Checking if fcntl-based file locking works... "
12111 if eval $compile_ok; then
12112 if $run ./try; then
12113 echo "Yes, it seems to work."
12116 echo "Nope, it didn't work."
12121 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12122 *** This is (almost) impossible.
12123 *** If your NFS lock daemons are not feeling well, something like
12124 *** this may happen, please investigate. Cannot continue, aborting.
12132 echo "I'm unable to compile the test program, so I'll assume not."
12137 echo "Nope, since you don't even have fcntl()."
12140 set d_fcntl_can_lock
12145 : check for fd_set items
12148 Checking to see how well your C compiler handles fd_set and friends ...
12151 #$i_stdlib I_STDLIB
12153 #include <stdlib.h>
12155 #$i_systime I_SYS_TIME
12156 #$i_sysselct I_SYS_SELECT
12157 #$d_socket HAS_SOCKET
12158 #include <sys/types.h>
12160 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12163 #include <sys/time.h>
12165 #ifdef I_SYS_SELECT
12166 #include <sys/select.h>
12175 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12183 if eval $compile; then
12184 d_fds_bits="$define"
12186 echo "Well, your system knows about the normal fd_set typedef..." >&4
12187 if $run ./try; then
12188 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12189 d_fd_macros="$define"
12192 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12194 d_fd_macros="$undef"
12198 Hmm, your compiler has some difficulty with fd_set. Checking further...
12201 if eval $compile; then
12202 d_fds_bits="$undef"
12204 echo "Well, your system has some sort of fd_set available..." >&4
12205 if $run ./try; then
12206 echo "and you have the normal fd_set macros." >&4
12207 d_fd_macros="$define"
12210 but not the normal fd_set macros! Gross! More work for me...
12212 d_fd_macros="$undef"
12215 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12217 d_fds_bits="$undef"
12218 d_fd_macros="$undef"
12223 : see if fgetpos exists
12224 set fgetpos d_fgetpos
12227 : see if finite exists
12228 set finite d_finite
12231 : see if finitel exists
12232 set finitel d_finitel
12235 : see if flock exists
12239 : see if prototype for flock is available
12241 set d_flockproto flock $i_sysfile sys/file.h
12244 : see if fork exists
12248 : see if fp_class exists
12249 set fp_class d_fp_class
12252 : see if pathconf exists
12253 set pathconf d_pathconf
12256 : see if fpathconf exists
12257 set fpathconf d_fpathconf
12260 : see if fpclass exists
12261 set fpclass d_fpclass
12264 : see if fpclassify exists
12265 set fpclassify d_fpclassify
12268 : see if fpclassl exists
12269 set fpclassl d_fpclassl
12273 : check for fpos64_t
12275 echo "Checking to see if you have fpos64_t..." >&4
12278 int main() { fpos64_t x = 7; }
12281 if eval $compile; then
12283 echo "You have fpos64_t."
12286 echo "You do not have fpos64_t."
12287 case "$fpossize" in
12288 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12295 : see if frexpl exists
12296 set frexpl d_frexpl
12299 : see if this is a sys/param system
12300 set sys/param.h i_sysparam
12303 : see if this is a sys/mount.h system
12304 set sys/mount.h i_sysmount
12309 echo "Checking to see if your system supports struct fs_data..." >&4
12310 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12312 case "$d_fs_data_s" in
12313 "$define") echo "Yes, it does." ;;
12314 *) echo "No, it doesn't." ;;
12317 : see if fseeko exists
12318 set fseeko d_fseeko
12320 case "$longsize" in
12321 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12324 : see if fsetpos exists
12325 set fsetpos d_fsetpos
12329 : see if fstatfs exists
12330 set fstatfs d_fstatfs
12334 : see if statvfs exists
12335 set statvfs d_statvfs
12338 : see if fstatvfs exists
12339 set fstatvfs d_fstatvfs
12343 : see if fsync exists
12347 : see if ftello exists
12348 set ftello d_ftello
12350 case "$longsize" in
12351 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12354 : see if getcwd exists
12355 set getcwd d_getcwd
12358 : see if getespwnam exists
12359 set getespwnam d_getespwnam
12363 : see if getfsstat exists
12364 set getfsstat d_getfsstat
12367 : see if getgrent exists
12368 set getgrent d_getgrent
12371 : see if getgrent_r exists
12372 set getgrent_r d_getgrent_r
12374 case "$d_getgrent_r" in
12376 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12377 case "$d_getgrent_r_proto:$usethreads" in
12378 ":define") d_getgrent_r_proto=define
12379 set d_getgrent_r_proto getgrent_r $hdrs
12383 case "$d_getgrent_r_proto" in
12385 case "$getgrent_r_proto" in
12386 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12387 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12389 case "$getgrent_r_proto" in
12390 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12391 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12393 case "$getgrent_r_proto" in
12394 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12395 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12397 case "$getgrent_r_proto" in
12398 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12399 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12401 case "$getgrent_r_proto" in
12402 ''|0) try='int getgrent_r(struct group*, char*, int);'
12403 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12405 case "$getgrent_r_proto" in
12406 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12407 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12409 case "$getgrent_r_proto" in
12410 ''|0) d_getgrent_r=undef
12412 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12413 * ) case "$getgrent_r_proto" in
12414 REENTRANT_PROTO*) ;;
12415 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12417 echo "Prototype: $try" ;;
12420 *) case "$usethreads" in
12421 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12428 *) getgrent_r_proto=0
12432 : see if getgrgid_r exists
12433 set getgrgid_r d_getgrgid_r
12435 case "$d_getgrgid_r" in
12437 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12438 case "$d_getgrgid_r_proto:$usethreads" in
12439 ":define") d_getgrgid_r_proto=define
12440 set d_getgrgid_r_proto getgrgid_r $hdrs
12444 case "$d_getgrgid_r_proto" in
12446 case "$getgrgid_r_proto" in
12447 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12448 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12450 case "$getgrgid_r_proto" in
12451 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12452 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12454 case "$getgrgid_r_proto" in
12455 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12456 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12458 case "$getgrgid_r_proto" in
12459 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12460 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12462 case "$getgrgid_r_proto" in
12463 ''|0) d_getgrgid_r=undef
12465 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12466 * ) case "$getgrgid_r_proto" in
12467 REENTRANT_PROTO*) ;;
12468 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12470 echo "Prototype: $try" ;;
12473 *) case "$usethreads" in
12474 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12481 *) getgrgid_r_proto=0
12485 : see if getgrnam_r exists
12486 set getgrnam_r d_getgrnam_r
12488 case "$d_getgrnam_r" in
12490 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12491 case "$d_getgrnam_r_proto:$usethreads" in
12492 ":define") d_getgrnam_r_proto=define
12493 set d_getgrnam_r_proto getgrnam_r $hdrs
12497 case "$d_getgrnam_r_proto" in
12499 case "$getgrnam_r_proto" in
12500 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12501 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12503 case "$getgrnam_r_proto" in
12504 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12505 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12507 case "$getgrnam_r_proto" in
12508 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12509 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12511 case "$getgrnam_r_proto" in
12512 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12513 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12515 case "$getgrnam_r_proto" in
12516 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12517 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12519 case "$getgrnam_r_proto" in
12520 ''|0) d_getgrnam_r=undef
12522 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12523 * ) case "$getgrnam_r_proto" in
12524 REENTRANT_PROTO*) ;;
12525 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12527 echo "Prototype: $try" ;;
12530 *) case "$usethreads" in
12531 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12538 *) getgrnam_r_proto=0
12542 : see if gethostbyaddr exists
12543 set gethostbyaddr d_gethbyaddr
12546 : see if gethostbyname exists
12547 set gethostbyname d_gethbyname
12550 : see if gethostent exists
12551 set gethostent d_gethent
12554 : see how we will look up host name
12557 if set gethostname val -f d_gethname; eval $csym; $val; then
12558 echo 'gethostname() found.' >&4
12559 d_gethname="$define"
12562 if set uname val -f d_uname; eval $csym; $val; then
12565 uname() was found, but you're running xenix, and older versions of xenix
12566 have a broken uname(). If you don't really know whether your xenix is old
12567 enough to have a broken system call, use the default answer.
12572 "$define") dflt=n;;
12574 rp='Is your uname() broken?'
12577 n*) d_uname="$define"; call=uname;;
12580 echo 'uname() found.' >&4
12587 case "$d_gethname" in
12588 '') d_gethname="$undef";;
12591 '') d_uname="$undef";;
12593 case "$d_uname$d_gethname" in
12598 Every now and then someone has a $call() that lies about the hostname
12599 but can't be fixed for political or economic reasons. If you wish, I can
12600 pretend $call() isn't there and maybe compute hostname at run-time
12601 thanks to the '$phostname' command.
12604 rp="Shall I ignore $call() from now on?"
12607 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12610 case "$phostname" in
12611 '') aphostname='';;
12612 *) case "$aphostname" in
12614 *) set X $phostname
12618 file=`./loc $file $file $pth`
12619 aphostname=`echo $file $*`
12624 case "$d_uname$d_gethname" in
12627 case "$phostname" in
12629 echo "There will be no way for $package to get your hostname." >&4;;
12631 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12635 case "$d_phostname" in
12636 '') d_phostname="$undef";;
12639 : see if gethostbyaddr_r exists
12640 set gethostbyaddr_r d_gethostbyaddr_r
12642 case "$d_gethostbyaddr_r" in
12644 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12645 case "$d_gethostbyaddr_r_proto:$usethreads" in
12646 ":define") d_gethostbyaddr_r_proto=define
12647 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12651 case "$d_gethostbyaddr_r_proto" in
12653 case "$gethostbyaddr_r_proto" in
12654 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12655 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12657 case "$gethostbyaddr_r_proto" in
12658 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12659 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12661 case "$gethostbyaddr_r_proto" in
12662 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12663 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12665 case "$gethostbyaddr_r_proto" in
12666 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12667 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12669 case "$gethostbyaddr_r_proto" in
12670 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12671 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12673 case "$gethostbyaddr_r_proto" in
12674 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12675 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12677 case "$gethostbyaddr_r_proto" in
12678 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12679 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12681 case "$gethostbyaddr_r_proto" in
12682 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12683 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12685 case "$gethostbyaddr_r_proto" in
12686 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12687 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12689 case "$gethostbyaddr_r_proto" in
12690 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12691 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12693 case "$gethostbyaddr_r_proto" in
12694 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12695 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12697 case "$gethostbyaddr_r_proto" in
12698 ''|0) d_gethostbyaddr_r=undef
12699 gethostbyaddr_r_proto=0
12700 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12701 * ) case "$gethostbyaddr_r_proto" in
12702 REENTRANT_PROTO*) ;;
12703 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12705 echo "Prototype: $try" ;;
12708 *) case "$usethreads" in
12709 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12711 d_gethostbyaddr_r=undef
12712 gethostbyaddr_r_proto=0
12716 *) gethostbyaddr_r_proto=0
12720 : see if gethostbyname_r exists
12721 set gethostbyname_r d_gethostbyname_r
12723 case "$d_gethostbyname_r" in
12725 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12726 case "$d_gethostbyname_r_proto:$usethreads" in
12727 ":define") d_gethostbyname_r_proto=define
12728 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12732 case "$d_gethostbyname_r_proto" in
12734 case "$gethostbyname_r_proto" in
12735 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12736 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12738 case "$gethostbyname_r_proto" in
12739 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12740 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12742 case "$gethostbyname_r_proto" in
12743 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12744 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
12746 case "$gethostbyname_r_proto" in
12747 ''|0) d_gethostbyname_r=undef
12748 gethostbyname_r_proto=0
12749 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
12750 * ) case "$gethostbyname_r_proto" in
12751 REENTRANT_PROTO*) ;;
12752 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
12754 echo "Prototype: $try" ;;
12757 *) case "$usethreads" in
12758 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
12760 d_gethostbyname_r=undef
12761 gethostbyname_r_proto=0
12765 *) gethostbyname_r_proto=0
12769 : see if gethostent_r exists
12770 set gethostent_r d_gethostent_r
12772 case "$d_gethostent_r" in
12774 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12775 case "$d_gethostent_r_proto:$usethreads" in
12776 ":define") d_gethostent_r_proto=define
12777 set d_gethostent_r_proto gethostent_r $hdrs
12781 case "$d_gethostent_r_proto" in
12783 case "$gethostent_r_proto" in
12784 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
12785 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
12787 case "$gethostent_r_proto" in
12788 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
12789 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
12791 case "$gethostent_r_proto" in
12792 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
12793 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
12795 case "$gethostent_r_proto" in
12796 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
12797 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
12799 case "$gethostent_r_proto" in
12800 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
12801 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
12803 case "$gethostent_r_proto" in
12804 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
12805 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
12807 case "$gethostent_r_proto" in
12808 ''|0) d_gethostent_r=undef
12809 gethostent_r_proto=0
12810 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
12811 * ) case "$gethostent_r_proto" in
12812 REENTRANT_PROTO*) ;;
12813 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
12815 echo "Prototype: $try" ;;
12818 *) case "$usethreads" in
12819 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
12821 d_gethostent_r=undef
12822 gethostent_r_proto=0
12826 *) gethostent_r_proto=0
12830 : see if prototypes for various gethostxxx netdb.h functions are available
12832 set d_gethostprotos gethostent $i_netdb netdb.h
12835 : see if getitimer exists
12836 set getitimer d_getitimer
12839 : see if getlogin exists
12840 set getlogin d_getlogin
12843 : see if getlogin_r exists
12844 set getlogin_r d_getlogin_r
12846 case "$d_getlogin_r" in
12848 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
12849 case "$d_getlogin_r_proto:$usethreads" in
12850 ":define") d_getlogin_r_proto=define
12851 set d_getlogin_r_proto getlogin_r $hdrs
12855 case "$d_getlogin_r_proto" in
12857 case "$getlogin_r_proto" in
12858 ''|0) try='int getlogin_r(char*, size_t);'
12859 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
12861 case "$getlogin_r_proto" in
12862 ''|0) try='int getlogin_r(char*, int);'
12863 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
12865 case "$getlogin_r_proto" in
12866 ''|0) try='char* getlogin_r(char*, size_t);'
12867 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
12869 case "$getlogin_r_proto" in
12870 ''|0) try='char* getlogin_r(char*, int);'
12871 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
12873 case "$getlogin_r_proto" in
12874 ''|0) d_getlogin_r=undef
12876 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
12877 * ) case "$getlogin_r_proto" in
12878 REENTRANT_PROTO*) ;;
12879 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
12881 echo "Prototype: $try" ;;
12884 *) case "$usethreads" in
12885 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
12892 *) getlogin_r_proto=0
12896 : see if getmnt exists
12897 set getmnt d_getmnt
12900 : see if getmntent exists
12901 set getmntent d_getmntent
12904 : see if getnetbyaddr exists
12905 set getnetbyaddr d_getnbyaddr
12908 : see if getnetbyname exists
12909 set getnetbyname d_getnbyname
12912 : see if getnetent exists
12913 set getnetent d_getnent
12916 : see if getnetbyaddr_r exists
12917 set getnetbyaddr_r d_getnetbyaddr_r
12919 case "$d_getnetbyaddr_r" in
12921 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12922 case "$d_getnetbyaddr_r_proto:$usethreads" in
12923 ":define") d_getnetbyaddr_r_proto=define
12924 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
12928 case "$d_getnetbyaddr_r_proto" in
12930 case "$getnetbyaddr_r_proto" in
12931 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
12932 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
12934 case "$getnetbyaddr_r_proto" in
12935 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
12936 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
12938 case "$getnetbyaddr_r_proto" in
12939 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
12940 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
12942 case "$getnetbyaddr_r_proto" in
12943 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
12944 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
12946 case "$getnetbyaddr_r_proto" in
12947 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
12948 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
12950 case "$getnetbyaddr_r_proto" in
12951 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
12952 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
12954 case "$getnetbyaddr_r_proto" in
12955 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
12956 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
12958 case "$getnetbyaddr_r_proto" in
12959 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
12960 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
12962 case "$getnetbyaddr_r_proto" in
12963 ''|0) d_getnetbyaddr_r=undef
12964 getnetbyaddr_r_proto=0
12965 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
12966 * ) case "$getnetbyaddr_r_proto" in
12967 REENTRANT_PROTO*) ;;
12968 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
12970 echo "Prototype: $try" ;;
12973 *) case "$usethreads" in
12974 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
12976 d_getnetbyaddr_r=undef
12977 getnetbyaddr_r_proto=0
12981 *) getnetbyaddr_r_proto=0
12985 : see if getnetbyname_r exists
12986 set getnetbyname_r d_getnetbyname_r
12988 case "$d_getnetbyname_r" in
12990 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12991 case "$d_getnetbyname_r_proto:$usethreads" in
12992 ":define") d_getnetbyname_r_proto=define
12993 set d_getnetbyname_r_proto getnetbyname_r $hdrs
12997 case "$d_getnetbyname_r_proto" in
12999 case "$getnetbyname_r_proto" in
13000 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13001 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13003 case "$getnetbyname_r_proto" in
13004 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13005 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13007 case "$getnetbyname_r_proto" in
13008 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13009 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13011 case "$getnetbyname_r_proto" in
13012 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13013 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13015 case "$getnetbyname_r_proto" in
13016 ''|0) d_getnetbyname_r=undef
13017 getnetbyname_r_proto=0
13018 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13019 * ) case "$getnetbyname_r_proto" in
13020 REENTRANT_PROTO*) ;;
13021 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13023 echo "Prototype: $try" ;;
13026 *) case "$usethreads" in
13027 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13029 d_getnetbyname_r=undef
13030 getnetbyname_r_proto=0
13034 *) getnetbyname_r_proto=0
13038 : see if getnetent_r exists
13039 set getnetent_r d_getnetent_r
13041 case "$d_getnetent_r" in
13043 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13044 case "$d_getnetent_r_proto:$usethreads" in
13045 ":define") d_getnetent_r_proto=define
13046 set d_getnetent_r_proto getnetent_r $hdrs
13050 case "$d_getnetent_r_proto" in
13052 case "$getnetent_r_proto" in
13053 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13054 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13056 case "$getnetent_r_proto" in
13057 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13058 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13060 case "$getnetent_r_proto" in
13061 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13062 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13064 case "$getnetent_r_proto" in
13065 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13066 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13068 case "$getnetent_r_proto" in
13069 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13070 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13072 case "$getnetent_r_proto" in
13073 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13074 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13076 case "$getnetent_r_proto" in
13077 ''|0) d_getnetent_r=undef
13078 getnetent_r_proto=0
13079 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13080 * ) case "$getnetent_r_proto" in
13081 REENTRANT_PROTO*) ;;
13082 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13084 echo "Prototype: $try" ;;
13087 *) case "$usethreads" in
13088 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13090 d_getnetent_r=undef
13091 getnetent_r_proto=0
13095 *) getnetent_r_proto=0
13099 : see if prototypes for various getnetxxx netdb.h functions are available
13101 set d_getnetprotos getnetent $i_netdb netdb.h
13104 : see if getpagesize exists
13105 set getpagesize d_getpagsz
13109 : see if getprotobyname exists
13110 set getprotobyname d_getpbyname
13113 : see if getprotobynumber exists
13114 set getprotobynumber d_getpbynumber
13117 : see if getprotoent exists
13118 set getprotoent d_getpent
13121 : see if getpgid exists
13122 set getpgid d_getpgid
13125 : see if getpgrp2 exists
13126 set getpgrp2 d_getpgrp2
13129 : see if getppid exists
13130 set getppid d_getppid
13133 : see if getpriority exists
13134 set getpriority d_getprior
13137 : see if getprotobyname_r exists
13138 set getprotobyname_r d_getprotobyname_r
13140 case "$d_getprotobyname_r" in
13142 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13143 case "$d_getprotobyname_r_proto:$usethreads" in
13144 ":define") d_getprotobyname_r_proto=define
13145 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13149 case "$d_getprotobyname_r_proto" in
13151 case "$getprotobyname_r_proto" in
13152 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13153 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13155 case "$getprotobyname_r_proto" in
13156 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13157 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13159 case "$getprotobyname_r_proto" in
13160 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13161 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13163 case "$getprotobyname_r_proto" in
13164 ''|0) d_getprotobyname_r=undef
13165 getprotobyname_r_proto=0
13166 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13167 * ) case "$getprotobyname_r_proto" in
13168 REENTRANT_PROTO*) ;;
13169 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13171 echo "Prototype: $try" ;;
13174 *) case "$usethreads" in
13175 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13177 d_getprotobyname_r=undef
13178 getprotobyname_r_proto=0
13182 *) getprotobyname_r_proto=0
13186 : see if getprotobynumber_r exists
13187 set getprotobynumber_r d_getprotobynumber_r
13189 case "$d_getprotobynumber_r" in
13191 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13192 case "$d_getprotobynumber_r_proto:$usethreads" in
13193 ":define") d_getprotobynumber_r_proto=define
13194 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13198 case "$d_getprotobynumber_r_proto" in
13200 case "$getprotobynumber_r_proto" in
13201 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13202 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13204 case "$getprotobynumber_r_proto" in
13205 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13206 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13208 case "$getprotobynumber_r_proto" in
13209 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13210 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13212 case "$getprotobynumber_r_proto" in
13213 ''|0) d_getprotobynumber_r=undef
13214 getprotobynumber_r_proto=0
13215 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13216 * ) case "$getprotobynumber_r_proto" in
13217 REENTRANT_PROTO*) ;;
13218 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13220 echo "Prototype: $try" ;;
13223 *) case "$usethreads" in
13224 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13226 d_getprotobynumber_r=undef
13227 getprotobynumber_r_proto=0
13231 *) getprotobynumber_r_proto=0
13235 : see if getprotoent_r exists
13236 set getprotoent_r d_getprotoent_r
13238 case "$d_getprotoent_r" in
13240 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13241 case "$d_getprotoent_r_proto:$usethreads" in
13242 ":define") d_getprotoent_r_proto=define
13243 set d_getprotoent_r_proto getprotoent_r $hdrs
13247 case "$d_getprotoent_r_proto" in
13249 case "$getprotoent_r_proto" in
13250 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13251 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13253 case "$getprotoent_r_proto" in
13254 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13255 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13257 case "$getprotoent_r_proto" in
13258 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13259 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13261 case "$getprotoent_r_proto" in
13262 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13263 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13265 case "$getprotoent_r_proto" in
13266 ''|0) d_getprotoent_r=undef
13267 getprotoent_r_proto=0
13268 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13269 * ) case "$getprotoent_r_proto" in
13270 REENTRANT_PROTO*) ;;
13271 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13273 echo "Prototype: $try" ;;
13276 *) case "$usethreads" in
13277 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13279 d_getprotoent_r=undef
13280 getprotoent_r_proto=0
13284 *) getprotoent_r_proto=0
13288 : see if prototypes for various getprotoxxx netdb.h functions are available
13290 set d_getprotoprotos getprotoent $i_netdb netdb.h
13293 : see if getprpwnam exists
13294 set getprpwnam d_getprpwnam
13297 : see if getpwent exists
13298 set getpwent d_getpwent
13301 : see if getpwent_r exists
13302 set getpwent_r d_getpwent_r
13304 case "$d_getpwent_r" in
13306 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13307 case "$d_getpwent_r_proto:$usethreads" in
13308 ":define") d_getpwent_r_proto=define
13309 set d_getpwent_r_proto getpwent_r $hdrs
13313 case "$d_getpwent_r_proto" in
13315 case "$getpwent_r_proto" in
13316 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13317 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13319 case "$getpwent_r_proto" in
13320 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13321 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13323 case "$getpwent_r_proto" in
13324 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13325 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13327 case "$getpwent_r_proto" in
13328 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13329 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13331 case "$getpwent_r_proto" in
13332 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13333 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13335 case "$getpwent_r_proto" in
13336 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13337 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13339 case "$getpwent_r_proto" in
13340 ''|0) d_getpwent_r=undef
13342 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13343 * ) case "$getpwent_r_proto" in
13344 REENTRANT_PROTO*) ;;
13345 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13347 echo "Prototype: $try" ;;
13350 *) case "$usethreads" in
13351 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13358 *) getpwent_r_proto=0
13362 : see if getpwnam_r exists
13363 set getpwnam_r d_getpwnam_r
13365 case "$d_getpwnam_r" in
13367 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13368 case "$d_getpwnam_r_proto:$usethreads" in
13369 ":define") d_getpwnam_r_proto=define
13370 set d_getpwnam_r_proto getpwnam_r $hdrs
13374 case "$d_getpwnam_r_proto" in
13376 case "$getpwnam_r_proto" in
13377 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13378 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13380 case "$getpwnam_r_proto" in
13381 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13382 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13384 case "$getpwnam_r_proto" in
13385 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13386 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13388 case "$getpwnam_r_proto" in
13389 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13390 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13392 case "$getpwnam_r_proto" in
13393 ''|0) d_getpwnam_r=undef
13395 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13396 * ) case "$getpwnam_r_proto" in
13397 REENTRANT_PROTO*) ;;
13398 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13400 echo "Prototype: $try" ;;
13403 *) case "$usethreads" in
13404 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13411 *) getpwnam_r_proto=0
13415 : see if getpwuid_r exists
13416 set getpwuid_r d_getpwuid_r
13418 case "$d_getpwuid_r" in
13420 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13421 case "$d_getpwuid_r_proto:$usethreads" in
13422 ":define") d_getpwuid_r_proto=define
13423 set d_getpwuid_r_proto getpwuid_r $hdrs
13427 case "$d_getpwuid_r_proto" in
13429 case "$getpwuid_r_proto" in
13430 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13431 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13433 case "$getpwuid_r_proto" in
13434 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13435 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13437 case "$getpwuid_r_proto" in
13438 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13439 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13441 case "$getpwuid_r_proto" in
13442 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13443 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13445 case "$getpwuid_r_proto" in
13446 ''|0) d_getpwuid_r=undef
13448 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13449 * ) case "$getpwuid_r_proto" in
13450 REENTRANT_PROTO*) ;;
13451 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13453 echo "Prototype: $try" ;;
13456 *) case "$usethreads" in
13457 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13464 *) getpwuid_r_proto=0
13469 : see if getservbyname exists
13470 set getservbyname d_getsbyname
13473 : see if getservbyport exists
13474 set getservbyport d_getsbyport
13477 : see if getservent exists
13478 set getservent d_getsent
13481 : see if getservbyname_r exists
13482 set getservbyname_r d_getservbyname_r
13484 case "$d_getservbyname_r" in
13486 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13487 case "$d_getservbyname_r_proto:$usethreads" in
13488 ":define") d_getservbyname_r_proto=define
13489 set d_getservbyname_r_proto getservbyname_r $hdrs
13493 case "$d_getservbyname_r_proto" in
13495 case "$getservbyname_r_proto" in
13496 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13497 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13499 case "$getservbyname_r_proto" in
13500 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13501 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13503 case "$getservbyname_r_proto" in
13504 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13505 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13507 case "$getservbyname_r_proto" in
13508 ''|0) d_getservbyname_r=undef
13509 getservbyname_r_proto=0
13510 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13511 * ) case "$getservbyname_r_proto" in
13512 REENTRANT_PROTO*) ;;
13513 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13515 echo "Prototype: $try" ;;
13518 *) case "$usethreads" in
13519 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13521 d_getservbyname_r=undef
13522 getservbyname_r_proto=0
13526 *) getservbyname_r_proto=0
13530 : see if getservbyport_r exists
13531 set getservbyport_r d_getservbyport_r
13533 case "$d_getservbyport_r" in
13535 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13536 case "$d_getservbyport_r_proto:$usethreads" in
13537 ":define") d_getservbyport_r_proto=define
13538 set d_getservbyport_r_proto getservbyport_r $hdrs
13542 case "$d_getservbyport_r_proto" in
13544 case "$getservbyport_r_proto" in
13545 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13546 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13548 case "$getservbyport_r_proto" in
13549 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13550 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13552 case "$getservbyport_r_proto" in
13553 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13554 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13556 case "$getservbyport_r_proto" in
13557 ''|0) d_getservbyport_r=undef
13558 getservbyport_r_proto=0
13559 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13560 * ) case "$getservbyport_r_proto" in
13561 REENTRANT_PROTO*) ;;
13562 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13564 echo "Prototype: $try" ;;
13567 *) case "$usethreads" in
13568 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13570 d_getservbyport_r=undef
13571 getservbyport_r_proto=0
13575 *) getservbyport_r_proto=0
13579 : see if getservent_r exists
13580 set getservent_r d_getservent_r
13582 case "$d_getservent_r" in
13584 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13585 case "$d_getservent_r_proto:$usethreads" in
13586 ":define") d_getservent_r_proto=define
13587 set d_getservent_r_proto getservent_r $hdrs
13591 case "$d_getservent_r_proto" in
13593 case "$getservent_r_proto" in
13594 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13595 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13597 case "$getservent_r_proto" in
13598 ''|0) try='int getservent_r(struct servent*, char*, int);'
13599 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13601 case "$getservent_r_proto" in
13602 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13603 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13605 case "$getservent_r_proto" in
13606 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13607 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13609 case "$getservent_r_proto" in
13610 ''|0) d_getservent_r=undef
13611 getservent_r_proto=0
13612 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13613 * ) case "$getservent_r_proto" in
13614 REENTRANT_PROTO*) ;;
13615 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13617 echo "Prototype: $try" ;;
13620 *) case "$usethreads" in
13621 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13623 d_getservent_r=undef
13624 getservent_r_proto=0
13628 *) getservent_r_proto=0
13632 : see if prototypes for various getservxxx netdb.h functions are available
13634 set d_getservprotos getservent $i_netdb netdb.h
13637 : see if getspnam exists
13638 set getspnam d_getspnam
13641 : see if this is a shadow.h system
13642 set shadow.h i_shadow
13645 : see if getspnam_r exists
13646 set getspnam_r d_getspnam_r
13648 case "$d_getspnam_r" in
13650 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13651 case "$d_getspnam_r_proto:$usethreads" in
13652 ":define") d_getspnam_r_proto=define
13653 set d_getspnam_r_proto getspnam_r $hdrs
13657 case "$d_getspnam_r_proto" in
13659 case "$getspnam_r_proto" in
13660 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13661 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13663 case "$getspnam_r_proto" in
13664 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13665 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13667 case "$getspnam_r_proto" in
13668 ''|0) d_getspnam_r=undef
13670 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13671 * ) case "$getspnam_r_proto" in
13672 REENTRANT_PROTO*) ;;
13673 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13675 echo "Prototype: $try" ;;
13678 *) case "$usethreads" in
13679 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13686 *) getspnam_r_proto=0
13690 : see if gettimeofday or ftime exists
13691 set gettimeofday d_gettimeod
13693 case "$d_gettimeod" in
13699 val="$undef"; set d_ftime; eval $setvar
13702 case "$d_gettimeod$d_ftime" in
13705 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13709 : see if gmtime_r exists
13710 set gmtime_r d_gmtime_r
13712 case "$d_gmtime_r" in
13714 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13715 case "$d_gmtime_r_proto:$usethreads" in
13716 ":define") d_gmtime_r_proto=define
13717 set d_gmtime_r_proto gmtime_r $hdrs
13721 case "$d_gmtime_r_proto" in
13723 case "$gmtime_r_proto" in
13724 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13725 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13727 case "$gmtime_r_proto" in
13728 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13729 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13731 case "$gmtime_r_proto" in
13732 ''|0) d_gmtime_r=undef
13734 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13735 * ) case "$gmtime_r_proto" in
13736 REENTRANT_PROTO*) ;;
13737 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13739 echo "Prototype: $try" ;;
13742 *) case "$usethreads" in
13743 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13750 *) gmtime_r_proto=0
13754 : see if hasmntopt exists
13755 set hasmntopt d_hasmntopt
13758 : see if this is a netinet/in.h or sys/in.h system
13759 set netinet/in.h i_niin sys/in.h i_sysin
13762 : see if arpa/inet.h has to be included
13763 set arpa/inet.h i_arpainet
13766 : see if htonl --and friends-- exists
13771 : Maybe they are macros.
13774 $cat >htonl.c <<EOM
13776 #include <sys/types.h>
13777 #$i_niin I_NETINET_IN
13779 #$i_arpainet I_ARPA_INET
13780 #ifdef I_NETINET_IN
13781 #include <netinet/in.h>
13784 #include <sys/in.h>
13787 #include <arpa/inet.h>
13790 printf("Defined as a macro.");
13793 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
13794 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
13796 echo "But it seems to be defined as a macro." >&4
13804 : see if ilogbl exists
13805 set ilogbl d_ilogbl
13810 if set index val -f; eval $csym; $val; then
13811 if set strchr val -f d_strchr; eval $csym; $val; then
13812 if $contains strchr "$strings" >/dev/null 2>&1 ; then
13815 echo "strchr() found." >&4
13819 echo "index() found." >&4
13824 echo "index() found." >&4
13827 if set strchr val -f d_strchr; eval $csym; $val; then
13830 echo "strchr() found." >&4
13832 echo "No index() or strchr() found!" >&4
13837 set d_strchr; eval $setvar
13839 set d_index; eval $setvar
13841 : check whether inet_aton exists
13842 set inet_aton d_inetaton
13847 $cat >isascii.c <<EOCP
13850 #$i_stdlib I_STDLIB
13852 #include <stdlib.h>
13863 if eval $compile; then
13864 echo "isascii() found." >&4
13867 echo "isascii() NOT found." >&4
13874 : see if isfinite exists
13875 set isfinite d_isfinite
13878 : see if isinf exists
13882 : see if isnan exists
13886 : see if isnanl exists
13887 set isnanl d_isnanl
13890 : see if killpg exists
13891 set killpg d_killpg
13894 : see if lchown exists
13896 $cat > try.c <<'EOCP'
13897 /* System header to define __stub macros and hopefully few prototypes,
13898 which can conflict with char lchown(); below. */
13899 #include <assert.h>
13900 /* Override any gcc2 internal prototype to avoid an error. */
13901 /* We use char because int might match the return type of a gcc2
13902 builtin and then its argument prototype would still apply. */
13905 /* The GNU C library defines this for functions which it implements
13906 to always fail with ENOSYS. Some functions are actually named
13907 something starting with __ and the normal name is an alias. */
13908 #if defined (__stub_lchown) || defined (__stub___lchown)
13916 if eval $compile; then
13917 $echo "lchown() found." >&4
13920 $echo "lchown() NOT found." >&4
13926 : See if number of significant digits in a double precision number is known
13928 $cat >ldbl_dig.c <<EOM
13929 #$i_limits I_LIMITS
13932 #include <limits.h>
13938 printf("Contains LDBL_DIG");
13941 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
13942 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
13943 echo "LDBL_DIG found." >&4
13946 echo "LDBL_DIG NOT found." >&4
13953 : see if this is a math.h system
13957 d_libm_lib_version="$undef"
13960 : check to see if math.h defines _LIB_VERSION
13962 echo "Checking to see if your libm supports _LIB_VERSION..." >&4
13964 #include <unistd.h>
13966 int main (int argc, char *argv[])
13968 printf ("%d\n", _LIB_VERSION);
13973 if eval $compile; then
13975 echo "Yes, it does ($foo)" >&4
13976 d_libm_lib_version="$define"
13978 echo "No, it does not (probably harmless)\n" >&4
13980 $rm -f try.* try core core.try.*
13985 : see if link exists
13989 : see if localtime_r exists
13990 set localtime_r d_localtime_r
13992 case "$d_localtime_r" in
13994 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13995 case "$d_localtime_r_proto:$usethreads" in
13996 ":define") d_localtime_r_proto=define
13997 set d_localtime_r_proto localtime_r $hdrs
14001 case "$d_localtime_r_proto" in
14003 case "$localtime_r_proto" in
14004 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
14005 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
14007 case "$localtime_r_proto" in
14008 ''|0) try='int localtime_r(const time_t*, struct tm*);'
14009 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
14011 case "$localtime_r_proto" in
14012 ''|0) d_localtime_r=undef
14013 localtime_r_proto=0
14014 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
14015 * ) case "$localtime_r_proto" in
14016 REENTRANT_PROTO*) ;;
14017 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
14019 echo "Prototype: $try" ;;
14022 *) case "$usethreads" in
14023 define) echo "localtime_r has no prototype, not using it." >&4 ;;
14025 d_localtime_r=undef
14026 localtime_r_proto=0
14030 *) localtime_r_proto=0
14034 : see if localeconv exists
14035 set localeconv d_locconv
14038 : see if lockf exists
14042 : see if prototype for lseek is available
14044 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14047 : see if lstat exists
14051 : see if madvise exists
14052 set madvise d_madvise
14055 : see if mblen exists
14059 : see if mbstowcs exists
14060 set mbstowcs d_mbstowcs
14063 : see if mbtowc exists
14064 set mbtowc d_mbtowc
14067 : see if memchr exists
14068 set memchr d_memchr
14071 : see if memcmp exists
14072 set memcmp d_memcmp
14075 : see if memcpy exists
14076 set memcpy d_memcpy
14079 : see if memmove exists
14080 set memmove d_memmove
14083 : see if memset exists
14084 set memset d_memset
14087 : see if mkdir exists
14091 : see if mkdtemp exists
14092 set mkdtemp d_mkdtemp
14095 : see if mkfifo exists
14096 set mkfifo d_mkfifo
14099 : see if mkstemp exists
14100 set mkstemp d_mkstemp
14103 : see if mkstemps exists
14104 set mkstemps d_mkstemps
14107 : see if mktime exists
14108 set mktime d_mktime
14111 : see if this is a sys/mman.h system
14112 set sys/mman.h i_sysmman
14115 : see if mmap exists
14118 : see what shmat returns
14119 : default to something harmless
14121 case "$i_sysmman$d_mmap" in
14123 $cat >mmap.c <<'END'
14124 #include <sys/mman.h>
14127 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14132 echo "and it returns ($mmaptype)." >&4
14138 : see if sqrtl exists
14142 : see if scalbnl exists
14143 set scalbnl d_scalbnl
14146 : see if modfl exists
14150 : see if prototype for modfl is available
14152 set d_modflproto modfl $i_math math.h
14155 d_modfl_pow32_bug="$undef"
14157 case "$d_longdbl$d_modfl" in
14160 Checking to see whether your modfl() is okay for large values...
14166 if $test "X$d_modflproto" != "X$define"; then
14167 $cat >>try.c <<EOCP
14168 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14169 long double modfl (long double, long double *);
14172 $cat >>try.c <<EOCP
14174 long double nv = 4294967303.15;
14180 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14184 case "$osname:$gccversion" in
14185 aix:) saveccflags="$ccflags"
14186 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14189 if eval $compile; then
14192 *" 4294967303.150000 1.150000 4294967302.000000")
14193 echo >&4 "Your modfl() is broken for large values."
14194 d_modfl_pow32_bug="$define"
14196 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14200 *" 4294967303.150000 0.150000 4294967303.000000")
14201 echo >&4 "Your modfl() seems okay for large values."
14203 *) echo >&4 "I don't understand your modfl() at all."
14207 $rm -f try.* try core core.try.*
14209 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14212 case "$osname:$gccversion" in
14213 aix:) ccflags="$saveccflags" ;; # restore
14218 if $test "$uselongdouble" = "$define"; then
14220 if $test "$d_sqrtl" != "$define"; then
14221 message="$message sqrtl"
14223 if $test "$d_modfl" != "$define"; then
14224 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14225 echo "You have both aintl and copysignl, so I can emulate modfl."
14227 message="$message modfl"
14230 if $test "$d_frexpl" != "$define"; then
14231 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14232 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14234 message="$message frexpl"
14238 if $test "$message" != ""; then
14241 *** You requested the use of long doubles but you do not seem to have
14242 *** the following mathematical functions needed for long double support:
14244 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14245 *** Cannot continue, aborting.
14253 : see if mprotect exists
14254 set mprotect d_mprotect
14257 : see if msgctl exists
14258 set msgctl d_msgctl
14261 : see if msgget exists
14262 set msgget d_msgget
14265 : see if msgsnd exists
14266 set msgsnd d_msgsnd
14269 : see if msgrcv exists
14270 set msgrcv d_msgrcv
14273 : see how much of the 'msg*(2)' library is present.
14276 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14277 *"$undef"*) h_msg=false;;
14281 case "`ipcs 2>&1`" in
14282 "SVID messages"*"not configured"*)
14283 echo "Your $osname does not have the msg*(2) configured." >&4
14286 set msgctl d_msgctl
14288 set msgget d_msgget
14290 set msgsnd d_msgsnd
14292 set msgrcv d_msgrcv
14298 : we could also check for sys/ipc.h ...
14299 if $h_msg && $test `./findhdr sys/msg.h`; then
14300 echo "You have the full msg*(2) library." >&4
14303 echo "You don't have the full msg*(2) library." >&4
14311 echo "Checking to see if your system supports struct msghdr..." >&4
14312 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14314 case "$d_msghdr_s" in
14315 "$define") echo "Yes, it does." ;;
14316 *) echo "No, it doesn't." ;;
14320 : see if msync exists
14324 : see if munmap exists
14325 set munmap d_munmap
14328 : see if nice exists
14332 : see if this is a langinfo.h system
14333 set langinfo.h i_langinfo
14336 : see if nl_langinfo exists
14337 set nl_langinfo d_nl_langinfo
14340 : check for length of character
14342 case "$charsize" in
14344 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14347 #$i_stdlib I_STDLIB
14349 #include <stdlib.h>
14353 printf("%d\n", (int)sizeof(char));
14358 if eval $compile_ok; then
14362 echo "(I can't seem to compile the test program. Guessing...)"
14369 rp="What is the size of a character (in bytes)?"
14374 : check for volatile keyword
14376 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14377 $cat >try.c <<'EOCP'
14380 typedef struct _goo_struct goo_struct;
14381 goo_struct * volatile goo = ((goo_struct *)0);
14382 struct _goo_struct {
14387 typedef unsigned short foo_t;
14388 char *volatile foo;
14390 volatile foo_t blech;
14394 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14396 echo "Yup, it does."
14399 echo "Nope, it doesn't."
14407 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14409 case "$use64bitint:$d_quad:$quadtype" in
14412 uvtype="$uquadtype"
14417 uvtype="unsigned long"
14423 case "$uselongdouble:$d_longdbl" in
14425 nvtype="long double"
14426 nvsize=$longdblsize
14433 $echo "(IV will be "$ivtype", $ivsize bytes)"
14434 $echo "(UV will be "$uvtype", $uvsize bytes)"
14435 $echo "(NV will be "$nvtype", $nvsize bytes)"
14438 #$i_inttypes I_INTTYPES
14440 #include <inttypes.h>
14445 int8_t i = INT8_MAX;
14446 uint8_t u = UINT8_MAX;
14447 printf("int8_t\n");
14450 int16_t i = INT16_MAX;
14451 uint16_t i = UINT16_MAX;
14452 printf("int16_t\n");
14455 int32_t i = INT32_MAX;
14456 uint32_t u = UINT32_MAX;
14457 printf("int32_t\n");
14463 '') case "$charsize" in
14465 u8type="unsigned char"
14474 if eval $compile; then
14475 case "`$run ./try`" in
14476 int8_t) i8type=int8_t
14486 '') if $test $charsize -ge 1; then
14488 u8type="unsigned char"
14496 '') case "$shortsize" in
14498 u16type="unsigned short"
14506 '') set try -DINT16
14507 if eval $compile; then
14508 case "`$run ./try`" in
14520 '') if $test $shortsize -ge 2; then
14522 u16type="unsigned short"
14530 '') case "$longsize" in
14532 u32type="unsigned long"
14536 *) case "$intsize" in
14538 u32type="unsigned int"
14548 '') set try -DINT32
14549 if eval $compile; then
14550 case "`$run ./try`" in
14562 '') if $test $intsize -ge 4; then
14564 u32type="unsigned int"
14572 '') case "$d_quad:$quadtype" in
14574 i64type="$quadtype"
14575 u64type="$uquadtype"
14583 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14584 : volatile so that the compiler has to store it out to memory.
14585 if test X"$d_volatile" = X"$define"; then
14590 #$i_stdlib I_STDLIB
14592 #include <stdlib.h>
14594 #include <sys/types.h>
14595 #include <signal.h>
14597 $volatile int bletched = 0;
14598 $signal_t blech(s) int s; { bletched = 1; }
14603 int n = 8 * $uvsize;
14606 signal(SIGFPE, blech);
14609 for (i = 0; i < n; i++) {
14610 u = u << 1 | ($uvtype)1;
14612 if (($uvtype)d != u)
14616 d = ($nvtype)(u - 1);
14617 if (($uvtype)d != (u - 1))
14625 printf("%d\n", ((i == n) ? -n : i));
14631 d_nv_preserves_uv="$undef"
14632 if eval $compile; then
14633 nv_preserves_uv_bits="`$run ./try`"
14635 case "$nv_preserves_uv_bits" in
14637 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14638 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14639 d_nv_preserves_uv="$define"
14641 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14642 d_nv_preserves_uv="$undef" ;;
14643 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14644 nv_preserves_uv_bits="$undef" ;;
14650 : check for off64_t
14652 echo "Checking to see if you have off64_t..." >&4
14654 #include <sys/types.h>
14655 #include <unistd.h>
14656 int main() { off64_t x = 7; }
14659 if eval $compile; then
14661 echo "You have off64_t."
14664 echo "You do not have off64_t."
14665 case "$lseeksize" in
14666 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
14673 : how to create joinable pthreads
14674 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
14676 echo "Checking what constant to use for creating joinable pthreads..." >&4
14677 $cat >try.c <<'EOCP'
14678 #include <pthread.h>
14680 int detachstate = JOINABLE;
14683 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
14684 if eval $compile; then
14685 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
14686 val="$undef" # Yes, undef.
14687 set d_old_pthread_create_joinable
14690 set old_pthread_create_joinable
14693 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
14694 if eval $compile; then
14695 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
14697 set d_old_pthread_create_joinable
14699 val=PTHREAD_CREATE_UNDETACHED
14700 set old_pthread_create_joinable
14703 set try -DJOINABLE=__UNDETACHED
14704 if eval $compile; then
14705 echo "You seem to use __UNDETACHED." >&4
14707 set d_old_pthread_create_joinable
14710 set old_pthread_create_joinable
14713 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
14715 set d_old_pthread_create_joinable
14718 set old_pthread_create_joinable
14725 d_old_pthread_create_joinable="$undef"
14726 old_pthread_create_joinable=""
14729 : see if pause exists
14733 : see if pipe exists
14737 : see if poll exists
14741 : see if readlink exists
14742 set readlink d_readlink
14748 case "$d_readlink" in
14750 if $issymlink /proc/self/exe ; then
14751 $ls -l /proc/self/exe > reflect
14752 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
14753 echo "You have Linux-like /proc/self/exe."
14754 procselfexe='"/proc/self/exe"'
14758 if $issymlink /proc/curproc/file ; then
14759 $ls -l /proc/curproc/file > reflect
14760 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
14761 echo "You have BSD-like /proc/curproc/file."
14762 procselfexe='"/proc/curproc/file"'
14772 : see whether the pthread_atfork exists
14774 #include <pthread.h>
14777 #ifdef PTHREAD_ATFORK
14778 pthread_atfork(NULL,NULL,NULL);
14783 : see if pthread_atfork exists
14784 set try -DPTHREAD_ATFORK
14785 if eval $compile; then
14790 case "$usethreads" in
14793 $define) echo 'pthread_atfork found.' >&4 ;;
14794 *) echo 'pthread_atfork NOT found.' >&4 ;;
14797 set d_pthread_atfork
14800 : see if pthread_attr_setscope exists
14801 set pthread_attr_setscope d_pthread_attr_setscope
14805 : see whether the various POSIXish _yields exist
14807 #include <pthread.h>
14813 #ifdef PTHREAD_YIELD
14816 #ifdef PTHREAD_YIELD_NULL
14817 pthread_yield(NULL);
14823 : see if sched_yield exists
14824 set try -DSCHED_YIELD
14825 if eval $compile; then
14827 sched_yield='sched_yield()'
14831 case "$usethreads" in
14834 $define) echo 'sched_yield() found.' >&4 ;;
14835 *) echo 'sched_yield() NOT found.' >&4 ;;
14841 : see if pthread_yield exists
14842 set try -DPTHREAD_YIELD
14843 if eval $compile; then
14845 case "$sched_yield" in
14846 '') sched_yield='pthread_yield()' ;;
14849 set try -DPTHREAD_YIELD_NULL
14850 if eval $compile; then
14852 case "$sched_yield" in
14853 '') sched_yield='pthread_yield(NULL)' ;;
14859 case "$usethreads" in
14862 $define) echo 'pthread_yield() found.' >&4 ;;
14863 *) echo 'pthread_yield() NOT found.' >&4 ;;
14867 set d_pthread_yield
14870 case "$sched_yield" in
14871 '') sched_yield=undef ;;
14876 : see if random_r exists
14877 set random_r d_random_r
14879 case "$d_random_r" in
14881 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
14882 case "$d_random_r_proto:$usethreads" in
14883 ":define") d_random_r_proto=define
14884 set d_random_r_proto random_r $hdrs
14888 case "$d_random_r_proto" in
14890 case "$random_r_proto" in
14891 ''|0) try='int random_r(int*, struct random_data*);'
14892 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
14894 case "$random_r_proto" in
14895 ''|0) try='int random_r(long*, struct random_data*);'
14896 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
14898 case "$random_r_proto" in
14899 ''|0) try='int random_r(struct random_data*, int32_t*);'
14900 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
14902 case "$random_r_proto" in
14903 ''|0) d_random_r=undef
14905 echo "Disabling random_r, cannot determine prototype." >&4 ;;
14906 * ) case "$random_r_proto" in
14907 REENTRANT_PROTO*) ;;
14908 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
14910 echo "Prototype: $try" ;;
14913 *) case "$usethreads" in
14914 define) echo "random_r has no prototype, not using it." >&4 ;;
14921 *) random_r_proto=0
14925 : see if readdir and friends exist
14926 set readdir d_readdir
14928 set seekdir d_seekdir
14930 set telldir d_telldir
14932 set rewinddir d_rewinddir
14935 : see if readdir64_r exists
14936 set readdir64_r d_readdir64_r
14938 case "$d_readdir64_r" in
14940 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
14941 case "$d_readdir64_r_proto:$usethreads" in
14942 ":define") d_readdir64_r_proto=define
14943 set d_readdir64_r_proto readdir64_r $hdrs
14947 case "$d_readdir64_r_proto" in
14949 case "$readdir64_r_proto" in
14950 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
14951 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
14953 case "$readdir64_r_proto" in
14954 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
14955 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
14957 case "$readdir64_r_proto" in
14958 ''|0) d_readdir64_r=undef
14959 readdir64_r_proto=0
14960 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
14961 * ) case "$readdir64_r_proto" in
14962 REENTRANT_PROTO*) ;;
14963 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
14965 echo "Prototype: $try" ;;
14968 *) case "$usethreads" in
14969 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
14971 d_readdir64_r=undef
14972 readdir64_r_proto=0
14976 *) readdir64_r_proto=0
14980 : see if readdir_r exists
14981 set readdir_r d_readdir_r
14983 case "$d_readdir_r" in
14985 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
14986 case "$d_readdir_r_proto:$usethreads" in
14987 ":define") d_readdir_r_proto=define
14988 set d_readdir_r_proto readdir_r $hdrs
14992 case "$d_readdir_r_proto" in
14994 case "$readdir_r_proto" in
14995 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
14996 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
14998 case "$readdir_r_proto" in
14999 ''|0) try='int readdir_r(DIR*, struct dirent*);'
15000 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
15002 case "$readdir_r_proto" in
15003 ''|0) d_readdir_r=undef
15005 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
15006 * ) case "$readdir_r_proto" in
15007 REENTRANT_PROTO*) ;;
15008 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
15010 echo "Prototype: $try" ;;
15013 *) case "$usethreads" in
15014 define) echo "readdir_r has no prototype, not using it." >&4 ;;
15021 *) readdir_r_proto=0
15025 : see if readv exists
15029 : see if recvmsg exists
15030 set recvmsg d_recvmsg
15033 : see if rename exists
15034 set rename d_rename
15037 : see if rmdir exists
15041 : see if memory.h is available.
15046 : See if it conflicts with string.h
15052 $cppstdin $cppflags $cppminus < $strings > mem.h
15053 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15055 echo "We won't be including <memory.h>."
15065 : can bcopy handle overlapping blocks?
15068 case "$d_memmove" in
15069 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15070 *) case "$d_bcopy" in
15072 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15074 #$i_memory I_MEMORY
15075 #$i_stdlib I_STDLIB
15076 #$i_string I_STRING
15077 #$i_unistd I_UNISTD
15079 $cat >>try.c <<'EOCP'
15082 # include <memory.h>
15085 # include <stdlib.h>
15088 # include <string.h>
15090 # include <strings.h>
15093 # include <unistd.h> /* Needed for NetBSD */
15097 char buf[128], abc[128];
15103 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15104 try to store the string in read-only memory. */
15105 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15107 for (align = 7; align >= 0; align--) {
15108 for (len = 36; len; len--) {
15110 bcopy(abc, b, len);
15111 for (off = 1; off <= len; off++) {
15112 bcopy(b, b+off, len);
15113 bcopy(b+off, b, len);
15114 if (bcmp(b, abc, len))
15123 if eval $compile_ok; then
15124 if ./try 2>/dev/null; then
15125 echo "Yes, it can."
15128 echo "It can't, sorry."
15131 echo "(I can't compile the test program, so we'll assume not...)"
15135 $rm -f try.* try core
15141 : can memcpy handle overlapping blocks?
15144 case "$d_memmove" in
15145 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15146 *) case "$d_memcpy" in
15148 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15150 #$i_memory I_MEMORY
15151 #$i_stdlib I_STDLIB
15152 #$i_string I_STRING
15153 #$i_unistd I_UNISTD
15155 $cat >>try.c <<'EOCP'
15158 # include <memory.h>
15161 # include <stdlib.h>
15164 # include <string.h>
15166 # include <strings.h>
15169 # include <unistd.h> /* Needed for NetBSD */
15173 char buf[128], abc[128];
15179 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15180 try to store the string in read-only memory. */
15181 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15183 for (align = 7; align >= 0; align--) {
15184 for (len = 36; len; len--) {
15186 memcpy(b, abc, len);
15187 for (off = 1; off <= len; off++) {
15188 memcpy(b+off, b, len);
15189 memcpy(b, b+off, len);
15190 if (memcmp(b, abc, len))
15199 if eval $compile_ok; then
15200 if ./try 2>/dev/null; then
15201 echo "Yes, it can."
15204 echo "It can't, sorry."
15207 echo "(I can't compile the test program, so we'll assume not...)"
15211 $rm -f try.* try core
15217 : can memcmp be trusted to compare relative magnitude?
15219 case "$d_memcmp" in
15222 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15224 #$i_memory I_MEMORY
15225 #$i_stdlib I_STDLIB
15226 #$i_string I_STRING
15227 #$i_unistd I_UNISTD
15229 $cat >>try.c <<'EOCP'
15232 # include <memory.h>
15235 # include <stdlib.h>
15238 # include <string.h>
15240 # include <strings.h>
15243 # include <unistd.h> /* Needed for NetBSD */
15249 if ((a < b) && memcmp(&a, &b, 1) < 0)
15255 if eval $compile_ok; then
15256 if $run ./try 2>/dev/null; then
15257 echo "Yes, it can."
15260 echo "No, it can't (it uses signed chars)."
15263 echo "(I can't compile the test program, so we'll assume not...)"
15267 $rm -f try.* try core
15271 : see if prototype for sbrk is available
15273 set d_sbrkproto sbrk $i_unistd unistd.h
15276 : see if select exists
15277 set select d_select
15280 : see if semctl exists
15281 set semctl d_semctl
15284 : see if semget exists
15285 set semget d_semget
15288 : see if semop exists
15292 : see how much of the 'sem*(2)' library is present.
15295 case "$d_semctl$d_semget$d_semop" in
15296 *"$undef"*) h_sem=false;;
15300 case "`ipcs 2>&1`" in
15301 "SVID messages"*"not configured"*)
15302 echo "Your $osname does not have the sem*(2) configured." >&4
15305 set semctl d_semctl
15307 set semget d_semget
15315 : we could also check for sys/ipc.h ...
15316 if $h_sem && $test `./findhdr sys/sem.h`; then
15317 echo "You have the full sem*(2) library." >&4
15320 echo "You don't have the full sem*(2) library." >&4
15326 : see whether sys/sem.h defines union semun
15328 $cat > try.c <<'END'
15329 #include <sys/types.h>
15330 #include <sys/ipc.h>
15331 #include <sys/sem.h>
15332 int main () { union semun semun; semun.buf = 0; }
15335 if eval $compile; then
15336 echo "You have union semun in <sys/sem.h>." >&4
15339 echo "You do not have union semun in <sys/sem.h>." >&4
15346 : see how to do semctl IPC_STAT
15353 # define S_IRUSR S_IREAD
15354 # define S_IWUSR S_IWRITE
15355 # define S_IXUSR S_IEXEC
15357 # define S_IRUSR 0400
15358 # define S_IWUSR 0200
15359 # define S_IXUSR 0100
15361 # define S_IRGRP (S_IRUSR>>3)
15362 # define S_IWGRP (S_IWUSR>>3)
15363 # define S_IXGRP (S_IXUSR>>3)
15364 # define S_IROTH (S_IRUSR>>6)
15365 # define S_IWOTH (S_IWUSR>>6)
15366 # define S_IXOTH (S_IXUSR>>6)
15369 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15370 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15371 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15374 : see whether semctl IPC_STAT can use union semun
15376 case "$d_semctl_semun" in
15379 #include <sys/types.h>
15380 #include <sys/ipc.h>
15381 #include <sys/sem.h>
15382 #include <sys/stat.h>
15389 #$d_union_semun HAS_UNION_SEMUN
15392 #ifndef HAS_UNION_SEMUN
15395 struct semid_ds *buf;
15396 unsigned short *array;
15402 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15403 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15405 struct semid_ds argbuf;
15408 st = semctl(sem, 0, IPC_STAT, arg);
15412 # endif /* IPC_STAT */
15413 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15415 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15416 # endif /* IPC_RMID */
15417 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15419 #endif /* IPC_PRIVATE && ... */
15420 printf("semget failed: errno = %d\n", errno);
15425 if eval $compile; then
15428 semun) val="$define" ;;
15436 case "$d_semctl_semun" in
15438 echo "You can use union semun for semctl IPC_STAT." >&4
15441 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15446 : see whether semctl IPC_STAT can use struct semid_ds pointer
15448 case "$d_semctl_semid_ds" in
15450 $cat > try.c <<'END'
15451 #include <sys/types.h>
15452 #include <sys/ipc.h>
15453 #include <sys/sem.h>
15454 #include <sys/stat.h>
15462 struct semid_ds arg;
15465 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15466 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15469 st = semctl(sem, 0, IPC_STAT, &arg);
15471 printf("semid_ds\n");
15473 # endif /* IPC_STAT */
15474 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15476 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15477 # endif /* IPC_RMID */
15478 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15480 #endif /* IPC_PRIVATE && ... */
15481 printf("semget failed: errno = %d\n", errno);
15487 if eval $compile; then
15490 semid_ds) val="$define" ;;
15496 set d_semctl_semid_ds
15498 case "$d_semctl_semid_ds" in
15500 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15502 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15509 # We do not have the full sem*(2) library, so assume we can not
15515 set d_semctl_semid_ds
15520 : see if sendmsg exists
15521 set sendmsg d_sendmsg
15524 : see if setegid exists
15525 set setegid d_setegid
15528 : see if seteuid exists
15529 set seteuid d_seteuid
15532 : see if setgrent exists
15533 set setgrent d_setgrent
15536 : see if setgrent_r exists
15537 set setgrent_r d_setgrent_r
15539 case "$d_setgrent_r" in
15541 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15542 case "$d_setgrent_r_proto:$usethreads" in
15543 ":define") d_setgrent_r_proto=define
15544 set d_setgrent_r_proto setgrent_r $hdrs
15548 case "$d_setgrent_r_proto" in
15550 case "$setgrent_r_proto" in
15551 ''|0) try='int setgrent_r(FILE**);'
15552 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15554 case "$setgrent_r_proto" in
15555 ''|0) try='void setgrent_r(FILE**);'
15556 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15558 case "$setgrent_r_proto" in
15559 ''|0) d_setgrent_r=undef
15561 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15562 * ) case "$setgrent_r_proto" in
15563 REENTRANT_PROTO*) ;;
15564 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15566 echo "Prototype: $try" ;;
15569 *) case "$usethreads" in
15570 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15577 *) setgrent_r_proto=0
15581 : see if sethostent exists
15582 set sethostent d_sethent
15585 : see if sethostent_r exists
15586 set sethostent_r d_sethostent_r
15588 case "$d_sethostent_r" in
15590 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15591 case "$d_sethostent_r_proto:$usethreads" in
15592 ":define") d_sethostent_r_proto=define
15593 set d_sethostent_r_proto sethostent_r $hdrs
15597 case "$d_sethostent_r_proto" in
15599 case "$sethostent_r_proto" in
15600 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15601 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15603 case "$sethostent_r_proto" in
15604 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15605 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15607 case "$sethostent_r_proto" in
15608 ''|0) d_sethostent_r=undef
15609 sethostent_r_proto=0
15610 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15611 * ) case "$sethostent_r_proto" in
15612 REENTRANT_PROTO*) ;;
15613 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
15615 echo "Prototype: $try" ;;
15618 *) case "$usethreads" in
15619 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
15621 d_sethostent_r=undef
15622 sethostent_r_proto=0
15626 *) sethostent_r_proto=0
15630 : see if setitimer exists
15631 set setitimer d_setitimer
15634 : see if setlinebuf exists
15635 set setlinebuf d_setlinebuf
15638 : see if setlocale exists
15639 set setlocale d_setlocale
15642 : see if locale.h is available
15643 set locale.h i_locale
15646 : see if setlocale_r exists
15647 set setlocale_r d_setlocale_r
15649 case "$d_setlocale_r" in
15651 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
15652 case "$d_setlocale_r_proto:$usethreads" in
15653 ":define") d_setlocale_r_proto=define
15654 set d_setlocale_r_proto setlocale_r $hdrs
15658 case "$d_setlocale_r_proto" in
15660 case "$setlocale_r_proto" in
15661 ''|0) try='int setlocale_r(int, const char*, char*, int);'
15662 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
15664 case "$setlocale_r_proto" in
15665 ''|0) d_setlocale_r=undef
15666 setlocale_r_proto=0
15667 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
15668 * ) case "$setlocale_r_proto" in
15669 REENTRANT_PROTO*) ;;
15670 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
15672 echo "Prototype: $try" ;;
15675 *) case "$usethreads" in
15676 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
15678 d_setlocale_r=undef
15679 setlocale_r_proto=0
15683 *) setlocale_r_proto=0
15687 : see if setnetent exists
15688 set setnetent d_setnent
15691 : see if setnetent_r exists
15692 set setnetent_r d_setnetent_r
15694 case "$d_setnetent_r" in
15696 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15697 case "$d_setnetent_r_proto:$usethreads" in
15698 ":define") d_setnetent_r_proto=define
15699 set d_setnetent_r_proto setnetent_r $hdrs
15703 case "$d_setnetent_r_proto" in
15705 case "$setnetent_r_proto" in
15706 ''|0) try='int setnetent_r(int, struct netent_data*);'
15707 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
15709 case "$setnetent_r_proto" in
15710 ''|0) try='void setnetent_r(int, struct netent_data*);'
15711 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
15713 case "$setnetent_r_proto" in
15714 ''|0) d_setnetent_r=undef
15715 setnetent_r_proto=0
15716 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
15717 * ) case "$setnetent_r_proto" in
15718 REENTRANT_PROTO*) ;;
15719 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
15721 echo "Prototype: $try" ;;
15724 *) case "$usethreads" in
15725 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
15727 d_setnetent_r=undef
15728 setnetent_r_proto=0
15732 *) setnetent_r_proto=0
15736 : see if setprotoent exists
15737 set setprotoent d_setpent
15740 : see if setpgid exists
15741 set setpgid d_setpgid
15744 : see if setpgrp2 exists
15745 set setpgrp2 d_setpgrp2
15748 : see if setpriority exists
15749 set setpriority d_setprior
15752 : see if setproctitle exists
15753 set setproctitle d_setproctitle
15756 : see if setprotoent_r exists
15757 set setprotoent_r d_setprotoent_r
15759 case "$d_setprotoent_r" in
15761 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15762 case "$d_setprotoent_r_proto:$usethreads" in
15763 ":define") d_setprotoent_r_proto=define
15764 set d_setprotoent_r_proto setprotoent_r $hdrs
15768 case "$d_setprotoent_r_proto" in
15770 case "$setprotoent_r_proto" in
15771 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
15772 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
15774 case "$setprotoent_r_proto" in
15775 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
15776 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
15778 case "$setprotoent_r_proto" in
15779 ''|0) d_setprotoent_r=undef
15780 setprotoent_r_proto=0
15781 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
15782 * ) case "$setprotoent_r_proto" in
15783 REENTRANT_PROTO*) ;;
15784 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
15786 echo "Prototype: $try" ;;
15789 *) case "$usethreads" in
15790 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
15792 d_setprotoent_r=undef
15793 setprotoent_r_proto=0
15797 *) setprotoent_r_proto=0
15801 : see if setpwent exists
15802 set setpwent d_setpwent
15805 : see if setpwent_r exists
15806 set setpwent_r d_setpwent_r
15808 case "$d_setpwent_r" in
15810 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15811 case "$d_setpwent_r_proto:$usethreads" in
15812 ":define") d_setpwent_r_proto=define
15813 set d_setpwent_r_proto setpwent_r $hdrs
15817 case "$d_setpwent_r_proto" in
15819 case "$setpwent_r_proto" in
15820 ''|0) try='int setpwent_r(FILE**);'
15821 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
15823 case "$setpwent_r_proto" in
15824 ''|0) try='void setpwent_r(FILE**);'
15825 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
15827 case "$setpwent_r_proto" in
15828 ''|0) d_setpwent_r=undef
15830 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
15831 * ) case "$setpwent_r_proto" in
15832 REENTRANT_PROTO*) ;;
15833 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
15835 echo "Prototype: $try" ;;
15838 *) case "$usethreads" in
15839 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
15846 *) setpwent_r_proto=0
15850 : see if setregid exists
15851 set setregid d_setregid
15853 set setresgid d_setresgid
15856 : see if setreuid exists
15857 set setreuid d_setreuid
15859 set setresuid d_setresuid
15862 : see if setrgid exists
15863 set setrgid d_setrgid
15866 : see if setruid exists
15867 set setruid d_setruid
15870 : see if setservent exists
15871 set setservent d_setsent
15874 : see if setservent_r exists
15875 set setservent_r d_setservent_r
15877 case "$d_setservent_r" in
15879 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15880 case "$d_setservent_r_proto:$usethreads" in
15881 ":define") d_setservent_r_proto=define
15882 set d_setservent_r_proto setservent_r $hdrs
15886 case "$d_setservent_r_proto" in
15888 case "$setservent_r_proto" in
15889 ''|0) try='int setservent_r(int, struct servent_data*);'
15890 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
15892 case "$setservent_r_proto" in
15893 ''|0) try='void setservent_r(int, struct servent_data*);'
15894 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
15896 case "$setservent_r_proto" in
15897 ''|0) d_setservent_r=undef
15898 setservent_r_proto=0
15899 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
15900 * ) case "$setservent_r_proto" in
15901 REENTRANT_PROTO*) ;;
15902 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
15904 echo "Prototype: $try" ;;
15907 *) case "$usethreads" in
15908 define) echo "setservent_r has no prototype, not using it." >&4 ;;
15910 d_setservent_r=undef
15911 setservent_r_proto=0
15915 *) setservent_r_proto=0
15919 : see if setsid exists
15920 set setsid d_setsid
15923 : see if setvbuf exists
15924 set setvbuf d_setvbuf
15927 : see if sfio.h is available
15932 : see if sfio library is available
15943 : Ok, but do we want to use it.
15947 true|$define|[yY]*) dflt='y';;
15950 echo "$package can use the sfio library, but it is experimental."
15951 case "$useperlio" in
15953 echo "For sfio also the PerlIO abstraction layer is needed."
15954 echo "Earlier you said you wouldn't want that."
15957 rp="You seem to have sfio available, do you want to try using it?"
15960 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
15961 useperlio="$define"
15964 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
15969 *) case "$usesfio" in
15970 true|$define|[yY]*)
15971 echo "Sorry, cannot find sfio on this machine." >&4
15972 echo "Ignoring your setting of usesfio=$usesfio." >&4
15981 $define) usesfio='true';;
15982 *) usesfio='false';;
15986 *) : Remove sfio from list of libraries to use
15989 echo "Removing unneeded -lsfio from library list" >&4
15990 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
15993 echo "libs = $libs" >&4
16000 : see if shmctl exists
16001 set shmctl d_shmctl
16004 : see if shmget exists
16005 set shmget d_shmget
16008 : see if shmat exists
16011 : see what shmat returns
16014 $cat >shmat.c <<'END'
16015 #include <sys/shm.h>
16018 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
16023 echo "and it returns ($shmattype)." >&4
16024 : see if a prototype for shmat is available
16025 xxx=`./findhdr sys/shm.h`
16026 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
16027 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16038 set d_shmatprototype
16041 : see if shmdt exists
16045 : see how much of the 'shm*(2)' library is present.
16048 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16049 *"$undef"*) h_shm=false;;
16053 case "`ipcs 2>&1`" in
16054 "SVID shared memory"*"not configured"*)
16055 echo "Your $osname does not have the shm*(2) configured." >&4
16058 set shmctl d_shmctl
16060 set shmget d_shmget
16070 : we could also check for sys/ipc.h ...
16071 if $h_shm && $test `./findhdr sys/shm.h`; then
16072 echo "You have the full shm*(2) library." >&4
16075 echo "You don't have the full shm*(2) library." >&4
16082 : see if we have sigaction
16083 if set sigaction val -f d_sigaction; eval $csym; $val; then
16084 echo 'sigaction() found.' >&4
16087 #include <sys/types.h>
16088 #include <signal.h>
16089 #$i_stdlib I_STDLIB
16091 #include <stdlib.h>
16095 struct sigaction act, oact;
16097 oact.sa_handler = 0;
16098 /* so that act and oact are used */
16099 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16103 if eval $compile_ok; then
16106 echo "But you don't seem to have a useable struct sigaction." >&4
16110 echo 'sigaction NOT found.' >&4
16113 set d_sigaction; eval $setvar
16114 $rm -f try try$_o try.c
16116 : see if sigprocmask exists
16117 set sigprocmask d_sigprocmask
16120 : see if sigsetjmp exists
16122 case "$d_sigsetjmp" in
16125 #include <setjmp.h>
16126 #$i_stdlib I_STDLIB
16128 #include <stdlib.h>
16134 if (sigsetjmp(env,1))
16137 siglongjmp(env, 1);
16142 if eval $compile; then
16143 if $run ./try >/dev/null 2>&1; then
16144 echo "POSIX sigsetjmp found." >&4
16148 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16154 echo "sigsetjmp not found." >&4
16158 *) val="$d_sigsetjmp"
16159 case "$d_sigsetjmp" in
16160 $define) echo "POSIX sigsetjmp found." >&4;;
16161 $undef) echo "sigsetjmp not found." >&4;;
16170 d_sitecustomize="$undef"
16171 case "$usesitecustomize" in
16172 $define|true|[Yy]*)
16173 usesitecustomize="$define"
16174 d_sitecustomize="$define"
16177 usesitecustomize="$undef"
16180 : see if sockatmark exists
16181 set sockatmark d_sockatmark
16184 : see if prototype for sockatmark is available
16186 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16189 : see if socks5_init exists
16190 set socks5_init d_socks5_init
16193 : see if srand48_r exists
16194 set srand48_r d_srand48_r
16196 case "$d_srand48_r" in
16198 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16199 case "$d_srand48_r_proto:$usethreads" in
16200 ":define") d_srand48_r_proto=define
16201 set d_srand48_r_proto srand48_r $hdrs
16205 case "$d_srand48_r_proto" in
16207 case "$srand48_r_proto" in
16208 ''|0) try='int srand48_r(long, struct drand48_data*);'
16209 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16211 case "$srand48_r_proto" in
16212 ''|0) d_srand48_r=undef
16214 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16215 * ) case "$srand48_r_proto" in
16216 REENTRANT_PROTO*) ;;
16217 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16219 echo "Prototype: $try" ;;
16222 *) case "$usethreads" in
16223 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16230 *) srand48_r_proto=0
16234 : see if srandom_r exists
16235 set srandom_r d_srandom_r
16237 case "$d_srandom_r" in
16239 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16240 case "$d_srandom_r_proto:$usethreads" in
16241 ":define") d_srandom_r_proto=define
16242 set d_srandom_r_proto srandom_r $hdrs
16246 case "$d_srandom_r_proto" in
16248 case "$srandom_r_proto" in
16249 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16250 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16252 case "$srandom_r_proto" in
16253 ''|0) d_srandom_r=undef
16255 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16256 * ) case "$srandom_r_proto" in
16257 REENTRANT_PROTO*) ;;
16258 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16260 echo "Prototype: $try" ;;
16263 *) case "$usethreads" in
16264 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16271 *) srandom_r_proto=0
16275 : see if prototype for setresgid is available
16277 set d_sresgproto setresgid $i_unistd unistd.h
16280 : see if prototype for setresuid is available
16282 set d_sresuproto setresuid $i_unistd unistd.h
16285 : see if sys/stat.h is available
16286 set sys/stat.h i_sysstat
16290 : see if stat knows about block sizes
16292 echo "Checking to see if your struct stat has st_blocks field..." >&4
16293 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16297 : see if this is a sys/vfs.h system
16298 set sys/vfs.h i_sysvfs
16302 : see if this is a sys/statfs.h system
16303 set sys/statfs.h i_sysstatfs
16308 echo "Checking to see if your system supports struct statfs..." >&4
16309 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
16311 case "$d_statfs_s" in
16312 "$define") echo "Yes, it does." ;;
16313 *) echo "No, it doesn't." ;;
16318 : see if struct statfs knows about f_flags
16319 case "$d_statfs_s" in
16322 echo "Checking to see if your struct statfs has f_flags field..." >&4
16323 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
16327 set d_statfs_f_flags
16331 case "$d_statfs_f_flags" in
16332 "$define") echo "Yes, it does." ;;
16333 *) echo "No, it doesn't." ;;
16337 Checking how to access stdio streams by file descriptor number...
16339 case "$stdio_stream_array" in
16340 '') $cat >try.c <<EOCP
16343 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16347 for s in _iob __iob __sF
16349 set try -DSTDIO_STREAM_ARRAY=$s
16350 if eval $compile; then
16351 case "`$run ./try`" in
16352 yes) stdio_stream_array=$s; break ;;
16356 $rm -f try.* try$exe_ext
16358 case "$stdio_stream_array" in
16360 I can't figure out how to access stdio streams by file descriptor number.
16362 d_stdio_stream_array="$undef"
16365 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16367 d_stdio_stream_array="$define"
16371 : see if strcoll exists
16372 set strcoll d_strcoll
16375 : check for structure copying
16377 echo "Checking to see if your C compiler can copy structs..." >&4
16378 $cat >try.c <<'EOCP'
16388 if $cc -c try.c >/dev/null 2>&1 ; then
16390 echo "Yup, it can."
16393 echo "Nope, it can't."
16399 : see if strerror and/or sys_errlist[] exist
16401 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16402 if set strerror val -f d_strerror; eval $csym; $val; then
16403 echo 'strerror() found.' >&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 "(You also have sys_errlist[], so we could roll our own strerror.)"
16408 d_syserrlst="$define"
16410 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16411 d_syserrlst="$undef"
16413 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16414 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16415 echo 'strerror() found in string header.' >&4
16416 d_strerror="$define"
16417 d_strerrm='strerror(e)'
16418 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16419 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16420 d_syserrlst="$define"
16422 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16423 d_syserrlst="$undef"
16425 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16426 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16427 d_strerror="$undef"
16428 d_syserrlst="$define"
16429 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16431 echo 'strerror() and sys_errlist[] NOT found.' >&4
16432 d_strerror="$undef"
16433 d_syserrlst="$undef"
16434 d_strerrm='"unknown"'
16438 : see if strerror_r exists
16439 set strerror_r d_strerror_r
16441 case "$d_strerror_r" in
16443 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16444 case "$d_strerror_r_proto:$usethreads" in
16445 ":define") d_strerror_r_proto=define
16446 set d_strerror_r_proto strerror_r $hdrs
16450 case "$d_strerror_r_proto" in
16452 case "$strerror_r_proto" in
16453 ''|0) try='int strerror_r(int, char*, size_t);'
16454 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16456 case "$strerror_r_proto" in
16457 ''|0) try='int strerror_r(int, char*, int);'
16458 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16460 case "$strerror_r_proto" in
16461 ''|0) try='char* strerror_r(int, char*, size_t);'
16462 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16464 case "$strerror_r_proto" in
16465 ''|0) d_strerror_r=undef
16467 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16468 * ) case "$strerror_r_proto" in
16469 REENTRANT_PROTO*) ;;
16470 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16472 echo "Prototype: $try" ;;
16475 *) case "$usethreads" in
16476 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16483 *) strerror_r_proto=0
16487 : see if strftime exists
16488 set strftime d_strftime
16491 : see if strlcat exists
16492 set strlcat d_strlcat
16495 : see if strlcpy exists
16496 set strlcpy d_strlcpy
16499 : see if strtod exists
16500 set strtod d_strtod
16503 : see if strtol exists
16504 set strtol d_strtol
16507 : see if strtold exists
16508 set strtold d_strtold
16511 : see if strtoll exists
16512 set strtoll d_strtoll
16515 case "$d_longlong-$d_strtoll" in
16518 Checking whether your strtoll() works okay...
16520 $cat >try.c <<'EOCP'
16523 #define strtoll __strtoll
16526 #define strtoll _strtoll
16529 extern long long int strtoll(char *s, char **, int);
16530 static int bad = 0;
16531 int check(char *s, long long ell, int een) {
16534 gll = strtoll(s, 0, 10);
16535 if (!((gll == ell) && (errno == een)))
16539 check(" 1", 1LL, 0);
16540 check(" 0", 0LL, 0);
16541 check("-1", -1LL, 0);
16542 check("-9223372036854775808", -9223372036854775808LL, 0);
16543 check("-9223372036854775808", -9223372036854775808LL, 0);
16544 check(" 9223372036854775807", 9223372036854775807LL, 0);
16545 check("-9223372036854775808", -9223372036854775808LL, 0);
16546 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
16547 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
16553 if eval $compile; then
16556 ok) echo "Your strtoll() seems to be working okay." ;;
16558 Your strtoll() doesn't seem to be working okay.
16564 echo "(I can't seem to compile the test program--assuming it doesn't)"
16570 : see if strtoq exists
16571 set strtoq d_strtoq
16574 : see if strtoul exists
16575 set strtoul d_strtoul
16578 case "$d_strtoul" in
16581 Checking whether your strtoul() works okay...
16583 $cat >try.c <<'EOCP'
16586 extern unsigned long int strtoul(char *s, char **, int);
16587 static int bad = 0;
16588 void check(char *s, unsigned long eul, int een) {
16591 gul = strtoul(s, 0, 10);
16592 if (!((gul == eul) && (errno == een)))
16596 check(" 1", 1L, 0);
16597 check(" 0", 0L, 0);
16599 case "$longsize" in
16601 $cat >>try.c <<'EOCP'
16602 check("18446744073709551615", 18446744073709551615UL, 0);
16603 check("18446744073709551616", 18446744073709551615UL, ERANGE);
16604 #if 0 /* strtoul() for /^-/ strings is undefined. */
16605 check("-1", 18446744073709551615UL, 0);
16606 check("-18446744073709551614", 2, 0);
16607 check("-18446744073709551615", 1, 0);
16608 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
16609 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
16614 $cat >>try.c <<'EOCP'
16615 check("4294967295", 4294967295UL, 0);
16616 check("4294967296", 4294967295UL, ERANGE);
16617 #if 0 /* strtoul() for /^-/ strings is undefined. */
16618 check("-1", 4294967295UL, 0);
16619 check("-4294967294", 2, 0);
16620 check("-4294967295", 1, 0);
16621 check("-4294967296", 4294967295UL, ERANGE);
16622 check("-4294967297", 4294967295UL, ERANGE);
16627 : Should we write these tests to be more portable by sprintf-ing
16628 : ~0 and then manipulating that char string as input for strtol?
16631 $cat >>try.c <<'EOCP'
16638 if eval $compile; then
16639 case "`$run ./try`" in
16640 ok) echo "Your strtoul() seems to be working okay." ;;
16642 Your strtoul() doesn't seem to be working okay.
16651 : see if strtoull exists
16652 set strtoull d_strtoull
16655 case "$d_longlong-$d_strtoull" in
16658 Checking whether your strtoull() works okay...
16660 $cat >try.c <<'EOCP'
16663 #define strtoull __strtoull
16666 extern unsigned long long int strtoull(char *s, char **, int);
16667 static int bad = 0;
16668 int check(char *s, long long eull, int een) {
16671 gull = strtoull(s, 0, 10);
16672 if (!((gull == eull) && (errno == een)))
16676 check(" 1", 1LL, 0);
16677 check(" 0", 0LL, 0);
16678 check("18446744073709551615", 18446744073709551615ULL, 0);
16679 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16680 #if 0 /* strtoull() for /^-/ strings is undefined. */
16681 check("-1", 18446744073709551615ULL, 0);
16682 check("-18446744073709551614", 2LL, 0);
16683 check("-18446744073709551615", 1LL, 0);
16684 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16685 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16692 if eval $compile; then
16693 case "`$run ./try`" in
16694 ok) echo "Your strtoull() seems to be working okay." ;;
16696 Your strtoull() doesn't seem to be working okay.
16698 d_strtoull="$undef"
16705 : see if strtouq exists
16706 set strtouq d_strtouq
16709 case "$d_strtouq" in
16712 Checking whether your strtouq() works okay...
16714 $cat >try.c <<'EOCP'
16717 extern unsigned long long int strtouq(char *s, char **, int);
16718 static int bad = 0;
16719 void check(char *s, unsigned long long eull, int een) {
16720 unsigned long long gull;
16722 gull = strtouq(s, 0, 10);
16723 if (!((gull == eull) && (errno == een)))
16727 check(" 1", 1LL, 0);
16728 check(" 0", 0LL, 0);
16729 check("18446744073709551615", 18446744073709551615ULL, 0);
16730 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16731 #if 0 /* strtouq() for /^-/ strings is undefined. */
16732 check("-1", 18446744073709551615ULL, 0);
16733 check("-18446744073709551614", 2LL, 0);
16734 check("-18446744073709551615", 1LL, 0);
16735 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16736 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16744 if eval $compile; then
16745 case "`$run ./try`" in
16746 ok) echo "Your strtouq() seems to be working okay." ;;
16748 Your strtouq() doesn't seem to be working okay.
16757 : see if strxfrm exists
16758 set strxfrm d_strxfrm
16761 : see if symlink exists
16762 set symlink d_symlink
16765 : see if syscall exists
16766 set syscall d_syscall
16769 : see if prototype for syscall is available
16771 set d_syscallproto syscall $i_unistd unistd.h
16774 : see if sysconf exists
16775 set sysconf d_sysconf
16778 : see if system exists
16779 set system d_system
16782 : see if tcgetpgrp exists
16783 set tcgetpgrp d_tcgetpgrp
16786 : see if tcsetpgrp exists
16787 set tcsetpgrp d_tcsetpgrp
16790 : see if prototype for telldir is available
16792 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
16795 : see if time exists
16797 if test "X$d_time" = X -o X"$timetype" = X; then
16798 if set time val -f d_time; eval $csym; $val; then
16799 echo 'time() found.' >&4
16801 rp="What is the type returned by time() on this system?"
16802 set time_t timetype long stdio.h sys/types.h
16805 echo 'time() not found, hope that will do.' >&4
16813 : see if this is a sys/times.h system
16814 set sys/times.h i_systimes
16817 : see if times exists
16819 if set times val -f d_times; eval $csym; $val; then
16820 echo 'times() found.' >&4
16823 case "$i_systimes" in
16824 "$define") inc='sys/times.h';;
16826 rp="What is the type returned by times() on this system?"
16827 set clock_t clocktype long stdio.h sys/types.h $inc
16830 echo 'times() NOT found, hope that will do.' >&4
16835 : see if tmpnam_r exists
16836 set tmpnam_r d_tmpnam_r
16838 case "$d_tmpnam_r" in
16840 hdrs="$i_systypes sys/types.h define stdio.h "
16841 case "$d_tmpnam_r_proto:$usethreads" in
16842 ":define") d_tmpnam_r_proto=define
16843 set d_tmpnam_r_proto tmpnam_r $hdrs
16847 case "$d_tmpnam_r_proto" in
16849 case "$tmpnam_r_proto" in
16850 ''|0) try='char* tmpnam_r(char*);'
16851 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
16853 case "$tmpnam_r_proto" in
16854 ''|0) d_tmpnam_r=undef
16856 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
16857 * ) case "$tmpnam_r_proto" in
16858 REENTRANT_PROTO*) ;;
16859 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
16861 echo "Prototype: $try" ;;
16864 *) case "$usethreads" in
16865 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
16872 *) tmpnam_r_proto=0
16876 : see if truncate exists
16877 set truncate d_truncate
16880 : see if ttyname_r exists
16881 set ttyname_r d_ttyname_r
16883 case "$d_ttyname_r" in
16885 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
16886 case "$d_ttyname_r_proto:$usethreads" in
16887 ":define") d_ttyname_r_proto=define
16888 set d_ttyname_r_proto ttyname_r $hdrs
16892 case "$d_ttyname_r_proto" in
16894 case "$ttyname_r_proto" in
16895 ''|0) try='int ttyname_r(int, char*, size_t);'
16896 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
16898 case "$ttyname_r_proto" in
16899 ''|0) try='int ttyname_r(int, char*, int);'
16900 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
16902 case "$ttyname_r_proto" in
16903 ''|0) try='char* ttyname_r(int, char*, int);'
16904 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
16906 case "$ttyname_r_proto" in
16907 ''|0) d_ttyname_r=undef
16909 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
16910 * ) case "$ttyname_r_proto" in
16911 REENTRANT_PROTO*) ;;
16912 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
16914 echo "Prototype: $try" ;;
16917 *) case "$usethreads" in
16918 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
16925 *) ttyname_r_proto=0
16929 : see if tzname[] exists
16931 if set tzname val -a d_tzname; eval $csym; $val; then
16933 echo 'tzname[] found.' >&4
16936 echo 'tzname[] NOT found.' >&4
16942 next|rhapsody|darwin) multiarch="$define" ;;
16944 case "$multiarch" in
16945 ''|[nN]*) multiarch="$undef" ;;
16948 : check for ordering of bytes in a UV
16950 case "$usecrosscompile$multiarch" in
16953 You seem to be either cross-compiling or doing a multiarchitecture build,
16954 skipping the byteorder check.
16960 case "$byteorder" in
16963 In the following, larger digits indicate more significance. A big-endian
16964 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
16965 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
16966 machines may have weird orders like 3412. A Cray will report 87654321,
16967 an Alpha will report 12345678. If the test program works the default is
16969 I'm now running the test program...
16973 #$i_stdlib I_STDLIB
16975 #include <stdlib.h>
16977 #include <sys/types.h>
16978 typedef $uvtype UV;
16988 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
16990 u.l = (UV)0x04030201;
16991 for (i = 0; i < $uvsize; i++)
16992 printf("%c", u.c[i]+'0');
16999 if eval $compile && ./try > /dev/null; then
17002 [1-4][1-4][1-4][1-4]|12345678|87654321)
17003 echo "(The test program ran ok.)"
17004 echo "byteorder=$dflt"
17007 ????|????????) echo "(The test program ran ok.)" ;;
17008 *) echo "(The test program didn't run right for some reason.)" ;;
17013 (I can't seem to compile the test program. Guessing big-endian...)
17016 case "$xxx_prompt" in
17018 rp="What is the order of bytes in $uvtype?"
17034 Checking to see whether you can access character data unalignedly...
17036 case "$d_u32align" in
17037 '') $cat >try.c <<EOCP
17039 #$i_stdlib I_STDLIB
17041 #include <stdlib.h>
17043 #define U32 $u32type
17044 #define BYTEORDER 0x$byteorder
17046 #include <signal.h>
17048 $signal_t bletch(s) int s; { exit(4); }
17051 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17056 if (sizeof(U32) != 4) {
17057 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17064 signal(SIGBUS, bletch);
17076 for (i = 0; i < 4; i++) {
17077 up = (U32*)(buf + i);
17078 if (! ((*up == 1 << (8*i)) || /* big-endian */
17079 (*up == 1 << (8*(3-i))) /* little-endian */
17083 printf("read failed (%x)\n", *up);
17089 for (i = 0; i < 4; i++) {
17090 up = (U32*)(buf + i);
17092 if (*up != 0xBeef) {
17093 printf("write failed (%x)\n", *up);
17107 if eval $compile_ok; then
17108 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17109 $run ./try 2>&1 >/dev/null
17112 You can access character data pretty unalignedly.
17114 d_u32align="$undef"
17117 It seems that you must access character data in an aligned manner.
17119 d_u32align="$define"
17123 rp='Can you access character data at unaligned addresses?'
17127 [yY]*) d_u32align="$undef" ;;
17128 *) d_u32align="$define" ;;
17131 $rm -f core core.try.* try.core
17135 : see if ualarm exists
17136 set ualarm d_ualarm
17139 : see if umask exists
17143 : see if unordered exists
17144 set unordered d_unordered
17147 : see if usleep exists
17148 set usleep d_usleep
17151 : see if prototype for usleep is available
17153 set d_usleepproto usleep $i_unistd unistd.h
17156 : see if ustat exists
17160 : backward compatibility for d_hvfork
17161 if test X$d_hvfork != X; then
17162 d_vfork="$d_hvfork"
17165 : see if there is a vfork
17170 : Ok, but do we want to use it. vfork is reportedly unreliable in
17171 : perl on Solaris 2.x, and probably elsewhere.
17175 case "$usevfork" in
17181 Perl can only use a vfork() that doesn't suffer from strict
17182 restrictions on calling functions or modifying global data in
17183 the child. For example, glibc-2.1 contains such a vfork()
17184 that is unsuitable. If your system provides a proper fork()
17185 call, chances are that you do NOT want perl to use vfork().
17188 rp="Do you still want to use vfork()?"
17193 echo "Ok, we won't use vfork()."
17202 $define) usevfork='true';;
17203 *) usevfork='false';;
17206 : see if closedir exists
17207 set closedir d_closedir
17210 case "$d_closedir" in
17213 echo "Checking whether closedir() returns a status..." >&4
17215 #$i_dirent I_DIRENT /**/
17216 #$i_sysdir I_SYS_DIR /**/
17217 #$i_sysndir I_SYS_NDIR /**/
17218 #$i_systypes I_SYS_TYPES /**/
17220 #if defined(I_SYS_TYPES)
17221 #include <sys/types.h>
17223 #if defined(I_DIRENT)
17224 #include <dirent.h>
17225 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17226 #include <sys/dir.h>
17230 #include <sys/ndir.h>
17234 #include <ndir.h> /* may be wrong in the future */
17236 #include <sys/dir.h>
17241 int main() { return closedir(opendir(".")); }
17244 if eval $compile_ok; then
17245 if $run ./try > /dev/null 2>&1 ; then
17246 echo "Yes, it does."
17249 echo "No, it doesn't."
17253 echo "(I can't seem to compile the test program--assuming it doesn't)"
17261 set d_void_closedir
17264 : see if there is a wait4
17268 : see if waitpid exists
17269 set waitpid d_waitpid
17272 : see if wcstombs exists
17273 set wcstombs d_wcstombs
17276 : see if wctomb exists
17277 set wctomb d_wctomb
17280 : see if writev exists
17281 set writev d_writev
17284 : preserve RCS keywords in files with variable substitution, grrr
17289 Revision='$Revision'
17291 : check for alignment requirements
17293 case "$usecrosscompile$multiarch" in
17296 You seem to be either cross-compiling or doing a multiarchitecture build,
17297 skipping the memory alignment check.
17300 case "$alignbytes" in
17301 '') alignbytes=8 ;;
17305 case "$alignbytes" in
17306 '') echo "Checking alignment constraints..." >&4
17307 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17308 $cat >try.c <<'EOCP'
17309 typedef long double NV;
17312 $cat >try.c <<'EOCP'
17316 $cat >>try.c <<'EOCP'
17324 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17329 if eval $compile_ok; then
17333 echo "(I can't seem to compile the test program...)"
17336 *) dflt="$alignbytes"
17339 rp="Doubles must be aligned on a how-many-byte boundary?"
17347 : set the base revision
17350 : how do we concatenate cpp tokens here?
17352 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17353 $cat >cpp_stuff.c <<'EOCP'
17354 #define RCAT(a,b)a/**/b
17355 #define ACAT(a,b)a ## b
17359 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17360 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17361 echo "Oh! Smells like ANSI's been here." >&4
17362 echo "We can catify or stringify, separately or together!"
17364 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17365 echo "Ah, yes! The good old days!" >&4
17366 echo "However, in the good old days we don't know how to stringify and"
17367 echo "catify at the same time."
17371 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17372 You're going to have to edit the values of CAT[2-5] in config.h...
17374 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17378 : see if this is a db.h system
17384 : Check db version.
17386 echo "Checking Berkeley DB version ..." >&4
17392 #include <sys/types.h>
17394 #$i_stdlib I_STDLIB
17396 #include <stdlib.h>
17399 int main(int argc, char *argv[])
17401 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17402 int Major, Minor, Patch ;
17403 unsigned long Version ;
17404 (void)db_version(&Major, &Minor, &Patch) ;
17406 printf("%d %d %d %d %d %d\n",
17407 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17408 Major, Minor, Patch);
17411 printf("You have Berkeley DB Version 2 or greater.\n");
17413 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17414 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17415 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17416 Major, Minor, Patch) ;
17418 /* check that db.h & libdb are compatible */
17419 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17420 printf("db.h and libdb are incompatible.\n") ;
17424 printf("db.h and libdb are compatible.\n") ;
17426 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17427 + DB_VERSION_PATCH ;
17429 /* needs to be >= 2.3.4 */
17430 if (Version < 2003004) {
17431 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17432 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17438 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17443 printf("You have Berkeley DB Version 1.\n");
17444 exit(0); /* DB version < 2: the coast is clear. */
17446 exit(1); /* <db.h> not Berkeley DB? */
17452 if eval $compile_ok && $run ./try; then
17453 echo 'Looks OK.' >&4
17455 db_version_major=$1
17456 db_version_minor=$2
17457 db_version_patch=$3
17459 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17463 : Remove db from list of libraries to use
17464 echo "Removing unusable -ldb from library list" >&4
17465 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17468 echo "libs = $libs" >&4
17478 : Check the return type needed for hash
17480 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17486 #include <sys/types.h>
17489 #ifndef DB_VERSION_MAJOR
17490 u_int32_t hash_cb (ptr, size)
17498 info.hash = hash_cb;
17502 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17503 if $contains warning try.out >>/dev/null 2>&1 ; then
17506 db_hashtype='u_int32_t'
17509 : XXX Maybe we should just give up here.
17510 db_hashtype=u_int32_t
17512 echo "Help: I can't seem to compile the db test program." >&4
17513 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
17516 echo "Your version of Berkeley DB uses $db_hashtype for hash."
17518 *) db_hashtype=u_int32_t
17523 : Check the return type needed for prefix
17525 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
17531 #include <sys/types.h>
17534 #ifndef DB_VERSION_MAJOR
17535 size_t prefix_cb (key1, key2)
17543 info.prefix = prefix_cb;
17547 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17548 if $contains warning try.out >>/dev/null 2>&1 ; then
17549 db_prefixtype='int'
17551 db_prefixtype='size_t'
17554 db_prefixtype='size_t'
17555 : XXX Maybe we should just give up here.
17557 echo "Help: I can't seem to compile the db test program." >&4
17558 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
17561 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
17563 *) db_prefixtype='size_t'
17568 : How can we generate normalized random numbers ?
17570 echo "Looking for a random number function..." >&4
17571 case "$randfunc" in
17573 if set drand48 val -f; eval $csym; $val; then
17575 echo "Good, found drand48()." >&4
17576 elif set random val -f; eval $csym; $val; then
17578 echo "OK, found random()." >&4
17581 echo "Yick, looks like I have to use rand()." >&4
17592 *-Dmy_rand=*|*-Dmy_srand=*)
17593 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
17594 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
17595 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
17596 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
17600 while $test "$cont"; do
17601 rp="Use which function to generate random numbers?"
17603 if $test "$ans" = "$dflt"; then
17609 if set $ans val -f; eval $csym; $val; then
17613 rp="I cannot find function $ans. Use that name anyway?"
17622 case "$randfunc" in
17624 drand01="drand48()"
17630 case "$randbits" in
17632 echo "Checking to see how many bits your $randfunc() function produces..." >&4
17634 #$i_unistd I_UNISTD
17635 #$i_stdlib I_STDLIB
17638 # include <unistd.h>
17641 # include <stdlib.h>
17646 register unsigned long tmp;
17647 register unsigned long max = 0L;
17649 for (i = 1000; i; i--) {
17650 tmp = (unsigned long) $randfunc();
17651 if (tmp > max) max = tmp;
17653 for (i = 0; max; i++)
17659 if eval $compile_ok; then
17663 echo "(I can't seem to compile the test program...)"
17670 rp="How many bits does your $randfunc() function produce?"
17674 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17675 seedfunc="s$randfunc"
17676 randseedtype=unsigned
17680 rp="How many bits does your $randfunc() function produce?"
17683 seedfunc="s$randfunc"
17684 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17685 if set $seedfunc val -f; eval $csym; $val; then
17686 echo "(Using $seedfunc() to seed random generator)"
17688 echo "(Warning: no $seedfunc() to seed random generator)"
17691 randseedtype=unsigned
17699 echo "Determining whether or not we are on an EBCDIC system..." >&4
17700 $cat >try.c <<'EOM'
17703 if ('M'==0xd4) return 0;
17710 if eval $compile_ok; then
17711 if $run ./try; then
17712 echo "You seem to speak EBCDIC." >&4
17715 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
17718 echo "I'm unable to compile the test program." >&4
17719 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
17727 Checking how to flush all pending stdio output...
17729 # I only know how to find the first 32 possibly open files on SunOS.
17730 # See also hints/sunos_4_1.sh and util.c --AD
17732 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
17734 $cat >>try.c <<EOCP
17736 #$i_stdlib I_STDLIB
17738 #include <stdlib.h>
17740 #$i_unistd I_UNISTD
17742 # include <unistd.h>
17744 #$d_sysconf HAS_SYSCONF
17745 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
17746 #ifdef HAS_STDIO_STREAM_ARRAY
17747 # define STDIO_STREAM_ARRAY $stdio_stream_array
17752 p = fopen("try.out", "w");
17756 # ifdef TRY_FPRINTF
17760 #ifdef TRY_FFLUSH_NULL
17763 #ifdef TRY_FFLUSH_ALL
17765 long open_max = -1;
17766 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
17767 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
17769 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
17770 open_max = sysconf(_SC_OPEN_MAX);
17773 open_max = FOPEN_MAX;
17776 open_max = OPEN_MAX;
17785 # ifdef HAS_STDIO_STREAM_ARRAY
17786 if (open_max > 0) {
17788 for (i = 0; i < open_max; i++)
17789 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
17790 STDIO_STREAM_ARRAY[i]._file < open_max &&
17791 STDIO_STREAM_ARRAY[i]._flag)
17792 fflush(&STDIO_STREAM_ARRAY[i]);
17800 : first we have to find out how _not_ to flush
17802 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
17804 set try -DTRY_FPUTC
17805 if eval $compile; then
17806 $run ./try 2>/dev/null
17809 if $test ! -s try.out -a "X$code" = X42; then
17815 set try -DTRY_FPRINTF
17816 if eval $compile; then
17817 $run ./try 2>/dev/null
17820 if $test ! -s try.out -a "X$code" = X42; then
17821 output=-DTRY_FPRINTF
17827 : check for fflush NULL behaviour
17828 case "$fflushNULL" in
17829 '') set try -DTRY_FFLUSH_NULL $output
17830 if eval $compile; then
17831 $run ./try 2>/dev/null
17834 if $test -s try.out -a "X$code" = X42; then
17835 fflushNULL="`$cat try.out`"
17837 if $test "X$code" != X42; then
17839 (If this test failed, don't worry, we'll try another method shortly.)
17844 $rm -f core try.core core.try.*
17845 case "$fflushNULL" in
17847 Your fflush(NULL) works okay for output streams.
17848 Let's see if it clobbers input pipes...
17850 # As of mid-March 2000 all versions of Solaris appear to have a stdio
17851 # bug that improperly flushes the input end of pipes. So we avoid the
17852 # autoflush on fork/system/exec support for now. :-(
17853 $cat >tryp.c <<EOCP
17856 main(int argc, char **argv)
17862 while ((i = getc(stdin)) != -1
17863 && (*bp++ = i) != '\n'
17864 && bp < &buf[1024])
17867 fprintf(stdout, "%s", buf);
17875 fflushNULL="$define"
17877 if eval $compile; then
17879 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17880 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17882 fflush(NULL) seems to behave okay with input streams.
17884 fflushNULL="$define"
17887 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
17889 fflushNULL="$undef"
17892 $rm -f core tryp.c tryp.core core.tryp.*
17895 Your fflush(NULL) isn't working (contrary to ANSI C).
17897 fflushNULL="$undef"
17900 Cannot figure out whether your fflush(NULL) works or not.
17901 I'm assuming it doesn't (contrary to ANSI C).
17903 fflushNULL="$undef"
17907 $define|true|[yY]*)
17908 fflushNULL="$define"
17911 fflushNULL="$undef"
17914 : check explicit looping only if NULL did not work, and if the pipe
17915 : bug does not show up on an explicit flush too
17916 case "$fflushNULL" in
17918 $cat >tryp.c <<EOCP
17921 main(int argc, char **argv)
17927 while ((i = getc(stdin)) != -1
17928 && (*bp++ = i) != '\n'
17929 && bp < &buf[1024])
17932 fprintf(stdout, "%s", buf);
17941 if eval $compile; then
17943 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17944 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17946 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
17948 : now check for fflushall behaviour
17949 case "$fflushall" in
17950 '') set try -DTRY_FFLUSH_ALL $output
17951 if eval $compile; then
17953 (Now testing the other method--but note that this also may fail.)
17955 $run ./try 2>/dev/null
17958 if $test -s try.out -a "X$code" = X42; then
17959 fflushall="`$cat try.out`"
17962 $rm -f core try.core core.try.*
17963 case "$fflushall" in
17965 Whew. Flushing explicitly all the stdio streams works.
17967 fflushall="$define"
17970 Sigh. Flushing explicitly all the stdio streams doesn't work.
17975 Cannot figure out whether flushing stdio streams explicitly works or not.
17976 I'm assuming it doesn't.
17982 "$define"|true|[yY]*)
17983 fflushall="$define"
17991 All is futile. Even fflush(stdin) clobbers input pipes!
17998 $rm -f core tryp.c tryp.core core.tryp.*
18000 *) fflushall="$undef"
18004 case "$fflushNULL$fflushall" in
18007 OK, I give up. I cannot figure out how to flush pending stdio output.
18008 We won't be flushing handles at all before fork/exec/popen.
18012 $rm -f try.* try$exe_ext
18014 : Store the full pathname to the ar program for use in the C program
18015 : Respect a hint or command line value for full_ar.
18020 : Store the full pathname to the sed program for use in the C program
18023 : see what type gids are declared as in the kernel
18025 echo "Looking for the type for group ids returned by getgid()."
18026 set gid_t gidtype xxx stdio.h sys/types.h
18030 xxx=`./findhdr sys/user.h`
18031 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18033 unsigned) dflt="$1 $2" ;;
18037 *) dflt="$gidtype";;
18040 gid_t) echo "gid_t found." ;;
18041 *) rp="What is the type for group ids returned by getgid()?"
18049 *_t) zzz="$gidtype" ;;
18052 echo "Checking the size of $zzz..." >&4
18054 #include <sys/types.h>
18056 #$i_stdlib I_STDLIB
18058 #include <stdlib.h>
18061 printf("%d\n", (int)sizeof($gidtype));
18066 if eval $compile_ok; then
18070 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18073 echo "Your $zzz is $gidsize bytes long."
18078 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18084 *_t) zzz="$gidtype" ;;
18087 echo "Checking the sign of $zzz..." >&4
18089 #include <sys/types.h>
18100 if eval $compile; then
18104 echo "(I can't execute the test program--guessing unsigned.)" >&4
18108 1) echo "Your $zzz is unsigned." ;;
18109 -1) echo "Your $zzz is signed." ;;
18115 echo "(I can't compile the test program--guessing unsigned.)" >&4
18121 if $test X"$quadtype" != X; then
18123 echo "Checking how to print 64-bit integers..." >&4
18125 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18126 $cat >try.c <<'EOCP'
18127 #include <sys/types.h>
18130 int q = 12345678901;
18131 printf("%ld\n", q);
18135 if eval $compile; then
18139 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18140 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18141 echo "We will use %d."
18147 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18148 $cat >try.c <<'EOCP'
18149 #include <sys/types.h>
18152 long q = 12345678901;
18153 printf("%ld\n", q);
18157 if eval $compile; then
18161 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18162 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18163 echo "We will use %ld."
18169 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18170 $cat >try.c <<'EOCP'
18171 #include <sys/types.h>
18172 #include <inttypes.h>
18175 int64_t q = 12345678901;
18176 printf("%" PRId64 "\n", q);
18180 if eval $compile; then
18184 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18185 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18186 echo "We will use the C9X style."
18192 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18194 #include <sys/types.h>
18197 $quadtype q = 12345678901;
18198 printf("%Ld\n", q);
18202 if eval $compile; then
18206 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18207 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18208 echo "We will use %Ld."
18214 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18215 $cat >try.c <<'EOCP'
18216 #include <sys/types.h>
18219 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18220 printf("%lld\n", q);
18224 if eval $compile; then
18228 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18229 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18230 echo "We will use the %lld style."
18236 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18238 #include <sys/types.h>
18241 $quadtype q = 12345678901;
18242 printf("%qd\n", q);
18246 if eval $compile; then
18250 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18251 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18252 echo "We will use %qd."
18258 if $test X"$sPRId64" = X; then
18259 echo "Cannot figure out how to print 64-bit integers." >&4
18267 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18268 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18270 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18271 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18277 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18279 if $test X"$ivsize" = X8; then
18280 ivdformat="$sPRId64"
18281 uvuformat="$sPRIu64"
18282 uvoformat="$sPRIo64"
18283 uvxformat="$sPRIx64"
18284 uvXUformat="$sPRIXU64"
18286 if $test X"$ivsize" = X"$longsize"; then
18293 if $test X"$ivsize" = X"$intsize"; then
18301 if $test X"$ivsize" = X"$shortsize"; then
18312 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18313 nveformat="$sPRIeldbl"
18314 nvfformat="$sPRIfldbl"
18315 nvgformat="$sPRIgldbl"
18316 nvEUformat="$sPRIEUldbl"
18317 nvFUformat="$sPRIFUldbl"
18318 nvGUformat="$sPRIGUldbl"
18328 case "$ivdformat" in
18329 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18336 $echo "Checking the format string to be used for gids..." >&4
18339 -1) if $test X"$gidsize" = X"$ivsize"; then
18340 gidformat="$ivdformat"
18342 if $test X"$gidsize" = X"$longsize"; then
18345 if $test X"$gidsize" = X"$intsize"; then
18348 if $test X"$gidsize" = X"$shortsize"; then
18355 *) if $test X"$gidsize" = X"$uvsize"; then
18356 gidformat="$uvuformat"
18358 if $test X"$gidsize" = X"$longsize"; then
18361 if $test X"$gidsize" = X"$intsize"; then
18364 if $test X"$gidsize" = X"$shortsize"; then
18373 : see if getgroups exists
18374 set getgroups d_getgrps
18377 : see if setgroups exists
18378 set setgroups d_setgrps
18382 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18384 case "$d_getgrps$d_setgrps" in
18386 case "$groupstype" in
18387 '') dflt="$gidtype" ;;
18388 *) dflt="$groupstype" ;;
18391 What type of pointer is the second argument to getgroups() and setgroups()?
18392 Usually this is the same as group ids, $gidtype, but not always.
18395 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18399 *) groupstype="$gidtype";;
18403 echo "Checking if your $make program sets \$(MAKE)..." >&4
18404 case "$make_set_make" in
18406 $sed 's/^X //' > testmake.mak << 'EOF'
18408 X @echo 'maketemp="$(MAKE)"'
18410 case "`$make -f testmake.mak 2>/dev/null`" in
18411 *maketemp=*) make_set_make='#' ;;
18412 *) make_set_make="MAKE=$make" ;;
18414 $rm -f testmake.mak
18417 case "$make_set_make" in
18418 '#') echo "Yup, it does.";;
18419 *) echo "Nope, it doesn't.";;
18422 : see what type is used for mode_t
18423 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18424 set mode_t modetype int stdio.h sys/types.h
18427 : see if stdarg is available
18429 if $test `./findhdr stdarg.h`; then
18430 echo "<stdarg.h> found." >&4
18433 echo "<stdarg.h> NOT found." >&4
18437 : see if varags is available
18439 if $test `./findhdr varargs.h`; then
18440 echo "<varargs.h> found." >&4
18442 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18445 : set up the varargs testing programs
18446 $cat > varargs.c <<EOP
18448 #include <stdarg.h>
18451 #include <varargs.h>
18455 int f(char *p, ...)
18469 p = va_arg(ap, char *);
18474 $cat > varargs <<EOP
18476 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
18485 : now check which varargs header should be included
18490 if `./varargs I_STDARG`; then
18492 elif `./varargs I_VARARGS`; then
18497 if `./varargs I_VARARGS`; then
18504 echo "I could not find the definition for va_dcl... You have problems..." >&4
18505 val="$undef"; set i_stdarg; eval $setvar
18506 val="$undef"; set i_varargs; eval $setvar
18511 case "$i_varhdr" in
18513 val="$define"; set i_stdarg; eval $setvar
18514 val="$undef"; set i_varargs; eval $setvar
18517 val="$undef"; set i_stdarg; eval $setvar
18518 val="$define"; set i_varargs; eval $setvar
18521 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
18525 : see if we need va_copy
18527 case "$i_stdarg" in
18530 #include <stdarg.h>
18532 #$i_stdlib I_STDLIB
18534 #include <stdlib.h>
18536 #include <signal.h>
18539 ivfprintf(FILE *f, const char *fmt, va_list *valp)
18541 return vfprintf(f, fmt, *valp);
18545 myvfprintf(FILE *f, const char *fmt, va_list val)
18547 return ivfprintf(f, fmt, &val);
18551 myprintf(char *fmt, ...)
18554 va_start(val, fmt);
18555 return myvfprintf(stdout, fmt, val);
18559 main(int ac, char **av)
18561 signal(SIGSEGV, exit);
18563 myprintf("%s%cs all right, then\n", "that", '\'');
18568 if eval $compile && $run ./try 2>&1 >/dev/null; then
18569 case "`$run ./try`" in
18570 "that's all right, then")
18576 yes) echo "It seems that you don't need va_copy()." >&4
18577 need_va_copy="$undef"
18579 *) echo "It seems that va_copy() or similar will be needed." >&4
18580 need_va_copy="$define"
18583 $rm -f try.* core core.* *.core *.core.*
18585 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
18589 : see what type is used for size_t
18590 rp="What is the type used for the length parameter for string functions?"
18591 set size_t sizetype 'unsigned int' stdio.h sys/types.h
18594 : check for type of arguments to gethostbyaddr.
18595 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
18596 case "$d_gethbyaddr" in
18600 Checking to see what type of arguments are accepted by gethostbyaddr().
18602 hdrs="$define sys/types.h
18603 $d_socket sys/socket.h
18604 $i_niin netinet/in.h
18606 $i_unistd unistd.h"
18607 : The first arg can 'char *' or 'void *'
18608 : The second arg is some of integral type
18609 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
18610 for yyy in size_t long int; do
18611 case "$netdb_host_type" in
18612 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
18613 if ./protochk "$try" $hdrs; then
18614 echo "Your system accepts $xxx for the first arg."
18615 echo "...and $yyy for the second arg."
18616 netdb_host_type="$xxx"
18617 netdb_hlen_type="$yyy"
18623 : In case none of those worked, prompt the user.
18624 case "$netdb_host_type" in
18625 '') rp='What is the type for the 1st argument to gethostbyaddr?'
18628 netdb_host_type=$ans
18629 rp='What is the type for the 2nd argument to gethostbyaddr?'
18632 netdb_hlen_type=$ans
18636 *) : no gethostbyaddr, so pick harmless defaults
18637 netdb_host_type='char *'
18638 netdb_hlen_type="$sizetype"
18641 # Remove the "const" if needed. -- but then we'll have a
18643 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
18646 : check for type of argument to gethostbyname.
18647 if test "X$netdb_name_type" = X ; then
18648 case "$d_gethbyname" in
18652 Checking to see what type of argument is accepted by gethostbyname().
18654 hdrs="$define sys/types.h
18655 $d_socket sys/socket.h
18656 $i_niin netinet/in.h
18658 $i_unistd unistd.h"
18659 for xxx in "const char *" "char *"; do
18660 case "$netdb_name_type" in
18661 '') try="extern struct hostent *gethostbyname($xxx);"
18662 if ./protochk "$try" $hdrs; then
18663 echo "Your system accepts $xxx."
18664 netdb_name_type="$xxx"
18669 : In case none of those worked, prompt the user.
18670 case "$netdb_name_type" in
18671 '') rp='What is the type for the 1st argument to gethostbyname?'
18674 netdb_name_type=$ans
18678 *) : no gethostbyname, so pick harmless default
18679 netdb_name_type='char *'
18684 : check for type of 1st argument to getnetbyaddr.
18685 if test "X$netdb_net_type" = X ; then
18686 case "$d_getnbyaddr" in
18690 Checking to see what type of 1st argument is accepted by getnetbyaddr().
18692 hdrs="$define sys/types.h
18693 $d_socket sys/socket.h
18694 $i_niin netinet/in.h
18696 $i_unistd unistd.h"
18697 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
18698 case "$netdb_net_type" in
18699 '') try="extern struct netent *getnetbyaddr($xxx, int);"
18700 if ./protochk "$try" $hdrs; then
18701 echo "Your system accepts $xxx."
18702 netdb_net_type="$xxx"
18707 : In case none of those worked, prompt the user.
18708 case "$netdb_net_type" in
18709 '') rp='What is the type for the 1st argument to getnetbyaddr?'
18712 netdb_net_type=$ans
18716 *) : no getnetbyaddr, so pick harmless default
18717 netdb_net_type='long'
18721 : locate the preferred pager for this system
18728 [a-zA-Z]:/*) dflt=$pg;;
18732 [a-zA-Z]:/*) dflt=$more;;
18736 [a-zA-Z]:/*) dflt=$less;;
18739 '') dflt=/usr/ucb/more;;
18743 : Instruct ./getfile to trust the hinted or previous pager value,
18744 : even if it does not begin with a slash. For example, on os2,
18745 : pager might be cmd /c more. See comments in UU/getfile.
18750 rp='What pager is used on your system?'
18754 : see what type pids are declared as in the kernel
18755 rp="What is the type of process ids on this system?"
18756 set pid_t pidtype int stdio.h sys/types.h
18759 : see if ar generates random libraries by itself
18761 echo "Checking how to generate random libraries on your machine..." >&4
18762 echo 'int bar1() { return bar2(); }' > bar1.c
18763 echo 'int bar2() { return 2; }' > bar2.c
18765 #$i_stdlib I_STDLIB
18767 #include <stdlib.h>
18769 int main() { printf("%d\n", bar1()); exit(0); }
18771 $cc $ccflags -c bar1.c >/dev/null 2>&1
18772 $cc $ccflags -c bar2.c >/dev/null 2>&1
18773 $cc $ccflags -c foo.c >/dev/null 2>&1
18774 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
18775 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
18776 $run ./foobar >/dev/null 2>&1; then
18777 echo "$ar appears to generate random libraries itself."
18780 elif $ar ts bar$_a >/dev/null 2>&1 &&
18781 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
18782 $run ./foobar >/dev/null 2>&1; then
18783 echo "a table of contents needs to be added with '$ar ts'."
18790 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
18791 $test -f $ranlib || ranlib=''
18794 if $test -n "$ranlib"; then
18795 echo "your system has '$ranlib'; we'll use that."
18798 echo "your system doesn't seem to support random libraries"
18799 echo "so we'll use lorder and tsort to order the libraries."
18806 : check for type of arguments to select.
18807 case "$selecttype" in
18808 '') case "$d_select" in
18812 Checking to see what type of arguments are accepted by select().
18814 hdrs="$define sys/types.h
18815 $i_systime sys/time.h
18816 $i_sysselct sys/select.h
18817 $d_socket sys/socket.h"
18818 : The first arg can be int, unsigned, or size_t
18819 : The last arg may or may not be 'const'
18821 : void pointer has been seen but using that
18822 : breaks the selectminbits test
18823 for xxx in 'fd_set *' 'int *'; do
18824 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
18825 for tmo in 'struct timeval *' 'const struct timeval *'; do
18827 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
18828 if ./protochk "$try" $hdrs; then
18829 echo "Your system accepts $xxx."
18838 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
18839 case "$d_fd_set" in
18840 $define) dflt="fd_set *" ;;
18849 *) : no select, so pick a harmless default
18856 : check for the select 'width'
18857 case "$selectminbits" in
18858 '') safebits=`expr $ptrsize \* 8`
18859 case "$d_select" in
18863 Checking to see on how many bits at a time your select() operates...
18866 #include <sys/types.h>
18868 #$i_systime I_SYS_TIME
18869 #$i_systimek I_SYS_TIME_KERNEL
18874 # ifdef I_SYS_TIME_KERNEL
18877 # include <sys/time.h>
18878 # ifdef I_SYS_TIME_KERNEL
18882 #$i_sysselct I_SYS_SELECT
18883 #ifdef I_SYS_SELECT
18884 #include <sys/select.h>
18886 #$d_socket HAS_SOCKET
18888 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
18891 #$i_stdlib I_STDLIB
18893 #include <stdlib.h>
18896 #define S sizeof(*(b))
18898 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
18899 #define NBITS (NBYTES * 8)
18901 char *s = malloc(NBYTES);
18910 fp = fopen("try.c", "r");
18916 b = ($selecttype)s;
18917 for (i = 0; i < NBITS; i++)
18921 select(fd + 1, b, 0, 0, &t);
18922 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
18924 printf("%d\n", i + 1);
18929 if eval $compile_ok; then
18930 selectminbits=`$run ./try`
18931 case "$selectminbits" in
18933 Cannot figure out on how many bits at a time your select() operates.
18934 I'll play safe and guess it is $safebits bits.
18936 selectminbits=$safebits
18937 bits="$safebits bits"
18940 *) bits="$selectminbits bits" ;;
18942 echo "Your select() operates on $bits at a time." >&4
18944 rp='What is the minimum number of bits your select() operates on?'
18945 case "$byteorder" in
18946 12345678) dflt=64 ;;
18952 selectminbits="$val"
18956 *) : no select, so pick a harmless default
18957 selectminbits=$safebits
18963 : Trace out the files included by signal.h, then look for SIGxxx names.
18964 : Remove SIGARRAYSIZE used by HPUX.
18965 : Remove SIGSTKSIZE used by Linux.
18966 : Remove SIGSTKSZ used by Posix.
18967 : Remove SIGTYP void lines used by OS2.
18968 : Some cpps, like os390, dont give the file name anywhere
18969 if [ "X$fieldn" = X ]; then
18970 : Just make some guesses. We check them later.
18971 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
18973 xxx=`echo '#include <signal.h>' |
18974 $cppstdin $cppminus $cppflags 2>/dev/null |
18975 $grep '^[ ]*#.*include' |
18976 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
18978 : Check this list of files to be sure we have parsed the cpp output ok.
18979 : This will also avoid potentially non-existent files, such
18982 for xx in $xxx /dev/null ; do
18983 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
18985 : If we have found no files, at least try signal.h
18986 case "$xxxfiles" in
18987 '') xxxfiles=`./findhdr signal.h` ;;
18990 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
18991 print substr($2, 4, 20)
18993 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
18994 print substr($3, 4, 20)
18996 : Append some common names just in case the awk scan failed.
18997 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
18998 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
18999 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
19000 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
19001 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
19003 : generate a few handy files for later
19004 $cat > signal.c <<EOCP
19005 #include <sys/types.h>
19006 #include <signal.h>
19007 #$i_stdlib I_STDLIB
19009 #include <stdlib.h>
19014 /* Strange style to avoid deeply-nested #if/#else/#endif */
19017 # define NSIG (_NSIG)
19023 # define NSIG (SIGMAX+1)
19029 # define NSIG (SIG_MAX+1)
19035 # define NSIG (MAXSIG+1)
19041 # define NSIG (MAX_SIG+1)
19046 # ifdef SIGARRAYSIZE
19047 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
19053 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19057 /* Default to some arbitrary number that's big enough to get most
19058 of the common signals.
19064 printf("NSIG %d\n", NSIG);
19070 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19072 printf "#ifdef SIG"; printf $1; printf "\n"
19073 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19074 printf $1; printf ");\n"
19078 printf "#endif /* JUST_NSIG */\n";
19079 printf "exit(0);\n}\n";
19082 $cat >signal.awk <<'EOP'
19083 BEGIN { ndups = 0 }
19084 $1 ~ /^NSIG$/ { nsig = $2 }
19085 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19086 if ($2 > maxsig) { maxsig = $2 }
19087 if (sig_name[$2]) {
19088 dup_name[ndups] = $1
19089 dup_num[ndups] = $2
19101 printf("NSIG %d\n", nsig);
19102 for (n = 1; n < nsig; n++) {
19104 printf("%s %d\n", sig_name[n], sig_num[n])
19107 printf("NUM%d %d\n", n, n)
19110 for (n = 0; n < ndups; n++) {
19111 printf("%s %d\n", dup_name[n], dup_num[n])
19115 $cat >signal_cmd <<EOS
19117 if $test -s signal.lst; then
19118 echo "Using your existing signal.lst file"
19123 $cat >>signal_cmd <<'EOS'
19126 if eval $compile_ok; then
19127 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19129 echo "(I can't seem be able to compile the whole test program)" >&4
19130 echo "(I'll try it in little pieces.)" >&4
19131 set signal -DJUST_NSIG
19132 if eval $compile_ok; then
19133 $run ./signal$_exe > signal.nsg
19136 echo "I can't seem to figure out how many signals you have." >&4
19137 echo "Guessing 50." >&4
19138 echo 'NSIG 50' > signal.nsg
19140 : Now look at all the signal names, one at a time.
19141 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19142 $cat > signal.c <<EOCP
19143 #include <sys/types.h>
19144 #include <signal.h>
19147 printf("$xx %d\n", SIG${xx});
19152 if eval $compile; then
19153 echo "SIG${xx} found."
19154 $run ./signal$_exe >> signal.ls1
19156 echo "SIG${xx} NOT found."
19159 if $test -s signal.ls1; then
19160 $cat signal.nsg signal.ls1 |
19161 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19165 if $test -s signal.lst; then
19168 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19169 echo 'kill -l' >signal
19170 set X `csh -f <signal`
19174 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19176 echo $@ | $tr ' ' $trnl | \
19177 $awk '{ printf "%s %d\n", $1, ++s; }
19178 END { printf "NSIG %d\n", ++s }' >signal.lst
19180 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19182 chmod a+x signal_cmd
19183 $eunicefix signal_cmd
19185 : generate list of signal names
19187 case "$sig_name_init" in
19189 *) case "$sig_num_init" in
19190 ''|*,*) doinit=yes ;;
19195 echo "Generating a list of signal names and numbers..." >&4
19197 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19198 sig_name=`$awk 'BEGIN { printf "ZERO " }
19199 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19200 sig_num=`$awk 'BEGIN { printf "0 " }
19201 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19202 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19203 !/^NSIG/ { printf "\"%s\", ", $1 }
19204 END { printf "0\n" }' signal.lst`
19205 sig_num_init=`$awk 'BEGIN { printf "0, " }
19206 !/^NSIG/ { printf "%d, ", $2}
19207 END { printf "0\n"}' signal.lst`
19210 echo "The following $sig_count signals are available:"
19212 echo $sig_name | $awk \
19213 'BEGIN { linelen = 0 }
19215 for (i = 1; i <= NF; i++) {
19216 name = "SIG" $i " "
19217 linelen = linelen + length(name)
19218 if (linelen > 70) {
19220 linelen = length(name)
19226 sig_size=`echo $sig_name | awk '{print NF}'`
19227 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19230 case "$sizetype" in
19231 *_t) zzz="$sizetype" ;;
19232 *) zzz="filesize" ;;
19234 echo "Checking the size of $zzz..." >&4
19236 #include <sys/types.h>
19238 #$i_stdlib I_STDLIB
19240 #include <stdlib.h>
19243 printf("%d\n", (int)sizeof($sizetype));
19248 if eval $compile_ok; then
19252 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19255 echo "Your $zzz size is $sizesize bytes."
19260 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19264 : check for socklen_t
19266 echo "Checking to see if you have socklen_t..." >&4
19268 #include <sys/types.h>
19269 #$d_socket HAS_SOCKET
19271 #include <sys/socket.h>
19273 int main() { socklen_t x = 16; }
19276 if eval $compile; then
19278 echo "You have socklen_t."
19281 echo "You do not have socklen_t."
19282 case "$sizetype" in
19283 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19290 : see if this is a socks.h system
19291 set socks.h i_socks
19294 : check for type of the size argument to socket calls
19295 case "$d_socket" in
19299 Checking to see what type is the last argument of accept().
19302 case "$d_socklen_t" in
19303 "$define") yyy="$yyy socklen_t"
19305 yyy="$yyy $sizetype int long unsigned"
19306 for xxx in $yyy; do
19307 case "$socksizetype" in
19308 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19309 case "$usesocks" in
19311 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19312 echo "Your system accepts '$xxx *' for the last argument of accept()."
19313 socksizetype="$xxx"
19316 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19317 echo "Your system accepts '$xxx *' for the last argument of accept()."
19318 socksizetype="$xxx"
19325 : In case none of those worked, prompt the user.
19326 case "$socksizetype" in
19327 '') rp='What is the type for socket address structure sizes?'
19334 *) : no sockets, so pick relatively harmless default
19339 : see what type is used for signed size_t
19340 set ssize_t ssizetype int stdio.h sys/types.h
19345 #$i_stdlib I_STDLIB
19347 #include <stdlib.h>
19349 #include <sys/types.h>
19350 #define Size_t $sizetype
19351 #define SSize_t $dflt
19354 if (sizeof(Size_t) == sizeof(SSize_t))
19356 else if (sizeof(Size_t) == sizeof(int))
19365 if eval $compile_ok && $run ./try > /dev/null; then
19366 ssizetype=`$run ./try`
19367 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19370 Help! I can't compile and run the ssize_t test program: please enlighten me!
19371 (This is probably a misconfiguration in your system or libraries, and
19372 you really ought to fix it. Still, I'll try anyway.)
19374 I need a type that is the same size as $sizetype, but is guaranteed to
19375 be signed. Common values are ssize_t, int and long.
19378 rp="What signed type is the same size as $sizetype?"
19384 : see what type of char stdio uses.
19386 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
19387 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19388 echo "Your stdio uses unsigned chars." >&4
19389 stdchar="unsigned char"
19391 echo "Your stdio uses signed chars." >&4
19398 : see what type uids are declared as in the kernel
19400 echo "Looking for the type for user ids returned by getuid()."
19401 set uid_t uidtype xxx stdio.h sys/types.h
19405 xxx=`./findhdr sys/user.h`
19406 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19408 unsigned) dflt="$1 $2" ;;
19412 *) dflt="$uidtype";;
19415 uid_t) echo "uid_t found." ;;
19416 *) rp="What is the type for user ids returned by getuid()?"
19424 *_t) zzz="$uidtype" ;;
19427 echo "Checking the size of $zzz..." >&4
19429 #include <sys/types.h>
19431 #$i_stdlib I_STDLIB
19433 #include <stdlib.h>
19436 printf("%d\n", (int)sizeof($uidtype));
19441 if eval $compile_ok; then
19445 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19448 echo "Your $zzz is $uidsize bytes long."
19453 echo "(I can't compile the test program--guessing $uidsize.)" >&4
19458 *_t) zzz="$uidtype" ;;
19461 echo "Checking the sign of $zzz..." >&4
19463 #include <sys/types.h>
19474 if eval $compile; then
19478 echo "(I can't execute the test program--guessing unsigned.)" >&4
19482 1) echo "Your $zzz is unsigned." ;;
19483 -1) echo "Your $zzz is signed." ;;
19489 echo "(I can't compile the test program--guessing unsigned.)" >&4
19495 $echo "Checking the format string to be used for uids..." >&4
19498 -1) if $test X"$uidsize" = X"$ivsize"; then
19499 uidformat="$ivdformat"
19501 if $test X"$uidsize" = X"$longsize"; then
19504 if $test X"$uidsize" = X"$intsize"; then
19507 if $test X"$uidsize" = X"$shortsize"; then
19514 *) if $test X"$uidsize" = X"$uvsize"; then
19515 uidformat="$uvuformat"
19517 if $test X"$uidsize" = X"$longsize"; then
19520 if $test X"$uidsize" = X"$intsize"; then
19523 if $test X"$uidsize" = X"$shortsize"; then
19532 : determine compiler compiler
19541 if $test -f "$byacc$_exe"; then
19543 comp="byacc or $comp"
19545 if $test -f "$bison$_exe"; then
19546 comp="$comp or bison -y"
19548 rp="Which compiler compiler ($comp) shall I use?"
19557 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
19563 : see if this is a fp.h system
19567 : see if this is a fp_class.h system
19568 set fp_class.h i_fp_class
19571 : see if this is a ieeefp.h system
19572 case "$i_ieeefp" in
19573 '' ) set ieeefp.h i_ieeefp
19578 : see if this is a libutil.h system
19579 set libutil.h i_libutil
19582 : see if mach cthreads are available
19583 if test "X$usethreads" = "X$define"; then
19584 set mach/cthreads.h i_machcthr
19587 i_machcthr="$undef"
19592 : see if this is a mntent.h system
19593 set mntent.h i_mntent
19596 : see if ndbm.h is available
19602 # Some Linux distributions such as RedHat 7.1 put the
19603 # ndbm.h header in /usr/include/gdbm/ndbm.h.
19604 if $test -f /usr/include/gdbm/ndbm.h; then
19605 echo '<gdbm/ndbm.h> found.'
19606 ccflags="$ccflags -I/usr/include/gdbm"
19607 cppflags="$cppflags -I/usr/include/gdbm"
19615 : see if dbm_open exists
19616 set dbm_open d_dbm_open
19618 case "$d_dbm_open" in
19621 echo "We won't be including <ndbm.h>"
19630 : see if net/errno.h is available
19632 set net/errno.h val
19635 : Unfortunately, it causes problems on some systems. Arrgh.
19638 cat > try.c <<'EOM'
19641 #include <net/errno.h>
19647 if $cc $ccflags -c try.c >/dev/null 2>&1; then
19648 echo "We'll be including <net/errno.h>." >&4
19650 echo "We won't be including <net/errno.h>." >&4
19659 : see if netinet/tcp.h is available
19660 set netinet/tcp.h i_netinettcp
19663 : see if this is a poll.h system
19667 : see if this is a prot.h system
19672 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
19673 $cat <<'EOSH' > Cppsym.know
19674 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
19675 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
19676 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
19677 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
19678 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
19679 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
19680 bull c cadmus clipper CMU COFF COMPILER_VERSION
19681 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
19682 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
19683 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
19684 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
19686 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
19687 H3050R H3050RX hbullx20 hcx host_mips
19688 hp200 hp300 hp700 HP700 hp800 hp9000
19689 hp9000s200 hp9000s300 hp9000s400 hp9000s500
19690 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
19691 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
19692 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
19693 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
19694 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
19695 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
19696 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
19697 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
19698 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
19699 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
19700 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
19701 MATH_HAS_NO_SIDE_EFFECTS
19702 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
19703 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
19704 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
19705 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
19706 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
19707 NetBSD news1500 news1700 news1800 news1900 news3700
19708 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
19709 ns32016 ns32332 ns32k nsc32000
19710 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
19711 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
19712 pc532 pdp11 PGC PIC plexus PORTAR posix
19713 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
19714 POSIX_C_SOURCE POSIX_SOURCE POWER
19715 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
19716 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
19717 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
19718 sony sony_news sonyrisc sparc sparclite spectrum
19719 stardent stdc STDC_EXT stratos sun sun3 sun386
19720 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
19721 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
19722 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
19723 sysV68 sysV88 Tek4132 Tek4300 titan
19724 TM3200 TM5400 TM5600
19725 tower tower32 tower32_200 tower32_600 tower32_700
19726 tower32_800 tower32_850 tss
19727 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
19728 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
19729 unix UNIX95 UNIX99 unixpc unos
19730 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
19731 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
19732 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
19734 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
19735 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
19736 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
19739 # Maybe put other stuff here too.
19740 cat <<EOSH >>Cppsym.know
19743 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
19744 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
19745 $cat Cppsym.know > Cppsym.c
19746 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
19747 $rm -f Cppsym.a Cppsym.b Cppsym.c
19748 cat <<EOSH > Cppsym
19750 if $test \$# -gt 0; then
19751 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
19752 if $test -s Cppsym.got; then
19759 $tr " " "$trnl" | ./Cppsym.try
19765 cat <<EOSH > Cppsym.try
19767 cat <<'EOCP' > try.c
19773 cat <<'EOSH' >> Cppsym.try
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
19777 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 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
19780 echo 'return 0;}' >> try.c
19782 cat <<EOSH >> Cppsym.try
19784 case "$osname-$gccversion" in
19785 irix-) ccflags="\$ccflags -woff 1178" ;;
19786 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
19788 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
19790 chmod +x Cppsym.try
19791 $eunicefix Cppsym.try
19792 ./Cppsym < Cppsym.know > Cppsym.true
19793 : now check the C compiler for additional symbols
19794 postprocess_cc_v=''
19796 aix) postprocess_cc_v="|$tr , ' '" ;;
19803 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
19806 -D*) echo "\$i" | $sed 's/^-D//';;
19807 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
19812 postprocess_cc_v=''
19815 ./ccsym > ccsym1.raw
19816 if $test -s ccsym1.raw; then
19817 $sort ccsym1.raw | $uniq >ccsym.raw
19819 mv ccsym1.raw ccsym.raw
19822 $awk '/\=/ { print $0; next }
19823 { print $0"=1" }' ccsym.raw >ccsym.list
19824 $awk '/\=/ { print $0; next }
19825 { print $0"=1" }' Cppsym.true >ccsym.true
19826 $comm -13 ccsym.true ccsym.list >ccsym.own
19827 $comm -12 ccsym.true ccsym.list >ccsym.com
19828 $comm -23 ccsym.true ccsym.list >ccsym.cpp
19830 if $test -z ccsym.raw; then
19831 echo "Your C compiler doesn't seem to define any symbols!" >&4
19833 echo "However, your C preprocessor defines the following symbols:"
19836 cppsymbols=`$cat Cppsym.true`
19837 cppsymbols=`echo $cppsymbols`
19838 cppccsymbols="$cppsymbols"
19840 if $test -s ccsym.com; then
19841 echo "Your C compiler and pre-processor define these symbols:"
19842 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
19845 cppccsymbols=`$cat ccsym.com`
19846 cppccsymbols=`echo $cppccsymbols`
19847 $test "$silent" || sleep 1
19849 if $test -s ccsym.cpp; then
19850 $test "$also" && echo " "
19851 echo "Your C pre-processor ${also}defines the following symbols:"
19852 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
19854 cppsymbols=`$cat ccsym.cpp`
19855 cppsymbols=`echo $cppsymbols`
19856 $test "$silent" || sleep 1
19858 if $test -s ccsym.own; then
19859 $test "$also" && echo " "
19860 echo "Your C compiler ${also}defines the following cpp symbols:"
19861 $sed -e 's/\(..*\)=1/\1/' ccsym.own
19862 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
19863 ccsymbols=`$cat ccsym.own`
19864 ccsymbols=`echo $ccsymbols`
19865 $test "$silent" || sleep 1
19869 : see if this is a termio system
19873 if $test `./findhdr termios.h`; then
19874 set tcsetattr i_termios
19880 "$define") echo "You have POSIX termios.h... good!" >&4;;
19881 *) if ./Cppsym pyr; then
19882 case "`/bin/universe`" in
19883 ucb) if $test `./findhdr sgtty.h`; then
19885 echo "<sgtty.h> found." >&4
19887 echo "System is pyramid with BSD universe."
19888 echo "<sgtty.h> not found--you could have problems." >&4
19890 *) if $test `./findhdr termio.h`; then
19892 echo "<termio.h> found." >&4
19894 echo "System is pyramid with USG universe."
19895 echo "<termio.h> not found--you could have problems." >&4
19899 if $test `./findhdr termio.h`; then
19900 echo "<termio.h> found." >&4
19902 elif $test `./findhdr sgtty.h`; then
19903 echo "<sgtty.h> found." >&4
19906 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
19909 if $test `./findhdr sgtty.h`; then
19910 echo "<sgtty.h> found." >&4
19912 elif $test `./findhdr termio.h`; then
19913 echo "<termio.h> found." >&4
19916 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
19920 set i_termio; eval $setvar
19921 val=$val2; set i_sgtty; eval $setvar
19922 val=$val3; set i_termios; eval $setvar
19924 : see if stddef is available
19925 set stddef.h i_stddef
19928 : see if this is a sunmath.h system
19929 set sunmath.h i_sunmath
19932 : see if sys/access.h is available
19933 set sys/access.h i_sysaccess
19936 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
19937 set sys/filio.h i_sysfilio
19940 if $test `./findhdr sys/ioctl.h`; then
19942 echo '<sys/ioctl.h> found.' >&4
19945 if $test $i_sysfilio = "$define"; then
19946 echo '<sys/ioctl.h> NOT found.' >&4
19948 $test $i_sgtty = "$define" && xxx="sgtty.h"
19949 $test $i_termio = "$define" && xxx="termio.h"
19950 $test $i_termios = "$define" && xxx="termios.h"
19951 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
19957 : see if socket ioctl defs are in sys/sockio.h
19959 xxx=`./findhdr sys/sockio.h`
19960 if $test "$xxx"; then
19961 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
19963 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
19966 echo "No socket ioctls found in <sys/sockio.h>." >&4
19971 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
19978 : see if this is a syslog.h system
19979 set syslog.h i_syslog
19983 : see if this is a sys/mode.h system
19984 set sys/mode.h i_sysmode
19987 : see if sys/resource.h has to be included
19988 set sys/resource.h i_sysresrc
19991 : see if sys/security.h is available
19992 set sys/security.h i_syssecrt
19995 : see if this is a sys/statvfs.h system
19996 set sys/statvfs.h i_sysstatvfs
19999 : see if this is a sys/un.h system
20000 set sys/un.h i_sysun
20004 : see if this is a sys/utsname.h system
20005 set sys/utsname.h i_sysutsname
20008 : see if this is a syswait system
20009 set sys/wait.h i_syswait
20012 : see if this is a ustat.h system
20013 set ustat.h i_ustat
20016 : see if this is an utime system
20017 set utime.h i_utime
20020 : see if this is a values.h system
20021 set values.h i_values
20024 : see if this is a vfork system
20027 set vfork.h i_vfork
20035 : see if gdbm.h is available
20040 : see if gdbm_open exists
20041 set gdbm_open d_gdbm_open
20043 case "$d_gdbm_open" in
20046 echo "We won't be including <gdbm.h>"
20056 echo "Looking for extensions..." >&4
20057 : If we are using the old config.sh, known_extensions may contain
20058 : old or inaccurate or duplicate values.
20059 known_extensions=''
20060 nonxs_extensions=''
20061 : We do not use find because it might not be available.
20062 : We do not just use MANIFEST because the user may have dropped
20063 : some additional extensions into the source tree and expect them
20066 : Function to recursively find available extensions, ignoring DynaLoader
20067 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20071 DynaLoader|dynaload) ;;
20073 if $test -f $xxx/$xxx.xs; then
20074 known_extensions="$known_extensions $1$xxx";
20075 elif $test -f $xxx/Makefile.PL; then
20076 nonxs_extensions="$nonxs_extensions $1$xxx";
20078 if $test -d $xxx -a $# -lt 10; then
20081 eval $find_extensions;
20093 eval $find_extensions
20094 # Special case: Add in threads/shared since it is not picked up by the
20095 # recursive find above (and adding in general recursive finding breaks
20096 # SDBM_File/sdbm). A.D. 10/25/2001.
20097 known_extensions="$known_extensions threads/shared"
20098 set X $nonxs_extensions
20100 nonxs_extensions="$*"
20101 set X $known_extensions
20103 known_extensions="$*"
20106 : Now see which are supported on this system.
20108 for xxx in $known_extensions ; do
20112 $define) avail_ext="$avail_ext $xxx" ;;
20115 GDBM_File|gdbm_fil)
20117 $define) avail_ext="$avail_ext $xxx" ;;
20120 I18N/Langinfo|i18n_lan)
20121 case "$i_langinfo$d_nl_langinfo" in
20122 $define$define) avail_ext="$avail_ext $xxx" ;;
20125 NDBM_File|ndbm_fil)
20128 case "$osname-$use64bitint" in
20131 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20134 *) avail_ext="$avail_ext $xxx" ;;
20139 ODBM_File|odbm_fil)
20140 case "${i_dbm}${i_rpcsvcdbm}" in
20142 case "$osname-$use64bitint" in
20145 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20148 *) avail_ext="$avail_ext $xxx" ;;
20154 case "$useposix" in
20155 true|define|y) avail_ext="$avail_ext $xxx" ;;
20159 case "$useopcode" in
20160 true|define|y) avail_ext="$avail_ext $xxx" ;;
20164 case "$d_socket" in
20167 beos) ;; # not unless BONE
20168 *) avail_ext="$avail_ext $xxx" ;;
20173 Sys/Syslog|sys/syslog)
20174 : XXX syslog requires socket
20175 case "$d_socket" in
20176 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20180 case "$usethreads" in
20182 case "$useithreads" in
20183 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20187 XS/APItest|xs/apitest)
20188 # This is just for testing. Skip it unless we have dynamic loading.
20191 $define) avail_ext="$avail_ext $xxx" ;;
20194 XS/Typemap|xs/typemap)
20195 # This is just for testing. Skip it unless we have dynamic loading.
20197 $define) avail_ext="$avail_ext $xxx" ;;
20200 threads|threads/shared)
20201 # threads and threads::shared are special cases.
20202 # To stop people from asking "Perl 5.8.0 was supposed
20203 # to have this new fancy threads implementation but my
20204 # perl doesn't have it" and from people trying to
20205 # (re)install the threads module using CPAN.pm and
20206 # CPAN.pm then offering to reinstall Perl 5.8.0,
20207 # the threads.pm and threads/shared.pm will always be
20208 # there, croaking informatively ("you need to rebuild
20209 # all of Perl with threads, sorry") when threads haven't
20210 # been compiled in.
20212 avail_ext="$avail_ext $xxx"
20215 : XXX Do we need a useipcsysv variable here
20216 case "${d_msg}${d_sem}${d_shm}" in
20217 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20220 *) avail_ext="$avail_ext $xxx"
20229 case "$onlyextensions" in
20231 *) keepextensions=''
20232 echo "You have requested that only certains extensions be included..." >&4
20233 for i in $onlyextensions; do
20234 case " $avail_ext " in
20236 echo "Keeping extension $i."
20237 keepextensions="$keepextensions $i"
20239 *) echo "Ignoring extension $i." ;;
20242 avail_ext="$keepextensions"
20246 case "$noextensions" in
20248 *) keepextensions=''
20249 echo "You have requested that certain extensions be ignored..." >&4
20250 for i in $avail_ext; do
20251 case " $noextensions " in
20252 *" $i "*) echo "Ignoring extension $i." ;;
20253 *) echo "Keeping extension $i.";
20254 keepextensions="$keepextensions $i"
20258 avail_ext="$keepextensions"
20262 : Now see which nonxs extensions are supported on this system.
20263 : For now assume all are.
20265 for xxx in $nonxs_extensions ; do
20267 *) nonxs_ext="$nonxs_ext $xxx"
20279 A number of extensions are supplied with $package. You may choose to
20280 compile these extensions for dynamic loading (the default), compile
20281 them into the $package executable (static loading), or not include
20282 them at all. Answer "none" to include no extensions.
20283 Note that DynaLoader is always built and need not be mentioned here.
20286 case "$dynamic_ext" in
20288 : Exclude those listed in static_ext
20290 for xxx in $avail_ext; do
20291 case " $static_ext " in
20293 *) dflt="$dflt $xxx" ;;
20300 *) dflt="$dynamic_ext"
20301 # Perhaps we are reusing an old out-of-date config.sh.
20304 if test X"$dynamic_ext" != X"$avail_ext"; then
20306 NOTICE: Your previous config.sh list may be incorrect.
20307 The extensions now available to you are
20309 but the default list from your previous config.sh is
20321 rp="What extensions do you wish to load dynamically?"
20324 none) dynamic_ext=' ' ;;
20325 *) dynamic_ext="$ans" ;;
20328 case "$static_ext" in
20330 : Exclude those already listed in dynamic linking
20332 for xxx in $avail_ext; do
20333 case " $dynamic_ext " in
20335 *) dflt="$dflt $xxx" ;;
20342 *) dflt="$static_ext"
20349 rp="What extensions do you wish to load statically?"
20352 none) static_ext=' ' ;;
20353 *) static_ext="$ans" ;;
20358 A number of extensions are supplied with $package. Answer "none"
20359 to include no extensions.
20360 Note that DynaLoader is always built and need not be mentioned here.
20363 case "$static_ext" in
20364 '') dflt="$avail_ext" ;;
20365 *) dflt="$static_ext"
20366 # Perhaps we are reusing an old out-of-date config.sh.
20369 if test X"$static_ext" != X"$avail_ext"; then
20371 NOTICE: Your previous config.sh list may be incorrect.
20372 The extensions now available to you are
20374 but the default list from your previous config.sh is
20383 : Exclude those that are not xs extensions
20387 rp="What extensions do you wish to include?"
20390 none) static_ext=' ' ;;
20391 *) static_ext="$ans" ;;
20396 # Encode is a special case. If we are building Encode as a static
20397 # extension, we need to explicitly list its subextensions as well.
20398 # For other nested extensions, this is handled automatically by
20399 # the appropriate Makefile.PL.
20400 case " $static_ext " in
20401 *" Encode "*) # Add the subextensions of Encode
20403 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20404 static_ext="$static_ext Encode/$xxx"
20410 set X $dynamic_ext $static_ext $nonxs_ext
20414 # Sanity check: We require an extension suitable for use with
20415 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
20416 # should show up as failures in the test suite, but it's helpful to
20417 # catch them now.) The 'extensions' list is normally sorted
20418 # alphabetically, so we need to accept either
20419 # DB_File ... Fcntl ... IO ....
20420 # or something like
20421 # Fcntl ... NDBM_File ... IO ....
20422 case " $extensions" in
20423 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
20424 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
20425 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
20426 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
20427 echo "WARNING: The Perl you are building will be quite crippled." >& 4
20431 : Remove libraries needed only for extensions
20432 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
20433 : The exception is SunOS 4.x, which needs them.
20434 case "${osname}X${osvers}" in
20438 *) case "$usedl" in
20439 $define|true|[yY]*)
20440 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
20444 *) perllibs="$libs"
20450 : Remove build directory name from cppstdin so it can be used from
20451 : either the present location or the final installed location.
20453 : Get out of the UU directory to get correct path name.
20455 case "$cppstdin" in
20457 echo "Stripping down cppstdin path name"
20463 : end of configuration questions
20465 echo "End of configuration questions."
20468 : back to where it started
20469 if test -d ../UU; then
20473 : configuration may be patched via a 'config.arch' file
20474 if $test -f config.arch; then
20475 echo "I see a config.arch file, loading it."
20479 : configuration may be patched via a 'config.over' file
20480 if $test -f config.over; then
20483 rp='I see a config.over file. Do you wish to load it?'
20486 n*) echo "OK, I'll ignore it.";;
20488 echo "Configuration override changes have been loaded."
20493 : in case they want portability, strip down executable paths
20494 case "$d_portable" in
20497 echo "Stripping down executable paths..." >&4
20498 for file in $loclist $trylist; do
20500 eval $file=`basename $temp`
20505 : create config.sh file
20507 echo "Creating config.sh..." >&4
20508 $spitshell <<EOT >config.sh
20511 # This file was produced by running the Configure script. It holds all the
20512 # definitions figured out by Configure. Should you modify one of these values,
20513 # do not forget to propagate your changes by running "Configure -der". You may
20514 # instead choose to run each of the .SH files by yourself, or "Configure -S".
20517 # Package name : $package
20518 # Source directory : $src
20519 # Configuration time: $cf_time
20520 # Configured by : $cf_by
20521 # Target system : $myuname
20531 Revision='$Revision'
20539 alignbytes='$alignbytes'
20540 ansi2knr='$ansi2knr'
20541 aphostname='$aphostname'
20542 api_revision='$api_revision'
20543 api_subversion='$api_subversion'
20544 api_version='$api_version'
20545 api_versionstring='$api_versionstring'
20548 archlibexp='$archlibexp'
20549 archname64='$archname64'
20550 archname='$archname'
20551 archobjs='$archobjs'
20552 asctime_r_proto='$asctime_r_proto'
20560 byteorder='$byteorder'
20562 castflags='$castflags'
20565 cccdlflags='$cccdlflags'
20566 ccdlflags='$ccdlflags'
20568 ccflags_uselargefiles='$ccflags_uselargefiles'
20570 ccsymbols='$ccsymbols'
20571 ccversion='$ccversion'
20573 cf_email='$cf_email'
20575 charsize='$charsize'
20579 clocktype='$clocktype'
20581 compress='$compress'
20582 contains='$contains'
20586 cpp_stuff='$cpp_stuff'
20587 cppccsymbols='$cppccsymbols'
20588 cppflags='$cppflags'
20590 cppminus='$cppminus'
20592 cppstdin='$cppstdin'
20593 cppsymbols='$cppsymbols'
20594 crypt_r_proto='$crypt_r_proto'
20595 cryptlib='$cryptlib'
20597 ctermid_r_proto='$ctermid_r_proto'
20598 ctime_r_proto='$ctime_r_proto'
20599 d_Gconvert='$d_Gconvert'
20600 d_PRIEUldbl='$d_PRIEUldbl'
20601 d_PRIFUldbl='$d_PRIFUldbl'
20602 d_PRIGUldbl='$d_PRIGUldbl'
20603 d_PRIXU64='$d_PRIXU64'
20604 d_PRId64='$d_PRId64'
20605 d_PRIeldbl='$d_PRIeldbl'
20606 d_PRIfldbl='$d_PRIfldbl'
20607 d_PRIgldbl='$d_PRIgldbl'
20608 d_PRIi64='$d_PRIi64'
20609 d_PRIo64='$d_PRIo64'
20610 d_PRIu64='$d_PRIu64'
20611 d_PRIx64='$d_PRIx64'
20612 d_SCNfldbl='$d_SCNfldbl'
20613 d__fwalk='$d__fwalk'
20614 d_access='$d_access'
20615 d_accessx='$d_accessx'
20618 d_archlib='$d_archlib'
20619 d_asctime_r='$d_asctime_r'
20622 d_attribut='$d_attribut'
20626 d_bsdgetpgrp='$d_bsdgetpgrp'
20627 d_bsdsetpgrp='$d_bsdsetpgrp'
20629 d_casti32='$d_casti32'
20630 d_castneg='$d_castneg'
20631 d_charvspr='$d_charvspr'
20633 d_chroot='$d_chroot'
20634 d_chsize='$d_chsize'
20636 d_closedir='$d_closedir'
20637 d_cmsghdr_s='$d_cmsghdr_s'
20639 d_copysignl='$d_copysignl'
20641 d_crypt_r='$d_crypt_r'
20643 d_ctermid_r='$d_ctermid_r'
20644 d_ctime_r='$d_ctime_r'
20645 d_cuserid='$d_cuserid'
20646 d_dbl_dig='$d_dbl_dig'
20647 d_dbminitproto='$d_dbminitproto'
20648 d_difftime='$d_difftime'
20650 d_dirnamlen='$d_dirnamlen'
20651 d_dlerror='$d_dlerror'
20652 d_dlopen='$d_dlopen'
20653 d_dlsymun='$d_dlsymun'
20654 d_dosuid='$d_dosuid'
20655 d_drand48_r='$d_drand48_r'
20656 d_drand48proto='$d_drand48proto'
20658 d_eaccess='$d_eaccess'
20659 d_endgrent='$d_endgrent'
20660 d_endgrent_r='$d_endgrent_r'
20661 d_endhent='$d_endhent'
20662 d_endhostent_r='$d_endhostent_r'
20663 d_endnent='$d_endnent'
20664 d_endnetent_r='$d_endnetent_r'
20665 d_endpent='$d_endpent'
20666 d_endprotoent_r='$d_endprotoent_r'
20667 d_endpwent='$d_endpwent'
20668 d_endpwent_r='$d_endpwent_r'
20669 d_endsent='$d_endsent'
20670 d_endservent_r='$d_endservent_r'
20671 d_eofnblk='$d_eofnblk'
20672 d_eunice='$d_eunice'
20673 d_faststdio='$d_faststdio'
20674 d_fchdir='$d_fchdir'
20675 d_fchmod='$d_fchmod'
20676 d_fchown='$d_fchown'
20678 d_fcntl_can_lock='$d_fcntl_can_lock'
20679 d_fd_macros='$d_fd_macros'
20680 d_fd_set='$d_fd_set'
20681 d_fds_bits='$d_fds_bits'
20682 d_fgetpos='$d_fgetpos'
20683 d_finite='$d_finite'
20684 d_finitel='$d_finitel'
20685 d_flexfnam='$d_flexfnam'
20687 d_flockproto='$d_flockproto'
20689 d_fp_class='$d_fp_class'
20690 d_fpathconf='$d_fpathconf'
20691 d_fpclass='$d_fpclass'
20692 d_fpclassify='$d_fpclassify'
20693 d_fpclassl='$d_fpclassl'
20694 d_fpos64_t='$d_fpos64_t'
20695 d_frexpl='$d_frexpl'
20696 d_fs_data_s='$d_fs_data_s'
20697 d_fseeko='$d_fseeko'
20698 d_fsetpos='$d_fsetpos'
20699 d_fstatfs='$d_fstatfs'
20700 d_fstatvfs='$d_fstatvfs'
20702 d_ftello='$d_ftello'
20704 d_getcwd='$d_getcwd'
20705 d_getespwnam='$d_getespwnam'
20706 d_getfsstat='$d_getfsstat'
20707 d_getgrent='$d_getgrent'
20708 d_getgrent_r='$d_getgrent_r'
20709 d_getgrgid_r='$d_getgrgid_r'
20710 d_getgrnam_r='$d_getgrnam_r'
20711 d_getgrps='$d_getgrps'
20712 d_gethbyaddr='$d_gethbyaddr'
20713 d_gethbyname='$d_gethbyname'
20714 d_gethent='$d_gethent'
20715 d_gethname='$d_gethname'
20716 d_gethostbyaddr_r='$d_gethostbyaddr_r'
20717 d_gethostbyname_r='$d_gethostbyname_r'
20718 d_gethostent_r='$d_gethostent_r'
20719 d_gethostprotos='$d_gethostprotos'
20720 d_getitimer='$d_getitimer'
20721 d_getlogin='$d_getlogin'
20722 d_getlogin_r='$d_getlogin_r'
20723 d_getmnt='$d_getmnt'
20724 d_getmntent='$d_getmntent'
20725 d_getnbyaddr='$d_getnbyaddr'
20726 d_getnbyname='$d_getnbyname'
20727 d_getnent='$d_getnent'
20728 d_getnetbyaddr_r='$d_getnetbyaddr_r'
20729 d_getnetbyname_r='$d_getnetbyname_r'
20730 d_getnetent_r='$d_getnetent_r'
20731 d_getnetprotos='$d_getnetprotos'
20732 d_getpagsz='$d_getpagsz'
20733 d_getpbyname='$d_getpbyname'
20734 d_getpbynumber='$d_getpbynumber'
20735 d_getpent='$d_getpent'
20736 d_getpgid='$d_getpgid'
20737 d_getpgrp2='$d_getpgrp2'
20738 d_getpgrp='$d_getpgrp'
20739 d_getppid='$d_getppid'
20740 d_getprior='$d_getprior'
20741 d_getprotobyname_r='$d_getprotobyname_r'
20742 d_getprotobynumber_r='$d_getprotobynumber_r'
20743 d_getprotoent_r='$d_getprotoent_r'
20744 d_getprotoprotos='$d_getprotoprotos'
20745 d_getprpwnam='$d_getprpwnam'
20746 d_getpwent='$d_getpwent'
20747 d_getpwent_r='$d_getpwent_r'
20748 d_getpwnam_r='$d_getpwnam_r'
20749 d_getpwuid_r='$d_getpwuid_r'
20750 d_getsbyname='$d_getsbyname'
20751 d_getsbyport='$d_getsbyport'
20752 d_getsent='$d_getsent'
20753 d_getservbyname_r='$d_getservbyname_r'
20754 d_getservbyport_r='$d_getservbyport_r'
20755 d_getservent_r='$d_getservent_r'
20756 d_getservprotos='$d_getservprotos'
20757 d_getspnam='$d_getspnam'
20758 d_getspnam_r='$d_getspnam_r'
20759 d_gettimeod='$d_gettimeod'
20760 d_gmtime_r='$d_gmtime_r'
20761 d_gnulibc='$d_gnulibc'
20762 d_grpasswd='$d_grpasswd'
20763 d_hasmntopt='$d_hasmntopt'
20765 d_ilogbl='$d_ilogbl'
20767 d_inetaton='$d_inetaton'
20768 d_int64_t='$d_int64_t'
20769 d_isascii='$d_isascii'
20770 d_isfinite='$d_isfinite'
20773 d_isnanl='$d_isnanl'
20774 d_killpg='$d_killpg'
20775 d_lchown='$d_lchown'
20776 d_ldbl_dig='$d_ldbl_dig'
20777 d_libm_lib_version='$d_libm_lib_version'
20779 d_localtime_r='$d_localtime_r'
20780 d_locconv='$d_locconv'
20782 d_longdbl='$d_longdbl'
20783 d_longlong='$d_longlong'
20784 d_lseekproto='$d_lseekproto'
20786 d_madvise='$d_madvise'
20788 d_mbstowcs='$d_mbstowcs'
20789 d_mbtowc='$d_mbtowc'
20790 d_memchr='$d_memchr'
20791 d_memcmp='$d_memcmp'
20792 d_memcpy='$d_memcpy'
20793 d_memmove='$d_memmove'
20794 d_memset='$d_memset'
20796 d_mkdtemp='$d_mkdtemp'
20797 d_mkfifo='$d_mkfifo'
20798 d_mkstemp='$d_mkstemp'
20799 d_mkstemps='$d_mkstemps'
20800 d_mktime='$d_mktime'
20803 d_modfl_pow32_bug='$d_modfl_pow32_bug'
20804 d_modflproto='$d_modflproto'
20805 d_mprotect='$d_mprotect'
20807 d_msg_ctrunc='$d_msg_ctrunc'
20808 d_msg_dontroute='$d_msg_dontroute'
20809 d_msg_oob='$d_msg_oob'
20810 d_msg_peek='$d_msg_peek'
20811 d_msg_proxy='$d_msg_proxy'
20812 d_msgctl='$d_msgctl'
20813 d_msgget='$d_msgget'
20814 d_msghdr_s='$d_msghdr_s'
20815 d_msgrcv='$d_msgrcv'
20816 d_msgsnd='$d_msgsnd'
20818 d_munmap='$d_munmap'
20819 d_mymalloc='$d_mymalloc'
20821 d_nl_langinfo='$d_nl_langinfo'
20822 d_nv_preserves_uv='$d_nv_preserves_uv'
20823 d_off64_t='$d_off64_t'
20824 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
20825 d_oldpthreads='$d_oldpthreads'
20826 d_oldsock='$d_oldsock'
20828 d_pathconf='$d_pathconf'
20830 d_perl_otherlibdirs='$d_perl_otherlibdirs'
20831 d_phostname='$d_phostname'
20834 d_portable='$d_portable'
20835 d_procselfexe='$d_procselfexe'
20836 d_pthread_atfork='$d_pthread_atfork'
20837 d_pthread_attr_setscope='$d_pthread_attr_setscope'
20838 d_pthread_yield='$d_pthread_yield'
20840 d_pwchange='$d_pwchange'
20841 d_pwclass='$d_pwclass'
20842 d_pwcomment='$d_pwcomment'
20843 d_pwexpire='$d_pwexpire'
20844 d_pwgecos='$d_pwgecos'
20845 d_pwpasswd='$d_pwpasswd'
20846 d_pwquota='$d_pwquota'
20849 d_random_r='$d_random_r'
20850 d_readdir64_r='$d_readdir64_r'
20851 d_readdir='$d_readdir'
20852 d_readdir_r='$d_readdir_r'
20853 d_readlink='$d_readlink'
20855 d_recvmsg='$d_recvmsg'
20856 d_rename='$d_rename'
20857 d_rewinddir='$d_rewinddir'
20859 d_safebcpy='$d_safebcpy'
20860 d_safemcpy='$d_safemcpy'
20861 d_sanemcmp='$d_sanemcmp'
20862 d_sbrkproto='$d_sbrkproto'
20863 d_scalbnl='$d_scalbnl'
20864 d_sched_yield='$d_sched_yield'
20865 d_scm_rights='$d_scm_rights'
20866 d_seekdir='$d_seekdir'
20867 d_select='$d_select'
20869 d_semctl='$d_semctl'
20870 d_semctl_semid_ds='$d_semctl_semid_ds'
20871 d_semctl_semun='$d_semctl_semun'
20872 d_semget='$d_semget'
20874 d_sendmsg='$d_sendmsg'
20875 d_setegid='$d_setegid'
20876 d_seteuid='$d_seteuid'
20877 d_setgrent='$d_setgrent'
20878 d_setgrent_r='$d_setgrent_r'
20879 d_setgrps='$d_setgrps'
20880 d_sethent='$d_sethent'
20881 d_sethostent_r='$d_sethostent_r'
20882 d_setitimer='$d_setitimer'
20883 d_setlinebuf='$d_setlinebuf'
20884 d_setlocale='$d_setlocale'
20885 d_setlocale_r='$d_setlocale_r'
20886 d_setnent='$d_setnent'
20887 d_setnetent_r='$d_setnetent_r'
20888 d_setpent='$d_setpent'
20889 d_setpgid='$d_setpgid'
20890 d_setpgrp2='$d_setpgrp2'
20891 d_setpgrp='$d_setpgrp'
20892 d_setprior='$d_setprior'
20893 d_setproctitle='$d_setproctitle'
20894 d_setprotoent_r='$d_setprotoent_r'
20895 d_setpwent='$d_setpwent'
20896 d_setpwent_r='$d_setpwent_r'
20897 d_setregid='$d_setregid'
20898 d_setresgid='$d_setresgid'
20899 d_setresuid='$d_setresuid'
20900 d_setreuid='$d_setreuid'
20901 d_setrgid='$d_setrgid'
20902 d_setruid='$d_setruid'
20903 d_setsent='$d_setsent'
20904 d_setservent_r='$d_setservent_r'
20905 d_setsid='$d_setsid'
20906 d_setvbuf='$d_setvbuf'
20910 d_shmatprototype='$d_shmatprototype'
20911 d_shmctl='$d_shmctl'
20913 d_shmget='$d_shmget'
20914 d_sigaction='$d_sigaction'
20915 d_sigprocmask='$d_sigprocmask'
20916 d_sigsetjmp='$d_sigsetjmp'
20917 d_sitecustomize='$d_sitecustomize'
20918 d_sockatmark='$d_sockatmark'
20919 d_sockatmarkproto='$d_sockatmarkproto'
20920 d_socket='$d_socket'
20921 d_socklen_t='$d_socklen_t'
20922 d_sockpair='$d_sockpair'
20923 d_socks5_init='$d_socks5_init'
20925 d_srand48_r='$d_srand48_r'
20926 d_srandom_r='$d_srandom_r'
20927 d_sresgproto='$d_sresgproto'
20928 d_sresuproto='$d_sresuproto'
20929 d_statblks='$d_statblks'
20930 d_statfs_f_flags='$d_statfs_f_flags'
20931 d_statfs_s='$d_statfs_s'
20932 d_statvfs='$d_statvfs'
20933 d_stdio_cnt_lval='$d_stdio_cnt_lval'
20934 d_stdio_ptr_lval='$d_stdio_ptr_lval'
20935 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
20936 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
20937 d_stdio_stream_array='$d_stdio_stream_array'
20938 d_stdiobase='$d_stdiobase'
20939 d_stdstdio='$d_stdstdio'
20940 d_strchr='$d_strchr'
20941 d_strcoll='$d_strcoll'
20942 d_strctcpy='$d_strctcpy'
20943 d_strerrm='$d_strerrm'
20944 d_strerror='$d_strerror'
20945 d_strerror_r='$d_strerror_r'
20946 d_strftime='$d_strftime'
20947 d_strlcat='$d_strlcat'
20948 d_strlcpy='$d_strlcpy'
20949 d_strtod='$d_strtod'
20950 d_strtol='$d_strtol'
20951 d_strtold='$d_strtold'
20952 d_strtoll='$d_strtoll'
20953 d_strtoq='$d_strtoq'
20954 d_strtoul='$d_strtoul'
20955 d_strtoull='$d_strtoull'
20956 d_strtouq='$d_strtouq'
20957 d_strxfrm='$d_strxfrm'
20958 d_suidsafe='$d_suidsafe'
20959 d_symlink='$d_symlink'
20960 d_syscall='$d_syscall'
20961 d_syscallproto='$d_syscallproto'
20962 d_sysconf='$d_sysconf'
20963 d_sysernlst='$d_sysernlst'
20964 d_syserrlst='$d_syserrlst'
20965 d_system='$d_system'
20966 d_tcgetpgrp='$d_tcgetpgrp'
20967 d_tcsetpgrp='$d_tcsetpgrp'
20968 d_telldir='$d_telldir'
20969 d_telldirproto='$d_telldirproto'
20972 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
20973 d_tm_tm_zone='$d_tm_tm_zone'
20974 d_tmpnam_r='$d_tmpnam_r'
20975 d_truncate='$d_truncate'
20976 d_ttyname_r='$d_ttyname_r'
20977 d_tzname='$d_tzname'
20978 d_u32align='$d_u32align'
20979 d_ualarm='$d_ualarm'
20982 d_union_semun='$d_union_semun'
20983 d_unordered='$d_unordered'
20984 d_usleep='$d_usleep'
20985 d_usleepproto='$d_usleepproto'
20987 d_vendorarch='$d_vendorarch'
20988 d_vendorbin='$d_vendorbin'
20989 d_vendorlib='$d_vendorlib'
20990 d_vendorscript='$d_vendorscript'
20992 d_void_closedir='$d_void_closedir'
20993 d_voidsig='$d_voidsig'
20994 d_voidtty='$d_voidtty'
20995 d_volatile='$d_volatile'
20996 d_vprintf='$d_vprintf'
20998 d_waitpid='$d_waitpid'
20999 d_wcstombs='$d_wcstombs'
21000 d_wctomb='$d_wctomb'
21001 d_writev='$d_writev'
21004 db_hashtype='$db_hashtype'
21005 db_prefixtype='$db_prefixtype'
21006 db_version_major='$db_version_major'
21007 db_version_minor='$db_version_minor'
21008 db_version_patch='$db_version_patch'
21009 defvoidused='$defvoidused'
21010 direntrytype='$direntrytype'
21013 doublesize='$doublesize'
21015 drand48_r_proto='$drand48_r_proto'
21016 dynamic_ext='$dynamic_ext'
21022 endgrent_r_proto='$endgrent_r_proto'
21023 endhostent_r_proto='$endhostent_r_proto'
21024 endnetent_r_proto='$endnetent_r_proto'
21025 endprotoent_r_proto='$endprotoent_r_proto'
21026 endpwent_r_proto='$endpwent_r_proto'
21027 endservent_r_proto='$endservent_r_proto'
21028 eunicefix='$eunicefix'
21031 extensions='$extensions'
21033 fflushNULL='$fflushNULL'
21034 fflushall='$fflushall'
21036 firstmakefile='$firstmakefile'
21038 fpossize='$fpossize'
21039 fpostype='$fpostype'
21040 freetype='$freetype'
21043 full_csh='$full_csh'
21044 full_sed='$full_sed'
21045 gccansipedantic='$gccansipedantic'
21046 gccosandvers='$gccosandvers'
21047 gccversion='$gccversion'
21048 getgrent_r_proto='$getgrent_r_proto'
21049 getgrgid_r_proto='$getgrgid_r_proto'
21050 getgrnam_r_proto='$getgrnam_r_proto'
21051 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21052 gethostbyname_r_proto='$gethostbyname_r_proto'
21053 gethostent_r_proto='$gethostent_r_proto'
21054 getlogin_r_proto='$getlogin_r_proto'
21055 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21056 getnetbyname_r_proto='$getnetbyname_r_proto'
21057 getnetent_r_proto='$getnetent_r_proto'
21058 getprotobyname_r_proto='$getprotobyname_r_proto'
21059 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21060 getprotoent_r_proto='$getprotoent_r_proto'
21061 getpwent_r_proto='$getpwent_r_proto'
21062 getpwnam_r_proto='$getpwnam_r_proto'
21063 getpwuid_r_proto='$getpwuid_r_proto'
21064 getservbyname_r_proto='$getservbyname_r_proto'
21065 getservbyport_r_proto='$getservbyport_r_proto'
21066 getservent_r_proto='$getservent_r_proto'
21067 getspnam_r_proto='$getspnam_r_proto'
21068 gidformat='$gidformat'
21074 gmtime_r_proto='$gmtime_r_proto'
21075 gnulibc_version='$gnulibc_version'
21077 groupcat='$groupcat'
21078 groupstype='$groupstype'
21081 h_sysfile='$h_sysfile'
21084 html1dir='$html1dir'
21085 html1direxp='$html1direxp'
21086 html3dir='$html3dir'
21087 html3direxp='$html3direxp'
21096 i_arpainet='$i_arpainet'
21097 i_bsdioctl='$i_bsdioctl'
21101 i_dirent='$i_dirent'
21107 i_fp_class='$i_fp_class'
21110 i_ieeefp='$i_ieeefp'
21111 i_inttypes='$i_inttypes'
21112 i_langinfo='$i_langinfo'
21113 i_libutil='$i_libutil'
21114 i_limits='$i_limits'
21115 i_locale='$i_locale'
21116 i_machcthr='$i_machcthr'
21117 i_malloc='$i_malloc'
21119 i_memory='$i_memory'
21120 i_mntent='$i_mntent'
21123 i_neterrno='$i_neterrno'
21124 i_netinettcp='$i_netinettcp'
21128 i_pthread='$i_pthread'
21130 i_rpcsvcdbm='$i_rpcsvcdbm'
21133 i_shadow='$i_shadow'
21135 i_stdarg='$i_stdarg'
21136 i_stddef='$i_stddef'
21137 i_stdlib='$i_stdlib'
21138 i_string='$i_string'
21139 i_sunmath='$i_sunmath'
21140 i_sysaccess='$i_sysaccess'
21141 i_sysdir='$i_sysdir'
21142 i_sysfile='$i_sysfile'
21143 i_sysfilio='$i_sysfilio'
21145 i_sysioctl='$i_sysioctl'
21146 i_syslog='$i_syslog'
21147 i_sysmman='$i_sysmman'
21148 i_sysmode='$i_sysmode'
21149 i_sysmount='$i_sysmount'
21150 i_sysndir='$i_sysndir'
21151 i_sysparam='$i_sysparam'
21152 i_sysresrc='$i_sysresrc'
21153 i_syssecrt='$i_syssecrt'
21154 i_sysselct='$i_sysselct'
21155 i_syssockio='$i_syssockio'
21156 i_sysstat='$i_sysstat'
21157 i_sysstatfs='$i_sysstatfs'
21158 i_sysstatvfs='$i_sysstatvfs'
21159 i_systime='$i_systime'
21160 i_systimek='$i_systimek'
21161 i_systimes='$i_systimes'
21162 i_systypes='$i_systypes'
21163 i_sysuio='$i_sysuio'
21165 i_sysutsname='$i_sysutsname'
21166 i_sysvfs='$i_sysvfs'
21167 i_syswait='$i_syswait'
21168 i_termio='$i_termio'
21169 i_termios='$i_termios'
21171 i_unistd='$i_unistd'
21174 i_values='$i_values'
21175 i_varargs='$i_varargs'
21176 i_varhdr='$i_varhdr'
21178 ignore_versioned_solibs='$ignore_versioned_solibs'
21179 inc_version_list='$inc_version_list'
21180 inc_version_list_init='$inc_version_list_init'
21183 installarchlib='$installarchlib'
21184 installbin='$installbin'
21185 installhtml1dir='$installhtml1dir'
21186 installhtml3dir='$installhtml3dir'
21187 installman1dir='$installman1dir'
21188 installman3dir='$installman3dir'
21189 installprefix='$installprefix'
21190 installprefixexp='$installprefixexp'
21191 installprivlib='$installprivlib'
21192 installscript='$installscript'
21193 installsitearch='$installsitearch'
21194 installsitebin='$installsitebin'
21195 installsitehtml1dir='$installsitehtml1dir'
21196 installsitehtml3dir='$installsitehtml3dir'
21197 installsitelib='$installsitelib'
21198 installsiteman1dir='$installsiteman1dir'
21199 installsiteman3dir='$installsiteman3dir'
21200 installsitescript='$installsitescript'
21201 installstyle='$installstyle'
21202 installusrbinperl='$installusrbinperl'
21203 installvendorarch='$installvendorarch'
21204 installvendorbin='$installvendorbin'
21205 installvendorhtml1dir='$installvendorhtml1dir'
21206 installvendorhtml3dir='$installvendorhtml3dir'
21207 installvendorlib='$installvendorlib'
21208 installvendorman1dir='$installvendorman1dir'
21209 installvendorman3dir='$installvendorman3dir'
21210 installvendorscript='$installvendorscript'
21212 issymlink='$issymlink'
21213 ivdformat='$ivdformat'
21216 known_extensions='$known_extensions'
21219 lddlflags='$lddlflags'
21221 ldflags_uselargefiles='$ldflags_uselargefiles'
21222 ldlibpthname='$ldlibpthname'
21229 libsdirs='$libsdirs'
21230 libsfiles='$libsfiles'
21231 libsfound='$libsfound'
21232 libspath='$libspath'
21233 libswanted='$libswanted'
21234 libswanted_uselargefiles='$libswanted_uselargefiles'
21240 localtime_r_proto='$localtime_r_proto'
21241 locincpth='$locincpth'
21242 loclibpth='$loclibpth'
21243 longdblsize='$longdblsize'
21244 longlongsize='$longlongsize'
21245 longsize='$longsize'
21249 lseeksize='$lseeksize'
21250 lseektype='$lseektype'
21254 make_set_make='$make_set_make'
21255 mallocobj='$mallocobj'
21256 mallocsrc='$mallocsrc'
21257 malloctype='$malloctype'
21259 man1direxp='$man1direxp'
21262 man3direxp='$man3direxp'
21264 mips_type='$mips_type'
21265 mistrustnm='$mistrustnm'
21267 mmaptype='$mmaptype'
21268 modetype='$modetype'
21270 multiarch='$multiarch'
21272 myarchname='$myarchname'
21273 mydomain='$mydomain'
21274 myhostname='$myhostname'
21277 need_va_copy='$need_va_copy'
21278 netdb_hlen_type='$netdb_hlen_type'
21279 netdb_host_type='$netdb_host_type'
21280 netdb_name_type='$netdb_name_type'
21281 netdb_net_type='$netdb_net_type'
21284 nm_so_opt='$nm_so_opt'
21285 nonxs_ext='$nonxs_ext'
21287 nvEUformat='$nvEUformat'
21288 nvFUformat='$nvFUformat'
21289 nvGUformat='$nvGUformat'
21290 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21291 nveformat='$nveformat'
21292 nvfformat='$nvfformat'
21293 nvgformat='$nvgformat'
21296 o_nonblock='$o_nonblock'
21298 old_pthread_create_joinable='$old_pthread_create_joinable'
21299 optimize='$optimize'
21300 orderlib='$orderlib'
21303 otherlibdirs='$otherlibdirs'
21307 patchlevel='$patchlevel'
21308 path_sep='$path_sep'
21311 perl_patchlevel='$perl_patchlevel'
21312 perladmin='$perladmin'
21313 perllibs='$perllibs'
21314 perlpath='$perlpath'
21316 phostname='$phostname'
21322 prefixexp='$prefixexp'
21324 privlibexp='$privlibexp'
21325 procselfexe='$procselfexe'
21326 prototype='$prototype'
21328 quadkind='$quadkind'
21329 quadtype='$quadtype'
21330 randbits='$randbits'
21331 randfunc='$randfunc'
21332 random_r_proto='$random_r_proto'
21333 randseedtype='$randseedtype'
21335 rd_nodata='$rd_nodata'
21336 readdir64_r_proto='$readdir64_r_proto'
21337 readdir_r_proto='$readdir_r_proto'
21338 revision='$revision'
21343 sPRIEUldbl='$sPRIEUldbl'
21344 sPRIFUldbl='$sPRIFUldbl'
21345 sPRIGUldbl='$sPRIGUldbl'
21346 sPRIXU64='$sPRIXU64'
21348 sPRIeldbl='$sPRIeldbl'
21349 sPRIfldbl='$sPRIfldbl'
21350 sPRIgldbl='$sPRIgldbl'
21355 sSCNfldbl='$sSCNfldbl'
21356 sched_yield='$sched_yield'
21357 scriptdir='$scriptdir'
21358 scriptdirexp='$scriptdirexp'
21360 seedfunc='$seedfunc'
21361 selectminbits='$selectminbits'
21362 selecttype='$selecttype'
21363 sendmail='$sendmail'
21364 setgrent_r_proto='$setgrent_r_proto'
21365 sethostent_r_proto='$sethostent_r_proto'
21366 setlocale_r_proto='$setlocale_r_proto'
21367 setnetent_r_proto='$setnetent_r_proto'
21368 setprotoent_r_proto='$setprotoent_r_proto'
21369 setpwent_r_proto='$setpwent_r_proto'
21370 setservent_r_proto='$setservent_r_proto'
21373 sharpbang='$sharpbang'
21374 shmattype='$shmattype'
21375 shortsize='$shortsize'
21378 sig_count='$sig_count'
21379 sig_name='$sig_name'
21380 sig_name_init='$sig_name_init'
21382 sig_num_init='$sig_num_init'
21383 sig_size='$sig_size'
21384 signal_t='$signal_t'
21385 sitearch='$sitearch'
21386 sitearchexp='$sitearchexp'
21388 sitebinexp='$sitebinexp'
21389 sitehtml1dir='$sitehtml1dir'
21390 sitehtml1direxp='$sitehtml1direxp'
21391 sitehtml3dir='$sitehtml3dir'
21392 sitehtml3direxp='$sitehtml3direxp'
21394 sitelib_stem='$sitelib_stem'
21395 sitelibexp='$sitelibexp'
21396 siteman1dir='$siteman1dir'
21397 siteman1direxp='$siteman1direxp'
21398 siteman3dir='$siteman3dir'
21399 siteman3direxp='$siteman3direxp'
21400 siteprefix='$siteprefix'
21401 siteprefixexp='$siteprefixexp'
21402 sitescript='$sitescript'
21403 sitescriptexp='$sitescriptexp'
21404 sizesize='$sizesize'
21405 sizetype='$sizetype'
21409 sockethdr='$sockethdr'
21410 socketlib='$socketlib'
21411 socksizetype='$socksizetype'
21413 spackage='$spackage'
21414 spitshell='$spitshell'
21415 srand48_r_proto='$srand48_r_proto'
21416 srandom_r_proto='$srandom_r_proto'
21418 ssizetype='$ssizetype'
21419 startperl='$startperl'
21421 static_ext='$static_ext'
21423 stdio_base='$stdio_base'
21424 stdio_bufsiz='$stdio_bufsiz'
21425 stdio_cnt='$stdio_cnt'
21426 stdio_filbuf='$stdio_filbuf'
21427 stdio_ptr='$stdio_ptr'
21428 stdio_stream_array='$stdio_stream_array'
21429 strerror_r_proto='$strerror_r_proto'
21432 subversion='$subversion'
21436 targetarch='$targetarch'
21440 timeincl='$timeincl'
21441 timetype='$timetype'
21442 tmpnam_r_proto='$tmpnam_r_proto'
21448 ttyname_r_proto='$ttyname_r_proto'
21457 uidformat='$uidformat'
21463 uquadtype='$uquadtype'
21464 use5005threads='$use5005threads'
21465 use64bitall='$use64bitall'
21466 use64bitint='$use64bitint'
21467 usecrosscompile='$usecrosscompile'
21469 usefaststdio='$usefaststdio'
21470 useithreads='$useithreads'
21471 uselargefiles='$uselargefiles'
21472 uselongdouble='$uselongdouble'
21473 usemallocwrap='$usemallocwrap'
21474 usemorebits='$usemorebits'
21475 usemultiplicity='$usemultiplicity'
21476 usemymalloc='$usemymalloc'
21478 useopcode='$useopcode'
21479 useperlio='$useperlio'
21480 useposix='$useposix'
21481 usereentrant='$usereentrant'
21482 userelocatableinc='$userelocatableinc'
21484 useshrplib='$useshrplib'
21485 usesitecustomize='$usesitecustomize'
21486 usesocks='$usesocks'
21487 usethreads='$usethreads'
21488 usevendorprefix='$usevendorprefix'
21489 usevfork='$usevfork'
21492 uvXUformat='$uvXUformat'
21493 uvoformat='$uvoformat'
21496 uvuformat='$uvuformat'
21497 uvxformat='$uvxformat'
21498 vendorarch='$vendorarch'
21499 vendorarchexp='$vendorarchexp'
21500 vendorbin='$vendorbin'
21501 vendorbinexp='$vendorbinexp'
21502 vendorhtml1dir='$vendorhtml1dir'
21503 vendorhtml1direxp='$vendorhtml1direxp'
21504 vendorhtml3dir='$vendorhtml3dir'
21505 vendorhtml3direxp='$vendorhtml3direxp'
21506 vendorlib='$vendorlib'
21507 vendorlib_stem='$vendorlib_stem'
21508 vendorlibexp='$vendorlibexp'
21509 vendorman1dir='$vendorman1dir'
21510 vendorman1direxp='$vendorman1direxp'
21511 vendorman3dir='$vendorman3dir'
21512 vendorman3direxp='$vendorman3direxp'
21513 vendorprefix='$vendorprefix'
21514 vendorprefixexp='$vendorprefixexp'
21515 vendorscript='$vendorscript'
21516 vendorscriptexp='$vendorscriptexp'
21518 version_patchlevel_string='$version_patchlevel_string'
21519 versiononly='$versiononly'
21521 voidflags='$voidflags'
21524 yaccflags='$yaccflags'
21529 : Add in command line options if available
21530 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21532 : add special variables
21533 $test -f $src/patchlevel.h && \
21534 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
21535 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
21536 echo "PERL_CONFIG_SH=true" >>config.sh
21538 : propagate old symbols
21539 if $test -f UU/config.sh; then
21540 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
21541 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
21542 $sort | $uniq -u >UU/oldsyms
21543 set X `cat UU/oldsyms`
21549 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
21551 echo "# Variables propagated from previous config.sh file." >>config.sh
21552 for sym in `cat UU/oldsyms`; do
21553 echo " Propagating $hint variable "'$'"$sym..."
21554 eval 'tmp="$'"${sym}"'"'
21556 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
21562 : Finish up by extracting the .SH files
21566 echo "Extraction done."
21576 If you'd like to make any changes to the config.sh file before I begin
21577 to configure things, do it as a shell escape now (e.g. !vi config.sh).
21580 rp="Press return or use a shell escape to edit config.sh:"
21585 *) : in case they cannot read
21586 sh 1>&4 -c "$ans";;
21591 : if this fails, just run all the .SH files by hand
21600 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
21607 Now you need to generate make dependencies by running "$make depend".
21608 You might prefer to run it in background: "$make depend > makedepend.out &"
21609 It can take a while, so you might not want to run it right now.
21614 rp="Run $make depend now?"
21618 $make depend && echo "Now you must run '$make'."
21621 echo "You must run '$make depend' then '$make'."
21624 elif test -f [Mm]akefile; then
21626 echo "Now you must run a $make."
21628 echo "Configure done."
21631 if $test -f Policy.sh; then
21634 If you compile $package on a different machine or from a different object
21635 directory, copy the Policy.sh file from this object directory to the
21636 new one before you run Configure -- this will help you with most of
21637 the policy defaults.
21641 if $test -f config.msg; then
21642 echo "Hmm. I also noted the following information while running:"
21644 $cat config.msg >&4
21647 $rm -f kit*isdone ark*isdone