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 May 25 22:51:20 EET DST 2002 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat c2$$
47 (exit $?0) || exec sh $0 $argv:q
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
68 case "X${MACHTYPE:-nonesuchmach}" in
76 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
77 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
78 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
79 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
80 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
81 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
82 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
83 paths="$paths /sbin /usr/sbin /usr/libexec"
84 paths="$paths /system/gnu_library/bin"
90 *) test -d $p && PATH=$PATH$p_$p ;;
97 : shall we be using ksh?
103 if (PATH=.; alias -x) >/dev/null 2>&1; then
106 if test -f /hp-ux -a -f /bin/ksh; then
107 needksh='to avoid sh bug in "here document" expansion'
109 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
110 if test X`/usr/bin/uname -v` = X4; then
111 avoidksh="to avoid AIX 4's /bin/sh"
115 if test -f /osf_boot -a -f /usr/sbin/setld; then
116 if test X`/usr/bin/uname -s` = XOSF1; then
117 avoidksh="to avoid Digital UNIX' ksh"
119 unset BIN_SH # if this is 'xpg4' sh will start up ksh
122 case "$inksh/$needksh" in
129 case "$inksh/$avoidksh" in
135 case "$inksh/$needksh-$avoidksh-" in
138 (I see you are using the Korn shell. Some ksh's blow up on $me,
139 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
146 echo "(Feeding myself to $newsh $reason.)"
148 Configure|*/Configure) exec $newsh $0 "$@";;
149 *) exec $newsh Configure "$@";;
154 : if needed set CDPATH to a harmless value that is not chatty
155 : avoid bash 2.02 problems with empty CDPATH.
159 *bash*) CDPATH='.' ;;
164 : Configure runs within the UU subdirectory
165 test -d UU || mkdir UU
373 endhostent_r_proto=''
379 endprotoent_r_proto=''
385 endservent_r_proto=''
435 gethostbyaddr_r_proto=''
437 gethostbyname_r_proto=''
439 gethostent_r_proto=''
451 getnetbyaddr_r_proto=''
453 getnetbyname_r_proto=''
467 d_getprotobyname_r=''
468 getprotobyname_r_proto=''
469 d_getprotobynumber_r=''
470 getprotobynumber_r_proto=''
472 getprotoent_r_proto=''
484 getservbyname_r_proto=''
486 getservbyport_r_proto=''
488 getservent_r_proto=''
561 d_old_pthread_create_joinable=''
562 old_pthread_create_joinable=''
601 sethostent_r_proto=''
618 setprotoent_r_proto=''
630 setservent_r_proto=''
674 d_stdio_ptr_lval_nochange_cnt=''
675 d_stdio_ptr_lval_sets_cnt=''
869 inc_version_list_init=''
888 ignore_versioned_solibs=''
947 d_perl_otherlibdirs=''
961 version_patchlevel_string=''
976 nv_preserves_uv_bits=''
1065 d_stdio_stream_array=''
1066 stdio_stream_array=''
1076 ccflags_uselargefiles=''
1077 ldflags_uselargefiles=''
1078 libswanted_uselargefiles=''
1098 installvendorarch=''
1124 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1127 : We must find out about Eunice early
1129 if test -f /etc/unixtovms; then
1130 eunicefix=/etc/unixtovms
1132 if test -f /etc/unixtovms.exe; then
1133 eunicefix=/etc/unixtovms.exe
1136 : Set executable suffix now -- needed before hints available
1137 if test -f "/libs/version.library"; then
1140 elif test -f "/system/gnu_library/bin/ar.pm"; then
1143 elif test -n "$DJGPP"; then
1146 elif test -d c:/. ; then
1155 : set useposix=false in your hint file to disable the POSIX extension.
1157 : set useopcode=false in your hint file to disable the Opcode extension.
1159 : Trailing extension. Override this in a hint file, if needed.
1160 : Extra object files, if any, needed on this platform.
1163 : Possible local include directories to search.
1164 : Set locincpth to "" in a hint file to defeat local include searches.
1165 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1166 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1168 : no include file wanted by default
1173 : change the next line if compiling for Xenix/286 on Xenix/386
1174 xlibpth='/usr/lib/386 /lib/386'
1175 : Possible local library directories to search.
1176 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1177 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1179 : general looking path for locating libraries
1180 glibpth="/lib /usr/lib $xlibpth"
1181 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1182 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1183 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1185 : Private path used by Configure to find libraries. Its value
1186 : is prepended to libpth. This variable takes care of special
1187 : machines, like the mips. Usually, it should be empty.
1190 : default library list
1192 : some systems want to use only the non-versioned libso:s
1193 ignore_versioned_solibs=''
1195 ccflags_uselargefiles=''
1196 ldflags_uselargefiles=''
1197 libswanted_uselargefiles=''
1198 : set usemultiplicity on the Configure command line to enable multiplicity.
1199 : set usesocks on the Configure command line to enable socks.
1200 : set usethreads on the Configure command line to enable threads.
1201 usereentrant='undef'
1202 : full support for void wanted by default
1205 : List of libraries we want.
1206 : If anyone needs -lnet, put it in a hint file.
1207 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1208 libswanted="$libswanted dld ld sun m c cposix posix"
1209 libswanted="$libswanted ndir dir crypt sec"
1210 libswanted="$libswanted ucb bsd BSD PW x util"
1211 : We probably want to search /usr/shlib before most other libraries.
1212 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1213 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1214 glibpth="/usr/shlib $glibpth"
1215 : Do not use vfork unless overridden by a hint file.
1218 : Find the basic shell for Bourne shell scripts
1222 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1225 if test -f "$xxx"; then
1228 : Build up a list and do a single loop so we can 'break' out.
1229 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1230 for xxx in sh bash ksh pdksh ash; do
1232 try="$try ${p}/${xxx}"
1236 if test -f "$xxx"; then
1239 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1242 elif test -f "$xxx.exe"; then
1253 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1255 Usually it's in /bin/sh. How did you even get this far?
1256 Please contact me (Perl Maintainers) at perlbug@perl.org and
1257 we'll try to straighten this all out.
1263 : see if sh knows # comments
1264 if `$sh -c '#' >/dev/null 2>&1`; then
1268 test -f $xcat$_exe || xcat=/usr/bin/cat
1269 if test ! -f $xcat$_exe; then
1270 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1271 if test -f $p/cat$_exe; then
1276 if test ! -f $xcat$_exe; then
1277 echo "Can't find cat anywhere!"
1281 echo "#!$xcat" >sharp
1285 if test -s today; then
1288 echo "#! $xcat" > sharp
1292 if test -s today; then
1300 echo "Your $sh doesn't grok # comments--I will strip them later on."
1303 echo "exec grep -v '^[ ]*#'" >spitshell
1305 $eunicefix spitshell
1306 spitshell=`pwd`/spitshell
1308 echo "I presume that if # doesn't work, #! won't work either!"
1313 : figure out how to guarantee sh startup
1315 '') startsh=${sharpbang}${sh} ;;
1327 : echo "Yup, it does."
1329 echo "Hmm... '$startsh' does not guarantee sh startup..."
1330 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1335 : Save command line options in file UU/cmdline.opt for later use in
1336 : generating config.sh.
1337 cat > cmdline.opt <<EOSH
1338 # Configure command line arguments.
1347 cat >>cmdline.opt <<EOSH
1348 config_arg$argn='$arg'
1350 # Extreme backslashitis: replace each ' by '"'"'
1351 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1354 arg_exp=`cat cmdl.opt`
1355 args_exp="$args_exp$args_sep'$arg_exp'"
1356 argn=`expr $argn + 1`
1359 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1360 # used by ./hints/os2.sh
1363 : produce awk script to parse command line options
1364 cat >options.awk <<'EOF'
1366 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1368 len = length(optstr);
1369 for (i = 1; i <= len; i++) {
1370 c = substr(optstr, i, 1);
1371 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1382 if (substr(str, 1, 1) != "-") {
1383 printf("'%s'\n", str);
1387 for (i = 2; i <= len; i++) {
1388 c = substr(str, i, 1);
1390 printf("-%s\n", substr(str, i));
1396 printf("'%s'\n", substr(str, i + 1));
1409 : process the command line options
1410 set X `for arg in "$@"; do echo "X$arg"; done |
1411 sed -e s/X// | awk -f options.awk`
1416 : set up default values
1426 rm -f optdef.sh posthint.sh
1427 cat >optdef.sh <<EOS
1433 while test $# -gt 0; do
1435 -d) shift; fastread=yes;;
1436 -e) shift; alldone=cont;;
1440 if test -r "$1"; then
1443 echo "$me: cannot read config file $1." >&2
1448 -h) shift; error=true;;
1449 -r) shift; reuseval=true;;
1450 -s) shift; silent=true; realsilent=true;;
1451 -E) shift; alldone=exit;;
1452 -K) shift; knowitall=true;;
1453 -O) shift; override=true;;
1454 -S) shift; silent=true; extractsh=true;;
1459 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1460 echo "$me: ignoring -D $1" >&2
1463 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1464 *) echo "$1='define'" >> optdef.sh;;
1471 *=) echo "$1" >> optdef.sh;;
1473 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1474 echo "$me: ignoring -U $1" >&2
1476 *) echo "$1='undef'" >> optdef.sh;;
1487 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1491 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1492 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1498 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1499 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1500 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1501 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1502 *) xxx=`echo $yyy|sed 's!:.*!!'`
1503 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1509 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1511 echo "$yyy=''" >> posthint.sh ;;
1516 echo "$yyy='$zzz'" >> posthint.sh ;;
1518 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1520 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1525 echo "$yyy=$zzz" >> posthint.sh ;;
1526 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1530 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1533 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1541 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1542 [-U symbol] [-U symbol=] [-A command:symbol...]
1543 -d : use defaults for all answers.
1544 -e : go on without questioning past the production of config.sh.
1545 -f : specify an alternate default configuration file.
1546 -h : print this help message and exit (with an error status).
1547 -r : reuse C symbols value if possible (skips costly nm extraction).
1548 -s : silent mode, only echoes questions and essential information.
1549 -D : define symbol to have some value:
1550 -D symbol symbol gets the value 'define'
1551 -D symbol=value symbol gets the value 'value'
1552 -E : stop at the end of questions, after having produced config.sh.
1553 -K : do not use unless you know what you are doing.
1554 -O : let -D and -U override definitions from loaded configuration file.
1555 -S : perform variable substitutions on all .SH files (can mix with -f)
1556 -U : undefine symbol:
1557 -U symbol symbol gets the value 'undef'
1558 -U symbol= symbol gets completely empty
1559 -A : manipulate symbol after the platform specific hints have been applied:
1560 -A symbol=value append " "value to symbol
1561 -A append:symbol=value append value to symbol
1562 -A define:symbol=value define symbol to have value
1563 -A clear:symbol define symbol to be ''
1564 -A define:symbol define symbol to be 'define'
1565 -A eval:symbol=value define symbol to be eval of value
1566 -A prepend:symbol=value prepend value to symbol
1567 -A undef:symbol define symbol to be 'undef'
1568 -A undef:symbol= define symbol to be ''
1569 -V : print version number and exit (with a zero status).
1576 case "$fastread$alldone" in
1579 case "$extractsh" in
1582 if test ! -t 0; then
1583 echo "Say 'sh Configure', not 'sh <Configure'"
1593 true) exec 1>/dev/null;;
1596 : run the defines and the undefines, if any, but leave the file out there...
1599 : create the posthint manipulation script and leave the file out there...
1604 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1605 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1606 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1607 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1608 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1611 : Some greps do not return status, grrr.
1612 echo "grimblepritz" >grimble
1613 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1615 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1621 : the following should work in any shell
1625 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1626 cat >contains <<'EOSS'
1627 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1632 : Find the path to the source tree
1635 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1639 *) src=`cd ../$src && pwd` ;;
1652 if test -f $rsrc/Configure && \
1653 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1655 : found it, so we are ok.
1658 for src in . .. ../.. ../../.. ../../../..; do
1659 if test -f ../$src/Configure && \
1660 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1671 Sorry, I can't seem to locate the source dir for $package. Please start
1672 Configure with an explicit path -- i.e. /some/path/Configure.
1680 echo "Sources for $package found in \"$src\"." >&4
1684 : script used to extract .SH files with variable substitutions
1685 cat >extract <<'EOS'
1687 echo "Doing variable substitutions on .SH files..."
1688 if test -f MANIFEST; then
1689 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1691 echo "(Looking for .SH files under the source directory.)"
1692 set x `(cd "$src"; find . -name "*.SH" -print)`
1696 0) set x `(cd "$src"; echo *.SH)`; shift;;
1698 if test ! -f "$src/$1"; then
1704 while test $name; do
1705 if test ! -d "$name"; then
1706 create="$name $create";
1707 name=`echo $name | sed -e "s|^[^/]*$||"`;
1708 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1713 for file in $create; do
1722 dir=`expr X$file : 'X\(.*\)/'`
1723 file=`expr X$file : 'X.*/\(.*\)'`
1724 (cd "$dir" && . ./$file)
1734 dir=`expr X$file : 'X\(.*\)/'`
1735 file=`expr X$file : 'X.*/\(.*\)'`
1736 (set x $dir; shift; eval $mkdir_p)
1737 sh <"$src/$dir/$file"
1746 if test -f "$src/config_h.SH"; then
1747 if test ! -f config.h; then
1748 : oops, they left it out of MANIFEST, probably, so do it anyway.
1749 . "$src/config_h.SH"
1754 : extract files and exit if asked to do so
1755 case "$extractsh" in
1757 case "$realsilent" in
1761 case "$config_sh" in
1762 '') config_sh='config.sh';;
1765 echo "Fetching answers from $config_sh..."
1768 test "$override" && . ./optdef.sh
1772 echo "Extraction done."
1777 : Eunice requires " " instead of "", can you believe it
1780 echo "Beginning of configuration questions for $package."
1782 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1784 : first determine how to suppress newline on echo command
1786 echo "Checking echo to see how to suppress newlines..."
1787 (echo "hi there\c" ; echo " ") >.echotmp
1788 if $contains c .echotmp >/dev/null 2>&1 ; then
1799 echo $n "The star should be here-->$c"
1803 : Now test for existence of everything in MANIFEST
1805 if test -f "$rsrc/MANIFEST"; then
1806 echo "First let's make sure your kit is complete. Checking..." >&4
1807 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1810 for filelist in x??; do
1811 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1813 if test -s missing; then
1817 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1819 You have the option of continuing the configuration process, despite the
1820 distinct possibility that your kit is damaged, by typing 'y'es. If you
1821 do, don't blame me if something goes wrong. I advise you to type 'n'o
1822 and contact the author (perlbug@perl.org).
1825 echo $n "Continue? [n] $c" >&4
1829 echo "Continuing..." >&4
1833 echo "ABORTING..." >&4
1838 echo "Looks good..."
1841 echo "There is no MANIFEST file. I hope your kit is complete !"
1846 : Find the appropriate value for a newline for tr
1847 if test -n "$DJGPP"; then
1850 if test X"$trnl" = X; then
1851 case "`echo foo|tr '\n' x 2>/dev/null`" in
1855 if test X"$trnl" = X; then
1856 case "`echo foo|tr '\012' x 2>/dev/null`" in
1857 foox) trnl='\012' ;;
1860 if test X"$trnl" = X; then
1861 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1862 fooxy) trnl='\n\r' ;;
1865 if test X"$trnl" = X; then
1868 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1874 : compute the number of columns on the terminal for proper question formatting
1879 : set up the echo used in my read
1880 myecho="case \"\$xxxm\" in
1881 '') echo $n \"\$rp $c\" >&4;;
1883 '') echo $n \"[\$xxxm] $c\";;
1885 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1887 echo $n \"[\$xxxm] $c\" >&4
1889 echo $n \"\$rp [\$xxxm] $c\" >&4
1895 : now set up to do reads with possible shell escape and default assignment
1901 case "\$fastread" in
1902 yes) case "\$dflt" in
1905 case "\$silent-\$rp" in
1910 *) case "\$silent" in
1911 true) case "\$rp" in
1916 while expr "X\$ans" : "X!" >/dev/null; do
1920 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1928 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1937 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1942 echo "(OK, I'll run with -d after this question.)" >&4
1945 echo "*** Sorry, \$1 not supported yet." >&4
1955 echo "*** Substitution done -- please confirm."
1957 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1962 echo "*** Error -- try again."
1969 case "\$ans\$xxxm\$nostick" in
1981 : create .config dir to save info across Configure sessions
1982 test -d ../.config || mkdir ../.config
1983 cat >../.config/README <<EOF
1984 This directory created by Configure to save information that should
1985 persist across sessions for $package.
1987 You may safely delete it if you wish.
1990 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1992 $define|true|[yY]*) ;;
1993 *) case "$xversion" in
1996 *** WHOA THERE!!! ***
1998 This is an UNSTABLE DEVELOPMENT release.
1999 The version of this $package distribution is $xversion, that is, odd,
2000 (as opposed to even) and that signifies a development release.
2001 If you want a maintenance release, you want an even-numbered version.
2003 Do ***NOT*** install this into production use.
2004 Data corruption and crashes are possible.
2006 It is most seriously suggested that you do not continue any further
2007 unless you want to help in developing and debugging Perl.
2009 If you *still* want to build perl, you can answer 'y' now,
2010 or pass -Dusedevel to Configure.
2013 rp='Do you really want to continue?'
2017 [yY]) echo >&4 "Okay, continuing."
2018 usedevel="$define" ;;
2019 *) echo >&4 "Okay, bye."
2029 case "$versiononly" in
2030 '') versiononly="$define" ;;
2032 case "$installusrbinperl" in
2033 '') installusrbinperl="$undef" ;;
2038 : general instructions
2041 user=`(logname) 2>/dev/null`
2043 '') user=`whoami 2>&1`;;
2045 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2048 rp='Would you like to see the instructions?'
2059 This installation shell script will examine your system and ask you questions
2060 to determine how the perl5 package should be installed. If you get
2061 stuck on a question, you may use a ! shell escape to start a subshell or
2062 execute a command. Many of the questions will have default answers in square
2063 brackets; typing carriage return will give you the default.
2065 On some of the questions which ask for file or directory names you are allowed
2066 to use the ~name construct to specify the login directory belonging to "name",
2067 even if you don't have a shell which knows about that. Questions where this is
2068 allowed will be marked "(~name ok)".
2072 dflt='Type carriage return to continue'
2076 The prompter used in this script allows you to use shell variables and
2077 backticks in your answers. You may use $1, $2, etc... to refer to the words
2078 in the default answer, as if the default line was a set of arguments given to a
2079 script shell. This means you may also use $* to repeat the whole default line,
2080 so you do not have to re-type everything to add something to the default.
2082 Everytime there is a substitution, you will have to confirm. If there is an
2083 error (e.g. an unmatched backtick), the default answer will remain unchanged
2084 and you will be prompted again.
2086 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2087 the questions and use the computed defaults (or the previous answers if there
2088 was already a config.sh file). Type 'Configure -h' for a list of options.
2089 You may also start interactively and then answer '& -d' at any prompt to turn
2090 on the non-interactive behaviour for the remainder of the execution.
2096 Much effort has been expended to ensure that this shell script will run on any
2097 Unix system. If despite that it blows up on yours, your best bet is to edit
2098 Configure and run it again. If you can't run Configure for some reason,
2099 you'll have to generate a config.sh file by hand. Whatever problems you
2100 have, let me (perlbug@perl.org) know how I blew it.
2102 This installation script affects things in two ways:
2104 1) it may do direct variable substitutions on some of the files included
2106 2) it builds a config.h file for inclusion in C programs. You may edit
2107 any of these files as the need arises after running this script.
2109 If you make a mistake on a question, there is no easy way to back up to it
2110 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2111 files. Configure will offer to let you do this before it runs the SH files.
2114 dflt='Type carriage return to continue'
2116 case "$firsttime" in
2117 true) echo $user >>../.config/instruct;;
2121 : find out where common programs are
2123 echo "Locating common programs..." >&4
2136 if test -d \$dir/\$thing; then
2142 for thisthing in \$dir/\$thing; do
2143 : just loop through to pick last item
2145 if test -f \$thisthing; then
2148 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2151 elif test -f \$dir/\$thing.exe; then
2152 if test -n "$DJGPP"; then
2153 echo \$dir/\$thing.exe
2155 : on Eunice apparently
2208 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2209 pth="$pth /lib /usr/lib"
2210 for file in $loclist; do
2214 if test -f "$xxx"; then
2217 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2218 xxx=`./loc $file $file $pth`
2221 '') xxx=`./loc $file $file $pth`;;
2222 *) xxx=`./loc $xxx $xxx $pth`;;
2224 eval $file=$xxx$_exe
2228 echo $file is in $xxx.
2231 echo $file is in $xxx.
2234 echo "I don't know where '$file' is, and my life depends on it." >&4
2235 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2241 echo "Don't worry if any of the following aren't found..."
2243 for file in $trylist; do
2247 if test -f "$xxx"; then
2250 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2251 xxx=`./loc $file $file $pth`
2254 '') xxx=`./loc $file $file $pth`;;
2255 *) xxx=`./loc $xxx $xxx $pth`;;
2257 eval $file=$xxx$_exe
2261 echo $file is in $xxx.
2264 echo $file is in $xxx.
2267 echo "I don't see $file out there, $say."
2274 echo "Substituting grep for egrep."
2281 echo "Substituting cp for ln."
2290 echo "I can't find make or gmake, and my life depends on it." >&4
2291 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2299 *) # We can't have osname yet.
2300 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2301 # Assume that gmake, if found, is definitely GNU make
2302 # and prefer it over the system make.
2303 echo "Substituting gmake for make."
2311 echo "Hopefully test is built into your sh."
2314 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2315 echo "Using the test built into your sh."
2323 echo "Hopefully echo is built into your sh."
2328 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2329 $echo $n "hi there$c" >foo1
2330 echo $n "hi there$c" >foo2
2331 if cmp foo1 foo2 >/dev/null 2>&1; then
2332 echo "They are compatible. In fact, they may be identical."
2339 They are not compatible! You are probably running ksh on a non-USG system.
2340 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2341 have echo built in and we may have to run some Bourne shell scripts. That
2342 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2345 $echo $n "The star should be here-->$c"
2355 cat <<'EOSC' >>trygcc
2360 int main(int argc, char *argv[]) {
2364 if $cc -o try $ccflags $ldflags try.c; then
2367 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2373 case "`$cc -v -c try.c 2>&1`" in
2376 if $test X"$trygcc" = Xyes; then
2377 if gcc -o try -c try.c; then
2379 echo "You seem to have a working gcc, though." >&4
2380 rp="Would you like to use it?"
2382 if $test -f myread; then
2385 if $test -f UU/myread; then
2388 echo "Cannot find myread, sorry. Aborting." >&2
2393 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2394 if $test -f usethreads.cbu; then
2397 *** However, any setting of the C compiler flags (e.g. for thread support)
2398 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2399 *** (together with e.g. -Dusethreads).
2415 cat <<'EOSC' >>checkcc
2420 int main(int argc, char *argv[]) {
2424 if $cc -o try $ccflags $ldflags try.c; then
2427 if $test X"$despair" = Xyes; then
2428 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2431 You need to find a working C compiler.
2432 Either (purchase and) install the C compiler supplied by your OS vendor,
2433 or for a free C compiler try http://gcc.gnu.org/
2434 I cannot continue any further, aborting.
2443 : determine whether symbolic links are supported
2446 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2447 echo "Symbolic links are supported." >&4
2450 echo "Symbolic links are NOT supported." >&4
2455 : determine whether symbolic links are supported
2459 echo "Checking how to test for symbolic links..." >&4
2461 if $test "X$issymlink" = X; then
2463 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2464 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2466 if test $? = 0; then
2469 echo "Your builtin 'test -h' may be broken." >&4
2472 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2475 if test -f "$p/$test"; then
2484 echo "Trying external '$test -h'." >&4
2485 issymlink="$test -h"
2486 if $test ! -h sym >/dev/null 2>&1; then
2487 echo "External '$test -h' is broken, too." >&4
2495 if $test "X$issymlink" = X; then
2496 if $test -L sym 2>/dev/null; then
2497 issymlink="$test -L"
2498 echo "The builtin '$test -L' worked." >&4
2501 if $test "X$issymlink" != X; then
2502 echo "You can test for symbolic links with '$issymlink'." >&4
2504 echo "I do not know how you can test for symbolic links." >&4
2508 *) echo "No symbolic links, so not testing for their testing..." >&4
2514 case "$mksymlinks" in
2517 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2520 *) case "$lns:$issymlink" in
2521 *"ln"*" -s:"*"test -"?)
2522 echo "Creating the symbolic links..." >&4
2523 echo "(First creating the subdirectories...)" >&4
2525 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2527 test -z "$directory" && break
2531 if test ! -d t/base; then
2532 echo "Failed to create the subdirectories. Aborting." >&4
2535 echo "(Then creating the symlinks...)" >&4
2536 awk '{print $1}' $src/MANIFEST | while true; do
2538 test -z "$filename" && break
2539 if test -f $filename; then
2540 if $issymlink $filename; then
2544 if test -f $filename; then
2545 echo "$filename already exists, not symlinking."
2547 ln -s $src/$filename $filename
2551 if test ! -f t/base/lex.t; then
2552 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2557 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2566 case "$usecrosscompile" in
2568 $echo "Cross-compiling..."
2571 *-*-gcc) # A cross-compiling gcc, probably.
2572 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2574 # leave out ld, choosing it is more complex
2576 ranlib=$targetarch-ranlib
2577 $echo 'extern int foo;' > try.c
2578 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2580 if $test $# -gt 0; then
2582 incpth="`$echo $incpth|$sed 's/^ //'`"
2583 echo "Guessing incpth '$incpth'." >&4
2585 j="`$echo $i|$sed 's,/include$,/lib,'`"
2586 if $test -d $j; then
2590 libpth="`$echo $libpth|$sed 's/^ //'`"
2591 echo "Guessing libpth '$libpth'." >&4
2596 case "$targetarch" in
2597 '') echo "Targetarch not defined." >&4; croak=y ;;
2598 *) echo "Using targetarch $targetarch." >&4 ;;
2601 '') echo "Incpth not defined." >&4; croak=y ;;
2602 *) echo "Using incpth '$incpth'." >&4 ;;
2605 '') echo "Libpth not defined." >&4; croak=y ;;
2606 *) echo "Using libpth '$libpth'." >&4 ;;
2609 '') for i in $incpth; do
2610 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2612 echo "Guessing usrinc $usrinc." >&4
2617 '') echo "Usrinc not defined." >&4; croak=y ;;
2620 *) echo "Using usrinc $usrinc." >&4 ;;
2622 case "$targethost" in
2623 '') echo "Targethost not defined." >&4; croak=y ;;
2624 *) echo "Using targethost $targethost." >&4
2629 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2632 /*) run=$src/Cross/run
2633 targetmkdir=$src/Cross/mkdir
2635 from=$src/Cross/from
2637 *) pwd=`$test -f ../Configure & cd ..; pwd`
2639 targetmkdir=$pwd/Cross/mkdir
2641 from=$pwd/Cross/from
2644 case "$targetrun" in
2645 '') targetrun=ssh ;;
2650 case "$targetfrom" in
2651 '') targetfrom=scp ;;
2655 from=$from-$targetfrom
2656 case "$targetdir" in
2658 echo "Guessing targetdir $targetdir." >&4
2661 case "$targetuser" in
2663 echo "Guessing targetuser $targetuser." >&4
2666 case "$targetfrom" in
2670 case "$targetrun" in
2682 '') cwd=$targetdir ;;
2686 if $test ! -f \$exe.xok; then
2690 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2693 *) echo "Unknown targetrun '$targetrun'" >&4
2697 case "$targetmkdir" in
2699 cat >$targetmkdir <<EOF
2701 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2703 $chmod a+rx $targetmkdir
2705 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2717 $targetmkdir \`dirname \$f\`
2718 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2721 $targetmkdir $targetdir/\`dirname \$f\`
2722 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2735 $mkdir -p $targetdir/\`dirname \$f\`
2736 $cp \$f $targetdir/\$f || exit 1
2739 $targetmkdir $targetdir/\`dirname \$f\`
2740 $cp \$f $targetdir/\$f || exit 1
2747 *) echo "Unknown targetto '$targetto'" >&4
2751 case "$targetfrom" in
2758 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2763 cp) cat >$from <<EOF
2768 cp $targetdir/\$f . || exit 1
2773 *) echo "Unknown targetfrom '$targetfrom'" >&4
2777 if $test ! -f $run; then
2778 echo "Target 'run' script '$run' not found." >&4
2782 if $test ! -f $to; then
2783 echo "Target 'to' script '$to' not found." >&4
2787 if $test ! -f $from; then
2788 echo "Target 'from' script '$from' not found." >&4
2792 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2796 Using '$run' for remote execution,
2797 and '$from' and '$to'
2798 for remote file transfer.
2804 usecrosscompile='undef'
2809 : see whether [:lower:] and [:upper:] are supported character classes
2811 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2813 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2817 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2818 # (0xc9 and 0xd1), therefore that is a nice testing point.
2819 if test "X$up" = X -o "X$low" = X; then
2820 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2826 if test "X$up" = X -o "X$low" = X; then
2827 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2833 if test "X$up" = X -o "X$low" = X; then
2834 case "`echo IJ | od -x 2>/dev/null`" in
2836 echo "Hey, this might be EBCDIC." >&4
2837 if test "X$up" = X -o "X$low" = X; then
2838 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2839 ij) up='[A-IJ-RS-Z]'
2844 if test "X$up" = X -o "X$low" = X; then
2845 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2855 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2857 echo "Using $up and $low to convert case." >&4
2860 echo "I don't know how to translate letters from upper to lower case." >&4
2861 echo "Your tr is not acting any way I know of." >&4
2865 : set up the translation script tr, must be called with ./tr of course
2869 '[A-Z][a-z]') exec $tr '$up' '$low';;
2870 '[a-z][A-Z]') exec $tr '$low' '$up';;
2877 : Try to determine whether config.sh was made on this system
2878 case "$config_sh" in
2880 myuname=`$uname -a 2>/dev/null`
2881 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2882 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2883 # because the A-Z/a-z are not consecutive.
2884 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2885 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2886 newmyuname="$myuname"
2888 case "$knowitall" in
2890 if test -f ../config.sh; then
2891 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2892 eval "`grep myuname= ../config.sh`"
2894 if test "X$myuname" = "X$newmyuname"; then
2902 : Get old answers from old config file if Configure was run on the
2903 : same system, otherwise use the hints.
2906 if test -f config.sh; then
2908 rp="I see a config.sh file. Shall I use it to set the defaults?"
2911 n*|N*) echo "OK, I'll ignore it."
2912 mv config.sh config.sh.old
2913 myuname="$newmyuname"
2915 *) echo "Fetching default answers from your old config.sh file..." >&4
2923 : Older versions did not always set $sh. Catch re-use of such
2933 if test ! -f config.sh; then
2936 First time through, eh? I have some defaults handy for some systems
2937 that need some extra help getting the Configure answers right:
2940 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2942 : Half the following guesses are probably wrong... If you have better
2943 : tests or hints, please send them to perlbug@perl.org
2944 : The metaconfig authors would also appreciate a copy...
2945 $test -f /irix && osname=irix
2946 $test -f /xenix && osname=sco_xenix
2947 $test -f /dynix && osname=dynix
2948 $test -f /dnix && osname=dnix
2949 $test -f /lynx.os && osname=lynxos
2950 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2951 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2952 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2953 $test -f /bin/mips && /bin/mips && osname=mips
2954 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2955 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2956 $test -d /usr/apollo/bin && osname=apollo
2957 $test -f /etc/saf/_sactab && osname=svr4
2958 $test -d /usr/include/minix && osname=minix
2959 $test -f /system/gnu_library/bin/ar.pm && osname=vos
2960 if $test -d /MachTen -o -d /MachTen_Folder; then
2962 if $test -x /sbin/version; then
2963 osvers=`/sbin/version | $awk '{print $2}' |
2964 $sed -e 's/[A-Za-z]$//'`
2965 elif $test -x /usr/etc/version; then
2966 osvers=`/usr/etc/version | $awk '{print $2}' |
2967 $sed -e 's/[A-Za-z]$//'`
2973 $test -f /sys/posix.dll &&
2974 $test -f /usr/bin/what &&
2975 set X `/usr/bin/what /sys/posix.dll` &&
2976 $test "$3" = UWIN &&
2980 if $test -f $uname; then
2988 umips) osname=umips ;;
2991 [23]100) osname=mips ;;
2992 next*) osname=next ;;
2994 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2995 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2998 elif $test -f /etc/kconfig; then
3000 if test "$lns" = "$ln -s"; then
3002 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3004 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3011 if test -n "$DJGPP"; then
3020 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3022 'not found') osvers="$4"."$3" ;;
3023 '<3240'|'<>3240') osvers=3.2.0 ;;
3024 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3025 '=3250'|'>3250') osvers=3.2.5 ;;
3029 bsd386) osname=bsd386
3032 cygwin*) osname=cygwin
3035 *dc.osx) osname=dcosx
3041 domainos) osname=apollo
3047 dynixptx*) osname=dynixptx
3048 osvers=`echo "$4"|sed 's/^v//'`
3050 freebsd) osname=freebsd
3052 genix) osname=genix ;;
3054 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3070 netbsd*) osname=netbsd
3073 news-os) osvers="$3"
3075 4*) osname=newsos4 ;;
3079 next*) osname=next ;;
3080 nonstop-ux) osname=nonstopux ;;
3081 openbsd) osname=openbsd
3084 POSIX-BC | posix-bc ) osname=posix-bc
3087 powerux | power_ux | powermax_os | powermaxos | \
3088 powerunix | power_unix) osname=powerux
3094 solaris) osname=solaris
3096 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3103 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3107 titanos) osname=titanos
3116 ultrix) osname=ultrix
3119 osf1|mls+) case "$5" in
3122 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3125 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3128 hp*) osname=hp_osf1 ;;
3129 mips) osname=mips_osf1 ;;
3132 unixware) osname=svr5
3140 $2) case "$osname" in
3144 : svr4.x or possibly later
3154 if test -f /stand/boot ; then
3155 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3156 if test -n "$INITPROG" -a -f "$INITPROG"; then
3157 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3158 if test -n "$isesix"; then
3166 *) if test -f /etc/systemid; then
3168 set `echo $3 | $sed 's/\./ /g'` $4
3169 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3171 elif $test -f $src/hints/sco_$1_$2.sh; then
3173 elif $test -f $src/hints/sco_$1.sh; then
3178 '') : Still unknown. Probably a generic Sys V.
3187 *) case "$osname" in
3188 '') : Still unknown. Probably a generic BSD.
3196 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3197 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3198 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3201 $rm -f UU/kernel.what
3202 elif test -d c:/.; then
3209 case "$targetarch" in
3212 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3217 : Now look for a hint file osname_osvers, unless one has been
3218 : specified already.
3221 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3222 : Also try without trailing minor version numbers.
3223 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3224 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3225 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3226 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3229 *) case "$osvers" in
3232 *) if $test -f $src/hints/$file.sh ; then
3234 elif $test -f $src/hints/$xfile.sh ; then
3236 elif $test -f $src/hints/$xxfile.sh ; then
3238 elif $test -f $src/hints/$xxxfile.sh ; then
3240 elif $test -f $src/hints/$xxxxfile.sh ; then
3242 elif $test -f "$src/hints/${osname}.sh" ; then
3251 if $test -f Policy.sh ; then
3254 none) dflt="Policy" ;;
3255 *) dflt="Policy $dflt" ;;
3260 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3264 if $test -f Policy.sh ; then
3267 There's also a Policy hint file available, which should make the
3268 site-specific (policy) questions easier to answer.
3275 You may give one or more space-separated answers, or "none" if appropriate.
3276 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3277 is a good thing. DO NOT give a wrong version or a wrong OS.
3281 rp="Which of these apply, if any?"
3284 for file in $tans; do
3285 if $test X$file = XPolicy -a -f Policy.sh; then
3287 $cat Policy.sh >> UU/config.sh
3288 elif $test -f $src/hints/$file.sh; then
3289 . $src/hints/$file.sh
3290 $cat $src/hints/$file.sh >> UU/config.sh
3291 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3294 : Give one chance to correct a possible typo.
3295 echo "$file.sh does not exist"
3297 rp="hint to use instead?"
3299 for file in $ans; do
3300 if $test -f "$src/hints/$file.sh"; then
3301 . $src/hints/$file.sh
3302 $cat $src/hints/$file.sh >> UU/config.sh
3303 elif $test X$ans = X -o X$ans = Xnone ; then
3306 echo "$file.sh does not exist -- ignored."
3313 : Remember our hint file for later.
3314 if $test -f "$src/hints/$file.sh" ; then
3324 echo "Fetching default answers from $config_sh..." >&4
3328 cp $config_sh config.sh 2>/dev/null
3338 test "$override" && . ./optdef.sh
3340 : Restore computed paths
3341 for file in $loclist $trylist; do
3342 eval $file="\$_$file"
3347 Configure uses the operating system name and version to set some defaults.
3348 The default value is probably right if the name rings a bell. Otherwise,
3349 since spelling matters for me, either accept the default or answer "none"
3356 ''|' '|none) dflt=none ;;
3357 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3360 *) dflt="$osname" ;;
3362 rp="Operating system name?"
3366 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3372 ''|' '|none) dflt=none ;;
3373 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3374 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3376 ''|' ') dflt=none ;;
3381 *) dflt="$osvers" ;;
3383 rp="Operating system version?"
3393 : who configured the system
3394 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3395 cf_by=`(logname) 2>/dev/null`
3398 cf_by=`(whoami) 2>/dev/null`
3400 "") cf_by=unknown ;;
3404 : set up the script used to warn in case of inconsistency
3411 echo "*** WHOA THERE!!! ***" >&4
3412 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3413 rp=" Keep the $hint value?"
3416 y) td=$was; tu=$was;;
3420 : function used to set $1 to $val
3421 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3423 $define$undef) . ./whoa; eval "$var=\$td";;
3424 $undef$define) . ./whoa; eval "$var=\$tu";;
3425 *) eval "$var=$val";;
3428 case "$usethreads" in
3429 $define|true|[yY]*) dflt='y';;
3430 *) # Catch case where user specified ithreads or 5005threads but
3431 # forgot -Dusethreads (A.D. 4/2002)
3432 case "$useithreads$use5005threads" in
3433 *$define*) dflt='y' ;;
3440 Perl can be built to take advantage of threads on some systems.
3441 To do so, Configure can be run with -Dusethreads.
3443 Note that Perl built with threading support runs slightly slower
3444 and uses more memory than plain Perl. The current implementation
3445 is believed to be stable, but it is fairly new, and so should be
3446 treated with caution.
3448 If this doesn't make any sense to you, just accept the default '$dflt'.
3450 rp='Build a threading Perl?'
3453 y|Y) val="$define" ;;
3459 case "$usethreads" in
3463 Since release 5.6, Perl has had two different threading implementations,
3464 the newer interpreter-based version (ithreads) with one interpreter per
3465 thread, and the older 5.005 version (5005threads).
3466 The 5005threads version is effectively unmaintained and will probably be
3467 removed in Perl 5.10, so there should be no need to build a Perl using it
3468 unless needed for backwards compatibility with some existing 5.005threads
3472 : Default to ithreads unless overridden on command line or with
3475 case "$use5005threads" in
3476 $define|true|[yY]*) dflt='n';;
3478 case "$useithreads" in
3479 $undef|false|[nN]*) dflt='n';;
3481 rp='Use the newer interpreter-based ithreads?'
3484 y|Y) val="$define" ;;
3489 : Now set use5005threads to the opposite value.
3490 case "$useithreads" in
3491 $define) val="$undef" ;;
3498 useithreads="$undef"
3499 use5005threads="$undef"
3503 case "$useithreads$use5005threads" in
3507 You cannot have both the ithreads and the 5.005 threads enabled
3508 at the same time. Disabling the 5.005 threads since they are
3509 much less stable than the ithreads.
3512 use5005threads="$undef"
3516 case "$d_oldpthreads" in
3517 '') : Configure tests would be welcome here. For now, assume undef.
3519 *) val="$d_oldpthreads" ;;
3525 case "$usethreads" in
3526 "$define"|true|[yY]*)
3527 : Look for a hint-file generated 'call-back-unit'. If the
3528 : user has specified that a threading perl is to be built,
3529 : we may need to set or change some other defaults.
3530 if $test -f usethreads.cbu; then
3531 echo "Your platform has some specific hints for threaded builds, using them..."
3535 (Your platform doesn't have any specific hints for threaded builds.
3536 Assuming POSIX threads, then.)
3544 Perl can be built so that multiple Perl interpreters can coexist
3545 within the same Perl executable.
3548 case "$useithreads" in
3551 This multiple interpreter support is required for interpreter-based threads.
3555 *) case "$usemultiplicity" in
3556 $define|true|[yY]*) dflt='y';;
3560 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3561 rp='Build Perl for multiplicity?'
3564 y|Y) val="$define" ;;
3573 case "$usemorebits" in
3574 "$define"|true|[yY]*)
3575 use64bitint="$define"
3576 uselongdouble="$define"
3577 usemorebits="$define"
3579 *) usemorebits="$undef"
3583 : make some quick guesses about what we are up against
3585 $echo $n "Hmm... $c"
3595 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3596 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3598 echo "Looks kind of like an OSF/1 system, but we'll see..."
3600 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3601 xxx=`./loc addbib blurfl $pth`
3602 if $test -f $xxx; then
3603 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3607 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3608 echo "Looks kind of like an extended USG system, but we'll see..."
3610 echo "Looks kind of like a USG system, but we'll see..."
3614 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3615 echo "Looks kind of like a BSD system, but we'll see..."
3619 echo "Looks kind of like a Version 7 system, but we'll see..."
3622 case "$eunicefix" in
3625 There is, however, a strange, musty smell in the air that reminds me of
3626 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3630 : it so happens the Eunice I know will not run shell scripts in Unix format
3634 echo "Congratulations. You aren't running Eunice."
3638 : Detect OS2. The p_ variable is set above in the Head.U unit.
3639 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3640 : semicolon as a patch separator
3645 I have the feeling something is not exactly right, however...don't tell me...
3646 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3647 (Or you may be running DOS with DJGPP.)
3652 if test -f /xenix; then
3653 echo "Actually, this looks more like a XENIX system..."
3658 echo "It's not Xenix..."
3663 if test -f /venix; then
3664 echo "Actually, this looks more like a VENIX system..."
3671 echo "Nor is it Venix..."
3674 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3675 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3682 rp="Use which C compiler?"
3686 : See if they have not cc but they do have gcc
3688 : Look for a hint-file generated 'call-back-unit'. Now that the
3689 : user has specified the compiler, we may need to set or change some
3691 if $test -f cc.cbu; then
3697 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3703 printf("%s\n", __VERSION__);
3705 printf("%s\n", "1");
3711 if $cc -o try $ccflags $ldflags try.c; then
3712 gccversion=`$run ./try`
3713 case "$gccversion" in
3714 '') echo "You are not using GNU cc." ;;
3715 *) echo "You are using GNU cc $gccversion."
3721 echo "*** WHOA THERE!!! ***" >&4
3722 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3723 case "$knowitall" in
3725 echo " You'd better start hunting for one and let me know about it." >&4
3731 case "$gccversion" in
3732 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3734 case "$gccversion" in
3735 '') gccosandvers='' ;;
3736 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3737 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3739 case "$gccosandvers" in
3740 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3741 $osname$osvers) ;; # looking good
3742 $osname*) cat <<EOM >&4
3744 *** WHOA THERE!!! ***
3746 Your gcc has not been compiled for the exact release of
3747 your operating system ($gccosandvers versus $osname$osvers).
3749 In general it is a good idea to keep gcc synchronized with
3750 the operating system because otherwise serious problems
3751 may ensue when trying to compile software, like Perl.
3753 I'm trying to be optimistic here, though, and will continue.
3754 If later during the configuration and build icky compilation
3755 problems appear (headerfile conflicts being the most common
3756 manifestation), I suggest reinstalling the gcc to match
3757 your operating system release.
3761 *) gccosandvers='' ;; # failed to parse, better be silent
3770 : decide how portable to be. Allow command line overrides.
3771 case "$d_portable" in
3773 *) d_portable="$define" ;;
3776 : set up shell script to do ~ expansion
3782 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3785 if $test -f /bin/csh; then
3786 /bin/csh -f -c "glob \$1"
3791 name=\`$expr x\$1 : '..\([^/]*\)'\`
3792 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3793 if $test ! -d "\$dir"; then
3795 echo "\$me: can't locate home directory for: \$name" >&2
3800 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3816 : now set up to get a file name
3820 cat <<'EOSC' >>getfile
3836 : getfile will accept an answer from the comma-separated list
3837 : enclosed in parentheses even if it does not meet other criteria.
3838 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3839 fn=`echo $fn | sed 's/(.*)//'`
3845 loc_file=`expr $fn : '.*:\(.*\)'`
3846 fn=`expr $fn : '\(.*\):.*'`
3854 */*) fullpath=true;;
3863 *e*) exp_file=true;;
3866 *p*) nopath_ok=true;;
3871 *d*) type='Directory';;
3872 *l*) type='Locate';;
3877 Locate) what='File';;
3882 case "$d_portable" in
3890 while test "$type"; do
3895 true) rp="$rp (~name ok)";;
3898 if test -f UU/getfile.ok && \
3899 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3918 value=`UU/filexp $ans`
3921 if test "$ans" != "$value"; then
3922 echo "(That expands to $value on this system.)"
3936 /*) value="$ansexp" ;;
3937 [a-zA-Z]:/*) value="$ansexp" ;;
3942 echo "I shall only accept a full path name, as in /bin/ls." >&4
3943 echo "Use a ! shell escape if you wish to check pathnames." >&4
3946 echo "Please give a full path name, starting with slash." >&4
3949 echo "Note that using ~name is ok provided it expands well." >&4
3962 for fp in $gfpth; do
3963 if test "X$fp" = X.; then
3968 if test -f "$pf"; then
3970 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3972 echo "($value is not a plain file, but that's ok.)"
3975 if test X"$type" = X; then
3982 for fp in $gfpth; do
3983 if test "X$fp" = X.; then
3988 direxp="$fp/$ansexp"
3990 if test -d "$direxp"; then
3998 if test -d "$ansexp"; then
3999 echo "(Looking for $loc_file in directory $value.)"
4000 value="$value/$loc_file"
4001 ansexp="$ansexp/$loc_file"
4003 if test -f "$ansexp"; then
4006 case "$nopath_ok" in
4007 true) case "$value" in
4009 *) echo "Assuming $value will be in people's path."
4025 if test "$fastread" = yes; then
4030 rp="$what $value doesn't exist. Use that name anyway?"
4049 test "X$gfpthkeep" != Xy && gfpth=""
4052 : What should the include directory be ?
4054 $echo $n "Hmm... $c"
4058 if $test -f /bin/mips && /bin/mips; then
4059 echo "Looks like a MIPS system..."
4060 $cat >usr.c <<'EOCP'
4061 #ifdef SYSTYPE_BSD43
4065 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4066 dflt='/bsd43/usr/include'
4070 mips_type='System V'
4072 $rm -f usr.c usr.out
4073 echo "and you're compiling with the $mips_type compiler and libraries."
4077 echo "Doesn't look like a MIPS system."
4087 case "$xxx_prompt" in
4090 rp='Where are the include files you want to use?'
4098 : see how we invoke the C preprocessor
4100 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4101 cat <<'EOT' >testcpp.c
4107 if test ! -f cppstdin; then
4108 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4109 # AIX cc -E doesn't show the absolute headerfile
4110 # locations but we'll cheat by using the -M flag.
4111 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
4113 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4116 echo "Keeping your $hint cppstdin wrapper."
4119 wrapper=`pwd`/cppstdin
4123 if $test "X$cppstdin" != "X" && \
4124 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4125 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4127 echo "You used to use $cppstdin $cppminus so we'll use that again."
4129 '') echo "But let's see if we can live without a wrapper..." ;;
4131 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4132 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4134 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4137 echo "(However, $cpprun $cpplast does not work, let's see...)"
4145 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4152 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4153 $cc -E <testcpp.c >testcpp.out 2>&1; \
4154 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4155 echo "Yup, it does."
4158 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4159 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4160 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4161 echo "Yup, it does."
4164 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4165 $cc -P <testcpp.c >testcpp.out 2>&1; \
4166 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4167 echo "Yipee, that works!"
4170 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4171 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4172 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4173 echo "At long last!"
4176 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4177 $cpp <testcpp.c >testcpp.out 2>&1; \
4178 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4182 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4183 $cpp - <testcpp.c >testcpp.out 2>&1; \
4184 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4185 echo "Hooray, it works! I was beginning to wonder."
4188 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4189 $wrapper <testcpp.c >testcpp.out 2>&1; \
4190 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4196 rp="No dice. I can't find a C preprocessor. Name one:"
4200 $x_cpp <testcpp.c >testcpp.out 2>&1
4201 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4202 echo "OK, that will do." >&4
4204 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4219 echo "Perhaps can we force $cc -E using a wrapper..."
4220 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4221 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4227 echo "Nope, we'll have to live without it..."
4241 "$wrapper"|'cppstdin') ;;
4242 *) $rm -f $wrapper;;
4244 $rm -f testcpp.c testcpp.out
4246 : Set private lib path
4249 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4254 '') dlist="$loclibpth $plibpth $glibpth";;
4255 *) dlist="$libpth";;
4258 : Now check and see which directories actually exist, avoiding duplicates
4262 if $test -d $xxx; then
4265 *) libpth="$libpth $xxx";;
4271 Some systems have incompatible or broken versions of libraries. Among
4272 the directories listed in the question below, please remove any you
4273 know not to be holding relevant libraries, and add any that are needed.
4274 Say "none" for none.
4285 rp="Directories to use for library searches?"
4292 : compute shared library extension
4295 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4305 On some systems, shared libraries may be available. Answer 'none' if
4306 you want to suppress searching of shared libraries for the remainder
4307 of this configuration.
4310 rp='What is the file extension used for shared libraries?'
4314 : Define several unixisms.
4315 : Hints files or command line option can be used to override them.
4316 : The convoluted testing is in case hints files set either the old
4319 '') case "$exe_ext" in
4321 *) _exe="$exe_ext" ;;
4326 '') case "$lib_ext" in
4333 '') case "$obj_ext" in
4340 '') case "$path_sep" in
4351 : Which makefile gets called first. This is used by make depend.
4352 case "$firstmakefile" in
4353 '') firstmakefile='makefile';;
4357 $define|true|[yY]*) dflt='y';;
4362 Perl can be built to use the SOCKS proxy protocol library. To do so,
4363 Configure must be run with -Dusesocks. If you use SOCKS you also need
4364 to use the PerlIO abstraction layer, this will be implicitly selected.
4366 If this doesn't make any sense to you, just accept the default '$dflt'.
4368 rp='Build Perl for SOCKS?'
4371 y|Y) val="$define" ;;
4378 $define|true|[yY]*) useperlio="$define";;
4381 : Looking for optional libraries
4383 echo "Checking for optional libraries..." >&4
4388 case "$libswanted" in
4389 '') libswanted='c_s';;
4392 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4398 for thisdir in $libpth $xlibpth; do
4399 test -d $thisdir && libspath="$libspath $thisdir"
4401 for thislib in $libswanted; do
4402 for thisdir in $libspath; do
4404 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4405 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4406 $test -f "$xxx" && eval $libscheck
4407 $test -f "$xxx" && libstyle=shared
4409 if test ! -f "$xxx"; then
4410 xxx=$thisdir/lib$thislib.$so
4411 $test -f "$xxx" && eval $libscheck
4412 $test -f "$xxx" && libstyle=shared
4414 if test ! -f "$xxx"; then
4415 xxx=$thisdir/lib$thislib$_a
4416 $test -f "$xxx" && eval $libscheck
4417 $test -f "$xxx" && libstyle=static
4419 if test ! -f "$xxx"; then
4420 xxx=$thisdir/$thislib$_a
4421 $test -f "$xxx" && eval $libscheck
4422 $test -f "$xxx" && libstyle=static
4424 if test ! -f "$xxx"; then
4425 xxx=$thisdir/lib${thislib}_s$_a
4426 $test -f "$xxx" && eval $libscheck
4427 $test -f "$xxx" && libstyle=static
4428 $test -f "$xxx" && thislib=${thislib}_s
4430 if test ! -f "$xxx"; then
4431 xxx=$thisdir/Slib$thislib$_a
4432 $test -f "$xxx" && eval $libscheck
4433 $test -f "$xxx" && libstyle=static
4435 if $test -f "$xxx"; then
4437 shared) echo "Found -l$thislib (shared)." ;;
4438 static) echo "Found -l$thislib." ;;
4439 *) echo "Found -l$thislib ($libstyle)." ;;
4443 *) dflt="$dflt -l$thislib"
4444 libsfound="$libsfound $xxx"
4446 libsfiles="$libsfiles $yyy"
4447 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4448 case " $libsdirs " in
4450 *) libsdirs="$libsdirs $yyy" ;;
4457 if $test ! -f "$xxx"; then
4458 echo "No -l$thislib."
4469 ' '|'') dflt='none';;
4474 In order to compile $package on your machine, a number of libraries
4475 are usually needed. Include any other special libraries here as well.
4476 Say "none" for none. The default list is almost always right.
4480 rp="What libraries to use?"
4487 : determine optimization, if desired, or use for debug flag also
4489 ' '|$undef) dflt='none';;
4491 *) dflt="$optimize";;
4495 By default, $package compiles with the -O flag to use the optimizer.
4496 Alternately, you might want to use the symbolic debugger, which uses
4497 the -g flag (on traditional Unix systems). Either flag can be
4498 specified here. To use neither flag, specify the word "none".
4501 rp="What optimizer/debugger flag should be used?"
4505 'none') optimize=" ";;
4509 : We will not override a previous value, but we might want to
4510 : augment a hint file
4512 default|recommended)
4513 case "$gccversion" in
4514 1*) dflt='-fpcc-struct-return' ;;
4517 *-g*) dflt="$dflt -DDEBUGGING";;
4519 case "$gccversion" in
4520 2*) if test -d /etc/conf/kconfig.d &&
4521 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4527 case "$gccversion" in
4531 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4532 echo 'int main(void) { return 0; }' > gcctest.c
4533 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4534 echo "Yes, it does." 2>&1
4537 echo "Leaving current flags $ccflags alone." 2>&1
4539 *) dflt="$dflt -fno-strict-aliasing" ;;
4542 echo "Nope, it doesn't, but that's ok." 2>&1
4549 case "$mips_type" in
4550 *BSD*|'') inclwanted="$locincpth $usrinc";;
4551 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4553 for thisincl in $inclwanted; do
4554 if $test -d $thisincl; then
4555 if $test x$thisincl != x$usrinc; then
4557 *" -I$thisincl "*);;
4558 *) dflt="$dflt -I$thisincl ";;
4564 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4566 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4574 *) dflt="$dflt -D$2";;
4578 set signal.h LANGUAGE_C; eval $inctest
4582 ccflags="$ccflags -DSOCKS"
4587 default|recommended) dflt="$ccflags $dflt" ;;
4588 *) dflt="$ccflags";;
4597 Your C compiler may want other flags. For this question you should include
4598 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4599 but you should NOT include libraries or ld flags like -lwhatever. If you
4600 want $package to honor its debug switch, you should include -DDEBUGGING here.
4601 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4603 To use no flags, specify the word "none".
4609 rp="Any additional cc flags?"
4616 : the following weeds options from ccflags that are of no interest to cpp
4618 '') cppflags="$ccflags" ;;
4619 *) cppflags="$cppflags $ccflags" ;;
4621 case "$gccversion" in
4622 1*) cppflags="$cppflags -D__GNUC__"
4624 case "$mips_type" in
4626 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4632 echo "Let me guess what the preprocessor flags are..." >&4
4646 *) ftry="$previous $flag";;
4648 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4649 >cpp1.out 2>/dev/null && \
4650 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4651 >cpp2.out 2>/dev/null && \
4652 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4653 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4655 cppflags="$cppflags $ftry"
4665 *-*) echo "They appear to be: $cppflags";;
4667 $rm -f cpp.c cpp?.out
4671 : flags used in final linking phase
4673 '') if ./venix; then
4679 *-posix*) dflt="$dflt -posix" ;;
4682 *) dflt="$ldflags";;
4685 : Try to guess additional flags to pick up local libraries.
4686 for thislibdir in $libpth; do
4687 case " $loclibpth " in
4690 *"-L$thislibdir "*) ;;
4691 *) dflt="$dflt -L$thislibdir" ;;
4703 Your C linker may need flags. For this question you should
4704 include -L/whatever and any other flags used by the C linker, but you
4705 should NOT include libraries like -lwhatever.
4707 Make sure you include the appropriate -L/path flags if your C linker
4708 does not normally search all of the directories you specified above,
4711 To use no flags, specify the word "none".
4715 rp="Any additional ld flags (NOT including libraries)?"
4721 rmlist="$rmlist pdp11"
4725 echo "Checking your choice of C compiler and flags for coherency..." >&4
4726 $cat > try.c <<'EOF'
4728 int main() { printf("Ok\n"); exit(0); }
4730 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4732 $cat >try.msg <<'EOM'
4733 I've tried to compile and run the following simple program:
4736 $cat try.c >> try.msg
4738 $cat >> try.msg <<EOM
4745 and I got the following output:
4749 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4750 if $sh -c "$run ./try" >>try.msg 2>&1; then
4754 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4757 cat >> try.msg <<'EOQS'
4758 If $libs contains -lsfio, and sfio is mis-configured, then it
4759 sometimes (apparently) runs and exits with a 0 status, but with no
4760 output! It may have to do with sfio's use of _exit vs. exit.
4763 rp="You have a big problem. Shall I abort Configure"
4770 echo "The program compiled OK, but exited with status $?." >>try.msg
4771 rp="You have a problem. Shall I abort Configure"
4775 echo "I can't compile the test program." >>try.msg
4776 rp="You have a BIG problem. Shall I abort Configure"
4782 case "$knowitall" in
4784 echo "(The supplied flags or libraries might be incorrect.)"
4792 *) echo "Ok. Stopping Configure." >&4
4797 n) echo "OK, that should do.";;
4799 $rm -f try try.* core
4801 : define a shorthand compile call
4805 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4806 : define a shorthand compile call for compilations that should be ok.
4810 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4812 : check for lengths of integral types
4816 echo "Checking to see how big your integers are..." >&4
4817 $cat >try.c <<'EOCP'
4821 printf("intsize=%d;\n", (int)sizeof(int));
4822 printf("longsize=%d;\n", (int)sizeof(long));
4823 printf("shortsize=%d;\n", (int)sizeof(short));
4828 if eval $compile_ok && $run ./try > /dev/null; then
4830 echo "Your integers are $intsize bytes long."
4831 echo "Your long integers are $longsize bytes long."
4832 echo "Your short integers are $shortsize bytes long."
4836 Help! I can't compile and run the intsize test program: please enlighten me!
4837 (This is probably a misconfiguration in your system or libraries, and
4838 you really ought to fix it. Still, I'll try anyway.)
4842 rp="What is the size of an integer (in bytes)?"
4846 rp="What is the size of a long integer (in bytes)?"
4850 rp="What is the size of a short integer (in bytes)?"
4858 : check for long long
4860 echo "Checking to see if you have long long..." >&4
4861 echo 'int main() { long long x = 7; return 0; }' > try.c
4863 if eval $compile; then
4865 echo "You have long long."
4868 echo "You do not have long long."
4874 : check for length of long long
4875 case "${d_longlong}${longlongsize}" in
4878 echo "Checking to see how big your long longs are..." >&4
4879 $cat >try.c <<'EOCP'
4883 printf("%d\n", (int)sizeof(long long));
4888 if eval $compile_ok; then
4889 longlongsize=`$run ./try`
4890 echo "Your long longs are $longlongsize bytes long."
4894 echo "(I can't seem to compile the test program. Guessing...)"
4895 rp="What is the size of a long long (in bytes)?"
4899 if $test "X$longsize" = "X$longlongsize"; then
4900 echo "(That isn't any different from an ordinary long.)"
4906 : determine filename position in cpp output
4908 echo "Computing filename position in cpp output for #include directives..." >&4
4910 vos) testaccess=-e ;;
4913 echo '#include <stdio.h>' > foo.c
4916 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4917 $grep '^[ ]*#.*stdio\.h' | \
4918 while read cline; do
4921 while $test \$# -gt 0; do
4922 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
4927 pos=\`expr \$pos + 1\`
4939 *) pos="${fieldn}th";;
4941 echo "Your cpp writes the filename in the $pos field of the line."
4944 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4947 : locate header file
4952 for usrincdir in $usrinc
4954 if test -f \$usrincdir/\$wanted; then
4955 echo "\$usrincdir/\$wanted"
4959 awkprg='{ print \$$fieldn }'
4960 echo "#include <\$wanted>" > foo\$\$.c
4961 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4962 $cppfilter $grep "^[ ]*#.*\$wanted" | \
4963 while read cline; do
4964 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4966 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4967 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4972 # status = 0: grep returned 0 lines, case statement not executed
4973 # status = 1: headerfile found
4974 # status = 2: while loop executed, no headerfile found
4978 if test \$status -eq 1; then
4985 : define an alternate in-header-list? function
4986 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4987 cont=true; xxf="echo \"<\$1> found.\" >&4";
4988 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4989 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4991 case $# in 4) instead=instead;; *) instead="at last";; esac;
4992 while $test "$cont"; do
4994 var=$2; eval "was=\$$2";
4995 if $test "$xxx" && $test -r "$xxx";
4997 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5000 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5001 set $yyy; shift; shift; yyy=$@;
5002 case $# in 0) cont="";;
5003 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5004 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5005 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5006 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5010 do set $yyy; var=$2; eval "was=\$$2";
5011 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5012 set $yyy; shift; shift; yyy=$@;
5015 : see if inttypes.h is available
5016 : we want a real compile instead of Inhdr because some systems
5017 : have an inttypes.h which includes non-existent headers
5020 #include <inttypes.h>
5022 static int32_t foo32 = 0x12345678;
5026 if eval $compile; then
5027 echo "<inttypes.h> found." >&4
5030 echo "<inttypes.h> NOT found." >&4
5039 echo "Checking to see if you have int64_t..." >&4
5041 #include <sys/types.h>
5042 #$i_inttypes I_INTTYPES
5044 #include <inttypes.h>
5046 int main() { int64_t x = 7; }
5049 if eval $compile; then
5051 echo "You have int64_t."
5054 echo "You do not have int64_t."
5062 echo "Checking which 64-bit integer type we could use..." >&4
5068 val='"unsigned int"'
5073 *) case "$longsize" in
5077 val='"unsigned long"'
5082 *) case "$d_longlong:$longlongsize" in
5087 val='"unsigned long long"'
5092 *) case "$d_int64_t" in
5111 '') echo "Alas, no 64-bit integer types in sight." >&4
5114 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5120 case "$uselonglong" in
5121 "$define"|true|[yY]*)
5124 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5126 use64bitint="$define"
5129 case "$use64bits" in
5130 "$define"|true|[yY]*)
5133 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5135 use64bitint="$define"
5138 case "$use64bitints" in
5139 "$define"|true|[yY]*)
5142 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5144 use64bitint="$define"
5147 case "$use64bitsint" in
5148 "$define"|true|[yY]*)
5151 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5153 use64bitint="$define"
5156 case "$uselonglongs" in
5157 "$define"|true|[yY]*)
5160 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5162 use64bitint="$define"
5165 case "$use64bitsall" in
5166 "$define"|true|[yY]*)
5169 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5171 use64bitall="$define"
5176 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5178 case "$use64bitall" in
5179 "$define"|true|[yY]*) use64bitint="$define" ;;
5185 You have natively 64-bit long integers.
5189 *) case "$use64bitint" in
5190 "$define"|true|[yY]*) dflt='y';;
5199 Perl can be built to take advantage of 64-bit integer types
5200 on some systems. To do so, Configure can be run with -Duse64bitint.
5201 Choosing this option will most probably introduce binary incompatibilities.
5203 If this doesn't make any sense to you, just accept the default '$dflt'.
5204 (The default has been chosen based on your configuration.)
5206 rp='Try to use 64-bit integers, if available?'
5209 [yY]*) val="$define" ;;
5217 case "$use64bitall" in
5218 "$define"|true|[yY]*) dflt='y' ;;
5219 *) case "$longsize" in
5227 You may also choose to try maximal 64-bitness. It means using as much
5228 64-bitness as possible on the platform. This in turn means even more
5229 binary incompatibilities. On the other hand, your platform may not
5230 have any more 64-bitness available than what you already have chosen.
5232 If this doesn't make any sense to you, just accept the default '$dflt'.
5233 (The default has been chosen based on your configuration.)
5235 rp='Try to use maximal 64-bit support, if available?'
5238 [yY]*) val="$define" ;;
5243 case "$use64bitall" in
5245 case "$use64bitint" in
5249 Since you have chosen a maximally 64-bit build, I'm also turning on
5250 the use of 64-bit integers.
5252 use64bitint="$define" ;;
5257 case "$use64bitint" in
5258 "$define"|true|[yY]*)
5259 : Look for a hint-file generated 'call-back-unit'. If the
5260 : user has specified that a 64-bit perl is to be built,
5261 : we may need to set or change some other defaults.
5262 if $test -f use64bitint.cbu; then
5263 echo "Your platform has some specific hints for 64-bit integers, using them..."
5267 4) case "$archname64" in
5268 '') archname64=64int ;;
5275 case "$use64bitall" in
5276 "$define"|true|[yY]*)
5277 : Look for a hint-file generated 'call-back-unit'. If the
5278 : user has specified that a maximally 64-bit perl is to be built,
5279 : we may need to set or change some other defaults.
5280 if $test -f use64bitall.cbu; then
5281 echo "Your platform has some specific hints for 64-bit builds, using them..."
5285 4) case "$archname64" in
5286 ''|64int) archname64=64all ;;
5294 echo "Checking for GNU C Library..." >&4
5307 if eval $compile_ok && $run ./try; then
5309 echo "You are using the GNU C Library"
5312 echo "You are not using the GNU C Library"
5318 : see if nm is to be used to determine whether a symbol is defined or not
5322 case "$d_gnulibc" in
5325 echo "nm probably won't work on the GNU C Library." >&4
5331 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5333 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5334 echo "'nm' won't be sufficient on this sytem." >&4
5340 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5341 if $test $dflt -gt 20; then
5351 true|$define) dflt=y;;
5358 I can use $nm to extract the symbols from your C libraries. This
5359 is a time consuming task which may generate huge output on the disk (up
5360 to 3 megabytes) but that should make the symbols extraction faster. The
5361 alternative is to skip the 'nm' extraction part and to compile a small
5362 test program instead to determine whether each symbol is present. If
5363 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5364 this may be the best solution.
5366 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5369 rp="Shall I use $nm to extract C symbols from the libraries?"
5372 [Nn]*) usenm=false;;
5381 : nm options which may be necessary
5383 '') if $test -f /mach_boot; then
5385 elif $test -d /usr/ccs/lib; then
5386 nm_opt='-p' # Solaris (and SunOS?)
5387 elif $test -f /dgux; then
5389 elif $test -f /lib64/rld; then
5390 nm_opt='-p' # 64-bit Irix
5396 : nm options which may be necessary for shared libraries but illegal
5397 : for archive libraries. Thank you, Linux.
5398 case "$nm_so_opt" in
5399 '') case "$myuname" in
5401 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5402 nm_so_opt='--dynamic'
5411 : get list of predefined functions in a handy place
5416 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5422 *) for thislib in $libs; do
5425 : Handle C library specially below.
5428 thislib=`echo $thislib | $sed -e 's/^-l//'`
5429 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5431 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5433 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5435 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5437 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5439 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5441 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5446 libnames="$libnames $try"
5448 *) libnames="$libnames $thislib" ;;
5457 for xxx in $libpth; do
5458 $test -r $1 || set $xxx/libc.$so
5459 : The messy sed command sorts on library version numbers.
5461 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5462 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5464 s/[0-9][0-9]*/0000&/g
5465 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5468 $sort | $sed -e 's/^.* //'`
5471 $test -r $1 || set /usr/ccs/lib/libc.$so
5472 $test -r $1 || set /lib/libsys_s$_a
5478 if $test -r "$1"; then
5479 echo "Your (shared) C library seems to be in $1."
5481 elif $test -r /lib/libc && $test -r /lib/clib; then
5482 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5484 libc='/lib/clib /lib/libc'
5485 if $test -r /lib/syslib; then
5486 echo "(Your math library is in /lib/syslib.)"
5487 libc="$libc /lib/syslib"
5489 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5490 echo "Your C library seems to be in $libc, as you said before."
5491 elif $test -r $incpath/usr/lib/libc$_a; then
5492 libc=$incpath/usr/lib/libc$_a;
5493 echo "Your C library seems to be in $libc. That's fine."
5494 elif $test -r /lib/libc$_a; then
5496 echo "Your C library seems to be in $libc. You're normal."
5498 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5500 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5501 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5502 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5504 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5506 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5509 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5511 if $test -r "$tans"; then
5512 echo "Your C library seems to be in $tans, of all places."
5518 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5522 If the guess above is wrong (which it might be if you're using a strange
5523 compiler, or your machine supports multiple models), you can override it here.
5528 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5530 I can't seem to find your C library. I've looked in the following places:
5533 $sed 's/^/ /' libpath
5536 None of these seems to contain your C library. I need to get its name...
5541 rp='Where is your C library?'
5546 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5547 set X `cat libnames`
5550 case $# in 1) xxx=file; esac
5551 echo "Extracting names from the following $xxx for later perusal:" >&4
5553 $sed 's/^/ /' libnames >&4
5555 $echo $n "This may take a while...$c" >&4
5559 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5560 *) $nm $nm_opt $file 2>/dev/null;;
5565 $grep fprintf libc.tmp > libc.ptf
5566 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5567 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
5569 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5571 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5573 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5575 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5577 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5579 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5581 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5583 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5585 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5587 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5589 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5591 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5593 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5594 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5596 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5598 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5600 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5602 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5604 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5606 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5608 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5610 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5612 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5614 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5616 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5618 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5620 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5622 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5624 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5627 $nm -p $* 2>/dev/null >libc.tmp
5628 $grep fprintf libc.tmp > libc.ptf
5629 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5630 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5636 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5638 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5639 for thisname in $libnames $libc; do
5640 $ar t $thisname >>libc.tmp
5642 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5644 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5645 # Repeat libc to extract forwarders to DLL entries too
5646 for thisname in $libnames $libc; do
5647 $ar tv $thisname >>libc.tmp
5648 # Revision 50 of EMX has bug in $ar.
5649 # it will not extract forwarders to DLL entries
5650 # Use emximp which will extract exactly them.
5651 emximp -o tmp.imp $thisname \
5653 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5654 < tmp.imp >>libc.tmp
5657 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5660 echo "$ar didn't seem to work right." >&4
5661 echo "Maybe this is a Cray...trying bld instead..." >&4
5662 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5664 for thisname in $libnames; do
5666 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5667 $ar t $thisname >>libc.tmp
5671 echo "That didn't work either. Giving up." >&4
5678 if $test -f /lib/syscalls.exp; then
5680 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5681 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
5685 $rm -f libnames libpath
5687 : is a C symbol defined?
5690 -v) tf=libc.tmp; tc=""; tdc="";;
5691 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5692 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5695 case "$reuseval-$4" in
5697 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5703 if $contains $tlook $tf >/dev/null 2>&1;
5708 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5709 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5717 $define) tval=true;;
5723 : define an is-in-libc? function
5724 inlibc='echo " "; td=$define; tu=$undef;
5725 sym=$1; var=$2; eval "was=\$$2";
5727 case "$reuseval$was" in
5737 echo "$sym() found." >&4;
5738 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5740 echo "$sym() NOT found." >&4;
5741 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5745 $define) echo "$sym() found." >&4;;
5746 *) echo "$sym() NOT found." >&4;;
5750 : see if sqrtl exists
5754 : check for length of double
5756 case "$doublesize" in
5758 echo "Checking to see how big your double precision numbers are..." >&4
5759 $cat >try.c <<'EOCP'
5763 printf("%d\n", (int)sizeof(double));
5768 if eval $compile_ok; then
5769 doublesize=`$run ./try`
5770 echo "Your double is $doublesize bytes long."
5773 echo "(I can't seem to compile the test program. Guessing...)"
5774 rp="What is the size of a double precision number (in bytes)?"
5782 : check for long doubles
5784 echo "Checking to see if you have long double..." >&4
5785 echo 'int main() { long double x = 7.0; }' > try.c
5787 if eval $compile; then
5789 echo "You have long double."
5792 echo "You do not have long double."
5798 : check for length of long double
5799 case "${d_longdbl}${longdblsize}" in
5802 echo "Checking to see how big your long doubles are..." >&4
5803 $cat >try.c <<'EOCP'
5807 printf("%d\n", sizeof(long double));
5812 if eval $compile; then
5813 longdblsize=`$run ./try`
5814 echo "Your long doubles are $longdblsize bytes long."
5818 echo "(I can't seem to compile the test program. Guessing...)" >&4
5819 rp="What is the size of a long double (in bytes)?"
5823 if $test "X$doublesize" = "X$longdblsize"; then
5824 echo "(That isn't any different from an ordinary double.)"
5832 if $test X"$d_longdbl" = X"$define"; then
5834 echo "Checking how to print long doubles..." >&4
5836 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
5837 $cat >try.c <<'EOCP'
5838 #include <sys/types.h>
5842 printf("%.3f\n", d);
5846 if eval $compile; then
5850 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
5851 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
5852 echo "We will use %f."
5858 if $test X"$sPRIfldbl" = X; then
5859 $cat >try.c <<'EOCP'
5860 #include <sys/types.h>
5863 long double d = 123.456;
5864 printf("%.3Lf\n", d);
5868 if eval $compile; then
5872 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
5873 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
5874 echo "We will use %Lf."
5880 if $test X"$sPRIfldbl" = X; then
5881 $cat >try.c <<'EOCP'
5882 #include <sys/types.h>
5885 long double d = 123.456;
5886 printf("%.3llf\n", d);
5890 if eval $compile; then
5894 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
5895 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
5896 echo "We will use %llf."
5902 if $test X"$sPRIfldbl" = X; then
5903 $cat >try.c <<'EOCP'
5904 #include <sys/types.h>
5907 long double d = 123.456;
5908 printf("%.3lf\n", d);
5912 if eval $compile; then
5916 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
5917 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
5918 echo "We will use %lf."
5924 if $test X"$sPRIfldbl" = X; then
5925 echo "Cannot figure out how to print long doubles." >&4
5927 sSCNfldbl=$sPRIfldbl # expect consistency
5934 case "$sPRIfldbl" in
5935 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
5936 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
5937 d_SCNfldbl="$undef";
5939 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
5940 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
5941 d_SCNfldbl="$define";
5945 : see if modfl exists
5949 d_modfl_pow32_bug="$undef"
5951 case "$d_longdbl$d_modfl" in
5954 Checking to see whether your modfl() is okay for large values...
5960 long double nv = 4294967303.15;
5966 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
5970 case "$osname:$gccversion" in
5971 aix:) saveccflags="$ccflags"
5972 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
5975 if eval $compile; then
5978 *" 4294967303.150000 1.150000 4294967302.000000")
5979 echo >&4 "Your modfl() is broken for large values."
5980 d_modfl_pow32_bug="$define"
5982 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
5986 *" 4294967303.150000 0.150000 4294967303.000000")
5987 echo >&4 "Your modfl() seems okay for large values."
5989 *) echo >&4 "I don't understand your modfl() at all."
5993 $rm -f try.* try core core.try.*
5995 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
5998 case "$osname:$gccversion" in
5999 aix:) ccflags="$saveccflags" ;; # restore
6005 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6008 case "$uselongdouble" in
6009 $define|true|[yY]*) dflt='y';;
6014 Perl can be built to take advantage of long doubles which
6015 (if available) may give more accuracy and range for floating point numbers.
6017 If this doesn't make any sense to you, just accept the default '$dflt'.
6019 rp='Try to use long doubles if available?'
6022 y|Y) val="$define" ;;
6028 case "$uselongdouble" in
6029 true|[yY]*) uselongdouble="$define" ;;
6032 case "$uselongdouble" in
6034 : Look for a hint-file generated 'call-back-unit'. If the
6035 : user has specified that long doubles should be used,
6036 : we may need to set or change some other defaults.
6037 if $test -f uselongdouble.cbu; then
6038 echo "Your platform has some specific hints for long doubles, using them..."
6039 . ./uselongdouble.cbu
6042 (Your platform doesn't have any specific hints for long doubles.)
6049 case "$uselongdouble:$d_sqrtl:$d_modfl" in
6050 $define:$define:$define)
6053 $define:$define:$undef)
6054 message="I could not find modfl"
6056 $define:$undef:$define)
6057 message="I could not find sqrtl"
6059 $define:$undef:$undef)
6060 message="I found neither sqrtl nor modfl"
6064 if $test "$message" != X; then
6067 *** You requested the use of long doubles but you do not seem to have
6068 *** the mathematic functions for long doubles.
6070 *** I'm disabling the use of long doubles.
6074 uselongdouble=$undef
6077 case "$useperlio" in
6078 $define|true|[yY]*|'') dflt='y';;
6083 Previous version of $package used the standard IO mechanisms as
6084 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
6085 alternate IO mechanisms via the PerlIO abstraction layer, but the
6086 stdio mechanism is still available if needed. The abstraction layer
6087 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
6088 Using PerlIO with sfio may cause problems with some extension modules.
6090 If this doesn't make any sense to you, just accept the default '$dflt'.
6092 rp='Use the PerlIO abstraction layer?'
6099 echo "Ok, doing things the stdio way."
6108 case "$useperlio" in
6109 $define|true|[yY]*) ;;
6112 You are using the SOCKS proxy protocol library which means that you
6113 should also use the PerlIO layer. You may be headed for trouble.
6122 : determine the architecture name
6124 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6125 tarch=`arch`"-$osname"
6126 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6127 if uname -m > tmparch 2>&1 ; then
6128 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6129 -e 's/$/'"-$osname/" tmparch`
6137 case "$myarchname" in
6140 echo "(Your architecture name used to be $myarchname.)"
6144 case "$targetarch" in
6146 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6151 *) dflt="$archname";;
6153 rp='What is your architecture name'
6156 case "$usethreads" in
6158 echo "Threads selected." >&4
6160 *-thread*) echo "...and architecture name already has -thread." >&4
6162 *) archname="$archname-thread"
6163 echo "...setting architecture name to $archname." >&4
6168 case "$usemultiplicity" in
6170 echo "Multiplicity selected." >&4
6172 *-multi*) echo "...and architecture name already has -multi." >&4
6174 *) archname="$archname-multi"
6175 echo "...setting architecture name to $archname." >&4
6180 case "$use64bitint$use64bitall" in
6182 case "$archname64" in
6184 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6187 case "$use64bitint" in
6188 "$define") echo "64 bit integers selected." >&4 ;;
6190 case "$use64bitall" in
6191 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6194 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6196 *) archname="$archname-$archname64"
6197 echo "...setting architecture name to $archname." >&4
6203 case "$uselongdouble" in
6205 echo "Long doubles selected." >&4
6206 case "$longdblsize" in
6208 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6212 *-ld*) echo "...and architecture name already has -ld." >&4
6214 *) archname="$archname-ld"
6215 echo "...setting architecture name to $archname." >&4
6222 case "$useperlio" in
6224 echo "Perlio selected." >&4
6227 echo "Perlio not selected, using stdio." >&4
6229 *-stdio*) echo "...and architecture name already has -stdio." >&4
6231 *) archname="$archname-stdio"
6232 echo "...setting architecture name to $archname." >&4
6238 : determine root of directory hierarchy where package will be installed.
6241 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
6249 By default, $package will be installed in $dflt/bin, manual pages
6250 under $dflt/man, etc..., i.e. with $dflt as prefix for all
6251 installation directories. Typically this is something like /usr/local.
6252 If you wish to have binaries under /usr/bin but other parts of the
6253 installation under /usr/local, that's ok: you will be prompted
6254 separately for each of the installation directories, the prefix being
6255 only used to set the defaults.
6259 rp='Installation prefix to use?'
6267 *) oldprefix="$prefix";;
6276 *) afsroot=$afsroot ;;
6282 $define|true) afs=true ;;
6283 $undef|false) afs=false ;;
6284 *) if test -d $afsroot; then
6292 echo "AFS may be running... I'll be extra cautious then..." >&4
6294 echo "AFS does not seem to be running..." >&4
6297 : determine installation prefix for where package is to be installed.
6301 Since you are running AFS, I need to distinguish the directory in which
6302 files will reside from the directory in which they are installed (and from
6303 which they are presumably copied to the former directory by occult means).
6306 case "$installprefix" in
6307 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
6308 *) dflt="$installprefix";;
6313 In some special cases, particularly when building $package for distribution,
6314 it is convenient to distinguish between the directory in which files should
6315 be installed from the directory ($prefix) in which they
6316 will eventually reside. For most users, these two directories are the same.
6319 case "$installprefix" in
6321 *) dflt=$installprefix;;
6325 rp='What installation prefix should I use for installing files?'
6327 installprefix="$ans"
6328 installprefixexp="$ansexp"
6330 : set the prefixit variable, to compute a suitable default value
6331 prefixit='case "$3" in
6333 case "$oldprefix" in
6334 "") eval "$1=\"\$$2\"";;
6341 ""|" ") eval "$1=\"\$$2\"";;
6347 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6349 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6350 /*-$oldprefix/*|\~*-$oldprefix/*)
6351 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6352 *) eval "$1=\"\$$2\"";;
6356 : get the patchlevel
6358 echo "Getting the current patchlevel..." >&4
6359 if $test -r $rsrc/patchlevel.h;then
6360 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6361 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6362 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6363 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6364 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6365 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6366 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6375 $echo "(You do not have patchlevel.h. Eek.)"
6377 if $test -r $rsrc/.patch ; then
6378 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6379 perl_patchlevel=`cat $rsrc/.patch`
6382 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6383 version_patchlevel_string="version $patchlevel subversion $subversion"
6384 case "$perl_patchlevel" in
6386 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6389 $echo "(You have $package $version_patchlevel_string.)"
6393 : XXX Should be a Configure test for double-dots in filenames.
6394 version=`echo $revision $patchlevel $subversion | \
6395 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6396 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6397 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6400 version=`echo $revision $patchlevel $subversion | \
6401 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6402 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6403 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6406 : Special case the 5.005_xx maintenance series, which used 5.005
6407 : without any subversion label as a subdirectory in $sitelib
6408 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6409 api_versionstring='5.005'
6412 : determine installation style
6413 : For now, try to deduce it from prefix unless it is already set.
6414 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6415 case "$installstyle" in
6416 '') case "$prefix" in
6417 *perl*) dflt='lib';;
6418 *) dflt='lib/perl5' ;;
6421 *) dflt="$installstyle" ;;
6423 : Probably not worth prompting for this since we prompt for all
6424 : the directories individually, and the prompt would be too long and
6428 : determine where private library files go
6429 : Usual default is /usr/local/lib/perl5/$version.
6430 : Also allow things like /opt/perl/lib/$version, since
6431 : /opt/perl/lib/perl5... would be redundant.
6432 : The default "style" setting is made in installstyle.U
6433 case "$installstyle" in
6434 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6435 *) set dflt privlib lib/$version ;;
6440 There are some auxiliary files for $package that need to be put into a
6441 private library directory that is accessible by everyone.
6445 rp='Pathname where the private library files will reside?'
6448 privlibexp="$ansexp"
6449 : Change installation prefix, if necessary.
6450 if $test X"$prefix" != X"$installprefix"; then
6451 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6453 installprivlib="$privlibexp"
6456 : set the prefixup variable, to restore leading tilda escape
6457 prefixup='case "$prefixexp" in
6459 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6462 : determine where public architecture dependent libraries go
6465 : privlib default is /usr/local/lib/$package/$version
6466 : archlib default is /usr/local/lib/$package/$version/$archname
6467 : privlib may have an optional trailing /share.
6468 tdflt=`echo $privlib | $sed 's,/share$,,'`
6469 tdflt=$tdflt/$archname
6478 $spackage contains architecture-dependent library files. If you are
6479 sharing libraries in a heterogeneous environment, you might store
6480 these files in a separate location. Otherwise, you can just include
6481 them with the rest of the public library files.
6485 rp='Where do you want to put the public architecture-dependent libraries?'
6488 archlibexp="$ansexp"
6489 if $test X"$archlib" = X"$privlib"; then
6494 : Change installation prefix, if necessary.
6495 if $test X"$prefix" != X"$installprefix"; then
6496 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6498 installarchlib="$archlibexp"
6501 : see if setuid scripts can be secure
6504 Some kernels have a bug that prevents setuid #! scripts from being
6505 secure. Some sites have disabled setuid #! scripts because of this.
6507 First let's decide if your kernel supports secure setuid #! scripts.
6508 (If setuid #! scripts would be secure but have been disabled anyway,
6509 don't say that they are secure if asked.)
6514 if $test -d /dev/fd; then
6515 echo "#!$ls" >reflect
6516 chmod +x,u+s reflect
6517 ./reflect >flect 2>&1
6518 if $contains "/dev/fd" flect >/dev/null; then
6519 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6523 If you are not sure if they are secure, I can check but I'll need a
6524 username and password different from the one you are using right now.
6525 If you don't have such a username or don't want me to test, simply
6529 rp='Other username to test security of setuid scripts with?'
6534 case "$d_suidsafe" in
6535 '') echo "I'll assume setuid scripts are *not* secure." >&4
6538 echo "Well, the $hint value is *not* secure." >&4
6540 *) echo "Well, the $hint value *is* secure." >&4
6545 $rm -f reflect flect
6546 echo "#!$ls" >reflect
6547 chmod +x,u+s reflect
6550 echo '"su" will (probably) prompt you for '"$ans's password."
6551 su $ans -c './reflect >flect'
6552 if $contains "/dev/fd" flect >/dev/null; then
6553 echo "Okay, it looks like setuid scripts are secure." >&4
6556 echo "I don't think setuid scripts are secure." >&4
6561 rp='Does your kernel have *secure* setuid scripts?'
6564 [yY]*) val="$define";;
6569 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6570 echo "(That's for file descriptors, not floppy disks.)"
6576 $rm -f reflect flect
6578 : now see if they want to do setuid emulation
6581 case "$d_suidsafe" in
6584 echo "No need to emulate SUID scripts since they are secure here." >&4
6588 Some systems have disabled setuid scripts, especially systems where
6589 setuid scripts cannot be secure. On systems where setuid scripts have
6590 been disabled, the setuid/setgid bits on scripts are currently
6591 useless. It is possible for $package to detect those bits and emulate
6592 setuid/setgid in a secure fashion. This emulation will only work if
6593 setuid scripts have been disabled in your kernel.
6597 "$define") dflt=y ;;
6600 rp="Do you want to do setuid/setgid emulation?"
6603 [yY]*) val="$define";;
6611 : see if this is a malloc.h system
6612 set malloc.h i_malloc
6615 : see if stdlib is available
6616 set stdlib.h i_stdlib
6619 : check for void type
6621 echo "Checking to see how well your C compiler groks the void type..." >&4
6622 case "$voidflags" in
6624 $cat >try.c <<'EOCP'
6630 extern void moo(); /* function returning void */
6631 void (*goo)(); /* ptr to func returning void */
6633 void *hue; /* generic ptr */
6646 int main() { sub(); }
6648 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6649 voidflags=$defvoidused
6650 echo "Good. It appears to support void to the level $package wants.">&4
6651 if $contains warning .out >/dev/null 2>&1; then
6652 echo "However, you might get some warnings that look like this:"
6656 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6657 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6658 echo "It supports 1..."
6659 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6660 echo "It also supports 2..."
6661 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6663 echo "And it supports 4 but not 8 definitely."
6665 echo "It doesn't support 4..."
6666 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6668 echo "But it supports 8."
6671 echo "Neither does it support 8."
6675 echo "It does not support 2..."
6676 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6678 echo "But it supports 4 and 8."
6680 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6682 echo "And it supports 4 but has not heard about 8."
6684 echo "However it supports 8 but not 4."
6689 echo "There is no support at all for void."
6694 case "$voidflags" in
6697 Support flag bits are:
6698 1: basic void declarations.
6699 2: arrays of pointers to functions returning void.
6700 4: operations between pointers to and addresses of void functions.
6701 8: generic void pointers.
6704 rp="Your void support flags add up to what?"
6711 : check for length of pointer
6715 echo "Checking to see how big your pointers are..." >&4
6716 if test "$voidflags" -gt 7; then
6717 echo '#define VOID_PTR char *' > try.c
6719 echo '#define VOID_PTR void *' > try.c
6721 $cat >>try.c <<'EOCP'
6725 printf("%d\n", (int)sizeof(VOID_PTR));
6730 if eval $compile_ok; then
6731 ptrsize=`$run ./try`
6732 echo "Your pointers are $ptrsize bytes long."
6735 echo "(I can't seem to compile the test program. Guessing...)" >&4
6736 rp="What is the size of a pointer (in bytes)?"
6743 case "$use64bitall" in
6744 "$define"|true|[yY]*)
6748 *** You have chosen a maximally 64-bit build, but your pointers
6749 *** are only 4 bytes wide, disabling maximal 64-bitness.
6752 use64bitall="$undef"
6753 case "$use64bitint" in
6754 "$define"|true|[yY]*) ;;
6757 *** Downgrading from maximal 64-bitness to using 64-bit integers.
6760 use64bitint="$define"
6769 : determine which malloc to compile in
6771 case "$usemymalloc" in
6772 [yY]*|true|$define) dflt='y' ;;
6773 [nN]*|false|$undef) dflt='n' ;;
6774 *) case "$ptrsize" in
6780 rp="Do you wish to attempt to use the malloc that comes with $package?"
6786 mallocsrc='malloc.c'
6787 mallocobj="malloc$_o"
6788 d_mymalloc="$define"
6791 : Remove malloc from list of libraries to use
6792 echo "Removing unneeded -lmalloc from library list" >&4
6793 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6796 echo "libs = $libs" >&4
6808 : compute the return types of malloc and free
6810 $cat >malloc.c <<END
6814 #include <sys/types.h>
6828 case "$malloctype" in
6830 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6837 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6841 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6848 echo "Your system uses $freetype free(), it would seem." >&4
6852 After $package is installed, you may wish to install various
6853 add-on modules and utilities. Typically, these add-ons will
6854 be installed under $prefix with the rest
6855 of this package. However, you may wish to install such add-ons
6856 elsewhere under a different prefix.
6858 If you do not wish to put everything under a single prefix, that's
6859 ok. You will be prompted for the individual locations; this siteprefix
6860 is only used to suggest the defaults.
6862 The default should be fine for most people.
6866 rp='Installation prefix to use for add-on modules and utilities?'
6867 : XXX Here might be another good place for an installstyle setting.
6868 case "$siteprefix" in
6870 *) dflt=$siteprefix ;;
6873 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6875 case "$siteprefix" in
6879 *) oldsiteprefix="$prefix";;
6884 siteprefixexp="$ansexp"
6886 : determine where site specific libraries go.
6887 : Usual default is /usr/local/lib/perl5/site_perl/$version
6888 : The default "style" setting is made in installstyle.U
6889 : XXX No longer works with Prefixit stuff.
6890 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6892 '') case "$installstyle" in
6893 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6894 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6902 The installation process will create a directory for
6903 site-specific extensions and modules. Most users find it convenient
6904 to place all site-specific files in this directory rather than in the
6905 main distribution directory.
6909 rp='Pathname for the site-specific library files?'
6912 sitelibexp="$ansexp"
6913 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6914 : Change installation prefix, if necessary.
6915 if $test X"$prefix" != X"$installprefix"; then
6916 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6918 installsitelib="$sitelibexp"
6921 : determine where site specific architecture-dependent libraries go.
6922 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6923 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6924 : sitelib may have an optional trailing /share.
6926 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6927 dflt="$dflt/$archname"
6932 set sitearch sitearch none
6936 The installation process will also create a directory for
6937 architecture-dependent site-specific extensions and modules.
6941 rp='Pathname for the site-specific architecture-dependent library files?'
6944 sitearchexp="$ansexp"
6945 : Change installation prefix, if necessary.
6946 if $test X"$prefix" != X"$installprefix"; then
6947 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6949 installsitearch="$sitearchexp"
6954 The installation process will also create a directory for
6955 vendor-supplied add-ons. Vendors who supply perl with their system
6956 may find it convenient to place all vendor-supplied files in this
6957 directory rather than in the main distribution directory. This will
6958 ease upgrades between binary-compatible maintenance versions of perl.
6960 Of course you may also use these directories in whatever way you see
6961 fit. For example, you might use them to access modules shared over a
6962 company-wide network.
6964 The default answer should be fine for most people.
6965 This causes further questions about vendor add-ons to be skipped
6966 and no vendor-specific directories will be configured for perl.
6969 rp='Do you want to configure vendor-specific add-on directories?'
6970 case "$usevendorprefix" in
6971 define|true|[yY]*) dflt=y ;;
6972 *) : User may have set vendorprefix directly on Configure command line.
6973 case "$vendorprefix" in
6982 rp='Installation prefix to use for vendor-supplied add-ons?'
6983 case "$vendorprefix" in
6985 *) dflt=$vendorprefix ;;
6988 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6990 case "$vendorprefix" in
6994 *) oldvendorprefix="$prefix";;
6998 usevendorprefix="$define"
7000 vendorprefixexp="$ansexp"
7002 *) usevendorprefix="$undef"
7008 case "$vendorprefix" in
7009 '') d_vendorlib="$undef"
7013 *) d_vendorlib="$define"
7014 : determine where vendor-supplied modules go.
7015 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7016 case "$vendorlib" in
7018 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7019 case "$installstyle" in
7020 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7021 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7024 *) dflt="$vendorlib"
7028 rp='Pathname for the vendor-supplied library files?'
7031 vendorlibexp="$ansexp"
7034 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7035 : Change installation prefix, if necessary.
7036 if $test X"$prefix" != X"$installprefix"; then
7037 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
7039 installvendorlib="$vendorlibexp"
7042 case "$vendorprefix" in
7043 '') d_vendorarch="$undef"
7047 *) d_vendorarch="$define"
7048 : determine where vendor-supplied architecture-dependent libraries go.
7049 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7050 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7051 : vendorlib may have an optional trailing /share.
7052 case "$vendorarch" in
7053 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7054 dflt="$dflt/$archname"
7056 *) dflt="$vendorarch" ;;
7059 rp='Pathname for vendor-supplied architecture-dependent files?'
7062 vendorarchexp="$ansexp"
7065 : Change installation prefix, if necessary.
7066 if $test X"$prefix" != X"$installprefix"; then
7067 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
7069 installvendorarch="$vendorarchexp"
7072 : Final catch-all directories to search
7075 Lastly, you can have perl look in other directories for extensions and
7076 modules in addition to those already specified.
7077 These directories will be searched after
7081 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7082 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7084 case "$otherlibdirs" in
7085 ''|' ') dflt='none' ;;
7086 *) dflt="$otherlibdirs" ;;
7089 Enter a colon-separated set of extra paths to include in perl's @INC
7090 search path, or enter 'none' for no extra paths.
7094 rp='Colon-separated list of additional directories for perl to search?'
7097 ' '|''|none) otherlibdirs=' ' ;;
7098 *) otherlibdirs="$ans" ;;
7100 case "$otherlibdirs" in
7104 set d_perl_otherlibdirs
7107 : Cruising for prototypes
7109 echo "Checking out function prototypes..." >&4
7110 $cat >prototype.c <<'EOCP'
7111 int main(int argc, char *argv[]) {
7114 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7115 echo "Your C compiler appears to support function prototypes."
7118 echo "Your C compiler doesn't seem to understand function prototypes."
7125 case "$prototype" in
7127 *) ansi2knr='ansi2knr'
7132 This version of $package can only be compiled by a compiler that
7133 understands function prototypes. Unfortunately, your C compiler
7135 doesn't seem to understand them. Sorry about that.
7137 If GNU cc is available for your system, perhaps you could try that instead.
7139 Eventually, we hope to support building Perl with pre-ANSI compilers.
7140 If you would like to help in that effort, please contact <perlbug@perl.org>.
7142 Aborting Configure now.
7148 : determine where public executables go
7153 rp='Pathname where the public executables will reside?'
7155 if $test "X$ansexp" != "X$binexp"; then
7160 : Change installation prefix, if necessary.
7161 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7162 if $test X"$prefix" != X"$installprefix"; then
7163 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
7165 installbin="$binexp"
7174 Perl can be built with extra modules or bundles of modules which
7175 will be fetched from the CPAN and installed alongside Perl.
7177 Notice that you will need access to the CPAN; either via the Internet,
7178 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7179 be asked later to configure the CPAN.pm module which will in turn do
7180 the installation of the rest of the extra modules or bundles.)
7182 Notice also that if the modules require any external software such as
7183 libraries and headers (the libz library and the zlib.h header for the
7184 Compress::Zlib module, for example) you MUST have any such software
7185 already installed, this configuration process will NOT install such
7188 If this doesn't make any sense to you, just accept the default '$dflt'.
7190 rp='Install any extra modules (y or n)?'
7196 Please list any extra modules or bundles to be installed from CPAN,
7197 with spaces between the names. The names can be in any format the
7198 'install' command of CPAN.pm will understand. (Answer 'none',
7199 without the quotes, to install no extra modules or bundles.)
7209 $rm -f ../extras.lst
7211 *) echo "(Saving the list of extras for later...)"
7212 echo "$extras" > ../extras.lst
7220 : Find perl5.005 or later.
7221 echo "Looking for a previously installed perl5.005 or later... "
7223 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7224 : Check if this perl is recent and can load a simple module
7225 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7228 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7238 '') echo "None found. That's ok.";;
7239 *) echo "Using $perl5." ;;
7242 : Determine list of previous versions to include in @INC
7243 $cat > getverlist <<EOPL
7246 \$api_versionstring = "$api_versionstring";
7247 \$version = "$version";
7248 \$stem = "$sitelib_stem";
7249 \$archname = "$archname";
7251 $cat >> getverlist <<'EOPL'
7252 # Can't have leading @ because metaconfig interprets it as a command!
7253 ;@inc_version_list=();
7254 # XXX Redo to do opendir/readdir?
7257 ;@candidates = glob("5.*");
7263 # XXX ToDo: These comparisons must be reworked when two-digit
7264 # subversions come along, so that 5.7.10 compares as greater than
7265 # 5.7.3! By that time, hope that 5.6.x is sufficiently
7266 # widespread that we can use the built-in version vectors rather
7267 # than reinventing them here. For 5.6.0, however, we must
7268 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
7269 foreach $d (@candidates) {
7270 if ($d lt $version) {
7271 if ($d ge $api_versionstring) {
7272 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
7274 elsif ($d ge "5.005") {
7275 unshift(@inc_version_list, grep { -d } $d);
7279 # Skip newer version. I.e. don't look in
7280 # 5.7.0 if we're installing 5.6.1.
7284 if (@inc_version_list) {
7285 print join(' ', @inc_version_list);
7288 # Blank space to preserve value for next Configure run.
7293 case "$inc_version_list" in
7294 '') if test -x "$perl5$exe_ext"; then
7295 dflt=`$perl5 getverlist`
7300 $undef) dflt='none' ;;
7301 *) eval dflt=\"$inc_version_list\" ;;
7304 ''|' ') dflt=none ;;
7311 In order to ease the process of upgrading, this version of perl
7312 can be configured to use modules built and installed with earlier
7313 versions of perl that were installed under $prefix. Specify here
7314 the list of earlier versions that this version of perl should check.
7315 If Configure detected no earlier versions of perl installed under
7316 $prefix, then the list will be empty. Answer 'none' to tell perl
7317 to not search earlier versions.
7319 The default should almost always be sensible, so if you're not sure,
7320 just accept the default.
7323 rp='List of earlier versions to include in @INC?'
7326 [Nn]one|''|' ') inc_version_list=' ' ;;
7327 *) inc_version_list="$ans" ;;
7329 case "$inc_version_list" in
7331 inc_version_list_init='0';;
7332 *) inc_version_list_init=`echo $inc_version_list |
7333 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7338 : determine whether to install perl also as /usr/bin/perl
7341 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7343 Many scripts expect perl to be installed as /usr/bin/perl.
7344 I can install the perl you are about to compile also as /usr/bin/perl
7345 (in addition to $installbin/perl).
7347 case "$installusrbinperl" in
7348 "$undef"|[nN]*) dflt='n';;
7351 rp="Do you want to install perl as /usr/bin/perl?"
7354 [yY]*) val="$define";;
7360 set installusrbinperl
7363 : see if dld is available
7367 : see if dlopen exists
7374 : determine which dynamic loading, if any, to compile in
7376 dldir="ext/DynaLoader"
7389 $define) dflt='y' ;;
7392 $define) dflt='y' ;;
7394 : Does a dl_xxx.xs file exist for this operating system
7395 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7398 rp="Do you wish to use dynamic loading?"
7405 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7406 dflt="$dldir/dl_${osname}.xs"
7407 elif $test "$d_dlopen" = "$define" ; then
7408 dflt="$dldir/dl_dlopen.xs"
7409 elif $test "$i_dld" = "$define" ; then
7410 dflt="$dldir/dl_dld.xs"
7415 *) dflt="$dldir/$dlsrc"
7418 echo "The following dynamic loading files are available:"
7419 : Can not go over to $dldir because getfile has path hard-coded in.
7420 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7421 rp="Source file to use for dynamic loading"
7427 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7431 Some systems may require passing special flags to $cc -c to
7432 compile modules that will be used to create a shared library.
7433 To use no flags, say "none".
7436 case "$cccdlflags" in
7437 '') case "$gccversion" in
7438 '') case "$osname" in
7440 next) dflt='none' ;;
7441 irix*) dflt='-KPIC' ;;
7442 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7443 sunos) dflt='-pic' ;;
7447 *) case "$osname" in
7448 darwin) dflt='none' ;;
7449 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7454 *) dflt="$cccdlflags" ;;
7456 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7459 none) cccdlflags=' ' ;;
7460 *) cccdlflags="$ans" ;;
7465 Some systems use ld to create libraries that can be dynamically loaded,
7466 while other systems (such as those using ELF) use $cc.
7470 '') $cat >try.c <<'EOM'
7471 /* Test for whether ELF binaries are produced */
7476 int i = open("a.out",O_RDONLY);
7479 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7480 exit(0); /* succeed (yes, it's ELF) */
7485 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7487 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7491 echo "I'll use ld to build dynamic libraries."
7500 rp="What command should be used to create dynamic libraries?"
7506 Some systems may require passing special flags to $ld to create a
7507 library that can be dynamically loaded. If your ld flags include
7508 -L/other/path options to locate libraries outside your loader's normal
7509 search path, you may need to specify those -L options here as well. To
7510 use no flags, say "none".
7513 case "$lddlflags" in
7514 '') case "$osname" in
7515 beos) dflt='-nostart' ;;
7517 case "$gccversion" in
7518 '') dflt="$dflt +vnocompatwarnings" ;;
7521 linux|irix*) dflt='-shared' ;;
7522 next) dflt='none' ;;
7523 solaris) dflt='-G' ;;
7524 sunos) dflt='-assert nodefinitions' ;;
7525 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7529 *) dflt="$lddlflags" ;;
7532 : Try to guess additional flags to pick up local libraries.
7533 : Be careful not to append to a plain 'none'
7537 for thisflag in $ldflags; do
7542 *) dflt="$dflt $thisflag" ;;
7549 ''|' ') dflt='none' ;;
7552 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7555 none) lddlflags=' ' ;;
7556 *) lddlflags="$ans" ;;
7561 Some systems may require passing special flags to $cc to indicate that
7562 the resulting executable will use dynamic linking. To use no flags,
7566 case "$ccdlflags" in
7567 '') case "$osname" in
7568 hpux) dflt='-Wl,-E' ;;
7569 linux) dflt='-rdynamic' ;;
7570 next) dflt='none' ;;
7571 sunos) dflt='none' ;;
7575 *) dflt="$ccdlflags" ;;
7577 rp="Any special flags to pass to $cc to use dynamic linking?"
7580 none) ccdlflags=' ' ;;
7581 *) ccdlflags="$ans" ;;
7595 # No dynamic loading being used, so don't bother even to prompt.
7598 *) case "$useshrplib" in
7599 '') case "$osname" in
7600 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7602 also='Building a shared libperl is required for dynamic loading to work on your system.'
7607 also='Building a shared libperl is needed for MAB support.'
7625 The perl executable is normally obtained by linking perlmain.c with
7626 libperl${_a}, any static extensions (usually just DynaLoader), and
7627 any other libraries needed on this system (such as -lm, etc.). Since
7628 your system supports dynamic loading, it is probably possible to build
7629 a shared libperl.$so. If you will have more than one executable linked
7630 to libperl.$so, this will significantly reduce the size of each
7631 executable, but it may have a noticeable affect on performance. The
7632 default is probably sensible for your system.
7636 rp="Build a shared libperl.$so (y/n)"
7640 useshrplib='true' ;;
7641 *) useshrplib='false' ;;
7646 case "$useshrplib" in
7650 # Figure out a good name for libperl.so. Since it gets stored in
7651 # a version-specific architecture-dependent library, the version
7652 # number isn't really that important, except for making cc/ld happy.
7654 # A name such as libperl.so.3.1
7655 majmin="libperl.$so.$patchlevel.$subversion"
7656 # A name such as libperl.so.301
7657 majonly=`echo $patchlevel $subversion |
7658 $awk '{printf "%d%02d", $1, $2}'`
7659 majonly=libperl.$so.$majonly
7660 # I'd prefer to keep the os-specific stuff here to a minimum, and
7661 # rely on figuring it out from the naming of libc.
7662 case "${osname}${osvers}" in
7665 # XXX How handle the --version stuff for MAB?
7667 linux*) # ld won't link with a bare -lperl otherwise.
7670 cygwin*) # ld links against an importlib
7671 dflt=libperl$lib_ext
7673 *) # Try to guess based on whether libc has major.minor.
7675 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7676 *libc.$so.[0-9]*) dflt=$majonly ;;
7677 *) dflt=libperl.$so ;;
7687 I need to select a good name for the shared libperl. If your system uses
7688 library names with major and minor numbers, then you might want something
7689 like $majmin. Alternatively, if your system uses a single version
7690 number for shared libraries, then you might want to use $majonly.
7691 Or, your system might be quite happy with a simple libperl.$so.
7693 Since the shared libperl will get installed into a version-specific
7694 architecture-dependent directory, the version number of the shared perl
7695 library probably isn't important, so the default should be o.k.
7698 rp='What name do you want to give to the shared libperl?'
7701 echo "Ok, I'll use $libperl"
7704 libperl="libperl${_a}"
7708 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7712 WARNING: Use of the shrpdir variable for the installation location of
7713 the shared $libperl is not supported. It was never documented and
7714 will not work in this version. Let me (perlbug@perl.org)
7715 know of any problems this may cause.
7721 But your current setting of $shrpdir is
7722 the default anyway, so it's harmless.
7727 Further, your current attempted setting of $shrpdir
7728 conflicts with the value of $archlibexp/CORE
7729 that installperl will use.
7736 # How will the perl executable find the installed shared $libperl?
7737 # Add $xxx to ccdlflags.
7738 # If we can't figure out a command-line option, use $shrpenv to
7739 # set env LD_RUN_PATH. The main perl makefile uses this.
7740 shrpdir=$archlibexp/CORE
7743 if "$useshrplib"; then
7746 # We'll set it in Makefile.SH...
7752 xxx="-Wl,-R$shrpdir"
7754 bsdos|linux|irix*|dec_osf)
7755 xxx="-Wl,-rpath,$shrpdir"
7758 # next doesn't like the default...
7761 # beos doesn't like the default, either.
7764 # hpux doesn't like the default, either.
7765 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7768 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7774 # Only add $xxx if it isn't already in ccdlflags.
7775 case " $ccdlflags " in
7777 *) ccdlflags="$ccdlflags $xxx"
7780 Adding $xxx to the flags
7781 passed to $ld so that the perl executable will find the
7782 installed shared $libperl.
7790 # Fix ccdlflags in AIX for building external extensions.
7791 # (For building Perl itself bare -bE:perl.exp is needed,
7792 # Makefile.SH takes care of this.)
7794 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7796 # Respect a hint or command-line value.
7798 '') shrpenv="$tmp_shrpenv" ;;
7800 case "$ldlibpthname" in
7801 '') ldlibpthname=LD_LIBRARY_PATH ;;
7802 none) ldlibpthname='' ;;
7805 : determine where manual pages are on this system
7809 syspath='/usr/share/man/man1 /usr/man/man1'
7810 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7811 syspath="$syspath /usr/man/u_man/man1"
7812 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7813 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7814 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7815 sysman=`./loc . /usr/man/man1 $syspath`
7818 if $test -d "$sysman"; then
7819 echo "System manual is in $sysman." >&4
7821 echo "Could not find manual pages in source form." >&4
7824 : determine where manual pages go
7825 set man1dir man1dir none
7829 $spackage has manual pages available in source form.
7833 echo "However, you don't have nroff, so they're probably useless to you."
7835 '') man1dir="none";;
7838 echo "If you don't want the manual sources installed, answer 'none'."
7843 lookpath="$prefixexp/share/man/man1"
7844 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7845 lookpath="$lookpath $prefixexp/man/p_man/man1"
7846 lookpath="$lookpath $prefixexp/man/u_man/man1"
7847 lookpath="$lookpath $prefixexp/man/man.1"
7849 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7850 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7860 rp="Where do the main $spackage manual pages (source) go?"
7862 if $test "X$man1direxp" != "X$ansexp"; then
7866 man1direxp="$ansexp"
7872 : Change installation prefix, if necessary.
7873 if $test X"$prefix" != X"$installprefix"; then
7874 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7876 installman1dir="$man1direxp"
7879 : What suffix to use on installed man pages
7886 rp="What suffix should be used for the main $spackage man pages?"
7888 '') case "$man1dir" in
7902 *) dflt="$man1ext";;
7909 : see if we can have long filenames
7911 first=123456789abcdef
7913 if (echo hi >$first) 2>/dev/null; then
7914 if $test -f 123456789abcde; then
7915 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7918 echo 'You can have filenames longer than 14 characters.'>&4
7923 You can't have filenames longer than 14 chars.
7924 You can't even think about them!
7930 $rm -rf 123456789abcde*
7932 : determine where library module manual pages go
7933 set man3dir man3dir none
7937 $spackage has manual pages for many of the library modules.
7943 However, you don't have nroff, so they're probably useless to you.
7946 '') man3dir="none";;
7950 case "$d_flexfnam" in
7953 However, your system can't handle the long file names like File::Basename.3.
7956 '') man3dir="none";;
7960 echo "If you don't want the manual sources installed, answer 'none'."
7961 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7963 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7964 if $test -d "$privlib/man/man3"; then
7967 WARNING: Previous versions of perl installed man3 pages into
7968 $privlib/man/man3. This version will suggest a
7969 new default of $dflt.
7973 rp='Do you wish to preserve the old behavior?(y/n)'
7976 y*) dflt="$privlib/man/man3" ;;
7981 *) dflt="$man3dir" ;;
7988 rp="Where do the $package library man pages (source) go?"
7991 man3direxp="$ansexp"
7997 : Change installation prefix, if necessary.
7998 if $test X"$prefix" != X"$installprefix"; then
7999 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8001 installman3dir="$man3direxp"
8004 : What suffix to use on installed man pages
8010 rp="What suffix should be used for the $package library man pages?"
8012 '') case "$man3dir" in
8026 *) dflt="$man3ext";;
8033 : see if we have to deal with yellow pages, now NIS.
8034 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8035 if $test -f /usr/etc/nibindd; then
8037 echo "I'm fairly confident you're on a NeXT."
8039 rp='Do you get the hosts file via NetInfo?'
8048 y*) hostcat='nidump hosts .';;
8049 *) case "$hostcat" in
8050 nidump*) hostcat='';;
8060 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8068 rp='Are you getting the hosts file via yellow pages?'
8071 y*) hostcat='ypcat hosts';;
8072 *) hostcat='cat /etc/hosts';;
8078 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8081 '') test -f /etc/group && groupcat='cat /etc/group';;
8084 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8087 : now get the host name
8089 echo "Figuring out host name..." >&4
8090 case "$myhostname" in
8092 echo 'Maybe "hostname" will work...'
8093 if tans=`sh -c hostname 2>&1` ; then
8101 if $test "$cont"; then
8103 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8104 if tans=`cat /etc/systemid 2>&1` ; then
8106 phostname='cat /etc/systemid'
8107 echo "Whadyaknow. Xenix always was a bit strange..."
8110 elif $test -r /etc/systemid; then
8111 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8114 if $test "$cont"; then
8115 echo 'No, maybe "uuname -l" will work...'
8116 if tans=`sh -c 'uuname -l' 2>&1` ; then
8118 phostname='uuname -l'
8120 echo 'Strange. Maybe "uname -n" will work...'
8121 if tans=`sh -c 'uname -n' 2>&1` ; then
8123 phostname='uname -n'
8125 echo 'Oh well, maybe I can mine it out of whoami.h...'
8126 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8127 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8128 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8130 case "$myhostname" in
8131 '') echo "Does this machine have an identity crisis or something?"
8134 echo "Well, you said $myhostname before..."
8135 phostname='echo $myhostname';;
8141 case "$myhostname" in
8142 '') myhostname=noname ;;
8144 : you do not want to know about this
8149 if $test "$myhostname" ; then
8151 rp='Your host name appears to be "'$myhostname'".'" Right?"
8159 : bad guess or no guess
8160 while $test "X$myhostname" = X ; do
8162 rp="Please type the (one word) name of your host:"
8167 : translate upper to lower if necessary
8168 case "$myhostname" in
8170 echo "(Normalizing case in your host name)"
8171 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8175 case "$myhostname" in
8177 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8178 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8179 echo "(Trimming domain name from host name--host name is now $myhostname)"
8181 *) case "$mydomain" in
8184 test "X$hostcat" = "Xypcat hosts" &&
8185 ypmatch "$myhostname" hosts 2>/dev/null |\
8186 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8189 test "X$hostcat" != "X" &&
8190 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8191 /[ ]$myhostname[ . ]/p" > hosts
8194 if $test -f hosts; then
8195 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8196 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8197 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8198 hosts | $sort | $uniq | \
8199 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8200 case `$echo X$dflt` in
8201 X*\ *) echo "(Several hosts in the database matched hostname)"
8204 X.) echo "(You do not have fully-qualified names in the hosts database)"
8208 echo "(I cannot locate a hosts database anywhere)"
8213 tans=`./loc resolv.conf X /etc /usr/etc`
8214 if $test -f "$tans"; then
8215 echo "(Attempting domain name extraction from $tans)"
8216 dflt=.`$sed -n -e 's/ / /g' \
8217 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8218 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8220 .) dflt=.`$sed -n -e 's/ / /g' \
8221 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8222 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8229 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8230 dflt=.`sh -c domainname 2>/dev/null`
8233 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8237 case "$dflt$osname" in
8238 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8239 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8243 .) echo "(Lost all hope -- silly guess then)"
8249 *) dflt="$mydomain";;
8253 rp="What is your domain name?"
8263 : translate upper to lower if necessary
8266 echo "(Normalizing case in your domain name)"
8267 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8271 : a little sanity check here
8272 case "$phostname" in
8275 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8276 $myhostname$mydomain|$myhostname) ;;
8278 case "$phostname" in
8280 echo "(That doesn't agree with your whoami.h file, by the way.)"
8283 echo "(That doesn't agree with your $phostname command, by the way.)"
8293 I need to get your e-mail address in Internet format if possible, i.e.
8294 something like user@host.domain. Please answer accurately since I have
8295 no easy means to double check it. The default value provided below
8296 is most probably close to reality but may not be valid from outside
8297 your organization...
8301 while test "$cont"; do
8303 '') dflt="$cf_by@$myhostname$mydomain";;
8304 *) dflt="$cf_email";;
8306 rp='What is your e-mail address?'
8312 rp='Address does not look like an Internet one. Use it anyway?'
8328 If you or somebody else will be maintaining perl at your site, please
8329 fill in the correct e-mail address here so that they may be contacted
8330 if necessary. Currently, the "perlbug" program included with perl
8331 will send mail to this address in addition to perlbug@perl.org. You may
8332 enter "none" for no administrator.
8335 case "$perladmin" in
8336 '') dflt="$cf_email";;
8337 *) dflt="$perladmin";;
8339 rp='Perl administrator e-mail address'
8343 : determine whether to only install version-specific parts.
8346 Do you want to install only the version-specific parts of the perl
8347 distribution? Usually you do *not* want to do this.
8349 case "$versiononly" in
8350 "$define"|[Yy]*|true) dflt='y' ;;
8353 rp="Do you want to install only the version-specific parts of perl?"
8356 [yY]*) val="$define";;
8362 case "$versiononly" in
8363 "$define") inc_version_list=''
8364 inc_version_list_init=0
8368 : figure out how to guarantee perl startup
8369 case "$startperl" in
8371 case "$sharpbang" in
8375 I can use the #! construct to start perl on your system. This will
8376 make startup of perl scripts faster, but may cause problems if you
8377 want to share those scripts and perl is not in a standard place
8378 ($binexp/perl) on all your platforms. The alternative is to force
8379 a shell by starting the script with a single ':' character.
8382 case "$versiononly" in
8383 "$define") dflt="$binexp/perl$version";;
8384 *) dflt="$binexp/perl";;
8386 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8389 none) startperl=": # use perl";;
8390 *) startperl="#!$ans"
8391 if $test 30 -lt `echo "$ans" | wc -c`; then
8394 WARNING: Some systems limit the #! command to 32 characters.
8395 If you experience difficulty running Perl scripts with #!, try
8396 installing Perl in a directory with a shorter pathname.
8402 *) startperl=": # use perl"
8407 echo "I'll use $startperl to start perl scripts."
8409 : figure best path for perl in scripts
8412 case "$versiononly" in
8413 "$define") perlpath="$binexp/perl$version";;
8414 *) perlpath="$binexp/perl";;
8416 case "$startperl" in
8421 I will use the "eval 'exec'" idiom to start Perl on your system.
8422 I can use the full path of your Perl binary for this purpose, but
8423 doing so may cause problems if you want to share those scripts and
8424 Perl is not always in a standard place ($binexp/perl).
8428 rp="What path shall I use in \"eval 'exec'\"?"
8435 case "$startperl" in
8437 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8440 : determine where public executable scripts go
8441 set scriptdir scriptdir
8443 case "$scriptdir" in
8446 : guess some guesses
8447 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8448 $test -d /usr/share/bin && dflt=/usr/share/bin
8449 $test -d /usr/local/script && dflt=/usr/local/script
8450 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8451 $test -d $prefixexp/script && dflt=$prefixexp/script
8455 *) dflt="$scriptdir"
8460 Some installations have a separate directory just for executable scripts so
8461 that they can mount it across multiple architectures but keep the scripts in
8462 one spot. You might, for example, have a subdirectory of /usr/share for this.
8463 Or you might just lump your scripts in with all your other executables.
8467 rp='Where do you keep publicly executable scripts?'
8469 if $test "X$ansexp" != "X$scriptdirexp"; then
8473 scriptdirexp="$ansexp"
8474 : Change installation prefix, if necessary.
8475 if $test X"$prefix" != X"$installprefix"; then
8476 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8478 installscript="$scriptdirexp"
8481 : determine where add-on public executables go
8483 '') dflt=$siteprefix/bin ;;
8487 rp='Pathname where the add-on public executables should be installed?'
8490 sitebinexp="$ansexp"
8491 : Change installation prefix, if necessary.
8492 if $test X"$prefix" != X"$installprefix"; then
8493 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8495 installsitebin="$sitebinexp"
8498 : define an is-a-typedef? function
8499 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8501 "") inclist="sys/types.h";;
8503 eval "varval=\$$var";
8507 for inc in $inclist; do
8508 echo "#include <$inc>" >>temp.c;
8510 echo "#ifdef $type" >> temp.c;
8511 echo "printf(\"We have $type\");" >> temp.c;
8512 echo "#endif" >> temp.c;
8513 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8514 if $contains $type temp.E >/dev/null 2>&1; then
8520 *) eval "$var=\$varval";;
8523 : define an is-a-typedef? function that prompts if the type is not available.
8524 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8526 "") inclist="sys/types.h";;
8528 eval "varval=\$$var";
8532 for inc in $inclist; do
8533 echo "#include <$inc>" >>temp.c;
8535 echo "#ifdef $type" >> temp.c;
8536 echo "printf(\"We have $type\");" >> temp.c;
8537 echo "#endif" >> temp.c;
8538 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8540 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8541 if $contains $type temp.E >/dev/null 2>&1; then
8542 echo "$type found." >&4;
8545 echo "$type NOT found." >&4;
8551 *) eval "$var=\$varval";;
8554 : see what type lseek is declared as in the kernel
8555 rp="What is the type used for lseek's offset on this system?"
8556 set off_t lseektype long stdio.h sys/types.h
8560 echo "Checking to see how big your file offsets are..." >&4
8562 #include <sys/types.h>
8566 printf("%d\n", (int)sizeof($lseektype));
8571 if eval $compile_ok; then
8572 lseeksize=`$run ./try`
8573 echo "Your file offsets are $lseeksize bytes long."
8577 echo "(I can't seem to compile the test program. Guessing...)"
8578 rp="What is the size of your file offsets (in bytes)?"
8584 : see what type file positions are declared as in the library
8585 rp="What is the type for file position used by fsetpos()?"
8586 set fpos_t fpostype long stdio.h sys/types.h
8591 *_t) zzz="$fpostype" ;;
8594 echo "Checking the size of $zzz..." >&4
8596 #include <sys/types.h>
8599 printf("%d\n", (int)sizeof($fpostype));
8604 if eval $compile_ok; then
8608 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8611 echo "Your $zzz is $fpossize bytes long."
8617 echo "(I can't compile the test program. Guessing...)" >&4
8618 rp="What is the size of your file positions (in bytes)?"
8625 # Backward compatibility (uselfs is deprecated).
8627 "$define"|true|[yY]*)
8630 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8632 uselargefiles="$define"
8636 case "$lseeksize:$fpossize" in
8639 You can have files larger than 2 gigabytes.
8642 *) case "$uselargefiles" in
8643 "$undef"|false|[nN]*) dflt='n' ;;
8648 Perl can be built to understand large files (files larger than 2 gigabytes)
8649 on some systems. To do so, Configure can be run with -Duselargefiles.
8651 If this doesn't make any sense to you, just accept the default '$dflt'.
8653 rp='Try to understand large files, if available?'
8656 y|Y) val="$define" ;;
8663 case "$uselargefiles" in
8665 : Look for a hint-file generated 'call-back-unit'. If the
8666 : user has specified that a large files perl is to be built,
8667 : we may need to set or change some other defaults.
8668 if $test -f uselargefiles.cbu; then
8669 echo "Your platform has some specific hints for large file builds, using them..."
8670 . ./uselargefiles.cbu
8672 echo "Rechecking to see how big your file offsets are..." >&4
8674 #include <sys/types.h>
8678 printf("%d\n", (int)sizeof($lseektype));
8683 if eval $compile_ok; then
8684 lseeksize=`$run ./try`
8685 $echo "Your file offsets are now $lseeksize bytes long."
8689 echo "(I can't seem to compile the test program. Guessing...)"
8690 rp="What is the size of your file offsets (in bytes)?"
8695 *_t) zzz="$fpostype" ;;
8698 $echo $n "Rechecking the size of $zzz...$c" >&4
8700 #include <sys/types.h>
8703 printf("%d\n", (int)sizeof($fpostype));
8708 if eval $compile_ok; then
8713 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8716 echo " $fpossize bytes." >&4
8722 echo "(I can't compile the test program. Guessing...)" >&4
8723 rp="What is the size of your file positions (in bytes)?"
8732 case "$vendorprefix" in
8733 '') d_vendorbin="$undef"
8737 *) d_vendorbin="$define"
8738 : determine where vendor-supplied executables go.
8739 case "$vendorbin" in
8740 '') dflt=$vendorprefix/bin ;;
8741 *) dflt="$vendorbin" ;;
8744 rp='Pathname for the vendor-supplied executables directory?'
8747 vendorbinexp="$ansexp"
8750 : Change installation prefix, if necessary.
8751 if $test X"$prefix" != X"$installprefix"; then
8752 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
8754 installvendorbin="$vendorbinexp"
8757 : see if qgcvt exists
8761 : Check how to convert floats to strings.
8763 if test "X$d_Gconvert" = X; then
8766 echo "Checking for an efficient way to convert floats to strings."
8768 case "$uselongdouble" in
8769 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8771 case "$d_longdbl" in
8772 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8774 case "$d_PRIgldbl" in
8775 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8779 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8780 char *myname = "gconvert";
8783 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8784 char *myname = "gcvt";
8787 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8788 char *myname = "qgcvt";
8789 #define DOUBLETYPE long double
8792 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8794 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8796 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
8799 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8801 char *myname = "sprintf";
8805 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8806 #define DOUBLETYPE long double
8808 #define DOUBLETYPE double
8814 #define I_STDLIB $i_stdlib
8820 checkit(expect, got)
8824 if (strcmp(expect, got)) {
8825 printf("%s oddity: Expected %s, got %s\n",
8826 myname, expect, got);
8836 /* This must be 1st test on (which?) platform */
8837 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8838 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8839 checkit("0.1", buf);
8841 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
8842 checkit("0.01", buf);
8844 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
8845 checkit("0.001", buf);
8847 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
8848 checkit("0.0001", buf);
8850 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
8851 if (strlen(buf) > 5)
8852 checkit("9e-005", buf); /* for Microsoft ?? */
8854 checkit("9e-05", buf);
8856 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8859 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8860 checkit("1.1", buf);
8862 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8863 checkit("1.01", buf);
8865 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8866 checkit("1.001", buf);
8868 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8869 checkit("1.0001", buf);
8871 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8872 checkit("1.00001", buf);
8874 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8875 checkit("1.000001", buf);
8877 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8880 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8883 /* Some Linux gcvt's give 1.e+5 here. */
8884 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8885 checkit("100000", buf);
8887 /* Some Linux gcvt's give -1.e+5 here. */
8888 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8889 checkit("-100000", buf);
8891 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8892 checkit("123.456", buf);
8894 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
8895 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
8896 /* 34 should be enough to scare even long double
8897 * places into using the e notation. */
8898 if (strlen(buf) > 5)
8899 checkit("1e+034", buf); /* for Microsoft */
8901 checkit("1e+34", buf);
8903 /* For Perl, if you add additional tests here, also add them to
8904 * t/base/num.t for benefit of platforms not using Configure or
8905 * overriding d_Gconvert */
8910 : first add preferred functions to our list
8912 for xxx_convert in $gconvert_preference; do
8913 case $xxx_convert in
8914 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
8915 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
8918 : then add any others
8919 for xxx_convert in gconvert gcvt sprintf; do
8922 *) xxx_list="$xxx_list $xxx_convert" ;;
8926 case "$d_longdbl$uselongdouble" in
8928 : again, add prefered functions to our list first
8930 for xxx_convert in $gconvert_ld_preference; do
8931 case $xxx_convert in
8932 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
8933 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
8936 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
8937 for xxx_convert in qgcvt sprintf $xxx_list; do
8938 case "$xxx_ld_list" in
8939 $xxx_convert*|*" $xxx_convert"*) ;;
8940 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
8943 : if sprintf cannot do long doubles, move it to the end
8944 if test "$d_PRIgldbl" != "$define"; then
8945 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
8947 : if no qgcvt, remove it
8948 if test "$d_qgcvt" != "$define"; then
8949 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
8952 xxx_list="$xxx_ld_list"
8956 for xxx_convert in $xxx_list; do
8957 echo "Trying $xxx_convert..."
8959 set try -DTRY_$xxx_convert
8960 if eval $compile; then
8961 echo "$xxx_convert() found." >&4
8963 echo "I'll use $xxx_convert to convert floats into a string." >&4
8966 echo "...But $xxx_convert didn't work as I expected."
8970 echo "$xxx_convert NOT found." >&4
8974 if test X$xxx_convert = X; then
8975 echo "*** WHOA THERE!!! ***" >&4
8976 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
8980 case "$xxx_convert" in
8981 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8982 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8983 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8984 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8985 "$define$define$define")
8986 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8987 "$define$define$undef")
8988 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
8989 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8996 : see if _fwalk exists
9000 : Initialize h_fcntl
9003 : Initialize h_sysfile
9006 : access call always available on UNIX
9010 : locate the flags for 'access()'
9014 $cat >access.c <<'EOCP'
9015 #include <sys/types.h>
9020 #include <sys/file.h>
9029 : check sys/file.h first, no particular reason here
9030 if $test `./findhdr sys/file.h` && \
9031 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9033 echo "<sys/file.h> defines the *_OK access constants." >&4
9034 elif $test `./findhdr fcntl.h` && \
9035 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9037 echo "<fcntl.h> defines the *_OK access constants." >&4
9038 elif $test `./findhdr unistd.h` && \
9039 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9040 echo "<unistd.h> defines the *_OK access constants." >&4
9042 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9048 : see if accessx exists
9049 set accessx d_accessx
9052 : see if alarm exists
9056 : see if POSIX threads are available
9057 set pthread.h i_pthread
9060 : define a fucntion to check prototypes
9061 $cat > protochk <<EOSH
9064 optimize="$optimize"
9066 prototype="$prototype"
9069 usethreads=$usethreads
9070 i_pthread=$i_pthread
9071 pthread_h_first=$pthread_h_first
9074 $cat >> protochk <<'EOSH'
9079 while test $# -ge 2; do
9081 $define) echo "#include <$2>" >> try.c ;;
9082 literal) echo "$2" >> try.c ;;
9084 # Extra magic for the benefit of systems that need pthread.h
9085 # to be included early to correctly detect threadsafe functions.
9086 # Such functions must guarantee themselves, though, that the usethreads
9087 # and i_pthread have been defined, before calling protochk.
9088 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9089 echo "#include <pthread.h>" >> try.c
9094 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9095 cat >> try.c <<'EOCP'
9096 #ifdef CAN_PROTOTYPE
9097 #define _(args) args
9102 echo "$foo" >> try.c
9103 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9104 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9112 hasproto='varname=$1; func=$2; shift; shift;
9113 while $test $# -ge 2; do
9115 $define) echo "#include <$2>";;
9119 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9120 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9121 echo "$func() prototype found.";
9124 echo "$func() prototype NOT found.";
9129 $rm -f try.c tryout.c'
9131 : see if sys/types.h has to be included
9132 set sys/types.h i_systypes
9135 : see if sys/select.h has to be included
9136 set sys/select.h i_sysselct
9139 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9140 while $test $# -ge 2; do
9142 $define) echo "#include <$2>";;
9146 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9148 if eval $compile; then
9157 : see if we should include time.h, sys/time.h, or both
9159 if test "X$timeincl" = X; then
9160 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9161 $echo $n "I'm now running the test program...$c"
9162 $cat >try.c <<'EOCP'
9163 #include <sys/types.h>
9168 #ifdef SYSTIMEKERNEL
9171 #include <sys/time.h>
9174 #include <sys/select.h>
9183 struct timezone tzp;
9185 if (foo.tm_sec == foo.tm_sec)
9188 if (bar.tv_sec == bar.tv_sec)
9195 for s_timezone in '-DS_TIMEZONE' ''; do
9197 for s_timeval in '-DS_TIMEVAL' ''; do
9198 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9199 for i_time in '' '-DI_TIME'; do
9200 for i_systime in '-DI_SYSTIME' ''; do
9203 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9204 if eval $compile; then
9205 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9209 $echo $n "Succeeded with $flags$c"
9221 *SYSTIMEKERNEL*) i_systimek="$define"
9222 timeincl=`./findhdr sys/time.h`
9223 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9224 *) i_systimek="$undef";;
9227 *I_TIME*) i_time="$define"
9228 timeincl=`./findhdr time.h`" $timeincl"
9229 echo "We'll include <time.h>." >&4;;
9230 *) i_time="$undef";;
9233 *I_SYSTIME*) i_systime="$define"
9234 timeincl=`./findhdr sys/time.h`" $timeincl"
9235 echo "We'll include <sys/time.h>." >&4;;
9236 *) i_systime="$undef";;
9240 : see if struct tm knows about tm_zone
9241 case "$i_systime$i_time" in
9244 echo "Checking to see if your struct tm has tm_zone field..." >&4
9245 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9253 case "$d_tm_tm_zone" in
9254 "$define") echo "Yes, it does." ;;
9255 *) echo "No, it doesn't." ;;
9257 : see if struct tm knows about tm_gmtoff
9258 case "$i_systime$i_time" in
9261 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9262 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9270 case "$d_tm_tm_gmtoff" in
9271 "$define") echo "Yes, it does." ;;
9272 *) echo "No, it doesn't." ;;
9275 : see if asctime_r exists
9276 set asctime_r d_asctime_r
9278 case "$d_asctime_r" in
9280 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9281 case "$d_asctime_r_proto:$usethreads" in
9282 ":define") d_asctime_r_proto=define
9283 set d_asctime_r_proto asctime_r $hdrs
9287 case "$d_asctime_r_proto" in
9289 case "$asctime_r_proto" in
9290 ''|0) try='char* asctime_r(const struct tm*, char*);'
9291 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9293 case "$asctime_r_proto" in
9294 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9295 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9297 case "$asctime_r_proto" in
9298 ''|0) try='int asctime_r(const struct tm*, char*);'
9299 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9301 case "$asctime_r_proto" in
9302 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9303 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9305 case "$asctime_r_proto" in
9306 ''|0) d_asctime_r=undef
9308 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9309 * ) case "$asctime_r_proto" in
9310 REENTRANT_PROTO*) ;;
9311 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9313 echo "Prototype: $try" ;;
9316 *) case "$usethreads" in
9317 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9324 *) asctime_r_proto=0
9328 : see if atolf exists
9332 : see if atoll exists
9336 : Look for GNU-cc style attribute checking
9338 echo "Checking whether your compiler can handle __attribute__ ..." >&4
9339 $cat >attrib.c <<'EOCP'
9341 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
9343 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9344 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9345 echo "Your C compiler doesn't fully support __attribute__."
9348 echo "Your C compiler supports __attribute__."
9352 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9359 : see if bcmp exists
9363 : see if bcopy exists
9367 : see if this is a unistd.h system
9368 set unistd.h i_unistd
9371 : see if getpgrp exists
9372 set getpgrp d_getpgrp
9375 case "$d_getpgrp" in
9378 echo "Checking to see which flavor of getpgrp is in use..."
9381 #include <sys/types.h>
9383 # include <unistd.h>
9387 if (getuid() == 0) {
9388 printf("(I see you are running Configure as super-user...)\n");
9392 if (getpgrp(1) == 0)
9401 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9402 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
9404 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9405 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
9408 echo "I can't seem to compile and run the test program."
9410 xxx="a USG one, i.e. you use getpgrp()."
9412 # SVR4 systems can appear rather BSD-ish.
9415 xxx="a BSD one, i.e. you use getpgrp(pid)."
9419 xxx="probably a USG one, i.e. you use getpgrp()."
9424 echo "Assuming your getpgrp is $xxx" >&4
9433 : see if setpgrp exists
9434 set setpgrp d_setpgrp
9437 case "$d_setpgrp" in
9440 echo "Checking to see which flavor of setpgrp is in use..."
9443 #include <sys/types.h>
9445 # include <unistd.h>
9449 if (getuid() == 0) {
9450 printf("(I see you are running Configure as super-user...)\n");
9454 if (-1 == setpgrp(1, 1))
9457 if (setpgrp() != -1)
9463 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9464 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
9466 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9467 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
9470 echo "(I can't seem to compile and run the test program.)"
9472 xxx="a USG one, i.e. you use setpgrp()."
9474 # SVR4 systems can appear rather BSD-ish.
9477 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
9481 xxx="probably a USG one, i.e. you use setpgrp()."
9486 echo "Assuming your setpgrp is $xxx" >&4
9494 : see if bzero exists
9498 : see if signal is declared as pointer to function returning int or void
9500 xxx=`./findhdr signal.h`
9501 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
9502 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9503 echo "You have int (*signal())() instead of void." >&4
9505 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9506 echo "You have void (*signal())()." >&4
9508 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
9509 echo "You have int (*signal())() instead of void." >&4
9511 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
9512 echo "You have void (*signal())()." >&4
9515 case "$d_voidsig" in
9517 echo "I can't determine whether signal handler returns void or int..." >&4
9519 rp="What type does your signal handler return?"
9526 echo "As you already told me, signal handler returns void." >&4
9529 *) echo "As you already told me, signal handler returns int." >&4
9536 case "$d_voidsig" in
9537 "$define") signal_t="void";;
9542 : check for ability to cast large floats to 32-bit ints.
9544 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
9545 if $test "$intsize" -ge 4; then
9552 #include <sys/types.h>
9554 $signal_t blech(s) int s; { exit(3); }
9561 signal(SIGFPE, blech);
9563 /* Don't let compiler optimize the test away. Store the number
9564 in a writable string for gcc to pass to sscanf under HP/UX.
9566 sprintf(str, "2147483647");
9567 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
9571 /* x86 processors will probably give 0x8000 0000, which is a
9572 sign change. We don't want that. We want to mimic SPARC
9573 behavior here, which is to preserve the sign and give
9576 if (i32 != ($xxx) f)
9582 if eval $compile_ok; then
9586 echo "(I can't seem to compile the test program--assuming it can't)"
9594 echo "Nope, it can't."
9601 : check for ability to cast negative floats to unsigned
9603 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
9606 #include <sys/types.h>
9608 $signal_t blech(s) int s; { exit(7); }
9609 $signal_t blech_in_list(s) int s; { exit(4); }
9610 unsigned long dummy_long(p) unsigned long p; { return p; }
9611 unsigned int dummy_int(p) unsigned int p; { return p; }
9612 unsigned short dummy_short(p) unsigned short p; { return p; }
9616 unsigned long along;
9618 unsigned short ashort;
9622 /* Frustrate gcc-2.7.2's optimizer which failed this test with
9623 a direct f = -123. assignment. gcc-2.8.0 reportedly
9624 optimized the whole file away
9626 /* Store the number in a writable string for gcc to pass to
9629 sprintf(str, "-123");
9630 sscanf(str, "%lf", &f); /* f = -123.; */
9632 signal(SIGFPE, blech);
9633 along = (unsigned long)f;
9634 aint = (unsigned int)f;
9635 ashort = (unsigned short)f;
9636 if (along != (unsigned long)-123)
9638 if (aint != (unsigned int)-123)
9640 if (ashort != (unsigned short)-123)
9642 sprintf(str, "1073741824.");
9643 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
9646 along = (unsigned long)f;
9647 if (along != 0x80000000)
9651 along = (unsigned long)f;
9652 if (along != 0x7fffffff)
9656 along = (unsigned long)f;
9657 if (along != 0x80000001)
9661 signal(SIGFPE, blech_in_list);
9662 sprintf(str, "123.");
9663 sscanf(str, "%lf", &f); /* f = 123.; */
9664 along = dummy_long((unsigned long)f);
9665 aint = dummy_int((unsigned int)f);
9666 ashort = dummy_short((unsigned short)f);
9667 if (along != (unsigned long)123)
9669 if (aint != (unsigned int)123)
9671 if (ashort != (unsigned short)123)
9678 if eval $compile_ok; then
9682 echo "(I can't seem to compile the test program--assuming it can't)"
9685 case "$castflags" in
9690 echo "Nope, it can't."
9697 : see if vprintf exists
9699 if set vprintf val -f d_vprintf; eval $csym; $val; then
9700 echo 'vprintf() found.' >&4
9703 #include <varargs.h>
9705 int main() { xxx("foo"); }
9714 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
9718 if eval $compile && $run ./try; then
9719 echo "Your vsprintf() returns (int)." >&4
9722 echo "Your vsprintf() returns (char*)." >&4
9726 echo 'vprintf() NOT found.' >&4
9737 : see if chown exists
9741 : see if chroot exists
9745 : see if chsize exists
9749 : see if class exists
9753 hasstruct='varname=$1; struct=$2; shift; shift;
9754 while $test $# -ge 2; do
9756 $define) echo "#include <$2>";;
9760 echo "int main () { struct $struct foo; }" >> try.c;
9762 if eval $compile; then
9773 : see whether socket exists
9775 $echo $n "Hmm... $c" >&4
9776 if set socket val -f d_socket; eval $csym; $val; then
9777 echo "Looks like you have Berkeley networking support." >&4
9779 if set setsockopt val -f; eval $csym; $val; then
9782 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9786 if $contains socklib libc.list >/dev/null 2>&1; then
9787 echo "Looks like you have Berkeley networking support." >&4
9789 : we will have to assume that it supports the 4.2 BSD interface
9792 echo "You don't have Berkeley networking in libc$_a..." >&4
9793 if test "X$d_socket" = "X$define"; then
9794 echo "...but you seem to believe that you have sockets." >&4
9796 for net in net socket
9798 if test -f /usr/lib/lib$net$_a; then
9799 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9800 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9801 if $contains socket libc.list >/dev/null 2>&1; then
9806 echo "...but the Wollongong group seems to have hacked it in." >&4
9807 sockethdr="-I/usr/netinclude"
9810 echo "Found Berkeley sockets interface in lib$net." >&4
9811 if $contains setsockopt libc.list >/dev/null 2>&1; then
9814 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9821 if test "X$d_socket" != "X$define"; then
9822 echo "or anywhere else I see." >&4
9830 : see if socketpair exists
9831 set socketpair d_sockpair
9836 echo "Checking the availability of certain socket constants..." >&4
9837 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9838 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9840 #include <sys/types.h>
9841 #include <sys/socket.h>
9847 set try; if eval $compile; then
9850 set d_${enum}; eval $setvar
9854 : see if this is a sys/uio.h system
9855 set sys/uio.h i_sysuio
9860 echo "Checking to see if your system supports struct cmsghdr..." >&4
9861 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
9863 case "$d_cmsghdr_s" in
9864 "$define") echo "Yes, it does." ;;
9865 *) echo "No, it doesn't." ;;
9869 : check for const keyword
9871 echo 'Checking to see if your C compiler knows about "const"...' >&4
9872 $cat >const.c <<'EOCP'
9873 typedef struct spug { int drokk; } spug;
9880 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
9882 echo "Yup, it does."
9885 echo "Nope, it doesn't."
9890 : see if crypt exists
9895 $define) cryptlib='' ;;
9896 *) if set crypt val -f d_crypt; eval $csym; $val; then
9897 echo 'crypt() found.' >&4
9901 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
9902 if $test -z "$cryptlib"; then
9903 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
9907 if $test -z "$cryptlib"; then
9908 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
9912 if $test -z "$cryptlib"; then
9913 cryptlib=`./loc libcrypt$_a "" $libpth`
9917 if $test -z "$cryptlib"; then
9918 echo 'crypt() NOT found.' >&4
9929 : see if this is a crypt.h system
9933 : see if crypt_r exists
9934 set crypt_r d_crypt_r
9936 case "$d_crypt_r" in
9938 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
9939 case "$d_crypt_r_proto:$usethreads" in
9940 ":define") d_crypt_r_proto=define
9941 set d_crypt_r_proto crypt_r $hdrs
9945 case "$d_crypt_r_proto" in
9947 case "$crypt_r_proto" in
9948 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
9949 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
9951 case "$crypt_r_proto" in
9952 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
9953 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
9955 case "$crypt_r_proto" in
9956 ''|0) d_crypt_r=undef
9958 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
9959 * ) case "$crypt_r_proto" in
9960 REENTRANT_PROTO*) ;;
9961 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
9963 echo "Prototype: $try" ;;
9966 *) case "$usethreads" in
9967 define) echo "crypt_r has no prototype, not using it." >&4 ;;
9978 : get csh whereabouts
9980 'csh') val="$undef" ;;
9985 : Respect a hint or command line value for full_csh.
9987 '') full_csh=$csh ;;
9990 : see if ctermid_r exists
9991 set ctermid_r d_ctermid_r
9993 case "$d_ctermid_r" in
9995 hdrs="$i_systypes sys/types.h define stdio.h "
9996 case "$d_ctermid_r_proto:$usethreads" in
9997 ":define") d_ctermid_r_proto=define
9998 set d_ctermid_r_proto ctermid_r $hdrs
10002 case "$d_ctermid_r_proto" in
10004 case "$ctermid_r_proto" in
10005 ''|0) try='char* ctermid_r(char*);'
10006 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10008 case "$ctermid_r_proto" in
10009 ''|0) d_ctermid_r=undef
10011 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10012 * ) case "$ctermid_r_proto" in
10013 REENTRANT_PROTO*) ;;
10014 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10016 echo "Prototype: $try" ;;
10019 *) case "$usethreads" in
10020 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10027 *) ctermid_r_proto=0
10031 : see if ctime_r exists
10032 set ctime_r d_ctime_r
10034 case "$d_ctime_r" in
10036 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10037 case "$d_ctime_r_proto:$usethreads" in
10038 ":define") d_ctime_r_proto=define
10039 set d_ctime_r_proto ctime_r $hdrs
10043 case "$d_ctime_r_proto" in
10045 case "$ctime_r_proto" in
10046 ''|0) try='char* ctime_r(const time_t*, char*);'
10047 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10049 case "$ctime_r_proto" in
10050 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10051 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10053 case "$ctime_r_proto" in
10054 ''|0) try='int ctime_r(const time_t*, char*);'
10055 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10057 case "$ctime_r_proto" in
10058 ''|0) try='int ctime_r(const time_t*, char*, int);'
10059 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10061 case "$ctime_r_proto" in
10062 ''|0) d_ctime_r=undef
10064 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10065 * ) case "$ctime_r_proto" in
10066 REENTRANT_PROTO*) ;;
10067 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10069 echo "Prototype: $try" ;;
10072 *) case "$usethreads" in
10073 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10084 : see if cuserid exists
10085 set cuserid d_cuserid
10088 : see if this is a limits.h system
10089 set limits.h i_limits
10092 : see if this is a float.h system
10093 set float.h i_float
10096 : See if number of significant digits in a double precision number is known
10098 $cat >dbl_dig.c <<EOM
10099 #$i_limits I_LIMITS
10102 #include <limits.h>
10108 printf("Contains DBL_DIG");
10111 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10112 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10113 echo "DBL_DIG found." >&4
10116 echo "DBL_DIG NOT found." >&4
10123 : see if dbm.h is available
10124 : see if dbmclose exists
10125 set dbmclose d_dbmclose
10128 case "$d_dbmclose" in
10138 *) set rpcsvc/dbm.h i_rpcsvcdbm
10143 *) echo "We won't be including <dbm.h>"
10153 : see if prototype for dbminit is available
10155 set d_dbminitproto dbminit $i_dbm dbm.h
10158 : see if difftime exists
10159 set difftime d_difftime
10162 : see if this is a dirent system
10164 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10166 echo "<dirent.h> found." >&4
10169 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10170 echo "<sys/dir.h> found." >&4
10173 xinc=`./findhdr sys/ndir.h`
10175 echo "<dirent.h> NOT found." >&4
10180 : Look for type of directory structure.
10182 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10184 case "$direntrytype" in
10186 case "$i_dirent" in
10187 $define) guess1='struct dirent' ;;
10188 *) guess1='struct direct' ;;
10191 *) guess1="$direntrytype"
10196 'struct dirent') guess2='struct direct' ;;
10197 *) guess2='struct dirent' ;;
10200 if $contains "$guess1" try.c >/dev/null 2>&1; then
10201 direntrytype="$guess1"
10202 echo "Your directory entries are $direntrytype." >&4
10203 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10204 direntrytype="$guess2"
10205 echo "Your directory entries seem to be $direntrytype." >&4
10207 echo "I don't recognize your system's directory entries." >&4
10208 rp="What type is used for directory entries on this system?"
10211 direntrytype="$ans"
10216 : see if the directory entry stores field length
10218 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10219 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10220 echo "Good, your directory entry keeps length information in d_namlen." >&4
10223 echo "Your directory entry does not know about the d_namlen field." >&4
10230 : see if this is an sysdir system
10231 set sys/dir.h i_sysdir
10234 : see if this is an sysndir system
10235 set sys/ndir.h i_sysndir
10240 $cat >dirfd.c <<EOM
10242 #$i_dirent I_DIRENT /**/
10243 #$i_sysdir I_SYS_DIR /**/
10244 #$i_sysndir I_SYS_NDIR /**/
10245 #$i_systypes I_SYS_TYPES /**/
10246 #if defined(I_SYS_TYPES)
10247 #include <sys/types.h>
10249 #if defined(I_DIRENT)
10250 #include <dirent.h>
10251 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10252 #include <sys/dir.h>
10256 #include <sys/ndir.h>
10260 #include <ndir.h> /* may be wrong in the future */
10262 #include <sys/dir.h>
10268 DIR *dirp = opendir(".");
10269 if (dirfd(dirp) >= 0)
10276 if eval $compile; then
10280 $define) echo "dirfd() found." >&4 ;;
10281 *) echo "dirfd() NOT found." >&4 ;;
10287 : see if dlerror exists
10290 set dlerror d_dlerror
10294 : see if dlfcn is available
10295 set dlfcn.h i_dlfcn
10302 On a few systems, the dynamically loaded modules that perl generates and uses
10303 will need a different extension than shared libs. The default will probably
10309 *) dflt="$dlext" ;;
10311 rp='What is the extension of dynamically loaded modules'
10320 : Check if dlsym need a leading underscore
10326 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
10327 $cat >dyna.c <<'EOM'
10336 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
10338 #include <sys/types.h>
10343 extern int fred() ;
10352 int mode = RTLD_LAZY ;
10354 handle = dlopen("./dyna.$dlext", mode) ;
10355 if (handle == NULL) {
10360 symbol = dlsym(handle, "fred") ;
10361 if (symbol == NULL) {
10362 /* try putting a leading underscore */
10363 symbol = dlsym(handle, "_fred") ;
10364 if (symbol == NULL) {
10377 : Call the object file tmp-dyna.o in case dlext=o.
10378 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
10379 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
10380 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
10381 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
10384 1) echo "Test program failed using dlopen." >&4
10385 echo "Perhaps you should not use dynamic loading." >&4;;
10386 2) echo "Test program failed using dlsym." >&4
10387 echo "Perhaps you should not use dynamic loading." >&4;;
10388 3) echo "dlsym needs a leading underscore" >&4
10390 4) echo "dlsym doesn't need a leading underscore." >&4;;
10393 echo "I can't compile and run the test program." >&4
10394 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
10399 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
10404 : see if drand48_r exists
10405 set drand48_r d_drand48_r
10407 case "$d_drand48_r" in
10409 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
10410 case "$d_drand48_r_proto:$usethreads" in
10411 ":define") d_drand48_r_proto=define
10412 set d_drand48_r_proto drand48_r $hdrs
10416 case "$d_drand48_r_proto" in
10418 case "$drand48_r_proto" in
10419 ''|0) try='int drand48_r(struct drand48_data*, double*);'
10420 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
10422 case "$drand48_r_proto" in
10423 ''|0) d_drand48_r=undef
10425 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
10426 * ) case "$drand48_r_proto" in
10427 REENTRANT_PROTO*) ;;
10428 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
10430 echo "Prototype: $try" ;;
10433 *) case "$usethreads" in
10434 define) echo "drand48_r has no prototype, not using it." >&4 ;;
10441 *) drand48_r_proto=0
10445 : see if prototype for drand48 is available
10447 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
10450 : see if dup2 exists
10454 : see if eaccess exists
10455 set eaccess d_eaccess
10458 : see if endgrent exists
10459 set endgrent d_endgrent
10462 : see if this is an grp system
10468 xxx=`./findhdr grp.h`
10469 $cppstdin $cppflags $cppminus < $xxx >$$.h
10471 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10483 set d_grpasswd; eval $setvar
10487 : see if endgrent_r exists
10488 set endgrent_r d_endgrent_r
10490 case "$d_endgrent_r" in
10492 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
10493 case "$d_endgrent_r_proto:$usethreads" in
10494 ":define") d_endgrent_r_proto=define
10495 set d_endgrent_r_proto endgrent_r $hdrs
10499 case "$d_endgrent_r_proto" in
10501 case "$endgrent_r_proto" in
10502 ''|0) try='int endgrent_r(FILE**);'
10503 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
10505 case "$endgrent_r_proto" in
10506 ''|0) try='void endgrent_r(FILE**);'
10507 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
10509 case "$endgrent_r_proto" in
10510 ''|0) d_endgrent_r=undef
10512 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
10513 * ) case "$endgrent_r_proto" in
10514 REENTRANT_PROTO*) ;;
10515 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
10517 echo "Prototype: $try" ;;
10520 *) case "$usethreads" in
10521 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
10528 *) endgrent_r_proto=0
10532 : see if endhostent exists
10533 set endhostent d_endhent
10536 : see if this is a netdb.h system
10537 set netdb.h i_netdb
10540 : see if endhostent_r exists
10541 set endhostent_r d_endhostent_r
10543 case "$d_endhostent_r" in
10545 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10546 case "$d_endhostent_r_proto:$usethreads" in
10547 ":define") d_endhostent_r_proto=define
10548 set d_endhostent_r_proto endhostent_r $hdrs
10552 case "$d_endhostent_r_proto" in
10554 case "$endhostent_r_proto" in
10555 ''|0) try='int endhostent_r(struct hostent_data*);'
10556 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
10558 case "$endhostent_r_proto" in
10559 ''|0) try='void endhostent_r(struct hostent_data*);'
10560 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
10562 case "$endhostent_r_proto" in
10563 ''|0) d_endhostent_r=undef
10564 endhostent_r_proto=0
10565 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
10566 * ) case "$endhostent_r_proto" in
10567 REENTRANT_PROTO*) ;;
10568 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
10570 echo "Prototype: $try" ;;
10573 *) case "$usethreads" in
10574 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
10576 d_endhostent_r=undef
10577 endhostent_r_proto=0
10581 *) endhostent_r_proto=0
10585 : see if endnetent exists
10586 set endnetent d_endnent
10589 : see if endnetent_r exists
10590 set endnetent_r d_endnetent_r
10592 case "$d_endnetent_r" in
10594 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10595 case "$d_endnetent_r_proto:$usethreads" in
10596 ":define") d_endnetent_r_proto=define
10597 set d_endnetent_r_proto endnetent_r $hdrs
10601 case "$d_endnetent_r_proto" in
10603 case "$endnetent_r_proto" in
10604 ''|0) try='int endnetent_r(struct netent_data*);'
10605 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
10607 case "$endnetent_r_proto" in
10608 ''|0) try='void endnetent_r(struct netent_data*);'
10609 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
10611 case "$endnetent_r_proto" in
10612 ''|0) d_endnetent_r=undef
10613 endnetent_r_proto=0
10614 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
10615 * ) case "$endnetent_r_proto" in
10616 REENTRANT_PROTO*) ;;
10617 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
10619 echo "Prototype: $try" ;;
10622 *) case "$usethreads" in
10623 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
10625 d_endnetent_r=undef
10626 endnetent_r_proto=0
10630 *) endnetent_r_proto=0
10634 : see if endprotoent exists
10635 set endprotoent d_endpent
10638 : see if endprotoent_r exists
10639 set endprotoent_r d_endprotoent_r
10641 case "$d_endprotoent_r" in
10643 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10644 case "$d_endprotoent_r_proto:$usethreads" in
10645 ":define") d_endprotoent_r_proto=define
10646 set d_endprotoent_r_proto endprotoent_r $hdrs
10650 case "$d_endprotoent_r_proto" in
10652 case "$endprotoent_r_proto" in
10653 ''|0) try='int endprotoent_r(struct protoent_data*);'
10654 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
10656 case "$endprotoent_r_proto" in
10657 ''|0) try='void endprotoent_r(struct protoent_data*);'
10658 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
10660 case "$endprotoent_r_proto" in
10661 ''|0) d_endprotoent_r=undef
10662 endprotoent_r_proto=0
10663 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
10664 * ) case "$endprotoent_r_proto" in
10665 REENTRANT_PROTO*) ;;
10666 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
10668 echo "Prototype: $try" ;;
10671 *) case "$usethreads" in
10672 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
10674 d_endprotoent_r=undef
10675 endprotoent_r_proto=0
10679 *) endprotoent_r_proto=0
10683 : see if endpwent exists
10684 set endpwent d_endpwent
10687 : see if this is a pwd.h system
10693 xxx=`./findhdr pwd.h`
10694 $cppstdin $cppflags $cppminus < $xxx >$$.h
10696 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10704 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10712 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10720 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10728 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10736 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10744 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10752 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10764 set d_pwquota; eval $setvar
10765 set d_pwage; eval $setvar
10766 set d_pwchange; eval $setvar
10767 set d_pwclass; eval $setvar
10768 set d_pwexpire; eval $setvar
10769 set d_pwcomment; eval $setvar
10770 set d_pwgecos; eval $setvar
10771 set d_pwpasswd; eval $setvar
10775 : see if endpwent_r exists
10776 set endpwent_r d_endpwent_r
10778 case "$d_endpwent_r" in
10780 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
10781 case "$d_endpwent_r_proto:$usethreads" in
10782 ":define") d_endpwent_r_proto=define
10783 set d_endpwent_r_proto endpwent_r $hdrs
10787 case "$d_endpwent_r_proto" in
10789 case "$endpwent_r_proto" in
10790 ''|0) try='int endpwent_r(FILE**);'
10791 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
10793 case "$endpwent_r_proto" in
10794 ''|0) try='void endpwent_r(FILE**);'
10795 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
10797 case "$endpwent_r_proto" in
10798 ''|0) d_endpwent_r=undef
10800 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
10801 * ) case "$endpwent_r_proto" in
10802 REENTRANT_PROTO*) ;;
10803 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
10805 echo "Prototype: $try" ;;
10808 *) case "$usethreads" in
10809 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
10816 *) endpwent_r_proto=0
10820 : see if endservent exists
10821 set endservent d_endsent
10824 : see if endservent_r exists
10825 set endservent_r d_endservent_r
10827 case "$d_endservent_r" in
10829 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10830 case "$d_endservent_r_proto:$usethreads" in
10831 ":define") d_endservent_r_proto=define
10832 set d_endservent_r_proto endservent_r $hdrs
10836 case "$d_endservent_r_proto" in
10838 case "$endservent_r_proto" in
10839 ''|0) try='int endservent_r(struct servent_data*);'
10840 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
10842 case "$endservent_r_proto" in
10843 ''|0) try='void endservent_r(struct servent_data*);'
10844 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
10846 case "$endservent_r_proto" in
10847 ''|0) d_endservent_r=undef
10848 endservent_r_proto=0
10849 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
10850 * ) case "$endservent_r_proto" in
10851 REENTRANT_PROTO*) ;;
10852 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
10854 echo "Prototype: $try" ;;
10857 *) case "$usethreads" in
10858 define) echo "endservent_r has no prototype, not using it." >&4 ;;
10860 d_endservent_r=undef
10861 endservent_r_proto=0
10865 *) endservent_r_proto=0
10869 : Locate the flags for 'open()'
10871 $cat >try.c <<'EOCP'
10872 #include <sys/types.h>
10877 #include <sys/file.h>
10888 : check sys/file.h first to get FREAD on Sun
10889 if $test `./findhdr sys/file.h` && \
10890 set try -DI_SYS_FILE && eval $compile; then
10892 echo "<sys/file.h> defines the O_* constants..." >&4
10893 if $run ./try; then
10894 echo "and you have the 3 argument form of open()." >&4
10897 echo "but not the 3 argument form of open(). Oh, well." >&4
10900 elif $test `./findhdr fcntl.h` && \
10901 set try -DI_FCNTL && eval $compile; then
10903 echo "<fcntl.h> defines the O_* constants..." >&4
10904 if $run ./try; then
10905 echo "and you have the 3 argument form of open()." >&4
10908 echo "but not the 3 argument form of open(). Oh, well." >&4
10913 echo "I can't find the O_* constant definitions! You got problems." >&4
10919 : see which of string.h or strings.h is needed
10921 strings=`./findhdr string.h`
10922 if $test "$strings" && $test -r "$strings"; then
10923 echo "Using <string.h> instead of <strings.h>." >&4
10927 strings=`./findhdr strings.h`
10928 if $test "$strings" && $test -r "$strings"; then
10929 echo "Using <strings.h> instead of <string.h>." >&4
10931 echo "No string header found -- You'll surely have problems." >&4
10936 case "$i_string" in
10937 "$undef") strings=`./findhdr strings.h`;;
10938 *) strings=`./findhdr string.h`;;
10941 : see if this is a sys/file.h system
10946 : do we need to include sys/file.h ?
10950 if $h_sysfile; then
10952 echo "We'll be including <sys/file.h>." >&4
10955 echo "We won't be including <sys/file.h>." >&4
10965 : see if fcntl.h is there
10970 : see if we can include fcntl.h
10976 echo "We'll be including <fcntl.h>." >&4
10979 if $h_sysfile; then
10980 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
10982 echo "We won't be including <fcntl.h>." >&4
10994 : check for non-blocking I/O stuff
10995 case "$h_sysfile" in
10996 true) echo "#include <sys/file.h>" > head.c;;
10999 true) echo "#include <fcntl.h>" > head.c;;
11000 *) echo "#include <sys/fcntl.h>" > head.c;;
11005 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11006 case "$o_nonblock" in
11008 $cat head.c > try.c
11009 $cat >>try.c <<EOCP
11011 #include <stdlib.h>
11018 printf("O_NONBLOCK\n");
11022 printf("O_NDELAY\n");
11026 printf("FNDELAY\n");
11033 if eval $compile_ok; then
11034 o_nonblock=`$run ./try`
11035 case "$o_nonblock" in
11036 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11037 *) echo "Seems like we can use $o_nonblock.";;
11040 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11043 *) echo "Using $hint value $o_nonblock.";;
11045 $rm -f try try.* .out core
11048 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11051 $cat head.c > try.c
11052 $cat >>try.c <<EOCP
11054 #include <sys/types.h>
11055 #include <signal.h>
11057 #include <stdlib.h>
11062 #define MY_O_NONBLOCK $o_nonblock
11063 #ifndef errno /* XXX need better Configure test */
11066 #$i_unistd I_UNISTD
11068 #include <unistd.h>
11070 #$i_string I_STRING
11072 #include <string.h>
11074 #include <strings.h>
11076 $signal_t blech(x) int x; { exit(3); }
11078 $cat >> try.c <<'EOCP'
11086 pipe(pd); /* Down: child -> parent */
11087 pipe(pu); /* Up: parent -> child */
11090 close(pd[1]); /* Parent reads from pd[0] */
11091 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11093 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11098 signal(SIGALRM, blech);
11100 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11102 sprintf(string, "%d\n", ret);
11103 write(2, string, strlen(string));
11106 if (errno == EAGAIN) {
11107 printf("EAGAIN\n");
11112 if (errno == EWOULDBLOCK)
11113 printf("EWOULDBLOCK\n");
11116 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11117 sleep(2); /* Give it time to close our pipe */
11119 ret = read(pd[0], buf, 1); /* Should read EOF */
11121 sprintf(string, "%d\n", ret);
11122 write(4, string, strlen(string));
11126 close(pd[0]); /* We write to pd[1] */
11127 close(pu[1]); /* We read from pu[0] */
11128 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11129 close(pd[1]); /* Pipe pd is now fully closed! */
11130 exit(0); /* Bye bye, thank you for playing! */
11134 if eval $compile_ok; then
11135 echo "$startsh" >mtry
11136 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11138 ./mtry >/dev/null 2>&1
11140 0) eagain=`$cat try.out`;;
11141 1) echo "Could not perform non-blocking setting!";;
11142 2) echo "I did a successful read() for something that was not there!";;
11143 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11144 4) echo "Could not find F_SETFL!";;
11145 *) echo "Something terribly wrong happened during testing.";;
11147 rd_nodata=`$cat try.ret`
11148 echo "A read() system call with no data present returns $rd_nodata."
11149 case "$rd_nodata" in
11152 echo "(That's peculiar, fixing that to be -1.)"
11158 echo "Forcing errno EAGAIN on read() with no data available."
11162 echo "Your read() sets errno to $eagain when no data is available."
11165 status=`$cat try.err`
11167 0) echo "And it correctly returns 0 to signal EOF.";;
11168 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11169 *) echo "However, your read() returns '$status' on EOF??";;
11172 if test "$status" = "$rd_nodata"; then
11173 echo "WARNING: you can't distinguish between EOF and no data!"
11177 echo "I can't compile the test program--assuming errno EAGAIN will do."
11184 echo "Using $hint value $eagain."
11185 echo "Your read() returns $rd_nodata when no data is present."
11186 case "$d_eofnblk" in
11187 "$define") echo "And you can see EOF because read() returns 0.";;
11188 "$undef") echo "But you can't see EOF status from read() returned value.";;
11190 echo "(Assuming you can't see EOF status from read anyway.)"
11196 $rm -f try try.* .out core head.c mtry
11198 : see if fchdir exists
11199 set fchdir d_fchdir
11202 : see if fchmod exists
11203 set fchmod d_fchmod
11206 : see if fchown exists
11207 set fchown d_fchown
11210 : see if this is an fcntl system
11215 : See if fcntl-based locking works.
11217 #include <stdlib.h>
11218 #include <unistd.h>
11220 #include <signal.h>
11221 $signal_t blech(x) int x; { exit(3); }
11223 #if defined(F_SETLK) && defined(F_SETLKW)
11224 struct flock flock;
11226 fd = open("try.c", O_RDONLY);
11227 flock.l_type = F_RDLCK;
11228 flock.l_whence = SEEK_SET;
11229 flock.l_start = flock.l_len = 0;
11230 signal(SIGALRM, blech);
11232 retval = fcntl(fd, F_SETLK, &flock);
11234 (retval < 0 ? exit(2) : exit(0));
11240 echo "Checking if fcntl-based file locking works... "
11244 if eval $compile_ok; then
11245 if $run ./try; then
11246 echo "Yes, it seems to work."
11249 echo "Nope, it didn't work."
11254 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
11255 *** This is (almost) impossible.
11256 *** If your NFS lock daemons are not feeling well, something like
11257 *** this may happen, please investigate. Cannot continue, aborting.
11265 echo "I'm unable to compile the test program, so I'll assume not."
11270 echo "Nope, since you don't even have fcntl()."
11273 set d_fcntl_can_lock
11278 : check for fd_set items
11281 Checking to see how well your C compiler handles fd_set and friends ...
11284 #$i_systime I_SYS_TIME
11285 #$i_sysselct I_SYS_SELECT
11286 #$d_socket HAS_SOCKET
11287 #include <sys/types.h>
11289 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
11292 #include <sys/time.h>
11294 #ifdef I_SYS_SELECT
11295 #include <sys/select.h>
11304 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
11312 if eval $compile; then
11313 d_fds_bits="$define"
11315 echo "Well, your system knows about the normal fd_set typedef..." >&4
11316 if $run ./try; then
11317 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
11318 d_fd_macros="$define"
11321 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
11323 d_fd_macros="$undef"
11327 Hmm, your compiler has some difficulty with fd_set. Checking further...
11330 if eval $compile; then
11331 d_fds_bits="$undef"
11333 echo "Well, your system has some sort of fd_set available..." >&4
11334 if $run ./try; then
11335 echo "and you have the normal fd_set macros." >&4
11336 d_fd_macros="$define"
11339 but not the normal fd_set macros! Gross! More work for me...
11341 d_fd_macros="$undef"
11344 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
11346 d_fds_bits="$undef"
11347 d_fd_macros="$undef"
11352 : see if fgetpos exists
11353 set fgetpos d_fgetpos
11356 : see if finite exists
11357 set finite d_finite
11360 : see if finitel exists
11361 set finitel d_finitel
11364 : see if flock exists
11368 : see if prototype for flock is available
11370 set d_flockproto flock $i_sysfile sys/file.h
11373 : see if fork exists
11377 : see if fp_class exists
11378 set fp_class d_fp_class
11381 : see if pathconf exists
11382 set pathconf d_pathconf
11385 : see if fpathconf exists
11386 set fpathconf d_fpathconf
11389 : see if fpclass exists
11390 set fpclass d_fpclass
11393 : see if fpclassify exists
11394 set fpclassify d_fpclassify
11397 : see if fpclassl exists
11398 set fpclassl d_fpclassl
11402 : check for fpos64_t
11404 echo "Checking to see if you have fpos64_t..." >&4
11407 int main() { fpos64_t x = 7; }
11410 if eval $compile; then
11412 echo "You have fpos64_t."
11415 echo "You do not have fpos64_t."
11416 case "$fpossize" in
11417 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
11424 : see if frexpl exists
11425 set frexpl d_frexpl
11428 : see if this is a sys/param system
11429 set sys/param.h i_sysparam
11432 : see if this is a sys/mount.h system
11433 set sys/mount.h i_sysmount
11438 echo "Checking to see if your system supports struct fs_data..." >&4
11439 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
11441 case "$d_fs_data_s" in
11442 "$define") echo "Yes, it does." ;;
11443 *) echo "No, it doesn't." ;;
11446 : see if fseeko exists
11447 set fseeko d_fseeko
11449 case "$longsize" in
11450 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
11453 : see if fsetpos exists
11454 set fsetpos d_fsetpos
11458 : see if fstatfs exists
11459 set fstatfs d_fstatfs
11463 : see if statvfs exists
11464 set statvfs d_statvfs
11467 : see if fstatvfs exists
11468 set fstatvfs d_fstatvfs
11472 : see if fsync exists
11476 : see if ftello exists
11477 set ftello d_ftello
11479 case "$longsize" in
11480 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
11483 : see if getcwd exists
11484 set getcwd d_getcwd
11487 : see if getespwnam exists
11488 set getespwnam d_getespwnam
11492 : see if getfsstat exists
11493 set getfsstat d_getfsstat
11496 : see if getgrent exists
11497 set getgrent d_getgrent
11500 : see if getgrent_r exists
11501 set getgrent_r d_getgrent_r
11503 case "$d_getgrent_r" in
11505 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11506 case "$d_getgrent_r_proto:$usethreads" in
11507 ":define") d_getgrent_r_proto=define
11508 set d_getgrent_r_proto getgrent_r $hdrs
11512 case "$d_getgrent_r_proto" in
11514 case "$getgrent_r_proto" in
11515 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
11516 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
11518 case "$getgrent_r_proto" in
11519 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
11520 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
11522 case "$getgrent_r_proto" in
11523 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
11524 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
11526 case "$getgrent_r_proto" in
11527 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
11528 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
11530 case "$getgrent_r_proto" in
11531 ''|0) try='int getgrent_r(struct group*, char*, int);'
11532 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
11534 case "$getgrent_r_proto" in
11535 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
11536 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
11538 case "$getgrent_r_proto" in
11539 ''|0) d_getgrent_r=undef
11541 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
11542 * ) case "$getgrent_r_proto" in
11543 REENTRANT_PROTO*) ;;
11544 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
11546 echo "Prototype: $try" ;;
11549 *) case "$usethreads" in
11550 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
11557 *) getgrent_r_proto=0
11561 : see if getgrgid_r exists
11562 set getgrgid_r d_getgrgid_r
11564 case "$d_getgrgid_r" in
11566 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11567 case "$d_getgrgid_r_proto:$usethreads" in
11568 ":define") d_getgrgid_r_proto=define
11569 set d_getgrgid_r_proto getgrgid_r $hdrs
11573 case "$d_getgrgid_r_proto" in
11575 case "$getgrgid_r_proto" in
11576 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
11577 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
11579 case "$getgrgid_r_proto" in
11580 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
11581 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
11583 case "$getgrgid_r_proto" in
11584 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
11585 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
11587 case "$getgrgid_r_proto" in
11588 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
11589 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
11591 case "$getgrgid_r_proto" in
11592 ''|0) d_getgrgid_r=undef
11594 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
11595 * ) case "$getgrgid_r_proto" in
11596 REENTRANT_PROTO*) ;;
11597 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
11599 echo "Prototype: $try" ;;
11602 *) case "$usethreads" in
11603 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
11610 *) getgrgid_r_proto=0
11614 : see if getgrnam_r exists
11615 set getgrnam_r d_getgrnam_r
11617 case "$d_getgrnam_r" in
11619 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11620 case "$d_getgrnam_r_proto:$usethreads" in
11621 ":define") d_getgrnam_r_proto=define
11622 set d_getgrnam_r_proto getgrnam_r $hdrs
11626 case "$d_getgrnam_r_proto" in
11628 case "$getgrnam_r_proto" in
11629 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
11630 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
11632 case "$getgrnam_r_proto" in
11633 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
11634 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
11636 case "$getgrnam_r_proto" in
11637 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
11638 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
11640 case "$getgrnam_r_proto" in
11641 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
11642 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
11644 case "$getgrnam_r_proto" in
11645 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
11646 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
11648 case "$getgrnam_r_proto" in
11649 ''|0) d_getgrnam_r=undef
11651 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
11652 * ) case "$getgrnam_r_proto" in
11653 REENTRANT_PROTO*) ;;
11654 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
11656 echo "Prototype: $try" ;;
11659 *) case "$usethreads" in
11660 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
11667 *) getgrnam_r_proto=0
11671 : see if gethostbyaddr exists
11672 set gethostbyaddr d_gethbyaddr
11675 : see if gethostbyname exists
11676 set gethostbyname d_gethbyname
11679 : see if gethostent exists
11680 set gethostent d_gethent
11683 : see how we will look up host name
11686 if set gethostname val -f d_gethname; eval $csym; $val; then
11687 echo 'gethostname() found.' >&4
11688 d_gethname="$define"
11691 if set uname val -f d_uname; eval $csym; $val; then
11694 uname() was found, but you're running xenix, and older versions of xenix
11695 have a broken uname(). If you don't really know whether your xenix is old
11696 enough to have a broken system call, use the default answer.
11701 "$define") dflt=n;;
11703 rp='Is your uname() broken?'
11706 n*) d_uname="$define"; call=uname;;
11709 echo 'uname() found.' >&4
11716 case "$d_gethname" in
11717 '') d_gethname="$undef";;
11720 '') d_uname="$undef";;
11722 case "$d_uname$d_gethname" in
11727 Every now and then someone has a $call() that lies about the hostname
11728 but can't be fixed for political or economic reasons. If you wish, I can
11729 pretend $call() isn't there and maybe compute hostname at run-time
11730 thanks to the '$phostname' command.
11733 rp="Shall I ignore $call() from now on?"
11736 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
11739 case "$phostname" in
11740 '') aphostname='';;
11741 *) case "$aphostname" in
11743 *) set X $phostname
11747 file=`./loc $file $file $pth`
11748 aphostname=`echo $file $*`
11753 case "$d_uname$d_gethname" in
11756 case "$phostname" in
11758 echo "There will be no way for $package to get your hostname." >&4;;
11760 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
11764 case "$d_phostname" in
11765 '') d_phostname="$undef";;
11768 : see if gethostbyaddr_r exists
11769 set gethostbyaddr_r d_gethostbyaddr_r
11771 case "$d_gethostbyaddr_r" in
11773 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11774 case "$d_gethostbyaddr_r_proto:$usethreads" in
11775 ":define") d_gethostbyaddr_r_proto=define
11776 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
11780 case "$d_gethostbyaddr_r_proto" in
11782 case "$gethostbyaddr_r_proto" in
11783 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
11784 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
11786 case "$gethostbyaddr_r_proto" in
11787 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
11788 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
11790 case "$gethostbyaddr_r_proto" in
11791 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
11792 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
11794 case "$gethostbyaddr_r_proto" in
11795 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
11796 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
11798 case "$gethostbyaddr_r_proto" in
11799 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
11800 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
11802 case "$gethostbyaddr_r_proto" in
11803 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
11804 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
11806 case "$gethostbyaddr_r_proto" in
11807 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
11808 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
11810 case "$gethostbyaddr_r_proto" in
11811 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
11812 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
11814 case "$gethostbyaddr_r_proto" in
11815 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
11816 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
11818 case "$gethostbyaddr_r_proto" in
11819 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
11820 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
11822 case "$gethostbyaddr_r_proto" in
11823 ''|0) d_gethostbyaddr_r=undef
11824 gethostbyaddr_r_proto=0
11825 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
11826 * ) case "$gethostbyaddr_r_proto" in
11827 REENTRANT_PROTO*) ;;
11828 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
11830 echo "Prototype: $try" ;;
11833 *) case "$usethreads" in
11834 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
11836 d_gethostbyaddr_r=undef
11837 gethostbyaddr_r_proto=0
11841 *) gethostbyaddr_r_proto=0
11845 : see if gethostbyname_r exists
11846 set gethostbyname_r d_gethostbyname_r
11848 case "$d_gethostbyname_r" in
11850 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11851 case "$d_gethostbyname_r_proto:$usethreads" in
11852 ":define") d_gethostbyname_r_proto=define
11853 set d_gethostbyname_r_proto gethostbyname_r $hdrs
11857 case "$d_gethostbyname_r_proto" in
11859 case "$gethostbyname_r_proto" in
11860 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
11861 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
11863 case "$gethostbyname_r_proto" in
11864 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
11865 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
11867 case "$gethostbyname_r_proto" in
11868 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
11869 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
11871 case "$gethostbyname_r_proto" in
11872 ''|0) d_gethostbyname_r=undef
11873 gethostbyname_r_proto=0
11874 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
11875 * ) case "$gethostbyname_r_proto" in
11876 REENTRANT_PROTO*) ;;
11877 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
11879 echo "Prototype: $try" ;;
11882 *) case "$usethreads" in
11883 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
11885 d_gethostbyname_r=undef
11886 gethostbyname_r_proto=0
11890 *) gethostbyname_r_proto=0
11894 : see if gethostent_r exists
11895 set gethostent_r d_gethostent_r
11897 case "$d_gethostent_r" in
11899 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11900 case "$d_gethostent_r_proto:$usethreads" in
11901 ":define") d_gethostent_r_proto=define
11902 set d_gethostent_r_proto gethostent_r $hdrs
11906 case "$d_gethostent_r_proto" in
11908 case "$gethostent_r_proto" in
11909 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
11910 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
11912 case "$gethostent_r_proto" in
11913 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
11914 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
11916 case "$gethostent_r_proto" in
11917 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
11918 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
11920 case "$gethostent_r_proto" in
11921 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
11922 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
11924 case "$gethostent_r_proto" in
11925 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
11926 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
11928 case "$gethostent_r_proto" in
11929 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
11930 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
11932 case "$gethostent_r_proto" in
11933 ''|0) d_gethostent_r=undef
11934 gethostent_r_proto=0
11935 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
11936 * ) case "$gethostent_r_proto" in
11937 REENTRANT_PROTO*) ;;
11938 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
11940 echo "Prototype: $try" ;;
11943 *) case "$usethreads" in
11944 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
11946 d_gethostent_r=undef
11947 gethostent_r_proto=0
11951 *) gethostent_r_proto=0
11955 : see if prototypes for various gethostxxx netdb.h functions are available
11957 set d_gethostprotos gethostent $i_netdb netdb.h
11960 : see if getitimer exists
11961 set getitimer d_getitimer
11964 : see if getlogin exists
11965 set getlogin d_getlogin
11968 : see if getlogin_r exists
11969 set getlogin_r d_getlogin_r
11971 case "$d_getlogin_r" in
11973 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
11974 case "$d_getlogin_r_proto:$usethreads" in
11975 ":define") d_getlogin_r_proto=define
11976 set d_getlogin_r_proto getlogin_r $hdrs
11980 case "$d_getlogin_r_proto" in
11982 case "$getlogin_r_proto" in
11983 ''|0) try='int getlogin_r(char*, size_t);'
11984 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
11986 case "$getlogin_r_proto" in
11987 ''|0) try='int getlogin_r(char*, int);'
11988 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
11990 case "$getlogin_r_proto" in
11991 ''|0) try='char* getlogin_r(char*, size_t);'
11992 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
11994 case "$getlogin_r_proto" in
11995 ''|0) try='char* getlogin_r(char*, int);'
11996 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
11998 case "$getlogin_r_proto" in
11999 ''|0) d_getlogin_r=undef
12001 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
12002 * ) case "$getlogin_r_proto" in
12003 REENTRANT_PROTO*) ;;
12004 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
12006 echo "Prototype: $try" ;;
12009 *) case "$usethreads" in
12010 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
12017 *) getlogin_r_proto=0
12021 : see if getmnt exists
12022 set getmnt d_getmnt
12025 : see if getmntent exists
12026 set getmntent d_getmntent
12029 : see if getnetbyaddr exists
12030 set getnetbyaddr d_getnbyaddr
12033 : see if getnetbyname exists
12034 set getnetbyname d_getnbyname
12037 : see if getnetent exists
12038 set getnetent d_getnent
12041 : see if getnetbyaddr_r exists
12042 set getnetbyaddr_r d_getnetbyaddr_r
12044 case "$d_getnetbyaddr_r" in
12046 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12047 case "$d_getnetbyaddr_r_proto:$usethreads" in
12048 ":define") d_getnetbyaddr_r_proto=define
12049 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
12053 case "$d_getnetbyaddr_r_proto" in
12055 case "$getnetbyaddr_r_proto" in
12056 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
12057 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
12059 case "$getnetbyaddr_r_proto" in
12060 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
12061 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
12063 case "$getnetbyaddr_r_proto" in
12064 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
12065 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
12067 case "$getnetbyaddr_r_proto" in
12068 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
12069 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
12071 case "$getnetbyaddr_r_proto" in
12072 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
12073 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
12075 case "$getnetbyaddr_r_proto" in
12076 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
12077 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
12079 case "$getnetbyaddr_r_proto" in
12080 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
12081 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
12083 case "$getnetbyaddr_r_proto" in
12084 ''|0) d_getnetbyaddr_r=undef
12085 getnetbyaddr_r_proto=0
12086 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
12087 * ) case "$getnetbyaddr_r_proto" in
12088 REENTRANT_PROTO*) ;;
12089 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
12091 echo "Prototype: $try" ;;
12094 *) case "$usethreads" in
12095 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
12097 d_getnetbyaddr_r=undef
12098 getnetbyaddr_r_proto=0
12102 *) getnetbyaddr_r_proto=0
12106 : see if getnetbyname_r exists
12107 set getnetbyname_r d_getnetbyname_r
12109 case "$d_getnetbyname_r" in
12111 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12112 case "$d_getnetbyname_r_proto:$usethreads" in
12113 ":define") d_getnetbyname_r_proto=define
12114 set d_getnetbyname_r_proto getnetbyname_r $hdrs
12118 case "$d_getnetbyname_r_proto" in
12120 case "$getnetbyname_r_proto" in
12121 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
12122 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
12124 case "$getnetbyname_r_proto" in
12125 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
12126 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
12128 case "$getnetbyname_r_proto" in
12129 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
12130 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
12132 case "$getnetbyname_r_proto" in
12133 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
12134 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
12136 case "$getnetbyname_r_proto" in
12137 ''|0) d_getnetbyname_r=undef
12138 getnetbyname_r_proto=0
12139 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
12140 * ) case "$getnetbyname_r_proto" in
12141 REENTRANT_PROTO*) ;;
12142 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
12144 echo "Prototype: $try" ;;
12147 *) case "$usethreads" in
12148 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
12150 d_getnetbyname_r=undef
12151 getnetbyname_r_proto=0
12155 *) getnetbyname_r_proto=0
12159 : see if getnetent_r exists
12160 set getnetent_r d_getnetent_r
12162 case "$d_getnetent_r" in
12164 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12165 case "$d_getnetent_r_proto:$usethreads" in
12166 ":define") d_getnetent_r_proto=define
12167 set d_getnetent_r_proto getnetent_r $hdrs
12171 case "$d_getnetent_r_proto" in
12173 case "$getnetent_r_proto" in
12174 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
12175 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
12177 case "$getnetent_r_proto" in
12178 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
12179 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
12181 case "$getnetent_r_proto" in
12182 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
12183 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
12185 case "$getnetent_r_proto" in
12186 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
12187 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
12189 case "$getnetent_r_proto" in
12190 ''|0) try='int getnetent_r(struct netent*, char*, int);'
12191 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
12193 case "$getnetent_r_proto" in
12194 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
12195 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
12197 case "$getnetent_r_proto" in
12198 ''|0) d_getnetent_r=undef
12199 getnetent_r_proto=0
12200 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
12201 * ) case "$getnetent_r_proto" in
12202 REENTRANT_PROTO*) ;;
12203 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
12205 echo "Prototype: $try" ;;
12208 *) case "$usethreads" in
12209 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
12211 d_getnetent_r=undef
12212 getnetent_r_proto=0
12216 *) getnetent_r_proto=0
12220 : see if prototypes for various getnetxxx netdb.h functions are available
12222 set d_getnetprotos getnetent $i_netdb netdb.h
12225 : see if getpagesize exists
12226 set getpagesize d_getpagsz
12230 : see if getprotobyname exists
12231 set getprotobyname d_getpbyname
12234 : see if getprotobynumber exists
12235 set getprotobynumber d_getpbynumber
12238 : see if getprotoent exists
12239 set getprotoent d_getpent
12242 : see if getpgid exists
12243 set getpgid d_getpgid
12246 : see if getpgrp2 exists
12247 set getpgrp2 d_getpgrp2
12250 : see if getppid exists
12251 set getppid d_getppid
12254 : see if getpriority exists
12255 set getpriority d_getprior
12258 : see if getprotobyname_r exists
12259 set getprotobyname_r d_getprotobyname_r
12261 case "$d_getprotobyname_r" in
12263 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12264 case "$d_getprotobyname_r_proto:$usethreads" in
12265 ":define") d_getprotobyname_r_proto=define
12266 set d_getprotobyname_r_proto getprotobyname_r $hdrs
12270 case "$d_getprotobyname_r_proto" in
12272 case "$getprotobyname_r_proto" in
12273 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
12274 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
12276 case "$getprotobyname_r_proto" in
12277 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
12278 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
12280 case "$getprotobyname_r_proto" in
12281 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
12282 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
12284 case "$getprotobyname_r_proto" in
12285 ''|0) d_getprotobyname_r=undef
12286 getprotobyname_r_proto=0
12287 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
12288 * ) case "$getprotobyname_r_proto" in
12289 REENTRANT_PROTO*) ;;
12290 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
12292 echo "Prototype: $try" ;;
12295 *) case "$usethreads" in
12296 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
12298 d_getprotobyname_r=undef
12299 getprotobyname_r_proto=0
12303 *) getprotobyname_r_proto=0
12307 : see if getprotobynumber_r exists
12308 set getprotobynumber_r d_getprotobynumber_r
12310 case "$d_getprotobynumber_r" in
12312 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12313 case "$d_getprotobynumber_r_proto:$usethreads" in
12314 ":define") d_getprotobynumber_r_proto=define
12315 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
12319 case "$d_getprotobynumber_r_proto" in
12321 case "$getprotobynumber_r_proto" in
12322 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
12323 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
12325 case "$getprotobynumber_r_proto" in
12326 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
12327 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
12329 case "$getprotobynumber_r_proto" in
12330 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
12331 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
12333 case "$getprotobynumber_r_proto" in
12334 ''|0) d_getprotobynumber_r=undef
12335 getprotobynumber_r_proto=0
12336 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
12337 * ) case "$getprotobynumber_r_proto" in
12338 REENTRANT_PROTO*) ;;
12339 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
12341 echo "Prototype: $try" ;;
12344 *) case "$usethreads" in
12345 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
12347 d_getprotobynumber_r=undef
12348 getprotobynumber_r_proto=0
12352 *) getprotobynumber_r_proto=0
12356 : see if getprotoent_r exists
12357 set getprotoent_r d_getprotoent_r
12359 case "$d_getprotoent_r" in
12361 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12362 case "$d_getprotoent_r_proto:$usethreads" in
12363 ":define") d_getprotoent_r_proto=define
12364 set d_getprotoent_r_proto getprotoent_r $hdrs
12368 case "$d_getprotoent_r_proto" in
12370 case "$getprotoent_r_proto" in
12371 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
12372 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
12374 case "$getprotoent_r_proto" in
12375 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
12376 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
12378 case "$getprotoent_r_proto" in
12379 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
12380 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
12382 case "$getprotoent_r_proto" in
12383 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
12384 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
12386 case "$getprotoent_r_proto" in
12387 ''|0) d_getprotoent_r=undef
12388 getprotoent_r_proto=0
12389 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
12390 * ) case "$getprotoent_r_proto" in
12391 REENTRANT_PROTO*) ;;
12392 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
12394 echo "Prototype: $try" ;;
12397 *) case "$usethreads" in
12398 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
12400 d_getprotoent_r=undef
12401 getprotoent_r_proto=0
12405 *) getprotoent_r_proto=0
12409 : see if prototypes for various getprotoxxx netdb.h functions are available
12411 set d_getprotoprotos getprotoent $i_netdb netdb.h
12414 : see if getprpwnam exists
12415 set getprpwnam d_getprpwnam
12418 : see if getpwent exists
12419 set getpwent d_getpwent
12422 : see if getpwent_r exists
12423 set getpwent_r d_getpwent_r
12425 case "$d_getpwent_r" in
12427 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12428 case "$d_getpwent_r_proto:$usethreads" in
12429 ":define") d_getpwent_r_proto=define
12430 set d_getpwent_r_proto getpwent_r $hdrs
12434 case "$d_getpwent_r_proto" in
12436 case "$getpwent_r_proto" in
12437 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
12438 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
12440 case "$getpwent_r_proto" in
12441 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
12442 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
12444 case "$getpwent_r_proto" in
12445 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
12446 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
12448 case "$getpwent_r_proto" in
12449 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
12450 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
12452 case "$getpwent_r_proto" in
12453 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
12454 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
12456 case "$getpwent_r_proto" in
12457 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
12458 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
12460 case "$getpwent_r_proto" in
12461 ''|0) d_getpwent_r=undef
12463 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
12464 * ) case "$getpwent_r_proto" in
12465 REENTRANT_PROTO*) ;;
12466 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
12468 echo "Prototype: $try" ;;
12471 *) case "$usethreads" in
12472 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
12479 *) getpwent_r_proto=0
12483 : see if getpwnam_r exists
12484 set getpwnam_r d_getpwnam_r
12486 case "$d_getpwnam_r" in
12488 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12489 case "$d_getpwnam_r_proto:$usethreads" in
12490 ":define") d_getpwnam_r_proto=define
12491 set d_getpwnam_r_proto getpwnam_r $hdrs
12495 case "$d_getpwnam_r_proto" in
12497 case "$getpwnam_r_proto" in
12498 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
12499 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
12501 case "$getpwnam_r_proto" in
12502 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
12503 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
12505 case "$getpwnam_r_proto" in
12506 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
12507 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
12509 case "$getpwnam_r_proto" in
12510 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
12511 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
12513 case "$getpwnam_r_proto" in
12514 ''|0) d_getpwnam_r=undef
12516 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
12517 * ) case "$getpwnam_r_proto" in
12518 REENTRANT_PROTO*) ;;
12519 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
12521 echo "Prototype: $try" ;;
12524 *) case "$usethreads" in
12525 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
12532 *) getpwnam_r_proto=0
12536 : see if getpwuid_r exists
12537 set getpwuid_r d_getpwuid_r
12539 case "$d_getpwuid_r" in
12541 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12542 case "$d_getpwuid_r_proto:$usethreads" in
12543 ":define") d_getpwuid_r_proto=define
12544 set d_getpwuid_r_proto getpwuid_r $hdrs
12548 case "$d_getpwuid_r_proto" in
12550 case "$getpwuid_r_proto" in
12551 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
12552 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
12554 case "$getpwuid_r_proto" in
12555 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
12556 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
12558 case "$getpwuid_r_proto" in
12559 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
12560 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
12562 case "$getpwuid_r_proto" in
12563 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
12564 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
12566 case "$getpwuid_r_proto" in
12567 ''|0) d_getpwuid_r=undef
12569 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
12570 * ) case "$getpwuid_r_proto" in
12571 REENTRANT_PROTO*) ;;
12572 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
12574 echo "Prototype: $try" ;;
12577 *) case "$usethreads" in
12578 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
12585 *) getpwuid_r_proto=0
12590 : see if getservbyname exists
12591 set getservbyname d_getsbyname
12594 : see if getservbyport exists
12595 set getservbyport d_getsbyport
12598 : see if getservent exists
12599 set getservent d_getsent
12602 : see if getservbyname_r exists
12603 set getservbyname_r d_getservbyname_r
12605 case "$d_getservbyname_r" in
12607 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12608 case "$d_getservbyname_r_proto:$usethreads" in
12609 ":define") d_getservbyname_r_proto=define
12610 set d_getservbyname_r_proto getservbyname_r $hdrs
12614 case "$d_getservbyname_r_proto" in
12616 case "$getservbyname_r_proto" in
12617 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
12618 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
12620 case "$getservbyname_r_proto" in
12621 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
12622 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
12624 case "$getservbyname_r_proto" in
12625 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
12626 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
12628 case "$getservbyname_r_proto" in
12629 ''|0) d_getservbyname_r=undef
12630 getservbyname_r_proto=0
12631 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
12632 * ) case "$getservbyname_r_proto" in
12633 REENTRANT_PROTO*) ;;
12634 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
12636 echo "Prototype: $try" ;;
12639 *) case "$usethreads" in
12640 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
12642 d_getservbyname_r=undef
12643 getservbyname_r_proto=0
12647 *) getservbyname_r_proto=0
12651 : see if getservbyport_r exists
12652 set getservbyport_r d_getservbyport_r
12654 case "$d_getservbyport_r" in
12656 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12657 case "$d_getservbyport_r_proto:$usethreads" in
12658 ":define") d_getservbyport_r_proto=define
12659 set d_getservbyport_r_proto getservbyport_r $hdrs
12663 case "$d_getservbyport_r_proto" in
12665 case "$getservbyport_r_proto" in
12666 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
12667 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
12669 case "$getservbyport_r_proto" in
12670 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
12671 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
12673 case "$getservbyport_r_proto" in
12674 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
12675 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
12677 case "$getservbyport_r_proto" in
12678 ''|0) d_getservbyport_r=undef
12679 getservbyport_r_proto=0
12680 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
12681 * ) case "$getservbyport_r_proto" in
12682 REENTRANT_PROTO*) ;;
12683 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
12685 echo "Prototype: $try" ;;
12688 *) case "$usethreads" in
12689 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
12691 d_getservbyport_r=undef
12692 getservbyport_r_proto=0
12696 *) getservbyport_r_proto=0
12700 : see if getservent_r exists
12701 set getservent_r d_getservent_r
12703 case "$d_getservent_r" in
12705 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12706 case "$d_getservent_r_proto:$usethreads" in
12707 ":define") d_getservent_r_proto=define
12708 set d_getservent_r_proto getservent_r $hdrs
12712 case "$d_getservent_r_proto" in
12714 case "$getservent_r_proto" in
12715 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
12716 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
12718 case "$getservent_r_proto" in
12719 ''|0) try='int getservent_r(struct servent*, char*, int);'
12720 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
12722 case "$getservent_r_proto" in
12723 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
12724 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
12726 case "$getservent_r_proto" in
12727 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
12728 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
12730 case "$getservent_r_proto" in
12731 ''|0) d_getservent_r=undef
12732 getservent_r_proto=0
12733 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
12734 * ) case "$getservent_r_proto" in
12735 REENTRANT_PROTO*) ;;
12736 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
12738 echo "Prototype: $try" ;;
12741 *) case "$usethreads" in
12742 define) echo "getservent_r has no prototype, not using it." >&4 ;;
12744 d_getservent_r=undef
12745 getservent_r_proto=0
12749 *) getservent_r_proto=0
12753 : see if prototypes for various getservxxx netdb.h functions are available
12755 set d_getservprotos getservent $i_netdb netdb.h
12758 : see if getspnam exists
12759 set getspnam d_getspnam
12762 : see if this is a shadow.h system
12763 set shadow.h i_shadow
12766 : see if getspnam_r exists
12767 set getspnam_r d_getspnam_r
12769 case "$d_getspnam_r" in
12771 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
12772 case "$d_getspnam_r_proto:$usethreads" in
12773 ":define") d_getspnam_r_proto=define
12774 set d_getspnam_r_proto getspnam_r $hdrs
12778 case "$d_getspnam_r_proto" in
12780 case "$getspnam_r_proto" in
12781 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
12782 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
12784 case "$getspnam_r_proto" in
12785 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
12786 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
12788 case "$getspnam_r_proto" in
12789 ''|0) d_getspnam_r=undef
12791 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
12792 * ) case "$getspnam_r_proto" in
12793 REENTRANT_PROTO*) ;;
12794 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
12796 echo "Prototype: $try" ;;
12799 *) case "$usethreads" in
12800 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
12807 *) getspnam_r_proto=0
12811 : see if gettimeofday or ftime exists
12812 set gettimeofday d_gettimeod
12814 case "$d_gettimeod" in
12820 val="$undef"; set d_ftime; eval $setvar
12823 case "$d_gettimeod$d_ftime" in
12826 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
12830 : see if gmtime_r exists
12831 set gmtime_r d_gmtime_r
12833 case "$d_gmtime_r" in
12835 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12836 case "$d_gmtime_r_proto:$usethreads" in
12837 ":define") d_gmtime_r_proto=define
12838 set d_gmtime_r_proto gmtime_r $hdrs
12842 case "$d_gmtime_r_proto" in
12844 case "$gmtime_r_proto" in
12845 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
12846 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
12848 case "$gmtime_r_proto" in
12849 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
12850 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
12852 case "$gmtime_r_proto" in
12853 ''|0) d_gmtime_r=undef
12855 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
12856 * ) case "$gmtime_r_proto" in
12857 REENTRANT_PROTO*) ;;
12858 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
12860 echo "Prototype: $try" ;;
12863 *) case "$usethreads" in
12864 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
12871 *) gmtime_r_proto=0
12875 : see if hasmntopt exists
12876 set hasmntopt d_hasmntopt
12879 : see if this is a netinet/in.h or sys/in.h system
12880 set netinet/in.h i_niin sys/in.h i_sysin
12883 : see if arpa/inet.h has to be included
12884 set arpa/inet.h i_arpainet
12887 : see if htonl --and friends-- exists
12892 : Maybe they are macros.
12895 $cat >htonl.c <<EOM
12897 #include <sys/types.h>
12898 #$i_niin I_NETINET_IN
12900 #$i_arpainet I_ARPA_INET
12901 #ifdef I_NETINET_IN
12902 #include <netinet/in.h>
12905 #include <sys/in.h>
12908 #include <arpa/inet.h>
12911 printf("Defined as a macro.");
12914 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
12915 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
12917 echo "But it seems to be defined as a macro." >&4
12927 if set index val -f; eval $csym; $val; then
12928 if set strchr val -f d_strchr; eval $csym; $val; then
12929 if $contains strchr "$strings" >/dev/null 2>&1 ; then
12932 echo "strchr() found." >&4
12936 echo "index() found." >&4
12941 echo "index() found." >&4
12944 if set strchr val -f d_strchr; eval $csym; $val; then
12947 echo "strchr() found." >&4
12949 echo "No index() or strchr() found!" >&4
12954 set d_strchr; eval $setvar
12956 set d_index; eval $setvar
12958 : check whether inet_aton exists
12959 set inet_aton d_inetaton
12964 $cat >isascii.c <<'EOCP'
12976 if eval $compile; then
12977 echo "isascii() found." >&4
12980 echo "isascii() NOT found." >&4
12987 : see if isfinite exists
12988 set isfinite d_isfinite
12991 : see if isinf exists
12995 : see if isnan exists
12999 : see if isnanl exists
13000 set isnanl d_isnanl
13003 : see if killpg exists
13004 set killpg d_killpg
13007 : see if lchown exists
13009 $cat > try.c <<'EOCP'
13010 /* System header to define __stub macros and hopefully few prototypes,
13011 which can conflict with char lchown(); below. */
13012 #include <assert.h>
13013 /* Override any gcc2 internal prototype to avoid an error. */
13014 /* We use char because int might match the return type of a gcc2
13015 builtin and then its argument prototype would still apply. */
13018 /* The GNU C library defines this for functions which it implements
13019 to always fail with ENOSYS. Some functions are actually named
13020 something starting with __ and the normal name is an alias. */
13021 #if defined (__stub_lchown) || defined (__stub___lchown)
13029 if eval $compile; then
13030 $echo "lchown() found." >&4
13033 $echo "lchown() NOT found." >&4
13039 : See if number of significant digits in a double precision number is known
13041 $cat >ldbl_dig.c <<EOM
13042 #$i_limits I_LIMITS
13045 #include <limits.h>
13051 printf("Contains LDBL_DIG");
13054 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
13055 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
13056 echo "LDBL_DIG found." >&4
13059 echo "LDBL_DIG NOT found." >&4
13066 : see if link exists
13070 : see if localtime_r exists
13071 set localtime_r d_localtime_r
13073 case "$d_localtime_r" in
13075 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13076 case "$d_localtime_r_proto:$usethreads" in
13077 ":define") d_localtime_r_proto=define
13078 set d_localtime_r_proto localtime_r $hdrs
13082 case "$d_localtime_r_proto" in
13084 case "$localtime_r_proto" in
13085 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
13086 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
13088 case "$localtime_r_proto" in
13089 ''|0) try='int localtime_r(const time_t*, struct tm*);'
13090 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
13092 case "$localtime_r_proto" in
13093 ''|0) d_localtime_r=undef
13094 localtime_r_proto=0
13095 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
13096 * ) case "$localtime_r_proto" in
13097 REENTRANT_PROTO*) ;;
13098 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
13100 echo "Prototype: $try" ;;
13103 *) case "$usethreads" in
13104 define) echo "localtime_r has no prototype, not using it." >&4 ;;
13106 d_localtime_r=undef
13107 localtime_r_proto=0
13111 *) localtime_r_proto=0
13115 : see if localeconv exists
13116 set localeconv d_locconv
13119 : see if lockf exists
13123 : see if prototype for lseek is available
13125 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
13128 : see if lstat exists
13132 : see if madvise exists
13133 set madvise d_madvise
13136 : see if mblen exists
13140 : see if mbstowcs exists
13141 set mbstowcs d_mbstowcs
13144 : see if mbtowc exists
13145 set mbtowc d_mbtowc
13148 : see if memchr exists
13149 set memchr d_memchr
13152 : see if memcmp exists
13153 set memcmp d_memcmp
13156 : see if memcpy exists
13157 set memcpy d_memcpy
13160 : see if memmove exists
13161 set memmove d_memmove
13164 : see if memset exists
13165 set memset d_memset
13168 : see if mkdir exists
13172 : see if mkdtemp exists
13173 set mkdtemp d_mkdtemp
13176 : see if mkfifo exists
13177 set mkfifo d_mkfifo
13180 : see if mkstemp exists
13181 set mkstemp d_mkstemp
13184 : see if mkstemps exists
13185 set mkstemps d_mkstemps
13188 : see if mktime exists
13189 set mktime d_mktime
13192 : see if this is a sys/mman.h system
13193 set sys/mman.h i_sysmman
13196 : see if mmap exists
13199 : see what shmat returns
13200 : default to something harmless
13202 case "$i_sysmman$d_mmap" in
13204 $cat >mmap.c <<'END'
13205 #include <sys/mman.h>
13208 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
13213 echo "and it returns ($mmaptype)." >&4
13219 : see if mprotect exists
13220 set mprotect d_mprotect
13223 : see if msgctl exists
13224 set msgctl d_msgctl
13227 : see if msgget exists
13228 set msgget d_msgget
13231 : see if msgsnd exists
13232 set msgsnd d_msgsnd
13235 : see if msgrcv exists
13236 set msgrcv d_msgrcv
13239 : see how much of the 'msg*(2)' library is present.
13242 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
13243 *"$undef"*) h_msg=false;;
13247 case "`ipcs 2>&1`" in
13248 "SVID messages"*"not configured"*)
13249 echo "Your $osname does not have the msg*(2) configured." >&4
13252 set msgctl d_msgctl
13254 set msgget d_msgget
13256 set msgsnd d_msgsnd
13258 set msgrcv d_msgrcv
13264 : we could also check for sys/ipc.h ...
13265 if $h_msg && $test `./findhdr sys/msg.h`; then
13266 echo "You have the full msg*(2) library." >&4
13269 echo "You don't have the full msg*(2) library." >&4
13277 echo "Checking to see if your system supports struct msghdr..." >&4
13278 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
13280 case "$d_msghdr_s" in
13281 "$define") echo "Yes, it does." ;;
13282 *) echo "No, it doesn't." ;;
13286 : see if msync exists
13290 : see if munmap exists
13291 set munmap d_munmap
13294 : see if nice exists
13298 : see if this is a langinfo.h system
13299 set langinfo.h i_langinfo
13302 : see if nl_langinfo exists
13303 set nl_langinfo d_nl_langinfo
13306 : check for length of character
13308 case "$charsize" in
13310 echo "Checking to see how big your characters are (hey, you never know)..." >&4
13311 $cat >try.c <<'EOCP'
13315 printf("%d\n", (int)sizeof(char));
13320 if eval $compile_ok; then
13324 echo "(I can't seem to compile the test program. Guessing...)"
13331 rp="What is the size of a character (in bytes)?"
13336 : check for volatile keyword
13338 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
13339 $cat >try.c <<'EOCP'
13342 typedef struct _goo_struct goo_struct;
13343 goo_struct * volatile goo = ((goo_struct *)0);
13344 struct _goo_struct {
13349 typedef unsigned short foo_t;
13350 char *volatile foo;
13352 volatile foo_t blech;
13356 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
13358 echo "Yup, it does."
13361 echo "Nope, it doesn't."
13369 $echo "Choosing the C types to be used for Perl's internal types..." >&4
13371 case "$use64bitint:$d_quad:$quadtype" in
13374 uvtype="$uquadtype"
13379 uvtype="unsigned long"
13385 case "$uselongdouble:$d_longdbl" in
13387 nvtype="long double"
13388 nvsize=$longdblsize
13395 $echo "(IV will be "$ivtype", $ivsize bytes)"
13396 $echo "(UV will be "$uvtype", $uvsize bytes)"
13397 $echo "(NV will be "$nvtype", $nvsize bytes)"
13400 #$i_inttypes I_INTTYPES
13402 #include <inttypes.h>
13407 int8_t i = INT8_MAX;
13408 uint8_t u = UINT8_MAX;
13409 printf("int8_t\n");
13412 int16_t i = INT16_MAX;
13413 uint16_t i = UINT16_MAX;
13414 printf("int16_t\n");
13417 int32_t i = INT32_MAX;
13418 uint32_t u = UINT32_MAX;
13419 printf("int32_t\n");
13425 '') case "$charsize" in
13427 u8type="unsigned char"
13436 if eval $compile; then
13437 case "`$run ./try`" in
13438 int8_t) i8type=int8_t
13448 '') if $test $charsize -ge 1; then
13450 u8type="unsigned char"
13458 '') case "$shortsize" in
13460 u16type="unsigned short"
13468 '') set try -DINT16
13469 if eval $compile; then
13470 case "`$run ./try`" in
13482 '') if $test $shortsize -ge 2; then
13484 u16type="unsigned short"
13492 '') case "$longsize" in
13494 u32type="unsigned long"
13498 *) case "$intsize" in
13500 u32type="unsigned int"
13510 '') set try -DINT32
13511 if eval $compile; then
13512 case "`$run ./try`" in
13524 '') if $test $intsize -ge 4; then
13526 u32type="unsigned int"
13534 '') case "$d_quad:$quadtype" in
13536 i64type="$quadtype"
13537 u64type="$uquadtype"
13545 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
13546 : volatile so that the compiler has to store it out to memory.
13547 if test X"$d_volatile" = X"$define"; then
13552 #include <sys/types.h>
13553 #include <signal.h>
13555 $volatile int bletched = 0;
13556 $signal_t blech(s) int s; { bletched = 1; }
13561 int n = 8 * $uvsize;
13564 signal(SIGFPE, blech);
13567 for (i = 0; i < n; i++) {
13568 u = u << 1 | ($uvtype)1;
13570 if (($uvtype)d != u)
13574 d = ($nvtype)(u - 1);
13575 if (($uvtype)d != (u - 1))
13583 printf("%d\n", ((i == n) ? -n : i));
13589 d_nv_preserves_uv="$undef"
13590 if eval $compile; then
13591 nv_preserves_uv_bits="`$run ./try`"
13593 case "$nv_preserves_uv_bits" in
13595 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
13596 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
13597 d_nv_preserves_uv="$define"
13599 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
13600 d_nv_preserves_uv="$undef" ;;
13601 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
13602 nv_preserves_uv_bits="$undef" ;;
13608 : check for off64_t
13610 echo "Checking to see if you have off64_t..." >&4
13612 #include <sys/types.h>
13613 #include <unistd.h>
13614 int main() { off64_t x = 7; }
13617 if eval $compile; then
13619 echo "You have off64_t."
13622 echo "You do not have off64_t."
13623 case "$lseeksize" in
13624 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
13631 : how to create joinable pthreads
13632 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
13634 echo "Checking what constant to use for creating joinable pthreads..." >&4
13635 $cat >try.c <<'EOCP'
13636 #include <pthread.h>
13638 int detachstate = JOINABLE;
13641 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
13642 if eval $compile; then
13643 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
13644 val="$undef" # Yes, undef.
13645 set d_old_pthread_create_joinable
13648 set old_pthread_create_joinable
13651 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
13652 if eval $compile; then
13653 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
13655 set d_old_pthread_create_joinable
13657 val=PTHREAD_CREATE_UNDETACHED
13658 set old_pthread_create_joinable
13661 set try -DJOINABLE=__UNDETACHED
13662 if eval $compile; then
13663 echo "You seem to use __UNDETACHED." >&4
13665 set d_old_pthread_create_joinable
13668 set old_pthread_create_joinable
13671 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
13673 set d_old_pthread_create_joinable
13676 set old_pthread_create_joinable
13683 d_old_pthread_create_joinable="$undef"
13684 old_pthread_create_joinable=""
13687 : see if pause exists
13691 : see if pipe exists
13695 : see if poll exists
13699 : see if readlink exists
13700 set readlink d_readlink
13706 case "$d_readlink" in
13708 if $issymlink /proc/self/exe ; then
13709 $ls -l /proc/self/exe > reflect
13710 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
13711 echo "You have Linux-like /proc/self/exe."
13712 procselfexe='"/proc/self/exe"'
13716 if $issymlink /proc/curproc/file ; then
13717 $ls -l /proc/curproc/file > reflect
13718 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
13719 echo "You have BSD-like /proc/curproc/file."
13720 procselfexe='"/proc/curproc/file"'
13730 : see whether the pthread_atfork exists
13732 #include <pthread.h>
13735 #ifdef PTHREAD_ATFORK
13736 pthread_atfork(NULL,NULL,NULL);
13741 : see if pthread_atfork exists
13742 set try -DPTHREAD_ATFORK
13743 if eval $compile; then
13748 case "$usethreads" in
13751 $define) echo 'pthread_atfork found.' >&4 ;;
13752 *) echo 'pthread_atfork NOT found.' >&4 ;;
13755 set d_pthread_atfork
13759 : see whether the various POSIXish _yields exist
13761 #include <pthread.h>
13767 #ifdef PTHREAD_YIELD
13770 #ifdef PTHREAD_YIELD_NULL
13771 pthread_yield(NULL);
13777 : see if sched_yield exists
13778 set try -DSCHED_YIELD
13779 if eval $compile; then
13781 sched_yield='sched_yield()'
13785 case "$usethreads" in
13788 $define) echo 'sched_yield() found.' >&4 ;;
13789 *) echo 'sched_yield() NOT found.' >&4 ;;
13795 : see if pthread_yield exists
13796 set try -DPTHREAD_YIELD
13797 if eval $compile; then
13799 case "$sched_yield" in
13800 '') sched_yield='pthread_yield()' ;;
13803 set try -DPTHREAD_YIELD_NULL
13804 if eval $compile; then
13806 case "$sched_yield" in
13807 '') sched_yield='pthread_yield(NULL)' ;;
13813 case "$usethreads" in
13816 $define) echo 'pthread_yield() found.' >&4 ;;
13817 *) echo 'pthread_yield() NOT found.' >&4 ;;
13821 set d_pthread_yield
13824 case "$sched_yield" in
13825 '') sched_yield=undef ;;
13830 : see if random_r exists
13831 set random_r d_random_r
13833 case "$d_random_r" in
13835 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
13836 case "$d_random_r_proto:$usethreads" in
13837 ":define") d_random_r_proto=define
13838 set d_random_r_proto random_r $hdrs
13842 case "$d_random_r_proto" in
13844 case "$random_r_proto" in
13845 ''|0) try='int random_r(int*, struct random_data*);'
13846 ./protochk "extern $try" $hdrs && random_r_proto=I_TS ;;
13848 case "$random_r_proto" in
13849 ''|0) d_random_r=undef
13851 echo "Disabling random_r, cannot determine prototype." >&4 ;;
13852 * ) case "$random_r_proto" in
13853 REENTRANT_PROTO*) ;;
13854 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
13856 echo "Prototype: $try" ;;
13859 *) case "$usethreads" in
13860 define) echo "random_r has no prototype, not using it." >&4 ;;
13867 *) random_r_proto=0
13871 : see if readdir and friends exist
13872 set readdir d_readdir
13874 set seekdir d_seekdir
13876 set telldir d_telldir
13878 set rewinddir d_rewinddir
13881 : see if readdir64_r exists
13882 set readdir64_r d_readdir64_r
13884 case "$d_readdir64_r" in
13886 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
13887 case "$d_readdir64_r_proto:$usethreads" in
13888 ":define") d_readdir64_r_proto=define
13889 set d_readdir64_r_proto readdir64_r $hdrs
13893 case "$d_readdir64_r_proto" in
13895 case "$readdir64_r_proto" in
13896 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
13897 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
13899 case "$readdir64_r_proto" in
13900 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
13901 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
13903 case "$readdir64_r_proto" in
13904 ''|0) d_readdir64_r=undef
13905 readdir64_r_proto=0
13906 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
13907 * ) case "$readdir64_r_proto" in
13908 REENTRANT_PROTO*) ;;
13909 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
13911 echo "Prototype: $try" ;;
13914 *) case "$usethreads" in
13915 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
13917 d_readdir64_r=undef
13918 readdir64_r_proto=0
13922 *) readdir64_r_proto=0
13926 : see if readdir_r exists
13927 set readdir_r d_readdir_r
13929 case "$d_readdir_r" in
13931 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
13932 case "$d_readdir_r_proto:$usethreads" in
13933 ":define") d_readdir_r_proto=define
13934 set d_readdir_r_proto readdir_r $hdrs
13938 case "$d_readdir_r_proto" in
13940 case "$readdir_r_proto" in
13941 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
13942 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
13944 case "$readdir_r_proto" in
13945 ''|0) try='int readdir_r(DIR*, struct dirent*);'
13946 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
13948 case "$readdir_r_proto" in
13949 ''|0) d_readdir_r=undef
13951 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
13952 * ) case "$readdir_r_proto" in
13953 REENTRANT_PROTO*) ;;
13954 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
13956 echo "Prototype: $try" ;;
13959 *) case "$usethreads" in
13960 define) echo "readdir_r has no prototype, not using it." >&4 ;;
13967 *) readdir_r_proto=0
13971 : see if readv exists
13975 : see if recvmsg exists
13976 set recvmsg d_recvmsg
13979 : see if rename exists
13980 set rename d_rename
13983 : see if rmdir exists
13987 : see if memory.h is available.
13992 : See if it conflicts with string.h
13998 $cppstdin $cppflags $cppminus < $strings > mem.h
13999 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
14001 echo "We won't be including <memory.h>."
14011 : can bcopy handle overlapping blocks?
14014 case "$d_memmove" in
14015 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
14016 *) case "$d_bcopy" in
14018 echo "Checking to see if bcopy() can do overlapping copies..." >&4
14020 #$i_memory I_MEMORY
14021 #$i_stdlib I_STDLIB
14022 #$i_string I_STRING
14023 #$i_unistd I_UNISTD
14025 $cat >>try.c <<'EOCP'
14028 # include <memory.h>
14031 # include <stdlib.h>
14034 # include <string.h>
14036 # include <strings.h>
14039 # include <unistd.h> /* Needed for NetBSD */
14043 char buf[128], abc[128];
14049 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14050 try to store the string in read-only memory. */
14051 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
14053 for (align = 7; align >= 0; align--) {
14054 for (len = 36; len; len--) {
14056 bcopy(abc, b, len);
14057 for (off = 1; off <= len; off++) {
14058 bcopy(b, b+off, len);
14059 bcopy(b+off, b, len);
14060 if (bcmp(b, abc, len))
14069 if eval $compile_ok; then
14070 if ./try 2>/dev/null; then
14071 echo "Yes, it can."
14074 echo "It can't, sorry."
14077 echo "(I can't compile the test program, so we'll assume not...)"
14081 $rm -f try.* try core
14087 : can memcpy handle overlapping blocks?
14090 case "$d_memmove" in
14091 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
14092 *) case "$d_memcpy" in
14094 echo "Checking to see if memcpy() can do overlapping copies..." >&4
14096 #$i_memory I_MEMORY
14097 #$i_stdlib I_STDLIB
14098 #$i_string I_STRING
14099 #$i_unistd I_UNISTD
14101 $cat >>try.c <<'EOCP'
14104 # include <memory.h>
14107 # include <stdlib.h>
14110 # include <string.h>
14112 # include <strings.h>
14115 # include <unistd.h> /* Needed for NetBSD */
14119 char buf[128], abc[128];
14125 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14126 try to store the string in read-only memory. */
14127 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
14129 for (align = 7; align >= 0; align--) {
14130 for (len = 36; len; len--) {
14132 memcpy(b, abc, len);
14133 for (off = 1; off <= len; off++) {
14134 memcpy(b+off, b, len);
14135 memcpy(b, b+off, len);
14136 if (memcmp(b, abc, len))
14145 if eval $compile_ok; then
14146 if ./try 2>/dev/null; then
14147 echo "Yes, it can."
14150 echo "It can't, sorry."
14153 echo "(I can't compile the test program, so we'll assume not...)"
14157 $rm -f try.* try core
14163 : can memcmp be trusted to compare relative magnitude?
14165 case "$d_memcmp" in
14168 echo "Checking if your memcmp() can compare relative magnitude..." >&4
14170 #$i_memory I_MEMORY
14171 #$i_stdlib I_STDLIB
14172 #$i_string I_STRING
14173 #$i_unistd I_UNISTD
14175 $cat >>try.c <<'EOCP'
14178 # include <memory.h>
14181 # include <stdlib.h>
14184 # include <string.h>
14186 # include <strings.h>
14189 # include <unistd.h> /* Needed for NetBSD */
14195 if ((a < b) && memcmp(&a, &b, 1) < 0)
14201 if eval $compile_ok; then
14202 if $run ./try 2>/dev/null; then
14203 echo "Yes, it can."
14206 echo "No, it can't (it uses signed chars)."
14209 echo "(I can't compile the test program, so we'll assume not...)"
14213 $rm -f try.* try core
14217 : see if prototype for sbrk is available
14219 set d_sbrkproto sbrk $i_unistd unistd.h
14222 : see if select exists
14223 set select d_select
14226 : see if semctl exists
14227 set semctl d_semctl
14230 : see if semget exists
14231 set semget d_semget
14234 : see if semop exists
14238 : see how much of the 'sem*(2)' library is present.
14241 case "$d_semctl$d_semget$d_semop" in
14242 *"$undef"*) h_sem=false;;
14246 case "`ipcs 2>&1`" in
14247 "SVID messages"*"not configured"*)
14248 echo "Your $osname does not have the sem*(2) configured." >&4
14251 set semctl d_semctl
14253 set semget d_semget
14261 : we could also check for sys/ipc.h ...
14262 if $h_sem && $test `./findhdr sys/sem.h`; then
14263 echo "You have the full sem*(2) library." >&4
14266 echo "You don't have the full sem*(2) library." >&4
14272 : see whether sys/sem.h defines union semun
14274 $cat > try.c <<'END'
14275 #include <sys/types.h>
14276 #include <sys/ipc.h>
14277 #include <sys/sem.h>
14278 int main () { union semun semun; semun.buf = 0; }
14281 if eval $compile; then
14282 echo "You have union semun in <sys/sem.h>." >&4
14285 echo "You do not have union semun in <sys/sem.h>." >&4
14288 $rm -f try try.c try.h
14292 : see how to do semctl IPC_STAT
14295 : see whether semctl IPC_STAT can use union semun
14300 # define S_IRUSR S_IREAD
14301 # define S_IWUSR S_IWRITE
14302 # define S_IXUSR S_IEXEC
14304 # define S_IRUSR 0400
14305 # define S_IWUSR 0200
14306 # define S_IXUSR 0100
14308 # define S_IRGRP (S_IRUSR>>3)
14309 # define S_IWGRP (S_IWUSR>>3)
14310 # define S_IXGRP (S_IXUSR>>3)
14311 # define S_IROTH (S_IRUSR>>6)
14312 # define S_IWOTH (S_IWUSR>>6)
14313 # define S_IXOTH (S_IXUSR>>6)
14316 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
14317 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
14318 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
14323 #include <sys/types.h>
14324 #include <sys/ipc.h>
14325 #include <sys/sem.h>
14326 #include <sys/stat.h>
14333 #$d_union_semun HAS_UNION_SEMUN
14336 #ifndef HAS_UNION_SEMUN
14339 struct semid_ds *buf;
14340 unsigned short *array;
14346 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14347 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14349 struct semid_ds argbuf;
14352 st = semctl(sem, 0, IPC_STAT, arg);
14356 # endif /* IPC_STAT */
14357 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14359 if (semctl(sem, 0, IPC_RMID, arg) != 0)
14360 # endif /* IPC_RMID */
14361 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14363 #endif /* IPC_PRIVATE && ... */
14364 printf("semget failed: errno = %d\n", errno);
14370 if eval $compile; then
14373 semun) val="$define" ;;
14379 case "$d_semctl_semun" in
14381 echo "You can use union semun for semctl IPC_STAT." >&4
14384 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
14389 : see whether semctl IPC_STAT can use struct semid_ds pointer
14390 $cat > try.c <<'END'
14391 #include <sys/types.h>
14392 #include <sys/ipc.h>
14393 #include <sys/sem.h>
14394 #include <sys/stat.h>
14402 struct semid_ds arg;
14405 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14406 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14409 st = semctl(sem, 0, IPC_STAT, &arg);
14411 printf("semid_ds\n");
14413 # endif /* IPC_STAT */
14414 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14416 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
14417 # endif /* IPC_RMID */
14418 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14420 #endif /* IPC_PRIVATE && ... */
14421 printf("semget failed: errno = %d\n", errno);
14428 if eval $compile; then
14431 semid_ds) val="$define" ;;
14435 set d_semctl_semid_ds
14437 case "$d_semctl_semid_ds" in
14439 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
14441 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
14448 # We do not have the full sem*(2) library, so assume we can not
14454 set d_semctl_semid_ds
14459 : see if sendmsg exists
14460 set sendmsg d_sendmsg
14463 : see if setegid exists
14464 set setegid d_setegid
14467 : see if seteuid exists
14468 set seteuid d_seteuid
14471 : see if setgrent exists
14472 set setgrent d_setgrent
14475 : see if setgrent_r exists
14476 set setgrent_r d_setgrent_r
14478 case "$d_setgrent_r" in
14480 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14481 case "$d_setgrent_r_proto:$usethreads" in
14482 ":define") d_setgrent_r_proto=define
14483 set d_setgrent_r_proto setgrent_r $hdrs
14487 case "$d_setgrent_r_proto" in
14489 case "$setgrent_r_proto" in
14490 ''|0) try='int setgrent_r(FILE**);'
14491 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
14493 case "$setgrent_r_proto" in
14494 ''|0) try='void setgrent_r(FILE**);'
14495 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
14497 case "$setgrent_r_proto" in
14498 ''|0) d_setgrent_r=undef
14500 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
14501 * ) case "$setgrent_r_proto" in
14502 REENTRANT_PROTO*) ;;
14503 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
14505 echo "Prototype: $try" ;;
14508 *) case "$usethreads" in
14509 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
14516 *) setgrent_r_proto=0
14520 : see if sethostent exists
14521 set sethostent d_sethent
14524 : see if sethostent_r exists
14525 set sethostent_r d_sethostent_r
14527 case "$d_sethostent_r" in
14529 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14530 case "$d_sethostent_r_proto:$usethreads" in
14531 ":define") d_sethostent_r_proto=define
14532 set d_sethostent_r_proto sethostent_r $hdrs
14536 case "$d_sethostent_r_proto" in
14538 case "$sethostent_r_proto" in
14539 ''|0) try='int sethostent_r(int, struct hostent_data*);'
14540 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
14542 case "$sethostent_r_proto" in
14543 ''|0) try='void sethostent_r(int, struct hostent_data*);'
14544 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
14546 case "$sethostent_r_proto" in
14547 ''|0) d_sethostent_r=undef
14548 sethostent_r_proto=0
14549 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
14550 * ) case "$sethostent_r_proto" in
14551 REENTRANT_PROTO*) ;;
14552 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
14554 echo "Prototype: $try" ;;
14557 *) case "$usethreads" in
14558 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
14560 d_sethostent_r=undef
14561 sethostent_r_proto=0
14565 *) sethostent_r_proto=0
14569 : see if setitimer exists
14570 set setitimer d_setitimer
14573 : see if setlinebuf exists
14574 set setlinebuf d_setlinebuf
14577 : see if setlocale exists
14578 set setlocale d_setlocale
14581 : see if locale.h is available
14582 set locale.h i_locale
14585 : see if setlocale_r exists
14586 set setlocale_r d_setlocale_r
14588 case "$d_setlocale_r" in
14590 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
14591 case "$d_setlocale_r_proto:$usethreads" in
14592 ":define") d_setlocale_r_proto=define
14593 set d_setlocale_r_proto setlocale_r $hdrs
14597 case "$d_setlocale_r_proto" in
14599 case "$setlocale_r_proto" in
14600 ''|0) try='int setlocale_r(int, const char*, char*, int);'
14601 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
14603 case "$setlocale_r_proto" in
14604 ''|0) d_setlocale_r=undef
14605 setlocale_r_proto=0
14606 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
14607 * ) case "$setlocale_r_proto" in
14608 REENTRANT_PROTO*) ;;
14609 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
14611 echo "Prototype: $try" ;;
14614 *) case "$usethreads" in
14615 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
14617 d_setlocale_r=undef
14618 setlocale_r_proto=0
14622 *) setlocale_r_proto=0
14626 : see if setnetent exists
14627 set setnetent d_setnent
14630 : see if setnetent_r exists
14631 set setnetent_r d_setnetent_r
14633 case "$d_setnetent_r" in
14635 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14636 case "$d_setnetent_r_proto:$usethreads" in
14637 ":define") d_setnetent_r_proto=define
14638 set d_setnetent_r_proto setnetent_r $hdrs
14642 case "$d_setnetent_r_proto" in
14644 case "$setnetent_r_proto" in
14645 ''|0) try='int setnetent_r(int, struct netent_data*);'
14646 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
14648 case "$setnetent_r_proto" in
14649 ''|0) try='void setnetent_r(int, struct netent_data*);'
14650 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
14652 case "$setnetent_r_proto" in
14653 ''|0) d_setnetent_r=undef
14654 setnetent_r_proto=0
14655 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
14656 * ) case "$setnetent_r_proto" in
14657 REENTRANT_PROTO*) ;;
14658 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
14660 echo "Prototype: $try" ;;
14663 *) case "$usethreads" in
14664 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
14666 d_setnetent_r=undef
14667 setnetent_r_proto=0
14671 *) setnetent_r_proto=0
14675 : see if setprotoent exists
14676 set setprotoent d_setpent
14679 : see if setpgid exists
14680 set setpgid d_setpgid
14683 : see if setpgrp2 exists
14684 set setpgrp2 d_setpgrp2
14687 : see if setpriority exists
14688 set setpriority d_setprior
14691 : see if setproctitle exists
14692 set setproctitle d_setproctitle
14695 : see if setprotoent_r exists
14696 set setprotoent_r d_setprotoent_r
14698 case "$d_setprotoent_r" in
14700 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14701 case "$d_setprotoent_r_proto:$usethreads" in
14702 ":define") d_setprotoent_r_proto=define
14703 set d_setprotoent_r_proto setprotoent_r $hdrs
14707 case "$d_setprotoent_r_proto" in
14709 case "$setprotoent_r_proto" in
14710 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
14711 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
14713 case "$setprotoent_r_proto" in
14714 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
14715 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
14717 case "$setprotoent_r_proto" in
14718 ''|0) d_setprotoent_r=undef
14719 setprotoent_r_proto=0
14720 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
14721 * ) case "$setprotoent_r_proto" in
14722 REENTRANT_PROTO*) ;;
14723 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
14725 echo "Prototype: $try" ;;
14728 *) case "$usethreads" in
14729 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
14731 d_setprotoent_r=undef
14732 setprotoent_r_proto=0
14736 *) setprotoent_r_proto=0
14740 : see if setpwent exists
14741 set setpwent d_setpwent
14744 : see if setpwent_r exists
14745 set setpwent_r d_setpwent_r
14747 case "$d_setpwent_r" in
14749 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14750 case "$d_setpwent_r_proto:$usethreads" in
14751 ":define") d_setpwent_r_proto=define
14752 set d_setpwent_r_proto setpwent_r $hdrs
14756 case "$d_setpwent_r_proto" in
14758 case "$setpwent_r_proto" in
14759 ''|0) try='int setpwent_r(FILE**);'
14760 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
14762 case "$setpwent_r_proto" in
14763 ''|0) try='void setpwent_r(FILE**);'
14764 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
14766 case "$setpwent_r_proto" in
14767 ''|0) d_setpwent_r=undef
14769 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
14770 * ) case "$setpwent_r_proto" in
14771 REENTRANT_PROTO*) ;;
14772 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
14774 echo "Prototype: $try" ;;
14777 *) case "$usethreads" in
14778 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
14785 *) setpwent_r_proto=0
14789 : see if setregid exists
14790 set setregid d_setregid
14792 set setresgid d_setresgid
14795 : see if setreuid exists
14796 set setreuid d_setreuid
14798 set setresuid d_setresuid
14801 : see if setrgid exists
14802 set setrgid d_setrgid
14805 : see if setruid exists
14806 set setruid d_setruid
14809 : see if setservent exists
14810 set setservent d_setsent
14813 : see if setservent_r exists
14814 set setservent_r d_setservent_r
14816 case "$d_setservent_r" in
14818 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14819 case "$d_setservent_r_proto:$usethreads" in
14820 ":define") d_setservent_r_proto=define
14821 set d_setservent_r_proto setservent_r $hdrs
14825 case "$d_setservent_r_proto" in
14827 case "$setservent_r_proto" in
14828 ''|0) try='int setservent_r(int, struct servent_data*);'
14829 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
14831 case "$setservent_r_proto" in
14832 ''|0) try='void setservent_r(int, struct servent_data*);'
14833 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
14835 case "$setservent_r_proto" in
14836 ''|0) d_setservent_r=undef
14837 setservent_r_proto=0
14838 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
14839 * ) case "$setservent_r_proto" in
14840 REENTRANT_PROTO*) ;;
14841 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
14843 echo "Prototype: $try" ;;
14846 *) case "$usethreads" in
14847 define) echo "setservent_r has no prototype, not using it." >&4 ;;
14849 d_setservent_r=undef
14850 setservent_r_proto=0
14854 *) setservent_r_proto=0
14858 : see if setsid exists
14859 set setsid d_setsid
14862 : see if setvbuf exists
14863 set setvbuf d_setvbuf
14866 : see if sfio.h is available
14871 : see if sfio library is available
14882 : Ok, but do we want to use it.
14886 true|$define|[yY]*) dflt='y';;
14889 echo "$package can use the sfio library, but it is experimental."
14890 case "$useperlio" in
14892 echo "For sfio also the PerlIO abstraction layer is needed."
14893 echo "Earlier you said you wouldn't want that."
14896 rp="You seem to have sfio available, do you want to try using it?"
14899 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
14900 useperlio="$define"
14903 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
14908 *) case "$usesfio" in
14909 true|$define|[yY]*)
14910 echo "Sorry, cannot find sfio on this machine." >&4
14911 echo "Ignoring your setting of usesfio=$usesfio." >&4
14920 $define) usesfio='true';;
14921 *) usesfio='false';;
14925 *) : Remove sfio from list of libraries to use
14928 echo "Removing unneeded -lsfio from library list" >&4
14929 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
14932 echo "libs = $libs" >&4
14939 : see if shmctl exists
14940 set shmctl d_shmctl
14943 : see if shmget exists
14944 set shmget d_shmget
14947 : see if shmat exists
14950 : see what shmat returns
14953 $cat >shmat.c <<'END'
14954 #include <sys/shm.h>
14957 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
14962 echo "and it returns ($shmattype)." >&4
14963 : see if a prototype for shmat is available
14964 xxx=`./findhdr sys/shm.h`
14965 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
14966 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
14977 set d_shmatprototype
14980 : see if shmdt exists
14984 : see how much of the 'shm*(2)' library is present.
14987 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
14988 *"$undef"*) h_shm=false;;
14992 case "`ipcs 2>&1`" in
14993 "SVID shared memory"*"not configured"*)
14994 echo "Your $osname does not have the shm*(2) configured." >&4
14997 set shmctl d_shmctl
14999 set shmget d_shmget
15009 : we could also check for sys/ipc.h ...
15010 if $h_shm && $test `./findhdr sys/shm.h`; then
15011 echo "You have the full shm*(2) library." >&4
15014 echo "You don't have the full shm*(2) library." >&4
15021 : see if we have sigaction
15022 if set sigaction val -f d_sigaction; eval $csym; $val; then
15023 echo 'sigaction() found.' >&4
15024 $cat > try.c <<'EOP'
15026 #include <sys/types.h>
15027 #include <signal.h>
15030 struct sigaction act, oact;
15032 oact.sa_handler = 0;
15033 /* so that act and oact are used */
15034 exit(act.sa_flags == 0 && oact.sa_handler == 0);
15038 if eval $compile_ok; then
15041 echo "But you don't seem to have a useable struct sigaction." >&4
15045 echo 'sigaction NOT found.' >&4
15048 set d_sigaction; eval $setvar
15049 $rm -f try try$_o try.c
15051 : see if sigprocmask exists
15052 set sigprocmask d_sigprocmask
15055 : see if sigsetjmp exists
15057 case "$d_sigsetjmp" in
15059 $cat >try.c <<'EOP'
15060 #include <setjmp.h>
15065 if (sigsetjmp(env,1))
15068 siglongjmp(env, 1);
15073 if eval $compile; then
15074 if $run ./try >/dev/null 2>&1; then
15075 echo "POSIX sigsetjmp found." >&4
15079 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
15085 echo "sigsetjmp not found." >&4
15089 *) val="$d_sigsetjmp"
15090 case "$d_sigsetjmp" in
15091 $define) echo "POSIX sigsetjmp found." >&4;;
15092 $undef) echo "sigsetjmp not found." >&4;;
15100 : see if sockatmark exists
15101 set sockatmark d_sockatmark
15104 : see if prototype for sockatmark is available
15106 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
15109 : see if socks5_init exists
15110 set socks5_init d_socks5_init
15113 : see if srand48_r exists
15114 set srand48_r d_srand48_r
15116 case "$d_srand48_r" in
15118 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15119 case "$d_srand48_r_proto:$usethreads" in
15120 ":define") d_srand48_r_proto=define
15121 set d_srand48_r_proto srand48_r $hdrs
15125 case "$d_srand48_r_proto" in
15127 case "$srand48_r_proto" in
15128 ''|0) try='int srand48_r(long, struct drand48_data*);'
15129 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
15131 case "$srand48_r_proto" in
15132 ''|0) d_srand48_r=undef
15134 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
15135 * ) case "$srand48_r_proto" in
15136 REENTRANT_PROTO*) ;;
15137 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
15139 echo "Prototype: $try" ;;
15142 *) case "$usethreads" in
15143 define) echo "srand48_r has no prototype, not using it." >&4 ;;
15150 *) srand48_r_proto=0
15154 : see if srandom_r exists
15155 set srandom_r d_srandom_r
15157 case "$d_srandom_r" in
15159 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15160 case "$d_srandom_r_proto:$usethreads" in
15161 ":define") d_srandom_r_proto=define
15162 set d_srandom_r_proto srandom_r $hdrs
15166 case "$d_srandom_r_proto" in
15168 case "$srandom_r_proto" in
15169 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
15170 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
15172 case "$srandom_r_proto" in
15173 ''|0) d_srandom_r=undef
15175 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
15176 * ) case "$srandom_r_proto" in
15177 REENTRANT_PROTO*) ;;
15178 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
15180 echo "Prototype: $try" ;;
15183 *) case "$usethreads" in
15184 define) echo "srandom_r has no prototype, not using it." >&4 ;;
15191 *) srandom_r_proto=0
15195 : see if prototype for setresgid is available
15197 set d_sresgproto setresgid $i_unistd unistd.h
15200 : see if prototype for setresuid is available
15202 set d_sresuproto setresuid $i_unistd unistd.h
15205 : see if sys/stat.h is available
15206 set sys/stat.h i_sysstat
15210 : see if stat knows about block sizes
15212 echo "Checking to see if your struct stat has st_blocks field..." >&4
15213 set d_statblks stat st_blocks $i_sysstat sys/stat.h
15217 : see if this is a sys/vfs.h system
15218 set sys/vfs.h i_sysvfs
15222 : see if this is a sys/statfs.h system
15223 set sys/statfs.h i_sysstatfs
15228 echo "Checking to see if your system supports struct statfs..." >&4
15229 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
15231 case "$d_statfs_s" in
15232 "$define") echo "Yes, it does." ;;
15233 *) echo "No, it doesn't." ;;
15238 : see if struct statfs knows about f_flags
15239 case "$d_statfs_s" in
15242 echo "Checking to see if your struct statfs has f_flags field..." >&4
15243 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
15247 set d_statfs_f_flags
15251 case "$d_statfs_f_flags" in
15252 "$define") echo "Yes, it does." ;;
15253 *) echo "No, it doesn't." ;;
15256 : see if _ptr and _cnt from stdio act std
15259 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
15260 echo "(Looks like you have stdio.h from BSD.)"
15261 case "$stdio_ptr" in
15262 '') stdio_ptr='((fp)->_p)'
15265 *) ptr_lval=$d_stdio_ptr_lval;;
15267 case "$stdio_cnt" in
15268 '') stdio_cnt='((fp)->_r)'
15271 *) cnt_lval=$d_stdio_cnt_lval;;
15273 case "$stdio_base" in
15274 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
15276 case "$stdio_bufsiz" in
15277 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
15279 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
15280 echo "(Looks like you have stdio.h from Linux.)"
15281 case "$stdio_ptr" in
15282 '') stdio_ptr='((fp)->_IO_read_ptr)'
15285 *) ptr_lval=$d_stdio_ptr_lval;;
15287 case "$stdio_cnt" in
15288 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
15291 *) cnt_lval=$d_stdio_cnt_lval;;
15293 case "$stdio_base" in
15294 '') stdio_base='((fp)->_IO_read_base)';;
15296 case "$stdio_bufsiz" in
15297 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
15300 case "$stdio_ptr" in
15301 '') stdio_ptr='((fp)->_ptr)'
15304 *) ptr_lval=$d_stdio_ptr_lval;;
15306 case "$stdio_cnt" in
15307 '') stdio_cnt='((fp)->_cnt)'
15310 *) cnt_lval=$d_stdio_cnt_lval;;
15312 case "$stdio_base" in
15313 '') stdio_base='((fp)->_base)';;
15315 case "$stdio_bufsiz" in
15316 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
15320 : test whether _ptr and _cnt really work
15321 echo "Checking how std your stdio is..." >&4
15324 #define FILE_ptr(fp) $stdio_ptr
15325 #define FILE_cnt(fp) $stdio_cnt
15327 FILE *fp = fopen("try.c", "r");
15330 18 <= FILE_cnt(fp) &&
15331 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15339 if eval $compile && $to try.c; then
15340 if $run ./try; then
15341 echo "Your stdio acts pretty std."
15344 echo "Your stdio isn't very std."
15347 echo "Your stdio doesn't appear very std."
15353 : Can _ptr be used as an lvalue?
15354 case "$d_stdstdio$ptr_lval" in
15355 $define$define) val=$define ;;
15358 set d_stdio_ptr_lval
15361 : Can _cnt be used as an lvalue?
15362 case "$d_stdstdio$cnt_lval" in
15363 $define$define) val=$define ;;
15366 set d_stdio_cnt_lval
15370 : test whether setting _ptr sets _cnt as a side effect
15371 d_stdio_ptr_lval_sets_cnt="$undef"
15372 d_stdio_ptr_lval_nochange_cnt="$undef"
15373 case "$d_stdio_ptr_lval$d_stdstdio" in
15375 echo "Checking to see what happens if we set the stdio ptr..." >&4
15378 /* Can we scream? */
15379 /* Eat dust sed :-) */
15380 /* In the buffer space, no one can hear you scream. */
15381 #define FILE_ptr(fp) $stdio_ptr
15382 #define FILE_cnt(fp) $stdio_cnt
15383 #include <sys/types.h>
15385 FILE *fp = fopen("try.c", "r");
15390 puts("Fail even to read");
15393 c = getc(fp); /* Read away the first # */
15395 puts("Fail even to read");
15399 18 <= FILE_cnt(fp) &&
15400 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15402 puts("Fail even to read");
15405 ptr = (char*) FILE_ptr(fp);
15406 cnt = (size_t)FILE_cnt(fp);
15408 FILE_ptr(fp) += 42;
15410 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
15411 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
15414 if (FILE_cnt(fp) <= 20) {
15415 printf ("Fail (<20 chars to test)");
15418 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
15419 puts("Fail compare");
15422 if (cnt == FILE_cnt(fp)) {
15423 puts("Pass_unchanged");
15426 if (FILE_cnt(fp) == (cnt - 42)) {
15427 puts("Pass_changed");
15430 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
15436 if eval $compile && $to try.c; then
15437 case `$run ./try` in
15439 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
15440 d_stdio_ptr_lval_sets_cnt="$define" ;;
15442 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
15443 d_stdio_ptr_lval_nochange_cnt="$define" ;;
15445 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
15447 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
15450 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
15456 : see if _base is also standard
15458 case "$d_stdstdio" in
15462 #define FILE_base(fp) $stdio_base
15463 #define FILE_bufsiz(fp) $stdio_bufsiz
15465 FILE *fp = fopen("try.c", "r");
15468 19 <= FILE_bufsiz(fp) &&
15469 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
15476 if eval $compile && $to try.c; then
15477 if $run ./try; then
15478 echo "And its _base field acts std."
15481 echo "But its _base field isn't std."
15484 echo "However, it seems to be lacking the _base field."
15493 Checking how to access stdio streams by file descriptor number...
15495 case "$stdio_stream_array" in
15496 '') $cat >try.c <<EOCP
15499 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
15503 for s in _iob __iob __sF
15505 set try -DSTDIO_STREAM_ARRAY=$s
15506 if eval $compile; then
15507 case "`$run ./try`" in
15508 yes) stdio_stream_array=$s; break ;;
15512 $rm -f try.* try$exe_ext
15514 case "$stdio_stream_array" in
15516 I can't figure out how to access stdio streams by file descriptor number.
15518 d_stdio_stream_array="$undef"
15521 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
15523 d_stdio_stream_array="$define"
15527 : see if strcoll exists
15528 set strcoll d_strcoll
15531 : check for structure copying
15533 echo "Checking to see if your C compiler can copy structs..." >&4
15534 $cat >try.c <<'EOCP'
15544 if $cc -c try.c >/dev/null 2>&1 ; then
15546 echo "Yup, it can."
15549 echo "Nope, it can't."
15555 : see if strerror and/or sys_errlist[] exist
15557 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
15558 if set strerror val -f d_strerror; eval $csym; $val; then
15559 echo 'strerror() found.' >&4
15560 d_strerror="$define"
15561 d_strerrm='strerror(e)'
15562 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15563 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
15564 d_syserrlst="$define"
15566 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
15567 d_syserrlst="$undef"
15569 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
15570 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
15571 echo 'strerror() found in string header.' >&4
15572 d_strerror="$define"
15573 d_strerrm='strerror(e)'
15574 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15575 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
15576 d_syserrlst="$define"
15578 echo "(You don't appear to have any sys_errlist[], how can this be?)"
15579 d_syserrlst="$undef"
15581 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15582 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
15583 d_strerror="$undef"
15584 d_syserrlst="$define"
15585 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
15587 echo 'strerror() and sys_errlist[] NOT found.' >&4
15588 d_strerror="$undef"
15589 d_syserrlst="$undef"
15590 d_strerrm='"unknown"'
15594 : see if strerror_r exists
15595 set strerror_r d_strerror_r
15597 case "$d_strerror_r" in
15599 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
15600 case "$d_strerror_r_proto:$usethreads" in
15601 ":define") d_strerror_r_proto=define
15602 set d_strerror_r_proto strerror_r $hdrs
15606 case "$d_strerror_r_proto" in
15608 case "$strerror_r_proto" in
15609 ''|0) try='int strerror_r(int, char*, size_t);'
15610 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
15612 case "$strerror_r_proto" in
15613 ''|0) try='int strerror_r(int, char*, int);'
15614 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
15616 case "$strerror_r_proto" in
15617 ''|0) try='char* strerror_r(int, char*, size_t);'
15618 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
15620 case "$strerror_r_proto" in
15621 ''|0) d_strerror_r=undef
15623 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
15624 * ) case "$strerror_r_proto" in
15625 REENTRANT_PROTO*) ;;
15626 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
15628 echo "Prototype: $try" ;;
15631 *) case "$usethreads" in
15632 define) echo "strerror_r has no prototype, not using it." >&4 ;;
15639 *) strerror_r_proto=0
15643 : see if strftime exists
15644 set strftime d_strftime
15647 : see if strtod exists
15648 set strtod d_strtod
15651 : see if strtol exists
15652 set strtol d_strtol
15655 : see if strtold exists
15656 set strtold d_strtold
15659 : see if strtoll exists
15660 set strtoll d_strtoll
15663 case "$d_longlong-$d_strtoll" in
15666 Checking whether your strtoll() works okay...
15668 $cat >try.c <<'EOCP'
15671 #define strtoll __strtoll
15674 #define strtoll _strtoll
15677 extern long long int strtoll(char *s, char **, int);
15678 static int bad = 0;
15679 int check(char *s, long long ell, int een) {
15682 gll = strtoll(s, 0, 10);
15683 if (!((gll == ell) && (errno == een)))
15687 check(" 1", 1LL, 0);
15688 check(" 0", 0LL, 0);
15689 check("-1", -1LL, 0);
15690 check("-9223372036854775808", -9223372036854775808LL, 0);
15691 check("-9223372036854775808", -9223372036854775808LL, 0);
15692 check(" 9223372036854775807", 9223372036854775807LL, 0);
15693 check("-9223372036854775808", -9223372036854775808LL, 0);
15694 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
15695 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
15701 if eval $compile; then
15704 ok) echo "Your strtoll() seems to be working okay." ;;
15706 Your strtoll() doesn't seem to be working okay.
15712 echo "(I can't seem to compile the test program--assuming it doesn't)"
15718 : see if strtoq exists
15719 set strtoq d_strtoq
15722 : see if strtoul exists
15723 set strtoul d_strtoul
15726 case "$d_strtoul" in
15729 Checking whether your strtoul() works okay...
15731 $cat >try.c <<'EOCP'
15734 extern unsigned long int strtoul(char *s, char **, int);
15735 static int bad = 0;
15736 void check(char *s, unsigned long eul, int een) {
15739 gul = strtoul(s, 0, 10);
15740 if (!((gul == eul) && (errno == een)))
15744 check(" 1", 1L, 0);
15745 check(" 0", 0L, 0);
15747 case "$longsize" in
15749 $cat >>try.c <<'EOCP'
15750 check("18446744073709551615", 18446744073709551615UL, 0);
15751 check("18446744073709551616", 18446744073709551615UL, ERANGE);
15752 #if 0 /* strtoul() for /^-/ strings is undefined. */
15753 check("-1", 18446744073709551615UL, 0);
15754 check("-18446744073709551614", 2, 0);
15755 check("-18446744073709551615", 1, 0);
15756 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
15757 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
15762 $cat >>try.c <<'EOCP'
15763 check("4294967295", 4294967295UL, 0);
15764 check("4294967296", 4294967295UL, ERANGE);
15765 #if 0 /* strtoul() for /^-/ strings is undefined. */
15766 check("-1", 4294967295UL, 0);
15767 check("-4294967294", 2, 0);
15768 check("-4294967295", 1, 0);
15769 check("-4294967296", 4294967295UL, ERANGE);
15770 check("-4294967297", 4294967295UL, ERANGE);
15775 : Should we write these tests to be more portable by sprintf-ing
15776 : ~0 and then manipulating that char string as input for strtol?
15779 $cat >>try.c <<'EOCP'
15786 if eval $compile; then
15787 case "`$run ./try`" in
15788 ok) echo "Your strtoul() seems to be working okay." ;;
15790 Your strtoul() doesn't seem to be working okay.
15799 : see if strtoull exists
15800 set strtoull d_strtoull
15803 case "$d_longlong-$d_strtoull" in
15806 Checking whether your strtoull() works okay...
15808 $cat >try.c <<'EOCP'
15811 #define strtoull __strtoull
15814 extern unsigned long long int strtoull(char *s, char **, int);
15815 static int bad = 0;
15816 int check(char *s, long long eull, int een) {
15819 gull = strtoull(s, 0, 10);
15820 if (!((gull == eull) && (errno == een)))
15824 check(" 1", 1LL, 0);
15825 check(" 0", 0LL, 0);
15826 check("18446744073709551615", 18446744073709551615ULL, 0);
15827 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
15828 #if 0 /* strtoull() for /^-/ strings is undefined. */
15829 check("-1", 18446744073709551615ULL, 0);
15830 check("-18446744073709551614", 2LL, 0);
15831 check("-18446744073709551615", 1LL, 0);
15832 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
15833 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
15840 if eval $compile; then
15841 case "`$run ./try`" in
15842 ok) echo "Your strtoull() seems to be working okay." ;;
15844 Your strtoull() doesn't seem to be working okay.
15846 d_strtoull="$undef"
15853 : see if strtouq exists
15854 set strtouq d_strtouq
15857 case "$d_strtouq" in
15860 Checking whether your strtouq() works okay...
15862 $cat >try.c <<'EOCP'
15865 extern unsigned long long int strtouq(char *s, char **, int);
15866 static int bad = 0;
15867 void check(char *s, unsigned long long eull, int een) {
15868 unsigned long long gull;
15870 gull = strtouq(s, 0, 10);
15871 if (!((gull == eull) && (errno == een)))
15875 check(" 1", 1LL, 0);
15876 check(" 0", 0LL, 0);
15877 check("18446744073709551615", 18446744073709551615ULL, 0);
15878 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
15879 #if 0 /* strtouq() for /^-/ strings is undefined. */
15880 check("-1", 18446744073709551615ULL, 0);
15881 check("-18446744073709551614", 2LL, 0);
15882 check("-18446744073709551615", 1LL, 0);
15883 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
15884 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
15892 if eval $compile; then
15893 case "`$run ./try`" in
15894 ok) echo "Your strtouq() seems to be working okay." ;;
15896 Your strtouq() doesn't seem to be working okay.
15905 : see if strxfrm exists
15906 set strxfrm d_strxfrm
15909 : see if symlink exists
15910 set symlink d_symlink
15913 : see if syscall exists
15914 set syscall d_syscall
15917 : see if prototype for syscall is available
15919 set d_syscallproto syscall $i_unistd unistd.h
15922 : see if sysconf exists
15923 set sysconf d_sysconf
15926 : see if system exists
15927 set system d_system
15930 : see if tcgetpgrp exists
15931 set tcgetpgrp d_tcgetpgrp
15934 : see if tcsetpgrp exists
15935 set tcsetpgrp d_tcsetpgrp
15938 : see if prototype for telldir is available
15940 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
15943 : see if time exists
15945 if test "X$d_time" = X -o X"$timetype" = X; then
15946 if set time val -f d_time; eval $csym; $val; then
15947 echo 'time() found.' >&4
15949 rp="What is the type returned by time() on this system?"
15950 set time_t timetype long stdio.h sys/types.h
15953 echo 'time() not found, hope that will do.' >&4
15961 : see if this is a sys/times.h system
15962 set sys/times.h i_systimes
15965 : see if times exists
15967 if set times val -f d_times; eval $csym; $val; then
15968 echo 'times() found.' >&4
15971 case "$i_systimes" in
15972 "$define") inc='sys/times.h';;
15974 rp="What is the type returned by times() on this system?"
15975 set clock_t clocktype long stdio.h sys/types.h $inc
15978 echo 'times() NOT found, hope that will do.' >&4
15983 : see if tmpnam_r exists
15984 set tmpnam_r d_tmpnam_r
15986 case "$d_tmpnam_r" in
15988 hdrs="$i_systypes sys/types.h define stdio.h "
15989 case "$d_tmpnam_r_proto:$usethreads" in
15990 ":define") d_tmpnam_r_proto=define
15991 set d_tmpnam_r_proto tmpnam_r $hdrs
15995 case "$d_tmpnam_r_proto" in
15997 case "$tmpnam_r_proto" in
15998 ''|0) try='char* tmpnam_r(char*);'
15999 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
16001 case "$tmpnam_r_proto" in
16002 ''|0) d_tmpnam_r=undef
16004 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
16005 * ) case "$tmpnam_r_proto" in
16006 REENTRANT_PROTO*) ;;
16007 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
16009 echo "Prototype: $try" ;;
16012 *) case "$usethreads" in
16013 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
16020 *) tmpnam_r_proto=0
16024 : see if truncate exists
16025 set truncate d_truncate
16028 : see if ttyname_r exists
16029 set ttyname_r d_ttyname_r
16031 case "$d_ttyname_r" in
16033 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
16034 case "$d_ttyname_r_proto:$usethreads" in
16035 ":define") d_ttyname_r_proto=define
16036 set d_ttyname_r_proto ttyname_r $hdrs
16040 case "$d_ttyname_r_proto" in
16042 case "$ttyname_r_proto" in
16043 ''|0) try='int ttyname_r(int, char*, size_t);'
16044 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
16046 case "$ttyname_r_proto" in
16047 ''|0) try='int ttyname_r(int, char*, int);'
16048 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
16050 case "$ttyname_r_proto" in
16051 ''|0) try='char* ttyname_r(int, char*, int);'
16052 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
16054 case "$ttyname_r_proto" in
16055 ''|0) d_ttyname_r=undef
16057 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
16058 * ) case "$ttyname_r_proto" in
16059 REENTRANT_PROTO*) ;;
16060 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
16062 echo "Prototype: $try" ;;
16065 *) case "$usethreads" in
16066 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
16073 *) ttyname_r_proto=0
16077 : see if tzname[] exists
16079 if set tzname val -a d_tzname; eval $csym; $val; then
16081 echo 'tzname[] found.' >&4
16084 echo 'tzname[] NOT found.' >&4
16090 next|rhapsody|darwin) multiarch="$define" ;;
16092 case "$multiarch" in
16093 ''|[nN]*) multiarch="$undef" ;;
16096 : check for ordering of bytes in a UV
16098 case "$usecrosscompile$multiarch" in
16101 You seem to be either cross-compiling or doing a multiarchitecture build,
16102 skipping the byteorder check.
16108 case "$byteorder" in
16111 In the following, larger digits indicate more significance. A big-endian
16112 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
16113 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
16114 machines may have weird orders like 3412. A Cray will report 87654321,
16115 an Alpha will report 12345678. If the test program works the default is
16117 I'm now running the test program...
16121 #include <sys/types.h>
16122 typedef $uvtype UV;
16132 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
16134 u.l = (UV)0x04030201;
16135 for (i = 0; i < $uvsize; i++)
16136 printf("%c", u.c[i]+'0');
16143 if eval $compile && ./try > /dev/null; then
16146 [1-4][1-4][1-4][1-4]|12345678|87654321)
16147 echo "(The test program ran ok.)"
16148 echo "byteorder=$dflt"
16151 ????|????????) echo "(The test program ran ok.)" ;;
16152 *) echo "(The test program didn't run right for some reason.)" ;;
16157 (I can't seem to compile the test program. Guessing big-endian...)
16160 case "$xxx_prompt" in
16162 rp="What is the order of bytes in $uvtype?"
16178 Checking to see whether you can access character data unalignedly...
16180 case "$d_u32align" in
16181 '') $cat >try.c <<EOCP
16183 #define U32 $u32type
16184 #define BYTEORDER 0x$byteorder
16186 #include <signal.h>
16188 $signal_t bletch(s) int s; { exit(4); }
16191 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
16196 if (sizeof(U32) != 4) {
16197 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
16204 signal(SIGBUS, bletch);
16216 for (i = 0; i < 4; i++) {
16217 up = (U32*)(buf + i);
16218 if (! ((*up == 1 << (8*i)) || /* big-endian */
16219 (*up == 1 << (8*(3-i))) /* little-endian */
16223 printf("read failed (%x)\n", *up);
16229 for (i = 0; i < 4; i++) {
16230 up = (U32*)(buf + i);
16232 if (*up != 0xBeef) {
16233 printf("write failed (%x)\n", *up);
16247 if eval $compile_ok; then
16248 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
16249 $run ./try 2>&1 >/dev/null
16252 You can access character data pretty unalignedly.
16254 d_u32align="$undef"
16257 It seems that you must access character data in an aligned manner.
16259 d_u32align="$define"
16263 rp='Can you access character data at unaligned addresses?'
16267 [yY]*) d_u32align="$undef" ;;
16268 *) d_u32align="$define" ;;
16271 $rm -f core core.try.* try.core
16275 : see if ualarm exists
16276 set ualarm d_ualarm
16279 : see if umask exists
16283 : see if unordered exists
16284 set unordered d_unordered
16287 : see if usleep exists
16288 set usleep d_usleep
16291 : see if prototype for usleep is available
16293 set d_usleepproto usleep $i_unistd unistd.h
16296 : see if ustat exists
16300 : backward compatibility for d_hvfork
16301 if test X$d_hvfork != X; then
16302 d_vfork="$d_hvfork"
16305 : see if there is a vfork
16310 : Ok, but do we want to use it. vfork is reportedly unreliable in
16311 : perl on Solaris 2.x, and probably elsewhere.
16315 case "$usevfork" in
16321 Perl can only use a vfork() that doesn't suffer from strict
16322 restrictions on calling functions or modifying global data in
16323 the child. For example, glibc-2.1 contains such a vfork()
16324 that is unsuitable. If your system provides a proper fork()
16325 call, chances are that you do NOT want perl to use vfork().
16328 rp="Do you still want to use vfork()?"
16333 echo "Ok, we won't use vfork()."
16342 $define) usevfork='true';;
16343 *) usevfork='false';;
16346 : see if closedir exists
16347 set closedir d_closedir
16350 case "$d_closedir" in
16353 echo "Checking whether closedir() returns a status..." >&4
16355 #$i_dirent I_DIRENT /**/
16356 #$i_sysdir I_SYS_DIR /**/
16357 #$i_sysndir I_SYS_NDIR /**/
16358 #$i_systypes I_SYS_TYPES /**/
16360 #if defined(I_SYS_TYPES)
16361 #include <sys/types.h>
16363 #if defined(I_DIRENT)
16364 #include <dirent.h>
16365 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
16366 #include <sys/dir.h>
16370 #include <sys/ndir.h>
16374 #include <ndir.h> /* may be wrong in the future */
16376 #include <sys/dir.h>
16381 int main() { return closedir(opendir(".")); }
16384 if eval $compile_ok; then
16385 if $run ./try > /dev/null 2>&1 ; then
16386 echo "Yes, it does."
16389 echo "No, it doesn't."
16393 echo "(I can't seem to compile the test program--assuming it doesn't)"
16401 set d_void_closedir
16404 : see if there is a wait4
16408 : see if waitpid exists
16409 set waitpid d_waitpid
16412 : see if wcstombs exists
16413 set wcstombs d_wcstombs
16416 : see if wctomb exists
16417 set wctomb d_wctomb
16420 : see if writev exists
16421 set writev d_writev
16424 : preserve RCS keywords in files with variable substitution, grrr
16429 Revision='$Revision'
16431 : check for alignment requirements
16433 case "$usecrosscompile$multiarch" in
16436 You seem to be either cross-compiling or doing a multiarchitecture build,
16437 skipping the memory alignment check.
16440 case "$alignbytes" in
16441 '') alignbytes=8 ;;
16445 case "$alignbytes" in
16446 '') echo "Checking alignment constraints..." >&4
16447 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
16448 $cat >try.c <<'EOCP'
16449 typedef long double NV;
16452 $cat >try.c <<'EOCP'
16456 $cat >>try.c <<'EOCP'
16464 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
16469 if eval $compile_ok; then
16473 echo "(I can't seem to compile the test program...)"
16476 *) dflt="$alignbytes"
16479 rp="Doubles must be aligned on a how-many-byte boundary?"
16487 : set the base revision
16490 : how do we catenate cpp tokens here?
16492 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
16493 $cat >cpp_stuff.c <<'EOCP'
16494 #define RCAT(a,b)a/**/b
16495 #define ACAT(a,b)a ## b
16499 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
16500 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
16501 echo "Oh! Smells like ANSI's been here." >&4
16502 echo "We can catify or stringify, separately or together!"
16504 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
16505 echo "Ah, yes! The good old days!" >&4
16506 echo "However, in the good old days we don't know how to stringify and"
16507 echo "catify at the same time."
16511 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
16512 to have to edit the values of CAT[2-5] in config.h...
16514 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
16518 : see if this is a db.h system
16524 : Check db version.
16526 echo "Checking Berkeley DB version ..." >&4
16532 #include <sys/types.h>
16535 int main(int argc, char *argv[])
16537 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
16538 int Major, Minor, Patch ;
16539 unsigned long Version ;
16540 (void)db_version(&Major, &Minor, &Patch) ;
16542 printf("%d %d %d %d %d %d\n",
16543 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
16544 Major, Minor, Patch);
16547 printf("You have Berkeley DB Version 2 or greater.\n");
16549 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
16550 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
16551 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
16552 Major, Minor, Patch) ;
16554 /* check that db.h & libdb are compatible */
16555 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
16556 printf("db.h and libdb are incompatible.\n") ;
16560 printf("db.h and libdb are compatible.\n") ;
16562 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
16563 + DB_VERSION_PATCH ;
16565 /* needs to be >= 2.3.4 */
16566 if (Version < 2003004) {
16567 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
16568 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
16574 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
16579 printf("You have Berkeley DB Version 1.\n");
16580 exit(0); /* DB version < 2: the coast is clear. */
16582 exit(1); /* <db.h> not Berkeley DB? */
16588 if eval $compile_ok && $run ./try; then
16589 echo 'Looks OK.' >&4
16591 db_version_major=$1
16592 db_version_minor=$2
16593 db_version_patch=$3
16595 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
16599 : Remove db from list of libraries to use
16600 echo "Removing unusable -ldb from library list" >&4
16601 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
16604 echo "libs = $libs" >&4
16614 : Check the return type needed for hash
16616 echo "Checking return type needed for hash for Berkeley DB ..." >&4
16622 #include <sys/types.h>
16625 #ifndef DB_VERSION_MAJOR
16626 u_int32_t hash_cb (ptr, size)
16634 info.hash = hash_cb;
16638 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16639 if $contains warning try.out >>/dev/null 2>&1 ; then
16642 db_hashtype='u_int32_t'
16645 : XXX Maybe we should just give up here.
16646 db_hashtype=u_int32_t
16648 echo "Help: I can't seem to compile the db test program." >&4
16649 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
16652 echo "Your version of Berkeley DB uses $db_hashtype for hash."
16654 *) db_hashtype=u_int32_t
16659 : Check the return type needed for prefix
16661 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
16667 #include <sys/types.h>
16670 #ifndef DB_VERSION_MAJOR
16671 size_t prefix_cb (key1, key2)
16679 info.prefix = prefix_cb;
16683 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16684 if $contains warning try.out >>/dev/null 2>&1 ; then
16685 db_prefixtype='int'
16687 db_prefixtype='size_t'
16690 db_prefixtype='size_t'
16691 : XXX Maybe we should just give up here.
16693 echo "Help: I can't seem to compile the db test program." >&4
16694 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
16697 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
16699 *) db_prefixtype='size_t'
16704 : How can we generate normalized random numbers ?
16706 echo "Looking for a random number function..." >&4
16707 case "$randfunc" in
16709 if set drand48 val -f; eval $csym; $val; then
16711 echo "Good, found drand48()." >&4
16712 elif set random val -f; eval $csym; $val; then
16714 echo "OK, found random()." >&4
16717 echo "Yick, looks like I have to use rand()." >&4
16728 *-Dmy_rand=*|*-Dmy_srand=*)
16729 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
16730 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
16731 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
16732 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
16736 while $test "$cont"; do
16737 rp="Use which function to generate random numbers?"
16739 if $test "$ans" = "$dflt"; then
16745 if set $ans val -f; eval $csym; $val; then
16749 rp="I cannot find function $ans. Use that name anyway?"
16758 case "$randfunc" in
16760 drand01="drand48()"
16766 case "$randbits" in
16768 echo "Checking to see how many bits your $randfunc() function produces..." >&4
16770 #$i_unistd I_UNISTD
16771 #$i_stdlib I_STDLIB
16774 # include <unistd.h>
16777 # include <stdlib.h>
16782 register unsigned long tmp;
16783 register unsigned long max = 0L;
16785 for (i = 1000; i; i--) {
16786 tmp = (unsigned long) $randfunc();
16787 if (tmp > max) max = tmp;
16789 for (i = 0; max; i++)
16795 if eval $compile_ok; then
16799 echo "(I can't seem to compile the test program...)"
16806 rp="How many bits does your $randfunc() function produce?"
16810 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
16811 seedfunc="s$randfunc"
16812 randseedtype=unsigned
16816 rp="How many bits does your $randfunc() function produce?"
16819 seedfunc="s$randfunc"
16820 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
16821 if set $seedfunc val -f; eval $csym; $val; then
16822 echo "(Using $seedfunc() to seed random generator)"
16824 echo "(Warning: no $seedfunc() to seed random generator)"
16827 randseedtype=unsigned
16835 echo "Determining whether or not we are on an EBCDIC system..." >&4
16836 $cat >try.c <<'EOM'
16839 if ('M'==0xd4) return 0;
16846 if eval $compile_ok; then
16847 if $run ./try; then
16848 echo "You seem to speak EBCDIC." >&4
16851 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
16854 echo "I'm unable to compile the test program." >&4
16855 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
16863 Checking how to flush all pending stdio output...
16865 # I only know how to find the first 32 possibly open files on SunOS.
16866 # See also hints/sunos_4_1.sh and util.c --AD
16868 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
16870 $cat >>try.c <<EOCP
16872 #$i_unistd I_UNISTD
16874 # include <unistd.h>
16876 #$d_sysconf HAS_SYSCONF
16877 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
16878 #ifdef HAS_STDIO_STREAM_ARRAY
16879 # define STDIO_STREAM_ARRAY $stdio_stream_array
16884 p = fopen("try.out", "w");
16888 # ifdef TRY_FPRINTF
16892 #ifdef TRY_FFLUSH_NULL
16895 #ifdef TRY_FFLUSH_ALL
16897 long open_max = -1;
16898 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
16899 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
16901 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
16902 open_max = sysconf(_SC_OPEN_MAX);
16905 open_max = FOPEN_MAX;
16908 open_max = OPEN_MAX;
16917 # ifdef HAS_STDIO_STREAM_ARRAY
16918 if (open_max > 0) {
16920 for (i = 0; i < open_max; i++)
16921 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
16922 STDIO_STREAM_ARRAY[i]._file < open_max &&
16923 STDIO_STREAM_ARRAY[i]._flag)
16924 fflush(&STDIO_STREAM_ARRAY[i]);
16932 : first we have to find out how _not_ to flush
16934 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
16936 set try -DTRY_FPUTC
16937 if eval $compile; then
16938 $run ./try 2>/dev/null
16941 if $test ! -s try.out -a "X$code" = X42; then
16947 set try -DTRY_FPRINTF
16948 if eval $compile; then
16949 $run ./try 2>/dev/null
16952 if $test ! -s try.out -a "X$code" = X42; then
16953 output=-DTRY_FPRINTF
16959 : check for fflush NULL behaviour
16960 case "$fflushNULL" in
16961 '') set try -DTRY_FFLUSH_NULL $output
16962 if eval $compile; then
16963 $run ./try 2>/dev/null
16966 if $test -s try.out -a "X$code" = X42; then
16967 fflushNULL="`$cat try.out`"
16969 if $test "X$code" != X42; then
16971 (If this test failed, don't worry, we'll try another method shortly.)
16976 $rm -f core try.core core.try.*
16977 case "$fflushNULL" in
16979 Your fflush(NULL) works okay for output streams.
16980 Let's see if it clobbers input pipes...
16982 # As of mid-March 2000 all versions of Solaris appear to have a stdio
16983 # bug that improperly flushes the input end of pipes. So we avoid the
16984 # autoflush on fork/system/exec support for now. :-(
16985 $cat >tryp.c <<EOCP
16988 main(int argc, char **argv)
16994 while ((i = getc(stdin)) != -1
16995 && (*bp++ = i) != '\n'
16996 && bp < &buf[1024])
16999 fprintf(stdout, "%s", buf);
17007 fflushNULL="$define"
17009 if eval $compile; then
17011 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17012 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17014 fflush(NULL) seems to behave okay with input streams.
17016 fflushNULL="$define"
17019 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
17021 fflushNULL="$undef"
17024 $rm -f core tryp.c tryp.core core.tryp.*
17027 Your fflush(NULL) isn't working (contrary to ANSI C).
17029 fflushNULL="$undef"
17032 Cannot figure out whether your fflush(NULL) works or not.
17033 I'm assuming it doesn't (contrary to ANSI C).
17035 fflushNULL="$undef"
17039 $define|true|[yY]*)
17040 fflushNULL="$define"
17043 fflushNULL="$undef"
17046 : check explicit looping only if NULL did not work, and if the pipe
17047 : bug does not show up on an explicit flush too
17048 case "$fflushNULL" in
17050 $cat >tryp.c <<EOCP
17053 main(int argc, char **argv)
17059 while ((i = getc(stdin)) != -1
17060 && (*bp++ = i) != '\n'
17061 && bp < &buf[1024])
17064 fprintf(stdout, "%s", buf);
17073 if eval $compile; then
17075 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17076 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17078 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
17080 : now check for fflushall behaviour
17081 case "$fflushall" in
17082 '') set try -DTRY_FFLUSH_ALL $output
17083 if eval $compile; then
17085 (Now testing the other method--but note that this also may fail.)
17087 $run ./try 2>/dev/null
17090 if $test -s try.out -a "X$code" = X42; then
17091 fflushall="`$cat try.out`"
17094 $rm -f core try.core core.try.*
17095 case "$fflushall" in
17097 Whew. Flushing explicitly all the stdio streams works.
17099 fflushall="$define"
17102 Sigh. Flushing explicitly all the stdio streams doesn't work.
17107 Cannot figure out whether flushing stdio streams explicitly works or not.
17108 I'm assuming it doesn't.
17114 "$define"|true|[yY]*)
17115 fflushall="$define"
17123 All is futile. Even fflush(stdin) clobbers input pipes!
17130 $rm -f core tryp.c tryp.core core.tryp.*
17132 *) fflushall="$undef"
17136 case "$fflushNULL$fflushall" in
17139 OK, I give up. I cannot figure out how to flush pending stdio output.
17140 We won't be flushing handles at all before fork/exec/popen.
17144 $rm -f try.* try$exe_ext
17146 : Store the full pathname to the ar program for use in the C program
17147 : Respect a hint or command line value for full_ar.
17152 : Store the full pathname to the sed program for use in the C program
17155 : see what type gids are declared as in the kernel
17157 echo "Looking for the type for group ids returned by getgid()."
17158 set gid_t gidtype xxx stdio.h sys/types.h
17162 xxx=`./findhdr sys/user.h`
17163 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
17165 unsigned) dflt="$1 $2" ;;
17169 *) dflt="$gidtype";;
17172 gid_t) echo "gid_t found." ;;
17173 *) rp="What is the type for group ids returned by getgid()?"
17181 *_t) zzz="$gidtype" ;;
17184 echo "Checking the size of $zzz..." >&4
17186 #include <sys/types.h>
17189 printf("%d\n", (int)sizeof($gidtype));
17194 if eval $compile_ok; then
17198 echo "(I can't execute the test program--guessing $gidsize.)" >&4
17201 echo "Your $zzz is $gidsize bytes long."
17206 echo "(I can't compile the test program--guessing $gidsize.)" >&4
17212 *_t) zzz="$gidtype" ;;
17215 echo "Checking the sign of $zzz..." >&4
17217 #include <sys/types.h>
17228 if eval $compile; then
17232 echo "(I can't execute the test program--guessing unsigned.)" >&4
17236 1) echo "Your $zzz is unsigned." ;;
17237 -1) echo "Your $zzz is signed." ;;
17243 echo "(I can't compile the test program--guessing unsigned.)" >&4
17249 if $test X"$quadtype" != X; then
17251 echo "Checking how to print 64-bit integers..." >&4
17253 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
17254 $cat >try.c <<'EOCP'
17255 #include <sys/types.h>
17258 int q = 12345678901;
17259 printf("%ld\n", q);
17263 if eval $compile; then
17267 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
17268 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
17269 echo "We will use %d."
17275 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
17276 $cat >try.c <<'EOCP'
17277 #include <sys/types.h>
17280 long q = 12345678901;
17281 printf("%ld\n", q);
17285 if eval $compile; then
17289 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
17290 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
17291 echo "We will use %ld."
17297 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
17298 $cat >try.c <<'EOCP'
17299 #include <sys/types.h>
17300 #include <inttypes.h>
17303 int64_t q = 12345678901;
17304 printf("%" PRId64 "\n", q);
17308 if eval $compile; then
17312 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
17313 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
17314 echo "We will use the C9X style."
17320 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17322 #include <sys/types.h>
17325 $quadtype q = 12345678901;
17326 printf("%Ld\n", q);
17330 if eval $compile; then
17334 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
17335 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
17336 echo "We will use %Ld."
17342 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
17343 $cat >try.c <<'EOCP'
17344 #include <sys/types.h>
17347 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
17348 printf("%lld\n", q);
17352 if eval $compile; then
17356 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
17357 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
17358 echo "We will use the %lld style."
17364 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17366 #include <sys/types.h>
17369 $quadtype q = 12345678901;
17370 printf("%qd\n", q);
17374 if eval $compile; then
17378 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
17379 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
17380 echo "We will use %qd."
17386 if $test X"$sPRId64" = X; then
17387 echo "Cannot figure out how to print 64-bit integers." >&4
17395 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
17396 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
17398 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
17399 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
17405 $echo "Checking the format strings to be used for Perl's internal types..." >&4
17407 if $test X"$ivsize" = X8; then
17408 ivdformat="$sPRId64"
17409 uvuformat="$sPRIu64"
17410 uvoformat="$sPRIo64"
17411 uvxformat="$sPRIx64"
17412 uvXUformat="$sPRIXU64"
17414 if $test X"$ivsize" = X"$longsize"; then
17421 if $test X"$ivsize" = X"$intsize"; then
17429 if $test X"$ivsize" = X"$shortsize"; then
17440 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
17441 nveformat="$sPRIeldbl"
17442 nvfformat="$sPRIfldbl"
17443 nvgformat="$sPRIgldbl"
17444 nvEUformat="$sPRIEUldbl"
17445 nvFUformat="$sPRIFUldbl"
17446 nvGUformat="$sPRIGUldbl"
17456 case "$ivdformat" in
17457 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
17464 $echo "Checking the format string to be used for gids..." >&4
17467 -1) if $test X"$gidsize" = X"$ivsize"; then
17468 gidformat="$ivdformat"
17470 if $test X"$gidsize" = X"$longsize"; then
17473 if $test X"$gidsize" = X"$intsize"; then
17476 if $test X"$gidsize" = X"$shortsize"; then
17483 *) if $test X"$gidsize" = X"$uvsize"; then
17484 gidformat="$uvuformat"
17486 if $test X"$gidsize" = X"$longsize"; then
17489 if $test X"$gidsize" = X"$intsize"; then
17492 if $test X"$gidsize" = X"$shortsize"; then
17501 : see if getgroups exists
17502 set getgroups d_getgrps
17505 : see if setgroups exists
17506 set setgroups d_setgrps
17510 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
17512 case "$d_getgrps$d_setgrps" in
17514 case "$groupstype" in
17515 '') dflt="$gidtype" ;;
17516 *) dflt="$groupstype" ;;
17519 What type of pointer is the second argument to getgroups() and setgroups()?
17520 Usually this is the same as group ids, $gidtype, but not always.
17523 rp='What type pointer is the second argument to getgroups() and setgroups()?'
17527 *) groupstype="$gidtype";;
17531 echo "Checking if your $make program sets \$(MAKE)..." >&4
17532 case "$make_set_make" in
17534 $sed 's/^X //' > testmake.mak << 'EOF'
17536 X @echo 'maketemp="$(MAKE)"'
17538 case "`$make -f testmake.mak 2>/dev/null`" in
17539 *maketemp=*) make_set_make='#' ;;
17540 *) make_set_make="MAKE=$make" ;;
17542 $rm -f testmake.mak
17545 case "$make_set_make" in
17546 '#') echo "Yup, it does.";;
17547 *) echo "Nope, it doesn't.";;
17550 : see what type is used for mode_t
17551 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
17552 set mode_t modetype int stdio.h sys/types.h
17555 : see if stdarg is available
17557 if $test `./findhdr stdarg.h`; then
17558 echo "<stdarg.h> found." >&4
17561 echo "<stdarg.h> NOT found." >&4
17565 : see if varags is available
17567 if $test `./findhdr varargs.h`; then
17568 echo "<varargs.h> found." >&4
17570 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
17573 : set up the varargs testing programs
17574 $cat > varargs.c <<EOP
17576 #include <stdarg.h>
17579 #include <varargs.h>
17583 int f(char *p, ...)
17597 p = va_arg(ap, char *);
17602 $cat > varargs <<EOP
17604 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
17613 : now check which varargs header should be included
17618 if `./varargs I_STDARG`; then
17620 elif `./varargs I_VARARGS`; then
17625 if `./varargs I_VARARGS`; then
17632 echo "I could not find the definition for va_dcl... You have problems..." >&4
17633 val="$undef"; set i_stdarg; eval $setvar
17634 val="$undef"; set i_varargs; eval $setvar
17639 case "$i_varhdr" in
17641 val="$define"; set i_stdarg; eval $setvar
17642 val="$undef"; set i_varargs; eval $setvar
17645 val="$undef"; set i_stdarg; eval $setvar
17646 val="$define"; set i_varargs; eval $setvar
17649 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
17653 : see if we need va_copy
17655 case "$i_stdarg" in
17658 #include <stdarg.h>
17660 #$i_stdlib I_STDLIB
17662 #include <stdlib.h>
17664 #include <signal.h>
17667 ivfprintf(FILE *f, const char *fmt, va_list *valp)
17669 return vfprintf(f, fmt, *valp);
17673 myvfprintf(FILE *f, const char *fmt, va_list val)
17675 return ivfprintf(f, fmt, &val);
17679 myprintf(char *fmt, ...)
17682 va_start(val, fmt);
17683 return myvfprintf(stdout, fmt, val);
17687 main(int ac, char **av)
17689 signal(SIGSEGV, exit);
17691 myprintf("%s%cs all right, then\n", "that", '\'');
17696 if eval $compile && $run ./try 2>&1 >/dev/null; then
17697 case "`$run ./try`" in
17698 "that's all right, then")
17704 yes) echo "It seems that you don't need va_copy()." >&4
17705 need_va_copy="$undef"
17707 *) echo "It seems that va_copy() or similar will be needed." >&4
17708 need_va_copy="$define"
17711 $rm -f try.* core core.* *.core *.core.*
17713 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
17717 : see what type is used for size_t
17718 rp="What is the type used for the length parameter for string functions?"
17719 set size_t sizetype 'unsigned int' stdio.h sys/types.h
17722 : check for type of arguments to gethostbyaddr.
17723 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
17724 case "$d_gethbyaddr" in
17728 Checking to see what type of arguments are accepted by gethostbyaddr().
17730 hdrs="$define sys/types.h
17731 $d_socket sys/socket.h
17732 $i_niin netinet/in.h
17734 $i_unistd unistd.h"
17735 : The first arg can 'char *' or 'void *'
17736 : The second arg is some of integral type
17737 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
17738 for yyy in size_t long int; do
17739 case "$netdb_host_type" in
17740 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
17741 if ./protochk "$try" $hdrs; then
17742 echo "Your system accepts $xxx for the first arg."
17743 echo "...and $yyy for the second arg."
17744 netdb_host_type="$xxx"
17745 netdb_hlen_type="$yyy"
17751 : In case none of those worked, prompt the user.
17752 case "$netdb_host_type" in
17753 '') rp='What is the type for the 1st argument to gethostbyaddr?'
17756 netdb_host_type=$ans
17757 rp='What is the type for the 2nd argument to gethostbyaddr?'
17760 netdb_hlen_type=$ans
17764 *) : no gethostbyaddr, so pick harmless defaults
17765 netdb_host_type='char *'
17766 netdb_hlen_type="$sizetype"
17769 # Remove the "const" if needed. -- but then we'll have a
17771 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
17774 : check for type of argument to gethostbyname.
17775 if test "X$netdb_name_type" = X ; then
17776 case "$d_gethbyname" in
17780 Checking to see what type of argument is accepted by gethostbyname().
17782 hdrs="$define sys/types.h
17783 $d_socket sys/socket.h
17784 $i_niin netinet/in.h
17786 $i_unistd unistd.h"
17787 for xxx in "const char *" "char *"; do
17788 case "$netdb_name_type" in
17789 '') try="extern struct hostent *gethostbyname($xxx);"
17790 if ./protochk "$try" $hdrs; then
17791 echo "Your system accepts $xxx."
17792 netdb_name_type="$xxx"
17797 : In case none of those worked, prompt the user.
17798 case "$netdb_name_type" in
17799 '') rp='What is the type for the 1st argument to gethostbyname?'
17802 netdb_name_type=$ans
17806 *) : no gethostbyname, so pick harmless default
17807 netdb_name_type='char *'
17812 : check for type of 1st argument to getnetbyaddr.
17813 if test "X$netdb_net_type" = X ; then
17814 case "$d_getnbyaddr" in
17818 Checking to see what type of 1st argument is accepted by getnetbyaddr().
17820 hdrs="$define sys/types.h
17821 $d_socket sys/socket.h
17822 $i_niin netinet/in.h
17824 $i_unistd unistd.h"
17825 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
17826 case "$netdb_net_type" in
17827 '') try="extern struct netent *getnetbyaddr($xxx, int);"
17828 if ./protochk "$try" $hdrs; then
17829 echo "Your system accepts $xxx."
17830 netdb_net_type="$xxx"
17835 : In case none of those worked, prompt the user.
17836 case "$netdb_net_type" in
17837 '') rp='What is the type for the 1st argument to getnetbyaddr?'
17840 netdb_net_type=$ans
17844 *) : no getnetbyaddr, so pick harmless default
17845 netdb_net_type='long'
17849 : locate the preferred pager for this system
17856 [a-zA-Z]:/*) dflt=$pg;;
17860 [a-zA-Z]:/*) dflt=$more;;
17864 [a-zA-Z]:/*) dflt=$less;;
17867 '') dflt=/usr/ucb/more;;
17871 : Instruct ./getfile to trust the hinted or previous pager value,
17872 : even if it does not begin with a slash. For example, on os2,
17873 : pager might be cmd /c more. See comments in UU/getfile.
17878 rp='What pager is used on your system?'
17882 : see what type pids are declared as in the kernel
17883 rp="What is the type of process ids on this system?"
17884 set pid_t pidtype int stdio.h sys/types.h
17887 : Find earliest binary compatible site_perl subdirectory perl can use.
17888 xs_apiversion=$version # The current site_perl version.
17889 : Find earliest pure perl site_perl subdirectory perl can use.
17890 : The versioned directories started at 5.005.
17891 pm_apiversion='5.005'
17893 : see if ar generates random libraries by itself
17895 echo "Checking how to generate random libraries on your machine..." >&4
17896 echo 'int bar1() { return bar2(); }' > bar1.c
17897 echo 'int bar2() { return 2; }' > bar2.c
17898 $cat > foo.c <<'EOP'
17899 int main() { printf("%d\n", bar1()); exit(0); }
17901 $cc $ccflags -c bar1.c >/dev/null 2>&1
17902 $cc $ccflags -c bar2.c >/dev/null 2>&1
17903 $cc $ccflags -c foo.c >/dev/null 2>&1
17904 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
17905 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
17906 $run ./foobar >/dev/null 2>&1; then
17907 echo "$ar appears to generate random libraries itself."
17910 elif $ar ts bar$_a >/dev/null 2>&1 &&
17911 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
17912 $run ./foobar >/dev/null 2>&1; then
17913 echo "a table of contents needs to be added with '$ar ts'."
17920 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
17921 $test -f $ranlib || ranlib=''
17924 if $test -n "$ranlib"; then
17925 echo "your system has '$ranlib'; we'll use that."
17928 echo "your system doesn't seem to support random libraries"
17929 echo "so we'll use lorder and tsort to order the libraries."
17936 : check for type of arguments to select.
17937 case "$selecttype" in
17938 '') case "$d_select" in
17942 Checking to see what type of arguments are accepted by select().
17944 hdrs="$define sys/types.h
17945 $i_systime sys/time.h
17946 $i_sysselct sys/select.h
17947 $d_socket sys/socket.h"
17948 : The first arg can be int, unsigned, or size_t
17949 : The last arg may or may not be 'const'
17951 : void pointer has been seen but using that
17952 : breaks the selectminbits test
17953 for xxx in 'fd_set *' 'int *'; do
17954 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
17955 for tmo in 'struct timeval *' 'const struct timeval *'; do
17957 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
17958 if ./protochk "$try" $hdrs; then
17959 echo "Your system accepts $xxx."
17968 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
17969 case "$d_fd_set" in
17970 $define) dflt="fd_set *" ;;
17979 *) : no select, so pick a harmless default
17986 : check for the select 'width'
17987 case "$selectminbits" in
17988 '') case "$d_select" in
17992 Checking to see on how many bits at a time your select() operates...
17995 #include <sys/types.h>
17997 #$i_systime I_SYS_TIME
17998 #$i_systimek I_SYS_TIME_KERNEL
18003 # ifdef I_SYS_TIME_KERNEL
18006 # include <sys/time.h>
18007 # ifdef I_SYS_TIME_KERNEL
18011 #$i_sysselct I_SYS_SELECT
18012 #ifdef I_SYS_SELECT
18013 #include <sys/select.h>
18015 #$d_socket HAS_SOCKET
18017 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
18021 #define S sizeof(*(b))
18023 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
18024 #define NBITS (NBYTES * 8)
18033 fp = fopen("try.c", "r");
18039 b = ($selecttype)s;
18040 for (i = 0; i < NBITS; i++)
18044 select(fd + 1, b, 0, 0, &t);
18045 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
18046 printf("%d\n", i + 1);
18051 if eval $compile_ok; then
18052 selectminbits=`$run ./try`
18053 case "$selectminbits" in
18055 Cannot figure out on how many bits at a time your select() operates.
18056 I'll play safe and guess it is 32 bits.
18062 *) bits="$selectminbits bits" ;;
18064 echo "Your select() operates on $bits at a time." >&4
18066 rp='What is the minimum number of bits your select() operates on?'
18067 case "$byteorder" in
18068 1234|12345678) dflt=32 ;;
18073 selectminbits="$val"
18077 *) : no select, so pick a harmless default
18084 : Trace out the files included by signal.h, then look for SIGxxx names.
18085 : Remove SIGARRAYSIZE used by HPUX.
18086 : Remove SIGSTKSIZE used by Linux.
18087 : Remove SIGSTKSZ used by Posix.
18088 : Remove SIGTYP void lines used by OS2.
18089 : Some cpps, like os390, dont give the file name anywhere
18090 if [ "X$fieldn" = X ]; then
18091 : Just make some guesses. We check them later.
18092 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
18094 xxx=`echo '#include <signal.h>' |
18095 $cppstdin $cppminus $cppflags 2>/dev/null |
18096 $grep '^[ ]*#.*include' |
18097 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
18099 : Check this list of files to be sure we have parsed the cpp output ok.
18100 : This will also avoid potentially non-existent files, such
18103 for xx in $xxx /dev/null ; do
18104 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
18106 : If we have found no files, at least try signal.h
18107 case "$xxxfiles" in
18108 '') xxxfiles=`./findhdr signal.h` ;;
18111 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
18112 print substr($2, 4, 20)
18114 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
18115 print substr($3, 4, 20)
18117 : Append some common names just in case the awk scan failed.
18118 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
18119 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
18120 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
18121 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
18122 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
18124 : generate a few handy files for later
18125 $cat > signal.c <<'EOCP'
18126 #include <sys/types.h>
18127 #include <signal.h>
18131 /* Strange style to avoid deeply-nested #if/#else/#endif */
18134 # define NSIG (_NSIG)
18140 # define NSIG (SIGMAX+1)
18146 # define NSIG (SIG_MAX+1)
18152 # define NSIG (MAXSIG+1)
18158 # define NSIG (MAX_SIG+1)
18163 # ifdef SIGARRAYSIZE
18164 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
18170 # define NSIG (_sys_nsig) /* Solaris 2.5 */
18174 /* Default to some arbitrary number that's big enough to get most
18175 of the common signals.
18181 printf("NSIG %d\n", NSIG);
18187 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
18189 printf "#ifdef SIG"; printf $1; printf "\n"
18190 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
18191 printf $1; printf ");\n"
18195 printf "#endif /* JUST_NSIG */\n";
18196 printf "exit(0);\n}\n";
18199 $cat >signal.awk <<'EOP'
18200 BEGIN { ndups = 0 }
18201 $1 ~ /^NSIG$/ { nsig = $2 }
18202 ($1 !~ /^NSIG$/) && (NF == 2) {
18203 if ($2 > maxsig) { maxsig = $2 }
18204 if (sig_name[$2]) {
18205 dup_name[ndups] = $1
18206 dup_num[ndups] = $2
18218 printf("NSIG %d\n", nsig);
18219 for (n = 1; n < nsig; n++) {
18221 printf("%s %d\n", sig_name[n], sig_num[n])
18224 printf("NUM%d %d\n", n, n)
18227 for (n = 0; n < ndups; n++) {
18228 printf("%s %d\n", dup_name[n], dup_num[n])
18232 $cat >signal_cmd <<EOS
18234 if $test -s signal.lst; then
18235 echo "Using your existing signal.lst file"
18240 $cat >>signal_cmd <<'EOS'
18243 if eval $compile_ok; then
18244 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
18246 echo "(I can't seem be able to compile the whole test program)" >&4
18247 echo "(I'll try it in little pieces.)" >&4
18248 set signal -DJUST_NSIG
18249 if eval $compile_ok; then
18250 $run ./signal$_exe > signal.nsg
18253 echo "I can't seem to figure out how many signals you have." >&4
18254 echo "Guessing 50." >&4
18255 echo 'NSIG 50' > signal.nsg
18257 : Now look at all the signal names, one at a time.
18258 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
18259 $cat > signal.c <<EOCP
18260 #include <sys/types.h>
18261 #include <signal.h>
18264 printf("$xx %d\n", SIG${xx});
18269 if eval $compile; then
18270 echo "SIG${xx} found."
18271 $run ./signal$_exe >> signal.ls1
18273 echo "SIG${xx} NOT found."
18276 if $test -s signal.ls1; then
18277 $cat signal.nsg signal.ls1 |
18278 $sort -n | $uniq | $awk -f signal.awk >signal.lst
18282 if $test -s signal.lst; then
18285 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
18286 echo 'kill -l' >signal
18287 set X `csh -f <signal`
18291 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
18293 echo $@ | $tr ' ' $trnl | \
18294 $awk '{ printf "%s %d\n", $1, ++s; }
18295 END { printf "NSIG %d\n", ++s }' >signal.lst
18297 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
18299 chmod a+x signal_cmd
18300 $eunicefix signal_cmd
18302 : generate list of signal names
18304 case "$sig_name_init" in
18306 *) case "$sig_num_init" in
18307 ''|*,*) doinit=yes ;;
18312 echo "Generating a list of signal names and numbers..." >&4
18314 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
18315 sig_name=`$awk 'BEGIN { printf "ZERO " }
18316 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
18317 sig_num=`$awk 'BEGIN { printf "0 " }
18318 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
18319 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
18320 !/^NSIG/ { printf "\"%s\", ", $1 }
18321 END { printf "0\n" }' signal.lst`
18322 sig_num_init=`$awk 'BEGIN { printf "0, " }
18323 !/^NSIG/ { printf "%d, ", $2}
18324 END { printf "0\n"}' signal.lst`
18327 echo "The following $sig_count signals are available:"
18329 echo $sig_name | $awk \
18330 'BEGIN { linelen = 0 }
18332 for (i = 1; i <= NF; i++) {
18333 name = "SIG" $i " "
18334 linelen = linelen + length(name)
18335 if (linelen > 70) {
18337 linelen = length(name)
18343 sig_size=`echo $sig_name | awk '{print NF}'`
18344 $rm -f signal signal.c signal.awk signal.lst signal_cmd
18347 case "$sizetype" in
18348 *_t) zzz="$sizetype" ;;
18349 *) zzz="filesize" ;;
18351 echo "Checking the size of $zzz..." >&4
18353 #include <sys/types.h>
18356 printf("%d\n", (int)sizeof($sizetype));
18361 if eval $compile_ok; then
18365 echo "(I can't execute the test program--guessing $sizesize.)" >&4
18368 echo "Your $zzz size is $sizesize bytes."
18373 echo "(I can't compile the test program--guessing $sizesize.)" >&4
18377 : check for socklen_t
18379 echo "Checking to see if you have socklen_t..." >&4
18381 #include <sys/types.h>
18382 #$d_socket HAS_SOCKET
18384 #include <sys/socket.h>
18386 int main() { socklen_t x = 16; }
18389 if eval $compile; then
18391 echo "You have socklen_t."
18394 echo "You do not have socklen_t."
18395 case "$sizetype" in
18396 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
18403 : see if this is a socks.h system
18404 set socks.h i_socks
18407 : check for type of the size argument to socket calls
18408 case "$d_socket" in
18412 Checking to see what type is the last argument of accept().
18415 case "$d_socklen_t" in
18416 "$define") yyy="$yyy socklen_t"
18418 yyy="$yyy $sizetype int long unsigned"
18419 for xxx in $yyy; do
18420 case "$socksizetype" in
18421 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
18422 case "$usesocks" in
18424 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
18425 echo "Your system accepts '$xxx *' for the last argument of accept()."
18426 socksizetype="$xxx"
18429 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
18430 echo "Your system accepts '$xxx *' for the last argument of accept()."
18431 socksizetype="$xxx"
18438 : In case none of those worked, prompt the user.
18439 case "$socksizetype" in
18440 '') rp='What is the type for socket address structure sizes?'
18447 *) : no sockets, so pick relatively harmless default
18452 : see what type is used for signed size_t
18453 set ssize_t ssizetype int stdio.h sys/types.h
18458 #include <sys/types.h>
18459 #define Size_t $sizetype
18460 #define SSize_t $dflt
18463 if (sizeof(Size_t) == sizeof(SSize_t))
18465 else if (sizeof(Size_t) == sizeof(int))
18474 if eval $compile_ok && $run ./try > /dev/null; then
18475 ssizetype=`$run ./try`
18476 echo "I'll be using $ssizetype for functions returning a byte count." >&4
18479 Help! I can't compile and run the ssize_t test program: please enlighten me!
18480 (This is probably a misconfiguration in your system or libraries, and
18481 you really ought to fix it. Still, I'll try anyway.)
18483 I need a type that is the same size as $sizetype, but is guaranteed to
18484 be signed. Common values are ssize_t, int and long.
18487 rp="What signed type is the same size as $sizetype?"
18493 : see what type of char stdio uses.
18495 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
18496 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
18497 echo "Your stdio uses unsigned chars." >&4
18498 stdchar="unsigned char"
18500 echo "Your stdio uses signed chars." >&4
18507 : see what type uids are declared as in the kernel
18509 echo "Looking for the type for user ids returned by getuid()."
18510 set uid_t uidtype xxx stdio.h sys/types.h
18514 xxx=`./findhdr sys/user.h`
18515 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18517 unsigned) dflt="$1 $2" ;;
18521 *) dflt="$uidtype";;
18524 uid_t) echo "uid_t found." ;;
18525 *) rp="What is the type for user ids returned by getuid()?"
18533 *_t) zzz="$uidtype" ;;
18536 echo "Checking the size of $zzz..." >&4
18538 #include <sys/types.h>
18541 printf("%d\n", (int)sizeof($uidtype));
18546 if eval $compile_ok; then
18550 echo "(I can't execute the test program--guessing $uidsize.)" >&4
18553 echo "Your $zzz is $uidsize bytes long."
18558 echo "(I can't compile the test program--guessing $uidsize.)" >&4
18563 *_t) zzz="$uidtype" ;;
18566 echo "Checking the sign of $zzz..." >&4
18568 #include <sys/types.h>
18579 if eval $compile; then
18583 echo "(I can't execute the test program--guessing unsigned.)" >&4
18587 1) echo "Your $zzz is unsigned." ;;
18588 -1) echo "Your $zzz is signed." ;;
18594 echo "(I can't compile the test program--guessing unsigned.)" >&4
18600 $echo "Checking the format string to be used for uids..." >&4
18603 -1) if $test X"$uidsize" = X"$ivsize"; then
18604 uidformat="$ivdformat"
18606 if $test X"$uidsize" = X"$longsize"; then
18609 if $test X"$uidsize" = X"$intsize"; then
18612 if $test X"$uidsize" = X"$shortsize"; then
18619 *) if $test X"$uidsize" = X"$uvsize"; then
18620 uidformat="$uvuformat"
18622 if $test X"$uidsize" = X"$longsize"; then
18625 if $test X"$uidsize" = X"$intsize"; then
18628 if $test X"$uidsize" = X"$shortsize"; then
18637 : determine compiler compiler
18646 if $test -f "$byacc$_exe"; then
18648 comp="byacc or $comp"
18650 if $test -f "$bison$_exe"; then
18651 comp="$comp or bison -y"
18653 rp="Which compiler compiler ($comp) shall I use?"
18662 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
18668 : see if this is a fp.h system
18672 : see if this is a fp_class.h system
18673 set fp_class.h i_fp_class
18676 : see if this is a ieeefp.h system
18677 case "$i_ieeefp" in
18678 '' ) set ieeefp.h i_ieeefp
18683 : see if this is a libutil.h system
18684 set libutil.h i_libutil
18687 : see if mach cthreads are available
18688 if test "X$usethreads" = "X$define"; then
18689 set mach/cthreads.h i_machcthr
18692 i_machcthr="$undef"
18697 : see if this is a math.h system
18701 : see if this is a mntent.h system
18702 set mntent.h i_mntent
18705 : see if ndbm.h is available
18711 # Some Linux distributions such as RedHat 7.1 put the
18712 # ndbm.h header in /usr/include/gdbm/ndbm.h.
18713 if $test -f /usr/include/gdbm/ndbm.h; then
18714 echo '<gdbm/ndbm.h> found.'
18715 ccflags="$ccflags -I/usr/include/gdbm"
18716 cppflags="$cppflags -I/usr/include/gdbm"
18724 : see if dbm_open exists
18725 set dbm_open d_dbm_open
18727 case "$d_dbm_open" in
18730 echo "We won't be including <ndbm.h>"
18739 : see if net/errno.h is available
18741 set net/errno.h val
18744 : Unfortunately, it causes problems on some systems. Arrgh.
18747 cat > try.c <<'EOM'
18750 #include <net/errno.h>
18756 if $cc $ccflags -c try.c >/dev/null 2>&1; then
18757 echo "We'll be including <net/errno.h>." >&4
18759 echo "We won't be including <net/errno.h>." >&4
18768 : see if netinet/tcp.h is available
18769 set netinet/tcp.h i_netinettcp
18772 : see if this is a poll.h system
18776 : see if this is a prot.h system
18781 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
18782 $cat <<'EOSH' > Cppsym.know
18783 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
18784 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
18785 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
18786 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
18787 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
18788 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
18789 bull c cadmus clipper CMU COFF COMPILER_VERSION
18790 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
18791 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
18792 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
18793 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
18795 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
18796 H3050R H3050RX hbullx20 hcx host_mips
18797 hp200 hp300 hp700 HP700 hp800 hp9000
18798 hp9000s200 hp9000s300 hp9000s400 hp9000s500
18799 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
18800 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
18801 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
18802 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
18803 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
18804 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
18805 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
18806 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
18807 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
18808 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
18809 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
18810 MATH_HAS_NO_SIDE_EFFECTS
18811 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
18812 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
18813 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
18814 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
18815 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
18816 NetBSD news1500 news1700 news1800 news1900 news3700
18817 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
18818 ns32016 ns32332 ns32k nsc32000
18819 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
18820 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
18821 pc532 pdp11 PGC PIC plexus PORTAR posix
18822 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
18823 POSIX_C_SOURCE POSIX_SOURCE POWER
18824 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
18825 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
18826 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
18827 sony sony_news sonyrisc sparc sparclite spectrum
18828 stardent stdc STDC_EXT stratos sun sun3 sun386
18829 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
18830 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
18831 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
18832 sysV68 sysV88 Tek4132 Tek4300 titan
18833 TM3200 TM5400 TM5600
18834 tower tower32 tower32_200 tower32_600 tower32_700
18835 tower32_800 tower32_850 tss
18836 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
18837 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
18838 unix UNIX95 UNIX99 unixpc unos
18839 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
18840 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
18841 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
18843 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
18844 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
18845 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
18848 # Maybe put other stuff here too.
18849 cat <<EOSH >>Cppsym.know
18852 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
18853 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
18854 $cat Cppsym.know > Cppsym.c
18855 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
18856 $rm -f Cppsym.a Cppsym.b Cppsym.c
18857 cat <<EOSH > Cppsym
18859 if $test \$# -gt 0; then
18860 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
18861 if $test -s Cppsym.got; then
18868 $tr " " "$trnl" | ./Cppsym.try
18874 cat <<EOSH > Cppsym.try
18876 cat <<'EOCP' > try.c
18882 cat <<'EOSH' >> Cppsym.try
18884 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
18885 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
18886 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
18887 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
18889 echo 'return 0;}' >> try.c
18891 cat <<EOSH >> Cppsym.try
18893 case "$osname-$gccversion" in
18894 irix-) ccflags="\$ccflags -woff 1178" ;;
18895 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
18897 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
18899 chmod +x Cppsym.try
18900 $eunicefix Cppsym.try
18901 ./Cppsym < Cppsym.know > Cppsym.true
18902 : now check the C compiler for additional symbols
18903 postprocess_cc_v=''
18905 aix) postprocess_cc_v="|$tr , ' '" ;;
18912 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
18915 -D*) echo "\$i" | $sed 's/^-D//';;
18916 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
18921 postprocess_cc_v=''
18924 ./ccsym > ccsym1.raw
18925 if $test -s ccsym1.raw; then
18926 $sort ccsym1.raw | $uniq >ccsym.raw
18928 mv ccsym1.raw ccsym.raw
18931 $awk '/\=/ { print $0; next }
18932 { print $0"=1" }' ccsym.raw >ccsym.list
18933 $awk '/\=/ { print $0; next }
18934 { print $0"=1" }' Cppsym.true >ccsym.true
18935 $comm -13 ccsym.true ccsym.list >ccsym.own
18936 $comm -12 ccsym.true ccsym.list >ccsym.com
18937 $comm -23 ccsym.true ccsym.list >ccsym.cpp
18939 if $test -z ccsym.raw; then
18940 echo "Your C compiler doesn't seem to define any symbols!" >&4
18942 echo "However, your C preprocessor defines the following symbols:"
18945 cppsymbols=`$cat Cppsym.true`
18946 cppsymbols=`echo $cppsymbols`
18947 cppccsymbols="$cppsymbols"
18949 if $test -s ccsym.com; then
18950 echo "Your C compiler and pre-processor define these symbols:"
18951 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
18954 cppccsymbols=`$cat ccsym.com`
18955 cppccsymbols=`echo $cppccsymbols`
18956 $test "$silent" || sleep 1
18958 if $test -s ccsym.cpp; then
18959 $test "$also" && echo " "
18960 echo "Your C pre-processor ${also}defines the following symbols:"
18961 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
18963 cppsymbols=`$cat ccsym.cpp`
18964 cppsymbols=`echo $cppsymbols`
18965 $test "$silent" || sleep 1
18967 if $test -s ccsym.own; then
18968 $test "$also" && echo " "
18969 echo "Your C compiler ${also}defines the following cpp symbols:"
18970 $sed -e 's/\(..*\)=1/\1/' ccsym.own
18971 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
18972 ccsymbols=`$cat ccsym.own`
18973 ccsymbols=`echo $ccsymbols`
18974 $test "$silent" || sleep 1
18978 : see if this is a termio system
18982 if $test `./findhdr termios.h`; then
18983 set tcsetattr i_termios
18989 "$define") echo "You have POSIX termios.h... good!" >&4;;
18990 *) if ./Cppsym pyr; then
18991 case "`/bin/universe`" in
18992 ucb) if $test `./findhdr sgtty.h`; then
18994 echo "<sgtty.h> found." >&4
18996 echo "System is pyramid with BSD universe."
18997 echo "<sgtty.h> not found--you could have problems." >&4
18999 *) if $test `./findhdr termio.h`; then
19001 echo "<termio.h> found." >&4
19003 echo "System is pyramid with USG universe."
19004 echo "<termio.h> not found--you could have problems." >&4
19008 if $test `./findhdr termio.h`; then
19009 echo "<termio.h> found." >&4
19011 elif $test `./findhdr sgtty.h`; then
19012 echo "<sgtty.h> found." >&4
19015 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
19018 if $test `./findhdr sgtty.h`; then
19019 echo "<sgtty.h> found." >&4
19021 elif $test `./findhdr termio.h`; then
19022 echo "<termio.h> found." >&4
19025 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
19029 set i_termio; eval $setvar
19030 val=$val2; set i_sgtty; eval $setvar
19031 val=$val3; set i_termios; eval $setvar
19033 : see if stddef is available
19034 set stddef.h i_stddef
19037 : see if this is a sunmath.h system
19038 set sunmath.h i_sunmath
19041 : see if sys/access.h is available
19042 set sys/access.h i_sysaccess
19045 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
19046 set sys/filio.h i_sysfilio
19049 if $test `./findhdr sys/ioctl.h`; then
19051 echo '<sys/ioctl.h> found.' >&4
19054 if $test $i_sysfilio = "$define"; then
19055 echo '<sys/ioctl.h> NOT found.' >&4
19057 $test $i_sgtty = "$define" && xxx="sgtty.h"
19058 $test $i_termio = "$define" && xxx="termio.h"
19059 $test $i_termios = "$define" && xxx="termios.h"
19060 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
19066 : see if socket ioctl defs are in sys/sockio.h
19068 xxx=`./findhdr sys/sockio.h`
19069 if $test "$xxx"; then
19070 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
19072 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
19075 echo "No socket ioctls found in <sys/sockio.h>." >&4
19080 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
19087 : see if this is a syslog.h system
19088 set syslog.h i_syslog
19092 : see if this is a sys/mode.h system
19093 set sys/mode.h i_sysmode
19096 : see if sys/resource.h has to be included
19097 set sys/resource.h i_sysresrc
19100 : see if sys/security.h is available
19101 set sys/security.h i_syssecrt
19104 : see if this is a sys/statvfs.h system
19105 set sys/statvfs.h i_sysstatvfs
19108 : see if this is a sys/un.h system
19109 set sys/un.h i_sysun
19113 : see if this is a sys/utsname.h system
19114 set sys/utsname.h i_sysutsname
19117 : see if this is a syswait system
19118 set sys/wait.h i_syswait
19121 : see if this is a ustat.h system
19122 set ustat.h i_ustat
19125 : see if this is an utime system
19126 set utime.h i_utime
19129 : see if this is a values.h system
19130 set values.h i_values
19133 : see if this is a vfork system
19136 set vfork.h i_vfork
19144 : see if gdbm.h is available
19149 : see if gdbm_open exists
19150 set gdbm_open d_gdbm_open
19152 case "$d_gdbm_open" in
19155 echo "We won't be including <gdbm.h>"
19165 echo "Looking for extensions..." >&4
19166 : If we are using the old config.sh, known_extensions may contain
19167 : old or inaccurate or duplicate values.
19168 known_extensions=''
19169 nonxs_extensions=''
19170 : We do not use find because it might not be available.
19171 : We do not just use MANIFEST because the user may have dropped
19172 : some additional extensions into the source tree and expect them
19175 : Function to recursively find available extensions, ignoring DynaLoader
19176 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
19180 DynaLoader|dynaload) ;;
19182 if $test -f $xxx/$xxx.xs; then
19183 known_extensions="$known_extensions $1$xxx";
19184 elif $test -f $xxx/Makefile.PL; then
19185 nonxs_extensions="$nonxs_extensions $1$xxx";
19187 if $test -d $xxx -a $# -lt 10; then
19190 eval $find_extensions;
19202 eval $find_extensions
19203 # Special case: Add in threads/shared since it is not picked up by the
19204 # recursive find above (and adding in general recursive finding breaks
19205 # SDBM_File/sdbm). A.D. 10/25/2001.
19206 known_extensions="$known_extensions threads/shared"
19207 set X $nonxs_extensions
19209 nonxs_extensions="$*"
19210 set X $known_extensions
19212 known_extensions="$*"
19215 : Now see which are supported on this system.
19217 for xxx in $known_extensions ; do
19221 $define) avail_ext="$avail_ext $xxx" ;;
19224 GDBM_File|gdbm_fil)
19226 $define) avail_ext="$avail_ext $xxx" ;;
19229 I18N/Langinfo|i18n_lan)
19230 case "$i_langinfo$d_nl_langinfo" in
19231 $define$define) avail_ext="$avail_ext $xxx" ;;
19234 NDBM_File|ndbm_fil)
19237 case "$osname-$use64bitint" in
19238 cygwin-*|hpux-define)
19240 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
19243 *) avail_ext="$avail_ext $xxx" ;;
19248 ODBM_File|odbm_fil)
19249 case "${i_dbm}${i_rpcsvcdbm}" in
19251 case "$osname-$use64bitint" in
19252 cygwin-*|hpux-define)
19254 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
19257 *) avail_ext="$avail_ext $xxx" ;;
19263 case "$useposix" in
19264 true|define|y) avail_ext="$avail_ext $xxx" ;;
19268 case "$useopcode" in
19269 true|define|y) avail_ext="$avail_ext $xxx" ;;
19273 case "$d_socket" in
19276 beos) ;; # not unless BONE
19277 *) avail_ext="$avail_ext $xxx" ;;
19282 Sys/Syslog|sys/syslog)
19283 : XXX syslog requires socket
19284 case "$d_socket" in
19285 true|$define|y) avail_ext="$avail_ext $xxx" ;;
19289 case "$usethreads" in
19291 case "$useithreads" in
19292 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
19296 threads|threads/shared)
19297 # threads and threads::shared are special cases.
19298 # To stop people from asking "Perl 5.8.0 was supposed
19299 # to have this new fancy threads implementation but my
19300 # perl doesn't have it" and from people trying to
19301 # (re)install the threads module using CPAN.pm and
19302 # CPAN.pm then offering to reinstall Perl 5.8.0,
19303 # the threads.pm and threads/shared.pm will always be
19304 # there, croaking informatively ("you need to rebuild
19305 # all of Perl with threads, sorry") when threads haven't
19306 # been compiled in.
19308 avail_ext="$avail_ext $xxx"
19311 : XXX Do we need a useipcsysv variable here
19312 case "${d_msg}${d_sem}${d_shm}" in
19313 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
19316 *) avail_ext="$avail_ext $xxx"
19325 : Now see which nonxs extensions are supported on this system.
19326 : For now assume all are.
19328 for xxx in $nonxs_extensions ; do
19330 *) nonxs_ext="$nonxs_ext $xxx"
19342 A number of extensions are supplied with $package. You may choose to
19343 compile these extensions for dynamic loading (the default), compile
19344 them into the $package executable (static loading), or not include
19345 them at all. Answer "none" to include no extensions.
19346 Note that DynaLoader is always built and need not be mentioned here.
19349 case "$dynamic_ext" in
19350 '') dflt="$avail_ext" ;;
19351 *) dflt="$dynamic_ext"
19352 # Perhaps we are reusing an old out-of-date config.sh.
19355 if test X"$dynamic_ext" != X"$avail_ext"; then
19357 NOTICE: Your previous config.sh list may be incorrect.
19358 The extensions now available to you are
19360 but the default list from your previous config.sh is
19372 rp="What extensions do you wish to load dynamically?"
19375 none) dynamic_ext=' ' ;;
19376 *) dynamic_ext="$ans" ;;
19379 case "$static_ext" in
19381 : Exclude those already listed in dynamic linking
19383 for xxx in $avail_ext; do
19384 case " $dynamic_ext " in
19386 *) dflt="$dflt $xxx" ;;
19393 *) dflt="$static_ext"
19400 rp="What extensions do you wish to load statically?"
19403 none) static_ext=' ' ;;
19404 *) static_ext="$ans" ;;
19409 A number of extensions are supplied with $package. Answer "none"
19410 to include no extensions.
19411 Note that DynaLoader is always built and need not be mentioned here.
19414 case "$static_ext" in
19415 '') dflt="$avail_ext" ;;
19416 *) dflt="$static_ext"
19417 # Perhaps we are reusing an old out-of-date config.sh.
19420 if test X"$static_ext" != X"$avail_ext"; then
19422 NOTICE: Your previous config.sh list may be incorrect.
19423 The extensions now available to you are
19425 but the default list from your previous config.sh is
19434 : Exclude those that are not xs extensions
19438 rp="What extensions do you wish to include?"
19441 none) static_ext=' ' ;;
19442 *) static_ext="$ans" ;;
19447 # Encode is a special case. If we are building Encode as a static
19448 # extension, we need to explicitly list its subextensions as well.
19449 # For other nested extensions, this is handled automatically by
19450 # the appropriate Makefile.PL.
19451 case " $static_ext " in
19452 *" Encode "*) # Add the subextensions of Encode
19454 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
19455 static_ext="$static_ext Encode/$xxx"
19461 set X $dynamic_ext $static_ext $nonxs_ext
19465 : Remove libraries needed only for extensions
19466 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
19467 : The exception is SunOS 4.x, which needs them.
19468 case "${osname}X${osvers}" in
19472 *) case "$usedl" in
19473 $define|true|[yY]*)
19474 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
19478 *) perllibs="$libs"
19484 : Remove build directory name from cppstdin so it can be used from
19485 : either the present location or the final installed location.
19487 : Get out of the UU directory to get correct path name.
19489 case "$cppstdin" in
19491 echo "Stripping down cppstdin path name"
19497 : end of configuration questions
19499 echo "End of configuration questions."
19502 : back to where it started
19503 if test -d ../UU; then
19507 : configuration may be patched via a 'config.arch' file
19508 if $test -f config.arch; then
19509 echo "I see a config.arch file, loading it."
19513 : configuration may be patched via a 'config.over' file
19514 if $test -f config.over; then
19517 rp='I see a config.over file. Do you wish to load it?'
19520 n*) echo "OK, I'll ignore it.";;
19522 echo "Configuration override changes have been loaded."
19527 : in case they want portability, strip down executable paths
19528 case "$d_portable" in
19531 echo "Stripping down executable paths..." >&4
19532 for file in $loclist $trylist; do
19534 eval $file=`basename $temp`
19539 : create config.sh file
19541 echo "Creating config.sh..." >&4
19542 $spitshell <<EOT >config.sh
19545 # This file was produced by running the Configure script. It holds all the
19546 # definitions figured out by Configure. Should you modify one of these values,
19547 # do not forget to propagate your changes by running "Configure -der". You may
19548 # instead choose to run each of the .SH files by yourself, or "Configure -S".
19551 # Package name : $package
19552 # Source directory : $src
19553 # Configuration time: $cf_time
19554 # Configured by : $cf_by
19555 # Target system : $myuname
19565 Revision='$Revision'
19573 alignbytes='$alignbytes'
19574 ansi2knr='$ansi2knr'
19575 aphostname='$aphostname'
19576 api_revision='$api_revision'
19577 api_subversion='$api_subversion'
19578 api_version='$api_version'
19579 api_versionstring='$api_versionstring'
19582 archlibexp='$archlibexp'
19583 archname64='$archname64'
19584 archname='$archname'
19585 archobjs='$archobjs'
19586 asctime_r_proto='$asctime_r_proto'
19594 byteorder='$byteorder'
19596 castflags='$castflags'
19599 cccdlflags='$cccdlflags'
19600 ccdlflags='$ccdlflags'
19602 ccflags_uselargefiles='$ccflags_uselargefiles'
19604 ccsymbols='$ccsymbols'
19605 ccversion='$ccversion'
19607 cf_email='$cf_email'
19609 charsize='$charsize'
19613 clocktype='$clocktype'
19615 compress='$compress'
19616 contains='$contains'
19620 cpp_stuff='$cpp_stuff'
19621 cppccsymbols='$cppccsymbols'
19622 cppflags='$cppflags'
19624 cppminus='$cppminus'
19626 cppstdin='$cppstdin'
19627 cppsymbols='$cppsymbols'
19628 crypt_r_proto='$crypt_r_proto'
19629 cryptlib='$cryptlib'
19631 ctermid_r_proto='$ctermid_r_proto'
19632 ctime_r_proto='$ctime_r_proto'
19633 d_Gconvert='$d_Gconvert'
19634 d_PRIEUldbl='$d_PRIEUldbl'
19635 d_PRIFUldbl='$d_PRIFUldbl'
19636 d_PRIGUldbl='$d_PRIGUldbl'
19637 d_PRIXU64='$d_PRIXU64'
19638 d_PRId64='$d_PRId64'
19639 d_PRIeldbl='$d_PRIeldbl'
19640 d_PRIfldbl='$d_PRIfldbl'
19641 d_PRIgldbl='$d_PRIgldbl'
19642 d_PRIi64='$d_PRIi64'
19643 d_PRIo64='$d_PRIo64'
19644 d_PRIu64='$d_PRIu64'
19645 d_PRIx64='$d_PRIx64'
19646 d_SCNfldbl='$d_SCNfldbl'
19647 d__fwalk='$d__fwalk'
19648 d_access='$d_access'
19649 d_accessx='$d_accessx'
19651 d_archlib='$d_archlib'
19652 d_asctime_r='$d_asctime_r'
19655 d_attribut='$d_attribut'
19659 d_bsdgetpgrp='$d_bsdgetpgrp'
19660 d_bsdsetpgrp='$d_bsdsetpgrp'
19662 d_casti32='$d_casti32'
19663 d_castneg='$d_castneg'
19664 d_charvspr='$d_charvspr'
19666 d_chroot='$d_chroot'
19667 d_chsize='$d_chsize'
19669 d_closedir='$d_closedir'
19670 d_cmsghdr_s='$d_cmsghdr_s'
19673 d_crypt_r='$d_crypt_r'
19675 d_ctermid_r='$d_ctermid_r'
19676 d_ctime_r='$d_ctime_r'
19677 d_cuserid='$d_cuserid'
19678 d_dbl_dig='$d_dbl_dig'
19679 d_dbminitproto='$d_dbminitproto'
19680 d_difftime='$d_difftime'
19682 d_dirnamlen='$d_dirnamlen'
19683 d_dlerror='$d_dlerror'
19684 d_dlopen='$d_dlopen'
19685 d_dlsymun='$d_dlsymun'
19686 d_dosuid='$d_dosuid'
19687 d_drand48_r='$d_drand48_r'
19688 d_drand48proto='$d_drand48proto'
19690 d_eaccess='$d_eaccess'
19691 d_endgrent='$d_endgrent'
19692 d_endgrent_r='$d_endgrent_r'
19693 d_endhent='$d_endhent'
19694 d_endhostent_r='$d_endhostent_r'
19695 d_endnent='$d_endnent'
19696 d_endnetent_r='$d_endnetent_r'
19697 d_endpent='$d_endpent'
19698 d_endprotoent_r='$d_endprotoent_r'
19699 d_endpwent='$d_endpwent'
19700 d_endpwent_r='$d_endpwent_r'
19701 d_endsent='$d_endsent'
19702 d_endservent_r='$d_endservent_r'
19703 d_eofnblk='$d_eofnblk'
19704 d_eunice='$d_eunice'
19705 d_fchdir='$d_fchdir'
19706 d_fchmod='$d_fchmod'
19707 d_fchown='$d_fchown'
19709 d_fcntl_can_lock='$d_fcntl_can_lock'
19710 d_fd_macros='$d_fd_macros'
19711 d_fd_set='$d_fd_set'
19712 d_fds_bits='$d_fds_bits'
19713 d_fgetpos='$d_fgetpos'
19714 d_finite='$d_finite'
19715 d_finitel='$d_finitel'
19716 d_flexfnam='$d_flexfnam'
19718 d_flockproto='$d_flockproto'
19720 d_fp_class='$d_fp_class'
19721 d_fpathconf='$d_fpathconf'
19722 d_fpclass='$d_fpclass'
19723 d_fpclassify='$d_fpclassify'
19724 d_fpclassl='$d_fpclassl'
19725 d_fpos64_t='$d_fpos64_t'
19726 d_frexpl='$d_frexpl'
19727 d_fs_data_s='$d_fs_data_s'
19728 d_fseeko='$d_fseeko'
19729 d_fsetpos='$d_fsetpos'
19730 d_fstatfs='$d_fstatfs'
19731 d_fstatvfs='$d_fstatvfs'
19733 d_ftello='$d_ftello'
19735 d_getcwd='$d_getcwd'
19736 d_getespwnam='$d_getespwnam'
19737 d_getfsstat='$d_getfsstat'
19738 d_getgrent='$d_getgrent'
19739 d_getgrent_r='$d_getgrent_r'
19740 d_getgrgid_r='$d_getgrgid_r'
19741 d_getgrnam_r='$d_getgrnam_r'
19742 d_getgrps='$d_getgrps'
19743 d_gethbyaddr='$d_gethbyaddr'
19744 d_gethbyname='$d_gethbyname'
19745 d_gethent='$d_gethent'
19746 d_gethname='$d_gethname'
19747 d_gethostbyaddr_r='$d_gethostbyaddr_r'
19748 d_gethostbyname_r='$d_gethostbyname_r'
19749 d_gethostent_r='$d_gethostent_r'
19750 d_gethostprotos='$d_gethostprotos'
19751 d_getitimer='$d_getitimer'
19752 d_getlogin='$d_getlogin'
19753 d_getlogin_r='$d_getlogin_r'
19754 d_getmnt='$d_getmnt'
19755 d_getmntent='$d_getmntent'
19756 d_getnbyaddr='$d_getnbyaddr'
19757 d_getnbyname='$d_getnbyname'
19758 d_getnent='$d_getnent'
19759 d_getnetbyaddr_r='$d_getnetbyaddr_r'
19760 d_getnetbyname_r='$d_getnetbyname_r'
19761 d_getnetent_r='$d_getnetent_r'
19762 d_getnetprotos='$d_getnetprotos'
19763 d_getpagsz='$d_getpagsz'
19764 d_getpbyname='$d_getpbyname'
19765 d_getpbynumber='$d_getpbynumber'
19766 d_getpent='$d_getpent'
19767 d_getpgid='$d_getpgid'
19768 d_getpgrp2='$d_getpgrp2'
19769 d_getpgrp='$d_getpgrp'
19770 d_getppid='$d_getppid'
19771 d_getprior='$d_getprior'
19772 d_getprotobyname_r='$d_getprotobyname_r'
19773 d_getprotobynumber_r='$d_getprotobynumber_r'
19774 d_getprotoent_r='$d_getprotoent_r'
19775 d_getprotoprotos='$d_getprotoprotos'
19776 d_getprpwnam='$d_getprpwnam'
19777 d_getpwent='$d_getpwent'
19778 d_getpwent_r='$d_getpwent_r'
19779 d_getpwnam_r='$d_getpwnam_r'
19780 d_getpwuid_r='$d_getpwuid_r'
19781 d_getsbyname='$d_getsbyname'
19782 d_getsbyport='$d_getsbyport'
19783 d_getsent='$d_getsent'
19784 d_getservbyname_r='$d_getservbyname_r'
19785 d_getservbyport_r='$d_getservbyport_r'
19786 d_getservent_r='$d_getservent_r'
19787 d_getservprotos='$d_getservprotos'
19788 d_getspnam='$d_getspnam'
19789 d_getspnam_r='$d_getspnam_r'
19790 d_gettimeod='$d_gettimeod'
19791 d_gmtime_r='$d_gmtime_r'
19792 d_gnulibc='$d_gnulibc'
19793 d_grpasswd='$d_grpasswd'
19794 d_hasmntopt='$d_hasmntopt'
19797 d_inetaton='$d_inetaton'
19798 d_int64_t='$d_int64_t'
19799 d_isascii='$d_isascii'
19800 d_isfinite='$d_isfinite'
19803 d_isnanl='$d_isnanl'
19804 d_killpg='$d_killpg'
19805 d_lchown='$d_lchown'
19806 d_ldbl_dig='$d_ldbl_dig'
19808 d_localtime_r='$d_localtime_r'
19809 d_locconv='$d_locconv'
19811 d_longdbl='$d_longdbl'
19812 d_longlong='$d_longlong'
19813 d_lseekproto='$d_lseekproto'
19815 d_madvise='$d_madvise'
19817 d_mbstowcs='$d_mbstowcs'
19818 d_mbtowc='$d_mbtowc'
19819 d_memchr='$d_memchr'
19820 d_memcmp='$d_memcmp'
19821 d_memcpy='$d_memcpy'
19822 d_memmove='$d_memmove'
19823 d_memset='$d_memset'
19825 d_mkdtemp='$d_mkdtemp'
19826 d_mkfifo='$d_mkfifo'
19827 d_mkstemp='$d_mkstemp'
19828 d_mkstemps='$d_mkstemps'
19829 d_mktime='$d_mktime'
19832 d_modfl_pow32_bug='$d_modfl_pow32_bug'
19833 d_mprotect='$d_mprotect'
19835 d_msg_ctrunc='$d_msg_ctrunc'
19836 d_msg_dontroute='$d_msg_dontroute'
19837 d_msg_oob='$d_msg_oob'
19838 d_msg_peek='$d_msg_peek'
19839 d_msg_proxy='$d_msg_proxy'
19840 d_msgctl='$d_msgctl'
19841 d_msgget='$d_msgget'
19842 d_msghdr_s='$d_msghdr_s'
19843 d_msgrcv='$d_msgrcv'
19844 d_msgsnd='$d_msgsnd'
19846 d_munmap='$d_munmap'
19847 d_mymalloc='$d_mymalloc'
19849 d_nl_langinfo='$d_nl_langinfo'
19850 d_nv_preserves_uv='$d_nv_preserves_uv'
19851 d_off64_t='$d_off64_t'
19852 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
19853 d_oldpthreads='$d_oldpthreads'
19854 d_oldsock='$d_oldsock'
19856 d_pathconf='$d_pathconf'
19858 d_perl_otherlibdirs='$d_perl_otherlibdirs'
19859 d_phostname='$d_phostname'
19862 d_portable='$d_portable'
19863 d_procselfexe='$d_procselfexe'
19864 d_pthread_atfork='$d_pthread_atfork'
19865 d_pthread_yield='$d_pthread_yield'
19867 d_pwchange='$d_pwchange'
19868 d_pwclass='$d_pwclass'
19869 d_pwcomment='$d_pwcomment'
19870 d_pwexpire='$d_pwexpire'
19871 d_pwgecos='$d_pwgecos'
19872 d_pwpasswd='$d_pwpasswd'
19873 d_pwquota='$d_pwquota'
19876 d_random_r='$d_random_r'
19877 d_readdir64_r='$d_readdir64_r'
19878 d_readdir='$d_readdir'
19879 d_readdir_r='$d_readdir_r'
19880 d_readlink='$d_readlink'
19882 d_recvmsg='$d_recvmsg'
19883 d_rename='$d_rename'
19884 d_rewinddir='$d_rewinddir'
19886 d_safebcpy='$d_safebcpy'
19887 d_safemcpy='$d_safemcpy'
19888 d_sanemcmp='$d_sanemcmp'
19889 d_sbrkproto='$d_sbrkproto'
19890 d_sched_yield='$d_sched_yield'
19891 d_scm_rights='$d_scm_rights'
19892 d_seekdir='$d_seekdir'
19893 d_select='$d_select'
19895 d_semctl='$d_semctl'
19896 d_semctl_semid_ds='$d_semctl_semid_ds'
19897 d_semctl_semun='$d_semctl_semun'
19898 d_semget='$d_semget'
19900 d_sendmsg='$d_sendmsg'
19901 d_setegid='$d_setegid'
19902 d_seteuid='$d_seteuid'
19903 d_setgrent='$d_setgrent'
19904 d_setgrent_r='$d_setgrent_r'
19905 d_setgrps='$d_setgrps'
19906 d_sethent='$d_sethent'
19907 d_sethostent_r='$d_sethostent_r'
19908 d_setitimer='$d_setitimer'
19909 d_setlinebuf='$d_setlinebuf'
19910 d_setlocale='$d_setlocale'
19911 d_setlocale_r='$d_setlocale_r'
19912 d_setnent='$d_setnent'
19913 d_setnetent_r='$d_setnetent_r'
19914 d_setpent='$d_setpent'
19915 d_setpgid='$d_setpgid'
19916 d_setpgrp2='$d_setpgrp2'
19917 d_setpgrp='$d_setpgrp'
19918 d_setprior='$d_setprior'
19919 d_setproctitle='$d_setproctitle'
19920 d_setprotoent_r='$d_setprotoent_r'
19921 d_setpwent='$d_setpwent'
19922 d_setpwent_r='$d_setpwent_r'
19923 d_setregid='$d_setregid'
19924 d_setresgid='$d_setresgid'
19925 d_setresuid='$d_setresuid'
19926 d_setreuid='$d_setreuid'
19927 d_setrgid='$d_setrgid'
19928 d_setruid='$d_setruid'
19929 d_setsent='$d_setsent'
19930 d_setservent_r='$d_setservent_r'
19931 d_setsid='$d_setsid'
19932 d_setvbuf='$d_setvbuf'
19936 d_shmatprototype='$d_shmatprototype'
19937 d_shmctl='$d_shmctl'
19939 d_shmget='$d_shmget'
19940 d_sigaction='$d_sigaction'
19941 d_sigprocmask='$d_sigprocmask'
19942 d_sigsetjmp='$d_sigsetjmp'
19943 d_sockatmark='$d_sockatmark'
19944 d_sockatmarkproto='$d_sockatmarkproto'
19945 d_socket='$d_socket'
19946 d_socklen_t='$d_socklen_t'
19947 d_sockpair='$d_sockpair'
19948 d_socks5_init='$d_socks5_init'
19950 d_srand48_r='$d_srand48_r'
19951 d_srandom_r='$d_srandom_r'
19952 d_sresgproto='$d_sresgproto'
19953 d_sresuproto='$d_sresuproto'
19954 d_statblks='$d_statblks'
19955 d_statfs_f_flags='$d_statfs_f_flags'
19956 d_statfs_s='$d_statfs_s'
19957 d_statvfs='$d_statvfs'
19958 d_stdio_cnt_lval='$d_stdio_cnt_lval'
19959 d_stdio_ptr_lval='$d_stdio_ptr_lval'
19960 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
19961 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
19962 d_stdio_stream_array='$d_stdio_stream_array'
19963 d_stdiobase='$d_stdiobase'
19964 d_stdstdio='$d_stdstdio'
19965 d_strchr='$d_strchr'
19966 d_strcoll='$d_strcoll'
19967 d_strctcpy='$d_strctcpy'
19968 d_strerrm='$d_strerrm'
19969 d_strerror='$d_strerror'
19970 d_strerror_r='$d_strerror_r'
19971 d_strftime='$d_strftime'
19972 d_strtod='$d_strtod'
19973 d_strtol='$d_strtol'
19974 d_strtold='$d_strtold'
19975 d_strtoll='$d_strtoll'
19976 d_strtoq='$d_strtoq'
19977 d_strtoul='$d_strtoul'
19978 d_strtoull='$d_strtoull'
19979 d_strtouq='$d_strtouq'
19980 d_strxfrm='$d_strxfrm'
19981 d_suidsafe='$d_suidsafe'
19982 d_symlink='$d_symlink'
19983 d_syscall='$d_syscall'
19984 d_syscallproto='$d_syscallproto'
19985 d_sysconf='$d_sysconf'
19986 d_sysernlst='$d_sysernlst'
19987 d_syserrlst='$d_syserrlst'
19988 d_system='$d_system'
19989 d_tcgetpgrp='$d_tcgetpgrp'
19990 d_tcsetpgrp='$d_tcsetpgrp'
19991 d_telldir='$d_telldir'
19992 d_telldirproto='$d_telldirproto'
19995 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
19996 d_tm_tm_zone='$d_tm_tm_zone'
19997 d_tmpnam_r='$d_tmpnam_r'
19998 d_truncate='$d_truncate'
19999 d_ttyname_r='$d_ttyname_r'
20000 d_tzname='$d_tzname'
20001 d_u32align='$d_u32align'
20002 d_ualarm='$d_ualarm'
20005 d_union_semun='$d_union_semun'
20006 d_unordered='$d_unordered'
20007 d_usleep='$d_usleep'
20008 d_usleepproto='$d_usleepproto'
20010 d_vendorarch='$d_vendorarch'
20011 d_vendorbin='$d_vendorbin'
20012 d_vendorlib='$d_vendorlib'
20014 d_void_closedir='$d_void_closedir'
20015 d_voidsig='$d_voidsig'
20016 d_voidtty='$d_voidtty'
20017 d_volatile='$d_volatile'
20018 d_vprintf='$d_vprintf'
20020 d_waitpid='$d_waitpid'
20021 d_wcstombs='$d_wcstombs'
20022 d_wctomb='$d_wctomb'
20023 d_writev='$d_writev'
20026 db_hashtype='$db_hashtype'
20027 db_prefixtype='$db_prefixtype'
20028 db_version_major='$db_version_major'
20029 db_version_minor='$db_version_minor'
20030 db_version_patch='$db_version_patch'
20031 defvoidused='$defvoidused'
20032 direntrytype='$direntrytype'
20035 doublesize='$doublesize'
20037 drand48_r_proto='$drand48_r_proto'
20038 dynamic_ext='$dynamic_ext'
20044 endgrent_r_proto='$endgrent_r_proto'
20045 endhostent_r_proto='$endhostent_r_proto'
20046 endnetent_r_proto='$endnetent_r_proto'
20047 endprotoent_r_proto='$endprotoent_r_proto'
20048 endpwent_r_proto='$endpwent_r_proto'
20049 endservent_r_proto='$endservent_r_proto'
20050 eunicefix='$eunicefix'
20053 extensions='$extensions'
20055 fflushNULL='$fflushNULL'
20056 fflushall='$fflushall'
20058 firstmakefile='$firstmakefile'
20060 fpossize='$fpossize'
20061 fpostype='$fpostype'
20062 freetype='$freetype'
20065 full_csh='$full_csh'
20066 full_sed='$full_sed'
20067 gccosandvers='$gccosandvers'
20068 gccversion='$gccversion'
20069 getgrent_r_proto='$getgrent_r_proto'
20070 getgrgid_r_proto='$getgrgid_r_proto'
20071 getgrnam_r_proto='$getgrnam_r_proto'
20072 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
20073 gethostbyname_r_proto='$gethostbyname_r_proto'
20074 gethostent_r_proto='$gethostent_r_proto'
20075 getlogin_r_proto='$getlogin_r_proto'
20076 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
20077 getnetbyname_r_proto='$getnetbyname_r_proto'
20078 getnetent_r_proto='$getnetent_r_proto'
20079 getprotobyname_r_proto='$getprotobyname_r_proto'
20080 getprotobynumber_r_proto='$getprotobynumber_r_proto'
20081 getprotoent_r_proto='$getprotoent_r_proto'
20082 getpwent_r_proto='$getpwent_r_proto'
20083 getpwnam_r_proto='$getpwnam_r_proto'
20084 getpwuid_r_proto='$getpwuid_r_proto'
20085 getservbyname_r_proto='$getservbyname_r_proto'
20086 getservbyport_r_proto='$getservbyport_r_proto'
20087 getservent_r_proto='$getservent_r_proto'
20088 getspnam_r_proto='$getspnam_r_proto'
20089 gidformat='$gidformat'
20095 gmtime_r_proto='$gmtime_r_proto'
20097 groupcat='$groupcat'
20098 groupstype='$groupstype'
20101 h_sysfile='$h_sysfile'
20112 i_arpainet='$i_arpainet'
20113 i_bsdioctl='$i_bsdioctl'
20117 i_dirent='$i_dirent'
20123 i_fp_class='$i_fp_class'
20126 i_ieeefp='$i_ieeefp'
20127 i_inttypes='$i_inttypes'
20128 i_langinfo='$i_langinfo'
20129 i_libutil='$i_libutil'
20130 i_limits='$i_limits'
20131 i_locale='$i_locale'
20132 i_machcthr='$i_machcthr'
20133 i_malloc='$i_malloc'
20135 i_memory='$i_memory'
20136 i_mntent='$i_mntent'
20139 i_neterrno='$i_neterrno'
20140 i_netinettcp='$i_netinettcp'
20144 i_pthread='$i_pthread'
20146 i_rpcsvcdbm='$i_rpcsvcdbm'
20149 i_shadow='$i_shadow'
20151 i_stdarg='$i_stdarg'
20152 i_stddef='$i_stddef'
20153 i_stdlib='$i_stdlib'
20154 i_string='$i_string'
20155 i_sunmath='$i_sunmath'
20156 i_sysaccess='$i_sysaccess'
20157 i_sysdir='$i_sysdir'
20158 i_sysfile='$i_sysfile'
20159 i_sysfilio='$i_sysfilio'
20161 i_sysioctl='$i_sysioctl'
20162 i_syslog='$i_syslog'
20163 i_sysmman='$i_sysmman'
20164 i_sysmode='$i_sysmode'
20165 i_sysmount='$i_sysmount'
20166 i_sysndir='$i_sysndir'
20167 i_sysparam='$i_sysparam'
20168 i_sysresrc='$i_sysresrc'
20169 i_syssecrt='$i_syssecrt'
20170 i_sysselct='$i_sysselct'
20171 i_syssockio='$i_syssockio'
20172 i_sysstat='$i_sysstat'
20173 i_sysstatfs='$i_sysstatfs'
20174 i_sysstatvfs='$i_sysstatvfs'
20175 i_systime='$i_systime'
20176 i_systimek='$i_systimek'
20177 i_systimes='$i_systimes'
20178 i_systypes='$i_systypes'
20179 i_sysuio='$i_sysuio'
20181 i_sysutsname='$i_sysutsname'
20182 i_sysvfs='$i_sysvfs'
20183 i_syswait='$i_syswait'
20184 i_termio='$i_termio'
20185 i_termios='$i_termios'
20187 i_unistd='$i_unistd'
20190 i_values='$i_values'
20191 i_varargs='$i_varargs'
20192 i_varhdr='$i_varhdr'
20194 ignore_versioned_solibs='$ignore_versioned_solibs'
20195 inc_version_list='$inc_version_list'
20196 inc_version_list_init='$inc_version_list_init'
20199 installarchlib='$installarchlib'
20200 installbin='$installbin'
20201 installman1dir='$installman1dir'
20202 installman3dir='$installman3dir'
20203 installprefix='$installprefix'
20204 installprefixexp='$installprefixexp'
20205 installprivlib='$installprivlib'
20206 installscript='$installscript'
20207 installsitearch='$installsitearch'
20208 installsitebin='$installsitebin'
20209 installsitelib='$installsitelib'
20210 installstyle='$installstyle'
20211 installusrbinperl='$installusrbinperl'
20212 installvendorarch='$installvendorarch'
20213 installvendorbin='$installvendorbin'
20214 installvendorlib='$installvendorlib'
20216 issymlink='$issymlink'
20217 ivdformat='$ivdformat'
20220 known_extensions='$known_extensions'
20223 lddlflags='$lddlflags'
20225 ldflags_uselargefiles='$ldflags_uselargefiles'
20226 ldlibpthname='$ldlibpthname'
20233 libsdirs='$libsdirs'
20234 libsfiles='$libsfiles'
20235 libsfound='$libsfound'
20236 libspath='$libspath'
20237 libswanted='$libswanted'
20238 libswanted_uselargefiles='$libswanted_uselargefiles'
20244 localtime_r_proto='$localtime_r_proto'
20245 locincpth='$locincpth'
20246 loclibpth='$loclibpth'
20247 longdblsize='$longdblsize'
20248 longlongsize='$longlongsize'
20249 longsize='$longsize'
20253 lseeksize='$lseeksize'
20254 lseektype='$lseektype'
20258 make_set_make='$make_set_make'
20259 mallocobj='$mallocobj'
20260 mallocsrc='$mallocsrc'
20261 malloctype='$malloctype'
20263 man1direxp='$man1direxp'
20266 man3direxp='$man3direxp'
20268 mips_type='$mips_type'
20270 mmaptype='$mmaptype'
20271 modetype='$modetype'
20273 multiarch='$multiarch'
20275 myarchname='$myarchname'
20276 mydomain='$mydomain'
20277 myhostname='$myhostname'
20280 need_va_copy='$need_va_copy'
20281 netdb_hlen_type='$netdb_hlen_type'
20282 netdb_host_type='$netdb_host_type'
20283 netdb_name_type='$netdb_name_type'
20284 netdb_net_type='$netdb_net_type'
20287 nm_so_opt='$nm_so_opt'
20288 nonxs_ext='$nonxs_ext'
20290 nvEUformat='$nvEUformat'
20291 nvFUformat='$nvFUformat'
20292 nvGUformat='$nvGUformat'
20293 nv_preserves_uv_bits='$nv_preserves_uv_bits'
20294 nveformat='$nveformat'
20295 nvfformat='$nvfformat'
20296 nvgformat='$nvgformat'
20299 o_nonblock='$o_nonblock'
20301 old_pthread_create_joinable='$old_pthread_create_joinable'
20302 optimize='$optimize'
20303 orderlib='$orderlib'
20306 otherlibdirs='$otherlibdirs'
20310 patchlevel='$patchlevel'
20311 path_sep='$path_sep'
20314 perl_patchlevel='$perl_patchlevel'
20315 perladmin='$perladmin'
20316 perllibs='$perllibs'
20317 perlpath='$perlpath'
20319 phostname='$phostname'
20322 pm_apiversion='$pm_apiversion'
20326 prefixexp='$prefixexp'
20328 privlibexp='$privlibexp'
20329 procselfexe='$procselfexe'
20330 prototype='$prototype'
20332 quadkind='$quadkind'
20333 quadtype='$quadtype'
20334 randbits='$randbits'
20335 randfunc='$randfunc'
20336 random_r_proto='$random_r_proto'
20337 randseedtype='$randseedtype'
20339 rd_nodata='$rd_nodata'
20340 readdir64_r_proto='$readdir64_r_proto'
20341 readdir_r_proto='$readdir_r_proto'
20342 revision='$revision'
20347 sPRIEUldbl='$sPRIEUldbl'
20348 sPRIFUldbl='$sPRIFUldbl'
20349 sPRIGUldbl='$sPRIGUldbl'
20350 sPRIXU64='$sPRIXU64'
20352 sPRIeldbl='$sPRIeldbl'
20353 sPRIfldbl='$sPRIfldbl'
20354 sPRIgldbl='$sPRIgldbl'
20359 sSCNfldbl='$sSCNfldbl'
20360 sched_yield='$sched_yield'
20361 scriptdir='$scriptdir'
20362 scriptdirexp='$scriptdirexp'
20364 seedfunc='$seedfunc'
20365 selectminbits='$selectminbits'
20366 selecttype='$selecttype'
20367 sendmail='$sendmail'
20368 setgrent_r_proto='$setgrent_r_proto'
20369 sethostent_r_proto='$sethostent_r_proto'
20370 setlocale_r_proto='$setlocale_r_proto'
20371 setnetent_r_proto='$setnetent_r_proto'
20372 setprotoent_r_proto='$setprotoent_r_proto'
20373 setpwent_r_proto='$setpwent_r_proto'
20374 setservent_r_proto='$setservent_r_proto'
20377 sharpbang='$sharpbang'
20378 shmattype='$shmattype'
20379 shortsize='$shortsize'
20382 sig_count='$sig_count'
20383 sig_name='$sig_name'
20384 sig_name_init='$sig_name_init'
20386 sig_num_init='$sig_num_init'
20387 sig_size='$sig_size'
20388 signal_t='$signal_t'
20389 sitearch='$sitearch'
20390 sitearchexp='$sitearchexp'
20392 sitebinexp='$sitebinexp'
20394 sitelib_stem='$sitelib_stem'
20395 sitelibexp='$sitelibexp'
20396 siteprefix='$siteprefix'
20397 siteprefixexp='$siteprefixexp'
20398 sizesize='$sizesize'
20399 sizetype='$sizetype'
20403 sockethdr='$sockethdr'
20404 socketlib='$socketlib'
20405 socksizetype='$socksizetype'
20407 spackage='$spackage'
20408 spitshell='$spitshell'
20409 srand48_r_proto='$srand48_r_proto'
20410 srandom_r_proto='$srandom_r_proto'
20412 ssizetype='$ssizetype'
20413 startperl='$startperl'
20415 static_ext='$static_ext'
20417 stdio_base='$stdio_base'
20418 stdio_bufsiz='$stdio_bufsiz'
20419 stdio_cnt='$stdio_cnt'
20420 stdio_filbuf='$stdio_filbuf'
20421 stdio_ptr='$stdio_ptr'
20422 stdio_stream_array='$stdio_stream_array'
20423 strerror_r_proto='$strerror_r_proto'
20426 subversion='$subversion'
20430 targetarch='$targetarch'
20434 timeincl='$timeincl'
20435 timetype='$timetype'
20436 tmpnam_r_proto='$tmpnam_r_proto'
20442 ttyname_r_proto='$ttyname_r_proto'
20451 uidformat='$uidformat'
20457 uquadtype='$uquadtype'
20458 use5005threads='$use5005threads'
20459 use64bitall='$use64bitall'
20460 use64bitint='$use64bitint'
20461 usecrosscompile='$usecrosscompile'
20463 useithreads='$useithreads'
20464 uselargefiles='$uselargefiles'
20465 uselongdouble='$uselongdouble'
20466 usemorebits='$usemorebits'
20467 usemultiplicity='$usemultiplicity'
20468 usemymalloc='$usemymalloc'
20470 useopcode='$useopcode'
20471 useperlio='$useperlio'
20472 useposix='$useposix'
20473 usereentrant='$usereentrant'
20475 useshrplib='$useshrplib'
20476 usesocks='$usesocks'
20477 usethreads='$usethreads'
20478 usevendorprefix='$usevendorprefix'
20479 usevfork='$usevfork'
20482 uvXUformat='$uvXUformat'
20483 uvoformat='$uvoformat'
20486 uvuformat='$uvuformat'
20487 uvxformat='$uvxformat'
20488 vendorarch='$vendorarch'
20489 vendorarchexp='$vendorarchexp'
20490 vendorbin='$vendorbin'
20491 vendorbinexp='$vendorbinexp'
20492 vendorlib='$vendorlib'
20493 vendorlib_stem='$vendorlib_stem'
20494 vendorlibexp='$vendorlibexp'
20495 vendorprefix='$vendorprefix'
20496 vendorprefixexp='$vendorprefixexp'
20498 version_patchlevel_string='$version_patchlevel_string'
20499 versiononly='$versiononly'
20501 voidflags='$voidflags'
20503 xs_apiversion='$xs_apiversion'
20505 yaccflags='$yaccflags'
20510 : Add in command line options if available
20511 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
20513 : add special variables
20514 $test -f $src/patchlevel.h && \
20515 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
20516 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
20517 echo "PERL_CONFIG_SH=true" >>config.sh
20519 : propagate old symbols
20520 if $test -f UU/config.sh; then
20521 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
20522 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
20523 $sort | $uniq -u >UU/oldsyms
20524 set X `cat UU/oldsyms`
20530 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
20532 echo "# Variables propagated from previous config.sh file." >>config.sh
20533 for sym in `cat UU/oldsyms`; do
20534 echo " Propagating $hint variable "'$'"$sym..."
20535 eval 'tmp="$'"${sym}"'"'
20537 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
20543 : Finish up by extracting the .SH files
20547 echo "Extraction done."
20557 If you'd like to make any changes to the config.sh file before I begin
20558 to configure things, do it as a shell escape now (e.g. !vi config.sh).
20561 rp="Press return or use a shell escape to edit config.sh:"
20566 *) : in case they cannot read
20567 sh 1>&4 -c "$ans";;
20572 : if this fails, just run all the .SH files by hand
20581 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
20588 Now you need to generate make dependencies by running "$make depend".
20589 You might prefer to run it in background: "$make depend > makedepend.out &"
20590 It can take a while, so you might not want to run it right now.
20595 rp="Run $make depend now?"
20599 $make depend && echo "Now you must run '$make'."
20602 echo "You must run '$make depend' then '$make'."
20605 elif test -f [Mm]akefile; then
20607 echo "Now you must run a $make."
20609 echo "Configure done."
20612 if $test -f Policy.sh; then
20615 If you compile $package on a different machine or from a different object
20616 directory, copy the Policy.sh file from this object directory to the
20617 new one before you run Configure -- this will help you with most of
20618 the policy defaults.
20622 if $test -f config.msg; then
20623 echo "Hmm. I also noted the following information while running:"
20625 $cat config.msg >&4
20628 $rm -f kit*isdone ark*isdone