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 Wed Mar 30 16:17:23 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=''
580 d_old_pthread_create_joinable=''
581 old_pthread_create_joinable=''
583 d_pthread_attr_setscope=''
622 sethostent_r_proto=''
639 setprotoent_r_proto=''
651 setservent_r_proto=''
697 d_stdio_ptr_lval_nochange_cnt=''
698 d_stdio_ptr_lval_sets_cnt=''
901 inc_version_list_init=''
920 ignore_versioned_solibs=''
980 d_perl_otherlibdirs=''
994 version_patchlevel_string=''
1009 nv_preserves_uv_bits=''
1080 installsitehtml1dir=''
1083 installsitehtml3dir=''
1090 installsiteman1dir=''
1093 installsiteman3dir=''
1098 installsitescript=''
1113 d_stdio_stream_array=''
1114 stdio_stream_array=''
1125 ccflags_uselargefiles=''
1126 ldflags_uselargefiles=''
1127 libswanted_uselargefiles=''
1137 userelocatableinc=''
1148 installvendorarch=''
1155 installvendorhtml1dir=''
1157 vendorhtml1direxp=''
1158 installvendorhtml3dir=''
1160 vendorhtml3direxp=''
1166 installvendorman1dir=''
1169 installvendorman3dir=''
1176 installvendorscript=''
1188 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1191 : We must find out about Eunice early
1193 if test -f /etc/unixtovms; then
1194 eunicefix=/etc/unixtovms
1196 if test -f /etc/unixtovms.exe; then
1197 eunicefix=/etc/unixtovms.exe
1200 : Set executable suffix now -- needed before hints available
1201 if test -f "/libs/version.library"; then
1204 elif test -f "/system/gnu_library/bin/ar.pm"; then
1207 elif test -n "$DJGPP"; then
1210 elif test -d c:/. -o -n "$is_os2" ; then
1219 : set useposix=false in your hint file to disable the POSIX extension.
1221 : set useopcode=false in your hint file to disable the Opcode extension.
1223 : Trailing extension. Override this in a hint file, if needed.
1224 : Extra object files, if any, needed on this platform.
1227 : Possible local include directories to search.
1228 : Set locincpth to "" in a hint file to defeat local include searches.
1229 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1230 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1232 : no include file wanted by default
1237 : change the next line if compiling for Xenix/286 on Xenix/386
1238 xlibpth='/usr/lib/386 /lib/386'
1239 : Possible local library directories to search.
1240 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1241 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1243 : general looking path for locating libraries
1244 glibpth="/lib /usr/lib $xlibpth"
1245 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1246 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1247 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1249 : Private path used by Configure to find libraries. Its value
1250 : is prepended to libpth. This variable takes care of special
1251 : machines, like the mips. Usually, it should be empty.
1254 : default library list
1256 : some systems want to use only the non-versioned libso:s
1257 ignore_versioned_solibs=''
1262 ccflags_uselargefiles=''
1263 ldflags_uselargefiles=''
1264 libswanted_uselargefiles=''
1265 : set usemultiplicity on the Configure command line to enable multiplicity.
1266 : set usesocks on the Configure command line to enable socks.
1267 : set usethreads on the Configure command line to enable threads.
1268 usereentrant='undef'
1269 : full support for void wanted by default
1272 : List of libraries we want.
1273 : If anyone needs extra -lxxx, put those in a hint file.
1274 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1275 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1276 : We probably want to search /usr/shlib before most other libraries.
1277 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1278 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1279 glibpth="/usr/shlib $glibpth"
1280 : Do not use vfork unless overridden by a hint file.
1283 : Find the basic shell for Bourne shell scripts
1287 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1290 if test -f "$xxx"; then
1293 : Build up a list and do a single loop so we can 'break' out.
1294 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1295 for xxx in sh bash ksh pdksh ash; do
1297 try="$try ${p}/${xxx}"
1301 if test -f "$xxx"; then
1304 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1307 elif test -f "$xxx.exe"; then
1318 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1320 Usually it's in /bin/sh. How did you even get this far?
1321 Please contact me (Perl Maintainers) at perlbug@perl.org and
1322 we'll try to straighten this all out.
1328 : see if sh knows # comments
1329 if `$sh -c '#' >/dev/null 2>&1`; then
1333 test -f $xcat$_exe || xcat=/usr/bin/cat
1334 if test ! -f $xcat$_exe; then
1335 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1336 if test -f $p/cat$_exe; then
1341 if test ! -f $xcat$_exe; then
1342 echo "Can't find cat anywhere!"
1346 echo "#!$xcat" >sharp
1350 if test -s today; then
1353 echo "#! $xcat" > sharp
1357 if test -s today; then
1365 echo "Your $sh doesn't grok # comments--I will strip them later on."
1368 echo "exec grep -v '^[ ]*#'" >spitshell
1370 $eunicefix spitshell
1371 spitshell=`pwd`/spitshell
1373 echo "I presume that if # doesn't work, #! won't work either!"
1378 : figure out how to guarantee sh startup
1380 '') startsh=${sharpbang}${sh} ;;
1392 : echo "Yup, it does."
1394 echo "Hmm... '$startsh' does not guarantee sh startup..."
1395 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1400 : Save command line options in file UU/cmdline.opt for later use in
1401 : generating config.sh.
1402 cat > cmdline.opt <<EOSH
1403 # Configure command line arguments.
1412 cat >>cmdline.opt <<EOSH
1413 config_arg$argn='$arg'
1415 # Extreme backslashitis: replace each ' by '"'"'
1416 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1419 arg_exp=`cat cmdl.opt`
1420 args_exp="$args_exp$args_sep'$arg_exp'"
1421 argn=`expr $argn + 1`
1424 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1425 # used by ./hints/os2.sh
1428 : produce awk script to parse command line options
1429 cat >options.awk <<'EOF'
1431 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1433 len = length(optstr);
1434 for (i = 1; i <= len; i++) {
1435 c = substr(optstr, i, 1);
1436 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1447 if (substr(str, 1, 1) != "-") {
1448 printf("'%s'\n", str);
1452 for (i = 2; i <= len; i++) {
1453 c = substr(str, i, 1);
1455 printf("-%s\n", substr(str, i));
1461 printf("'%s'\n", substr(str, i + 1));
1474 : process the command line options
1475 set X `for arg in "$@"; do echo "X$arg"; done |
1476 sed -e s/X// | awk -f options.awk`
1481 : set up default values
1491 rm -f optdef.sh posthint.sh
1492 cat >optdef.sh <<EOS
1498 while test $# -gt 0; do
1500 -d) shift; fastread=yes;;
1501 -e) shift; alldone=cont;;
1505 if test -r "$1"; then
1508 echo "$me: cannot read config file $1." >&2
1513 -h) shift; error=true;;
1514 -r) shift; reuseval=true;;
1515 -s) shift; silent=true; realsilent=true;;
1516 -E) shift; alldone=exit;;
1517 -K) shift; knowitall=true;;
1518 -O) shift; override=true;;
1519 -S) shift; silent=true; extractsh=true;;
1524 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1525 echo "$me: ignoring -D $1" >&2
1528 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1529 *) echo "$1='define'" >> optdef.sh;;
1536 *=) echo "$1" >> optdef.sh;;
1538 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1539 echo "$me: ignoring -U $1" >&2
1541 *) echo "$1='undef'" >> optdef.sh;;
1552 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1556 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1557 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1563 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1564 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1565 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1566 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1567 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1568 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1574 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1576 echo "$yyy=''" >> posthint.sh ;;
1581 echo "$yyy='$zzz'" >> posthint.sh ;;
1583 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1585 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1590 echo "$yyy=$zzz" >> posthint.sh ;;
1591 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1595 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1598 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1606 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1607 [-U symbol] [-U symbol=] [-A command:symbol...]
1608 -d : use defaults for all answers.
1609 -e : go on without questioning past the production of config.sh.
1610 -f : specify an alternate default configuration file.
1611 -h : print this help message and exit (with an error status).
1612 -r : reuse C symbols value if possible (skips costly nm extraction).
1613 -s : silent mode, only echoes questions and essential information.
1614 -D : define symbol to have some value:
1615 -D symbol symbol gets the value 'define'
1616 -D symbol=value symbol gets the value 'value'
1617 -E : stop at the end of questions, after having produced config.sh.
1618 -K : do not use unless you know what you are doing.
1619 -O : let -D and -U override definitions from loaded configuration file.
1620 -S : perform variable substitutions on all .SH files (can mix with -f)
1621 -U : undefine symbol:
1622 -U symbol symbol gets the value 'undef'
1623 -U symbol= symbol gets completely empty
1624 -A : manipulate symbol after the platform specific hints have been applied:
1625 -A symbol=value append " "value to symbol
1626 -A append:symbol=value append value to symbol
1627 -A define:symbol=value define symbol to have value
1628 -A clear:symbol define symbol to be ''
1629 -A define:symbol define symbol to be 'define'
1630 -A eval:symbol=value define symbol to be eval of value
1631 -A prepend:symbol=value prepend value to symbol
1632 -A undef:symbol define symbol to be 'undef'
1633 -A undef:symbol= define symbol to be ''
1634 -V : print version number and exit (with a zero status).
1641 case "$fastread$alldone" in
1644 case "$extractsh" in
1647 if test ! -t 0; then
1648 echo "Say 'sh Configure', not 'sh <Configure'"
1658 true) exec 1>/dev/null;;
1661 : run the defines and the undefines, if any, but leave the file out there...
1664 : create the posthint manipulation script and leave the file out there...
1669 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1670 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1671 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1672 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1673 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1676 : Some greps do not return status, grrr.
1677 echo "grimblepritz" >grimble
1678 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1680 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1686 : the following should work in any shell
1690 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1691 cat >contains <<'EOSS'
1692 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1697 : Find the path to the source tree
1700 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1704 *) src=`cd ../$src && pwd` ;;
1717 if test -f $rsrc/Configure && \
1718 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1720 : found it, so we are ok.
1723 for src in . .. ../.. ../../.. ../../../..; do
1724 if test -f ../$src/Configure && \
1725 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1736 Sorry, I can't seem to locate the source dir for $package. Please start
1737 Configure with an explicit path -- i.e. /some/path/Configure.
1745 echo "Sources for $package found in \"$src\"." >&4
1749 : script used to extract .SH files with variable substitutions
1750 cat >extract <<'EOS'
1752 echo "Doing variable substitutions on .SH files..."
1753 if test -f MANIFEST; then
1754 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1756 echo "(Looking for .SH files under the source directory.)"
1757 set x `(cd "$src"; find . -name "*.SH" -print)`
1761 0) set x `(cd "$src"; echo *.SH)`; shift;;
1763 if test ! -f "$src/$1"; then
1769 while test $name; do
1770 if test ! -d "$name"; then
1771 create="$name $create";
1772 name=`echo $name | sed -e "s|^[^/]*$||"`;
1773 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1778 for file in $create; do
1787 dir=`expr X$file : 'X\(.*\)/'`
1788 file=`expr X$file : 'X.*/\(.*\)'`
1789 (cd "$dir" && . ./$file)
1799 dir=`expr X$file : 'X\(.*\)/'`
1800 file=`expr X$file : 'X.*/\(.*\)'`
1801 (set x $dir; shift; eval $mkdir_p)
1802 sh <"$src/$dir/$file"
1811 if test -f "$src/config_h.SH"; then
1812 if test ! -f config.h; then
1813 : oops, they left it out of MANIFEST, probably, so do it anyway.
1814 . "$src/config_h.SH"
1819 : extract files and exit if asked to do so
1820 case "$extractsh" in
1822 case "$realsilent" in
1826 case "$config_sh" in
1827 '') config_sh='config.sh';;
1830 echo "Fetching answers from $config_sh..."
1833 test "$override" && . ./optdef.sh
1837 echo "Extraction done."
1842 : Eunice requires " " instead of "", can you believe it
1845 echo "Beginning of configuration questions for $package."
1847 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1849 : first determine how to suppress newline on echo command
1851 echo "Checking echo to see how to suppress newlines..."
1852 (echo "hi there\c" ; echo " ") >.echotmp
1853 if $contains c .echotmp >/dev/null 2>&1 ; then
1864 echo $n "The star should be here-->$c"
1868 : Now test for existence of everything in MANIFEST
1870 if test -f "$rsrc/MANIFEST"; then
1871 echo "First let's make sure your kit is complete. Checking..." >&4
1872 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1875 for filelist in x??; do
1876 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1878 if test -s missing; then
1882 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1884 You have the option of continuing the configuration process, despite the
1885 distinct possibility that your kit is damaged, by typing 'y'es. If you
1886 do, don't blame me if something goes wrong. I advise you to type 'n'o
1887 and contact the author (perlbug@perl.org).
1890 echo $n "Continue? [n] $c" >&4
1894 echo "Continuing..." >&4
1898 echo "ABORTING..." >&4
1903 echo "Looks good..."
1906 echo "There is no MANIFEST file. I hope your kit is complete !"
1911 : Find the appropriate value for a newline for tr
1912 if test -n "$DJGPP"; then
1915 if test X"$trnl" = X; then
1916 case "`echo foo|tr '\n' x 2>/dev/null`" in
1920 if test X"$trnl" = X; then
1921 case "`echo foo|tr '\012' x 2>/dev/null`" in
1922 foox) trnl='\012' ;;
1925 if test X"$trnl" = X; then
1926 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1927 fooxy) trnl='\n\r' ;;
1930 if test X"$trnl" = X; then
1933 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1939 : compute the number of columns on the terminal for proper question formatting
1944 : set up the echo used in my read
1945 myecho="case \"\$xxxm\" in
1946 '') echo $n \"\$rp $c\" >&4;;
1948 '') echo $n \"[\$xxxm] $c\";;
1950 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1952 echo $n \"[\$xxxm] $c\" >&4
1954 echo $n \"\$rp [\$xxxm] $c\" >&4
1960 : now set up to do reads with possible shell escape and default assignment
1966 case "\$fastread" in
1967 yes) case "\$dflt" in
1970 case "\$silent-\$rp" in
1975 *) case "\$silent" in
1976 true) case "\$rp" in
1981 while expr "X\$ans" : "X!" >/dev/null; do
1985 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1993 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
2002 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2007 echo "(OK, I'll run with -d after this question.)" >&4
2010 echo "*** Sorry, \$1 not supported yet." >&4
2020 echo "*** Substitution done -- please confirm."
2022 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2027 echo "*** Error -- try again."
2034 case "\$ans\$xxxm\$nostick" in
2046 : create .config dir to save info across Configure sessions
2047 test -d ../.config || mkdir ../.config
2048 cat >../.config/README <<EOF
2049 This directory created by Configure to save information that should
2050 persist across sessions for $package.
2052 You may safely delete it if you wish.
2055 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2057 $define|true|[yY]*) ;;
2058 *) case "$xversion" in
2061 *** WHOA THERE!!! ***
2063 This is an UNSTABLE DEVELOPMENT release.
2064 The version of this $package distribution is $xversion, that is, odd,
2065 (as opposed to even) and that signifies a development release.
2066 If you want a maintenance release, you want an even-numbered version.
2068 Do ***NOT*** install this into production use.
2069 Data corruption and crashes are possible.
2071 It is most seriously suggested that you do not continue any further
2072 unless you want to help in developing and debugging Perl.
2074 If you *still* want to build perl, you can answer 'y' now,
2075 or pass -Dusedevel to Configure.
2078 rp='Do you really want to continue?'
2082 [yY]) echo >&4 "Okay, continuing."
2083 usedevel="$define" ;;
2084 *) echo >&4 "Okay, bye."
2094 case "$versiononly" in
2095 '') versiononly="$define" ;;
2097 case "$installusrbinperl" in
2098 '') installusrbinperl="$undef" ;;
2103 : general instructions
2106 user=`(logname) 2>/dev/null`
2108 '') user=`whoami 2>&1`;;
2110 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2113 rp='Would you like to see the instructions?'
2124 This installation shell script will examine your system and ask you questions
2125 to determine how the perl5 package should be installed. If you get
2126 stuck on a question, you may use a ! shell escape to start a subshell or
2127 execute a command. Many of the questions will have default answers in square
2128 brackets; typing carriage return will give you the default.
2130 On some of the questions which ask for file or directory names you are allowed
2131 to use the ~name construct to specify the login directory belonging to "name",
2132 even if you don't have a shell which knows about that. Questions where this is
2133 allowed will be marked "(~name ok)".
2137 dflt='Type carriage return to continue'
2141 The prompter used in this script allows you to use shell variables and
2142 backticks in your answers. You may use $1, $2, etc... to refer to the words
2143 in the default answer, as if the default line was a set of arguments given to a
2144 script shell. This means you may also use $* to repeat the whole default line,
2145 so you do not have to re-type everything to add something to the default.
2147 Everytime there is a substitution, you will have to confirm. If there is an
2148 error (e.g. an unmatched backtick), the default answer will remain unchanged
2149 and you will be prompted again.
2151 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2152 the questions and use the computed defaults (or the previous answers if there
2153 was already a config.sh file). Type 'Configure -h' for a list of options.
2154 You may also start interactively and then answer '& -d' at any prompt to turn
2155 on the non-interactive behaviour for the remainder of the execution.
2161 Much effort has been expended to ensure that this shell script will run on any
2162 Unix system. If despite that it blows up on yours, your best bet is to edit
2163 Configure and run it again. If you can't run Configure for some reason,
2164 you'll have to generate a config.sh file by hand. Whatever problems you
2165 have, let me (perlbug@perl.org) know how I blew it.
2167 This installation script affects things in two ways:
2169 1) it may do direct variable substitutions on some of the files included
2171 2) it builds a config.h file for inclusion in C programs. You may edit
2172 any of these files as the need arises after running this script.
2174 If you make a mistake on a question, there is no easy way to back up to it
2175 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2176 files. Configure will offer to let you do this before it runs the SH files.
2179 dflt='Type carriage return to continue'
2181 case "$firsttime" in
2182 true) echo $user >>../.config/instruct;;
2186 : find out where common programs are
2188 echo "Locating common programs..." >&4
2201 if test -d \$dir/\$thing; then
2207 for thisthing in \$dir/\$thing; do
2208 : just loop through to pick last item
2210 if test -f \$thisthing; then
2213 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2216 elif test -f \$dir/\$thing.exe; then
2217 if test -n "$DJGPP"; then
2218 echo \$dir/\$thing.exe
2219 elif test "$eunicefix" != ":"; then
2220 : on Eunice apparently
2274 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2275 pth="$pth /lib /usr/lib"
2276 for file in $loclist; do
2280 if test -f "$xxx"; then
2283 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2284 xxx=`./loc $file $file $pth`
2287 '') xxx=`./loc $file $file $pth`;;
2288 *) xxx=`./loc $xxx $xxx $pth`;;
2290 eval $file=$xxx$_exe
2294 echo $file is in $xxx.
2297 echo $file is in $xxx.
2300 echo "I don't know where '$file' is, and my life depends on it." >&4
2301 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2307 echo "Don't worry if any of the following aren't found..."
2309 for file in $trylist; do
2313 if test -f "$xxx"; then
2316 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2317 xxx=`./loc $file $file $pth`
2320 '') xxx=`./loc $file $file $pth`;;
2321 *) xxx=`./loc $xxx $xxx $pth`;;
2323 eval $file=$xxx$_exe
2327 echo $file is in $xxx.
2330 echo $file is in $xxx.
2333 echo "I don't see $file out there, $say."
2340 echo "Substituting grep for egrep."
2347 echo "Substituting cp for ln."
2356 echo "I can't find make or gmake, and my life depends on it." >&4
2357 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2365 *) # We can't have osname yet.
2366 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2367 # Assume that gmake, if found, is definitely GNU make
2368 # and prefer it over the system make.
2369 echo "Substituting gmake for make."
2377 echo "Hopefully test is built into your sh."
2380 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2381 echo "Using the test built into your sh."
2389 echo "Hopefully echo is built into your sh."
2394 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2395 $echo $n "hi there$c" >foo1
2396 echo $n "hi there$c" >foo2
2397 if cmp foo1 foo2 >/dev/null 2>&1; then
2398 echo "They are compatible. In fact, they may be identical."
2405 They are not compatible! You are probably running ksh on a non-USG system.
2406 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2407 have echo built in and we may have to run some Bourne shell scripts. That
2408 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2411 $echo $n "The star should be here-->$c"
2421 cat <<'EOSC' >>trygcc
2426 int main(int argc, char *argv[]) {
2430 if $cc -o try $ccflags $ldflags try.c; then
2433 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2439 case "`$cc -v -c try.c 2>&1`" in
2442 if $test X"$trygcc" = Xyes; then
2443 if gcc -o try -c try.c; then
2445 echo "You seem to have a working gcc, though." >&4
2446 rp="Would you like to use it?"
2448 if $test -f myread; then
2451 if $test -f UU/myread; then
2454 echo "Cannot find myread, sorry. Aborting." >&2
2459 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2460 if $test -f usethreads.cbu; then
2463 *** However, any setting of the C compiler flags (e.g. for thread support)
2464 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2465 *** (together with e.g. -Dusethreads).
2481 cat <<'EOSC' >>checkcc
2486 int main(int argc, char *argv[]) {
2490 if $cc -o try $ccflags $ldflags try.c; then
2493 if $test X"$despair" = Xyes; then
2494 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2497 You need to find a working C compiler.
2498 Either (purchase and) install the C compiler supplied by your OS vendor,
2499 or for a free C compiler try http://gcc.gnu.org/
2500 I cannot continue any further, aborting.
2509 : determine whether symbolic links are supported
2512 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2513 echo "Symbolic links are supported." >&4
2516 echo "Symbolic links are NOT supported." >&4
2521 : determine whether symbolic links are supported
2525 echo "Checking how to test for symbolic links..." >&4
2527 if $test "X$issymlink" = X; then
2529 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2530 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2532 if test $? = 0; then
2535 echo "Your builtin 'test -h' may be broken." >&4
2538 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2541 if test -f "$p/$test"; then
2550 echo "Trying external '$test -h'." >&4
2551 issymlink="$test -h"
2552 if $test ! -h sym >/dev/null 2>&1; then
2553 echo "External '$test -h' is broken, too." >&4
2561 if $test "X$issymlink" = X; then
2562 if $test -L sym 2>/dev/null; then
2563 issymlink="$test -L"
2564 echo "The builtin '$test -L' worked." >&4
2567 if $test "X$issymlink" != X; then
2568 echo "You can test for symbolic links with '$issymlink'." >&4
2570 echo "I do not know how you can test for symbolic links." >&4
2574 *) echo "No symbolic links, so not testing for their testing..." >&4
2580 case "$mksymlinks" in
2583 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2586 *) case "$lns:$issymlink" in
2587 *"ln"*" -s:"*"test -"?)
2588 echo "Creating the symbolic links..." >&4
2589 echo "(First creating the subdirectories...)" >&4
2591 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2593 test -z "$directory" && break
2597 if test ! -d t/base; then
2598 echo "Failed to create the subdirectories. Aborting." >&4
2601 echo "(Then creating the symlinks...)" >&4
2602 awk '{print $1}' $src/MANIFEST | while true; do
2604 test -z "$filename" && break
2605 if test -f $filename; then
2606 if $issymlink $filename; then
2610 if test -f $filename; then
2611 echo "$filename already exists, not symlinking."
2613 ln -s $src/$filename $filename
2617 if test ! -f t/base/lex.t; then
2618 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2623 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2632 case "$usecrosscompile" in
2634 $echo "Cross-compiling..."
2637 *-*-gcc) # A cross-compiling gcc, probably.
2638 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2640 # leave out ld, choosing it is more complex
2642 ranlib=$targetarch-ranlib
2643 $echo 'extern int foo;' > try.c
2644 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2646 if $test $# -gt 0; then
2648 incpth="`$echo $incpth|$sed 's/^ //'`"
2649 echo "Guessing incpth '$incpth'." >&4
2651 j="`$echo $i|$sed 's,/include$,/lib,'`"
2652 if $test -d $j; then
2656 libpth="`$echo $libpth|$sed 's/^ //'`"
2657 echo "Guessing libpth '$libpth'." >&4
2662 case "$targetarch" in
2663 '') echo "Targetarch not defined." >&4; croak=y ;;
2664 *) echo "Using targetarch $targetarch." >&4 ;;
2667 '') echo "Incpth not defined." >&4; croak=y ;;
2668 *) echo "Using incpth '$incpth'." >&4 ;;
2671 '') echo "Libpth not defined." >&4; croak=y ;;
2672 *) echo "Using libpth '$libpth'." >&4 ;;
2675 '') for i in $incpth; do
2676 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2678 echo "Guessing usrinc $usrinc." >&4
2683 '') echo "Usrinc not defined." >&4; croak=y ;;
2686 *) echo "Using usrinc $usrinc." >&4 ;;
2688 case "$targethost" in
2689 '') echo "Targethost not defined." >&4; croak=y ;;
2690 *) echo "Using targethost $targethost." >&4
2695 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2698 /*) run=$src/Cross/run
2699 targetmkdir=$src/Cross/mkdir
2701 from=$src/Cross/from
2703 *) pwd=`$test -f ../Configure & cd ..; pwd`
2705 targetmkdir=$pwd/Cross/mkdir
2707 from=$pwd/Cross/from
2710 case "$targetrun" in
2711 '') targetrun=ssh ;;
2716 case "$targetfrom" in
2717 '') targetfrom=scp ;;
2721 from=$from-$targetfrom
2722 case "$targetdir" in
2724 echo "Guessing targetdir $targetdir." >&4
2727 case "$targetuser" in
2729 echo "Guessing targetuser $targetuser." >&4
2732 case "$targetfrom" in
2736 case "$targetrun" in
2748 '') cwd=$targetdir ;;
2752 if $test ! -f \$exe.xok; then
2756 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2759 *) echo "Unknown targetrun '$targetrun'" >&4
2763 case "$targetmkdir" in
2765 cat >$targetmkdir <<EOF
2767 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2769 $chmod a+rx $targetmkdir
2771 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2783 $targetmkdir \`dirname \$f\`
2784 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2787 $targetmkdir $targetdir/\`dirname \$f\`
2788 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2801 $mkdir -p $targetdir/\`dirname \$f\`
2802 $cp \$f $targetdir/\$f || exit 1
2805 $targetmkdir $targetdir/\`dirname \$f\`
2806 $cp \$f $targetdir/\$f || exit 1
2813 *) echo "Unknown targetto '$targetto'" >&4
2817 case "$targetfrom" in
2824 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2829 cp) cat >$from <<EOF
2834 cp $targetdir/\$f . || exit 1
2839 *) echo "Unknown targetfrom '$targetfrom'" >&4
2843 if $test ! -f $run; then
2844 echo "Target 'run' script '$run' not found." >&4
2848 if $test ! -f $to; then
2849 echo "Target 'to' script '$to' not found." >&4
2853 if $test ! -f $from; then
2854 echo "Target 'from' script '$from' not found." >&4
2858 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2862 Using '$run' for remote execution,
2863 and '$from' and '$to'
2864 for remote file transfer.
2870 usecrosscompile='undef'
2875 : see whether [:lower:] and [:upper:] are supported character classes
2877 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2879 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2883 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2884 # (0xd9 and 0xe2), therefore that is a nice testing point.
2885 if test "X$up" = X -o "X$low" = X; then
2886 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2892 if test "X$up" = X -o "X$low" = X; then
2893 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2899 if test "X$up" = X -o "X$low" = X; then
2900 case "`echo RS | od -x 2>/dev/null`" in
2902 echo "Hey, this might be EBCDIC." >&4
2903 if test "X$up" = X -o "X$low" = X; then
2904 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2905 rs) up='[A-IJ-RS-Z]'
2910 if test "X$up" = X -o "X$low" = X; then
2911 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2921 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2923 echo "Using $up and $low to convert case." >&4
2926 echo "I don't know how to translate letters from upper to lower case." >&4
2927 echo "Your tr is not acting any way I know of." >&4
2931 : set up the translation script tr, must be called with ./tr of course
2935 '[A-Z][a-z]') exec $tr '$up' '$low';;
2936 '[a-z][A-Z]') exec $tr '$low' '$up';;
2943 : Try to determine whether config.sh was made on this system
2944 case "$config_sh" in
2946 myuname=`$uname -a 2>/dev/null`
2947 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2948 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2949 # because the A-Z/a-z are not consecutive.
2950 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2951 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2952 newmyuname="$myuname"
2954 case "$knowitall" in
2956 if test -f ../config.sh; then
2957 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2958 eval "`grep myuname= ../config.sh`"
2960 if test "X$myuname" = "X$newmyuname"; then
2968 : Get old answers from old config file if Configure was run on the
2969 : same system, otherwise use the hints.
2972 if test -f config.sh; then
2974 rp="I see a config.sh file. Shall I use it to set the defaults?"
2977 n*|N*) echo "OK, I'll ignore it."
2978 mv config.sh config.sh.old
2979 myuname="$newmyuname"
2981 *) echo "Fetching default answers from your old config.sh file..." >&4
2989 : Older versions did not always set $sh. Catch re-use of such
2999 if test ! -f config.sh; then
3002 First time through, eh? I have some defaults handy for some systems
3003 that need some extra help getting the Configure answers right:
3006 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3008 : Half the following guesses are probably wrong... If you have better
3009 : tests or hints, please send them to perlbug@perl.org
3010 : The metaconfig authors would also appreciate a copy...
3011 $test -f /irix && osname=irix
3012 $test -f /xenix && osname=sco_xenix
3013 $test -f /dynix && osname=dynix
3014 $test -f /dnix && osname=dnix
3015 $test -f /lynx.os && osname=lynxos
3016 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3017 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3018 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3019 $test -f /bin/mips && /bin/mips && osname=mips
3020 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3021 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3022 $test -d /usr/apollo/bin && osname=apollo
3023 $test -f /etc/saf/_sactab && osname=svr4
3024 $test -d /usr/include/minix && osname=minix
3025 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3026 if $test -d /MachTen -o -d /MachTen_Folder; then
3028 if $test -x /sbin/version; then
3029 osvers=`/sbin/version | $awk '{print $2}' |
3030 $sed -e 's/[A-Za-z]$//'`
3031 elif $test -x /usr/etc/version; then
3032 osvers=`/usr/etc/version | $awk '{print $2}' |
3033 $sed -e 's/[A-Za-z]$//'`
3039 $test -f /sys/posix.dll &&
3040 $test -f /usr/bin/what &&
3041 set X `/usr/bin/what /sys/posix.dll` &&
3042 $test "$3" = UWIN &&
3046 if $test -f $uname; then
3054 umips) osname=umips ;;
3057 [23]100) osname=mips ;;
3058 next*) osname=next ;;
3060 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3061 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3064 elif $test -f /etc/kconfig; then
3066 if test "$lns" = "$ln -s"; then
3068 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3070 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3077 if test -n "$DJGPP"; then
3086 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3088 # oslevel can fail with:
3089 # oslevel: Unable to acquire lock.
3090 *not\ found) osvers="$4"."$3" ;;
3091 '<3240'|'<>3240') osvers=3.2.0 ;;
3092 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3093 '=3250'|'>3250') osvers=3.2.5 ;;
3097 bsd386) osname=bsd386
3100 cygwin*) osname=cygwin
3103 *dc.osx) osname=dcosx
3109 domainos) osname=apollo
3115 dynixptx*) osname=dynixptx
3116 osvers=`echo "$4"|sed 's/^v//'`
3118 freebsd) osname=freebsd
3120 genix) osname=genix ;;
3124 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3140 netbsd*) osname=netbsd
3143 news-os) osvers="$3"
3145 4*) osname=newsos4 ;;
3149 next*) osname=next ;;
3150 nonstop-ux) osname=nonstopux ;;
3151 openbsd) osname=openbsd
3157 POSIX-BC | posix-bc ) osname=posix-bc
3160 powerux | power_ux | powermax_os | powermaxos | \
3161 powerunix | power_unix) osname=powerux
3167 solaris) osname=solaris
3169 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3176 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3180 titanos) osname=titanos
3189 ultrix) osname=ultrix
3192 osf1|mls+) case "$5" in
3195 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3198 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3201 hp*) osname=hp_osf1 ;;
3202 mips) osname=mips_osf1 ;;
3205 # UnixWare 7.1.2 is known as Open UNIX 8
3206 openunix|unixware) osname=svr5
3214 $2) case "$osname" in
3218 : svr4.x or possibly later
3228 if test -f /stand/boot ; then
3229 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3230 if test -n "$INITPROG" -a -f "$INITPROG"; then
3231 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3232 if test -n "$isesix"; then
3240 *) if test -f /etc/systemid; then
3242 set `echo $3 | $sed 's/\./ /g'` $4
3243 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3245 elif $test -f $src/hints/sco_$1_$2.sh; then
3247 elif $test -f $src/hints/sco_$1.sh; then
3252 '') : Still unknown. Probably a generic Sys V.
3261 *) case "$osname" in
3262 '') : Still unknown. Probably a generic BSD.
3270 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3271 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3272 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3275 $rm -f UU/kernel.what
3276 elif test -d c:/. -o -n "$is_os2" ; then
3283 case "$targetarch" in
3286 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3291 : Now look for a hint file osname_osvers, unless one has been
3292 : specified already.
3295 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3296 : Also try without trailing minor version numbers.
3297 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3298 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3299 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3300 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3303 *) case "$osvers" in
3306 *) if $test -f $src/hints/$file.sh ; then
3308 elif $test -f $src/hints/$xfile.sh ; then
3310 elif $test -f $src/hints/$xxfile.sh ; then
3312 elif $test -f $src/hints/$xxxfile.sh ; then
3314 elif $test -f $src/hints/$xxxxfile.sh ; then
3316 elif $test -f "$src/hints/${osname}.sh" ; then
3325 if $test -f Policy.sh ; then
3328 none) dflt="Policy" ;;
3329 *) dflt="Policy $dflt" ;;
3334 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3338 if $test -f Policy.sh ; then
3341 There's also a Policy hint file available, which should make the
3342 site-specific (policy) questions easier to answer.
3349 You may give one or more space-separated answers, or "none" if appropriate.
3350 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3351 is a good thing. DO NOT give a wrong version or a wrong OS.
3355 rp="Which of these apply, if any?"
3358 for file in $tans; do
3359 if $test X$file = XPolicy -a -f Policy.sh; then
3361 $cat Policy.sh >> UU/config.sh
3362 elif $test -f $src/hints/$file.sh; then
3363 . $src/hints/$file.sh
3364 $cat $src/hints/$file.sh >> UU/config.sh
3365 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3368 : Give one chance to correct a possible typo.
3369 echo "$file.sh does not exist"
3371 rp="hint to use instead?"
3373 for file in $ans; do
3374 if $test -f "$src/hints/$file.sh"; then
3375 . $src/hints/$file.sh
3376 $cat $src/hints/$file.sh >> UU/config.sh
3377 elif $test X$ans = X -o X$ans = Xnone ; then
3380 echo "$file.sh does not exist -- ignored."
3387 : Remember our hint file for later.
3388 if $test -f "$src/hints/$file.sh" ; then
3398 echo "Fetching default answers from $config_sh..." >&4
3402 cp $config_sh config.sh 2>/dev/null
3412 test "$override" && . ./optdef.sh
3414 : Restore computed paths
3415 for file in $loclist $trylist; do
3416 eval $file="\$_$file"
3421 Configure uses the operating system name and version to set some defaults.
3422 The default value is probably right if the name rings a bell. Otherwise,
3423 since spelling matters for me, either accept the default or answer "none"
3430 ''|' '|none) dflt=none ;;
3431 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3434 *) dflt="$osname" ;;
3436 rp="Operating system name?"
3440 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3446 ''|' '|none) dflt=none ;;
3447 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3448 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3450 ''|' ') dflt=none ;;
3455 *) dflt="$osvers" ;;
3457 rp="Operating system version?"
3467 : who configured the system
3468 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3471 cf_by=`(logname) 2>/dev/null`
3474 cf_by=`(whoami) 2>/dev/null`
3476 "") cf_by=unknown ;;
3481 : set up the script used to warn in case of inconsistency
3488 echo "*** WHOA THERE!!! ***" >&4
3489 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3490 rp=" Keep the $hint value?"
3493 y) td=$was; tu=$was;;
3497 : function used to set $1 to $val
3498 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3500 $define$undef) . ./whoa; eval "$var=\$td";;
3501 $undef$define) . ./whoa; eval "$var=\$tu";;
3502 *) eval "$var=$val";;
3506 $define|true|[yY]*) dflt='y';;
3511 Perl can be built to use the SOCKS proxy protocol library. To do so,
3512 Configure must be run with -Dusesocks. If you use SOCKS you also need
3513 to use the PerlIO abstraction layer, this will be implicitly selected.
3515 If this doesn't make any sense to you, just accept the default '$dflt'.
3517 rp='Build Perl for SOCKS?'
3520 y|Y) val="$define" ;;
3527 $define|true|[yY]*) useperlio="$define";;
3530 case "$useperlio" in
3531 $define|true|[yY]*|'') dflt='y';;
3536 Previous version of $package used the standard IO mechanisms as
3537 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3538 alternate IO mechanisms via the PerlIO abstraction layer, but the
3539 stdio mechanism is still available if needed. The abstraction layer
3540 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3541 Using PerlIO with sfio may cause problems with some extension modules.
3543 If this doesn't make any sense to you, just accept the default '$dflt'.
3545 rp='Use the PerlIO abstraction layer?'
3552 echo "Ok, doing things the stdio way."
3561 case "$useperlio" in
3562 $define|true|[yY]*) ;;
3565 You are using the SOCKS proxy protocol library which means that you
3566 should also use the PerlIO layer. You may be headed for trouble.
3575 case "$usethreads" in
3576 $define|true|[yY]*) dflt='y';;
3577 *) # Catch case where user specified ithreads or 5005threads but
3578 # forgot -Dusethreads (A.D. 4/2002)
3579 case "$useithreads$use5005threads" in
3581 case "$useperlio" in
3582 "$define") dflt='y' ;;
3592 Perl can be built to take advantage of threads on some systems.
3593 To do so, Configure can be run with -Dusethreads.
3595 Note that Perl built with threading support runs slightly slower
3596 and uses more memory than plain Perl. The current implementation
3597 is believed to be stable, but it is fairly new, and so should be
3598 treated with caution.
3600 If this doesn't make any sense to you, just accept the default '$dflt'.
3602 rp='Build a threading Perl?'
3605 y|Y) val="$define" ;;
3611 case "$usethreads" in
3615 Since release 5.6, Perl has had two different threading implementations,
3616 the newer interpreter-based version (ithreads) with one interpreter per
3617 thread, and the older 5.005 version (5005threads).
3618 The 5005threads version is effectively unmaintained and will probably be
3619 removed in Perl 5.10, so there should be no need to build a Perl using it
3620 unless needed for backwards compatibility with some existing 5.005threads
3624 : Default to ithreads unless overridden on command line or with
3627 case "$use5005threads" in
3628 $define|true|[yY]*) dflt='n';;
3630 case "$useithreads" in
3631 $undef|false|[nN]*) dflt='n';;
3633 rp='Use the newer interpreter-based ithreads?'
3636 y|Y) val="$define" ;;
3641 : Now set use5005threads to the opposite value.
3642 case "$useithreads" in
3643 $define) val="$undef" ;;
3650 useithreads="$undef"
3651 use5005threads="$undef"
3655 case "$useithreads$use5005threads" in
3659 You cannot have both the ithreads and the 5.005 threads enabled
3660 at the same time. Disabling the 5.005 threads since they are
3661 much less stable than the ithreads.
3664 use5005threads="$undef"
3668 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3671 *** To build with ithreads you must also use the PerlIO layer.
3672 *** Cannot continue, aborting.
3678 case "$d_oldpthreads" in
3679 '') : Configure tests would be welcome here. For now, assume undef.
3681 *) val="$d_oldpthreads" ;;
3687 : Look for a hint-file generated 'call-back-unit'. If the
3688 : user has specified that a threading perl is to be built,
3689 : we may need to set or change some other defaults.
3690 if $test -f usethreads.cbu; then
3691 echo "Your platform has some specific hints regarding threaded builds, using them..."
3694 case "$usethreads" in
3695 "$define"|true|[yY]*)
3697 (Your platform does not have any specific hints for threaded builds.
3698 Assuming POSIX threads, then.)
3706 Perl can be built so that multiple Perl interpreters can coexist
3707 within the same Perl executable.
3710 case "$useithreads" in
3713 This multiple interpreter support is required for interpreter-based threads.
3717 *) case "$usemultiplicity" in
3718 $define|true|[yY]*) dflt='y';;
3722 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3723 rp='Build Perl for multiplicity?'
3726 y|Y) val="$define" ;;
3735 case "$usemorebits" in
3736 "$define"|true|[yY]*)
3737 use64bitint="$define"
3738 uselongdouble="$define"
3739 usemorebits="$define"
3741 *) usemorebits="$undef"
3745 : make some quick guesses about what we are up against
3747 $echo $n "Hmm... $c"
3757 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3758 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3760 echo "Looks kind of like an OSF/1 system, but we'll see..."
3762 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3763 xxx=`./loc addbib blurfl $pth`
3764 if $test -f $xxx; then
3765 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3769 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3770 echo "Looks kind of like an extended USG system, but we'll see..."
3772 echo "Looks kind of like a USG system, but we'll see..."
3776 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3777 echo "Looks kind of like a BSD system, but we'll see..."
3781 echo "Looks kind of like a Version 7 system, but we'll see..."
3784 case "$eunicefix" in
3787 There is, however, a strange, musty smell in the air that reminds me of
3788 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3792 : it so happens the Eunice I know will not run shell scripts in Unix format
3796 echo "Congratulations. You aren't running Eunice."
3800 : Detect OS2. The p_ variable is set above in the Head.U unit.
3801 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3802 : semicolon as a patch separator
3807 I have the feeling something is not exactly right, however...don't tell me...
3808 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3809 (Or you may be running DOS with DJGPP.)
3814 if test -f /xenix; then
3815 echo "Actually, this looks more like a XENIX system..."
3820 echo "It's not Xenix..."
3825 if test -f /venix; then
3826 echo "Actually, this looks more like a VENIX system..."
3833 echo "Nor is it Venix..."
3836 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3837 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3844 rp="Use which C compiler?"
3848 : See if they have not cc but they do have gcc
3850 : Look for a hint-file generated 'call-back-unit'. Now that the
3851 : user has specified the compiler, we may need to set or change some
3853 if $test -f cc.cbu; then
3859 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3865 printf("%s\n", __VERSION__);
3867 printf("%s\n", "1");
3873 if $cc -o try $ccflags $ldflags try.c; then
3874 gccversion=`$run ./try`
3875 case "$gccversion" in
3876 '') echo "You are not using GNU cc." ;;
3877 *) echo "You are using GNU cc $gccversion."
3883 echo "*** WHOA THERE!!! ***" >&4
3884 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3885 case "$knowitall" in
3887 echo " You'd better start hunting for one and let me know about it." >&4
3893 case "$gccversion" in
3894 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3896 case "$gccversion" in
3897 '') gccosandvers='' ;;
3898 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3899 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3901 case "$gccosandvers" in
3902 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3903 $osname$osvers) ;; # looking good
3904 $osname*) cat <<EOM >&4
3906 *** WHOA THERE!!! ***
3908 Your gcc has not been compiled for the exact release of
3909 your operating system ($gccosandvers versus $osname$osvers).
3911 In general it is a good idea to keep gcc synchronized with
3912 the operating system because otherwise serious problems
3913 may ensue when trying to compile software, like Perl.
3915 I'm trying to be optimistic here, though, and will continue.
3916 If later during the configuration and build icky compilation
3917 problems appear (headerfile conflicts being the most common
3918 manifestation), I suggest reinstalling the gcc to match
3919 your operating system release.
3923 *) gccosandvers='' ;; # failed to parse, better be silent
3931 # gcc 3.* complain about adding -Idirectories that they already know about,
3932 # so we will take those off from locincpth.
3933 case "$gccversion" in
3935 echo "main(){}">try.c
3936 for incdir in $locincpth; do
3937 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3938 grep '^c[cp]p*[01]: warning: changing search order '`
3939 if test "X$warn" != X; then
3940 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3946 : decide how portable to be. Allow command line overrides.
3947 case "$d_portable" in
3949 *) d_portable="$define" ;;
3952 : set up shell script to do ~ expansion
3958 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3961 if $test -f /bin/csh; then
3962 /bin/csh -f -c "glob \$1"
3967 name=\`$expr x\$1 : '..\([^/]*\)'\`
3968 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3969 if $test ! -d "\$dir"; then
3971 echo "\$me: can't locate home directory for: \$name" >&2
3976 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3992 : now set up to get a file name
3996 cat <<'EOSC' >>getfile
4012 : getfile will accept an answer from the comma-separated list
4013 : enclosed in parentheses even if it does not meet other criteria.
4014 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4015 fn=`echo $fn | sed 's/(.*)//'`
4021 loc_file=`expr $fn : '.*:\(.*\)'`
4022 fn=`expr $fn : '\(.*\):.*'`
4030 */*) fullpath=true;;
4039 *e*) exp_file=true;;
4042 *p*) nopath_ok=true;;
4047 *d*) type='Directory';;
4048 *l*) type='Locate';;
4053 Locate) what='File';;
4058 case "$d_portable" in
4066 while test "$type"; do
4071 true) rp="$rp (~name ok)";;
4074 if test -f UU/getfile.ok && \
4075 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4094 value=`UU/filexp $ans`
4097 if test "$ans" != "$value"; then
4098 echo "(That expands to $value on this system.)"
4112 /*) value="$ansexp" ;;
4113 [a-zA-Z]:/*) value="$ansexp" ;;
4118 echo "I shall only accept a full path name, as in /bin/ls." >&4
4119 echo "Use a ! shell escape if you wish to check pathnames." >&4
4122 echo "Please give a full path name, starting with slash." >&4
4125 echo "Note that using ~name is ok provided it expands well." >&4
4138 for fp in $gfpth; do
4139 if test "X$fp" = X.; then
4144 if test -f "$pf"; then
4146 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4148 echo "($value is not a plain file, but that's ok.)"
4151 if test X"$type" = X; then
4158 for fp in $gfpth; do
4159 if test "X$fp" = X.; then
4164 direxp="$fp/$ansexp"
4166 if test -d "$direxp"; then
4174 if test -d "$ansexp"; then
4175 echo "(Looking for $loc_file in directory $value.)"
4176 value="$value/$loc_file"
4177 ansexp="$ansexp/$loc_file"
4179 if test -f "$ansexp"; then
4182 case "$nopath_ok" in
4183 true) case "$value" in
4185 *) echo "Assuming $value will be in people's path."
4201 if test "$fastread" = yes; then
4206 rp="$what $value doesn't exist. Use that name anyway?"
4225 test "X$gfpthkeep" != Xy && gfpth=""
4228 : What should the include directory be ?
4230 $echo $n "Hmm... $c"
4234 if $test -f /bin/mips && /bin/mips; then
4235 echo "Looks like a MIPS system..."
4236 $cat >usr.c <<'EOCP'
4237 #ifdef SYSTYPE_BSD43
4241 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4242 dflt='/bsd43/usr/include'
4246 mips_type='System V'
4248 $rm -f usr.c usr.out
4249 echo "and you're compiling with the $mips_type compiler and libraries."
4253 echo "Doesn't look like a MIPS system."
4263 case "$xxx_prompt" in
4266 rp='Where are the include files you want to use?'
4274 : see how we invoke the C preprocessor
4276 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4277 cat <<'EOT' >testcpp.c
4283 if test ! -f cppstdin; then
4284 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4285 # AIX cc -E doesn't show the absolute headerfile
4286 # locations but we'll cheat by using the -M flag.
4287 echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
4289 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4292 echo "Keeping your $hint cppstdin wrapper."
4295 wrapper=`pwd`/cppstdin
4299 if $test "X$cppstdin" != "X" && \
4300 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4301 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4303 echo "You used to use $cppstdin $cppminus so we'll use that again."
4305 '') echo "But let's see if we can live without a wrapper..." ;;
4307 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4308 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4310 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4313 echo "(However, $cpprun $cpplast does not work, let's see...)"
4321 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4328 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4329 $cc -E <testcpp.c >testcpp.out 2>&1; \
4330 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4331 echo "Yup, it does."
4334 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4335 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4336 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4337 echo "Yup, it does."
4340 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4341 $cc -P <testcpp.c >testcpp.out 2>&1; \
4342 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4343 echo "Yipee, that works!"
4346 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4347 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4348 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4349 echo "At long last!"
4352 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4353 $cpp <testcpp.c >testcpp.out 2>&1; \
4354 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4358 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4359 $cpp - <testcpp.c >testcpp.out 2>&1; \
4360 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4361 echo "Hooray, it works! I was beginning to wonder."
4364 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4365 $wrapper <testcpp.c >testcpp.out 2>&1; \
4366 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4372 rp="No dice. I can't find a C preprocessor. Name one:"
4376 $x_cpp <testcpp.c >testcpp.out 2>&1
4377 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4378 echo "OK, that will do." >&4
4380 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4395 echo "Perhaps can we force $cc -E using a wrapper..."
4396 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4397 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4403 echo "Nope, we'll have to live without it..."
4417 "$wrapper"|'cppstdin') ;;
4418 *) $rm -f $wrapper;;
4420 $rm -f testcpp.c testcpp.out
4422 : Set private lib path
4425 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4430 '') dlist="$loclibpth $plibpth $glibpth";;
4431 *) dlist="$libpth";;
4434 : Now check and see which directories actually exist, avoiding duplicates
4438 if $test -d $xxx; then
4441 *) libpth="$libpth $xxx";;
4447 Some systems have incompatible or broken versions of libraries. Among
4448 the directories listed in the question below, please remove any you
4449 know not to be holding relevant libraries, and add any that are needed.
4450 Say "none" for none.
4461 rp="Directories to use for library searches?"
4468 : compute shared library extension
4471 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4481 On some systems, shared libraries may be available. Answer 'none' if
4482 you want to suppress searching of shared libraries for the remainder
4483 of this configuration.
4486 rp='What is the file extension used for shared libraries?'
4490 : Define several unixisms.
4491 : Hints files or command line option can be used to override them.
4492 : The convoluted testing is in case hints files set either the old
4495 '') case "$exe_ext" in
4497 *) _exe="$exe_ext" ;;
4502 '') case "$lib_ext" in
4509 '') case "$obj_ext" in
4516 '') case "$path_sep" in
4527 : Which makefile gets called first. This is used by make depend.
4528 case "$firstmakefile" in
4529 '') firstmakefile='makefile';;
4533 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4536 case "$uselongdouble" in
4537 $define|true|[yY]*) dflt='y';;
4542 Perl can be built to take advantage of long doubles which
4543 (if available) may give more accuracy and range for floating point numbers.
4545 If this doesn't make any sense to you, just accept the default '$dflt'.
4547 rp='Try to use long doubles if available?'
4550 y|Y) val="$define" ;;
4556 case "$uselongdouble" in
4557 true|[yY]*) uselongdouble="$define" ;;
4560 : Look for a hint-file generated 'call-back-unit'. If the
4561 : user has specified that long doubles should be used,
4562 : we may need to set or change some other defaults.
4563 if $test -f uselongdouble.cbu; then
4564 echo "Your platform has some specific hints regarding long doubles, using them..."
4565 . ./uselongdouble.cbu
4567 case "$uselongdouble" in
4570 (Your platform does not have any specific hints for long doubles.)
4576 : Looking for optional libraries
4578 echo "Checking for optional libraries..." >&4
4583 case "$libswanted" in
4584 '') libswanted='c_s';;
4587 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4593 for thisdir in $libpth $xlibpth; do
4594 test -d $thisdir && libspath="$libspath $thisdir"
4596 for thislib in $libswanted; do
4597 for thisdir in $libspath; do
4599 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4600 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4601 $test -f "$xxx" && eval $libscheck
4602 $test -f "$xxx" && libstyle=shared
4604 if test ! -f "$xxx"; then
4605 xxx=$thisdir/lib$thislib.$so
4606 $test -f "$xxx" && eval $libscheck
4607 $test -f "$xxx" && libstyle=shared
4609 if test ! -f "$xxx"; then
4610 xxx=$thisdir/lib$thislib$_a
4611 $test -f "$xxx" && eval $libscheck
4612 $test -f "$xxx" && libstyle=static
4614 if test ! -f "$xxx"; then
4615 xxx=$thisdir/$thislib$_a
4616 $test -f "$xxx" && eval $libscheck
4617 $test -f "$xxx" && libstyle=static
4619 if test ! -f "$xxx"; then
4620 xxx=$thisdir/lib${thislib}_s$_a
4621 $test -f "$xxx" && eval $libscheck
4622 $test -f "$xxx" && libstyle=static
4623 $test -f "$xxx" && thislib=${thislib}_s
4625 if test ! -f "$xxx"; then
4626 xxx=$thisdir/Slib$thislib$_a
4627 $test -f "$xxx" && eval $libscheck
4628 $test -f "$xxx" && libstyle=static
4630 if $test -f "$xxx"; then
4632 shared) echo "Found -l$thislib (shared)." ;;
4633 static) echo "Found -l$thislib." ;;
4634 *) echo "Found -l$thislib ($libstyle)." ;;
4638 *) dflt="$dflt -l$thislib"
4639 libsfound="$libsfound $xxx"
4641 libsfiles="$libsfiles $yyy"
4642 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4643 case " $libsdirs " in
4645 *) libsdirs="$libsdirs $yyy" ;;
4652 if $test ! -f "$xxx"; then
4653 echo "No -l$thislib."
4664 ' '|'') dflt='none';;
4669 In order to compile $package on your machine, a number of libraries
4670 are usually needed. Include any other special libraries here as well.
4671 Say "none" for none. The default list is almost always right.
4675 rp="What libraries to use?"
4682 : determine optimization, if desired, or use for debug flag also
4684 ' '|$undef) dflt='none';;
4686 *) dflt="$optimize";;
4690 By default, $package compiles with the -O flag to use the optimizer.
4691 Alternately, you might want to use the symbolic debugger, which uses
4692 the -g flag (on traditional Unix systems). Either flag can be
4693 specified here. To use neither flag, specify the word "none".
4696 rp="What optimizer/debugger flag should be used?"
4700 'none') optimize=" ";;
4704 : We will not override a previous value, but we might want to
4705 : augment a hint file
4707 default|recommended)
4708 case "$gccversion" in
4709 1*) dflt='-fpcc-struct-return' ;;
4712 *-g*) dflt="$dflt -DDEBUGGING";;
4714 case "$gccversion" in
4715 2*) if test -d /etc/conf/kconfig.d &&
4716 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4718 # Interactive Systems (ISC) POSIX mode.
4723 case "$gccversion" in
4727 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4728 echo 'int main(void) { return 0; }' > gcctest.c
4729 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4730 echo "Yes, it does." 2>&1
4733 echo "Leaving current flags $ccflags alone." 2>&1
4735 *) dflt="$dflt -fno-strict-aliasing" ;;
4738 echo "Nope, it doesn't, but that's ok." 2>&1
4742 # For gcc, adding -pipe speeds up compilations for some, but apparently
4743 # some assemblers can't read from stdin. (It also slows down compilations
4744 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4745 case "$gccversion" in
4747 echo "Checking if your compiler accepts -pipe" 2>&1
4748 echo 'int main(void) { return 0; }' > gcctest.c
4749 if $cc -O2 -pipe -o gcctest gcctest.c; then
4750 echo "Yes, it does." 2>&1
4753 echo "Leaving current flags $ccflags alone." 2>&1
4755 *) dflt="$dflt -pipe" ;;
4758 echo "Nope, it doesn't, but that's ok." 2>&1
4765 case "$mips_type" in
4766 *BSD*|'') inclwanted="$locincpth $usrinc";;
4767 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4769 for thisincl in $inclwanted; do
4770 if $test -d $thisincl; then
4771 if $test x$thisincl != x$usrinc; then
4773 *" -I$thisincl "*);;
4774 *) dflt="$dflt -I$thisincl ";;
4780 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4782 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4790 *) dflt="$dflt -D$2";;
4794 set signal.h LANGUAGE_C; eval $inctest
4798 ccflags="$ccflags -DSOCKS"
4803 default|recommended) dflt="$ccflags $dflt" ;;
4804 *) dflt="$ccflags";;
4813 Your C compiler may want other flags. For this question you should include
4814 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4815 but you should NOT include libraries or ld flags like -lwhatever. If you
4816 want $package to honor its debug switch, you should include -DDEBUGGING here.
4817 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4819 To use no flags, specify the word "none".
4825 rp="Any additional cc flags?"
4832 : the following weeds options from ccflags that are of no interest to cpp
4834 '') cppflags="$ccflags" ;;
4835 *) cppflags="$cppflags $ccflags" ;;
4837 case "$gccversion" in
4838 1*) cppflags="$cppflags -D__GNUC__"
4840 case "$mips_type" in
4842 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4848 echo "Let me guess what the preprocessor flags are..." >&4
4862 *) ftry="$previous $flag";;
4864 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4865 >cpp1.out 2>/dev/null && \
4866 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4867 >cpp2.out 2>/dev/null && \
4868 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4869 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4871 cppflags="$cppflags $ftry"
4881 *-*) echo "They appear to be: $cppflags";;
4883 $rm -f cpp.c cpp?.out
4887 : flags used in final linking phase
4889 '') if ./venix; then
4895 *-posix*) dflt="$dflt -posix" ;;
4898 *) dflt="$ldflags";;
4901 : Try to guess additional flags to pick up local libraries.
4902 for thislibdir in $libpth; do
4903 case " $loclibpth " in
4906 *"-L$thislibdir "*) ;;
4907 *) dflt="$dflt -L$thislibdir" ;;
4919 Your C linker may need flags. For this question you should
4920 include -L/whatever and any other flags used by the C linker, but you
4921 should NOT include libraries like -lwhatever.
4923 Make sure you include the appropriate -L/path flags if your C linker
4924 does not normally search all of the directories you specified above,
4927 To use no flags, specify the word "none".
4931 rp="Any additional ld flags (NOT including libraries)?"
4937 rmlist="$rmlist pdp11"
4941 echo "Checking your choice of C compiler and flags for coherency..." >&4
4942 $cat > try.c <<'EOF'
4944 int main() { printf("Ok\n"); return(0); }
4946 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4948 $cat >try.msg <<'EOM'
4949 I've tried to compile and run the following simple program:
4952 $cat try.c >> try.msg
4954 $cat >> try.msg <<EOM
4961 and I got the following output:
4965 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4966 if $sh -c "$run ./try" >>try.msg 2>&1; then
4970 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4973 cat >> try.msg <<'EOQS'
4974 If $libs contains -lsfio, and sfio is mis-configured, then it
4975 sometimes (apparently) runs and exits with a 0 status, but with no
4976 output! It may have to do with sfio's use of _exit vs. exit.
4979 rp="You have a big problem. Shall I abort Configure"
4986 echo "The program compiled OK, but exited with status $?." >>try.msg
4987 rp="You have a problem. Shall I abort Configure"
4991 echo "I can't compile the test program." >>try.msg
4992 rp="You have a BIG problem. Shall I abort Configure"
4998 case "$knowitall" in
5000 echo "(The supplied flags or libraries might be incorrect.)"
5008 *) echo "Ok. Stopping Configure." >&4
5013 n) echo "OK, that should do.";;
5015 $rm -f try try.* core
5017 : define a shorthand compile call
5021 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5022 : define a shorthand compile call for compilations that should be ok.
5026 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5028 : determine filename position in cpp output
5030 echo "Computing filename position in cpp output for #include directives..." >&4
5032 vos) testaccess=-e ;;
5035 echo '#include <stdio.h>' > foo.c
5038 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5039 $grep '^[ ]*#.*stdio\.h' | \
5040 while read cline; do
5043 while $test \$# -gt 0; do
5044 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5049 pos=\`expr \$pos + 1\`
5061 *) pos="${fieldn}th";;
5063 echo "Your cpp writes the filename in the $pos field of the line."
5066 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5067 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5070 : locate header file
5075 for usrincdir in $usrinc
5077 if test -f \$usrincdir/\$wanted; then
5078 echo "\$usrincdir/\$wanted"
5082 awkprg='{ print \$$fieldn }'
5083 echo "#include <\$wanted>" > foo\$\$.c
5084 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5085 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5086 while read cline; do
5087 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5089 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5090 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5095 # status = 0: grep returned 0 lines, case statement not executed
5096 # status = 1: headerfile found
5097 # status = 2: while loop executed, no headerfile found
5101 if test \$status -eq 1; then
5108 : define an alternate in-header-list? function
5109 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5110 cont=true; xxf="echo \"<\$1> found.\" >&4";
5111 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5112 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5114 case $# in 4) instead=instead;; *) instead="at last";; esac;
5115 while $test "$cont"; do
5117 var=$2; eval "was=\$$2";
5118 if $test "$xxx" && $test -r "$xxx";
5120 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5123 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5124 set $yyy; shift; shift; yyy=$@;
5125 case $# in 0) cont="";;
5126 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5127 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5128 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5129 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5133 do set $yyy; var=$2; eval "was=\$$2";
5134 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5135 set $yyy; shift; shift; yyy=$@;
5138 : see if stdlib is available
5139 set stdlib.h i_stdlib
5142 : check for lengths of integral types
5146 echo "Checking to see how big your integers are..." >&4
5155 printf("intsize=%d;\n", (int)sizeof(int));
5156 printf("longsize=%d;\n", (int)sizeof(long));
5157 printf("shortsize=%d;\n", (int)sizeof(short));
5162 if eval $compile_ok && $run ./try > /dev/null; then
5164 echo "Your integers are $intsize bytes long."
5165 echo "Your long integers are $longsize bytes long."
5166 echo "Your short integers are $shortsize bytes long."
5170 Help! I can't compile and run the intsize test program: please enlighten me!
5171 (This is probably a misconfiguration in your system or libraries, and
5172 you really ought to fix it. Still, I'll try anyway.)
5176 rp="What is the size of an integer (in bytes)?"
5180 rp="What is the size of a long integer (in bytes)?"
5184 rp="What is the size of a short integer (in bytes)?"
5192 : check for long long
5194 echo "Checking to see if you have long long..." >&4
5195 echo 'int main() { long long x = 7; return 0; }' > try.c
5197 if eval $compile; then
5199 echo "You have long long."
5202 echo "You do not have long long."
5208 : check for length of long long
5209 case "${d_longlong}${longlongsize}" in
5212 echo "Checking to see how big your long longs are..." >&4
5213 $cat >try.c <<'EOCP'
5217 printf("%d\n", (int)sizeof(long long));
5222 if eval $compile_ok; then
5223 longlongsize=`$run ./try`
5224 echo "Your long longs are $longlongsize bytes long."
5228 echo "(I can't seem to compile the test program. Guessing...)"
5229 rp="What is the size of a long long (in bytes)?"
5233 if $test "X$longsize" = "X$longlongsize"; then
5234 echo "(That isn't any different from an ordinary long.)"
5240 : see if inttypes.h is available
5241 : we want a real compile instead of Inhdr because some systems
5242 : have an inttypes.h which includes non-existent headers
5245 #include <inttypes.h>
5247 static int32_t foo32 = 0x12345678;
5251 if eval $compile; then
5252 echo "<inttypes.h> found." >&4
5255 echo "<inttypes.h> NOT found." >&4
5264 echo "Checking to see if you have int64_t..." >&4
5266 #include <sys/types.h>
5267 #$i_inttypes I_INTTYPES
5269 #include <inttypes.h>
5271 int main() { int64_t x = 7; }
5274 if eval $compile; then
5276 echo "You have int64_t."
5279 echo "You do not have int64_t."
5287 echo "Checking which 64-bit integer type we could use..." >&4
5293 val='"unsigned int"'
5298 *) case "$longsize" in
5302 val='"unsigned long"'
5307 *) case "$d_longlong:$longlongsize" in
5312 val='"unsigned long long"'
5317 *) case "$d_int64_t" in
5336 '') echo "Alas, no 64-bit integer types in sight." >&4
5339 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5345 case "$uselonglong" in
5346 "$define"|true|[yY]*)
5349 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5351 use64bitint="$define"
5354 case "$use64bits" in
5355 "$define"|true|[yY]*)
5358 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5360 use64bitint="$define"
5363 case "$use64bitints" in
5364 "$define"|true|[yY]*)
5367 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5369 use64bitint="$define"
5372 case "$use64bitsint" in
5373 "$define"|true|[yY]*)
5376 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5378 use64bitint="$define"
5381 case "$uselonglongs" in
5382 "$define"|true|[yY]*)
5385 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5387 use64bitint="$define"
5390 case "$use64bitsall" in
5391 "$define"|true|[yY]*)
5394 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5396 use64bitall="$define"
5401 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5403 case "$use64bitall" in
5404 "$define"|true|[yY]*) use64bitint="$define" ;;
5410 You have natively 64-bit long integers.
5414 *) case "$use64bitint" in
5415 "$define"|true|[yY]*) dflt='y';;
5424 Perl can be built to take advantage of 64-bit integer types
5425 on some systems. To do so, Configure can be run with -Duse64bitint.
5426 Choosing this option will most probably introduce binary incompatibilities.
5428 If this doesn't make any sense to you, just accept the default '$dflt'.
5429 (The default has been chosen based on your configuration.)
5431 rp='Try to use 64-bit integers, if available?'
5434 [yY]*) val="$define" ;;
5442 case "$use64bitall" in
5443 "$define"|true|[yY]*) dflt='y' ;;
5444 *) case "$longsize" in
5452 You may also choose to try maximal 64-bitness. It means using as much
5453 64-bitness as possible on the platform. This in turn means even more
5454 binary incompatibilities. On the other hand, your platform may not
5455 have any more 64-bitness available than what you already have chosen.
5457 If this doesn't make any sense to you, just accept the default '$dflt'.
5458 (The default has been chosen based on your configuration.)
5460 rp='Try to use maximal 64-bit support, if available?'
5463 [yY]*) val="$define" ;;
5468 case "$use64bitall" in
5470 case "$use64bitint" in
5474 Since you have chosen a maximally 64-bit build, I'm also turning on
5475 the use of 64-bit integers.
5477 use64bitint="$define" ;;
5482 : Look for a hint-file generated 'call-back-unit'. If the
5483 : user has specified that a 64-bit perl is to be built,
5484 : we may need to set or change some other defaults.
5485 if $test -f use64bitint.cbu; then
5486 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5489 case "$use64bitint" in
5490 "$define"|true|[yY]*)
5492 4) case "$archname64" in
5493 '') archname64=64int ;;
5500 : Look for a hint-file generated 'call-back-unit'. If the
5501 : user has specified that a maximally 64-bit perl is to be built,
5502 : we may need to set or change some other defaults.
5503 if $test -f use64bitall.cbu; then
5504 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5507 case "$use64bitall" in
5508 "$define"|true|[yY]*)
5510 4) case "$archname64" in
5511 ''|64int) archname64=64all ;;
5518 case "$d_quad:$use64bitint" in
5522 *** You have chosen to use 64-bit integers,
5523 *** but none can be found.
5524 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5525 *** Cannot continue, aborting.
5532 : check for length of double
5534 case "$doublesize" in
5536 echo "Checking to see how big your double precision numbers are..." >&4
5545 printf("%d\n", (int)sizeof(double));
5550 if eval $compile_ok; then
5551 doublesize=`$run ./try`
5552 echo "Your double is $doublesize bytes long."
5555 echo "(I can't seem to compile the test program. Guessing...)"
5556 rp="What is the size of a double precision number (in bytes)?"
5564 : check for long doubles
5566 echo "Checking to see if you have long double..." >&4
5567 echo 'int main() { long double x = 7.0; }' > try.c
5569 if eval $compile; then
5571 echo "You have long double."
5574 echo "You do not have long double."
5580 : check for length of long double
5581 case "${d_longdbl}${longdblsize}" in
5584 echo "Checking to see how big your long doubles are..." >&4
5585 $cat >try.c <<'EOCP'
5589 printf("%d\n", sizeof(long double));
5594 if eval $compile; then
5595 longdblsize=`$run ./try`
5596 echo "Your long doubles are $longdblsize bytes long."
5600 echo "(I can't seem to compile the test program. Guessing...)" >&4
5601 rp="What is the size of a long double (in bytes)?"
5605 if $test "X$doublesize" = "X$longdblsize"; then
5606 echo "That isn't any different from an ordinary double."
5607 echo "I'll keep your setting anyway, but you may see some"
5608 echo "harmless compilation warnings."
5614 : determine the architecture name
5616 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5617 tarch=`arch`"-$osname"
5618 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5619 if uname -m > tmparch 2>&1 ; then
5620 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5621 -e 's/$/'"-$osname/" tmparch`
5629 case "$myarchname" in
5632 echo "(Your architecture name used to be $myarchname.)"
5636 case "$targetarch" in
5638 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5643 *) dflt="$archname";;
5645 rp='What is your architecture name'
5648 case "$usethreads" in
5650 echo "Threads selected." >&4
5652 *-thread*) echo "...and architecture name already has -thread." >&4
5654 *) archname="$archname-thread"
5655 echo "...setting architecture name to $archname." >&4
5660 case "$usemultiplicity" in
5662 echo "Multiplicity selected." >&4
5664 *-multi*) echo "...and architecture name already has -multi." >&4
5666 *) archname="$archname-multi"
5667 echo "...setting architecture name to $archname." >&4
5672 case "$use64bitint$use64bitall" in
5674 case "$archname64" in
5676 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5679 case "$use64bitint" in
5680 "$define") echo "64 bit integers selected." >&4 ;;
5682 case "$use64bitall" in
5683 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5686 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5688 *) archname="$archname-$archname64"
5689 echo "...setting architecture name to $archname." >&4
5695 case "$uselongdouble" in
5697 echo "Long doubles selected." >&4
5698 case "$longdblsize" in
5700 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5704 *-ld*) echo "...and architecture name already has -ld." >&4
5706 *) archname="$archname-ld"
5707 echo "...setting architecture name to $archname." >&4
5714 case "$useperlio" in
5716 echo "Perlio selected." >&4
5719 echo "Perlio not selected, using stdio." >&4
5721 *-stdio*) echo "...and architecture name already has -stdio." >&4
5723 *) archname="$archname-stdio"
5724 echo "...setting architecture name to $archname." >&4
5729 if $test -f archname.cbu; then
5730 echo "Your platform has some specific hints for architecture name, using them..."
5734 : determine root of directory hierarchy where package will be installed.
5737 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5740 dflt=`echo "$prefix" | sed 's/.$//'`
5748 By default, $package will be installed in $dflt/bin, manual pages
5749 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5750 installation directories. Typically this is something like /usr/local.
5751 If you wish to have binaries under /usr/bin but other parts of the
5752 installation under /usr/local, that's ok: you will be prompted
5753 separately for each of the installation directories, the prefix being
5754 only used to set the defaults.
5758 rp='Installation prefix to use?'
5766 *) oldprefix="$prefix";;
5775 *) afsroot=$afsroot ;;
5781 $define|true) afs=true ;;
5782 $undef|false) afs=false ;;
5783 *) if test -d $afsroot; then
5791 echo "AFS may be running... I'll be extra cautious then..." >&4
5793 echo "AFS does not seem to be running..." >&4
5796 : determine installation prefix for where package is to be installed.
5800 Since you are running AFS, I need to distinguish the directory in which
5801 files will reside from the directory in which they are installed (and from
5802 which they are presumably copied to the former directory by occult means).
5805 case "$installprefix" in
5806 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5807 *) dflt="$installprefix";;
5812 In some special cases, particularly when building $package for distribution,
5813 it is convenient to distinguish the directory in which files should be
5814 installed from the directory ($prefix) in which they will
5815 eventually reside. For most users, these two directories are the same.
5818 case "$installprefix" in
5820 *) dflt=$installprefix;;
5824 rp='What installation prefix should I use for installing files?'
5826 installprefix="$ans"
5827 installprefixexp="$ansexp"
5829 : set the prefixit variable, to compute a suitable default value
5830 prefixit='case "$3" in
5832 case "$oldprefix" in
5833 "") eval "$1=\"\$$2\"";;
5840 ""|" ") eval "$1=\"\$$2\"";;
5846 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5848 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5849 /*-$oldprefix/*|\~*-$oldprefix/*)
5850 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5851 *) eval "$1=\"\$$2\"";;
5855 : get the patchlevel
5857 echo "Getting the current patchlevel..." >&4
5858 if $test -r $rsrc/patchlevel.h;then
5859 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5860 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5861 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5862 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5863 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5864 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5865 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5874 $echo "(You do not have patchlevel.h. Eek.)"
5876 if $test -r $rsrc/.patch ; then
5877 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5878 perl_patchlevel=`cat $rsrc/.patch`
5881 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5882 version_patchlevel_string="version $patchlevel subversion $subversion"
5883 case "$perl_patchlevel" in
5885 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5888 $echo "(You have $package $version_patchlevel_string.)"
5892 : XXX Should be a Configure test for double-dots in filenames.
5893 version=`echo $revision $patchlevel $subversion | \
5894 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5895 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5896 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5899 version=`echo $revision $patchlevel $subversion | \
5900 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5901 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5902 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5905 : Special case the 5.005_xx maintenance series, which used 5.005
5906 : without any subversion label as a subdirectory in $sitelib
5907 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5908 api_versionstring='5.005'
5911 : determine installation style
5912 : For now, try to deduce it from prefix unless it is already set.
5913 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5914 case "$installstyle" in
5915 '') case "$prefix" in
5916 *perl*) dflt='lib';;
5917 *) dflt='lib/perl5' ;;
5920 *) dflt="$installstyle" ;;
5922 : Probably not worth prompting for this since we prompt for all
5923 : the directories individually, and the prompt would be too long and
5927 : determine where private library files go
5928 : Usual default is /usr/local/lib/perl5/$version.
5929 : Also allow things like /opt/perl/lib/$version, since
5930 : /opt/perl/lib/perl5... would be redundant.
5931 : The default "style" setting is made in installstyle.U
5932 case "$installstyle" in
5933 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5934 *) set dflt privlib lib/$version ;;
5939 There are some auxiliary files for $package that need to be put into a
5940 private library directory that is accessible by everyone.
5944 rp='Pathname where the private library files will reside?'
5947 privlibexp="$ansexp"
5948 : Change installation prefix, if necessary.
5949 if $test X"$prefix" != X"$installprefix"; then
5950 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5952 installprivlib="$privlibexp"
5955 : set the prefixup variable, to restore leading tilda escape
5956 prefixup='case "$prefixexp" in
5958 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5961 : determine where public architecture dependent libraries go
5964 : privlib default is /usr/local/lib/$package/$version
5965 : archlib default is /usr/local/lib/$package/$version/$archname
5966 : privlib may have an optional trailing /share.
5967 tdflt=`echo $privlib | $sed 's,/share$,,'`
5968 tdflt=$tdflt/$archname
5977 $spackage contains architecture-dependent library files. If you are
5978 sharing libraries in a heterogeneous environment, you might store
5979 these files in a separate location. Otherwise, you can just include
5980 them with the rest of the public library files.
5984 rp='Where do you want to put the public architecture-dependent libraries?'
5987 archlibexp="$ansexp"
5988 if $test X"$archlib" = X"$privlib"; then
5993 : Change installation prefix, if necessary.
5994 if $test X"$prefix" != X"$installprefix"; then
5995 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
5997 installarchlib="$archlibexp"
6000 : see if setuid scripts can be secure
6003 Some kernels have a bug that prevents setuid #! scripts from being
6004 secure. Some sites have disabled setuid #! scripts because of this.
6006 First let's decide if your kernel supports secure setuid #! scripts.
6007 (If setuid #! scripts would be secure but have been disabled anyway,
6008 don't say that they are secure if asked.)
6013 if $test -d /dev/fd; then
6014 echo "#!$ls" >reflect
6015 chmod +x,u+s reflect
6016 ./reflect >flect 2>&1
6017 if $contains "/dev/fd" flect >/dev/null; then
6018 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6022 If you are not sure if they are secure, I can check but I'll need a
6023 username and password different from the one you are using right now.
6024 If you don't have such a username or don't want me to test, simply
6028 rp='Other username to test security of setuid scripts with?'
6033 case "$d_suidsafe" in
6034 '') echo "I'll assume setuid scripts are *not* secure." >&4
6037 echo "Well, the $hint value is *not* secure." >&4
6039 *) echo "Well, the $hint value *is* secure." >&4
6044 $rm -f reflect flect
6045 echo "#!$ls" >reflect
6046 chmod +x,u+s reflect
6049 echo '"su" will (probably) prompt you for '"$ans's password."
6050 su $ans -c './reflect >flect'
6051 if $contains "/dev/fd" flect >/dev/null; then
6052 echo "Okay, it looks like setuid scripts are secure." >&4
6055 echo "I don't think setuid scripts are secure." >&4
6060 rp='Does your kernel have *secure* setuid scripts?'
6063 [yY]*) val="$define";;
6068 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6069 echo "(That's for file descriptors, not floppy disks.)"
6075 $rm -f reflect flect
6077 : now see if they want to do setuid emulation
6080 case "$d_suidsafe" in
6083 echo "No need to emulate SUID scripts since they are secure here." >&4
6087 Some systems have disabled setuid scripts, especially systems where
6088 setuid scripts cannot be secure. On systems where setuid scripts have
6089 been disabled, the setuid/setgid bits on scripts are currently
6090 useless. It is possible for $package to detect those bits and emulate
6091 setuid/setgid in a secure fashion. This emulation will only work if
6092 setuid scripts have been disabled in your kernel.
6096 "$define") dflt=y ;;
6099 rp="Do you want to do setuid/setgid emulation?"
6102 [yY]*) val="$define";;
6110 : see if this is a malloc.h system
6111 : we want a real compile instead of Inhdr because some systems have a
6112 : malloc.h that just gives a compile error saying to use stdlib.h instead
6117 int main () { return 0; }
6120 if eval $compile; then
6121 echo "<malloc.h> found." >&4
6124 echo "<malloc.h> NOT found." >&4
6131 : check for void type
6133 echo "Checking to see how well your C compiler groks the void type..." >&4
6134 case "$voidflags" in
6146 extern void moo(); /* function returning void */
6147 void (*goo)(); /* ptr to func returning void */
6149 void *hue; /* generic ptr */
6162 int main() { sub(); }
6164 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6165 voidflags=$defvoidused
6166 echo "Good. It appears to support void to the level $package wants.">&4
6167 if $contains warning .out >/dev/null 2>&1; then
6168 echo "However, you might get some warnings that look like this:"
6172 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6173 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6174 echo "It supports 1..."
6175 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6176 echo "It also supports 2..."
6177 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6179 echo "And it supports 4 but not 8 definitely."
6181 echo "It doesn't support 4..."
6182 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6184 echo "But it supports 8."
6187 echo "Neither does it support 8."
6191 echo "It does not support 2..."
6192 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6194 echo "But it supports 4 and 8."
6196 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6198 echo "And it supports 4 but has not heard about 8."
6200 echo "However it supports 8 but not 4."
6205 echo "There is no support at all for void."
6210 case "$voidflags" in
6213 Support flag bits are:
6214 1: basic void declarations.
6215 2: arrays of pointers to functions returning void.
6216 4: operations between pointers to and addresses of void functions.
6217 8: generic void pointers.
6220 rp="Your void support flags add up to what?"
6227 : check for length of pointer
6231 echo "Checking to see how big your pointers are..." >&4
6232 if test "$voidflags" -gt 7; then
6233 echo '#define VOID_PTR char *' > try.c
6235 echo '#define VOID_PTR void *' > try.c
6245 printf("%d\n", (int)sizeof(VOID_PTR));
6250 if eval $compile_ok; then
6251 ptrsize=`$run ./try`
6252 echo "Your pointers are $ptrsize bytes long."
6255 echo "(I can't seem to compile the test program. Guessing...)" >&4
6256 rp="What is the size of a pointer (in bytes)?"
6263 case "$use64bitall" in
6264 "$define"|true|[yY]*)
6268 *** You have chosen a maximally 64-bit build,
6269 *** but your pointers are only 4 bytes wide.
6270 *** Please rerun Configure without -Duse64bitall.
6275 *** Since you have quads, you could possibly try with -Duse64bitint.
6280 *** Cannot continue, aborting.
6291 : determine whether to use malloc wrapping
6293 case "$usemallocwrap" in
6294 [yY]*|true|$define) dflt='y' ;;
6295 [nN]*|false|$undef) dflt='n' ;;
6296 *) case "$usedevel" in
6297 [yY]*|true|$define) dflt='y' ;;
6302 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6304 usemallocwrap="$ans"
6307 usemallocwrap="$define" ;;
6309 usemallocwrap="$undef" ;;
6312 : determine which malloc to compile in
6314 case "$usemymalloc" in
6315 [yY]*|true|$define) dflt='y' ;;
6316 [nN]*|false|$undef) dflt='n' ;;
6317 *) case "$ptrsize" in
6323 rp="Do you wish to attempt to use the malloc that comes with $package?"
6329 mallocsrc='malloc.c'
6330 mallocobj="malloc$_o"
6331 d_mymalloc="$define"
6334 : Remove malloc from list of libraries to use
6335 echo "Removing unneeded -lmalloc from library list" >&4
6336 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6339 echo "libs = $libs" >&4
6351 : compute the return types of malloc and free
6353 $cat >malloc.c <<END
6357 #include <sys/types.h>
6371 case "$malloctype" in
6373 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6380 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6384 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6391 echo "Your system uses $freetype free(), it would seem." >&4
6395 After $package is installed, you may wish to install various
6396 add-on modules and utilities. Typically, these add-ons will
6397 be installed under $prefix with the rest
6398 of this package. However, you may wish to install such add-ons
6399 elsewhere under a different prefix.
6401 If you do not wish to put everything under a single prefix, that's
6402 ok. You will be prompted for the individual locations; this siteprefix
6403 is only used to suggest the defaults.
6405 The default should be fine for most people.
6409 rp='Installation prefix to use for add-on modules and utilities?'
6410 : XXX Here might be another good place for an installstyle setting.
6411 case "$siteprefix" in
6413 *) dflt=$siteprefix ;;
6416 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6418 case "$siteprefix" in
6422 *) oldsiteprefix="$prefix";;
6427 siteprefixexp="$ansexp"
6429 : determine where site specific libraries go.
6430 : Usual default is /usr/local/lib/perl5/site_perl/$version
6431 : The default "style" setting is made in installstyle.U
6432 : XXX No longer works with Prefixit stuff.
6433 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6435 '') case "$installstyle" in
6436 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6437 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6445 The installation process will create a directory for
6446 site-specific extensions and modules. Most users find it convenient
6447 to place all site-specific files in this directory rather than in the
6448 main distribution directory.
6452 rp='Pathname for the site-specific library files?'
6455 sitelibexp="$ansexp"
6456 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6457 : Change installation prefix, if necessary.
6458 if $test X"$prefix" != X"$installprefix"; then
6459 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6461 installsitelib="$sitelibexp"
6464 : determine where site specific architecture-dependent libraries go.
6465 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6466 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6467 : sitelib may have an optional trailing /share.
6469 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6470 dflt="$dflt/$archname"
6475 set sitearch sitearch none
6479 The installation process will also create a directory for
6480 architecture-dependent site-specific extensions and modules.
6484 rp='Pathname for the site-specific architecture-dependent library files?'
6487 sitearchexp="$ansexp"
6488 : Change installation prefix, if necessary.
6489 if $test X"$prefix" != X"$installprefix"; then
6490 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6492 installsitearch="$sitearchexp"
6497 The installation process will also create a directory for
6498 vendor-supplied add-ons. Vendors who supply perl with their system
6499 may find it convenient to place all vendor-supplied files in this
6500 directory rather than in the main distribution directory. This will
6501 ease upgrades between binary-compatible maintenance versions of perl.
6503 Of course you may also use these directories in whatever way you see
6504 fit. For example, you might use them to access modules shared over a
6505 company-wide network.
6507 The default answer should be fine for most people.
6508 This causes further questions about vendor add-ons to be skipped
6509 and no vendor-specific directories will be configured for perl.
6512 rp='Do you want to configure vendor-specific add-on directories?'
6513 case "$usevendorprefix" in
6514 define|true|[yY]*) dflt=y ;;
6515 *) : User may have set vendorprefix directly on Configure command line.
6516 case "$vendorprefix" in
6525 rp='Installation prefix to use for vendor-supplied add-ons?'
6526 case "$vendorprefix" in
6528 *) dflt=$vendorprefix ;;
6531 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6533 case "$vendorprefix" in
6537 *) oldvendorprefix="$prefix";;
6541 usevendorprefix="$define"
6543 vendorprefixexp="$ansexp"
6545 *) usevendorprefix="$undef"
6551 case "$vendorprefix" in
6552 '') d_vendorlib="$undef"
6556 *) d_vendorlib="$define"
6557 : determine where vendor-supplied modules go.
6558 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6559 case "$vendorlib" in
6561 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6562 case "$installstyle" in
6563 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6564 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6567 *) dflt="$vendorlib"
6571 rp='Pathname for the vendor-supplied library files?'
6574 vendorlibexp="$ansexp"
6577 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6578 : Change installation prefix, if necessary.
6579 if $test X"$prefix" != X"$installprefix"; then
6580 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6582 installvendorlib="$vendorlibexp"
6585 case "$vendorprefix" in
6586 '') d_vendorarch="$undef"
6590 *) d_vendorarch="$define"
6591 : determine where vendor-supplied architecture-dependent libraries go.
6592 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6593 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6594 : vendorlib may have an optional trailing /share.
6595 case "$vendorarch" in
6596 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6597 dflt="$dflt/$archname"
6599 *) dflt="$vendorarch" ;;
6602 rp='Pathname for vendor-supplied architecture-dependent files?'
6605 vendorarchexp="$ansexp"
6608 : Change installation prefix, if necessary.
6609 if $test X"$prefix" != X"$installprefix"; then
6610 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6612 installvendorarch="$vendorarchexp"
6615 : Final catch-all directories to search
6618 Lastly, you can have perl look in other directories for extensions and
6619 modules in addition to those already specified.
6620 These directories will be searched after
6624 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6625 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6627 case "$otherlibdirs" in
6628 ''|' ') dflt='none' ;;
6629 *) dflt="$otherlibdirs" ;;
6632 Enter a colon-separated set of extra paths to include in perl's @INC
6633 search path, or enter 'none' for no extra paths.
6637 rp='Colon-separated list of additional directories for perl to search?'
6640 ' '|''|none) otherlibdirs=' ' ;;
6641 *) otherlibdirs="$ans" ;;
6643 case "$otherlibdirs" in
6647 set d_perl_otherlibdirs
6650 : Cruising for prototypes
6652 echo "Checking out function prototypes..." >&4
6653 $cat >prototype.c <<EOCP
6658 int main(int argc, char *argv[]) {
6661 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6662 echo "Your C compiler appears to support function prototypes."
6665 echo "Your C compiler doesn't seem to understand function prototypes."
6672 case "$prototype" in
6674 *) ansi2knr='ansi2knr'
6679 This version of $package can only be compiled by a compiler that
6680 understands function prototypes. Unfortunately, your C compiler
6682 doesn't seem to understand them. Sorry about that.
6684 If GNU cc is available for your system, perhaps you could try that instead.
6686 Eventually, we hope to support building Perl with pre-ANSI compilers.
6687 If you would like to help in that effort, please contact <perlbug@perl.org>.
6689 Aborting Configure now.
6695 : determine where public executables go
6700 rp='Pathname where the public executables will reside?'
6702 if $test "X$ansexp" != "X$binexp"; then
6707 : Change installation prefix, if necessary.
6708 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6709 if $test X"$prefix" != X"$installprefix"; then
6710 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6712 installbin="$binexp"
6721 Perl can be built with extra modules or bundles of modules which
6722 will be fetched from the CPAN and installed alongside Perl.
6724 Notice that you will need access to the CPAN; either via the Internet,
6725 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6726 be asked later to configure the CPAN.pm module which will in turn do
6727 the installation of the rest of the extra modules or bundles.)
6729 Notice also that if the modules require any external software such as
6730 libraries and headers (the libz library and the zlib.h header for the
6731 Compress::Zlib module, for example) you MUST have any such software
6732 already installed, this configuration process will NOT install such
6735 If this doesn't make any sense to you, just accept the default '$dflt'.
6737 rp='Install any extra modules (y or n)?'
6743 Please list any extra modules or bundles to be installed from CPAN,
6744 with spaces between the names. The names can be in any format the
6745 'install' command of CPAN.pm will understand. (Answer 'none',
6746 without the quotes, to install no extra modules or bundles.)
6756 $rm -f ../extras.lst
6758 *) echo "(Saving the list of extras for later...)"
6759 echo "$extras" > ../extras.lst
6767 : determine where html pages for programs go
6768 set html1dir html1dir none
6772 If you wish to install html files for programs in $spackage, indicate
6773 the appropriate directory here. To skip installing html files,
6777 ''|none|$undef|' ') dflt=none ;;
6778 *) dflt=$html1dir ;;
6781 rp="Directory for the main $spackage html pages?"
6784 html1direxp="$ansexp"
6785 : Use ' ' for none so value is preserved next time through Configure
6786 $test X"$html1dir" = "X" && html1dir=' '
6787 : Change installation prefix, if necessary.
6788 if $test X"$prefix" != X"$installprefix"; then
6789 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
6791 installhtml1dir="$html1direxp"
6794 : determine where html pages for libraries and modules go
6795 set html3dir html3dir none
6799 If you wish to install html files for modules associated with $spackage,
6800 indicate the appropriate directory here. To skip installing html files,
6803 : There is no obvious default. If they have specified html1dir, then
6804 : try to key off that, possibly changing .../html1 into .../html3.
6806 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6807 *) dflt=$html3dir ;;
6810 rp="Directory for the $spackage module html pages?"
6813 html3direxp="$ansexp"
6814 : Use ' ' for none so value is preserved next time through Configure
6815 $test X"$html3dir" = "X" && html3dir=' '
6816 : Change installation prefix, if necessary.
6817 if $test X"$prefix" != X"$installprefix"; then
6818 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
6820 installhtml3dir="$html3direxp"
6823 : Find perl5.005 or later.
6824 echo "Looking for a previously installed perl5.005 or later... "
6826 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6827 : Check if this perl is recent and can load a simple module
6828 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6831 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6841 '') echo "None found. That's ok.";;
6842 *) echo "Using $perl5." ;;
6845 : Determine list of previous versions to include in @INC
6846 $cat > getverlist <<EOPL
6849 \$api_versionstring = "$api_versionstring";
6850 \$version = "$version";
6851 \$stem = "$sitelib_stem";
6852 \$archname = "$archname";
6854 $cat >> getverlist <<'EOPL'
6855 # Can't have leading @ because metaconfig interprets it as a command!
6856 ;@inc_version_list=();
6857 # XXX Redo to do opendir/readdir?
6860 ;@candidates = glob("5.*");
6866 # XXX ToDo: These comparisons must be reworked when two-digit
6867 # subversions come along, so that 5.7.10 compares as greater than
6868 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6869 # widespread that we can use the built-in version vectors rather
6870 # than reinventing them here. For 5.6.0, however, we must
6871 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6872 foreach $d (@candidates) {
6873 if ($d lt $version) {
6874 if ($d ge $api_versionstring) {
6875 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6877 elsif ($d ge "5.005") {
6878 unshift(@inc_version_list, grep { -d } $d);
6882 # Skip newer version. I.e. don't look in
6883 # 5.7.0 if we're installing 5.6.1.
6887 if (@inc_version_list) {
6888 print join(' ', @inc_version_list);
6891 # Blank space to preserve value for next Configure run.
6896 case "$inc_version_list" in
6897 '') if test -x "$perl5$exe_ext"; then
6898 dflt=`$perl5 getverlist`
6903 $undef) dflt='none' ;;
6904 *) eval dflt=\"$inc_version_list\" ;;
6907 ''|' ') dflt=none ;;
6914 In order to ease the process of upgrading, this version of perl
6915 can be configured to use modules built and installed with earlier
6916 versions of perl that were installed under $prefix. Specify here
6917 the list of earlier versions that this version of perl should check.
6918 If Configure detected no earlier versions of perl installed under
6919 $prefix, then the list will be empty. Answer 'none' to tell perl
6920 to not search earlier versions.
6922 The default should almost always be sensible, so if you're not sure,
6923 just accept the default.
6926 rp='List of earlier versions to include in @INC?'
6929 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6930 *) inc_version_list="$ans" ;;
6932 case "$inc_version_list" in
6934 inc_version_list_init='0';;
6935 *) inc_version_list_init=`echo $inc_version_list |
6936 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6941 : determine whether to install perl also as /usr/bin/perl
6944 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6946 Many scripts expect perl to be installed as /usr/bin/perl.
6948 If you want to, I can install the perl you are about to compile
6949 as /usr/bin/perl (in addition to $bin/perl).
6951 if test -f /usr/bin/perl; then
6954 However, please note that because you already have a /usr/bin/perl,
6955 overwriting that with a new Perl would very probably cause problems.
6956 Therefore I'm assuming you don't want to do that (unless you insist).
6959 case "$installusrbinperl" in
6960 "$define"|[yY]*) dflt='y';;
6966 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
6969 case "$installusrbinperl" in
6970 "$undef"|[nN]*) dflt='n';;
6974 rp="Do you want to install perl as /usr/bin/perl?"
6977 [yY]*) val="$define";;
6983 set installusrbinperl
6987 echo "Checking for GNU C Library..." >&4
6989 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6990 alone are insufficient to distinguish different versions, such as
6991 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6992 libc version 2.1.0. A. Dougherty, June 3, 2002.
6998 # ifdef __GLIBC_MINOR__
6999 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
7000 # include <gnu/libc-version.h>
7001 printf("%s\n", gnu_get_libc_version());
7003 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7006 printf("%d\n", __GLIBC__);
7015 if eval $compile_ok && $run ./try > glibc.ver; then
7017 gnulibc_version=`$cat glibc.ver`
7018 echo "You are using the GNU C Library version $gnulibc_version"
7022 echo "You are not using the GNU C Library"
7024 $rm -f try try.* glibc.ver
7028 : see if nm is to be used to determine whether a symbol is defined or not
7032 case "$d_gnulibc" in
7035 echo "nm probably won't work on the GNU C Library." >&4
7041 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7043 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7044 echo "'nm' won't be sufficient on this sytem." >&4
7050 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7051 if $test $dflt -gt 20; then
7061 true|$define) dflt=y;;
7068 I can use $nm to extract the symbols from your C libraries. This
7069 is a time consuming task which may generate huge output on the disk (up
7070 to 3 megabytes) but that should make the symbols extraction faster. The
7071 alternative is to skip the 'nm' extraction part and to compile a small
7072 test program instead to determine whether each symbol is present. If
7073 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7074 this may be the best solution.
7076 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7079 rp="Shall I use $nm to extract C symbols from the libraries?"
7082 [Nn]*) usenm=false;;
7091 : nm options which may be necessary
7093 '') if $test -f /mach_boot; then
7095 elif $test -d /usr/ccs/lib; then
7096 nm_opt='-p' # Solaris (and SunOS?)
7097 elif $test -f /dgux; then
7099 elif $test -f /lib64/rld; then
7100 nm_opt='-p' # 64-bit Irix
7106 : nm options which may be necessary for shared libraries but illegal
7107 : for archive libraries. Thank you, Linux.
7108 case "$nm_so_opt" in
7109 '') case "$myuname" in
7111 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7112 nm_so_opt='--dynamic'
7121 : get list of predefined functions in a handy place
7126 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7132 *) for thislib in $libs; do
7135 : Handle C library specially below.
7138 thislib=`echo $thislib | $sed -e 's/^-l//'`
7139 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7141 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7143 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7145 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7147 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7149 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7151 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7156 libnames="$libnames $try"
7158 *) libnames="$libnames $thislib" ;;
7167 for xxx in $libpth; do
7168 $test -r $1 || set $xxx/libc.$so
7169 : The messy sed command sorts on library version numbers.
7171 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7172 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7174 s/[0-9][0-9]*/0000&/g
7175 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7178 $sort | $sed -e 's/^.* //'`
7181 $test -r $1 || set /usr/ccs/lib/libc.$so
7182 $test -r $1 || set /lib/libsys_s$_a
7188 if $test -r "$1"; then
7189 echo "Your (shared) C library seems to be in $1."
7191 elif $test -r /lib/libc && $test -r /lib/clib; then
7192 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7194 libc='/lib/clib /lib/libc'
7195 if $test -r /lib/syslib; then
7196 echo "(Your math library is in /lib/syslib.)"
7197 libc="$libc /lib/syslib"
7199 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7200 echo "Your C library seems to be in $libc, as you said before."
7201 elif $test -r $incpath/usr/lib/libc$_a; then
7202 libc=$incpath/usr/lib/libc$_a;
7203 echo "Your C library seems to be in $libc. That's fine."
7204 elif $test -r /lib/libc$_a; then
7206 echo "Your C library seems to be in $libc. You're normal."
7208 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7210 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7211 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7212 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7214 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7216 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7219 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7221 if $test -r "$tans"; then
7222 echo "Your C library seems to be in $tans, of all places."
7228 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7232 If the guess above is wrong (which it might be if you're using a strange
7233 compiler, or your machine supports multiple models), you can override it here.
7238 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7240 I can't seem to find your C library. I've looked in the following places:
7243 $sed 's/^/ /' libpath
7246 None of these seems to contain your C library. I need to get its name...
7251 rp='Where is your C library?'
7256 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7257 set X `cat libnames`
7260 case $# in 1) xxx=file; esac
7261 echo "Extracting names from the following $xxx for later perusal:" >&4
7263 $sed 's/^/ /' libnames >&4
7265 $echo $n "This may take a while...$c" >&4
7269 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7270 *) $nm $nm_opt $file 2>/dev/null;;
7275 $grep fprintf libc.tmp > libc.ptf
7276 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7277 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7279 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7281 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7283 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7285 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7287 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7289 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7291 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7293 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7295 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7297 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7299 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7301 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7303 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7304 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7306 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7308 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7310 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7312 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7314 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7316 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7318 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7320 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7322 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7324 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7326 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7328 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7330 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7332 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7334 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7337 $nm -p $* 2>/dev/null >libc.tmp
7338 $grep fprintf libc.tmp > libc.ptf
7339 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7340 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7346 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7348 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7349 for thisname in $libnames $libc; do
7350 $ar t $thisname >>libc.tmp
7352 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7354 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7355 # Repeat libc to extract forwarders to DLL entries too
7356 for thisname in $libnames $libc; do
7357 $ar tv $thisname >>libc.tmp
7358 # Revision 50 of EMX has bug in $ar.
7359 # it will not extract forwarders to DLL entries
7360 # Use emximp which will extract exactly them.
7361 emximp -o tmp.imp $thisname \
7363 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7364 < tmp.imp >>libc.tmp
7367 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7370 echo "$ar didn't seem to work right." >&4
7371 echo "Maybe this is a Cray...trying bld instead..." >&4
7372 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7374 for thisname in $libnames; do
7376 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7377 $ar t $thisname >>libc.tmp
7381 echo "That didn't work either. Giving up." >&4
7391 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7392 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7394 *) if $test -f /lib/syscalls.exp; then
7396 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7397 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7403 $rm -f libnames libpath
7405 : see if dld is available
7409 : is a C symbol defined?
7412 -v) tf=libc.tmp; tdc="";;
7413 -a) tf=libc.tmp; tdc="[]";;
7414 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7417 case "$reuseval-$4" in
7419 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7424 if $test "$runnm" = true; then
7425 if $contains $tlook $tf >/dev/null 2>&1; then
7427 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7428 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7429 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7430 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7431 $rm -f try$_exe try.c core core.* try.core;
7434 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7435 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7436 $rm -f try$_exe try.c;
7441 $define) tval=true;;
7448 : define an is-in-libc? function
7449 inlibc='echo " "; td=$define; tu=$undef;
7450 sym=$1; var=$2; eval "was=\$$2";
7452 case "$reuseval$was" in
7462 echo "$sym() found." >&4;
7463 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7465 echo "$sym() NOT found." >&4;
7466 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7470 $define) echo "$sym() found." >&4;;
7471 *) echo "$sym() NOT found." >&4;;
7475 : see if dlopen exists
7482 : determine which dynamic loading, if any, to compile in
7484 dldir="ext/DynaLoader"
7497 $define) dflt='y' ;;
7500 $define) dflt='y' ;;
7502 : Does a dl_xxx.xs file exist for this operating system
7503 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7506 rp="Do you wish to use dynamic loading?"
7513 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7514 dflt="$dldir/dl_${osname}.xs"
7515 elif $test "$d_dlopen" = "$define" ; then
7516 dflt="$dldir/dl_dlopen.xs"
7517 elif $test "$i_dld" = "$define" ; then
7518 dflt="$dldir/dl_dld.xs"
7523 *) dflt="$dldir/$dlsrc"
7526 echo "The following dynamic loading files are available:"
7527 : Can not go over to $dldir because getfile has path hard-coded in.
7528 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7529 rp="Source file to use for dynamic loading"
7535 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7539 Some systems may require passing special flags to $cc -c to
7540 compile modules that will be used to create a shared library.
7541 To use no flags, say "none".
7544 case "$cccdlflags" in
7545 '') case "$gccversion" in
7546 '') case "$osname" in
7548 next) dflt='none' ;;
7549 irix*) dflt='-KPIC' ;;
7550 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7551 sunos) dflt='-pic' ;;
7555 *) case "$osname" in
7556 darwin) dflt='none' ;;
7557 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7562 *) dflt="$cccdlflags" ;;
7564 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7567 none) cccdlflags=' ' ;;
7568 *) cccdlflags="$ans" ;;
7573 Some systems use ld to create libraries that can be dynamically loaded,
7574 while other systems (such as those using ELF) use $cc.
7578 '') $cat >try.c <<EOM
7579 /* Test for whether ELF binaries are produced */
7587 int i = open("a.out",O_RDONLY);
7590 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7591 exit(0); /* succeed (yes, it's ELF) */
7596 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7598 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7602 echo "I'll use ld to build dynamic libraries."
7611 rp="What command should be used to create dynamic libraries?"
7617 Some systems may require passing special flags to $ld to create a
7618 library that can be dynamically loaded. If your ld flags include
7619 -L/other/path options to locate libraries outside your loader's normal
7620 search path, you may need to specify those -L options here as well. To
7621 use no flags, say "none".
7624 case "$lddlflags" in
7625 '') case "$osname" in
7626 beos) dflt='-nostart' ;;
7628 case "$gccversion" in
7629 '') dflt="$dflt +vnocompatwarnings" ;;
7632 linux|irix*|gnu*) dflt='-shared' ;;
7633 next) dflt='none' ;;
7634 solaris) dflt='-G' ;;
7635 sunos) dflt='-assert nodefinitions' ;;
7636 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7640 *) dflt="$lddlflags" ;;
7643 : Try to guess additional flags to pick up local libraries.
7644 : Be careful not to append to a plain 'none'
7648 for thisflag in $ldflags; do
7653 *) dflt="$dflt $thisflag" ;;
7660 ''|' ') dflt='none' ;;
7663 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7666 none) lddlflags=' ' ;;
7667 *) lddlflags="$ans" ;;
7672 Some systems may require passing special flags to $cc to indicate that
7673 the resulting executable will use dynamic linking. To use no flags,
7677 case "$ccdlflags" in
7678 '') case "$osname" in
7679 linux|hpux|gnu*) dflt='-Wl,-E' ;;
7680 next|sunos) dflt='none' ;;
7684 *) dflt="$ccdlflags" ;;
7686 rp="Any special flags to pass to $cc to use dynamic linking?"
7689 none) ccdlflags=' ' ;;
7690 *) ccdlflags="$ans" ;;
7704 # No dynamic loading being used, so don't bother even to prompt.
7707 *) case "$useshrplib" in
7708 '') case "$osname" in
7709 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7711 also='Building a shared libperl is required for dynamic loading to work on your system.'
7716 also='Building a shared libperl is needed for MAB support.'
7734 The perl executable is normally obtained by linking perlmain.c with
7735 libperl${_a}, any static extensions (usually just DynaLoader), and
7736 any other libraries needed on this system (such as -lm, etc.). Since
7737 your system supports dynamic loading, it is probably possible to build
7738 a shared libperl.$so. If you will have more than one executable linked
7739 to libperl.$so, this will significantly reduce the size of each
7740 executable, but it may have a noticeable affect on performance. The
7741 default is probably sensible for your system.
7745 rp="Build a shared libperl.$so (y/n)"
7749 useshrplib='true' ;;
7750 *) useshrplib='false' ;;
7755 case "$useshrplib" in
7759 # Figure out a good name for libperl.so. Since it gets stored in
7760 # a version-specific architecture-dependent library, the version
7761 # number isn't really that important, except for making cc/ld happy.
7763 # A name such as libperl.so.3.1
7764 majmin="libperl.$so.$patchlevel.$subversion"
7765 # A name such as libperl.so.301
7766 majonly=`echo $patchlevel $subversion |
7767 $awk '{printf "%d%02d", $1, $2}'`
7768 majonly=libperl.$so.$majonly
7769 # I'd prefer to keep the os-specific stuff here to a minimum, and
7770 # rely on figuring it out from the naming of libc.
7771 case "${osname}${osvers}" in
7774 # XXX How handle the --version stuff for MAB?
7776 linux*|gnu*) # ld won't link with a bare -lperl otherwise.
7779 cygwin*) # ld links against an importlib
7780 dflt=libperl$lib_ext
7782 *) # Try to guess based on whether libc has major.minor.
7784 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7785 *libc.$so.[0-9]*) dflt=$majonly ;;
7786 *) dflt=libperl.$so ;;
7796 I need to select a good name for the shared libperl. If your system uses
7797 library names with major and minor numbers, then you might want something
7798 like $majmin. Alternatively, if your system uses a single version
7799 number for shared libraries, then you might want to use $majonly.
7800 Or, your system might be quite happy with a simple libperl.$so.
7802 Since the shared libperl will get installed into a version-specific
7803 architecture-dependent directory, the version number of the shared perl
7804 library probably isn't important, so the default should be o.k.
7807 rp='What name do you want to give to the shared libperl?'
7810 echo "Ok, I'll use $libperl"
7813 libperl="libperl${_a}"
7817 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7821 WARNING: Use of the shrpdir variable for the installation location of
7822 the shared $libperl is not supported. It was never documented and
7823 will not work in this version. Let me (perlbug@perl.org)
7824 know of any problems this may cause.
7830 But your current setting of $shrpdir is
7831 the default anyway, so it's harmless.
7836 Further, your current attempted setting of $shrpdir
7837 conflicts with the value of $archlibexp/CORE
7838 that installperl will use.
7845 # How will the perl executable find the installed shared $libperl?
7846 # Add $xxx to ccdlflags.
7847 # If we can't figure out a command-line option, use $shrpenv to
7848 # set env LD_RUN_PATH. The main perl makefile uses this.
7849 shrpdir=$archlibexp/CORE
7852 if "$useshrplib"; then
7855 # We'll set it in Makefile.SH...
7860 freebsd|netbsd|openbsd|interix)
7861 xxx="-Wl,-R$shrpdir"
7863 bsdos|linux|irix*|dec_osf|gnu*)
7864 xxx="-Wl,-rpath,$shrpdir"
7867 # next doesn't like the default...
7870 # beos doesn't like the default, either.
7873 # hpux doesn't like the default, either.
7874 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7877 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7883 # Only add $xxx if it isn't already in ccdlflags.
7884 case " $ccdlflags " in
7886 *) ccdlflags="$ccdlflags $xxx"
7889 Adding $xxx to the flags
7890 passed to $ld so that the perl executable will find the
7891 installed shared $libperl.
7899 # Fix ccdlflags in AIX for building external extensions.
7900 # (For building Perl itself bare -bE:perl.exp is needed,
7901 # Makefile.SH takes care of this.)
7903 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7905 # Respect a hint or command-line value.
7907 '') shrpenv="$tmp_shrpenv" ;;
7909 case "$ldlibpthname" in
7910 '') ldlibpthname=LD_LIBRARY_PATH ;;
7911 none) ldlibpthname='' ;;
7914 : determine where manual pages are on this system
7918 syspath='/usr/share/man/man1 /usr/man/man1'
7919 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7920 syspath="$syspath /usr/man/u_man/man1"
7921 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7922 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7923 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7924 sysman=`./loc . /usr/man/man1 $syspath`
7927 if $test -d "$sysman"; then
7928 echo "System manual is in $sysman." >&4
7930 echo "Could not find manual pages in source form." >&4
7933 : determine where manual pages go
7934 set man1dir man1dir none
7938 $spackage has manual pages available in source form.
7942 echo "However, you don't have nroff, so they're probably useless to you."
7944 '') man1dir="none";;
7947 echo "If you don't want the manual sources installed, answer 'none'."
7952 lookpath="$prefixexp/share/man/man1"
7953 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7954 lookpath="$lookpath $prefixexp/man/p_man/man1"
7955 lookpath="$lookpath $prefixexp/man/u_man/man1"
7956 lookpath="$lookpath $prefixexp/man/man.1"
7958 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7959 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7969 rp="Where do the main $spackage manual pages (source) go?"
7971 if $test "X$man1direxp" != "X$ansexp"; then
7975 man1direxp="$ansexp"
7981 : Change installation prefix, if necessary.
7982 if $test X"$prefix" != X"$installprefix"; then
7983 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7985 installman1dir="$man1direxp"
7988 : What suffix to use on installed man pages
7995 rp="What suffix should be used for the main $spackage man pages?"
7997 '') case "$man1dir" in
8011 *) dflt="$man1ext";;
8018 : see if we can have long filenames
8020 first=123456789abcdef
8022 if (echo hi >$first) 2>/dev/null; then
8023 if $test -f 123456789abcde; then
8024 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8027 echo 'You can have filenames longer than 14 characters.'>&4
8032 You can't have filenames longer than 14 chars.
8033 You can't even think about them!
8039 $rm -rf 123456789abcde*
8041 : determine where library module manual pages go
8042 set man3dir man3dir none
8046 $spackage has manual pages for many of the library modules.
8052 However, you don't have nroff, so they're probably useless to you.
8055 '') man3dir="none";;
8059 case "$d_flexfnam" in
8062 However, your system can't handle the long file names like File::Basename.3.
8065 '') man3dir="none";;
8069 echo "If you don't want the manual sources installed, answer 'none'."
8070 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8072 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8073 if $test -d "$privlib/man/man3"; then
8076 WARNING: Previous versions of perl installed man3 pages into
8077 $privlib/man/man3. This version will suggest a
8078 new default of $dflt.
8082 rp='Do you wish to preserve the old behavior?(y/n)'
8085 y*) dflt="$privlib/man/man3" ;;
8090 *) dflt="$man3dir" ;;
8097 rp="Where do the $package library man pages (source) go?"
8100 man3direxp="$ansexp"
8106 : Change installation prefix, if necessary.
8107 if $test X"$prefix" != X"$installprefix"; then
8108 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8110 installman3dir="$man3direxp"
8113 : What suffix to use on installed man pages
8119 rp="What suffix should be used for the $package library man pages?"
8121 '') case "$man3dir" in
8135 *) dflt="$man3ext";;
8142 : see if we have to deal with yellow pages, now NIS.
8143 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8144 if $test -f /usr/etc/nibindd; then
8146 echo "I'm fairly confident you're on a NeXT."
8148 rp='Do you get the hosts file via NetInfo?'
8157 y*) hostcat='nidump hosts .';;
8158 *) case "$hostcat" in
8159 nidump*) hostcat='';;
8169 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8177 rp='Are you getting the hosts file via yellow pages?'
8180 y*) hostcat='ypcat hosts';;
8181 *) hostcat='cat /etc/hosts';;
8187 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8190 '') test -f /etc/group && groupcat='cat /etc/group';;
8193 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8196 : now get the host name
8198 echo "Figuring out host name..." >&4
8199 case "$myhostname" in
8201 echo 'Maybe "hostname" will work...'
8202 if tans=`sh -c hostname 2>&1` ; then
8210 if $test "$cont"; then
8212 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8213 if tans=`cat /etc/systemid 2>&1` ; then
8215 phostname='cat /etc/systemid'
8216 echo "Whadyaknow. Xenix always was a bit strange..."
8219 elif $test -r /etc/systemid; then
8220 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8223 if $test "$cont"; then
8224 echo 'No, maybe "uuname -l" will work...'
8225 if tans=`sh -c 'uuname -l' 2>&1` ; then
8227 phostname='uuname -l'
8229 echo 'Strange. Maybe "uname -n" will work...'
8230 if tans=`sh -c 'uname -n' 2>&1` ; then
8232 phostname='uname -n'
8234 echo 'Oh well, maybe I can mine it out of whoami.h...'
8235 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8236 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8237 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8239 case "$myhostname" in
8240 '') echo "Does this machine have an identity crisis or something?"
8243 echo "Well, you said $myhostname before..."
8244 phostname='echo $myhostname';;
8250 case "$myhostname" in
8251 '') myhostname=noname ;;
8253 : you do not want to know about this
8258 if $test "$myhostname" ; then
8260 rp='Your host name appears to be "'$myhostname'".'" Right?"
8268 : bad guess or no guess
8269 while $test "X$myhostname" = X ; do
8271 rp="Please type the (one word) name of your host:"
8276 : translate upper to lower if necessary
8277 case "$myhostname" in
8279 echo "(Normalizing case in your host name)"
8280 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8284 case "$myhostname" in
8286 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8287 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8288 echo "(Trimming domain name from host name--host name is now $myhostname)"
8290 *) case "$mydomain" in
8293 test "X$hostcat" = "Xypcat hosts" &&
8294 ypmatch "$myhostname" hosts 2>/dev/null |\
8295 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8298 test "X$hostcat" != "X" &&
8299 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8300 /[ ]$myhostname[ . ]/p" > hosts
8303 if $test -f hosts; then
8304 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8305 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8306 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8307 hosts | $sort | $uniq | \
8308 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8309 case `$echo X$dflt` in
8310 X*\ *) echo "(Several hosts in the database matched hostname)"
8313 X.) echo "(You do not have fully-qualified names in the hosts database)"
8317 echo "(I cannot locate a hosts database anywhere)"
8322 tans=`./loc resolv.conf X /etc /usr/etc`
8323 if $test -f "$tans"; then
8324 echo "(Attempting domain name extraction from $tans)"
8325 dflt=.`$sed -n -e 's/ / /g' \
8326 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8327 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8329 .) dflt=.`$sed -n -e 's/ / /g' \
8330 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8331 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8338 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8339 dflt=.`sh -c domainname 2>/dev/null`
8342 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8346 case "$dflt$osname" in
8347 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8348 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8352 .) echo "(Lost all hope -- silly guess then)"
8358 *) dflt="$mydomain";;
8362 rp="What is your domain name?"
8372 : translate upper to lower if necessary
8375 echo "(Normalizing case in your domain name)"
8376 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8380 : a little sanity check here
8381 case "$phostname" in
8384 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8385 $myhostname$mydomain|$myhostname) ;;
8387 case "$phostname" in
8389 echo "(That doesn't agree with your whoami.h file, by the way.)"
8392 echo "(That doesn't agree with your $phostname command, by the way.)"
8402 I need to get your e-mail address in Internet format if possible, i.e.
8403 something like user@host.domain. Please answer accurately since I have
8404 no easy means to double check it. The default value provided below
8405 is most probably close to reality but may not be valid from outside
8406 your organization...
8410 while test "$cont"; do
8412 '') dflt="$cf_by@$myhostname$mydomain";;
8413 *) dflt="$cf_email";;
8415 rp='What is your e-mail address?'
8421 rp='Address does not look like an Internet one. Use it anyway?'
8437 If you or somebody else will be maintaining perl at your site, please
8438 fill in the correct e-mail address here so that they may be contacted
8439 if necessary. Currently, the "perlbug" program included with perl
8440 will send mail to this address in addition to perlbug@perl.org. You may
8441 enter "none" for no administrator.
8444 case "$perladmin" in
8445 '') dflt="$cf_email";;
8446 *) dflt="$perladmin";;
8448 rp='Perl administrator e-mail address'
8452 : determine whether to only install version-specific parts.
8455 Do you want to install only the version-specific parts of the perl
8456 distribution? Usually you do *not* want to do this.
8458 case "$versiononly" in
8459 "$define"|[Yy]*|true) dflt='y' ;;
8462 rp="Do you want to install only the version-specific parts of perl?"
8465 [yY]*) val="$define";;
8471 case "$versiononly" in
8472 "$define") inc_version_list=''
8473 inc_version_list_init=0
8477 : figure out how to guarantee perl startup
8478 case "$startperl" in
8480 case "$sharpbang" in
8484 I can use the #! construct to start perl on your system. This will
8485 make startup of perl scripts faster, but may cause problems if you
8486 want to share those scripts and perl is not in a standard place
8487 ($binexp/perl) on all your platforms. The alternative is to force
8488 a shell by starting the script with a single ':' character.
8491 case "$versiononly" in
8492 "$define") dflt="$binexp/perl$version";;
8493 *) dflt="$binexp/perl";;
8495 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8498 none) startperl=": # use perl";;
8499 *) startperl="#!$ans"
8500 if $test 30 -lt `echo "$ans" | wc -c`; then
8503 WARNING: Some systems limit the #! command to 32 characters.
8504 If you experience difficulty running Perl scripts with #!, try
8505 installing Perl in a directory with a shorter pathname.
8511 *) startperl=": # use perl"
8516 echo "I'll use $startperl to start perl scripts."
8518 : figure best path for perl in scripts
8521 case "$versiononly" in
8522 "$define") perlpath="$binexp/perl$version";;
8523 *) perlpath="$binexp/perl";;
8525 case "$startperl" in
8530 I will use the "eval 'exec'" idiom to start Perl on your system.
8531 I can use the full path of your Perl binary for this purpose, but
8532 doing so may cause problems if you want to share those scripts and
8533 Perl is not always in a standard place ($binexp/perl).
8537 rp="What path shall I use in \"eval 'exec'\"?"
8544 case "$startperl" in
8546 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8549 : determine where public executable scripts go
8550 set scriptdir scriptdir
8552 case "$scriptdir" in
8555 : guess some guesses
8556 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8557 $test -d /usr/share/bin && dflt=/usr/share/bin
8558 $test -d /usr/local/script && dflt=/usr/local/script
8559 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8560 $test -d $prefixexp/script && dflt=$prefixexp/script
8564 *) dflt="$scriptdir"
8569 Some installations have a separate directory just for executable scripts so
8570 that they can mount it across multiple architectures but keep the scripts in
8571 one spot. You might, for example, have a subdirectory of /usr/share for this.
8572 Or you might just lump your scripts in with all your other executables.
8576 rp='Where do you keep publicly executable scripts?'
8578 if $test "X$ansexp" != "X$scriptdirexp"; then
8582 scriptdirexp="$ansexp"
8583 : Change installation prefix, if necessary.
8584 if $test X"$prefix" != X"$installprefix"; then
8585 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8587 installscript="$scriptdirexp"
8590 : determine where add-on public executables go
8592 '') dflt=$siteprefix/bin ;;
8596 rp='Pathname where the add-on public executables should be installed?'
8599 sitebinexp="$ansexp"
8600 : Change installation prefix, if necessary.
8601 if $test X"$prefix" != X"$installprefix"; then
8602 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8604 installsitebin="$sitebinexp"
8607 : determine where add-on html pages go
8608 : There is no standard location, so try to copy the previously-selected
8609 : directory structure for the core html pages.
8610 case "$sitehtml1dir" in
8611 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8612 *) dflt=$sitehtml1dir ;;
8615 ''|' ') dflt=none ;;
8618 rp='Pathname where the site-specific html pages should be installed?'
8621 sitehtml1direxp="$ansexp"
8622 : Change installation prefix, if necessary.
8623 if $test X"$prefix" != X"$installprefix"; then
8624 installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
8626 installsitehtml1dir="$sitehtml1direxp"
8629 : determine where add-on library html pages go
8630 : There is no standard location, so try to copy the previously-selected
8631 : directory structure for the core html pages.
8632 case "$sitehtml3dir" in
8633 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8634 *) dflt=$sitehtml3dir ;;
8637 ''|' ') dflt=none ;;
8640 rp='Pathname where the site-specific library html pages should be installed?'
8643 sitehtml3direxp="$ansexp"
8644 : Change installation prefix, if necessary.
8645 if $test X"$prefix" != X"$installprefix"; then
8646 installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
8648 installsitehtml3dir="$sitehtml3direxp"
8651 : determine where add-on manual pages go
8652 case "$siteman1dir" in
8653 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8654 *) dflt=$siteman1dir ;;
8657 ''|' ') dflt=none ;;
8660 rp='Pathname where the site-specific manual pages should be installed?'
8663 siteman1direxp="$ansexp"
8664 : Change installation prefix, if necessary.
8665 if $test X"$prefix" != X"$installprefix"; then
8666 installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
8668 installsiteman1dir="$siteman1direxp"
8671 : determine where add-on library man pages go
8672 case "$siteman3dir" in
8673 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8674 *) dflt=$siteman3dir ;;
8677 ''|' ') dflt=none ;;
8680 rp='Pathname where the site-specific library manual pages should be installed?'
8683 siteman3direxp="$ansexp"
8684 : Change installation prefix, if necessary.
8685 if $test X"$prefix" != X"$installprefix"; then
8686 installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
8688 installsiteman3dir="$siteman3direxp"
8691 : determine where add-on public executable scripts go
8692 case "$sitescript" in
8693 '') dflt=$siteprefix/script
8694 $test -d $dflt || dflt=$sitebin ;;
8695 *) dflt="$sitescript" ;;
8698 rp='Pathname where add-on public executable scripts should be installed?'
8701 sitescriptexp="$ansexp"
8702 : Change installation prefix, if necessary.
8703 if $test X"$prefix" != X"$installprefix"; then
8704 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8706 installsitescript="$sitescriptexp"
8709 case "$usefaststdio" in
8710 $define|true|[yY]*|'')
8711 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8721 Perl can be built to use 'fast stdio', which means using the stdio
8722 library but also directly manipulating the stdio buffers to enable
8723 faster I/O. Using stdio is better for backward compatibility (especially
8724 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8725 interface has been preferred instead of stdio.
8727 If this doesn't make any sense to you, just accept the default '$dflt'.
8729 rp='Use the "fast stdio" if available?'
8732 y|Y) val="$define" ;;
8739 : define an is-a-typedef? function
8740 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8742 "") inclist="sys/types.h";;
8744 eval "varval=\$$var";
8748 for inc in $inclist; do
8749 echo "#include <$inc>" >>temp.c;
8751 echo "#ifdef $type" >> temp.c;
8752 echo "printf(\"We have $type\");" >> temp.c;
8753 echo "#endif" >> temp.c;
8754 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8755 if $contains $type temp.E >/dev/null 2>&1; then
8761 *) eval "$var=\$varval";;
8764 : define an is-a-typedef? function that prompts if the type is not available.
8765 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8767 "") inclist="sys/types.h";;
8769 eval "varval=\$$var";
8773 for inc in $inclist; do
8774 echo "#include <$inc>" >>temp.c;
8776 echo "#ifdef $type" >> temp.c;
8777 echo "printf(\"We have $type\");" >> temp.c;
8778 echo "#endif" >> temp.c;
8779 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8781 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8782 if $contains $type temp.E >/dev/null 2>&1; then
8783 echo "$type found." >&4;
8786 echo "$type NOT found." >&4;
8792 *) eval "$var=\$varval";;
8795 : see what type lseek is declared as in the kernel
8796 rp="What is the type used for lseek's offset on this system?"
8797 set off_t lseektype long stdio.h sys/types.h
8801 echo "Checking to see how big your file offsets are..." >&4
8803 #include <sys/types.h>
8807 printf("%d\n", (int)sizeof($lseektype));
8812 if eval $compile_ok; then
8813 lseeksize=`$run ./try`
8814 echo "Your file offsets are $lseeksize bytes long."
8818 echo "(I can't seem to compile the test program. Guessing...)"
8819 rp="What is the size of your file offsets (in bytes)?"
8825 : see what type file positions are declared as in the library
8826 rp="What is the type for file position used by fsetpos()?"
8827 set fpos_t fpostype long stdio.h sys/types.h
8832 *_t) zzz="$fpostype" ;;
8835 echo "Checking the size of $zzz..." >&4
8837 #include <sys/types.h>
8844 printf("%d\n", (int)sizeof($fpostype));
8849 if eval $compile_ok; then
8853 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8856 echo "Your $zzz is $fpossize bytes long."
8862 echo "(I can't compile the test program. Guessing...)" >&4
8863 rp="What is the size of your file positions (in bytes)?"
8868 # Backward compatibility (uselfs is deprecated).
8870 "$define"|true|[yY]*)
8873 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8875 uselargefiles="$define"
8879 case "$lseeksize:$fpossize" in
8882 You can have files larger than 2 gigabytes.
8885 *) case "$uselargefiles" in
8886 "$undef"|false|[nN]*) dflt='n' ;;
8891 Perl can be built to understand large files (files larger than 2 gigabytes)
8892 on some systems. To do so, Configure can be run with -Duselargefiles.
8894 If this doesn't make any sense to you, just accept the default '$dflt'.
8896 rp='Try to understand large files, if available?'
8899 y|Y) val="$define" ;;
8906 : Look for a hint-file generated 'call-back-unit'. If the
8907 : user has specified that a large files perl is to be built,
8908 : we may need to set or change some other defaults.
8909 if $test -f uselargefiles.cbu; then
8910 echo "Your platform has some specific hints regarding large file builds, using them..."
8911 . ./uselargefiles.cbu
8913 case "$uselargefiles" in
8915 if $test -f uselargefiles.cbu; then
8917 echo "Rechecking to see how big your file offsets are..." >&4
8919 #include <sys/types.h>
8923 printf("%d\n", (int)sizeof($lseektype));
8928 if eval $compile_ok; then
8929 lseeksize=`$run ./try`
8930 $echo "Your file offsets are now $lseeksize bytes long."
8934 echo "(I can't seem to compile the test program. Guessing...)"
8935 rp="What is the size of your file offsets (in bytes)?"
8940 *_t) zzz="$fpostype" ;;
8943 $echo $n "Rechecking the size of $zzz...$c" >&4
8945 #include <sys/types.h>
8952 printf("%d\n", (int)sizeof($fpostype));
8957 if eval $compile_ok; then
8962 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8965 echo " $fpossize bytes." >&4
8971 echo "(I can't compile the test program. Guessing...)" >&4
8972 rp="What is the size of your file positions (in bytes)?"
8981 # probably will refer to
8982 # $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
8984 userelocatableinc=undef
8986 case "$vendorprefix" in
8987 '') d_vendorbin="$undef"
8991 *) d_vendorbin="$define"
8992 : determine where vendor-supplied executables go.
8993 case "$vendorbin" in
8994 '') dflt=$vendorprefix/bin ;;
8995 *) dflt="$vendorbin" ;;
8998 rp='Pathname for the vendor-supplied executables directory?'
9001 vendorbinexp="$ansexp"
9004 : Change installation prefix, if necessary.
9005 if $test X"$prefix" != X"$installprefix"; then
9006 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9008 installvendorbin="$vendorbinexp"
9011 case "$vendorprefix" in
9012 '') vendorhtml1dir=''
9013 vendorhtml1direxp=''
9015 *) : determine where vendor-supplied html pages go.
9016 : There is no standard location, so try to copy the previously-selected
9017 : directory structure for the core html pages.
9018 : XXX Better default suggestions would be welcome.
9019 case "$vendorhtml1dir" in
9020 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9021 *) dflt=$vendorhtml1dir ;;
9024 ''|' ') dflt=none ;;
9027 rp='Pathname for the vendor-supplied html pages?'
9029 vendorhtml1dir="$ans"
9030 vendorhtml1direxp="$ansexp"
9033 : Use ' ' for none so value is preserved next time through Configure
9034 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9035 : Change installation prefix, if necessary.
9036 if $test X"$prefix" != X"$installprefix"; then
9037 installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
9039 installvendorhtml1dir="$vendorhtml1direxp"
9042 case "$vendorprefix" in
9043 '') vendorhtml3dir=''
9044 vendorhtml3direxp=''
9046 *) : determine where vendor-supplied module html pages go.
9047 : There is no standard location, so try to copy the previously-selected
9048 : directory structure for the core html pages.
9049 : XXX Better default suggestions would be welcome.
9050 case "$vendorhtml3dir" in
9051 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9052 *) dflt=$vendorhtml3dir ;;
9055 ''|' ') dflt=none ;;
9058 rp='Pathname for the vendor-supplied html pages?'
9060 vendorhtml3dir="$ans"
9061 vendorhtml3direxp="$ansexp"
9064 : Use ' ' for none so value is preserved next time through Configure
9065 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9066 : Change installation prefix, if necessary.
9067 if $test X"$prefix" != X"$installprefix"; then
9068 installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
9070 installvendorhtml3dir="$vendorhtml3direxp"
9073 case "$vendorprefix" in
9074 '') vendorman1dir=''
9077 *) : determine where vendor-supplied manual pages go.
9078 case "$vendorman1dir" in
9079 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9080 *) dflt=$vendorman1dir ;;
9083 ''|' ') dflt=none ;;
9086 rp='Pathname for the vendor-supplied manual section 1 pages?'
9088 vendorman1dir="$ans"
9089 vendorman1direxp="$ansexp"
9092 : Use ' ' for none so value is preserved next time through Configure
9093 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9094 : Change installation prefix, if necessary.
9095 if $test X"$prefix" != X"$installprefix"; then
9096 installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
9098 installvendorman1dir="$vendorman1direxp"
9101 case "$vendorprefix" in
9102 '') vendorman3dir=''
9105 *) : determine where vendor-supplied module manual pages go.
9106 case "$vendorman3dir" in
9107 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9108 *) dflt=$vendorman3dir ;;
9111 ''|' ') dflt=none ;;
9114 rp='Pathname for the vendor-supplied manual section 3 pages?'
9116 vendorman3dir="$ans"
9117 vendorman3direxp="$ansexp"
9120 : Use ' ' for none so value is preserved next time through Configure
9121 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9122 : Change installation prefix, if necessary.
9123 if $test X"$prefix" != X"$installprefix"; then
9124 installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
9126 installvendorman3dir="$vendorman3direxp"
9129 case "$vendorprefix" in
9130 '') d_vendorscript="$undef"
9134 *) d_vendorscript="$define"
9135 : determine where vendor-supplied scripts go.
9136 case "$vendorscript" in
9137 '') dflt=$vendorprefix/script
9138 $test -d $dflt || dflt=$vendorbin ;;
9139 *) dflt="$vendorscript" ;;
9143 The installation process will create a directory for
9144 vendor-supplied scripts.
9148 rp='Pathname for the vendor-supplied scripts directory?'
9151 vendorscriptexp="$ansexp"
9154 : Change installation prefix, if necessary.
9155 if $test X"$prefix" != X"$installprefix"; then
9156 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9158 installvendorscript="$vendorscriptexp"
9161 : see if qgcvt exists
9167 if $test X"$d_longdbl" = X"$define"; then
9169 echo "Checking how to print long doubles..." >&4
9171 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9172 $cat >try.c <<'EOCP'
9173 #include <sys/types.h>
9177 printf("%.3f\n", d);
9181 if eval $compile; then
9185 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9186 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9187 echo "We will use %f."
9193 if $test X"$sPRIfldbl" = X; then
9194 $cat >try.c <<'EOCP'
9195 #include <sys/types.h>
9198 long double d = 123.456;
9199 printf("%.3Lf\n", d);
9203 if eval $compile; then
9207 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9208 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9209 echo "We will use %Lf."
9215 if $test X"$sPRIfldbl" = X; then
9216 $cat >try.c <<'EOCP'
9217 #include <sys/types.h>
9220 long double d = 123.456;
9221 printf("%.3llf\n", d);
9225 if eval $compile; then
9229 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9230 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9231 echo "We will use %llf."
9237 if $test X"$sPRIfldbl" = X; then
9238 $cat >try.c <<'EOCP'
9239 #include <sys/types.h>
9242 long double d = 123.456;
9243 printf("%.3lf\n", d);
9247 if eval $compile; then
9251 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9252 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9253 echo "We will use %lf."
9259 if $test X"$sPRIfldbl" = X; then
9260 echo "Cannot figure out how to print long doubles." >&4
9262 sSCNfldbl=$sPRIfldbl # expect consistency
9269 case "$sPRIfldbl" in
9270 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9271 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9272 d_SCNfldbl="$undef";
9274 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9275 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9276 d_SCNfldbl="$define";
9280 : Check how to convert floats to strings.
9282 if test "X$d_Gconvert" = X; then
9285 echo "Checking for an efficient way to convert floats to strings."
9287 case "$uselongdouble" in
9288 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9290 case "$d_longdbl" in
9291 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9293 case "$d_PRIgldbl" in
9294 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9298 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9299 char *myname = "gconvert";
9302 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9303 char *myname = "gcvt";
9306 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9307 char *myname = "qgcvt";
9308 #define DOUBLETYPE long double
9311 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9313 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9315 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9318 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9320 char *myname = "sprintf";
9324 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9325 #define DOUBLETYPE long double
9327 #define DOUBLETYPE double
9333 #define I_STDLIB $i_stdlib
9339 checkit(expect, got)
9343 if (strcmp(expect, got)) {
9344 printf("%s oddity: Expected %s, got %s\n",
9345 myname, expect, got);
9355 /* This must be 1st test on (which?) platform */
9356 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9357 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9358 checkit("0.1", buf);
9360 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9361 checkit("0.01", buf);
9363 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9364 checkit("0.001", buf);
9366 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9367 checkit("0.0001", buf);
9369 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9370 if (strlen(buf) > 5)
9371 checkit("9e-005", buf); /* for Microsoft ?? */
9373 checkit("9e-05", buf);
9375 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9378 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9379 checkit("1.1", buf);
9381 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9382 checkit("1.01", buf);
9384 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9385 checkit("1.001", buf);
9387 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9388 checkit("1.0001", buf);
9390 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9391 checkit("1.00001", buf);
9393 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9394 checkit("1.000001", buf);
9396 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9399 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9402 /* Some Linux gcvt's give 1.e+5 here. */
9403 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9404 checkit("100000", buf);
9406 /* Some Linux gcvt's give -1.e+5 here. */
9407 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9408 checkit("-100000", buf);
9410 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9411 checkit("123.456", buf);
9413 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9414 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9415 /* 34 should be enough to scare even long double
9416 * places into using the e notation. */
9417 if (strlen(buf) > 5)
9418 checkit("1e+034", buf); /* for Microsoft */
9420 checkit("1e+34", buf);
9422 /* For Perl, if you add additional tests here, also add them to
9423 * t/base/num.t for benefit of platforms not using Configure or
9424 * overriding d_Gconvert */
9429 : first add preferred functions to our list
9431 for xxx_convert in $gconvert_preference; do
9432 case $xxx_convert in
9433 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9434 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9437 : then add any others
9438 for xxx_convert in gconvert gcvt sprintf; do
9441 *) xxx_list="$xxx_list $xxx_convert" ;;
9445 case "$d_longdbl$uselongdouble" in
9447 : again, add prefered functions to our list first
9449 for xxx_convert in $gconvert_ld_preference; do
9450 case $xxx_convert in
9451 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9452 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9455 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9456 for xxx_convert in qgcvt sprintf $xxx_list; do
9457 case "$xxx_ld_list" in
9458 $xxx_convert*|*" $xxx_convert"*) ;;
9459 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9462 : if sprintf cannot do long doubles, move it to the end
9463 if test "$d_PRIgldbl" != "$define"; then
9464 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9466 : if no qgcvt, remove it
9467 if test "$d_qgcvt" != "$define"; then
9468 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9471 xxx_list="$xxx_ld_list"
9475 for xxx_convert in $xxx_list; do
9476 echo "Trying $xxx_convert..."
9478 set try -DTRY_$xxx_convert
9479 if eval $compile; then
9480 echo "$xxx_convert() found." >&4
9482 echo "I'll use $xxx_convert to convert floats into a string." >&4
9485 echo "...But $xxx_convert didn't work as I expected."
9489 echo "$xxx_convert NOT found." >&4
9493 if test X$xxx_convert = X; then
9494 echo "*** WHOA THERE!!! ***" >&4
9495 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9499 case "$xxx_convert" in
9500 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9501 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9502 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9503 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9504 "$define$define$define")
9505 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9506 "$define$define$undef")
9507 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9508 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9515 : see if _fwalk exists
9519 : Initialize h_fcntl
9522 : Initialize h_sysfile
9525 : access call always available on UNIX
9529 : locate the flags for 'access()'
9533 $cat >access.c <<EOCP
9534 #include <sys/types.h>
9539 #include <sys/file.h>
9552 : check sys/file.h first, no particular reason here
9553 if $test `./findhdr sys/file.h` && \
9554 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9556 echo "<sys/file.h> defines the *_OK access constants." >&4
9557 elif $test `./findhdr fcntl.h` && \
9558 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9560 echo "<fcntl.h> defines the *_OK access constants." >&4
9561 elif $test `./findhdr unistd.h` && \
9562 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9563 echo "<unistd.h> defines the *_OK access constants." >&4
9565 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9571 : see if accessx exists
9572 set accessx d_accessx
9575 : see if aintl exists
9579 : see if alarm exists
9583 : see if POSIX threads are available
9584 set pthread.h i_pthread
9587 : define a fucntion to check prototypes
9588 $cat > protochk <<EOSH
9591 optimize="$optimize"
9593 prototype="$prototype"
9596 usethreads=$usethreads
9597 i_pthread=$i_pthread
9598 pthread_h_first=$pthread_h_first
9601 $cat >> protochk <<'EOSH'
9606 while test $# -ge 2; do
9608 $define) echo "#include <$2>" >> try.c ;;
9609 literal) echo "$2" >> try.c ;;
9611 # Extra magic for the benefit of systems that need pthread.h
9612 # to be included early to correctly detect threadsafe functions.
9613 # Such functions must guarantee themselves, though, that the usethreads
9614 # and i_pthread have been defined, before calling protochk.
9615 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9616 echo "#include <pthread.h>" >> try.c
9621 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9622 cat >> try.c <<'EOCP'
9623 #ifdef CAN_PROTOTYPE
9624 #define _(args) args
9629 echo "$foo" >> try.c
9630 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9631 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9639 hasproto='varname=$1; func=$2; shift; shift;
9640 while $test $# -ge 2; do
9642 $define) echo "#include <$2>";;
9646 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9647 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9648 echo "$func() prototype found.";
9651 echo "$func() prototype NOT found.";
9656 $rm -f try.c tryout.c'
9658 : see if sys/types.h has to be included
9659 set sys/types.h i_systypes
9662 : see if sys/select.h has to be included
9663 set sys/select.h i_sysselct
9666 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9667 while $test $# -ge 2; do
9669 $define) echo "#include <$2>";;
9673 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9675 if eval $compile; then
9684 : see if we should include time.h, sys/time.h, or both
9686 if test "X$timeincl" = X; then
9687 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9688 $echo $n "I'm now running the test program...$c"
9690 #include <sys/types.h>
9695 #ifdef SYSTIMEKERNEL
9698 #include <sys/time.h>
9701 #include <sys/select.h>
9714 struct timezone tzp;
9716 if (foo.tm_sec == foo.tm_sec)
9719 if (bar.tv_sec == bar.tv_sec)
9726 for s_timezone in '-DS_TIMEZONE' ''; do
9728 for s_timeval in '-DS_TIMEVAL' ''; do
9729 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9730 for i_time in '' '-DI_TIME'; do
9731 for i_systime in '-DI_SYSTIME' ''; do
9734 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9735 if eval $compile; then
9736 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9740 $echo $n "Succeeded with $flags$c"
9752 *SYSTIMEKERNEL*) i_systimek="$define"
9753 timeincl=`./findhdr sys/time.h`
9754 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9755 *) i_systimek="$undef";;
9758 *I_TIME*) i_time="$define"
9759 timeincl=`./findhdr time.h`" $timeincl"
9760 echo "We'll include <time.h>." >&4;;
9761 *) i_time="$undef";;
9764 *I_SYSTIME*) i_systime="$define"
9765 timeincl=`./findhdr sys/time.h`" $timeincl"
9766 echo "We'll include <sys/time.h>." >&4;;
9767 *) i_systime="$undef";;
9771 : see if struct tm knows about tm_zone
9772 case "$i_systime$i_time" in
9775 echo "Checking to see if your struct tm has tm_zone field..." >&4
9776 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9784 case "$d_tm_tm_zone" in
9785 "$define") echo "Yes, it does." ;;
9786 *) echo "No, it doesn't." ;;
9788 : see if struct tm knows about tm_gmtoff
9789 case "$i_systime$i_time" in
9792 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9793 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9801 case "$d_tm_tm_gmtoff" in
9802 "$define") echo "Yes, it does." ;;
9803 *) echo "No, it doesn't." ;;
9806 : see if asctime_r exists
9807 set asctime_r d_asctime_r
9809 case "$d_asctime_r" in
9811 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9812 case "$d_asctime_r_proto:$usethreads" in
9813 ":define") d_asctime_r_proto=define
9814 set d_asctime_r_proto asctime_r $hdrs
9818 case "$d_asctime_r_proto" in
9820 case "$asctime_r_proto" in
9821 ''|0) try='char* asctime_r(const struct tm*, char*);'
9822 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9824 case "$asctime_r_proto" in
9825 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9826 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9828 case "$asctime_r_proto" in
9829 ''|0) try='int asctime_r(const struct tm*, char*);'
9830 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9832 case "$asctime_r_proto" in
9833 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9834 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9836 case "$asctime_r_proto" in
9837 ''|0) d_asctime_r=undef
9839 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9840 * ) case "$asctime_r_proto" in
9841 REENTRANT_PROTO*) ;;
9842 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9844 echo "Prototype: $try" ;;
9847 *) case "$usethreads" in
9848 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9855 *) asctime_r_proto=0
9859 : see if atolf exists
9863 : see if atoll exists
9867 : Look for GNU-cc style attribute checking
9868 case "$d_attribut" in
9871 echo "Checking whether your compiler can handle __attribute__ ..." >&4
9872 $cat >attrib.c <<'EOCP'
9874 void croak (char* pat,...) __attribute__((__format__(__printf__,1,2),noreturn));
9876 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9877 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9878 echo "Your C compiler doesn't fully support __attribute__."
9881 echo "Your C compiler supports __attribute__."
9885 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9889 *) val="$d_attribut" ;;
9895 : see if bcmp exists
9899 : see if bcopy exists
9903 : see if this is a unistd.h system
9904 set unistd.h i_unistd
9907 : see if getpgrp exists
9908 set getpgrp d_getpgrp
9911 case "$d_getpgrp" in
9914 echo "Checking to see which flavor of getpgrp is in use..."
9917 #include <sys/types.h>
9919 # include <unistd.h>
9927 if (getuid() == 0) {
9928 printf("(I see you are running Configure as super-user...)\n");
9932 if (getpgrp(1) == 0)
9941 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9942 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
9944 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9945 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
9948 echo "I can't seem to compile and run the test program."
9950 xxx="a USG one, i.e. you use getpgrp()."
9952 # SVR4 systems can appear rather BSD-ish.
9955 xxx="a BSD one, i.e. you use getpgrp(pid)."
9959 xxx="probably a USG one, i.e. you use getpgrp()."
9964 echo "Assuming your getpgrp is $xxx" >&4
9973 : see if setpgrp exists
9974 set setpgrp d_setpgrp
9977 case "$d_setpgrp" in
9980 echo "Checking to see which flavor of setpgrp is in use..."
9983 #include <sys/types.h>
9985 # include <unistd.h>
9993 if (getuid() == 0) {
9994 printf("(I see you are running Configure as super-user...)\n");
9998 if (-1 == setpgrp(1, 1))
10001 if (setpgrp() != -1)
10007 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10008 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
10010 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
10011 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10014 echo "(I can't seem to compile and run the test program.)"
10016 xxx="a USG one, i.e. you use setpgrp()."
10018 # SVR4 systems can appear rather BSD-ish.
10019 case "$i_unistd" in
10021 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10025 xxx="probably a USG one, i.e. you use setpgrp()."
10030 echo "Assuming your setpgrp is $xxx" >&4
10038 : see if bzero exists
10042 : see if signal is declared as pointer to function returning int or void
10044 xxx=`./findhdr signal.h`
10045 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10046 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10047 echo "You have int (*signal())() instead of void." >&4
10049 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10050 echo "You have void (*signal())()." >&4
10052 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10053 echo "You have int (*signal())() instead of void." >&4
10055 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10056 echo "You have void (*signal())()." >&4
10059 case "$d_voidsig" in
10061 echo "I can't determine whether signal handler returns void or int..." >&4
10063 rp="What type does your signal handler return?"
10066 v*) val="$define";;
10070 echo "As you already told me, signal handler returns void." >&4
10073 *) echo "As you already told me, signal handler returns int." >&4
10080 case "$d_voidsig" in
10081 "$define") signal_t="void";;
10082 *) signal_t="int";;
10086 : check for ability to cast large floats to 32-bit ints.
10088 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10089 if $test "$intsize" -ge 4; then
10096 #$i_stdlib I_STDLIB
10098 #include <stdlib.h>
10100 #include <sys/types.h>
10101 #include <signal.h>
10102 $signal_t blech(s) int s; { exit(3); }
10109 signal(SIGFPE, blech);
10111 /* Don't let compiler optimize the test away. Store the number
10112 in a writable string for gcc to pass to sscanf under HP/UX.
10114 sprintf(str, "2147483647");
10115 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10119 /* x86 processors will probably give 0x8000 0000, which is a
10120 sign change. We don't want that. We want to mimic SPARC
10121 behavior here, which is to preserve the sign and give
10124 if (i32 != ($xxx) f)
10130 if eval $compile_ok; then
10134 echo "(I can't seem to compile the test program--assuming it can't)"
10139 echo "Yup, it can."
10142 echo "Nope, it can't."
10149 : check for ability to cast negative floats to unsigned
10151 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10154 #$i_stdlib I_STDLIB
10156 #include <stdlib.h>
10158 #include <sys/types.h>
10159 #include <signal.h>
10160 $signal_t blech(s) int s; { exit(7); }
10161 $signal_t blech_in_list(s) int s; { exit(4); }
10162 unsigned long dummy_long(p) unsigned long p; { return p; }
10163 unsigned int dummy_int(p) unsigned int p; { return p; }
10164 unsigned short dummy_short(p) unsigned short p; { return p; }
10168 unsigned long along;
10170 unsigned short ashort;
10174 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10175 a direct f = -123. assignment. gcc-2.8.0 reportedly
10176 optimized the whole file away
10178 /* Store the number in a writable string for gcc to pass to
10179 sscanf under HP/UX.
10181 sprintf(str, "-123");
10182 sscanf(str, "%lf", &f); /* f = -123.; */
10184 signal(SIGFPE, blech);
10185 along = (unsigned long)f;
10186 aint = (unsigned int)f;
10187 ashort = (unsigned short)f;
10188 if (along != (unsigned long)-123)
10190 if (aint != (unsigned int)-123)
10192 if (ashort != (unsigned short)-123)
10194 sprintf(str, "1073741824.");
10195 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10198 along = (unsigned long)f;
10199 if (along != 0x80000000)
10203 along = (unsigned long)f;
10204 if (along != 0x7fffffff)
10208 along = (unsigned long)f;
10209 if (along != 0x80000001)
10213 signal(SIGFPE, blech_in_list);
10214 sprintf(str, "123.");
10215 sscanf(str, "%lf", &f); /* f = 123.; */
10216 along = dummy_long((unsigned long)f);
10217 aint = dummy_int((unsigned int)f);
10218 ashort = dummy_short((unsigned short)f);
10219 if (along != (unsigned long)123)
10221 if (aint != (unsigned int)123)
10223 if (ashort != (unsigned short)123)
10230 if eval $compile_ok; then
10234 echo "(I can't seem to compile the test program--assuming it can't)"
10237 case "$castflags" in
10239 echo "Yup, it can."
10242 echo "Nope, it can't."
10249 : see if vprintf exists
10251 if set vprintf val -f d_vprintf; eval $csym; $val; then
10252 echo 'vprintf() found.' >&4
10255 #include <varargs.h>
10256 #$i_stdlib I_STDLIB
10258 #include <stdlib.h>
10261 int main() { xxx("foo"); }
10270 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10274 if eval $compile && $run ./try; then
10275 echo "Your vsprintf() returns (int)." >&4
10278 echo "Your vsprintf() returns (char*)." >&4
10282 echo 'vprintf() NOT found.' >&4
10293 : see if chown exists
10297 : see if chroot exists
10298 set chroot d_chroot
10301 : see if chsize exists
10302 set chsize d_chsize
10305 : see if class exists
10309 hasstruct='varname=$1; struct=$2; shift; shift;
10310 while $test $# -ge 2; do
10312 $define) echo "#include <$2>";;
10316 echo "int main () { struct $struct foo; }" >> try.c;
10318 if eval $compile; then
10325 $rm -f try.c try.o'
10329 : see whether socket exists
10331 $echo $n "Hmm... $c" >&4
10332 if set socket val -f d_socket; eval $csym; $val; then
10333 echo "Looks like you have Berkeley networking support." >&4
10335 if set setsockopt val -f; eval $csym; $val; then
10338 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10339 d_oldsock="$define"
10342 if $contains socklib libc.list >/dev/null 2>&1; then
10343 echo "Looks like you have Berkeley networking support." >&4
10345 : we will have to assume that it supports the 4.2 BSD interface
10348 echo "You don't have Berkeley networking in libc$_a..." >&4
10349 if test "X$d_socket" = "X$define"; then
10350 echo "...but you seem to believe that you have sockets." >&4
10352 for net in net socket
10354 if test -f /usr/lib/lib$net$_a; then
10355 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10356 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10357 if $contains socket libc.list >/dev/null 2>&1; then
10362 echo "...but the Wollongong group seems to have hacked it in." >&4
10363 sockethdr="-I/usr/netinclude"
10366 echo "Found Berkeley sockets interface in lib$net." >&4
10367 if $contains setsockopt libc.list >/dev/null 2>&1; then
10370 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10371 d_oldsock="$define"
10377 if test "X$d_socket" != "X$define"; then
10378 echo "or anywhere else I see." >&4
10386 : see if socketpair exists
10387 set socketpair d_sockpair
10392 echo "Checking the availability of certain socket constants..." >&4
10393 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10394 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10396 #include <sys/types.h>
10397 #include <sys/socket.h>
10403 set try; if eval $compile; then
10406 set d_${enum}; eval $setvar
10410 : see if this is a sys/uio.h system
10411 set sys/uio.h i_sysuio
10416 echo "Checking to see if your system supports struct cmsghdr..." >&4
10417 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10419 case "$d_cmsghdr_s" in
10420 "$define") echo "Yes, it does." ;;
10421 *) echo "No, it doesn't." ;;
10425 : check for const keyword
10427 echo 'Checking to see if your C compiler knows about "const"...' >&4
10428 $cat >const.c <<'EOCP'
10429 typedef struct spug { int drokk; } spug;
10436 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10438 echo "Yup, it does."
10441 echo "Nope, it doesn't."
10446 : see if copysignl exists
10447 set copysignl d_copysignl
10450 : see if crypt exists
10455 $define) cryptlib='' ;;
10456 *) if set crypt val -f d_crypt; eval $csym; $val; then
10457 echo 'crypt() found.' >&4
10461 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10462 if $test -z "$cryptlib"; then
10463 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10467 if $test -z "$cryptlib"; then
10468 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10472 if $test -z "$cryptlib"; then
10473 cryptlib=`./loc libcrypt$_a "" $libpth`
10477 if $test -z "$cryptlib"; then
10478 echo 'crypt() NOT found.' >&4
10489 : see if this is a crypt.h system
10490 set crypt.h i_crypt
10493 : see if crypt_r exists
10494 set crypt_r d_crypt_r
10496 case "$d_crypt_r" in
10498 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10499 case "$d_crypt_r_proto:$usethreads" in
10500 ":define") d_crypt_r_proto=define
10501 set d_crypt_r_proto crypt_r $hdrs
10505 case "$d_crypt_r_proto" in
10507 case "$crypt_r_proto" in
10508 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10509 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10511 case "$crypt_r_proto" in
10512 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10513 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10515 case "$crypt_r_proto" in
10516 ''|0) d_crypt_r=undef
10518 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10519 * ) case "$crypt_r_proto" in
10520 REENTRANT_PROTO*) ;;
10521 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10523 echo "Prototype: $try" ;;
10526 *) case "$usethreads" in
10527 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10538 : get csh whereabouts
10540 'csh') val="$undef" ;;
10541 *) val="$define" ;;
10545 : Respect a hint or command line value for full_csh.
10546 case "$full_csh" in
10547 '') full_csh=$csh ;;
10550 : see if ctermid_r exists
10551 set ctermid_r d_ctermid_r
10553 case "$d_ctermid_r" in
10555 hdrs="$i_systypes sys/types.h define stdio.h "
10556 case "$d_ctermid_r_proto:$usethreads" in
10557 ":define") d_ctermid_r_proto=define
10558 set d_ctermid_r_proto ctermid_r $hdrs
10562 case "$d_ctermid_r_proto" in
10564 case "$ctermid_r_proto" in
10565 ''|0) try='char* ctermid_r(char*);'
10566 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10568 case "$ctermid_r_proto" in
10569 ''|0) d_ctermid_r=undef
10571 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10572 * ) case "$ctermid_r_proto" in
10573 REENTRANT_PROTO*) ;;
10574 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10576 echo "Prototype: $try" ;;
10579 *) case "$usethreads" in
10580 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10587 *) ctermid_r_proto=0
10591 : see if ctime_r exists
10592 set ctime_r d_ctime_r
10594 case "$d_ctime_r" in
10596 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10597 case "$d_ctime_r_proto:$usethreads" in
10598 ":define") d_ctime_r_proto=define
10599 set d_ctime_r_proto ctime_r $hdrs
10603 case "$d_ctime_r_proto" in
10605 case "$ctime_r_proto" in
10606 ''|0) try='char* ctime_r(const time_t*, char*);'
10607 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10609 case "$ctime_r_proto" in
10610 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10611 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10613 case "$ctime_r_proto" in
10614 ''|0) try='int ctime_r(const time_t*, char*);'
10615 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10617 case "$ctime_r_proto" in
10618 ''|0) try='int ctime_r(const time_t*, char*, int);'
10619 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10621 case "$ctime_r_proto" in
10622 ''|0) d_ctime_r=undef
10624 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10625 * ) case "$ctime_r_proto" in
10626 REENTRANT_PROTO*) ;;
10627 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10629 echo "Prototype: $try" ;;
10632 *) case "$usethreads" in
10633 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10644 : see if cuserid exists
10645 set cuserid d_cuserid
10648 : see if this is a limits.h system
10649 set limits.h i_limits
10652 : see if this is a float.h system
10653 set float.h i_float
10656 : See if number of significant digits in a double precision number is known
10658 $cat >dbl_dig.c <<EOM
10659 #$i_limits I_LIMITS
10662 #include <limits.h>
10668 printf("Contains DBL_DIG");
10671 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10672 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10673 echo "DBL_DIG found." >&4
10676 echo "DBL_DIG NOT found." >&4
10683 : see if dbm.h is available
10684 : see if dbmclose exists
10685 set dbmclose d_dbmclose
10688 case "$d_dbmclose" in
10698 *) set rpcsvc/dbm.h i_rpcsvcdbm
10703 *) echo "We won't be including <dbm.h>"
10713 : see if prototype for dbminit is available
10715 set d_dbminitproto dbminit $i_dbm dbm.h
10718 : see if difftime exists
10719 set difftime d_difftime
10722 : see if this is a dirent system
10724 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10726 echo "<dirent.h> found." >&4
10729 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10730 echo "<sys/dir.h> found." >&4
10733 xinc=`./findhdr sys/ndir.h`
10735 echo "<dirent.h> NOT found." >&4
10740 : Look for type of directory structure.
10742 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10744 case "$direntrytype" in
10746 case "$i_dirent" in
10747 $define) guess1='struct dirent' ;;
10748 *) guess1='struct direct' ;;
10751 *) guess1="$direntrytype"
10756 'struct dirent') guess2='struct direct' ;;
10757 *) guess2='struct dirent' ;;
10760 if $contains "$guess1" try.c >/dev/null 2>&1; then
10761 direntrytype="$guess1"
10762 echo "Your directory entries are $direntrytype." >&4
10763 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10764 direntrytype="$guess2"
10765 echo "Your directory entries seem to be $direntrytype." >&4
10767 echo "I don't recognize your system's directory entries." >&4
10768 rp="What type is used for directory entries on this system?"
10771 direntrytype="$ans"
10776 : see if the directory entry stores field length
10778 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10779 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10780 echo "Good, your directory entry keeps length information in d_namlen." >&4
10783 echo "Your directory entry does not know about the d_namlen field." >&4
10790 : see if this is an sysdir system
10791 set sys/dir.h i_sysdir
10794 : see if this is an sysndir system
10795 set sys/ndir.h i_sysndir
10800 $cat >dirfd.c <<EOM
10802 #$i_stdlib I_STDLIB
10804 #include <stdlib.h>
10806 #$i_dirent I_DIRENT /**/
10807 #$i_sysdir I_SYS_DIR /**/
10808 #$i_sysndir I_SYS_NDIR /**/
10809 #$i_systypes I_SYS_TYPES /**/
10810 #if defined(I_SYS_TYPES)
10811 #include <sys/types.h>
10813 #if defined(I_DIRENT)
10814 #include <dirent.h>
10815 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10816 #include <sys/dir.h>
10820 #include <sys/ndir.h>
10824 #include <ndir.h> /* may be wrong in the future */
10826 #include <sys/dir.h>
10832 DIR *dirp = opendir(".");
10833 if (dirfd(dirp) >= 0)
10840 if eval $compile; then
10844 $define) echo "dirfd() found." >&4 ;;
10845 *) echo "dirfd() NOT found." >&4 ;;
10851 : see if dlerror exists
10854 set dlerror d_dlerror
10858 : see if dlfcn is available
10859 set dlfcn.h i_dlfcn
10866 On a few systems, the dynamically loaded modules that perl generates and uses
10867 will need a different extension than shared libs. The default will probably
10873 *) dflt="$dlext" ;;
10875 rp='What is the extension of dynamically loaded modules'
10884 : Check if dlsym need a leading underscore
10890 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
10891 $cat >dyna.c <<'EOM'
10898 #$i_stdlib I_STDLIB
10900 #include <stdlib.h>
10904 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
10906 #include <sys/types.h>
10911 extern int fred() ;
10920 int mode = RTLD_LAZY ;
10922 handle = dlopen("./dyna.$dlext", mode) ;
10923 if (handle == NULL) {
10928 symbol = dlsym(handle, "fred") ;
10929 if (symbol == NULL) {
10930 /* try putting a leading underscore */
10931 symbol = dlsym(handle, "_fred") ;
10932 if (symbol == NULL) {
10945 : Call the object file tmp-dyna.o in case dlext=o.
10946 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
10947 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
10948 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
10949 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
10952 1) echo "Test program failed using dlopen." >&4
10953 echo "Perhaps you should not use dynamic loading." >&4;;
10954 2) echo "Test program failed using dlsym." >&4
10955 echo "Perhaps you should not use dynamic loading." >&4;;
10956 3) echo "dlsym needs a leading underscore" >&4
10958 4) echo "dlsym doesn't need a leading underscore." >&4;;
10961 echo "I can't compile and run the test program." >&4
10962 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
10967 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
10972 : see if drand48_r exists
10973 set drand48_r d_drand48_r
10975 case "$d_drand48_r" in
10977 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
10978 case "$d_drand48_r_proto:$usethreads" in
10979 ":define") d_drand48_r_proto=define
10980 set d_drand48_r_proto drand48_r $hdrs
10984 case "$d_drand48_r_proto" in
10986 case "$drand48_r_proto" in
10987 ''|0) try='int drand48_r(struct drand48_data*, double*);'
10988 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
10990 case "$drand48_r_proto" in
10991 ''|0) d_drand48_r=undef
10993 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
10994 * ) case "$drand48_r_proto" in
10995 REENTRANT_PROTO*) ;;
10996 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
10998 echo "Prototype: $try" ;;
11001 *) case "$usethreads" in
11002 define) echo "drand48_r has no prototype, not using it." >&4 ;;
11009 *) drand48_r_proto=0
11013 : see if prototype for drand48 is available
11015 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11018 : see if dup2 exists
11022 : see if eaccess exists
11023 set eaccess d_eaccess
11026 : see if endgrent exists
11027 set endgrent d_endgrent
11030 : see if this is an grp system
11036 xxx=`./findhdr grp.h`
11037 $cppstdin $cppflags $cppminus < $xxx >$$.h
11039 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11051 set d_grpasswd; eval $setvar
11055 : see if endgrent_r exists
11056 set endgrent_r d_endgrent_r
11058 case "$d_endgrent_r" in
11060 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11061 case "$d_endgrent_r_proto:$usethreads" in
11062 ":define") d_endgrent_r_proto=define
11063 set d_endgrent_r_proto endgrent_r $hdrs
11067 case "$d_endgrent_r_proto" in
11069 case "$endgrent_r_proto" in
11070 ''|0) try='int endgrent_r(FILE**);'
11071 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11073 case "$endgrent_r_proto" in
11074 ''|0) try='void endgrent_r(FILE**);'
11075 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11077 case "$endgrent_r_proto" in
11078 ''|0) d_endgrent_r=undef
11080 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11081 * ) case "$endgrent_r_proto" in
11082 REENTRANT_PROTO*) ;;
11083 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11085 echo "Prototype: $try" ;;
11088 *) case "$usethreads" in
11089 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11096 *) endgrent_r_proto=0
11100 : see if endhostent exists
11101 set endhostent d_endhent
11104 : see if this is a netdb.h system
11105 set netdb.h i_netdb
11108 : see if endhostent_r exists
11109 set endhostent_r d_endhostent_r
11111 case "$d_endhostent_r" in
11113 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11114 case "$d_endhostent_r_proto:$usethreads" in
11115 ":define") d_endhostent_r_proto=define
11116 set d_endhostent_r_proto endhostent_r $hdrs
11120 case "$d_endhostent_r_proto" in
11122 case "$endhostent_r_proto" in
11123 ''|0) try='int endhostent_r(struct hostent_data*);'
11124 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11126 case "$endhostent_r_proto" in
11127 ''|0) try='void endhostent_r(struct hostent_data*);'
11128 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11130 case "$endhostent_r_proto" in
11131 ''|0) d_endhostent_r=undef
11132 endhostent_r_proto=0
11133 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11134 * ) case "$endhostent_r_proto" in
11135 REENTRANT_PROTO*) ;;
11136 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11138 echo "Prototype: $try" ;;
11141 *) case "$usethreads" in
11142 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11144 d_endhostent_r=undef
11145 endhostent_r_proto=0
11149 *) endhostent_r_proto=0
11153 : see if endnetent exists
11154 set endnetent d_endnent
11157 : see if endnetent_r exists
11158 set endnetent_r d_endnetent_r
11160 case "$d_endnetent_r" in
11162 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11163 case "$d_endnetent_r_proto:$usethreads" in
11164 ":define") d_endnetent_r_proto=define
11165 set d_endnetent_r_proto endnetent_r $hdrs
11169 case "$d_endnetent_r_proto" in
11171 case "$endnetent_r_proto" in
11172 ''|0) try='int endnetent_r(struct netent_data*);'
11173 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11175 case "$endnetent_r_proto" in
11176 ''|0) try='void endnetent_r(struct netent_data*);'
11177 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11179 case "$endnetent_r_proto" in
11180 ''|0) d_endnetent_r=undef
11181 endnetent_r_proto=0
11182 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11183 * ) case "$endnetent_r_proto" in
11184 REENTRANT_PROTO*) ;;
11185 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11187 echo "Prototype: $try" ;;
11190 *) case "$usethreads" in
11191 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11193 d_endnetent_r=undef
11194 endnetent_r_proto=0
11198 *) endnetent_r_proto=0
11202 : see if endprotoent exists
11203 set endprotoent d_endpent
11206 : see if endprotoent_r exists
11207 set endprotoent_r d_endprotoent_r
11209 case "$d_endprotoent_r" in
11211 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11212 case "$d_endprotoent_r_proto:$usethreads" in
11213 ":define") d_endprotoent_r_proto=define
11214 set d_endprotoent_r_proto endprotoent_r $hdrs
11218 case "$d_endprotoent_r_proto" in
11220 case "$endprotoent_r_proto" in
11221 ''|0) try='int endprotoent_r(struct protoent_data*);'
11222 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11224 case "$endprotoent_r_proto" in
11225 ''|0) try='void endprotoent_r(struct protoent_data*);'
11226 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11228 case "$endprotoent_r_proto" in
11229 ''|0) d_endprotoent_r=undef
11230 endprotoent_r_proto=0
11231 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11232 * ) case "$endprotoent_r_proto" in
11233 REENTRANT_PROTO*) ;;
11234 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11236 echo "Prototype: $try" ;;
11239 *) case "$usethreads" in
11240 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11242 d_endprotoent_r=undef
11243 endprotoent_r_proto=0
11247 *) endprotoent_r_proto=0
11251 : see if endpwent exists
11252 set endpwent d_endpwent
11255 : see if this is a pwd.h system
11261 xxx=`./findhdr pwd.h`
11262 $cppstdin $cppflags $cppminus < $xxx >$$.h
11264 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11272 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11280 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11288 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11296 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11304 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11312 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11320 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11332 set d_pwquota; eval $setvar
11333 set d_pwage; eval $setvar
11334 set d_pwchange; eval $setvar
11335 set d_pwclass; eval $setvar
11336 set d_pwexpire; eval $setvar
11337 set d_pwcomment; eval $setvar
11338 set d_pwgecos; eval $setvar
11339 set d_pwpasswd; eval $setvar
11343 : see if endpwent_r exists
11344 set endpwent_r d_endpwent_r
11346 case "$d_endpwent_r" in
11348 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11349 case "$d_endpwent_r_proto:$usethreads" in
11350 ":define") d_endpwent_r_proto=define
11351 set d_endpwent_r_proto endpwent_r $hdrs
11355 case "$d_endpwent_r_proto" in
11357 case "$endpwent_r_proto" in
11358 ''|0) try='int endpwent_r(FILE**);'
11359 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11361 case "$endpwent_r_proto" in
11362 ''|0) try='void endpwent_r(FILE**);'
11363 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11365 case "$endpwent_r_proto" in
11366 ''|0) d_endpwent_r=undef
11368 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11369 * ) case "$endpwent_r_proto" in
11370 REENTRANT_PROTO*) ;;
11371 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11373 echo "Prototype: $try" ;;
11376 *) case "$usethreads" in
11377 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11384 *) endpwent_r_proto=0
11388 : see if endservent exists
11389 set endservent d_endsent
11392 : see if endservent_r exists
11393 set endservent_r d_endservent_r
11395 case "$d_endservent_r" in
11397 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11398 case "$d_endservent_r_proto:$usethreads" in
11399 ":define") d_endservent_r_proto=define
11400 set d_endservent_r_proto endservent_r $hdrs
11404 case "$d_endservent_r_proto" in
11406 case "$endservent_r_proto" in
11407 ''|0) try='int endservent_r(struct servent_data*);'
11408 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11410 case "$endservent_r_proto" in
11411 ''|0) try='void endservent_r(struct servent_data*);'
11412 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11414 case "$endservent_r_proto" in
11415 ''|0) d_endservent_r=undef
11416 endservent_r_proto=0
11417 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11418 * ) case "$endservent_r_proto" in
11419 REENTRANT_PROTO*) ;;
11420 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11422 echo "Prototype: $try" ;;
11425 *) case "$usethreads" in
11426 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11428 d_endservent_r=undef
11429 endservent_r_proto=0
11433 *) endservent_r_proto=0
11437 : Locate the flags for 'open()'
11440 #include <sys/types.h>
11445 #include <sys/file.h>
11447 #$i_stdlib I_STDLIB
11449 #include <stdlib.h>
11460 : check sys/file.h first to get FREAD on Sun
11461 if $test `./findhdr sys/file.h` && \
11462 set try -DI_SYS_FILE && eval $compile; then
11464 echo "<sys/file.h> defines the O_* constants..." >&4
11465 if $run ./try; then
11466 echo "and you have the 3 argument form of open()." >&4
11469 echo "but not the 3 argument form of open(). Oh, well." >&4
11472 elif $test `./findhdr fcntl.h` && \
11473 set try -DI_FCNTL && eval $compile; then
11475 echo "<fcntl.h> defines the O_* constants..." >&4
11476 if $run ./try; then
11477 echo "and you have the 3 argument form of open()." >&4
11480 echo "but not the 3 argument form of open(). Oh, well." >&4
11485 echo "I can't find the O_* constant definitions! You got problems." >&4
11491 : see which of string.h or strings.h is needed
11493 strings=`./findhdr string.h`
11494 if $test "$strings" && $test -r "$strings"; then
11495 echo "Using <string.h> instead of <strings.h>." >&4
11499 strings=`./findhdr strings.h`
11500 if $test "$strings" && $test -r "$strings"; then
11501 echo "Using <strings.h> instead of <string.h>." >&4
11503 echo "No string header found -- You'll surely have problems." >&4
11508 case "$i_string" in
11509 "$undef") strings=`./findhdr strings.h`;;
11510 *) strings=`./findhdr string.h`;;
11513 : see if this is a sys/file.h system
11518 : do we need to include sys/file.h ?
11522 if $h_sysfile; then
11524 echo "We'll be including <sys/file.h>." >&4
11527 echo "We won't be including <sys/file.h>." >&4
11537 : see if fcntl.h is there
11542 : see if we can include fcntl.h
11548 echo "We'll be including <fcntl.h>." >&4
11551 if $h_sysfile; then
11552 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11554 echo "We won't be including <fcntl.h>." >&4
11566 : check for non-blocking I/O stuff
11567 case "$h_sysfile" in
11568 true) echo "#include <sys/file.h>" > head.c;;
11571 true) echo "#include <fcntl.h>" > head.c;;
11572 *) echo "#include <sys/fcntl.h>" > head.c;;
11577 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11578 case "$o_nonblock" in
11580 $cat head.c > try.c
11581 $cat >>try.c <<EOCP
11583 #$i_stdlib I_STDLIB
11585 #include <stdlib.h>
11593 printf("O_NONBLOCK\n");
11597 printf("O_NDELAY\n");
11601 printf("FNDELAY\n");
11608 if eval $compile_ok; then
11609 o_nonblock=`$run ./try`
11610 case "$o_nonblock" in
11611 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11612 *) echo "Seems like we can use $o_nonblock.";;
11615 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11618 *) echo "Using $hint value $o_nonblock.";;
11620 $rm -f try try.* .out core
11623 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11626 $cat head.c > try.c
11627 $cat >>try.c <<EOCP
11629 #include <sys/types.h>
11630 #include <signal.h>
11632 #$i_stdlib I_STDLIB
11634 #include <stdlib.h>
11640 #define MY_O_NONBLOCK $o_nonblock
11641 #ifndef errno /* XXX need better Configure test */
11644 #$i_unistd I_UNISTD
11646 #include <unistd.h>
11648 #$i_string I_STRING
11650 #include <string.h>
11652 #include <strings.h>
11654 $signal_t blech(x) int x; { exit(3); }
11656 $cat >> try.c <<'EOCP'
11664 pipe(pd); /* Down: child -> parent */
11665 pipe(pu); /* Up: parent -> child */
11668 close(pd[1]); /* Parent reads from pd[0] */
11669 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11671 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11676 signal(SIGALRM, blech);
11678 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11680 sprintf(string, "%d\n", ret);
11681 write(2, string, strlen(string));
11684 if (errno == EAGAIN) {
11685 printf("EAGAIN\n");
11690 if (errno == EWOULDBLOCK)
11691 printf("EWOULDBLOCK\n");
11694 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11695 sleep(2); /* Give it time to close our pipe */
11697 ret = read(pd[0], buf, 1); /* Should read EOF */
11699 sprintf(string, "%d\n", ret);
11700 write(4, string, strlen(string));
11704 close(pd[0]); /* We write to pd[1] */
11705 close(pu[1]); /* We read from pu[0] */
11706 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11707 close(pd[1]); /* Pipe pd is now fully closed! */
11708 exit(0); /* Bye bye, thank you for playing! */
11712 if eval $compile_ok; then
11713 echo "$startsh" >mtry
11714 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11716 ./mtry >/dev/null 2>&1
11718 0) eagain=`$cat try.out`;;
11719 1) echo "Could not perform non-blocking setting!";;
11720 2) echo "I did a successful read() for something that was not there!";;
11721 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11722 4) echo "Could not find F_SETFL!";;
11723 *) echo "Something terribly wrong happened during testing.";;
11725 rd_nodata=`$cat try.ret`
11726 echo "A read() system call with no data present returns $rd_nodata."
11727 case "$rd_nodata" in
11730 echo "(That's peculiar, fixing that to be -1.)"
11736 echo "Forcing errno EAGAIN on read() with no data available."
11740 echo "Your read() sets errno to $eagain when no data is available."
11743 status=`$cat try.err`
11745 0) echo "And it correctly returns 0 to signal EOF.";;
11746 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11747 *) echo "However, your read() returns '$status' on EOF??";;
11750 if test "$status" = "$rd_nodata"; then
11751 echo "WARNING: you can't distinguish between EOF and no data!"
11755 echo "I can't compile the test program--assuming errno EAGAIN will do."
11762 echo "Using $hint value $eagain."
11763 echo "Your read() returns $rd_nodata when no data is present."
11764 case "$d_eofnblk" in
11765 "$define") echo "And you can see EOF because read() returns 0.";;
11766 "$undef") echo "But you can't see EOF status from read() returned value.";;
11768 echo "(Assuming you can't see EOF status from read anyway.)"
11774 $rm -f try try.* .out core head.c mtry
11776 : see if _ptr and _cnt from stdio act std
11779 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11780 echo "(Looks like you have stdio.h from BSD.)"
11781 case "$stdio_ptr" in
11782 '') stdio_ptr='((fp)->_p)'
11785 *) ptr_lval=$d_stdio_ptr_lval;;
11787 case "$stdio_cnt" in
11788 '') stdio_cnt='((fp)->_r)'
11791 *) cnt_lval=$d_stdio_cnt_lval;;
11793 case "$stdio_base" in
11794 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11796 case "$stdio_bufsiz" in
11797 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11799 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11800 echo "(Looks like you have stdio.h from Linux.)"
11801 case "$stdio_ptr" in
11802 '') stdio_ptr='((fp)->_IO_read_ptr)'
11805 *) ptr_lval=$d_stdio_ptr_lval;;
11807 case "$stdio_cnt" in
11808 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11811 *) cnt_lval=$d_stdio_cnt_lval;;
11813 case "$stdio_base" in
11814 '') stdio_base='((fp)->_IO_read_base)';;
11816 case "$stdio_bufsiz" in
11817 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11820 case "$stdio_ptr" in
11821 '') stdio_ptr='((fp)->_ptr)'
11824 *) ptr_lval=$d_stdio_ptr_lval;;
11826 case "$stdio_cnt" in
11827 '') stdio_cnt='((fp)->_cnt)'
11830 *) cnt_lval=$d_stdio_cnt_lval;;
11832 case "$stdio_base" in
11833 '') stdio_base='((fp)->_base)';;
11835 case "$stdio_bufsiz" in
11836 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11840 : test whether _ptr and _cnt really work
11841 echo "Checking how std your stdio is..." >&4
11844 #$i_stdlib I_STDLIB
11846 #include <stdlib.h>
11848 #define FILE_ptr(fp) $stdio_ptr
11849 #define FILE_cnt(fp) $stdio_cnt
11851 FILE *fp = fopen("try.c", "r");
11854 18 <= FILE_cnt(fp) &&
11855 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11863 if eval $compile && $to try.c; then
11864 if $run ./try; then
11865 echo "Your stdio acts pretty std."
11868 echo "Your stdio isn't very std."
11871 echo "Your stdio doesn't appear very std."
11875 # glibc 2.2.90 and above apparently change stdio streams so Perl's
11876 # direct buffer manipulation no longer works. The Configure tests
11877 # should be changed to correctly detect this, but until then,
11878 # the following check should at least let perl compile and run.
11879 # (This quick fix should be updated before 5.8.1.)
11880 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
11881 # A. Dougherty, June 3, 2002.
11882 case "$d_gnulibc" in
11884 case "$gnulibc_version" in
11888 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
11897 : Can _ptr be used as an lvalue?
11898 case "$d_stdstdio$ptr_lval" in
11899 $define$define) val=$define ;;
11902 set d_stdio_ptr_lval
11905 : Can _cnt be used as an lvalue?
11906 case "$d_stdstdio$cnt_lval" in
11907 $define$define) val=$define ;;
11910 set d_stdio_cnt_lval
11914 : test whether setting _ptr sets _cnt as a side effect
11915 d_stdio_ptr_lval_sets_cnt="$undef"
11916 d_stdio_ptr_lval_nochange_cnt="$undef"
11917 case "$d_stdio_ptr_lval$d_stdstdio" in
11919 echo "Checking to see what happens if we set the stdio ptr..." >&4
11922 /* Can we scream? */
11923 /* Eat dust sed :-) */
11924 /* In the buffer space, no one can hear you scream. */
11925 #$i_stdlib I_STDLIB
11927 #include <stdlib.h>
11929 #define FILE_ptr(fp) $stdio_ptr
11930 #define FILE_cnt(fp) $stdio_cnt
11931 #include <sys/types.h>
11933 FILE *fp = fopen("try.c", "r");
11938 puts("Fail even to read");
11941 c = getc(fp); /* Read away the first # */
11943 puts("Fail even to read");
11947 18 <= FILE_cnt(fp) &&
11948 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11950 puts("Fail even to read");
11953 ptr = (char*) FILE_ptr(fp);
11954 cnt = (size_t)FILE_cnt(fp);
11956 FILE_ptr(fp) += 42;
11958 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
11959 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
11962 if (FILE_cnt(fp) <= 20) {
11963 printf ("Fail (<20 chars to test)");
11966 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
11967 puts("Fail compare");
11970 if (cnt == FILE_cnt(fp)) {
11971 puts("Pass_unchanged");
11974 if (FILE_cnt(fp) == (cnt - 42)) {
11975 puts("Pass_changed");
11978 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
11984 if eval $compile && $to try.c; then
11985 case `$run ./try` in
11987 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
11988 d_stdio_ptr_lval_sets_cnt="$define" ;;
11990 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
11991 d_stdio_ptr_lval_nochange_cnt="$define" ;;
11993 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
11995 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
11998 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
12004 : see if _base is also standard
12006 case "$d_stdstdio" in
12010 #$i_stdlib I_STDLIB
12012 #include <stdlib.h>
12014 #define FILE_base(fp) $stdio_base
12015 #define FILE_bufsiz(fp) $stdio_bufsiz
12017 FILE *fp = fopen("try.c", "r");
12020 19 <= FILE_bufsiz(fp) &&
12021 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12028 if eval $compile && $to try.c; then
12029 if $run ./try; then
12030 echo "And its _base field acts std."
12033 echo "But its _base field isn't std."
12036 echo "However, it seems to be lacking the _base field."
12044 : see if fast_stdio exists
12046 case "$d_stdstdio:$d_stdio_ptr_lval" in
12048 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12050 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12061 : see if fchdir exists
12062 set fchdir d_fchdir
12065 : see if fchmod exists
12066 set fchmod d_fchmod
12069 : see if fchown exists
12070 set fchown d_fchown
12073 : see if this is an fcntl system
12078 : See if fcntl-based locking works.
12080 #$i_stdlib I_STDLIB
12082 #include <stdlib.h>
12084 #include <unistd.h>
12086 #include <signal.h>
12087 $signal_t blech(x) int x; { exit(3); }
12089 #if defined(F_SETLK) && defined(F_SETLKW)
12090 struct flock flock;
12092 fd = open("try.c", O_RDONLY);
12093 flock.l_type = F_RDLCK;
12094 flock.l_whence = SEEK_SET;
12095 flock.l_start = flock.l_len = 0;
12096 signal(SIGALRM, blech);
12098 retval = fcntl(fd, F_SETLK, &flock);
12100 (retval < 0 ? exit(2) : exit(0));
12106 echo "Checking if fcntl-based file locking works... "
12110 if eval $compile_ok; then
12111 if $run ./try; then
12112 echo "Yes, it seems to work."
12115 echo "Nope, it didn't work."
12120 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12121 *** This is (almost) impossible.
12122 *** If your NFS lock daemons are not feeling well, something like
12123 *** this may happen, please investigate. Cannot continue, aborting.
12131 echo "I'm unable to compile the test program, so I'll assume not."
12136 echo "Nope, since you don't even have fcntl()."
12139 set d_fcntl_can_lock
12144 : check for fd_set items
12147 Checking to see how well your C compiler handles fd_set and friends ...
12150 #$i_stdlib I_STDLIB
12152 #include <stdlib.h>
12154 #$i_systime I_SYS_TIME
12155 #$i_sysselct I_SYS_SELECT
12156 #$d_socket HAS_SOCKET
12157 #include <sys/types.h>
12159 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12162 #include <sys/time.h>
12164 #ifdef I_SYS_SELECT
12165 #include <sys/select.h>
12174 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12182 if eval $compile; then
12183 d_fds_bits="$define"
12185 echo "Well, your system knows about the normal fd_set typedef..." >&4
12186 if $run ./try; then
12187 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12188 d_fd_macros="$define"
12191 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12193 d_fd_macros="$undef"
12197 Hmm, your compiler has some difficulty with fd_set. Checking further...
12200 if eval $compile; then
12201 d_fds_bits="$undef"
12203 echo "Well, your system has some sort of fd_set available..." >&4
12204 if $run ./try; then
12205 echo "and you have the normal fd_set macros." >&4
12206 d_fd_macros="$define"
12209 but not the normal fd_set macros! Gross! More work for me...
12211 d_fd_macros="$undef"
12214 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12216 d_fds_bits="$undef"
12217 d_fd_macros="$undef"
12222 : see if fgetpos exists
12223 set fgetpos d_fgetpos
12226 : see if finite exists
12227 set finite d_finite
12230 : see if finitel exists
12231 set finitel d_finitel
12234 : see if flock exists
12238 : see if prototype for flock is available
12240 set d_flockproto flock $i_sysfile sys/file.h
12243 : see if fork exists
12247 : see if fp_class exists
12248 set fp_class d_fp_class
12251 : see if pathconf exists
12252 set pathconf d_pathconf
12255 : see if fpathconf exists
12256 set fpathconf d_fpathconf
12259 : see if fpclass exists
12260 set fpclass d_fpclass
12263 : see if fpclassify exists
12264 set fpclassify d_fpclassify
12267 : see if fpclassl exists
12268 set fpclassl d_fpclassl
12272 : check for fpos64_t
12274 echo "Checking to see if you have fpos64_t..." >&4
12277 int main() { fpos64_t x = 7; }
12280 if eval $compile; then
12282 echo "You have fpos64_t."
12285 echo "You do not have fpos64_t."
12286 case "$fpossize" in
12287 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12294 : see if frexpl exists
12295 set frexpl d_frexpl
12298 : see if this is a sys/param system
12299 set sys/param.h i_sysparam
12302 : see if this is a sys/mount.h system
12303 set sys/mount.h i_sysmount
12308 echo "Checking to see if your system supports struct fs_data..." >&4
12309 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12311 case "$d_fs_data_s" in
12312 "$define") echo "Yes, it does." ;;
12313 *) echo "No, it doesn't." ;;
12316 : see if fseeko exists
12317 set fseeko d_fseeko
12319 case "$longsize" in
12320 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12323 : see if fsetpos exists
12324 set fsetpos d_fsetpos
12328 : see if fstatfs exists
12329 set fstatfs d_fstatfs
12333 : see if statvfs exists
12334 set statvfs d_statvfs
12337 : see if fstatvfs exists
12338 set fstatvfs d_fstatvfs
12342 : see if fsync exists
12346 : see if ftello exists
12347 set ftello d_ftello
12349 case "$longsize" in
12350 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12353 : see if getcwd exists
12354 set getcwd d_getcwd
12357 : see if getespwnam exists
12358 set getespwnam d_getespwnam
12362 : see if getfsstat exists
12363 set getfsstat d_getfsstat
12366 : see if getgrent exists
12367 set getgrent d_getgrent
12370 : see if getgrent_r exists
12371 set getgrent_r d_getgrent_r
12373 case "$d_getgrent_r" in
12375 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12376 case "$d_getgrent_r_proto:$usethreads" in
12377 ":define") d_getgrent_r_proto=define
12378 set d_getgrent_r_proto getgrent_r $hdrs
12382 case "$d_getgrent_r_proto" in
12384 case "$getgrent_r_proto" in
12385 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12386 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12388 case "$getgrent_r_proto" in
12389 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12390 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12392 case "$getgrent_r_proto" in
12393 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12394 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12396 case "$getgrent_r_proto" in
12397 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12398 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12400 case "$getgrent_r_proto" in
12401 ''|0) try='int getgrent_r(struct group*, char*, int);'
12402 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12404 case "$getgrent_r_proto" in
12405 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12406 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12408 case "$getgrent_r_proto" in
12409 ''|0) d_getgrent_r=undef
12411 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12412 * ) case "$getgrent_r_proto" in
12413 REENTRANT_PROTO*) ;;
12414 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12416 echo "Prototype: $try" ;;
12419 *) case "$usethreads" in
12420 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12427 *) getgrent_r_proto=0
12431 : see if getgrgid_r exists
12432 set getgrgid_r d_getgrgid_r
12434 case "$d_getgrgid_r" in
12436 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12437 case "$d_getgrgid_r_proto:$usethreads" in
12438 ":define") d_getgrgid_r_proto=define
12439 set d_getgrgid_r_proto getgrgid_r $hdrs
12443 case "$d_getgrgid_r_proto" in
12445 case "$getgrgid_r_proto" in
12446 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12447 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12449 case "$getgrgid_r_proto" in
12450 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12451 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12453 case "$getgrgid_r_proto" in
12454 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12455 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12457 case "$getgrgid_r_proto" in
12458 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12459 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12461 case "$getgrgid_r_proto" in
12462 ''|0) d_getgrgid_r=undef
12464 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12465 * ) case "$getgrgid_r_proto" in
12466 REENTRANT_PROTO*) ;;
12467 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12469 echo "Prototype: $try" ;;
12472 *) case "$usethreads" in
12473 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12480 *) getgrgid_r_proto=0
12484 : see if getgrnam_r exists
12485 set getgrnam_r d_getgrnam_r
12487 case "$d_getgrnam_r" in
12489 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12490 case "$d_getgrnam_r_proto:$usethreads" in
12491 ":define") d_getgrnam_r_proto=define
12492 set d_getgrnam_r_proto getgrnam_r $hdrs
12496 case "$d_getgrnam_r_proto" in
12498 case "$getgrnam_r_proto" in
12499 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12500 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12502 case "$getgrnam_r_proto" in
12503 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12504 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12506 case "$getgrnam_r_proto" in
12507 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12508 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12510 case "$getgrnam_r_proto" in
12511 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12512 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12514 case "$getgrnam_r_proto" in
12515 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12516 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12518 case "$getgrnam_r_proto" in
12519 ''|0) d_getgrnam_r=undef
12521 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12522 * ) case "$getgrnam_r_proto" in
12523 REENTRANT_PROTO*) ;;
12524 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12526 echo "Prototype: $try" ;;
12529 *) case "$usethreads" in
12530 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12537 *) getgrnam_r_proto=0
12541 : see if gethostbyaddr exists
12542 set gethostbyaddr d_gethbyaddr
12545 : see if gethostbyname exists
12546 set gethostbyname d_gethbyname
12549 : see if gethostent exists
12550 set gethostent d_gethent
12553 : see how we will look up host name
12556 if set gethostname val -f d_gethname; eval $csym; $val; then
12557 echo 'gethostname() found.' >&4
12558 d_gethname="$define"
12561 if set uname val -f d_uname; eval $csym; $val; then
12564 uname() was found, but you're running xenix, and older versions of xenix
12565 have a broken uname(). If you don't really know whether your xenix is old
12566 enough to have a broken system call, use the default answer.
12571 "$define") dflt=n;;
12573 rp='Is your uname() broken?'
12576 n*) d_uname="$define"; call=uname;;
12579 echo 'uname() found.' >&4
12586 case "$d_gethname" in
12587 '') d_gethname="$undef";;
12590 '') d_uname="$undef";;
12592 case "$d_uname$d_gethname" in
12597 Every now and then someone has a $call() that lies about the hostname
12598 but can't be fixed for political or economic reasons. If you wish, I can
12599 pretend $call() isn't there and maybe compute hostname at run-time
12600 thanks to the '$phostname' command.
12603 rp="Shall I ignore $call() from now on?"
12606 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12609 case "$phostname" in
12610 '') aphostname='';;
12611 *) case "$aphostname" in
12613 *) set X $phostname
12617 file=`./loc $file $file $pth`
12618 aphostname=`echo $file $*`
12623 case "$d_uname$d_gethname" in
12626 case "$phostname" in
12628 echo "There will be no way for $package to get your hostname." >&4;;
12630 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12634 case "$d_phostname" in
12635 '') d_phostname="$undef";;
12638 : see if gethostbyaddr_r exists
12639 set gethostbyaddr_r d_gethostbyaddr_r
12641 case "$d_gethostbyaddr_r" in
12643 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12644 case "$d_gethostbyaddr_r_proto:$usethreads" in
12645 ":define") d_gethostbyaddr_r_proto=define
12646 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12650 case "$d_gethostbyaddr_r_proto" in
12652 case "$gethostbyaddr_r_proto" in
12653 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12654 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12656 case "$gethostbyaddr_r_proto" in
12657 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12658 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12660 case "$gethostbyaddr_r_proto" in
12661 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12662 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12664 case "$gethostbyaddr_r_proto" in
12665 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12666 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12668 case "$gethostbyaddr_r_proto" in
12669 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12670 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12672 case "$gethostbyaddr_r_proto" in
12673 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12674 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12676 case "$gethostbyaddr_r_proto" in
12677 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12678 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12680 case "$gethostbyaddr_r_proto" in
12681 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12682 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12684 case "$gethostbyaddr_r_proto" in
12685 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12686 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12688 case "$gethostbyaddr_r_proto" in
12689 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12690 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12692 case "$gethostbyaddr_r_proto" in
12693 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12694 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12696 case "$gethostbyaddr_r_proto" in
12697 ''|0) d_gethostbyaddr_r=undef
12698 gethostbyaddr_r_proto=0
12699 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12700 * ) case "$gethostbyaddr_r_proto" in
12701 REENTRANT_PROTO*) ;;
12702 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12704 echo "Prototype: $try" ;;
12707 *) case "$usethreads" in
12708 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12710 d_gethostbyaddr_r=undef
12711 gethostbyaddr_r_proto=0
12715 *) gethostbyaddr_r_proto=0
12719 : see if gethostbyname_r exists
12720 set gethostbyname_r d_gethostbyname_r
12722 case "$d_gethostbyname_r" in
12724 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12725 case "$d_gethostbyname_r_proto:$usethreads" in
12726 ":define") d_gethostbyname_r_proto=define
12727 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12731 case "$d_gethostbyname_r_proto" in
12733 case "$gethostbyname_r_proto" in
12734 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12735 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12737 case "$gethostbyname_r_proto" in
12738 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12739 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12741 case "$gethostbyname_r_proto" in
12742 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12743 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
12745 case "$gethostbyname_r_proto" in
12746 ''|0) d_gethostbyname_r=undef
12747 gethostbyname_r_proto=0
12748 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
12749 * ) case "$gethostbyname_r_proto" in
12750 REENTRANT_PROTO*) ;;
12751 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
12753 echo "Prototype: $try" ;;
12756 *) case "$usethreads" in
12757 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
12759 d_gethostbyname_r=undef
12760 gethostbyname_r_proto=0
12764 *) gethostbyname_r_proto=0
12768 : see if gethostent_r exists
12769 set gethostent_r d_gethostent_r
12771 case "$d_gethostent_r" in
12773 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12774 case "$d_gethostent_r_proto:$usethreads" in
12775 ":define") d_gethostent_r_proto=define
12776 set d_gethostent_r_proto gethostent_r $hdrs
12780 case "$d_gethostent_r_proto" in
12782 case "$gethostent_r_proto" in
12783 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
12784 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
12786 case "$gethostent_r_proto" in
12787 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
12788 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
12790 case "$gethostent_r_proto" in
12791 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
12792 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
12794 case "$gethostent_r_proto" in
12795 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
12796 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
12798 case "$gethostent_r_proto" in
12799 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
12800 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
12802 case "$gethostent_r_proto" in
12803 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
12804 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
12806 case "$gethostent_r_proto" in
12807 ''|0) d_gethostent_r=undef
12808 gethostent_r_proto=0
12809 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
12810 * ) case "$gethostent_r_proto" in
12811 REENTRANT_PROTO*) ;;
12812 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
12814 echo "Prototype: $try" ;;
12817 *) case "$usethreads" in
12818 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
12820 d_gethostent_r=undef
12821 gethostent_r_proto=0
12825 *) gethostent_r_proto=0
12829 : see if prototypes for various gethostxxx netdb.h functions are available
12831 set d_gethostprotos gethostent $i_netdb netdb.h
12834 : see if getitimer exists
12835 set getitimer d_getitimer
12838 : see if getlogin exists
12839 set getlogin d_getlogin
12842 : see if getlogin_r exists
12843 set getlogin_r d_getlogin_r
12845 case "$d_getlogin_r" in
12847 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
12848 case "$d_getlogin_r_proto:$usethreads" in
12849 ":define") d_getlogin_r_proto=define
12850 set d_getlogin_r_proto getlogin_r $hdrs
12854 case "$d_getlogin_r_proto" in
12856 case "$getlogin_r_proto" in
12857 ''|0) try='int getlogin_r(char*, size_t);'
12858 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
12860 case "$getlogin_r_proto" in
12861 ''|0) try='int getlogin_r(char*, int);'
12862 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
12864 case "$getlogin_r_proto" in
12865 ''|0) try='char* getlogin_r(char*, size_t);'
12866 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
12868 case "$getlogin_r_proto" in
12869 ''|0) try='char* getlogin_r(char*, int);'
12870 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
12872 case "$getlogin_r_proto" in
12873 ''|0) d_getlogin_r=undef
12875 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
12876 * ) case "$getlogin_r_proto" in
12877 REENTRANT_PROTO*) ;;
12878 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
12880 echo "Prototype: $try" ;;
12883 *) case "$usethreads" in
12884 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
12891 *) getlogin_r_proto=0
12895 : see if getmnt exists
12896 set getmnt d_getmnt
12899 : see if getmntent exists
12900 set getmntent d_getmntent
12903 : see if getnetbyaddr exists
12904 set getnetbyaddr d_getnbyaddr
12907 : see if getnetbyname exists
12908 set getnetbyname d_getnbyname
12911 : see if getnetent exists
12912 set getnetent d_getnent
12915 : see if getnetbyaddr_r exists
12916 set getnetbyaddr_r d_getnetbyaddr_r
12918 case "$d_getnetbyaddr_r" in
12920 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12921 case "$d_getnetbyaddr_r_proto:$usethreads" in
12922 ":define") d_getnetbyaddr_r_proto=define
12923 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
12927 case "$d_getnetbyaddr_r_proto" in
12929 case "$getnetbyaddr_r_proto" in
12930 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
12931 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
12933 case "$getnetbyaddr_r_proto" in
12934 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
12935 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
12937 case "$getnetbyaddr_r_proto" in
12938 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
12939 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
12941 case "$getnetbyaddr_r_proto" in
12942 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
12943 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
12945 case "$getnetbyaddr_r_proto" in
12946 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
12947 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
12949 case "$getnetbyaddr_r_proto" in
12950 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
12951 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
12953 case "$getnetbyaddr_r_proto" in
12954 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
12955 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
12957 case "$getnetbyaddr_r_proto" in
12958 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
12959 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
12961 case "$getnetbyaddr_r_proto" in
12962 ''|0) d_getnetbyaddr_r=undef
12963 getnetbyaddr_r_proto=0
12964 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
12965 * ) case "$getnetbyaddr_r_proto" in
12966 REENTRANT_PROTO*) ;;
12967 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
12969 echo "Prototype: $try" ;;
12972 *) case "$usethreads" in
12973 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
12975 d_getnetbyaddr_r=undef
12976 getnetbyaddr_r_proto=0
12980 *) getnetbyaddr_r_proto=0
12984 : see if getnetbyname_r exists
12985 set getnetbyname_r d_getnetbyname_r
12987 case "$d_getnetbyname_r" in
12989 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12990 case "$d_getnetbyname_r_proto:$usethreads" in
12991 ":define") d_getnetbyname_r_proto=define
12992 set d_getnetbyname_r_proto getnetbyname_r $hdrs
12996 case "$d_getnetbyname_r_proto" in
12998 case "$getnetbyname_r_proto" in
12999 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
13000 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
13002 case "$getnetbyname_r_proto" in
13003 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
13004 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
13006 case "$getnetbyname_r_proto" in
13007 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
13008 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
13010 case "$getnetbyname_r_proto" in
13011 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
13012 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13014 case "$getnetbyname_r_proto" in
13015 ''|0) d_getnetbyname_r=undef
13016 getnetbyname_r_proto=0
13017 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13018 * ) case "$getnetbyname_r_proto" in
13019 REENTRANT_PROTO*) ;;
13020 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13022 echo "Prototype: $try" ;;
13025 *) case "$usethreads" in
13026 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13028 d_getnetbyname_r=undef
13029 getnetbyname_r_proto=0
13033 *) getnetbyname_r_proto=0
13037 : see if getnetent_r exists
13038 set getnetent_r d_getnetent_r
13040 case "$d_getnetent_r" in
13042 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13043 case "$d_getnetent_r_proto:$usethreads" in
13044 ":define") d_getnetent_r_proto=define
13045 set d_getnetent_r_proto getnetent_r $hdrs
13049 case "$d_getnetent_r_proto" in
13051 case "$getnetent_r_proto" in
13052 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13053 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13055 case "$getnetent_r_proto" in
13056 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13057 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13059 case "$getnetent_r_proto" in
13060 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13061 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13063 case "$getnetent_r_proto" in
13064 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13065 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13067 case "$getnetent_r_proto" in
13068 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13069 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13071 case "$getnetent_r_proto" in
13072 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13073 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13075 case "$getnetent_r_proto" in
13076 ''|0) d_getnetent_r=undef
13077 getnetent_r_proto=0
13078 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13079 * ) case "$getnetent_r_proto" in
13080 REENTRANT_PROTO*) ;;
13081 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13083 echo "Prototype: $try" ;;
13086 *) case "$usethreads" in
13087 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13089 d_getnetent_r=undef
13090 getnetent_r_proto=0
13094 *) getnetent_r_proto=0
13098 : see if prototypes for various getnetxxx netdb.h functions are available
13100 set d_getnetprotos getnetent $i_netdb netdb.h
13103 : see if getpagesize exists
13104 set getpagesize d_getpagsz
13108 : see if getprotobyname exists
13109 set getprotobyname d_getpbyname
13112 : see if getprotobynumber exists
13113 set getprotobynumber d_getpbynumber
13116 : see if getprotoent exists
13117 set getprotoent d_getpent
13120 : see if getpgid exists
13121 set getpgid d_getpgid
13124 : see if getpgrp2 exists
13125 set getpgrp2 d_getpgrp2
13128 : see if getppid exists
13129 set getppid d_getppid
13132 : see if getpriority exists
13133 set getpriority d_getprior
13136 : see if getprotobyname_r exists
13137 set getprotobyname_r d_getprotobyname_r
13139 case "$d_getprotobyname_r" in
13141 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13142 case "$d_getprotobyname_r_proto:$usethreads" in
13143 ":define") d_getprotobyname_r_proto=define
13144 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13148 case "$d_getprotobyname_r_proto" in
13150 case "$getprotobyname_r_proto" in
13151 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13152 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13154 case "$getprotobyname_r_proto" in
13155 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13156 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13158 case "$getprotobyname_r_proto" in
13159 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13160 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13162 case "$getprotobyname_r_proto" in
13163 ''|0) d_getprotobyname_r=undef
13164 getprotobyname_r_proto=0
13165 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13166 * ) case "$getprotobyname_r_proto" in
13167 REENTRANT_PROTO*) ;;
13168 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13170 echo "Prototype: $try" ;;
13173 *) case "$usethreads" in
13174 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13176 d_getprotobyname_r=undef
13177 getprotobyname_r_proto=0
13181 *) getprotobyname_r_proto=0
13185 : see if getprotobynumber_r exists
13186 set getprotobynumber_r d_getprotobynumber_r
13188 case "$d_getprotobynumber_r" in
13190 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13191 case "$d_getprotobynumber_r_proto:$usethreads" in
13192 ":define") d_getprotobynumber_r_proto=define
13193 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13197 case "$d_getprotobynumber_r_proto" in
13199 case "$getprotobynumber_r_proto" in
13200 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13201 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13203 case "$getprotobynumber_r_proto" in
13204 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13205 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13207 case "$getprotobynumber_r_proto" in
13208 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13209 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13211 case "$getprotobynumber_r_proto" in
13212 ''|0) d_getprotobynumber_r=undef
13213 getprotobynumber_r_proto=0
13214 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13215 * ) case "$getprotobynumber_r_proto" in
13216 REENTRANT_PROTO*) ;;
13217 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13219 echo "Prototype: $try" ;;
13222 *) case "$usethreads" in
13223 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13225 d_getprotobynumber_r=undef
13226 getprotobynumber_r_proto=0
13230 *) getprotobynumber_r_proto=0
13234 : see if getprotoent_r exists
13235 set getprotoent_r d_getprotoent_r
13237 case "$d_getprotoent_r" in
13239 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13240 case "$d_getprotoent_r_proto:$usethreads" in
13241 ":define") d_getprotoent_r_proto=define
13242 set d_getprotoent_r_proto getprotoent_r $hdrs
13246 case "$d_getprotoent_r_proto" in
13248 case "$getprotoent_r_proto" in
13249 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13250 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13252 case "$getprotoent_r_proto" in
13253 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13254 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13256 case "$getprotoent_r_proto" in
13257 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13258 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13260 case "$getprotoent_r_proto" in
13261 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13262 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13264 case "$getprotoent_r_proto" in
13265 ''|0) d_getprotoent_r=undef
13266 getprotoent_r_proto=0
13267 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13268 * ) case "$getprotoent_r_proto" in
13269 REENTRANT_PROTO*) ;;
13270 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13272 echo "Prototype: $try" ;;
13275 *) case "$usethreads" in
13276 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13278 d_getprotoent_r=undef
13279 getprotoent_r_proto=0
13283 *) getprotoent_r_proto=0
13287 : see if prototypes for various getprotoxxx netdb.h functions are available
13289 set d_getprotoprotos getprotoent $i_netdb netdb.h
13292 : see if getprpwnam exists
13293 set getprpwnam d_getprpwnam
13296 : see if getpwent exists
13297 set getpwent d_getpwent
13300 : see if getpwent_r exists
13301 set getpwent_r d_getpwent_r
13303 case "$d_getpwent_r" in
13305 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13306 case "$d_getpwent_r_proto:$usethreads" in
13307 ":define") d_getpwent_r_proto=define
13308 set d_getpwent_r_proto getpwent_r $hdrs
13312 case "$d_getpwent_r_proto" in
13314 case "$getpwent_r_proto" in
13315 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13316 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13318 case "$getpwent_r_proto" in
13319 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13320 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13322 case "$getpwent_r_proto" in
13323 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13324 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13326 case "$getpwent_r_proto" in
13327 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13328 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13330 case "$getpwent_r_proto" in
13331 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13332 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13334 case "$getpwent_r_proto" in
13335 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13336 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13338 case "$getpwent_r_proto" in
13339 ''|0) d_getpwent_r=undef
13341 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13342 * ) case "$getpwent_r_proto" in
13343 REENTRANT_PROTO*) ;;
13344 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13346 echo "Prototype: $try" ;;
13349 *) case "$usethreads" in
13350 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13357 *) getpwent_r_proto=0
13361 : see if getpwnam_r exists
13362 set getpwnam_r d_getpwnam_r
13364 case "$d_getpwnam_r" in
13366 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13367 case "$d_getpwnam_r_proto:$usethreads" in
13368 ":define") d_getpwnam_r_proto=define
13369 set d_getpwnam_r_proto getpwnam_r $hdrs
13373 case "$d_getpwnam_r_proto" in
13375 case "$getpwnam_r_proto" in
13376 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13377 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13379 case "$getpwnam_r_proto" in
13380 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13381 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13383 case "$getpwnam_r_proto" in
13384 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13385 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13387 case "$getpwnam_r_proto" in
13388 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13389 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13391 case "$getpwnam_r_proto" in
13392 ''|0) d_getpwnam_r=undef
13394 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13395 * ) case "$getpwnam_r_proto" in
13396 REENTRANT_PROTO*) ;;
13397 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13399 echo "Prototype: $try" ;;
13402 *) case "$usethreads" in
13403 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13410 *) getpwnam_r_proto=0
13414 : see if getpwuid_r exists
13415 set getpwuid_r d_getpwuid_r
13417 case "$d_getpwuid_r" in
13419 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13420 case "$d_getpwuid_r_proto:$usethreads" in
13421 ":define") d_getpwuid_r_proto=define
13422 set d_getpwuid_r_proto getpwuid_r $hdrs
13426 case "$d_getpwuid_r_proto" in
13428 case "$getpwuid_r_proto" in
13429 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13430 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13432 case "$getpwuid_r_proto" in
13433 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13434 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13436 case "$getpwuid_r_proto" in
13437 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13438 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13440 case "$getpwuid_r_proto" in
13441 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13442 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13444 case "$getpwuid_r_proto" in
13445 ''|0) d_getpwuid_r=undef
13447 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13448 * ) case "$getpwuid_r_proto" in
13449 REENTRANT_PROTO*) ;;
13450 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13452 echo "Prototype: $try" ;;
13455 *) case "$usethreads" in
13456 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13463 *) getpwuid_r_proto=0
13468 : see if getservbyname exists
13469 set getservbyname d_getsbyname
13472 : see if getservbyport exists
13473 set getservbyport d_getsbyport
13476 : see if getservent exists
13477 set getservent d_getsent
13480 : see if getservbyname_r exists
13481 set getservbyname_r d_getservbyname_r
13483 case "$d_getservbyname_r" in
13485 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13486 case "$d_getservbyname_r_proto:$usethreads" in
13487 ":define") d_getservbyname_r_proto=define
13488 set d_getservbyname_r_proto getservbyname_r $hdrs
13492 case "$d_getservbyname_r_proto" in
13494 case "$getservbyname_r_proto" in
13495 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13496 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13498 case "$getservbyname_r_proto" in
13499 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13500 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13502 case "$getservbyname_r_proto" in
13503 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13504 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13506 case "$getservbyname_r_proto" in
13507 ''|0) d_getservbyname_r=undef
13508 getservbyname_r_proto=0
13509 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13510 * ) case "$getservbyname_r_proto" in
13511 REENTRANT_PROTO*) ;;
13512 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13514 echo "Prototype: $try" ;;
13517 *) case "$usethreads" in
13518 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13520 d_getservbyname_r=undef
13521 getservbyname_r_proto=0
13525 *) getservbyname_r_proto=0
13529 : see if getservbyport_r exists
13530 set getservbyport_r d_getservbyport_r
13532 case "$d_getservbyport_r" in
13534 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13535 case "$d_getservbyport_r_proto:$usethreads" in
13536 ":define") d_getservbyport_r_proto=define
13537 set d_getservbyport_r_proto getservbyport_r $hdrs
13541 case "$d_getservbyport_r_proto" in
13543 case "$getservbyport_r_proto" in
13544 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13545 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13547 case "$getservbyport_r_proto" in
13548 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13549 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13551 case "$getservbyport_r_proto" in
13552 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13553 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13555 case "$getservbyport_r_proto" in
13556 ''|0) d_getservbyport_r=undef
13557 getservbyport_r_proto=0
13558 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13559 * ) case "$getservbyport_r_proto" in
13560 REENTRANT_PROTO*) ;;
13561 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13563 echo "Prototype: $try" ;;
13566 *) case "$usethreads" in
13567 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13569 d_getservbyport_r=undef
13570 getservbyport_r_proto=0
13574 *) getservbyport_r_proto=0
13578 : see if getservent_r exists
13579 set getservent_r d_getservent_r
13581 case "$d_getservent_r" in
13583 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13584 case "$d_getservent_r_proto:$usethreads" in
13585 ":define") d_getservent_r_proto=define
13586 set d_getservent_r_proto getservent_r $hdrs
13590 case "$d_getservent_r_proto" in
13592 case "$getservent_r_proto" in
13593 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13594 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13596 case "$getservent_r_proto" in
13597 ''|0) try='int getservent_r(struct servent*, char*, int);'
13598 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13600 case "$getservent_r_proto" in
13601 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13602 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13604 case "$getservent_r_proto" in
13605 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13606 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13608 case "$getservent_r_proto" in
13609 ''|0) d_getservent_r=undef
13610 getservent_r_proto=0
13611 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13612 * ) case "$getservent_r_proto" in
13613 REENTRANT_PROTO*) ;;
13614 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13616 echo "Prototype: $try" ;;
13619 *) case "$usethreads" in
13620 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13622 d_getservent_r=undef
13623 getservent_r_proto=0
13627 *) getservent_r_proto=0
13631 : see if prototypes for various getservxxx netdb.h functions are available
13633 set d_getservprotos getservent $i_netdb netdb.h
13636 : see if getspnam exists
13637 set getspnam d_getspnam
13640 : see if this is a shadow.h system
13641 set shadow.h i_shadow
13644 : see if getspnam_r exists
13645 set getspnam_r d_getspnam_r
13647 case "$d_getspnam_r" in
13649 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13650 case "$d_getspnam_r_proto:$usethreads" in
13651 ":define") d_getspnam_r_proto=define
13652 set d_getspnam_r_proto getspnam_r $hdrs
13656 case "$d_getspnam_r_proto" in
13658 case "$getspnam_r_proto" in
13659 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13660 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13662 case "$getspnam_r_proto" in
13663 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13664 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13666 case "$getspnam_r_proto" in
13667 ''|0) d_getspnam_r=undef
13669 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13670 * ) case "$getspnam_r_proto" in
13671 REENTRANT_PROTO*) ;;
13672 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13674 echo "Prototype: $try" ;;
13677 *) case "$usethreads" in
13678 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13685 *) getspnam_r_proto=0
13689 : see if gettimeofday or ftime exists
13690 set gettimeofday d_gettimeod
13692 case "$d_gettimeod" in
13698 val="$undef"; set d_ftime; eval $setvar
13701 case "$d_gettimeod$d_ftime" in
13704 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13708 : see if gmtime_r exists
13709 set gmtime_r d_gmtime_r
13711 case "$d_gmtime_r" in
13713 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13714 case "$d_gmtime_r_proto:$usethreads" in
13715 ":define") d_gmtime_r_proto=define
13716 set d_gmtime_r_proto gmtime_r $hdrs
13720 case "$d_gmtime_r_proto" in
13722 case "$gmtime_r_proto" in
13723 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13724 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13726 case "$gmtime_r_proto" in
13727 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13728 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13730 case "$gmtime_r_proto" in
13731 ''|0) d_gmtime_r=undef
13733 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13734 * ) case "$gmtime_r_proto" in
13735 REENTRANT_PROTO*) ;;
13736 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13738 echo "Prototype: $try" ;;
13741 *) case "$usethreads" in
13742 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13749 *) gmtime_r_proto=0
13753 : see if hasmntopt exists
13754 set hasmntopt d_hasmntopt
13757 : see if this is a netinet/in.h or sys/in.h system
13758 set netinet/in.h i_niin sys/in.h i_sysin
13761 : see if arpa/inet.h has to be included
13762 set arpa/inet.h i_arpainet
13765 : see if htonl --and friends-- exists
13770 : Maybe they are macros.
13773 $cat >htonl.c <<EOM
13775 #include <sys/types.h>
13776 #$i_niin I_NETINET_IN
13778 #$i_arpainet I_ARPA_INET
13779 #ifdef I_NETINET_IN
13780 #include <netinet/in.h>
13783 #include <sys/in.h>
13786 #include <arpa/inet.h>
13789 printf("Defined as a macro.");
13792 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
13793 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
13795 echo "But it seems to be defined as a macro." >&4
13803 : see if ilogbl exists
13804 set ilogbl d_ilogbl
13809 if set index val -f; eval $csym; $val; then
13810 if set strchr val -f d_strchr; eval $csym; $val; then
13811 if $contains strchr "$strings" >/dev/null 2>&1 ; then
13814 echo "strchr() found." >&4
13818 echo "index() found." >&4
13823 echo "index() found." >&4
13826 if set strchr val -f d_strchr; eval $csym; $val; then
13829 echo "strchr() found." >&4
13831 echo "No index() or strchr() found!" >&4
13836 set d_strchr; eval $setvar
13838 set d_index; eval $setvar
13840 : check whether inet_aton exists
13841 set inet_aton d_inetaton
13846 $cat >isascii.c <<EOCP
13849 #$i_stdlib I_STDLIB
13851 #include <stdlib.h>
13862 if eval $compile; then
13863 echo "isascii() found." >&4
13866 echo "isascii() NOT found." >&4
13873 : see if isfinite exists
13874 set isfinite d_isfinite
13877 : see if isinf exists
13881 : see if isnan exists
13885 : see if isnanl exists
13886 set isnanl d_isnanl
13889 : see if killpg exists
13890 set killpg d_killpg
13893 : see if lchown exists
13895 $cat > try.c <<'EOCP'
13896 /* System header to define __stub macros and hopefully few prototypes,
13897 which can conflict with char lchown(); below. */
13898 #include <assert.h>
13899 /* Override any gcc2 internal prototype to avoid an error. */
13900 /* We use char because int might match the return type of a gcc2
13901 builtin and then its argument prototype would still apply. */
13904 /* The GNU C library defines this for functions which it implements
13905 to always fail with ENOSYS. Some functions are actually named
13906 something starting with __ and the normal name is an alias. */
13907 #if defined (__stub_lchown) || defined (__stub___lchown)
13915 if eval $compile; then
13916 $echo "lchown() found." >&4
13919 $echo "lchown() NOT found." >&4
13925 : See if number of significant digits in a double precision number is known
13927 $cat >ldbl_dig.c <<EOM
13928 #$i_limits I_LIMITS
13931 #include <limits.h>
13937 printf("Contains LDBL_DIG");
13940 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
13941 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
13942 echo "LDBL_DIG found." >&4
13945 echo "LDBL_DIG NOT found." >&4
13952 : see if link exists
13956 : see if localtime_r exists
13957 set localtime_r d_localtime_r
13959 case "$d_localtime_r" in
13961 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13962 case "$d_localtime_r_proto:$usethreads" in
13963 ":define") d_localtime_r_proto=define
13964 set d_localtime_r_proto localtime_r $hdrs
13968 case "$d_localtime_r_proto" in
13970 case "$localtime_r_proto" in
13971 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
13972 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
13974 case "$localtime_r_proto" in
13975 ''|0) try='int localtime_r(const time_t*, struct tm*);'
13976 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
13978 case "$localtime_r_proto" in
13979 ''|0) d_localtime_r=undef
13980 localtime_r_proto=0
13981 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
13982 * ) case "$localtime_r_proto" in
13983 REENTRANT_PROTO*) ;;
13984 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
13986 echo "Prototype: $try" ;;
13989 *) case "$usethreads" in
13990 define) echo "localtime_r has no prototype, not using it." >&4 ;;
13992 d_localtime_r=undef
13993 localtime_r_proto=0
13997 *) localtime_r_proto=0
14001 : see if localeconv exists
14002 set localeconv d_locconv
14005 : see if lockf exists
14009 : see if prototype for lseek is available
14011 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14014 : see if lstat exists
14018 : see if madvise exists
14019 set madvise d_madvise
14022 : see if mblen exists
14026 : see if mbstowcs exists
14027 set mbstowcs d_mbstowcs
14030 : see if mbtowc exists
14031 set mbtowc d_mbtowc
14034 : see if memchr exists
14035 set memchr d_memchr
14038 : see if memcmp exists
14039 set memcmp d_memcmp
14042 : see if memcpy exists
14043 set memcpy d_memcpy
14046 : see if memmove exists
14047 set memmove d_memmove
14050 : see if memset exists
14051 set memset d_memset
14054 : see if mkdir exists
14058 : see if mkdtemp exists
14059 set mkdtemp d_mkdtemp
14062 : see if mkfifo exists
14063 set mkfifo d_mkfifo
14066 : see if mkstemp exists
14067 set mkstemp d_mkstemp
14070 : see if mkstemps exists
14071 set mkstemps d_mkstemps
14074 : see if mktime exists
14075 set mktime d_mktime
14078 : see if this is a sys/mman.h system
14079 set sys/mman.h i_sysmman
14082 : see if mmap exists
14085 : see what shmat returns
14086 : default to something harmless
14088 case "$i_sysmman$d_mmap" in
14090 $cat >mmap.c <<'END'
14091 #include <sys/mman.h>
14094 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14099 echo "and it returns ($mmaptype)." >&4
14105 : see if sqrtl exists
14109 : see if scalbnl exists
14110 set scalbnl d_scalbnl
14113 : see if modfl exists
14117 : see if this is a math.h system
14121 : see if prototype for modfl is available
14123 set d_modflproto modfl $i_math math.h
14126 d_modfl_pow32_bug="$undef"
14128 case "$d_longdbl$d_modfl" in
14131 Checking to see whether your modfl() is okay for large values...
14137 if $test "X$d_modflproto" != "X$define"; then
14138 $cat >>try.c <<EOCP
14139 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14140 long double modfl (long double, long double *);
14143 $cat >>try.c <<EOCP
14145 long double nv = 4294967303.15;
14151 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14155 case "$osname:$gccversion" in
14156 aix:) saveccflags="$ccflags"
14157 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14160 if eval $compile; then
14163 *" 4294967303.150000 1.150000 4294967302.000000")
14164 echo >&4 "Your modfl() is broken for large values."
14165 d_modfl_pow32_bug="$define"
14167 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14171 *" 4294967303.150000 0.150000 4294967303.000000")
14172 echo >&4 "Your modfl() seems okay for large values."
14174 *) echo >&4 "I don't understand your modfl() at all."
14178 $rm -f try.* try core core.try.*
14180 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14183 case "$osname:$gccversion" in
14184 aix:) ccflags="$saveccflags" ;; # restore
14189 if $test "$uselongdouble" = "$define"; then
14191 if $test "$d_sqrtl" != "$define"; then
14192 message="$message sqrtl"
14194 if $test "$d_modfl" != "$define"; then
14195 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14196 echo "You have both aintl and copysignl, so I can emulate modfl."
14198 message="$message modfl"
14201 if $test "$d_frexpl" != "$define"; then
14202 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14203 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14205 message="$message frexpl"
14209 if $test "$message" != ""; then
14212 *** You requested the use of long doubles but you do not seem to have
14213 *** the following mathematical functions needed for long double support:
14215 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14216 *** Cannot continue, aborting.
14224 : see if mprotect exists
14225 set mprotect d_mprotect
14228 : see if msgctl exists
14229 set msgctl d_msgctl
14232 : see if msgget exists
14233 set msgget d_msgget
14236 : see if msgsnd exists
14237 set msgsnd d_msgsnd
14240 : see if msgrcv exists
14241 set msgrcv d_msgrcv
14244 : see how much of the 'msg*(2)' library is present.
14247 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14248 *"$undef"*) h_msg=false;;
14252 case "`ipcs 2>&1`" in
14253 "SVID messages"*"not configured"*)
14254 echo "Your $osname does not have the msg*(2) configured." >&4
14257 set msgctl d_msgctl
14259 set msgget d_msgget
14261 set msgsnd d_msgsnd
14263 set msgrcv d_msgrcv
14269 : we could also check for sys/ipc.h ...
14270 if $h_msg && $test `./findhdr sys/msg.h`; then
14271 echo "You have the full msg*(2) library." >&4
14274 echo "You don't have the full msg*(2) library." >&4
14282 echo "Checking to see if your system supports struct msghdr..." >&4
14283 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14285 case "$d_msghdr_s" in
14286 "$define") echo "Yes, it does." ;;
14287 *) echo "No, it doesn't." ;;
14291 : see if msync exists
14295 : see if munmap exists
14296 set munmap d_munmap
14299 : see if nice exists
14303 : see if this is a langinfo.h system
14304 set langinfo.h i_langinfo
14307 : see if nl_langinfo exists
14308 set nl_langinfo d_nl_langinfo
14311 : check for length of character
14313 case "$charsize" in
14315 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14318 #$i_stdlib I_STDLIB
14320 #include <stdlib.h>
14324 printf("%d\n", (int)sizeof(char));
14329 if eval $compile_ok; then
14333 echo "(I can't seem to compile the test program. Guessing...)"
14340 rp="What is the size of a character (in bytes)?"
14345 : check for volatile keyword
14347 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14348 $cat >try.c <<'EOCP'
14351 typedef struct _goo_struct goo_struct;
14352 goo_struct * volatile goo = ((goo_struct *)0);
14353 struct _goo_struct {
14358 typedef unsigned short foo_t;
14359 char *volatile foo;
14361 volatile foo_t blech;
14365 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14367 echo "Yup, it does."
14370 echo "Nope, it doesn't."
14378 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14380 case "$use64bitint:$d_quad:$quadtype" in
14383 uvtype="$uquadtype"
14388 uvtype="unsigned long"
14394 case "$uselongdouble:$d_longdbl" in
14396 nvtype="long double"
14397 nvsize=$longdblsize
14404 $echo "(IV will be "$ivtype", $ivsize bytes)"
14405 $echo "(UV will be "$uvtype", $uvsize bytes)"
14406 $echo "(NV will be "$nvtype", $nvsize bytes)"
14409 #$i_inttypes I_INTTYPES
14411 #include <inttypes.h>
14416 int8_t i = INT8_MAX;
14417 uint8_t u = UINT8_MAX;
14418 printf("int8_t\n");
14421 int16_t i = INT16_MAX;
14422 uint16_t i = UINT16_MAX;
14423 printf("int16_t\n");
14426 int32_t i = INT32_MAX;
14427 uint32_t u = UINT32_MAX;
14428 printf("int32_t\n");
14434 '') case "$charsize" in
14436 u8type="unsigned char"
14445 if eval $compile; then
14446 case "`$run ./try`" in
14447 int8_t) i8type=int8_t
14457 '') if $test $charsize -ge 1; then
14459 u8type="unsigned char"
14467 '') case "$shortsize" in
14469 u16type="unsigned short"
14477 '') set try -DINT16
14478 if eval $compile; then
14479 case "`$run ./try`" in
14491 '') if $test $shortsize -ge 2; then
14493 u16type="unsigned short"
14501 '') case "$longsize" in
14503 u32type="unsigned long"
14507 *) case "$intsize" in
14509 u32type="unsigned int"
14519 '') set try -DINT32
14520 if eval $compile; then
14521 case "`$run ./try`" in
14533 '') if $test $intsize -ge 4; then
14535 u32type="unsigned int"
14543 '') case "$d_quad:$quadtype" in
14545 i64type="$quadtype"
14546 u64type="$uquadtype"
14554 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14555 : volatile so that the compiler has to store it out to memory.
14556 if test X"$d_volatile" = X"$define"; then
14561 #$i_stdlib I_STDLIB
14563 #include <stdlib.h>
14565 #include <sys/types.h>
14566 #include <signal.h>
14568 $volatile int bletched = 0;
14569 $signal_t blech(s) int s; { bletched = 1; }
14574 int n = 8 * $uvsize;
14577 signal(SIGFPE, blech);
14580 for (i = 0; i < n; i++) {
14581 u = u << 1 | ($uvtype)1;
14583 if (($uvtype)d != u)
14587 d = ($nvtype)(u - 1);
14588 if (($uvtype)d != (u - 1))
14596 printf("%d\n", ((i == n) ? -n : i));
14602 d_nv_preserves_uv="$undef"
14603 if eval $compile; then
14604 nv_preserves_uv_bits="`$run ./try`"
14606 case "$nv_preserves_uv_bits" in
14608 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14609 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14610 d_nv_preserves_uv="$define"
14612 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14613 d_nv_preserves_uv="$undef" ;;
14614 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14615 nv_preserves_uv_bits="$undef" ;;
14621 : check for off64_t
14623 echo "Checking to see if you have off64_t..." >&4
14625 #include <sys/types.h>
14626 #include <unistd.h>
14627 int main() { off64_t x = 7; }
14630 if eval $compile; then
14632 echo "You have off64_t."
14635 echo "You do not have off64_t."
14636 case "$lseeksize" in
14637 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
14644 : how to create joinable pthreads
14645 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
14647 echo "Checking what constant to use for creating joinable pthreads..." >&4
14648 $cat >try.c <<'EOCP'
14649 #include <pthread.h>
14651 int detachstate = JOINABLE;
14654 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
14655 if eval $compile; then
14656 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
14657 val="$undef" # Yes, undef.
14658 set d_old_pthread_create_joinable
14661 set old_pthread_create_joinable
14664 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
14665 if eval $compile; then
14666 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
14668 set d_old_pthread_create_joinable
14670 val=PTHREAD_CREATE_UNDETACHED
14671 set old_pthread_create_joinable
14674 set try -DJOINABLE=__UNDETACHED
14675 if eval $compile; then
14676 echo "You seem to use __UNDETACHED." >&4
14678 set d_old_pthread_create_joinable
14681 set old_pthread_create_joinable
14684 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
14686 set d_old_pthread_create_joinable
14689 set old_pthread_create_joinable
14696 d_old_pthread_create_joinable="$undef"
14697 old_pthread_create_joinable=""
14700 : see if pause exists
14704 : see if pipe exists
14708 : see if poll exists
14712 : see if readlink exists
14713 set readlink d_readlink
14719 case "$d_readlink" in
14721 if $issymlink /proc/self/exe ; then
14722 $ls -l /proc/self/exe > reflect
14723 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
14724 echo "You have Linux-like /proc/self/exe."
14725 procselfexe='"/proc/self/exe"'
14729 if $issymlink /proc/curproc/file ; then
14730 $ls -l /proc/curproc/file > reflect
14731 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
14732 echo "You have BSD-like /proc/curproc/file."
14733 procselfexe='"/proc/curproc/file"'
14743 : see whether the pthread_atfork exists
14745 #include <pthread.h>
14748 #ifdef PTHREAD_ATFORK
14749 pthread_atfork(NULL,NULL,NULL);
14754 : see if pthread_atfork exists
14755 set try -DPTHREAD_ATFORK
14756 if eval $compile; then
14761 case "$usethreads" in
14764 $define) echo 'pthread_atfork found.' >&4 ;;
14765 *) echo 'pthread_atfork NOT found.' >&4 ;;
14768 set d_pthread_atfork
14771 : see if pthread_attr_setscope exists
14772 set pthread_attr_setscope d_pthread_attr_setscope
14776 : see whether the various POSIXish _yields exist
14778 #include <pthread.h>
14784 #ifdef PTHREAD_YIELD
14787 #ifdef PTHREAD_YIELD_NULL
14788 pthread_yield(NULL);
14794 : see if sched_yield exists
14795 set try -DSCHED_YIELD
14796 if eval $compile; then
14798 sched_yield='sched_yield()'
14802 case "$usethreads" in
14805 $define) echo 'sched_yield() found.' >&4 ;;
14806 *) echo 'sched_yield() NOT found.' >&4 ;;
14812 : see if pthread_yield exists
14813 set try -DPTHREAD_YIELD
14814 if eval $compile; then
14816 case "$sched_yield" in
14817 '') sched_yield='pthread_yield()' ;;
14820 set try -DPTHREAD_YIELD_NULL
14821 if eval $compile; then
14823 case "$sched_yield" in
14824 '') sched_yield='pthread_yield(NULL)' ;;
14830 case "$usethreads" in
14833 $define) echo 'pthread_yield() found.' >&4 ;;
14834 *) echo 'pthread_yield() NOT found.' >&4 ;;
14838 set d_pthread_yield
14841 case "$sched_yield" in
14842 '') sched_yield=undef ;;
14847 : see if random_r exists
14848 set random_r d_random_r
14850 case "$d_random_r" in
14852 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
14853 case "$d_random_r_proto:$usethreads" in
14854 ":define") d_random_r_proto=define
14855 set d_random_r_proto random_r $hdrs
14859 case "$d_random_r_proto" in
14861 case "$random_r_proto" in
14862 ''|0) try='int random_r(int*, struct random_data*);'
14863 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
14865 case "$random_r_proto" in
14866 ''|0) try='int random_r(long*, struct random_data*);'
14867 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
14869 case "$random_r_proto" in
14870 ''|0) try='int random_r(struct random_data*, int32_t*);'
14871 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
14873 case "$random_r_proto" in
14874 ''|0) d_random_r=undef
14876 echo "Disabling random_r, cannot determine prototype." >&4 ;;
14877 * ) case "$random_r_proto" in
14878 REENTRANT_PROTO*) ;;
14879 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
14881 echo "Prototype: $try" ;;
14884 *) case "$usethreads" in
14885 define) echo "random_r has no prototype, not using it." >&4 ;;
14892 *) random_r_proto=0
14896 : see if readdir and friends exist
14897 set readdir d_readdir
14899 set seekdir d_seekdir
14901 set telldir d_telldir
14903 set rewinddir d_rewinddir
14906 : see if readdir64_r exists
14907 set readdir64_r d_readdir64_r
14909 case "$d_readdir64_r" in
14911 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
14912 case "$d_readdir64_r_proto:$usethreads" in
14913 ":define") d_readdir64_r_proto=define
14914 set d_readdir64_r_proto readdir64_r $hdrs
14918 case "$d_readdir64_r_proto" in
14920 case "$readdir64_r_proto" in
14921 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
14922 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
14924 case "$readdir64_r_proto" in
14925 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
14926 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
14928 case "$readdir64_r_proto" in
14929 ''|0) d_readdir64_r=undef
14930 readdir64_r_proto=0
14931 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
14932 * ) case "$readdir64_r_proto" in
14933 REENTRANT_PROTO*) ;;
14934 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
14936 echo "Prototype: $try" ;;
14939 *) case "$usethreads" in
14940 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
14942 d_readdir64_r=undef
14943 readdir64_r_proto=0
14947 *) readdir64_r_proto=0
14951 : see if readdir_r exists
14952 set readdir_r d_readdir_r
14954 case "$d_readdir_r" in
14956 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
14957 case "$d_readdir_r_proto:$usethreads" in
14958 ":define") d_readdir_r_proto=define
14959 set d_readdir_r_proto readdir_r $hdrs
14963 case "$d_readdir_r_proto" in
14965 case "$readdir_r_proto" in
14966 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
14967 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
14969 case "$readdir_r_proto" in
14970 ''|0) try='int readdir_r(DIR*, struct dirent*);'
14971 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
14973 case "$readdir_r_proto" in
14974 ''|0) d_readdir_r=undef
14976 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
14977 * ) case "$readdir_r_proto" in
14978 REENTRANT_PROTO*) ;;
14979 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
14981 echo "Prototype: $try" ;;
14984 *) case "$usethreads" in
14985 define) echo "readdir_r has no prototype, not using it." >&4 ;;
14992 *) readdir_r_proto=0
14996 : see if readv exists
15000 : see if recvmsg exists
15001 set recvmsg d_recvmsg
15004 : see if rename exists
15005 set rename d_rename
15008 : see if rmdir exists
15012 : see if memory.h is available.
15017 : See if it conflicts with string.h
15023 $cppstdin $cppflags $cppminus < $strings > mem.h
15024 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15026 echo "We won't be including <memory.h>."
15036 : can bcopy handle overlapping blocks?
15039 case "$d_memmove" in
15040 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15041 *) case "$d_bcopy" in
15043 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15045 #$i_memory I_MEMORY
15046 #$i_stdlib I_STDLIB
15047 #$i_string I_STRING
15048 #$i_unistd I_UNISTD
15050 $cat >>try.c <<'EOCP'
15053 # include <memory.h>
15056 # include <stdlib.h>
15059 # include <string.h>
15061 # include <strings.h>
15064 # include <unistd.h> /* Needed for NetBSD */
15068 char buf[128], abc[128];
15074 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15075 try to store the string in read-only memory. */
15076 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15078 for (align = 7; align >= 0; align--) {
15079 for (len = 36; len; len--) {
15081 bcopy(abc, b, len);
15082 for (off = 1; off <= len; off++) {
15083 bcopy(b, b+off, len);
15084 bcopy(b+off, b, len);
15085 if (bcmp(b, abc, len))
15094 if eval $compile_ok; then
15095 if ./try 2>/dev/null; then
15096 echo "Yes, it can."
15099 echo "It can't, sorry."
15102 echo "(I can't compile the test program, so we'll assume not...)"
15106 $rm -f try.* try core
15112 : can memcpy handle overlapping blocks?
15115 case "$d_memmove" in
15116 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15117 *) case "$d_memcpy" in
15119 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15121 #$i_memory I_MEMORY
15122 #$i_stdlib I_STDLIB
15123 #$i_string I_STRING
15124 #$i_unistd I_UNISTD
15126 $cat >>try.c <<'EOCP'
15129 # include <memory.h>
15132 # include <stdlib.h>
15135 # include <string.h>
15137 # include <strings.h>
15140 # include <unistd.h> /* Needed for NetBSD */
15144 char buf[128], abc[128];
15150 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15151 try to store the string in read-only memory. */
15152 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15154 for (align = 7; align >= 0; align--) {
15155 for (len = 36; len; len--) {
15157 memcpy(b, abc, len);
15158 for (off = 1; off <= len; off++) {
15159 memcpy(b+off, b, len);
15160 memcpy(b, b+off, len);
15161 if (memcmp(b, abc, len))
15170 if eval $compile_ok; then
15171 if ./try 2>/dev/null; then
15172 echo "Yes, it can."
15175 echo "It can't, sorry."
15178 echo "(I can't compile the test program, so we'll assume not...)"
15182 $rm -f try.* try core
15188 : can memcmp be trusted to compare relative magnitude?
15190 case "$d_memcmp" in
15193 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15195 #$i_memory I_MEMORY
15196 #$i_stdlib I_STDLIB
15197 #$i_string I_STRING
15198 #$i_unistd I_UNISTD
15200 $cat >>try.c <<'EOCP'
15203 # include <memory.h>
15206 # include <stdlib.h>
15209 # include <string.h>
15211 # include <strings.h>
15214 # include <unistd.h> /* Needed for NetBSD */
15220 if ((a < b) && memcmp(&a, &b, 1) < 0)
15226 if eval $compile_ok; then
15227 if $run ./try 2>/dev/null; then
15228 echo "Yes, it can."
15231 echo "No, it can't (it uses signed chars)."
15234 echo "(I can't compile the test program, so we'll assume not...)"
15238 $rm -f try.* try core
15242 : see if prototype for sbrk is available
15244 set d_sbrkproto sbrk $i_unistd unistd.h
15247 : see if select exists
15248 set select d_select
15251 : see if semctl exists
15252 set semctl d_semctl
15255 : see if semget exists
15256 set semget d_semget
15259 : see if semop exists
15263 : see how much of the 'sem*(2)' library is present.
15266 case "$d_semctl$d_semget$d_semop" in
15267 *"$undef"*) h_sem=false;;
15271 case "`ipcs 2>&1`" in
15272 "SVID messages"*"not configured"*)
15273 echo "Your $osname does not have the sem*(2) configured." >&4
15276 set semctl d_semctl
15278 set semget d_semget
15286 : we could also check for sys/ipc.h ...
15287 if $h_sem && $test `./findhdr sys/sem.h`; then
15288 echo "You have the full sem*(2) library." >&4
15291 echo "You don't have the full sem*(2) library." >&4
15297 : see whether sys/sem.h defines union semun
15299 $cat > try.c <<'END'
15300 #include <sys/types.h>
15301 #include <sys/ipc.h>
15302 #include <sys/sem.h>
15303 int main () { union semun semun; semun.buf = 0; }
15306 if eval $compile; then
15307 echo "You have union semun in <sys/sem.h>." >&4
15310 echo "You do not have union semun in <sys/sem.h>." >&4
15317 : see how to do semctl IPC_STAT
15324 # define S_IRUSR S_IREAD
15325 # define S_IWUSR S_IWRITE
15326 # define S_IXUSR S_IEXEC
15328 # define S_IRUSR 0400
15329 # define S_IWUSR 0200
15330 # define S_IXUSR 0100
15332 # define S_IRGRP (S_IRUSR>>3)
15333 # define S_IWGRP (S_IWUSR>>3)
15334 # define S_IXGRP (S_IXUSR>>3)
15335 # define S_IROTH (S_IRUSR>>6)
15336 # define S_IWOTH (S_IWUSR>>6)
15337 # define S_IXOTH (S_IXUSR>>6)
15340 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15341 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15342 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15345 : see whether semctl IPC_STAT can use union semun
15347 case "$d_semctl_semun" in
15350 #include <sys/types.h>
15351 #include <sys/ipc.h>
15352 #include <sys/sem.h>
15353 #include <sys/stat.h>
15360 #$d_union_semun HAS_UNION_SEMUN
15363 #ifndef HAS_UNION_SEMUN
15366 struct semid_ds *buf;
15367 unsigned short *array;
15373 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15374 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15376 struct semid_ds argbuf;
15379 st = semctl(sem, 0, IPC_STAT, arg);
15383 # endif /* IPC_STAT */
15384 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15386 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15387 # endif /* IPC_RMID */
15388 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15390 #endif /* IPC_PRIVATE && ... */
15391 printf("semget failed: errno = %d\n", errno);
15396 if eval $compile; then
15399 semun) val="$define" ;;
15407 case "$d_semctl_semun" in
15409 echo "You can use union semun for semctl IPC_STAT." >&4
15412 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15417 : see whether semctl IPC_STAT can use struct semid_ds pointer
15419 case "$d_semctl_semid_ds" in
15421 $cat > try.c <<'END'
15422 #include <sys/types.h>
15423 #include <sys/ipc.h>
15424 #include <sys/sem.h>
15425 #include <sys/stat.h>
15433 struct semid_ds arg;
15436 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15437 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15440 st = semctl(sem, 0, IPC_STAT, &arg);
15442 printf("semid_ds\n");
15444 # endif /* IPC_STAT */
15445 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15447 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15448 # endif /* IPC_RMID */
15449 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15451 #endif /* IPC_PRIVATE && ... */
15452 printf("semget failed: errno = %d\n", errno);
15458 if eval $compile; then
15461 semid_ds) val="$define" ;;
15467 set d_semctl_semid_ds
15469 case "$d_semctl_semid_ds" in
15471 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15473 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15480 # We do not have the full sem*(2) library, so assume we can not
15486 set d_semctl_semid_ds
15491 : see if sendmsg exists
15492 set sendmsg d_sendmsg
15495 : see if setegid exists
15496 set setegid d_setegid
15499 : see if seteuid exists
15500 set seteuid d_seteuid
15503 : see if setgrent exists
15504 set setgrent d_setgrent
15507 : see if setgrent_r exists
15508 set setgrent_r d_setgrent_r
15510 case "$d_setgrent_r" in
15512 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15513 case "$d_setgrent_r_proto:$usethreads" in
15514 ":define") d_setgrent_r_proto=define
15515 set d_setgrent_r_proto setgrent_r $hdrs
15519 case "$d_setgrent_r_proto" in
15521 case "$setgrent_r_proto" in
15522 ''|0) try='int setgrent_r(FILE**);'
15523 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15525 case "$setgrent_r_proto" in
15526 ''|0) try='void setgrent_r(FILE**);'
15527 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15529 case "$setgrent_r_proto" in
15530 ''|0) d_setgrent_r=undef
15532 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15533 * ) case "$setgrent_r_proto" in
15534 REENTRANT_PROTO*) ;;
15535 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15537 echo "Prototype: $try" ;;
15540 *) case "$usethreads" in
15541 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15548 *) setgrent_r_proto=0
15552 : see if sethostent exists
15553 set sethostent d_sethent
15556 : see if sethostent_r exists
15557 set sethostent_r d_sethostent_r
15559 case "$d_sethostent_r" in
15561 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15562 case "$d_sethostent_r_proto:$usethreads" in
15563 ":define") d_sethostent_r_proto=define
15564 set d_sethostent_r_proto sethostent_r $hdrs
15568 case "$d_sethostent_r_proto" in
15570 case "$sethostent_r_proto" in
15571 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15572 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15574 case "$sethostent_r_proto" in
15575 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15576 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15578 case "$sethostent_r_proto" in
15579 ''|0) d_sethostent_r=undef
15580 sethostent_r_proto=0
15581 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15582 * ) case "$sethostent_r_proto" in
15583 REENTRANT_PROTO*) ;;
15584 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
15586 echo "Prototype: $try" ;;
15589 *) case "$usethreads" in
15590 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
15592 d_sethostent_r=undef
15593 sethostent_r_proto=0
15597 *) sethostent_r_proto=0
15601 : see if setitimer exists
15602 set setitimer d_setitimer
15605 : see if setlinebuf exists
15606 set setlinebuf d_setlinebuf
15609 : see if setlocale exists
15610 set setlocale d_setlocale
15613 : see if locale.h is available
15614 set locale.h i_locale
15617 : see if setlocale_r exists
15618 set setlocale_r d_setlocale_r
15620 case "$d_setlocale_r" in
15622 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
15623 case "$d_setlocale_r_proto:$usethreads" in
15624 ":define") d_setlocale_r_proto=define
15625 set d_setlocale_r_proto setlocale_r $hdrs
15629 case "$d_setlocale_r_proto" in
15631 case "$setlocale_r_proto" in
15632 ''|0) try='int setlocale_r(int, const char*, char*, int);'
15633 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
15635 case "$setlocale_r_proto" in
15636 ''|0) d_setlocale_r=undef
15637 setlocale_r_proto=0
15638 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
15639 * ) case "$setlocale_r_proto" in
15640 REENTRANT_PROTO*) ;;
15641 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
15643 echo "Prototype: $try" ;;
15646 *) case "$usethreads" in
15647 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
15649 d_setlocale_r=undef
15650 setlocale_r_proto=0
15654 *) setlocale_r_proto=0
15658 : see if setnetent exists
15659 set setnetent d_setnent
15662 : see if setnetent_r exists
15663 set setnetent_r d_setnetent_r
15665 case "$d_setnetent_r" in
15667 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15668 case "$d_setnetent_r_proto:$usethreads" in
15669 ":define") d_setnetent_r_proto=define
15670 set d_setnetent_r_proto setnetent_r $hdrs
15674 case "$d_setnetent_r_proto" in
15676 case "$setnetent_r_proto" in
15677 ''|0) try='int setnetent_r(int, struct netent_data*);'
15678 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
15680 case "$setnetent_r_proto" in
15681 ''|0) try='void setnetent_r(int, struct netent_data*);'
15682 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
15684 case "$setnetent_r_proto" in
15685 ''|0) d_setnetent_r=undef
15686 setnetent_r_proto=0
15687 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
15688 * ) case "$setnetent_r_proto" in
15689 REENTRANT_PROTO*) ;;
15690 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
15692 echo "Prototype: $try" ;;
15695 *) case "$usethreads" in
15696 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
15698 d_setnetent_r=undef
15699 setnetent_r_proto=0
15703 *) setnetent_r_proto=0
15707 : see if setprotoent exists
15708 set setprotoent d_setpent
15711 : see if setpgid exists
15712 set setpgid d_setpgid
15715 : see if setpgrp2 exists
15716 set setpgrp2 d_setpgrp2
15719 : see if setpriority exists
15720 set setpriority d_setprior
15723 : see if setproctitle exists
15724 set setproctitle d_setproctitle
15727 : see if setprotoent_r exists
15728 set setprotoent_r d_setprotoent_r
15730 case "$d_setprotoent_r" in
15732 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15733 case "$d_setprotoent_r_proto:$usethreads" in
15734 ":define") d_setprotoent_r_proto=define
15735 set d_setprotoent_r_proto setprotoent_r $hdrs
15739 case "$d_setprotoent_r_proto" in
15741 case "$setprotoent_r_proto" in
15742 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
15743 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
15745 case "$setprotoent_r_proto" in
15746 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
15747 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
15749 case "$setprotoent_r_proto" in
15750 ''|0) d_setprotoent_r=undef
15751 setprotoent_r_proto=0
15752 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
15753 * ) case "$setprotoent_r_proto" in
15754 REENTRANT_PROTO*) ;;
15755 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
15757 echo "Prototype: $try" ;;
15760 *) case "$usethreads" in
15761 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
15763 d_setprotoent_r=undef
15764 setprotoent_r_proto=0
15768 *) setprotoent_r_proto=0
15772 : see if setpwent exists
15773 set setpwent d_setpwent
15776 : see if setpwent_r exists
15777 set setpwent_r d_setpwent_r
15779 case "$d_setpwent_r" in
15781 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15782 case "$d_setpwent_r_proto:$usethreads" in
15783 ":define") d_setpwent_r_proto=define
15784 set d_setpwent_r_proto setpwent_r $hdrs
15788 case "$d_setpwent_r_proto" in
15790 case "$setpwent_r_proto" in
15791 ''|0) try='int setpwent_r(FILE**);'
15792 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
15794 case "$setpwent_r_proto" in
15795 ''|0) try='void setpwent_r(FILE**);'
15796 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
15798 case "$setpwent_r_proto" in
15799 ''|0) d_setpwent_r=undef
15801 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
15802 * ) case "$setpwent_r_proto" in
15803 REENTRANT_PROTO*) ;;
15804 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
15806 echo "Prototype: $try" ;;
15809 *) case "$usethreads" in
15810 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
15817 *) setpwent_r_proto=0
15821 : see if setregid exists
15822 set setregid d_setregid
15824 set setresgid d_setresgid
15827 : see if setreuid exists
15828 set setreuid d_setreuid
15830 set setresuid d_setresuid
15833 : see if setrgid exists
15834 set setrgid d_setrgid
15837 : see if setruid exists
15838 set setruid d_setruid
15841 : see if setservent exists
15842 set setservent d_setsent
15845 : see if setservent_r exists
15846 set setservent_r d_setservent_r
15848 case "$d_setservent_r" in
15850 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15851 case "$d_setservent_r_proto:$usethreads" in
15852 ":define") d_setservent_r_proto=define
15853 set d_setservent_r_proto setservent_r $hdrs
15857 case "$d_setservent_r_proto" in
15859 case "$setservent_r_proto" in
15860 ''|0) try='int setservent_r(int, struct servent_data*);'
15861 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
15863 case "$setservent_r_proto" in
15864 ''|0) try='void setservent_r(int, struct servent_data*);'
15865 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
15867 case "$setservent_r_proto" in
15868 ''|0) d_setservent_r=undef
15869 setservent_r_proto=0
15870 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
15871 * ) case "$setservent_r_proto" in
15872 REENTRANT_PROTO*) ;;
15873 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
15875 echo "Prototype: $try" ;;
15878 *) case "$usethreads" in
15879 define) echo "setservent_r has no prototype, not using it." >&4 ;;
15881 d_setservent_r=undef
15882 setservent_r_proto=0
15886 *) setservent_r_proto=0
15890 : see if setsid exists
15891 set setsid d_setsid
15894 : see if setvbuf exists
15895 set setvbuf d_setvbuf
15898 : see if sfio.h is available
15903 : see if sfio library is available
15914 : Ok, but do we want to use it.
15918 true|$define|[yY]*) dflt='y';;
15921 echo "$package can use the sfio library, but it is experimental."
15922 case "$useperlio" in
15924 echo "For sfio also the PerlIO abstraction layer is needed."
15925 echo "Earlier you said you wouldn't want that."
15928 rp="You seem to have sfio available, do you want to try using it?"
15931 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
15932 useperlio="$define"
15935 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
15940 *) case "$usesfio" in
15941 true|$define|[yY]*)
15942 echo "Sorry, cannot find sfio on this machine." >&4
15943 echo "Ignoring your setting of usesfio=$usesfio." >&4
15952 $define) usesfio='true';;
15953 *) usesfio='false';;
15957 *) : Remove sfio from list of libraries to use
15960 echo "Removing unneeded -lsfio from library list" >&4
15961 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
15964 echo "libs = $libs" >&4
15971 : see if shmctl exists
15972 set shmctl d_shmctl
15975 : see if shmget exists
15976 set shmget d_shmget
15979 : see if shmat exists
15982 : see what shmat returns
15985 $cat >shmat.c <<'END'
15986 #include <sys/shm.h>
15989 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
15994 echo "and it returns ($shmattype)." >&4
15995 : see if a prototype for shmat is available
15996 xxx=`./findhdr sys/shm.h`
15997 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
15998 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
16009 set d_shmatprototype
16012 : see if shmdt exists
16016 : see how much of the 'shm*(2)' library is present.
16019 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16020 *"$undef"*) h_shm=false;;
16024 case "`ipcs 2>&1`" in
16025 "SVID shared memory"*"not configured"*)
16026 echo "Your $osname does not have the shm*(2) configured." >&4
16029 set shmctl d_shmctl
16031 set shmget d_shmget
16041 : we could also check for sys/ipc.h ...
16042 if $h_shm && $test `./findhdr sys/shm.h`; then
16043 echo "You have the full shm*(2) library." >&4
16046 echo "You don't have the full shm*(2) library." >&4
16053 : see if we have sigaction
16054 if set sigaction val -f d_sigaction; eval $csym; $val; then
16055 echo 'sigaction() found.' >&4
16058 #include <sys/types.h>
16059 #include <signal.h>
16060 #$i_stdlib I_STDLIB
16062 #include <stdlib.h>
16066 struct sigaction act, oact;
16068 oact.sa_handler = 0;
16069 /* so that act and oact are used */
16070 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16074 if eval $compile_ok; then
16077 echo "But you don't seem to have a useable struct sigaction." >&4
16081 echo 'sigaction NOT found.' >&4
16084 set d_sigaction; eval $setvar
16085 $rm -f try try$_o try.c
16087 : see if sigprocmask exists
16088 set sigprocmask d_sigprocmask
16091 : see if sigsetjmp exists
16093 case "$d_sigsetjmp" in
16096 #include <setjmp.h>
16097 #$i_stdlib I_STDLIB
16099 #include <stdlib.h>
16105 if (sigsetjmp(env,1))
16108 siglongjmp(env, 1);
16113 if eval $compile; then
16114 if $run ./try >/dev/null 2>&1; then
16115 echo "POSIX sigsetjmp found." >&4
16119 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16125 echo "sigsetjmp not found." >&4
16129 *) val="$d_sigsetjmp"
16130 case "$d_sigsetjmp" in
16131 $define) echo "POSIX sigsetjmp found." >&4;;
16132 $undef) echo "sigsetjmp not found." >&4;;
16141 d_sitecustomize="$undef"
16142 case "$usesitecustomize" in
16143 $define|true|[Yy]*)
16144 usesitecustomize="$define"
16145 d_sitecustomize="$define"
16148 usesitecustomize="$undef"
16151 : see if sockatmark exists
16152 set sockatmark d_sockatmark
16155 : see if prototype for sockatmark is available
16157 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16160 : see if socks5_init exists
16161 set socks5_init d_socks5_init
16164 : see if srand48_r exists
16165 set srand48_r d_srand48_r
16167 case "$d_srand48_r" in
16169 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16170 case "$d_srand48_r_proto:$usethreads" in
16171 ":define") d_srand48_r_proto=define
16172 set d_srand48_r_proto srand48_r $hdrs
16176 case "$d_srand48_r_proto" in
16178 case "$srand48_r_proto" in
16179 ''|0) try='int srand48_r(long, struct drand48_data*);'
16180 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16182 case "$srand48_r_proto" in
16183 ''|0) d_srand48_r=undef
16185 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16186 * ) case "$srand48_r_proto" in
16187 REENTRANT_PROTO*) ;;
16188 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16190 echo "Prototype: $try" ;;
16193 *) case "$usethreads" in
16194 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16201 *) srand48_r_proto=0
16205 : see if srandom_r exists
16206 set srandom_r d_srandom_r
16208 case "$d_srandom_r" in
16210 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16211 case "$d_srandom_r_proto:$usethreads" in
16212 ":define") d_srandom_r_proto=define
16213 set d_srandom_r_proto srandom_r $hdrs
16217 case "$d_srandom_r_proto" in
16219 case "$srandom_r_proto" in
16220 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16221 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16223 case "$srandom_r_proto" in
16224 ''|0) d_srandom_r=undef
16226 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16227 * ) case "$srandom_r_proto" in
16228 REENTRANT_PROTO*) ;;
16229 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16231 echo "Prototype: $try" ;;
16234 *) case "$usethreads" in
16235 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16242 *) srandom_r_proto=0
16246 : see if prototype for setresgid is available
16248 set d_sresgproto setresgid $i_unistd unistd.h
16251 : see if prototype for setresuid is available
16253 set d_sresuproto setresuid $i_unistd unistd.h
16256 : see if sys/stat.h is available
16257 set sys/stat.h i_sysstat
16261 : see if stat knows about block sizes
16263 echo "Checking to see if your struct stat has st_blocks field..." >&4
16264 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16268 : see if this is a sys/vfs.h system
16269 set sys/vfs.h i_sysvfs
16273 : see if this is a sys/statfs.h system
16274 set sys/statfs.h i_sysstatfs
16279 echo "Checking to see if your system supports struct statfs..." >&4
16280 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
16282 case "$d_statfs_s" in
16283 "$define") echo "Yes, it does." ;;
16284 *) echo "No, it doesn't." ;;
16289 : see if struct statfs knows about f_flags
16290 case "$d_statfs_s" in
16293 echo "Checking to see if your struct statfs has f_flags field..." >&4
16294 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
16298 set d_statfs_f_flags
16302 case "$d_statfs_f_flags" in
16303 "$define") echo "Yes, it does." ;;
16304 *) echo "No, it doesn't." ;;
16308 Checking how to access stdio streams by file descriptor number...
16310 case "$stdio_stream_array" in
16311 '') $cat >try.c <<EOCP
16314 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16318 for s in _iob __iob __sF
16320 set try -DSTDIO_STREAM_ARRAY=$s
16321 if eval $compile; then
16322 case "`$run ./try`" in
16323 yes) stdio_stream_array=$s; break ;;
16327 $rm -f try.* try$exe_ext
16329 case "$stdio_stream_array" in
16331 I can't figure out how to access stdio streams by file descriptor number.
16333 d_stdio_stream_array="$undef"
16336 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16338 d_stdio_stream_array="$define"
16342 : see if strcoll exists
16343 set strcoll d_strcoll
16346 : check for structure copying
16348 echo "Checking to see if your C compiler can copy structs..." >&4
16349 $cat >try.c <<'EOCP'
16359 if $cc -c try.c >/dev/null 2>&1 ; then
16361 echo "Yup, it can."
16364 echo "Nope, it can't."
16370 : see if strerror and/or sys_errlist[] exist
16372 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16373 if set strerror val -f d_strerror; eval $csym; $val; then
16374 echo 'strerror() found.' >&4
16375 d_strerror="$define"
16376 d_strerrm='strerror(e)'
16377 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16378 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16379 d_syserrlst="$define"
16381 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16382 d_syserrlst="$undef"
16384 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16385 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16386 echo 'strerror() found in string header.' >&4
16387 d_strerror="$define"
16388 d_strerrm='strerror(e)'
16389 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16390 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16391 d_syserrlst="$define"
16393 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16394 d_syserrlst="$undef"
16396 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16397 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16398 d_strerror="$undef"
16399 d_syserrlst="$define"
16400 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16402 echo 'strerror() and sys_errlist[] NOT found.' >&4
16403 d_strerror="$undef"
16404 d_syserrlst="$undef"
16405 d_strerrm='"unknown"'
16409 : see if strerror_r exists
16410 set strerror_r d_strerror_r
16412 case "$d_strerror_r" in
16414 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16415 case "$d_strerror_r_proto:$usethreads" in
16416 ":define") d_strerror_r_proto=define
16417 set d_strerror_r_proto strerror_r $hdrs
16421 case "$d_strerror_r_proto" in
16423 case "$strerror_r_proto" in
16424 ''|0) try='int strerror_r(int, char*, size_t);'
16425 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16427 case "$strerror_r_proto" in
16428 ''|0) try='int strerror_r(int, char*, int);'
16429 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16431 case "$strerror_r_proto" in
16432 ''|0) try='char* strerror_r(int, char*, size_t);'
16433 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16435 case "$strerror_r_proto" in
16436 ''|0) d_strerror_r=undef
16438 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16439 * ) case "$strerror_r_proto" in
16440 REENTRANT_PROTO*) ;;
16441 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16443 echo "Prototype: $try" ;;
16446 *) case "$usethreads" in
16447 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16454 *) strerror_r_proto=0
16458 : see if strftime exists
16459 set strftime d_strftime
16462 : see if strlcat exists
16463 set strlcat d_strlcat
16466 : see if strlcpy exists
16467 set strlcpy d_strlcpy
16470 : see if strtod exists
16471 set strtod d_strtod
16474 : see if strtol exists
16475 set strtol d_strtol
16478 : see if strtold exists
16479 set strtold d_strtold
16482 : see if strtoll exists
16483 set strtoll d_strtoll
16486 case "$d_longlong-$d_strtoll" in
16489 Checking whether your strtoll() works okay...
16491 $cat >try.c <<'EOCP'
16494 #define strtoll __strtoll
16497 #define strtoll _strtoll
16500 extern long long int strtoll(char *s, char **, int);
16501 static int bad = 0;
16502 int check(char *s, long long ell, int een) {
16505 gll = strtoll(s, 0, 10);
16506 if (!((gll == ell) && (errno == een)))
16510 check(" 1", 1LL, 0);
16511 check(" 0", 0LL, 0);
16512 check("-1", -1LL, 0);
16513 check("-9223372036854775808", -9223372036854775808LL, 0);
16514 check("-9223372036854775808", -9223372036854775808LL, 0);
16515 check(" 9223372036854775807", 9223372036854775807LL, 0);
16516 check("-9223372036854775808", -9223372036854775808LL, 0);
16517 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
16518 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
16524 if eval $compile; then
16527 ok) echo "Your strtoll() seems to be working okay." ;;
16529 Your strtoll() doesn't seem to be working okay.
16535 echo "(I can't seem to compile the test program--assuming it doesn't)"
16541 : see if strtoq exists
16542 set strtoq d_strtoq
16545 : see if strtoul exists
16546 set strtoul d_strtoul
16549 case "$d_strtoul" in
16552 Checking whether your strtoul() works okay...
16554 $cat >try.c <<'EOCP'
16557 extern unsigned long int strtoul(char *s, char **, int);
16558 static int bad = 0;
16559 void check(char *s, unsigned long eul, int een) {
16562 gul = strtoul(s, 0, 10);
16563 if (!((gul == eul) && (errno == een)))
16567 check(" 1", 1L, 0);
16568 check(" 0", 0L, 0);
16570 case "$longsize" in
16572 $cat >>try.c <<'EOCP'
16573 check("18446744073709551615", 18446744073709551615UL, 0);
16574 check("18446744073709551616", 18446744073709551615UL, ERANGE);
16575 #if 0 /* strtoul() for /^-/ strings is undefined. */
16576 check("-1", 18446744073709551615UL, 0);
16577 check("-18446744073709551614", 2, 0);
16578 check("-18446744073709551615", 1, 0);
16579 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
16580 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
16585 $cat >>try.c <<'EOCP'
16586 check("4294967295", 4294967295UL, 0);
16587 check("4294967296", 4294967295UL, ERANGE);
16588 #if 0 /* strtoul() for /^-/ strings is undefined. */
16589 check("-1", 4294967295UL, 0);
16590 check("-4294967294", 2, 0);
16591 check("-4294967295", 1, 0);
16592 check("-4294967296", 4294967295UL, ERANGE);
16593 check("-4294967297", 4294967295UL, ERANGE);
16598 : Should we write these tests to be more portable by sprintf-ing
16599 : ~0 and then manipulating that char string as input for strtol?
16602 $cat >>try.c <<'EOCP'
16609 if eval $compile; then
16610 case "`$run ./try`" in
16611 ok) echo "Your strtoul() seems to be working okay." ;;
16613 Your strtoul() doesn't seem to be working okay.
16622 : see if strtoull exists
16623 set strtoull d_strtoull
16626 case "$d_longlong-$d_strtoull" in
16629 Checking whether your strtoull() works okay...
16631 $cat >try.c <<'EOCP'
16634 #define strtoull __strtoull
16637 extern unsigned long long int strtoull(char *s, char **, int);
16638 static int bad = 0;
16639 int check(char *s, long long eull, int een) {
16642 gull = strtoull(s, 0, 10);
16643 if (!((gull == eull) && (errno == een)))
16647 check(" 1", 1LL, 0);
16648 check(" 0", 0LL, 0);
16649 check("18446744073709551615", 18446744073709551615ULL, 0);
16650 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16651 #if 0 /* strtoull() for /^-/ strings is undefined. */
16652 check("-1", 18446744073709551615ULL, 0);
16653 check("-18446744073709551614", 2LL, 0);
16654 check("-18446744073709551615", 1LL, 0);
16655 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16656 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16663 if eval $compile; then
16664 case "`$run ./try`" in
16665 ok) echo "Your strtoull() seems to be working okay." ;;
16667 Your strtoull() doesn't seem to be working okay.
16669 d_strtoull="$undef"
16676 : see if strtouq exists
16677 set strtouq d_strtouq
16680 case "$d_strtouq" in
16683 Checking whether your strtouq() works okay...
16685 $cat >try.c <<'EOCP'
16688 extern unsigned long long int strtouq(char *s, char **, int);
16689 static int bad = 0;
16690 void check(char *s, unsigned long long eull, int een) {
16691 unsigned long long gull;
16693 gull = strtouq(s, 0, 10);
16694 if (!((gull == eull) && (errno == een)))
16698 check(" 1", 1LL, 0);
16699 check(" 0", 0LL, 0);
16700 check("18446744073709551615", 18446744073709551615ULL, 0);
16701 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16702 #if 0 /* strtouq() for /^-/ strings is undefined. */
16703 check("-1", 18446744073709551615ULL, 0);
16704 check("-18446744073709551614", 2LL, 0);
16705 check("-18446744073709551615", 1LL, 0);
16706 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16707 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16715 if eval $compile; then
16716 case "`$run ./try`" in
16717 ok) echo "Your strtouq() seems to be working okay." ;;
16719 Your strtouq() doesn't seem to be working okay.
16728 : see if strxfrm exists
16729 set strxfrm d_strxfrm
16732 : see if symlink exists
16733 set symlink d_symlink
16736 : see if syscall exists
16737 set syscall d_syscall
16740 : see if prototype for syscall is available
16742 set d_syscallproto syscall $i_unistd unistd.h
16745 : see if sysconf exists
16746 set sysconf d_sysconf
16749 : see if system exists
16750 set system d_system
16753 : see if tcgetpgrp exists
16754 set tcgetpgrp d_tcgetpgrp
16757 : see if tcsetpgrp exists
16758 set tcsetpgrp d_tcsetpgrp
16761 : see if prototype for telldir is available
16763 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
16766 : see if time exists
16768 if test "X$d_time" = X -o X"$timetype" = X; then
16769 if set time val -f d_time; eval $csym; $val; then
16770 echo 'time() found.' >&4
16772 rp="What is the type returned by time() on this system?"
16773 set time_t timetype long stdio.h sys/types.h
16776 echo 'time() not found, hope that will do.' >&4
16784 : see if this is a sys/times.h system
16785 set sys/times.h i_systimes
16788 : see if times exists
16790 if set times val -f d_times; eval $csym; $val; then
16791 echo 'times() found.' >&4
16794 case "$i_systimes" in
16795 "$define") inc='sys/times.h';;
16797 rp="What is the type returned by times() on this system?"
16798 set clock_t clocktype long stdio.h sys/types.h $inc
16801 echo 'times() NOT found, hope that will do.' >&4
16806 : see if tmpnam_r exists
16807 set tmpnam_r d_tmpnam_r
16809 case "$d_tmpnam_r" in
16811 hdrs="$i_systypes sys/types.h define stdio.h "
16812 case "$d_tmpnam_r_proto:$usethreads" in
16813 ":define") d_tmpnam_r_proto=define
16814 set d_tmpnam_r_proto tmpnam_r $hdrs
16818 case "$d_tmpnam_r_proto" in
16820 case "$tmpnam_r_proto" in
16821 ''|0) try='char* tmpnam_r(char*);'
16822 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
16824 case "$tmpnam_r_proto" in
16825 ''|0) d_tmpnam_r=undef
16827 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
16828 * ) case "$tmpnam_r_proto" in
16829 REENTRANT_PROTO*) ;;
16830 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
16832 echo "Prototype: $try" ;;
16835 *) case "$usethreads" in
16836 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
16843 *) tmpnam_r_proto=0
16847 : see if truncate exists
16848 set truncate d_truncate
16851 : see if ttyname_r exists
16852 set ttyname_r d_ttyname_r
16854 case "$d_ttyname_r" in
16856 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
16857 case "$d_ttyname_r_proto:$usethreads" in
16858 ":define") d_ttyname_r_proto=define
16859 set d_ttyname_r_proto ttyname_r $hdrs
16863 case "$d_ttyname_r_proto" in
16865 case "$ttyname_r_proto" in
16866 ''|0) try='int ttyname_r(int, char*, size_t);'
16867 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
16869 case "$ttyname_r_proto" in
16870 ''|0) try='int ttyname_r(int, char*, int);'
16871 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
16873 case "$ttyname_r_proto" in
16874 ''|0) try='char* ttyname_r(int, char*, int);'
16875 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
16877 case "$ttyname_r_proto" in
16878 ''|0) d_ttyname_r=undef
16880 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
16881 * ) case "$ttyname_r_proto" in
16882 REENTRANT_PROTO*) ;;
16883 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
16885 echo "Prototype: $try" ;;
16888 *) case "$usethreads" in
16889 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
16896 *) ttyname_r_proto=0
16900 : see if tzname[] exists
16902 if set tzname val -a d_tzname; eval $csym; $val; then
16904 echo 'tzname[] found.' >&4
16907 echo 'tzname[] NOT found.' >&4
16913 next|rhapsody|darwin) multiarch="$define" ;;
16915 case "$multiarch" in
16916 ''|[nN]*) multiarch="$undef" ;;
16919 : check for ordering of bytes in a UV
16921 case "$usecrosscompile$multiarch" in
16924 You seem to be either cross-compiling or doing a multiarchitecture build,
16925 skipping the byteorder check.
16931 case "$byteorder" in
16934 In the following, larger digits indicate more significance. A big-endian
16935 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
16936 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
16937 machines may have weird orders like 3412. A Cray will report 87654321,
16938 an Alpha will report 12345678. If the test program works the default is
16940 I'm now running the test program...
16944 #$i_stdlib I_STDLIB
16946 #include <stdlib.h>
16948 #include <sys/types.h>
16949 typedef $uvtype UV;
16959 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
16961 u.l = (UV)0x04030201;
16962 for (i = 0; i < $uvsize; i++)
16963 printf("%c", u.c[i]+'0');
16970 if eval $compile && ./try > /dev/null; then
16973 [1-4][1-4][1-4][1-4]|12345678|87654321)
16974 echo "(The test program ran ok.)"
16975 echo "byteorder=$dflt"
16978 ????|????????) echo "(The test program ran ok.)" ;;
16979 *) echo "(The test program didn't run right for some reason.)" ;;
16984 (I can't seem to compile the test program. Guessing big-endian...)
16987 case "$xxx_prompt" in
16989 rp="What is the order of bytes in $uvtype?"
17005 Checking to see whether you can access character data unalignedly...
17007 case "$d_u32align" in
17008 '') $cat >try.c <<EOCP
17010 #$i_stdlib I_STDLIB
17012 #include <stdlib.h>
17014 #define U32 $u32type
17015 #define BYTEORDER 0x$byteorder
17017 #include <signal.h>
17019 $signal_t bletch(s) int s; { exit(4); }
17022 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
17027 if (sizeof(U32) != 4) {
17028 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17035 signal(SIGBUS, bletch);
17047 for (i = 0; i < 4; i++) {
17048 up = (U32*)(buf + i);
17049 if (! ((*up == 1 << (8*i)) || /* big-endian */
17050 (*up == 1 << (8*(3-i))) /* little-endian */
17054 printf("read failed (%x)\n", *up);
17060 for (i = 0; i < 4; i++) {
17061 up = (U32*)(buf + i);
17063 if (*up != 0xBeef) {
17064 printf("write failed (%x)\n", *up);
17078 if eval $compile_ok; then
17079 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17080 $run ./try 2>&1 >/dev/null
17083 You can access character data pretty unalignedly.
17085 d_u32align="$undef"
17088 It seems that you must access character data in an aligned manner.
17090 d_u32align="$define"
17094 rp='Can you access character data at unaligned addresses?'
17098 [yY]*) d_u32align="$undef" ;;
17099 *) d_u32align="$define" ;;
17102 $rm -f core core.try.* try.core
17106 : see if ualarm exists
17107 set ualarm d_ualarm
17110 : see if umask exists
17114 : see if unordered exists
17115 set unordered d_unordered
17118 : see if usleep exists
17119 set usleep d_usleep
17122 : see if prototype for usleep is available
17124 set d_usleepproto usleep $i_unistd unistd.h
17127 : see if ustat exists
17131 : backward compatibility for d_hvfork
17132 if test X$d_hvfork != X; then
17133 d_vfork="$d_hvfork"
17136 : see if there is a vfork
17141 : Ok, but do we want to use it. vfork is reportedly unreliable in
17142 : perl on Solaris 2.x, and probably elsewhere.
17146 case "$usevfork" in
17152 Perl can only use a vfork() that doesn't suffer from strict
17153 restrictions on calling functions or modifying global data in
17154 the child. For example, glibc-2.1 contains such a vfork()
17155 that is unsuitable. If your system provides a proper fork()
17156 call, chances are that you do NOT want perl to use vfork().
17159 rp="Do you still want to use vfork()?"
17164 echo "Ok, we won't use vfork()."
17173 $define) usevfork='true';;
17174 *) usevfork='false';;
17177 : see if closedir exists
17178 set closedir d_closedir
17181 case "$d_closedir" in
17184 echo "Checking whether closedir() returns a status..." >&4
17186 #$i_dirent I_DIRENT /**/
17187 #$i_sysdir I_SYS_DIR /**/
17188 #$i_sysndir I_SYS_NDIR /**/
17189 #$i_systypes I_SYS_TYPES /**/
17191 #if defined(I_SYS_TYPES)
17192 #include <sys/types.h>
17194 #if defined(I_DIRENT)
17195 #include <dirent.h>
17196 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17197 #include <sys/dir.h>
17201 #include <sys/ndir.h>
17205 #include <ndir.h> /* may be wrong in the future */
17207 #include <sys/dir.h>
17212 int main() { return closedir(opendir(".")); }
17215 if eval $compile_ok; then
17216 if $run ./try > /dev/null 2>&1 ; then
17217 echo "Yes, it does."
17220 echo "No, it doesn't."
17224 echo "(I can't seem to compile the test program--assuming it doesn't)"
17232 set d_void_closedir
17235 : see if there is a wait4
17239 : see if waitpid exists
17240 set waitpid d_waitpid
17243 : see if wcstombs exists
17244 set wcstombs d_wcstombs
17247 : see if wctomb exists
17248 set wctomb d_wctomb
17251 : see if writev exists
17252 set writev d_writev
17255 : preserve RCS keywords in files with variable substitution, grrr
17260 Revision='$Revision'
17262 : check for alignment requirements
17264 case "$usecrosscompile$multiarch" in
17267 You seem to be either cross-compiling or doing a multiarchitecture build,
17268 skipping the memory alignment check.
17271 case "$alignbytes" in
17272 '') alignbytes=8 ;;
17276 case "$alignbytes" in
17277 '') echo "Checking alignment constraints..." >&4
17278 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17279 $cat >try.c <<'EOCP'
17280 typedef long double NV;
17283 $cat >try.c <<'EOCP'
17287 $cat >>try.c <<'EOCP'
17295 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17300 if eval $compile_ok; then
17304 echo "(I can't seem to compile the test program...)"
17307 *) dflt="$alignbytes"
17310 rp="Doubles must be aligned on a how-many-byte boundary?"
17318 : set the base revision
17321 : how do we concatenate cpp tokens here?
17323 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17324 $cat >cpp_stuff.c <<'EOCP'
17325 #define RCAT(a,b)a/**/b
17326 #define ACAT(a,b)a ## b
17330 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17331 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17332 echo "Oh! Smells like ANSI's been here." >&4
17333 echo "We can catify or stringify, separately or together!"
17335 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17336 echo "Ah, yes! The good old days!" >&4
17337 echo "However, in the good old days we don't know how to stringify and"
17338 echo "catify at the same time."
17342 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17343 You're going to have to edit the values of CAT[2-5] in config.h...
17345 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17349 : see if this is a db.h system
17355 : Check db version.
17357 echo "Checking Berkeley DB version ..." >&4
17363 #include <sys/types.h>
17365 #$i_stdlib I_STDLIB
17367 #include <stdlib.h>
17370 int main(int argc, char *argv[])
17372 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17373 int Major, Minor, Patch ;
17374 unsigned long Version ;
17375 (void)db_version(&Major, &Minor, &Patch) ;
17377 printf("%d %d %d %d %d %d\n",
17378 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17379 Major, Minor, Patch);
17382 printf("You have Berkeley DB Version 2 or greater.\n");
17384 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17385 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17386 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17387 Major, Minor, Patch) ;
17389 /* check that db.h & libdb are compatible */
17390 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17391 printf("db.h and libdb are incompatible.\n") ;
17395 printf("db.h and libdb are compatible.\n") ;
17397 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17398 + DB_VERSION_PATCH ;
17400 /* needs to be >= 2.3.4 */
17401 if (Version < 2003004) {
17402 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17403 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17409 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17414 printf("You have Berkeley DB Version 1.\n");
17415 exit(0); /* DB version < 2: the coast is clear. */
17417 exit(1); /* <db.h> not Berkeley DB? */
17423 if eval $compile_ok && $run ./try; then
17424 echo 'Looks OK.' >&4
17426 db_version_major=$1
17427 db_version_minor=$2
17428 db_version_patch=$3
17430 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17434 : Remove db from list of libraries to use
17435 echo "Removing unusable -ldb from library list" >&4
17436 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17439 echo "libs = $libs" >&4
17449 : Check the return type needed for hash
17451 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17457 #include <sys/types.h>
17460 #ifndef DB_VERSION_MAJOR
17461 u_int32_t hash_cb (ptr, size)
17469 info.hash = hash_cb;
17473 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17474 if $contains warning try.out >>/dev/null 2>&1 ; then
17477 db_hashtype='u_int32_t'
17480 : XXX Maybe we should just give up here.
17481 db_hashtype=u_int32_t
17483 echo "Help: I can't seem to compile the db test program." >&4
17484 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
17487 echo "Your version of Berkeley DB uses $db_hashtype for hash."
17489 *) db_hashtype=u_int32_t
17494 : Check the return type needed for prefix
17496 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
17502 #include <sys/types.h>
17505 #ifndef DB_VERSION_MAJOR
17506 size_t prefix_cb (key1, key2)
17514 info.prefix = prefix_cb;
17518 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17519 if $contains warning try.out >>/dev/null 2>&1 ; then
17520 db_prefixtype='int'
17522 db_prefixtype='size_t'
17525 db_prefixtype='size_t'
17526 : XXX Maybe we should just give up here.
17528 echo "Help: I can't seem to compile the db test program." >&4
17529 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
17532 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
17534 *) db_prefixtype='size_t'
17539 : How can we generate normalized random numbers ?
17541 echo "Looking for a random number function..." >&4
17542 case "$randfunc" in
17544 if set drand48 val -f; eval $csym; $val; then
17546 echo "Good, found drand48()." >&4
17547 elif set random val -f; eval $csym; $val; then
17549 echo "OK, found random()." >&4
17552 echo "Yick, looks like I have to use rand()." >&4
17563 *-Dmy_rand=*|*-Dmy_srand=*)
17564 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
17565 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
17566 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
17567 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
17571 while $test "$cont"; do
17572 rp="Use which function to generate random numbers?"
17574 if $test "$ans" = "$dflt"; then
17580 if set $ans val -f; eval $csym; $val; then
17584 rp="I cannot find function $ans. Use that name anyway?"
17593 case "$randfunc" in
17595 drand01="drand48()"
17601 case "$randbits" in
17603 echo "Checking to see how many bits your $randfunc() function produces..." >&4
17605 #$i_unistd I_UNISTD
17606 #$i_stdlib I_STDLIB
17609 # include <unistd.h>
17612 # include <stdlib.h>
17617 register unsigned long tmp;
17618 register unsigned long max = 0L;
17620 for (i = 1000; i; i--) {
17621 tmp = (unsigned long) $randfunc();
17622 if (tmp > max) max = tmp;
17624 for (i = 0; max; i++)
17630 if eval $compile_ok; then
17634 echo "(I can't seem to compile the test program...)"
17641 rp="How many bits does your $randfunc() function produce?"
17645 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17646 seedfunc="s$randfunc"
17647 randseedtype=unsigned
17651 rp="How many bits does your $randfunc() function produce?"
17654 seedfunc="s$randfunc"
17655 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17656 if set $seedfunc val -f; eval $csym; $val; then
17657 echo "(Using $seedfunc() to seed random generator)"
17659 echo "(Warning: no $seedfunc() to seed random generator)"
17662 randseedtype=unsigned
17670 echo "Determining whether or not we are on an EBCDIC system..." >&4
17671 $cat >try.c <<'EOM'
17674 if ('M'==0xd4) return 0;
17681 if eval $compile_ok; then
17682 if $run ./try; then
17683 echo "You seem to speak EBCDIC." >&4
17686 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
17689 echo "I'm unable to compile the test program." >&4
17690 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
17698 Checking how to flush all pending stdio output...
17700 # I only know how to find the first 32 possibly open files on SunOS.
17701 # See also hints/sunos_4_1.sh and util.c --AD
17703 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
17705 $cat >>try.c <<EOCP
17707 #$i_stdlib I_STDLIB
17709 #include <stdlib.h>
17711 #$i_unistd I_UNISTD
17713 # include <unistd.h>
17715 #$d_sysconf HAS_SYSCONF
17716 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
17717 #ifdef HAS_STDIO_STREAM_ARRAY
17718 # define STDIO_STREAM_ARRAY $stdio_stream_array
17723 p = fopen("try.out", "w");
17727 # ifdef TRY_FPRINTF
17731 #ifdef TRY_FFLUSH_NULL
17734 #ifdef TRY_FFLUSH_ALL
17736 long open_max = -1;
17737 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
17738 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
17740 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
17741 open_max = sysconf(_SC_OPEN_MAX);
17744 open_max = FOPEN_MAX;
17747 open_max = OPEN_MAX;
17756 # ifdef HAS_STDIO_STREAM_ARRAY
17757 if (open_max > 0) {
17759 for (i = 0; i < open_max; i++)
17760 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
17761 STDIO_STREAM_ARRAY[i]._file < open_max &&
17762 STDIO_STREAM_ARRAY[i]._flag)
17763 fflush(&STDIO_STREAM_ARRAY[i]);
17771 : first we have to find out how _not_ to flush
17773 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
17775 set try -DTRY_FPUTC
17776 if eval $compile; then
17777 $run ./try 2>/dev/null
17780 if $test ! -s try.out -a "X$code" = X42; then
17786 set try -DTRY_FPRINTF
17787 if eval $compile; then
17788 $run ./try 2>/dev/null
17791 if $test ! -s try.out -a "X$code" = X42; then
17792 output=-DTRY_FPRINTF
17798 : check for fflush NULL behaviour
17799 case "$fflushNULL" in
17800 '') set try -DTRY_FFLUSH_NULL $output
17801 if eval $compile; then
17802 $run ./try 2>/dev/null
17805 if $test -s try.out -a "X$code" = X42; then
17806 fflushNULL="`$cat try.out`"
17808 if $test "X$code" != X42; then
17810 (If this test failed, don't worry, we'll try another method shortly.)
17815 $rm -f core try.core core.try.*
17816 case "$fflushNULL" in
17818 Your fflush(NULL) works okay for output streams.
17819 Let's see if it clobbers input pipes...
17821 # As of mid-March 2000 all versions of Solaris appear to have a stdio
17822 # bug that improperly flushes the input end of pipes. So we avoid the
17823 # autoflush on fork/system/exec support for now. :-(
17824 $cat >tryp.c <<EOCP
17827 main(int argc, char **argv)
17833 while ((i = getc(stdin)) != -1
17834 && (*bp++ = i) != '\n'
17835 && bp < &buf[1024])
17838 fprintf(stdout, "%s", buf);
17846 fflushNULL="$define"
17848 if eval $compile; then
17850 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17851 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17853 fflush(NULL) seems to behave okay with input streams.
17855 fflushNULL="$define"
17858 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
17860 fflushNULL="$undef"
17863 $rm -f core tryp.c tryp.core core.tryp.*
17866 Your fflush(NULL) isn't working (contrary to ANSI C).
17868 fflushNULL="$undef"
17871 Cannot figure out whether your fflush(NULL) works or not.
17872 I'm assuming it doesn't (contrary to ANSI C).
17874 fflushNULL="$undef"
17878 $define|true|[yY]*)
17879 fflushNULL="$define"
17882 fflushNULL="$undef"
17885 : check explicit looping only if NULL did not work, and if the pipe
17886 : bug does not show up on an explicit flush too
17887 case "$fflushNULL" in
17889 $cat >tryp.c <<EOCP
17892 main(int argc, char **argv)
17898 while ((i = getc(stdin)) != -1
17899 && (*bp++ = i) != '\n'
17900 && bp < &buf[1024])
17903 fprintf(stdout, "%s", buf);
17912 if eval $compile; then
17914 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17915 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17917 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
17919 : now check for fflushall behaviour
17920 case "$fflushall" in
17921 '') set try -DTRY_FFLUSH_ALL $output
17922 if eval $compile; then
17924 (Now testing the other method--but note that this also may fail.)
17926 $run ./try 2>/dev/null
17929 if $test -s try.out -a "X$code" = X42; then
17930 fflushall="`$cat try.out`"
17933 $rm -f core try.core core.try.*
17934 case "$fflushall" in
17936 Whew. Flushing explicitly all the stdio streams works.
17938 fflushall="$define"
17941 Sigh. Flushing explicitly all the stdio streams doesn't work.
17946 Cannot figure out whether flushing stdio streams explicitly works or not.
17947 I'm assuming it doesn't.
17953 "$define"|true|[yY]*)
17954 fflushall="$define"
17962 All is futile. Even fflush(stdin) clobbers input pipes!
17969 $rm -f core tryp.c tryp.core core.tryp.*
17971 *) fflushall="$undef"
17975 case "$fflushNULL$fflushall" in
17978 OK, I give up. I cannot figure out how to flush pending stdio output.
17979 We won't be flushing handles at all before fork/exec/popen.
17983 $rm -f try.* try$exe_ext
17985 : Store the full pathname to the ar program for use in the C program
17986 : Respect a hint or command line value for full_ar.
17991 : Store the full pathname to the sed program for use in the C program
17994 : see what type gids are declared as in the kernel
17996 echo "Looking for the type for group ids returned by getgid()."
17997 set gid_t gidtype xxx stdio.h sys/types.h
18001 xxx=`./findhdr sys/user.h`
18002 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
18004 unsigned) dflt="$1 $2" ;;
18008 *) dflt="$gidtype";;
18011 gid_t) echo "gid_t found." ;;
18012 *) rp="What is the type for group ids returned by getgid()?"
18020 *_t) zzz="$gidtype" ;;
18023 echo "Checking the size of $zzz..." >&4
18025 #include <sys/types.h>
18027 #$i_stdlib I_STDLIB
18029 #include <stdlib.h>
18032 printf("%d\n", (int)sizeof($gidtype));
18037 if eval $compile_ok; then
18041 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18044 echo "Your $zzz is $gidsize bytes long."
18049 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18055 *_t) zzz="$gidtype" ;;
18058 echo "Checking the sign of $zzz..." >&4
18060 #include <sys/types.h>
18071 if eval $compile; then
18075 echo "(I can't execute the test program--guessing unsigned.)" >&4
18079 1) echo "Your $zzz is unsigned." ;;
18080 -1) echo "Your $zzz is signed." ;;
18086 echo "(I can't compile the test program--guessing unsigned.)" >&4
18092 if $test X"$quadtype" != X; then
18094 echo "Checking how to print 64-bit integers..." >&4
18096 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18097 $cat >try.c <<'EOCP'
18098 #include <sys/types.h>
18101 int q = 12345678901;
18102 printf("%ld\n", q);
18106 if eval $compile; then
18110 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18111 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18112 echo "We will use %d."
18118 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18119 $cat >try.c <<'EOCP'
18120 #include <sys/types.h>
18123 long q = 12345678901;
18124 printf("%ld\n", q);
18128 if eval $compile; then
18132 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18133 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18134 echo "We will use %ld."
18140 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18141 $cat >try.c <<'EOCP'
18142 #include <sys/types.h>
18143 #include <inttypes.h>
18146 int64_t q = 12345678901;
18147 printf("%" PRId64 "\n", q);
18151 if eval $compile; then
18155 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18156 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18157 echo "We will use the C9X style."
18163 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18165 #include <sys/types.h>
18168 $quadtype q = 12345678901;
18169 printf("%Ld\n", q);
18173 if eval $compile; then
18177 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18178 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18179 echo "We will use %Ld."
18185 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18186 $cat >try.c <<'EOCP'
18187 #include <sys/types.h>
18190 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18191 printf("%lld\n", q);
18195 if eval $compile; then
18199 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18200 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18201 echo "We will use the %lld style."
18207 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18209 #include <sys/types.h>
18212 $quadtype q = 12345678901;
18213 printf("%qd\n", q);
18217 if eval $compile; then
18221 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18222 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18223 echo "We will use %qd."
18229 if $test X"$sPRId64" = X; then
18230 echo "Cannot figure out how to print 64-bit integers." >&4
18238 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18239 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18241 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18242 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18248 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18250 if $test X"$ivsize" = X8; then
18251 ivdformat="$sPRId64"
18252 uvuformat="$sPRIu64"
18253 uvoformat="$sPRIo64"
18254 uvxformat="$sPRIx64"
18255 uvXUformat="$sPRIXU64"
18257 if $test X"$ivsize" = X"$longsize"; then
18264 if $test X"$ivsize" = X"$intsize"; then
18272 if $test X"$ivsize" = X"$shortsize"; then
18283 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18284 nveformat="$sPRIeldbl"
18285 nvfformat="$sPRIfldbl"
18286 nvgformat="$sPRIgldbl"
18287 nvEUformat="$sPRIEUldbl"
18288 nvFUformat="$sPRIFUldbl"
18289 nvGUformat="$sPRIGUldbl"
18299 case "$ivdformat" in
18300 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18307 $echo "Checking the format string to be used for gids..." >&4
18310 -1) if $test X"$gidsize" = X"$ivsize"; then
18311 gidformat="$ivdformat"
18313 if $test X"$gidsize" = X"$longsize"; then
18316 if $test X"$gidsize" = X"$intsize"; then
18319 if $test X"$gidsize" = X"$shortsize"; then
18326 *) if $test X"$gidsize" = X"$uvsize"; then
18327 gidformat="$uvuformat"
18329 if $test X"$gidsize" = X"$longsize"; then
18332 if $test X"$gidsize" = X"$intsize"; then
18335 if $test X"$gidsize" = X"$shortsize"; then
18344 : see if getgroups exists
18345 set getgroups d_getgrps
18348 : see if setgroups exists
18349 set setgroups d_setgrps
18353 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18355 case "$d_getgrps$d_setgrps" in
18357 case "$groupstype" in
18358 '') dflt="$gidtype" ;;
18359 *) dflt="$groupstype" ;;
18362 What type of pointer is the second argument to getgroups() and setgroups()?
18363 Usually this is the same as group ids, $gidtype, but not always.
18366 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18370 *) groupstype="$gidtype";;
18374 echo "Checking if your $make program sets \$(MAKE)..." >&4
18375 case "$make_set_make" in
18377 $sed 's/^X //' > testmake.mak << 'EOF'
18379 X @echo 'maketemp="$(MAKE)"'
18381 case "`$make -f testmake.mak 2>/dev/null`" in
18382 *maketemp=*) make_set_make='#' ;;
18383 *) make_set_make="MAKE=$make" ;;
18385 $rm -f testmake.mak
18388 case "$make_set_make" in
18389 '#') echo "Yup, it does.";;
18390 *) echo "Nope, it doesn't.";;
18393 : see what type is used for mode_t
18394 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18395 set mode_t modetype int stdio.h sys/types.h
18398 : see if stdarg is available
18400 if $test `./findhdr stdarg.h`; then
18401 echo "<stdarg.h> found." >&4
18404 echo "<stdarg.h> NOT found." >&4
18408 : see if varags is available
18410 if $test `./findhdr varargs.h`; then
18411 echo "<varargs.h> found." >&4
18413 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18416 : set up the varargs testing programs
18417 $cat > varargs.c <<EOP
18419 #include <stdarg.h>
18422 #include <varargs.h>
18426 int f(char *p, ...)
18440 p = va_arg(ap, char *);
18445 $cat > varargs <<EOP
18447 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
18456 : now check which varargs header should be included
18461 if `./varargs I_STDARG`; then
18463 elif `./varargs I_VARARGS`; then
18468 if `./varargs I_VARARGS`; then
18475 echo "I could not find the definition for va_dcl... You have problems..." >&4
18476 val="$undef"; set i_stdarg; eval $setvar
18477 val="$undef"; set i_varargs; eval $setvar
18482 case "$i_varhdr" in
18484 val="$define"; set i_stdarg; eval $setvar
18485 val="$undef"; set i_varargs; eval $setvar
18488 val="$undef"; set i_stdarg; eval $setvar
18489 val="$define"; set i_varargs; eval $setvar
18492 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
18496 : see if we need va_copy
18498 case "$i_stdarg" in
18501 #include <stdarg.h>
18503 #$i_stdlib I_STDLIB
18505 #include <stdlib.h>
18507 #include <signal.h>
18510 ivfprintf(FILE *f, const char *fmt, va_list *valp)
18512 return vfprintf(f, fmt, *valp);
18516 myvfprintf(FILE *f, const char *fmt, va_list val)
18518 return ivfprintf(f, fmt, &val);
18522 myprintf(char *fmt, ...)
18525 va_start(val, fmt);
18526 return myvfprintf(stdout, fmt, val);
18530 main(int ac, char **av)
18532 signal(SIGSEGV, exit);
18534 myprintf("%s%cs all right, then\n", "that", '\'');
18539 if eval $compile && $run ./try 2>&1 >/dev/null; then
18540 case "`$run ./try`" in
18541 "that's all right, then")
18547 yes) echo "It seems that you don't need va_copy()." >&4
18548 need_va_copy="$undef"
18550 *) echo "It seems that va_copy() or similar will be needed." >&4
18551 need_va_copy="$define"
18554 $rm -f try.* core core.* *.core *.core.*
18556 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
18560 : see what type is used for size_t
18561 rp="What is the type used for the length parameter for string functions?"
18562 set size_t sizetype 'unsigned int' stdio.h sys/types.h
18565 : check for type of arguments to gethostbyaddr.
18566 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
18567 case "$d_gethbyaddr" in
18571 Checking to see what type of arguments are accepted by gethostbyaddr().
18573 hdrs="$define sys/types.h
18574 $d_socket sys/socket.h
18575 $i_niin netinet/in.h
18577 $i_unistd unistd.h"
18578 : The first arg can 'char *' or 'void *'
18579 : The second arg is some of integral type
18580 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
18581 for yyy in size_t long int; do
18582 case "$netdb_host_type" in
18583 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
18584 if ./protochk "$try" $hdrs; then
18585 echo "Your system accepts $xxx for the first arg."
18586 echo "...and $yyy for the second arg."
18587 netdb_host_type="$xxx"
18588 netdb_hlen_type="$yyy"
18594 : In case none of those worked, prompt the user.
18595 case "$netdb_host_type" in
18596 '') rp='What is the type for the 1st argument to gethostbyaddr?'
18599 netdb_host_type=$ans
18600 rp='What is the type for the 2nd argument to gethostbyaddr?'
18603 netdb_hlen_type=$ans
18607 *) : no gethostbyaddr, so pick harmless defaults
18608 netdb_host_type='char *'
18609 netdb_hlen_type="$sizetype"
18612 # Remove the "const" if needed. -- but then we'll have a
18614 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
18617 : check for type of argument to gethostbyname.
18618 if test "X$netdb_name_type" = X ; then
18619 case "$d_gethbyname" in
18623 Checking to see what type of argument is accepted by gethostbyname().
18625 hdrs="$define sys/types.h
18626 $d_socket sys/socket.h
18627 $i_niin netinet/in.h
18629 $i_unistd unistd.h"
18630 for xxx in "const char *" "char *"; do
18631 case "$netdb_name_type" in
18632 '') try="extern struct hostent *gethostbyname($xxx);"
18633 if ./protochk "$try" $hdrs; then
18634 echo "Your system accepts $xxx."
18635 netdb_name_type="$xxx"
18640 : In case none of those worked, prompt the user.
18641 case "$netdb_name_type" in
18642 '') rp='What is the type for the 1st argument to gethostbyname?'
18645 netdb_name_type=$ans
18649 *) : no gethostbyname, so pick harmless default
18650 netdb_name_type='char *'
18655 : check for type of 1st argument to getnetbyaddr.
18656 if test "X$netdb_net_type" = X ; then
18657 case "$d_getnbyaddr" in
18661 Checking to see what type of 1st argument is accepted by getnetbyaddr().
18663 hdrs="$define sys/types.h
18664 $d_socket sys/socket.h
18665 $i_niin netinet/in.h
18667 $i_unistd unistd.h"
18668 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
18669 case "$netdb_net_type" in
18670 '') try="extern struct netent *getnetbyaddr($xxx, int);"
18671 if ./protochk "$try" $hdrs; then
18672 echo "Your system accepts $xxx."
18673 netdb_net_type="$xxx"
18678 : In case none of those worked, prompt the user.
18679 case "$netdb_net_type" in
18680 '') rp='What is the type for the 1st argument to getnetbyaddr?'
18683 netdb_net_type=$ans
18687 *) : no getnetbyaddr, so pick harmless default
18688 netdb_net_type='long'
18692 : locate the preferred pager for this system
18699 [a-zA-Z]:/*) dflt=$pg;;
18703 [a-zA-Z]:/*) dflt=$more;;
18707 [a-zA-Z]:/*) dflt=$less;;
18710 '') dflt=/usr/ucb/more;;
18714 : Instruct ./getfile to trust the hinted or previous pager value,
18715 : even if it does not begin with a slash. For example, on os2,
18716 : pager might be cmd /c more. See comments in UU/getfile.
18721 rp='What pager is used on your system?'
18725 : see what type pids are declared as in the kernel
18726 rp="What is the type of process ids on this system?"
18727 set pid_t pidtype int stdio.h sys/types.h
18730 : see if ar generates random libraries by itself
18732 echo "Checking how to generate random libraries on your machine..." >&4
18733 echo 'int bar1() { return bar2(); }' > bar1.c
18734 echo 'int bar2() { return 2; }' > bar2.c
18736 #$i_stdlib I_STDLIB
18738 #include <stdlib.h>
18740 int main() { printf("%d\n", bar1()); exit(0); }
18742 $cc $ccflags -c bar1.c >/dev/null 2>&1
18743 $cc $ccflags -c bar2.c >/dev/null 2>&1
18744 $cc $ccflags -c foo.c >/dev/null 2>&1
18745 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
18746 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
18747 $run ./foobar >/dev/null 2>&1; then
18748 echo "$ar appears to generate random libraries itself."
18751 elif $ar ts bar$_a >/dev/null 2>&1 &&
18752 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
18753 $run ./foobar >/dev/null 2>&1; then
18754 echo "a table of contents needs to be added with '$ar ts'."
18761 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
18762 $test -f $ranlib || ranlib=''
18765 if $test -n "$ranlib"; then
18766 echo "your system has '$ranlib'; we'll use that."
18769 echo "your system doesn't seem to support random libraries"
18770 echo "so we'll use lorder and tsort to order the libraries."
18777 : check for type of arguments to select.
18778 case "$selecttype" in
18779 '') case "$d_select" in
18783 Checking to see what type of arguments are accepted by select().
18785 hdrs="$define sys/types.h
18786 $i_systime sys/time.h
18787 $i_sysselct sys/select.h
18788 $d_socket sys/socket.h"
18789 : The first arg can be int, unsigned, or size_t
18790 : The last arg may or may not be 'const'
18792 : void pointer has been seen but using that
18793 : breaks the selectminbits test
18794 for xxx in 'fd_set *' 'int *'; do
18795 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
18796 for tmo in 'struct timeval *' 'const struct timeval *'; do
18798 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
18799 if ./protochk "$try" $hdrs; then
18800 echo "Your system accepts $xxx."
18809 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
18810 case "$d_fd_set" in
18811 $define) dflt="fd_set *" ;;
18820 *) : no select, so pick a harmless default
18827 : check for the select 'width'
18828 case "$selectminbits" in
18829 '') safebits=`expr $ptrsize \* 8`
18830 case "$d_select" in
18834 Checking to see on how many bits at a time your select() operates...
18837 #include <sys/types.h>
18839 #$i_systime I_SYS_TIME
18840 #$i_systimek I_SYS_TIME_KERNEL
18845 # ifdef I_SYS_TIME_KERNEL
18848 # include <sys/time.h>
18849 # ifdef I_SYS_TIME_KERNEL
18853 #$i_sysselct I_SYS_SELECT
18854 #ifdef I_SYS_SELECT
18855 #include <sys/select.h>
18857 #$d_socket HAS_SOCKET
18859 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
18862 #$i_stdlib I_STDLIB
18864 #include <stdlib.h>
18867 #define S sizeof(*(b))
18869 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
18870 #define NBITS (NBYTES * 8)
18872 char *s = malloc(NBYTES);
18881 fp = fopen("try.c", "r");
18887 b = ($selecttype)s;
18888 for (i = 0; i < NBITS; i++)
18892 select(fd + 1, b, 0, 0, &t);
18893 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
18895 printf("%d\n", i + 1);
18900 if eval $compile_ok; then
18901 selectminbits=`$run ./try`
18902 case "$selectminbits" in
18904 Cannot figure out on how many bits at a time your select() operates.
18905 I'll play safe and guess it is $safebits bits.
18907 selectminbits=$safebits
18908 bits="$safebits bits"
18911 *) bits="$selectminbits bits" ;;
18913 echo "Your select() operates on $bits at a time." >&4
18915 rp='What is the minimum number of bits your select() operates on?'
18916 case "$byteorder" in
18917 12345678) dflt=64 ;;
18923 selectminbits="$val"
18927 *) : no select, so pick a harmless default
18928 selectminbits=$safebits
18934 : Trace out the files included by signal.h, then look for SIGxxx names.
18935 : Remove SIGARRAYSIZE used by HPUX.
18936 : Remove SIGSTKSIZE used by Linux.
18937 : Remove SIGSTKSZ used by Posix.
18938 : Remove SIGTYP void lines used by OS2.
18939 : Some cpps, like os390, dont give the file name anywhere
18940 if [ "X$fieldn" = X ]; then
18941 : Just make some guesses. We check them later.
18942 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
18944 xxx=`echo '#include <signal.h>' |
18945 $cppstdin $cppminus $cppflags 2>/dev/null |
18946 $grep '^[ ]*#.*include' |
18947 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
18949 : Check this list of files to be sure we have parsed the cpp output ok.
18950 : This will also avoid potentially non-existent files, such
18953 for xx in $xxx /dev/null ; do
18954 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
18956 : If we have found no files, at least try signal.h
18957 case "$xxxfiles" in
18958 '') xxxfiles=`./findhdr signal.h` ;;
18961 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
18962 print substr($2, 4, 20)
18964 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
18965 print substr($3, 4, 20)
18967 : Append some common names just in case the awk scan failed.
18968 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
18969 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
18970 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
18971 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
18972 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
18974 : generate a few handy files for later
18975 $cat > signal.c <<EOCP
18976 #include <sys/types.h>
18977 #include <signal.h>
18978 #$i_stdlib I_STDLIB
18980 #include <stdlib.h>
18985 /* Strange style to avoid deeply-nested #if/#else/#endif */
18988 # define NSIG (_NSIG)
18994 # define NSIG (SIGMAX+1)
19000 # define NSIG (SIG_MAX+1)
19006 # define NSIG (MAXSIG+1)
19012 # define NSIG (MAX_SIG+1)
19017 # ifdef SIGARRAYSIZE
19018 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
19024 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19028 /* Default to some arbitrary number that's big enough to get most
19029 of the common signals.
19035 printf("NSIG %d\n", NSIG);
19041 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19043 printf "#ifdef SIG"; printf $1; printf "\n"
19044 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19045 printf $1; printf ");\n"
19049 printf "#endif /* JUST_NSIG */\n";
19050 printf "exit(0);\n}\n";
19053 $cat >signal.awk <<'EOP'
19054 BEGIN { ndups = 0 }
19055 $1 ~ /^NSIG$/ { nsig = $2 }
19056 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19057 if ($2 > maxsig) { maxsig = $2 }
19058 if (sig_name[$2]) {
19059 dup_name[ndups] = $1
19060 dup_num[ndups] = $2
19072 printf("NSIG %d\n", nsig);
19073 for (n = 1; n < nsig; n++) {
19075 printf("%s %d\n", sig_name[n], sig_num[n])
19078 printf("NUM%d %d\n", n, n)
19081 for (n = 0; n < ndups; n++) {
19082 printf("%s %d\n", dup_name[n], dup_num[n])
19086 $cat >signal_cmd <<EOS
19088 if $test -s signal.lst; then
19089 echo "Using your existing signal.lst file"
19094 $cat >>signal_cmd <<'EOS'
19097 if eval $compile_ok; then
19098 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19100 echo "(I can't seem be able to compile the whole test program)" >&4
19101 echo "(I'll try it in little pieces.)" >&4
19102 set signal -DJUST_NSIG
19103 if eval $compile_ok; then
19104 $run ./signal$_exe > signal.nsg
19107 echo "I can't seem to figure out how many signals you have." >&4
19108 echo "Guessing 50." >&4
19109 echo 'NSIG 50' > signal.nsg
19111 : Now look at all the signal names, one at a time.
19112 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19113 $cat > signal.c <<EOCP
19114 #include <sys/types.h>
19115 #include <signal.h>
19118 printf("$xx %d\n", SIG${xx});
19123 if eval $compile; then
19124 echo "SIG${xx} found."
19125 $run ./signal$_exe >> signal.ls1
19127 echo "SIG${xx} NOT found."
19130 if $test -s signal.ls1; then
19131 $cat signal.nsg signal.ls1 |
19132 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19136 if $test -s signal.lst; then
19139 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19140 echo 'kill -l' >signal
19141 set X `csh -f <signal`
19145 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19147 echo $@ | $tr ' ' $trnl | \
19148 $awk '{ printf "%s %d\n", $1, ++s; }
19149 END { printf "NSIG %d\n", ++s }' >signal.lst
19151 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19153 chmod a+x signal_cmd
19154 $eunicefix signal_cmd
19156 : generate list of signal names
19158 case "$sig_name_init" in
19160 *) case "$sig_num_init" in
19161 ''|*,*) doinit=yes ;;
19166 echo "Generating a list of signal names and numbers..." >&4
19168 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19169 sig_name=`$awk 'BEGIN { printf "ZERO " }
19170 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19171 sig_num=`$awk 'BEGIN { printf "0 " }
19172 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19173 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19174 !/^NSIG/ { printf "\"%s\", ", $1 }
19175 END { printf "0\n" }' signal.lst`
19176 sig_num_init=`$awk 'BEGIN { printf "0, " }
19177 !/^NSIG/ { printf "%d, ", $2}
19178 END { printf "0\n"}' signal.lst`
19181 echo "The following $sig_count signals are available:"
19183 echo $sig_name | $awk \
19184 'BEGIN { linelen = 0 }
19186 for (i = 1; i <= NF; i++) {
19187 name = "SIG" $i " "
19188 linelen = linelen + length(name)
19189 if (linelen > 70) {
19191 linelen = length(name)
19197 sig_size=`echo $sig_name | awk '{print NF}'`
19198 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19201 case "$sizetype" in
19202 *_t) zzz="$sizetype" ;;
19203 *) zzz="filesize" ;;
19205 echo "Checking the size of $zzz..." >&4
19207 #include <sys/types.h>
19209 #$i_stdlib I_STDLIB
19211 #include <stdlib.h>
19214 printf("%d\n", (int)sizeof($sizetype));
19219 if eval $compile_ok; then
19223 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19226 echo "Your $zzz size is $sizesize bytes."
19231 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19235 : check for socklen_t
19237 echo "Checking to see if you have socklen_t..." >&4
19239 #include <sys/types.h>
19240 #$d_socket HAS_SOCKET
19242 #include <sys/socket.h>
19244 int main() { socklen_t x = 16; }
19247 if eval $compile; then
19249 echo "You have socklen_t."
19252 echo "You do not have socklen_t."
19253 case "$sizetype" in
19254 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19261 : see if this is a socks.h system
19262 set socks.h i_socks
19265 : check for type of the size argument to socket calls
19266 case "$d_socket" in
19270 Checking to see what type is the last argument of accept().
19273 case "$d_socklen_t" in
19274 "$define") yyy="$yyy socklen_t"
19276 yyy="$yyy $sizetype int long unsigned"
19277 for xxx in $yyy; do
19278 case "$socksizetype" in
19279 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19280 case "$usesocks" in
19282 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19283 echo "Your system accepts '$xxx *' for the last argument of accept()."
19284 socksizetype="$xxx"
19287 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19288 echo "Your system accepts '$xxx *' for the last argument of accept()."
19289 socksizetype="$xxx"
19296 : In case none of those worked, prompt the user.
19297 case "$socksizetype" in
19298 '') rp='What is the type for socket address structure sizes?'
19305 *) : no sockets, so pick relatively harmless default
19310 : see what type is used for signed size_t
19311 set ssize_t ssizetype int stdio.h sys/types.h
19316 #$i_stdlib I_STDLIB
19318 #include <stdlib.h>
19320 #include <sys/types.h>
19321 #define Size_t $sizetype
19322 #define SSize_t $dflt
19325 if (sizeof(Size_t) == sizeof(SSize_t))
19327 else if (sizeof(Size_t) == sizeof(int))
19336 if eval $compile_ok && $run ./try > /dev/null; then
19337 ssizetype=`$run ./try`
19338 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19341 Help! I can't compile and run the ssize_t test program: please enlighten me!
19342 (This is probably a misconfiguration in your system or libraries, and
19343 you really ought to fix it. Still, I'll try anyway.)
19345 I need a type that is the same size as $sizetype, but is guaranteed to
19346 be signed. Common values are ssize_t, int and long.
19349 rp="What signed type is the same size as $sizetype?"
19355 : see what type of char stdio uses.
19357 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
19358 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19359 echo "Your stdio uses unsigned chars." >&4
19360 stdchar="unsigned char"
19362 echo "Your stdio uses signed chars." >&4
19369 : see what type uids are declared as in the kernel
19371 echo "Looking for the type for user ids returned by getuid()."
19372 set uid_t uidtype xxx stdio.h sys/types.h
19376 xxx=`./findhdr sys/user.h`
19377 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19379 unsigned) dflt="$1 $2" ;;
19383 *) dflt="$uidtype";;
19386 uid_t) echo "uid_t found." ;;
19387 *) rp="What is the type for user ids returned by getuid()?"
19395 *_t) zzz="$uidtype" ;;
19398 echo "Checking the size of $zzz..." >&4
19400 #include <sys/types.h>
19402 #$i_stdlib I_STDLIB
19404 #include <stdlib.h>
19407 printf("%d\n", (int)sizeof($uidtype));
19412 if eval $compile_ok; then
19416 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19419 echo "Your $zzz is $uidsize bytes long."
19424 echo "(I can't compile the test program--guessing $uidsize.)" >&4
19429 *_t) zzz="$uidtype" ;;
19432 echo "Checking the sign of $zzz..." >&4
19434 #include <sys/types.h>
19445 if eval $compile; then
19449 echo "(I can't execute the test program--guessing unsigned.)" >&4
19453 1) echo "Your $zzz is unsigned." ;;
19454 -1) echo "Your $zzz is signed." ;;
19460 echo "(I can't compile the test program--guessing unsigned.)" >&4
19466 $echo "Checking the format string to be used for uids..." >&4
19469 -1) if $test X"$uidsize" = X"$ivsize"; then
19470 uidformat="$ivdformat"
19472 if $test X"$uidsize" = X"$longsize"; then
19475 if $test X"$uidsize" = X"$intsize"; then
19478 if $test X"$uidsize" = X"$shortsize"; then
19485 *) if $test X"$uidsize" = X"$uvsize"; then
19486 uidformat="$uvuformat"
19488 if $test X"$uidsize" = X"$longsize"; then
19491 if $test X"$uidsize" = X"$intsize"; then
19494 if $test X"$uidsize" = X"$shortsize"; then
19503 : determine compiler compiler
19512 if $test -f "$byacc$_exe"; then
19514 comp="byacc or $comp"
19516 if $test -f "$bison$_exe"; then
19517 comp="$comp or bison -y"
19519 rp="Which compiler compiler ($comp) shall I use?"
19528 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
19534 : see if this is a fp.h system
19538 : see if this is a fp_class.h system
19539 set fp_class.h i_fp_class
19542 : see if this is a ieeefp.h system
19543 case "$i_ieeefp" in
19544 '' ) set ieeefp.h i_ieeefp
19549 : see if this is a libutil.h system
19550 set libutil.h i_libutil
19553 : see if mach cthreads are available
19554 if test "X$usethreads" = "X$define"; then
19555 set mach/cthreads.h i_machcthr
19558 i_machcthr="$undef"
19563 : see if this is a mntent.h system
19564 set mntent.h i_mntent
19567 : see if ndbm.h is available
19573 # Some Linux distributions such as RedHat 7.1 put the
19574 # ndbm.h header in /usr/include/gdbm/ndbm.h.
19575 if $test -f /usr/include/gdbm/ndbm.h; then
19576 echo '<gdbm/ndbm.h> found.'
19577 ccflags="$ccflags -I/usr/include/gdbm"
19578 cppflags="$cppflags -I/usr/include/gdbm"
19586 : see if dbm_open exists
19587 set dbm_open d_dbm_open
19589 case "$d_dbm_open" in
19592 echo "We won't be including <ndbm.h>"
19601 : see if net/errno.h is available
19603 set net/errno.h val
19606 : Unfortunately, it causes problems on some systems. Arrgh.
19609 cat > try.c <<'EOM'
19612 #include <net/errno.h>
19618 if $cc $ccflags -c try.c >/dev/null 2>&1; then
19619 echo "We'll be including <net/errno.h>." >&4
19621 echo "We won't be including <net/errno.h>." >&4
19630 : see if netinet/tcp.h is available
19631 set netinet/tcp.h i_netinettcp
19634 : see if this is a poll.h system
19638 : see if this is a prot.h system
19643 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
19644 $cat <<'EOSH' > Cppsym.know
19645 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
19646 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
19647 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
19648 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
19649 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
19650 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
19651 bull c cadmus clipper CMU COFF COMPILER_VERSION
19652 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
19653 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
19654 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
19655 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
19657 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
19658 H3050R H3050RX hbullx20 hcx host_mips
19659 hp200 hp300 hp700 HP700 hp800 hp9000
19660 hp9000s200 hp9000s300 hp9000s400 hp9000s500
19661 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
19662 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
19663 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
19664 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
19665 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
19666 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
19667 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
19668 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
19669 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
19670 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
19671 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
19672 MATH_HAS_NO_SIDE_EFFECTS
19673 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
19674 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
19675 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
19676 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
19677 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
19678 NetBSD news1500 news1700 news1800 news1900 news3700
19679 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
19680 ns32016 ns32332 ns32k nsc32000
19681 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
19682 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
19683 pc532 pdp11 PGC PIC plexus PORTAR posix
19684 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
19685 POSIX_C_SOURCE POSIX_SOURCE POWER
19686 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
19687 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
19688 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
19689 sony sony_news sonyrisc sparc sparclite spectrum
19690 stardent stdc STDC_EXT stratos sun sun3 sun386
19691 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
19692 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
19693 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
19694 sysV68 sysV88 Tek4132 Tek4300 titan
19695 TM3200 TM5400 TM5600
19696 tower tower32 tower32_200 tower32_600 tower32_700
19697 tower32_800 tower32_850 tss
19698 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
19699 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
19700 unix UNIX95 UNIX99 unixpc unos
19701 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
19702 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
19703 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
19705 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
19706 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
19707 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
19710 # Maybe put other stuff here too.
19711 cat <<EOSH >>Cppsym.know
19714 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
19715 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
19716 $cat Cppsym.know > Cppsym.c
19717 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
19718 $rm -f Cppsym.a Cppsym.b Cppsym.c
19719 cat <<EOSH > Cppsym
19721 if $test \$# -gt 0; then
19722 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
19723 if $test -s Cppsym.got; then
19730 $tr " " "$trnl" | ./Cppsym.try
19736 cat <<EOSH > Cppsym.try
19738 cat <<'EOCP' > try.c
19744 cat <<'EOSH' >> Cppsym.try
19746 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
19747 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
19748 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
19749 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
19751 echo 'return 0;}' >> try.c
19753 cat <<EOSH >> Cppsym.try
19755 case "$osname-$gccversion" in
19756 irix-) ccflags="\$ccflags -woff 1178" ;;
19757 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
19759 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
19761 chmod +x Cppsym.try
19762 $eunicefix Cppsym.try
19763 ./Cppsym < Cppsym.know > Cppsym.true
19764 : now check the C compiler for additional symbols
19765 postprocess_cc_v=''
19767 aix) postprocess_cc_v="|$tr , ' '" ;;
19774 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
19777 -D*) echo "\$i" | $sed 's/^-D//';;
19778 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
19783 postprocess_cc_v=''
19786 ./ccsym > ccsym1.raw
19787 if $test -s ccsym1.raw; then
19788 $sort ccsym1.raw | $uniq >ccsym.raw
19790 mv ccsym1.raw ccsym.raw
19793 $awk '/\=/ { print $0; next }
19794 { print $0"=1" }' ccsym.raw >ccsym.list
19795 $awk '/\=/ { print $0; next }
19796 { print $0"=1" }' Cppsym.true >ccsym.true
19797 $comm -13 ccsym.true ccsym.list >ccsym.own
19798 $comm -12 ccsym.true ccsym.list >ccsym.com
19799 $comm -23 ccsym.true ccsym.list >ccsym.cpp
19801 if $test -z ccsym.raw; then
19802 echo "Your C compiler doesn't seem to define any symbols!" >&4
19804 echo "However, your C preprocessor defines the following symbols:"
19807 cppsymbols=`$cat Cppsym.true`
19808 cppsymbols=`echo $cppsymbols`
19809 cppccsymbols="$cppsymbols"
19811 if $test -s ccsym.com; then
19812 echo "Your C compiler and pre-processor define these symbols:"
19813 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
19816 cppccsymbols=`$cat ccsym.com`
19817 cppccsymbols=`echo $cppccsymbols`
19818 $test "$silent" || sleep 1
19820 if $test -s ccsym.cpp; then
19821 $test "$also" && echo " "
19822 echo "Your C pre-processor ${also}defines the following symbols:"
19823 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
19825 cppsymbols=`$cat ccsym.cpp`
19826 cppsymbols=`echo $cppsymbols`
19827 $test "$silent" || sleep 1
19829 if $test -s ccsym.own; then
19830 $test "$also" && echo " "
19831 echo "Your C compiler ${also}defines the following cpp symbols:"
19832 $sed -e 's/\(..*\)=1/\1/' ccsym.own
19833 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
19834 ccsymbols=`$cat ccsym.own`
19835 ccsymbols=`echo $ccsymbols`
19836 $test "$silent" || sleep 1
19840 : see if this is a termio system
19844 if $test `./findhdr termios.h`; then
19845 set tcsetattr i_termios
19851 "$define") echo "You have POSIX termios.h... good!" >&4;;
19852 *) if ./Cppsym pyr; then
19853 case "`/bin/universe`" in
19854 ucb) if $test `./findhdr sgtty.h`; then
19856 echo "<sgtty.h> found." >&4
19858 echo "System is pyramid with BSD universe."
19859 echo "<sgtty.h> not found--you could have problems." >&4
19861 *) if $test `./findhdr termio.h`; then
19863 echo "<termio.h> found." >&4
19865 echo "System is pyramid with USG universe."
19866 echo "<termio.h> not found--you could have problems." >&4
19870 if $test `./findhdr termio.h`; then
19871 echo "<termio.h> found." >&4
19873 elif $test `./findhdr sgtty.h`; then
19874 echo "<sgtty.h> found." >&4
19877 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
19880 if $test `./findhdr sgtty.h`; then
19881 echo "<sgtty.h> found." >&4
19883 elif $test `./findhdr termio.h`; then
19884 echo "<termio.h> found." >&4
19887 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
19891 set i_termio; eval $setvar
19892 val=$val2; set i_sgtty; eval $setvar
19893 val=$val3; set i_termios; eval $setvar
19895 : see if stddef is available
19896 set stddef.h i_stddef
19899 : see if this is a sunmath.h system
19900 set sunmath.h i_sunmath
19903 : see if sys/access.h is available
19904 set sys/access.h i_sysaccess
19907 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
19908 set sys/filio.h i_sysfilio
19911 if $test `./findhdr sys/ioctl.h`; then
19913 echo '<sys/ioctl.h> found.' >&4
19916 if $test $i_sysfilio = "$define"; then
19917 echo '<sys/ioctl.h> NOT found.' >&4
19919 $test $i_sgtty = "$define" && xxx="sgtty.h"
19920 $test $i_termio = "$define" && xxx="termio.h"
19921 $test $i_termios = "$define" && xxx="termios.h"
19922 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
19928 : see if socket ioctl defs are in sys/sockio.h
19930 xxx=`./findhdr sys/sockio.h`
19931 if $test "$xxx"; then
19932 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
19934 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
19937 echo "No socket ioctls found in <sys/sockio.h>." >&4
19942 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
19949 : see if this is a syslog.h system
19950 set syslog.h i_syslog
19954 : see if this is a sys/mode.h system
19955 set sys/mode.h i_sysmode
19958 : see if sys/resource.h has to be included
19959 set sys/resource.h i_sysresrc
19962 : see if sys/security.h is available
19963 set sys/security.h i_syssecrt
19966 : see if this is a sys/statvfs.h system
19967 set sys/statvfs.h i_sysstatvfs
19970 : see if this is a sys/un.h system
19971 set sys/un.h i_sysun
19975 : see if this is a sys/utsname.h system
19976 set sys/utsname.h i_sysutsname
19979 : see if this is a syswait system
19980 set sys/wait.h i_syswait
19983 : see if this is a ustat.h system
19984 set ustat.h i_ustat
19987 : see if this is an utime system
19988 set utime.h i_utime
19991 : see if this is a values.h system
19992 set values.h i_values
19995 : see if this is a vfork system
19998 set vfork.h i_vfork
20006 : see if gdbm.h is available
20011 : see if gdbm_open exists
20012 set gdbm_open d_gdbm_open
20014 case "$d_gdbm_open" in
20017 echo "We won't be including <gdbm.h>"
20027 echo "Looking for extensions..." >&4
20028 : If we are using the old config.sh, known_extensions may contain
20029 : old or inaccurate or duplicate values.
20030 known_extensions=''
20031 nonxs_extensions=''
20032 : We do not use find because it might not be available.
20033 : We do not just use MANIFEST because the user may have dropped
20034 : some additional extensions into the source tree and expect them
20037 : Function to recursively find available extensions, ignoring DynaLoader
20038 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20042 DynaLoader|dynaload) ;;
20044 if $test -f $xxx/$xxx.xs; then
20045 known_extensions="$known_extensions $1$xxx";
20046 elif $test -f $xxx/Makefile.PL; then
20047 nonxs_extensions="$nonxs_extensions $1$xxx";
20049 if $test -d $xxx -a $# -lt 10; then
20052 eval $find_extensions;
20064 eval $find_extensions
20065 # Special case: Add in threads/shared since it is not picked up by the
20066 # recursive find above (and adding in general recursive finding breaks
20067 # SDBM_File/sdbm). A.D. 10/25/2001.
20068 known_extensions="$known_extensions threads/shared"
20069 set X $nonxs_extensions
20071 nonxs_extensions="$*"
20072 set X $known_extensions
20074 known_extensions="$*"
20077 : Now see which are supported on this system.
20079 for xxx in $known_extensions ; do
20083 $define) avail_ext="$avail_ext $xxx" ;;
20086 GDBM_File|gdbm_fil)
20088 $define) avail_ext="$avail_ext $xxx" ;;
20091 I18N/Langinfo|i18n_lan)
20092 case "$i_langinfo$d_nl_langinfo" in
20093 $define$define) avail_ext="$avail_ext $xxx" ;;
20096 NDBM_File|ndbm_fil)
20099 case "$osname-$use64bitint" in
20102 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20105 *) avail_ext="$avail_ext $xxx" ;;
20110 ODBM_File|odbm_fil)
20111 case "${i_dbm}${i_rpcsvcdbm}" in
20113 case "$osname-$use64bitint" in
20116 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20119 *) avail_ext="$avail_ext $xxx" ;;
20125 case "$useposix" in
20126 true|define|y) avail_ext="$avail_ext $xxx" ;;
20130 case "$useopcode" in
20131 true|define|y) avail_ext="$avail_ext $xxx" ;;
20135 case "$d_socket" in
20138 beos) ;; # not unless BONE
20139 *) avail_ext="$avail_ext $xxx" ;;
20144 Sys/Syslog|sys/syslog)
20145 : XXX syslog requires socket
20146 case "$d_socket" in
20147 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20151 case "$usethreads" in
20153 case "$useithreads" in
20154 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20158 XS/APItest|xs/apitest)
20159 # This is just for testing. Skip it unless we have dynamic loading.
20162 $define) avail_ext="$avail_ext $xxx" ;;
20165 XS/Typemap|xs/typemap)
20166 # This is just for testing. Skip it unless we have dynamic loading.
20168 $define) avail_ext="$avail_ext $xxx" ;;
20171 threads|threads/shared)
20172 # threads and threads::shared are special cases.
20173 # To stop people from asking "Perl 5.8.0 was supposed
20174 # to have this new fancy threads implementation but my
20175 # perl doesn't have it" and from people trying to
20176 # (re)install the threads module using CPAN.pm and
20177 # CPAN.pm then offering to reinstall Perl 5.8.0,
20178 # the threads.pm and threads/shared.pm will always be
20179 # there, croaking informatively ("you need to rebuild
20180 # all of Perl with threads, sorry") when threads haven't
20181 # been compiled in.
20183 avail_ext="$avail_ext $xxx"
20186 : XXX Do we need a useipcsysv variable here
20187 case "${d_msg}${d_sem}${d_shm}" in
20188 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20191 *) avail_ext="$avail_ext $xxx"
20200 case "$onlyextensions" in
20202 *) keepextensions=''
20203 echo "You have requested that only certains extensions be included..." >&4
20204 for i in $onlyextensions; do
20205 case " $avail_ext " in
20207 echo "Keeping extension $i."
20208 keepextensions="$keepextensions $i"
20210 *) echo "Ignoring extension $i." ;;
20213 avail_ext="$keepextensions"
20217 case "$noextensions" in
20219 *) keepextensions=''
20220 echo "You have requested that certain extensions be ignored..." >&4
20221 for i in $avail_ext; do
20222 case " $noextensions " in
20223 *" $i "*) echo "Ignoring extension $i." ;;
20224 *) echo "Keeping extension $i.";
20225 keepextensions="$keepextensions $i"
20229 avail_ext="$keepextensions"
20233 : Now see which nonxs extensions are supported on this system.
20234 : For now assume all are.
20236 for xxx in $nonxs_extensions ; do
20238 *) nonxs_ext="$nonxs_ext $xxx"
20250 A number of extensions are supplied with $package. You may choose to
20251 compile these extensions for dynamic loading (the default), compile
20252 them into the $package executable (static loading), or not include
20253 them at all. Answer "none" to include no extensions.
20254 Note that DynaLoader is always built and need not be mentioned here.
20257 case "$dynamic_ext" in
20259 : Exclude those listed in static_ext
20261 for xxx in $avail_ext; do
20262 case " $static_ext " in
20264 *) dflt="$dflt $xxx" ;;
20271 *) dflt="$dynamic_ext"
20272 # Perhaps we are reusing an old out-of-date config.sh.
20275 if test X"$dynamic_ext" != X"$avail_ext"; then
20277 NOTICE: Your previous config.sh list may be incorrect.
20278 The extensions now available to you are
20280 but the default list from your previous config.sh is
20292 rp="What extensions do you wish to load dynamically?"
20295 none) dynamic_ext=' ' ;;
20296 *) dynamic_ext="$ans" ;;
20299 case "$static_ext" in
20301 : Exclude those already listed in dynamic linking
20303 for xxx in $avail_ext; do
20304 case " $dynamic_ext " in
20306 *) dflt="$dflt $xxx" ;;
20313 *) dflt="$static_ext"
20320 rp="What extensions do you wish to load statically?"
20323 none) static_ext=' ' ;;
20324 *) static_ext="$ans" ;;
20329 A number of extensions are supplied with $package. Answer "none"
20330 to include no extensions.
20331 Note that DynaLoader is always built and need not be mentioned here.
20334 case "$static_ext" in
20335 '') dflt="$avail_ext" ;;
20336 *) dflt="$static_ext"
20337 # Perhaps we are reusing an old out-of-date config.sh.
20340 if test X"$static_ext" != X"$avail_ext"; then
20342 NOTICE: Your previous config.sh list may be incorrect.
20343 The extensions now available to you are
20345 but the default list from your previous config.sh is
20354 : Exclude those that are not xs extensions
20358 rp="What extensions do you wish to include?"
20361 none) static_ext=' ' ;;
20362 *) static_ext="$ans" ;;
20367 # Encode is a special case. If we are building Encode as a static
20368 # extension, we need to explicitly list its subextensions as well.
20369 # For other nested extensions, this is handled automatically by
20370 # the appropriate Makefile.PL.
20371 case " $static_ext " in
20372 *" Encode "*) # Add the subextensions of Encode
20374 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20375 static_ext="$static_ext Encode/$xxx"
20381 set X $dynamic_ext $static_ext $nonxs_ext
20385 # Sanity check: We require an extension suitable for use with
20386 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
20387 # should show up as failures in the test suite, but it's helpful to
20388 # catch them now.) The 'extensions' list is normally sorted
20389 # alphabetically, so we need to accept either
20390 # DB_File ... Fcntl ... IO ....
20391 # or something like
20392 # Fcntl ... NDBM_File ... IO ....
20393 case " $extensions" in
20394 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
20395 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
20396 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
20397 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
20398 echo "WARNING: The Perl you are building will be quite crippled." >& 4
20402 : Remove libraries needed only for extensions
20403 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
20404 : The exception is SunOS 4.x, which needs them.
20405 case "${osname}X${osvers}" in
20409 *) case "$usedl" in
20410 $define|true|[yY]*)
20411 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
20415 *) perllibs="$libs"
20421 : Remove build directory name from cppstdin so it can be used from
20422 : either the present location or the final installed location.
20424 : Get out of the UU directory to get correct path name.
20426 case "$cppstdin" in
20428 echo "Stripping down cppstdin path name"
20434 : end of configuration questions
20436 echo "End of configuration questions."
20439 : back to where it started
20440 if test -d ../UU; then
20444 : configuration may be patched via a 'config.arch' file
20445 if $test -f config.arch; then
20446 echo "I see a config.arch file, loading it."
20450 : configuration may be patched via a 'config.over' file
20451 if $test -f config.over; then
20454 rp='I see a config.over file. Do you wish to load it?'
20457 n*) echo "OK, I'll ignore it.";;
20459 echo "Configuration override changes have been loaded."
20464 : in case they want portability, strip down executable paths
20465 case "$d_portable" in
20468 echo "Stripping down executable paths..." >&4
20469 for file in $loclist $trylist; do
20471 eval $file=`basename $temp`
20476 : create config.sh file
20478 echo "Creating config.sh..." >&4
20479 $spitshell <<EOT >config.sh
20482 # This file was produced by running the Configure script. It holds all the
20483 # definitions figured out by Configure. Should you modify one of these values,
20484 # do not forget to propagate your changes by running "Configure -der". You may
20485 # instead choose to run each of the .SH files by yourself, or "Configure -S".
20488 # Package name : $package
20489 # Source directory : $src
20490 # Configuration time: $cf_time
20491 # Configured by : $cf_by
20492 # Target system : $myuname
20502 Revision='$Revision'
20510 alignbytes='$alignbytes'
20511 ansi2knr='$ansi2knr'
20512 aphostname='$aphostname'
20513 api_revision='$api_revision'
20514 api_subversion='$api_subversion'
20515 api_version='$api_version'
20516 api_versionstring='$api_versionstring'
20519 archlibexp='$archlibexp'
20520 archname64='$archname64'
20521 archname='$archname'
20522 archobjs='$archobjs'
20523 asctime_r_proto='$asctime_r_proto'
20531 byteorder='$byteorder'
20533 castflags='$castflags'
20536 cccdlflags='$cccdlflags'
20537 ccdlflags='$ccdlflags'
20539 ccflags_uselargefiles='$ccflags_uselargefiles'
20541 ccsymbols='$ccsymbols'
20542 ccversion='$ccversion'
20544 cf_email='$cf_email'
20546 charsize='$charsize'
20550 clocktype='$clocktype'
20552 compress='$compress'
20553 contains='$contains'
20557 cpp_stuff='$cpp_stuff'
20558 cppccsymbols='$cppccsymbols'
20559 cppflags='$cppflags'
20561 cppminus='$cppminus'
20563 cppstdin='$cppstdin'
20564 cppsymbols='$cppsymbols'
20565 crypt_r_proto='$crypt_r_proto'
20566 cryptlib='$cryptlib'
20568 ctermid_r_proto='$ctermid_r_proto'
20569 ctime_r_proto='$ctime_r_proto'
20570 d_Gconvert='$d_Gconvert'
20571 d_PRIEUldbl='$d_PRIEUldbl'
20572 d_PRIFUldbl='$d_PRIFUldbl'
20573 d_PRIGUldbl='$d_PRIGUldbl'
20574 d_PRIXU64='$d_PRIXU64'
20575 d_PRId64='$d_PRId64'
20576 d_PRIeldbl='$d_PRIeldbl'
20577 d_PRIfldbl='$d_PRIfldbl'
20578 d_PRIgldbl='$d_PRIgldbl'
20579 d_PRIi64='$d_PRIi64'
20580 d_PRIo64='$d_PRIo64'
20581 d_PRIu64='$d_PRIu64'
20582 d_PRIx64='$d_PRIx64'
20583 d_SCNfldbl='$d_SCNfldbl'
20584 d__fwalk='$d__fwalk'
20585 d_access='$d_access'
20586 d_accessx='$d_accessx'
20589 d_archlib='$d_archlib'
20590 d_asctime_r='$d_asctime_r'
20593 d_attribut='$d_attribut'
20597 d_bsdgetpgrp='$d_bsdgetpgrp'
20598 d_bsdsetpgrp='$d_bsdsetpgrp'
20600 d_casti32='$d_casti32'
20601 d_castneg='$d_castneg'
20602 d_charvspr='$d_charvspr'
20604 d_chroot='$d_chroot'
20605 d_chsize='$d_chsize'
20607 d_closedir='$d_closedir'
20608 d_cmsghdr_s='$d_cmsghdr_s'
20610 d_copysignl='$d_copysignl'
20612 d_crypt_r='$d_crypt_r'
20614 d_ctermid_r='$d_ctermid_r'
20615 d_ctime_r='$d_ctime_r'
20616 d_cuserid='$d_cuserid'
20617 d_dbl_dig='$d_dbl_dig'
20618 d_dbminitproto='$d_dbminitproto'
20619 d_difftime='$d_difftime'
20621 d_dirnamlen='$d_dirnamlen'
20622 d_dlerror='$d_dlerror'
20623 d_dlopen='$d_dlopen'
20624 d_dlsymun='$d_dlsymun'
20625 d_dosuid='$d_dosuid'
20626 d_drand48_r='$d_drand48_r'
20627 d_drand48proto='$d_drand48proto'
20629 d_eaccess='$d_eaccess'
20630 d_endgrent='$d_endgrent'
20631 d_endgrent_r='$d_endgrent_r'
20632 d_endhent='$d_endhent'
20633 d_endhostent_r='$d_endhostent_r'
20634 d_endnent='$d_endnent'
20635 d_endnetent_r='$d_endnetent_r'
20636 d_endpent='$d_endpent'
20637 d_endprotoent_r='$d_endprotoent_r'
20638 d_endpwent='$d_endpwent'
20639 d_endpwent_r='$d_endpwent_r'
20640 d_endsent='$d_endsent'
20641 d_endservent_r='$d_endservent_r'
20642 d_eofnblk='$d_eofnblk'
20643 d_eunice='$d_eunice'
20644 d_faststdio='$d_faststdio'
20645 d_fchdir='$d_fchdir'
20646 d_fchmod='$d_fchmod'
20647 d_fchown='$d_fchown'
20649 d_fcntl_can_lock='$d_fcntl_can_lock'
20650 d_fd_macros='$d_fd_macros'
20651 d_fd_set='$d_fd_set'
20652 d_fds_bits='$d_fds_bits'
20653 d_fgetpos='$d_fgetpos'
20654 d_finite='$d_finite'
20655 d_finitel='$d_finitel'
20656 d_flexfnam='$d_flexfnam'
20658 d_flockproto='$d_flockproto'
20660 d_fp_class='$d_fp_class'
20661 d_fpathconf='$d_fpathconf'
20662 d_fpclass='$d_fpclass'
20663 d_fpclassify='$d_fpclassify'
20664 d_fpclassl='$d_fpclassl'
20665 d_fpos64_t='$d_fpos64_t'
20666 d_frexpl='$d_frexpl'
20667 d_fs_data_s='$d_fs_data_s'
20668 d_fseeko='$d_fseeko'
20669 d_fsetpos='$d_fsetpos'
20670 d_fstatfs='$d_fstatfs'
20671 d_fstatvfs='$d_fstatvfs'
20673 d_ftello='$d_ftello'
20675 d_getcwd='$d_getcwd'
20676 d_getespwnam='$d_getespwnam'
20677 d_getfsstat='$d_getfsstat'
20678 d_getgrent='$d_getgrent'
20679 d_getgrent_r='$d_getgrent_r'
20680 d_getgrgid_r='$d_getgrgid_r'
20681 d_getgrnam_r='$d_getgrnam_r'
20682 d_getgrps='$d_getgrps'
20683 d_gethbyaddr='$d_gethbyaddr'
20684 d_gethbyname='$d_gethbyname'
20685 d_gethent='$d_gethent'
20686 d_gethname='$d_gethname'
20687 d_gethostbyaddr_r='$d_gethostbyaddr_r'
20688 d_gethostbyname_r='$d_gethostbyname_r'
20689 d_gethostent_r='$d_gethostent_r'
20690 d_gethostprotos='$d_gethostprotos'
20691 d_getitimer='$d_getitimer'
20692 d_getlogin='$d_getlogin'
20693 d_getlogin_r='$d_getlogin_r'
20694 d_getmnt='$d_getmnt'
20695 d_getmntent='$d_getmntent'
20696 d_getnbyaddr='$d_getnbyaddr'
20697 d_getnbyname='$d_getnbyname'
20698 d_getnent='$d_getnent'
20699 d_getnetbyaddr_r='$d_getnetbyaddr_r'
20700 d_getnetbyname_r='$d_getnetbyname_r'
20701 d_getnetent_r='$d_getnetent_r'
20702 d_getnetprotos='$d_getnetprotos'
20703 d_getpagsz='$d_getpagsz'
20704 d_getpbyname='$d_getpbyname'
20705 d_getpbynumber='$d_getpbynumber'
20706 d_getpent='$d_getpent'
20707 d_getpgid='$d_getpgid'
20708 d_getpgrp2='$d_getpgrp2'
20709 d_getpgrp='$d_getpgrp'
20710 d_getppid='$d_getppid'
20711 d_getprior='$d_getprior'
20712 d_getprotobyname_r='$d_getprotobyname_r'
20713 d_getprotobynumber_r='$d_getprotobynumber_r'
20714 d_getprotoent_r='$d_getprotoent_r'
20715 d_getprotoprotos='$d_getprotoprotos'
20716 d_getprpwnam='$d_getprpwnam'
20717 d_getpwent='$d_getpwent'
20718 d_getpwent_r='$d_getpwent_r'
20719 d_getpwnam_r='$d_getpwnam_r'
20720 d_getpwuid_r='$d_getpwuid_r'
20721 d_getsbyname='$d_getsbyname'
20722 d_getsbyport='$d_getsbyport'
20723 d_getsent='$d_getsent'
20724 d_getservbyname_r='$d_getservbyname_r'
20725 d_getservbyport_r='$d_getservbyport_r'
20726 d_getservent_r='$d_getservent_r'
20727 d_getservprotos='$d_getservprotos'
20728 d_getspnam='$d_getspnam'
20729 d_getspnam_r='$d_getspnam_r'
20730 d_gettimeod='$d_gettimeod'
20731 d_gmtime_r='$d_gmtime_r'
20732 d_gnulibc='$d_gnulibc'
20733 d_grpasswd='$d_grpasswd'
20734 d_hasmntopt='$d_hasmntopt'
20736 d_ilogbl='$d_ilogbl'
20738 d_inetaton='$d_inetaton'
20739 d_int64_t='$d_int64_t'
20740 d_isascii='$d_isascii'
20741 d_isfinite='$d_isfinite'
20744 d_isnanl='$d_isnanl'
20745 d_killpg='$d_killpg'
20746 d_lchown='$d_lchown'
20747 d_ldbl_dig='$d_ldbl_dig'
20749 d_localtime_r='$d_localtime_r'
20750 d_locconv='$d_locconv'
20752 d_longdbl='$d_longdbl'
20753 d_longlong='$d_longlong'
20754 d_lseekproto='$d_lseekproto'
20756 d_madvise='$d_madvise'
20758 d_mbstowcs='$d_mbstowcs'
20759 d_mbtowc='$d_mbtowc'
20760 d_memchr='$d_memchr'
20761 d_memcmp='$d_memcmp'
20762 d_memcpy='$d_memcpy'
20763 d_memmove='$d_memmove'
20764 d_memset='$d_memset'
20766 d_mkdtemp='$d_mkdtemp'
20767 d_mkfifo='$d_mkfifo'
20768 d_mkstemp='$d_mkstemp'
20769 d_mkstemps='$d_mkstemps'
20770 d_mktime='$d_mktime'
20773 d_modfl_pow32_bug='$d_modfl_pow32_bug'
20774 d_modflproto='$d_modflproto'
20775 d_mprotect='$d_mprotect'
20777 d_msg_ctrunc='$d_msg_ctrunc'
20778 d_msg_dontroute='$d_msg_dontroute'
20779 d_msg_oob='$d_msg_oob'
20780 d_msg_peek='$d_msg_peek'
20781 d_msg_proxy='$d_msg_proxy'
20782 d_msgctl='$d_msgctl'
20783 d_msgget='$d_msgget'
20784 d_msghdr_s='$d_msghdr_s'
20785 d_msgrcv='$d_msgrcv'
20786 d_msgsnd='$d_msgsnd'
20788 d_munmap='$d_munmap'
20789 d_mymalloc='$d_mymalloc'
20791 d_nl_langinfo='$d_nl_langinfo'
20792 d_nv_preserves_uv='$d_nv_preserves_uv'
20793 d_off64_t='$d_off64_t'
20794 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
20795 d_oldpthreads='$d_oldpthreads'
20796 d_oldsock='$d_oldsock'
20798 d_pathconf='$d_pathconf'
20800 d_perl_otherlibdirs='$d_perl_otherlibdirs'
20801 d_phostname='$d_phostname'
20804 d_portable='$d_portable'
20805 d_procselfexe='$d_procselfexe'
20806 d_pthread_atfork='$d_pthread_atfork'
20807 d_pthread_attr_setscope='$d_pthread_attr_setscope'
20808 d_pthread_yield='$d_pthread_yield'
20810 d_pwchange='$d_pwchange'
20811 d_pwclass='$d_pwclass'
20812 d_pwcomment='$d_pwcomment'
20813 d_pwexpire='$d_pwexpire'
20814 d_pwgecos='$d_pwgecos'
20815 d_pwpasswd='$d_pwpasswd'
20816 d_pwquota='$d_pwquota'
20819 d_random_r='$d_random_r'
20820 d_readdir64_r='$d_readdir64_r'
20821 d_readdir='$d_readdir'
20822 d_readdir_r='$d_readdir_r'
20823 d_readlink='$d_readlink'
20825 d_recvmsg='$d_recvmsg'
20826 d_rename='$d_rename'
20827 d_rewinddir='$d_rewinddir'
20829 d_safebcpy='$d_safebcpy'
20830 d_safemcpy='$d_safemcpy'
20831 d_sanemcmp='$d_sanemcmp'
20832 d_sbrkproto='$d_sbrkproto'
20833 d_scalbnl='$d_scalbnl'
20834 d_sched_yield='$d_sched_yield'
20835 d_scm_rights='$d_scm_rights'
20836 d_seekdir='$d_seekdir'
20837 d_select='$d_select'
20839 d_semctl='$d_semctl'
20840 d_semctl_semid_ds='$d_semctl_semid_ds'
20841 d_semctl_semun='$d_semctl_semun'
20842 d_semget='$d_semget'
20844 d_sendmsg='$d_sendmsg'
20845 d_setegid='$d_setegid'
20846 d_seteuid='$d_seteuid'
20847 d_setgrent='$d_setgrent'
20848 d_setgrent_r='$d_setgrent_r'
20849 d_setgrps='$d_setgrps'
20850 d_sethent='$d_sethent'
20851 d_sethostent_r='$d_sethostent_r'
20852 d_setitimer='$d_setitimer'
20853 d_setlinebuf='$d_setlinebuf'
20854 d_setlocale='$d_setlocale'
20855 d_setlocale_r='$d_setlocale_r'
20856 d_setnent='$d_setnent'
20857 d_setnetent_r='$d_setnetent_r'
20858 d_setpent='$d_setpent'
20859 d_setpgid='$d_setpgid'
20860 d_setpgrp2='$d_setpgrp2'
20861 d_setpgrp='$d_setpgrp'
20862 d_setprior='$d_setprior'
20863 d_setproctitle='$d_setproctitle'
20864 d_setprotoent_r='$d_setprotoent_r'
20865 d_setpwent='$d_setpwent'
20866 d_setpwent_r='$d_setpwent_r'
20867 d_setregid='$d_setregid'
20868 d_setresgid='$d_setresgid'
20869 d_setresuid='$d_setresuid'
20870 d_setreuid='$d_setreuid'
20871 d_setrgid='$d_setrgid'
20872 d_setruid='$d_setruid'
20873 d_setsent='$d_setsent'
20874 d_setservent_r='$d_setservent_r'
20875 d_setsid='$d_setsid'
20876 d_setvbuf='$d_setvbuf'
20880 d_shmatprototype='$d_shmatprototype'
20881 d_shmctl='$d_shmctl'
20883 d_shmget='$d_shmget'
20884 d_sigaction='$d_sigaction'
20885 d_sigprocmask='$d_sigprocmask'
20886 d_sigsetjmp='$d_sigsetjmp'
20887 d_sitecustomize='$d_sitecustomize'
20888 d_sockatmark='$d_sockatmark'
20889 d_sockatmarkproto='$d_sockatmarkproto'
20890 d_socket='$d_socket'
20891 d_socklen_t='$d_socklen_t'
20892 d_sockpair='$d_sockpair'
20893 d_socks5_init='$d_socks5_init'
20895 d_srand48_r='$d_srand48_r'
20896 d_srandom_r='$d_srandom_r'
20897 d_sresgproto='$d_sresgproto'
20898 d_sresuproto='$d_sresuproto'
20899 d_statblks='$d_statblks'
20900 d_statfs_f_flags='$d_statfs_f_flags'
20901 d_statfs_s='$d_statfs_s'
20902 d_statvfs='$d_statvfs'
20903 d_stdio_cnt_lval='$d_stdio_cnt_lval'
20904 d_stdio_ptr_lval='$d_stdio_ptr_lval'
20905 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
20906 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
20907 d_stdio_stream_array='$d_stdio_stream_array'
20908 d_stdiobase='$d_stdiobase'
20909 d_stdstdio='$d_stdstdio'
20910 d_strchr='$d_strchr'
20911 d_strcoll='$d_strcoll'
20912 d_strctcpy='$d_strctcpy'
20913 d_strerrm='$d_strerrm'
20914 d_strerror='$d_strerror'
20915 d_strerror_r='$d_strerror_r'
20916 d_strftime='$d_strftime'
20917 d_strlcat='$d_strlcat'
20918 d_strlcpy='$d_strlcpy'
20919 d_strtod='$d_strtod'
20920 d_strtol='$d_strtol'
20921 d_strtold='$d_strtold'
20922 d_strtoll='$d_strtoll'
20923 d_strtoq='$d_strtoq'
20924 d_strtoul='$d_strtoul'
20925 d_strtoull='$d_strtoull'
20926 d_strtouq='$d_strtouq'
20927 d_strxfrm='$d_strxfrm'
20928 d_suidsafe='$d_suidsafe'
20929 d_symlink='$d_symlink'
20930 d_syscall='$d_syscall'
20931 d_syscallproto='$d_syscallproto'
20932 d_sysconf='$d_sysconf'
20933 d_sysernlst='$d_sysernlst'
20934 d_syserrlst='$d_syserrlst'
20935 d_system='$d_system'
20936 d_tcgetpgrp='$d_tcgetpgrp'
20937 d_tcsetpgrp='$d_tcsetpgrp'
20938 d_telldir='$d_telldir'
20939 d_telldirproto='$d_telldirproto'
20942 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
20943 d_tm_tm_zone='$d_tm_tm_zone'
20944 d_tmpnam_r='$d_tmpnam_r'
20945 d_truncate='$d_truncate'
20946 d_ttyname_r='$d_ttyname_r'
20947 d_tzname='$d_tzname'
20948 d_u32align='$d_u32align'
20949 d_ualarm='$d_ualarm'
20952 d_union_semun='$d_union_semun'
20953 d_unordered='$d_unordered'
20954 d_usleep='$d_usleep'
20955 d_usleepproto='$d_usleepproto'
20957 d_vendorarch='$d_vendorarch'
20958 d_vendorbin='$d_vendorbin'
20959 d_vendorlib='$d_vendorlib'
20960 d_vendorscript='$d_vendorscript'
20962 d_void_closedir='$d_void_closedir'
20963 d_voidsig='$d_voidsig'
20964 d_voidtty='$d_voidtty'
20965 d_volatile='$d_volatile'
20966 d_vprintf='$d_vprintf'
20968 d_waitpid='$d_waitpid'
20969 d_wcstombs='$d_wcstombs'
20970 d_wctomb='$d_wctomb'
20971 d_writev='$d_writev'
20974 db_hashtype='$db_hashtype'
20975 db_prefixtype='$db_prefixtype'
20976 db_version_major='$db_version_major'
20977 db_version_minor='$db_version_minor'
20978 db_version_patch='$db_version_patch'
20979 defvoidused='$defvoidused'
20980 direntrytype='$direntrytype'
20983 doublesize='$doublesize'
20985 drand48_r_proto='$drand48_r_proto'
20986 dynamic_ext='$dynamic_ext'
20992 endgrent_r_proto='$endgrent_r_proto'
20993 endhostent_r_proto='$endhostent_r_proto'
20994 endnetent_r_proto='$endnetent_r_proto'
20995 endprotoent_r_proto='$endprotoent_r_proto'
20996 endpwent_r_proto='$endpwent_r_proto'
20997 endservent_r_proto='$endservent_r_proto'
20998 eunicefix='$eunicefix'
21001 extensions='$extensions'
21003 fflushNULL='$fflushNULL'
21004 fflushall='$fflushall'
21006 firstmakefile='$firstmakefile'
21008 fpossize='$fpossize'
21009 fpostype='$fpostype'
21010 freetype='$freetype'
21013 full_csh='$full_csh'
21014 full_sed='$full_sed'
21015 gccansipedantic='$gccansipedantic'
21016 gccosandvers='$gccosandvers'
21017 gccversion='$gccversion'
21018 getgrent_r_proto='$getgrent_r_proto'
21019 getgrgid_r_proto='$getgrgid_r_proto'
21020 getgrnam_r_proto='$getgrnam_r_proto'
21021 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
21022 gethostbyname_r_proto='$gethostbyname_r_proto'
21023 gethostent_r_proto='$gethostent_r_proto'
21024 getlogin_r_proto='$getlogin_r_proto'
21025 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21026 getnetbyname_r_proto='$getnetbyname_r_proto'
21027 getnetent_r_proto='$getnetent_r_proto'
21028 getprotobyname_r_proto='$getprotobyname_r_proto'
21029 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21030 getprotoent_r_proto='$getprotoent_r_proto'
21031 getpwent_r_proto='$getpwent_r_proto'
21032 getpwnam_r_proto='$getpwnam_r_proto'
21033 getpwuid_r_proto='$getpwuid_r_proto'
21034 getservbyname_r_proto='$getservbyname_r_proto'
21035 getservbyport_r_proto='$getservbyport_r_proto'
21036 getservent_r_proto='$getservent_r_proto'
21037 getspnam_r_proto='$getspnam_r_proto'
21038 gidformat='$gidformat'
21044 gmtime_r_proto='$gmtime_r_proto'
21045 gnulibc_version='$gnulibc_version'
21047 groupcat='$groupcat'
21048 groupstype='$groupstype'
21051 h_sysfile='$h_sysfile'
21054 html1dir='$html1dir'
21055 html1direxp='$html1direxp'
21056 html3dir='$html3dir'
21057 html3direxp='$html3direxp'
21066 i_arpainet='$i_arpainet'
21067 i_bsdioctl='$i_bsdioctl'
21071 i_dirent='$i_dirent'
21077 i_fp_class='$i_fp_class'
21080 i_ieeefp='$i_ieeefp'
21081 i_inttypes='$i_inttypes'
21082 i_langinfo='$i_langinfo'
21083 i_libutil='$i_libutil'
21084 i_limits='$i_limits'
21085 i_locale='$i_locale'
21086 i_machcthr='$i_machcthr'
21087 i_malloc='$i_malloc'
21089 i_memory='$i_memory'
21090 i_mntent='$i_mntent'
21093 i_neterrno='$i_neterrno'
21094 i_netinettcp='$i_netinettcp'
21098 i_pthread='$i_pthread'
21100 i_rpcsvcdbm='$i_rpcsvcdbm'
21103 i_shadow='$i_shadow'
21105 i_stdarg='$i_stdarg'
21106 i_stddef='$i_stddef'
21107 i_stdlib='$i_stdlib'
21108 i_string='$i_string'
21109 i_sunmath='$i_sunmath'
21110 i_sysaccess='$i_sysaccess'
21111 i_sysdir='$i_sysdir'
21112 i_sysfile='$i_sysfile'
21113 i_sysfilio='$i_sysfilio'
21115 i_sysioctl='$i_sysioctl'
21116 i_syslog='$i_syslog'
21117 i_sysmman='$i_sysmman'
21118 i_sysmode='$i_sysmode'
21119 i_sysmount='$i_sysmount'
21120 i_sysndir='$i_sysndir'
21121 i_sysparam='$i_sysparam'
21122 i_sysresrc='$i_sysresrc'
21123 i_syssecrt='$i_syssecrt'
21124 i_sysselct='$i_sysselct'
21125 i_syssockio='$i_syssockio'
21126 i_sysstat='$i_sysstat'
21127 i_sysstatfs='$i_sysstatfs'
21128 i_sysstatvfs='$i_sysstatvfs'
21129 i_systime='$i_systime'
21130 i_systimek='$i_systimek'
21131 i_systimes='$i_systimes'
21132 i_systypes='$i_systypes'
21133 i_sysuio='$i_sysuio'
21135 i_sysutsname='$i_sysutsname'
21136 i_sysvfs='$i_sysvfs'
21137 i_syswait='$i_syswait'
21138 i_termio='$i_termio'
21139 i_termios='$i_termios'
21141 i_unistd='$i_unistd'
21144 i_values='$i_values'
21145 i_varargs='$i_varargs'
21146 i_varhdr='$i_varhdr'
21148 ignore_versioned_solibs='$ignore_versioned_solibs'
21149 inc_version_list='$inc_version_list'
21150 inc_version_list_init='$inc_version_list_init'
21153 installarchlib='$installarchlib'
21154 installbin='$installbin'
21155 installhtml1dir='$installhtml1dir'
21156 installhtml3dir='$installhtml3dir'
21157 installman1dir='$installman1dir'
21158 installman3dir='$installman3dir'
21159 installprefix='$installprefix'
21160 installprefixexp='$installprefixexp'
21161 installprivlib='$installprivlib'
21162 installscript='$installscript'
21163 installsitearch='$installsitearch'
21164 installsitebin='$installsitebin'
21165 installsitehtml1dir='$installsitehtml1dir'
21166 installsitehtml3dir='$installsitehtml3dir'
21167 installsitelib='$installsitelib'
21168 installsiteman1dir='$installsiteman1dir'
21169 installsiteman3dir='$installsiteman3dir'
21170 installsitescript='$installsitescript'
21171 installstyle='$installstyle'
21172 installusrbinperl='$installusrbinperl'
21173 installvendorarch='$installvendorarch'
21174 installvendorbin='$installvendorbin'
21175 installvendorhtml1dir='$installvendorhtml1dir'
21176 installvendorhtml3dir='$installvendorhtml3dir'
21177 installvendorlib='$installvendorlib'
21178 installvendorman1dir='$installvendorman1dir'
21179 installvendorman3dir='$installvendorman3dir'
21180 installvendorscript='$installvendorscript'
21182 issymlink='$issymlink'
21183 ivdformat='$ivdformat'
21186 known_extensions='$known_extensions'
21189 lddlflags='$lddlflags'
21191 ldflags_uselargefiles='$ldflags_uselargefiles'
21192 ldlibpthname='$ldlibpthname'
21199 libsdirs='$libsdirs'
21200 libsfiles='$libsfiles'
21201 libsfound='$libsfound'
21202 libspath='$libspath'
21203 libswanted='$libswanted'
21204 libswanted_uselargefiles='$libswanted_uselargefiles'
21210 localtime_r_proto='$localtime_r_proto'
21211 locincpth='$locincpth'
21212 loclibpth='$loclibpth'
21213 longdblsize='$longdblsize'
21214 longlongsize='$longlongsize'
21215 longsize='$longsize'
21219 lseeksize='$lseeksize'
21220 lseektype='$lseektype'
21224 make_set_make='$make_set_make'
21225 mallocobj='$mallocobj'
21226 mallocsrc='$mallocsrc'
21227 malloctype='$malloctype'
21229 man1direxp='$man1direxp'
21232 man3direxp='$man3direxp'
21234 mips_type='$mips_type'
21235 mistrustnm='$mistrustnm'
21237 mmaptype='$mmaptype'
21238 modetype='$modetype'
21240 multiarch='$multiarch'
21242 myarchname='$myarchname'
21243 mydomain='$mydomain'
21244 myhostname='$myhostname'
21247 need_va_copy='$need_va_copy'
21248 netdb_hlen_type='$netdb_hlen_type'
21249 netdb_host_type='$netdb_host_type'
21250 netdb_name_type='$netdb_name_type'
21251 netdb_net_type='$netdb_net_type'
21254 nm_so_opt='$nm_so_opt'
21255 nonxs_ext='$nonxs_ext'
21257 nvEUformat='$nvEUformat'
21258 nvFUformat='$nvFUformat'
21259 nvGUformat='$nvGUformat'
21260 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21261 nveformat='$nveformat'
21262 nvfformat='$nvfformat'
21263 nvgformat='$nvgformat'
21266 o_nonblock='$o_nonblock'
21268 old_pthread_create_joinable='$old_pthread_create_joinable'
21269 optimize='$optimize'
21270 orderlib='$orderlib'
21273 otherlibdirs='$otherlibdirs'
21277 patchlevel='$patchlevel'
21278 path_sep='$path_sep'
21281 perl_patchlevel='$perl_patchlevel'
21282 perladmin='$perladmin'
21283 perllibs='$perllibs'
21284 perlpath='$perlpath'
21286 phostname='$phostname'
21292 prefixexp='$prefixexp'
21294 privlibexp='$privlibexp'
21295 procselfexe='$procselfexe'
21296 prototype='$prototype'
21298 quadkind='$quadkind'
21299 quadtype='$quadtype'
21300 randbits='$randbits'
21301 randfunc='$randfunc'
21302 random_r_proto='$random_r_proto'
21303 randseedtype='$randseedtype'
21305 rd_nodata='$rd_nodata'
21306 readdir64_r_proto='$readdir64_r_proto'
21307 readdir_r_proto='$readdir_r_proto'
21308 revision='$revision'
21313 sPRIEUldbl='$sPRIEUldbl'
21314 sPRIFUldbl='$sPRIFUldbl'
21315 sPRIGUldbl='$sPRIGUldbl'
21316 sPRIXU64='$sPRIXU64'
21318 sPRIeldbl='$sPRIeldbl'
21319 sPRIfldbl='$sPRIfldbl'
21320 sPRIgldbl='$sPRIgldbl'
21325 sSCNfldbl='$sSCNfldbl'
21326 sched_yield='$sched_yield'
21327 scriptdir='$scriptdir'
21328 scriptdirexp='$scriptdirexp'
21330 seedfunc='$seedfunc'
21331 selectminbits='$selectminbits'
21332 selecttype='$selecttype'
21333 sendmail='$sendmail'
21334 setgrent_r_proto='$setgrent_r_proto'
21335 sethostent_r_proto='$sethostent_r_proto'
21336 setlocale_r_proto='$setlocale_r_proto'
21337 setnetent_r_proto='$setnetent_r_proto'
21338 setprotoent_r_proto='$setprotoent_r_proto'
21339 setpwent_r_proto='$setpwent_r_proto'
21340 setservent_r_proto='$setservent_r_proto'
21343 sharpbang='$sharpbang'
21344 shmattype='$shmattype'
21345 shortsize='$shortsize'
21348 sig_count='$sig_count'
21349 sig_name='$sig_name'
21350 sig_name_init='$sig_name_init'
21352 sig_num_init='$sig_num_init'
21353 sig_size='$sig_size'
21354 signal_t='$signal_t'
21355 sitearch='$sitearch'
21356 sitearchexp='$sitearchexp'
21358 sitebinexp='$sitebinexp'
21359 sitehtml1dir='$sitehtml1dir'
21360 sitehtml1direxp='$sitehtml1direxp'
21361 sitehtml3dir='$sitehtml3dir'
21362 sitehtml3direxp='$sitehtml3direxp'
21364 sitelib_stem='$sitelib_stem'
21365 sitelibexp='$sitelibexp'
21366 siteman1dir='$siteman1dir'
21367 siteman1direxp='$siteman1direxp'
21368 siteman3dir='$siteman3dir'
21369 siteman3direxp='$siteman3direxp'
21370 siteprefix='$siteprefix'
21371 siteprefixexp='$siteprefixexp'
21372 sitescript='$sitescript'
21373 sitescriptexp='$sitescriptexp'
21374 sizesize='$sizesize'
21375 sizetype='$sizetype'
21379 sockethdr='$sockethdr'
21380 socketlib='$socketlib'
21381 socksizetype='$socksizetype'
21383 spackage='$spackage'
21384 spitshell='$spitshell'
21385 srand48_r_proto='$srand48_r_proto'
21386 srandom_r_proto='$srandom_r_proto'
21388 ssizetype='$ssizetype'
21389 startperl='$startperl'
21391 static_ext='$static_ext'
21393 stdio_base='$stdio_base'
21394 stdio_bufsiz='$stdio_bufsiz'
21395 stdio_cnt='$stdio_cnt'
21396 stdio_filbuf='$stdio_filbuf'
21397 stdio_ptr='$stdio_ptr'
21398 stdio_stream_array='$stdio_stream_array'
21399 strerror_r_proto='$strerror_r_proto'
21402 subversion='$subversion'
21406 targetarch='$targetarch'
21410 timeincl='$timeincl'
21411 timetype='$timetype'
21412 tmpnam_r_proto='$tmpnam_r_proto'
21418 ttyname_r_proto='$ttyname_r_proto'
21427 uidformat='$uidformat'
21433 uquadtype='$uquadtype'
21434 use5005threads='$use5005threads'
21435 use64bitall='$use64bitall'
21436 use64bitint='$use64bitint'
21437 usecrosscompile='$usecrosscompile'
21439 usefaststdio='$usefaststdio'
21440 useithreads='$useithreads'
21441 uselargefiles='$uselargefiles'
21442 uselongdouble='$uselongdouble'
21443 usemallocwrap='$usemallocwrap'
21444 usemorebits='$usemorebits'
21445 usemultiplicity='$usemultiplicity'
21446 usemymalloc='$usemymalloc'
21448 useopcode='$useopcode'
21449 useperlio='$useperlio'
21450 useposix='$useposix'
21451 usereentrant='$usereentrant'
21452 userelocatableinc='$userelocatableinc'
21454 useshrplib='$useshrplib'
21455 usesitecustomize='$usesitecustomize'
21456 usesocks='$usesocks'
21457 usethreads='$usethreads'
21458 usevendorprefix='$usevendorprefix'
21459 usevfork='$usevfork'
21462 uvXUformat='$uvXUformat'
21463 uvoformat='$uvoformat'
21466 uvuformat='$uvuformat'
21467 uvxformat='$uvxformat'
21468 vendorarch='$vendorarch'
21469 vendorarchexp='$vendorarchexp'
21470 vendorbin='$vendorbin'
21471 vendorbinexp='$vendorbinexp'
21472 vendorhtml1dir='$vendorhtml1dir'
21473 vendorhtml1direxp='$vendorhtml1direxp'
21474 vendorhtml3dir='$vendorhtml3dir'
21475 vendorhtml3direxp='$vendorhtml3direxp'
21476 vendorlib='$vendorlib'
21477 vendorlib_stem='$vendorlib_stem'
21478 vendorlibexp='$vendorlibexp'
21479 vendorman1dir='$vendorman1dir'
21480 vendorman1direxp='$vendorman1direxp'
21481 vendorman3dir='$vendorman3dir'
21482 vendorman3direxp='$vendorman3direxp'
21483 vendorprefix='$vendorprefix'
21484 vendorprefixexp='$vendorprefixexp'
21485 vendorscript='$vendorscript'
21486 vendorscriptexp='$vendorscriptexp'
21488 version_patchlevel_string='$version_patchlevel_string'
21489 versiononly='$versiononly'
21491 voidflags='$voidflags'
21494 yaccflags='$yaccflags'
21499 : Add in command line options if available
21500 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21502 : add special variables
21503 $test -f $src/patchlevel.h && \
21504 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
21505 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
21506 echo "PERL_CONFIG_SH=true" >>config.sh
21508 : propagate old symbols
21509 if $test -f UU/config.sh; then
21510 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
21511 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
21512 $sort | $uniq -u >UU/oldsyms
21513 set X `cat UU/oldsyms`
21519 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
21521 echo "# Variables propagated from previous config.sh file." >>config.sh
21522 for sym in `cat UU/oldsyms`; do
21523 echo " Propagating $hint variable "'$'"$sym..."
21524 eval 'tmp="$'"${sym}"'"'
21526 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
21532 : Finish up by extracting the .SH files
21536 echo "Extraction done."
21546 If you'd like to make any changes to the config.sh file before I begin
21547 to configure things, do it as a shell escape now (e.g. !vi config.sh).
21550 rp="Press return or use a shell escape to edit config.sh:"
21555 *) : in case they cannot read
21556 sh 1>&4 -c "$ans";;
21561 : if this fails, just run all the .SH files by hand
21570 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
21577 Now you need to generate make dependencies by running "$make depend".
21578 You might prefer to run it in background: "$make depend > makedepend.out &"
21579 It can take a while, so you might not want to run it right now.
21584 rp="Run $make depend now?"
21588 $make depend && echo "Now you must run '$make'."
21591 echo "You must run '$make depend' then '$make'."
21594 elif test -f [Mm]akefile; then
21596 echo "Now you must run a $make."
21598 echo "Configure done."
21601 if $test -f Policy.sh; then
21604 If you compile $package on a different machine or from a different object
21605 directory, copy the Policy.sh file from this object directory to the
21606 new one before you run Configure -- this will help you with most of
21607 the policy defaults.
21611 if $test -f config.msg; then
21612 echo "Hmm. I also noted the following information while running:"
21614 $cat config.msg >&4
21617 $rm -f kit*isdone ark*isdone