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 Sat Oct 30 18:24:58 METDST 2004 [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=''
695 d_stdio_ptr_lval_nochange_cnt=''
696 d_stdio_ptr_lval_sets_cnt=''
899 inc_version_list_init=''
918 ignore_versioned_solibs=''
978 d_perl_otherlibdirs=''
992 version_patchlevel_string=''
1007 nv_preserves_uv_bits=''
1078 installsitehtml1dir=''
1081 installsitehtml3dir=''
1088 installsiteman1dir=''
1091 installsiteman3dir=''
1096 installsitescript=''
1111 d_stdio_stream_array=''
1112 stdio_stream_array=''
1123 ccflags_uselargefiles=''
1124 ldflags_uselargefiles=''
1125 libswanted_uselargefiles=''
1145 installvendorarch=''
1152 installvendorhtml1dir=''
1154 vendorhtml1direxp=''
1155 installvendorhtml3dir=''
1157 vendorhtml3direxp=''
1163 installvendorman1dir=''
1166 installvendorman3dir=''
1173 installvendorscript=''
1185 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1188 : We must find out about Eunice early
1190 if test -f /etc/unixtovms; then
1191 eunicefix=/etc/unixtovms
1193 if test -f /etc/unixtovms.exe; then
1194 eunicefix=/etc/unixtovms.exe
1197 : Set executable suffix now -- needed before hints available
1198 if test -f "/libs/version.library"; then
1201 elif test -f "/system/gnu_library/bin/ar.pm"; then
1204 elif test -n "$DJGPP"; then
1207 elif test -d c:/. -o -n "$is_os2" ; then
1216 : set useposix=false in your hint file to disable the POSIX extension.
1218 : set useopcode=false in your hint file to disable the Opcode extension.
1220 : Trailing extension. Override this in a hint file, if needed.
1221 : Extra object files, if any, needed on this platform.
1224 : Possible local include directories to search.
1225 : Set locincpth to "" in a hint file to defeat local include searches.
1226 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1227 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1229 : no include file wanted by default
1234 : change the next line if compiling for Xenix/286 on Xenix/386
1235 xlibpth='/usr/lib/386 /lib/386'
1236 : Possible local library directories to search.
1237 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1238 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1240 : general looking path for locating libraries
1241 glibpth="/lib /usr/lib $xlibpth"
1242 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1243 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1244 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1246 : Private path used by Configure to find libraries. Its value
1247 : is prepended to libpth. This variable takes care of special
1248 : machines, like the mips. Usually, it should be empty.
1251 : default library list
1253 : some systems want to use only the non-versioned libso:s
1254 ignore_versioned_solibs=''
1259 ccflags_uselargefiles=''
1260 ldflags_uselargefiles=''
1261 libswanted_uselargefiles=''
1262 : set usemultiplicity on the Configure command line to enable multiplicity.
1263 : set usesocks on the Configure command line to enable socks.
1264 : set usethreads on the Configure command line to enable threads.
1265 usereentrant='undef'
1266 : full support for void wanted by default
1269 : List of libraries we want.
1270 : If anyone needs extra -lxxx, put those in a hint file.
1271 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
1272 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
1273 : We probably want to search /usr/shlib before most other libraries.
1274 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1275 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1276 glibpth="/usr/shlib $glibpth"
1277 : Do not use vfork unless overridden by a hint file.
1280 : Find the basic shell for Bourne shell scripts
1284 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1287 if test -f "$xxx"; then
1290 : Build up a list and do a single loop so we can 'break' out.
1291 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1292 for xxx in sh bash ksh pdksh ash; do
1294 try="$try ${p}/${xxx}"
1298 if test -f "$xxx"; then
1301 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1304 elif test -f "$xxx.exe"; then
1315 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1317 Usually it's in /bin/sh. How did you even get this far?
1318 Please contact me (Perl Maintainers) at perlbug@perl.org and
1319 we'll try to straighten this all out.
1325 : see if sh knows # comments
1326 if `$sh -c '#' >/dev/null 2>&1`; then
1330 test -f $xcat$_exe || xcat=/usr/bin/cat
1331 if test ! -f $xcat$_exe; then
1332 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1333 if test -f $p/cat$_exe; then
1338 if test ! -f $xcat$_exe; then
1339 echo "Can't find cat anywhere!"
1343 echo "#!$xcat" >sharp
1347 if test -s today; then
1350 echo "#! $xcat" > sharp
1354 if test -s today; then
1362 echo "Your $sh doesn't grok # comments--I will strip them later on."
1365 echo "exec grep -v '^[ ]*#'" >spitshell
1367 $eunicefix spitshell
1368 spitshell=`pwd`/spitshell
1370 echo "I presume that if # doesn't work, #! won't work either!"
1375 : figure out how to guarantee sh startup
1377 '') startsh=${sharpbang}${sh} ;;
1389 : echo "Yup, it does."
1391 echo "Hmm... '$startsh' does not guarantee sh startup..."
1392 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1397 : Save command line options in file UU/cmdline.opt for later use in
1398 : generating config.sh.
1399 cat > cmdline.opt <<EOSH
1400 # Configure command line arguments.
1409 cat >>cmdline.opt <<EOSH
1410 config_arg$argn='$arg'
1412 # Extreme backslashitis: replace each ' by '"'"'
1413 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1416 arg_exp=`cat cmdl.opt`
1417 args_exp="$args_exp$args_sep'$arg_exp'"
1418 argn=`expr $argn + 1`
1421 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1422 # used by ./hints/os2.sh
1425 : produce awk script to parse command line options
1426 cat >options.awk <<'EOF'
1428 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1430 len = length(optstr);
1431 for (i = 1; i <= len; i++) {
1432 c = substr(optstr, i, 1);
1433 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1444 if (substr(str, 1, 1) != "-") {
1445 printf("'%s'\n", str);
1449 for (i = 2; i <= len; i++) {
1450 c = substr(str, i, 1);
1452 printf("-%s\n", substr(str, i));
1458 printf("'%s'\n", substr(str, i + 1));
1471 : process the command line options
1472 set X `for arg in "$@"; do echo "X$arg"; done |
1473 sed -e s/X// | awk -f options.awk`
1478 : set up default values
1488 rm -f optdef.sh posthint.sh
1489 cat >optdef.sh <<EOS
1495 while test $# -gt 0; do
1497 -d) shift; fastread=yes;;
1498 -e) shift; alldone=cont;;
1502 if test -r "$1"; then
1505 echo "$me: cannot read config file $1." >&2
1510 -h) shift; error=true;;
1511 -r) shift; reuseval=true;;
1512 -s) shift; silent=true; realsilent=true;;
1513 -E) shift; alldone=exit;;
1514 -K) shift; knowitall=true;;
1515 -O) shift; override=true;;
1516 -S) shift; silent=true; extractsh=true;;
1521 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1522 echo "$me: ignoring -D $1" >&2
1525 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1526 *) echo "$1='define'" >> optdef.sh;;
1533 *=) echo "$1" >> optdef.sh;;
1535 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1536 echo "$me: ignoring -U $1" >&2
1538 *) echo "$1='undef'" >> optdef.sh;;
1549 *=*) zzz=`echo "$yyy"|sed 's!=.*!!'`
1553 zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
1554 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1560 *:*) xxx=`echo "$yyy"|sed 's!:.*!!'`
1561 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'`
1562 zzz=`echo "$yyy"|sed 's!^[^=]*=!!'`
1563 yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
1564 *) xxx=`echo "$yyy"|sed 's!:.*!!'`
1565 yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
1571 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1573 echo "$yyy=''" >> posthint.sh ;;
1578 echo "$yyy='$zzz'" >> posthint.sh ;;
1580 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1582 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1587 echo "$yyy=$zzz" >> posthint.sh ;;
1588 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1592 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1595 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1603 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1604 [-U symbol] [-U symbol=] [-A command:symbol...]
1605 -d : use defaults for all answers.
1606 -e : go on without questioning past the production of config.sh.
1607 -f : specify an alternate default configuration file.
1608 -h : print this help message and exit (with an error status).
1609 -r : reuse C symbols value if possible (skips costly nm extraction).
1610 -s : silent mode, only echoes questions and essential information.
1611 -D : define symbol to have some value:
1612 -D symbol symbol gets the value 'define'
1613 -D symbol=value symbol gets the value 'value'
1614 -E : stop at the end of questions, after having produced config.sh.
1615 -K : do not use unless you know what you are doing.
1616 -O : let -D and -U override definitions from loaded configuration file.
1617 -S : perform variable substitutions on all .SH files (can mix with -f)
1618 -U : undefine symbol:
1619 -U symbol symbol gets the value 'undef'
1620 -U symbol= symbol gets completely empty
1621 -A : manipulate symbol after the platform specific hints have been applied:
1622 -A symbol=value append " "value to symbol
1623 -A append:symbol=value append value to symbol
1624 -A define:symbol=value define symbol to have value
1625 -A clear:symbol define symbol to be ''
1626 -A define:symbol define symbol to be 'define'
1627 -A eval:symbol=value define symbol to be eval of value
1628 -A prepend:symbol=value prepend value to symbol
1629 -A undef:symbol define symbol to be 'undef'
1630 -A undef:symbol= define symbol to be ''
1631 -V : print version number and exit (with a zero status).
1638 case "$fastread$alldone" in
1641 case "$extractsh" in
1644 if test ! -t 0; then
1645 echo "Say 'sh Configure', not 'sh <Configure'"
1655 true) exec 1>/dev/null;;
1658 : run the defines and the undefines, if any, but leave the file out there...
1661 : create the posthint manipulation script and leave the file out there...
1666 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1667 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1668 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1669 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1670 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1673 : Some greps do not return status, grrr.
1674 echo "grimblepritz" >grimble
1675 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1677 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1683 : the following should work in any shell
1687 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1688 cat >contains <<'EOSS'
1689 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1694 : Find the path to the source tree
1697 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1701 *) src=`cd ../$src && pwd` ;;
1714 if test -f $rsrc/Configure && \
1715 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1717 : found it, so we are ok.
1720 for src in . .. ../.. ../../.. ../../../..; do
1721 if test -f ../$src/Configure && \
1722 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1733 Sorry, I can't seem to locate the source dir for $package. Please start
1734 Configure with an explicit path -- i.e. /some/path/Configure.
1742 echo "Sources for $package found in \"$src\"." >&4
1746 : script used to extract .SH files with variable substitutions
1747 cat >extract <<'EOS'
1749 echo "Doing variable substitutions on .SH files..."
1750 if test -f MANIFEST; then
1751 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1753 echo "(Looking for .SH files under the source directory.)"
1754 set x `(cd "$src"; find . -name "*.SH" -print)`
1758 0) set x `(cd "$src"; echo *.SH)`; shift;;
1760 if test ! -f "$src/$1"; then
1766 while test $name; do
1767 if test ! -d "$name"; then
1768 create="$name $create";
1769 name=`echo $name | sed -e "s|^[^/]*$||"`;
1770 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1775 for file in $create; do
1784 dir=`expr X$file : 'X\(.*\)/'`
1785 file=`expr X$file : 'X.*/\(.*\)'`
1786 (cd "$dir" && . ./$file)
1796 dir=`expr X$file : 'X\(.*\)/'`
1797 file=`expr X$file : 'X.*/\(.*\)'`
1798 (set x $dir; shift; eval $mkdir_p)
1799 sh <"$src/$dir/$file"
1808 if test -f "$src/config_h.SH"; then
1809 if test ! -f config.h; then
1810 : oops, they left it out of MANIFEST, probably, so do it anyway.
1811 . "$src/config_h.SH"
1816 : extract files and exit if asked to do so
1817 case "$extractsh" in
1819 case "$realsilent" in
1823 case "$config_sh" in
1824 '') config_sh='config.sh';;
1827 echo "Fetching answers from $config_sh..."
1830 test "$override" && . ./optdef.sh
1834 echo "Extraction done."
1839 : Eunice requires " " instead of "", can you believe it
1842 echo "Beginning of configuration questions for $package."
1844 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1846 : first determine how to suppress newline on echo command
1848 echo "Checking echo to see how to suppress newlines..."
1849 (echo "hi there\c" ; echo " ") >.echotmp
1850 if $contains c .echotmp >/dev/null 2>&1 ; then
1861 echo $n "The star should be here-->$c"
1865 : Now test for existence of everything in MANIFEST
1867 if test -f "$rsrc/MANIFEST"; then
1868 echo "First let's make sure your kit is complete. Checking..." >&4
1869 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1872 for filelist in x??; do
1873 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1875 if test -s missing; then
1879 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1881 You have the option of continuing the configuration process, despite the
1882 distinct possibility that your kit is damaged, by typing 'y'es. If you
1883 do, don't blame me if something goes wrong. I advise you to type 'n'o
1884 and contact the author (perlbug@perl.org).
1887 echo $n "Continue? [n] $c" >&4
1891 echo "Continuing..." >&4
1895 echo "ABORTING..." >&4
1900 echo "Looks good..."
1903 echo "There is no MANIFEST file. I hope your kit is complete !"
1908 : Find the appropriate value for a newline for tr
1909 if test -n "$DJGPP"; then
1912 if test X"$trnl" = X; then
1913 case "`echo foo|tr '\n' x 2>/dev/null`" in
1917 if test X"$trnl" = X; then
1918 case "`echo foo|tr '\012' x 2>/dev/null`" in
1919 foox) trnl='\012' ;;
1922 if test X"$trnl" = X; then
1923 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1924 fooxy) trnl='\n\r' ;;
1927 if test X"$trnl" = X; then
1930 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1936 : compute the number of columns on the terminal for proper question formatting
1941 : set up the echo used in my read
1942 myecho="case \"\$xxxm\" in
1943 '') echo $n \"\$rp $c\" >&4;;
1945 '') echo $n \"[\$xxxm] $c\";;
1947 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1949 echo $n \"[\$xxxm] $c\" >&4
1951 echo $n \"\$rp [\$xxxm] $c\" >&4
1957 : now set up to do reads with possible shell escape and default assignment
1963 case "\$fastread" in
1964 yes) case "\$dflt" in
1967 case "\$silent-\$rp" in
1972 *) case "\$silent" in
1973 true) case "\$rp" in
1978 while expr "X\$ans" : "X!" >/dev/null; do
1982 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1990 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1999 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
2004 echo "(OK, I'll run with -d after this question.)" >&4
2007 echo "*** Sorry, \$1 not supported yet." >&4
2017 echo "*** Substitution done -- please confirm."
2019 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
2024 echo "*** Error -- try again."
2031 case "\$ans\$xxxm\$nostick" in
2043 : create .config dir to save info across Configure sessions
2044 test -d ../.config || mkdir ../.config
2045 cat >../.config/README <<EOF
2046 This directory created by Configure to save information that should
2047 persist across sessions for $package.
2049 You may safely delete it if you wish.
2052 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
2054 $define|true|[yY]*) ;;
2055 *) case "$xversion" in
2058 *** WHOA THERE!!! ***
2060 This is an UNSTABLE DEVELOPMENT release.
2061 The version of this $package distribution is $xversion, that is, odd,
2062 (as opposed to even) and that signifies a development release.
2063 If you want a maintenance release, you want an even-numbered version.
2065 Do ***NOT*** install this into production use.
2066 Data corruption and crashes are possible.
2068 It is most seriously suggested that you do not continue any further
2069 unless you want to help in developing and debugging Perl.
2071 If you *still* want to build perl, you can answer 'y' now,
2072 or pass -Dusedevel to Configure.
2075 rp='Do you really want to continue?'
2079 [yY]) echo >&4 "Okay, continuing."
2080 usedevel="$define" ;;
2081 *) echo >&4 "Okay, bye."
2091 case "$versiononly" in
2092 '') versiononly="$define" ;;
2094 case "$installusrbinperl" in
2095 '') installusrbinperl="$undef" ;;
2100 : general instructions
2103 user=`(logname) 2>/dev/null`
2105 '') user=`whoami 2>&1`;;
2107 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2110 rp='Would you like to see the instructions?'
2121 This installation shell script will examine your system and ask you questions
2122 to determine how the perl5 package should be installed. If you get
2123 stuck on a question, you may use a ! shell escape to start a subshell or
2124 execute a command. Many of the questions will have default answers in square
2125 brackets; typing carriage return will give you the default.
2127 On some of the questions which ask for file or directory names you are allowed
2128 to use the ~name construct to specify the login directory belonging to "name",
2129 even if you don't have a shell which knows about that. Questions where this is
2130 allowed will be marked "(~name ok)".
2134 dflt='Type carriage return to continue'
2138 The prompter used in this script allows you to use shell variables and
2139 backticks in your answers. You may use $1, $2, etc... to refer to the words
2140 in the default answer, as if the default line was a set of arguments given to a
2141 script shell. This means you may also use $* to repeat the whole default line,
2142 so you do not have to re-type everything to add something to the default.
2144 Everytime there is a substitution, you will have to confirm. If there is an
2145 error (e.g. an unmatched backtick), the default answer will remain unchanged
2146 and you will be prompted again.
2148 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2149 the questions and use the computed defaults (or the previous answers if there
2150 was already a config.sh file). Type 'Configure -h' for a list of options.
2151 You may also start interactively and then answer '& -d' at any prompt to turn
2152 on the non-interactive behaviour for the remainder of the execution.
2158 Much effort has been expended to ensure that this shell script will run on any
2159 Unix system. If despite that it blows up on yours, your best bet is to edit
2160 Configure and run it again. If you can't run Configure for some reason,
2161 you'll have to generate a config.sh file by hand. Whatever problems you
2162 have, let me (perlbug@perl.org) know how I blew it.
2164 This installation script affects things in two ways:
2166 1) it may do direct variable substitutions on some of the files included
2168 2) it builds a config.h file for inclusion in C programs. You may edit
2169 any of these files as the need arises after running this script.
2171 If you make a mistake on a question, there is no easy way to back up to it
2172 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2173 files. Configure will offer to let you do this before it runs the SH files.
2176 dflt='Type carriage return to continue'
2178 case "$firsttime" in
2179 true) echo $user >>../.config/instruct;;
2183 : find out where common programs are
2185 echo "Locating common programs..." >&4
2198 if test -d \$dir/\$thing; then
2204 for thisthing in \$dir/\$thing; do
2205 : just loop through to pick last item
2207 if test -f \$thisthing; then
2210 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2213 elif test -f \$dir/\$thing.exe; then
2214 if test -n "$DJGPP"; then
2215 echo \$dir/\$thing.exe
2216 elif test "$eunicefix" != ":"; then
2217 : on Eunice apparently
2271 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2272 pth="$pth /lib /usr/lib"
2273 for file in $loclist; do
2277 if test -f "$xxx"; then
2280 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2281 xxx=`./loc $file $file $pth`
2284 '') xxx=`./loc $file $file $pth`;;
2285 *) xxx=`./loc $xxx $xxx $pth`;;
2287 eval $file=$xxx$_exe
2291 echo $file is in $xxx.
2294 echo $file is in $xxx.
2297 echo "I don't know where '$file' is, and my life depends on it." >&4
2298 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2304 echo "Don't worry if any of the following aren't found..."
2306 for file in $trylist; do
2310 if test -f "$xxx"; then
2313 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2314 xxx=`./loc $file $file $pth`
2317 '') xxx=`./loc $file $file $pth`;;
2318 *) xxx=`./loc $xxx $xxx $pth`;;
2320 eval $file=$xxx$_exe
2324 echo $file is in $xxx.
2327 echo $file is in $xxx.
2330 echo "I don't see $file out there, $say."
2337 echo "Substituting grep for egrep."
2344 echo "Substituting cp for ln."
2353 echo "I can't find make or gmake, and my life depends on it." >&4
2354 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2362 *) # We can't have osname yet.
2363 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2364 # Assume that gmake, if found, is definitely GNU make
2365 # and prefer it over the system make.
2366 echo "Substituting gmake for make."
2374 echo "Hopefully test is built into your sh."
2377 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2378 echo "Using the test built into your sh."
2386 echo "Hopefully echo is built into your sh."
2391 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2392 $echo $n "hi there$c" >foo1
2393 echo $n "hi there$c" >foo2
2394 if cmp foo1 foo2 >/dev/null 2>&1; then
2395 echo "They are compatible. In fact, they may be identical."
2402 They are not compatible! You are probably running ksh on a non-USG system.
2403 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2404 have echo built in and we may have to run some Bourne shell scripts. That
2405 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2408 $echo $n "The star should be here-->$c"
2418 cat <<'EOSC' >>trygcc
2423 int main(int argc, char *argv[]) {
2427 if $cc -o try $ccflags $ldflags try.c; then
2430 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2436 case "`$cc -v -c try.c 2>&1`" in
2439 if $test X"$trygcc" = Xyes; then
2440 if gcc -o try -c try.c; then
2442 echo "You seem to have a working gcc, though." >&4
2443 rp="Would you like to use it?"
2445 if $test -f myread; then
2448 if $test -f UU/myread; then
2451 echo "Cannot find myread, sorry. Aborting." >&2
2456 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2457 if $test -f usethreads.cbu; then
2460 *** However, any setting of the C compiler flags (e.g. for thread support)
2461 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2462 *** (together with e.g. -Dusethreads).
2478 cat <<'EOSC' >>checkcc
2483 int main(int argc, char *argv[]) {
2487 if $cc -o try $ccflags $ldflags try.c; then
2490 if $test X"$despair" = Xyes; then
2491 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2494 You need to find a working C compiler.
2495 Either (purchase and) install the C compiler supplied by your OS vendor,
2496 or for a free C compiler try http://gcc.gnu.org/
2497 I cannot continue any further, aborting.
2506 : determine whether symbolic links are supported
2509 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2510 echo "Symbolic links are supported." >&4
2513 echo "Symbolic links are NOT supported." >&4
2518 : determine whether symbolic links are supported
2522 echo "Checking how to test for symbolic links..." >&4
2524 if $test "X$issymlink" = X; then
2526 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2527 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2529 if test $? = 0; then
2532 echo "Your builtin 'test -h' may be broken." >&4
2535 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2538 if test -f "$p/$test"; then
2547 echo "Trying external '$test -h'." >&4
2548 issymlink="$test -h"
2549 if $test ! -h sym >/dev/null 2>&1; then
2550 echo "External '$test -h' is broken, too." >&4
2558 if $test "X$issymlink" = X; then
2559 if $test -L sym 2>/dev/null; then
2560 issymlink="$test -L"
2561 echo "The builtin '$test -L' worked." >&4
2564 if $test "X$issymlink" != X; then
2565 echo "You can test for symbolic links with '$issymlink'." >&4
2567 echo "I do not know how you can test for symbolic links." >&4
2571 *) echo "No symbolic links, so not testing for their testing..." >&4
2577 case "$mksymlinks" in
2580 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2583 *) case "$lns:$issymlink" in
2584 *"ln"*" -s:"*"test -"?)
2585 echo "Creating the symbolic links..." >&4
2586 echo "(First creating the subdirectories...)" >&4
2588 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2590 test -z "$directory" && break
2594 if test ! -d t/base; then
2595 echo "Failed to create the subdirectories. Aborting." >&4
2598 echo "(Then creating the symlinks...)" >&4
2599 awk '{print $1}' $src/MANIFEST | while true; do
2601 test -z "$filename" && break
2602 if test -f $filename; then
2603 if $issymlink $filename; then
2607 if test -f $filename; then
2608 echo "$filename already exists, not symlinking."
2610 ln -s $src/$filename $filename
2614 if test ! -f t/base/lex.t; then
2615 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2620 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2629 case "$usecrosscompile" in
2631 $echo "Cross-compiling..."
2634 *-*-gcc) # A cross-compiling gcc, probably.
2635 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2637 # leave out ld, choosing it is more complex
2639 ranlib=$targetarch-ranlib
2640 $echo 'extern int foo;' > try.c
2641 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2643 if $test $# -gt 0; then
2645 incpth="`$echo $incpth|$sed 's/^ //'`"
2646 echo "Guessing incpth '$incpth'." >&4
2648 j="`$echo $i|$sed 's,/include$,/lib,'`"
2649 if $test -d $j; then
2653 libpth="`$echo $libpth|$sed 's/^ //'`"
2654 echo "Guessing libpth '$libpth'." >&4
2659 case "$targetarch" in
2660 '') echo "Targetarch not defined." >&4; croak=y ;;
2661 *) echo "Using targetarch $targetarch." >&4 ;;
2664 '') echo "Incpth not defined." >&4; croak=y ;;
2665 *) echo "Using incpth '$incpth'." >&4 ;;
2668 '') echo "Libpth not defined." >&4; croak=y ;;
2669 *) echo "Using libpth '$libpth'." >&4 ;;
2672 '') for i in $incpth; do
2673 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2675 echo "Guessing usrinc $usrinc." >&4
2680 '') echo "Usrinc not defined." >&4; croak=y ;;
2683 *) echo "Using usrinc $usrinc." >&4 ;;
2685 case "$targethost" in
2686 '') echo "Targethost not defined." >&4; croak=y ;;
2687 *) echo "Using targethost $targethost." >&4
2692 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2695 /*) run=$src/Cross/run
2696 targetmkdir=$src/Cross/mkdir
2698 from=$src/Cross/from
2700 *) pwd=`$test -f ../Configure & cd ..; pwd`
2702 targetmkdir=$pwd/Cross/mkdir
2704 from=$pwd/Cross/from
2707 case "$targetrun" in
2708 '') targetrun=ssh ;;
2713 case "$targetfrom" in
2714 '') targetfrom=scp ;;
2718 from=$from-$targetfrom
2719 case "$targetdir" in
2721 echo "Guessing targetdir $targetdir." >&4
2724 case "$targetuser" in
2726 echo "Guessing targetuser $targetuser." >&4
2729 case "$targetfrom" in
2733 case "$targetrun" in
2745 '') cwd=$targetdir ;;
2749 if $test ! -f \$exe.xok; then
2753 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2756 *) echo "Unknown targetrun '$targetrun'" >&4
2760 case "$targetmkdir" in
2762 cat >$targetmkdir <<EOF
2764 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2766 $chmod a+rx $targetmkdir
2768 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2780 $targetmkdir \`dirname \$f\`
2781 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2784 $targetmkdir $targetdir/\`dirname \$f\`
2785 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2798 $mkdir -p $targetdir/\`dirname \$f\`
2799 $cp \$f $targetdir/\$f || exit 1
2802 $targetmkdir $targetdir/\`dirname \$f\`
2803 $cp \$f $targetdir/\$f || exit 1
2810 *) echo "Unknown targetto '$targetto'" >&4
2814 case "$targetfrom" in
2821 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2826 cp) cat >$from <<EOF
2831 cp $targetdir/\$f . || exit 1
2836 *) echo "Unknown targetfrom '$targetfrom'" >&4
2840 if $test ! -f $run; then
2841 echo "Target 'run' script '$run' not found." >&4
2845 if $test ! -f $to; then
2846 echo "Target 'to' script '$to' not found." >&4
2850 if $test ! -f $from; then
2851 echo "Target 'from' script '$from' not found." >&4
2855 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2859 Using '$run' for remote execution,
2860 and '$from' and '$to'
2861 for remote file transfer.
2867 usecrosscompile='undef'
2872 : see whether [:lower:] and [:upper:] are supported character classes
2874 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2876 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2880 *) # There is a discontinuity in EBCDIC between 'R' and 'S'
2881 # (0xd9 and 0xe2), therefore that is a nice testing point.
2882 if test "X$up" = X -o "X$low" = X; then
2883 case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
2889 if test "X$up" = X -o "X$low" = X; then
2890 case "`echo RS | $tr R-S r-s 2>/dev/null`" in
2896 if test "X$up" = X -o "X$low" = X; then
2897 case "`echo RS | od -x 2>/dev/null`" in
2899 echo "Hey, this might be EBCDIC." >&4
2900 if test "X$up" = X -o "X$low" = X; then
2901 case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2902 rs) up='[A-IJ-RS-Z]'
2907 if test "X$up" = X -o "X$low" = X; then
2908 case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2918 case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
2920 echo "Using $up and $low to convert case." >&4
2923 echo "I don't know how to translate letters from upper to lower case." >&4
2924 echo "Your tr is not acting any way I know of." >&4
2928 : set up the translation script tr, must be called with ./tr of course
2932 '[A-Z][a-z]') exec $tr '$up' '$low';;
2933 '[a-z][A-Z]') exec $tr '$low' '$up';;
2940 : Try to determine whether config.sh was made on this system
2941 case "$config_sh" in
2943 myuname=`$uname -a 2>/dev/null`
2944 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2945 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2946 # because the A-Z/a-z are not consecutive.
2947 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2948 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2949 newmyuname="$myuname"
2951 case "$knowitall" in
2953 if test -f ../config.sh; then
2954 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2955 eval "`grep myuname= ../config.sh`"
2957 if test "X$myuname" = "X$newmyuname"; then
2965 : Get old answers from old config file if Configure was run on the
2966 : same system, otherwise use the hints.
2969 if test -f config.sh; then
2971 rp="I see a config.sh file. Shall I use it to set the defaults?"
2974 n*|N*) echo "OK, I'll ignore it."
2975 mv config.sh config.sh.old
2976 myuname="$newmyuname"
2978 *) echo "Fetching default answers from your old config.sh file..." >&4
2986 : Older versions did not always set $sh. Catch re-use of such
2996 if test ! -f config.sh; then
2999 First time through, eh? I have some defaults handy for some systems
3000 that need some extra help getting the Configure answers right:
3003 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
3005 : Half the following guesses are probably wrong... If you have better
3006 : tests or hints, please send them to perlbug@perl.org
3007 : The metaconfig authors would also appreciate a copy...
3008 $test -f /irix && osname=irix
3009 $test -f /xenix && osname=sco_xenix
3010 $test -f /dynix && osname=dynix
3011 $test -f /dnix && osname=dnix
3012 $test -f /lynx.os && osname=lynxos
3013 $test -f /unicos && osname=unicos && osvers=`$uname -r`
3014 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
3015 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
3016 $test -f /bin/mips && /bin/mips && osname=mips
3017 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
3018 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
3019 $test -d /usr/apollo/bin && osname=apollo
3020 $test -f /etc/saf/_sactab && osname=svr4
3021 $test -d /usr/include/minix && osname=minix
3022 $test -f /system/gnu_library/bin/ar.pm && osname=vos
3023 if $test -d /MachTen -o -d /MachTen_Folder; then
3025 if $test -x /sbin/version; then
3026 osvers=`/sbin/version | $awk '{print $2}' |
3027 $sed -e 's/[A-Za-z]$//'`
3028 elif $test -x /usr/etc/version; then
3029 osvers=`/usr/etc/version | $awk '{print $2}' |
3030 $sed -e 's/[A-Za-z]$//'`
3036 $test -f /sys/posix.dll &&
3037 $test -f /usr/bin/what &&
3038 set X `/usr/bin/what /sys/posix.dll` &&
3039 $test "$3" = UWIN &&
3043 if $test -f $uname; then
3051 umips) osname=umips ;;
3054 [23]100) osname=mips ;;
3055 next*) osname=next ;;
3057 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
3058 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
3061 elif $test -f /etc/kconfig; then
3063 if test "$lns" = "$ln -s"; then
3065 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3067 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3074 if test -n "$DJGPP"; then
3083 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3085 # oslevel can fail with:
3086 # oslevel: Unable to acquire lock.
3087 *not\ found) osvers="$4"."$3" ;;
3088 '<3240'|'<>3240') osvers=3.2.0 ;;
3089 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3090 '=3250'|'>3250') osvers=3.2.5 ;;
3094 bsd386) osname=bsd386
3097 cygwin*) osname=cygwin
3100 *dc.osx) osname=dcosx
3106 domainos) osname=apollo
3112 dynixptx*) osname=dynixptx
3113 osvers=`echo "$4"|sed 's/^v//'`
3115 freebsd) osname=freebsd
3117 genix) osname=genix ;;
3121 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3137 netbsd*) osname=netbsd
3140 news-os) osvers="$3"
3142 4*) osname=newsos4 ;;
3146 next*) osname=next ;;
3147 nonstop-ux) osname=nonstopux ;;
3148 openbsd) osname=openbsd
3154 POSIX-BC | posix-bc ) osname=posix-bc
3157 powerux | power_ux | powermax_os | powermaxos | \
3158 powerunix | power_unix) osname=powerux
3164 solaris) osname=solaris
3166 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3173 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3177 titanos) osname=titanos
3186 ultrix) osname=ultrix
3189 osf1|mls+) case "$5" in
3192 osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3195 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3198 hp*) osname=hp_osf1 ;;
3199 mips) osname=mips_osf1 ;;
3202 # UnixWare 7.1.2 is known as Open UNIX 8
3203 openunix|unixware) osname=svr5
3211 $2) case "$osname" in
3215 : svr4.x or possibly later
3225 if test -f /stand/boot ; then
3226 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3227 if test -n "$INITPROG" -a -f "$INITPROG"; then
3228 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3229 if test -n "$isesix"; then
3237 *) if test -f /etc/systemid; then
3239 set `echo $3 | $sed 's/\./ /g'` $4
3240 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3242 elif $test -f $src/hints/sco_$1_$2.sh; then
3244 elif $test -f $src/hints/sco_$1.sh; then
3249 '') : Still unknown. Probably a generic Sys V.
3258 *) case "$osname" in
3259 '') : Still unknown. Probably a generic BSD.
3267 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3268 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3269 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3272 $rm -f UU/kernel.what
3273 elif test -d c:/. -o -n "$is_os2" ; then
3280 case "$targetarch" in
3283 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3288 : Now look for a hint file osname_osvers, unless one has been
3289 : specified already.
3292 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3293 : Also try without trailing minor version numbers.
3294 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3295 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3296 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3297 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3300 *) case "$osvers" in
3303 *) if $test -f $src/hints/$file.sh ; then
3305 elif $test -f $src/hints/$xfile.sh ; then
3307 elif $test -f $src/hints/$xxfile.sh ; then
3309 elif $test -f $src/hints/$xxxfile.sh ; then
3311 elif $test -f $src/hints/$xxxxfile.sh ; then
3313 elif $test -f "$src/hints/${osname}.sh" ; then
3322 if $test -f Policy.sh ; then
3325 none) dflt="Policy" ;;
3326 *) dflt="Policy $dflt" ;;
3331 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3335 if $test -f Policy.sh ; then
3338 There's also a Policy hint file available, which should make the
3339 site-specific (policy) questions easier to answer.
3346 You may give one or more space-separated answers, or "none" if appropriate.
3347 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3348 is a good thing. DO NOT give a wrong version or a wrong OS.
3352 rp="Which of these apply, if any?"
3355 for file in $tans; do
3356 if $test X$file = XPolicy -a -f Policy.sh; then
3358 $cat Policy.sh >> UU/config.sh
3359 elif $test -f $src/hints/$file.sh; then
3360 . $src/hints/$file.sh
3361 $cat $src/hints/$file.sh >> UU/config.sh
3362 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3365 : Give one chance to correct a possible typo.
3366 echo "$file.sh does not exist"
3368 rp="hint to use instead?"
3370 for file in $ans; do
3371 if $test -f "$src/hints/$file.sh"; then
3372 . $src/hints/$file.sh
3373 $cat $src/hints/$file.sh >> UU/config.sh
3374 elif $test X$ans = X -o X$ans = Xnone ; then
3377 echo "$file.sh does not exist -- ignored."
3384 : Remember our hint file for later.
3385 if $test -f "$src/hints/$file.sh" ; then
3395 echo "Fetching default answers from $config_sh..." >&4
3399 cp $config_sh config.sh 2>/dev/null
3409 test "$override" && . ./optdef.sh
3411 : Restore computed paths
3412 for file in $loclist $trylist; do
3413 eval $file="\$_$file"
3418 Configure uses the operating system name and version to set some defaults.
3419 The default value is probably right if the name rings a bell. Otherwise,
3420 since spelling matters for me, either accept the default or answer "none"
3427 ''|' '|none) dflt=none ;;
3428 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3431 *) dflt="$osname" ;;
3433 rp="Operating system name?"
3437 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3443 ''|' '|none) dflt=none ;;
3444 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3445 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3447 ''|' ') dflt=none ;;
3452 *) dflt="$osvers" ;;
3454 rp="Operating system version?"
3464 : who configured the system
3465 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3468 cf_by=`(logname) 2>/dev/null`
3471 cf_by=`(whoami) 2>/dev/null`
3473 "") cf_by=unknown ;;
3478 : set up the script used to warn in case of inconsistency
3485 echo "*** WHOA THERE!!! ***" >&4
3486 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3487 rp=" Keep the $hint value?"
3490 y) td=$was; tu=$was;;
3494 : function used to set $1 to $val
3495 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3497 $define$undef) . ./whoa; eval "$var=\$td";;
3498 $undef$define) . ./whoa; eval "$var=\$tu";;
3499 *) eval "$var=$val";;
3503 $define|true|[yY]*) dflt='y';;
3508 Perl can be built to use the SOCKS proxy protocol library. To do so,
3509 Configure must be run with -Dusesocks. If you use SOCKS you also need
3510 to use the PerlIO abstraction layer, this will be implicitly selected.
3512 If this doesn't make any sense to you, just accept the default '$dflt'.
3514 rp='Build Perl for SOCKS?'
3517 y|Y) val="$define" ;;
3524 $define|true|[yY]*) useperlio="$define";;
3527 case "$useperlio" in
3528 $define|true|[yY]*|'') dflt='y';;
3533 Previous version of $package used the standard IO mechanisms as
3534 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
3535 alternate IO mechanisms via the PerlIO abstraction layer, but the
3536 stdio mechanism is still available if needed. The abstraction layer
3537 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3538 Using PerlIO with sfio may cause problems with some extension modules.
3540 If this doesn't make any sense to you, just accept the default '$dflt'.
3542 rp='Use the PerlIO abstraction layer?'
3549 echo "Ok, doing things the stdio way."
3558 case "$useperlio" in
3559 $define|true|[yY]*) ;;
3562 You are using the SOCKS proxy protocol library which means that you
3563 should also use the PerlIO layer. You may be headed for trouble.
3572 case "$usethreads" in
3573 $define|true|[yY]*) dflt='y';;
3574 *) # Catch case where user specified ithreads or 5005threads but
3575 # forgot -Dusethreads (A.D. 4/2002)
3576 case "$useithreads$use5005threads" in
3578 case "$useperlio" in
3579 "$define") dflt='y' ;;
3589 Perl can be built to take advantage of threads on some systems.
3590 To do so, Configure can be run with -Dusethreads.
3592 Note that Perl built with threading support runs slightly slower
3593 and uses more memory than plain Perl. The current implementation
3594 is believed to be stable, but it is fairly new, and so should be
3595 treated with caution.
3597 If this doesn't make any sense to you, just accept the default '$dflt'.
3599 rp='Build a threading Perl?'
3602 y|Y) val="$define" ;;
3608 case "$usethreads" in
3612 Since release 5.6, Perl has had two different threading implementations,
3613 the newer interpreter-based version (ithreads) with one interpreter per
3614 thread, and the older 5.005 version (5005threads).
3615 The 5005threads version is effectively unmaintained and will probably be
3616 removed in Perl 5.10, so there should be no need to build a Perl using it
3617 unless needed for backwards compatibility with some existing 5.005threads
3621 : Default to ithreads unless overridden on command line or with
3624 case "$use5005threads" in
3625 $define|true|[yY]*) dflt='n';;
3627 case "$useithreads" in
3628 $undef|false|[nN]*) dflt='n';;
3630 rp='Use the newer interpreter-based ithreads?'
3633 y|Y) val="$define" ;;
3638 : Now set use5005threads to the opposite value.
3639 case "$useithreads" in
3640 $define) val="$undef" ;;
3647 useithreads="$undef"
3648 use5005threads="$undef"
3652 case "$useithreads$use5005threads" in
3656 You cannot have both the ithreads and the 5.005 threads enabled
3657 at the same time. Disabling the 5.005 threads since they are
3658 much less stable than the ithreads.
3661 use5005threads="$undef"
3665 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
3668 *** To build with ithreads you must also use the PerlIO layer.
3669 *** Cannot continue, aborting.
3675 case "$d_oldpthreads" in
3676 '') : Configure tests would be welcome here. For now, assume undef.
3678 *) val="$d_oldpthreads" ;;
3684 : Look for a hint-file generated 'call-back-unit'. If the
3685 : user has specified that a threading perl is to be built,
3686 : we may need to set or change some other defaults.
3687 if $test -f usethreads.cbu; then
3688 echo "Your platform has some specific hints regarding threaded builds, using them..."
3691 case "$usethreads" in
3692 "$define"|true|[yY]*)
3694 (Your platform does not have any specific hints for threaded builds.
3695 Assuming POSIX threads, then.)
3703 Perl can be built so that multiple Perl interpreters can coexist
3704 within the same Perl executable.
3707 case "$useithreads" in
3710 This multiple interpreter support is required for interpreter-based threads.
3714 *) case "$usemultiplicity" in
3715 $define|true|[yY]*) dflt='y';;
3719 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3720 rp='Build Perl for multiplicity?'
3723 y|Y) val="$define" ;;
3732 case "$usemorebits" in
3733 "$define"|true|[yY]*)
3734 use64bitint="$define"
3735 uselongdouble="$define"
3736 usemorebits="$define"
3738 *) usemorebits="$undef"
3742 : make some quick guesses about what we are up against
3744 $echo $n "Hmm... $c"
3754 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3755 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3757 echo "Looks kind of like an OSF/1 system, but we'll see..."
3759 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3760 xxx=`./loc addbib blurfl $pth`
3761 if $test -f $xxx; then
3762 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3766 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3767 echo "Looks kind of like an extended USG system, but we'll see..."
3769 echo "Looks kind of like a USG system, but we'll see..."
3773 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3774 echo "Looks kind of like a BSD system, but we'll see..."
3778 echo "Looks kind of like a Version 7 system, but we'll see..."
3781 case "$eunicefix" in
3784 There is, however, a strange, musty smell in the air that reminds me of
3785 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3789 : it so happens the Eunice I know will not run shell scripts in Unix format
3793 echo "Congratulations. You aren't running Eunice."
3797 : Detect OS2. The p_ variable is set above in the Head.U unit.
3798 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3799 : semicolon as a patch separator
3804 I have the feeling something is not exactly right, however...don't tell me...
3805 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3806 (Or you may be running DOS with DJGPP.)
3811 if test -f /xenix; then
3812 echo "Actually, this looks more like a XENIX system..."
3817 echo "It's not Xenix..."
3822 if test -f /venix; then
3823 echo "Actually, this looks more like a VENIX system..."
3830 echo "Nor is it Venix..."
3833 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3834 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3841 rp="Use which C compiler?"
3845 : See if they have not cc but they do have gcc
3847 : Look for a hint-file generated 'call-back-unit'. Now that the
3848 : user has specified the compiler, we may need to set or change some
3850 if $test -f cc.cbu; then
3856 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3862 printf("%s\n", __VERSION__);
3864 printf("%s\n", "1");
3870 if $cc -o try $ccflags $ldflags try.c; then
3871 gccversion=`$run ./try`
3872 case "$gccversion" in
3873 '') echo "You are not using GNU cc." ;;
3874 *) echo "You are using GNU cc $gccversion."
3880 echo "*** WHOA THERE!!! ***" >&4
3881 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3882 case "$knowitall" in
3884 echo " You'd better start hunting for one and let me know about it." >&4
3890 case "$gccversion" in
3891 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3893 case "$gccversion" in
3894 '') gccosandvers='' ;;
3895 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3896 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3898 case "$gccosandvers" in
3899 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3900 $osname$osvers) ;; # looking good
3901 $osname*) cat <<EOM >&4
3903 *** WHOA THERE!!! ***
3905 Your gcc has not been compiled for the exact release of
3906 your operating system ($gccosandvers versus $osname$osvers).
3908 In general it is a good idea to keep gcc synchronized with
3909 the operating system because otherwise serious problems
3910 may ensue when trying to compile software, like Perl.
3912 I'm trying to be optimistic here, though, and will continue.
3913 If later during the configuration and build icky compilation
3914 problems appear (headerfile conflicts being the most common
3915 manifestation), I suggest reinstalling the gcc to match
3916 your operating system release.
3920 *) gccosandvers='' ;; # failed to parse, better be silent
3928 # gcc 3.* complain about adding -Idirectories that they already know about,
3929 # so we will take those off from locincpth.
3930 case "$gccversion" in
3932 echo "main(){}">try.c
3933 for incdir in $locincpth; do
3934 warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
3935 grep '^c[cp]p*[01]: warning: changing search order '`
3936 if test "X$warn" != X; then
3937 locincpth=`echo " $locincpth " | sed "s! $incdir ! !"`
3943 : decide how portable to be. Allow command line overrides.
3944 case "$d_portable" in
3946 *) d_portable="$define" ;;
3949 : set up shell script to do ~ expansion
3955 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3958 if $test -f /bin/csh; then
3959 /bin/csh -f -c "glob \$1"
3964 name=\`$expr x\$1 : '..\([^/]*\)'\`
3965 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3966 if $test ! -d "\$dir"; then
3968 echo "\$me: can't locate home directory for: \$name" >&2
3973 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3989 : now set up to get a file name
3993 cat <<'EOSC' >>getfile
4009 : getfile will accept an answer from the comma-separated list
4010 : enclosed in parentheses even if it does not meet other criteria.
4011 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
4012 fn=`echo $fn | sed 's/(.*)//'`
4018 loc_file=`expr $fn : '.*:\(.*\)'`
4019 fn=`expr $fn : '\(.*\):.*'`
4027 */*) fullpath=true;;
4036 *e*) exp_file=true;;
4039 *p*) nopath_ok=true;;
4044 *d*) type='Directory';;
4045 *l*) type='Locate';;
4050 Locate) what='File';;
4055 case "$d_portable" in
4063 while test "$type"; do
4068 true) rp="$rp (~name ok)";;
4071 if test -f UU/getfile.ok && \
4072 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
4091 value=`UU/filexp $ans`
4094 if test "$ans" != "$value"; then
4095 echo "(That expands to $value on this system.)"
4109 /*) value="$ansexp" ;;
4110 [a-zA-Z]:/*) value="$ansexp" ;;
4115 echo "I shall only accept a full path name, as in /bin/ls." >&4
4116 echo "Use a ! shell escape if you wish to check pathnames." >&4
4119 echo "Please give a full path name, starting with slash." >&4
4122 echo "Note that using ~name is ok provided it expands well." >&4
4135 for fp in $gfpth; do
4136 if test "X$fp" = X.; then
4141 if test -f "$pf"; then
4143 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
4145 echo "($value is not a plain file, but that's ok.)"
4148 if test X"$type" = X; then
4155 for fp in $gfpth; do
4156 if test "X$fp" = X.; then
4161 direxp="$fp/$ansexp"
4163 if test -d "$direxp"; then
4171 if test -d "$ansexp"; then
4172 echo "(Looking for $loc_file in directory $value.)"
4173 value="$value/$loc_file"
4174 ansexp="$ansexp/$loc_file"
4176 if test -f "$ansexp"; then
4179 case "$nopath_ok" in
4180 true) case "$value" in
4182 *) echo "Assuming $value will be in people's path."
4198 if test "$fastread" = yes; then
4203 rp="$what $value doesn't exist. Use that name anyway?"
4222 test "X$gfpthkeep" != Xy && gfpth=""
4225 : What should the include directory be ?
4227 $echo $n "Hmm... $c"
4231 if $test -f /bin/mips && /bin/mips; then
4232 echo "Looks like a MIPS system..."
4233 $cat >usr.c <<'EOCP'
4234 #ifdef SYSTYPE_BSD43
4238 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4239 dflt='/bsd43/usr/include'
4243 mips_type='System V'
4245 $rm -f usr.c usr.out
4246 echo "and you're compiling with the $mips_type compiler and libraries."
4250 echo "Doesn't look like a MIPS system."
4260 case "$xxx_prompt" in
4263 rp='Where are the include files you want to use?'
4271 : see how we invoke the C preprocessor
4273 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4274 cat <<'EOT' >testcpp.c
4280 if test ! -f cppstdin; then
4281 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4282 # AIX cc -E doesn't show the absolute headerfile
4283 # locations but we'll cheat by using the -M flag.
4284 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
4286 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4289 echo "Keeping your $hint cppstdin wrapper."
4292 wrapper=`pwd`/cppstdin
4296 if $test "X$cppstdin" != "X" && \
4297 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4298 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4300 echo "You used to use $cppstdin $cppminus so we'll use that again."
4302 '') echo "But let's see if we can live without a wrapper..." ;;
4304 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4305 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4307 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4310 echo "(However, $cpprun $cpplast does not work, let's see...)"
4318 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4325 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4326 $cc -E <testcpp.c >testcpp.out 2>&1; \
4327 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4328 echo "Yup, it does."
4331 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4332 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4333 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4334 echo "Yup, it does."
4337 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4338 $cc -P <testcpp.c >testcpp.out 2>&1; \
4339 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4340 echo "Yipee, that works!"
4343 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4344 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4345 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4346 echo "At long last!"
4349 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4350 $cpp <testcpp.c >testcpp.out 2>&1; \
4351 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4355 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4356 $cpp - <testcpp.c >testcpp.out 2>&1; \
4357 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4358 echo "Hooray, it works! I was beginning to wonder."
4361 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4362 $wrapper <testcpp.c >testcpp.out 2>&1; \
4363 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4369 rp="No dice. I can't find a C preprocessor. Name one:"
4373 $x_cpp <testcpp.c >testcpp.out 2>&1
4374 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4375 echo "OK, that will do." >&4
4377 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4392 echo "Perhaps can we force $cc -E using a wrapper..."
4393 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4394 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4400 echo "Nope, we'll have to live without it..."
4414 "$wrapper"|'cppstdin') ;;
4415 *) $rm -f $wrapper;;
4417 $rm -f testcpp.c testcpp.out
4419 : Set private lib path
4422 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4427 '') dlist="$loclibpth $plibpth $glibpth";;
4428 *) dlist="$libpth";;
4431 : Now check and see which directories actually exist, avoiding duplicates
4435 if $test -d $xxx; then
4438 *) libpth="$libpth $xxx";;
4444 Some systems have incompatible or broken versions of libraries. Among
4445 the directories listed in the question below, please remove any you
4446 know not to be holding relevant libraries, and add any that are needed.
4447 Say "none" for none.
4458 rp="Directories to use for library searches?"
4465 : compute shared library extension
4468 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4478 On some systems, shared libraries may be available. Answer 'none' if
4479 you want to suppress searching of shared libraries for the remainder
4480 of this configuration.
4483 rp='What is the file extension used for shared libraries?'
4487 : Define several unixisms.
4488 : Hints files or command line option can be used to override them.
4489 : The convoluted testing is in case hints files set either the old
4492 '') case "$exe_ext" in
4494 *) _exe="$exe_ext" ;;
4499 '') case "$lib_ext" in
4506 '') case "$obj_ext" in
4513 '') case "$path_sep" in
4524 : Which makefile gets called first. This is used by make depend.
4525 case "$firstmakefile" in
4526 '') firstmakefile='makefile';;
4530 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
4533 case "$uselongdouble" in
4534 $define|true|[yY]*) dflt='y';;
4539 Perl can be built to take advantage of long doubles which
4540 (if available) may give more accuracy and range for floating point numbers.
4542 If this doesn't make any sense to you, just accept the default '$dflt'.
4544 rp='Try to use long doubles if available?'
4547 y|Y) val="$define" ;;
4553 case "$uselongdouble" in
4554 true|[yY]*) uselongdouble="$define" ;;
4557 : Look for a hint-file generated 'call-back-unit'. If the
4558 : user has specified that long doubles should be used,
4559 : we may need to set or change some other defaults.
4560 if $test -f uselongdouble.cbu; then
4561 echo "Your platform has some specific hints regarding long doubles, using them..."
4562 . ./uselongdouble.cbu
4564 case "$uselongdouble" in
4567 (Your platform does not have any specific hints for long doubles.)
4573 : Looking for optional libraries
4575 echo "Checking for optional libraries..." >&4
4580 case "$libswanted" in
4581 '') libswanted='c_s';;
4584 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4590 for thisdir in $libpth $xlibpth; do
4591 test -d $thisdir && libspath="$libspath $thisdir"
4593 for thislib in $libswanted; do
4594 for thisdir in $libspath; do
4596 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4597 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4598 $test -f "$xxx" && eval $libscheck
4599 $test -f "$xxx" && libstyle=shared
4601 if test ! -f "$xxx"; then
4602 xxx=$thisdir/lib$thislib.$so
4603 $test -f "$xxx" && eval $libscheck
4604 $test -f "$xxx" && libstyle=shared
4606 if test ! -f "$xxx"; then
4607 xxx=$thisdir/lib$thislib$_a
4608 $test -f "$xxx" && eval $libscheck
4609 $test -f "$xxx" && libstyle=static
4611 if test ! -f "$xxx"; then
4612 xxx=$thisdir/$thislib$_a
4613 $test -f "$xxx" && eval $libscheck
4614 $test -f "$xxx" && libstyle=static
4616 if test ! -f "$xxx"; then
4617 xxx=$thisdir/lib${thislib}_s$_a
4618 $test -f "$xxx" && eval $libscheck
4619 $test -f "$xxx" && libstyle=static
4620 $test -f "$xxx" && thislib=${thislib}_s
4622 if test ! -f "$xxx"; then
4623 xxx=$thisdir/Slib$thislib$_a
4624 $test -f "$xxx" && eval $libscheck
4625 $test -f "$xxx" && libstyle=static
4627 if $test -f "$xxx"; then
4629 shared) echo "Found -l$thislib (shared)." ;;
4630 static) echo "Found -l$thislib." ;;
4631 *) echo "Found -l$thislib ($libstyle)." ;;
4635 *) dflt="$dflt -l$thislib"
4636 libsfound="$libsfound $xxx"
4638 libsfiles="$libsfiles $yyy"
4639 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4640 case " $libsdirs " in
4642 *) libsdirs="$libsdirs $yyy" ;;
4649 if $test ! -f "$xxx"; then
4650 echo "No -l$thislib."
4661 ' '|'') dflt='none';;
4666 In order to compile $package on your machine, a number of libraries
4667 are usually needed. Include any other special libraries here as well.
4668 Say "none" for none. The default list is almost always right.
4672 rp="What libraries to use?"
4679 : determine optimization, if desired, or use for debug flag also
4681 ' '|$undef) dflt='none';;
4683 *) dflt="$optimize";;
4687 By default, $package compiles with the -O flag to use the optimizer.
4688 Alternately, you might want to use the symbolic debugger, which uses
4689 the -g flag (on traditional Unix systems). Either flag can be
4690 specified here. To use neither flag, specify the word "none".
4693 rp="What optimizer/debugger flag should be used?"
4697 'none') optimize=" ";;
4701 : We will not override a previous value, but we might want to
4702 : augment a hint file
4704 default|recommended)
4705 case "$gccversion" in
4706 1*) dflt='-fpcc-struct-return' ;;
4709 *-g*) dflt="$dflt -DDEBUGGING";;
4711 case "$gccversion" in
4712 2*) if test -d /etc/conf/kconfig.d &&
4713 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4715 # Interactive Systems (ISC) POSIX mode.
4720 case "$gccversion" in
4724 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4725 echo 'int main(void) { return 0; }' > gcctest.c
4726 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4727 echo "Yes, it does." 2>&1
4730 echo "Leaving current flags $ccflags alone." 2>&1
4732 *) dflt="$dflt -fno-strict-aliasing" ;;
4735 echo "Nope, it doesn't, but that's ok." 2>&1
4739 # For gcc, adding -pipe speeds up compilations for some, but apparently
4740 # some assemblers can't read from stdin. (It also slows down compilations
4741 # in other cases, but those are apparently rarer these days.) AD 5/2004.
4742 case "$gccversion" in
4744 echo "Checking if your compiler accepts -pipe" 2>&1
4745 echo 'int main(void) { return 0; }' > gcctest.c
4746 if $cc -O2 -pipe -o gcctest gcctest.c; then
4747 echo "Yes, it does." 2>&1
4750 echo "Leaving current flags $ccflags alone." 2>&1
4752 *) dflt="$dflt -pipe" ;;
4755 echo "Nope, it doesn't, but that's ok." 2>&1
4762 case "$mips_type" in
4763 *BSD*|'') inclwanted="$locincpth $usrinc";;
4764 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4766 for thisincl in $inclwanted; do
4767 if $test -d $thisincl; then
4768 if $test x$thisincl != x$usrinc; then
4770 *" -I$thisincl "*);;
4771 *) dflt="$dflt -I$thisincl ";;
4777 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4779 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4787 *) dflt="$dflt -D$2";;
4791 set signal.h LANGUAGE_C; eval $inctest
4795 ccflags="$ccflags -DSOCKS"
4800 default|recommended) dflt="$ccflags $dflt" ;;
4801 *) dflt="$ccflags";;
4810 Your C compiler may want other flags. For this question you should include
4811 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4812 but you should NOT include libraries or ld flags like -lwhatever. If you
4813 want $package to honor its debug switch, you should include -DDEBUGGING here.
4814 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4816 To use no flags, specify the word "none".
4822 rp="Any additional cc flags?"
4829 : the following weeds options from ccflags that are of no interest to cpp
4831 '') cppflags="$ccflags" ;;
4832 *) cppflags="$cppflags $ccflags" ;;
4834 case "$gccversion" in
4835 1*) cppflags="$cppflags -D__GNUC__"
4837 case "$mips_type" in
4839 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4845 echo "Let me guess what the preprocessor flags are..." >&4
4859 *) ftry="$previous $flag";;
4861 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4862 >cpp1.out 2>/dev/null && \
4863 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4864 >cpp2.out 2>/dev/null && \
4865 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4866 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4868 cppflags="$cppflags $ftry"
4878 *-*) echo "They appear to be: $cppflags";;
4880 $rm -f cpp.c cpp?.out
4884 : flags used in final linking phase
4886 '') if ./venix; then
4892 *-posix*) dflt="$dflt -posix" ;;
4895 *) dflt="$ldflags";;
4898 : Try to guess additional flags to pick up local libraries.
4899 for thislibdir in $libpth; do
4900 case " $loclibpth " in
4903 *"-L$thislibdir "*) ;;
4904 *) dflt="$dflt -L$thislibdir" ;;
4916 Your C linker may need flags. For this question you should
4917 include -L/whatever and any other flags used by the C linker, but you
4918 should NOT include libraries like -lwhatever.
4920 Make sure you include the appropriate -L/path flags if your C linker
4921 does not normally search all of the directories you specified above,
4924 To use no flags, specify the word "none".
4928 rp="Any additional ld flags (NOT including libraries)?"
4934 rmlist="$rmlist pdp11"
4938 echo "Checking your choice of C compiler and flags for coherency..." >&4
4939 $cat > try.c <<'EOF'
4941 int main() { printf("Ok\n"); return(0); }
4943 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4945 $cat >try.msg <<'EOM'
4946 I've tried to compile and run the following simple program:
4949 $cat try.c >> try.msg
4951 $cat >> try.msg <<EOM
4958 and I got the following output:
4962 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4963 if $sh -c "$run ./try" >>try.msg 2>&1; then
4967 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4970 cat >> try.msg <<'EOQS'
4971 If $libs contains -lsfio, and sfio is mis-configured, then it
4972 sometimes (apparently) runs and exits with a 0 status, but with no
4973 output! It may have to do with sfio's use of _exit vs. exit.
4976 rp="You have a big problem. Shall I abort Configure"
4983 echo "The program compiled OK, but exited with status $?." >>try.msg
4984 rp="You have a problem. Shall I abort Configure"
4988 echo "I can't compile the test program." >>try.msg
4989 rp="You have a BIG problem. Shall I abort Configure"
4995 case "$knowitall" in
4997 echo "(The supplied flags or libraries might be incorrect.)"
5005 *) echo "Ok. Stopping Configure." >&4
5010 n) echo "OK, that should do.";;
5012 $rm -f try try.* core
5014 : define a shorthand compile call
5018 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
5019 : define a shorthand compile call for compilations that should be ok.
5023 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
5025 : determine filename position in cpp output
5027 echo "Computing filename position in cpp output for #include directives..." >&4
5029 vos) testaccess=-e ;;
5032 echo '#include <stdio.h>' > foo.c
5035 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
5036 $grep '^[ ]*#.*stdio\.h' | \
5037 while read cline; do
5040 while $test \$# -gt 0; do
5041 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
5046 pos=\`expr \$pos + 1\`
5058 *) pos="${fieldn}th";;
5060 echo "Your cpp writes the filename in the $pos field of the line."
5063 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
5064 os2) cppfilter="sed -e 's|\\\\\\\\|/|g' |" ;; # path component separator is \
5067 : locate header file
5072 for usrincdir in $usrinc
5074 if test -f \$usrincdir/\$wanted; then
5075 echo "\$usrincdir/\$wanted"
5079 awkprg='{ print \$$fieldn }'
5080 echo "#include <\$wanted>" > foo\$\$.c
5081 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
5082 $cppfilter $grep "^[ ]*#.*\$wanted" | \
5083 while read cline; do
5084 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
5086 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
5087 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
5092 # status = 0: grep returned 0 lines, case statement not executed
5093 # status = 1: headerfile found
5094 # status = 2: while loop executed, no headerfile found
5098 if test \$status -eq 1; then
5105 : define an alternate in-header-list? function
5106 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
5107 cont=true; xxf="echo \"<\$1> found.\" >&4";
5108 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5109 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5111 case $# in 4) instead=instead;; *) instead="at last";; esac;
5112 while $test "$cont"; do
5114 var=$2; eval "was=\$$2";
5115 if $test "$xxx" && $test -r "$xxx";
5117 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5120 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5121 set $yyy; shift; shift; yyy=$@;
5122 case $# in 0) cont="";;
5123 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5124 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5125 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5126 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5130 do set $yyy; var=$2; eval "was=\$$2";
5131 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5132 set $yyy; shift; shift; yyy=$@;
5135 : see if stdlib is available
5136 set stdlib.h i_stdlib
5139 : check for lengths of integral types
5143 echo "Checking to see how big your integers are..." >&4
5152 printf("intsize=%d;\n", (int)sizeof(int));
5153 printf("longsize=%d;\n", (int)sizeof(long));
5154 printf("shortsize=%d;\n", (int)sizeof(short));
5159 if eval $compile_ok && $run ./try > /dev/null; then
5161 echo "Your integers are $intsize bytes long."
5162 echo "Your long integers are $longsize bytes long."
5163 echo "Your short integers are $shortsize bytes long."
5167 Help! I can't compile and run the intsize test program: please enlighten me!
5168 (This is probably a misconfiguration in your system or libraries, and
5169 you really ought to fix it. Still, I'll try anyway.)
5173 rp="What is the size of an integer (in bytes)?"
5177 rp="What is the size of a long integer (in bytes)?"
5181 rp="What is the size of a short integer (in bytes)?"
5189 : check for long long
5191 echo "Checking to see if you have long long..." >&4
5192 echo 'int main() { long long x = 7; return 0; }' > try.c
5194 if eval $compile; then
5196 echo "You have long long."
5199 echo "You do not have long long."
5205 : check for length of long long
5206 case "${d_longlong}${longlongsize}" in
5209 echo "Checking to see how big your long longs are..." >&4
5210 $cat >try.c <<'EOCP'
5214 printf("%d\n", (int)sizeof(long long));
5219 if eval $compile_ok; then
5220 longlongsize=`$run ./try`
5221 echo "Your long longs are $longlongsize bytes long."
5225 echo "(I can't seem to compile the test program. Guessing...)"
5226 rp="What is the size of a long long (in bytes)?"
5230 if $test "X$longsize" = "X$longlongsize"; then
5231 echo "(That isn't any different from an ordinary long.)"
5237 : see if inttypes.h is available
5238 : we want a real compile instead of Inhdr because some systems
5239 : have an inttypes.h which includes non-existent headers
5242 #include <inttypes.h>
5244 static int32_t foo32 = 0x12345678;
5248 if eval $compile; then
5249 echo "<inttypes.h> found." >&4
5252 echo "<inttypes.h> NOT found." >&4
5261 echo "Checking to see if you have int64_t..." >&4
5263 #include <sys/types.h>
5264 #$i_inttypes I_INTTYPES
5266 #include <inttypes.h>
5268 int main() { int64_t x = 7; }
5271 if eval $compile; then
5273 echo "You have int64_t."
5276 echo "You do not have int64_t."
5284 echo "Checking which 64-bit integer type we could use..." >&4
5290 val='"unsigned int"'
5295 *) case "$longsize" in
5299 val='"unsigned long"'
5304 *) case "$d_longlong:$longlongsize" in
5309 val='"unsigned long long"'
5314 *) case "$d_int64_t" in
5333 '') echo "Alas, no 64-bit integer types in sight." >&4
5336 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5342 case "$uselonglong" in
5343 "$define"|true|[yY]*)
5346 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5348 use64bitint="$define"
5351 case "$use64bits" in
5352 "$define"|true|[yY]*)
5355 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5357 use64bitint="$define"
5360 case "$use64bitints" in
5361 "$define"|true|[yY]*)
5364 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5366 use64bitint="$define"
5369 case "$use64bitsint" in
5370 "$define"|true|[yY]*)
5373 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5375 use64bitint="$define"
5378 case "$uselonglongs" in
5379 "$define"|true|[yY]*)
5382 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5384 use64bitint="$define"
5387 case "$use64bitsall" in
5388 "$define"|true|[yY]*)
5391 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5393 use64bitall="$define"
5398 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5400 case "$use64bitall" in
5401 "$define"|true|[yY]*) use64bitint="$define" ;;
5407 You have natively 64-bit long integers.
5411 *) case "$use64bitint" in
5412 "$define"|true|[yY]*) dflt='y';;
5421 Perl can be built to take advantage of 64-bit integer types
5422 on some systems. To do so, Configure can be run with -Duse64bitint.
5423 Choosing this option will most probably introduce binary incompatibilities.
5425 If this doesn't make any sense to you, just accept the default '$dflt'.
5426 (The default has been chosen based on your configuration.)
5428 rp='Try to use 64-bit integers, if available?'
5431 [yY]*) val="$define" ;;
5439 case "$use64bitall" in
5440 "$define"|true|[yY]*) dflt='y' ;;
5441 *) case "$longsize" in
5449 You may also choose to try maximal 64-bitness. It means using as much
5450 64-bitness as possible on the platform. This in turn means even more
5451 binary incompatibilities. On the other hand, your platform may not
5452 have any more 64-bitness available than what you already have chosen.
5454 If this doesn't make any sense to you, just accept the default '$dflt'.
5455 (The default has been chosen based on your configuration.)
5457 rp='Try to use maximal 64-bit support, if available?'
5460 [yY]*) val="$define" ;;
5465 case "$use64bitall" in
5467 case "$use64bitint" in
5471 Since you have chosen a maximally 64-bit build, I'm also turning on
5472 the use of 64-bit integers.
5474 use64bitint="$define" ;;
5479 : Look for a hint-file generated 'call-back-unit'. If the
5480 : user has specified that a 64-bit perl is to be built,
5481 : we may need to set or change some other defaults.
5482 if $test -f use64bitint.cbu; then
5483 echo "Your platform has some specific hints regarding 64-bit integers, using them..."
5486 case "$use64bitint" in
5487 "$define"|true|[yY]*)
5489 4) case "$archname64" in
5490 '') archname64=64int ;;
5497 : Look for a hint-file generated 'call-back-unit'. If the
5498 : user has specified that a maximally 64-bit perl is to be built,
5499 : we may need to set or change some other defaults.
5500 if $test -f use64bitall.cbu; then
5501 echo "Your platform has some specific hints regarding 64-bit builds, using them..."
5504 case "$use64bitall" in
5505 "$define"|true|[yY]*)
5507 4) case "$archname64" in
5508 ''|64int) archname64=64all ;;
5515 case "$d_quad:$use64bitint" in
5519 *** You have chosen to use 64-bit integers,
5520 *** but none can be found.
5521 *** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
5522 *** Cannot continue, aborting.
5529 : check for length of double
5531 case "$doublesize" in
5533 echo "Checking to see how big your double precision numbers are..." >&4
5542 printf("%d\n", (int)sizeof(double));
5547 if eval $compile_ok; then
5548 doublesize=`$run ./try`
5549 echo "Your double is $doublesize bytes long."
5552 echo "(I can't seem to compile the test program. Guessing...)"
5553 rp="What is the size of a double precision number (in bytes)?"
5561 : check for long doubles
5563 echo "Checking to see if you have long double..." >&4
5564 echo 'int main() { long double x = 7.0; }' > try.c
5566 if eval $compile; then
5568 echo "You have long double."
5571 echo "You do not have long double."
5577 : check for length of long double
5578 case "${d_longdbl}${longdblsize}" in
5581 echo "Checking to see how big your long doubles are..." >&4
5582 $cat >try.c <<'EOCP'
5586 printf("%d\n", sizeof(long double));
5591 if eval $compile; then
5592 longdblsize=`$run ./try`
5593 echo "Your long doubles are $longdblsize bytes long."
5597 echo "(I can't seem to compile the test program. Guessing...)" >&4
5598 rp="What is the size of a long double (in bytes)?"
5602 if $test "X$doublesize" = "X$longdblsize"; then
5603 echo "That isn't any different from an ordinary double."
5604 echo "I'll keep your setting anyway, but you may see some"
5605 echo "harmless compilation warnings."
5611 : determine the architecture name
5613 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
5614 tarch=`arch`"-$osname"
5615 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
5616 if uname -m > tmparch 2>&1 ; then
5617 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
5618 -e 's/$/'"-$osname/" tmparch`
5626 case "$myarchname" in
5629 echo "(Your architecture name used to be $myarchname.)"
5633 case "$targetarch" in
5635 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
5640 *) dflt="$archname";;
5642 rp='What is your architecture name'
5645 case "$usethreads" in
5647 echo "Threads selected." >&4
5649 *-thread*) echo "...and architecture name already has -thread." >&4
5651 *) archname="$archname-thread"
5652 echo "...setting architecture name to $archname." >&4
5657 case "$usemultiplicity" in
5659 echo "Multiplicity selected." >&4
5661 *-multi*) echo "...and architecture name already has -multi." >&4
5663 *) archname="$archname-multi"
5664 echo "...setting architecture name to $archname." >&4
5669 case "$use64bitint$use64bitall" in
5671 case "$archname64" in
5673 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
5676 case "$use64bitint" in
5677 "$define") echo "64 bit integers selected." >&4 ;;
5679 case "$use64bitall" in
5680 "$define") echo "Maximal 64 bitness selected." >&4 ;;
5683 *-$archname64*) echo "...and architecture name already has $archname64." >&4
5685 *) archname="$archname-$archname64"
5686 echo "...setting architecture name to $archname." >&4
5692 case "$uselongdouble" in
5694 echo "Long doubles selected." >&4
5695 case "$longdblsize" in
5697 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
5701 *-ld*) echo "...and architecture name already has -ld." >&4
5703 *) archname="$archname-ld"
5704 echo "...setting architecture name to $archname." >&4
5711 case "$useperlio" in
5713 echo "Perlio selected." >&4
5716 echo "Perlio not selected, using stdio." >&4
5718 *-stdio*) echo "...and architecture name already has -stdio." >&4
5720 *) archname="$archname-stdio"
5721 echo "...setting architecture name to $archname." >&4
5726 if $test -f archname.cbu; then
5727 echo "Your platform has some specific hints for architecture name, using them..."
5731 : determine root of directory hierarchy where package will be installed.
5734 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
5737 dflt=`echo "$prefix" | sed 's/.$//'`
5745 By default, $package will be installed in $dflt/bin, manual pages
5746 under $dflt/man, etc..., i.e. with $dflt as prefix for all
5747 installation directories. Typically this is something like /usr/local.
5748 If you wish to have binaries under /usr/bin but other parts of the
5749 installation under /usr/local, that's ok: you will be prompted
5750 separately for each of the installation directories, the prefix being
5751 only used to set the defaults.
5755 rp='Installation prefix to use?'
5763 *) oldprefix="$prefix";;
5772 *) afsroot=$afsroot ;;
5778 $define|true) afs=true ;;
5779 $undef|false) afs=false ;;
5780 *) if test -d $afsroot; then
5788 echo "AFS may be running... I'll be extra cautious then..." >&4
5790 echo "AFS does not seem to be running..." >&4
5793 : determine installation prefix for where package is to be installed.
5797 Since you are running AFS, I need to distinguish the directory in which
5798 files will reside from the directory in which they are installed (and from
5799 which they are presumably copied to the former directory by occult means).
5802 case "$installprefix" in
5803 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
5804 *) dflt="$installprefix";;
5809 In some special cases, particularly when building $package for distribution,
5810 it is convenient to distinguish the directory in which files should be
5811 installed from the directory ($prefix) in which they will
5812 eventually reside. For most users, these two directories are the same.
5815 case "$installprefix" in
5817 *) dflt=$installprefix;;
5821 rp='What installation prefix should I use for installing files?'
5823 installprefix="$ans"
5824 installprefixexp="$ansexp"
5826 : set the prefixit variable, to compute a suitable default value
5827 prefixit='case "$3" in
5829 case "$oldprefix" in
5830 "") eval "$1=\"\$$2\"";;
5837 ""|" ") eval "$1=\"\$$2\"";;
5843 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
5845 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
5846 /*-$oldprefix/*|\~*-$oldprefix/*)
5847 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
5848 *) eval "$1=\"\$$2\"";;
5852 : get the patchlevel
5854 echo "Getting the current patchlevel..." >&4
5855 if $test -r $rsrc/patchlevel.h;then
5856 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
5857 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
5858 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5859 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
5860 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
5861 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
5862 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
5871 $echo "(You do not have patchlevel.h. Eek.)"
5873 if $test -r $rsrc/.patch ; then
5874 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
5875 perl_patchlevel=`cat $rsrc/.patch`
5878 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
5879 version_patchlevel_string="version $patchlevel subversion $subversion"
5880 case "$perl_patchlevel" in
5882 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
5885 $echo "(You have $package $version_patchlevel_string.)"
5889 : XXX Should be a Configure test for double-dots in filenames.
5890 version=`echo $revision $patchlevel $subversion | \
5891 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5892 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5893 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
5896 version=`echo $revision $patchlevel $subversion | \
5897 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5898 api_versionstring=`echo $api_revision $api_version $api_subversion | \
5899 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
5902 : Special case the 5.005_xx maintenance series, which used 5.005
5903 : without any subversion label as a subdirectory in $sitelib
5904 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
5905 api_versionstring='5.005'
5908 : determine installation style
5909 : For now, try to deduce it from prefix unless it is already set.
5910 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
5911 case "$installstyle" in
5912 '') case "$prefix" in
5913 *perl*) dflt='lib';;
5914 *) dflt='lib/perl5' ;;
5917 *) dflt="$installstyle" ;;
5919 : Probably not worth prompting for this since we prompt for all
5920 : the directories individually, and the prompt would be too long and
5924 : determine where private library files go
5925 : Usual default is /usr/local/lib/perl5/$version.
5926 : Also allow things like /opt/perl/lib/$version, since
5927 : /opt/perl/lib/perl5... would be redundant.
5928 : The default "style" setting is made in installstyle.U
5929 case "$installstyle" in
5930 *lib/perl5*) set dflt privlib lib/$package/$version ;;
5931 *) set dflt privlib lib/$version ;;
5936 There are some auxiliary files for $package that need to be put into a
5937 private library directory that is accessible by everyone.
5941 rp='Pathname where the private library files will reside?'
5944 privlibexp="$ansexp"
5945 : Change installation prefix, if necessary.
5946 if $test X"$prefix" != X"$installprefix"; then
5947 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
5949 installprivlib="$privlibexp"
5952 : set the prefixup variable, to restore leading tilda escape
5953 prefixup='case "$prefixexp" in
5955 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
5958 : determine where public architecture dependent libraries go
5961 : privlib default is /usr/local/lib/$package/$version
5962 : archlib default is /usr/local/lib/$package/$version/$archname
5963 : privlib may have an optional trailing /share.
5964 tdflt=`echo $privlib | $sed 's,/share$,,'`
5965 tdflt=$tdflt/$archname
5974 $spackage contains architecture-dependent library files. If you are
5975 sharing libraries in a heterogeneous environment, you might store
5976 these files in a separate location. Otherwise, you can just include
5977 them with the rest of the public library files.
5981 rp='Where do you want to put the public architecture-dependent libraries?'
5984 archlibexp="$ansexp"
5985 if $test X"$archlib" = X"$privlib"; then
5990 : Change installation prefix, if necessary.
5991 if $test X"$prefix" != X"$installprefix"; then
5992 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
5994 installarchlib="$archlibexp"
5997 : see if setuid scripts can be secure
6000 Some kernels have a bug that prevents setuid #! scripts from being
6001 secure. Some sites have disabled setuid #! scripts because of this.
6003 First let's decide if your kernel supports secure setuid #! scripts.
6004 (If setuid #! scripts would be secure but have been disabled anyway,
6005 don't say that they are secure if asked.)
6010 if $test -d /dev/fd; then
6011 echo "#!$ls" >reflect
6012 chmod +x,u+s reflect
6013 ./reflect >flect 2>&1
6014 if $contains "/dev/fd" flect >/dev/null; then
6015 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6019 If you are not sure if they are secure, I can check but I'll need a
6020 username and password different from the one you are using right now.
6021 If you don't have such a username or don't want me to test, simply
6025 rp='Other username to test security of setuid scripts with?'
6030 case "$d_suidsafe" in
6031 '') echo "I'll assume setuid scripts are *not* secure." >&4
6034 echo "Well, the $hint value is *not* secure." >&4
6036 *) echo "Well, the $hint value *is* secure." >&4
6041 $rm -f reflect flect
6042 echo "#!$ls" >reflect
6043 chmod +x,u+s reflect
6046 echo '"su" will (probably) prompt you for '"$ans's password."
6047 su $ans -c './reflect >flect'
6048 if $contains "/dev/fd" flect >/dev/null; then
6049 echo "Okay, it looks like setuid scripts are secure." >&4
6052 echo "I don't think setuid scripts are secure." >&4
6057 rp='Does your kernel have *secure* setuid scripts?'
6060 [yY]*) val="$define";;
6065 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6066 echo "(That's for file descriptors, not floppy disks.)"
6072 $rm -f reflect flect
6074 : now see if they want to do setuid emulation
6077 case "$d_suidsafe" in
6080 echo "No need to emulate SUID scripts since they are secure here." >&4
6084 Some systems have disabled setuid scripts, especially systems where
6085 setuid scripts cannot be secure. On systems where setuid scripts have
6086 been disabled, the setuid/setgid bits on scripts are currently
6087 useless. It is possible for $package to detect those bits and emulate
6088 setuid/setgid in a secure fashion. This emulation will only work if
6089 setuid scripts have been disabled in your kernel.
6093 "$define") dflt=y ;;
6096 rp="Do you want to do setuid/setgid emulation?"
6099 [yY]*) val="$define";;
6107 : see if this is a malloc.h system
6108 : we want a real compile instead of Inhdr because some systems have a
6109 : malloc.h that just gives a compile error saying to use stdlib.h instead
6114 int main () { return 0; }
6117 if eval $compile; then
6118 echo "<malloc.h> found." >&4
6121 echo "<malloc.h> NOT found." >&4
6128 : check for void type
6130 echo "Checking to see how well your C compiler groks the void type..." >&4
6131 case "$voidflags" in
6143 extern void moo(); /* function returning void */
6144 void (*goo)(); /* ptr to func returning void */
6146 void *hue; /* generic ptr */
6159 int main() { sub(); }
6161 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6162 voidflags=$defvoidused
6163 echo "Good. It appears to support void to the level $package wants.">&4
6164 if $contains warning .out >/dev/null 2>&1; then
6165 echo "However, you might get some warnings that look like this:"
6169 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6170 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6171 echo "It supports 1..."
6172 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6173 echo "It also supports 2..."
6174 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6176 echo "And it supports 4 but not 8 definitely."
6178 echo "It doesn't support 4..."
6179 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6181 echo "But it supports 8."
6184 echo "Neither does it support 8."
6188 echo "It does not support 2..."
6189 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6191 echo "But it supports 4 and 8."
6193 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6195 echo "And it supports 4 but has not heard about 8."
6197 echo "However it supports 8 but not 4."
6202 echo "There is no support at all for void."
6207 case "$voidflags" in
6210 Support flag bits are:
6211 1: basic void declarations.
6212 2: arrays of pointers to functions returning void.
6213 4: operations between pointers to and addresses of void functions.
6214 8: generic void pointers.
6217 rp="Your void support flags add up to what?"
6224 : check for length of pointer
6228 echo "Checking to see how big your pointers are..." >&4
6229 if test "$voidflags" -gt 7; then
6230 echo '#define VOID_PTR char *' > try.c
6232 echo '#define VOID_PTR void *' > try.c
6242 printf("%d\n", (int)sizeof(VOID_PTR));
6247 if eval $compile_ok; then
6248 ptrsize=`$run ./try`
6249 echo "Your pointers are $ptrsize bytes long."
6252 echo "(I can't seem to compile the test program. Guessing...)" >&4
6253 rp="What is the size of a pointer (in bytes)?"
6260 case "$use64bitall" in
6261 "$define"|true|[yY]*)
6265 *** You have chosen a maximally 64-bit build,
6266 *** but your pointers are only 4 bytes wide.
6267 *** Please rerun Configure without -Duse64bitall.
6272 *** Since you have quads, you could possibly try with -Duse64bitint.
6277 *** Cannot continue, aborting.
6288 : determine whether to use malloc wrapping
6290 case "$usemallocwrap" in
6291 [yY]*|true|$define) dflt='y' ;;
6292 [nN]*|false|$undef) dflt='n' ;;
6293 *) case "$usedevel" in
6294 [yY]*|true|$define) dflt='y' ;;
6299 rp="Do you wish to wrap malloc calls to protect against potential overflows?"
6301 usemallocwrap="$ans"
6304 usemallocwrap="$define" ;;
6306 usemallocwrap="$undef" ;;
6309 : determine which malloc to compile in
6311 case "$usemymalloc" in
6312 [yY]*|true|$define) dflt='y' ;;
6313 [nN]*|false|$undef) dflt='n' ;;
6314 *) case "$ptrsize" in
6320 rp="Do you wish to attempt to use the malloc that comes with $package?"
6326 mallocsrc='malloc.c'
6327 mallocobj="malloc$_o"
6328 d_mymalloc="$define"
6331 : Remove malloc from list of libraries to use
6332 echo "Removing unneeded -lmalloc from library list" >&4
6333 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6336 echo "libs = $libs" >&4
6348 : compute the return types of malloc and free
6350 $cat >malloc.c <<END
6354 #include <sys/types.h>
6368 case "$malloctype" in
6370 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6377 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6381 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6388 echo "Your system uses $freetype free(), it would seem." >&4
6392 After $package is installed, you may wish to install various
6393 add-on modules and utilities. Typically, these add-ons will
6394 be installed under $prefix with the rest
6395 of this package. However, you may wish to install such add-ons
6396 elsewhere under a different prefix.
6398 If you do not wish to put everything under a single prefix, that's
6399 ok. You will be prompted for the individual locations; this siteprefix
6400 is only used to suggest the defaults.
6402 The default should be fine for most people.
6406 rp='Installation prefix to use for add-on modules and utilities?'
6407 : XXX Here might be another good place for an installstyle setting.
6408 case "$siteprefix" in
6410 *) dflt=$siteprefix ;;
6413 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6415 case "$siteprefix" in
6419 *) oldsiteprefix="$prefix";;
6424 siteprefixexp="$ansexp"
6426 : determine where site specific libraries go.
6427 : Usual default is /usr/local/lib/perl5/site_perl/$version
6428 : The default "style" setting is made in installstyle.U
6429 : XXX No longer works with Prefixit stuff.
6430 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6432 '') case "$installstyle" in
6433 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6434 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6442 The installation process will create a directory for
6443 site-specific extensions and modules. Most users find it convenient
6444 to place all site-specific files in this directory rather than in the
6445 main distribution directory.
6449 rp='Pathname for the site-specific library files?'
6452 sitelibexp="$ansexp"
6453 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6454 : Change installation prefix, if necessary.
6455 if $test X"$prefix" != X"$installprefix"; then
6456 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6458 installsitelib="$sitelibexp"
6461 : determine where site specific architecture-dependent libraries go.
6462 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6463 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6464 : sitelib may have an optional trailing /share.
6466 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6467 dflt="$dflt/$archname"
6472 set sitearch sitearch none
6476 The installation process will also create a directory for
6477 architecture-dependent site-specific extensions and modules.
6481 rp='Pathname for the site-specific architecture-dependent library files?'
6484 sitearchexp="$ansexp"
6485 : Change installation prefix, if necessary.
6486 if $test X"$prefix" != X"$installprefix"; then
6487 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6489 installsitearch="$sitearchexp"
6494 The installation process will also create a directory for
6495 vendor-supplied add-ons. Vendors who supply perl with their system
6496 may find it convenient to place all vendor-supplied files in this
6497 directory rather than in the main distribution directory. This will
6498 ease upgrades between binary-compatible maintenance versions of perl.
6500 Of course you may also use these directories in whatever way you see
6501 fit. For example, you might use them to access modules shared over a
6502 company-wide network.
6504 The default answer should be fine for most people.
6505 This causes further questions about vendor add-ons to be skipped
6506 and no vendor-specific directories will be configured for perl.
6509 rp='Do you want to configure vendor-specific add-on directories?'
6510 case "$usevendorprefix" in
6511 define|true|[yY]*) dflt=y ;;
6512 *) : User may have set vendorprefix directly on Configure command line.
6513 case "$vendorprefix" in
6522 rp='Installation prefix to use for vendor-supplied add-ons?'
6523 case "$vendorprefix" in
6525 *) dflt=$vendorprefix ;;
6528 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6530 case "$vendorprefix" in
6534 *) oldvendorprefix="$prefix";;
6538 usevendorprefix="$define"
6540 vendorprefixexp="$ansexp"
6542 *) usevendorprefix="$undef"
6548 case "$vendorprefix" in
6549 '') d_vendorlib="$undef"
6553 *) d_vendorlib="$define"
6554 : determine where vendor-supplied modules go.
6555 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
6556 case "$vendorlib" in
6558 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6559 case "$installstyle" in
6560 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
6561 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
6564 *) dflt="$vendorlib"
6568 rp='Pathname for the vendor-supplied library files?'
6571 vendorlibexp="$ansexp"
6574 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
6575 : Change installation prefix, if necessary.
6576 if $test X"$prefix" != X"$installprefix"; then
6577 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
6579 installvendorlib="$vendorlibexp"
6582 case "$vendorprefix" in
6583 '') d_vendorarch="$undef"
6587 *) d_vendorarch="$define"
6588 : determine where vendor-supplied architecture-dependent libraries go.
6589 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
6590 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
6591 : vendorlib may have an optional trailing /share.
6592 case "$vendorarch" in
6593 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
6594 dflt="$dflt/$archname"
6596 *) dflt="$vendorarch" ;;
6599 rp='Pathname for vendor-supplied architecture-dependent files?'
6602 vendorarchexp="$ansexp"
6605 : Change installation prefix, if necessary.
6606 if $test X"$prefix" != X"$installprefix"; then
6607 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
6609 installvendorarch="$vendorarchexp"
6612 : Final catch-all directories to search
6615 Lastly, you can have perl look in other directories for extensions and
6616 modules in addition to those already specified.
6617 These directories will be searched after
6621 test X"$vendorlib" != "X" && echo ' ' $vendorlib
6622 test X"$vendorarch" != "X" && echo ' ' $vendorarch
6624 case "$otherlibdirs" in
6625 ''|' ') dflt='none' ;;
6626 *) dflt="$otherlibdirs" ;;
6629 Enter a colon-separated set of extra paths to include in perl's @INC
6630 search path, or enter 'none' for no extra paths.
6634 rp='Colon-separated list of additional directories for perl to search?'
6637 ' '|''|none) otherlibdirs=' ' ;;
6638 *) otherlibdirs="$ans" ;;
6640 case "$otherlibdirs" in
6644 set d_perl_otherlibdirs
6647 : Cruising for prototypes
6649 echo "Checking out function prototypes..." >&4
6650 $cat >prototype.c <<EOCP
6655 int main(int argc, char *argv[]) {
6658 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
6659 echo "Your C compiler appears to support function prototypes."
6662 echo "Your C compiler doesn't seem to understand function prototypes."
6669 case "$prototype" in
6671 *) ansi2knr='ansi2knr'
6676 This version of $package can only be compiled by a compiler that
6677 understands function prototypes. Unfortunately, your C compiler
6679 doesn't seem to understand them. Sorry about that.
6681 If GNU cc is available for your system, perhaps you could try that instead.
6683 Eventually, we hope to support building Perl with pre-ANSI compilers.
6684 If you would like to help in that effort, please contact <perlbug@perl.org>.
6686 Aborting Configure now.
6692 : determine where public executables go
6697 rp='Pathname where the public executables will reside?'
6699 if $test "X$ansexp" != "X$binexp"; then
6704 : Change installation prefix, if necessary.
6705 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
6706 if $test X"$prefix" != X"$installprefix"; then
6707 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
6709 installbin="$binexp"
6718 Perl can be built with extra modules or bundles of modules which
6719 will be fetched from the CPAN and installed alongside Perl.
6721 Notice that you will need access to the CPAN; either via the Internet,
6722 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
6723 be asked later to configure the CPAN.pm module which will in turn do
6724 the installation of the rest of the extra modules or bundles.)
6726 Notice also that if the modules require any external software such as
6727 libraries and headers (the libz library and the zlib.h header for the
6728 Compress::Zlib module, for example) you MUST have any such software
6729 already installed, this configuration process will NOT install such
6732 If this doesn't make any sense to you, just accept the default '$dflt'.
6734 rp='Install any extra modules (y or n)?'
6740 Please list any extra modules or bundles to be installed from CPAN,
6741 with spaces between the names. The names can be in any format the
6742 'install' command of CPAN.pm will understand. (Answer 'none',
6743 without the quotes, to install no extra modules or bundles.)
6753 $rm -f ../extras.lst
6755 *) echo "(Saving the list of extras for later...)"
6756 echo "$extras" > ../extras.lst
6764 : determine where html pages for programs go
6765 set html1dir html1dir none
6769 If you wish to install html files for programs in $spackage, indicate
6770 the appropriate directory here. To skip installing html files,
6774 ''|none|$undef|' ') dflt=none ;;
6775 *) dflt=$html1dir ;;
6778 rp="Directory for the main $spackage html pages?"
6781 html1direxp="$ansexp"
6782 : Use ' ' for none so value is preserved next time through Configure
6783 $test X"$html1dir" = "X" && html1dir=' '
6784 : Change installation prefix, if necessary.
6785 if $test X"$prefix" != X"$installprefix"; then
6786 installhtml1dir=`echo $html1direxp | sed "s#^$prefix#$installprefix#"`
6788 installhtml1dir="$html1direxp"
6791 : determine where html pages for libraries and modules go
6792 set html3dir html3dir none
6796 If you wish to install html files for modules associated with $spackage,
6797 indicate the appropriate directory here. To skip installing html files,
6800 : There is no obvious default. If they have specified html1dir, then
6801 : try to key off that, possibly changing .../html1 into .../html3.
6803 '') html3dir=`echo "$html1dir" | $sed 's/1$/3$/'` ;;
6804 *) dflt=$html3dir ;;
6807 rp="Directory for the $spackage module html pages?"
6810 html3direxp="$ansexp"
6811 : Use ' ' for none so value is preserved next time through Configure
6812 $test X"$html3dir" = "X" && html3dir=' '
6813 : Change installation prefix, if necessary.
6814 if $test X"$prefix" != X"$installprefix"; then
6815 installhtml3dir=`echo $html3direxp | sed "s#^$prefix#$installprefix#"`
6817 installhtml3dir="$html3direxp"
6820 : Find perl5.005 or later.
6821 echo "Looking for a previously installed perl5.005 or later... "
6823 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
6824 : Check if this perl is recent and can load a simple module
6825 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6828 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
6838 '') echo "None found. That's ok.";;
6839 *) echo "Using $perl5." ;;
6842 : Determine list of previous versions to include in @INC
6843 $cat > getverlist <<EOPL
6846 \$api_versionstring = "$api_versionstring";
6847 \$version = "$version";
6848 \$stem = "$sitelib_stem";
6849 \$archname = "$archname";
6851 $cat >> getverlist <<'EOPL'
6852 # Can't have leading @ because metaconfig interprets it as a command!
6853 ;@inc_version_list=();
6854 # XXX Redo to do opendir/readdir?
6857 ;@candidates = glob("5.*");
6863 # XXX ToDo: These comparisons must be reworked when two-digit
6864 # subversions come along, so that 5.7.10 compares as greater than
6865 # 5.7.3! By that time, hope that 5.6.x is sufficiently
6866 # widespread that we can use the built-in version vectors rather
6867 # than reinventing them here. For 5.6.0, however, we must
6868 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
6869 foreach $d (@candidates) {
6870 if ($d lt $version) {
6871 if ($d ge $api_versionstring) {
6872 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
6874 elsif ($d ge "5.005") {
6875 unshift(@inc_version_list, grep { -d } $d);
6879 # Skip newer version. I.e. don't look in
6880 # 5.7.0 if we're installing 5.6.1.
6884 if (@inc_version_list) {
6885 print join(' ', @inc_version_list);
6888 # Blank space to preserve value for next Configure run.
6893 case "$inc_version_list" in
6894 '') if test -x "$perl5$exe_ext"; then
6895 dflt=`$perl5 getverlist`
6900 $undef) dflt='none' ;;
6901 *) eval dflt=\"$inc_version_list\" ;;
6904 ''|' ') dflt=none ;;
6911 In order to ease the process of upgrading, this version of perl
6912 can be configured to use modules built and installed with earlier
6913 versions of perl that were installed under $prefix. Specify here
6914 the list of earlier versions that this version of perl should check.
6915 If Configure detected no earlier versions of perl installed under
6916 $prefix, then the list will be empty. Answer 'none' to tell perl
6917 to not search earlier versions.
6919 The default should almost always be sensible, so if you're not sure,
6920 just accept the default.
6923 rp='List of earlier versions to include in @INC?'
6926 [Nn]one|''|' '|$undef) inc_version_list=' ' ;;
6927 *) inc_version_list="$ans" ;;
6929 case "$inc_version_list" in
6931 inc_version_list_init='0';;
6932 *) inc_version_list_init=`echo $inc_version_list |
6933 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
6938 : determine whether to install perl also as /usr/bin/perl
6941 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
6943 Many scripts expect perl to be installed as /usr/bin/perl.
6945 If you want to, I can install the perl you are about to compile
6946 as /usr/bin/perl (in addition to $bin/perl).
6948 if test -f /usr/bin/perl; then
6951 However, please note that because you already have a /usr/bin/perl,
6952 overwriting that with a new Perl would very probably cause problems.
6953 Therefore I'm assuming you don't want to do that (unless you insist).
6956 case "$installusrbinperl" in
6957 "$define"|[yY]*) dflt='y';;
6963 Since you don't have a /usr/bin/perl I'm assuming creating one is okay.
6966 case "$installusrbinperl" in
6967 "$undef"|[nN]*) dflt='n';;
6971 rp="Do you want to install perl as /usr/bin/perl?"
6974 [yY]*) val="$define";;
6980 set installusrbinperl
6984 echo "Checking for GNU C Library..." >&4
6986 /* Find out version of GNU C library. __GLIBC__ and __GLIBC_MINOR__
6987 alone are insufficient to distinguish different versions, such as
6988 2.0.6 and 2.0.7. The function gnu_get_libc_version() appeared in
6989 libc version 2.1.0. A. Dougherty, June 3, 2002.
6995 # ifdef __GLIBC_MINOR__
6996 # if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
6997 # include <gnu/libc-version.h>
6998 printf("%s\n", gnu_get_libc_version());
7000 printf("%d.%d\n", __GLIBC__, __GLIBC_MINOR__);
7003 printf("%d\n", __GLIBC__);
7012 if eval $compile_ok && $run ./try > glibc.ver; then
7014 gnulibc_version=`$cat glibc.ver`
7015 echo "You are using the GNU C Library version $gnulibc_version"
7019 echo "You are not using the GNU C Library"
7021 $rm -f try try.* glibc.ver
7025 : see if nm is to be used to determine whether a symbol is defined or not
7029 case "$d_gnulibc" in
7032 echo "nm probably won't work on the GNU C Library." >&4
7038 if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
7040 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
7041 echo "'nm' won't be sufficient on this sytem." >&4
7047 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
7048 if $test $dflt -gt 20; then
7058 true|$define) dflt=y;;
7065 I can use $nm to extract the symbols from your C libraries. This
7066 is a time consuming task which may generate huge output on the disk (up
7067 to 3 megabytes) but that should make the symbols extraction faster. The
7068 alternative is to skip the 'nm' extraction part and to compile a small
7069 test program instead to determine whether each symbol is present. If
7070 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
7071 this may be the best solution.
7073 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
7076 rp="Shall I use $nm to extract C symbols from the libraries?"
7079 [Nn]*) usenm=false;;
7088 : nm options which may be necessary
7090 '') if $test -f /mach_boot; then
7092 elif $test -d /usr/ccs/lib; then
7093 nm_opt='-p' # Solaris (and SunOS?)
7094 elif $test -f /dgux; then
7096 elif $test -f /lib64/rld; then
7097 nm_opt='-p' # 64-bit Irix
7103 : nm options which may be necessary for shared libraries but illegal
7104 : for archive libraries. Thank you, Linux.
7105 case "$nm_so_opt" in
7106 '') case "$myuname" in
7108 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
7109 nm_so_opt='--dynamic'
7118 : get list of predefined functions in a handy place
7123 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
7129 *) for thislib in $libs; do
7132 : Handle C library specially below.
7135 thislib=`echo $thislib | $sed -e 's/^-l//'`
7136 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
7138 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
7140 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
7142 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
7144 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
7146 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
7148 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
7153 libnames="$libnames $try"
7155 *) libnames="$libnames $thislib" ;;
7164 for xxx in $libpth; do
7165 $test -r $1 || set $xxx/libc.$so
7166 : The messy sed command sorts on library version numbers.
7168 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
7169 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
7171 s/[0-9][0-9]*/0000&/g
7172 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
7175 $sort | $sed -e 's/^.* //'`
7178 $test -r $1 || set /usr/ccs/lib/libc.$so
7179 $test -r $1 || set /lib/libsys_s$_a
7185 if $test -r "$1"; then
7186 echo "Your (shared) C library seems to be in $1."
7188 elif $test -r /lib/libc && $test -r /lib/clib; then
7189 echo "Your C library seems to be in both /lib/clib and /lib/libc."
7191 libc='/lib/clib /lib/libc'
7192 if $test -r /lib/syslib; then
7193 echo "(Your math library is in /lib/syslib.)"
7194 libc="$libc /lib/syslib"
7196 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7197 echo "Your C library seems to be in $libc, as you said before."
7198 elif $test -r $incpath/usr/lib/libc$_a; then
7199 libc=$incpath/usr/lib/libc$_a;
7200 echo "Your C library seems to be in $libc. That's fine."
7201 elif $test -r /lib/libc$_a; then
7203 echo "Your C library seems to be in $libc. You're normal."
7205 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
7207 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
7208 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
7209 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
7211 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7213 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
7216 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
7218 if $test -r "$tans"; then
7219 echo "Your C library seems to be in $tans, of all places."
7225 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
7229 If the guess above is wrong (which it might be if you're using a strange
7230 compiler, or your machine supports multiple models), you can override it here.
7235 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
7237 I can't seem to find your C library. I've looked in the following places:
7240 $sed 's/^/ /' libpath
7243 None of these seems to contain your C library. I need to get its name...
7248 rp='Where is your C library?'
7253 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
7254 set X `cat libnames`
7257 case $# in 1) xxx=file; esac
7258 echo "Extracting names from the following $xxx for later perusal:" >&4
7260 $sed 's/^/ /' libnames >&4
7262 $echo $n "This may take a while...$c" >&4
7266 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
7267 *) $nm $nm_opt $file 2>/dev/null;;
7272 $grep fprintf libc.tmp > libc.ptf
7273 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
7274 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
7276 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *//p'";\
7278 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7280 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
7282 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7284 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
7286 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7288 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
7290 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7292 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
7294 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7296 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
7298 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7300 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
7301 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
7303 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7305 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
7307 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7309 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
7311 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7313 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
7315 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7317 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
7319 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7321 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
7323 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7325 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
7327 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7329 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
7331 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
7334 $nm -p $* 2>/dev/null >libc.tmp
7335 $grep fprintf libc.tmp > libc.ptf
7336 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
7337 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
7343 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
7345 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
7346 for thisname in $libnames $libc; do
7347 $ar t $thisname >>libc.tmp
7349 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
7351 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
7352 # Repeat libc to extract forwarders to DLL entries too
7353 for thisname in $libnames $libc; do
7354 $ar tv $thisname >>libc.tmp
7355 # Revision 50 of EMX has bug in $ar.
7356 # it will not extract forwarders to DLL entries
7357 # Use emximp which will extract exactly them.
7358 emximp -o tmp.imp $thisname \
7360 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
7361 < tmp.imp >>libc.tmp
7364 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
7367 echo "$ar didn't seem to work right." >&4
7368 echo "Maybe this is a Cray...trying bld instead..." >&4
7369 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
7371 for thisname in $libnames; do
7373 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
7374 $ar t $thisname >>libc.tmp
7378 echo "That didn't work either. Giving up." >&4
7388 echo "Since you are compiling for PASE, extracting more symbols from libc.a ...">&4
7389 dump -Tv /lib/libc.a | awk '$7 == "/unix" {print $5 " " $8}' | grep "^SV" | awk '{print $2}' >> libc.list
7391 *) if $test -f /lib/syscalls.exp; then
7393 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
7394 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
7400 $rm -f libnames libpath
7402 : see if dld is available
7406 : is a C symbol defined?
7409 -v) tf=libc.tmp; tdc="";;
7410 -a) tf=libc.tmp; tdc="[]";;
7411 *) tlook="^$1\$"; tf=libc.list; tdc="()";;
7414 case "$reuseval-$4" in
7416 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
7421 if $test "$runnm" = true; then
7422 if $contains $tlook $tf >/dev/null 2>&1; then
7424 elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
7425 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7426 $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
7427 $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
7428 $rm -f try$_exe try.c core core.* try.core;
7431 echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
7432 $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
7433 $rm -f try$_exe try.c;
7438 $define) tval=true;;
7445 : define an is-in-libc? function
7446 inlibc='echo " "; td=$define; tu=$undef;
7447 sym=$1; var=$2; eval "was=\$$2";
7449 case "$reuseval$was" in
7459 echo "$sym() found." >&4;
7460 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
7462 echo "$sym() NOT found." >&4;
7463 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
7467 $define) echo "$sym() found." >&4;;
7468 *) echo "$sym() NOT found." >&4;;
7472 : see if dlopen exists
7479 : determine which dynamic loading, if any, to compile in
7481 dldir="ext/DynaLoader"
7494 $define) dflt='y' ;;
7497 $define) dflt='y' ;;
7499 : Does a dl_xxx.xs file exist for this operating system
7500 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7503 rp="Do you wish to use dynamic loading?"
7510 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7511 dflt="$dldir/dl_${osname}.xs"
7512 elif $test "$d_dlopen" = "$define" ; then
7513 dflt="$dldir/dl_dlopen.xs"
7514 elif $test "$i_dld" = "$define" ; then
7515 dflt="$dldir/dl_dld.xs"
7520 *) dflt="$dldir/$dlsrc"
7523 echo "The following dynamic loading files are available:"
7524 : Can not go over to $dldir because getfile has path hard-coded in.
7525 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7526 rp="Source file to use for dynamic loading"
7532 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7536 Some systems may require passing special flags to $cc -c to
7537 compile modules that will be used to create a shared library.
7538 To use no flags, say "none".
7541 case "$cccdlflags" in
7542 '') case "$gccversion" in
7543 '') case "$osname" in
7545 next) dflt='none' ;;
7546 irix*) dflt='-KPIC' ;;
7547 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7548 sunos) dflt='-pic' ;;
7552 *) case "$osname" in
7553 darwin) dflt='none' ;;
7554 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7559 *) dflt="$cccdlflags" ;;
7561 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7564 none) cccdlflags=' ' ;;
7565 *) cccdlflags="$ans" ;;
7570 Some systems use ld to create libraries that can be dynamically loaded,
7571 while other systems (such as those using ELF) use $cc.
7575 '') $cat >try.c <<EOM
7576 /* Test for whether ELF binaries are produced */
7584 int i = open("a.out",O_RDONLY);
7587 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7588 exit(0); /* succeed (yes, it's ELF) */
7593 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7595 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7599 echo "I'll use ld to build dynamic libraries."
7608 rp="What command should be used to create dynamic libraries?"
7614 Some systems may require passing special flags to $ld to create a
7615 library that can be dynamically loaded. If your ld flags include
7616 -L/other/path options to locate libraries outside your loader's normal
7617 search path, you may need to specify those -L options here as well. To
7618 use no flags, say "none".
7621 case "$lddlflags" in
7622 '') case "$osname" in
7623 beos) dflt='-nostart' ;;
7625 case "$gccversion" in
7626 '') dflt="$dflt +vnocompatwarnings" ;;
7629 linux|irix*) dflt='-shared' ;;
7630 next) dflt='none' ;;
7631 solaris) dflt='-G' ;;
7632 sunos) dflt='-assert nodefinitions' ;;
7633 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7637 *) dflt="$lddlflags" ;;
7640 : Try to guess additional flags to pick up local libraries.
7641 : Be careful not to append to a plain 'none'
7645 for thisflag in $ldflags; do
7650 *) dflt="$dflt $thisflag" ;;
7657 ''|' ') dflt='none' ;;
7660 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7663 none) lddlflags=' ' ;;
7664 *) lddlflags="$ans" ;;
7669 Some systems may require passing special flags to $cc to indicate that
7670 the resulting executable will use dynamic linking. To use no flags,
7674 case "$ccdlflags" in
7675 '') case "$osname" in
7676 linux|hpux) dflt='-Wl,-E' ;;
7677 next|sunos) dflt='none' ;;
7681 *) dflt="$ccdlflags" ;;
7683 rp="Any special flags to pass to $cc to use dynamic linking?"
7686 none) ccdlflags=' ' ;;
7687 *) ccdlflags="$ans" ;;
7701 # No dynamic loading being used, so don't bother even to prompt.
7704 *) case "$useshrplib" in
7705 '') case "$osname" in
7706 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7708 also='Building a shared libperl is required for dynamic loading to work on your system.'
7713 also='Building a shared libperl is needed for MAB support.'
7731 The perl executable is normally obtained by linking perlmain.c with
7732 libperl${_a}, any static extensions (usually just DynaLoader), and
7733 any other libraries needed on this system (such as -lm, etc.). Since
7734 your system supports dynamic loading, it is probably possible to build
7735 a shared libperl.$so. If you will have more than one executable linked
7736 to libperl.$so, this will significantly reduce the size of each
7737 executable, but it may have a noticeable affect on performance. The
7738 default is probably sensible for your system.
7742 rp="Build a shared libperl.$so (y/n)"
7746 useshrplib='true' ;;
7747 *) useshrplib='false' ;;
7752 case "$useshrplib" in
7756 # Figure out a good name for libperl.so. Since it gets stored in
7757 # a version-specific architecture-dependent library, the version
7758 # number isn't really that important, except for making cc/ld happy.
7760 # A name such as libperl.so.3.1
7761 majmin="libperl.$so.$patchlevel.$subversion"
7762 # A name such as libperl.so.301
7763 majonly=`echo $patchlevel $subversion |
7764 $awk '{printf "%d%02d", $1, $2}'`
7765 majonly=libperl.$so.$majonly
7766 # I'd prefer to keep the os-specific stuff here to a minimum, and
7767 # rely on figuring it out from the naming of libc.
7768 case "${osname}${osvers}" in
7771 # XXX How handle the --version stuff for MAB?
7773 linux*) # ld won't link with a bare -lperl otherwise.
7776 cygwin*) # ld links against an importlib
7777 dflt=libperl$lib_ext
7779 *) # Try to guess based on whether libc has major.minor.
7781 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7782 *libc.$so.[0-9]*) dflt=$majonly ;;
7783 *) dflt=libperl.$so ;;
7793 I need to select a good name for the shared libperl. If your system uses
7794 library names with major and minor numbers, then you might want something
7795 like $majmin. Alternatively, if your system uses a single version
7796 number for shared libraries, then you might want to use $majonly.
7797 Or, your system might be quite happy with a simple libperl.$so.
7799 Since the shared libperl will get installed into a version-specific
7800 architecture-dependent directory, the version number of the shared perl
7801 library probably isn't important, so the default should be o.k.
7804 rp='What name do you want to give to the shared libperl?'
7807 echo "Ok, I'll use $libperl"
7810 libperl="libperl${_a}"
7814 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7818 WARNING: Use of the shrpdir variable for the installation location of
7819 the shared $libperl is not supported. It was never documented and
7820 will not work in this version. Let me (perlbug@perl.org)
7821 know of any problems this may cause.
7827 But your current setting of $shrpdir is
7828 the default anyway, so it's harmless.
7833 Further, your current attempted setting of $shrpdir
7834 conflicts with the value of $archlibexp/CORE
7835 that installperl will use.
7842 # How will the perl executable find the installed shared $libperl?
7843 # Add $xxx to ccdlflags.
7844 # If we can't figure out a command-line option, use $shrpenv to
7845 # set env LD_RUN_PATH. The main perl makefile uses this.
7846 shrpdir=$archlibexp/CORE
7849 if "$useshrplib"; then
7852 # We'll set it in Makefile.SH...
7857 freebsd|netbsd|openbsd)
7858 xxx="-Wl,-R$shrpdir"
7860 bsdos|linux|irix*|dec_osf)
7861 xxx="-Wl,-rpath,$shrpdir"
7864 # next doesn't like the default...
7867 # beos doesn't like the default, either.
7870 # hpux doesn't like the default, either.
7871 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7874 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7880 # Only add $xxx if it isn't already in ccdlflags.
7881 case " $ccdlflags " in
7883 *) ccdlflags="$ccdlflags $xxx"
7886 Adding $xxx to the flags
7887 passed to $ld so that the perl executable will find the
7888 installed shared $libperl.
7896 # Fix ccdlflags in AIX for building external extensions.
7897 # (For building Perl itself bare -bE:perl.exp is needed,
7898 # Makefile.SH takes care of this.)
7900 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7902 # Respect a hint or command-line value.
7904 '') shrpenv="$tmp_shrpenv" ;;
7906 case "$ldlibpthname" in
7907 '') ldlibpthname=LD_LIBRARY_PATH ;;
7908 none) ldlibpthname='' ;;
7911 : determine where manual pages are on this system
7915 syspath='/usr/share/man/man1 /usr/man/man1'
7916 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7917 syspath="$syspath /usr/man/u_man/man1"
7918 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7919 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7920 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7921 sysman=`./loc . /usr/man/man1 $syspath`
7924 if $test -d "$sysman"; then
7925 echo "System manual is in $sysman." >&4
7927 echo "Could not find manual pages in source form." >&4
7930 : determine where manual pages go
7931 set man1dir man1dir none
7935 $spackage has manual pages available in source form.
7939 echo "However, you don't have nroff, so they're probably useless to you."
7941 '') man1dir="none";;
7944 echo "If you don't want the manual sources installed, answer 'none'."
7949 lookpath="$prefixexp/share/man/man1"
7950 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7951 lookpath="$lookpath $prefixexp/man/p_man/man1"
7952 lookpath="$lookpath $prefixexp/man/u_man/man1"
7953 lookpath="$lookpath $prefixexp/man/man.1"
7955 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7956 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7966 rp="Where do the main $spackage manual pages (source) go?"
7968 if $test "X$man1direxp" != "X$ansexp"; then
7972 man1direxp="$ansexp"
7978 : Change installation prefix, if necessary.
7979 if $test X"$prefix" != X"$installprefix"; then
7980 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7982 installman1dir="$man1direxp"
7985 : What suffix to use on installed man pages
7992 rp="What suffix should be used for the main $spackage man pages?"
7994 '') case "$man1dir" in
8008 *) dflt="$man1ext";;
8015 : see if we can have long filenames
8017 first=123456789abcdef
8019 if (echo hi >$first) 2>/dev/null; then
8020 if $test -f 123456789abcde; then
8021 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
8024 echo 'You can have filenames longer than 14 characters.'>&4
8029 You can't have filenames longer than 14 chars.
8030 You can't even think about them!
8036 $rm -rf 123456789abcde*
8038 : determine where library module manual pages go
8039 set man3dir man3dir none
8043 $spackage has manual pages for many of the library modules.
8049 However, you don't have nroff, so they're probably useless to you.
8052 '') man3dir="none";;
8056 case "$d_flexfnam" in
8059 However, your system can't handle the long file names like File::Basename.3.
8062 '') man3dir="none";;
8066 echo "If you don't want the manual sources installed, answer 'none'."
8067 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
8069 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
8070 if $test -d "$privlib/man/man3"; then
8073 WARNING: Previous versions of perl installed man3 pages into
8074 $privlib/man/man3. This version will suggest a
8075 new default of $dflt.
8079 rp='Do you wish to preserve the old behavior?(y/n)'
8082 y*) dflt="$privlib/man/man3" ;;
8087 *) dflt="$man3dir" ;;
8094 rp="Where do the $package library man pages (source) go?"
8097 man3direxp="$ansexp"
8103 : Change installation prefix, if necessary.
8104 if $test X"$prefix" != X"$installprefix"; then
8105 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8107 installman3dir="$man3direxp"
8110 : What suffix to use on installed man pages
8116 rp="What suffix should be used for the $package library man pages?"
8118 '') case "$man3dir" in
8132 *) dflt="$man3ext";;
8139 : see if we have to deal with yellow pages, now NIS.
8140 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8141 if $test -f /usr/etc/nibindd; then
8143 echo "I'm fairly confident you're on a NeXT."
8145 rp='Do you get the hosts file via NetInfo?'
8154 y*) hostcat='nidump hosts .';;
8155 *) case "$hostcat" in
8156 nidump*) hostcat='';;
8166 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8174 rp='Are you getting the hosts file via yellow pages?'
8177 y*) hostcat='ypcat hosts';;
8178 *) hostcat='cat /etc/hosts';;
8184 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8187 '') test -f /etc/group && groupcat='cat /etc/group';;
8190 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8193 : now get the host name
8195 echo "Figuring out host name..." >&4
8196 case "$myhostname" in
8198 echo 'Maybe "hostname" will work...'
8199 if tans=`sh -c hostname 2>&1` ; then
8207 if $test "$cont"; then
8209 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8210 if tans=`cat /etc/systemid 2>&1` ; then
8212 phostname='cat /etc/systemid'
8213 echo "Whadyaknow. Xenix always was a bit strange..."
8216 elif $test -r /etc/systemid; then
8217 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8220 if $test "$cont"; then
8221 echo 'No, maybe "uuname -l" will work...'
8222 if tans=`sh -c 'uuname -l' 2>&1` ; then
8224 phostname='uuname -l'
8226 echo 'Strange. Maybe "uname -n" will work...'
8227 if tans=`sh -c 'uname -n' 2>&1` ; then
8229 phostname='uname -n'
8231 echo 'Oh well, maybe I can mine it out of whoami.h...'
8232 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8233 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8234 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8236 case "$myhostname" in
8237 '') echo "Does this machine have an identity crisis or something?"
8240 echo "Well, you said $myhostname before..."
8241 phostname='echo $myhostname';;
8247 case "$myhostname" in
8248 '') myhostname=noname ;;
8250 : you do not want to know about this
8255 if $test "$myhostname" ; then
8257 rp='Your host name appears to be "'$myhostname'".'" Right?"
8265 : bad guess or no guess
8266 while $test "X$myhostname" = X ; do
8268 rp="Please type the (one word) name of your host:"
8273 : translate upper to lower if necessary
8274 case "$myhostname" in
8276 echo "(Normalizing case in your host name)"
8277 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8281 case "$myhostname" in
8283 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8284 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8285 echo "(Trimming domain name from host name--host name is now $myhostname)"
8287 *) case "$mydomain" in
8290 test "X$hostcat" = "Xypcat hosts" &&
8291 ypmatch "$myhostname" hosts 2>/dev/null |\
8292 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8295 test "X$hostcat" != "X" &&
8296 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8297 /[ ]$myhostname[ . ]/p" > hosts
8300 if $test -f hosts; then
8301 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8302 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8303 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8304 hosts | $sort | $uniq | \
8305 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8306 case `$echo X$dflt` in
8307 X*\ *) echo "(Several hosts in the database matched hostname)"
8310 X.) echo "(You do not have fully-qualified names in the hosts database)"
8314 echo "(I cannot locate a hosts database anywhere)"
8319 tans=`./loc resolv.conf X /etc /usr/etc`
8320 if $test -f "$tans"; then
8321 echo "(Attempting domain name extraction from $tans)"
8322 dflt=.`$sed -n -e 's/ / /g' \
8323 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8324 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8326 .) dflt=.`$sed -n -e 's/ / /g' \
8327 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8328 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8335 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8336 dflt=.`sh -c domainname 2>/dev/null`
8339 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8343 case "$dflt$osname" in
8344 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8345 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8349 .) echo "(Lost all hope -- silly guess then)"
8355 *) dflt="$mydomain";;
8359 rp="What is your domain name?"
8369 : translate upper to lower if necessary
8372 echo "(Normalizing case in your domain name)"
8373 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8377 : a little sanity check here
8378 case "$phostname" in
8381 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8382 $myhostname$mydomain|$myhostname) ;;
8384 case "$phostname" in
8386 echo "(That doesn't agree with your whoami.h file, by the way.)"
8389 echo "(That doesn't agree with your $phostname command, by the way.)"
8399 I need to get your e-mail address in Internet format if possible, i.e.
8400 something like user@host.domain. Please answer accurately since I have
8401 no easy means to double check it. The default value provided below
8402 is most probably close to reality but may not be valid from outside
8403 your organization...
8407 while test "$cont"; do
8409 '') dflt="$cf_by@$myhostname$mydomain";;
8410 *) dflt="$cf_email";;
8412 rp='What is your e-mail address?'
8418 rp='Address does not look like an Internet one. Use it anyway?'
8434 If you or somebody else will be maintaining perl at your site, please
8435 fill in the correct e-mail address here so that they may be contacted
8436 if necessary. Currently, the "perlbug" program included with perl
8437 will send mail to this address in addition to perlbug@perl.org. You may
8438 enter "none" for no administrator.
8441 case "$perladmin" in
8442 '') dflt="$cf_email";;
8443 *) dflt="$perladmin";;
8445 rp='Perl administrator e-mail address'
8449 : determine whether to only install version-specific parts.
8452 Do you want to install only the version-specific parts of the perl
8453 distribution? Usually you do *not* want to do this.
8455 case "$versiononly" in
8456 "$define"|[Yy]*|true) dflt='y' ;;
8459 rp="Do you want to install only the version-specific parts of perl?"
8462 [yY]*) val="$define";;
8468 case "$versiononly" in
8469 "$define") inc_version_list=''
8470 inc_version_list_init=0
8474 : figure out how to guarantee perl startup
8475 case "$startperl" in
8477 case "$sharpbang" in
8481 I can use the #! construct to start perl on your system. This will
8482 make startup of perl scripts faster, but may cause problems if you
8483 want to share those scripts and perl is not in a standard place
8484 ($binexp/perl) on all your platforms. The alternative is to force
8485 a shell by starting the script with a single ':' character.
8488 case "$versiononly" in
8489 "$define") dflt="$binexp/perl$version";;
8490 *) dflt="$binexp/perl";;
8492 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8495 none) startperl=": # use perl";;
8496 *) startperl="#!$ans"
8497 if $test 30 -lt `echo "$ans" | wc -c`; then
8500 WARNING: Some systems limit the #! command to 32 characters.
8501 If you experience difficulty running Perl scripts with #!, try
8502 installing Perl in a directory with a shorter pathname.
8508 *) startperl=": # use perl"
8513 echo "I'll use $startperl to start perl scripts."
8515 : figure best path for perl in scripts
8518 case "$versiononly" in
8519 "$define") perlpath="$binexp/perl$version";;
8520 *) perlpath="$binexp/perl";;
8522 case "$startperl" in
8527 I will use the "eval 'exec'" idiom to start Perl on your system.
8528 I can use the full path of your Perl binary for this purpose, but
8529 doing so may cause problems if you want to share those scripts and
8530 Perl is not always in a standard place ($binexp/perl).
8534 rp="What path shall I use in \"eval 'exec'\"?"
8541 case "$startperl" in
8543 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8546 : determine where public executable scripts go
8547 set scriptdir scriptdir
8549 case "$scriptdir" in
8552 : guess some guesses
8553 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8554 $test -d /usr/share/bin && dflt=/usr/share/bin
8555 $test -d /usr/local/script && dflt=/usr/local/script
8556 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8557 $test -d $prefixexp/script && dflt=$prefixexp/script
8561 *) dflt="$scriptdir"
8566 Some installations have a separate directory just for executable scripts so
8567 that they can mount it across multiple architectures but keep the scripts in
8568 one spot. You might, for example, have a subdirectory of /usr/share for this.
8569 Or you might just lump your scripts in with all your other executables.
8573 rp='Where do you keep publicly executable scripts?'
8575 if $test "X$ansexp" != "X$scriptdirexp"; then
8579 scriptdirexp="$ansexp"
8580 : Change installation prefix, if necessary.
8581 if $test X"$prefix" != X"$installprefix"; then
8582 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8584 installscript="$scriptdirexp"
8587 : determine where add-on public executables go
8589 '') dflt=$siteprefix/bin ;;
8593 rp='Pathname where the add-on public executables should be installed?'
8596 sitebinexp="$ansexp"
8597 : Change installation prefix, if necessary.
8598 if $test X"$prefix" != X"$installprefix"; then
8599 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8601 installsitebin="$sitebinexp"
8604 : determine where add-on html pages go
8605 : There is no standard location, so try to copy the previously-selected
8606 : directory structure for the core html pages.
8607 case "$sitehtml1dir" in
8608 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8609 *) dflt=$sitehtml1dir ;;
8612 ''|' ') dflt=none ;;
8615 rp='Pathname where the site-specific html pages should be installed?'
8618 sitehtml1direxp="$ansexp"
8619 : Change installation prefix, if necessary.
8620 if $test X"$prefix" != X"$installprefix"; then
8621 installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
8623 installsitehtml1dir="$sitehtml1direxp"
8626 : determine where add-on library html pages go
8627 : There is no standard location, so try to copy the previously-selected
8628 : directory structure for the core html pages.
8629 case "$sitehtml3dir" in
8630 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
8631 *) dflt=$sitehtml3dir ;;
8634 ''|' ') dflt=none ;;
8637 rp='Pathname where the site-specific library html pages should be installed?'
8640 sitehtml3direxp="$ansexp"
8641 : Change installation prefix, if necessary.
8642 if $test X"$prefix" != X"$installprefix"; then
8643 installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
8645 installsitehtml3dir="$sitehtml3direxp"
8648 : determine where add-on manual pages go
8649 case "$siteman1dir" in
8650 '') dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
8651 *) dflt=$siteman1dir ;;
8654 ''|' ') dflt=none ;;
8657 rp='Pathname where the site-specific manual pages should be installed?'
8660 siteman1direxp="$ansexp"
8661 : Change installation prefix, if necessary.
8662 if $test X"$prefix" != X"$installprefix"; then
8663 installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
8665 installsiteman1dir="$siteman1direxp"
8668 : determine where add-on library man pages go
8669 case "$siteman3dir" in
8670 '') dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
8671 *) dflt=$siteman3dir ;;
8674 ''|' ') dflt=none ;;
8677 rp='Pathname where the site-specific library manual pages should be installed?'
8680 siteman3direxp="$ansexp"
8681 : Change installation prefix, if necessary.
8682 if $test X"$prefix" != X"$installprefix"; then
8683 installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
8685 installsiteman3dir="$siteman3direxp"
8688 : determine where add-on public executable scripts go
8689 case "$sitescript" in
8690 '') dflt=$siteprefix/script
8691 $test -d $dflt || dflt=$sitebin ;;
8692 *) dflt="$sitescript" ;;
8695 rp='Pathname where add-on public executable scripts should be installed?'
8698 sitescriptexp="$ansexp"
8699 : Change installation prefix, if necessary.
8700 if $test X"$prefix" != X"$installprefix"; then
8701 installsitescript=`echo $sitescriptexp | sed "s#^$prefix#$installprefix#"`
8703 installsitescript="$sitescriptexp"
8706 case "$usefaststdio" in
8707 $define|true|[yY]*|'')
8708 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
8718 Perl can be built to use 'fast stdio', which means using the stdio
8719 library but also directly manipulating the stdio buffers to enable
8720 faster I/O. Using stdio is better for backward compatibility (especially
8721 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
8722 interface has been preferred instead of stdio.
8724 If this doesn't make any sense to you, just accept the default '$dflt'.
8726 rp='Use the "fast stdio" if available?'
8729 y|Y) val="$define" ;;
8736 : define an is-a-typedef? function
8737 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8739 "") inclist="sys/types.h";;
8741 eval "varval=\$$var";
8745 for inc in $inclist; do
8746 echo "#include <$inc>" >>temp.c;
8748 echo "#ifdef $type" >> temp.c;
8749 echo "printf(\"We have $type\");" >> temp.c;
8750 echo "#endif" >> temp.c;
8751 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8752 if $contains $type temp.E >/dev/null 2>&1; then
8758 *) eval "$var=\$varval";;
8761 : define an is-a-typedef? function that prompts if the type is not available.
8762 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8764 "") inclist="sys/types.h";;
8766 eval "varval=\$$var";
8770 for inc in $inclist; do
8771 echo "#include <$inc>" >>temp.c;
8773 echo "#ifdef $type" >> temp.c;
8774 echo "printf(\"We have $type\");" >> temp.c;
8775 echo "#endif" >> temp.c;
8776 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8778 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8779 if $contains $type temp.E >/dev/null 2>&1; then
8780 echo "$type found." >&4;
8783 echo "$type NOT found." >&4;
8789 *) eval "$var=\$varval";;
8792 : see what type lseek is declared as in the kernel
8793 rp="What is the type used for lseek's offset on this system?"
8794 set off_t lseektype long stdio.h sys/types.h
8798 echo "Checking to see how big your file offsets are..." >&4
8800 #include <sys/types.h>
8804 printf("%d\n", (int)sizeof($lseektype));
8809 if eval $compile_ok; then
8810 lseeksize=`$run ./try`
8811 echo "Your file offsets are $lseeksize bytes long."
8815 echo "(I can't seem to compile the test program. Guessing...)"
8816 rp="What is the size of your file offsets (in bytes)?"
8822 : see what type file positions are declared as in the library
8823 rp="What is the type for file position used by fsetpos()?"
8824 set fpos_t fpostype long stdio.h sys/types.h
8829 *_t) zzz="$fpostype" ;;
8832 echo "Checking the size of $zzz..." >&4
8834 #include <sys/types.h>
8841 printf("%d\n", (int)sizeof($fpostype));
8846 if eval $compile_ok; then
8850 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8853 echo "Your $zzz is $fpossize bytes long."
8859 echo "(I can't compile the test program. Guessing...)" >&4
8860 rp="What is the size of your file positions (in bytes)?"
8865 # Backward compatibility (uselfs is deprecated).
8867 "$define"|true|[yY]*)
8870 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8872 uselargefiles="$define"
8876 case "$lseeksize:$fpossize" in
8879 You can have files larger than 2 gigabytes.
8882 *) case "$uselargefiles" in
8883 "$undef"|false|[nN]*) dflt='n' ;;
8888 Perl can be built to understand large files (files larger than 2 gigabytes)
8889 on some systems. To do so, Configure can be run with -Duselargefiles.
8891 If this doesn't make any sense to you, just accept the default '$dflt'.
8893 rp='Try to understand large files, if available?'
8896 y|Y) val="$define" ;;
8903 : Look for a hint-file generated 'call-back-unit'. If the
8904 : user has specified that a large files perl is to be built,
8905 : we may need to set or change some other defaults.
8906 if $test -f uselargefiles.cbu; then
8907 echo "Your platform has some specific hints regarding large file builds, using them..."
8908 . ./uselargefiles.cbu
8910 case "$uselargefiles" in
8912 if $test -f uselargefiles.cbu; then
8914 echo "Rechecking to see how big your file offsets are..." >&4
8916 #include <sys/types.h>
8920 printf("%d\n", (int)sizeof($lseektype));
8925 if eval $compile_ok; then
8926 lseeksize=`$run ./try`
8927 $echo "Your file offsets are now $lseeksize bytes long."
8931 echo "(I can't seem to compile the test program. Guessing...)"
8932 rp="What is the size of your file offsets (in bytes)?"
8937 *_t) zzz="$fpostype" ;;
8940 $echo $n "Rechecking the size of $zzz...$c" >&4
8942 #include <sys/types.h>
8949 printf("%d\n", (int)sizeof($fpostype));
8954 if eval $compile_ok; then
8959 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8962 echo " $fpossize bytes." >&4
8968 echo "(I can't compile the test program. Guessing...)" >&4
8969 rp="What is the size of your file positions (in bytes)?"
8978 case "$vendorprefix" in
8979 '') d_vendorbin="$undef"
8983 *) d_vendorbin="$define"
8984 : determine where vendor-supplied executables go.
8985 case "$vendorbin" in
8986 '') dflt=$vendorprefix/bin ;;
8987 *) dflt="$vendorbin" ;;
8990 rp='Pathname for the vendor-supplied executables directory?'
8993 vendorbinexp="$ansexp"
8996 : Change installation prefix, if necessary.
8997 if $test X"$prefix" != X"$installprefix"; then
8998 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
9000 installvendorbin="$vendorbinexp"
9003 case "$vendorprefix" in
9004 '') vendorhtml1dir=''
9005 vendorhtml1direxp=''
9007 *) : determine where vendor-supplied html pages go.
9008 : There is no standard location, so try to copy the previously-selected
9009 : directory structure for the core html pages.
9010 : XXX Better default suggestions would be welcome.
9011 case "$vendorhtml1dir" in
9012 '') dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9013 *) dflt=$vendorhtml1dir ;;
9016 ''|' ') dflt=none ;;
9019 rp='Pathname for the vendor-supplied html pages?'
9021 vendorhtml1dir="$ans"
9022 vendorhtml1direxp="$ansexp"
9025 : Use ' ' for none so value is preserved next time through Configure
9026 $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
9027 : Change installation prefix, if necessary.
9028 if $test X"$prefix" != X"$installprefix"; then
9029 installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
9031 installvendorhtml1dir="$vendorhtml1direxp"
9034 case "$vendorprefix" in
9035 '') vendorhtml3dir=''
9036 vendorhtml3direxp=''
9038 *) : determine where vendor-supplied module html pages go.
9039 : There is no standard location, so try to copy the previously-selected
9040 : directory structure for the core html pages.
9041 : XXX Better default suggestions would be welcome.
9042 case "$vendorhtml3dir" in
9043 '') dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9044 *) dflt=$vendorhtml3dir ;;
9047 ''|' ') dflt=none ;;
9050 rp='Pathname for the vendor-supplied html pages?'
9052 vendorhtml3dir="$ans"
9053 vendorhtml3direxp="$ansexp"
9056 : Use ' ' for none so value is preserved next time through Configure
9057 $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
9058 : Change installation prefix, if necessary.
9059 if $test X"$prefix" != X"$installprefix"; then
9060 installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
9062 installvendorhtml3dir="$vendorhtml3direxp"
9065 case "$vendorprefix" in
9066 '') vendorman1dir=''
9069 *) : determine where vendor-supplied manual pages go.
9070 case "$vendorman1dir" in
9071 '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9072 *) dflt=$vendorman1dir ;;
9075 ''|' ') dflt=none ;;
9078 rp='Pathname for the vendor-supplied manual section 1 pages?'
9080 vendorman1dir="$ans"
9081 vendorman1direxp="$ansexp"
9084 : Use ' ' for none so value is preserved next time through Configure
9085 $test X"$vendorman1dir" = "X" && vendorman1dir=' '
9086 : Change installation prefix, if necessary.
9087 if $test X"$prefix" != X"$installprefix"; then
9088 installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
9090 installvendorman1dir="$vendorman1direxp"
9093 case "$vendorprefix" in
9094 '') vendorman3dir=''
9097 *) : determine where vendor-supplied module manual pages go.
9098 case "$vendorman3dir" in
9099 '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
9100 *) dflt=$vendorman3dir ;;
9103 ''|' ') dflt=none ;;
9106 rp='Pathname for the vendor-supplied manual section 3 pages?'
9108 vendorman3dir="$ans"
9109 vendorman3direxp="$ansexp"
9112 : Use ' ' for none so value is preserved next time through Configure
9113 $test X"$vendorman3dir" = "X" && vendorman3dir=' '
9114 : Change installation prefix, if necessary.
9115 if $test X"$prefix" != X"$installprefix"; then
9116 installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
9118 installvendorman3dir="$vendorman3direxp"
9121 case "$vendorprefix" in
9122 '') d_vendorscript="$undef"
9126 *) d_vendorscript="$define"
9127 : determine where vendor-supplied scripts go.
9128 case "$vendorscript" in
9129 '') dflt=$vendorprefix/script
9130 $test -d $dflt || dflt=$vendorbin ;;
9131 *) dflt="$vendorscript" ;;
9135 The installation process will create a directory for
9136 vendor-supplied scripts.
9140 rp='Pathname for the vendor-supplied scripts directory?'
9143 vendorscriptexp="$ansexp"
9146 : Change installation prefix, if necessary.
9147 if $test X"$prefix" != X"$installprefix"; then
9148 installvendorscript=`echo $vendorscriptexp | $sed "s#^$prefix#$installprefix#"`
9150 installvendorscript="$vendorscriptexp"
9153 : see if qgcvt exists
9159 if $test X"$d_longdbl" = X"$define"; then
9161 echo "Checking how to print long doubles..." >&4
9163 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
9164 $cat >try.c <<'EOCP'
9165 #include <sys/types.h>
9169 printf("%.3f\n", d);
9173 if eval $compile; then
9177 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
9178 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
9179 echo "We will use %f."
9185 if $test X"$sPRIfldbl" = X; then
9186 $cat >try.c <<'EOCP'
9187 #include <sys/types.h>
9190 long double d = 123.456;
9191 printf("%.3Lf\n", d);
9195 if eval $compile; then
9199 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
9200 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
9201 echo "We will use %Lf."
9207 if $test X"$sPRIfldbl" = X; then
9208 $cat >try.c <<'EOCP'
9209 #include <sys/types.h>
9212 long double d = 123.456;
9213 printf("%.3llf\n", d);
9217 if eval $compile; then
9221 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
9222 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
9223 echo "We will use %llf."
9229 if $test X"$sPRIfldbl" = X; then
9230 $cat >try.c <<'EOCP'
9231 #include <sys/types.h>
9234 long double d = 123.456;
9235 printf("%.3lf\n", d);
9239 if eval $compile; then
9243 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
9244 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
9245 echo "We will use %lf."
9251 if $test X"$sPRIfldbl" = X; then
9252 echo "Cannot figure out how to print long doubles." >&4
9254 sSCNfldbl=$sPRIfldbl # expect consistency
9261 case "$sPRIfldbl" in
9262 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
9263 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
9264 d_SCNfldbl="$undef";
9266 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
9267 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
9268 d_SCNfldbl="$define";
9272 : Check how to convert floats to strings.
9274 if test "X$d_Gconvert" = X; then
9277 echo "Checking for an efficient way to convert floats to strings."
9279 case "$uselongdouble" in
9280 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
9282 case "$d_longdbl" in
9283 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
9285 case "$d_PRIgldbl" in
9286 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
9290 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
9291 char *myname = "gconvert";
9294 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
9295 char *myname = "gcvt";
9298 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
9299 char *myname = "qgcvt";
9300 #define DOUBLETYPE long double
9303 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9305 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
9307 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
9310 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
9312 char *myname = "sprintf";
9316 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
9317 #define DOUBLETYPE long double
9319 #define DOUBLETYPE double
9325 #define I_STDLIB $i_stdlib
9331 checkit(expect, got)
9335 if (strcmp(expect, got)) {
9336 printf("%s oddity: Expected %s, got %s\n",
9337 myname, expect, got);
9347 /* This must be 1st test on (which?) platform */
9348 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
9349 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
9350 checkit("0.1", buf);
9352 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
9353 checkit("0.01", buf);
9355 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
9356 checkit("0.001", buf);
9358 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
9359 checkit("0.0001", buf);
9361 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
9362 if (strlen(buf) > 5)
9363 checkit("9e-005", buf); /* for Microsoft ?? */
9365 checkit("9e-05", buf);
9367 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
9370 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
9371 checkit("1.1", buf);
9373 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
9374 checkit("1.01", buf);
9376 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
9377 checkit("1.001", buf);
9379 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
9380 checkit("1.0001", buf);
9382 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
9383 checkit("1.00001", buf);
9385 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
9386 checkit("1.000001", buf);
9388 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
9391 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
9394 /* Some Linux gcvt's give 1.e+5 here. */
9395 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
9396 checkit("100000", buf);
9398 /* Some Linux gcvt's give -1.e+5 here. */
9399 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
9400 checkit("-100000", buf);
9402 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
9403 checkit("123.456", buf);
9405 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
9406 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
9407 /* 34 should be enough to scare even long double
9408 * places into using the e notation. */
9409 if (strlen(buf) > 5)
9410 checkit("1e+034", buf); /* for Microsoft */
9412 checkit("1e+34", buf);
9414 /* For Perl, if you add additional tests here, also add them to
9415 * t/base/num.t for benefit of platforms not using Configure or
9416 * overriding d_Gconvert */
9421 : first add preferred functions to our list
9423 for xxx_convert in $gconvert_preference; do
9424 case $xxx_convert in
9425 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
9426 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
9429 : then add any others
9430 for xxx_convert in gconvert gcvt sprintf; do
9433 *) xxx_list="$xxx_list $xxx_convert" ;;
9437 case "$d_longdbl$uselongdouble" in
9439 : again, add prefered functions to our list first
9441 for xxx_convert in $gconvert_ld_preference; do
9442 case $xxx_convert in
9443 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9444 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
9447 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
9448 for xxx_convert in qgcvt sprintf $xxx_list; do
9449 case "$xxx_ld_list" in
9450 $xxx_convert*|*" $xxx_convert"*) ;;
9451 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
9454 : if sprintf cannot do long doubles, move it to the end
9455 if test "$d_PRIgldbl" != "$define"; then
9456 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
9458 : if no qgcvt, remove it
9459 if test "$d_qgcvt" != "$define"; then
9460 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
9463 xxx_list="$xxx_ld_list"
9467 for xxx_convert in $xxx_list; do
9468 echo "Trying $xxx_convert..."
9470 set try -DTRY_$xxx_convert
9471 if eval $compile; then
9472 echo "$xxx_convert() found." >&4
9474 echo "I'll use $xxx_convert to convert floats into a string." >&4
9477 echo "...But $xxx_convert didn't work as I expected."
9481 echo "$xxx_convert NOT found." >&4
9485 if test X$xxx_convert = X; then
9486 echo "*** WHOA THERE!!! ***" >&4
9487 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
9491 case "$xxx_convert" in
9492 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
9493 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
9494 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
9495 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
9496 "$define$define$define")
9497 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
9498 "$define$define$undef")
9499 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9500 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9507 : see if _fwalk exists
9511 : Initialize h_fcntl
9514 : Initialize h_sysfile
9517 : access call always available on UNIX
9521 : locate the flags for 'access()'
9525 $cat >access.c <<EOCP
9526 #include <sys/types.h>
9531 #include <sys/file.h>
9544 : check sys/file.h first, no particular reason here
9545 if $test `./findhdr sys/file.h` && \
9546 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9548 echo "<sys/file.h> defines the *_OK access constants." >&4
9549 elif $test `./findhdr fcntl.h` && \
9550 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9552 echo "<fcntl.h> defines the *_OK access constants." >&4
9553 elif $test `./findhdr unistd.h` && \
9554 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9555 echo "<unistd.h> defines the *_OK access constants." >&4
9557 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9563 : see if accessx exists
9564 set accessx d_accessx
9567 : see if aintl exists
9571 : see if alarm exists
9575 : see if POSIX threads are available
9576 set pthread.h i_pthread
9579 : define a fucntion to check prototypes
9580 $cat > protochk <<EOSH
9583 optimize="$optimize"
9585 prototype="$prototype"
9588 usethreads=$usethreads
9589 i_pthread=$i_pthread
9590 pthread_h_first=$pthread_h_first
9593 $cat >> protochk <<'EOSH'
9598 while test $# -ge 2; do
9600 $define) echo "#include <$2>" >> try.c ;;
9601 literal) echo "$2" >> try.c ;;
9603 # Extra magic for the benefit of systems that need pthread.h
9604 # to be included early to correctly detect threadsafe functions.
9605 # Such functions must guarantee themselves, though, that the usethreads
9606 # and i_pthread have been defined, before calling protochk.
9607 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9608 echo "#include <pthread.h>" >> try.c
9613 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9614 cat >> try.c <<'EOCP'
9615 #ifdef CAN_PROTOTYPE
9616 #define _(args) args
9621 echo "$foo" >> try.c
9622 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9623 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9631 hasproto='varname=$1; func=$2; shift; shift;
9632 while $test $# -ge 2; do
9634 $define) echo "#include <$2>";;
9638 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9639 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9640 echo "$func() prototype found.";
9643 echo "$func() prototype NOT found.";
9648 $rm -f try.c tryout.c'
9650 : see if sys/types.h has to be included
9651 set sys/types.h i_systypes
9654 : see if sys/select.h has to be included
9655 set sys/select.h i_sysselct
9658 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9659 while $test $# -ge 2; do
9661 $define) echo "#include <$2>";;
9665 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9667 if eval $compile; then
9676 : see if we should include time.h, sys/time.h, or both
9678 if test "X$timeincl" = X; then
9679 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9680 $echo $n "I'm now running the test program...$c"
9682 #include <sys/types.h>
9687 #ifdef SYSTIMEKERNEL
9690 #include <sys/time.h>
9693 #include <sys/select.h>
9706 struct timezone tzp;
9708 if (foo.tm_sec == foo.tm_sec)
9711 if (bar.tv_sec == bar.tv_sec)
9718 for s_timezone in '-DS_TIMEZONE' ''; do
9720 for s_timeval in '-DS_TIMEVAL' ''; do
9721 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9722 for i_time in '' '-DI_TIME'; do
9723 for i_systime in '-DI_SYSTIME' ''; do
9726 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9727 if eval $compile; then
9728 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9732 $echo $n "Succeeded with $flags$c"
9744 *SYSTIMEKERNEL*) i_systimek="$define"
9745 timeincl=`./findhdr sys/time.h`
9746 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9747 *) i_systimek="$undef";;
9750 *I_TIME*) i_time="$define"
9751 timeincl=`./findhdr time.h`" $timeincl"
9752 echo "We'll include <time.h>." >&4;;
9753 *) i_time="$undef";;
9756 *I_SYSTIME*) i_systime="$define"
9757 timeincl=`./findhdr sys/time.h`" $timeincl"
9758 echo "We'll include <sys/time.h>." >&4;;
9759 *) i_systime="$undef";;
9763 : see if struct tm knows about tm_zone
9764 case "$i_systime$i_time" in
9767 echo "Checking to see if your struct tm has tm_zone field..." >&4
9768 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9776 case "$d_tm_tm_zone" in
9777 "$define") echo "Yes, it does." ;;
9778 *) echo "No, it doesn't." ;;
9780 : see if struct tm knows about tm_gmtoff
9781 case "$i_systime$i_time" in
9784 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9785 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9793 case "$d_tm_tm_gmtoff" in
9794 "$define") echo "Yes, it does." ;;
9795 *) echo "No, it doesn't." ;;
9798 : see if asctime_r exists
9799 set asctime_r d_asctime_r
9801 case "$d_asctime_r" in
9803 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9804 case "$d_asctime_r_proto:$usethreads" in
9805 ":define") d_asctime_r_proto=define
9806 set d_asctime_r_proto asctime_r $hdrs
9810 case "$d_asctime_r_proto" in
9812 case "$asctime_r_proto" in
9813 ''|0) try='char* asctime_r(const struct tm*, char*);'
9814 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9816 case "$asctime_r_proto" in
9817 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9818 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9820 case "$asctime_r_proto" in
9821 ''|0) try='int asctime_r(const struct tm*, char*);'
9822 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9824 case "$asctime_r_proto" in
9825 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9826 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9828 case "$asctime_r_proto" in
9829 ''|0) d_asctime_r=undef
9831 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9832 * ) case "$asctime_r_proto" in
9833 REENTRANT_PROTO*) ;;
9834 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9836 echo "Prototype: $try" ;;
9839 *) case "$usethreads" in
9840 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9847 *) asctime_r_proto=0
9851 : see if atolf exists
9855 : see if atoll exists
9859 : Look for GNU-cc style attribute checking
9861 echo "Checking whether your compiler can handle __attribute__ ..." >&4
9862 $cat >attrib.c <<'EOCP'
9864 void croak (char* pat,...) __attribute__((__format__(__printf__,1,2),noreturn));
9866 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9867 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9868 echo "Your C compiler doesn't fully support __attribute__."
9871 echo "Your C compiler supports __attribute__."
9875 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9882 : see if bcmp exists
9886 : see if bcopy exists
9890 : see if this is a unistd.h system
9891 set unistd.h i_unistd
9894 : see if getpgrp exists
9895 set getpgrp d_getpgrp
9898 case "$d_getpgrp" in
9901 echo "Checking to see which flavor of getpgrp is in use..."
9904 #include <sys/types.h>
9906 # include <unistd.h>
9914 if (getuid() == 0) {
9915 printf("(I see you are running Configure as super-user...)\n");
9919 if (getpgrp(1) == 0)
9928 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9929 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
9931 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9932 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
9935 echo "I can't seem to compile and run the test program."
9937 xxx="a USG one, i.e. you use getpgrp()."
9939 # SVR4 systems can appear rather BSD-ish.
9942 xxx="a BSD one, i.e. you use getpgrp(pid)."
9946 xxx="probably a USG one, i.e. you use getpgrp()."
9951 echo "Assuming your getpgrp is $xxx" >&4
9960 : see if setpgrp exists
9961 set setpgrp d_setpgrp
9964 case "$d_setpgrp" in
9967 echo "Checking to see which flavor of setpgrp is in use..."
9970 #include <sys/types.h>
9972 # include <unistd.h>
9980 if (getuid() == 0) {
9981 printf("(I see you are running Configure as super-user...)\n");
9985 if (-1 == setpgrp(1, 1))
9988 if (setpgrp() != -1)
9994 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9995 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
9997 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9998 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
10001 echo "(I can't seem to compile and run the test program.)"
10003 xxx="a USG one, i.e. you use setpgrp()."
10005 # SVR4 systems can appear rather BSD-ish.
10006 case "$i_unistd" in
10008 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
10012 xxx="probably a USG one, i.e. you use setpgrp()."
10017 echo "Assuming your setpgrp is $xxx" >&4
10025 : see if bzero exists
10029 : see if signal is declared as pointer to function returning int or void
10031 xxx=`./findhdr signal.h`
10032 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
10033 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10034 echo "You have int (*signal())() instead of void." >&4
10036 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
10037 echo "You have void (*signal())()." >&4
10039 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
10040 echo "You have int (*signal())() instead of void." >&4
10042 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
10043 echo "You have void (*signal())()." >&4
10046 case "$d_voidsig" in
10048 echo "I can't determine whether signal handler returns void or int..." >&4
10050 rp="What type does your signal handler return?"
10053 v*) val="$define";;
10057 echo "As you already told me, signal handler returns void." >&4
10060 *) echo "As you already told me, signal handler returns int." >&4
10067 case "$d_voidsig" in
10068 "$define") signal_t="void";;
10069 *) signal_t="int";;
10073 : check for ability to cast large floats to 32-bit ints.
10075 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
10076 if $test "$intsize" -ge 4; then
10083 #$i_stdlib I_STDLIB
10085 #include <stdlib.h>
10087 #include <sys/types.h>
10088 #include <signal.h>
10089 $signal_t blech(s) int s; { exit(3); }
10096 signal(SIGFPE, blech);
10098 /* Don't let compiler optimize the test away. Store the number
10099 in a writable string for gcc to pass to sscanf under HP/UX.
10101 sprintf(str, "2147483647");
10102 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
10106 /* x86 processors will probably give 0x8000 0000, which is a
10107 sign change. We don't want that. We want to mimic SPARC
10108 behavior here, which is to preserve the sign and give
10111 if (i32 != ($xxx) f)
10117 if eval $compile_ok; then
10121 echo "(I can't seem to compile the test program--assuming it can't)"
10126 echo "Yup, it can."
10129 echo "Nope, it can't."
10136 : check for ability to cast negative floats to unsigned
10138 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
10141 #$i_stdlib I_STDLIB
10143 #include <stdlib.h>
10145 #include <sys/types.h>
10146 #include <signal.h>
10147 $signal_t blech(s) int s; { exit(7); }
10148 $signal_t blech_in_list(s) int s; { exit(4); }
10149 unsigned long dummy_long(p) unsigned long p; { return p; }
10150 unsigned int dummy_int(p) unsigned int p; { return p; }
10151 unsigned short dummy_short(p) unsigned short p; { return p; }
10155 unsigned long along;
10157 unsigned short ashort;
10161 /* Frustrate gcc-2.7.2's optimizer which failed this test with
10162 a direct f = -123. assignment. gcc-2.8.0 reportedly
10163 optimized the whole file away
10165 /* Store the number in a writable string for gcc to pass to
10166 sscanf under HP/UX.
10168 sprintf(str, "-123");
10169 sscanf(str, "%lf", &f); /* f = -123.; */
10171 signal(SIGFPE, blech);
10172 along = (unsigned long)f;
10173 aint = (unsigned int)f;
10174 ashort = (unsigned short)f;
10175 if (along != (unsigned long)-123)
10177 if (aint != (unsigned int)-123)
10179 if (ashort != (unsigned short)-123)
10181 sprintf(str, "1073741824.");
10182 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
10185 along = (unsigned long)f;
10186 if (along != 0x80000000)
10190 along = (unsigned long)f;
10191 if (along != 0x7fffffff)
10195 along = (unsigned long)f;
10196 if (along != 0x80000001)
10200 signal(SIGFPE, blech_in_list);
10201 sprintf(str, "123.");
10202 sscanf(str, "%lf", &f); /* f = 123.; */
10203 along = dummy_long((unsigned long)f);
10204 aint = dummy_int((unsigned int)f);
10205 ashort = dummy_short((unsigned short)f);
10206 if (along != (unsigned long)123)
10208 if (aint != (unsigned int)123)
10210 if (ashort != (unsigned short)123)
10217 if eval $compile_ok; then
10221 echo "(I can't seem to compile the test program--assuming it can't)"
10224 case "$castflags" in
10226 echo "Yup, it can."
10229 echo "Nope, it can't."
10236 : see if vprintf exists
10238 if set vprintf val -f d_vprintf; eval $csym; $val; then
10239 echo 'vprintf() found.' >&4
10242 #include <varargs.h>
10243 #$i_stdlib I_STDLIB
10245 #include <stdlib.h>
10248 int main() { xxx("foo"); }
10257 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
10261 if eval $compile && $run ./try; then
10262 echo "Your vsprintf() returns (int)." >&4
10265 echo "Your vsprintf() returns (char*)." >&4
10269 echo 'vprintf() NOT found.' >&4
10280 : see if chown exists
10284 : see if chroot exists
10285 set chroot d_chroot
10288 : see if chsize exists
10289 set chsize d_chsize
10292 : see if class exists
10296 hasstruct='varname=$1; struct=$2; shift; shift;
10297 while $test $# -ge 2; do
10299 $define) echo "#include <$2>";;
10303 echo "int main () { struct $struct foo; }" >> try.c;
10305 if eval $compile; then
10312 $rm -f try.c try.o'
10316 : see whether socket exists
10318 $echo $n "Hmm... $c" >&4
10319 if set socket val -f d_socket; eval $csym; $val; then
10320 echo "Looks like you have Berkeley networking support." >&4
10322 if set setsockopt val -f; eval $csym; $val; then
10325 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
10326 d_oldsock="$define"
10329 if $contains socklib libc.list >/dev/null 2>&1; then
10330 echo "Looks like you have Berkeley networking support." >&4
10332 : we will have to assume that it supports the 4.2 BSD interface
10335 echo "You don't have Berkeley networking in libc$_a..." >&4
10336 if test "X$d_socket" = "X$define"; then
10337 echo "...but you seem to believe that you have sockets." >&4
10339 for net in net socket
10341 if test -f /usr/lib/lib$net$_a; then
10342 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
10343 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
10344 if $contains socket libc.list >/dev/null 2>&1; then
10349 echo "...but the Wollongong group seems to have hacked it in." >&4
10350 sockethdr="-I/usr/netinclude"
10353 echo "Found Berkeley sockets interface in lib$net." >&4
10354 if $contains setsockopt libc.list >/dev/null 2>&1; then
10357 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
10358 d_oldsock="$define"
10364 if test "X$d_socket" != "X$define"; then
10365 echo "or anywhere else I see." >&4
10373 : see if socketpair exists
10374 set socketpair d_sockpair
10379 echo "Checking the availability of certain socket constants..." >&4
10380 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
10381 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
10383 #include <sys/types.h>
10384 #include <sys/socket.h>
10390 set try; if eval $compile; then
10393 set d_${enum}; eval $setvar
10397 : see if this is a sys/uio.h system
10398 set sys/uio.h i_sysuio
10403 echo "Checking to see if your system supports struct cmsghdr..." >&4
10404 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
10406 case "$d_cmsghdr_s" in
10407 "$define") echo "Yes, it does." ;;
10408 *) echo "No, it doesn't." ;;
10412 : check for const keyword
10414 echo 'Checking to see if your C compiler knows about "const"...' >&4
10415 $cat >const.c <<'EOCP'
10416 typedef struct spug { int drokk; } spug;
10423 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
10425 echo "Yup, it does."
10428 echo "Nope, it doesn't."
10433 : see if copysignl exists
10434 set copysignl d_copysignl
10437 : see if crypt exists
10442 $define) cryptlib='' ;;
10443 *) if set crypt val -f d_crypt; eval $csym; $val; then
10444 echo 'crypt() found.' >&4
10448 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
10449 if $test -z "$cryptlib"; then
10450 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
10454 if $test -z "$cryptlib"; then
10455 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
10459 if $test -z "$cryptlib"; then
10460 cryptlib=`./loc libcrypt$_a "" $libpth`
10464 if $test -z "$cryptlib"; then
10465 echo 'crypt() NOT found.' >&4
10476 : see if this is a crypt.h system
10477 set crypt.h i_crypt
10480 : see if crypt_r exists
10481 set crypt_r d_crypt_r
10483 case "$d_crypt_r" in
10485 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
10486 case "$d_crypt_r_proto:$usethreads" in
10487 ":define") d_crypt_r_proto=define
10488 set d_crypt_r_proto crypt_r $hdrs
10492 case "$d_crypt_r_proto" in
10494 case "$crypt_r_proto" in
10495 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
10496 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
10498 case "$crypt_r_proto" in
10499 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
10500 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
10502 case "$crypt_r_proto" in
10503 ''|0) d_crypt_r=undef
10505 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
10506 * ) case "$crypt_r_proto" in
10507 REENTRANT_PROTO*) ;;
10508 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
10510 echo "Prototype: $try" ;;
10513 *) case "$usethreads" in
10514 define) echo "crypt_r has no prototype, not using it." >&4 ;;
10525 : get csh whereabouts
10527 'csh') val="$undef" ;;
10528 *) val="$define" ;;
10532 : Respect a hint or command line value for full_csh.
10533 case "$full_csh" in
10534 '') full_csh=$csh ;;
10537 : see if ctermid_r exists
10538 set ctermid_r d_ctermid_r
10540 case "$d_ctermid_r" in
10542 hdrs="$i_systypes sys/types.h define stdio.h "
10543 case "$d_ctermid_r_proto:$usethreads" in
10544 ":define") d_ctermid_r_proto=define
10545 set d_ctermid_r_proto ctermid_r $hdrs
10549 case "$d_ctermid_r_proto" in
10551 case "$ctermid_r_proto" in
10552 ''|0) try='char* ctermid_r(char*);'
10553 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10555 case "$ctermid_r_proto" in
10556 ''|0) d_ctermid_r=undef
10558 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10559 * ) case "$ctermid_r_proto" in
10560 REENTRANT_PROTO*) ;;
10561 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10563 echo "Prototype: $try" ;;
10566 *) case "$usethreads" in
10567 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10574 *) ctermid_r_proto=0
10578 : see if ctime_r exists
10579 set ctime_r d_ctime_r
10581 case "$d_ctime_r" in
10583 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10584 case "$d_ctime_r_proto:$usethreads" in
10585 ":define") d_ctime_r_proto=define
10586 set d_ctime_r_proto ctime_r $hdrs
10590 case "$d_ctime_r_proto" in
10592 case "$ctime_r_proto" in
10593 ''|0) try='char* ctime_r(const time_t*, char*);'
10594 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10596 case "$ctime_r_proto" in
10597 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10598 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10600 case "$ctime_r_proto" in
10601 ''|0) try='int ctime_r(const time_t*, char*);'
10602 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10604 case "$ctime_r_proto" in
10605 ''|0) try='int ctime_r(const time_t*, char*, int);'
10606 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10608 case "$ctime_r_proto" in
10609 ''|0) d_ctime_r=undef
10611 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10612 * ) case "$ctime_r_proto" in
10613 REENTRANT_PROTO*) ;;
10614 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10616 echo "Prototype: $try" ;;
10619 *) case "$usethreads" in
10620 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10631 : see if cuserid exists
10632 set cuserid d_cuserid
10635 : see if this is a limits.h system
10636 set limits.h i_limits
10639 : see if this is a float.h system
10640 set float.h i_float
10643 : See if number of significant digits in a double precision number is known
10645 $cat >dbl_dig.c <<EOM
10646 #$i_limits I_LIMITS
10649 #include <limits.h>
10655 printf("Contains DBL_DIG");
10658 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10659 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10660 echo "DBL_DIG found." >&4
10663 echo "DBL_DIG NOT found." >&4
10670 : see if dbm.h is available
10671 : see if dbmclose exists
10672 set dbmclose d_dbmclose
10675 case "$d_dbmclose" in
10685 *) set rpcsvc/dbm.h i_rpcsvcdbm
10690 *) echo "We won't be including <dbm.h>"
10700 : see if prototype for dbminit is available
10702 set d_dbminitproto dbminit $i_dbm dbm.h
10705 : see if difftime exists
10706 set difftime d_difftime
10709 : see if this is a dirent system
10711 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10713 echo "<dirent.h> found." >&4
10716 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10717 echo "<sys/dir.h> found." >&4
10720 xinc=`./findhdr sys/ndir.h`
10722 echo "<dirent.h> NOT found." >&4
10727 : Look for type of directory structure.
10729 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10731 case "$direntrytype" in
10733 case "$i_dirent" in
10734 $define) guess1='struct dirent' ;;
10735 *) guess1='struct direct' ;;
10738 *) guess1="$direntrytype"
10743 'struct dirent') guess2='struct direct' ;;
10744 *) guess2='struct dirent' ;;
10747 if $contains "$guess1" try.c >/dev/null 2>&1; then
10748 direntrytype="$guess1"
10749 echo "Your directory entries are $direntrytype." >&4
10750 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10751 direntrytype="$guess2"
10752 echo "Your directory entries seem to be $direntrytype." >&4
10754 echo "I don't recognize your system's directory entries." >&4
10755 rp="What type is used for directory entries on this system?"
10758 direntrytype="$ans"
10763 : see if the directory entry stores field length
10765 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10766 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10767 echo "Good, your directory entry keeps length information in d_namlen." >&4
10770 echo "Your directory entry does not know about the d_namlen field." >&4
10777 : see if this is an sysdir system
10778 set sys/dir.h i_sysdir
10781 : see if this is an sysndir system
10782 set sys/ndir.h i_sysndir
10787 $cat >dirfd.c <<EOM
10789 #$i_stdlib I_STDLIB
10791 #include <stdlib.h>
10793 #$i_dirent I_DIRENT /**/
10794 #$i_sysdir I_SYS_DIR /**/
10795 #$i_sysndir I_SYS_NDIR /**/
10796 #$i_systypes I_SYS_TYPES /**/
10797 #if defined(I_SYS_TYPES)
10798 #include <sys/types.h>
10800 #if defined(I_DIRENT)
10801 #include <dirent.h>
10802 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10803 #include <sys/dir.h>
10807 #include <sys/ndir.h>
10811 #include <ndir.h> /* may be wrong in the future */
10813 #include <sys/dir.h>
10819 DIR *dirp = opendir(".");
10820 if (dirfd(dirp) >= 0)
10827 if eval $compile; then
10831 $define) echo "dirfd() found." >&4 ;;
10832 *) echo "dirfd() NOT found." >&4 ;;
10838 : see if dlerror exists
10841 set dlerror d_dlerror
10845 : see if dlfcn is available
10846 set dlfcn.h i_dlfcn
10853 On a few systems, the dynamically loaded modules that perl generates and uses
10854 will need a different extension than shared libs. The default will probably
10860 *) dflt="$dlext" ;;
10862 rp='What is the extension of dynamically loaded modules'
10871 : Check if dlsym need a leading underscore
10877 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
10878 $cat >dyna.c <<'EOM'
10885 #$i_stdlib I_STDLIB
10887 #include <stdlib.h>
10891 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
10893 #include <sys/types.h>
10898 extern int fred() ;
10907 int mode = RTLD_LAZY ;
10909 handle = dlopen("./dyna.$dlext", mode) ;
10910 if (handle == NULL) {
10915 symbol = dlsym(handle, "fred") ;
10916 if (symbol == NULL) {
10917 /* try putting a leading underscore */
10918 symbol = dlsym(handle, "_fred") ;
10919 if (symbol == NULL) {
10932 : Call the object file tmp-dyna.o in case dlext=o.
10933 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
10934 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
10935 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
10936 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
10939 1) echo "Test program failed using dlopen." >&4
10940 echo "Perhaps you should not use dynamic loading." >&4;;
10941 2) echo "Test program failed using dlsym." >&4
10942 echo "Perhaps you should not use dynamic loading." >&4;;
10943 3) echo "dlsym needs a leading underscore" >&4
10945 4) echo "dlsym doesn't need a leading underscore." >&4;;
10948 echo "I can't compile and run the test program." >&4
10949 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
10954 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
10959 : see if drand48_r exists
10960 set drand48_r d_drand48_r
10962 case "$d_drand48_r" in
10964 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
10965 case "$d_drand48_r_proto:$usethreads" in
10966 ":define") d_drand48_r_proto=define
10967 set d_drand48_r_proto drand48_r $hdrs
10971 case "$d_drand48_r_proto" in
10973 case "$drand48_r_proto" in
10974 ''|0) try='int drand48_r(struct drand48_data*, double*);'
10975 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
10977 case "$drand48_r_proto" in
10978 ''|0) d_drand48_r=undef
10980 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
10981 * ) case "$drand48_r_proto" in
10982 REENTRANT_PROTO*) ;;
10983 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
10985 echo "Prototype: $try" ;;
10988 *) case "$usethreads" in
10989 define) echo "drand48_r has no prototype, not using it." >&4 ;;
10996 *) drand48_r_proto=0
11000 : see if prototype for drand48 is available
11002 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
11005 : see if dup2 exists
11009 : see if eaccess exists
11010 set eaccess d_eaccess
11013 : see if endgrent exists
11014 set endgrent d_endgrent
11017 : see if this is an grp system
11023 xxx=`./findhdr grp.h`
11024 $cppstdin $cppflags $cppminus < $xxx >$$.h
11026 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
11038 set d_grpasswd; eval $setvar
11042 : see if endgrent_r exists
11043 set endgrent_r d_endgrent_r
11045 case "$d_endgrent_r" in
11047 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11048 case "$d_endgrent_r_proto:$usethreads" in
11049 ":define") d_endgrent_r_proto=define
11050 set d_endgrent_r_proto endgrent_r $hdrs
11054 case "$d_endgrent_r_proto" in
11056 case "$endgrent_r_proto" in
11057 ''|0) try='int endgrent_r(FILE**);'
11058 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
11060 case "$endgrent_r_proto" in
11061 ''|0) try='void endgrent_r(FILE**);'
11062 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
11064 case "$endgrent_r_proto" in
11065 ''|0) d_endgrent_r=undef
11067 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
11068 * ) case "$endgrent_r_proto" in
11069 REENTRANT_PROTO*) ;;
11070 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
11072 echo "Prototype: $try" ;;
11075 *) case "$usethreads" in
11076 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
11083 *) endgrent_r_proto=0
11087 : see if endhostent exists
11088 set endhostent d_endhent
11091 : see if this is a netdb.h system
11092 set netdb.h i_netdb
11095 : see if endhostent_r exists
11096 set endhostent_r d_endhostent_r
11098 case "$d_endhostent_r" in
11100 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11101 case "$d_endhostent_r_proto:$usethreads" in
11102 ":define") d_endhostent_r_proto=define
11103 set d_endhostent_r_proto endhostent_r $hdrs
11107 case "$d_endhostent_r_proto" in
11109 case "$endhostent_r_proto" in
11110 ''|0) try='int endhostent_r(struct hostent_data*);'
11111 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
11113 case "$endhostent_r_proto" in
11114 ''|0) try='void endhostent_r(struct hostent_data*);'
11115 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
11117 case "$endhostent_r_proto" in
11118 ''|0) d_endhostent_r=undef
11119 endhostent_r_proto=0
11120 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
11121 * ) case "$endhostent_r_proto" in
11122 REENTRANT_PROTO*) ;;
11123 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
11125 echo "Prototype: $try" ;;
11128 *) case "$usethreads" in
11129 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
11131 d_endhostent_r=undef
11132 endhostent_r_proto=0
11136 *) endhostent_r_proto=0
11140 : see if endnetent exists
11141 set endnetent d_endnent
11144 : see if endnetent_r exists
11145 set endnetent_r d_endnetent_r
11147 case "$d_endnetent_r" in
11149 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11150 case "$d_endnetent_r_proto:$usethreads" in
11151 ":define") d_endnetent_r_proto=define
11152 set d_endnetent_r_proto endnetent_r $hdrs
11156 case "$d_endnetent_r_proto" in
11158 case "$endnetent_r_proto" in
11159 ''|0) try='int endnetent_r(struct netent_data*);'
11160 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
11162 case "$endnetent_r_proto" in
11163 ''|0) try='void endnetent_r(struct netent_data*);'
11164 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
11166 case "$endnetent_r_proto" in
11167 ''|0) d_endnetent_r=undef
11168 endnetent_r_proto=0
11169 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
11170 * ) case "$endnetent_r_proto" in
11171 REENTRANT_PROTO*) ;;
11172 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
11174 echo "Prototype: $try" ;;
11177 *) case "$usethreads" in
11178 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
11180 d_endnetent_r=undef
11181 endnetent_r_proto=0
11185 *) endnetent_r_proto=0
11189 : see if endprotoent exists
11190 set endprotoent d_endpent
11193 : see if endprotoent_r exists
11194 set endprotoent_r d_endprotoent_r
11196 case "$d_endprotoent_r" in
11198 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11199 case "$d_endprotoent_r_proto:$usethreads" in
11200 ":define") d_endprotoent_r_proto=define
11201 set d_endprotoent_r_proto endprotoent_r $hdrs
11205 case "$d_endprotoent_r_proto" in
11207 case "$endprotoent_r_proto" in
11208 ''|0) try='int endprotoent_r(struct protoent_data*);'
11209 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
11211 case "$endprotoent_r_proto" in
11212 ''|0) try='void endprotoent_r(struct protoent_data*);'
11213 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
11215 case "$endprotoent_r_proto" in
11216 ''|0) d_endprotoent_r=undef
11217 endprotoent_r_proto=0
11218 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
11219 * ) case "$endprotoent_r_proto" in
11220 REENTRANT_PROTO*) ;;
11221 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
11223 echo "Prototype: $try" ;;
11226 *) case "$usethreads" in
11227 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
11229 d_endprotoent_r=undef
11230 endprotoent_r_proto=0
11234 *) endprotoent_r_proto=0
11238 : see if endpwent exists
11239 set endpwent d_endpwent
11242 : see if this is a pwd.h system
11248 xxx=`./findhdr pwd.h`
11249 $cppstdin $cppflags $cppminus < $xxx >$$.h
11251 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
11259 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
11267 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
11275 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
11283 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
11291 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
11299 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
11307 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
11319 set d_pwquota; eval $setvar
11320 set d_pwage; eval $setvar
11321 set d_pwchange; eval $setvar
11322 set d_pwclass; eval $setvar
11323 set d_pwexpire; eval $setvar
11324 set d_pwcomment; eval $setvar
11325 set d_pwgecos; eval $setvar
11326 set d_pwpasswd; eval $setvar
11330 : see if endpwent_r exists
11331 set endpwent_r d_endpwent_r
11333 case "$d_endpwent_r" in
11335 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
11336 case "$d_endpwent_r_proto:$usethreads" in
11337 ":define") d_endpwent_r_proto=define
11338 set d_endpwent_r_proto endpwent_r $hdrs
11342 case "$d_endpwent_r_proto" in
11344 case "$endpwent_r_proto" in
11345 ''|0) try='int endpwent_r(FILE**);'
11346 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
11348 case "$endpwent_r_proto" in
11349 ''|0) try='void endpwent_r(FILE**);'
11350 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
11352 case "$endpwent_r_proto" in
11353 ''|0) d_endpwent_r=undef
11355 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
11356 * ) case "$endpwent_r_proto" in
11357 REENTRANT_PROTO*) ;;
11358 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
11360 echo "Prototype: $try" ;;
11363 *) case "$usethreads" in
11364 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
11371 *) endpwent_r_proto=0
11375 : see if endservent exists
11376 set endservent d_endsent
11379 : see if endservent_r exists
11380 set endservent_r d_endservent_r
11382 case "$d_endservent_r" in
11384 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11385 case "$d_endservent_r_proto:$usethreads" in
11386 ":define") d_endservent_r_proto=define
11387 set d_endservent_r_proto endservent_r $hdrs
11391 case "$d_endservent_r_proto" in
11393 case "$endservent_r_proto" in
11394 ''|0) try='int endservent_r(struct servent_data*);'
11395 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
11397 case "$endservent_r_proto" in
11398 ''|0) try='void endservent_r(struct servent_data*);'
11399 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
11401 case "$endservent_r_proto" in
11402 ''|0) d_endservent_r=undef
11403 endservent_r_proto=0
11404 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
11405 * ) case "$endservent_r_proto" in
11406 REENTRANT_PROTO*) ;;
11407 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
11409 echo "Prototype: $try" ;;
11412 *) case "$usethreads" in
11413 define) echo "endservent_r has no prototype, not using it." >&4 ;;
11415 d_endservent_r=undef
11416 endservent_r_proto=0
11420 *) endservent_r_proto=0
11424 : Locate the flags for 'open()'
11427 #include <sys/types.h>
11432 #include <sys/file.h>
11434 #$i_stdlib I_STDLIB
11436 #include <stdlib.h>
11447 : check sys/file.h first to get FREAD on Sun
11448 if $test `./findhdr sys/file.h` && \
11449 set try -DI_SYS_FILE && eval $compile; then
11451 echo "<sys/file.h> defines the O_* constants..." >&4
11452 if $run ./try; then
11453 echo "and you have the 3 argument form of open()." >&4
11456 echo "but not the 3 argument form of open(). Oh, well." >&4
11459 elif $test `./findhdr fcntl.h` && \
11460 set try -DI_FCNTL && eval $compile; then
11462 echo "<fcntl.h> defines the O_* constants..." >&4
11463 if $run ./try; then
11464 echo "and you have the 3 argument form of open()." >&4
11467 echo "but not the 3 argument form of open(). Oh, well." >&4
11472 echo "I can't find the O_* constant definitions! You got problems." >&4
11478 : see which of string.h or strings.h is needed
11480 strings=`./findhdr string.h`
11481 if $test "$strings" && $test -r "$strings"; then
11482 echo "Using <string.h> instead of <strings.h>." >&4
11486 strings=`./findhdr strings.h`
11487 if $test "$strings" && $test -r "$strings"; then
11488 echo "Using <strings.h> instead of <string.h>." >&4
11490 echo "No string header found -- You'll surely have problems." >&4
11495 case "$i_string" in
11496 "$undef") strings=`./findhdr strings.h`;;
11497 *) strings=`./findhdr string.h`;;
11500 : see if this is a sys/file.h system
11505 : do we need to include sys/file.h ?
11509 if $h_sysfile; then
11511 echo "We'll be including <sys/file.h>." >&4
11514 echo "We won't be including <sys/file.h>." >&4
11524 : see if fcntl.h is there
11529 : see if we can include fcntl.h
11535 echo "We'll be including <fcntl.h>." >&4
11538 if $h_sysfile; then
11539 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
11541 echo "We won't be including <fcntl.h>." >&4
11553 : check for non-blocking I/O stuff
11554 case "$h_sysfile" in
11555 true) echo "#include <sys/file.h>" > head.c;;
11558 true) echo "#include <fcntl.h>" > head.c;;
11559 *) echo "#include <sys/fcntl.h>" > head.c;;
11564 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11565 case "$o_nonblock" in
11567 $cat head.c > try.c
11568 $cat >>try.c <<EOCP
11570 #$i_stdlib I_STDLIB
11572 #include <stdlib.h>
11580 printf("O_NONBLOCK\n");
11584 printf("O_NDELAY\n");
11588 printf("FNDELAY\n");
11595 if eval $compile_ok; then
11596 o_nonblock=`$run ./try`
11597 case "$o_nonblock" in
11598 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11599 *) echo "Seems like we can use $o_nonblock.";;
11602 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11605 *) echo "Using $hint value $o_nonblock.";;
11607 $rm -f try try.* .out core
11610 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11613 $cat head.c > try.c
11614 $cat >>try.c <<EOCP
11616 #include <sys/types.h>
11617 #include <signal.h>
11619 #$i_stdlib I_STDLIB
11621 #include <stdlib.h>
11627 #define MY_O_NONBLOCK $o_nonblock
11628 #ifndef errno /* XXX need better Configure test */
11631 #$i_unistd I_UNISTD
11633 #include <unistd.h>
11635 #$i_string I_STRING
11637 #include <string.h>
11639 #include <strings.h>
11641 $signal_t blech(x) int x; { exit(3); }
11643 $cat >> try.c <<'EOCP'
11651 pipe(pd); /* Down: child -> parent */
11652 pipe(pu); /* Up: parent -> child */
11655 close(pd[1]); /* Parent reads from pd[0] */
11656 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11658 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11663 signal(SIGALRM, blech);
11665 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11667 sprintf(string, "%d\n", ret);
11668 write(2, string, strlen(string));
11671 if (errno == EAGAIN) {
11672 printf("EAGAIN\n");
11677 if (errno == EWOULDBLOCK)
11678 printf("EWOULDBLOCK\n");
11681 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11682 sleep(2); /* Give it time to close our pipe */
11684 ret = read(pd[0], buf, 1); /* Should read EOF */
11686 sprintf(string, "%d\n", ret);
11687 write(4, string, strlen(string));
11691 close(pd[0]); /* We write to pd[1] */
11692 close(pu[1]); /* We read from pu[0] */
11693 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11694 close(pd[1]); /* Pipe pd is now fully closed! */
11695 exit(0); /* Bye bye, thank you for playing! */
11699 if eval $compile_ok; then
11700 echo "$startsh" >mtry
11701 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11703 ./mtry >/dev/null 2>&1
11705 0) eagain=`$cat try.out`;;
11706 1) echo "Could not perform non-blocking setting!";;
11707 2) echo "I did a successful read() for something that was not there!";;
11708 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11709 4) echo "Could not find F_SETFL!";;
11710 *) echo "Something terribly wrong happened during testing.";;
11712 rd_nodata=`$cat try.ret`
11713 echo "A read() system call with no data present returns $rd_nodata."
11714 case "$rd_nodata" in
11717 echo "(That's peculiar, fixing that to be -1.)"
11723 echo "Forcing errno EAGAIN on read() with no data available."
11727 echo "Your read() sets errno to $eagain when no data is available."
11730 status=`$cat try.err`
11732 0) echo "And it correctly returns 0 to signal EOF.";;
11733 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11734 *) echo "However, your read() returns '$status' on EOF??";;
11737 if test "$status" = "$rd_nodata"; then
11738 echo "WARNING: you can't distinguish between EOF and no data!"
11742 echo "I can't compile the test program--assuming errno EAGAIN will do."
11749 echo "Using $hint value $eagain."
11750 echo "Your read() returns $rd_nodata when no data is present."
11751 case "$d_eofnblk" in
11752 "$define") echo "And you can see EOF because read() returns 0.";;
11753 "$undef") echo "But you can't see EOF status from read() returned value.";;
11755 echo "(Assuming you can't see EOF status from read anyway.)"
11761 $rm -f try try.* .out core head.c mtry
11763 : see if _ptr and _cnt from stdio act std
11766 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
11767 echo "(Looks like you have stdio.h from BSD.)"
11768 case "$stdio_ptr" in
11769 '') stdio_ptr='((fp)->_p)'
11772 *) ptr_lval=$d_stdio_ptr_lval;;
11774 case "$stdio_cnt" in
11775 '') stdio_cnt='((fp)->_r)'
11778 *) cnt_lval=$d_stdio_cnt_lval;;
11780 case "$stdio_base" in
11781 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
11783 case "$stdio_bufsiz" in
11784 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
11786 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
11787 echo "(Looks like you have stdio.h from Linux.)"
11788 case "$stdio_ptr" in
11789 '') stdio_ptr='((fp)->_IO_read_ptr)'
11792 *) ptr_lval=$d_stdio_ptr_lval;;
11794 case "$stdio_cnt" in
11795 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
11798 *) cnt_lval=$d_stdio_cnt_lval;;
11800 case "$stdio_base" in
11801 '') stdio_base='((fp)->_IO_read_base)';;
11803 case "$stdio_bufsiz" in
11804 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
11807 case "$stdio_ptr" in
11808 '') stdio_ptr='((fp)->_ptr)'
11811 *) ptr_lval=$d_stdio_ptr_lval;;
11813 case "$stdio_cnt" in
11814 '') stdio_cnt='((fp)->_cnt)'
11817 *) cnt_lval=$d_stdio_cnt_lval;;
11819 case "$stdio_base" in
11820 '') stdio_base='((fp)->_base)';;
11822 case "$stdio_bufsiz" in
11823 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
11827 : test whether _ptr and _cnt really work
11828 echo "Checking how std your stdio is..." >&4
11831 #$i_stdlib I_STDLIB
11833 #include <stdlib.h>
11835 #define FILE_ptr(fp) $stdio_ptr
11836 #define FILE_cnt(fp) $stdio_cnt
11838 FILE *fp = fopen("try.c", "r");
11841 18 <= FILE_cnt(fp) &&
11842 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11850 if eval $compile && $to try.c; then
11851 if $run ./try; then
11852 echo "Your stdio acts pretty std."
11855 echo "Your stdio isn't very std."
11858 echo "Your stdio doesn't appear very std."
11862 # glibc 2.2.90 and above apparently change stdio streams so Perl's
11863 # direct buffer manipulation no longer works. The Configure tests
11864 # should be changed to correctly detect this, but until then,
11865 # the following check should at least let perl compile and run.
11866 # (This quick fix should be updated before 5.8.1.)
11867 # To be defensive, reject all unknown versions, and all versions > 2.2.9.
11868 # A. Dougherty, June 3, 2002.
11869 case "$d_gnulibc" in
11871 case "$gnulibc_version" in
11875 *) echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
11884 : Can _ptr be used as an lvalue?
11885 case "$d_stdstdio$ptr_lval" in
11886 $define$define) val=$define ;;
11889 set d_stdio_ptr_lval
11892 : Can _cnt be used as an lvalue?
11893 case "$d_stdstdio$cnt_lval" in
11894 $define$define) val=$define ;;
11897 set d_stdio_cnt_lval
11901 : test whether setting _ptr sets _cnt as a side effect
11902 d_stdio_ptr_lval_sets_cnt="$undef"
11903 d_stdio_ptr_lval_nochange_cnt="$undef"
11904 case "$d_stdio_ptr_lval$d_stdstdio" in
11906 echo "Checking to see what happens if we set the stdio ptr..." >&4
11909 /* Can we scream? */
11910 /* Eat dust sed :-) */
11911 /* In the buffer space, no one can hear you scream. */
11912 #$i_stdlib I_STDLIB
11914 #include <stdlib.h>
11916 #define FILE_ptr(fp) $stdio_ptr
11917 #define FILE_cnt(fp) $stdio_cnt
11918 #include <sys/types.h>
11920 FILE *fp = fopen("try.c", "r");
11925 puts("Fail even to read");
11928 c = getc(fp); /* Read away the first # */
11930 puts("Fail even to read");
11934 18 <= FILE_cnt(fp) &&
11935 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
11937 puts("Fail even to read");
11940 ptr = (char*) FILE_ptr(fp);
11941 cnt = (size_t)FILE_cnt(fp);
11943 FILE_ptr(fp) += 42;
11945 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
11946 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
11949 if (FILE_cnt(fp) <= 20) {
11950 printf ("Fail (<20 chars to test)");
11953 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
11954 puts("Fail compare");
11957 if (cnt == FILE_cnt(fp)) {
11958 puts("Pass_unchanged");
11961 if (FILE_cnt(fp) == (cnt - 42)) {
11962 puts("Pass_changed");
11965 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
11971 if eval $compile && $to try.c; then
11972 case `$run ./try` in
11974 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
11975 d_stdio_ptr_lval_sets_cnt="$define" ;;
11977 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
11978 d_stdio_ptr_lval_nochange_cnt="$define" ;;
11980 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
11982 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
11985 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
11991 : see if _base is also standard
11993 case "$d_stdstdio" in
11997 #$i_stdlib I_STDLIB
11999 #include <stdlib.h>
12001 #define FILE_base(fp) $stdio_base
12002 #define FILE_bufsiz(fp) $stdio_bufsiz
12004 FILE *fp = fopen("try.c", "r");
12007 19 <= FILE_bufsiz(fp) &&
12008 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
12015 if eval $compile && $to try.c; then
12016 if $run ./try; then
12017 echo "And its _base field acts std."
12020 echo "But its _base field isn't std."
12023 echo "However, it seems to be lacking the _base field."
12031 : see if fast_stdio exists
12033 case "$d_stdstdio:$d_stdio_ptr_lval" in
12035 case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
12037 echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
12048 : see if fchdir exists
12049 set fchdir d_fchdir
12052 : see if fchmod exists
12053 set fchmod d_fchmod
12056 : see if fchown exists
12057 set fchown d_fchown
12060 : see if this is an fcntl system
12065 : See if fcntl-based locking works.
12067 #$i_stdlib I_STDLIB
12069 #include <stdlib.h>
12071 #include <unistd.h>
12073 #include <signal.h>
12074 $signal_t blech(x) int x; { exit(3); }
12076 #if defined(F_SETLK) && defined(F_SETLKW)
12077 struct flock flock;
12079 fd = open("try.c", O_RDONLY);
12080 flock.l_type = F_RDLCK;
12081 flock.l_whence = SEEK_SET;
12082 flock.l_start = flock.l_len = 0;
12083 signal(SIGALRM, blech);
12085 retval = fcntl(fd, F_SETLK, &flock);
12087 (retval < 0 ? exit(2) : exit(0));
12093 echo "Checking if fcntl-based file locking works... "
12097 if eval $compile_ok; then
12098 if $run ./try; then
12099 echo "Yes, it seems to work."
12102 echo "Nope, it didn't work."
12107 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
12108 *** This is (almost) impossible.
12109 *** If your NFS lock daemons are not feeling well, something like
12110 *** this may happen, please investigate. Cannot continue, aborting.
12118 echo "I'm unable to compile the test program, so I'll assume not."
12123 echo "Nope, since you don't even have fcntl()."
12126 set d_fcntl_can_lock
12131 : check for fd_set items
12134 Checking to see how well your C compiler handles fd_set and friends ...
12137 #$i_stdlib I_STDLIB
12139 #include <stdlib.h>
12141 #$i_systime I_SYS_TIME
12142 #$i_sysselct I_SYS_SELECT
12143 #$d_socket HAS_SOCKET
12144 #include <sys/types.h>
12146 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
12149 #include <sys/time.h>
12151 #ifdef I_SYS_SELECT
12152 #include <sys/select.h>
12161 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
12169 if eval $compile; then
12170 d_fds_bits="$define"
12172 echo "Well, your system knows about the normal fd_set typedef..." >&4
12173 if $run ./try; then
12174 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
12175 d_fd_macros="$define"
12178 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
12180 d_fd_macros="$undef"
12184 Hmm, your compiler has some difficulty with fd_set. Checking further...
12187 if eval $compile; then
12188 d_fds_bits="$undef"
12190 echo "Well, your system has some sort of fd_set available..." >&4
12191 if $run ./try; then
12192 echo "and you have the normal fd_set macros." >&4
12193 d_fd_macros="$define"
12196 but not the normal fd_set macros! Gross! More work for me...
12198 d_fd_macros="$undef"
12201 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
12203 d_fds_bits="$undef"
12204 d_fd_macros="$undef"
12209 : see if fgetpos exists
12210 set fgetpos d_fgetpos
12213 : see if finite exists
12214 set finite d_finite
12217 : see if finitel exists
12218 set finitel d_finitel
12221 : see if flock exists
12225 : see if prototype for flock is available
12227 set d_flockproto flock $i_sysfile sys/file.h
12230 : see if fork exists
12234 : see if fp_class exists
12235 set fp_class d_fp_class
12238 : see if pathconf exists
12239 set pathconf d_pathconf
12242 : see if fpathconf exists
12243 set fpathconf d_fpathconf
12246 : see if fpclass exists
12247 set fpclass d_fpclass
12250 : see if fpclassify exists
12251 set fpclassify d_fpclassify
12254 : see if fpclassl exists
12255 set fpclassl d_fpclassl
12259 : check for fpos64_t
12261 echo "Checking to see if you have fpos64_t..." >&4
12264 int main() { fpos64_t x = 7; }
12267 if eval $compile; then
12269 echo "You have fpos64_t."
12272 echo "You do not have fpos64_t."
12273 case "$fpossize" in
12274 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
12281 : see if frexpl exists
12282 set frexpl d_frexpl
12285 : see if this is a sys/param system
12286 set sys/param.h i_sysparam
12289 : see if this is a sys/mount.h system
12290 set sys/mount.h i_sysmount
12295 echo "Checking to see if your system supports struct fs_data..." >&4
12296 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
12298 case "$d_fs_data_s" in
12299 "$define") echo "Yes, it does." ;;
12300 *) echo "No, it doesn't." ;;
12303 : see if fseeko exists
12304 set fseeko d_fseeko
12306 case "$longsize" in
12307 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
12310 : see if fsetpos exists
12311 set fsetpos d_fsetpos
12315 : see if fstatfs exists
12316 set fstatfs d_fstatfs
12320 : see if statvfs exists
12321 set statvfs d_statvfs
12324 : see if fstatvfs exists
12325 set fstatvfs d_fstatvfs
12329 : see if fsync exists
12333 : see if ftello exists
12334 set ftello d_ftello
12336 case "$longsize" in
12337 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
12340 : see if getcwd exists
12341 set getcwd d_getcwd
12344 : see if getespwnam exists
12345 set getespwnam d_getespwnam
12349 : see if getfsstat exists
12350 set getfsstat d_getfsstat
12353 : see if getgrent exists
12354 set getgrent d_getgrent
12357 : see if getgrent_r exists
12358 set getgrent_r d_getgrent_r
12360 case "$d_getgrent_r" in
12362 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12363 case "$d_getgrent_r_proto:$usethreads" in
12364 ":define") d_getgrent_r_proto=define
12365 set d_getgrent_r_proto getgrent_r $hdrs
12369 case "$d_getgrent_r_proto" in
12371 case "$getgrent_r_proto" in
12372 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
12373 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
12375 case "$getgrent_r_proto" in
12376 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
12377 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
12379 case "$getgrent_r_proto" in
12380 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
12381 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
12383 case "$getgrent_r_proto" in
12384 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
12385 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
12387 case "$getgrent_r_proto" in
12388 ''|0) try='int getgrent_r(struct group*, char*, int);'
12389 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
12391 case "$getgrent_r_proto" in
12392 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
12393 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
12395 case "$getgrent_r_proto" in
12396 ''|0) d_getgrent_r=undef
12398 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
12399 * ) case "$getgrent_r_proto" in
12400 REENTRANT_PROTO*) ;;
12401 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
12403 echo "Prototype: $try" ;;
12406 *) case "$usethreads" in
12407 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
12414 *) getgrent_r_proto=0
12418 : see if getgrgid_r exists
12419 set getgrgid_r d_getgrgid_r
12421 case "$d_getgrgid_r" in
12423 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12424 case "$d_getgrgid_r_proto:$usethreads" in
12425 ":define") d_getgrgid_r_proto=define
12426 set d_getgrgid_r_proto getgrgid_r $hdrs
12430 case "$d_getgrgid_r_proto" in
12432 case "$getgrgid_r_proto" in
12433 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
12434 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
12436 case "$getgrgid_r_proto" in
12437 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
12438 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
12440 case "$getgrgid_r_proto" in
12441 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
12442 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
12444 case "$getgrgid_r_proto" in
12445 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
12446 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
12448 case "$getgrgid_r_proto" in
12449 ''|0) d_getgrgid_r=undef
12451 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
12452 * ) case "$getgrgid_r_proto" in
12453 REENTRANT_PROTO*) ;;
12454 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
12456 echo "Prototype: $try" ;;
12459 *) case "$usethreads" in
12460 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
12467 *) getgrgid_r_proto=0
12471 : see if getgrnam_r exists
12472 set getgrnam_r d_getgrnam_r
12474 case "$d_getgrnam_r" in
12476 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
12477 case "$d_getgrnam_r_proto:$usethreads" in
12478 ":define") d_getgrnam_r_proto=define
12479 set d_getgrnam_r_proto getgrnam_r $hdrs
12483 case "$d_getgrnam_r_proto" in
12485 case "$getgrnam_r_proto" in
12486 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
12487 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
12489 case "$getgrnam_r_proto" in
12490 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
12491 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
12493 case "$getgrnam_r_proto" in
12494 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
12495 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
12497 case "$getgrnam_r_proto" in
12498 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
12499 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
12501 case "$getgrnam_r_proto" in
12502 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
12503 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
12505 case "$getgrnam_r_proto" in
12506 ''|0) d_getgrnam_r=undef
12508 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
12509 * ) case "$getgrnam_r_proto" in
12510 REENTRANT_PROTO*) ;;
12511 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
12513 echo "Prototype: $try" ;;
12516 *) case "$usethreads" in
12517 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
12524 *) getgrnam_r_proto=0
12528 : see if gethostbyaddr exists
12529 set gethostbyaddr d_gethbyaddr
12532 : see if gethostbyname exists
12533 set gethostbyname d_gethbyname
12536 : see if gethostent exists
12537 set gethostent d_gethent
12540 : see how we will look up host name
12543 if set gethostname val -f d_gethname; eval $csym; $val; then
12544 echo 'gethostname() found.' >&4
12545 d_gethname="$define"
12548 if set uname val -f d_uname; eval $csym; $val; then
12551 uname() was found, but you're running xenix, and older versions of xenix
12552 have a broken uname(). If you don't really know whether your xenix is old
12553 enough to have a broken system call, use the default answer.
12558 "$define") dflt=n;;
12560 rp='Is your uname() broken?'
12563 n*) d_uname="$define"; call=uname;;
12566 echo 'uname() found.' >&4
12573 case "$d_gethname" in
12574 '') d_gethname="$undef";;
12577 '') d_uname="$undef";;
12579 case "$d_uname$d_gethname" in
12584 Every now and then someone has a $call() that lies about the hostname
12585 but can't be fixed for political or economic reasons. If you wish, I can
12586 pretend $call() isn't there and maybe compute hostname at run-time
12587 thanks to the '$phostname' command.
12590 rp="Shall I ignore $call() from now on?"
12593 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
12596 case "$phostname" in
12597 '') aphostname='';;
12598 *) case "$aphostname" in
12600 *) set X $phostname
12604 file=`./loc $file $file $pth`
12605 aphostname=`echo $file $*`
12610 case "$d_uname$d_gethname" in
12613 case "$phostname" in
12615 echo "There will be no way for $package to get your hostname." >&4;;
12617 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
12621 case "$d_phostname" in
12622 '') d_phostname="$undef";;
12625 : see if gethostbyaddr_r exists
12626 set gethostbyaddr_r d_gethostbyaddr_r
12628 case "$d_gethostbyaddr_r" in
12630 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12631 case "$d_gethostbyaddr_r_proto:$usethreads" in
12632 ":define") d_gethostbyaddr_r_proto=define
12633 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
12637 case "$d_gethostbyaddr_r_proto" in
12639 case "$gethostbyaddr_r_proto" in
12640 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12641 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
12643 case "$gethostbyaddr_r_proto" in
12644 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
12645 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
12647 case "$gethostbyaddr_r_proto" in
12648 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
12649 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
12651 case "$gethostbyaddr_r_proto" in
12652 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
12653 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
12655 case "$gethostbyaddr_r_proto" in
12656 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
12657 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
12659 case "$gethostbyaddr_r_proto" in
12660 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
12661 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
12663 case "$gethostbyaddr_r_proto" in
12664 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
12665 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
12667 case "$gethostbyaddr_r_proto" in
12668 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
12669 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
12671 case "$gethostbyaddr_r_proto" in
12672 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
12673 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
12675 case "$gethostbyaddr_r_proto" in
12676 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
12677 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
12679 case "$gethostbyaddr_r_proto" in
12680 ''|0) try='int gethostbyaddr_r(const void*, socklen_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
12681 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_TsISBWRE ;;
12683 case "$gethostbyaddr_r_proto" in
12684 ''|0) d_gethostbyaddr_r=undef
12685 gethostbyaddr_r_proto=0
12686 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
12687 * ) case "$gethostbyaddr_r_proto" in
12688 REENTRANT_PROTO*) ;;
12689 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
12691 echo "Prototype: $try" ;;
12694 *) case "$usethreads" in
12695 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
12697 d_gethostbyaddr_r=undef
12698 gethostbyaddr_r_proto=0
12702 *) gethostbyaddr_r_proto=0
12706 : see if gethostbyname_r exists
12707 set gethostbyname_r d_gethostbyname_r
12709 case "$d_gethostbyname_r" in
12711 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12712 case "$d_gethostbyname_r_proto:$usethreads" in
12713 ":define") d_gethostbyname_r_proto=define
12714 set d_gethostbyname_r_proto gethostbyname_r $hdrs
12718 case "$d_gethostbyname_r_proto" in
12720 case "$gethostbyname_r_proto" in
12721 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
12722 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
12724 case "$gethostbyname_r_proto" in
12725 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
12726 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
12728 case "$gethostbyname_r_proto" in
12729 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
12730 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
12732 case "$gethostbyname_r_proto" in
12733 ''|0) d_gethostbyname_r=undef
12734 gethostbyname_r_proto=0
12735 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
12736 * ) case "$gethostbyname_r_proto" in
12737 REENTRANT_PROTO*) ;;
12738 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
12740 echo "Prototype: $try" ;;
12743 *) case "$usethreads" in
12744 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
12746 d_gethostbyname_r=undef
12747 gethostbyname_r_proto=0
12751 *) gethostbyname_r_proto=0
12755 : see if gethostent_r exists
12756 set gethostent_r d_gethostent_r
12758 case "$d_gethostent_r" in
12760 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12761 case "$d_gethostent_r_proto:$usethreads" in
12762 ":define") d_gethostent_r_proto=define
12763 set d_gethostent_r_proto gethostent_r $hdrs
12767 case "$d_gethostent_r_proto" in
12769 case "$gethostent_r_proto" in
12770 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
12771 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
12773 case "$gethostent_r_proto" in
12774 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
12775 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
12777 case "$gethostent_r_proto" in
12778 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
12779 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
12781 case "$gethostent_r_proto" in
12782 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
12783 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
12785 case "$gethostent_r_proto" in
12786 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
12787 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
12789 case "$gethostent_r_proto" in
12790 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
12791 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
12793 case "$gethostent_r_proto" in
12794 ''|0) d_gethostent_r=undef
12795 gethostent_r_proto=0
12796 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
12797 * ) case "$gethostent_r_proto" in
12798 REENTRANT_PROTO*) ;;
12799 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
12801 echo "Prototype: $try" ;;
12804 *) case "$usethreads" in
12805 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
12807 d_gethostent_r=undef
12808 gethostent_r_proto=0
12812 *) gethostent_r_proto=0
12816 : see if prototypes for various gethostxxx netdb.h functions are available
12818 set d_gethostprotos gethostent $i_netdb netdb.h
12821 : see if getitimer exists
12822 set getitimer d_getitimer
12825 : see if getlogin exists
12826 set getlogin d_getlogin
12829 : see if getlogin_r exists
12830 set getlogin_r d_getlogin_r
12832 case "$d_getlogin_r" in
12834 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
12835 case "$d_getlogin_r_proto:$usethreads" in
12836 ":define") d_getlogin_r_proto=define
12837 set d_getlogin_r_proto getlogin_r $hdrs
12841 case "$d_getlogin_r_proto" in
12843 case "$getlogin_r_proto" in
12844 ''|0) try='int getlogin_r(char*, size_t);'
12845 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
12847 case "$getlogin_r_proto" in
12848 ''|0) try='int getlogin_r(char*, int);'
12849 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
12851 case "$getlogin_r_proto" in
12852 ''|0) try='char* getlogin_r(char*, size_t);'
12853 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
12855 case "$getlogin_r_proto" in
12856 ''|0) try='char* getlogin_r(char*, int);'
12857 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
12859 case "$getlogin_r_proto" in
12860 ''|0) d_getlogin_r=undef
12862 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
12863 * ) case "$getlogin_r_proto" in
12864 REENTRANT_PROTO*) ;;
12865 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
12867 echo "Prototype: $try" ;;
12870 *) case "$usethreads" in
12871 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
12878 *) getlogin_r_proto=0
12882 : see if getmnt exists
12883 set getmnt d_getmnt
12886 : see if getmntent exists
12887 set getmntent d_getmntent
12890 : see if getnetbyaddr exists
12891 set getnetbyaddr d_getnbyaddr
12894 : see if getnetbyname exists
12895 set getnetbyname d_getnbyname
12898 : see if getnetent exists
12899 set getnetent d_getnent
12902 : see if getnetbyaddr_r exists
12903 set getnetbyaddr_r d_getnetbyaddr_r
12905 case "$d_getnetbyaddr_r" in
12907 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12908 case "$d_getnetbyaddr_r_proto:$usethreads" in
12909 ":define") d_getnetbyaddr_r_proto=define
12910 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
12914 case "$d_getnetbyaddr_r_proto" in
12916 case "$getnetbyaddr_r_proto" in
12917 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
12918 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
12920 case "$getnetbyaddr_r_proto" in
12921 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
12922 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
12924 case "$getnetbyaddr_r_proto" in
12925 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
12926 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
12928 case "$getnetbyaddr_r_proto" in
12929 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
12930 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
12932 case "$getnetbyaddr_r_proto" in
12933 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
12934 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
12936 case "$getnetbyaddr_r_proto" in
12937 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
12938 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
12940 case "$getnetbyaddr_r_proto" in
12941 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
12942 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
12944 case "$getnetbyaddr_r_proto" in
12945 ''|0) try='int getnetbyaddr_r(uint32_t, int, struct netent*, char*, size_t, struct netent**, int*);'
12946 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_uISBWRE ;;
12948 case "$getnetbyaddr_r_proto" in
12949 ''|0) d_getnetbyaddr_r=undef
12950 getnetbyaddr_r_proto=0
12951 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
12952 * ) case "$getnetbyaddr_r_proto" in
12953 REENTRANT_PROTO*) ;;
12954 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
12956 echo "Prototype: $try" ;;
12959 *) case "$usethreads" in
12960 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
12962 d_getnetbyaddr_r=undef
12963 getnetbyaddr_r_proto=0
12967 *) getnetbyaddr_r_proto=0
12971 : see if getnetbyname_r exists
12972 set getnetbyname_r d_getnetbyname_r
12974 case "$d_getnetbyname_r" in
12976 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12977 case "$d_getnetbyname_r_proto:$usethreads" in
12978 ":define") d_getnetbyname_r_proto=define
12979 set d_getnetbyname_r_proto getnetbyname_r $hdrs
12983 case "$d_getnetbyname_r_proto" in
12985 case "$getnetbyname_r_proto" in
12986 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
12987 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
12989 case "$getnetbyname_r_proto" in
12990 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
12991 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
12993 case "$getnetbyname_r_proto" in
12994 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
12995 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
12997 case "$getnetbyname_r_proto" in
12998 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
12999 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
13001 case "$getnetbyname_r_proto" in
13002 ''|0) d_getnetbyname_r=undef
13003 getnetbyname_r_proto=0
13004 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
13005 * ) case "$getnetbyname_r_proto" in
13006 REENTRANT_PROTO*) ;;
13007 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
13009 echo "Prototype: $try" ;;
13012 *) case "$usethreads" in
13013 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
13015 d_getnetbyname_r=undef
13016 getnetbyname_r_proto=0
13020 *) getnetbyname_r_proto=0
13024 : see if getnetent_r exists
13025 set getnetent_r d_getnetent_r
13027 case "$d_getnetent_r" in
13029 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13030 case "$d_getnetent_r_proto:$usethreads" in
13031 ":define") d_getnetent_r_proto=define
13032 set d_getnetent_r_proto getnetent_r $hdrs
13036 case "$d_getnetent_r_proto" in
13038 case "$getnetent_r_proto" in
13039 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
13040 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
13042 case "$getnetent_r_proto" in
13043 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
13044 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
13046 case "$getnetent_r_proto" in
13047 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
13048 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
13050 case "$getnetent_r_proto" in
13051 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
13052 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
13054 case "$getnetent_r_proto" in
13055 ''|0) try='int getnetent_r(struct netent*, char*, int);'
13056 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
13058 case "$getnetent_r_proto" in
13059 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
13060 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
13062 case "$getnetent_r_proto" in
13063 ''|0) d_getnetent_r=undef
13064 getnetent_r_proto=0
13065 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
13066 * ) case "$getnetent_r_proto" in
13067 REENTRANT_PROTO*) ;;
13068 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
13070 echo "Prototype: $try" ;;
13073 *) case "$usethreads" in
13074 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
13076 d_getnetent_r=undef
13077 getnetent_r_proto=0
13081 *) getnetent_r_proto=0
13085 : see if prototypes for various getnetxxx netdb.h functions are available
13087 set d_getnetprotos getnetent $i_netdb netdb.h
13090 : see if getpagesize exists
13091 set getpagesize d_getpagsz
13095 : see if getprotobyname exists
13096 set getprotobyname d_getpbyname
13099 : see if getprotobynumber exists
13100 set getprotobynumber d_getpbynumber
13103 : see if getprotoent exists
13104 set getprotoent d_getpent
13107 : see if getpgid exists
13108 set getpgid d_getpgid
13111 : see if getpgrp2 exists
13112 set getpgrp2 d_getpgrp2
13115 : see if getppid exists
13116 set getppid d_getppid
13119 : see if getpriority exists
13120 set getpriority d_getprior
13123 : see if getprotobyname_r exists
13124 set getprotobyname_r d_getprotobyname_r
13126 case "$d_getprotobyname_r" in
13128 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13129 case "$d_getprotobyname_r_proto:$usethreads" in
13130 ":define") d_getprotobyname_r_proto=define
13131 set d_getprotobyname_r_proto getprotobyname_r $hdrs
13135 case "$d_getprotobyname_r_proto" in
13137 case "$getprotobyname_r_proto" in
13138 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
13139 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
13141 case "$getprotobyname_r_proto" in
13142 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
13143 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
13145 case "$getprotobyname_r_proto" in
13146 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
13147 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
13149 case "$getprotobyname_r_proto" in
13150 ''|0) d_getprotobyname_r=undef
13151 getprotobyname_r_proto=0
13152 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
13153 * ) case "$getprotobyname_r_proto" in
13154 REENTRANT_PROTO*) ;;
13155 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
13157 echo "Prototype: $try" ;;
13160 *) case "$usethreads" in
13161 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
13163 d_getprotobyname_r=undef
13164 getprotobyname_r_proto=0
13168 *) getprotobyname_r_proto=0
13172 : see if getprotobynumber_r exists
13173 set getprotobynumber_r d_getprotobynumber_r
13175 case "$d_getprotobynumber_r" in
13177 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13178 case "$d_getprotobynumber_r_proto:$usethreads" in
13179 ":define") d_getprotobynumber_r_proto=define
13180 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
13184 case "$d_getprotobynumber_r_proto" in
13186 case "$getprotobynumber_r_proto" in
13187 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
13188 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
13190 case "$getprotobynumber_r_proto" in
13191 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
13192 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
13194 case "$getprotobynumber_r_proto" in
13195 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
13196 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
13198 case "$getprotobynumber_r_proto" in
13199 ''|0) d_getprotobynumber_r=undef
13200 getprotobynumber_r_proto=0
13201 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
13202 * ) case "$getprotobynumber_r_proto" in
13203 REENTRANT_PROTO*) ;;
13204 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
13206 echo "Prototype: $try" ;;
13209 *) case "$usethreads" in
13210 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
13212 d_getprotobynumber_r=undef
13213 getprotobynumber_r_proto=0
13217 *) getprotobynumber_r_proto=0
13221 : see if getprotoent_r exists
13222 set getprotoent_r d_getprotoent_r
13224 case "$d_getprotoent_r" in
13226 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13227 case "$d_getprotoent_r_proto:$usethreads" in
13228 ":define") d_getprotoent_r_proto=define
13229 set d_getprotoent_r_proto getprotoent_r $hdrs
13233 case "$d_getprotoent_r_proto" in
13235 case "$getprotoent_r_proto" in
13236 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
13237 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
13239 case "$getprotoent_r_proto" in
13240 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
13241 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
13243 case "$getprotoent_r_proto" in
13244 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
13245 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
13247 case "$getprotoent_r_proto" in
13248 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
13249 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
13251 case "$getprotoent_r_proto" in
13252 ''|0) d_getprotoent_r=undef
13253 getprotoent_r_proto=0
13254 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
13255 * ) case "$getprotoent_r_proto" in
13256 REENTRANT_PROTO*) ;;
13257 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
13259 echo "Prototype: $try" ;;
13262 *) case "$usethreads" in
13263 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
13265 d_getprotoent_r=undef
13266 getprotoent_r_proto=0
13270 *) getprotoent_r_proto=0
13274 : see if prototypes for various getprotoxxx netdb.h functions are available
13276 set d_getprotoprotos getprotoent $i_netdb netdb.h
13279 : see if getprpwnam exists
13280 set getprpwnam d_getprpwnam
13283 : see if getpwent exists
13284 set getpwent d_getpwent
13287 : see if getpwent_r exists
13288 set getpwent_r d_getpwent_r
13290 case "$d_getpwent_r" in
13292 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13293 case "$d_getpwent_r_proto:$usethreads" in
13294 ":define") d_getpwent_r_proto=define
13295 set d_getpwent_r_proto getpwent_r $hdrs
13299 case "$d_getpwent_r_proto" in
13301 case "$getpwent_r_proto" in
13302 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
13303 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
13305 case "$getpwent_r_proto" in
13306 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
13307 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
13309 case "$getpwent_r_proto" in
13310 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
13311 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
13313 case "$getpwent_r_proto" in
13314 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
13315 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
13317 case "$getpwent_r_proto" in
13318 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
13319 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
13321 case "$getpwent_r_proto" in
13322 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
13323 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
13325 case "$getpwent_r_proto" in
13326 ''|0) d_getpwent_r=undef
13328 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
13329 * ) case "$getpwent_r_proto" in
13330 REENTRANT_PROTO*) ;;
13331 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
13333 echo "Prototype: $try" ;;
13336 *) case "$usethreads" in
13337 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
13344 *) getpwent_r_proto=0
13348 : see if getpwnam_r exists
13349 set getpwnam_r d_getpwnam_r
13351 case "$d_getpwnam_r" in
13353 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13354 case "$d_getpwnam_r_proto:$usethreads" in
13355 ":define") d_getpwnam_r_proto=define
13356 set d_getpwnam_r_proto getpwnam_r $hdrs
13360 case "$d_getpwnam_r_proto" in
13362 case "$getpwnam_r_proto" in
13363 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
13364 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
13366 case "$getpwnam_r_proto" in
13367 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
13368 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
13370 case "$getpwnam_r_proto" in
13371 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
13372 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
13374 case "$getpwnam_r_proto" in
13375 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
13376 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
13378 case "$getpwnam_r_proto" in
13379 ''|0) d_getpwnam_r=undef
13381 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
13382 * ) case "$getpwnam_r_proto" in
13383 REENTRANT_PROTO*) ;;
13384 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
13386 echo "Prototype: $try" ;;
13389 *) case "$usethreads" in
13390 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
13397 *) getpwnam_r_proto=0
13401 : see if getpwuid_r exists
13402 set getpwuid_r d_getpwuid_r
13404 case "$d_getpwuid_r" in
13406 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
13407 case "$d_getpwuid_r_proto:$usethreads" in
13408 ":define") d_getpwuid_r_proto=define
13409 set d_getpwuid_r_proto getpwuid_r $hdrs
13413 case "$d_getpwuid_r_proto" in
13415 case "$getpwuid_r_proto" in
13416 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
13417 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
13419 case "$getpwuid_r_proto" in
13420 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
13421 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
13423 case "$getpwuid_r_proto" in
13424 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
13425 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
13427 case "$getpwuid_r_proto" in
13428 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
13429 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
13431 case "$getpwuid_r_proto" in
13432 ''|0) d_getpwuid_r=undef
13434 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
13435 * ) case "$getpwuid_r_proto" in
13436 REENTRANT_PROTO*) ;;
13437 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
13439 echo "Prototype: $try" ;;
13442 *) case "$usethreads" in
13443 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
13450 *) getpwuid_r_proto=0
13455 : see if getservbyname exists
13456 set getservbyname d_getsbyname
13459 : see if getservbyport exists
13460 set getservbyport d_getsbyport
13463 : see if getservent exists
13464 set getservent d_getsent
13467 : see if getservbyname_r exists
13468 set getservbyname_r d_getservbyname_r
13470 case "$d_getservbyname_r" in
13472 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13473 case "$d_getservbyname_r_proto:$usethreads" in
13474 ":define") d_getservbyname_r_proto=define
13475 set d_getservbyname_r_proto getservbyname_r $hdrs
13479 case "$d_getservbyname_r_proto" in
13481 case "$getservbyname_r_proto" in
13482 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
13483 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
13485 case "$getservbyname_r_proto" in
13486 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
13487 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
13489 case "$getservbyname_r_proto" in
13490 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
13491 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
13493 case "$getservbyname_r_proto" in
13494 ''|0) d_getservbyname_r=undef
13495 getservbyname_r_proto=0
13496 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
13497 * ) case "$getservbyname_r_proto" in
13498 REENTRANT_PROTO*) ;;
13499 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
13501 echo "Prototype: $try" ;;
13504 *) case "$usethreads" in
13505 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
13507 d_getservbyname_r=undef
13508 getservbyname_r_proto=0
13512 *) getservbyname_r_proto=0
13516 : see if getservbyport_r exists
13517 set getservbyport_r d_getservbyport_r
13519 case "$d_getservbyport_r" in
13521 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13522 case "$d_getservbyport_r_proto:$usethreads" in
13523 ":define") d_getservbyport_r_proto=define
13524 set d_getservbyport_r_proto getservbyport_r $hdrs
13528 case "$d_getservbyport_r_proto" in
13530 case "$getservbyport_r_proto" in
13531 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
13532 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
13534 case "$getservbyport_r_proto" in
13535 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
13536 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
13538 case "$getservbyport_r_proto" in
13539 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
13540 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
13542 case "$getservbyport_r_proto" in
13543 ''|0) d_getservbyport_r=undef
13544 getservbyport_r_proto=0
13545 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
13546 * ) case "$getservbyport_r_proto" in
13547 REENTRANT_PROTO*) ;;
13548 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
13550 echo "Prototype: $try" ;;
13553 *) case "$usethreads" in
13554 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
13556 d_getservbyport_r=undef
13557 getservbyport_r_proto=0
13561 *) getservbyport_r_proto=0
13565 : see if getservent_r exists
13566 set getservent_r d_getservent_r
13568 case "$d_getservent_r" in
13570 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
13571 case "$d_getservent_r_proto:$usethreads" in
13572 ":define") d_getservent_r_proto=define
13573 set d_getservent_r_proto getservent_r $hdrs
13577 case "$d_getservent_r_proto" in
13579 case "$getservent_r_proto" in
13580 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
13581 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
13583 case "$getservent_r_proto" in
13584 ''|0) try='int getservent_r(struct servent*, char*, int);'
13585 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
13587 case "$getservent_r_proto" in
13588 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
13589 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
13591 case "$getservent_r_proto" in
13592 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
13593 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
13595 case "$getservent_r_proto" in
13596 ''|0) d_getservent_r=undef
13597 getservent_r_proto=0
13598 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
13599 * ) case "$getservent_r_proto" in
13600 REENTRANT_PROTO*) ;;
13601 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
13603 echo "Prototype: $try" ;;
13606 *) case "$usethreads" in
13607 define) echo "getservent_r has no prototype, not using it." >&4 ;;
13609 d_getservent_r=undef
13610 getservent_r_proto=0
13614 *) getservent_r_proto=0
13618 : see if prototypes for various getservxxx netdb.h functions are available
13620 set d_getservprotos getservent $i_netdb netdb.h
13623 : see if getspnam exists
13624 set getspnam d_getspnam
13627 : see if this is a shadow.h system
13628 set shadow.h i_shadow
13631 : see if getspnam_r exists
13632 set getspnam_r d_getspnam_r
13634 case "$d_getspnam_r" in
13636 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
13637 case "$d_getspnam_r_proto:$usethreads" in
13638 ":define") d_getspnam_r_proto=define
13639 set d_getspnam_r_proto getspnam_r $hdrs
13643 case "$d_getspnam_r_proto" in
13645 case "$getspnam_r_proto" in
13646 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
13647 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
13649 case "$getspnam_r_proto" in
13650 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
13651 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
13653 case "$getspnam_r_proto" in
13654 ''|0) d_getspnam_r=undef
13656 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
13657 * ) case "$getspnam_r_proto" in
13658 REENTRANT_PROTO*) ;;
13659 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
13661 echo "Prototype: $try" ;;
13664 *) case "$usethreads" in
13665 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
13672 *) getspnam_r_proto=0
13676 : see if gettimeofday or ftime exists
13677 set gettimeofday d_gettimeod
13679 case "$d_gettimeod" in
13685 val="$undef"; set d_ftime; eval $setvar
13688 case "$d_gettimeod$d_ftime" in
13691 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
13695 : see if gmtime_r exists
13696 set gmtime_r d_gmtime_r
13698 case "$d_gmtime_r" in
13700 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13701 case "$d_gmtime_r_proto:$usethreads" in
13702 ":define") d_gmtime_r_proto=define
13703 set d_gmtime_r_proto gmtime_r $hdrs
13707 case "$d_gmtime_r_proto" in
13709 case "$gmtime_r_proto" in
13710 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
13711 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
13713 case "$gmtime_r_proto" in
13714 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
13715 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
13717 case "$gmtime_r_proto" in
13718 ''|0) d_gmtime_r=undef
13720 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
13721 * ) case "$gmtime_r_proto" in
13722 REENTRANT_PROTO*) ;;
13723 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
13725 echo "Prototype: $try" ;;
13728 *) case "$usethreads" in
13729 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
13736 *) gmtime_r_proto=0
13740 : see if hasmntopt exists
13741 set hasmntopt d_hasmntopt
13744 : see if this is a netinet/in.h or sys/in.h system
13745 set netinet/in.h i_niin sys/in.h i_sysin
13748 : see if arpa/inet.h has to be included
13749 set arpa/inet.h i_arpainet
13752 : see if htonl --and friends-- exists
13757 : Maybe they are macros.
13760 $cat >htonl.c <<EOM
13762 #include <sys/types.h>
13763 #$i_niin I_NETINET_IN
13765 #$i_arpainet I_ARPA_INET
13766 #ifdef I_NETINET_IN
13767 #include <netinet/in.h>
13770 #include <sys/in.h>
13773 #include <arpa/inet.h>
13776 printf("Defined as a macro.");
13779 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
13780 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
13782 echo "But it seems to be defined as a macro." >&4
13790 : see if ilogbl exists
13791 set ilogbl d_ilogbl
13796 if set index val -f; eval $csym; $val; then
13797 if set strchr val -f d_strchr; eval $csym; $val; then
13798 if $contains strchr "$strings" >/dev/null 2>&1 ; then
13801 echo "strchr() found." >&4
13805 echo "index() found." >&4
13810 echo "index() found." >&4
13813 if set strchr val -f d_strchr; eval $csym; $val; then
13816 echo "strchr() found." >&4
13818 echo "No index() or strchr() found!" >&4
13823 set d_strchr; eval $setvar
13825 set d_index; eval $setvar
13827 : check whether inet_aton exists
13828 set inet_aton d_inetaton
13833 $cat >isascii.c <<EOCP
13836 #$i_stdlib I_STDLIB
13838 #include <stdlib.h>
13849 if eval $compile; then
13850 echo "isascii() found." >&4
13853 echo "isascii() NOT found." >&4
13860 : see if isfinite exists
13861 set isfinite d_isfinite
13864 : see if isinf exists
13868 : see if isnan exists
13872 : see if isnanl exists
13873 set isnanl d_isnanl
13876 : see if killpg exists
13877 set killpg d_killpg
13880 : see if lchown exists
13882 $cat > try.c <<'EOCP'
13883 /* System header to define __stub macros and hopefully few prototypes,
13884 which can conflict with char lchown(); below. */
13885 #include <assert.h>
13886 /* Override any gcc2 internal prototype to avoid an error. */
13887 /* We use char because int might match the return type of a gcc2
13888 builtin and then its argument prototype would still apply. */
13891 /* The GNU C library defines this for functions which it implements
13892 to always fail with ENOSYS. Some functions are actually named
13893 something starting with __ and the normal name is an alias. */
13894 #if defined (__stub_lchown) || defined (__stub___lchown)
13902 if eval $compile; then
13903 $echo "lchown() found." >&4
13906 $echo "lchown() NOT found." >&4
13912 : See if number of significant digits in a double precision number is known
13914 $cat >ldbl_dig.c <<EOM
13915 #$i_limits I_LIMITS
13918 #include <limits.h>
13924 printf("Contains LDBL_DIG");
13927 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
13928 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
13929 echo "LDBL_DIG found." >&4
13932 echo "LDBL_DIG NOT found." >&4
13939 : see if link exists
13943 : see if localtime_r exists
13944 set localtime_r d_localtime_r
13946 case "$d_localtime_r" in
13948 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13949 case "$d_localtime_r_proto:$usethreads" in
13950 ":define") d_localtime_r_proto=define
13951 set d_localtime_r_proto localtime_r $hdrs
13955 case "$d_localtime_r_proto" in
13957 case "$localtime_r_proto" in
13958 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
13959 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
13961 case "$localtime_r_proto" in
13962 ''|0) try='int localtime_r(const time_t*, struct tm*);'
13963 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
13965 case "$localtime_r_proto" in
13966 ''|0) d_localtime_r=undef
13967 localtime_r_proto=0
13968 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
13969 * ) case "$localtime_r_proto" in
13970 REENTRANT_PROTO*) ;;
13971 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
13973 echo "Prototype: $try" ;;
13976 *) case "$usethreads" in
13977 define) echo "localtime_r has no prototype, not using it." >&4 ;;
13979 d_localtime_r=undef
13980 localtime_r_proto=0
13984 *) localtime_r_proto=0
13988 : see if localeconv exists
13989 set localeconv d_locconv
13992 : see if lockf exists
13996 : see if prototype for lseek is available
13998 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
14001 : see if lstat exists
14005 : see if madvise exists
14006 set madvise d_madvise
14009 : see if mblen exists
14013 : see if mbstowcs exists
14014 set mbstowcs d_mbstowcs
14017 : see if mbtowc exists
14018 set mbtowc d_mbtowc
14021 : see if memchr exists
14022 set memchr d_memchr
14025 : see if memcmp exists
14026 set memcmp d_memcmp
14029 : see if memcpy exists
14030 set memcpy d_memcpy
14033 : see if memmove exists
14034 set memmove d_memmove
14037 : see if memset exists
14038 set memset d_memset
14041 : see if mkdir exists
14045 : see if mkdtemp exists
14046 set mkdtemp d_mkdtemp
14049 : see if mkfifo exists
14050 set mkfifo d_mkfifo
14053 : see if mkstemp exists
14054 set mkstemp d_mkstemp
14057 : see if mkstemps exists
14058 set mkstemps d_mkstemps
14061 : see if mktime exists
14062 set mktime d_mktime
14065 : see if this is a sys/mman.h system
14066 set sys/mman.h i_sysmman
14069 : see if mmap exists
14072 : see what shmat returns
14073 : default to something harmless
14075 case "$i_sysmman$d_mmap" in
14077 $cat >mmap.c <<'END'
14078 #include <sys/mman.h>
14081 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
14086 echo "and it returns ($mmaptype)." >&4
14092 : see if sqrtl exists
14096 : see if scalbnl exists
14097 set scalbnl d_scalbnl
14100 : see if modfl exists
14104 : see if prototype for modfl is available
14106 set d_modflproto modfl math.h
14109 d_modfl_pow32_bug="$undef"
14111 case "$d_longdbl$d_modfl" in
14114 Checking to see whether your modfl() is okay for large values...
14120 if $test "X$d_modflproto" != "X$define"; then
14121 $cat >>try.c <<EOCP
14122 /* Sigh. many current glibcs provide the function, but do not prototype it. */
14123 long double modfl (long double, long double *);
14126 $cat >>try.c <<EOCP
14128 long double nv = 4294967303.15;
14134 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
14138 case "$osname:$gccversion" in
14139 aix:) saveccflags="$ccflags"
14140 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
14143 if eval $compile; then
14146 *" 4294967303.150000 1.150000 4294967302.000000")
14147 echo >&4 "Your modfl() is broken for large values."
14148 d_modfl_pow32_bug="$define"
14150 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
14154 *" 4294967303.150000 0.150000 4294967303.000000")
14155 echo >&4 "Your modfl() seems okay for large values."
14157 *) echo >&4 "I don't understand your modfl() at all."
14161 $rm -f try.* try core core.try.*
14163 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
14166 case "$osname:$gccversion" in
14167 aix:) ccflags="$saveccflags" ;; # restore
14172 if $test "$uselongdouble" = "$define"; then
14174 if $test "$d_sqrtl" != "$define"; then
14175 message="$message sqrtl"
14177 if $test "$d_modfl" != "$define"; then
14178 if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
14179 echo "You have both aintl and copysignl, so I can emulate modfl."
14181 message="$message modfl"
14184 if $test "$d_frexpl" != "$define"; then
14185 if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
14186 echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
14188 message="$message frexpl"
14192 if $test "$message" != ""; then
14195 *** You requested the use of long doubles but you do not seem to have
14196 *** the following mathematical functions needed for long double support:
14198 *** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
14199 *** Cannot continue, aborting.
14207 : see if mprotect exists
14208 set mprotect d_mprotect
14211 : see if msgctl exists
14212 set msgctl d_msgctl
14215 : see if msgget exists
14216 set msgget d_msgget
14219 : see if msgsnd exists
14220 set msgsnd d_msgsnd
14223 : see if msgrcv exists
14224 set msgrcv d_msgrcv
14227 : see how much of the 'msg*(2)' library is present.
14230 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
14231 *"$undef"*) h_msg=false;;
14235 case "`ipcs 2>&1`" in
14236 "SVID messages"*"not configured"*)
14237 echo "Your $osname does not have the msg*(2) configured." >&4
14240 set msgctl d_msgctl
14242 set msgget d_msgget
14244 set msgsnd d_msgsnd
14246 set msgrcv d_msgrcv
14252 : we could also check for sys/ipc.h ...
14253 if $h_msg && $test `./findhdr sys/msg.h`; then
14254 echo "You have the full msg*(2) library." >&4
14257 echo "You don't have the full msg*(2) library." >&4
14265 echo "Checking to see if your system supports struct msghdr..." >&4
14266 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
14268 case "$d_msghdr_s" in
14269 "$define") echo "Yes, it does." ;;
14270 *) echo "No, it doesn't." ;;
14274 : see if msync exists
14278 : see if munmap exists
14279 set munmap d_munmap
14282 : see if nice exists
14286 : see if this is a langinfo.h system
14287 set langinfo.h i_langinfo
14290 : see if nl_langinfo exists
14291 set nl_langinfo d_nl_langinfo
14294 : check for length of character
14296 case "$charsize" in
14298 echo "Checking to see how big your characters are (hey, you never know)..." >&4
14301 #$i_stdlib I_STDLIB
14303 #include <stdlib.h>
14307 printf("%d\n", (int)sizeof(char));
14312 if eval $compile_ok; then
14316 echo "(I can't seem to compile the test program. Guessing...)"
14323 rp="What is the size of a character (in bytes)?"
14328 : check for volatile keyword
14330 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
14331 $cat >try.c <<'EOCP'
14334 typedef struct _goo_struct goo_struct;
14335 goo_struct * volatile goo = ((goo_struct *)0);
14336 struct _goo_struct {
14341 typedef unsigned short foo_t;
14342 char *volatile foo;
14344 volatile foo_t blech;
14348 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
14350 echo "Yup, it does."
14353 echo "Nope, it doesn't."
14361 $echo "Choosing the C types to be used for Perl's internal types..." >&4
14363 case "$use64bitint:$d_quad:$quadtype" in
14366 uvtype="$uquadtype"
14371 uvtype="unsigned long"
14377 case "$uselongdouble:$d_longdbl" in
14379 nvtype="long double"
14380 nvsize=$longdblsize
14387 $echo "(IV will be "$ivtype", $ivsize bytes)"
14388 $echo "(UV will be "$uvtype", $uvsize bytes)"
14389 $echo "(NV will be "$nvtype", $nvsize bytes)"
14392 #$i_inttypes I_INTTYPES
14394 #include <inttypes.h>
14399 int8_t i = INT8_MAX;
14400 uint8_t u = UINT8_MAX;
14401 printf("int8_t\n");
14404 int16_t i = INT16_MAX;
14405 uint16_t i = UINT16_MAX;
14406 printf("int16_t\n");
14409 int32_t i = INT32_MAX;
14410 uint32_t u = UINT32_MAX;
14411 printf("int32_t\n");
14417 '') case "$charsize" in
14419 u8type="unsigned char"
14428 if eval $compile; then
14429 case "`$run ./try`" in
14430 int8_t) i8type=int8_t
14440 '') if $test $charsize -ge 1; then
14442 u8type="unsigned char"
14450 '') case "$shortsize" in
14452 u16type="unsigned short"
14460 '') set try -DINT16
14461 if eval $compile; then
14462 case "`$run ./try`" in
14474 '') if $test $shortsize -ge 2; then
14476 u16type="unsigned short"
14484 '') case "$longsize" in
14486 u32type="unsigned long"
14490 *) case "$intsize" in
14492 u32type="unsigned int"
14502 '') set try -DINT32
14503 if eval $compile; then
14504 case "`$run ./try`" in
14516 '') if $test $intsize -ge 4; then
14518 u32type="unsigned int"
14526 '') case "$d_quad:$quadtype" in
14528 i64type="$quadtype"
14529 u64type="$uquadtype"
14537 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
14538 : volatile so that the compiler has to store it out to memory.
14539 if test X"$d_volatile" = X"$define"; then
14544 #$i_stdlib I_STDLIB
14546 #include <stdlib.h>
14548 #include <sys/types.h>
14549 #include <signal.h>
14551 $volatile int bletched = 0;
14552 $signal_t blech(s) int s; { bletched = 1; }
14557 int n = 8 * $uvsize;
14560 signal(SIGFPE, blech);
14563 for (i = 0; i < n; i++) {
14564 u = u << 1 | ($uvtype)1;
14566 if (($uvtype)d != u)
14570 d = ($nvtype)(u - 1);
14571 if (($uvtype)d != (u - 1))
14579 printf("%d\n", ((i == n) ? -n : i));
14585 d_nv_preserves_uv="$undef"
14586 if eval $compile; then
14587 nv_preserves_uv_bits="`$run ./try`"
14589 case "$nv_preserves_uv_bits" in
14591 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
14592 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
14593 d_nv_preserves_uv="$define"
14595 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
14596 d_nv_preserves_uv="$undef" ;;
14597 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
14598 nv_preserves_uv_bits="$undef" ;;
14604 : check for off64_t
14606 echo "Checking to see if you have off64_t..." >&4
14608 #include <sys/types.h>
14609 #include <unistd.h>
14610 int main() { off64_t x = 7; }
14613 if eval $compile; then
14615 echo "You have off64_t."
14618 echo "You do not have off64_t."
14619 case "$lseeksize" in
14620 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
14627 : how to create joinable pthreads
14628 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
14630 echo "Checking what constant to use for creating joinable pthreads..." >&4
14631 $cat >try.c <<'EOCP'
14632 #include <pthread.h>
14634 int detachstate = JOINABLE;
14637 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
14638 if eval $compile; then
14639 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
14640 val="$undef" # Yes, undef.
14641 set d_old_pthread_create_joinable
14644 set old_pthread_create_joinable
14647 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
14648 if eval $compile; then
14649 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
14651 set d_old_pthread_create_joinable
14653 val=PTHREAD_CREATE_UNDETACHED
14654 set old_pthread_create_joinable
14657 set try -DJOINABLE=__UNDETACHED
14658 if eval $compile; then
14659 echo "You seem to use __UNDETACHED." >&4
14661 set d_old_pthread_create_joinable
14664 set old_pthread_create_joinable
14667 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
14669 set d_old_pthread_create_joinable
14672 set old_pthread_create_joinable
14679 d_old_pthread_create_joinable="$undef"
14680 old_pthread_create_joinable=""
14683 : see if pause exists
14687 : see if pipe exists
14691 : see if poll exists
14695 : see if readlink exists
14696 set readlink d_readlink
14702 case "$d_readlink" in
14704 if $issymlink /proc/self/exe ; then
14705 $ls -l /proc/self/exe > reflect
14706 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
14707 echo "You have Linux-like /proc/self/exe."
14708 procselfexe='"/proc/self/exe"'
14712 if $issymlink /proc/curproc/file ; then
14713 $ls -l /proc/curproc/file > reflect
14714 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
14715 echo "You have BSD-like /proc/curproc/file."
14716 procselfexe='"/proc/curproc/file"'
14726 : see whether the pthread_atfork exists
14728 #include <pthread.h>
14731 #ifdef PTHREAD_ATFORK
14732 pthread_atfork(NULL,NULL,NULL);
14737 : see if pthread_atfork exists
14738 set try -DPTHREAD_ATFORK
14739 if eval $compile; then
14744 case "$usethreads" in
14747 $define) echo 'pthread_atfork found.' >&4 ;;
14748 *) echo 'pthread_atfork NOT found.' >&4 ;;
14751 set d_pthread_atfork
14754 : see if pthread_attr_setscope exists
14755 set pthread_attr_setscope d_pthread_attr_setscope
14759 : see whether the various POSIXish _yields exist
14761 #include <pthread.h>
14767 #ifdef PTHREAD_YIELD
14770 #ifdef PTHREAD_YIELD_NULL
14771 pthread_yield(NULL);
14777 : see if sched_yield exists
14778 set try -DSCHED_YIELD
14779 if eval $compile; then
14781 sched_yield='sched_yield()'
14785 case "$usethreads" in
14788 $define) echo 'sched_yield() found.' >&4 ;;
14789 *) echo 'sched_yield() NOT found.' >&4 ;;
14795 : see if pthread_yield exists
14796 set try -DPTHREAD_YIELD
14797 if eval $compile; then
14799 case "$sched_yield" in
14800 '') sched_yield='pthread_yield()' ;;
14803 set try -DPTHREAD_YIELD_NULL
14804 if eval $compile; then
14806 case "$sched_yield" in
14807 '') sched_yield='pthread_yield(NULL)' ;;
14813 case "$usethreads" in
14816 $define) echo 'pthread_yield() found.' >&4 ;;
14817 *) echo 'pthread_yield() NOT found.' >&4 ;;
14821 set d_pthread_yield
14824 case "$sched_yield" in
14825 '') sched_yield=undef ;;
14830 : see if random_r exists
14831 set random_r d_random_r
14833 case "$d_random_r" in
14835 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
14836 case "$d_random_r_proto:$usethreads" in
14837 ":define") d_random_r_proto=define
14838 set d_random_r_proto random_r $hdrs
14842 case "$d_random_r_proto" in
14844 case "$random_r_proto" in
14845 ''|0) try='int random_r(int*, struct random_data*);'
14846 ./protochk "extern $try" $hdrs && random_r_proto=I_iS ;;
14848 case "$random_r_proto" in
14849 ''|0) try='int random_r(long*, struct random_data*);'
14850 ./protochk "extern $try" $hdrs && random_r_proto=I_lS ;;
14852 case "$random_r_proto" in
14853 ''|0) try='int random_r(struct random_data*, int32_t*);'
14854 ./protochk "extern $try" $hdrs && random_r_proto=I_St ;;
14856 case "$random_r_proto" in
14857 ''|0) d_random_r=undef
14859 echo "Disabling random_r, cannot determine prototype." >&4 ;;
14860 * ) case "$random_r_proto" in
14861 REENTRANT_PROTO*) ;;
14862 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
14864 echo "Prototype: $try" ;;
14867 *) case "$usethreads" in
14868 define) echo "random_r has no prototype, not using it." >&4 ;;
14875 *) random_r_proto=0
14879 : see if readdir and friends exist
14880 set readdir d_readdir
14882 set seekdir d_seekdir
14884 set telldir d_telldir
14886 set rewinddir d_rewinddir
14889 : see if readdir64_r exists
14890 set readdir64_r d_readdir64_r
14892 case "$d_readdir64_r" in
14894 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
14895 case "$d_readdir64_r_proto:$usethreads" in
14896 ":define") d_readdir64_r_proto=define
14897 set d_readdir64_r_proto readdir64_r $hdrs
14901 case "$d_readdir64_r_proto" in
14903 case "$readdir64_r_proto" in
14904 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
14905 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
14907 case "$readdir64_r_proto" in
14908 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
14909 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
14911 case "$readdir64_r_proto" in
14912 ''|0) d_readdir64_r=undef
14913 readdir64_r_proto=0
14914 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
14915 * ) case "$readdir64_r_proto" in
14916 REENTRANT_PROTO*) ;;
14917 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
14919 echo "Prototype: $try" ;;
14922 *) case "$usethreads" in
14923 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
14925 d_readdir64_r=undef
14926 readdir64_r_proto=0
14930 *) readdir64_r_proto=0
14934 : see if readdir_r exists
14935 set readdir_r d_readdir_r
14937 case "$d_readdir_r" in
14939 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
14940 case "$d_readdir_r_proto:$usethreads" in
14941 ":define") d_readdir_r_proto=define
14942 set d_readdir_r_proto readdir_r $hdrs
14946 case "$d_readdir_r_proto" in
14948 case "$readdir_r_proto" in
14949 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
14950 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
14952 case "$readdir_r_proto" in
14953 ''|0) try='int readdir_r(DIR*, struct dirent*);'
14954 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
14956 case "$readdir_r_proto" in
14957 ''|0) d_readdir_r=undef
14959 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
14960 * ) case "$readdir_r_proto" in
14961 REENTRANT_PROTO*) ;;
14962 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
14964 echo "Prototype: $try" ;;
14967 *) case "$usethreads" in
14968 define) echo "readdir_r has no prototype, not using it." >&4 ;;
14975 *) readdir_r_proto=0
14979 : see if readv exists
14983 : see if recvmsg exists
14984 set recvmsg d_recvmsg
14987 : see if rename exists
14988 set rename d_rename
14991 : see if rmdir exists
14995 : see if memory.h is available.
15000 : See if it conflicts with string.h
15006 $cppstdin $cppflags $cppminus < $strings > mem.h
15007 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
15009 echo "We won't be including <memory.h>."
15019 : can bcopy handle overlapping blocks?
15022 case "$d_memmove" in
15023 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
15024 *) case "$d_bcopy" in
15026 echo "Checking to see if bcopy() can do overlapping copies..." >&4
15028 #$i_memory I_MEMORY
15029 #$i_stdlib I_STDLIB
15030 #$i_string I_STRING
15031 #$i_unistd I_UNISTD
15033 $cat >>try.c <<'EOCP'
15036 # include <memory.h>
15039 # include <stdlib.h>
15042 # include <string.h>
15044 # include <strings.h>
15047 # include <unistd.h> /* Needed for NetBSD */
15051 char buf[128], abc[128];
15057 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15058 try to store the string in read-only memory. */
15059 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
15061 for (align = 7; align >= 0; align--) {
15062 for (len = 36; len; len--) {
15064 bcopy(abc, b, len);
15065 for (off = 1; off <= len; off++) {
15066 bcopy(b, b+off, len);
15067 bcopy(b+off, b, len);
15068 if (bcmp(b, abc, len))
15077 if eval $compile_ok; then
15078 if ./try 2>/dev/null; then
15079 echo "Yes, it can."
15082 echo "It can't, sorry."
15085 echo "(I can't compile the test program, so we'll assume not...)"
15089 $rm -f try.* try core
15095 : can memcpy handle overlapping blocks?
15098 case "$d_memmove" in
15099 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
15100 *) case "$d_memcpy" in
15102 echo "Checking to see if memcpy() can do overlapping copies..." >&4
15104 #$i_memory I_MEMORY
15105 #$i_stdlib I_STDLIB
15106 #$i_string I_STRING
15107 #$i_unistd I_UNISTD
15109 $cat >>try.c <<'EOCP'
15112 # include <memory.h>
15115 # include <stdlib.h>
15118 # include <string.h>
15120 # include <strings.h>
15123 # include <unistd.h> /* Needed for NetBSD */
15127 char buf[128], abc[128];
15133 /* Copy "abcde..." string to char abc[] so that gcc doesn't
15134 try to store the string in read-only memory. */
15135 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
15137 for (align = 7; align >= 0; align--) {
15138 for (len = 36; len; len--) {
15140 memcpy(b, abc, len);
15141 for (off = 1; off <= len; off++) {
15142 memcpy(b+off, b, len);
15143 memcpy(b, b+off, len);
15144 if (memcmp(b, abc, len))
15153 if eval $compile_ok; then
15154 if ./try 2>/dev/null; then
15155 echo "Yes, it can."
15158 echo "It can't, sorry."
15161 echo "(I can't compile the test program, so we'll assume not...)"
15165 $rm -f try.* try core
15171 : can memcmp be trusted to compare relative magnitude?
15173 case "$d_memcmp" in
15176 echo "Checking if your memcmp() can compare relative magnitude..." >&4
15178 #$i_memory I_MEMORY
15179 #$i_stdlib I_STDLIB
15180 #$i_string I_STRING
15181 #$i_unistd I_UNISTD
15183 $cat >>try.c <<'EOCP'
15186 # include <memory.h>
15189 # include <stdlib.h>
15192 # include <string.h>
15194 # include <strings.h>
15197 # include <unistd.h> /* Needed for NetBSD */
15203 if ((a < b) && memcmp(&a, &b, 1) < 0)
15209 if eval $compile_ok; then
15210 if $run ./try 2>/dev/null; then
15211 echo "Yes, it can."
15214 echo "No, it can't (it uses signed chars)."
15217 echo "(I can't compile the test program, so we'll assume not...)"
15221 $rm -f try.* try core
15225 : see if prototype for sbrk is available
15227 set d_sbrkproto sbrk $i_unistd unistd.h
15230 : see if select exists
15231 set select d_select
15234 : see if semctl exists
15235 set semctl d_semctl
15238 : see if semget exists
15239 set semget d_semget
15242 : see if semop exists
15246 : see how much of the 'sem*(2)' library is present.
15249 case "$d_semctl$d_semget$d_semop" in
15250 *"$undef"*) h_sem=false;;
15254 case "`ipcs 2>&1`" in
15255 "SVID messages"*"not configured"*)
15256 echo "Your $osname does not have the sem*(2) configured." >&4
15259 set semctl d_semctl
15261 set semget d_semget
15269 : we could also check for sys/ipc.h ...
15270 if $h_sem && $test `./findhdr sys/sem.h`; then
15271 echo "You have the full sem*(2) library." >&4
15274 echo "You don't have the full sem*(2) library." >&4
15280 : see whether sys/sem.h defines union semun
15282 $cat > try.c <<'END'
15283 #include <sys/types.h>
15284 #include <sys/ipc.h>
15285 #include <sys/sem.h>
15286 int main () { union semun semun; semun.buf = 0; }
15289 if eval $compile; then
15290 echo "You have union semun in <sys/sem.h>." >&4
15293 echo "You do not have union semun in <sys/sem.h>." >&4
15300 : see how to do semctl IPC_STAT
15307 # define S_IRUSR S_IREAD
15308 # define S_IWUSR S_IWRITE
15309 # define S_IXUSR S_IEXEC
15311 # define S_IRUSR 0400
15312 # define S_IWUSR 0200
15313 # define S_IXUSR 0100
15315 # define S_IRGRP (S_IRUSR>>3)
15316 # define S_IWGRP (S_IWUSR>>3)
15317 # define S_IXGRP (S_IXUSR>>3)
15318 # define S_IROTH (S_IRUSR>>6)
15319 # define S_IWOTH (S_IWUSR>>6)
15320 # define S_IXOTH (S_IXUSR>>6)
15323 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
15324 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
15325 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
15328 : see whether semctl IPC_STAT can use union semun
15330 case "$d_semctl_semun" in
15333 #include <sys/types.h>
15334 #include <sys/ipc.h>
15335 #include <sys/sem.h>
15336 #include <sys/stat.h>
15343 #$d_union_semun HAS_UNION_SEMUN
15346 #ifndef HAS_UNION_SEMUN
15349 struct semid_ds *buf;
15350 unsigned short *array;
15356 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15357 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15359 struct semid_ds argbuf;
15362 st = semctl(sem, 0, IPC_STAT, arg);
15366 # endif /* IPC_STAT */
15367 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15369 if (semctl(sem, 0, IPC_RMID, arg) != 0)
15370 # endif /* IPC_RMID */
15371 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15373 #endif /* IPC_PRIVATE && ... */
15374 printf("semget failed: errno = %d\n", errno);
15379 if eval $compile; then
15382 semun) val="$define" ;;
15390 case "$d_semctl_semun" in
15392 echo "You can use union semun for semctl IPC_STAT." >&4
15395 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
15400 : see whether semctl IPC_STAT can use struct semid_ds pointer
15402 case "$d_semctl_semid_ds" in
15404 $cat > try.c <<'END'
15405 #include <sys/types.h>
15406 #include <sys/ipc.h>
15407 #include <sys/sem.h>
15408 #include <sys/stat.h>
15416 struct semid_ds arg;
15419 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
15420 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
15423 st = semctl(sem, 0, IPC_STAT, &arg);
15425 printf("semid_ds\n");
15427 # endif /* IPC_STAT */
15428 printf("semctl IPC_STAT failed: errno = %d\n", errno);
15430 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
15431 # endif /* IPC_RMID */
15432 printf("semctl IPC_RMID failed: errno = %d\n", errno);
15434 #endif /* IPC_PRIVATE && ... */
15435 printf("semget failed: errno = %d\n", errno);
15441 if eval $compile; then
15444 semid_ds) val="$define" ;;
15450 set d_semctl_semid_ds
15452 case "$d_semctl_semid_ds" in
15454 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
15456 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
15463 # We do not have the full sem*(2) library, so assume we can not
15469 set d_semctl_semid_ds
15474 : see if sendmsg exists
15475 set sendmsg d_sendmsg
15478 : see if setegid exists
15479 set setegid d_setegid
15482 : see if seteuid exists
15483 set seteuid d_seteuid
15486 : see if setgrent exists
15487 set setgrent d_setgrent
15490 : see if setgrent_r exists
15491 set setgrent_r d_setgrent_r
15493 case "$d_setgrent_r" in
15495 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
15496 case "$d_setgrent_r_proto:$usethreads" in
15497 ":define") d_setgrent_r_proto=define
15498 set d_setgrent_r_proto setgrent_r $hdrs
15502 case "$d_setgrent_r_proto" in
15504 case "$setgrent_r_proto" in
15505 ''|0) try='int setgrent_r(FILE**);'
15506 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
15508 case "$setgrent_r_proto" in
15509 ''|0) try='void setgrent_r(FILE**);'
15510 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
15512 case "$setgrent_r_proto" in
15513 ''|0) d_setgrent_r=undef
15515 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
15516 * ) case "$setgrent_r_proto" in
15517 REENTRANT_PROTO*) ;;
15518 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
15520 echo "Prototype: $try" ;;
15523 *) case "$usethreads" in
15524 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
15531 *) setgrent_r_proto=0
15535 : see if sethostent exists
15536 set sethostent d_sethent
15539 : see if sethostent_r exists
15540 set sethostent_r d_sethostent_r
15542 case "$d_sethostent_r" in
15544 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15545 case "$d_sethostent_r_proto:$usethreads" in
15546 ":define") d_sethostent_r_proto=define
15547 set d_sethostent_r_proto sethostent_r $hdrs
15551 case "$d_sethostent_r_proto" in
15553 case "$sethostent_r_proto" in
15554 ''|0) try='int sethostent_r(int, struct hostent_data*);'
15555 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
15557 case "$sethostent_r_proto" in
15558 ''|0) try='void sethostent_r(int, struct hostent_data*);'
15559 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
15561 case "$sethostent_r_proto" in
15562 ''|0) d_sethostent_r=undef
15563 sethostent_r_proto=0
15564 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
15565 * ) case "$sethostent_r_proto" in
15566 REENTRANT_PROTO*) ;;
15567 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
15569 echo "Prototype: $try" ;;
15572 *) case "$usethreads" in
15573 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
15575 d_sethostent_r=undef
15576 sethostent_r_proto=0
15580 *) sethostent_r_proto=0
15584 : see if setitimer exists
15585 set setitimer d_setitimer
15588 : see if setlinebuf exists
15589 set setlinebuf d_setlinebuf
15592 : see if setlocale exists
15593 set setlocale d_setlocale
15596 : see if locale.h is available
15597 set locale.h i_locale
15600 : see if setlocale_r exists
15601 set setlocale_r d_setlocale_r
15603 case "$d_setlocale_r" in
15605 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
15606 case "$d_setlocale_r_proto:$usethreads" in
15607 ":define") d_setlocale_r_proto=define
15608 set d_setlocale_r_proto setlocale_r $hdrs
15612 case "$d_setlocale_r_proto" in
15614 case "$setlocale_r_proto" in
15615 ''|0) try='int setlocale_r(int, const char*, char*, int);'
15616 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
15618 case "$setlocale_r_proto" in
15619 ''|0) d_setlocale_r=undef
15620 setlocale_r_proto=0
15621 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
15622 * ) case "$setlocale_r_proto" in
15623 REENTRANT_PROTO*) ;;
15624 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
15626 echo "Prototype: $try" ;;
15629 *) case "$usethreads" in
15630 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
15632 d_setlocale_r=undef
15633 setlocale_r_proto=0
15637 *) setlocale_r_proto=0
15641 : see if setnetent exists
15642 set setnetent d_setnent
15645 : see if setnetent_r exists
15646 set setnetent_r d_setnetent_r
15648 case "$d_setnetent_r" in
15650 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15651 case "$d_setnetent_r_proto:$usethreads" in
15652 ":define") d_setnetent_r_proto=define
15653 set d_setnetent_r_proto setnetent_r $hdrs
15657 case "$d_setnetent_r_proto" in
15659 case "$setnetent_r_proto" in
15660 ''|0) try='int setnetent_r(int, struct netent_data*);'
15661 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
15663 case "$setnetent_r_proto" in
15664 ''|0) try='void setnetent_r(int, struct netent_data*);'
15665 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
15667 case "$setnetent_r_proto" in
15668 ''|0) d_setnetent_r=undef
15669 setnetent_r_proto=0
15670 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
15671 * ) case "$setnetent_r_proto" in
15672 REENTRANT_PROTO*) ;;
15673 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
15675 echo "Prototype: $try" ;;
15678 *) case "$usethreads" in
15679 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
15681 d_setnetent_r=undef
15682 setnetent_r_proto=0
15686 *) setnetent_r_proto=0
15690 : see if setprotoent exists
15691 set setprotoent d_setpent
15694 : see if setpgid exists
15695 set setpgid d_setpgid
15698 : see if setpgrp2 exists
15699 set setpgrp2 d_setpgrp2
15702 : see if setpriority exists
15703 set setpriority d_setprior
15706 : see if setproctitle exists
15707 set setproctitle d_setproctitle
15710 : see if setprotoent_r exists
15711 set setprotoent_r d_setprotoent_r
15713 case "$d_setprotoent_r" in
15715 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15716 case "$d_setprotoent_r_proto:$usethreads" in
15717 ":define") d_setprotoent_r_proto=define
15718 set d_setprotoent_r_proto setprotoent_r $hdrs
15722 case "$d_setprotoent_r_proto" in
15724 case "$setprotoent_r_proto" in
15725 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
15726 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
15728 case "$setprotoent_r_proto" in
15729 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
15730 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
15732 case "$setprotoent_r_proto" in
15733 ''|0) d_setprotoent_r=undef
15734 setprotoent_r_proto=0
15735 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
15736 * ) case "$setprotoent_r_proto" in
15737 REENTRANT_PROTO*) ;;
15738 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
15740 echo "Prototype: $try" ;;
15743 *) case "$usethreads" in
15744 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
15746 d_setprotoent_r=undef
15747 setprotoent_r_proto=0
15751 *) setprotoent_r_proto=0
15755 : see if setpwent exists
15756 set setpwent d_setpwent
15759 : see if setpwent_r exists
15760 set setpwent_r d_setpwent_r
15762 case "$d_setpwent_r" in
15764 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
15765 case "$d_setpwent_r_proto:$usethreads" in
15766 ":define") d_setpwent_r_proto=define
15767 set d_setpwent_r_proto setpwent_r $hdrs
15771 case "$d_setpwent_r_proto" in
15773 case "$setpwent_r_proto" in
15774 ''|0) try='int setpwent_r(FILE**);'
15775 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
15777 case "$setpwent_r_proto" in
15778 ''|0) try='void setpwent_r(FILE**);'
15779 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
15781 case "$setpwent_r_proto" in
15782 ''|0) d_setpwent_r=undef
15784 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
15785 * ) case "$setpwent_r_proto" in
15786 REENTRANT_PROTO*) ;;
15787 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
15789 echo "Prototype: $try" ;;
15792 *) case "$usethreads" in
15793 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
15800 *) setpwent_r_proto=0
15804 : see if setregid exists
15805 set setregid d_setregid
15807 set setresgid d_setresgid
15810 : see if setreuid exists
15811 set setreuid d_setreuid
15813 set setresuid d_setresuid
15816 : see if setrgid exists
15817 set setrgid d_setrgid
15820 : see if setruid exists
15821 set setruid d_setruid
15824 : see if setservent exists
15825 set setservent d_setsent
15828 : see if setservent_r exists
15829 set setservent_r d_setservent_r
15831 case "$d_setservent_r" in
15833 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
15834 case "$d_setservent_r_proto:$usethreads" in
15835 ":define") d_setservent_r_proto=define
15836 set d_setservent_r_proto setservent_r $hdrs
15840 case "$d_setservent_r_proto" in
15842 case "$setservent_r_proto" in
15843 ''|0) try='int setservent_r(int, struct servent_data*);'
15844 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
15846 case "$setservent_r_proto" in
15847 ''|0) try='void setservent_r(int, struct servent_data*);'
15848 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
15850 case "$setservent_r_proto" in
15851 ''|0) d_setservent_r=undef
15852 setservent_r_proto=0
15853 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
15854 * ) case "$setservent_r_proto" in
15855 REENTRANT_PROTO*) ;;
15856 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
15858 echo "Prototype: $try" ;;
15861 *) case "$usethreads" in
15862 define) echo "setservent_r has no prototype, not using it." >&4 ;;
15864 d_setservent_r=undef
15865 setservent_r_proto=0
15869 *) setservent_r_proto=0
15873 : see if setsid exists
15874 set setsid d_setsid
15877 : see if setvbuf exists
15878 set setvbuf d_setvbuf
15881 : see if sfio.h is available
15886 : see if sfio library is available
15897 : Ok, but do we want to use it.
15901 true|$define|[yY]*) dflt='y';;
15904 echo "$package can use the sfio library, but it is experimental."
15905 case "$useperlio" in
15907 echo "For sfio also the PerlIO abstraction layer is needed."
15908 echo "Earlier you said you wouldn't want that."
15911 rp="You seem to have sfio available, do you want to try using it?"
15914 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
15915 useperlio="$define"
15918 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
15923 *) case "$usesfio" in
15924 true|$define|[yY]*)
15925 echo "Sorry, cannot find sfio on this machine." >&4
15926 echo "Ignoring your setting of usesfio=$usesfio." >&4
15935 $define) usesfio='true';;
15936 *) usesfio='false';;
15940 *) : Remove sfio from list of libraries to use
15943 echo "Removing unneeded -lsfio from library list" >&4
15944 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
15947 echo "libs = $libs" >&4
15954 : see if shmctl exists
15955 set shmctl d_shmctl
15958 : see if shmget exists
15959 set shmget d_shmget
15962 : see if shmat exists
15965 : see what shmat returns
15968 $cat >shmat.c <<'END'
15969 #include <sys/shm.h>
15972 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
15977 echo "and it returns ($shmattype)." >&4
15978 : see if a prototype for shmat is available
15979 xxx=`./findhdr sys/shm.h`
15980 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
15981 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
15992 set d_shmatprototype
15995 : see if shmdt exists
15999 : see how much of the 'shm*(2)' library is present.
16002 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
16003 *"$undef"*) h_shm=false;;
16007 case "`ipcs 2>&1`" in
16008 "SVID shared memory"*"not configured"*)
16009 echo "Your $osname does not have the shm*(2) configured." >&4
16012 set shmctl d_shmctl
16014 set shmget d_shmget
16024 : we could also check for sys/ipc.h ...
16025 if $h_shm && $test `./findhdr sys/shm.h`; then
16026 echo "You have the full shm*(2) library." >&4
16029 echo "You don't have the full shm*(2) library." >&4
16036 : see if we have sigaction
16037 if set sigaction val -f d_sigaction; eval $csym; $val; then
16038 echo 'sigaction() found.' >&4
16041 #include <sys/types.h>
16042 #include <signal.h>
16043 #$i_stdlib I_STDLIB
16045 #include <stdlib.h>
16049 struct sigaction act, oact;
16051 oact.sa_handler = 0;
16052 /* so that act and oact are used */
16053 exit(act.sa_flags == 0 && oact.sa_handler == 0);
16057 if eval $compile_ok; then
16060 echo "But you don't seem to have a useable struct sigaction." >&4
16064 echo 'sigaction NOT found.' >&4
16067 set d_sigaction; eval $setvar
16068 $rm -f try try$_o try.c
16070 : see if sigprocmask exists
16071 set sigprocmask d_sigprocmask
16074 : see if sigsetjmp exists
16076 case "$d_sigsetjmp" in
16079 #include <setjmp.h>
16080 #$i_stdlib I_STDLIB
16082 #include <stdlib.h>
16088 if (sigsetjmp(env,1))
16091 siglongjmp(env, 1);
16096 if eval $compile; then
16097 if $run ./try >/dev/null 2>&1; then
16098 echo "POSIX sigsetjmp found." >&4
16102 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
16108 echo "sigsetjmp not found." >&4
16112 *) val="$d_sigsetjmp"
16113 case "$d_sigsetjmp" in
16114 $define) echo "POSIX sigsetjmp found." >&4;;
16115 $undef) echo "sigsetjmp not found." >&4;;
16123 : see if sockatmark exists
16124 set sockatmark d_sockatmark
16127 : see if prototype for sockatmark is available
16129 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
16132 : see if socks5_init exists
16133 set socks5_init d_socks5_init
16136 : see if srand48_r exists
16137 set srand48_r d_srand48_r
16139 case "$d_srand48_r" in
16141 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16142 case "$d_srand48_r_proto:$usethreads" in
16143 ":define") d_srand48_r_proto=define
16144 set d_srand48_r_proto srand48_r $hdrs
16148 case "$d_srand48_r_proto" in
16150 case "$srand48_r_proto" in
16151 ''|0) try='int srand48_r(long, struct drand48_data*);'
16152 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
16154 case "$srand48_r_proto" in
16155 ''|0) d_srand48_r=undef
16157 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
16158 * ) case "$srand48_r_proto" in
16159 REENTRANT_PROTO*) ;;
16160 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
16162 echo "Prototype: $try" ;;
16165 *) case "$usethreads" in
16166 define) echo "srand48_r has no prototype, not using it." >&4 ;;
16173 *) srand48_r_proto=0
16177 : see if srandom_r exists
16178 set srandom_r d_srandom_r
16180 case "$d_srandom_r" in
16182 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
16183 case "$d_srandom_r_proto:$usethreads" in
16184 ":define") d_srandom_r_proto=define
16185 set d_srandom_r_proto srandom_r $hdrs
16189 case "$d_srandom_r_proto" in
16191 case "$srandom_r_proto" in
16192 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
16193 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
16195 case "$srandom_r_proto" in
16196 ''|0) d_srandom_r=undef
16198 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
16199 * ) case "$srandom_r_proto" in
16200 REENTRANT_PROTO*) ;;
16201 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
16203 echo "Prototype: $try" ;;
16206 *) case "$usethreads" in
16207 define) echo "srandom_r has no prototype, not using it." >&4 ;;
16214 *) srandom_r_proto=0
16218 : see if prototype for setresgid is available
16220 set d_sresgproto setresgid $i_unistd unistd.h
16223 : see if prototype for setresuid is available
16225 set d_sresuproto setresuid $i_unistd unistd.h
16228 : see if sys/stat.h is available
16229 set sys/stat.h i_sysstat
16233 : see if stat knows about block sizes
16235 echo "Checking to see if your struct stat has st_blocks field..." >&4
16236 set d_statblks stat st_blocks $i_sysstat sys/stat.h
16240 : see if this is a sys/vfs.h system
16241 set sys/vfs.h i_sysvfs
16245 : see if this is a sys/statfs.h system
16246 set sys/statfs.h i_sysstatfs
16251 echo "Checking to see if your system supports struct statfs..." >&4
16252 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
16254 case "$d_statfs_s" in
16255 "$define") echo "Yes, it does." ;;
16256 *) echo "No, it doesn't." ;;
16261 : see if struct statfs knows about f_flags
16262 case "$d_statfs_s" in
16265 echo "Checking to see if your struct statfs has f_flags field..." >&4
16266 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
16270 set d_statfs_f_flags
16274 case "$d_statfs_f_flags" in
16275 "$define") echo "Yes, it does." ;;
16276 *) echo "No, it doesn't." ;;
16280 Checking how to access stdio streams by file descriptor number...
16282 case "$stdio_stream_array" in
16283 '') $cat >try.c <<EOCP
16286 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
16290 for s in _iob __iob __sF
16292 set try -DSTDIO_STREAM_ARRAY=$s
16293 if eval $compile; then
16294 case "`$run ./try`" in
16295 yes) stdio_stream_array=$s; break ;;
16299 $rm -f try.* try$exe_ext
16301 case "$stdio_stream_array" in
16303 I can't figure out how to access stdio streams by file descriptor number.
16305 d_stdio_stream_array="$undef"
16308 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
16310 d_stdio_stream_array="$define"
16314 : see if strcoll exists
16315 set strcoll d_strcoll
16318 : check for structure copying
16320 echo "Checking to see if your C compiler can copy structs..." >&4
16321 $cat >try.c <<'EOCP'
16331 if $cc -c try.c >/dev/null 2>&1 ; then
16333 echo "Yup, it can."
16336 echo "Nope, it can't."
16342 : see if strerror and/or sys_errlist[] exist
16344 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
16345 if set strerror val -f d_strerror; eval $csym; $val; then
16346 echo 'strerror() found.' >&4
16347 d_strerror="$define"
16348 d_strerrm='strerror(e)'
16349 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16350 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
16351 d_syserrlst="$define"
16353 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
16354 d_syserrlst="$undef"
16356 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
16357 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
16358 echo 'strerror() found in string header.' >&4
16359 d_strerror="$define"
16360 d_strerrm='strerror(e)'
16361 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16362 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
16363 d_syserrlst="$define"
16365 echo "(You don't appear to have any sys_errlist[], how can this be?)"
16366 d_syserrlst="$undef"
16368 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
16369 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
16370 d_strerror="$undef"
16371 d_syserrlst="$define"
16372 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
16374 echo 'strerror() and sys_errlist[] NOT found.' >&4
16375 d_strerror="$undef"
16376 d_syserrlst="$undef"
16377 d_strerrm='"unknown"'
16381 : see if strerror_r exists
16382 set strerror_r d_strerror_r
16384 case "$d_strerror_r" in
16386 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
16387 case "$d_strerror_r_proto:$usethreads" in
16388 ":define") d_strerror_r_proto=define
16389 set d_strerror_r_proto strerror_r $hdrs
16393 case "$d_strerror_r_proto" in
16395 case "$strerror_r_proto" in
16396 ''|0) try='int strerror_r(int, char*, size_t);'
16397 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
16399 case "$strerror_r_proto" in
16400 ''|0) try='int strerror_r(int, char*, int);'
16401 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
16403 case "$strerror_r_proto" in
16404 ''|0) try='char* strerror_r(int, char*, size_t);'
16405 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
16407 case "$strerror_r_proto" in
16408 ''|0) d_strerror_r=undef
16410 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
16411 * ) case "$strerror_r_proto" in
16412 REENTRANT_PROTO*) ;;
16413 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
16415 echo "Prototype: $try" ;;
16418 *) case "$usethreads" in
16419 define) echo "strerror_r has no prototype, not using it." >&4 ;;
16426 *) strerror_r_proto=0
16430 : see if strftime exists
16431 set strftime d_strftime
16434 : see if strlcat exists
16435 set strlcat d_strlcat
16438 : see if strlcpy exists
16439 set strlcpy d_strlcpy
16442 : see if strtod exists
16443 set strtod d_strtod
16446 : see if strtol exists
16447 set strtol d_strtol
16450 : see if strtold exists
16451 set strtold d_strtold
16454 : see if strtoll exists
16455 set strtoll d_strtoll
16458 case "$d_longlong-$d_strtoll" in
16461 Checking whether your strtoll() works okay...
16463 $cat >try.c <<'EOCP'
16466 #define strtoll __strtoll
16469 #define strtoll _strtoll
16472 extern long long int strtoll(char *s, char **, int);
16473 static int bad = 0;
16474 int check(char *s, long long ell, int een) {
16477 gll = strtoll(s, 0, 10);
16478 if (!((gll == ell) && (errno == een)))
16482 check(" 1", 1LL, 0);
16483 check(" 0", 0LL, 0);
16484 check("-1", -1LL, 0);
16485 check("-9223372036854775808", -9223372036854775808LL, 0);
16486 check("-9223372036854775808", -9223372036854775808LL, 0);
16487 check(" 9223372036854775807", 9223372036854775807LL, 0);
16488 check("-9223372036854775808", -9223372036854775808LL, 0);
16489 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
16490 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
16496 if eval $compile; then
16499 ok) echo "Your strtoll() seems to be working okay." ;;
16501 Your strtoll() doesn't seem to be working okay.
16507 echo "(I can't seem to compile the test program--assuming it doesn't)"
16513 : see if strtoq exists
16514 set strtoq d_strtoq
16517 : see if strtoul exists
16518 set strtoul d_strtoul
16521 case "$d_strtoul" in
16524 Checking whether your strtoul() works okay...
16526 $cat >try.c <<'EOCP'
16529 extern unsigned long int strtoul(char *s, char **, int);
16530 static int bad = 0;
16531 void check(char *s, unsigned long eul, int een) {
16534 gul = strtoul(s, 0, 10);
16535 if (!((gul == eul) && (errno == een)))
16539 check(" 1", 1L, 0);
16540 check(" 0", 0L, 0);
16542 case "$longsize" in
16544 $cat >>try.c <<'EOCP'
16545 check("18446744073709551615", 18446744073709551615UL, 0);
16546 check("18446744073709551616", 18446744073709551615UL, ERANGE);
16547 #if 0 /* strtoul() for /^-/ strings is undefined. */
16548 check("-1", 18446744073709551615UL, 0);
16549 check("-18446744073709551614", 2, 0);
16550 check("-18446744073709551615", 1, 0);
16551 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
16552 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
16557 $cat >>try.c <<'EOCP'
16558 check("4294967295", 4294967295UL, 0);
16559 check("4294967296", 4294967295UL, ERANGE);
16560 #if 0 /* strtoul() for /^-/ strings is undefined. */
16561 check("-1", 4294967295UL, 0);
16562 check("-4294967294", 2, 0);
16563 check("-4294967295", 1, 0);
16564 check("-4294967296", 4294967295UL, ERANGE);
16565 check("-4294967297", 4294967295UL, ERANGE);
16570 : Should we write these tests to be more portable by sprintf-ing
16571 : ~0 and then manipulating that char string as input for strtol?
16574 $cat >>try.c <<'EOCP'
16581 if eval $compile; then
16582 case "`$run ./try`" in
16583 ok) echo "Your strtoul() seems to be working okay." ;;
16585 Your strtoul() doesn't seem to be working okay.
16594 : see if strtoull exists
16595 set strtoull d_strtoull
16598 case "$d_longlong-$d_strtoull" in
16601 Checking whether your strtoull() works okay...
16603 $cat >try.c <<'EOCP'
16606 #define strtoull __strtoull
16609 extern unsigned long long int strtoull(char *s, char **, int);
16610 static int bad = 0;
16611 int check(char *s, long long eull, int een) {
16614 gull = strtoull(s, 0, 10);
16615 if (!((gull == eull) && (errno == een)))
16619 check(" 1", 1LL, 0);
16620 check(" 0", 0LL, 0);
16621 check("18446744073709551615", 18446744073709551615ULL, 0);
16622 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16623 #if 0 /* strtoull() for /^-/ strings is undefined. */
16624 check("-1", 18446744073709551615ULL, 0);
16625 check("-18446744073709551614", 2LL, 0);
16626 check("-18446744073709551615", 1LL, 0);
16627 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16628 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16635 if eval $compile; then
16636 case "`$run ./try`" in
16637 ok) echo "Your strtoull() seems to be working okay." ;;
16639 Your strtoull() doesn't seem to be working okay.
16641 d_strtoull="$undef"
16648 : see if strtouq exists
16649 set strtouq d_strtouq
16652 case "$d_strtouq" in
16655 Checking whether your strtouq() works okay...
16657 $cat >try.c <<'EOCP'
16660 extern unsigned long long int strtouq(char *s, char **, int);
16661 static int bad = 0;
16662 void check(char *s, unsigned long long eull, int een) {
16663 unsigned long long gull;
16665 gull = strtouq(s, 0, 10);
16666 if (!((gull == eull) && (errno == een)))
16670 check(" 1", 1LL, 0);
16671 check(" 0", 0LL, 0);
16672 check("18446744073709551615", 18446744073709551615ULL, 0);
16673 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
16674 #if 0 /* strtouq() for /^-/ strings is undefined. */
16675 check("-1", 18446744073709551615ULL, 0);
16676 check("-18446744073709551614", 2LL, 0);
16677 check("-18446744073709551615", 1LL, 0);
16678 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
16679 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
16687 if eval $compile; then
16688 case "`$run ./try`" in
16689 ok) echo "Your strtouq() seems to be working okay." ;;
16691 Your strtouq() doesn't seem to be working okay.
16700 : see if strxfrm exists
16701 set strxfrm d_strxfrm
16704 : see if symlink exists
16705 set symlink d_symlink
16708 : see if syscall exists
16709 set syscall d_syscall
16712 : see if prototype for syscall is available
16714 set d_syscallproto syscall $i_unistd unistd.h
16717 : see if sysconf exists
16718 set sysconf d_sysconf
16721 : see if system exists
16722 set system d_system
16725 : see if tcgetpgrp exists
16726 set tcgetpgrp d_tcgetpgrp
16729 : see if tcsetpgrp exists
16730 set tcsetpgrp d_tcsetpgrp
16733 : see if prototype for telldir is available
16735 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
16738 : see if time exists
16740 if test "X$d_time" = X -o X"$timetype" = X; then
16741 if set time val -f d_time; eval $csym; $val; then
16742 echo 'time() found.' >&4
16744 rp="What is the type returned by time() on this system?"
16745 set time_t timetype long stdio.h sys/types.h
16748 echo 'time() not found, hope that will do.' >&4
16756 : see if this is a sys/times.h system
16757 set sys/times.h i_systimes
16760 : see if times exists
16762 if set times val -f d_times; eval $csym; $val; then
16763 echo 'times() found.' >&4
16766 case "$i_systimes" in
16767 "$define") inc='sys/times.h';;
16769 rp="What is the type returned by times() on this system?"
16770 set clock_t clocktype long stdio.h sys/types.h $inc
16773 echo 'times() NOT found, hope that will do.' >&4
16778 : see if tmpnam_r exists
16779 set tmpnam_r d_tmpnam_r
16781 case "$d_tmpnam_r" in
16783 hdrs="$i_systypes sys/types.h define stdio.h "
16784 case "$d_tmpnam_r_proto:$usethreads" in
16785 ":define") d_tmpnam_r_proto=define
16786 set d_tmpnam_r_proto tmpnam_r $hdrs
16790 case "$d_tmpnam_r_proto" in
16792 case "$tmpnam_r_proto" in
16793 ''|0) try='char* tmpnam_r(char*);'
16794 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
16796 case "$tmpnam_r_proto" in
16797 ''|0) d_tmpnam_r=undef
16799 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
16800 * ) case "$tmpnam_r_proto" in
16801 REENTRANT_PROTO*) ;;
16802 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
16804 echo "Prototype: $try" ;;
16807 *) case "$usethreads" in
16808 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
16815 *) tmpnam_r_proto=0
16819 : see if truncate exists
16820 set truncate d_truncate
16823 : see if ttyname_r exists
16824 set ttyname_r d_ttyname_r
16826 case "$d_ttyname_r" in
16828 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
16829 case "$d_ttyname_r_proto:$usethreads" in
16830 ":define") d_ttyname_r_proto=define
16831 set d_ttyname_r_proto ttyname_r $hdrs
16835 case "$d_ttyname_r_proto" in
16837 case "$ttyname_r_proto" in
16838 ''|0) try='int ttyname_r(int, char*, size_t);'
16839 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
16841 case "$ttyname_r_proto" in
16842 ''|0) try='int ttyname_r(int, char*, int);'
16843 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
16845 case "$ttyname_r_proto" in
16846 ''|0) try='char* ttyname_r(int, char*, int);'
16847 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
16849 case "$ttyname_r_proto" in
16850 ''|0) d_ttyname_r=undef
16852 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
16853 * ) case "$ttyname_r_proto" in
16854 REENTRANT_PROTO*) ;;
16855 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
16857 echo "Prototype: $try" ;;
16860 *) case "$usethreads" in
16861 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
16868 *) ttyname_r_proto=0
16872 : see if tzname[] exists
16874 if set tzname val -a d_tzname; eval $csym; $val; then
16876 echo 'tzname[] found.' >&4
16879 echo 'tzname[] NOT found.' >&4
16885 next|rhapsody|darwin) multiarch="$define" ;;
16887 case "$multiarch" in
16888 ''|[nN]*) multiarch="$undef" ;;
16891 : check for ordering of bytes in a UV
16893 case "$usecrosscompile$multiarch" in
16896 You seem to be either cross-compiling or doing a multiarchitecture build,
16897 skipping the byteorder check.
16903 case "$byteorder" in
16906 In the following, larger digits indicate more significance. A big-endian
16907 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
16908 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
16909 machines may have weird orders like 3412. A Cray will report 87654321,
16910 an Alpha will report 12345678. If the test program works the default is
16912 I'm now running the test program...
16916 #$i_stdlib I_STDLIB
16918 #include <stdlib.h>
16920 #include <sys/types.h>
16921 typedef $uvtype UV;
16931 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
16933 u.l = (UV)0x04030201;
16934 for (i = 0; i < $uvsize; i++)
16935 printf("%c", u.c[i]+'0');
16942 if eval $compile && ./try > /dev/null; then
16945 [1-4][1-4][1-4][1-4]|12345678|87654321)
16946 echo "(The test program ran ok.)"
16947 echo "byteorder=$dflt"
16950 ????|????????) echo "(The test program ran ok.)" ;;
16951 *) echo "(The test program didn't run right for some reason.)" ;;
16956 (I can't seem to compile the test program. Guessing big-endian...)
16959 case "$xxx_prompt" in
16961 rp="What is the order of bytes in $uvtype?"
16977 Checking to see whether you can access character data unalignedly...
16979 case "$d_u32align" in
16980 '') $cat >try.c <<EOCP
16982 #$i_stdlib I_STDLIB
16984 #include <stdlib.h>
16986 #define U32 $u32type
16987 #define BYTEORDER 0x$byteorder
16989 #include <signal.h>
16991 $signal_t bletch(s) int s; { exit(4); }
16994 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
16999 if (sizeof(U32) != 4) {
17000 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
17007 signal(SIGBUS, bletch);
17019 for (i = 0; i < 4; i++) {
17020 up = (U32*)(buf + i);
17021 if (! ((*up == 1 << (8*i)) || /* big-endian */
17022 (*up == 1 << (8*(3-i))) /* little-endian */
17026 printf("read failed (%x)\n", *up);
17032 for (i = 0; i < 4; i++) {
17033 up = (U32*)(buf + i);
17035 if (*up != 0xBeef) {
17036 printf("write failed (%x)\n", *up);
17050 if eval $compile_ok; then
17051 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
17052 $run ./try 2>&1 >/dev/null
17055 You can access character data pretty unalignedly.
17057 d_u32align="$undef"
17060 It seems that you must access character data in an aligned manner.
17062 d_u32align="$define"
17066 rp='Can you access character data at unaligned addresses?'
17070 [yY]*) d_u32align="$undef" ;;
17071 *) d_u32align="$define" ;;
17074 $rm -f core core.try.* try.core
17078 : see if ualarm exists
17079 set ualarm d_ualarm
17082 : see if umask exists
17086 : see if unordered exists
17087 set unordered d_unordered
17090 : see if usleep exists
17091 set usleep d_usleep
17094 : see if prototype for usleep is available
17096 set d_usleepproto usleep $i_unistd unistd.h
17099 : see if ustat exists
17103 : backward compatibility for d_hvfork
17104 if test X$d_hvfork != X; then
17105 d_vfork="$d_hvfork"
17108 : see if there is a vfork
17113 : Ok, but do we want to use it. vfork is reportedly unreliable in
17114 : perl on Solaris 2.x, and probably elsewhere.
17118 case "$usevfork" in
17124 Perl can only use a vfork() that doesn't suffer from strict
17125 restrictions on calling functions or modifying global data in
17126 the child. For example, glibc-2.1 contains such a vfork()
17127 that is unsuitable. If your system provides a proper fork()
17128 call, chances are that you do NOT want perl to use vfork().
17131 rp="Do you still want to use vfork()?"
17136 echo "Ok, we won't use vfork()."
17145 $define) usevfork='true';;
17146 *) usevfork='false';;
17149 : see if closedir exists
17150 set closedir d_closedir
17153 case "$d_closedir" in
17156 echo "Checking whether closedir() returns a status..." >&4
17158 #$i_dirent I_DIRENT /**/
17159 #$i_sysdir I_SYS_DIR /**/
17160 #$i_sysndir I_SYS_NDIR /**/
17161 #$i_systypes I_SYS_TYPES /**/
17163 #if defined(I_SYS_TYPES)
17164 #include <sys/types.h>
17166 #if defined(I_DIRENT)
17167 #include <dirent.h>
17168 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
17169 #include <sys/dir.h>
17173 #include <sys/ndir.h>
17177 #include <ndir.h> /* may be wrong in the future */
17179 #include <sys/dir.h>
17184 int main() { return closedir(opendir(".")); }
17187 if eval $compile_ok; then
17188 if $run ./try > /dev/null 2>&1 ; then
17189 echo "Yes, it does."
17192 echo "No, it doesn't."
17196 echo "(I can't seem to compile the test program--assuming it doesn't)"
17204 set d_void_closedir
17207 : see if there is a wait4
17211 : see if waitpid exists
17212 set waitpid d_waitpid
17215 : see if wcstombs exists
17216 set wcstombs d_wcstombs
17219 : see if wctomb exists
17220 set wctomb d_wctomb
17223 : see if writev exists
17224 set writev d_writev
17227 : preserve RCS keywords in files with variable substitution, grrr
17232 Revision='$Revision'
17234 : check for alignment requirements
17236 case "$usecrosscompile$multiarch" in
17239 You seem to be either cross-compiling or doing a multiarchitecture build,
17240 skipping the memory alignment check.
17243 case "$alignbytes" in
17244 '') alignbytes=8 ;;
17248 case "$alignbytes" in
17249 '') echo "Checking alignment constraints..." >&4
17250 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
17251 $cat >try.c <<'EOCP'
17252 typedef long double NV;
17255 $cat >try.c <<'EOCP'
17259 $cat >>try.c <<'EOCP'
17267 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
17272 if eval $compile_ok; then
17276 echo "(I can't seem to compile the test program...)"
17279 *) dflt="$alignbytes"
17282 rp="Doubles must be aligned on a how-many-byte boundary?"
17290 : set the base revision
17293 : how do we concatenate cpp tokens here?
17295 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
17296 $cat >cpp_stuff.c <<'EOCP'
17297 #define RCAT(a,b)a/**/b
17298 #define ACAT(a,b)a ## b
17302 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
17303 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
17304 echo "Oh! Smells like ANSI's been here." >&4
17305 echo "We can catify or stringify, separately or together!"
17307 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
17308 echo "Ah, yes! The good old days!" >&4
17309 echo "However, in the good old days we don't know how to stringify and"
17310 echo "catify at the same time."
17314 Hmm, I don't seem to be able to concatenate tokens with your cpp.
17315 You're going to have to edit the values of CAT[2-5] in config.h...
17317 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
17321 : see if this is a db.h system
17327 : Check db version.
17329 echo "Checking Berkeley DB version ..." >&4
17335 #include <sys/types.h>
17337 #$i_stdlib I_STDLIB
17339 #include <stdlib.h>
17342 int main(int argc, char *argv[])
17344 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
17345 int Major, Minor, Patch ;
17346 unsigned long Version ;
17347 (void)db_version(&Major, &Minor, &Patch) ;
17349 printf("%d %d %d %d %d %d\n",
17350 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
17351 Major, Minor, Patch);
17354 printf("You have Berkeley DB Version 2 or greater.\n");
17356 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
17357 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
17358 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
17359 Major, Minor, Patch) ;
17361 /* check that db.h & libdb are compatible */
17362 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
17363 printf("db.h and libdb are incompatible.\n") ;
17367 printf("db.h and libdb are compatible.\n") ;
17369 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
17370 + DB_VERSION_PATCH ;
17372 /* needs to be >= 2.3.4 */
17373 if (Version < 2003004) {
17374 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
17375 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
17381 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
17386 printf("You have Berkeley DB Version 1.\n");
17387 exit(0); /* DB version < 2: the coast is clear. */
17389 exit(1); /* <db.h> not Berkeley DB? */
17395 if eval $compile_ok && $run ./try; then
17396 echo 'Looks OK.' >&4
17398 db_version_major=$1
17399 db_version_minor=$2
17400 db_version_patch=$3
17402 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
17406 : Remove db from list of libraries to use
17407 echo "Removing unusable -ldb from library list" >&4
17408 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
17411 echo "libs = $libs" >&4
17421 : Check the return type needed for hash
17423 echo "Checking return type needed for hash for Berkeley DB ..." >&4
17429 #include <sys/types.h>
17432 #ifndef DB_VERSION_MAJOR
17433 u_int32_t hash_cb (ptr, size)
17441 info.hash = hash_cb;
17445 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17446 if $contains warning try.out >>/dev/null 2>&1 ; then
17449 db_hashtype='u_int32_t'
17452 : XXX Maybe we should just give up here.
17453 db_hashtype=u_int32_t
17455 echo "Help: I can't seem to compile the db test program." >&4
17456 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
17459 echo "Your version of Berkeley DB uses $db_hashtype for hash."
17461 *) db_hashtype=u_int32_t
17466 : Check the return type needed for prefix
17468 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
17474 #include <sys/types.h>
17477 #ifndef DB_VERSION_MAJOR
17478 size_t prefix_cb (key1, key2)
17486 info.prefix = prefix_cb;
17490 if $cc $ccflags -c try.c >try.out 2>&1 ; then
17491 if $contains warning try.out >>/dev/null 2>&1 ; then
17492 db_prefixtype='int'
17494 db_prefixtype='size_t'
17497 db_prefixtype='size_t'
17498 : XXX Maybe we should just give up here.
17500 echo "Help: I can't seem to compile the db test program." >&4
17501 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
17504 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
17506 *) db_prefixtype='size_t'
17511 : How can we generate normalized random numbers ?
17513 echo "Looking for a random number function..." >&4
17514 case "$randfunc" in
17516 if set drand48 val -f; eval $csym; $val; then
17518 echo "Good, found drand48()." >&4
17519 elif set random val -f; eval $csym; $val; then
17521 echo "OK, found random()." >&4
17524 echo "Yick, looks like I have to use rand()." >&4
17535 *-Dmy_rand=*|*-Dmy_srand=*)
17536 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
17537 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
17538 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
17539 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
17543 while $test "$cont"; do
17544 rp="Use which function to generate random numbers?"
17546 if $test "$ans" = "$dflt"; then
17552 if set $ans val -f; eval $csym; $val; then
17556 rp="I cannot find function $ans. Use that name anyway?"
17565 case "$randfunc" in
17567 drand01="drand48()"
17573 case "$randbits" in
17575 echo "Checking to see how many bits your $randfunc() function produces..." >&4
17577 #$i_unistd I_UNISTD
17578 #$i_stdlib I_STDLIB
17581 # include <unistd.h>
17584 # include <stdlib.h>
17589 register unsigned long tmp;
17590 register unsigned long max = 0L;
17592 for (i = 1000; i; i--) {
17593 tmp = (unsigned long) $randfunc();
17594 if (tmp > max) max = tmp;
17596 for (i = 0; max; i++)
17602 if eval $compile_ok; then
17606 echo "(I can't seem to compile the test program...)"
17613 rp="How many bits does your $randfunc() function produce?"
17617 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17618 seedfunc="s$randfunc"
17619 randseedtype=unsigned
17623 rp="How many bits does your $randfunc() function produce?"
17626 seedfunc="s$randfunc"
17627 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
17628 if set $seedfunc val -f; eval $csym; $val; then
17629 echo "(Using $seedfunc() to seed random generator)"
17631 echo "(Warning: no $seedfunc() to seed random generator)"
17634 randseedtype=unsigned
17642 echo "Determining whether or not we are on an EBCDIC system..." >&4
17643 $cat >try.c <<'EOM'
17646 if ('M'==0xd4) return 0;
17653 if eval $compile_ok; then
17654 if $run ./try; then
17655 echo "You seem to speak EBCDIC." >&4
17658 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
17661 echo "I'm unable to compile the test program." >&4
17662 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
17670 Checking how to flush all pending stdio output...
17672 # I only know how to find the first 32 possibly open files on SunOS.
17673 # See also hints/sunos_4_1.sh and util.c --AD
17675 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
17677 $cat >>try.c <<EOCP
17679 #$i_stdlib I_STDLIB
17681 #include <stdlib.h>
17683 #$i_unistd I_UNISTD
17685 # include <unistd.h>
17687 #$d_sysconf HAS_SYSCONF
17688 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
17689 #ifdef HAS_STDIO_STREAM_ARRAY
17690 # define STDIO_STREAM_ARRAY $stdio_stream_array
17695 p = fopen("try.out", "w");
17699 # ifdef TRY_FPRINTF
17703 #ifdef TRY_FFLUSH_NULL
17706 #ifdef TRY_FFLUSH_ALL
17708 long open_max = -1;
17709 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
17710 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
17712 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
17713 open_max = sysconf(_SC_OPEN_MAX);
17716 open_max = FOPEN_MAX;
17719 open_max = OPEN_MAX;
17728 # ifdef HAS_STDIO_STREAM_ARRAY
17729 if (open_max > 0) {
17731 for (i = 0; i < open_max; i++)
17732 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
17733 STDIO_STREAM_ARRAY[i]._file < open_max &&
17734 STDIO_STREAM_ARRAY[i]._flag)
17735 fflush(&STDIO_STREAM_ARRAY[i]);
17743 : first we have to find out how _not_ to flush
17745 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
17747 set try -DTRY_FPUTC
17748 if eval $compile; then
17749 $run ./try 2>/dev/null
17752 if $test ! -s try.out -a "X$code" = X42; then
17758 set try -DTRY_FPRINTF
17759 if eval $compile; then
17760 $run ./try 2>/dev/null
17763 if $test ! -s try.out -a "X$code" = X42; then
17764 output=-DTRY_FPRINTF
17770 : check for fflush NULL behaviour
17771 case "$fflushNULL" in
17772 '') set try -DTRY_FFLUSH_NULL $output
17773 if eval $compile; then
17774 $run ./try 2>/dev/null
17777 if $test -s try.out -a "X$code" = X42; then
17778 fflushNULL="`$cat try.out`"
17780 if $test "X$code" != X42; then
17782 (If this test failed, don't worry, we'll try another method shortly.)
17787 $rm -f core try.core core.try.*
17788 case "$fflushNULL" in
17790 Your fflush(NULL) works okay for output streams.
17791 Let's see if it clobbers input pipes...
17793 # As of mid-March 2000 all versions of Solaris appear to have a stdio
17794 # bug that improperly flushes the input end of pipes. So we avoid the
17795 # autoflush on fork/system/exec support for now. :-(
17796 $cat >tryp.c <<EOCP
17799 main(int argc, char **argv)
17805 while ((i = getc(stdin)) != -1
17806 && (*bp++ = i) != '\n'
17807 && bp < &buf[1024])
17810 fprintf(stdout, "%s", buf);
17818 fflushNULL="$define"
17820 if eval $compile; then
17822 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17823 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17825 fflush(NULL) seems to behave okay with input streams.
17827 fflushNULL="$define"
17830 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
17832 fflushNULL="$undef"
17835 $rm -f core tryp.c tryp.core core.tryp.*
17838 Your fflush(NULL) isn't working (contrary to ANSI C).
17840 fflushNULL="$undef"
17843 Cannot figure out whether your fflush(NULL) works or not.
17844 I'm assuming it doesn't (contrary to ANSI C).
17846 fflushNULL="$undef"
17850 $define|true|[yY]*)
17851 fflushNULL="$define"
17854 fflushNULL="$undef"
17857 : check explicit looping only if NULL did not work, and if the pipe
17858 : bug does not show up on an explicit flush too
17859 case "$fflushNULL" in
17861 $cat >tryp.c <<EOCP
17864 main(int argc, char **argv)
17870 while ((i = getc(stdin)) != -1
17871 && (*bp++ = i) != '\n'
17872 && bp < &buf[1024])
17875 fprintf(stdout, "%s", buf);
17884 if eval $compile; then
17886 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17887 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17889 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
17891 : now check for fflushall behaviour
17892 case "$fflushall" in
17893 '') set try -DTRY_FFLUSH_ALL $output
17894 if eval $compile; then
17896 (Now testing the other method--but note that this also may fail.)
17898 $run ./try 2>/dev/null
17901 if $test -s try.out -a "X$code" = X42; then
17902 fflushall="`$cat try.out`"
17905 $rm -f core try.core core.try.*
17906 case "$fflushall" in
17908 Whew. Flushing explicitly all the stdio streams works.
17910 fflushall="$define"
17913 Sigh. Flushing explicitly all the stdio streams doesn't work.
17918 Cannot figure out whether flushing stdio streams explicitly works or not.
17919 I'm assuming it doesn't.
17925 "$define"|true|[yY]*)
17926 fflushall="$define"
17934 All is futile. Even fflush(stdin) clobbers input pipes!
17941 $rm -f core tryp.c tryp.core core.tryp.*
17943 *) fflushall="$undef"
17947 case "$fflushNULL$fflushall" in
17950 OK, I give up. I cannot figure out how to flush pending stdio output.
17951 We won't be flushing handles at all before fork/exec/popen.
17955 $rm -f try.* try$exe_ext
17957 : Store the full pathname to the ar program for use in the C program
17958 : Respect a hint or command line value for full_ar.
17963 : Store the full pathname to the sed program for use in the C program
17966 : see what type gids are declared as in the kernel
17968 echo "Looking for the type for group ids returned by getgid()."
17969 set gid_t gidtype xxx stdio.h sys/types.h
17973 xxx=`./findhdr sys/user.h`
17974 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
17976 unsigned) dflt="$1 $2" ;;
17980 *) dflt="$gidtype";;
17983 gid_t) echo "gid_t found." ;;
17984 *) rp="What is the type for group ids returned by getgid()?"
17992 *_t) zzz="$gidtype" ;;
17995 echo "Checking the size of $zzz..." >&4
17997 #include <sys/types.h>
17999 #$i_stdlib I_STDLIB
18001 #include <stdlib.h>
18004 printf("%d\n", (int)sizeof($gidtype));
18009 if eval $compile_ok; then
18013 echo "(I can't execute the test program--guessing $gidsize.)" >&4
18016 echo "Your $zzz is $gidsize bytes long."
18021 echo "(I can't compile the test program--guessing $gidsize.)" >&4
18027 *_t) zzz="$gidtype" ;;
18030 echo "Checking the sign of $zzz..." >&4
18032 #include <sys/types.h>
18043 if eval $compile; then
18047 echo "(I can't execute the test program--guessing unsigned.)" >&4
18051 1) echo "Your $zzz is unsigned." ;;
18052 -1) echo "Your $zzz is signed." ;;
18058 echo "(I can't compile the test program--guessing unsigned.)" >&4
18064 if $test X"$quadtype" != X; then
18066 echo "Checking how to print 64-bit integers..." >&4
18068 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
18069 $cat >try.c <<'EOCP'
18070 #include <sys/types.h>
18073 int q = 12345678901;
18074 printf("%ld\n", q);
18078 if eval $compile; then
18082 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
18083 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
18084 echo "We will use %d."
18090 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
18091 $cat >try.c <<'EOCP'
18092 #include <sys/types.h>
18095 long q = 12345678901;
18096 printf("%ld\n", q);
18100 if eval $compile; then
18104 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
18105 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
18106 echo "We will use %ld."
18112 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
18113 $cat >try.c <<'EOCP'
18114 #include <sys/types.h>
18115 #include <inttypes.h>
18118 int64_t q = 12345678901;
18119 printf("%" PRId64 "\n", q);
18123 if eval $compile; then
18127 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
18128 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
18129 echo "We will use the C9X style."
18135 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18137 #include <sys/types.h>
18140 $quadtype q = 12345678901;
18141 printf("%Ld\n", q);
18145 if eval $compile; then
18149 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
18150 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
18151 echo "We will use %Ld."
18157 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
18158 $cat >try.c <<'EOCP'
18159 #include <sys/types.h>
18162 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
18163 printf("%lld\n", q);
18167 if eval $compile; then
18171 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
18172 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
18173 echo "We will use the %lld style."
18179 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
18181 #include <sys/types.h>
18184 $quadtype q = 12345678901;
18185 printf("%qd\n", q);
18189 if eval $compile; then
18193 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
18194 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
18195 echo "We will use %qd."
18201 if $test X"$sPRId64" = X; then
18202 echo "Cannot figure out how to print 64-bit integers." >&4
18210 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
18211 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
18213 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
18214 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
18220 $echo "Checking the format strings to be used for Perl's internal types..." >&4
18222 if $test X"$ivsize" = X8; then
18223 ivdformat="$sPRId64"
18224 uvuformat="$sPRIu64"
18225 uvoformat="$sPRIo64"
18226 uvxformat="$sPRIx64"
18227 uvXUformat="$sPRIXU64"
18229 if $test X"$ivsize" = X"$longsize"; then
18236 if $test X"$ivsize" = X"$intsize"; then
18244 if $test X"$ivsize" = X"$shortsize"; then
18255 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
18256 nveformat="$sPRIeldbl"
18257 nvfformat="$sPRIfldbl"
18258 nvgformat="$sPRIgldbl"
18259 nvEUformat="$sPRIEUldbl"
18260 nvFUformat="$sPRIFUldbl"
18261 nvGUformat="$sPRIGUldbl"
18271 case "$ivdformat" in
18272 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
18279 $echo "Checking the format string to be used for gids..." >&4
18282 -1) if $test X"$gidsize" = X"$ivsize"; then
18283 gidformat="$ivdformat"
18285 if $test X"$gidsize" = X"$longsize"; then
18288 if $test X"$gidsize" = X"$intsize"; then
18291 if $test X"$gidsize" = X"$shortsize"; then
18298 *) if $test X"$gidsize" = X"$uvsize"; then
18299 gidformat="$uvuformat"
18301 if $test X"$gidsize" = X"$longsize"; then
18304 if $test X"$gidsize" = X"$intsize"; then
18307 if $test X"$gidsize" = X"$shortsize"; then
18316 : see if getgroups exists
18317 set getgroups d_getgrps
18320 : see if setgroups exists
18321 set setgroups d_setgrps
18325 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
18327 case "$d_getgrps$d_setgrps" in
18329 case "$groupstype" in
18330 '') dflt="$gidtype" ;;
18331 *) dflt="$groupstype" ;;
18334 What type of pointer is the second argument to getgroups() and setgroups()?
18335 Usually this is the same as group ids, $gidtype, but not always.
18338 rp='What type pointer is the second argument to getgroups() and setgroups()?'
18342 *) groupstype="$gidtype";;
18346 echo "Checking if your $make program sets \$(MAKE)..." >&4
18347 case "$make_set_make" in
18349 $sed 's/^X //' > testmake.mak << 'EOF'
18351 X @echo 'maketemp="$(MAKE)"'
18353 case "`$make -f testmake.mak 2>/dev/null`" in
18354 *maketemp=*) make_set_make='#' ;;
18355 *) make_set_make="MAKE=$make" ;;
18357 $rm -f testmake.mak
18360 case "$make_set_make" in
18361 '#') echo "Yup, it does.";;
18362 *) echo "Nope, it doesn't.";;
18365 : see what type is used for mode_t
18366 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
18367 set mode_t modetype int stdio.h sys/types.h
18370 : see if stdarg is available
18372 if $test `./findhdr stdarg.h`; then
18373 echo "<stdarg.h> found." >&4
18376 echo "<stdarg.h> NOT found." >&4
18380 : see if varags is available
18382 if $test `./findhdr varargs.h`; then
18383 echo "<varargs.h> found." >&4
18385 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
18388 : set up the varargs testing programs
18389 $cat > varargs.c <<EOP
18391 #include <stdarg.h>
18394 #include <varargs.h>
18398 int f(char *p, ...)
18412 p = va_arg(ap, char *);
18417 $cat > varargs <<EOP
18419 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
18428 : now check which varargs header should be included
18433 if `./varargs I_STDARG`; then
18435 elif `./varargs I_VARARGS`; then
18440 if `./varargs I_VARARGS`; then
18447 echo "I could not find the definition for va_dcl... You have problems..." >&4
18448 val="$undef"; set i_stdarg; eval $setvar
18449 val="$undef"; set i_varargs; eval $setvar
18454 case "$i_varhdr" in
18456 val="$define"; set i_stdarg; eval $setvar
18457 val="$undef"; set i_varargs; eval $setvar
18460 val="$undef"; set i_stdarg; eval $setvar
18461 val="$define"; set i_varargs; eval $setvar
18464 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
18468 : see if we need va_copy
18470 case "$i_stdarg" in
18473 #include <stdarg.h>
18475 #$i_stdlib I_STDLIB
18477 #include <stdlib.h>
18479 #include <signal.h>
18482 ivfprintf(FILE *f, const char *fmt, va_list *valp)
18484 return vfprintf(f, fmt, *valp);
18488 myvfprintf(FILE *f, const char *fmt, va_list val)
18490 return ivfprintf(f, fmt, &val);
18494 myprintf(char *fmt, ...)
18497 va_start(val, fmt);
18498 return myvfprintf(stdout, fmt, val);
18502 main(int ac, char **av)
18504 signal(SIGSEGV, exit);
18506 myprintf("%s%cs all right, then\n", "that", '\'');
18511 if eval $compile && $run ./try 2>&1 >/dev/null; then
18512 case "`$run ./try`" in
18513 "that's all right, then")
18519 yes) echo "It seems that you don't need va_copy()." >&4
18520 need_va_copy="$undef"
18522 *) echo "It seems that va_copy() or similar will be needed." >&4
18523 need_va_copy="$define"
18526 $rm -f try.* core core.* *.core *.core.*
18528 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
18532 : see what type is used for size_t
18533 rp="What is the type used for the length parameter for string functions?"
18534 set size_t sizetype 'unsigned int' stdio.h sys/types.h
18537 : check for type of arguments to gethostbyaddr.
18538 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
18539 case "$d_gethbyaddr" in
18543 Checking to see what type of arguments are accepted by gethostbyaddr().
18545 hdrs="$define sys/types.h
18546 $d_socket sys/socket.h
18547 $i_niin netinet/in.h
18549 $i_unistd unistd.h"
18550 : The first arg can 'char *' or 'void *'
18551 : The second arg is some of integral type
18552 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
18553 for yyy in size_t long int; do
18554 case "$netdb_host_type" in
18555 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
18556 if ./protochk "$try" $hdrs; then
18557 echo "Your system accepts $xxx for the first arg."
18558 echo "...and $yyy for the second arg."
18559 netdb_host_type="$xxx"
18560 netdb_hlen_type="$yyy"
18566 : In case none of those worked, prompt the user.
18567 case "$netdb_host_type" in
18568 '') rp='What is the type for the 1st argument to gethostbyaddr?'
18571 netdb_host_type=$ans
18572 rp='What is the type for the 2nd argument to gethostbyaddr?'
18575 netdb_hlen_type=$ans
18579 *) : no gethostbyaddr, so pick harmless defaults
18580 netdb_host_type='char *'
18581 netdb_hlen_type="$sizetype"
18584 # Remove the "const" if needed. -- but then we'll have a
18586 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
18589 : check for type of argument to gethostbyname.
18590 if test "X$netdb_name_type" = X ; then
18591 case "$d_gethbyname" in
18595 Checking to see what type of argument is accepted by gethostbyname().
18597 hdrs="$define sys/types.h
18598 $d_socket sys/socket.h
18599 $i_niin netinet/in.h
18601 $i_unistd unistd.h"
18602 for xxx in "const char *" "char *"; do
18603 case "$netdb_name_type" in
18604 '') try="extern struct hostent *gethostbyname($xxx);"
18605 if ./protochk "$try" $hdrs; then
18606 echo "Your system accepts $xxx."
18607 netdb_name_type="$xxx"
18612 : In case none of those worked, prompt the user.
18613 case "$netdb_name_type" in
18614 '') rp='What is the type for the 1st argument to gethostbyname?'
18617 netdb_name_type=$ans
18621 *) : no gethostbyname, so pick harmless default
18622 netdb_name_type='char *'
18627 : check for type of 1st argument to getnetbyaddr.
18628 if test "X$netdb_net_type" = X ; then
18629 case "$d_getnbyaddr" in
18633 Checking to see what type of 1st argument is accepted by getnetbyaddr().
18635 hdrs="$define sys/types.h
18636 $d_socket sys/socket.h
18637 $i_niin netinet/in.h
18639 $i_unistd unistd.h"
18640 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
18641 case "$netdb_net_type" in
18642 '') try="extern struct netent *getnetbyaddr($xxx, int);"
18643 if ./protochk "$try" $hdrs; then
18644 echo "Your system accepts $xxx."
18645 netdb_net_type="$xxx"
18650 : In case none of those worked, prompt the user.
18651 case "$netdb_net_type" in
18652 '') rp='What is the type for the 1st argument to getnetbyaddr?'
18655 netdb_net_type=$ans
18659 *) : no getnetbyaddr, so pick harmless default
18660 netdb_net_type='long'
18664 : locate the preferred pager for this system
18671 [a-zA-Z]:/*) dflt=$pg;;
18675 [a-zA-Z]:/*) dflt=$more;;
18679 [a-zA-Z]:/*) dflt=$less;;
18682 '') dflt=/usr/ucb/more;;
18686 : Instruct ./getfile to trust the hinted or previous pager value,
18687 : even if it does not begin with a slash. For example, on os2,
18688 : pager might be cmd /c more. See comments in UU/getfile.
18693 rp='What pager is used on your system?'
18697 : see what type pids are declared as in the kernel
18698 rp="What is the type of process ids on this system?"
18699 set pid_t pidtype int stdio.h sys/types.h
18702 : see if ar generates random libraries by itself
18704 echo "Checking how to generate random libraries on your machine..." >&4
18705 echo 'int bar1() { return bar2(); }' > bar1.c
18706 echo 'int bar2() { return 2; }' > bar2.c
18708 #$i_stdlib I_STDLIB
18710 #include <stdlib.h>
18712 int main() { printf("%d\n", bar1()); exit(0); }
18714 $cc $ccflags -c bar1.c >/dev/null 2>&1
18715 $cc $ccflags -c bar2.c >/dev/null 2>&1
18716 $cc $ccflags -c foo.c >/dev/null 2>&1
18717 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
18718 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
18719 $run ./foobar >/dev/null 2>&1; then
18720 echo "$ar appears to generate random libraries itself."
18723 elif $ar ts bar$_a >/dev/null 2>&1 &&
18724 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
18725 $run ./foobar >/dev/null 2>&1; then
18726 echo "a table of contents needs to be added with '$ar ts'."
18733 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
18734 $test -f $ranlib || ranlib=''
18737 if $test -n "$ranlib"; then
18738 echo "your system has '$ranlib'; we'll use that."
18741 echo "your system doesn't seem to support random libraries"
18742 echo "so we'll use lorder and tsort to order the libraries."
18749 : check for type of arguments to select.
18750 case "$selecttype" in
18751 '') case "$d_select" in
18755 Checking to see what type of arguments are accepted by select().
18757 hdrs="$define sys/types.h
18758 $i_systime sys/time.h
18759 $i_sysselct sys/select.h
18760 $d_socket sys/socket.h"
18761 : The first arg can be int, unsigned, or size_t
18762 : The last arg may or may not be 'const'
18764 : void pointer has been seen but using that
18765 : breaks the selectminbits test
18766 for xxx in 'fd_set *' 'int *'; do
18767 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
18768 for tmo in 'struct timeval *' 'const struct timeval *'; do
18770 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
18771 if ./protochk "$try" $hdrs; then
18772 echo "Your system accepts $xxx."
18781 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
18782 case "$d_fd_set" in
18783 $define) dflt="fd_set *" ;;
18792 *) : no select, so pick a harmless default
18799 : check for the select 'width'
18800 case "$selectminbits" in
18801 '') safebits=`expr $ptrsize \* 8`
18802 case "$d_select" in
18806 Checking to see on how many bits at a time your select() operates...
18809 #include <sys/types.h>
18811 #$i_systime I_SYS_TIME
18812 #$i_systimek I_SYS_TIME_KERNEL
18817 # ifdef I_SYS_TIME_KERNEL
18820 # include <sys/time.h>
18821 # ifdef I_SYS_TIME_KERNEL
18825 #$i_sysselct I_SYS_SELECT
18826 #ifdef I_SYS_SELECT
18827 #include <sys/select.h>
18829 #$d_socket HAS_SOCKET
18831 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
18834 #$i_stdlib I_STDLIB
18836 #include <stdlib.h>
18839 #define S sizeof(*(b))
18841 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
18842 #define NBITS (NBYTES * 8)
18844 char *s = malloc(NBYTES);
18853 fp = fopen("try.c", "r");
18859 b = ($selecttype)s;
18860 for (i = 0; i < NBITS; i++)
18864 select(fd + 1, b, 0, 0, &t);
18865 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
18867 printf("%d\n", i + 1);
18872 if eval $compile_ok; then
18873 selectminbits=`$run ./try`
18874 case "$selectminbits" in
18876 Cannot figure out on how many bits at a time your select() operates.
18877 I'll play safe and guess it is $safebits bits.
18879 selectminbits=$safebits
18880 bits="$safebits bits"
18883 *) bits="$selectminbits bits" ;;
18885 echo "Your select() operates on $bits at a time." >&4
18887 rp='What is the minimum number of bits your select() operates on?'
18888 case "$byteorder" in
18889 12345678) dflt=64 ;;
18895 selectminbits="$val"
18899 *) : no select, so pick a harmless default
18900 selectminbits=$safebits
18906 : Trace out the files included by signal.h, then look for SIGxxx names.
18907 : Remove SIGARRAYSIZE used by HPUX.
18908 : Remove SIGSTKSIZE used by Linux.
18909 : Remove SIGSTKSZ used by Posix.
18910 : Remove SIGTYP void lines used by OS2.
18911 : Some cpps, like os390, dont give the file name anywhere
18912 if [ "X$fieldn" = X ]; then
18913 : Just make some guesses. We check them later.
18914 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
18916 xxx=`echo '#include <signal.h>' |
18917 $cppstdin $cppminus $cppflags 2>/dev/null |
18918 $grep '^[ ]*#.*include' |
18919 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
18921 : Check this list of files to be sure we have parsed the cpp output ok.
18922 : This will also avoid potentially non-existent files, such
18925 for xx in $xxx /dev/null ; do
18926 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
18928 : If we have found no files, at least try signal.h
18929 case "$xxxfiles" in
18930 '') xxxfiles=`./findhdr signal.h` ;;
18933 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
18934 print substr($2, 4, 20)
18936 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
18937 print substr($3, 4, 20)
18939 : Append some common names just in case the awk scan failed.
18940 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
18941 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
18942 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
18943 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
18944 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
18946 : generate a few handy files for later
18947 $cat > signal.c <<EOCP
18948 #include <sys/types.h>
18949 #include <signal.h>
18950 #$i_stdlib I_STDLIB
18952 #include <stdlib.h>
18957 /* Strange style to avoid deeply-nested #if/#else/#endif */
18960 # define NSIG (_NSIG)
18966 # define NSIG (SIGMAX+1)
18972 # define NSIG (SIG_MAX+1)
18978 # define NSIG (MAXSIG+1)
18984 # define NSIG (MAX_SIG+1)
18989 # ifdef SIGARRAYSIZE
18990 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
18996 # define NSIG (_sys_nsig) /* Solaris 2.5 */
19000 /* Default to some arbitrary number that's big enough to get most
19001 of the common signals.
19007 printf("NSIG %d\n", NSIG);
19013 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
19015 printf "#ifdef SIG"; printf $1; printf "\n"
19016 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
19017 printf $1; printf ");\n"
19021 printf "#endif /* JUST_NSIG */\n";
19022 printf "exit(0);\n}\n";
19025 $cat >signal.awk <<'EOP'
19026 BEGIN { ndups = 0 }
19027 $1 ~ /^NSIG$/ { nsig = $2 }
19028 ($1 !~ /^NSIG$/) && (NF == 2) && ($2 ~ /^[0-9][0-9]*$/) {
19029 if ($2 > maxsig) { maxsig = $2 }
19030 if (sig_name[$2]) {
19031 dup_name[ndups] = $1
19032 dup_num[ndups] = $2
19044 printf("NSIG %d\n", nsig);
19045 for (n = 1; n < nsig; n++) {
19047 printf("%s %d\n", sig_name[n], sig_num[n])
19050 printf("NUM%d %d\n", n, n)
19053 for (n = 0; n < ndups; n++) {
19054 printf("%s %d\n", dup_name[n], dup_num[n])
19058 $cat >signal_cmd <<EOS
19060 if $test -s signal.lst; then
19061 echo "Using your existing signal.lst file"
19066 $cat >>signal_cmd <<'EOS'
19069 if eval $compile_ok; then
19070 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
19072 echo "(I can't seem be able to compile the whole test program)" >&4
19073 echo "(I'll try it in little pieces.)" >&4
19074 set signal -DJUST_NSIG
19075 if eval $compile_ok; then
19076 $run ./signal$_exe > signal.nsg
19079 echo "I can't seem to figure out how many signals you have." >&4
19080 echo "Guessing 50." >&4
19081 echo 'NSIG 50' > signal.nsg
19083 : Now look at all the signal names, one at a time.
19084 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
19085 $cat > signal.c <<EOCP
19086 #include <sys/types.h>
19087 #include <signal.h>
19090 printf("$xx %d\n", SIG${xx});
19095 if eval $compile; then
19096 echo "SIG${xx} found."
19097 $run ./signal$_exe >> signal.ls1
19099 echo "SIG${xx} NOT found."
19102 if $test -s signal.ls1; then
19103 $cat signal.nsg signal.ls1 |
19104 $sort -n | $uniq | $awk -f signal.awk >signal.lst
19108 if $test -s signal.lst; then
19111 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
19112 echo 'kill -l' >signal
19113 set X `csh -f <signal`
19117 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
19119 echo $@ | $tr ' ' $trnl | \
19120 $awk '{ printf "%s %d\n", $1, ++s; }
19121 END { printf "NSIG %d\n", ++s }' >signal.lst
19123 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
19125 chmod a+x signal_cmd
19126 $eunicefix signal_cmd
19128 : generate list of signal names
19130 case "$sig_name_init" in
19132 *) case "$sig_num_init" in
19133 ''|*,*) doinit=yes ;;
19138 echo "Generating a list of signal names and numbers..." >&4
19140 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
19141 sig_name=`$awk 'BEGIN { printf "ZERO " }
19142 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
19143 sig_num=`$awk 'BEGIN { printf "0 " }
19144 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
19145 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
19146 !/^NSIG/ { printf "\"%s\", ", $1 }
19147 END { printf "0\n" }' signal.lst`
19148 sig_num_init=`$awk 'BEGIN { printf "0, " }
19149 !/^NSIG/ { printf "%d, ", $2}
19150 END { printf "0\n"}' signal.lst`
19153 echo "The following $sig_count signals are available:"
19155 echo $sig_name | $awk \
19156 'BEGIN { linelen = 0 }
19158 for (i = 1; i <= NF; i++) {
19159 name = "SIG" $i " "
19160 linelen = linelen + length(name)
19161 if (linelen > 70) {
19163 linelen = length(name)
19169 sig_size=`echo $sig_name | awk '{print NF}'`
19170 $rm -f signal signal.c signal.awk signal.lst signal_cmd
19173 case "$sizetype" in
19174 *_t) zzz="$sizetype" ;;
19175 *) zzz="filesize" ;;
19177 echo "Checking the size of $zzz..." >&4
19179 #include <sys/types.h>
19181 #$i_stdlib I_STDLIB
19183 #include <stdlib.h>
19186 printf("%d\n", (int)sizeof($sizetype));
19191 if eval $compile_ok; then
19195 echo "(I can't execute the test program--guessing $sizesize.)" >&4
19198 echo "Your $zzz size is $sizesize bytes."
19203 echo "(I can't compile the test program--guessing $sizesize.)" >&4
19207 : check for socklen_t
19209 echo "Checking to see if you have socklen_t..." >&4
19211 #include <sys/types.h>
19212 #$d_socket HAS_SOCKET
19214 #include <sys/socket.h>
19216 int main() { socklen_t x = 16; }
19219 if eval $compile; then
19221 echo "You have socklen_t."
19224 echo "You do not have socklen_t."
19225 case "$sizetype" in
19226 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
19233 : see if this is a socks.h system
19234 set socks.h i_socks
19237 : check for type of the size argument to socket calls
19238 case "$d_socket" in
19242 Checking to see what type is the last argument of accept().
19245 case "$d_socklen_t" in
19246 "$define") yyy="$yyy socklen_t"
19248 yyy="$yyy $sizetype int long unsigned"
19249 for xxx in $yyy; do
19250 case "$socksizetype" in
19251 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
19252 case "$usesocks" in
19254 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
19255 echo "Your system accepts '$xxx *' for the last argument of accept()."
19256 socksizetype="$xxx"
19259 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
19260 echo "Your system accepts '$xxx *' for the last argument of accept()."
19261 socksizetype="$xxx"
19268 : In case none of those worked, prompt the user.
19269 case "$socksizetype" in
19270 '') rp='What is the type for socket address structure sizes?'
19277 *) : no sockets, so pick relatively harmless default
19282 : see what type is used for signed size_t
19283 set ssize_t ssizetype int stdio.h sys/types.h
19288 #$i_stdlib I_STDLIB
19290 #include <stdlib.h>
19292 #include <sys/types.h>
19293 #define Size_t $sizetype
19294 #define SSize_t $dflt
19297 if (sizeof(Size_t) == sizeof(SSize_t))
19299 else if (sizeof(Size_t) == sizeof(int))
19308 if eval $compile_ok && $run ./try > /dev/null; then
19309 ssizetype=`$run ./try`
19310 echo "I'll be using $ssizetype for functions returning a byte count." >&4
19313 Help! I can't compile and run the ssize_t test program: please enlighten me!
19314 (This is probably a misconfiguration in your system or libraries, and
19315 you really ought to fix it. Still, I'll try anyway.)
19317 I need a type that is the same size as $sizetype, but is guaranteed to
19318 be signed. Common values are ssize_t, int and long.
19321 rp="What signed type is the same size as $sizetype?"
19327 : see what type of char stdio uses.
19329 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
19330 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
19331 echo "Your stdio uses unsigned chars." >&4
19332 stdchar="unsigned char"
19334 echo "Your stdio uses signed chars." >&4
19341 : see what type uids are declared as in the kernel
19343 echo "Looking for the type for user ids returned by getuid()."
19344 set uid_t uidtype xxx stdio.h sys/types.h
19348 xxx=`./findhdr sys/user.h`
19349 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
19351 unsigned) dflt="$1 $2" ;;
19355 *) dflt="$uidtype";;
19358 uid_t) echo "uid_t found." ;;
19359 *) rp="What is the type for user ids returned by getuid()?"
19367 *_t) zzz="$uidtype" ;;
19370 echo "Checking the size of $zzz..." >&4
19372 #include <sys/types.h>
19374 #$i_stdlib I_STDLIB
19376 #include <stdlib.h>
19379 printf("%d\n", (int)sizeof($uidtype));
19384 if eval $compile_ok; then
19388 echo "(I can't execute the test program--guessing $uidsize.)" >&4
19391 echo "Your $zzz is $uidsize bytes long."
19396 echo "(I can't compile the test program--guessing $uidsize.)" >&4
19401 *_t) zzz="$uidtype" ;;
19404 echo "Checking the sign of $zzz..." >&4
19406 #include <sys/types.h>
19417 if eval $compile; then
19421 echo "(I can't execute the test program--guessing unsigned.)" >&4
19425 1) echo "Your $zzz is unsigned." ;;
19426 -1) echo "Your $zzz is signed." ;;
19432 echo "(I can't compile the test program--guessing unsigned.)" >&4
19438 $echo "Checking the format string to be used for uids..." >&4
19441 -1) if $test X"$uidsize" = X"$ivsize"; then
19442 uidformat="$ivdformat"
19444 if $test X"$uidsize" = X"$longsize"; then
19447 if $test X"$uidsize" = X"$intsize"; then
19450 if $test X"$uidsize" = X"$shortsize"; then
19457 *) if $test X"$uidsize" = X"$uvsize"; then
19458 uidformat="$uvuformat"
19460 if $test X"$uidsize" = X"$longsize"; then
19463 if $test X"$uidsize" = X"$intsize"; then
19466 if $test X"$uidsize" = X"$shortsize"; then
19475 : determine compiler compiler
19484 if $test -f "$byacc$_exe"; then
19486 comp="byacc or $comp"
19488 if $test -f "$bison$_exe"; then
19489 comp="$comp or bison -y"
19491 rp="Which compiler compiler ($comp) shall I use?"
19500 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
19506 : see if this is a fp.h system
19510 : see if this is a fp_class.h system
19511 set fp_class.h i_fp_class
19514 : see if this is a ieeefp.h system
19515 case "$i_ieeefp" in
19516 '' ) set ieeefp.h i_ieeefp
19521 : see if this is a libutil.h system
19522 set libutil.h i_libutil
19525 : see if mach cthreads are available
19526 if test "X$usethreads" = "X$define"; then
19527 set mach/cthreads.h i_machcthr
19530 i_machcthr="$undef"
19535 : see if this is a math.h system
19539 : see if this is a mntent.h system
19540 set mntent.h i_mntent
19543 : see if ndbm.h is available
19549 # Some Linux distributions such as RedHat 7.1 put the
19550 # ndbm.h header in /usr/include/gdbm/ndbm.h.
19551 if $test -f /usr/include/gdbm/ndbm.h; then
19552 echo '<gdbm/ndbm.h> found.'
19553 ccflags="$ccflags -I/usr/include/gdbm"
19554 cppflags="$cppflags -I/usr/include/gdbm"
19562 : see if dbm_open exists
19563 set dbm_open d_dbm_open
19565 case "$d_dbm_open" in
19568 echo "We won't be including <ndbm.h>"
19577 : see if net/errno.h is available
19579 set net/errno.h val
19582 : Unfortunately, it causes problems on some systems. Arrgh.
19585 cat > try.c <<'EOM'
19588 #include <net/errno.h>
19594 if $cc $ccflags -c try.c >/dev/null 2>&1; then
19595 echo "We'll be including <net/errno.h>." >&4
19597 echo "We won't be including <net/errno.h>." >&4
19606 : see if netinet/tcp.h is available
19607 set netinet/tcp.h i_netinettcp
19610 : see if this is a poll.h system
19614 : see if this is a prot.h system
19619 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
19620 $cat <<'EOSH' > Cppsym.know
19621 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
19622 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
19623 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
19624 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
19625 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
19626 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
19627 bull c cadmus clipper CMU COFF COMPILER_VERSION
19628 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
19629 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
19630 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
19631 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
19633 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
19634 H3050R H3050RX hbullx20 hcx host_mips
19635 hp200 hp300 hp700 HP700 hp800 hp9000
19636 hp9000s200 hp9000s300 hp9000s400 hp9000s500
19637 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
19638 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
19639 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
19640 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
19641 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
19642 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
19643 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
19644 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
19645 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
19646 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
19647 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
19648 MATH_HAS_NO_SIDE_EFFECTS
19649 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
19650 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
19651 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
19652 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
19653 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
19654 NetBSD news1500 news1700 news1800 news1900 news3700
19655 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
19656 ns32016 ns32332 ns32k nsc32000
19657 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
19658 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
19659 pc532 pdp11 PGC PIC plexus PORTAR posix
19660 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
19661 POSIX_C_SOURCE POSIX_SOURCE POWER
19662 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
19663 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
19664 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
19665 sony sony_news sonyrisc sparc sparclite spectrum
19666 stardent stdc STDC_EXT stratos sun sun3 sun386
19667 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
19668 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
19669 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
19670 sysV68 sysV88 Tek4132 Tek4300 titan
19671 TM3200 TM5400 TM5600
19672 tower tower32 tower32_200 tower32_600 tower32_700
19673 tower32_800 tower32_850 tss
19674 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
19675 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
19676 unix UNIX95 UNIX99 unixpc unos
19677 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
19678 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
19679 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
19681 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
19682 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
19683 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
19686 # Maybe put other stuff here too.
19687 cat <<EOSH >>Cppsym.know
19690 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
19691 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
19692 $cat Cppsym.know > Cppsym.c
19693 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
19694 $rm -f Cppsym.a Cppsym.b Cppsym.c
19695 cat <<EOSH > Cppsym
19697 if $test \$# -gt 0; then
19698 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
19699 if $test -s Cppsym.got; then
19706 $tr " " "$trnl" | ./Cppsym.try
19712 cat <<EOSH > Cppsym.try
19714 cat <<'EOCP' > try.c
19720 cat <<'EOSH' >> Cppsym.try
19722 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
19723 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
19724 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
19725 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
19727 echo 'return 0;}' >> try.c
19729 cat <<EOSH >> Cppsym.try
19731 case "$osname-$gccversion" in
19732 irix-) ccflags="\$ccflags -woff 1178" ;;
19733 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
19735 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
19737 chmod +x Cppsym.try
19738 $eunicefix Cppsym.try
19739 ./Cppsym < Cppsym.know > Cppsym.true
19740 : now check the C compiler for additional symbols
19741 postprocess_cc_v=''
19743 aix) postprocess_cc_v="|$tr , ' '" ;;
19750 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
19753 -D*) echo "\$i" | $sed 's/^-D//';;
19754 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
19759 postprocess_cc_v=''
19762 ./ccsym > ccsym1.raw
19763 if $test -s ccsym1.raw; then
19764 $sort ccsym1.raw | $uniq >ccsym.raw
19766 mv ccsym1.raw ccsym.raw
19769 $awk '/\=/ { print $0; next }
19770 { print $0"=1" }' ccsym.raw >ccsym.list
19771 $awk '/\=/ { print $0; next }
19772 { print $0"=1" }' Cppsym.true >ccsym.true
19773 $comm -13 ccsym.true ccsym.list >ccsym.own
19774 $comm -12 ccsym.true ccsym.list >ccsym.com
19775 $comm -23 ccsym.true ccsym.list >ccsym.cpp
19777 if $test -z ccsym.raw; then
19778 echo "Your C compiler doesn't seem to define any symbols!" >&4
19780 echo "However, your C preprocessor defines the following symbols:"
19783 cppsymbols=`$cat Cppsym.true`
19784 cppsymbols=`echo $cppsymbols`
19785 cppccsymbols="$cppsymbols"
19787 if $test -s ccsym.com; then
19788 echo "Your C compiler and pre-processor define these symbols:"
19789 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
19792 cppccsymbols=`$cat ccsym.com`
19793 cppccsymbols=`echo $cppccsymbols`
19794 $test "$silent" || sleep 1
19796 if $test -s ccsym.cpp; then
19797 $test "$also" && echo " "
19798 echo "Your C pre-processor ${also}defines the following symbols:"
19799 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
19801 cppsymbols=`$cat ccsym.cpp`
19802 cppsymbols=`echo $cppsymbols`
19803 $test "$silent" || sleep 1
19805 if $test -s ccsym.own; then
19806 $test "$also" && echo " "
19807 echo "Your C compiler ${also}defines the following cpp symbols:"
19808 $sed -e 's/\(..*\)=1/\1/' ccsym.own
19809 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
19810 ccsymbols=`$cat ccsym.own`
19811 ccsymbols=`echo $ccsymbols`
19812 $test "$silent" || sleep 1
19816 : see if this is a termio system
19820 if $test `./findhdr termios.h`; then
19821 set tcsetattr i_termios
19827 "$define") echo "You have POSIX termios.h... good!" >&4;;
19828 *) if ./Cppsym pyr; then
19829 case "`/bin/universe`" in
19830 ucb) if $test `./findhdr sgtty.h`; then
19832 echo "<sgtty.h> found." >&4
19834 echo "System is pyramid with BSD universe."
19835 echo "<sgtty.h> not found--you could have problems." >&4
19837 *) if $test `./findhdr termio.h`; then
19839 echo "<termio.h> found." >&4
19841 echo "System is pyramid with USG universe."
19842 echo "<termio.h> not found--you could have problems." >&4
19846 if $test `./findhdr termio.h`; then
19847 echo "<termio.h> found." >&4
19849 elif $test `./findhdr sgtty.h`; then
19850 echo "<sgtty.h> found." >&4
19853 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
19856 if $test `./findhdr sgtty.h`; then
19857 echo "<sgtty.h> found." >&4
19859 elif $test `./findhdr termio.h`; then
19860 echo "<termio.h> found." >&4
19863 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
19867 set i_termio; eval $setvar
19868 val=$val2; set i_sgtty; eval $setvar
19869 val=$val3; set i_termios; eval $setvar
19871 : see if stddef is available
19872 set stddef.h i_stddef
19875 : see if this is a sunmath.h system
19876 set sunmath.h i_sunmath
19879 : see if sys/access.h is available
19880 set sys/access.h i_sysaccess
19883 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
19884 set sys/filio.h i_sysfilio
19887 if $test `./findhdr sys/ioctl.h`; then
19889 echo '<sys/ioctl.h> found.' >&4
19892 if $test $i_sysfilio = "$define"; then
19893 echo '<sys/ioctl.h> NOT found.' >&4
19895 $test $i_sgtty = "$define" && xxx="sgtty.h"
19896 $test $i_termio = "$define" && xxx="termio.h"
19897 $test $i_termios = "$define" && xxx="termios.h"
19898 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
19904 : see if socket ioctl defs are in sys/sockio.h
19906 xxx=`./findhdr sys/sockio.h`
19907 if $test "$xxx"; then
19908 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
19910 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
19913 echo "No socket ioctls found in <sys/sockio.h>." >&4
19918 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
19925 : see if this is a syslog.h system
19926 set syslog.h i_syslog
19930 : see if this is a sys/mode.h system
19931 set sys/mode.h i_sysmode
19934 : see if sys/resource.h has to be included
19935 set sys/resource.h i_sysresrc
19938 : see if sys/security.h is available
19939 set sys/security.h i_syssecrt
19942 : see if this is a sys/statvfs.h system
19943 set sys/statvfs.h i_sysstatvfs
19946 : see if this is a sys/un.h system
19947 set sys/un.h i_sysun
19951 : see if this is a sys/utsname.h system
19952 set sys/utsname.h i_sysutsname
19955 : see if this is a syswait system
19956 set sys/wait.h i_syswait
19959 : see if this is a ustat.h system
19960 set ustat.h i_ustat
19963 : see if this is an utime system
19964 set utime.h i_utime
19967 : see if this is a values.h system
19968 set values.h i_values
19971 : see if this is a vfork system
19974 set vfork.h i_vfork
19982 : see if gdbm.h is available
19987 : see if gdbm_open exists
19988 set gdbm_open d_gdbm_open
19990 case "$d_gdbm_open" in
19993 echo "We won't be including <gdbm.h>"
20003 echo "Looking for extensions..." >&4
20004 : If we are using the old config.sh, known_extensions may contain
20005 : old or inaccurate or duplicate values.
20006 known_extensions=''
20007 nonxs_extensions=''
20008 : We do not use find because it might not be available.
20009 : We do not just use MANIFEST because the user may have dropped
20010 : some additional extensions into the source tree and expect them
20013 : Function to recursively find available extensions, ignoring DynaLoader
20014 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
20018 DynaLoader|dynaload) ;;
20020 if $test -f $xxx/$xxx.xs; then
20021 known_extensions="$known_extensions $1$xxx";
20022 elif $test -f $xxx/Makefile.PL; then
20023 nonxs_extensions="$nonxs_extensions $1$xxx";
20025 if $test -d $xxx -a $# -lt 10; then
20028 eval $find_extensions;
20040 eval $find_extensions
20041 # Special case: Add in threads/shared since it is not picked up by the
20042 # recursive find above (and adding in general recursive finding breaks
20043 # SDBM_File/sdbm). A.D. 10/25/2001.
20044 known_extensions="$known_extensions threads/shared"
20045 set X $nonxs_extensions
20047 nonxs_extensions="$*"
20048 set X $known_extensions
20050 known_extensions="$*"
20053 : Now see which are supported on this system.
20055 for xxx in $known_extensions ; do
20059 $define) avail_ext="$avail_ext $xxx" ;;
20062 GDBM_File|gdbm_fil)
20064 $define) avail_ext="$avail_ext $xxx" ;;
20067 I18N/Langinfo|i18n_lan)
20068 case "$i_langinfo$d_nl_langinfo" in
20069 $define$define) avail_ext="$avail_ext $xxx" ;;
20072 NDBM_File|ndbm_fil)
20075 case "$osname-$use64bitint" in
20078 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
20081 *) avail_ext="$avail_ext $xxx" ;;
20086 ODBM_File|odbm_fil)
20087 case "${i_dbm}${i_rpcsvcdbm}" in
20089 case "$osname-$use64bitint" in
20092 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
20095 *) avail_ext="$avail_ext $xxx" ;;
20101 case "$useposix" in
20102 true|define|y) avail_ext="$avail_ext $xxx" ;;
20106 case "$useopcode" in
20107 true|define|y) avail_ext="$avail_ext $xxx" ;;
20111 case "$d_socket" in
20114 beos) ;; # not unless BONE
20115 *) avail_ext="$avail_ext $xxx" ;;
20120 Sys/Syslog|sys/syslog)
20121 : XXX syslog requires socket
20122 case "$d_socket" in
20123 true|$define|y) avail_ext="$avail_ext $xxx" ;;
20127 case "$usethreads" in
20129 case "$useithreads" in
20130 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
20134 XS/APItest|xs/apitest)
20135 # This is just for testing. Skip it unless we have dynamic loading.
20138 $define) avail_ext="$avail_ext $xxx" ;;
20141 XS/Typemap|xs/typemap)
20142 # This is just for testing. Skip it unless we have dynamic loading.
20144 $define) avail_ext="$avail_ext $xxx" ;;
20147 threads|threads/shared)
20148 # threads and threads::shared are special cases.
20149 # To stop people from asking "Perl 5.8.0 was supposed
20150 # to have this new fancy threads implementation but my
20151 # perl doesn't have it" and from people trying to
20152 # (re)install the threads module using CPAN.pm and
20153 # CPAN.pm then offering to reinstall Perl 5.8.0,
20154 # the threads.pm and threads/shared.pm will always be
20155 # there, croaking informatively ("you need to rebuild
20156 # all of Perl with threads, sorry") when threads haven't
20157 # been compiled in.
20159 avail_ext="$avail_ext $xxx"
20162 : XXX Do we need a useipcsysv variable here
20163 case "${d_msg}${d_sem}${d_shm}" in
20164 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
20167 *) avail_ext="$avail_ext $xxx"
20176 case "$onlyextensions" in
20178 *) keepextensions=''
20179 echo "You have requested that only certains extensions be included..." >&4
20180 for i in $onlyextensions; do
20181 case " $avail_ext " in
20183 echo "Keeping extension $i."
20184 keepextensions="$keepextensions $i"
20186 *) echo "Ignoring extension $i." ;;
20189 avail_ext="$keepextensions"
20193 case "$noextensions" in
20195 *) keepextensions=''
20196 echo "You have requested that certain extensions be ignored..." >&4
20197 for i in $avail_ext; do
20198 case " $noextensions " in
20199 *" $i "*) echo "Ignoring extension $i." ;;
20200 *) echo "Keeping extension $i.";
20201 keepextensions="$keepextensions $i"
20205 avail_ext="$keepextensions"
20209 : Now see which nonxs extensions are supported on this system.
20210 : For now assume all are.
20212 for xxx in $nonxs_extensions ; do
20214 *) nonxs_ext="$nonxs_ext $xxx"
20226 A number of extensions are supplied with $package. You may choose to
20227 compile these extensions for dynamic loading (the default), compile
20228 them into the $package executable (static loading), or not include
20229 them at all. Answer "none" to include no extensions.
20230 Note that DynaLoader is always built and need not be mentioned here.
20233 case "$dynamic_ext" in
20235 : Exclude those listed in static_ext
20237 for xxx in $avail_ext; do
20238 case " $static_ext " in
20240 *) dflt="$dflt $xxx" ;;
20247 *) dflt="$dynamic_ext"
20248 # Perhaps we are reusing an old out-of-date config.sh.
20251 if test X"$dynamic_ext" != X"$avail_ext"; then
20253 NOTICE: Your previous config.sh list may be incorrect.
20254 The extensions now available to you are
20256 but the default list from your previous config.sh is
20268 rp="What extensions do you wish to load dynamically?"
20271 none) dynamic_ext=' ' ;;
20272 *) dynamic_ext="$ans" ;;
20275 case "$static_ext" in
20277 : Exclude those already listed in dynamic linking
20279 for xxx in $avail_ext; do
20280 case " $dynamic_ext " in
20282 *) dflt="$dflt $xxx" ;;
20289 *) dflt="$static_ext"
20296 rp="What extensions do you wish to load statically?"
20299 none) static_ext=' ' ;;
20300 *) static_ext="$ans" ;;
20305 A number of extensions are supplied with $package. Answer "none"
20306 to include no extensions.
20307 Note that DynaLoader is always built and need not be mentioned here.
20310 case "$static_ext" in
20311 '') dflt="$avail_ext" ;;
20312 *) dflt="$static_ext"
20313 # Perhaps we are reusing an old out-of-date config.sh.
20316 if test X"$static_ext" != X"$avail_ext"; then
20318 NOTICE: Your previous config.sh list may be incorrect.
20319 The extensions now available to you are
20321 but the default list from your previous config.sh is
20330 : Exclude those that are not xs extensions
20334 rp="What extensions do you wish to include?"
20337 none) static_ext=' ' ;;
20338 *) static_ext="$ans" ;;
20343 # Encode is a special case. If we are building Encode as a static
20344 # extension, we need to explicitly list its subextensions as well.
20345 # For other nested extensions, this is handled automatically by
20346 # the appropriate Makefile.PL.
20347 case " $static_ext " in
20348 *" Encode "*) # Add the subextensions of Encode
20350 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
20351 static_ext="$static_ext Encode/$xxx"
20357 set X $dynamic_ext $static_ext $nonxs_ext
20361 # Sanity check: We require an extension suitable for use with
20362 # AnyDBM_File, as well as Fcntl and IO. (Failure to have these
20363 # should show up as failures in the test suite, but it's helpful to
20364 # catch them now.) The 'extensions' list is normally sorted
20365 # alphabetically, so we need to accept either
20366 # DB_File ... Fcntl ... IO ....
20367 # or something like
20368 # Fcntl ... NDBM_File ... IO ....
20369 case " $extensions" in
20370 *"_File "*" Fcntl "*" IO "*) ;; # DB_File
20371 *" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
20372 *" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
20373 *) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
20374 echo "WARNING: The Perl you are building will be quite crippled." >& 4
20378 : Remove libraries needed only for extensions
20379 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
20380 : The exception is SunOS 4.x, which needs them.
20381 case "${osname}X${osvers}" in
20385 *) case "$usedl" in
20386 $define|true|[yY]*)
20387 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
20391 *) perllibs="$libs"
20397 : Remove build directory name from cppstdin so it can be used from
20398 : either the present location or the final installed location.
20400 : Get out of the UU directory to get correct path name.
20402 case "$cppstdin" in
20404 echo "Stripping down cppstdin path name"
20410 : end of configuration questions
20412 echo "End of configuration questions."
20415 : back to where it started
20416 if test -d ../UU; then
20420 : configuration may be patched via a 'config.arch' file
20421 if $test -f config.arch; then
20422 echo "I see a config.arch file, loading it."
20426 : configuration may be patched via a 'config.over' file
20427 if $test -f config.over; then
20430 rp='I see a config.over file. Do you wish to load it?'
20433 n*) echo "OK, I'll ignore it.";;
20435 echo "Configuration override changes have been loaded."
20440 : in case they want portability, strip down executable paths
20441 case "$d_portable" in
20444 echo "Stripping down executable paths..." >&4
20445 for file in $loclist $trylist; do
20447 eval $file=`basename $temp`
20452 : create config.sh file
20454 echo "Creating config.sh..." >&4
20455 $spitshell <<EOT >config.sh
20458 # This file was produced by running the Configure script. It holds all the
20459 # definitions figured out by Configure. Should you modify one of these values,
20460 # do not forget to propagate your changes by running "Configure -der". You may
20461 # instead choose to run each of the .SH files by yourself, or "Configure -S".
20464 # Package name : $package
20465 # Source directory : $src
20466 # Configuration time: $cf_time
20467 # Configured by : $cf_by
20468 # Target system : $myuname
20478 Revision='$Revision'
20486 alignbytes='$alignbytes'
20487 ansi2knr='$ansi2knr'
20488 aphostname='$aphostname'
20489 api_revision='$api_revision'
20490 api_subversion='$api_subversion'
20491 api_version='$api_version'
20492 api_versionstring='$api_versionstring'
20495 archlibexp='$archlibexp'
20496 archname64='$archname64'
20497 archname='$archname'
20498 archobjs='$archobjs'
20499 asctime_r_proto='$asctime_r_proto'
20507 byteorder='$byteorder'
20509 castflags='$castflags'
20512 cccdlflags='$cccdlflags'
20513 ccdlflags='$ccdlflags'
20515 ccflags_uselargefiles='$ccflags_uselargefiles'
20517 ccsymbols='$ccsymbols'
20518 ccversion='$ccversion'
20520 cf_email='$cf_email'
20522 charsize='$charsize'
20526 clocktype='$clocktype'
20528 compress='$compress'
20529 contains='$contains'
20533 cpp_stuff='$cpp_stuff'
20534 cppccsymbols='$cppccsymbols'
20535 cppflags='$cppflags'
20537 cppminus='$cppminus'
20539 cppstdin='$cppstdin'
20540 cppsymbols='$cppsymbols'
20541 crypt_r_proto='$crypt_r_proto'
20542 cryptlib='$cryptlib'
20544 ctermid_r_proto='$ctermid_r_proto'
20545 ctime_r_proto='$ctime_r_proto'
20546 d_Gconvert='$d_Gconvert'
20547 d_PRIEUldbl='$d_PRIEUldbl'
20548 d_PRIFUldbl='$d_PRIFUldbl'
20549 d_PRIGUldbl='$d_PRIGUldbl'
20550 d_PRIXU64='$d_PRIXU64'
20551 d_PRId64='$d_PRId64'
20552 d_PRIeldbl='$d_PRIeldbl'
20553 d_PRIfldbl='$d_PRIfldbl'
20554 d_PRIgldbl='$d_PRIgldbl'
20555 d_PRIi64='$d_PRIi64'
20556 d_PRIo64='$d_PRIo64'
20557 d_PRIu64='$d_PRIu64'
20558 d_PRIx64='$d_PRIx64'
20559 d_SCNfldbl='$d_SCNfldbl'
20560 d__fwalk='$d__fwalk'
20561 d_access='$d_access'
20562 d_accessx='$d_accessx'
20565 d_archlib='$d_archlib'
20566 d_asctime_r='$d_asctime_r'
20569 d_attribut='$d_attribut'
20573 d_bsdgetpgrp='$d_bsdgetpgrp'
20574 d_bsdsetpgrp='$d_bsdsetpgrp'
20576 d_casti32='$d_casti32'
20577 d_castneg='$d_castneg'
20578 d_charvspr='$d_charvspr'
20580 d_chroot='$d_chroot'
20581 d_chsize='$d_chsize'
20583 d_closedir='$d_closedir'
20584 d_cmsghdr_s='$d_cmsghdr_s'
20586 d_copysignl='$d_copysignl'
20588 d_crypt_r='$d_crypt_r'
20590 d_ctermid_r='$d_ctermid_r'
20591 d_ctime_r='$d_ctime_r'
20592 d_cuserid='$d_cuserid'
20593 d_dbl_dig='$d_dbl_dig'
20594 d_dbminitproto='$d_dbminitproto'
20595 d_difftime='$d_difftime'
20597 d_dirnamlen='$d_dirnamlen'
20598 d_dlerror='$d_dlerror'
20599 d_dlopen='$d_dlopen'
20600 d_dlsymun='$d_dlsymun'
20601 d_dosuid='$d_dosuid'
20602 d_drand48_r='$d_drand48_r'
20603 d_drand48proto='$d_drand48proto'
20605 d_eaccess='$d_eaccess'
20606 d_endgrent='$d_endgrent'
20607 d_endgrent_r='$d_endgrent_r'
20608 d_endhent='$d_endhent'
20609 d_endhostent_r='$d_endhostent_r'
20610 d_endnent='$d_endnent'
20611 d_endnetent_r='$d_endnetent_r'
20612 d_endpent='$d_endpent'
20613 d_endprotoent_r='$d_endprotoent_r'
20614 d_endpwent='$d_endpwent'
20615 d_endpwent_r='$d_endpwent_r'
20616 d_endsent='$d_endsent'
20617 d_endservent_r='$d_endservent_r'
20618 d_eofnblk='$d_eofnblk'
20619 d_eunice='$d_eunice'
20620 d_faststdio='$d_faststdio'
20621 d_fchdir='$d_fchdir'
20622 d_fchmod='$d_fchmod'
20623 d_fchown='$d_fchown'
20625 d_fcntl_can_lock='$d_fcntl_can_lock'
20626 d_fd_macros='$d_fd_macros'
20627 d_fd_set='$d_fd_set'
20628 d_fds_bits='$d_fds_bits'
20629 d_fgetpos='$d_fgetpos'
20630 d_finite='$d_finite'
20631 d_finitel='$d_finitel'
20632 d_flexfnam='$d_flexfnam'
20634 d_flockproto='$d_flockproto'
20636 d_fp_class='$d_fp_class'
20637 d_fpathconf='$d_fpathconf'
20638 d_fpclass='$d_fpclass'
20639 d_fpclassify='$d_fpclassify'
20640 d_fpclassl='$d_fpclassl'
20641 d_fpos64_t='$d_fpos64_t'
20642 d_frexpl='$d_frexpl'
20643 d_fs_data_s='$d_fs_data_s'
20644 d_fseeko='$d_fseeko'
20645 d_fsetpos='$d_fsetpos'
20646 d_fstatfs='$d_fstatfs'
20647 d_fstatvfs='$d_fstatvfs'
20649 d_ftello='$d_ftello'
20651 d_getcwd='$d_getcwd'
20652 d_getespwnam='$d_getespwnam'
20653 d_getfsstat='$d_getfsstat'
20654 d_getgrent='$d_getgrent'
20655 d_getgrent_r='$d_getgrent_r'
20656 d_getgrgid_r='$d_getgrgid_r'
20657 d_getgrnam_r='$d_getgrnam_r'
20658 d_getgrps='$d_getgrps'
20659 d_gethbyaddr='$d_gethbyaddr'
20660 d_gethbyname='$d_gethbyname'
20661 d_gethent='$d_gethent'
20662 d_gethname='$d_gethname'
20663 d_gethostbyaddr_r='$d_gethostbyaddr_r'
20664 d_gethostbyname_r='$d_gethostbyname_r'
20665 d_gethostent_r='$d_gethostent_r'
20666 d_gethostprotos='$d_gethostprotos'
20667 d_getitimer='$d_getitimer'
20668 d_getlogin='$d_getlogin'
20669 d_getlogin_r='$d_getlogin_r'
20670 d_getmnt='$d_getmnt'
20671 d_getmntent='$d_getmntent'
20672 d_getnbyaddr='$d_getnbyaddr'
20673 d_getnbyname='$d_getnbyname'
20674 d_getnent='$d_getnent'
20675 d_getnetbyaddr_r='$d_getnetbyaddr_r'
20676 d_getnetbyname_r='$d_getnetbyname_r'
20677 d_getnetent_r='$d_getnetent_r'
20678 d_getnetprotos='$d_getnetprotos'
20679 d_getpagsz='$d_getpagsz'
20680 d_getpbyname='$d_getpbyname'
20681 d_getpbynumber='$d_getpbynumber'
20682 d_getpent='$d_getpent'
20683 d_getpgid='$d_getpgid'
20684 d_getpgrp2='$d_getpgrp2'
20685 d_getpgrp='$d_getpgrp'
20686 d_getppid='$d_getppid'
20687 d_getprior='$d_getprior'
20688 d_getprotobyname_r='$d_getprotobyname_r'
20689 d_getprotobynumber_r='$d_getprotobynumber_r'
20690 d_getprotoent_r='$d_getprotoent_r'
20691 d_getprotoprotos='$d_getprotoprotos'
20692 d_getprpwnam='$d_getprpwnam'
20693 d_getpwent='$d_getpwent'
20694 d_getpwent_r='$d_getpwent_r'
20695 d_getpwnam_r='$d_getpwnam_r'
20696 d_getpwuid_r='$d_getpwuid_r'
20697 d_getsbyname='$d_getsbyname'
20698 d_getsbyport='$d_getsbyport'
20699 d_getsent='$d_getsent'
20700 d_getservbyname_r='$d_getservbyname_r'
20701 d_getservbyport_r='$d_getservbyport_r'
20702 d_getservent_r='$d_getservent_r'
20703 d_getservprotos='$d_getservprotos'
20704 d_getspnam='$d_getspnam'
20705 d_getspnam_r='$d_getspnam_r'
20706 d_gettimeod='$d_gettimeod'
20707 d_gmtime_r='$d_gmtime_r'
20708 d_gnulibc='$d_gnulibc'
20709 d_grpasswd='$d_grpasswd'
20710 d_hasmntopt='$d_hasmntopt'
20712 d_ilogbl='$d_ilogbl'
20714 d_inetaton='$d_inetaton'
20715 d_int64_t='$d_int64_t'
20716 d_isascii='$d_isascii'
20717 d_isfinite='$d_isfinite'
20720 d_isnanl='$d_isnanl'
20721 d_killpg='$d_killpg'
20722 d_lchown='$d_lchown'
20723 d_ldbl_dig='$d_ldbl_dig'
20725 d_localtime_r='$d_localtime_r'
20726 d_locconv='$d_locconv'
20728 d_longdbl='$d_longdbl'
20729 d_longlong='$d_longlong'
20730 d_lseekproto='$d_lseekproto'
20732 d_madvise='$d_madvise'
20734 d_mbstowcs='$d_mbstowcs'
20735 d_mbtowc='$d_mbtowc'
20736 d_memchr='$d_memchr'
20737 d_memcmp='$d_memcmp'
20738 d_memcpy='$d_memcpy'
20739 d_memmove='$d_memmove'
20740 d_memset='$d_memset'
20742 d_mkdtemp='$d_mkdtemp'
20743 d_mkfifo='$d_mkfifo'
20744 d_mkstemp='$d_mkstemp'
20745 d_mkstemps='$d_mkstemps'
20746 d_mktime='$d_mktime'
20749 d_modfl_pow32_bug='$d_modfl_pow32_bug'
20750 d_modflproto='$d_modflproto'
20751 d_mprotect='$d_mprotect'
20753 d_msg_ctrunc='$d_msg_ctrunc'
20754 d_msg_dontroute='$d_msg_dontroute'
20755 d_msg_oob='$d_msg_oob'
20756 d_msg_peek='$d_msg_peek'
20757 d_msg_proxy='$d_msg_proxy'
20758 d_msgctl='$d_msgctl'
20759 d_msgget='$d_msgget'
20760 d_msghdr_s='$d_msghdr_s'
20761 d_msgrcv='$d_msgrcv'
20762 d_msgsnd='$d_msgsnd'
20764 d_munmap='$d_munmap'
20765 d_mymalloc='$d_mymalloc'
20767 d_nl_langinfo='$d_nl_langinfo'
20768 d_nv_preserves_uv='$d_nv_preserves_uv'
20769 d_off64_t='$d_off64_t'
20770 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
20771 d_oldpthreads='$d_oldpthreads'
20772 d_oldsock='$d_oldsock'
20774 d_pathconf='$d_pathconf'
20776 d_perl_otherlibdirs='$d_perl_otherlibdirs'
20777 d_phostname='$d_phostname'
20780 d_portable='$d_portable'
20781 d_procselfexe='$d_procselfexe'
20782 d_pthread_atfork='$d_pthread_atfork'
20783 d_pthread_attr_setscope='$d_pthread_attr_setscope'
20784 d_pthread_yield='$d_pthread_yield'
20786 d_pwchange='$d_pwchange'
20787 d_pwclass='$d_pwclass'
20788 d_pwcomment='$d_pwcomment'
20789 d_pwexpire='$d_pwexpire'
20790 d_pwgecos='$d_pwgecos'
20791 d_pwpasswd='$d_pwpasswd'
20792 d_pwquota='$d_pwquota'
20795 d_random_r='$d_random_r'
20796 d_readdir64_r='$d_readdir64_r'
20797 d_readdir='$d_readdir'
20798 d_readdir_r='$d_readdir_r'
20799 d_readlink='$d_readlink'
20801 d_recvmsg='$d_recvmsg'
20802 d_rename='$d_rename'
20803 d_rewinddir='$d_rewinddir'
20805 d_safebcpy='$d_safebcpy'
20806 d_safemcpy='$d_safemcpy'
20807 d_sanemcmp='$d_sanemcmp'
20808 d_sbrkproto='$d_sbrkproto'
20809 d_scalbnl='$d_scalbnl'
20810 d_sched_yield='$d_sched_yield'
20811 d_scm_rights='$d_scm_rights'
20812 d_seekdir='$d_seekdir'
20813 d_select='$d_select'
20815 d_semctl='$d_semctl'
20816 d_semctl_semid_ds='$d_semctl_semid_ds'
20817 d_semctl_semun='$d_semctl_semun'
20818 d_semget='$d_semget'
20820 d_sendmsg='$d_sendmsg'
20821 d_setegid='$d_setegid'
20822 d_seteuid='$d_seteuid'
20823 d_setgrent='$d_setgrent'
20824 d_setgrent_r='$d_setgrent_r'
20825 d_setgrps='$d_setgrps'
20826 d_sethent='$d_sethent'
20827 d_sethostent_r='$d_sethostent_r'
20828 d_setitimer='$d_setitimer'
20829 d_setlinebuf='$d_setlinebuf'
20830 d_setlocale='$d_setlocale'
20831 d_setlocale_r='$d_setlocale_r'
20832 d_setnent='$d_setnent'
20833 d_setnetent_r='$d_setnetent_r'
20834 d_setpent='$d_setpent'
20835 d_setpgid='$d_setpgid'
20836 d_setpgrp2='$d_setpgrp2'
20837 d_setpgrp='$d_setpgrp'
20838 d_setprior='$d_setprior'
20839 d_setproctitle='$d_setproctitle'
20840 d_setprotoent_r='$d_setprotoent_r'
20841 d_setpwent='$d_setpwent'
20842 d_setpwent_r='$d_setpwent_r'
20843 d_setregid='$d_setregid'
20844 d_setresgid='$d_setresgid'
20845 d_setresuid='$d_setresuid'
20846 d_setreuid='$d_setreuid'
20847 d_setrgid='$d_setrgid'
20848 d_setruid='$d_setruid'
20849 d_setsent='$d_setsent'
20850 d_setservent_r='$d_setservent_r'
20851 d_setsid='$d_setsid'
20852 d_setvbuf='$d_setvbuf'
20856 d_shmatprototype='$d_shmatprototype'
20857 d_shmctl='$d_shmctl'
20859 d_shmget='$d_shmget'
20860 d_sigaction='$d_sigaction'
20861 d_sigprocmask='$d_sigprocmask'
20862 d_sigsetjmp='$d_sigsetjmp'
20863 d_sockatmark='$d_sockatmark'
20864 d_sockatmarkproto='$d_sockatmarkproto'
20865 d_socket='$d_socket'
20866 d_socklen_t='$d_socklen_t'
20867 d_sockpair='$d_sockpair'
20868 d_socks5_init='$d_socks5_init'
20870 d_srand48_r='$d_srand48_r'
20871 d_srandom_r='$d_srandom_r'
20872 d_sresgproto='$d_sresgproto'
20873 d_sresuproto='$d_sresuproto'
20874 d_statblks='$d_statblks'
20875 d_statfs_f_flags='$d_statfs_f_flags'
20876 d_statfs_s='$d_statfs_s'
20877 d_statvfs='$d_statvfs'
20878 d_stdio_cnt_lval='$d_stdio_cnt_lval'
20879 d_stdio_ptr_lval='$d_stdio_ptr_lval'
20880 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
20881 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
20882 d_stdio_stream_array='$d_stdio_stream_array'
20883 d_stdiobase='$d_stdiobase'
20884 d_stdstdio='$d_stdstdio'
20885 d_strchr='$d_strchr'
20886 d_strcoll='$d_strcoll'
20887 d_strctcpy='$d_strctcpy'
20888 d_strerrm='$d_strerrm'
20889 d_strerror='$d_strerror'
20890 d_strerror_r='$d_strerror_r'
20891 d_strftime='$d_strftime'
20892 d_strlcat='$d_strlcat'
20893 d_strlcpy='$d_strlcpy'
20894 d_strtod='$d_strtod'
20895 d_strtol='$d_strtol'
20896 d_strtold='$d_strtold'
20897 d_strtoll='$d_strtoll'
20898 d_strtoq='$d_strtoq'
20899 d_strtoul='$d_strtoul'
20900 d_strtoull='$d_strtoull'
20901 d_strtouq='$d_strtouq'
20902 d_strxfrm='$d_strxfrm'
20903 d_suidsafe='$d_suidsafe'
20904 d_symlink='$d_symlink'
20905 d_syscall='$d_syscall'
20906 d_syscallproto='$d_syscallproto'
20907 d_sysconf='$d_sysconf'
20908 d_sysernlst='$d_sysernlst'
20909 d_syserrlst='$d_syserrlst'
20910 d_system='$d_system'
20911 d_tcgetpgrp='$d_tcgetpgrp'
20912 d_tcsetpgrp='$d_tcsetpgrp'
20913 d_telldir='$d_telldir'
20914 d_telldirproto='$d_telldirproto'
20917 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
20918 d_tm_tm_zone='$d_tm_tm_zone'
20919 d_tmpnam_r='$d_tmpnam_r'
20920 d_truncate='$d_truncate'
20921 d_ttyname_r='$d_ttyname_r'
20922 d_tzname='$d_tzname'
20923 d_u32align='$d_u32align'
20924 d_ualarm='$d_ualarm'
20927 d_union_semun='$d_union_semun'
20928 d_unordered='$d_unordered'
20929 d_usleep='$d_usleep'
20930 d_usleepproto='$d_usleepproto'
20932 d_vendorarch='$d_vendorarch'
20933 d_vendorbin='$d_vendorbin'
20934 d_vendorlib='$d_vendorlib'
20935 d_vendorscript='$d_vendorscript'
20937 d_void_closedir='$d_void_closedir'
20938 d_voidsig='$d_voidsig'
20939 d_voidtty='$d_voidtty'
20940 d_volatile='$d_volatile'
20941 d_vprintf='$d_vprintf'
20943 d_waitpid='$d_waitpid'
20944 d_wcstombs='$d_wcstombs'
20945 d_wctomb='$d_wctomb'
20946 d_writev='$d_writev'
20949 db_hashtype='$db_hashtype'
20950 db_prefixtype='$db_prefixtype'
20951 db_version_major='$db_version_major'
20952 db_version_minor='$db_version_minor'
20953 db_version_patch='$db_version_patch'
20954 defvoidused='$defvoidused'
20955 direntrytype='$direntrytype'
20958 doublesize='$doublesize'
20960 drand48_r_proto='$drand48_r_proto'
20961 dynamic_ext='$dynamic_ext'
20967 endgrent_r_proto='$endgrent_r_proto'
20968 endhostent_r_proto='$endhostent_r_proto'
20969 endnetent_r_proto='$endnetent_r_proto'
20970 endprotoent_r_proto='$endprotoent_r_proto'
20971 endpwent_r_proto='$endpwent_r_proto'
20972 endservent_r_proto='$endservent_r_proto'
20973 eunicefix='$eunicefix'
20976 extensions='$extensions'
20978 fflushNULL='$fflushNULL'
20979 fflushall='$fflushall'
20981 firstmakefile='$firstmakefile'
20983 fpossize='$fpossize'
20984 fpostype='$fpostype'
20985 freetype='$freetype'
20988 full_csh='$full_csh'
20989 full_sed='$full_sed'
20990 gccansipedantic='$gccansipedantic'
20991 gccosandvers='$gccosandvers'
20992 gccversion='$gccversion'
20993 getgrent_r_proto='$getgrent_r_proto'
20994 getgrgid_r_proto='$getgrgid_r_proto'
20995 getgrnam_r_proto='$getgrnam_r_proto'
20996 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
20997 gethostbyname_r_proto='$gethostbyname_r_proto'
20998 gethostent_r_proto='$gethostent_r_proto'
20999 getlogin_r_proto='$getlogin_r_proto'
21000 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
21001 getnetbyname_r_proto='$getnetbyname_r_proto'
21002 getnetent_r_proto='$getnetent_r_proto'
21003 getprotobyname_r_proto='$getprotobyname_r_proto'
21004 getprotobynumber_r_proto='$getprotobynumber_r_proto'
21005 getprotoent_r_proto='$getprotoent_r_proto'
21006 getpwent_r_proto='$getpwent_r_proto'
21007 getpwnam_r_proto='$getpwnam_r_proto'
21008 getpwuid_r_proto='$getpwuid_r_proto'
21009 getservbyname_r_proto='$getservbyname_r_proto'
21010 getservbyport_r_proto='$getservbyport_r_proto'
21011 getservent_r_proto='$getservent_r_proto'
21012 getspnam_r_proto='$getspnam_r_proto'
21013 gidformat='$gidformat'
21019 gmtime_r_proto='$gmtime_r_proto'
21020 gnulibc_version='$gnulibc_version'
21022 groupcat='$groupcat'
21023 groupstype='$groupstype'
21026 h_sysfile='$h_sysfile'
21029 html1dir='$html1dir'
21030 html1direxp='$html1direxp'
21031 html3dir='$html3dir'
21032 html3direxp='$html3direxp'
21041 i_arpainet='$i_arpainet'
21042 i_bsdioctl='$i_bsdioctl'
21046 i_dirent='$i_dirent'
21052 i_fp_class='$i_fp_class'
21055 i_ieeefp='$i_ieeefp'
21056 i_inttypes='$i_inttypes'
21057 i_langinfo='$i_langinfo'
21058 i_libutil='$i_libutil'
21059 i_limits='$i_limits'
21060 i_locale='$i_locale'
21061 i_machcthr='$i_machcthr'
21062 i_malloc='$i_malloc'
21064 i_memory='$i_memory'
21065 i_mntent='$i_mntent'
21068 i_neterrno='$i_neterrno'
21069 i_netinettcp='$i_netinettcp'
21073 i_pthread='$i_pthread'
21075 i_rpcsvcdbm='$i_rpcsvcdbm'
21078 i_shadow='$i_shadow'
21080 i_stdarg='$i_stdarg'
21081 i_stddef='$i_stddef'
21082 i_stdlib='$i_stdlib'
21083 i_string='$i_string'
21084 i_sunmath='$i_sunmath'
21085 i_sysaccess='$i_sysaccess'
21086 i_sysdir='$i_sysdir'
21087 i_sysfile='$i_sysfile'
21088 i_sysfilio='$i_sysfilio'
21090 i_sysioctl='$i_sysioctl'
21091 i_syslog='$i_syslog'
21092 i_sysmman='$i_sysmman'
21093 i_sysmode='$i_sysmode'
21094 i_sysmount='$i_sysmount'
21095 i_sysndir='$i_sysndir'
21096 i_sysparam='$i_sysparam'
21097 i_sysresrc='$i_sysresrc'
21098 i_syssecrt='$i_syssecrt'
21099 i_sysselct='$i_sysselct'
21100 i_syssockio='$i_syssockio'
21101 i_sysstat='$i_sysstat'
21102 i_sysstatfs='$i_sysstatfs'
21103 i_sysstatvfs='$i_sysstatvfs'
21104 i_systime='$i_systime'
21105 i_systimek='$i_systimek'
21106 i_systimes='$i_systimes'
21107 i_systypes='$i_systypes'
21108 i_sysuio='$i_sysuio'
21110 i_sysutsname='$i_sysutsname'
21111 i_sysvfs='$i_sysvfs'
21112 i_syswait='$i_syswait'
21113 i_termio='$i_termio'
21114 i_termios='$i_termios'
21116 i_unistd='$i_unistd'
21119 i_values='$i_values'
21120 i_varargs='$i_varargs'
21121 i_varhdr='$i_varhdr'
21123 ignore_versioned_solibs='$ignore_versioned_solibs'
21124 inc_version_list='$inc_version_list'
21125 inc_version_list_init='$inc_version_list_init'
21128 installarchlib='$installarchlib'
21129 installbin='$installbin'
21130 installhtml1dir='$installhtml1dir'
21131 installhtml3dir='$installhtml3dir'
21132 installman1dir='$installman1dir'
21133 installman3dir='$installman3dir'
21134 installprefix='$installprefix'
21135 installprefixexp='$installprefixexp'
21136 installprivlib='$installprivlib'
21137 installscript='$installscript'
21138 installsitearch='$installsitearch'
21139 installsitebin='$installsitebin'
21140 installsitehtml1dir='$installsitehtml1dir'
21141 installsitehtml3dir='$installsitehtml3dir'
21142 installsitelib='$installsitelib'
21143 installsiteman1dir='$installsiteman1dir'
21144 installsiteman3dir='$installsiteman3dir'
21145 installsitescript='$installsitescript'
21146 installstyle='$installstyle'
21147 installusrbinperl='$installusrbinperl'
21148 installvendorarch='$installvendorarch'
21149 installvendorbin='$installvendorbin'
21150 installvendorhtml1dir='$installvendorhtml1dir'
21151 installvendorhtml3dir='$installvendorhtml3dir'
21152 installvendorlib='$installvendorlib'
21153 installvendorman1dir='$installvendorman1dir'
21154 installvendorman3dir='$installvendorman3dir'
21155 installvendorscript='$installvendorscript'
21157 issymlink='$issymlink'
21158 ivdformat='$ivdformat'
21161 known_extensions='$known_extensions'
21164 lddlflags='$lddlflags'
21166 ldflags_uselargefiles='$ldflags_uselargefiles'
21167 ldlibpthname='$ldlibpthname'
21174 libsdirs='$libsdirs'
21175 libsfiles='$libsfiles'
21176 libsfound='$libsfound'
21177 libspath='$libspath'
21178 libswanted='$libswanted'
21179 libswanted_uselargefiles='$libswanted_uselargefiles'
21185 localtime_r_proto='$localtime_r_proto'
21186 locincpth='$locincpth'
21187 loclibpth='$loclibpth'
21188 longdblsize='$longdblsize'
21189 longlongsize='$longlongsize'
21190 longsize='$longsize'
21194 lseeksize='$lseeksize'
21195 lseektype='$lseektype'
21199 make_set_make='$make_set_make'
21200 mallocobj='$mallocobj'
21201 mallocsrc='$mallocsrc'
21202 malloctype='$malloctype'
21204 man1direxp='$man1direxp'
21207 man3direxp='$man3direxp'
21209 mips_type='$mips_type'
21210 mistrustnm='$mistrustnm'
21212 mmaptype='$mmaptype'
21213 modetype='$modetype'
21215 multiarch='$multiarch'
21217 myarchname='$myarchname'
21218 mydomain='$mydomain'
21219 myhostname='$myhostname'
21222 need_va_copy='$need_va_copy'
21223 netdb_hlen_type='$netdb_hlen_type'
21224 netdb_host_type='$netdb_host_type'
21225 netdb_name_type='$netdb_name_type'
21226 netdb_net_type='$netdb_net_type'
21229 nm_so_opt='$nm_so_opt'
21230 nonxs_ext='$nonxs_ext'
21232 nvEUformat='$nvEUformat'
21233 nvFUformat='$nvFUformat'
21234 nvGUformat='$nvGUformat'
21235 nv_preserves_uv_bits='$nv_preserves_uv_bits'
21236 nveformat='$nveformat'
21237 nvfformat='$nvfformat'
21238 nvgformat='$nvgformat'
21241 o_nonblock='$o_nonblock'
21243 old_pthread_create_joinable='$old_pthread_create_joinable'
21244 optimize='$optimize'
21245 orderlib='$orderlib'
21248 otherlibdirs='$otherlibdirs'
21252 patchlevel='$patchlevel'
21253 path_sep='$path_sep'
21256 perl_patchlevel='$perl_patchlevel'
21257 perladmin='$perladmin'
21258 perllibs='$perllibs'
21259 perlpath='$perlpath'
21261 phostname='$phostname'
21267 prefixexp='$prefixexp'
21269 privlibexp='$privlibexp'
21270 procselfexe='$procselfexe'
21271 prototype='$prototype'
21273 quadkind='$quadkind'
21274 quadtype='$quadtype'
21275 randbits='$randbits'
21276 randfunc='$randfunc'
21277 random_r_proto='$random_r_proto'
21278 randseedtype='$randseedtype'
21280 rd_nodata='$rd_nodata'
21281 readdir64_r_proto='$readdir64_r_proto'
21282 readdir_r_proto='$readdir_r_proto'
21283 revision='$revision'
21288 sPRIEUldbl='$sPRIEUldbl'
21289 sPRIFUldbl='$sPRIFUldbl'
21290 sPRIGUldbl='$sPRIGUldbl'
21291 sPRIXU64='$sPRIXU64'
21293 sPRIeldbl='$sPRIeldbl'
21294 sPRIfldbl='$sPRIfldbl'
21295 sPRIgldbl='$sPRIgldbl'
21300 sSCNfldbl='$sSCNfldbl'
21301 sched_yield='$sched_yield'
21302 scriptdir='$scriptdir'
21303 scriptdirexp='$scriptdirexp'
21305 seedfunc='$seedfunc'
21306 selectminbits='$selectminbits'
21307 selecttype='$selecttype'
21308 sendmail='$sendmail'
21309 setgrent_r_proto='$setgrent_r_proto'
21310 sethostent_r_proto='$sethostent_r_proto'
21311 setlocale_r_proto='$setlocale_r_proto'
21312 setnetent_r_proto='$setnetent_r_proto'
21313 setprotoent_r_proto='$setprotoent_r_proto'
21314 setpwent_r_proto='$setpwent_r_proto'
21315 setservent_r_proto='$setservent_r_proto'
21318 sharpbang='$sharpbang'
21319 shmattype='$shmattype'
21320 shortsize='$shortsize'
21323 sig_count='$sig_count'
21324 sig_name='$sig_name'
21325 sig_name_init='$sig_name_init'
21327 sig_num_init='$sig_num_init'
21328 sig_size='$sig_size'
21329 signal_t='$signal_t'
21330 sitearch='$sitearch'
21331 sitearchexp='$sitearchexp'
21333 sitebinexp='$sitebinexp'
21334 sitehtml1dir='$sitehtml1dir'
21335 sitehtml1direxp='$sitehtml1direxp'
21336 sitehtml3dir='$sitehtml3dir'
21337 sitehtml3direxp='$sitehtml3direxp'
21339 sitelib_stem='$sitelib_stem'
21340 sitelibexp='$sitelibexp'
21341 siteman1dir='$siteman1dir'
21342 siteman1direxp='$siteman1direxp'
21343 siteman3dir='$siteman3dir'
21344 siteman3direxp='$siteman3direxp'
21345 siteprefix='$siteprefix'
21346 siteprefixexp='$siteprefixexp'
21347 sitescript='$sitescript'
21348 sitescriptexp='$sitescriptexp'
21349 sizesize='$sizesize'
21350 sizetype='$sizetype'
21354 sockethdr='$sockethdr'
21355 socketlib='$socketlib'
21356 socksizetype='$socksizetype'
21358 spackage='$spackage'
21359 spitshell='$spitshell'
21360 srand48_r_proto='$srand48_r_proto'
21361 srandom_r_proto='$srandom_r_proto'
21363 ssizetype='$ssizetype'
21364 startperl='$startperl'
21366 static_ext='$static_ext'
21368 stdio_base='$stdio_base'
21369 stdio_bufsiz='$stdio_bufsiz'
21370 stdio_cnt='$stdio_cnt'
21371 stdio_filbuf='$stdio_filbuf'
21372 stdio_ptr='$stdio_ptr'
21373 stdio_stream_array='$stdio_stream_array'
21374 strerror_r_proto='$strerror_r_proto'
21377 subversion='$subversion'
21381 targetarch='$targetarch'
21385 timeincl='$timeincl'
21386 timetype='$timetype'
21387 tmpnam_r_proto='$tmpnam_r_proto'
21393 ttyname_r_proto='$ttyname_r_proto'
21402 uidformat='$uidformat'
21408 uquadtype='$uquadtype'
21409 use5005threads='$use5005threads'
21410 use64bitall='$use64bitall'
21411 use64bitint='$use64bitint'
21412 usecrosscompile='$usecrosscompile'
21414 usefaststdio='$usefaststdio'
21415 useithreads='$useithreads'
21416 uselargefiles='$uselargefiles'
21417 uselongdouble='$uselongdouble'
21418 usemallocwrap='$usemallocwrap'
21419 usemorebits='$usemorebits'
21420 usemultiplicity='$usemultiplicity'
21421 usemymalloc='$usemymalloc'
21423 useopcode='$useopcode'
21424 useperlio='$useperlio'
21425 useposix='$useposix'
21426 usereentrant='$usereentrant'
21428 useshrplib='$useshrplib'
21429 usesocks='$usesocks'
21430 usethreads='$usethreads'
21431 usevendorprefix='$usevendorprefix'
21432 usevfork='$usevfork'
21435 uvXUformat='$uvXUformat'
21436 uvoformat='$uvoformat'
21439 uvuformat='$uvuformat'
21440 uvxformat='$uvxformat'
21441 vendorarch='$vendorarch'
21442 vendorarchexp='$vendorarchexp'
21443 vendorbin='$vendorbin'
21444 vendorbinexp='$vendorbinexp'
21445 vendorhtml1dir='$vendorhtml1dir'
21446 vendorhtml1direxp='$vendorhtml1direxp'
21447 vendorhtml3dir='$vendorhtml3dir'
21448 vendorhtml3direxp='$vendorhtml3direxp'
21449 vendorlib='$vendorlib'
21450 vendorlib_stem='$vendorlib_stem'
21451 vendorlibexp='$vendorlibexp'
21452 vendorman1dir='$vendorman1dir'
21453 vendorman1direxp='$vendorman1direxp'
21454 vendorman3dir='$vendorman3dir'
21455 vendorman3direxp='$vendorman3direxp'
21456 vendorprefix='$vendorprefix'
21457 vendorprefixexp='$vendorprefixexp'
21458 vendorscript='$vendorscript'
21459 vendorscriptexp='$vendorscriptexp'
21461 version_patchlevel_string='$version_patchlevel_string'
21462 versiononly='$versiononly'
21464 voidflags='$voidflags'
21467 yaccflags='$yaccflags'
21472 : Add in command line options if available
21473 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
21475 : add special variables
21476 $test -f $src/patchlevel.h && \
21477 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
21478 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
21479 echo "PERL_CONFIG_SH=true" >>config.sh
21481 : propagate old symbols
21482 if $test -f UU/config.sh; then
21483 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
21484 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
21485 $sort | $uniq -u >UU/oldsyms
21486 set X `cat UU/oldsyms`
21492 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
21494 echo "# Variables propagated from previous config.sh file." >>config.sh
21495 for sym in `cat UU/oldsyms`; do
21496 echo " Propagating $hint variable "'$'"$sym..."
21497 eval 'tmp="$'"${sym}"'"'
21499 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
21505 : Finish up by extracting the .SH files
21509 echo "Extraction done."
21519 If you'd like to make any changes to the config.sh file before I begin
21520 to configure things, do it as a shell escape now (e.g. !vi config.sh).
21523 rp="Press return or use a shell escape to edit config.sh:"
21528 *) : in case they cannot read
21529 sh 1>&4 -c "$ans";;
21534 : if this fails, just run all the .SH files by hand
21543 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
21550 Now you need to generate make dependencies by running "$make depend".
21551 You might prefer to run it in background: "$make depend > makedepend.out &"
21552 It can take a while, so you might not want to run it right now.
21557 rp="Run $make depend now?"
21561 $make depend && echo "Now you must run '$make'."
21564 echo "You must run '$make depend' then '$make'."
21567 elif test -f [Mm]akefile; then
21569 echo "Now you must run a $make."
21571 echo "Configure done."
21574 if $test -f Policy.sh; then
21577 If you compile $package on a different machine or from a different object
21578 directory, copy the Policy.sh file from this object directory to the
21579 new one before you run Configure -- this will help you with most of
21580 the policy defaults.
21584 if $test -f config.msg; then
21585 echo "Hmm. I also noted the following information while running:"
21587 $cat config.msg >&4
21590 $rm -f kit*isdone ark*isdone