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 Thu May 30 16:44:56 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
3769 # gcc 3.1 complains about adding -Idirectories that it already knows about,
3770 # so we will take those off from locincpth.
3771 case "$gccversion" in
3773 echo "main(){}">try.c
3774 for incdir in `$cc -v -c try.c 2>&1 | \
3775 sed '1,/^#include <\.\.\.>/d;/^End of search list/,$d;s/^ //'` ; do
3776 locincpth=`echo $locincpth | sed s!$incdir!!`
3781 : decide how portable to be. Allow command line overrides.
3782 case "$d_portable" in
3784 *) d_portable="$define" ;;
3787 : set up shell script to do ~ expansion
3793 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3796 if $test -f /bin/csh; then
3797 /bin/csh -f -c "glob \$1"
3802 name=\`$expr x\$1 : '..\([^/]*\)'\`
3803 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3804 if $test ! -d "\$dir"; then
3806 echo "\$me: can't locate home directory for: \$name" >&2
3811 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3827 : now set up to get a file name
3831 cat <<'EOSC' >>getfile
3847 : getfile will accept an answer from the comma-separated list
3848 : enclosed in parentheses even if it does not meet other criteria.
3849 expr "$fn" : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3850 fn=`echo $fn | sed 's/(.*)//'`
3856 loc_file=`expr $fn : '.*:\(.*\)'`
3857 fn=`expr $fn : '\(.*\):.*'`
3865 */*) fullpath=true;;
3874 *e*) exp_file=true;;
3877 *p*) nopath_ok=true;;
3882 *d*) type='Directory';;
3883 *l*) type='Locate';;
3888 Locate) what='File';;
3893 case "$d_portable" in
3901 while test "$type"; do
3906 true) rp="$rp (~name ok)";;
3909 if test -f UU/getfile.ok && \
3910 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3929 value=`UU/filexp $ans`
3932 if test "$ans" != "$value"; then
3933 echo "(That expands to $value on this system.)"
3947 /*) value="$ansexp" ;;
3948 [a-zA-Z]:/*) value="$ansexp" ;;
3953 echo "I shall only accept a full path name, as in /bin/ls." >&4
3954 echo "Use a ! shell escape if you wish to check pathnames." >&4
3957 echo "Please give a full path name, starting with slash." >&4
3960 echo "Note that using ~name is ok provided it expands well." >&4
3973 for fp in $gfpth; do
3974 if test "X$fp" = X.; then
3979 if test -f "$pf"; then
3981 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3983 echo "($value is not a plain file, but that's ok.)"
3986 if test X"$type" = X; then
3993 for fp in $gfpth; do
3994 if test "X$fp" = X.; then
3999 direxp="$fp/$ansexp"
4001 if test -d "$direxp"; then
4009 if test -d "$ansexp"; then
4010 echo "(Looking for $loc_file in directory $value.)"
4011 value="$value/$loc_file"
4012 ansexp="$ansexp/$loc_file"
4014 if test -f "$ansexp"; then
4017 case "$nopath_ok" in
4018 true) case "$value" in
4020 *) echo "Assuming $value will be in people's path."
4036 if test "$fastread" = yes; then
4041 rp="$what $value doesn't exist. Use that name anyway?"
4060 test "X$gfpthkeep" != Xy && gfpth=""
4063 : What should the include directory be ?
4065 $echo $n "Hmm... $c"
4069 if $test -f /bin/mips && /bin/mips; then
4070 echo "Looks like a MIPS system..."
4071 $cat >usr.c <<'EOCP'
4072 #ifdef SYSTYPE_BSD43
4076 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4077 dflt='/bsd43/usr/include'
4081 mips_type='System V'
4083 $rm -f usr.c usr.out
4084 echo "and you're compiling with the $mips_type compiler and libraries."
4088 echo "Doesn't look like a MIPS system."
4098 case "$xxx_prompt" in
4101 rp='Where are the include files you want to use?'
4109 : see how we invoke the C preprocessor
4111 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4112 cat <<'EOT' >testcpp.c
4118 if test ! -f cppstdin; then
4119 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4120 # AIX cc -E doesn't show the absolute headerfile
4121 # locations but we'll cheat by using the -M flag.
4122 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
4124 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4127 echo "Keeping your $hint cppstdin wrapper."
4130 wrapper=`pwd`/cppstdin
4134 if $test "X$cppstdin" != "X" && \
4135 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4136 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4138 echo "You used to use $cppstdin $cppminus so we'll use that again."
4140 '') echo "But let's see if we can live without a wrapper..." ;;
4142 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4143 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4145 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4148 echo "(However, $cpprun $cpplast does not work, let's see...)"
4156 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4163 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4164 $cc -E <testcpp.c >testcpp.out 2>&1; \
4165 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4166 echo "Yup, it does."
4169 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4170 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4171 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4172 echo "Yup, it does."
4175 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4176 $cc -P <testcpp.c >testcpp.out 2>&1; \
4177 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4178 echo "Yipee, that works!"
4181 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4182 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4183 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4184 echo "At long last!"
4187 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4188 $cpp <testcpp.c >testcpp.out 2>&1; \
4189 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4193 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4194 $cpp - <testcpp.c >testcpp.out 2>&1; \
4195 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4196 echo "Hooray, it works! I was beginning to wonder."
4199 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4200 $wrapper <testcpp.c >testcpp.out 2>&1; \
4201 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4207 rp="No dice. I can't find a C preprocessor. Name one:"
4211 $x_cpp <testcpp.c >testcpp.out 2>&1
4212 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4213 echo "OK, that will do." >&4
4215 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4230 echo "Perhaps can we force $cc -E using a wrapper..."
4231 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4232 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4238 echo "Nope, we'll have to live without it..."
4252 "$wrapper"|'cppstdin') ;;
4253 *) $rm -f $wrapper;;
4255 $rm -f testcpp.c testcpp.out
4257 : Set private lib path
4260 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4265 '') dlist="$loclibpth $plibpth $glibpth";;
4266 *) dlist="$libpth";;
4269 : Now check and see which directories actually exist, avoiding duplicates
4273 if $test -d $xxx; then
4276 *) libpth="$libpth $xxx";;
4282 Some systems have incompatible or broken versions of libraries. Among
4283 the directories listed in the question below, please remove any you
4284 know not to be holding relevant libraries, and add any that are needed.
4285 Say "none" for none.
4296 rp="Directories to use for library searches?"
4303 : compute shared library extension
4306 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4316 On some systems, shared libraries may be available. Answer 'none' if
4317 you want to suppress searching of shared libraries for the remainder
4318 of this configuration.
4321 rp='What is the file extension used for shared libraries?'
4325 : Define several unixisms.
4326 : Hints files or command line option can be used to override them.
4327 : The convoluted testing is in case hints files set either the old
4330 '') case "$exe_ext" in
4332 *) _exe="$exe_ext" ;;
4337 '') case "$lib_ext" in
4344 '') case "$obj_ext" in
4351 '') case "$path_sep" in
4362 : Which makefile gets called first. This is used by make depend.
4363 case "$firstmakefile" in
4364 '') firstmakefile='makefile';;
4368 $define|true|[yY]*) dflt='y';;
4373 Perl can be built to use the SOCKS proxy protocol library. To do so,
4374 Configure must be run with -Dusesocks. If you use SOCKS you also need
4375 to use the PerlIO abstraction layer, this will be implicitly selected.
4377 If this doesn't make any sense to you, just accept the default '$dflt'.
4379 rp='Build Perl for SOCKS?'
4382 y|Y) val="$define" ;;
4389 $define|true|[yY]*) useperlio="$define";;
4392 : Looking for optional libraries
4394 echo "Checking for optional libraries..." >&4
4399 case "$libswanted" in
4400 '') libswanted='c_s';;
4403 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4409 for thisdir in $libpth $xlibpth; do
4410 test -d $thisdir && libspath="$libspath $thisdir"
4412 for thislib in $libswanted; do
4413 for thisdir in $libspath; do
4415 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4416 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4417 $test -f "$xxx" && eval $libscheck
4418 $test -f "$xxx" && libstyle=shared
4420 if test ! -f "$xxx"; then
4421 xxx=$thisdir/lib$thislib.$so
4422 $test -f "$xxx" && eval $libscheck
4423 $test -f "$xxx" && libstyle=shared
4425 if test ! -f "$xxx"; then
4426 xxx=$thisdir/lib$thislib$_a
4427 $test -f "$xxx" && eval $libscheck
4428 $test -f "$xxx" && libstyle=static
4430 if test ! -f "$xxx"; then
4431 xxx=$thisdir/$thislib$_a
4432 $test -f "$xxx" && eval $libscheck
4433 $test -f "$xxx" && libstyle=static
4435 if test ! -f "$xxx"; then
4436 xxx=$thisdir/lib${thislib}_s$_a
4437 $test -f "$xxx" && eval $libscheck
4438 $test -f "$xxx" && libstyle=static
4439 $test -f "$xxx" && thislib=${thislib}_s
4441 if test ! -f "$xxx"; then
4442 xxx=$thisdir/Slib$thislib$_a
4443 $test -f "$xxx" && eval $libscheck
4444 $test -f "$xxx" && libstyle=static
4446 if $test -f "$xxx"; then
4448 shared) echo "Found -l$thislib (shared)." ;;
4449 static) echo "Found -l$thislib." ;;
4450 *) echo "Found -l$thislib ($libstyle)." ;;
4454 *) dflt="$dflt -l$thislib"
4455 libsfound="$libsfound $xxx"
4457 libsfiles="$libsfiles $yyy"
4458 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4459 case " $libsdirs " in
4461 *) libsdirs="$libsdirs $yyy" ;;
4468 if $test ! -f "$xxx"; then
4469 echo "No -l$thislib."
4480 ' '|'') dflt='none';;
4485 In order to compile $package on your machine, a number of libraries
4486 are usually needed. Include any other special libraries here as well.
4487 Say "none" for none. The default list is almost always right.
4491 rp="What libraries to use?"
4498 : determine optimization, if desired, or use for debug flag also
4500 ' '|$undef) dflt='none';;
4502 *) dflt="$optimize";;
4506 By default, $package compiles with the -O flag to use the optimizer.
4507 Alternately, you might want to use the symbolic debugger, which uses
4508 the -g flag (on traditional Unix systems). Either flag can be
4509 specified here. To use neither flag, specify the word "none".
4512 rp="What optimizer/debugger flag should be used?"
4516 'none') optimize=" ";;
4520 : We will not override a previous value, but we might want to
4521 : augment a hint file
4523 default|recommended)
4524 case "$gccversion" in
4525 1*) dflt='-fpcc-struct-return' ;;
4528 *-g*) dflt="$dflt -DDEBUGGING";;
4530 case "$gccversion" in
4531 2*) if test -d /etc/conf/kconfig.d &&
4532 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4538 case "$gccversion" in
4542 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4543 echo 'int main(void) { return 0; }' > gcctest.c
4544 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4545 echo "Yes, it does." 2>&1
4548 echo "Leaving current flags $ccflags alone." 2>&1
4550 *) dflt="$dflt -fno-strict-aliasing" ;;
4553 echo "Nope, it doesn't, but that's ok." 2>&1
4560 case "$mips_type" in
4561 *BSD*|'') inclwanted="$locincpth $usrinc";;
4562 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4564 for thisincl in $inclwanted; do
4565 if $test -d $thisincl; then
4566 if $test x$thisincl != x$usrinc; then
4568 *" -I$thisincl "*);;
4569 *) dflt="$dflt -I$thisincl ";;
4575 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4577 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4585 *) dflt="$dflt -D$2";;
4589 set signal.h LANGUAGE_C; eval $inctest
4593 ccflags="$ccflags -DSOCKS"
4598 default|recommended) dflt="$ccflags $dflt" ;;
4599 *) dflt="$ccflags";;
4608 Your C compiler may want other flags. For this question you should include
4609 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4610 but you should NOT include libraries or ld flags like -lwhatever. If you
4611 want $package to honor its debug switch, you should include -DDEBUGGING here.
4612 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4614 To use no flags, specify the word "none".
4620 rp="Any additional cc flags?"
4627 : the following weeds options from ccflags that are of no interest to cpp
4629 '') cppflags="$ccflags" ;;
4630 *) cppflags="$cppflags $ccflags" ;;
4632 case "$gccversion" in
4633 1*) cppflags="$cppflags -D__GNUC__"
4635 case "$mips_type" in
4637 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4643 echo "Let me guess what the preprocessor flags are..." >&4
4657 *) ftry="$previous $flag";;
4659 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4660 >cpp1.out 2>/dev/null && \
4661 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4662 >cpp2.out 2>/dev/null && \
4663 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4664 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4666 cppflags="$cppflags $ftry"
4676 *-*) echo "They appear to be: $cppflags";;
4678 $rm -f cpp.c cpp?.out
4682 : flags used in final linking phase
4684 '') if ./venix; then
4690 *-posix*) dflt="$dflt -posix" ;;
4693 *) dflt="$ldflags";;
4696 : Try to guess additional flags to pick up local libraries.
4697 for thislibdir in $libpth; do
4698 case " $loclibpth " in
4701 *"-L$thislibdir "*) ;;
4702 *) dflt="$dflt -L$thislibdir" ;;
4714 Your C linker may need flags. For this question you should
4715 include -L/whatever and any other flags used by the C linker, but you
4716 should NOT include libraries like -lwhatever.
4718 Make sure you include the appropriate -L/path flags if your C linker
4719 does not normally search all of the directories you specified above,
4722 To use no flags, specify the word "none".
4726 rp="Any additional ld flags (NOT including libraries)?"
4732 rmlist="$rmlist pdp11"
4736 echo "Checking your choice of C compiler and flags for coherency..." >&4
4737 $cat > try.c <<'EOF'
4739 int main() { printf("Ok\n"); exit(0); }
4741 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4743 $cat >try.msg <<'EOM'
4744 I've tried to compile and run the following simple program:
4747 $cat try.c >> try.msg
4749 $cat >> try.msg <<EOM
4756 and I got the following output:
4760 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4761 if $sh -c "$run ./try" >>try.msg 2>&1; then
4765 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4768 cat >> try.msg <<'EOQS'
4769 If $libs contains -lsfio, and sfio is mis-configured, then it
4770 sometimes (apparently) runs and exits with a 0 status, but with no
4771 output! It may have to do with sfio's use of _exit vs. exit.
4774 rp="You have a big problem. Shall I abort Configure"
4781 echo "The program compiled OK, but exited with status $?." >>try.msg
4782 rp="You have a problem. Shall I abort Configure"
4786 echo "I can't compile the test program." >>try.msg
4787 rp="You have a BIG problem. Shall I abort Configure"
4793 case "$knowitall" in
4795 echo "(The supplied flags or libraries might be incorrect.)"
4803 *) echo "Ok. Stopping Configure." >&4
4808 n) echo "OK, that should do.";;
4810 $rm -f try try.* core
4812 : define a shorthand compile call
4816 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4817 : define a shorthand compile call for compilations that should be ok.
4821 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4823 : check for lengths of integral types
4827 echo "Checking to see how big your integers are..." >&4
4828 $cat >try.c <<'EOCP'
4832 printf("intsize=%d;\n", (int)sizeof(int));
4833 printf("longsize=%d;\n", (int)sizeof(long));
4834 printf("shortsize=%d;\n", (int)sizeof(short));
4839 if eval $compile_ok && $run ./try > /dev/null; then
4841 echo "Your integers are $intsize bytes long."
4842 echo "Your long integers are $longsize bytes long."
4843 echo "Your short integers are $shortsize bytes long."
4847 Help! I can't compile and run the intsize test program: please enlighten me!
4848 (This is probably a misconfiguration in your system or libraries, and
4849 you really ought to fix it. Still, I'll try anyway.)
4853 rp="What is the size of an integer (in bytes)?"
4857 rp="What is the size of a long integer (in bytes)?"
4861 rp="What is the size of a short integer (in bytes)?"
4869 : check for long long
4871 echo "Checking to see if you have long long..." >&4
4872 echo 'int main() { long long x = 7; return 0; }' > try.c
4874 if eval $compile; then
4876 echo "You have long long."
4879 echo "You do not have long long."
4885 : check for length of long long
4886 case "${d_longlong}${longlongsize}" in
4889 echo "Checking to see how big your long longs are..." >&4
4890 $cat >try.c <<'EOCP'
4894 printf("%d\n", (int)sizeof(long long));
4899 if eval $compile_ok; then
4900 longlongsize=`$run ./try`
4901 echo "Your long longs are $longlongsize bytes long."
4905 echo "(I can't seem to compile the test program. Guessing...)"
4906 rp="What is the size of a long long (in bytes)?"
4910 if $test "X$longsize" = "X$longlongsize"; then
4911 echo "(That isn't any different from an ordinary long.)"
4917 : determine filename position in cpp output
4919 echo "Computing filename position in cpp output for #include directives..." >&4
4921 vos) testaccess=-e ;;
4924 echo '#include <stdio.h>' > foo.c
4927 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4928 $grep '^[ ]*#.*stdio\.h' | \
4929 while read cline; do
4932 while $test \$# -gt 0; do
4933 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
4938 pos=\`expr \$pos + 1\`
4950 *) pos="${fieldn}th";;
4952 echo "Your cpp writes the filename in the $pos field of the line."
4955 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4958 : locate header file
4963 for usrincdir in $usrinc
4965 if test -f \$usrincdir/\$wanted; then
4966 echo "\$usrincdir/\$wanted"
4970 awkprg='{ print \$$fieldn }'
4971 echo "#include <\$wanted>" > foo\$\$.c
4972 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4973 $cppfilter $grep "^[ ]*#.*\$wanted" | \
4974 while read cline; do
4975 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4977 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4978 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4983 # status = 0: grep returned 0 lines, case statement not executed
4984 # status = 1: headerfile found
4985 # status = 2: while loop executed, no headerfile found
4989 if test \$status -eq 1; then
4996 : define an alternate in-header-list? function
4997 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4998 cont=true; xxf="echo \"<\$1> found.\" >&4";
4999 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
5000 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
5002 case $# in 4) instead=instead;; *) instead="at last";; esac;
5003 while $test "$cont"; do
5005 var=$2; eval "was=\$$2";
5006 if $test "$xxx" && $test -r "$xxx";
5008 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
5011 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
5012 set $yyy; shift; shift; yyy=$@;
5013 case $# in 0) cont="";;
5014 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5015 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5016 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5017 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5021 do set $yyy; var=$2; eval "was=\$$2";
5022 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5023 set $yyy; shift; shift; yyy=$@;
5026 : see if inttypes.h is available
5027 : we want a real compile instead of Inhdr because some systems
5028 : have an inttypes.h which includes non-existent headers
5031 #include <inttypes.h>
5033 static int32_t foo32 = 0x12345678;
5037 if eval $compile; then
5038 echo "<inttypes.h> found." >&4
5041 echo "<inttypes.h> NOT found." >&4
5050 echo "Checking to see if you have int64_t..." >&4
5052 #include <sys/types.h>
5053 #$i_inttypes I_INTTYPES
5055 #include <inttypes.h>
5057 int main() { int64_t x = 7; }
5060 if eval $compile; then
5062 echo "You have int64_t."
5065 echo "You do not have int64_t."
5073 echo "Checking which 64-bit integer type we could use..." >&4
5079 val='"unsigned int"'
5084 *) case "$longsize" in
5088 val='"unsigned long"'
5093 *) case "$d_longlong:$longlongsize" in
5098 val='"unsigned long long"'
5103 *) case "$d_int64_t" in
5122 '') echo "Alas, no 64-bit integer types in sight." >&4
5125 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5131 case "$uselonglong" in
5132 "$define"|true|[yY]*)
5135 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5137 use64bitint="$define"
5140 case "$use64bits" in
5141 "$define"|true|[yY]*)
5144 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5146 use64bitint="$define"
5149 case "$use64bitints" in
5150 "$define"|true|[yY]*)
5153 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5155 use64bitint="$define"
5158 case "$use64bitsint" in
5159 "$define"|true|[yY]*)
5162 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5164 use64bitint="$define"
5167 case "$uselonglongs" in
5168 "$define"|true|[yY]*)
5171 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5173 use64bitint="$define"
5176 case "$use64bitsall" in
5177 "$define"|true|[yY]*)
5180 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5182 use64bitall="$define"
5187 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5189 case "$use64bitall" in
5190 "$define"|true|[yY]*) use64bitint="$define" ;;
5196 You have natively 64-bit long integers.
5200 *) case "$use64bitint" in
5201 "$define"|true|[yY]*) dflt='y';;
5210 Perl can be built to take advantage of 64-bit integer types
5211 on some systems. To do so, Configure can be run with -Duse64bitint.
5212 Choosing this option will most probably introduce binary incompatibilities.
5214 If this doesn't make any sense to you, just accept the default '$dflt'.
5215 (The default has been chosen based on your configuration.)
5217 rp='Try to use 64-bit integers, if available?'
5220 [yY]*) val="$define" ;;
5228 case "$use64bitall" in
5229 "$define"|true|[yY]*) dflt='y' ;;
5230 *) case "$longsize" in
5238 You may also choose to try maximal 64-bitness. It means using as much
5239 64-bitness as possible on the platform. This in turn means even more
5240 binary incompatibilities. On the other hand, your platform may not
5241 have any more 64-bitness available than what you already have chosen.
5243 If this doesn't make any sense to you, just accept the default '$dflt'.
5244 (The default has been chosen based on your configuration.)
5246 rp='Try to use maximal 64-bit support, if available?'
5249 [yY]*) val="$define" ;;
5254 case "$use64bitall" in
5256 case "$use64bitint" in
5260 Since you have chosen a maximally 64-bit build, I'm also turning on
5261 the use of 64-bit integers.
5263 use64bitint="$define" ;;
5268 case "$use64bitint" in
5269 "$define"|true|[yY]*)
5270 : Look for a hint-file generated 'call-back-unit'. If the
5271 : user has specified that a 64-bit perl is to be built,
5272 : we may need to set or change some other defaults.
5273 if $test -f use64bitint.cbu; then
5274 echo "Your platform has some specific hints for 64-bit integers, using them..."
5278 4) case "$archname64" in
5279 '') archname64=64int ;;
5286 case "$use64bitall" in
5287 "$define"|true|[yY]*)
5288 : Look for a hint-file generated 'call-back-unit'. If the
5289 : user has specified that a maximally 64-bit perl is to be built,
5290 : we may need to set or change some other defaults.
5291 if $test -f use64bitall.cbu; then
5292 echo "Your platform has some specific hints for 64-bit builds, using them..."
5296 4) case "$archname64" in
5297 ''|64int) archname64=64all ;;
5305 echo "Checking for GNU C Library..." >&4
5318 if eval $compile_ok && $run ./try; then
5320 echo "You are using the GNU C Library"
5323 echo "You are not using the GNU C Library"
5329 : see if nm is to be used to determine whether a symbol is defined or not
5333 case "$d_gnulibc" in
5336 echo "nm probably won't work on the GNU C Library." >&4
5342 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5344 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5345 echo "'nm' won't be sufficient on this sytem." >&4
5351 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5352 if $test $dflt -gt 20; then
5362 true|$define) dflt=y;;
5369 I can use $nm to extract the symbols from your C libraries. This
5370 is a time consuming task which may generate huge output on the disk (up
5371 to 3 megabytes) but that should make the symbols extraction faster. The
5372 alternative is to skip the 'nm' extraction part and to compile a small
5373 test program instead to determine whether each symbol is present. If
5374 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5375 this may be the best solution.
5377 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5380 rp="Shall I use $nm to extract C symbols from the libraries?"
5383 [Nn]*) usenm=false;;
5392 : nm options which may be necessary
5394 '') if $test -f /mach_boot; then
5396 elif $test -d /usr/ccs/lib; then
5397 nm_opt='-p' # Solaris (and SunOS?)
5398 elif $test -f /dgux; then
5400 elif $test -f /lib64/rld; then
5401 nm_opt='-p' # 64-bit Irix
5407 : nm options which may be necessary for shared libraries but illegal
5408 : for archive libraries. Thank you, Linux.
5409 case "$nm_so_opt" in
5410 '') case "$myuname" in
5412 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5413 nm_so_opt='--dynamic'
5422 : get list of predefined functions in a handy place
5427 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5433 *) for thislib in $libs; do
5436 : Handle C library specially below.
5439 thislib=`echo $thislib | $sed -e 's/^-l//'`
5440 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5442 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5444 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5446 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5448 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5450 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5452 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5457 libnames="$libnames $try"
5459 *) libnames="$libnames $thislib" ;;
5468 for xxx in $libpth; do
5469 $test -r $1 || set $xxx/libc.$so
5470 : The messy sed command sorts on library version numbers.
5472 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5473 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5475 s/[0-9][0-9]*/0000&/g
5476 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5479 $sort | $sed -e 's/^.* //'`
5482 $test -r $1 || set /usr/ccs/lib/libc.$so
5483 $test -r $1 || set /lib/libsys_s$_a
5489 if $test -r "$1"; then
5490 echo "Your (shared) C library seems to be in $1."
5492 elif $test -r /lib/libc && $test -r /lib/clib; then
5493 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5495 libc='/lib/clib /lib/libc'
5496 if $test -r /lib/syslib; then
5497 echo "(Your math library is in /lib/syslib.)"
5498 libc="$libc /lib/syslib"
5500 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5501 echo "Your C library seems to be in $libc, as you said before."
5502 elif $test -r $incpath/usr/lib/libc$_a; then
5503 libc=$incpath/usr/lib/libc$_a;
5504 echo "Your C library seems to be in $libc. That's fine."
5505 elif $test -r /lib/libc$_a; then
5507 echo "Your C library seems to be in $libc. You're normal."
5509 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5511 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5512 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5513 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5515 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5517 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5520 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5522 if $test -r "$tans"; then
5523 echo "Your C library seems to be in $tans, of all places."
5529 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5533 If the guess above is wrong (which it might be if you're using a strange
5534 compiler, or your machine supports multiple models), you can override it here.
5539 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5541 I can't seem to find your C library. I've looked in the following places:
5544 $sed 's/^/ /' libpath
5547 None of these seems to contain your C library. I need to get its name...
5552 rp='Where is your C library?'
5557 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5558 set X `cat libnames`
5561 case $# in 1) xxx=file; esac
5562 echo "Extracting names from the following $xxx for later perusal:" >&4
5564 $sed 's/^/ /' libnames >&4
5566 $echo $n "This may take a while...$c" >&4
5570 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5571 *) $nm $nm_opt $file 2>/dev/null;;
5576 $grep fprintf libc.tmp > libc.ptf
5577 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5578 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
5580 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5582 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5584 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5586 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5588 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5590 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5592 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5594 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5596 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5598 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5600 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5602 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5604 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5605 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5607 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5609 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5611 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5613 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5615 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5617 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5619 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5621 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5623 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5625 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5627 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5629 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5631 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5633 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5635 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5638 $nm -p $* 2>/dev/null >libc.tmp
5639 $grep fprintf libc.tmp > libc.ptf
5640 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5641 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5647 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5649 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5650 for thisname in $libnames $libc; do
5651 $ar t $thisname >>libc.tmp
5653 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5655 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5656 # Repeat libc to extract forwarders to DLL entries too
5657 for thisname in $libnames $libc; do
5658 $ar tv $thisname >>libc.tmp
5659 # Revision 50 of EMX has bug in $ar.
5660 # it will not extract forwarders to DLL entries
5661 # Use emximp which will extract exactly them.
5662 emximp -o tmp.imp $thisname \
5664 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5665 < tmp.imp >>libc.tmp
5668 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5671 echo "$ar didn't seem to work right." >&4
5672 echo "Maybe this is a Cray...trying bld instead..." >&4
5673 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5675 for thisname in $libnames; do
5677 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5678 $ar t $thisname >>libc.tmp
5682 echo "That didn't work either. Giving up." >&4
5689 if $test -f /lib/syscalls.exp; then
5691 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5692 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
5696 $rm -f libnames libpath
5698 : is a C symbol defined?
5701 -v) tf=libc.tmp; tc=""; tdc="";;
5702 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5703 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5706 case "$reuseval-$4" in
5708 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5714 if $contains $tlook $tf >/dev/null 2>&1;
5719 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5720 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5728 $define) tval=true;;
5734 : define an is-in-libc? function
5735 inlibc='echo " "; td=$define; tu=$undef;
5736 sym=$1; var=$2; eval "was=\$$2";
5738 case "$reuseval$was" in
5748 echo "$sym() found." >&4;
5749 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5751 echo "$sym() NOT found." >&4;
5752 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5756 $define) echo "$sym() found." >&4;;
5757 *) echo "$sym() NOT found." >&4;;
5761 : see if sqrtl exists
5765 : check for length of double
5767 case "$doublesize" in
5769 echo "Checking to see how big your double precision numbers are..." >&4
5770 $cat >try.c <<'EOCP'
5774 printf("%d\n", (int)sizeof(double));
5779 if eval $compile_ok; then
5780 doublesize=`$run ./try`
5781 echo "Your double is $doublesize bytes long."
5784 echo "(I can't seem to compile the test program. Guessing...)"
5785 rp="What is the size of a double precision number (in bytes)?"
5793 : check for long doubles
5795 echo "Checking to see if you have long double..." >&4
5796 echo 'int main() { long double x = 7.0; }' > try.c
5798 if eval $compile; then
5800 echo "You have long double."
5803 echo "You do not have long double."
5809 : check for length of long double
5810 case "${d_longdbl}${longdblsize}" in
5813 echo "Checking to see how big your long doubles are..." >&4
5814 $cat >try.c <<'EOCP'
5818 printf("%d\n", sizeof(long double));
5823 if eval $compile; then
5824 longdblsize=`$run ./try`
5825 echo "Your long doubles are $longdblsize bytes long."
5829 echo "(I can't seem to compile the test program. Guessing...)" >&4
5830 rp="What is the size of a long double (in bytes)?"
5834 if $test "X$doublesize" = "X$longdblsize"; then
5835 echo "(That isn't any different from an ordinary double.)"
5843 if $test X"$d_longdbl" = X"$define"; then
5845 echo "Checking how to print long doubles..." >&4
5847 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
5848 $cat >try.c <<'EOCP'
5849 #include <sys/types.h>
5853 printf("%.3f\n", d);
5857 if eval $compile; then
5861 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
5862 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
5863 echo "We will use %f."
5869 if $test X"$sPRIfldbl" = X; then
5870 $cat >try.c <<'EOCP'
5871 #include <sys/types.h>
5874 long double d = 123.456;
5875 printf("%.3Lf\n", d);
5879 if eval $compile; then
5883 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
5884 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
5885 echo "We will use %Lf."
5891 if $test X"$sPRIfldbl" = X; then
5892 $cat >try.c <<'EOCP'
5893 #include <sys/types.h>
5896 long double d = 123.456;
5897 printf("%.3llf\n", d);
5901 if eval $compile; then
5905 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
5906 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
5907 echo "We will use %llf."
5913 if $test X"$sPRIfldbl" = X; then
5914 $cat >try.c <<'EOCP'
5915 #include <sys/types.h>
5918 long double d = 123.456;
5919 printf("%.3lf\n", d);
5923 if eval $compile; then
5927 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
5928 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
5929 echo "We will use %lf."
5935 if $test X"$sPRIfldbl" = X; then
5936 echo "Cannot figure out how to print long doubles." >&4
5938 sSCNfldbl=$sPRIfldbl # expect consistency
5945 case "$sPRIfldbl" in
5946 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
5947 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
5948 d_SCNfldbl="$undef";
5950 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
5951 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
5952 d_SCNfldbl="$define";
5956 : see if modfl exists
5960 d_modfl_pow32_bug="$undef"
5962 case "$d_longdbl$d_modfl" in
5965 Checking to see whether your modfl() is okay for large values...
5971 long double nv = 4294967303.15;
5977 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
5981 case "$osname:$gccversion" in
5982 aix:) saveccflags="$ccflags"
5983 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
5986 if eval $compile; then
5989 *" 4294967303.150000 1.150000 4294967302.000000")
5990 echo >&4 "Your modfl() is broken for large values."
5991 d_modfl_pow32_bug="$define"
5993 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
5997 *" 4294967303.150000 0.150000 4294967303.000000")
5998 echo >&4 "Your modfl() seems okay for large values."
6000 *) echo >&4 "I don't understand your modfl() at all."
6004 $rm -f try.* try core core.try.*
6006 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
6009 case "$osname:$gccversion" in
6010 aix:) ccflags="$saveccflags" ;; # restore
6016 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6019 case "$uselongdouble" in
6020 $define|true|[yY]*) dflt='y';;
6025 Perl can be built to take advantage of long doubles which
6026 (if available) may give more accuracy and range for floating point numbers.
6028 If this doesn't make any sense to you, just accept the default '$dflt'.
6030 rp='Try to use long doubles if available?'
6033 y|Y) val="$define" ;;
6039 case "$uselongdouble" in
6040 true|[yY]*) uselongdouble="$define" ;;
6043 case "$uselongdouble" in
6045 : Look for a hint-file generated 'call-back-unit'. If the
6046 : user has specified that long doubles should be used,
6047 : we may need to set or change some other defaults.
6048 if $test -f uselongdouble.cbu; then
6049 echo "Your platform has some specific hints for long doubles, using them..."
6050 . ./uselongdouble.cbu
6053 (Your platform doesn't have any specific hints for long doubles.)
6060 case "$uselongdouble:$d_sqrtl:$d_modfl" in
6061 $define:$define:$define)
6064 $define:$define:$undef)
6065 message="I could not find modfl"
6067 $define:$undef:$define)
6068 message="I could not find sqrtl"
6070 $define:$undef:$undef)
6071 message="I found neither sqrtl nor modfl"
6075 if $test "$message" != X; then
6078 *** You requested the use of long doubles but you do not seem to have
6079 *** the mathematic functions for long doubles.
6081 *** I'm disabling the use of long doubles.
6085 uselongdouble=$undef
6088 case "$useperlio" in
6089 $define|true|[yY]*|'') dflt='y';;
6094 Previous version of $package used the standard IO mechanisms as
6095 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
6096 alternate IO mechanisms via the PerlIO abstraction layer, but the
6097 stdio mechanism is still available if needed. The abstraction layer
6098 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
6099 Using PerlIO with sfio may cause problems with some extension modules.
6101 If this doesn't make any sense to you, just accept the default '$dflt'.
6103 rp='Use the PerlIO abstraction layer?'
6110 echo "Ok, doing things the stdio way."
6119 case "$useperlio" in
6120 $define|true|[yY]*) ;;
6123 You are using the SOCKS proxy protocol library which means that you
6124 should also use the PerlIO layer. You may be headed for trouble.
6133 : determine the architecture name
6135 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6136 tarch=`arch`"-$osname"
6137 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6138 if uname -m > tmparch 2>&1 ; then
6139 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6140 -e 's/$/'"-$osname/" tmparch`
6148 case "$myarchname" in
6151 echo "(Your architecture name used to be $myarchname.)"
6155 case "$targetarch" in
6157 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6162 *) dflt="$archname";;
6164 rp='What is your architecture name'
6167 case "$usethreads" in
6169 echo "Threads selected." >&4
6171 *-thread*) echo "...and architecture name already has -thread." >&4
6173 *) archname="$archname-thread"
6174 echo "...setting architecture name to $archname." >&4
6179 case "$usemultiplicity" in
6181 echo "Multiplicity selected." >&4
6183 *-multi*) echo "...and architecture name already has -multi." >&4
6185 *) archname="$archname-multi"
6186 echo "...setting architecture name to $archname." >&4
6191 case "$use64bitint$use64bitall" in
6193 case "$archname64" in
6195 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6198 case "$use64bitint" in
6199 "$define") echo "64 bit integers selected." >&4 ;;
6201 case "$use64bitall" in
6202 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6205 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6207 *) archname="$archname-$archname64"
6208 echo "...setting architecture name to $archname." >&4
6214 case "$uselongdouble" in
6216 echo "Long doubles selected." >&4
6217 case "$longdblsize" in
6219 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6223 *-ld*) echo "...and architecture name already has -ld." >&4
6225 *) archname="$archname-ld"
6226 echo "...setting architecture name to $archname." >&4
6233 case "$useperlio" in
6235 echo "Perlio selected." >&4
6238 echo "Perlio not selected, using stdio." >&4
6240 *-stdio*) echo "...and architecture name already has -stdio." >&4
6242 *) archname="$archname-stdio"
6243 echo "...setting architecture name to $archname." >&4
6249 : determine root of directory hierarchy where package will be installed.
6252 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
6260 By default, $package will be installed in $dflt/bin, manual pages
6261 under $dflt/man, etc..., i.e. with $dflt as prefix for all
6262 installation directories. Typically this is something like /usr/local.
6263 If you wish to have binaries under /usr/bin but other parts of the
6264 installation under /usr/local, that's ok: you will be prompted
6265 separately for each of the installation directories, the prefix being
6266 only used to set the defaults.
6270 rp='Installation prefix to use?'
6278 *) oldprefix="$prefix";;
6287 *) afsroot=$afsroot ;;
6293 $define|true) afs=true ;;
6294 $undef|false) afs=false ;;
6295 *) if test -d $afsroot; then
6303 echo "AFS may be running... I'll be extra cautious then..." >&4
6305 echo "AFS does not seem to be running..." >&4
6308 : determine installation prefix for where package is to be installed.
6312 Since you are running AFS, I need to distinguish the directory in which
6313 files will reside from the directory in which they are installed (and from
6314 which they are presumably copied to the former directory by occult means).
6317 case "$installprefix" in
6318 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
6319 *) dflt="$installprefix";;
6324 In some special cases, particularly when building $package for distribution,
6325 it is convenient to distinguish between the directory in which files should
6326 be installed from the directory ($prefix) in which they
6327 will eventually reside. For most users, these two directories are the same.
6330 case "$installprefix" in
6332 *) dflt=$installprefix;;
6336 rp='What installation prefix should I use for installing files?'
6338 installprefix="$ans"
6339 installprefixexp="$ansexp"
6341 : set the prefixit variable, to compute a suitable default value
6342 prefixit='case "$3" in
6344 case "$oldprefix" in
6345 "") eval "$1=\"\$$2\"";;
6352 ""|" ") eval "$1=\"\$$2\"";;
6358 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6360 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6361 /*-$oldprefix/*|\~*-$oldprefix/*)
6362 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6363 *) eval "$1=\"\$$2\"";;
6367 : get the patchlevel
6369 echo "Getting the current patchlevel..." >&4
6370 if $test -r $rsrc/patchlevel.h;then
6371 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6372 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6373 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6374 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6375 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6376 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6377 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6386 $echo "(You do not have patchlevel.h. Eek.)"
6388 if $test -r $rsrc/.patch ; then
6389 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6390 perl_patchlevel=`cat $rsrc/.patch`
6393 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6394 version_patchlevel_string="version $patchlevel subversion $subversion"
6395 case "$perl_patchlevel" in
6397 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6400 $echo "(You have $package $version_patchlevel_string.)"
6404 : XXX Should be a Configure test for double-dots in filenames.
6405 version=`echo $revision $patchlevel $subversion | \
6406 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6407 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6408 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6411 version=`echo $revision $patchlevel $subversion | \
6412 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6413 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6414 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6417 : Special case the 5.005_xx maintenance series, which used 5.005
6418 : without any subversion label as a subdirectory in $sitelib
6419 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6420 api_versionstring='5.005'
6423 : determine installation style
6424 : For now, try to deduce it from prefix unless it is already set.
6425 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6426 case "$installstyle" in
6427 '') case "$prefix" in
6428 *perl*) dflt='lib';;
6429 *) dflt='lib/perl5' ;;
6432 *) dflt="$installstyle" ;;
6434 : Probably not worth prompting for this since we prompt for all
6435 : the directories individually, and the prompt would be too long and
6439 : determine where private library files go
6440 : Usual default is /usr/local/lib/perl5/$version.
6441 : Also allow things like /opt/perl/lib/$version, since
6442 : /opt/perl/lib/perl5... would be redundant.
6443 : The default "style" setting is made in installstyle.U
6444 case "$installstyle" in
6445 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6446 *) set dflt privlib lib/$version ;;
6451 There are some auxiliary files for $package that need to be put into a
6452 private library directory that is accessible by everyone.
6456 rp='Pathname where the private library files will reside?'
6459 privlibexp="$ansexp"
6460 : Change installation prefix, if necessary.
6461 if $test X"$prefix" != X"$installprefix"; then
6462 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6464 installprivlib="$privlibexp"
6467 : set the prefixup variable, to restore leading tilda escape
6468 prefixup='case "$prefixexp" in
6470 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6473 : determine where public architecture dependent libraries go
6476 : privlib default is /usr/local/lib/$package/$version
6477 : archlib default is /usr/local/lib/$package/$version/$archname
6478 : privlib may have an optional trailing /share.
6479 tdflt=`echo $privlib | $sed 's,/share$,,'`
6480 tdflt=$tdflt/$archname
6489 $spackage contains architecture-dependent library files. If you are
6490 sharing libraries in a heterogeneous environment, you might store
6491 these files in a separate location. Otherwise, you can just include
6492 them with the rest of the public library files.
6496 rp='Where do you want to put the public architecture-dependent libraries?'
6499 archlibexp="$ansexp"
6500 if $test X"$archlib" = X"$privlib"; then
6505 : Change installation prefix, if necessary.
6506 if $test X"$prefix" != X"$installprefix"; then
6507 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6509 installarchlib="$archlibexp"
6512 : see if setuid scripts can be secure
6515 Some kernels have a bug that prevents setuid #! scripts from being
6516 secure. Some sites have disabled setuid #! scripts because of this.
6518 First let's decide if your kernel supports secure setuid #! scripts.
6519 (If setuid #! scripts would be secure but have been disabled anyway,
6520 don't say that they are secure if asked.)
6525 if $test -d /dev/fd; then
6526 echo "#!$ls" >reflect
6527 chmod +x,u+s reflect
6528 ./reflect >flect 2>&1
6529 if $contains "/dev/fd" flect >/dev/null; then
6530 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6534 If you are not sure if they are secure, I can check but I'll need a
6535 username and password different from the one you are using right now.
6536 If you don't have such a username or don't want me to test, simply
6540 rp='Other username to test security of setuid scripts with?'
6545 case "$d_suidsafe" in
6546 '') echo "I'll assume setuid scripts are *not* secure." >&4
6549 echo "Well, the $hint value is *not* secure." >&4
6551 *) echo "Well, the $hint value *is* secure." >&4
6556 $rm -f reflect flect
6557 echo "#!$ls" >reflect
6558 chmod +x,u+s reflect
6561 echo '"su" will (probably) prompt you for '"$ans's password."
6562 su $ans -c './reflect >flect'
6563 if $contains "/dev/fd" flect >/dev/null; then
6564 echo "Okay, it looks like setuid scripts are secure." >&4
6567 echo "I don't think setuid scripts are secure." >&4
6572 rp='Does your kernel have *secure* setuid scripts?'
6575 [yY]*) val="$define";;
6580 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6581 echo "(That's for file descriptors, not floppy disks.)"
6587 $rm -f reflect flect
6589 : now see if they want to do setuid emulation
6592 case "$d_suidsafe" in
6595 echo "No need to emulate SUID scripts since they are secure here." >&4
6599 Some systems have disabled setuid scripts, especially systems where
6600 setuid scripts cannot be secure. On systems where setuid scripts have
6601 been disabled, the setuid/setgid bits on scripts are currently
6602 useless. It is possible for $package to detect those bits and emulate
6603 setuid/setgid in a secure fashion. This emulation will only work if
6604 setuid scripts have been disabled in your kernel.
6608 "$define") dflt=y ;;
6611 rp="Do you want to do setuid/setgid emulation?"
6614 [yY]*) val="$define";;
6622 : see if this is a malloc.h system
6623 set malloc.h i_malloc
6626 : see if stdlib is available
6627 set stdlib.h i_stdlib
6630 : check for void type
6632 echo "Checking to see how well your C compiler groks the void type..." >&4
6633 case "$voidflags" in
6635 $cat >try.c <<'EOCP'
6641 extern void moo(); /* function returning void */
6642 void (*goo)(); /* ptr to func returning void */
6644 void *hue; /* generic ptr */
6657 int main() { sub(); }
6659 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6660 voidflags=$defvoidused
6661 echo "Good. It appears to support void to the level $package wants.">&4
6662 if $contains warning .out >/dev/null 2>&1; then
6663 echo "However, you might get some warnings that look like this:"
6667 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6668 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6669 echo "It supports 1..."
6670 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6671 echo "It also supports 2..."
6672 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6674 echo "And it supports 4 but not 8 definitely."
6676 echo "It doesn't support 4..."
6677 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6679 echo "But it supports 8."
6682 echo "Neither does it support 8."
6686 echo "It does not support 2..."
6687 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6689 echo "But it supports 4 and 8."
6691 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6693 echo "And it supports 4 but has not heard about 8."
6695 echo "However it supports 8 but not 4."
6700 echo "There is no support at all for void."
6705 case "$voidflags" in
6708 Support flag bits are:
6709 1: basic void declarations.
6710 2: arrays of pointers to functions returning void.
6711 4: operations between pointers to and addresses of void functions.
6712 8: generic void pointers.
6715 rp="Your void support flags add up to what?"
6722 : check for length of pointer
6726 echo "Checking to see how big your pointers are..." >&4
6727 if test "$voidflags" -gt 7; then
6728 echo '#define VOID_PTR char *' > try.c
6730 echo '#define VOID_PTR void *' > try.c
6732 $cat >>try.c <<'EOCP'
6736 printf("%d\n", (int)sizeof(VOID_PTR));
6741 if eval $compile_ok; then
6742 ptrsize=`$run ./try`
6743 echo "Your pointers are $ptrsize bytes long."
6746 echo "(I can't seem to compile the test program. Guessing...)" >&4
6747 rp="What is the size of a pointer (in bytes)?"
6754 case "$use64bitall" in
6755 "$define"|true|[yY]*)
6759 *** You have chosen a maximally 64-bit build, but your pointers
6760 *** are only 4 bytes wide, disabling maximal 64-bitness.
6763 use64bitall="$undef"
6764 case "$use64bitint" in
6765 "$define"|true|[yY]*) ;;
6768 *** Downgrading from maximal 64-bitness to using 64-bit integers.
6771 use64bitint="$define"
6780 : determine which malloc to compile in
6782 case "$usemymalloc" in
6783 [yY]*|true|$define) dflt='y' ;;
6784 [nN]*|false|$undef) dflt='n' ;;
6785 *) case "$ptrsize" in
6791 rp="Do you wish to attempt to use the malloc that comes with $package?"
6797 mallocsrc='malloc.c'
6798 mallocobj="malloc$_o"
6799 d_mymalloc="$define"
6802 : Remove malloc from list of libraries to use
6803 echo "Removing unneeded -lmalloc from library list" >&4
6804 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6807 echo "libs = $libs" >&4
6819 : compute the return types of malloc and free
6821 $cat >malloc.c <<END
6825 #include <sys/types.h>
6839 case "$malloctype" in
6841 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6848 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6852 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6859 echo "Your system uses $freetype free(), it would seem." >&4
6863 After $package is installed, you may wish to install various
6864 add-on modules and utilities. Typically, these add-ons will
6865 be installed under $prefix with the rest
6866 of this package. However, you may wish to install such add-ons
6867 elsewhere under a different prefix.
6869 If you do not wish to put everything under a single prefix, that's
6870 ok. You will be prompted for the individual locations; this siteprefix
6871 is only used to suggest the defaults.
6873 The default should be fine for most people.
6877 rp='Installation prefix to use for add-on modules and utilities?'
6878 : XXX Here might be another good place for an installstyle setting.
6879 case "$siteprefix" in
6881 *) dflt=$siteprefix ;;
6884 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6886 case "$siteprefix" in
6890 *) oldsiteprefix="$prefix";;
6895 siteprefixexp="$ansexp"
6897 : determine where site specific libraries go.
6898 : Usual default is /usr/local/lib/perl5/site_perl/$version
6899 : The default "style" setting is made in installstyle.U
6900 : XXX No longer works with Prefixit stuff.
6901 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6903 '') case "$installstyle" in
6904 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6905 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6913 The installation process will create a directory for
6914 site-specific extensions and modules. Most users find it convenient
6915 to place all site-specific files in this directory rather than in the
6916 main distribution directory.
6920 rp='Pathname for the site-specific library files?'
6923 sitelibexp="$ansexp"
6924 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6925 : Change installation prefix, if necessary.
6926 if $test X"$prefix" != X"$installprefix"; then
6927 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6929 installsitelib="$sitelibexp"
6932 : determine where site specific architecture-dependent libraries go.
6933 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6934 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6935 : sitelib may have an optional trailing /share.
6937 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6938 dflt="$dflt/$archname"
6943 set sitearch sitearch none
6947 The installation process will also create a directory for
6948 architecture-dependent site-specific extensions and modules.
6952 rp='Pathname for the site-specific architecture-dependent library files?'
6955 sitearchexp="$ansexp"
6956 : Change installation prefix, if necessary.
6957 if $test X"$prefix" != X"$installprefix"; then
6958 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6960 installsitearch="$sitearchexp"
6965 The installation process will also create a directory for
6966 vendor-supplied add-ons. Vendors who supply perl with their system
6967 may find it convenient to place all vendor-supplied files in this
6968 directory rather than in the main distribution directory. This will
6969 ease upgrades between binary-compatible maintenance versions of perl.
6971 Of course you may also use these directories in whatever way you see
6972 fit. For example, you might use them to access modules shared over a
6973 company-wide network.
6975 The default answer should be fine for most people.
6976 This causes further questions about vendor add-ons to be skipped
6977 and no vendor-specific directories will be configured for perl.
6980 rp='Do you want to configure vendor-specific add-on directories?'
6981 case "$usevendorprefix" in
6982 define|true|[yY]*) dflt=y ;;
6983 *) : User may have set vendorprefix directly on Configure command line.
6984 case "$vendorprefix" in
6993 rp='Installation prefix to use for vendor-supplied add-ons?'
6994 case "$vendorprefix" in
6996 *) dflt=$vendorprefix ;;
6999 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
7001 case "$vendorprefix" in
7005 *) oldvendorprefix="$prefix";;
7009 usevendorprefix="$define"
7011 vendorprefixexp="$ansexp"
7013 *) usevendorprefix="$undef"
7019 case "$vendorprefix" in
7020 '') d_vendorlib="$undef"
7024 *) d_vendorlib="$define"
7025 : determine where vendor-supplied modules go.
7026 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7027 case "$vendorlib" in
7029 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7030 case "$installstyle" in
7031 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7032 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7035 *) dflt="$vendorlib"
7039 rp='Pathname for the vendor-supplied library files?'
7042 vendorlibexp="$ansexp"
7045 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7046 : Change installation prefix, if necessary.
7047 if $test X"$prefix" != X"$installprefix"; then
7048 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
7050 installvendorlib="$vendorlibexp"
7053 case "$vendorprefix" in
7054 '') d_vendorarch="$undef"
7058 *) d_vendorarch="$define"
7059 : determine where vendor-supplied architecture-dependent libraries go.
7060 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7061 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7062 : vendorlib may have an optional trailing /share.
7063 case "$vendorarch" in
7064 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7065 dflt="$dflt/$archname"
7067 *) dflt="$vendorarch" ;;
7070 rp='Pathname for vendor-supplied architecture-dependent files?'
7073 vendorarchexp="$ansexp"
7076 : Change installation prefix, if necessary.
7077 if $test X"$prefix" != X"$installprefix"; then
7078 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
7080 installvendorarch="$vendorarchexp"
7083 : Final catch-all directories to search
7086 Lastly, you can have perl look in other directories for extensions and
7087 modules in addition to those already specified.
7088 These directories will be searched after
7092 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7093 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7095 case "$otherlibdirs" in
7096 ''|' ') dflt='none' ;;
7097 *) dflt="$otherlibdirs" ;;
7100 Enter a colon-separated set of extra paths to include in perl's @INC
7101 search path, or enter 'none' for no extra paths.
7105 rp='Colon-separated list of additional directories for perl to search?'
7108 ' '|''|none) otherlibdirs=' ' ;;
7109 *) otherlibdirs="$ans" ;;
7111 case "$otherlibdirs" in
7115 set d_perl_otherlibdirs
7118 : Cruising for prototypes
7120 echo "Checking out function prototypes..." >&4
7121 $cat >prototype.c <<'EOCP'
7122 int main(int argc, char *argv[]) {
7125 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7126 echo "Your C compiler appears to support function prototypes."
7129 echo "Your C compiler doesn't seem to understand function prototypes."
7136 case "$prototype" in
7138 *) ansi2knr='ansi2knr'
7143 This version of $package can only be compiled by a compiler that
7144 understands function prototypes. Unfortunately, your C compiler
7146 doesn't seem to understand them. Sorry about that.
7148 If GNU cc is available for your system, perhaps you could try that instead.
7150 Eventually, we hope to support building Perl with pre-ANSI compilers.
7151 If you would like to help in that effort, please contact <perlbug@perl.org>.
7153 Aborting Configure now.
7159 : determine where public executables go
7164 rp='Pathname where the public executables will reside?'
7166 if $test "X$ansexp" != "X$binexp"; then
7171 : Change installation prefix, if necessary.
7172 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7173 if $test X"$prefix" != X"$installprefix"; then
7174 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
7176 installbin="$binexp"
7185 Perl can be built with extra modules or bundles of modules which
7186 will be fetched from the CPAN and installed alongside Perl.
7188 Notice that you will need access to the CPAN; either via the Internet,
7189 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7190 be asked later to configure the CPAN.pm module which will in turn do
7191 the installation of the rest of the extra modules or bundles.)
7193 Notice also that if the modules require any external software such as
7194 libraries and headers (the libz library and the zlib.h header for the
7195 Compress::Zlib module, for example) you MUST have any such software
7196 already installed, this configuration process will NOT install such
7199 If this doesn't make any sense to you, just accept the default '$dflt'.
7201 rp='Install any extra modules (y or n)?'
7207 Please list any extra modules or bundles to be installed from CPAN,
7208 with spaces between the names. The names can be in any format the
7209 'install' command of CPAN.pm will understand. (Answer 'none',
7210 without the quotes, to install no extra modules or bundles.)
7220 $rm -f ../extras.lst
7222 *) echo "(Saving the list of extras for later...)"
7223 echo "$extras" > ../extras.lst
7231 : Find perl5.005 or later.
7232 echo "Looking for a previously installed perl5.005 or later... "
7234 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7235 : Check if this perl is recent and can load a simple module
7236 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7239 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7249 '') echo "None found. That's ok.";;
7250 *) echo "Using $perl5." ;;
7253 : Determine list of previous versions to include in @INC
7254 $cat > getverlist <<EOPL
7257 \$api_versionstring = "$api_versionstring";
7258 \$version = "$version";
7259 \$stem = "$sitelib_stem";
7260 \$archname = "$archname";
7262 $cat >> getverlist <<'EOPL'
7263 # Can't have leading @ because metaconfig interprets it as a command!
7264 ;@inc_version_list=();
7265 # XXX Redo to do opendir/readdir?
7268 ;@candidates = glob("5.*");
7274 # XXX ToDo: These comparisons must be reworked when two-digit
7275 # subversions come along, so that 5.7.10 compares as greater than
7276 # 5.7.3! By that time, hope that 5.6.x is sufficiently
7277 # widespread that we can use the built-in version vectors rather
7278 # than reinventing them here. For 5.6.0, however, we must
7279 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
7280 foreach $d (@candidates) {
7281 if ($d lt $version) {
7282 if ($d ge $api_versionstring) {
7283 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
7285 elsif ($d ge "5.005") {
7286 unshift(@inc_version_list, grep { -d } $d);
7290 # Skip newer version. I.e. don't look in
7291 # 5.7.0 if we're installing 5.6.1.
7295 if (@inc_version_list) {
7296 print join(' ', @inc_version_list);
7299 # Blank space to preserve value for next Configure run.
7304 case "$inc_version_list" in
7305 '') if test -x "$perl5$exe_ext"; then
7306 dflt=`$perl5 getverlist`
7311 $undef) dflt='none' ;;
7312 *) eval dflt=\"$inc_version_list\" ;;
7315 ''|' ') dflt=none ;;
7322 In order to ease the process of upgrading, this version of perl
7323 can be configured to use modules built and installed with earlier
7324 versions of perl that were installed under $prefix. Specify here
7325 the list of earlier versions that this version of perl should check.
7326 If Configure detected no earlier versions of perl installed under
7327 $prefix, then the list will be empty. Answer 'none' to tell perl
7328 to not search earlier versions.
7330 The default should almost always be sensible, so if you're not sure,
7331 just accept the default.
7334 rp='List of earlier versions to include in @INC?'
7337 [Nn]one|''|' ') inc_version_list=' ' ;;
7338 *) inc_version_list="$ans" ;;
7340 case "$inc_version_list" in
7342 inc_version_list_init='0';;
7343 *) inc_version_list_init=`echo $inc_version_list |
7344 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7349 : determine whether to install perl also as /usr/bin/perl
7352 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7354 Many scripts expect perl to be installed as /usr/bin/perl.
7355 I can install the perl you are about to compile also as /usr/bin/perl
7356 (in addition to $installbin/perl).
7358 case "$installusrbinperl" in
7359 "$undef"|[nN]*) dflt='n';;
7362 rp="Do you want to install perl as /usr/bin/perl?"
7365 [yY]*) val="$define";;
7371 set installusrbinperl
7374 : see if dld is available
7378 : see if dlopen exists
7385 : determine which dynamic loading, if any, to compile in
7387 dldir="ext/DynaLoader"
7400 $define) dflt='y' ;;
7403 $define) dflt='y' ;;
7405 : Does a dl_xxx.xs file exist for this operating system
7406 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7409 rp="Do you wish to use dynamic loading?"
7416 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7417 dflt="$dldir/dl_${osname}.xs"
7418 elif $test "$d_dlopen" = "$define" ; then
7419 dflt="$dldir/dl_dlopen.xs"
7420 elif $test "$i_dld" = "$define" ; then
7421 dflt="$dldir/dl_dld.xs"
7426 *) dflt="$dldir/$dlsrc"
7429 echo "The following dynamic loading files are available:"
7430 : Can not go over to $dldir because getfile has path hard-coded in.
7431 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7432 rp="Source file to use for dynamic loading"
7438 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7442 Some systems may require passing special flags to $cc -c to
7443 compile modules that will be used to create a shared library.
7444 To use no flags, say "none".
7447 case "$cccdlflags" in
7448 '') case "$gccversion" in
7449 '') case "$osname" in
7451 next) dflt='none' ;;
7452 irix*) dflt='-KPIC' ;;
7453 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7454 sunos) dflt='-pic' ;;
7458 *) case "$osname" in
7459 darwin) dflt='none' ;;
7460 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7465 *) dflt="$cccdlflags" ;;
7467 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7470 none) cccdlflags=' ' ;;
7471 *) cccdlflags="$ans" ;;
7476 Some systems use ld to create libraries that can be dynamically loaded,
7477 while other systems (such as those using ELF) use $cc.
7481 '') $cat >try.c <<'EOM'
7482 /* Test for whether ELF binaries are produced */
7487 int i = open("a.out",O_RDONLY);
7490 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7491 exit(0); /* succeed (yes, it's ELF) */
7496 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7498 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7502 echo "I'll use ld to build dynamic libraries."
7511 rp="What command should be used to create dynamic libraries?"
7517 Some systems may require passing special flags to $ld to create a
7518 library that can be dynamically loaded. If your ld flags include
7519 -L/other/path options to locate libraries outside your loader's normal
7520 search path, you may need to specify those -L options here as well. To
7521 use no flags, say "none".
7524 case "$lddlflags" in
7525 '') case "$osname" in
7526 beos) dflt='-nostart' ;;
7528 case "$gccversion" in
7529 '') dflt="$dflt +vnocompatwarnings" ;;
7532 linux|irix*) dflt='-shared' ;;
7533 next) dflt='none' ;;
7534 solaris) dflt='-G' ;;
7535 sunos) dflt='-assert nodefinitions' ;;
7536 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7540 *) dflt="$lddlflags" ;;
7543 : Try to guess additional flags to pick up local libraries.
7544 : Be careful not to append to a plain 'none'
7548 for thisflag in $ldflags; do
7553 *) dflt="$dflt $thisflag" ;;
7560 ''|' ') dflt='none' ;;
7563 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7566 none) lddlflags=' ' ;;
7567 *) lddlflags="$ans" ;;
7572 Some systems may require passing special flags to $cc to indicate that
7573 the resulting executable will use dynamic linking. To use no flags,
7577 case "$ccdlflags" in
7578 '') case "$osname" in
7579 hpux) dflt='-Wl,-E' ;;
7580 linux) dflt='-rdynamic' ;;
7581 next) dflt='none' ;;
7582 sunos) dflt='none' ;;
7586 *) dflt="$ccdlflags" ;;
7588 rp="Any special flags to pass to $cc to use dynamic linking?"
7591 none) ccdlflags=' ' ;;
7592 *) ccdlflags="$ans" ;;
7606 # No dynamic loading being used, so don't bother even to prompt.
7609 *) case "$useshrplib" in
7610 '') case "$osname" in
7611 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7613 also='Building a shared libperl is required for dynamic loading to work on your system.'
7618 also='Building a shared libperl is needed for MAB support.'
7636 The perl executable is normally obtained by linking perlmain.c with
7637 libperl${_a}, any static extensions (usually just DynaLoader), and
7638 any other libraries needed on this system (such as -lm, etc.). Since
7639 your system supports dynamic loading, it is probably possible to build
7640 a shared libperl.$so. If you will have more than one executable linked
7641 to libperl.$so, this will significantly reduce the size of each
7642 executable, but it may have a noticeable affect on performance. The
7643 default is probably sensible for your system.
7647 rp="Build a shared libperl.$so (y/n)"
7651 useshrplib='true' ;;
7652 *) useshrplib='false' ;;
7657 case "$useshrplib" in
7661 # Figure out a good name for libperl.so. Since it gets stored in
7662 # a version-specific architecture-dependent library, the version
7663 # number isn't really that important, except for making cc/ld happy.
7665 # A name such as libperl.so.3.1
7666 majmin="libperl.$so.$patchlevel.$subversion"
7667 # A name such as libperl.so.301
7668 majonly=`echo $patchlevel $subversion |
7669 $awk '{printf "%d%02d", $1, $2}'`
7670 majonly=libperl.$so.$majonly
7671 # I'd prefer to keep the os-specific stuff here to a minimum, and
7672 # rely on figuring it out from the naming of libc.
7673 case "${osname}${osvers}" in
7676 # XXX How handle the --version stuff for MAB?
7678 linux*) # ld won't link with a bare -lperl otherwise.
7681 cygwin*) # ld links against an importlib
7682 dflt=libperl$lib_ext
7684 *) # Try to guess based on whether libc has major.minor.
7686 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7687 *libc.$so.[0-9]*) dflt=$majonly ;;
7688 *) dflt=libperl.$so ;;
7698 I need to select a good name for the shared libperl. If your system uses
7699 library names with major and minor numbers, then you might want something
7700 like $majmin. Alternatively, if your system uses a single version
7701 number for shared libraries, then you might want to use $majonly.
7702 Or, your system might be quite happy with a simple libperl.$so.
7704 Since the shared libperl will get installed into a version-specific
7705 architecture-dependent directory, the version number of the shared perl
7706 library probably isn't important, so the default should be o.k.
7709 rp='What name do you want to give to the shared libperl?'
7712 echo "Ok, I'll use $libperl"
7715 libperl="libperl${_a}"
7719 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7723 WARNING: Use of the shrpdir variable for the installation location of
7724 the shared $libperl is not supported. It was never documented and
7725 will not work in this version. Let me (perlbug@perl.org)
7726 know of any problems this may cause.
7732 But your current setting of $shrpdir is
7733 the default anyway, so it's harmless.
7738 Further, your current attempted setting of $shrpdir
7739 conflicts with the value of $archlibexp/CORE
7740 that installperl will use.
7747 # How will the perl executable find the installed shared $libperl?
7748 # Add $xxx to ccdlflags.
7749 # If we can't figure out a command-line option, use $shrpenv to
7750 # set env LD_RUN_PATH. The main perl makefile uses this.
7751 shrpdir=$archlibexp/CORE
7754 if "$useshrplib"; then
7757 # We'll set it in Makefile.SH...
7763 xxx="-Wl,-R$shrpdir"
7765 bsdos|linux|irix*|dec_osf)
7766 xxx="-Wl,-rpath,$shrpdir"
7769 # next doesn't like the default...
7772 # beos doesn't like the default, either.
7775 # hpux doesn't like the default, either.
7776 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7779 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7785 # Only add $xxx if it isn't already in ccdlflags.
7786 case " $ccdlflags " in
7788 *) ccdlflags="$ccdlflags $xxx"
7791 Adding $xxx to the flags
7792 passed to $ld so that the perl executable will find the
7793 installed shared $libperl.
7801 # Fix ccdlflags in AIX for building external extensions.
7802 # (For building Perl itself bare -bE:perl.exp is needed,
7803 # Makefile.SH takes care of this.)
7805 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7807 # Respect a hint or command-line value.
7809 '') shrpenv="$tmp_shrpenv" ;;
7811 case "$ldlibpthname" in
7812 '') ldlibpthname=LD_LIBRARY_PATH ;;
7813 none) ldlibpthname='' ;;
7816 : determine where manual pages are on this system
7820 syspath='/usr/share/man/man1 /usr/man/man1'
7821 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7822 syspath="$syspath /usr/man/u_man/man1"
7823 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7824 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7825 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7826 sysman=`./loc . /usr/man/man1 $syspath`
7829 if $test -d "$sysman"; then
7830 echo "System manual is in $sysman." >&4
7832 echo "Could not find manual pages in source form." >&4
7835 : determine where manual pages go
7836 set man1dir man1dir none
7840 $spackage has manual pages available in source form.
7844 echo "However, you don't have nroff, so they're probably useless to you."
7846 '') man1dir="none";;
7849 echo "If you don't want the manual sources installed, answer 'none'."
7854 lookpath="$prefixexp/share/man/man1"
7855 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7856 lookpath="$lookpath $prefixexp/man/p_man/man1"
7857 lookpath="$lookpath $prefixexp/man/u_man/man1"
7858 lookpath="$lookpath $prefixexp/man/man.1"
7860 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7861 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7871 rp="Where do the main $spackage manual pages (source) go?"
7873 if $test "X$man1direxp" != "X$ansexp"; then
7877 man1direxp="$ansexp"
7883 : Change installation prefix, if necessary.
7884 if $test X"$prefix" != X"$installprefix"; then
7885 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7887 installman1dir="$man1direxp"
7890 : What suffix to use on installed man pages
7897 rp="What suffix should be used for the main $spackage man pages?"
7899 '') case "$man1dir" in
7913 *) dflt="$man1ext";;
7920 : see if we can have long filenames
7922 first=123456789abcdef
7924 if (echo hi >$first) 2>/dev/null; then
7925 if $test -f 123456789abcde; then
7926 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7929 echo 'You can have filenames longer than 14 characters.'>&4
7934 You can't have filenames longer than 14 chars.
7935 You can't even think about them!
7941 $rm -rf 123456789abcde*
7943 : determine where library module manual pages go
7944 set man3dir man3dir none
7948 $spackage has manual pages for many of the library modules.
7954 However, you don't have nroff, so they're probably useless to you.
7957 '') man3dir="none";;
7961 case "$d_flexfnam" in
7964 However, your system can't handle the long file names like File::Basename.3.
7967 '') man3dir="none";;
7971 echo "If you don't want the manual sources installed, answer 'none'."
7972 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7974 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7975 if $test -d "$privlib/man/man3"; then
7978 WARNING: Previous versions of perl installed man3 pages into
7979 $privlib/man/man3. This version will suggest a
7980 new default of $dflt.
7984 rp='Do you wish to preserve the old behavior?(y/n)'
7987 y*) dflt="$privlib/man/man3" ;;
7992 *) dflt="$man3dir" ;;
7999 rp="Where do the $package library man pages (source) go?"
8002 man3direxp="$ansexp"
8008 : Change installation prefix, if necessary.
8009 if $test X"$prefix" != X"$installprefix"; then
8010 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
8012 installman3dir="$man3direxp"
8015 : What suffix to use on installed man pages
8021 rp="What suffix should be used for the $package library man pages?"
8023 '') case "$man3dir" in
8037 *) dflt="$man3ext";;
8044 : see if we have to deal with yellow pages, now NIS.
8045 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8046 if $test -f /usr/etc/nibindd; then
8048 echo "I'm fairly confident you're on a NeXT."
8050 rp='Do you get the hosts file via NetInfo?'
8059 y*) hostcat='nidump hosts .';;
8060 *) case "$hostcat" in
8061 nidump*) hostcat='';;
8071 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8079 rp='Are you getting the hosts file via yellow pages?'
8082 y*) hostcat='ypcat hosts';;
8083 *) hostcat='cat /etc/hosts';;
8089 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8092 '') test -f /etc/group && groupcat='cat /etc/group';;
8095 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8098 : now get the host name
8100 echo "Figuring out host name..." >&4
8101 case "$myhostname" in
8103 echo 'Maybe "hostname" will work...'
8104 if tans=`sh -c hostname 2>&1` ; then
8112 if $test "$cont"; then
8114 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8115 if tans=`cat /etc/systemid 2>&1` ; then
8117 phostname='cat /etc/systemid'
8118 echo "Whadyaknow. Xenix always was a bit strange..."
8121 elif $test -r /etc/systemid; then
8122 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8125 if $test "$cont"; then
8126 echo 'No, maybe "uuname -l" will work...'
8127 if tans=`sh -c 'uuname -l' 2>&1` ; then
8129 phostname='uuname -l'
8131 echo 'Strange. Maybe "uname -n" will work...'
8132 if tans=`sh -c 'uname -n' 2>&1` ; then
8134 phostname='uname -n'
8136 echo 'Oh well, maybe I can mine it out of whoami.h...'
8137 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8138 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8139 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8141 case "$myhostname" in
8142 '') echo "Does this machine have an identity crisis or something?"
8145 echo "Well, you said $myhostname before..."
8146 phostname='echo $myhostname';;
8152 case "$myhostname" in
8153 '') myhostname=noname ;;
8155 : you do not want to know about this
8160 if $test "$myhostname" ; then
8162 rp='Your host name appears to be "'$myhostname'".'" Right?"
8170 : bad guess or no guess
8171 while $test "X$myhostname" = X ; do
8173 rp="Please type the (one word) name of your host:"
8178 : translate upper to lower if necessary
8179 case "$myhostname" in
8181 echo "(Normalizing case in your host name)"
8182 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8186 case "$myhostname" in
8188 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8189 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8190 echo "(Trimming domain name from host name--host name is now $myhostname)"
8192 *) case "$mydomain" in
8195 test "X$hostcat" = "Xypcat hosts" &&
8196 ypmatch "$myhostname" hosts 2>/dev/null |\
8197 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8200 test "X$hostcat" != "X" &&
8201 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8202 /[ ]$myhostname[ . ]/p" > hosts
8205 if $test -f hosts; then
8206 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8207 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8208 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8209 hosts | $sort | $uniq | \
8210 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8211 case `$echo X$dflt` in
8212 X*\ *) echo "(Several hosts in the database matched hostname)"
8215 X.) echo "(You do not have fully-qualified names in the hosts database)"
8219 echo "(I cannot locate a hosts database anywhere)"
8224 tans=`./loc resolv.conf X /etc /usr/etc`
8225 if $test -f "$tans"; then
8226 echo "(Attempting domain name extraction from $tans)"
8227 dflt=.`$sed -n -e 's/ / /g' \
8228 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8229 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8231 .) dflt=.`$sed -n -e 's/ / /g' \
8232 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8233 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8240 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8241 dflt=.`sh -c domainname 2>/dev/null`
8244 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8248 case "$dflt$osname" in
8249 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8250 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8254 .) echo "(Lost all hope -- silly guess then)"
8260 *) dflt="$mydomain";;
8264 rp="What is your domain name?"
8274 : translate upper to lower if necessary
8277 echo "(Normalizing case in your domain name)"
8278 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8282 : a little sanity check here
8283 case "$phostname" in
8286 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8287 $myhostname$mydomain|$myhostname) ;;
8289 case "$phostname" in
8291 echo "(That doesn't agree with your whoami.h file, by the way.)"
8294 echo "(That doesn't agree with your $phostname command, by the way.)"
8304 I need to get your e-mail address in Internet format if possible, i.e.
8305 something like user@host.domain. Please answer accurately since I have
8306 no easy means to double check it. The default value provided below
8307 is most probably close to reality but may not be valid from outside
8308 your organization...
8312 while test "$cont"; do
8314 '') dflt="$cf_by@$myhostname$mydomain";;
8315 *) dflt="$cf_email";;
8317 rp='What is your e-mail address?'
8323 rp='Address does not look like an Internet one. Use it anyway?'
8339 If you or somebody else will be maintaining perl at your site, please
8340 fill in the correct e-mail address here so that they may be contacted
8341 if necessary. Currently, the "perlbug" program included with perl
8342 will send mail to this address in addition to perlbug@perl.org. You may
8343 enter "none" for no administrator.
8346 case "$perladmin" in
8347 '') dflt="$cf_email";;
8348 *) dflt="$perladmin";;
8350 rp='Perl administrator e-mail address'
8354 : determine whether to only install version-specific parts.
8357 Do you want to install only the version-specific parts of the perl
8358 distribution? Usually you do *not* want to do this.
8360 case "$versiononly" in
8361 "$define"|[Yy]*|true) dflt='y' ;;
8364 rp="Do you want to install only the version-specific parts of perl?"
8367 [yY]*) val="$define";;
8373 case "$versiononly" in
8374 "$define") inc_version_list=''
8375 inc_version_list_init=0
8379 : figure out how to guarantee perl startup
8380 case "$startperl" in
8382 case "$sharpbang" in
8386 I can use the #! construct to start perl on your system. This will
8387 make startup of perl scripts faster, but may cause problems if you
8388 want to share those scripts and perl is not in a standard place
8389 ($binexp/perl) on all your platforms. The alternative is to force
8390 a shell by starting the script with a single ':' character.
8393 case "$versiononly" in
8394 "$define") dflt="$binexp/perl$version";;
8395 *) dflt="$binexp/perl";;
8397 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8400 none) startperl=": # use perl";;
8401 *) startperl="#!$ans"
8402 if $test 30 -lt `echo "$ans" | wc -c`; then
8405 WARNING: Some systems limit the #! command to 32 characters.
8406 If you experience difficulty running Perl scripts with #!, try
8407 installing Perl in a directory with a shorter pathname.
8413 *) startperl=": # use perl"
8418 echo "I'll use $startperl to start perl scripts."
8420 : figure best path for perl in scripts
8423 case "$versiononly" in
8424 "$define") perlpath="$binexp/perl$version";;
8425 *) perlpath="$binexp/perl";;
8427 case "$startperl" in
8432 I will use the "eval 'exec'" idiom to start Perl on your system.
8433 I can use the full path of your Perl binary for this purpose, but
8434 doing so may cause problems if you want to share those scripts and
8435 Perl is not always in a standard place ($binexp/perl).
8439 rp="What path shall I use in \"eval 'exec'\"?"
8446 case "$startperl" in
8448 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8451 : determine where public executable scripts go
8452 set scriptdir scriptdir
8454 case "$scriptdir" in
8457 : guess some guesses
8458 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8459 $test -d /usr/share/bin && dflt=/usr/share/bin
8460 $test -d /usr/local/script && dflt=/usr/local/script
8461 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8462 $test -d $prefixexp/script && dflt=$prefixexp/script
8466 *) dflt="$scriptdir"
8471 Some installations have a separate directory just for executable scripts so
8472 that they can mount it across multiple architectures but keep the scripts in
8473 one spot. You might, for example, have a subdirectory of /usr/share for this.
8474 Or you might just lump your scripts in with all your other executables.
8478 rp='Where do you keep publicly executable scripts?'
8480 if $test "X$ansexp" != "X$scriptdirexp"; then
8484 scriptdirexp="$ansexp"
8485 : Change installation prefix, if necessary.
8486 if $test X"$prefix" != X"$installprefix"; then
8487 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8489 installscript="$scriptdirexp"
8492 : determine where add-on public executables go
8494 '') dflt=$siteprefix/bin ;;
8498 rp='Pathname where the add-on public executables should be installed?'
8501 sitebinexp="$ansexp"
8502 : Change installation prefix, if necessary.
8503 if $test X"$prefix" != X"$installprefix"; then
8504 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8506 installsitebin="$sitebinexp"
8509 : define an is-a-typedef? function
8510 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8512 "") inclist="sys/types.h";;
8514 eval "varval=\$$var";
8518 for inc in $inclist; do
8519 echo "#include <$inc>" >>temp.c;
8521 echo "#ifdef $type" >> temp.c;
8522 echo "printf(\"We have $type\");" >> temp.c;
8523 echo "#endif" >> temp.c;
8524 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8525 if $contains $type temp.E >/dev/null 2>&1; then
8531 *) eval "$var=\$varval";;
8534 : define an is-a-typedef? function that prompts if the type is not available.
8535 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8537 "") inclist="sys/types.h";;
8539 eval "varval=\$$var";
8543 for inc in $inclist; do
8544 echo "#include <$inc>" >>temp.c;
8546 echo "#ifdef $type" >> temp.c;
8547 echo "printf(\"We have $type\");" >> temp.c;
8548 echo "#endif" >> temp.c;
8549 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8551 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8552 if $contains $type temp.E >/dev/null 2>&1; then
8553 echo "$type found." >&4;
8556 echo "$type NOT found." >&4;
8562 *) eval "$var=\$varval";;
8565 : see what type lseek is declared as in the kernel
8566 rp="What is the type used for lseek's offset on this system?"
8567 set off_t lseektype long stdio.h sys/types.h
8571 echo "Checking to see how big your file offsets are..." >&4
8573 #include <sys/types.h>
8577 printf("%d\n", (int)sizeof($lseektype));
8582 if eval $compile_ok; then
8583 lseeksize=`$run ./try`
8584 echo "Your file offsets are $lseeksize bytes long."
8588 echo "(I can't seem to compile the test program. Guessing...)"
8589 rp="What is the size of your file offsets (in bytes)?"
8595 : see what type file positions are declared as in the library
8596 rp="What is the type for file position used by fsetpos()?"
8597 set fpos_t fpostype long stdio.h sys/types.h
8602 *_t) zzz="$fpostype" ;;
8605 echo "Checking the size of $zzz..." >&4
8607 #include <sys/types.h>
8610 printf("%d\n", (int)sizeof($fpostype));
8615 if eval $compile_ok; then
8619 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8622 echo "Your $zzz is $fpossize bytes long."
8628 echo "(I can't compile the test program. Guessing...)" >&4
8629 rp="What is the size of your file positions (in bytes)?"
8636 # Backward compatibility (uselfs is deprecated).
8638 "$define"|true|[yY]*)
8641 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8643 uselargefiles="$define"
8647 case "$lseeksize:$fpossize" in
8650 You can have files larger than 2 gigabytes.
8653 *) case "$uselargefiles" in
8654 "$undef"|false|[nN]*) dflt='n' ;;
8659 Perl can be built to understand large files (files larger than 2 gigabytes)
8660 on some systems. To do so, Configure can be run with -Duselargefiles.
8662 If this doesn't make any sense to you, just accept the default '$dflt'.
8664 rp='Try to understand large files, if available?'
8667 y|Y) val="$define" ;;
8674 case "$uselargefiles" in
8676 : Look for a hint-file generated 'call-back-unit'. If the
8677 : user has specified that a large files perl is to be built,
8678 : we may need to set or change some other defaults.
8679 if $test -f uselargefiles.cbu; then
8680 echo "Your platform has some specific hints for large file builds, using them..."
8681 . ./uselargefiles.cbu
8683 echo "Rechecking to see how big your file offsets are..." >&4
8685 #include <sys/types.h>
8689 printf("%d\n", (int)sizeof($lseektype));
8694 if eval $compile_ok; then
8695 lseeksize=`$run ./try`
8696 $echo "Your file offsets are now $lseeksize bytes long."
8700 echo "(I can't seem to compile the test program. Guessing...)"
8701 rp="What is the size of your file offsets (in bytes)?"
8706 *_t) zzz="$fpostype" ;;
8709 $echo $n "Rechecking the size of $zzz...$c" >&4
8711 #include <sys/types.h>
8714 printf("%d\n", (int)sizeof($fpostype));
8719 if eval $compile_ok; then
8724 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8727 echo " $fpossize bytes." >&4
8733 echo "(I can't compile the test program. Guessing...)" >&4
8734 rp="What is the size of your file positions (in bytes)?"
8743 case "$vendorprefix" in
8744 '') d_vendorbin="$undef"
8748 *) d_vendorbin="$define"
8749 : determine where vendor-supplied executables go.
8750 case "$vendorbin" in
8751 '') dflt=$vendorprefix/bin ;;
8752 *) dflt="$vendorbin" ;;
8755 rp='Pathname for the vendor-supplied executables directory?'
8758 vendorbinexp="$ansexp"
8761 : Change installation prefix, if necessary.
8762 if $test X"$prefix" != X"$installprefix"; then
8763 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
8765 installvendorbin="$vendorbinexp"
8768 : see if qgcvt exists
8772 : Check how to convert floats to strings.
8774 if test "X$d_Gconvert" = X; then
8777 echo "Checking for an efficient way to convert floats to strings."
8779 case "$uselongdouble" in
8780 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8782 case "$d_longdbl" in
8783 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8785 case "$d_PRIgldbl" in
8786 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8790 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8791 char *myname = "gconvert";
8794 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8795 char *myname = "gcvt";
8798 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8799 char *myname = "qgcvt";
8800 #define DOUBLETYPE long double
8803 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8805 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8807 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
8810 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8812 char *myname = "sprintf";
8816 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8817 #define DOUBLETYPE long double
8819 #define DOUBLETYPE double
8825 #define I_STDLIB $i_stdlib
8831 checkit(expect, got)
8835 if (strcmp(expect, got)) {
8836 printf("%s oddity: Expected %s, got %s\n",
8837 myname, expect, got);
8847 /* This must be 1st test on (which?) platform */
8848 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8849 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8850 checkit("0.1", buf);
8852 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
8853 checkit("0.01", buf);
8855 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
8856 checkit("0.001", buf);
8858 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
8859 checkit("0.0001", buf);
8861 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
8862 if (strlen(buf) > 5)
8863 checkit("9e-005", buf); /* for Microsoft ?? */
8865 checkit("9e-05", buf);
8867 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8870 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8871 checkit("1.1", buf);
8873 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8874 checkit("1.01", buf);
8876 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8877 checkit("1.001", buf);
8879 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8880 checkit("1.0001", buf);
8882 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8883 checkit("1.00001", buf);
8885 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8886 checkit("1.000001", buf);
8888 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8891 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8894 /* Some Linux gcvt's give 1.e+5 here. */
8895 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8896 checkit("100000", buf);
8898 /* Some Linux gcvt's give -1.e+5 here. */
8899 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8900 checkit("-100000", buf);
8902 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8903 checkit("123.456", buf);
8905 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
8906 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
8907 /* 34 should be enough to scare even long double
8908 * places into using the e notation. */
8909 if (strlen(buf) > 5)
8910 checkit("1e+034", buf); /* for Microsoft */
8912 checkit("1e+34", buf);
8914 /* For Perl, if you add additional tests here, also add them to
8915 * t/base/num.t for benefit of platforms not using Configure or
8916 * overriding d_Gconvert */
8921 : first add preferred functions to our list
8923 for xxx_convert in $gconvert_preference; do
8924 case $xxx_convert in
8925 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
8926 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
8929 : then add any others
8930 for xxx_convert in gconvert gcvt sprintf; do
8933 *) xxx_list="$xxx_list $xxx_convert" ;;
8937 case "$d_longdbl$uselongdouble" in
8939 : again, add prefered functions to our list first
8941 for xxx_convert in $gconvert_ld_preference; do
8942 case $xxx_convert in
8943 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
8944 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
8947 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
8948 for xxx_convert in qgcvt sprintf $xxx_list; do
8949 case "$xxx_ld_list" in
8950 $xxx_convert*|*" $xxx_convert"*) ;;
8951 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
8954 : if sprintf cannot do long doubles, move it to the end
8955 if test "$d_PRIgldbl" != "$define"; then
8956 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
8958 : if no qgcvt, remove it
8959 if test "$d_qgcvt" != "$define"; then
8960 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
8963 xxx_list="$xxx_ld_list"
8967 for xxx_convert in $xxx_list; do
8968 echo "Trying $xxx_convert..."
8970 set try -DTRY_$xxx_convert
8971 if eval $compile; then
8972 echo "$xxx_convert() found." >&4
8974 echo "I'll use $xxx_convert to convert floats into a string." >&4
8977 echo "...But $xxx_convert didn't work as I expected."
8981 echo "$xxx_convert NOT found." >&4
8985 if test X$xxx_convert = X; then
8986 echo "*** WHOA THERE!!! ***" >&4
8987 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
8991 case "$xxx_convert" in
8992 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8993 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8994 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8995 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8996 "$define$define$define")
8997 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8998 "$define$define$undef")
8999 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
9000 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
9007 : see if _fwalk exists
9011 : Initialize h_fcntl
9014 : Initialize h_sysfile
9017 : access call always available on UNIX
9021 : locate the flags for 'access()'
9025 $cat >access.c <<'EOCP'
9026 #include <sys/types.h>
9031 #include <sys/file.h>
9040 : check sys/file.h first, no particular reason here
9041 if $test `./findhdr sys/file.h` && \
9042 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9044 echo "<sys/file.h> defines the *_OK access constants." >&4
9045 elif $test `./findhdr fcntl.h` && \
9046 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9048 echo "<fcntl.h> defines the *_OK access constants." >&4
9049 elif $test `./findhdr unistd.h` && \
9050 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9051 echo "<unistd.h> defines the *_OK access constants." >&4
9053 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9059 : see if accessx exists
9060 set accessx d_accessx
9063 : see if alarm exists
9067 : see if POSIX threads are available
9068 set pthread.h i_pthread
9071 : define a fucntion to check prototypes
9072 $cat > protochk <<EOSH
9075 optimize="$optimize"
9077 prototype="$prototype"
9080 usethreads=$usethreads
9081 i_pthread=$i_pthread
9082 pthread_h_first=$pthread_h_first
9085 $cat >> protochk <<'EOSH'
9090 while test $# -ge 2; do
9092 $define) echo "#include <$2>" >> try.c ;;
9093 literal) echo "$2" >> try.c ;;
9095 # Extra magic for the benefit of systems that need pthread.h
9096 # to be included early to correctly detect threadsafe functions.
9097 # Such functions must guarantee themselves, though, that the usethreads
9098 # and i_pthread have been defined, before calling protochk.
9099 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9100 echo "#include <pthread.h>" >> try.c
9105 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9106 cat >> try.c <<'EOCP'
9107 #ifdef CAN_PROTOTYPE
9108 #define _(args) args
9113 echo "$foo" >> try.c
9114 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9115 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9123 hasproto='varname=$1; func=$2; shift; shift;
9124 while $test $# -ge 2; do
9126 $define) echo "#include <$2>";;
9130 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9131 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9132 echo "$func() prototype found.";
9135 echo "$func() prototype NOT found.";
9140 $rm -f try.c tryout.c'
9142 : see if sys/types.h has to be included
9143 set sys/types.h i_systypes
9146 : see if sys/select.h has to be included
9147 set sys/select.h i_sysselct
9150 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9151 while $test $# -ge 2; do
9153 $define) echo "#include <$2>";;
9157 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9159 if eval $compile; then
9168 : see if we should include time.h, sys/time.h, or both
9170 if test "X$timeincl" = X; then
9171 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9172 $echo $n "I'm now running the test program...$c"
9173 $cat >try.c <<'EOCP'
9174 #include <sys/types.h>
9179 #ifdef SYSTIMEKERNEL
9182 #include <sys/time.h>
9185 #include <sys/select.h>
9194 struct timezone tzp;
9196 if (foo.tm_sec == foo.tm_sec)
9199 if (bar.tv_sec == bar.tv_sec)
9206 for s_timezone in '-DS_TIMEZONE' ''; do
9208 for s_timeval in '-DS_TIMEVAL' ''; do
9209 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9210 for i_time in '' '-DI_TIME'; do
9211 for i_systime in '-DI_SYSTIME' ''; do
9214 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9215 if eval $compile; then
9216 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9220 $echo $n "Succeeded with $flags$c"
9232 *SYSTIMEKERNEL*) i_systimek="$define"
9233 timeincl=`./findhdr sys/time.h`
9234 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9235 *) i_systimek="$undef";;
9238 *I_TIME*) i_time="$define"
9239 timeincl=`./findhdr time.h`" $timeincl"
9240 echo "We'll include <time.h>." >&4;;
9241 *) i_time="$undef";;
9244 *I_SYSTIME*) i_systime="$define"
9245 timeincl=`./findhdr sys/time.h`" $timeincl"
9246 echo "We'll include <sys/time.h>." >&4;;
9247 *) i_systime="$undef";;
9251 : see if struct tm knows about tm_zone
9252 case "$i_systime$i_time" in
9255 echo "Checking to see if your struct tm has tm_zone field..." >&4
9256 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9264 case "$d_tm_tm_zone" in
9265 "$define") echo "Yes, it does." ;;
9266 *) echo "No, it doesn't." ;;
9268 : see if struct tm knows about tm_gmtoff
9269 case "$i_systime$i_time" in
9272 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9273 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9281 case "$d_tm_tm_gmtoff" in
9282 "$define") echo "Yes, it does." ;;
9283 *) echo "No, it doesn't." ;;
9286 : see if asctime_r exists
9287 set asctime_r d_asctime_r
9289 case "$d_asctime_r" in
9291 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9292 case "$d_asctime_r_proto:$usethreads" in
9293 ":define") d_asctime_r_proto=define
9294 set d_asctime_r_proto asctime_r $hdrs
9298 case "$d_asctime_r_proto" in
9300 case "$asctime_r_proto" in
9301 ''|0) try='char* asctime_r(const struct tm*, char*);'
9302 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9304 case "$asctime_r_proto" in
9305 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9306 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9308 case "$asctime_r_proto" in
9309 ''|0) try='int asctime_r(const struct tm*, char*);'
9310 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9312 case "$asctime_r_proto" in
9313 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9314 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9316 case "$asctime_r_proto" in
9317 ''|0) d_asctime_r=undef
9319 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9320 * ) case "$asctime_r_proto" in
9321 REENTRANT_PROTO*) ;;
9322 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9324 echo "Prototype: $try" ;;
9327 *) case "$usethreads" in
9328 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9335 *) asctime_r_proto=0
9339 : see if atolf exists
9343 : see if atoll exists
9347 : Look for GNU-cc style attribute checking
9349 echo "Checking whether your compiler can handle __attribute__ ..." >&4
9350 $cat >attrib.c <<'EOCP'
9352 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
9354 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9355 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9356 echo "Your C compiler doesn't fully support __attribute__."
9359 echo "Your C compiler supports __attribute__."
9363 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9370 : see if bcmp exists
9374 : see if bcopy exists
9378 : see if this is a unistd.h system
9379 set unistd.h i_unistd
9382 : see if getpgrp exists
9383 set getpgrp d_getpgrp
9386 case "$d_getpgrp" in
9389 echo "Checking to see which flavor of getpgrp is in use..."
9392 #include <sys/types.h>
9394 # include <unistd.h>
9398 if (getuid() == 0) {
9399 printf("(I see you are running Configure as super-user...)\n");
9403 if (getpgrp(1) == 0)
9412 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9413 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
9415 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9416 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
9419 echo "I can't seem to compile and run the test program."
9421 xxx="a USG one, i.e. you use getpgrp()."
9423 # SVR4 systems can appear rather BSD-ish.
9426 xxx="a BSD one, i.e. you use getpgrp(pid)."
9430 xxx="probably a USG one, i.e. you use getpgrp()."
9435 echo "Assuming your getpgrp is $xxx" >&4
9444 : see if setpgrp exists
9445 set setpgrp d_setpgrp
9448 case "$d_setpgrp" in
9451 echo "Checking to see which flavor of setpgrp is in use..."
9454 #include <sys/types.h>
9456 # include <unistd.h>
9460 if (getuid() == 0) {
9461 printf("(I see you are running Configure as super-user...)\n");
9465 if (-1 == setpgrp(1, 1))
9468 if (setpgrp() != -1)
9474 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9475 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
9477 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9478 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
9481 echo "(I can't seem to compile and run the test program.)"
9483 xxx="a USG one, i.e. you use setpgrp()."
9485 # SVR4 systems can appear rather BSD-ish.
9488 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
9492 xxx="probably a USG one, i.e. you use setpgrp()."
9497 echo "Assuming your setpgrp is $xxx" >&4
9505 : see if bzero exists
9509 : see if signal is declared as pointer to function returning int or void
9511 xxx=`./findhdr signal.h`
9512 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
9513 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9514 echo "You have int (*signal())() instead of void." >&4
9516 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9517 echo "You have void (*signal())()." >&4
9519 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
9520 echo "You have int (*signal())() instead of void." >&4
9522 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
9523 echo "You have void (*signal())()." >&4
9526 case "$d_voidsig" in
9528 echo "I can't determine whether signal handler returns void or int..." >&4
9530 rp="What type does your signal handler return?"
9537 echo "As you already told me, signal handler returns void." >&4
9540 *) echo "As you already told me, signal handler returns int." >&4
9547 case "$d_voidsig" in
9548 "$define") signal_t="void";;
9553 : check for ability to cast large floats to 32-bit ints.
9555 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
9556 if $test "$intsize" -ge 4; then
9563 #include <sys/types.h>
9565 $signal_t blech(s) int s; { exit(3); }
9572 signal(SIGFPE, blech);
9574 /* Don't let compiler optimize the test away. Store the number
9575 in a writable string for gcc to pass to sscanf under HP/UX.
9577 sprintf(str, "2147483647");
9578 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
9582 /* x86 processors will probably give 0x8000 0000, which is a
9583 sign change. We don't want that. We want to mimic SPARC
9584 behavior here, which is to preserve the sign and give
9587 if (i32 != ($xxx) f)
9593 if eval $compile_ok; then
9597 echo "(I can't seem to compile the test program--assuming it can't)"
9605 echo "Nope, it can't."
9612 : check for ability to cast negative floats to unsigned
9614 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
9617 #include <sys/types.h>
9619 $signal_t blech(s) int s; { exit(7); }
9620 $signal_t blech_in_list(s) int s; { exit(4); }
9621 unsigned long dummy_long(p) unsigned long p; { return p; }
9622 unsigned int dummy_int(p) unsigned int p; { return p; }
9623 unsigned short dummy_short(p) unsigned short p; { return p; }
9627 unsigned long along;
9629 unsigned short ashort;
9633 /* Frustrate gcc-2.7.2's optimizer which failed this test with
9634 a direct f = -123. assignment. gcc-2.8.0 reportedly
9635 optimized the whole file away
9637 /* Store the number in a writable string for gcc to pass to
9640 sprintf(str, "-123");
9641 sscanf(str, "%lf", &f); /* f = -123.; */
9643 signal(SIGFPE, blech);
9644 along = (unsigned long)f;
9645 aint = (unsigned int)f;
9646 ashort = (unsigned short)f;
9647 if (along != (unsigned long)-123)
9649 if (aint != (unsigned int)-123)
9651 if (ashort != (unsigned short)-123)
9653 sprintf(str, "1073741824.");
9654 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
9657 along = (unsigned long)f;
9658 if (along != 0x80000000)
9662 along = (unsigned long)f;
9663 if (along != 0x7fffffff)
9667 along = (unsigned long)f;
9668 if (along != 0x80000001)
9672 signal(SIGFPE, blech_in_list);
9673 sprintf(str, "123.");
9674 sscanf(str, "%lf", &f); /* f = 123.; */
9675 along = dummy_long((unsigned long)f);
9676 aint = dummy_int((unsigned int)f);
9677 ashort = dummy_short((unsigned short)f);
9678 if (along != (unsigned long)123)
9680 if (aint != (unsigned int)123)
9682 if (ashort != (unsigned short)123)
9689 if eval $compile_ok; then
9693 echo "(I can't seem to compile the test program--assuming it can't)"
9696 case "$castflags" in
9701 echo "Nope, it can't."
9708 : see if vprintf exists
9710 if set vprintf val -f d_vprintf; eval $csym; $val; then
9711 echo 'vprintf() found.' >&4
9714 #include <varargs.h>
9716 int main() { xxx("foo"); }
9725 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
9729 if eval $compile && $run ./try; then
9730 echo "Your vsprintf() returns (int)." >&4
9733 echo "Your vsprintf() returns (char*)." >&4
9737 echo 'vprintf() NOT found.' >&4
9748 : see if chown exists
9752 : see if chroot exists
9756 : see if chsize exists
9760 : see if class exists
9764 hasstruct='varname=$1; struct=$2; shift; shift;
9765 while $test $# -ge 2; do
9767 $define) echo "#include <$2>";;
9771 echo "int main () { struct $struct foo; }" >> try.c;
9773 if eval $compile; then
9784 : see whether socket exists
9786 $echo $n "Hmm... $c" >&4
9787 if set socket val -f d_socket; eval $csym; $val; then
9788 echo "Looks like you have Berkeley networking support." >&4
9790 if set setsockopt val -f; eval $csym; $val; then
9793 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9797 if $contains socklib libc.list >/dev/null 2>&1; then
9798 echo "Looks like you have Berkeley networking support." >&4
9800 : we will have to assume that it supports the 4.2 BSD interface
9803 echo "You don't have Berkeley networking in libc$_a..." >&4
9804 if test "X$d_socket" = "X$define"; then
9805 echo "...but you seem to believe that you have sockets." >&4
9807 for net in net socket
9809 if test -f /usr/lib/lib$net$_a; then
9810 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9811 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9812 if $contains socket libc.list >/dev/null 2>&1; then
9817 echo "...but the Wollongong group seems to have hacked it in." >&4
9818 sockethdr="-I/usr/netinclude"
9821 echo "Found Berkeley sockets interface in lib$net." >&4
9822 if $contains setsockopt libc.list >/dev/null 2>&1; then
9825 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9832 if test "X$d_socket" != "X$define"; then
9833 echo "or anywhere else I see." >&4
9841 : see if socketpair exists
9842 set socketpair d_sockpair
9847 echo "Checking the availability of certain socket constants..." >&4
9848 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9849 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9851 #include <sys/types.h>
9852 #include <sys/socket.h>
9858 set try; if eval $compile; then
9861 set d_${enum}; eval $setvar
9865 : see if this is a sys/uio.h system
9866 set sys/uio.h i_sysuio
9871 echo "Checking to see if your system supports struct cmsghdr..." >&4
9872 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
9874 case "$d_cmsghdr_s" in
9875 "$define") echo "Yes, it does." ;;
9876 *) echo "No, it doesn't." ;;
9880 : check for const keyword
9882 echo 'Checking to see if your C compiler knows about "const"...' >&4
9883 $cat >const.c <<'EOCP'
9884 typedef struct spug { int drokk; } spug;
9891 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
9893 echo "Yup, it does."
9896 echo "Nope, it doesn't."
9901 : see if crypt exists
9906 $define) cryptlib='' ;;
9907 *) if set crypt val -f d_crypt; eval $csym; $val; then
9908 echo 'crypt() found.' >&4
9912 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
9913 if $test -z "$cryptlib"; then
9914 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
9918 if $test -z "$cryptlib"; then
9919 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
9923 if $test -z "$cryptlib"; then
9924 cryptlib=`./loc libcrypt$_a "" $libpth`
9928 if $test -z "$cryptlib"; then
9929 echo 'crypt() NOT found.' >&4
9940 : see if this is a crypt.h system
9944 : see if crypt_r exists
9945 set crypt_r d_crypt_r
9947 case "$d_crypt_r" in
9949 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
9950 case "$d_crypt_r_proto:$usethreads" in
9951 ":define") d_crypt_r_proto=define
9952 set d_crypt_r_proto crypt_r $hdrs
9956 case "$d_crypt_r_proto" in
9958 case "$crypt_r_proto" in
9959 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
9960 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
9962 case "$crypt_r_proto" in
9963 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
9964 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
9966 case "$crypt_r_proto" in
9967 ''|0) d_crypt_r=undef
9969 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
9970 * ) case "$crypt_r_proto" in
9971 REENTRANT_PROTO*) ;;
9972 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
9974 echo "Prototype: $try" ;;
9977 *) case "$usethreads" in
9978 define) echo "crypt_r has no prototype, not using it." >&4 ;;
9989 : get csh whereabouts
9991 'csh') val="$undef" ;;
9996 : Respect a hint or command line value for full_csh.
9998 '') full_csh=$csh ;;
10001 : see if ctermid_r exists
10002 set ctermid_r d_ctermid_r
10004 case "$d_ctermid_r" in
10006 hdrs="$i_systypes sys/types.h define stdio.h "
10007 case "$d_ctermid_r_proto:$usethreads" in
10008 ":define") d_ctermid_r_proto=define
10009 set d_ctermid_r_proto ctermid_r $hdrs
10013 case "$d_ctermid_r_proto" in
10015 case "$ctermid_r_proto" in
10016 ''|0) try='char* ctermid_r(char*);'
10017 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10019 case "$ctermid_r_proto" in
10020 ''|0) d_ctermid_r=undef
10022 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10023 * ) case "$ctermid_r_proto" in
10024 REENTRANT_PROTO*) ;;
10025 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10027 echo "Prototype: $try" ;;
10030 *) case "$usethreads" in
10031 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10038 *) ctermid_r_proto=0
10042 : see if ctime_r exists
10043 set ctime_r d_ctime_r
10045 case "$d_ctime_r" in
10047 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10048 case "$d_ctime_r_proto:$usethreads" in
10049 ":define") d_ctime_r_proto=define
10050 set d_ctime_r_proto ctime_r $hdrs
10054 case "$d_ctime_r_proto" in
10056 case "$ctime_r_proto" in
10057 ''|0) try='char* ctime_r(const time_t*, char*);'
10058 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10060 case "$ctime_r_proto" in
10061 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10062 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10064 case "$ctime_r_proto" in
10065 ''|0) try='int ctime_r(const time_t*, char*);'
10066 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10068 case "$ctime_r_proto" in
10069 ''|0) try='int ctime_r(const time_t*, char*, int);'
10070 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10072 case "$ctime_r_proto" in
10073 ''|0) d_ctime_r=undef
10075 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10076 * ) case "$ctime_r_proto" in
10077 REENTRANT_PROTO*) ;;
10078 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10080 echo "Prototype: $try" ;;
10083 *) case "$usethreads" in
10084 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10095 : see if cuserid exists
10096 set cuserid d_cuserid
10099 : see if this is a limits.h system
10100 set limits.h i_limits
10103 : see if this is a float.h system
10104 set float.h i_float
10107 : See if number of significant digits in a double precision number is known
10109 $cat >dbl_dig.c <<EOM
10110 #$i_limits I_LIMITS
10113 #include <limits.h>
10119 printf("Contains DBL_DIG");
10122 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10123 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10124 echo "DBL_DIG found." >&4
10127 echo "DBL_DIG NOT found." >&4
10134 : see if dbm.h is available
10135 : see if dbmclose exists
10136 set dbmclose d_dbmclose
10139 case "$d_dbmclose" in
10149 *) set rpcsvc/dbm.h i_rpcsvcdbm
10154 *) echo "We won't be including <dbm.h>"
10164 : see if prototype for dbminit is available
10166 set d_dbminitproto dbminit $i_dbm dbm.h
10169 : see if difftime exists
10170 set difftime d_difftime
10173 : see if this is a dirent system
10175 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10177 echo "<dirent.h> found." >&4
10180 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10181 echo "<sys/dir.h> found." >&4
10184 xinc=`./findhdr sys/ndir.h`
10186 echo "<dirent.h> NOT found." >&4
10191 : Look for type of directory structure.
10193 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10195 case "$direntrytype" in
10197 case "$i_dirent" in
10198 $define) guess1='struct dirent' ;;
10199 *) guess1='struct direct' ;;
10202 *) guess1="$direntrytype"
10207 'struct dirent') guess2='struct direct' ;;
10208 *) guess2='struct dirent' ;;
10211 if $contains "$guess1" try.c >/dev/null 2>&1; then
10212 direntrytype="$guess1"
10213 echo "Your directory entries are $direntrytype." >&4
10214 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10215 direntrytype="$guess2"
10216 echo "Your directory entries seem to be $direntrytype." >&4
10218 echo "I don't recognize your system's directory entries." >&4
10219 rp="What type is used for directory entries on this system?"
10222 direntrytype="$ans"
10227 : see if the directory entry stores field length
10229 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10230 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10231 echo "Good, your directory entry keeps length information in d_namlen." >&4
10234 echo "Your directory entry does not know about the d_namlen field." >&4
10241 : see if this is an sysdir system
10242 set sys/dir.h i_sysdir
10245 : see if this is an sysndir system
10246 set sys/ndir.h i_sysndir
10251 $cat >dirfd.c <<EOM
10253 #$i_dirent I_DIRENT /**/
10254 #$i_sysdir I_SYS_DIR /**/
10255 #$i_sysndir I_SYS_NDIR /**/
10256 #$i_systypes I_SYS_TYPES /**/
10257 #if defined(I_SYS_TYPES)
10258 #include <sys/types.h>
10260 #if defined(I_DIRENT)
10261 #include <dirent.h>
10262 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10263 #include <sys/dir.h>
10267 #include <sys/ndir.h>
10271 #include <ndir.h> /* may be wrong in the future */
10273 #include <sys/dir.h>
10279 DIR *dirp = opendir(".");
10280 if (dirfd(dirp) >= 0)
10287 if eval $compile; then
10291 $define) echo "dirfd() found." >&4 ;;
10292 *) echo "dirfd() NOT found." >&4 ;;
10298 : see if dlerror exists
10301 set dlerror d_dlerror
10305 : see if dlfcn is available
10306 set dlfcn.h i_dlfcn
10313 On a few systems, the dynamically loaded modules that perl generates and uses
10314 will need a different extension than shared libs. The default will probably
10320 *) dflt="$dlext" ;;
10322 rp='What is the extension of dynamically loaded modules'
10331 : Check if dlsym need a leading underscore
10337 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
10338 $cat >dyna.c <<'EOM'
10347 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
10349 #include <sys/types.h>
10354 extern int fred() ;
10363 int mode = RTLD_LAZY ;
10365 handle = dlopen("./dyna.$dlext", mode) ;
10366 if (handle == NULL) {
10371 symbol = dlsym(handle, "fred") ;
10372 if (symbol == NULL) {
10373 /* try putting a leading underscore */
10374 symbol = dlsym(handle, "_fred") ;
10375 if (symbol == NULL) {
10388 : Call the object file tmp-dyna.o in case dlext=o.
10389 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
10390 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
10391 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
10392 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
10395 1) echo "Test program failed using dlopen." >&4
10396 echo "Perhaps you should not use dynamic loading." >&4;;
10397 2) echo "Test program failed using dlsym." >&4
10398 echo "Perhaps you should not use dynamic loading." >&4;;
10399 3) echo "dlsym needs a leading underscore" >&4
10401 4) echo "dlsym doesn't need a leading underscore." >&4;;
10404 echo "I can't compile and run the test program." >&4
10405 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
10410 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
10415 : see if drand48_r exists
10416 set drand48_r d_drand48_r
10418 case "$d_drand48_r" in
10420 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
10421 case "$d_drand48_r_proto:$usethreads" in
10422 ":define") d_drand48_r_proto=define
10423 set d_drand48_r_proto drand48_r $hdrs
10427 case "$d_drand48_r_proto" in
10429 case "$drand48_r_proto" in
10430 ''|0) try='int drand48_r(struct drand48_data*, double*);'
10431 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
10433 case "$drand48_r_proto" in
10434 ''|0) d_drand48_r=undef
10436 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
10437 * ) case "$drand48_r_proto" in
10438 REENTRANT_PROTO*) ;;
10439 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
10441 echo "Prototype: $try" ;;
10444 *) case "$usethreads" in
10445 define) echo "drand48_r has no prototype, not using it." >&4 ;;
10452 *) drand48_r_proto=0
10456 : see if prototype for drand48 is available
10458 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
10461 : see if dup2 exists
10465 : see if eaccess exists
10466 set eaccess d_eaccess
10469 : see if endgrent exists
10470 set endgrent d_endgrent
10473 : see if this is an grp system
10479 xxx=`./findhdr grp.h`
10480 $cppstdin $cppflags $cppminus < $xxx >$$.h
10482 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10494 set d_grpasswd; eval $setvar
10498 : see if endgrent_r exists
10499 set endgrent_r d_endgrent_r
10501 case "$d_endgrent_r" in
10503 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
10504 case "$d_endgrent_r_proto:$usethreads" in
10505 ":define") d_endgrent_r_proto=define
10506 set d_endgrent_r_proto endgrent_r $hdrs
10510 case "$d_endgrent_r_proto" in
10512 case "$endgrent_r_proto" in
10513 ''|0) try='int endgrent_r(FILE**);'
10514 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
10516 case "$endgrent_r_proto" in
10517 ''|0) try='void endgrent_r(FILE**);'
10518 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
10520 case "$endgrent_r_proto" in
10521 ''|0) d_endgrent_r=undef
10523 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
10524 * ) case "$endgrent_r_proto" in
10525 REENTRANT_PROTO*) ;;
10526 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
10528 echo "Prototype: $try" ;;
10531 *) case "$usethreads" in
10532 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
10539 *) endgrent_r_proto=0
10543 : see if endhostent exists
10544 set endhostent d_endhent
10547 : see if this is a netdb.h system
10548 set netdb.h i_netdb
10551 : see if endhostent_r exists
10552 set endhostent_r d_endhostent_r
10554 case "$d_endhostent_r" in
10556 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10557 case "$d_endhostent_r_proto:$usethreads" in
10558 ":define") d_endhostent_r_proto=define
10559 set d_endhostent_r_proto endhostent_r $hdrs
10563 case "$d_endhostent_r_proto" in
10565 case "$endhostent_r_proto" in
10566 ''|0) try='int endhostent_r(struct hostent_data*);'
10567 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
10569 case "$endhostent_r_proto" in
10570 ''|0) try='void endhostent_r(struct hostent_data*);'
10571 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
10573 case "$endhostent_r_proto" in
10574 ''|0) d_endhostent_r=undef
10575 endhostent_r_proto=0
10576 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
10577 * ) case "$endhostent_r_proto" in
10578 REENTRANT_PROTO*) ;;
10579 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
10581 echo "Prototype: $try" ;;
10584 *) case "$usethreads" in
10585 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
10587 d_endhostent_r=undef
10588 endhostent_r_proto=0
10592 *) endhostent_r_proto=0
10596 : see if endnetent exists
10597 set endnetent d_endnent
10600 : see if endnetent_r exists
10601 set endnetent_r d_endnetent_r
10603 case "$d_endnetent_r" in
10605 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10606 case "$d_endnetent_r_proto:$usethreads" in
10607 ":define") d_endnetent_r_proto=define
10608 set d_endnetent_r_proto endnetent_r $hdrs
10612 case "$d_endnetent_r_proto" in
10614 case "$endnetent_r_proto" in
10615 ''|0) try='int endnetent_r(struct netent_data*);'
10616 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
10618 case "$endnetent_r_proto" in
10619 ''|0) try='void endnetent_r(struct netent_data*);'
10620 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
10622 case "$endnetent_r_proto" in
10623 ''|0) d_endnetent_r=undef
10624 endnetent_r_proto=0
10625 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
10626 * ) case "$endnetent_r_proto" in
10627 REENTRANT_PROTO*) ;;
10628 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
10630 echo "Prototype: $try" ;;
10633 *) case "$usethreads" in
10634 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
10636 d_endnetent_r=undef
10637 endnetent_r_proto=0
10641 *) endnetent_r_proto=0
10645 : see if endprotoent exists
10646 set endprotoent d_endpent
10649 : see if endprotoent_r exists
10650 set endprotoent_r d_endprotoent_r
10652 case "$d_endprotoent_r" in
10654 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10655 case "$d_endprotoent_r_proto:$usethreads" in
10656 ":define") d_endprotoent_r_proto=define
10657 set d_endprotoent_r_proto endprotoent_r $hdrs
10661 case "$d_endprotoent_r_proto" in
10663 case "$endprotoent_r_proto" in
10664 ''|0) try='int endprotoent_r(struct protoent_data*);'
10665 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
10667 case "$endprotoent_r_proto" in
10668 ''|0) try='void endprotoent_r(struct protoent_data*);'
10669 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
10671 case "$endprotoent_r_proto" in
10672 ''|0) d_endprotoent_r=undef
10673 endprotoent_r_proto=0
10674 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
10675 * ) case "$endprotoent_r_proto" in
10676 REENTRANT_PROTO*) ;;
10677 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
10679 echo "Prototype: $try" ;;
10682 *) case "$usethreads" in
10683 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
10685 d_endprotoent_r=undef
10686 endprotoent_r_proto=0
10690 *) endprotoent_r_proto=0
10694 : see if endpwent exists
10695 set endpwent d_endpwent
10698 : see if this is a pwd.h system
10704 xxx=`./findhdr pwd.h`
10705 $cppstdin $cppflags $cppminus < $xxx >$$.h
10707 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10715 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10723 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10731 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10739 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10747 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10755 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10763 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10775 set d_pwquota; eval $setvar
10776 set d_pwage; eval $setvar
10777 set d_pwchange; eval $setvar
10778 set d_pwclass; eval $setvar
10779 set d_pwexpire; eval $setvar
10780 set d_pwcomment; eval $setvar
10781 set d_pwgecos; eval $setvar
10782 set d_pwpasswd; eval $setvar
10786 : see if endpwent_r exists
10787 set endpwent_r d_endpwent_r
10789 case "$d_endpwent_r" in
10791 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
10792 case "$d_endpwent_r_proto:$usethreads" in
10793 ":define") d_endpwent_r_proto=define
10794 set d_endpwent_r_proto endpwent_r $hdrs
10798 case "$d_endpwent_r_proto" in
10800 case "$endpwent_r_proto" in
10801 ''|0) try='int endpwent_r(FILE**);'
10802 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
10804 case "$endpwent_r_proto" in
10805 ''|0) try='void endpwent_r(FILE**);'
10806 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
10808 case "$endpwent_r_proto" in
10809 ''|0) d_endpwent_r=undef
10811 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
10812 * ) case "$endpwent_r_proto" in
10813 REENTRANT_PROTO*) ;;
10814 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
10816 echo "Prototype: $try" ;;
10819 *) case "$usethreads" in
10820 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
10827 *) endpwent_r_proto=0
10831 : see if endservent exists
10832 set endservent d_endsent
10835 : see if endservent_r exists
10836 set endservent_r d_endservent_r
10838 case "$d_endservent_r" in
10840 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10841 case "$d_endservent_r_proto:$usethreads" in
10842 ":define") d_endservent_r_proto=define
10843 set d_endservent_r_proto endservent_r $hdrs
10847 case "$d_endservent_r_proto" in
10849 case "$endservent_r_proto" in
10850 ''|0) try='int endservent_r(struct servent_data*);'
10851 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
10853 case "$endservent_r_proto" in
10854 ''|0) try='void endservent_r(struct servent_data*);'
10855 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
10857 case "$endservent_r_proto" in
10858 ''|0) d_endservent_r=undef
10859 endservent_r_proto=0
10860 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
10861 * ) case "$endservent_r_proto" in
10862 REENTRANT_PROTO*) ;;
10863 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
10865 echo "Prototype: $try" ;;
10868 *) case "$usethreads" in
10869 define) echo "endservent_r has no prototype, not using it." >&4 ;;
10871 d_endservent_r=undef
10872 endservent_r_proto=0
10876 *) endservent_r_proto=0
10880 : Locate the flags for 'open()'
10882 $cat >try.c <<'EOCP'
10883 #include <sys/types.h>
10888 #include <sys/file.h>
10899 : check sys/file.h first to get FREAD on Sun
10900 if $test `./findhdr sys/file.h` && \
10901 set try -DI_SYS_FILE && eval $compile; then
10903 echo "<sys/file.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
10911 elif $test `./findhdr fcntl.h` && \
10912 set try -DI_FCNTL && eval $compile; then
10914 echo "<fcntl.h> defines the O_* constants..." >&4
10915 if $run ./try; then
10916 echo "and you have the 3 argument form of open()." >&4
10919 echo "but not the 3 argument form of open(). Oh, well." >&4
10924 echo "I can't find the O_* constant definitions! You got problems." >&4
10930 : see which of string.h or strings.h is needed
10932 strings=`./findhdr string.h`
10933 if $test "$strings" && $test -r "$strings"; then
10934 echo "Using <string.h> instead of <strings.h>." >&4
10938 strings=`./findhdr strings.h`
10939 if $test "$strings" && $test -r "$strings"; then
10940 echo "Using <strings.h> instead of <string.h>." >&4
10942 echo "No string header found -- You'll surely have problems." >&4
10947 case "$i_string" in
10948 "$undef") strings=`./findhdr strings.h`;;
10949 *) strings=`./findhdr string.h`;;
10952 : see if this is a sys/file.h system
10957 : do we need to include sys/file.h ?
10961 if $h_sysfile; then
10963 echo "We'll be including <sys/file.h>." >&4
10966 echo "We won't be including <sys/file.h>." >&4
10976 : see if fcntl.h is there
10981 : see if we can include fcntl.h
10987 echo "We'll be including <fcntl.h>." >&4
10990 if $h_sysfile; then
10991 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
10993 echo "We won't be including <fcntl.h>." >&4
11005 : check for non-blocking I/O stuff
11006 case "$h_sysfile" in
11007 true) echo "#include <sys/file.h>" > head.c;;
11010 true) echo "#include <fcntl.h>" > head.c;;
11011 *) echo "#include <sys/fcntl.h>" > head.c;;
11016 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11017 case "$o_nonblock" in
11019 $cat head.c > try.c
11020 $cat >>try.c <<EOCP
11022 #include <stdlib.h>
11029 printf("O_NONBLOCK\n");
11033 printf("O_NDELAY\n");
11037 printf("FNDELAY\n");
11044 if eval $compile_ok; then
11045 o_nonblock=`$run ./try`
11046 case "$o_nonblock" in
11047 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11048 *) echo "Seems like we can use $o_nonblock.";;
11051 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11054 *) echo "Using $hint value $o_nonblock.";;
11056 $rm -f try try.* .out core
11059 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11062 $cat head.c > try.c
11063 $cat >>try.c <<EOCP
11065 #include <sys/types.h>
11066 #include <signal.h>
11068 #include <stdlib.h>
11073 #define MY_O_NONBLOCK $o_nonblock
11074 #ifndef errno /* XXX need better Configure test */
11077 #$i_unistd I_UNISTD
11079 #include <unistd.h>
11081 #$i_string I_STRING
11083 #include <string.h>
11085 #include <strings.h>
11087 $signal_t blech(x) int x; { exit(3); }
11089 $cat >> try.c <<'EOCP'
11097 pipe(pd); /* Down: child -> parent */
11098 pipe(pu); /* Up: parent -> child */
11101 close(pd[1]); /* Parent reads from pd[0] */
11102 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11104 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11109 signal(SIGALRM, blech);
11111 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11113 sprintf(string, "%d\n", ret);
11114 write(2, string, strlen(string));
11117 if (errno == EAGAIN) {
11118 printf("EAGAIN\n");
11123 if (errno == EWOULDBLOCK)
11124 printf("EWOULDBLOCK\n");
11127 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11128 sleep(2); /* Give it time to close our pipe */
11130 ret = read(pd[0], buf, 1); /* Should read EOF */
11132 sprintf(string, "%d\n", ret);
11133 write(4, string, strlen(string));
11137 close(pd[0]); /* We write to pd[1] */
11138 close(pu[1]); /* We read from pu[0] */
11139 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11140 close(pd[1]); /* Pipe pd is now fully closed! */
11141 exit(0); /* Bye bye, thank you for playing! */
11145 if eval $compile_ok; then
11146 echo "$startsh" >mtry
11147 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11149 ./mtry >/dev/null 2>&1
11151 0) eagain=`$cat try.out`;;
11152 1) echo "Could not perform non-blocking setting!";;
11153 2) echo "I did a successful read() for something that was not there!";;
11154 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11155 4) echo "Could not find F_SETFL!";;
11156 *) echo "Something terribly wrong happened during testing.";;
11158 rd_nodata=`$cat try.ret`
11159 echo "A read() system call with no data present returns $rd_nodata."
11160 case "$rd_nodata" in
11163 echo "(That's peculiar, fixing that to be -1.)"
11169 echo "Forcing errno EAGAIN on read() with no data available."
11173 echo "Your read() sets errno to $eagain when no data is available."
11176 status=`$cat try.err`
11178 0) echo "And it correctly returns 0 to signal EOF.";;
11179 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11180 *) echo "However, your read() returns '$status' on EOF??";;
11183 if test "$status" = "$rd_nodata"; then
11184 echo "WARNING: you can't distinguish between EOF and no data!"
11188 echo "I can't compile the test program--assuming errno EAGAIN will do."
11195 echo "Using $hint value $eagain."
11196 echo "Your read() returns $rd_nodata when no data is present."
11197 case "$d_eofnblk" in
11198 "$define") echo "And you can see EOF because read() returns 0.";;
11199 "$undef") echo "But you can't see EOF status from read() returned value.";;
11201 echo "(Assuming you can't see EOF status from read anyway.)"
11207 $rm -f try try.* .out core head.c mtry
11209 : see if fchdir exists
11210 set fchdir d_fchdir
11213 : see if fchmod exists
11214 set fchmod d_fchmod
11217 : see if fchown exists
11218 set fchown d_fchown
11221 : see if this is an fcntl system
11226 : See if fcntl-based locking works.
11228 #include <stdlib.h>
11229 #include <unistd.h>
11231 #include <signal.h>
11232 $signal_t blech(x) int x; { exit(3); }
11234 #if defined(F_SETLK) && defined(F_SETLKW)
11235 struct flock flock;
11237 fd = open("try.c", O_RDONLY);
11238 flock.l_type = F_RDLCK;
11239 flock.l_whence = SEEK_SET;
11240 flock.l_start = flock.l_len = 0;
11241 signal(SIGALRM, blech);
11243 retval = fcntl(fd, F_SETLK, &flock);
11245 (retval < 0 ? exit(2) : exit(0));
11251 echo "Checking if fcntl-based file locking works... "
11255 if eval $compile_ok; then
11256 if $run ./try; then
11257 echo "Yes, it seems to work."
11260 echo "Nope, it didn't work."
11265 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
11266 *** This is (almost) impossible.
11267 *** If your NFS lock daemons are not feeling well, something like
11268 *** this may happen, please investigate. Cannot continue, aborting.
11276 echo "I'm unable to compile the test program, so I'll assume not."
11281 echo "Nope, since you don't even have fcntl()."
11284 set d_fcntl_can_lock
11289 : check for fd_set items
11292 Checking to see how well your C compiler handles fd_set and friends ...
11295 #$i_systime I_SYS_TIME
11296 #$i_sysselct I_SYS_SELECT
11297 #$d_socket HAS_SOCKET
11298 #include <sys/types.h>
11300 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
11303 #include <sys/time.h>
11305 #ifdef I_SYS_SELECT
11306 #include <sys/select.h>
11315 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
11323 if eval $compile; then
11324 d_fds_bits="$define"
11326 echo "Well, your system knows about the normal fd_set typedef..." >&4
11327 if $run ./try; then
11328 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
11329 d_fd_macros="$define"
11332 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
11334 d_fd_macros="$undef"
11338 Hmm, your compiler has some difficulty with fd_set. Checking further...
11341 if eval $compile; then
11342 d_fds_bits="$undef"
11344 echo "Well, your system has some sort of fd_set available..." >&4
11345 if $run ./try; then
11346 echo "and you have the normal fd_set macros." >&4
11347 d_fd_macros="$define"
11350 but not the normal fd_set macros! Gross! More work for me...
11352 d_fd_macros="$undef"
11355 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
11357 d_fds_bits="$undef"
11358 d_fd_macros="$undef"
11363 : see if fgetpos exists
11364 set fgetpos d_fgetpos
11367 : see if finite exists
11368 set finite d_finite
11371 : see if finitel exists
11372 set finitel d_finitel
11375 : see if flock exists
11379 : see if prototype for flock is available
11381 set d_flockproto flock $i_sysfile sys/file.h
11384 : see if fork exists
11388 : see if fp_class exists
11389 set fp_class d_fp_class
11392 : see if pathconf exists
11393 set pathconf d_pathconf
11396 : see if fpathconf exists
11397 set fpathconf d_fpathconf
11400 : see if fpclass exists
11401 set fpclass d_fpclass
11404 : see if fpclassify exists
11405 set fpclassify d_fpclassify
11408 : see if fpclassl exists
11409 set fpclassl d_fpclassl
11413 : check for fpos64_t
11415 echo "Checking to see if you have fpos64_t..." >&4
11418 int main() { fpos64_t x = 7; }
11421 if eval $compile; then
11423 echo "You have fpos64_t."
11426 echo "You do not have fpos64_t."
11427 case "$fpossize" in
11428 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
11435 : see if frexpl exists
11436 set frexpl d_frexpl
11439 : see if this is a sys/param system
11440 set sys/param.h i_sysparam
11443 : see if this is a sys/mount.h system
11444 set sys/mount.h i_sysmount
11449 echo "Checking to see if your system supports struct fs_data..." >&4
11450 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
11452 case "$d_fs_data_s" in
11453 "$define") echo "Yes, it does." ;;
11454 *) echo "No, it doesn't." ;;
11457 : see if fseeko exists
11458 set fseeko d_fseeko
11460 case "$longsize" in
11461 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
11464 : see if fsetpos exists
11465 set fsetpos d_fsetpos
11469 : see if fstatfs exists
11470 set fstatfs d_fstatfs
11474 : see if statvfs exists
11475 set statvfs d_statvfs
11478 : see if fstatvfs exists
11479 set fstatvfs d_fstatvfs
11483 : see if fsync exists
11487 : see if ftello exists
11488 set ftello d_ftello
11490 case "$longsize" in
11491 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
11494 : see if getcwd exists
11495 set getcwd d_getcwd
11498 : see if getespwnam exists
11499 set getespwnam d_getespwnam
11503 : see if getfsstat exists
11504 set getfsstat d_getfsstat
11507 : see if getgrent exists
11508 set getgrent d_getgrent
11511 : see if getgrent_r exists
11512 set getgrent_r d_getgrent_r
11514 case "$d_getgrent_r" in
11516 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11517 case "$d_getgrent_r_proto:$usethreads" in
11518 ":define") d_getgrent_r_proto=define
11519 set d_getgrent_r_proto getgrent_r $hdrs
11523 case "$d_getgrent_r_proto" in
11525 case "$getgrent_r_proto" in
11526 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
11527 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
11529 case "$getgrent_r_proto" in
11530 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
11531 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
11533 case "$getgrent_r_proto" in
11534 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
11535 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
11537 case "$getgrent_r_proto" in
11538 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
11539 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
11541 case "$getgrent_r_proto" in
11542 ''|0) try='int getgrent_r(struct group*, char*, int);'
11543 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
11545 case "$getgrent_r_proto" in
11546 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
11547 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
11549 case "$getgrent_r_proto" in
11550 ''|0) d_getgrent_r=undef
11552 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
11553 * ) case "$getgrent_r_proto" in
11554 REENTRANT_PROTO*) ;;
11555 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
11557 echo "Prototype: $try" ;;
11560 *) case "$usethreads" in
11561 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
11568 *) getgrent_r_proto=0
11572 : see if getgrgid_r exists
11573 set getgrgid_r d_getgrgid_r
11575 case "$d_getgrgid_r" in
11577 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11578 case "$d_getgrgid_r_proto:$usethreads" in
11579 ":define") d_getgrgid_r_proto=define
11580 set d_getgrgid_r_proto getgrgid_r $hdrs
11584 case "$d_getgrgid_r_proto" in
11586 case "$getgrgid_r_proto" in
11587 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
11588 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
11590 case "$getgrgid_r_proto" in
11591 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
11592 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
11594 case "$getgrgid_r_proto" in
11595 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
11596 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
11598 case "$getgrgid_r_proto" in
11599 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
11600 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
11602 case "$getgrgid_r_proto" in
11603 ''|0) d_getgrgid_r=undef
11605 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
11606 * ) case "$getgrgid_r_proto" in
11607 REENTRANT_PROTO*) ;;
11608 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
11610 echo "Prototype: $try" ;;
11613 *) case "$usethreads" in
11614 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
11621 *) getgrgid_r_proto=0
11625 : see if getgrnam_r exists
11626 set getgrnam_r d_getgrnam_r
11628 case "$d_getgrnam_r" in
11630 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11631 case "$d_getgrnam_r_proto:$usethreads" in
11632 ":define") d_getgrnam_r_proto=define
11633 set d_getgrnam_r_proto getgrnam_r $hdrs
11637 case "$d_getgrnam_r_proto" in
11639 case "$getgrnam_r_proto" in
11640 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
11641 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
11643 case "$getgrnam_r_proto" in
11644 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
11645 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
11647 case "$getgrnam_r_proto" in
11648 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
11649 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
11651 case "$getgrnam_r_proto" in
11652 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
11653 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
11655 case "$getgrnam_r_proto" in
11656 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
11657 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
11659 case "$getgrnam_r_proto" in
11660 ''|0) d_getgrnam_r=undef
11662 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
11663 * ) case "$getgrnam_r_proto" in
11664 REENTRANT_PROTO*) ;;
11665 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
11667 echo "Prototype: $try" ;;
11670 *) case "$usethreads" in
11671 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
11678 *) getgrnam_r_proto=0
11682 : see if gethostbyaddr exists
11683 set gethostbyaddr d_gethbyaddr
11686 : see if gethostbyname exists
11687 set gethostbyname d_gethbyname
11690 : see if gethostent exists
11691 set gethostent d_gethent
11694 : see how we will look up host name
11697 if set gethostname val -f d_gethname; eval $csym; $val; then
11698 echo 'gethostname() found.' >&4
11699 d_gethname="$define"
11702 if set uname val -f d_uname; eval $csym; $val; then
11705 uname() was found, but you're running xenix, and older versions of xenix
11706 have a broken uname(). If you don't really know whether your xenix is old
11707 enough to have a broken system call, use the default answer.
11712 "$define") dflt=n;;
11714 rp='Is your uname() broken?'
11717 n*) d_uname="$define"; call=uname;;
11720 echo 'uname() found.' >&4
11727 case "$d_gethname" in
11728 '') d_gethname="$undef";;
11731 '') d_uname="$undef";;
11733 case "$d_uname$d_gethname" in
11738 Every now and then someone has a $call() that lies about the hostname
11739 but can't be fixed for political or economic reasons. If you wish, I can
11740 pretend $call() isn't there and maybe compute hostname at run-time
11741 thanks to the '$phostname' command.
11744 rp="Shall I ignore $call() from now on?"
11747 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
11750 case "$phostname" in
11751 '') aphostname='';;
11752 *) case "$aphostname" in
11754 *) set X $phostname
11758 file=`./loc $file $file $pth`
11759 aphostname=`echo $file $*`
11764 case "$d_uname$d_gethname" in
11767 case "$phostname" in
11769 echo "There will be no way for $package to get your hostname." >&4;;
11771 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
11775 case "$d_phostname" in
11776 '') d_phostname="$undef";;
11779 : see if gethostbyaddr_r exists
11780 set gethostbyaddr_r d_gethostbyaddr_r
11782 case "$d_gethostbyaddr_r" in
11784 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11785 case "$d_gethostbyaddr_r_proto:$usethreads" in
11786 ":define") d_gethostbyaddr_r_proto=define
11787 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
11791 case "$d_gethostbyaddr_r_proto" in
11793 case "$gethostbyaddr_r_proto" in
11794 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
11795 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
11797 case "$gethostbyaddr_r_proto" in
11798 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
11799 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
11801 case "$gethostbyaddr_r_proto" in
11802 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
11803 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
11805 case "$gethostbyaddr_r_proto" in
11806 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
11807 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
11809 case "$gethostbyaddr_r_proto" in
11810 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
11811 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
11813 case "$gethostbyaddr_r_proto" in
11814 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
11815 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
11817 case "$gethostbyaddr_r_proto" in
11818 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
11819 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
11821 case "$gethostbyaddr_r_proto" in
11822 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
11823 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
11825 case "$gethostbyaddr_r_proto" in
11826 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
11827 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
11829 case "$gethostbyaddr_r_proto" in
11830 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
11831 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
11833 case "$gethostbyaddr_r_proto" in
11834 ''|0) d_gethostbyaddr_r=undef
11835 gethostbyaddr_r_proto=0
11836 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
11837 * ) case "$gethostbyaddr_r_proto" in
11838 REENTRANT_PROTO*) ;;
11839 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
11841 echo "Prototype: $try" ;;
11844 *) case "$usethreads" in
11845 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
11847 d_gethostbyaddr_r=undef
11848 gethostbyaddr_r_proto=0
11852 *) gethostbyaddr_r_proto=0
11856 : see if gethostbyname_r exists
11857 set gethostbyname_r d_gethostbyname_r
11859 case "$d_gethostbyname_r" in
11861 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11862 case "$d_gethostbyname_r_proto:$usethreads" in
11863 ":define") d_gethostbyname_r_proto=define
11864 set d_gethostbyname_r_proto gethostbyname_r $hdrs
11868 case "$d_gethostbyname_r_proto" in
11870 case "$gethostbyname_r_proto" in
11871 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
11872 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
11874 case "$gethostbyname_r_proto" in
11875 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
11876 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
11878 case "$gethostbyname_r_proto" in
11879 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
11880 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
11882 case "$gethostbyname_r_proto" in
11883 ''|0) d_gethostbyname_r=undef
11884 gethostbyname_r_proto=0
11885 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
11886 * ) case "$gethostbyname_r_proto" in
11887 REENTRANT_PROTO*) ;;
11888 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
11890 echo "Prototype: $try" ;;
11893 *) case "$usethreads" in
11894 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
11896 d_gethostbyname_r=undef
11897 gethostbyname_r_proto=0
11901 *) gethostbyname_r_proto=0
11905 : see if gethostent_r exists
11906 set gethostent_r d_gethostent_r
11908 case "$d_gethostent_r" in
11910 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11911 case "$d_gethostent_r_proto:$usethreads" in
11912 ":define") d_gethostent_r_proto=define
11913 set d_gethostent_r_proto gethostent_r $hdrs
11917 case "$d_gethostent_r_proto" in
11919 case "$gethostent_r_proto" in
11920 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
11921 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
11923 case "$gethostent_r_proto" in
11924 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
11925 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
11927 case "$gethostent_r_proto" in
11928 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
11929 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
11931 case "$gethostent_r_proto" in
11932 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
11933 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
11935 case "$gethostent_r_proto" in
11936 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
11937 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
11939 case "$gethostent_r_proto" in
11940 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
11941 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
11943 case "$gethostent_r_proto" in
11944 ''|0) d_gethostent_r=undef
11945 gethostent_r_proto=0
11946 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
11947 * ) case "$gethostent_r_proto" in
11948 REENTRANT_PROTO*) ;;
11949 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
11951 echo "Prototype: $try" ;;
11954 *) case "$usethreads" in
11955 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
11957 d_gethostent_r=undef
11958 gethostent_r_proto=0
11962 *) gethostent_r_proto=0
11966 : see if prototypes for various gethostxxx netdb.h functions are available
11968 set d_gethostprotos gethostent $i_netdb netdb.h
11971 : see if getitimer exists
11972 set getitimer d_getitimer
11975 : see if getlogin exists
11976 set getlogin d_getlogin
11979 : see if getlogin_r exists
11980 set getlogin_r d_getlogin_r
11982 case "$d_getlogin_r" in
11984 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
11985 case "$d_getlogin_r_proto:$usethreads" in
11986 ":define") d_getlogin_r_proto=define
11987 set d_getlogin_r_proto getlogin_r $hdrs
11991 case "$d_getlogin_r_proto" in
11993 case "$getlogin_r_proto" in
11994 ''|0) try='int getlogin_r(char*, size_t);'
11995 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
11997 case "$getlogin_r_proto" in
11998 ''|0) try='int getlogin_r(char*, int);'
11999 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
12001 case "$getlogin_r_proto" in
12002 ''|0) try='char* getlogin_r(char*, size_t);'
12003 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
12005 case "$getlogin_r_proto" in
12006 ''|0) try='char* getlogin_r(char*, int);'
12007 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
12009 case "$getlogin_r_proto" in
12010 ''|0) d_getlogin_r=undef
12012 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
12013 * ) case "$getlogin_r_proto" in
12014 REENTRANT_PROTO*) ;;
12015 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
12017 echo "Prototype: $try" ;;
12020 *) case "$usethreads" in
12021 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
12028 *) getlogin_r_proto=0
12032 : see if getmnt exists
12033 set getmnt d_getmnt
12036 : see if getmntent exists
12037 set getmntent d_getmntent
12040 : see if getnetbyaddr exists
12041 set getnetbyaddr d_getnbyaddr
12044 : see if getnetbyname exists
12045 set getnetbyname d_getnbyname
12048 : see if getnetent exists
12049 set getnetent d_getnent
12052 : see if getnetbyaddr_r exists
12053 set getnetbyaddr_r d_getnetbyaddr_r
12055 case "$d_getnetbyaddr_r" in
12057 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12058 case "$d_getnetbyaddr_r_proto:$usethreads" in
12059 ":define") d_getnetbyaddr_r_proto=define
12060 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
12064 case "$d_getnetbyaddr_r_proto" in
12066 case "$getnetbyaddr_r_proto" in
12067 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
12068 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
12070 case "$getnetbyaddr_r_proto" in
12071 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
12072 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
12074 case "$getnetbyaddr_r_proto" in
12075 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
12076 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
12078 case "$getnetbyaddr_r_proto" in
12079 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
12080 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
12082 case "$getnetbyaddr_r_proto" in
12083 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
12084 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
12086 case "$getnetbyaddr_r_proto" in
12087 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
12088 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
12090 case "$getnetbyaddr_r_proto" in
12091 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
12092 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
12094 case "$getnetbyaddr_r_proto" in
12095 ''|0) d_getnetbyaddr_r=undef
12096 getnetbyaddr_r_proto=0
12097 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
12098 * ) case "$getnetbyaddr_r_proto" in
12099 REENTRANT_PROTO*) ;;
12100 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
12102 echo "Prototype: $try" ;;
12105 *) case "$usethreads" in
12106 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
12108 d_getnetbyaddr_r=undef
12109 getnetbyaddr_r_proto=0
12113 *) getnetbyaddr_r_proto=0
12117 : see if getnetbyname_r exists
12118 set getnetbyname_r d_getnetbyname_r
12120 case "$d_getnetbyname_r" in
12122 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12123 case "$d_getnetbyname_r_proto:$usethreads" in
12124 ":define") d_getnetbyname_r_proto=define
12125 set d_getnetbyname_r_proto getnetbyname_r $hdrs
12129 case "$d_getnetbyname_r_proto" in
12131 case "$getnetbyname_r_proto" in
12132 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
12133 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
12135 case "$getnetbyname_r_proto" in
12136 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
12137 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
12139 case "$getnetbyname_r_proto" in
12140 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
12141 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
12143 case "$getnetbyname_r_proto" in
12144 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
12145 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
12147 case "$getnetbyname_r_proto" in
12148 ''|0) d_getnetbyname_r=undef
12149 getnetbyname_r_proto=0
12150 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
12151 * ) case "$getnetbyname_r_proto" in
12152 REENTRANT_PROTO*) ;;
12153 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
12155 echo "Prototype: $try" ;;
12158 *) case "$usethreads" in
12159 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
12161 d_getnetbyname_r=undef
12162 getnetbyname_r_proto=0
12166 *) getnetbyname_r_proto=0
12170 : see if getnetent_r exists
12171 set getnetent_r d_getnetent_r
12173 case "$d_getnetent_r" in
12175 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12176 case "$d_getnetent_r_proto:$usethreads" in
12177 ":define") d_getnetent_r_proto=define
12178 set d_getnetent_r_proto getnetent_r $hdrs
12182 case "$d_getnetent_r_proto" in
12184 case "$getnetent_r_proto" in
12185 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
12186 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
12188 case "$getnetent_r_proto" in
12189 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
12190 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
12192 case "$getnetent_r_proto" in
12193 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
12194 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
12196 case "$getnetent_r_proto" in
12197 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
12198 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
12200 case "$getnetent_r_proto" in
12201 ''|0) try='int getnetent_r(struct netent*, char*, int);'
12202 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
12204 case "$getnetent_r_proto" in
12205 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
12206 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
12208 case "$getnetent_r_proto" in
12209 ''|0) d_getnetent_r=undef
12210 getnetent_r_proto=0
12211 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
12212 * ) case "$getnetent_r_proto" in
12213 REENTRANT_PROTO*) ;;
12214 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
12216 echo "Prototype: $try" ;;
12219 *) case "$usethreads" in
12220 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
12222 d_getnetent_r=undef
12223 getnetent_r_proto=0
12227 *) getnetent_r_proto=0
12231 : see if prototypes for various getnetxxx netdb.h functions are available
12233 set d_getnetprotos getnetent $i_netdb netdb.h
12236 : see if getpagesize exists
12237 set getpagesize d_getpagsz
12241 : see if getprotobyname exists
12242 set getprotobyname d_getpbyname
12245 : see if getprotobynumber exists
12246 set getprotobynumber d_getpbynumber
12249 : see if getprotoent exists
12250 set getprotoent d_getpent
12253 : see if getpgid exists
12254 set getpgid d_getpgid
12257 : see if getpgrp2 exists
12258 set getpgrp2 d_getpgrp2
12261 : see if getppid exists
12262 set getppid d_getppid
12265 : see if getpriority exists
12266 set getpriority d_getprior
12269 : see if getprotobyname_r exists
12270 set getprotobyname_r d_getprotobyname_r
12272 case "$d_getprotobyname_r" in
12274 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12275 case "$d_getprotobyname_r_proto:$usethreads" in
12276 ":define") d_getprotobyname_r_proto=define
12277 set d_getprotobyname_r_proto getprotobyname_r $hdrs
12281 case "$d_getprotobyname_r_proto" in
12283 case "$getprotobyname_r_proto" in
12284 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
12285 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
12287 case "$getprotobyname_r_proto" in
12288 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
12289 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
12291 case "$getprotobyname_r_proto" in
12292 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
12293 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
12295 case "$getprotobyname_r_proto" in
12296 ''|0) d_getprotobyname_r=undef
12297 getprotobyname_r_proto=0
12298 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
12299 * ) case "$getprotobyname_r_proto" in
12300 REENTRANT_PROTO*) ;;
12301 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
12303 echo "Prototype: $try" ;;
12306 *) case "$usethreads" in
12307 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
12309 d_getprotobyname_r=undef
12310 getprotobyname_r_proto=0
12314 *) getprotobyname_r_proto=0
12318 : see if getprotobynumber_r exists
12319 set getprotobynumber_r d_getprotobynumber_r
12321 case "$d_getprotobynumber_r" in
12323 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12324 case "$d_getprotobynumber_r_proto:$usethreads" in
12325 ":define") d_getprotobynumber_r_proto=define
12326 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
12330 case "$d_getprotobynumber_r_proto" in
12332 case "$getprotobynumber_r_proto" in
12333 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
12334 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
12336 case "$getprotobynumber_r_proto" in
12337 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
12338 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
12340 case "$getprotobynumber_r_proto" in
12341 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
12342 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
12344 case "$getprotobynumber_r_proto" in
12345 ''|0) d_getprotobynumber_r=undef
12346 getprotobynumber_r_proto=0
12347 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
12348 * ) case "$getprotobynumber_r_proto" in
12349 REENTRANT_PROTO*) ;;
12350 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
12352 echo "Prototype: $try" ;;
12355 *) case "$usethreads" in
12356 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
12358 d_getprotobynumber_r=undef
12359 getprotobynumber_r_proto=0
12363 *) getprotobynumber_r_proto=0
12367 : see if getprotoent_r exists
12368 set getprotoent_r d_getprotoent_r
12370 case "$d_getprotoent_r" in
12372 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12373 case "$d_getprotoent_r_proto:$usethreads" in
12374 ":define") d_getprotoent_r_proto=define
12375 set d_getprotoent_r_proto getprotoent_r $hdrs
12379 case "$d_getprotoent_r_proto" in
12381 case "$getprotoent_r_proto" in
12382 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
12383 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
12385 case "$getprotoent_r_proto" in
12386 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
12387 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
12389 case "$getprotoent_r_proto" in
12390 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
12391 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
12393 case "$getprotoent_r_proto" in
12394 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
12395 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
12397 case "$getprotoent_r_proto" in
12398 ''|0) d_getprotoent_r=undef
12399 getprotoent_r_proto=0
12400 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
12401 * ) case "$getprotoent_r_proto" in
12402 REENTRANT_PROTO*) ;;
12403 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
12405 echo "Prototype: $try" ;;
12408 *) case "$usethreads" in
12409 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
12411 d_getprotoent_r=undef
12412 getprotoent_r_proto=0
12416 *) getprotoent_r_proto=0
12420 : see if prototypes for various getprotoxxx netdb.h functions are available
12422 set d_getprotoprotos getprotoent $i_netdb netdb.h
12425 : see if getprpwnam exists
12426 set getprpwnam d_getprpwnam
12429 : see if getpwent exists
12430 set getpwent d_getpwent
12433 : see if getpwent_r exists
12434 set getpwent_r d_getpwent_r
12436 case "$d_getpwent_r" in
12438 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12439 case "$d_getpwent_r_proto:$usethreads" in
12440 ":define") d_getpwent_r_proto=define
12441 set d_getpwent_r_proto getpwent_r $hdrs
12445 case "$d_getpwent_r_proto" in
12447 case "$getpwent_r_proto" in
12448 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
12449 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
12451 case "$getpwent_r_proto" in
12452 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
12453 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
12455 case "$getpwent_r_proto" in
12456 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
12457 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
12459 case "$getpwent_r_proto" in
12460 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
12461 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
12463 case "$getpwent_r_proto" in
12464 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
12465 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
12467 case "$getpwent_r_proto" in
12468 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
12469 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
12471 case "$getpwent_r_proto" in
12472 ''|0) d_getpwent_r=undef
12474 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
12475 * ) case "$getpwent_r_proto" in
12476 REENTRANT_PROTO*) ;;
12477 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
12479 echo "Prototype: $try" ;;
12482 *) case "$usethreads" in
12483 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
12490 *) getpwent_r_proto=0
12494 : see if getpwnam_r exists
12495 set getpwnam_r d_getpwnam_r
12497 case "$d_getpwnam_r" in
12499 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12500 case "$d_getpwnam_r_proto:$usethreads" in
12501 ":define") d_getpwnam_r_proto=define
12502 set d_getpwnam_r_proto getpwnam_r $hdrs
12506 case "$d_getpwnam_r_proto" in
12508 case "$getpwnam_r_proto" in
12509 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
12510 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
12512 case "$getpwnam_r_proto" in
12513 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
12514 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
12516 case "$getpwnam_r_proto" in
12517 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
12518 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
12520 case "$getpwnam_r_proto" in
12521 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
12522 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
12524 case "$getpwnam_r_proto" in
12525 ''|0) d_getpwnam_r=undef
12527 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
12528 * ) case "$getpwnam_r_proto" in
12529 REENTRANT_PROTO*) ;;
12530 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
12532 echo "Prototype: $try" ;;
12535 *) case "$usethreads" in
12536 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
12543 *) getpwnam_r_proto=0
12547 : see if getpwuid_r exists
12548 set getpwuid_r d_getpwuid_r
12550 case "$d_getpwuid_r" in
12552 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12553 case "$d_getpwuid_r_proto:$usethreads" in
12554 ":define") d_getpwuid_r_proto=define
12555 set d_getpwuid_r_proto getpwuid_r $hdrs
12559 case "$d_getpwuid_r_proto" in
12561 case "$getpwuid_r_proto" in
12562 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
12563 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
12565 case "$getpwuid_r_proto" in
12566 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
12567 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
12569 case "$getpwuid_r_proto" in
12570 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
12571 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
12573 case "$getpwuid_r_proto" in
12574 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
12575 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
12577 case "$getpwuid_r_proto" in
12578 ''|0) d_getpwuid_r=undef
12580 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
12581 * ) case "$getpwuid_r_proto" in
12582 REENTRANT_PROTO*) ;;
12583 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
12585 echo "Prototype: $try" ;;
12588 *) case "$usethreads" in
12589 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
12596 *) getpwuid_r_proto=0
12601 : see if getservbyname exists
12602 set getservbyname d_getsbyname
12605 : see if getservbyport exists
12606 set getservbyport d_getsbyport
12609 : see if getservent exists
12610 set getservent d_getsent
12613 : see if getservbyname_r exists
12614 set getservbyname_r d_getservbyname_r
12616 case "$d_getservbyname_r" in
12618 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12619 case "$d_getservbyname_r_proto:$usethreads" in
12620 ":define") d_getservbyname_r_proto=define
12621 set d_getservbyname_r_proto getservbyname_r $hdrs
12625 case "$d_getservbyname_r_proto" in
12627 case "$getservbyname_r_proto" in
12628 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
12629 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
12631 case "$getservbyname_r_proto" in
12632 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
12633 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
12635 case "$getservbyname_r_proto" in
12636 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
12637 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
12639 case "$getservbyname_r_proto" in
12640 ''|0) d_getservbyname_r=undef
12641 getservbyname_r_proto=0
12642 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
12643 * ) case "$getservbyname_r_proto" in
12644 REENTRANT_PROTO*) ;;
12645 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
12647 echo "Prototype: $try" ;;
12650 *) case "$usethreads" in
12651 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
12653 d_getservbyname_r=undef
12654 getservbyname_r_proto=0
12658 *) getservbyname_r_proto=0
12662 : see if getservbyport_r exists
12663 set getservbyport_r d_getservbyport_r
12665 case "$d_getservbyport_r" in
12667 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12668 case "$d_getservbyport_r_proto:$usethreads" in
12669 ":define") d_getservbyport_r_proto=define
12670 set d_getservbyport_r_proto getservbyport_r $hdrs
12674 case "$d_getservbyport_r_proto" in
12676 case "$getservbyport_r_proto" in
12677 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
12678 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
12680 case "$getservbyport_r_proto" in
12681 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
12682 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
12684 case "$getservbyport_r_proto" in
12685 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
12686 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
12688 case "$getservbyport_r_proto" in
12689 ''|0) d_getservbyport_r=undef
12690 getservbyport_r_proto=0
12691 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
12692 * ) case "$getservbyport_r_proto" in
12693 REENTRANT_PROTO*) ;;
12694 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
12696 echo "Prototype: $try" ;;
12699 *) case "$usethreads" in
12700 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
12702 d_getservbyport_r=undef
12703 getservbyport_r_proto=0
12707 *) getservbyport_r_proto=0
12711 : see if getservent_r exists
12712 set getservent_r d_getservent_r
12714 case "$d_getservent_r" in
12716 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12717 case "$d_getservent_r_proto:$usethreads" in
12718 ":define") d_getservent_r_proto=define
12719 set d_getservent_r_proto getservent_r $hdrs
12723 case "$d_getservent_r_proto" in
12725 case "$getservent_r_proto" in
12726 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
12727 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
12729 case "$getservent_r_proto" in
12730 ''|0) try='int getservent_r(struct servent*, char*, int);'
12731 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
12733 case "$getservent_r_proto" in
12734 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
12735 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
12737 case "$getservent_r_proto" in
12738 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
12739 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
12741 case "$getservent_r_proto" in
12742 ''|0) d_getservent_r=undef
12743 getservent_r_proto=0
12744 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
12745 * ) case "$getservent_r_proto" in
12746 REENTRANT_PROTO*) ;;
12747 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
12749 echo "Prototype: $try" ;;
12752 *) case "$usethreads" in
12753 define) echo "getservent_r has no prototype, not using it." >&4 ;;
12755 d_getservent_r=undef
12756 getservent_r_proto=0
12760 *) getservent_r_proto=0
12764 : see if prototypes for various getservxxx netdb.h functions are available
12766 set d_getservprotos getservent $i_netdb netdb.h
12769 : see if getspnam exists
12770 set getspnam d_getspnam
12773 : see if this is a shadow.h system
12774 set shadow.h i_shadow
12777 : see if getspnam_r exists
12778 set getspnam_r d_getspnam_r
12780 case "$d_getspnam_r" in
12782 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
12783 case "$d_getspnam_r_proto:$usethreads" in
12784 ":define") d_getspnam_r_proto=define
12785 set d_getspnam_r_proto getspnam_r $hdrs
12789 case "$d_getspnam_r_proto" in
12791 case "$getspnam_r_proto" in
12792 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
12793 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
12795 case "$getspnam_r_proto" in
12796 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
12797 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
12799 case "$getspnam_r_proto" in
12800 ''|0) d_getspnam_r=undef
12802 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
12803 * ) case "$getspnam_r_proto" in
12804 REENTRANT_PROTO*) ;;
12805 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
12807 echo "Prototype: $try" ;;
12810 *) case "$usethreads" in
12811 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
12818 *) getspnam_r_proto=0
12822 : see if gettimeofday or ftime exists
12823 set gettimeofday d_gettimeod
12825 case "$d_gettimeod" in
12831 val="$undef"; set d_ftime; eval $setvar
12834 case "$d_gettimeod$d_ftime" in
12837 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
12841 : see if gmtime_r exists
12842 set gmtime_r d_gmtime_r
12844 case "$d_gmtime_r" in
12846 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12847 case "$d_gmtime_r_proto:$usethreads" in
12848 ":define") d_gmtime_r_proto=define
12849 set d_gmtime_r_proto gmtime_r $hdrs
12853 case "$d_gmtime_r_proto" in
12855 case "$gmtime_r_proto" in
12856 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
12857 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
12859 case "$gmtime_r_proto" in
12860 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
12861 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
12863 case "$gmtime_r_proto" in
12864 ''|0) d_gmtime_r=undef
12866 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
12867 * ) case "$gmtime_r_proto" in
12868 REENTRANT_PROTO*) ;;
12869 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
12871 echo "Prototype: $try" ;;
12874 *) case "$usethreads" in
12875 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
12882 *) gmtime_r_proto=0
12886 : see if hasmntopt exists
12887 set hasmntopt d_hasmntopt
12890 : see if this is a netinet/in.h or sys/in.h system
12891 set netinet/in.h i_niin sys/in.h i_sysin
12894 : see if arpa/inet.h has to be included
12895 set arpa/inet.h i_arpainet
12898 : see if htonl --and friends-- exists
12903 : Maybe they are macros.
12906 $cat >htonl.c <<EOM
12908 #include <sys/types.h>
12909 #$i_niin I_NETINET_IN
12911 #$i_arpainet I_ARPA_INET
12912 #ifdef I_NETINET_IN
12913 #include <netinet/in.h>
12916 #include <sys/in.h>
12919 #include <arpa/inet.h>
12922 printf("Defined as a macro.");
12925 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
12926 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
12928 echo "But it seems to be defined as a macro." >&4
12938 if set index val -f; eval $csym; $val; then
12939 if set strchr val -f d_strchr; eval $csym; $val; then
12940 if $contains strchr "$strings" >/dev/null 2>&1 ; then
12943 echo "strchr() found." >&4
12947 echo "index() found." >&4
12952 echo "index() found." >&4
12955 if set strchr val -f d_strchr; eval $csym; $val; then
12958 echo "strchr() found." >&4
12960 echo "No index() or strchr() found!" >&4
12965 set d_strchr; eval $setvar
12967 set d_index; eval $setvar
12969 : check whether inet_aton exists
12970 set inet_aton d_inetaton
12975 $cat >isascii.c <<'EOCP'
12987 if eval $compile; then
12988 echo "isascii() found." >&4
12991 echo "isascii() NOT found." >&4
12998 : see if isfinite exists
12999 set isfinite d_isfinite
13002 : see if isinf exists
13006 : see if isnan exists
13010 : see if isnanl exists
13011 set isnanl d_isnanl
13014 : see if killpg exists
13015 set killpg d_killpg
13018 : see if lchown exists
13020 $cat > try.c <<'EOCP'
13021 /* System header to define __stub macros and hopefully few prototypes,
13022 which can conflict with char lchown(); below. */
13023 #include <assert.h>
13024 /* Override any gcc2 internal prototype to avoid an error. */
13025 /* We use char because int might match the return type of a gcc2
13026 builtin and then its argument prototype would still apply. */
13029 /* The GNU C library defines this for functions which it implements
13030 to always fail with ENOSYS. Some functions are actually named
13031 something starting with __ and the normal name is an alias. */
13032 #if defined (__stub_lchown) || defined (__stub___lchown)
13040 if eval $compile; then
13041 $echo "lchown() found." >&4
13044 $echo "lchown() NOT found." >&4
13050 : See if number of significant digits in a double precision number is known
13052 $cat >ldbl_dig.c <<EOM
13053 #$i_limits I_LIMITS
13056 #include <limits.h>
13062 printf("Contains LDBL_DIG");
13065 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
13066 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
13067 echo "LDBL_DIG found." >&4
13070 echo "LDBL_DIG NOT found." >&4
13077 : see if link exists
13081 : see if localtime_r exists
13082 set localtime_r d_localtime_r
13084 case "$d_localtime_r" in
13086 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13087 case "$d_localtime_r_proto:$usethreads" in
13088 ":define") d_localtime_r_proto=define
13089 set d_localtime_r_proto localtime_r $hdrs
13093 case "$d_localtime_r_proto" in
13095 case "$localtime_r_proto" in
13096 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
13097 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
13099 case "$localtime_r_proto" in
13100 ''|0) try='int localtime_r(const time_t*, struct tm*);'
13101 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
13103 case "$localtime_r_proto" in
13104 ''|0) d_localtime_r=undef
13105 localtime_r_proto=0
13106 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
13107 * ) case "$localtime_r_proto" in
13108 REENTRANT_PROTO*) ;;
13109 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
13111 echo "Prototype: $try" ;;
13114 *) case "$usethreads" in
13115 define) echo "localtime_r has no prototype, not using it." >&4 ;;
13117 d_localtime_r=undef
13118 localtime_r_proto=0
13122 *) localtime_r_proto=0
13126 : see if localeconv exists
13127 set localeconv d_locconv
13130 : see if lockf exists
13134 : see if prototype for lseek is available
13136 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
13139 : see if lstat exists
13143 : see if madvise exists
13144 set madvise d_madvise
13147 : see if mblen exists
13151 : see if mbstowcs exists
13152 set mbstowcs d_mbstowcs
13155 : see if mbtowc exists
13156 set mbtowc d_mbtowc
13159 : see if memchr exists
13160 set memchr d_memchr
13163 : see if memcmp exists
13164 set memcmp d_memcmp
13167 : see if memcpy exists
13168 set memcpy d_memcpy
13171 : see if memmove exists
13172 set memmove d_memmove
13175 : see if memset exists
13176 set memset d_memset
13179 : see if mkdir exists
13183 : see if mkdtemp exists
13184 set mkdtemp d_mkdtemp
13187 : see if mkfifo exists
13188 set mkfifo d_mkfifo
13191 : see if mkstemp exists
13192 set mkstemp d_mkstemp
13195 : see if mkstemps exists
13196 set mkstemps d_mkstemps
13199 : see if mktime exists
13200 set mktime d_mktime
13203 : see if this is a sys/mman.h system
13204 set sys/mman.h i_sysmman
13207 : see if mmap exists
13210 : see what shmat returns
13211 : default to something harmless
13213 case "$i_sysmman$d_mmap" in
13215 $cat >mmap.c <<'END'
13216 #include <sys/mman.h>
13219 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
13224 echo "and it returns ($mmaptype)." >&4
13230 : see if mprotect exists
13231 set mprotect d_mprotect
13234 : see if msgctl exists
13235 set msgctl d_msgctl
13238 : see if msgget exists
13239 set msgget d_msgget
13242 : see if msgsnd exists
13243 set msgsnd d_msgsnd
13246 : see if msgrcv exists
13247 set msgrcv d_msgrcv
13250 : see how much of the 'msg*(2)' library is present.
13253 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
13254 *"$undef"*) h_msg=false;;
13258 case "`ipcs 2>&1`" in
13259 "SVID messages"*"not configured"*)
13260 echo "Your $osname does not have the msg*(2) configured." >&4
13263 set msgctl d_msgctl
13265 set msgget d_msgget
13267 set msgsnd d_msgsnd
13269 set msgrcv d_msgrcv
13275 : we could also check for sys/ipc.h ...
13276 if $h_msg && $test `./findhdr sys/msg.h`; then
13277 echo "You have the full msg*(2) library." >&4
13280 echo "You don't have the full msg*(2) library." >&4
13288 echo "Checking to see if your system supports struct msghdr..." >&4
13289 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
13291 case "$d_msghdr_s" in
13292 "$define") echo "Yes, it does." ;;
13293 *) echo "No, it doesn't." ;;
13297 : see if msync exists
13301 : see if munmap exists
13302 set munmap d_munmap
13305 : see if nice exists
13309 : see if this is a langinfo.h system
13310 set langinfo.h i_langinfo
13313 : see if nl_langinfo exists
13314 set nl_langinfo d_nl_langinfo
13317 : check for length of character
13319 case "$charsize" in
13321 echo "Checking to see how big your characters are (hey, you never know)..." >&4
13322 $cat >try.c <<'EOCP'
13326 printf("%d\n", (int)sizeof(char));
13331 if eval $compile_ok; then
13335 echo "(I can't seem to compile the test program. Guessing...)"
13342 rp="What is the size of a character (in bytes)?"
13347 : check for volatile keyword
13349 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
13350 $cat >try.c <<'EOCP'
13353 typedef struct _goo_struct goo_struct;
13354 goo_struct * volatile goo = ((goo_struct *)0);
13355 struct _goo_struct {
13360 typedef unsigned short foo_t;
13361 char *volatile foo;
13363 volatile foo_t blech;
13367 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
13369 echo "Yup, it does."
13372 echo "Nope, it doesn't."
13380 $echo "Choosing the C types to be used for Perl's internal types..." >&4
13382 case "$use64bitint:$d_quad:$quadtype" in
13385 uvtype="$uquadtype"
13390 uvtype="unsigned long"
13396 case "$uselongdouble:$d_longdbl" in
13398 nvtype="long double"
13399 nvsize=$longdblsize
13406 $echo "(IV will be "$ivtype", $ivsize bytes)"
13407 $echo "(UV will be "$uvtype", $uvsize bytes)"
13408 $echo "(NV will be "$nvtype", $nvsize bytes)"
13411 #$i_inttypes I_INTTYPES
13413 #include <inttypes.h>
13418 int8_t i = INT8_MAX;
13419 uint8_t u = UINT8_MAX;
13420 printf("int8_t\n");
13423 int16_t i = INT16_MAX;
13424 uint16_t i = UINT16_MAX;
13425 printf("int16_t\n");
13428 int32_t i = INT32_MAX;
13429 uint32_t u = UINT32_MAX;
13430 printf("int32_t\n");
13436 '') case "$charsize" in
13438 u8type="unsigned char"
13447 if eval $compile; then
13448 case "`$run ./try`" in
13449 int8_t) i8type=int8_t
13459 '') if $test $charsize -ge 1; then
13461 u8type="unsigned char"
13469 '') case "$shortsize" in
13471 u16type="unsigned short"
13479 '') set try -DINT16
13480 if eval $compile; then
13481 case "`$run ./try`" in
13493 '') if $test $shortsize -ge 2; then
13495 u16type="unsigned short"
13503 '') case "$longsize" in
13505 u32type="unsigned long"
13509 *) case "$intsize" in
13511 u32type="unsigned int"
13521 '') set try -DINT32
13522 if eval $compile; then
13523 case "`$run ./try`" in
13535 '') if $test $intsize -ge 4; then
13537 u32type="unsigned int"
13545 '') case "$d_quad:$quadtype" in
13547 i64type="$quadtype"
13548 u64type="$uquadtype"
13556 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
13557 : volatile so that the compiler has to store it out to memory.
13558 if test X"$d_volatile" = X"$define"; then
13563 #include <sys/types.h>
13564 #include <signal.h>
13566 $volatile int bletched = 0;
13567 $signal_t blech(s) int s; { bletched = 1; }
13572 int n = 8 * $uvsize;
13575 signal(SIGFPE, blech);
13578 for (i = 0; i < n; i++) {
13579 u = u << 1 | ($uvtype)1;
13581 if (($uvtype)d != u)
13585 d = ($nvtype)(u - 1);
13586 if (($uvtype)d != (u - 1))
13594 printf("%d\n", ((i == n) ? -n : i));
13600 d_nv_preserves_uv="$undef"
13601 if eval $compile; then
13602 nv_preserves_uv_bits="`$run ./try`"
13604 case "$nv_preserves_uv_bits" in
13606 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
13607 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
13608 d_nv_preserves_uv="$define"
13610 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
13611 d_nv_preserves_uv="$undef" ;;
13612 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
13613 nv_preserves_uv_bits="$undef" ;;
13619 : check for off64_t
13621 echo "Checking to see if you have off64_t..." >&4
13623 #include <sys/types.h>
13624 #include <unistd.h>
13625 int main() { off64_t x = 7; }
13628 if eval $compile; then
13630 echo "You have off64_t."
13633 echo "You do not have off64_t."
13634 case "$lseeksize" in
13635 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
13642 : how to create joinable pthreads
13643 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
13645 echo "Checking what constant to use for creating joinable pthreads..." >&4
13646 $cat >try.c <<'EOCP'
13647 #include <pthread.h>
13649 int detachstate = JOINABLE;
13652 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
13653 if eval $compile; then
13654 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
13655 val="$undef" # Yes, undef.
13656 set d_old_pthread_create_joinable
13659 set old_pthread_create_joinable
13662 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
13663 if eval $compile; then
13664 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
13666 set d_old_pthread_create_joinable
13668 val=PTHREAD_CREATE_UNDETACHED
13669 set old_pthread_create_joinable
13672 set try -DJOINABLE=__UNDETACHED
13673 if eval $compile; then
13674 echo "You seem to use __UNDETACHED." >&4
13676 set d_old_pthread_create_joinable
13679 set old_pthread_create_joinable
13682 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
13684 set d_old_pthread_create_joinable
13687 set old_pthread_create_joinable
13694 d_old_pthread_create_joinable="$undef"
13695 old_pthread_create_joinable=""
13698 : see if pause exists
13702 : see if pipe exists
13706 : see if poll exists
13710 : see if readlink exists
13711 set readlink d_readlink
13717 case "$d_readlink" in
13719 if $issymlink /proc/self/exe ; then
13720 $ls -l /proc/self/exe > reflect
13721 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
13722 echo "You have Linux-like /proc/self/exe."
13723 procselfexe='"/proc/self/exe"'
13727 if $issymlink /proc/curproc/file ; then
13728 $ls -l /proc/curproc/file > reflect
13729 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
13730 echo "You have BSD-like /proc/curproc/file."
13731 procselfexe='"/proc/curproc/file"'
13741 : see whether the pthread_atfork exists
13743 #include <pthread.h>
13746 #ifdef PTHREAD_ATFORK
13747 pthread_atfork(NULL,NULL,NULL);
13752 : see if pthread_atfork exists
13753 set try -DPTHREAD_ATFORK
13754 if eval $compile; then
13759 case "$usethreads" in
13762 $define) echo 'pthread_atfork found.' >&4 ;;
13763 *) echo 'pthread_atfork NOT found.' >&4 ;;
13766 set d_pthread_atfork
13770 : see whether the various POSIXish _yields exist
13772 #include <pthread.h>
13778 #ifdef PTHREAD_YIELD
13781 #ifdef PTHREAD_YIELD_NULL
13782 pthread_yield(NULL);
13788 : see if sched_yield exists
13789 set try -DSCHED_YIELD
13790 if eval $compile; then
13792 sched_yield='sched_yield()'
13796 case "$usethreads" in
13799 $define) echo 'sched_yield() found.' >&4 ;;
13800 *) echo 'sched_yield() NOT found.' >&4 ;;
13806 : see if pthread_yield exists
13807 set try -DPTHREAD_YIELD
13808 if eval $compile; then
13810 case "$sched_yield" in
13811 '') sched_yield='pthread_yield()' ;;
13814 set try -DPTHREAD_YIELD_NULL
13815 if eval $compile; then
13817 case "$sched_yield" in
13818 '') sched_yield='pthread_yield(NULL)' ;;
13824 case "$usethreads" in
13827 $define) echo 'pthread_yield() found.' >&4 ;;
13828 *) echo 'pthread_yield() NOT found.' >&4 ;;
13832 set d_pthread_yield
13835 case "$sched_yield" in
13836 '') sched_yield=undef ;;
13841 : see if random_r exists
13842 set random_r d_random_r
13844 case "$d_random_r" in
13846 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
13847 case "$d_random_r_proto:$usethreads" in
13848 ":define") d_random_r_proto=define
13849 set d_random_r_proto random_r $hdrs
13853 case "$d_random_r_proto" in
13855 case "$random_r_proto" in
13856 ''|0) try='int random_r(int*, struct random_data*);'
13857 ./protochk "extern $try" $hdrs && random_r_proto=I_TS ;;
13859 case "$random_r_proto" in
13860 ''|0) d_random_r=undef
13862 echo "Disabling random_r, cannot determine prototype." >&4 ;;
13863 * ) case "$random_r_proto" in
13864 REENTRANT_PROTO*) ;;
13865 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
13867 echo "Prototype: $try" ;;
13870 *) case "$usethreads" in
13871 define) echo "random_r has no prototype, not using it." >&4 ;;
13878 *) random_r_proto=0
13882 : see if readdir and friends exist
13883 set readdir d_readdir
13885 set seekdir d_seekdir
13887 set telldir d_telldir
13889 set rewinddir d_rewinddir
13892 : see if readdir64_r exists
13893 set readdir64_r d_readdir64_r
13895 case "$d_readdir64_r" in
13897 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
13898 case "$d_readdir64_r_proto:$usethreads" in
13899 ":define") d_readdir64_r_proto=define
13900 set d_readdir64_r_proto readdir64_r $hdrs
13904 case "$d_readdir64_r_proto" in
13906 case "$readdir64_r_proto" in
13907 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
13908 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
13910 case "$readdir64_r_proto" in
13911 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
13912 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
13914 case "$readdir64_r_proto" in
13915 ''|0) d_readdir64_r=undef
13916 readdir64_r_proto=0
13917 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
13918 * ) case "$readdir64_r_proto" in
13919 REENTRANT_PROTO*) ;;
13920 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
13922 echo "Prototype: $try" ;;
13925 *) case "$usethreads" in
13926 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
13928 d_readdir64_r=undef
13929 readdir64_r_proto=0
13933 *) readdir64_r_proto=0
13937 : see if readdir_r exists
13938 set readdir_r d_readdir_r
13940 case "$d_readdir_r" in
13942 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
13943 case "$d_readdir_r_proto:$usethreads" in
13944 ":define") d_readdir_r_proto=define
13945 set d_readdir_r_proto readdir_r $hdrs
13949 case "$d_readdir_r_proto" in
13951 case "$readdir_r_proto" in
13952 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
13953 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
13955 case "$readdir_r_proto" in
13956 ''|0) try='int readdir_r(DIR*, struct dirent*);'
13957 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
13959 case "$readdir_r_proto" in
13960 ''|0) d_readdir_r=undef
13962 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
13963 * ) case "$readdir_r_proto" in
13964 REENTRANT_PROTO*) ;;
13965 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
13967 echo "Prototype: $try" ;;
13970 *) case "$usethreads" in
13971 define) echo "readdir_r has no prototype, not using it." >&4 ;;
13978 *) readdir_r_proto=0
13982 : see if readv exists
13986 : see if recvmsg exists
13987 set recvmsg d_recvmsg
13990 : see if rename exists
13991 set rename d_rename
13994 : see if rmdir exists
13998 : see if memory.h is available.
14003 : See if it conflicts with string.h
14009 $cppstdin $cppflags $cppminus < $strings > mem.h
14010 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
14012 echo "We won't be including <memory.h>."
14022 : can bcopy handle overlapping blocks?
14025 case "$d_memmove" in
14026 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
14027 *) case "$d_bcopy" in
14029 echo "Checking to see if bcopy() can do overlapping copies..." >&4
14031 #$i_memory I_MEMORY
14032 #$i_stdlib I_STDLIB
14033 #$i_string I_STRING
14034 #$i_unistd I_UNISTD
14036 $cat >>try.c <<'EOCP'
14039 # include <memory.h>
14042 # include <stdlib.h>
14045 # include <string.h>
14047 # include <strings.h>
14050 # include <unistd.h> /* Needed for NetBSD */
14054 char buf[128], abc[128];
14060 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14061 try to store the string in read-only memory. */
14062 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
14064 for (align = 7; align >= 0; align--) {
14065 for (len = 36; len; len--) {
14067 bcopy(abc, b, len);
14068 for (off = 1; off <= len; off++) {
14069 bcopy(b, b+off, len);
14070 bcopy(b+off, b, len);
14071 if (bcmp(b, abc, len))
14080 if eval $compile_ok; then
14081 if ./try 2>/dev/null; then
14082 echo "Yes, it can."
14085 echo "It can't, sorry."
14088 echo "(I can't compile the test program, so we'll assume not...)"
14092 $rm -f try.* try core
14098 : can memcpy handle overlapping blocks?
14101 case "$d_memmove" in
14102 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
14103 *) case "$d_memcpy" in
14105 echo "Checking to see if memcpy() can do overlapping copies..." >&4
14107 #$i_memory I_MEMORY
14108 #$i_stdlib I_STDLIB
14109 #$i_string I_STRING
14110 #$i_unistd I_UNISTD
14112 $cat >>try.c <<'EOCP'
14115 # include <memory.h>
14118 # include <stdlib.h>
14121 # include <string.h>
14123 # include <strings.h>
14126 # include <unistd.h> /* Needed for NetBSD */
14130 char buf[128], abc[128];
14136 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14137 try to store the string in read-only memory. */
14138 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
14140 for (align = 7; align >= 0; align--) {
14141 for (len = 36; len; len--) {
14143 memcpy(b, abc, len);
14144 for (off = 1; off <= len; off++) {
14145 memcpy(b+off, b, len);
14146 memcpy(b, b+off, len);
14147 if (memcmp(b, abc, len))
14156 if eval $compile_ok; then
14157 if ./try 2>/dev/null; then
14158 echo "Yes, it can."
14161 echo "It can't, sorry."
14164 echo "(I can't compile the test program, so we'll assume not...)"
14168 $rm -f try.* try core
14174 : can memcmp be trusted to compare relative magnitude?
14176 case "$d_memcmp" in
14179 echo "Checking if your memcmp() can compare relative magnitude..." >&4
14181 #$i_memory I_MEMORY
14182 #$i_stdlib I_STDLIB
14183 #$i_string I_STRING
14184 #$i_unistd I_UNISTD
14186 $cat >>try.c <<'EOCP'
14189 # include <memory.h>
14192 # include <stdlib.h>
14195 # include <string.h>
14197 # include <strings.h>
14200 # include <unistd.h> /* Needed for NetBSD */
14206 if ((a < b) && memcmp(&a, &b, 1) < 0)
14212 if eval $compile_ok; then
14213 if $run ./try 2>/dev/null; then
14214 echo "Yes, it can."
14217 echo "No, it can't (it uses signed chars)."
14220 echo "(I can't compile the test program, so we'll assume not...)"
14224 $rm -f try.* try core
14228 : see if prototype for sbrk is available
14230 set d_sbrkproto sbrk $i_unistd unistd.h
14233 : see if select exists
14234 set select d_select
14237 : see if semctl exists
14238 set semctl d_semctl
14241 : see if semget exists
14242 set semget d_semget
14245 : see if semop exists
14249 : see how much of the 'sem*(2)' library is present.
14252 case "$d_semctl$d_semget$d_semop" in
14253 *"$undef"*) h_sem=false;;
14257 case "`ipcs 2>&1`" in
14258 "SVID messages"*"not configured"*)
14259 echo "Your $osname does not have the sem*(2) configured." >&4
14262 set semctl d_semctl
14264 set semget d_semget
14272 : we could also check for sys/ipc.h ...
14273 if $h_sem && $test `./findhdr sys/sem.h`; then
14274 echo "You have the full sem*(2) library." >&4
14277 echo "You don't have the full sem*(2) library." >&4
14283 : see whether sys/sem.h defines union semun
14285 $cat > try.c <<'END'
14286 #include <sys/types.h>
14287 #include <sys/ipc.h>
14288 #include <sys/sem.h>
14289 int main () { union semun semun; semun.buf = 0; }
14292 if eval $compile; then
14293 echo "You have union semun in <sys/sem.h>." >&4
14296 echo "You do not have union semun in <sys/sem.h>." >&4
14299 $rm -f try try.c try.h
14303 : see how to do semctl IPC_STAT
14306 : see whether semctl IPC_STAT can use union semun
14311 # define S_IRUSR S_IREAD
14312 # define S_IWUSR S_IWRITE
14313 # define S_IXUSR S_IEXEC
14315 # define S_IRUSR 0400
14316 # define S_IWUSR 0200
14317 # define S_IXUSR 0100
14319 # define S_IRGRP (S_IRUSR>>3)
14320 # define S_IWGRP (S_IWUSR>>3)
14321 # define S_IXGRP (S_IXUSR>>3)
14322 # define S_IROTH (S_IRUSR>>6)
14323 # define S_IWOTH (S_IWUSR>>6)
14324 # define S_IXOTH (S_IXUSR>>6)
14327 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
14328 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
14329 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
14334 #include <sys/types.h>
14335 #include <sys/ipc.h>
14336 #include <sys/sem.h>
14337 #include <sys/stat.h>
14344 #$d_union_semun HAS_UNION_SEMUN
14347 #ifndef HAS_UNION_SEMUN
14350 struct semid_ds *buf;
14351 unsigned short *array;
14357 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14358 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14360 struct semid_ds argbuf;
14363 st = semctl(sem, 0, IPC_STAT, arg);
14367 # endif /* IPC_STAT */
14368 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14370 if (semctl(sem, 0, IPC_RMID, arg) != 0)
14371 # endif /* IPC_RMID */
14372 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14374 #endif /* IPC_PRIVATE && ... */
14375 printf("semget failed: errno = %d\n", errno);
14381 if eval $compile; then
14384 semun) val="$define" ;;
14390 case "$d_semctl_semun" in
14392 echo "You can use union semun for semctl IPC_STAT." >&4
14395 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
14400 : see whether semctl IPC_STAT can use struct semid_ds pointer
14401 $cat > try.c <<'END'
14402 #include <sys/types.h>
14403 #include <sys/ipc.h>
14404 #include <sys/sem.h>
14405 #include <sys/stat.h>
14413 struct semid_ds arg;
14416 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14417 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14420 st = semctl(sem, 0, IPC_STAT, &arg);
14422 printf("semid_ds\n");
14424 # endif /* IPC_STAT */
14425 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14427 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
14428 # endif /* IPC_RMID */
14429 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14431 #endif /* IPC_PRIVATE && ... */
14432 printf("semget failed: errno = %d\n", errno);
14439 if eval $compile; then
14442 semid_ds) val="$define" ;;
14446 set d_semctl_semid_ds
14448 case "$d_semctl_semid_ds" in
14450 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
14452 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
14459 # We do not have the full sem*(2) library, so assume we can not
14465 set d_semctl_semid_ds
14470 : see if sendmsg exists
14471 set sendmsg d_sendmsg
14474 : see if setegid exists
14475 set setegid d_setegid
14478 : see if seteuid exists
14479 set seteuid d_seteuid
14482 : see if setgrent exists
14483 set setgrent d_setgrent
14486 : see if setgrent_r exists
14487 set setgrent_r d_setgrent_r
14489 case "$d_setgrent_r" in
14491 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14492 case "$d_setgrent_r_proto:$usethreads" in
14493 ":define") d_setgrent_r_proto=define
14494 set d_setgrent_r_proto setgrent_r $hdrs
14498 case "$d_setgrent_r_proto" in
14500 case "$setgrent_r_proto" in
14501 ''|0) try='int setgrent_r(FILE**);'
14502 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
14504 case "$setgrent_r_proto" in
14505 ''|0) try='void setgrent_r(FILE**);'
14506 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
14508 case "$setgrent_r_proto" in
14509 ''|0) d_setgrent_r=undef
14511 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
14512 * ) case "$setgrent_r_proto" in
14513 REENTRANT_PROTO*) ;;
14514 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
14516 echo "Prototype: $try" ;;
14519 *) case "$usethreads" in
14520 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
14527 *) setgrent_r_proto=0
14531 : see if sethostent exists
14532 set sethostent d_sethent
14535 : see if sethostent_r exists
14536 set sethostent_r d_sethostent_r
14538 case "$d_sethostent_r" in
14540 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14541 case "$d_sethostent_r_proto:$usethreads" in
14542 ":define") d_sethostent_r_proto=define
14543 set d_sethostent_r_proto sethostent_r $hdrs
14547 case "$d_sethostent_r_proto" in
14549 case "$sethostent_r_proto" in
14550 ''|0) try='int sethostent_r(int, struct hostent_data*);'
14551 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
14553 case "$sethostent_r_proto" in
14554 ''|0) try='void sethostent_r(int, struct hostent_data*);'
14555 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
14557 case "$sethostent_r_proto" in
14558 ''|0) d_sethostent_r=undef
14559 sethostent_r_proto=0
14560 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
14561 * ) case "$sethostent_r_proto" in
14562 REENTRANT_PROTO*) ;;
14563 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
14565 echo "Prototype: $try" ;;
14568 *) case "$usethreads" in
14569 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
14571 d_sethostent_r=undef
14572 sethostent_r_proto=0
14576 *) sethostent_r_proto=0
14580 : see if setitimer exists
14581 set setitimer d_setitimer
14584 : see if setlinebuf exists
14585 set setlinebuf d_setlinebuf
14588 : see if setlocale exists
14589 set setlocale d_setlocale
14592 : see if locale.h is available
14593 set locale.h i_locale
14596 : see if setlocale_r exists
14597 set setlocale_r d_setlocale_r
14599 case "$d_setlocale_r" in
14601 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
14602 case "$d_setlocale_r_proto:$usethreads" in
14603 ":define") d_setlocale_r_proto=define
14604 set d_setlocale_r_proto setlocale_r $hdrs
14608 case "$d_setlocale_r_proto" in
14610 case "$setlocale_r_proto" in
14611 ''|0) try='int setlocale_r(int, const char*, char*, int);'
14612 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
14614 case "$setlocale_r_proto" in
14615 ''|0) d_setlocale_r=undef
14616 setlocale_r_proto=0
14617 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
14618 * ) case "$setlocale_r_proto" in
14619 REENTRANT_PROTO*) ;;
14620 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
14622 echo "Prototype: $try" ;;
14625 *) case "$usethreads" in
14626 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
14628 d_setlocale_r=undef
14629 setlocale_r_proto=0
14633 *) setlocale_r_proto=0
14637 : see if setnetent exists
14638 set setnetent d_setnent
14641 : see if setnetent_r exists
14642 set setnetent_r d_setnetent_r
14644 case "$d_setnetent_r" in
14646 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14647 case "$d_setnetent_r_proto:$usethreads" in
14648 ":define") d_setnetent_r_proto=define
14649 set d_setnetent_r_proto setnetent_r $hdrs
14653 case "$d_setnetent_r_proto" in
14655 case "$setnetent_r_proto" in
14656 ''|0) try='int setnetent_r(int, struct netent_data*);'
14657 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
14659 case "$setnetent_r_proto" in
14660 ''|0) try='void setnetent_r(int, struct netent_data*);'
14661 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
14663 case "$setnetent_r_proto" in
14664 ''|0) d_setnetent_r=undef
14665 setnetent_r_proto=0
14666 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
14667 * ) case "$setnetent_r_proto" in
14668 REENTRANT_PROTO*) ;;
14669 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
14671 echo "Prototype: $try" ;;
14674 *) case "$usethreads" in
14675 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
14677 d_setnetent_r=undef
14678 setnetent_r_proto=0
14682 *) setnetent_r_proto=0
14686 : see if setprotoent exists
14687 set setprotoent d_setpent
14690 : see if setpgid exists
14691 set setpgid d_setpgid
14694 : see if setpgrp2 exists
14695 set setpgrp2 d_setpgrp2
14698 : see if setpriority exists
14699 set setpriority d_setprior
14702 : see if setproctitle exists
14703 set setproctitle d_setproctitle
14706 : see if setprotoent_r exists
14707 set setprotoent_r d_setprotoent_r
14709 case "$d_setprotoent_r" in
14711 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14712 case "$d_setprotoent_r_proto:$usethreads" in
14713 ":define") d_setprotoent_r_proto=define
14714 set d_setprotoent_r_proto setprotoent_r $hdrs
14718 case "$d_setprotoent_r_proto" in
14720 case "$setprotoent_r_proto" in
14721 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
14722 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
14724 case "$setprotoent_r_proto" in
14725 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
14726 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
14728 case "$setprotoent_r_proto" in
14729 ''|0) d_setprotoent_r=undef
14730 setprotoent_r_proto=0
14731 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
14732 * ) case "$setprotoent_r_proto" in
14733 REENTRANT_PROTO*) ;;
14734 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
14736 echo "Prototype: $try" ;;
14739 *) case "$usethreads" in
14740 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
14742 d_setprotoent_r=undef
14743 setprotoent_r_proto=0
14747 *) setprotoent_r_proto=0
14751 : see if setpwent exists
14752 set setpwent d_setpwent
14755 : see if setpwent_r exists
14756 set setpwent_r d_setpwent_r
14758 case "$d_setpwent_r" in
14760 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14761 case "$d_setpwent_r_proto:$usethreads" in
14762 ":define") d_setpwent_r_proto=define
14763 set d_setpwent_r_proto setpwent_r $hdrs
14767 case "$d_setpwent_r_proto" in
14769 case "$setpwent_r_proto" in
14770 ''|0) try='int setpwent_r(FILE**);'
14771 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
14773 case "$setpwent_r_proto" in
14774 ''|0) try='void setpwent_r(FILE**);'
14775 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
14777 case "$setpwent_r_proto" in
14778 ''|0) d_setpwent_r=undef
14780 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
14781 * ) case "$setpwent_r_proto" in
14782 REENTRANT_PROTO*) ;;
14783 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
14785 echo "Prototype: $try" ;;
14788 *) case "$usethreads" in
14789 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
14796 *) setpwent_r_proto=0
14800 : see if setregid exists
14801 set setregid d_setregid
14803 set setresgid d_setresgid
14806 : see if setreuid exists
14807 set setreuid d_setreuid
14809 set setresuid d_setresuid
14812 : see if setrgid exists
14813 set setrgid d_setrgid
14816 : see if setruid exists
14817 set setruid d_setruid
14820 : see if setservent exists
14821 set setservent d_setsent
14824 : see if setservent_r exists
14825 set setservent_r d_setservent_r
14827 case "$d_setservent_r" in
14829 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14830 case "$d_setservent_r_proto:$usethreads" in
14831 ":define") d_setservent_r_proto=define
14832 set d_setservent_r_proto setservent_r $hdrs
14836 case "$d_setservent_r_proto" in
14838 case "$setservent_r_proto" in
14839 ''|0) try='int setservent_r(int, struct servent_data*);'
14840 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
14842 case "$setservent_r_proto" in
14843 ''|0) try='void setservent_r(int, struct servent_data*);'
14844 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
14846 case "$setservent_r_proto" in
14847 ''|0) d_setservent_r=undef
14848 setservent_r_proto=0
14849 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
14850 * ) case "$setservent_r_proto" in
14851 REENTRANT_PROTO*) ;;
14852 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
14854 echo "Prototype: $try" ;;
14857 *) case "$usethreads" in
14858 define) echo "setservent_r has no prototype, not using it." >&4 ;;
14860 d_setservent_r=undef
14861 setservent_r_proto=0
14865 *) setservent_r_proto=0
14869 : see if setsid exists
14870 set setsid d_setsid
14873 : see if setvbuf exists
14874 set setvbuf d_setvbuf
14877 : see if sfio.h is available
14882 : see if sfio library is available
14893 : Ok, but do we want to use it.
14897 true|$define|[yY]*) dflt='y';;
14900 echo "$package can use the sfio library, but it is experimental."
14901 case "$useperlio" in
14903 echo "For sfio also the PerlIO abstraction layer is needed."
14904 echo "Earlier you said you wouldn't want that."
14907 rp="You seem to have sfio available, do you want to try using it?"
14910 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
14911 useperlio="$define"
14914 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
14919 *) case "$usesfio" in
14920 true|$define|[yY]*)
14921 echo "Sorry, cannot find sfio on this machine." >&4
14922 echo "Ignoring your setting of usesfio=$usesfio." >&4
14931 $define) usesfio='true';;
14932 *) usesfio='false';;
14936 *) : Remove sfio from list of libraries to use
14939 echo "Removing unneeded -lsfio from library list" >&4
14940 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
14943 echo "libs = $libs" >&4
14950 : see if shmctl exists
14951 set shmctl d_shmctl
14954 : see if shmget exists
14955 set shmget d_shmget
14958 : see if shmat exists
14961 : see what shmat returns
14964 $cat >shmat.c <<'END'
14965 #include <sys/shm.h>
14968 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
14973 echo "and it returns ($shmattype)." >&4
14974 : see if a prototype for shmat is available
14975 xxx=`./findhdr sys/shm.h`
14976 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
14977 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
14988 set d_shmatprototype
14991 : see if shmdt exists
14995 : see how much of the 'shm*(2)' library is present.
14998 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
14999 *"$undef"*) h_shm=false;;
15003 case "`ipcs 2>&1`" in
15004 "SVID shared memory"*"not configured"*)
15005 echo "Your $osname does not have the shm*(2) configured." >&4
15008 set shmctl d_shmctl
15010 set shmget d_shmget
15020 : we could also check for sys/ipc.h ...
15021 if $h_shm && $test `./findhdr sys/shm.h`; then
15022 echo "You have the full shm*(2) library." >&4
15025 echo "You don't have the full shm*(2) library." >&4
15032 : see if we have sigaction
15033 if set sigaction val -f d_sigaction; eval $csym; $val; then
15034 echo 'sigaction() found.' >&4
15035 $cat > try.c <<'EOP'
15037 #include <sys/types.h>
15038 #include <signal.h>
15041 struct sigaction act, oact;
15043 oact.sa_handler = 0;
15044 /* so that act and oact are used */
15045 exit(act.sa_flags == 0 && oact.sa_handler == 0);
15049 if eval $compile_ok; then
15052 echo "But you don't seem to have a useable struct sigaction." >&4
15056 echo 'sigaction NOT found.' >&4
15059 set d_sigaction; eval $setvar
15060 $rm -f try try$_o try.c
15062 : see if sigprocmask exists
15063 set sigprocmask d_sigprocmask
15066 : see if sigsetjmp exists
15068 case "$d_sigsetjmp" in
15070 $cat >try.c <<'EOP'
15071 #include <setjmp.h>
15076 if (sigsetjmp(env,1))
15079 siglongjmp(env, 1);
15084 if eval $compile; then
15085 if $run ./try >/dev/null 2>&1; then
15086 echo "POSIX sigsetjmp found." >&4
15090 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
15096 echo "sigsetjmp not found." >&4
15100 *) val="$d_sigsetjmp"
15101 case "$d_sigsetjmp" in
15102 $define) echo "POSIX sigsetjmp found." >&4;;
15103 $undef) echo "sigsetjmp not found." >&4;;
15111 : see if sockatmark exists
15112 set sockatmark d_sockatmark
15115 : see if prototype for sockatmark is available
15117 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
15120 : see if socks5_init exists
15121 set socks5_init d_socks5_init
15124 : see if srand48_r exists
15125 set srand48_r d_srand48_r
15127 case "$d_srand48_r" in
15129 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15130 case "$d_srand48_r_proto:$usethreads" in
15131 ":define") d_srand48_r_proto=define
15132 set d_srand48_r_proto srand48_r $hdrs
15136 case "$d_srand48_r_proto" in
15138 case "$srand48_r_proto" in
15139 ''|0) try='int srand48_r(long, struct drand48_data*);'
15140 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
15142 case "$srand48_r_proto" in
15143 ''|0) d_srand48_r=undef
15145 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
15146 * ) case "$srand48_r_proto" in
15147 REENTRANT_PROTO*) ;;
15148 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
15150 echo "Prototype: $try" ;;
15153 *) case "$usethreads" in
15154 define) echo "srand48_r has no prototype, not using it." >&4 ;;
15161 *) srand48_r_proto=0
15165 : see if srandom_r exists
15166 set srandom_r d_srandom_r
15168 case "$d_srandom_r" in
15170 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15171 case "$d_srandom_r_proto:$usethreads" in
15172 ":define") d_srandom_r_proto=define
15173 set d_srandom_r_proto srandom_r $hdrs
15177 case "$d_srandom_r_proto" in
15179 case "$srandom_r_proto" in
15180 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
15181 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
15183 case "$srandom_r_proto" in
15184 ''|0) d_srandom_r=undef
15186 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
15187 * ) case "$srandom_r_proto" in
15188 REENTRANT_PROTO*) ;;
15189 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
15191 echo "Prototype: $try" ;;
15194 *) case "$usethreads" in
15195 define) echo "srandom_r has no prototype, not using it." >&4 ;;
15202 *) srandom_r_proto=0
15206 : see if prototype for setresgid is available
15208 set d_sresgproto setresgid $i_unistd unistd.h
15211 : see if prototype for setresuid is available
15213 set d_sresuproto setresuid $i_unistd unistd.h
15216 : see if sys/stat.h is available
15217 set sys/stat.h i_sysstat
15221 : see if stat knows about block sizes
15223 echo "Checking to see if your struct stat has st_blocks field..." >&4
15224 set d_statblks stat st_blocks $i_sysstat sys/stat.h
15228 : see if this is a sys/vfs.h system
15229 set sys/vfs.h i_sysvfs
15233 : see if this is a sys/statfs.h system
15234 set sys/statfs.h i_sysstatfs
15239 echo "Checking to see if your system supports struct statfs..." >&4
15240 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
15242 case "$d_statfs_s" in
15243 "$define") echo "Yes, it does." ;;
15244 *) echo "No, it doesn't." ;;
15249 : see if struct statfs knows about f_flags
15250 case "$d_statfs_s" in
15253 echo "Checking to see if your struct statfs has f_flags field..." >&4
15254 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
15258 set d_statfs_f_flags
15262 case "$d_statfs_f_flags" in
15263 "$define") echo "Yes, it does." ;;
15264 *) echo "No, it doesn't." ;;
15267 : see if _ptr and _cnt from stdio act std
15270 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
15271 echo "(Looks like you have stdio.h from BSD.)"
15272 case "$stdio_ptr" in
15273 '') stdio_ptr='((fp)->_p)'
15276 *) ptr_lval=$d_stdio_ptr_lval;;
15278 case "$stdio_cnt" in
15279 '') stdio_cnt='((fp)->_r)'
15282 *) cnt_lval=$d_stdio_cnt_lval;;
15284 case "$stdio_base" in
15285 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
15287 case "$stdio_bufsiz" in
15288 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
15290 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
15291 echo "(Looks like you have stdio.h from Linux.)"
15292 case "$stdio_ptr" in
15293 '') stdio_ptr='((fp)->_IO_read_ptr)'
15296 *) ptr_lval=$d_stdio_ptr_lval;;
15298 case "$stdio_cnt" in
15299 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
15302 *) cnt_lval=$d_stdio_cnt_lval;;
15304 case "$stdio_base" in
15305 '') stdio_base='((fp)->_IO_read_base)';;
15307 case "$stdio_bufsiz" in
15308 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
15311 case "$stdio_ptr" in
15312 '') stdio_ptr='((fp)->_ptr)'
15315 *) ptr_lval=$d_stdio_ptr_lval;;
15317 case "$stdio_cnt" in
15318 '') stdio_cnt='((fp)->_cnt)'
15321 *) cnt_lval=$d_stdio_cnt_lval;;
15323 case "$stdio_base" in
15324 '') stdio_base='((fp)->_base)';;
15326 case "$stdio_bufsiz" in
15327 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
15331 : test whether _ptr and _cnt really work
15332 echo "Checking how std your stdio is..." >&4
15335 #define FILE_ptr(fp) $stdio_ptr
15336 #define FILE_cnt(fp) $stdio_cnt
15338 FILE *fp = fopen("try.c", "r");
15341 18 <= FILE_cnt(fp) &&
15342 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15350 if eval $compile && $to try.c; then
15351 if $run ./try; then
15352 echo "Your stdio acts pretty std."
15355 echo "Your stdio isn't very std."
15358 echo "Your stdio doesn't appear very std."
15364 : Can _ptr be used as an lvalue?
15365 case "$d_stdstdio$ptr_lval" in
15366 $define$define) val=$define ;;
15369 set d_stdio_ptr_lval
15372 : Can _cnt be used as an lvalue?
15373 case "$d_stdstdio$cnt_lval" in
15374 $define$define) val=$define ;;
15377 set d_stdio_cnt_lval
15381 : test whether setting _ptr sets _cnt as a side effect
15382 d_stdio_ptr_lval_sets_cnt="$undef"
15383 d_stdio_ptr_lval_nochange_cnt="$undef"
15384 case "$d_stdio_ptr_lval$d_stdstdio" in
15386 echo "Checking to see what happens if we set the stdio ptr..." >&4
15389 /* Can we scream? */
15390 /* Eat dust sed :-) */
15391 /* In the buffer space, no one can hear you scream. */
15392 #define FILE_ptr(fp) $stdio_ptr
15393 #define FILE_cnt(fp) $stdio_cnt
15394 #include <sys/types.h>
15396 FILE *fp = fopen("try.c", "r");
15401 puts("Fail even to read");
15404 c = getc(fp); /* Read away the first # */
15406 puts("Fail even to read");
15410 18 <= FILE_cnt(fp) &&
15411 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15413 puts("Fail even to read");
15416 ptr = (char*) FILE_ptr(fp);
15417 cnt = (size_t)FILE_cnt(fp);
15419 FILE_ptr(fp) += 42;
15421 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
15422 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
15425 if (FILE_cnt(fp) <= 20) {
15426 printf ("Fail (<20 chars to test)");
15429 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
15430 puts("Fail compare");
15433 if (cnt == FILE_cnt(fp)) {
15434 puts("Pass_unchanged");
15437 if (FILE_cnt(fp) == (cnt - 42)) {
15438 puts("Pass_changed");
15441 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
15447 if eval $compile && $to try.c; then
15448 case `$run ./try` in
15450 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
15451 d_stdio_ptr_lval_sets_cnt="$define" ;;
15453 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
15454 d_stdio_ptr_lval_nochange_cnt="$define" ;;
15456 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
15458 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
15461 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
15467 : see if _base is also standard
15469 case "$d_stdstdio" in
15473 #define FILE_base(fp) $stdio_base
15474 #define FILE_bufsiz(fp) $stdio_bufsiz
15476 FILE *fp = fopen("try.c", "r");
15479 19 <= FILE_bufsiz(fp) &&
15480 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
15487 if eval $compile && $to try.c; then
15488 if $run ./try; then
15489 echo "And its _base field acts std."
15492 echo "But its _base field isn't std."
15495 echo "However, it seems to be lacking the _base field."
15504 Checking how to access stdio streams by file descriptor number...
15506 case "$stdio_stream_array" in
15507 '') $cat >try.c <<EOCP
15510 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
15514 for s in _iob __iob __sF
15516 set try -DSTDIO_STREAM_ARRAY=$s
15517 if eval $compile; then
15518 case "`$run ./try`" in
15519 yes) stdio_stream_array=$s; break ;;
15523 $rm -f try.* try$exe_ext
15525 case "$stdio_stream_array" in
15527 I can't figure out how to access stdio streams by file descriptor number.
15529 d_stdio_stream_array="$undef"
15532 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
15534 d_stdio_stream_array="$define"
15538 : see if strcoll exists
15539 set strcoll d_strcoll
15542 : check for structure copying
15544 echo "Checking to see if your C compiler can copy structs..." >&4
15545 $cat >try.c <<'EOCP'
15555 if $cc -c try.c >/dev/null 2>&1 ; then
15557 echo "Yup, it can."
15560 echo "Nope, it can't."
15566 : see if strerror and/or sys_errlist[] exist
15568 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
15569 if set strerror val -f d_strerror; eval $csym; $val; then
15570 echo 'strerror() found.' >&4
15571 d_strerror="$define"
15572 d_strerrm='strerror(e)'
15573 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15574 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
15575 d_syserrlst="$define"
15577 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
15578 d_syserrlst="$undef"
15580 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
15581 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
15582 echo 'strerror() found in string header.' >&4
15583 d_strerror="$define"
15584 d_strerrm='strerror(e)'
15585 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15586 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
15587 d_syserrlst="$define"
15589 echo "(You don't appear to have any sys_errlist[], how can this be?)"
15590 d_syserrlst="$undef"
15592 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15593 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
15594 d_strerror="$undef"
15595 d_syserrlst="$define"
15596 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
15598 echo 'strerror() and sys_errlist[] NOT found.' >&4
15599 d_strerror="$undef"
15600 d_syserrlst="$undef"
15601 d_strerrm='"unknown"'
15605 : see if strerror_r exists
15606 set strerror_r d_strerror_r
15608 case "$d_strerror_r" in
15610 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
15611 case "$d_strerror_r_proto:$usethreads" in
15612 ":define") d_strerror_r_proto=define
15613 set d_strerror_r_proto strerror_r $hdrs
15617 case "$d_strerror_r_proto" in
15619 case "$strerror_r_proto" in
15620 ''|0) try='int strerror_r(int, char*, size_t);'
15621 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
15623 case "$strerror_r_proto" in
15624 ''|0) try='int strerror_r(int, char*, int);'
15625 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
15627 case "$strerror_r_proto" in
15628 ''|0) try='char* strerror_r(int, char*, size_t);'
15629 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
15631 case "$strerror_r_proto" in
15632 ''|0) d_strerror_r=undef
15634 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
15635 * ) case "$strerror_r_proto" in
15636 REENTRANT_PROTO*) ;;
15637 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
15639 echo "Prototype: $try" ;;
15642 *) case "$usethreads" in
15643 define) echo "strerror_r has no prototype, not using it." >&4 ;;
15650 *) strerror_r_proto=0
15654 : see if strftime exists
15655 set strftime d_strftime
15658 : see if strtod exists
15659 set strtod d_strtod
15662 : see if strtol exists
15663 set strtol d_strtol
15666 : see if strtold exists
15667 set strtold d_strtold
15670 : see if strtoll exists
15671 set strtoll d_strtoll
15674 case "$d_longlong-$d_strtoll" in
15677 Checking whether your strtoll() works okay...
15679 $cat >try.c <<'EOCP'
15682 #define strtoll __strtoll
15685 #define strtoll _strtoll
15688 extern long long int strtoll(char *s, char **, int);
15689 static int bad = 0;
15690 int check(char *s, long long ell, int een) {
15693 gll = strtoll(s, 0, 10);
15694 if (!((gll == ell) && (errno == een)))
15698 check(" 1", 1LL, 0);
15699 check(" 0", 0LL, 0);
15700 check("-1", -1LL, 0);
15701 check("-9223372036854775808", -9223372036854775808LL, 0);
15702 check("-9223372036854775808", -9223372036854775808LL, 0);
15703 check(" 9223372036854775807", 9223372036854775807LL, 0);
15704 check("-9223372036854775808", -9223372036854775808LL, 0);
15705 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
15706 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
15712 if eval $compile; then
15715 ok) echo "Your strtoll() seems to be working okay." ;;
15717 Your strtoll() doesn't seem to be working okay.
15723 echo "(I can't seem to compile the test program--assuming it doesn't)"
15729 : see if strtoq exists
15730 set strtoq d_strtoq
15733 : see if strtoul exists
15734 set strtoul d_strtoul
15737 case "$d_strtoul" in
15740 Checking whether your strtoul() works okay...
15742 $cat >try.c <<'EOCP'
15745 extern unsigned long int strtoul(char *s, char **, int);
15746 static int bad = 0;
15747 void check(char *s, unsigned long eul, int een) {
15750 gul = strtoul(s, 0, 10);
15751 if (!((gul == eul) && (errno == een)))
15755 check(" 1", 1L, 0);
15756 check(" 0", 0L, 0);
15758 case "$longsize" in
15760 $cat >>try.c <<'EOCP'
15761 check("18446744073709551615", 18446744073709551615UL, 0);
15762 check("18446744073709551616", 18446744073709551615UL, ERANGE);
15763 #if 0 /* strtoul() for /^-/ strings is undefined. */
15764 check("-1", 18446744073709551615UL, 0);
15765 check("-18446744073709551614", 2, 0);
15766 check("-18446744073709551615", 1, 0);
15767 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
15768 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
15773 $cat >>try.c <<'EOCP'
15774 check("4294967295", 4294967295UL, 0);
15775 check("4294967296", 4294967295UL, ERANGE);
15776 #if 0 /* strtoul() for /^-/ strings is undefined. */
15777 check("-1", 4294967295UL, 0);
15778 check("-4294967294", 2, 0);
15779 check("-4294967295", 1, 0);
15780 check("-4294967296", 4294967295UL, ERANGE);
15781 check("-4294967297", 4294967295UL, ERANGE);
15786 : Should we write these tests to be more portable by sprintf-ing
15787 : ~0 and then manipulating that char string as input for strtol?
15790 $cat >>try.c <<'EOCP'
15797 if eval $compile; then
15798 case "`$run ./try`" in
15799 ok) echo "Your strtoul() seems to be working okay." ;;
15801 Your strtoul() doesn't seem to be working okay.
15810 : see if strtoull exists
15811 set strtoull d_strtoull
15814 case "$d_longlong-$d_strtoull" in
15817 Checking whether your strtoull() works okay...
15819 $cat >try.c <<'EOCP'
15822 #define strtoull __strtoull
15825 extern unsigned long long int strtoull(char *s, char **, int);
15826 static int bad = 0;
15827 int check(char *s, long long eull, int een) {
15830 gull = strtoull(s, 0, 10);
15831 if (!((gull == eull) && (errno == een)))
15835 check(" 1", 1LL, 0);
15836 check(" 0", 0LL, 0);
15837 check("18446744073709551615", 18446744073709551615ULL, 0);
15838 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
15839 #if 0 /* strtoull() for /^-/ strings is undefined. */
15840 check("-1", 18446744073709551615ULL, 0);
15841 check("-18446744073709551614", 2LL, 0);
15842 check("-18446744073709551615", 1LL, 0);
15843 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
15844 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
15851 if eval $compile; then
15852 case "`$run ./try`" in
15853 ok) echo "Your strtoull() seems to be working okay." ;;
15855 Your strtoull() doesn't seem to be working okay.
15857 d_strtoull="$undef"
15864 : see if strtouq exists
15865 set strtouq d_strtouq
15868 case "$d_strtouq" in
15871 Checking whether your strtouq() works okay...
15873 $cat >try.c <<'EOCP'
15876 extern unsigned long long int strtouq(char *s, char **, int);
15877 static int bad = 0;
15878 void check(char *s, unsigned long long eull, int een) {
15879 unsigned long long gull;
15881 gull = strtouq(s, 0, 10);
15882 if (!((gull == eull) && (errno == een)))
15886 check(" 1", 1LL, 0);
15887 check(" 0", 0LL, 0);
15888 check("18446744073709551615", 18446744073709551615ULL, 0);
15889 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
15890 #if 0 /* strtouq() for /^-/ strings is undefined. */
15891 check("-1", 18446744073709551615ULL, 0);
15892 check("-18446744073709551614", 2LL, 0);
15893 check("-18446744073709551615", 1LL, 0);
15894 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
15895 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
15903 if eval $compile; then
15904 case "`$run ./try`" in
15905 ok) echo "Your strtouq() seems to be working okay." ;;
15907 Your strtouq() doesn't seem to be working okay.
15916 : see if strxfrm exists
15917 set strxfrm d_strxfrm
15920 : see if symlink exists
15921 set symlink d_symlink
15924 : see if syscall exists
15925 set syscall d_syscall
15928 : see if prototype for syscall is available
15930 set d_syscallproto syscall $i_unistd unistd.h
15933 : see if sysconf exists
15934 set sysconf d_sysconf
15937 : see if system exists
15938 set system d_system
15941 : see if tcgetpgrp exists
15942 set tcgetpgrp d_tcgetpgrp
15945 : see if tcsetpgrp exists
15946 set tcsetpgrp d_tcsetpgrp
15949 : see if prototype for telldir is available
15951 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
15954 : see if time exists
15956 if test "X$d_time" = X -o X"$timetype" = X; then
15957 if set time val -f d_time; eval $csym; $val; then
15958 echo 'time() found.' >&4
15960 rp="What is the type returned by time() on this system?"
15961 set time_t timetype long stdio.h sys/types.h
15964 echo 'time() not found, hope that will do.' >&4
15972 : see if this is a sys/times.h system
15973 set sys/times.h i_systimes
15976 : see if times exists
15978 if set times val -f d_times; eval $csym; $val; then
15979 echo 'times() found.' >&4
15982 case "$i_systimes" in
15983 "$define") inc='sys/times.h';;
15985 rp="What is the type returned by times() on this system?"
15986 set clock_t clocktype long stdio.h sys/types.h $inc
15989 echo 'times() NOT found, hope that will do.' >&4
15994 : see if tmpnam_r exists
15995 set tmpnam_r d_tmpnam_r
15997 case "$d_tmpnam_r" in
15999 hdrs="$i_systypes sys/types.h define stdio.h "
16000 case "$d_tmpnam_r_proto:$usethreads" in
16001 ":define") d_tmpnam_r_proto=define
16002 set d_tmpnam_r_proto tmpnam_r $hdrs
16006 case "$d_tmpnam_r_proto" in
16008 case "$tmpnam_r_proto" in
16009 ''|0) try='char* tmpnam_r(char*);'
16010 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
16012 case "$tmpnam_r_proto" in
16013 ''|0) d_tmpnam_r=undef
16015 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
16016 * ) case "$tmpnam_r_proto" in
16017 REENTRANT_PROTO*) ;;
16018 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
16020 echo "Prototype: $try" ;;
16023 *) case "$usethreads" in
16024 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
16031 *) tmpnam_r_proto=0
16035 : see if truncate exists
16036 set truncate d_truncate
16039 : see if ttyname_r exists
16040 set ttyname_r d_ttyname_r
16042 case "$d_ttyname_r" in
16044 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
16045 case "$d_ttyname_r_proto:$usethreads" in
16046 ":define") d_ttyname_r_proto=define
16047 set d_ttyname_r_proto ttyname_r $hdrs
16051 case "$d_ttyname_r_proto" in
16053 case "$ttyname_r_proto" in
16054 ''|0) try='int ttyname_r(int, char*, size_t);'
16055 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
16057 case "$ttyname_r_proto" in
16058 ''|0) try='int ttyname_r(int, char*, int);'
16059 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
16061 case "$ttyname_r_proto" in
16062 ''|0) try='char* ttyname_r(int, char*, int);'
16063 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
16065 case "$ttyname_r_proto" in
16066 ''|0) d_ttyname_r=undef
16068 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
16069 * ) case "$ttyname_r_proto" in
16070 REENTRANT_PROTO*) ;;
16071 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
16073 echo "Prototype: $try" ;;
16076 *) case "$usethreads" in
16077 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
16084 *) ttyname_r_proto=0
16088 : see if tzname[] exists
16090 if set tzname val -a d_tzname; eval $csym; $val; then
16092 echo 'tzname[] found.' >&4
16095 echo 'tzname[] NOT found.' >&4
16101 next|rhapsody|darwin) multiarch="$define" ;;
16103 case "$multiarch" in
16104 ''|[nN]*) multiarch="$undef" ;;
16107 : check for ordering of bytes in a UV
16109 case "$usecrosscompile$multiarch" in
16112 You seem to be either cross-compiling or doing a multiarchitecture build,
16113 skipping the byteorder check.
16119 case "$byteorder" in
16122 In the following, larger digits indicate more significance. A big-endian
16123 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
16124 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
16125 machines may have weird orders like 3412. A Cray will report 87654321,
16126 an Alpha will report 12345678. If the test program works the default is
16128 I'm now running the test program...
16132 #include <sys/types.h>
16133 typedef $uvtype UV;
16143 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
16145 u.l = (UV)0x04030201;
16146 for (i = 0; i < $uvsize; i++)
16147 printf("%c", u.c[i]+'0');
16154 if eval $compile && ./try > /dev/null; then
16157 [1-4][1-4][1-4][1-4]|12345678|87654321)
16158 echo "(The test program ran ok.)"
16159 echo "byteorder=$dflt"
16162 ????|????????) echo "(The test program ran ok.)" ;;
16163 *) echo "(The test program didn't run right for some reason.)" ;;
16168 (I can't seem to compile the test program. Guessing big-endian...)
16171 case "$xxx_prompt" in
16173 rp="What is the order of bytes in $uvtype?"
16189 Checking to see whether you can access character data unalignedly...
16191 case "$d_u32align" in
16192 '') $cat >try.c <<EOCP
16194 #define U32 $u32type
16195 #define BYTEORDER 0x$byteorder
16197 #include <signal.h>
16199 $signal_t bletch(s) int s; { exit(4); }
16202 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
16207 if (sizeof(U32) != 4) {
16208 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
16215 signal(SIGBUS, bletch);
16227 for (i = 0; i < 4; i++) {
16228 up = (U32*)(buf + i);
16229 if (! ((*up == 1 << (8*i)) || /* big-endian */
16230 (*up == 1 << (8*(3-i))) /* little-endian */
16234 printf("read failed (%x)\n", *up);
16240 for (i = 0; i < 4; i++) {
16241 up = (U32*)(buf + i);
16243 if (*up != 0xBeef) {
16244 printf("write failed (%x)\n", *up);
16258 if eval $compile_ok; then
16259 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
16260 $run ./try 2>&1 >/dev/null
16263 You can access character data pretty unalignedly.
16265 d_u32align="$undef"
16268 It seems that you must access character data in an aligned manner.
16270 d_u32align="$define"
16274 rp='Can you access character data at unaligned addresses?'
16278 [yY]*) d_u32align="$undef" ;;
16279 *) d_u32align="$define" ;;
16282 $rm -f core core.try.* try.core
16286 : see if ualarm exists
16287 set ualarm d_ualarm
16290 : see if umask exists
16294 : see if unordered exists
16295 set unordered d_unordered
16298 : see if usleep exists
16299 set usleep d_usleep
16302 : see if prototype for usleep is available
16304 set d_usleepproto usleep $i_unistd unistd.h
16307 : see if ustat exists
16311 : backward compatibility for d_hvfork
16312 if test X$d_hvfork != X; then
16313 d_vfork="$d_hvfork"
16316 : see if there is a vfork
16321 : Ok, but do we want to use it. vfork is reportedly unreliable in
16322 : perl on Solaris 2.x, and probably elsewhere.
16326 case "$usevfork" in
16332 Perl can only use a vfork() that doesn't suffer from strict
16333 restrictions on calling functions or modifying global data in
16334 the child. For example, glibc-2.1 contains such a vfork()
16335 that is unsuitable. If your system provides a proper fork()
16336 call, chances are that you do NOT want perl to use vfork().
16339 rp="Do you still want to use vfork()?"
16344 echo "Ok, we won't use vfork()."
16353 $define) usevfork='true';;
16354 *) usevfork='false';;
16357 : see if closedir exists
16358 set closedir d_closedir
16361 case "$d_closedir" in
16364 echo "Checking whether closedir() returns a status..." >&4
16366 #$i_dirent I_DIRENT /**/
16367 #$i_sysdir I_SYS_DIR /**/
16368 #$i_sysndir I_SYS_NDIR /**/
16369 #$i_systypes I_SYS_TYPES /**/
16371 #if defined(I_SYS_TYPES)
16372 #include <sys/types.h>
16374 #if defined(I_DIRENT)
16375 #include <dirent.h>
16376 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
16377 #include <sys/dir.h>
16381 #include <sys/ndir.h>
16385 #include <ndir.h> /* may be wrong in the future */
16387 #include <sys/dir.h>
16392 int main() { return closedir(opendir(".")); }
16395 if eval $compile_ok; then
16396 if $run ./try > /dev/null 2>&1 ; then
16397 echo "Yes, it does."
16400 echo "No, it doesn't."
16404 echo "(I can't seem to compile the test program--assuming it doesn't)"
16412 set d_void_closedir
16415 : see if there is a wait4
16419 : see if waitpid exists
16420 set waitpid d_waitpid
16423 : see if wcstombs exists
16424 set wcstombs d_wcstombs
16427 : see if wctomb exists
16428 set wctomb d_wctomb
16431 : see if writev exists
16432 set writev d_writev
16435 : preserve RCS keywords in files with variable substitution, grrr
16440 Revision='$Revision'
16442 : check for alignment requirements
16444 case "$usecrosscompile$multiarch" in
16447 You seem to be either cross-compiling or doing a multiarchitecture build,
16448 skipping the memory alignment check.
16451 case "$alignbytes" in
16452 '') alignbytes=8 ;;
16456 case "$alignbytes" in
16457 '') echo "Checking alignment constraints..." >&4
16458 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
16459 $cat >try.c <<'EOCP'
16460 typedef long double NV;
16463 $cat >try.c <<'EOCP'
16467 $cat >>try.c <<'EOCP'
16475 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
16480 if eval $compile_ok; then
16484 echo "(I can't seem to compile the test program...)"
16487 *) dflt="$alignbytes"
16490 rp="Doubles must be aligned on a how-many-byte boundary?"
16498 : set the base revision
16501 : how do we catenate cpp tokens here?
16503 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
16504 $cat >cpp_stuff.c <<'EOCP'
16505 #define RCAT(a,b)a/**/b
16506 #define ACAT(a,b)a ## b
16510 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
16511 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
16512 echo "Oh! Smells like ANSI's been here." >&4
16513 echo "We can catify or stringify, separately or together!"
16515 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
16516 echo "Ah, yes! The good old days!" >&4
16517 echo "However, in the good old days we don't know how to stringify and"
16518 echo "catify at the same time."
16522 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
16523 to have to edit the values of CAT[2-5] in config.h...
16525 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
16529 : see if this is a db.h system
16535 : Check db version.
16537 echo "Checking Berkeley DB version ..." >&4
16543 #include <sys/types.h>
16546 int main(int argc, char *argv[])
16548 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
16549 int Major, Minor, Patch ;
16550 unsigned long Version ;
16551 (void)db_version(&Major, &Minor, &Patch) ;
16553 printf("%d %d %d %d %d %d\n",
16554 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
16555 Major, Minor, Patch);
16558 printf("You have Berkeley DB Version 2 or greater.\n");
16560 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
16561 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
16562 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
16563 Major, Minor, Patch) ;
16565 /* check that db.h & libdb are compatible */
16566 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
16567 printf("db.h and libdb are incompatible.\n") ;
16571 printf("db.h and libdb are compatible.\n") ;
16573 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
16574 + DB_VERSION_PATCH ;
16576 /* needs to be >= 2.3.4 */
16577 if (Version < 2003004) {
16578 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
16579 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
16585 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
16590 printf("You have Berkeley DB Version 1.\n");
16591 exit(0); /* DB version < 2: the coast is clear. */
16593 exit(1); /* <db.h> not Berkeley DB? */
16599 if eval $compile_ok && $run ./try; then
16600 echo 'Looks OK.' >&4
16602 db_version_major=$1
16603 db_version_minor=$2
16604 db_version_patch=$3
16606 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
16610 : Remove db from list of libraries to use
16611 echo "Removing unusable -ldb from library list" >&4
16612 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
16615 echo "libs = $libs" >&4
16625 : Check the return type needed for hash
16627 echo "Checking return type needed for hash for Berkeley DB ..." >&4
16633 #include <sys/types.h>
16636 #ifndef DB_VERSION_MAJOR
16637 u_int32_t hash_cb (ptr, size)
16645 info.hash = hash_cb;
16649 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16650 if $contains warning try.out >>/dev/null 2>&1 ; then
16653 db_hashtype='u_int32_t'
16656 : XXX Maybe we should just give up here.
16657 db_hashtype=u_int32_t
16659 echo "Help: I can't seem to compile the db test program." >&4
16660 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
16663 echo "Your version of Berkeley DB uses $db_hashtype for hash."
16665 *) db_hashtype=u_int32_t
16670 : Check the return type needed for prefix
16672 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
16678 #include <sys/types.h>
16681 #ifndef DB_VERSION_MAJOR
16682 size_t prefix_cb (key1, key2)
16690 info.prefix = prefix_cb;
16694 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16695 if $contains warning try.out >>/dev/null 2>&1 ; then
16696 db_prefixtype='int'
16698 db_prefixtype='size_t'
16701 db_prefixtype='size_t'
16702 : XXX Maybe we should just give up here.
16704 echo "Help: I can't seem to compile the db test program." >&4
16705 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
16708 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
16710 *) db_prefixtype='size_t'
16715 : How can we generate normalized random numbers ?
16717 echo "Looking for a random number function..." >&4
16718 case "$randfunc" in
16720 if set drand48 val -f; eval $csym; $val; then
16722 echo "Good, found drand48()." >&4
16723 elif set random val -f; eval $csym; $val; then
16725 echo "OK, found random()." >&4
16728 echo "Yick, looks like I have to use rand()." >&4
16739 *-Dmy_rand=*|*-Dmy_srand=*)
16740 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
16741 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
16742 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
16743 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
16747 while $test "$cont"; do
16748 rp="Use which function to generate random numbers?"
16750 if $test "$ans" = "$dflt"; then
16756 if set $ans val -f; eval $csym; $val; then
16760 rp="I cannot find function $ans. Use that name anyway?"
16769 case "$randfunc" in
16771 drand01="drand48()"
16777 case "$randbits" in
16779 echo "Checking to see how many bits your $randfunc() function produces..." >&4
16781 #$i_unistd I_UNISTD
16782 #$i_stdlib I_STDLIB
16785 # include <unistd.h>
16788 # include <stdlib.h>
16793 register unsigned long tmp;
16794 register unsigned long max = 0L;
16796 for (i = 1000; i; i--) {
16797 tmp = (unsigned long) $randfunc();
16798 if (tmp > max) max = tmp;
16800 for (i = 0; max; i++)
16806 if eval $compile_ok; then
16810 echo "(I can't seem to compile the test program...)"
16817 rp="How many bits does your $randfunc() function produce?"
16821 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
16822 seedfunc="s$randfunc"
16823 randseedtype=unsigned
16827 rp="How many bits does your $randfunc() function produce?"
16830 seedfunc="s$randfunc"
16831 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
16832 if set $seedfunc val -f; eval $csym; $val; then
16833 echo "(Using $seedfunc() to seed random generator)"
16835 echo "(Warning: no $seedfunc() to seed random generator)"
16838 randseedtype=unsigned
16846 echo "Determining whether or not we are on an EBCDIC system..." >&4
16847 $cat >try.c <<'EOM'
16850 if ('M'==0xd4) return 0;
16857 if eval $compile_ok; then
16858 if $run ./try; then
16859 echo "You seem to speak EBCDIC." >&4
16862 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
16865 echo "I'm unable to compile the test program." >&4
16866 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
16874 Checking how to flush all pending stdio output...
16876 # I only know how to find the first 32 possibly open files on SunOS.
16877 # See also hints/sunos_4_1.sh and util.c --AD
16879 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
16881 $cat >>try.c <<EOCP
16883 #$i_unistd I_UNISTD
16885 # include <unistd.h>
16887 #$d_sysconf HAS_SYSCONF
16888 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
16889 #ifdef HAS_STDIO_STREAM_ARRAY
16890 # define STDIO_STREAM_ARRAY $stdio_stream_array
16895 p = fopen("try.out", "w");
16899 # ifdef TRY_FPRINTF
16903 #ifdef TRY_FFLUSH_NULL
16906 #ifdef TRY_FFLUSH_ALL
16908 long open_max = -1;
16909 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
16910 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
16912 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
16913 open_max = sysconf(_SC_OPEN_MAX);
16916 open_max = FOPEN_MAX;
16919 open_max = OPEN_MAX;
16928 # ifdef HAS_STDIO_STREAM_ARRAY
16929 if (open_max > 0) {
16931 for (i = 0; i < open_max; i++)
16932 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
16933 STDIO_STREAM_ARRAY[i]._file < open_max &&
16934 STDIO_STREAM_ARRAY[i]._flag)
16935 fflush(&STDIO_STREAM_ARRAY[i]);
16943 : first we have to find out how _not_ to flush
16945 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
16947 set try -DTRY_FPUTC
16948 if eval $compile; then
16949 $run ./try 2>/dev/null
16952 if $test ! -s try.out -a "X$code" = X42; then
16958 set try -DTRY_FPRINTF
16959 if eval $compile; then
16960 $run ./try 2>/dev/null
16963 if $test ! -s try.out -a "X$code" = X42; then
16964 output=-DTRY_FPRINTF
16970 : check for fflush NULL behaviour
16971 case "$fflushNULL" in
16972 '') set try -DTRY_FFLUSH_NULL $output
16973 if eval $compile; then
16974 $run ./try 2>/dev/null
16977 if $test -s try.out -a "X$code" = X42; then
16978 fflushNULL="`$cat try.out`"
16980 if $test "X$code" != X42; then
16982 (If this test failed, don't worry, we'll try another method shortly.)
16987 $rm -f core try.core core.try.*
16988 case "$fflushNULL" in
16990 Your fflush(NULL) works okay for output streams.
16991 Let's see if it clobbers input pipes...
16993 # As of mid-March 2000 all versions of Solaris appear to have a stdio
16994 # bug that improperly flushes the input end of pipes. So we avoid the
16995 # autoflush on fork/system/exec support for now. :-(
16996 $cat >tryp.c <<EOCP
16999 main(int argc, char **argv)
17005 while ((i = getc(stdin)) != -1
17006 && (*bp++ = i) != '\n'
17007 && bp < &buf[1024])
17010 fprintf(stdout, "%s", buf);
17018 fflushNULL="$define"
17020 if eval $compile; then
17022 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17023 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17025 fflush(NULL) seems to behave okay with input streams.
17027 fflushNULL="$define"
17030 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
17032 fflushNULL="$undef"
17035 $rm -f core tryp.c tryp.core core.tryp.*
17038 Your fflush(NULL) isn't working (contrary to ANSI C).
17040 fflushNULL="$undef"
17043 Cannot figure out whether your fflush(NULL) works or not.
17044 I'm assuming it doesn't (contrary to ANSI C).
17046 fflushNULL="$undef"
17050 $define|true|[yY]*)
17051 fflushNULL="$define"
17054 fflushNULL="$undef"
17057 : check explicit looping only if NULL did not work, and if the pipe
17058 : bug does not show up on an explicit flush too
17059 case "$fflushNULL" in
17061 $cat >tryp.c <<EOCP
17064 main(int argc, char **argv)
17070 while ((i = getc(stdin)) != -1
17071 && (*bp++ = i) != '\n'
17072 && bp < &buf[1024])
17075 fprintf(stdout, "%s", buf);
17084 if eval $compile; then
17086 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17087 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17089 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
17091 : now check for fflushall behaviour
17092 case "$fflushall" in
17093 '') set try -DTRY_FFLUSH_ALL $output
17094 if eval $compile; then
17096 (Now testing the other method--but note that this also may fail.)
17098 $run ./try 2>/dev/null
17101 if $test -s try.out -a "X$code" = X42; then
17102 fflushall="`$cat try.out`"
17105 $rm -f core try.core core.try.*
17106 case "$fflushall" in
17108 Whew. Flushing explicitly all the stdio streams works.
17110 fflushall="$define"
17113 Sigh. Flushing explicitly all the stdio streams doesn't work.
17118 Cannot figure out whether flushing stdio streams explicitly works or not.
17119 I'm assuming it doesn't.
17125 "$define"|true|[yY]*)
17126 fflushall="$define"
17134 All is futile. Even fflush(stdin) clobbers input pipes!
17141 $rm -f core tryp.c tryp.core core.tryp.*
17143 *) fflushall="$undef"
17147 case "$fflushNULL$fflushall" in
17150 OK, I give up. I cannot figure out how to flush pending stdio output.
17151 We won't be flushing handles at all before fork/exec/popen.
17155 $rm -f try.* try$exe_ext
17157 : Store the full pathname to the ar program for use in the C program
17158 : Respect a hint or command line value for full_ar.
17163 : Store the full pathname to the sed program for use in the C program
17166 : see what type gids are declared as in the kernel
17168 echo "Looking for the type for group ids returned by getgid()."
17169 set gid_t gidtype xxx stdio.h sys/types.h
17173 xxx=`./findhdr sys/user.h`
17174 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
17176 unsigned) dflt="$1 $2" ;;
17180 *) dflt="$gidtype";;
17183 gid_t) echo "gid_t found." ;;
17184 *) rp="What is the type for group ids returned by getgid()?"
17192 *_t) zzz="$gidtype" ;;
17195 echo "Checking the size of $zzz..." >&4
17197 #include <sys/types.h>
17200 printf("%d\n", (int)sizeof($gidtype));
17205 if eval $compile_ok; then
17209 echo "(I can't execute the test program--guessing $gidsize.)" >&4
17212 echo "Your $zzz is $gidsize bytes long."
17217 echo "(I can't compile the test program--guessing $gidsize.)" >&4
17223 *_t) zzz="$gidtype" ;;
17226 echo "Checking the sign of $zzz..." >&4
17228 #include <sys/types.h>
17239 if eval $compile; then
17243 echo "(I can't execute the test program--guessing unsigned.)" >&4
17247 1) echo "Your $zzz is unsigned." ;;
17248 -1) echo "Your $zzz is signed." ;;
17254 echo "(I can't compile the test program--guessing unsigned.)" >&4
17260 if $test X"$quadtype" != X; then
17262 echo "Checking how to print 64-bit integers..." >&4
17264 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
17265 $cat >try.c <<'EOCP'
17266 #include <sys/types.h>
17269 int q = 12345678901;
17270 printf("%ld\n", q);
17274 if eval $compile; then
17278 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
17279 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
17280 echo "We will use %d."
17286 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
17287 $cat >try.c <<'EOCP'
17288 #include <sys/types.h>
17291 long q = 12345678901;
17292 printf("%ld\n", q);
17296 if eval $compile; then
17300 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
17301 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
17302 echo "We will use %ld."
17308 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
17309 $cat >try.c <<'EOCP'
17310 #include <sys/types.h>
17311 #include <inttypes.h>
17314 int64_t q = 12345678901;
17315 printf("%" PRId64 "\n", q);
17319 if eval $compile; then
17323 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
17324 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
17325 echo "We will use the C9X style."
17331 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17333 #include <sys/types.h>
17336 $quadtype q = 12345678901;
17337 printf("%Ld\n", q);
17341 if eval $compile; then
17345 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
17346 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
17347 echo "We will use %Ld."
17353 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
17354 $cat >try.c <<'EOCP'
17355 #include <sys/types.h>
17358 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
17359 printf("%lld\n", q);
17363 if eval $compile; then
17367 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
17368 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
17369 echo "We will use the %lld style."
17375 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17377 #include <sys/types.h>
17380 $quadtype q = 12345678901;
17381 printf("%qd\n", q);
17385 if eval $compile; then
17389 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
17390 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
17391 echo "We will use %qd."
17397 if $test X"$sPRId64" = X; then
17398 echo "Cannot figure out how to print 64-bit integers." >&4
17406 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
17407 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
17409 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
17410 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
17416 $echo "Checking the format strings to be used for Perl's internal types..." >&4
17418 if $test X"$ivsize" = X8; then
17419 ivdformat="$sPRId64"
17420 uvuformat="$sPRIu64"
17421 uvoformat="$sPRIo64"
17422 uvxformat="$sPRIx64"
17423 uvXUformat="$sPRIXU64"
17425 if $test X"$ivsize" = X"$longsize"; then
17432 if $test X"$ivsize" = X"$intsize"; then
17440 if $test X"$ivsize" = X"$shortsize"; then
17451 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
17452 nveformat="$sPRIeldbl"
17453 nvfformat="$sPRIfldbl"
17454 nvgformat="$sPRIgldbl"
17455 nvEUformat="$sPRIEUldbl"
17456 nvFUformat="$sPRIFUldbl"
17457 nvGUformat="$sPRIGUldbl"
17467 case "$ivdformat" in
17468 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
17475 $echo "Checking the format string to be used for gids..." >&4
17478 -1) if $test X"$gidsize" = X"$ivsize"; then
17479 gidformat="$ivdformat"
17481 if $test X"$gidsize" = X"$longsize"; then
17484 if $test X"$gidsize" = X"$intsize"; then
17487 if $test X"$gidsize" = X"$shortsize"; then
17494 *) if $test X"$gidsize" = X"$uvsize"; then
17495 gidformat="$uvuformat"
17497 if $test X"$gidsize" = X"$longsize"; then
17500 if $test X"$gidsize" = X"$intsize"; then
17503 if $test X"$gidsize" = X"$shortsize"; then
17512 : see if getgroups exists
17513 set getgroups d_getgrps
17516 : see if setgroups exists
17517 set setgroups d_setgrps
17521 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
17523 case "$d_getgrps$d_setgrps" in
17525 case "$groupstype" in
17526 '') dflt="$gidtype" ;;
17527 *) dflt="$groupstype" ;;
17530 What type of pointer is the second argument to getgroups() and setgroups()?
17531 Usually this is the same as group ids, $gidtype, but not always.
17534 rp='What type pointer is the second argument to getgroups() and setgroups()?'
17538 *) groupstype="$gidtype";;
17542 echo "Checking if your $make program sets \$(MAKE)..." >&4
17543 case "$make_set_make" in
17545 $sed 's/^X //' > testmake.mak << 'EOF'
17547 X @echo 'maketemp="$(MAKE)"'
17549 case "`$make -f testmake.mak 2>/dev/null`" in
17550 *maketemp=*) make_set_make='#' ;;
17551 *) make_set_make="MAKE=$make" ;;
17553 $rm -f testmake.mak
17556 case "$make_set_make" in
17557 '#') echo "Yup, it does.";;
17558 *) echo "Nope, it doesn't.";;
17561 : see what type is used for mode_t
17562 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
17563 set mode_t modetype int stdio.h sys/types.h
17566 : see if stdarg is available
17568 if $test `./findhdr stdarg.h`; then
17569 echo "<stdarg.h> found." >&4
17572 echo "<stdarg.h> NOT found." >&4
17576 : see if varags is available
17578 if $test `./findhdr varargs.h`; then
17579 echo "<varargs.h> found." >&4
17581 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
17584 : set up the varargs testing programs
17585 $cat > varargs.c <<EOP
17587 #include <stdarg.h>
17590 #include <varargs.h>
17594 int f(char *p, ...)
17608 p = va_arg(ap, char *);
17613 $cat > varargs <<EOP
17615 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
17624 : now check which varargs header should be included
17629 if `./varargs I_STDARG`; then
17631 elif `./varargs I_VARARGS`; then
17636 if `./varargs I_VARARGS`; then
17643 echo "I could not find the definition for va_dcl... You have problems..." >&4
17644 val="$undef"; set i_stdarg; eval $setvar
17645 val="$undef"; set i_varargs; eval $setvar
17650 case "$i_varhdr" in
17652 val="$define"; set i_stdarg; eval $setvar
17653 val="$undef"; set i_varargs; eval $setvar
17656 val="$undef"; set i_stdarg; eval $setvar
17657 val="$define"; set i_varargs; eval $setvar
17660 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
17664 : see if we need va_copy
17666 case "$i_stdarg" in
17669 #include <stdarg.h>
17671 #$i_stdlib I_STDLIB
17673 #include <stdlib.h>
17675 #include <signal.h>
17678 ivfprintf(FILE *f, const char *fmt, va_list *valp)
17680 return vfprintf(f, fmt, *valp);
17684 myvfprintf(FILE *f, const char *fmt, va_list val)
17686 return ivfprintf(f, fmt, &val);
17690 myprintf(char *fmt, ...)
17693 va_start(val, fmt);
17694 return myvfprintf(stdout, fmt, val);
17698 main(int ac, char **av)
17700 signal(SIGSEGV, exit);
17702 myprintf("%s%cs all right, then\n", "that", '\'');
17707 if eval $compile && $run ./try 2>&1 >/dev/null; then
17708 case "`$run ./try`" in
17709 "that's all right, then")
17715 yes) echo "It seems that you don't need va_copy()." >&4
17716 need_va_copy="$undef"
17718 *) echo "It seems that va_copy() or similar will be needed." >&4
17719 need_va_copy="$define"
17722 $rm -f try.* core core.* *.core *.core.*
17724 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
17728 : see what type is used for size_t
17729 rp="What is the type used for the length parameter for string functions?"
17730 set size_t sizetype 'unsigned int' stdio.h sys/types.h
17733 : check for type of arguments to gethostbyaddr.
17734 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
17735 case "$d_gethbyaddr" in
17739 Checking to see what type of arguments are accepted by gethostbyaddr().
17741 hdrs="$define sys/types.h
17742 $d_socket sys/socket.h
17743 $i_niin netinet/in.h
17745 $i_unistd unistd.h"
17746 : The first arg can 'char *' or 'void *'
17747 : The second arg is some of integral type
17748 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
17749 for yyy in size_t long int; do
17750 case "$netdb_host_type" in
17751 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
17752 if ./protochk "$try" $hdrs; then
17753 echo "Your system accepts $xxx for the first arg."
17754 echo "...and $yyy for the second arg."
17755 netdb_host_type="$xxx"
17756 netdb_hlen_type="$yyy"
17762 : In case none of those worked, prompt the user.
17763 case "$netdb_host_type" in
17764 '') rp='What is the type for the 1st argument to gethostbyaddr?'
17767 netdb_host_type=$ans
17768 rp='What is the type for the 2nd argument to gethostbyaddr?'
17771 netdb_hlen_type=$ans
17775 *) : no gethostbyaddr, so pick harmless defaults
17776 netdb_host_type='char *'
17777 netdb_hlen_type="$sizetype"
17780 # Remove the "const" if needed. -- but then we'll have a
17782 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
17785 : check for type of argument to gethostbyname.
17786 if test "X$netdb_name_type" = X ; then
17787 case "$d_gethbyname" in
17791 Checking to see what type of argument is accepted by gethostbyname().
17793 hdrs="$define sys/types.h
17794 $d_socket sys/socket.h
17795 $i_niin netinet/in.h
17797 $i_unistd unistd.h"
17798 for xxx in "const char *" "char *"; do
17799 case "$netdb_name_type" in
17800 '') try="extern struct hostent *gethostbyname($xxx);"
17801 if ./protochk "$try" $hdrs; then
17802 echo "Your system accepts $xxx."
17803 netdb_name_type="$xxx"
17808 : In case none of those worked, prompt the user.
17809 case "$netdb_name_type" in
17810 '') rp='What is the type for the 1st argument to gethostbyname?'
17813 netdb_name_type=$ans
17817 *) : no gethostbyname, so pick harmless default
17818 netdb_name_type='char *'
17823 : check for type of 1st argument to getnetbyaddr.
17824 if test "X$netdb_net_type" = X ; then
17825 case "$d_getnbyaddr" in
17829 Checking to see what type of 1st argument is accepted by getnetbyaddr().
17831 hdrs="$define sys/types.h
17832 $d_socket sys/socket.h
17833 $i_niin netinet/in.h
17835 $i_unistd unistd.h"
17836 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
17837 case "$netdb_net_type" in
17838 '') try="extern struct netent *getnetbyaddr($xxx, int);"
17839 if ./protochk "$try" $hdrs; then
17840 echo "Your system accepts $xxx."
17841 netdb_net_type="$xxx"
17846 : In case none of those worked, prompt the user.
17847 case "$netdb_net_type" in
17848 '') rp='What is the type for the 1st argument to getnetbyaddr?'
17851 netdb_net_type=$ans
17855 *) : no getnetbyaddr, so pick harmless default
17856 netdb_net_type='long'
17860 : locate the preferred pager for this system
17867 [a-zA-Z]:/*) dflt=$pg;;
17871 [a-zA-Z]:/*) dflt=$more;;
17875 [a-zA-Z]:/*) dflt=$less;;
17878 '') dflt=/usr/ucb/more;;
17882 : Instruct ./getfile to trust the hinted or previous pager value,
17883 : even if it does not begin with a slash. For example, on os2,
17884 : pager might be cmd /c more. See comments in UU/getfile.
17889 rp='What pager is used on your system?'
17893 : see what type pids are declared as in the kernel
17894 rp="What is the type of process ids on this system?"
17895 set pid_t pidtype int stdio.h sys/types.h
17898 : Find earliest binary compatible site_perl subdirectory perl can use.
17899 xs_apiversion=$version # The current site_perl version.
17900 : Find earliest pure perl site_perl subdirectory perl can use.
17901 : The versioned directories started at 5.005.
17902 pm_apiversion='5.005'
17904 : see if ar generates random libraries by itself
17906 echo "Checking how to generate random libraries on your machine..." >&4
17907 echo 'int bar1() { return bar2(); }' > bar1.c
17908 echo 'int bar2() { return 2; }' > bar2.c
17909 $cat > foo.c <<'EOP'
17910 int main() { printf("%d\n", bar1()); exit(0); }
17912 $cc $ccflags -c bar1.c >/dev/null 2>&1
17913 $cc $ccflags -c bar2.c >/dev/null 2>&1
17914 $cc $ccflags -c foo.c >/dev/null 2>&1
17915 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
17916 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
17917 $run ./foobar >/dev/null 2>&1; then
17918 echo "$ar appears to generate random libraries itself."
17921 elif $ar ts bar$_a >/dev/null 2>&1 &&
17922 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
17923 $run ./foobar >/dev/null 2>&1; then
17924 echo "a table of contents needs to be added with '$ar ts'."
17931 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
17932 $test -f $ranlib || ranlib=''
17935 if $test -n "$ranlib"; then
17936 echo "your system has '$ranlib'; we'll use that."
17939 echo "your system doesn't seem to support random libraries"
17940 echo "so we'll use lorder and tsort to order the libraries."
17947 : check for type of arguments to select.
17948 case "$selecttype" in
17949 '') case "$d_select" in
17953 Checking to see what type of arguments are accepted by select().
17955 hdrs="$define sys/types.h
17956 $i_systime sys/time.h
17957 $i_sysselct sys/select.h
17958 $d_socket sys/socket.h"
17959 : The first arg can be int, unsigned, or size_t
17960 : The last arg may or may not be 'const'
17962 : void pointer has been seen but using that
17963 : breaks the selectminbits test
17964 for xxx in 'fd_set *' 'int *'; do
17965 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
17966 for tmo in 'struct timeval *' 'const struct timeval *'; do
17968 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
17969 if ./protochk "$try" $hdrs; then
17970 echo "Your system accepts $xxx."
17979 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
17980 case "$d_fd_set" in
17981 $define) dflt="fd_set *" ;;
17990 *) : no select, so pick a harmless default
17997 : check for the select 'width'
17998 case "$selectminbits" in
17999 '') case "$d_select" in
18003 Checking to see on how many bits at a time your select() operates...
18006 #include <sys/types.h>
18008 #$i_systime I_SYS_TIME
18009 #$i_systimek I_SYS_TIME_KERNEL
18014 # ifdef I_SYS_TIME_KERNEL
18017 # include <sys/time.h>
18018 # ifdef I_SYS_TIME_KERNEL
18022 #$i_sysselct I_SYS_SELECT
18023 #ifdef I_SYS_SELECT
18024 #include <sys/select.h>
18026 #$d_socket HAS_SOCKET
18028 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
18032 #define S sizeof(*(b))
18034 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
18035 #define NBITS (NBYTES * 8)
18044 fp = fopen("try.c", "r");
18050 b = ($selecttype)s;
18051 for (i = 0; i < NBITS; i++)
18055 select(fd + 1, b, 0, 0, &t);
18056 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
18057 printf("%d\n", i + 1);
18062 if eval $compile_ok; then
18063 selectminbits=`$run ./try`
18064 case "$selectminbits" in
18066 Cannot figure out on how many bits at a time your select() operates.
18067 I'll play safe and guess it is 32 bits.
18073 *) bits="$selectminbits bits" ;;
18075 echo "Your select() operates on $bits at a time." >&4
18077 rp='What is the minimum number of bits your select() operates on?'
18078 case "$byteorder" in
18079 1234|12345678) dflt=32 ;;
18084 selectminbits="$val"
18088 *) : no select, so pick a harmless default
18095 : Trace out the files included by signal.h, then look for SIGxxx names.
18096 : Remove SIGARRAYSIZE used by HPUX.
18097 : Remove SIGSTKSIZE used by Linux.
18098 : Remove SIGSTKSZ used by Posix.
18099 : Remove SIGTYP void lines used by OS2.
18100 : Some cpps, like os390, dont give the file name anywhere
18101 if [ "X$fieldn" = X ]; then
18102 : Just make some guesses. We check them later.
18103 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
18105 xxx=`echo '#include <signal.h>' |
18106 $cppstdin $cppminus $cppflags 2>/dev/null |
18107 $grep '^[ ]*#.*include' |
18108 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
18110 : Check this list of files to be sure we have parsed the cpp output ok.
18111 : This will also avoid potentially non-existent files, such
18114 for xx in $xxx /dev/null ; do
18115 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
18117 : If we have found no files, at least try signal.h
18118 case "$xxxfiles" in
18119 '') xxxfiles=`./findhdr signal.h` ;;
18122 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
18123 print substr($2, 4, 20)
18125 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
18126 print substr($3, 4, 20)
18128 : Append some common names just in case the awk scan failed.
18129 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
18130 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
18131 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
18132 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
18133 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
18135 : generate a few handy files for later
18136 $cat > signal.c <<'EOCP'
18137 #include <sys/types.h>
18138 #include <signal.h>
18142 /* Strange style to avoid deeply-nested #if/#else/#endif */
18145 # define NSIG (_NSIG)
18151 # define NSIG (SIGMAX+1)
18157 # define NSIG (SIG_MAX+1)
18163 # define NSIG (MAXSIG+1)
18169 # define NSIG (MAX_SIG+1)
18174 # ifdef SIGARRAYSIZE
18175 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
18181 # define NSIG (_sys_nsig) /* Solaris 2.5 */
18185 /* Default to some arbitrary number that's big enough to get most
18186 of the common signals.
18192 printf("NSIG %d\n", NSIG);
18198 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
18200 printf "#ifdef SIG"; printf $1; printf "\n"
18201 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
18202 printf $1; printf ");\n"
18206 printf "#endif /* JUST_NSIG */\n";
18207 printf "exit(0);\n}\n";
18210 $cat >signal.awk <<'EOP'
18211 BEGIN { ndups = 0 }
18212 $1 ~ /^NSIG$/ { nsig = $2 }
18213 ($1 !~ /^NSIG$/) && (NF == 2) {
18214 if ($2 > maxsig) { maxsig = $2 }
18215 if (sig_name[$2]) {
18216 dup_name[ndups] = $1
18217 dup_num[ndups] = $2
18229 printf("NSIG %d\n", nsig);
18230 for (n = 1; n < nsig; n++) {
18232 printf("%s %d\n", sig_name[n], sig_num[n])
18235 printf("NUM%d %d\n", n, n)
18238 for (n = 0; n < ndups; n++) {
18239 printf("%s %d\n", dup_name[n], dup_num[n])
18243 $cat >signal_cmd <<EOS
18245 if $test -s signal.lst; then
18246 echo "Using your existing signal.lst file"
18251 $cat >>signal_cmd <<'EOS'
18254 if eval $compile_ok; then
18255 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
18257 echo "(I can't seem be able to compile the whole test program)" >&4
18258 echo "(I'll try it in little pieces.)" >&4
18259 set signal -DJUST_NSIG
18260 if eval $compile_ok; then
18261 $run ./signal$_exe > signal.nsg
18264 echo "I can't seem to figure out how many signals you have." >&4
18265 echo "Guessing 50." >&4
18266 echo 'NSIG 50' > signal.nsg
18268 : Now look at all the signal names, one at a time.
18269 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
18270 $cat > signal.c <<EOCP
18271 #include <sys/types.h>
18272 #include <signal.h>
18275 printf("$xx %d\n", SIG${xx});
18280 if eval $compile; then
18281 echo "SIG${xx} found."
18282 $run ./signal$_exe >> signal.ls1
18284 echo "SIG${xx} NOT found."
18287 if $test -s signal.ls1; then
18288 $cat signal.nsg signal.ls1 |
18289 $sort -n | $uniq | $awk -f signal.awk >signal.lst
18293 if $test -s signal.lst; then
18296 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
18297 echo 'kill -l' >signal
18298 set X `csh -f <signal`
18302 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
18304 echo $@ | $tr ' ' $trnl | \
18305 $awk '{ printf "%s %d\n", $1, ++s; }
18306 END { printf "NSIG %d\n", ++s }' >signal.lst
18308 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
18310 chmod a+x signal_cmd
18311 $eunicefix signal_cmd
18313 : generate list of signal names
18315 case "$sig_name_init" in
18317 *) case "$sig_num_init" in
18318 ''|*,*) doinit=yes ;;
18323 echo "Generating a list of signal names and numbers..." >&4
18325 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
18326 sig_name=`$awk 'BEGIN { printf "ZERO " }
18327 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
18328 sig_num=`$awk 'BEGIN { printf "0 " }
18329 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
18330 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
18331 !/^NSIG/ { printf "\"%s\", ", $1 }
18332 END { printf "0\n" }' signal.lst`
18333 sig_num_init=`$awk 'BEGIN { printf "0, " }
18334 !/^NSIG/ { printf "%d, ", $2}
18335 END { printf "0\n"}' signal.lst`
18338 echo "The following $sig_count signals are available:"
18340 echo $sig_name | $awk \
18341 'BEGIN { linelen = 0 }
18343 for (i = 1; i <= NF; i++) {
18344 name = "SIG" $i " "
18345 linelen = linelen + length(name)
18346 if (linelen > 70) {
18348 linelen = length(name)
18354 sig_size=`echo $sig_name | awk '{print NF}'`
18355 $rm -f signal signal.c signal.awk signal.lst signal_cmd
18358 case "$sizetype" in
18359 *_t) zzz="$sizetype" ;;
18360 *) zzz="filesize" ;;
18362 echo "Checking the size of $zzz..." >&4
18364 #include <sys/types.h>
18367 printf("%d\n", (int)sizeof($sizetype));
18372 if eval $compile_ok; then
18376 echo "(I can't execute the test program--guessing $sizesize.)" >&4
18379 echo "Your $zzz size is $sizesize bytes."
18384 echo "(I can't compile the test program--guessing $sizesize.)" >&4
18388 : check for socklen_t
18390 echo "Checking to see if you have socklen_t..." >&4
18392 #include <sys/types.h>
18393 #$d_socket HAS_SOCKET
18395 #include <sys/socket.h>
18397 int main() { socklen_t x = 16; }
18400 if eval $compile; then
18402 echo "You have socklen_t."
18405 echo "You do not have socklen_t."
18406 case "$sizetype" in
18407 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
18414 : see if this is a socks.h system
18415 set socks.h i_socks
18418 : check for type of the size argument to socket calls
18419 case "$d_socket" in
18423 Checking to see what type is the last argument of accept().
18426 case "$d_socklen_t" in
18427 "$define") yyy="$yyy socklen_t"
18429 yyy="$yyy $sizetype int long unsigned"
18430 for xxx in $yyy; do
18431 case "$socksizetype" in
18432 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
18433 case "$usesocks" in
18435 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
18436 echo "Your system accepts '$xxx *' for the last argument of accept()."
18437 socksizetype="$xxx"
18440 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
18441 echo "Your system accepts '$xxx *' for the last argument of accept()."
18442 socksizetype="$xxx"
18449 : In case none of those worked, prompt the user.
18450 case "$socksizetype" in
18451 '') rp='What is the type for socket address structure sizes?'
18458 *) : no sockets, so pick relatively harmless default
18463 : see what type is used for signed size_t
18464 set ssize_t ssizetype int stdio.h sys/types.h
18469 #include <sys/types.h>
18470 #define Size_t $sizetype
18471 #define SSize_t $dflt
18474 if (sizeof(Size_t) == sizeof(SSize_t))
18476 else if (sizeof(Size_t) == sizeof(int))
18485 if eval $compile_ok && $run ./try > /dev/null; then
18486 ssizetype=`$run ./try`
18487 echo "I'll be using $ssizetype for functions returning a byte count." >&4
18490 Help! I can't compile and run the ssize_t test program: please enlighten me!
18491 (This is probably a misconfiguration in your system or libraries, and
18492 you really ought to fix it. Still, I'll try anyway.)
18494 I need a type that is the same size as $sizetype, but is guaranteed to
18495 be signed. Common values are ssize_t, int and long.
18498 rp="What signed type is the same size as $sizetype?"
18504 : see what type of char stdio uses.
18506 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
18507 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
18508 echo "Your stdio uses unsigned chars." >&4
18509 stdchar="unsigned char"
18511 echo "Your stdio uses signed chars." >&4
18518 : see what type uids are declared as in the kernel
18520 echo "Looking for the type for user ids returned by getuid()."
18521 set uid_t uidtype xxx stdio.h sys/types.h
18525 xxx=`./findhdr sys/user.h`
18526 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18528 unsigned) dflt="$1 $2" ;;
18532 *) dflt="$uidtype";;
18535 uid_t) echo "uid_t found." ;;
18536 *) rp="What is the type for user ids returned by getuid()?"
18544 *_t) zzz="$uidtype" ;;
18547 echo "Checking the size of $zzz..." >&4
18549 #include <sys/types.h>
18552 printf("%d\n", (int)sizeof($uidtype));
18557 if eval $compile_ok; then
18561 echo "(I can't execute the test program--guessing $uidsize.)" >&4
18564 echo "Your $zzz is $uidsize bytes long."
18569 echo "(I can't compile the test program--guessing $uidsize.)" >&4
18574 *_t) zzz="$uidtype" ;;
18577 echo "Checking the sign of $zzz..." >&4
18579 #include <sys/types.h>
18590 if eval $compile; then
18594 echo "(I can't execute the test program--guessing unsigned.)" >&4
18598 1) echo "Your $zzz is unsigned." ;;
18599 -1) echo "Your $zzz is signed." ;;
18605 echo "(I can't compile the test program--guessing unsigned.)" >&4
18611 $echo "Checking the format string to be used for uids..." >&4
18614 -1) if $test X"$uidsize" = X"$ivsize"; then
18615 uidformat="$ivdformat"
18617 if $test X"$uidsize" = X"$longsize"; then
18620 if $test X"$uidsize" = X"$intsize"; then
18623 if $test X"$uidsize" = X"$shortsize"; then
18630 *) if $test X"$uidsize" = X"$uvsize"; then
18631 uidformat="$uvuformat"
18633 if $test X"$uidsize" = X"$longsize"; then
18636 if $test X"$uidsize" = X"$intsize"; then
18639 if $test X"$uidsize" = X"$shortsize"; then
18648 : determine compiler compiler
18657 if $test -f "$byacc$_exe"; then
18659 comp="byacc or $comp"
18661 if $test -f "$bison$_exe"; then
18662 comp="$comp or bison -y"
18664 rp="Which compiler compiler ($comp) shall I use?"
18673 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
18679 : see if this is a fp.h system
18683 : see if this is a fp_class.h system
18684 set fp_class.h i_fp_class
18687 : see if this is a ieeefp.h system
18688 case "$i_ieeefp" in
18689 '' ) set ieeefp.h i_ieeefp
18694 : see if this is a libutil.h system
18695 set libutil.h i_libutil
18698 : see if mach cthreads are available
18699 if test "X$usethreads" = "X$define"; then
18700 set mach/cthreads.h i_machcthr
18703 i_machcthr="$undef"
18708 : see if this is a math.h system
18712 : see if this is a mntent.h system
18713 set mntent.h i_mntent
18716 : see if ndbm.h is available
18722 # Some Linux distributions such as RedHat 7.1 put the
18723 # ndbm.h header in /usr/include/gdbm/ndbm.h.
18724 if $test -f /usr/include/gdbm/ndbm.h; then
18725 echo '<gdbm/ndbm.h> found.'
18726 ccflags="$ccflags -I/usr/include/gdbm"
18727 cppflags="$cppflags -I/usr/include/gdbm"
18735 : see if dbm_open exists
18736 set dbm_open d_dbm_open
18738 case "$d_dbm_open" in
18741 echo "We won't be including <ndbm.h>"
18750 : see if net/errno.h is available
18752 set net/errno.h val
18755 : Unfortunately, it causes problems on some systems. Arrgh.
18758 cat > try.c <<'EOM'
18761 #include <net/errno.h>
18767 if $cc $ccflags -c try.c >/dev/null 2>&1; then
18768 echo "We'll be including <net/errno.h>." >&4
18770 echo "We won't be including <net/errno.h>." >&4
18779 : see if netinet/tcp.h is available
18780 set netinet/tcp.h i_netinettcp
18783 : see if this is a poll.h system
18787 : see if this is a prot.h system
18792 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
18793 $cat <<'EOSH' > Cppsym.know
18794 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
18795 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
18796 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
18797 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
18798 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
18799 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
18800 bull c cadmus clipper CMU COFF COMPILER_VERSION
18801 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
18802 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
18803 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
18804 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
18806 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
18807 H3050R H3050RX hbullx20 hcx host_mips
18808 hp200 hp300 hp700 HP700 hp800 hp9000
18809 hp9000s200 hp9000s300 hp9000s400 hp9000s500
18810 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
18811 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
18812 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
18813 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
18814 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
18815 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
18816 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
18817 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
18818 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
18819 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
18820 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
18821 MATH_HAS_NO_SIDE_EFFECTS
18822 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
18823 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
18824 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
18825 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
18826 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
18827 NetBSD news1500 news1700 news1800 news1900 news3700
18828 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
18829 ns32016 ns32332 ns32k nsc32000
18830 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
18831 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
18832 pc532 pdp11 PGC PIC plexus PORTAR posix
18833 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
18834 POSIX_C_SOURCE POSIX_SOURCE POWER
18835 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
18836 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
18837 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
18838 sony sony_news sonyrisc sparc sparclite spectrum
18839 stardent stdc STDC_EXT stratos sun sun3 sun386
18840 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
18841 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
18842 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
18843 sysV68 sysV88 Tek4132 Tek4300 titan
18844 TM3200 TM5400 TM5600
18845 tower tower32 tower32_200 tower32_600 tower32_700
18846 tower32_800 tower32_850 tss
18847 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
18848 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
18849 unix UNIX95 UNIX99 unixpc unos
18850 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
18851 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
18852 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
18854 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
18855 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
18856 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
18859 # Maybe put other stuff here too.
18860 cat <<EOSH >>Cppsym.know
18863 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
18864 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
18865 $cat Cppsym.know > Cppsym.c
18866 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
18867 $rm -f Cppsym.a Cppsym.b Cppsym.c
18868 cat <<EOSH > Cppsym
18870 if $test \$# -gt 0; then
18871 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
18872 if $test -s Cppsym.got; then
18879 $tr " " "$trnl" | ./Cppsym.try
18885 cat <<EOSH > Cppsym.try
18887 cat <<'EOCP' > try.c
18893 cat <<'EOSH' >> Cppsym.try
18895 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
18896 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
18897 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
18898 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
18900 echo 'return 0;}' >> try.c
18902 cat <<EOSH >> Cppsym.try
18904 case "$osname-$gccversion" in
18905 irix-) ccflags="\$ccflags -woff 1178" ;;
18906 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
18908 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
18910 chmod +x Cppsym.try
18911 $eunicefix Cppsym.try
18912 ./Cppsym < Cppsym.know > Cppsym.true
18913 : now check the C compiler for additional symbols
18914 postprocess_cc_v=''
18916 aix) postprocess_cc_v="|$tr , ' '" ;;
18923 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
18926 -D*) echo "\$i" | $sed 's/^-D//';;
18927 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
18932 postprocess_cc_v=''
18935 ./ccsym > ccsym1.raw
18936 if $test -s ccsym1.raw; then
18937 $sort ccsym1.raw | $uniq >ccsym.raw
18939 mv ccsym1.raw ccsym.raw
18942 $awk '/\=/ { print $0; next }
18943 { print $0"=1" }' ccsym.raw >ccsym.list
18944 $awk '/\=/ { print $0; next }
18945 { print $0"=1" }' Cppsym.true >ccsym.true
18946 $comm -13 ccsym.true ccsym.list >ccsym.own
18947 $comm -12 ccsym.true ccsym.list >ccsym.com
18948 $comm -23 ccsym.true ccsym.list >ccsym.cpp
18950 if $test -z ccsym.raw; then
18951 echo "Your C compiler doesn't seem to define any symbols!" >&4
18953 echo "However, your C preprocessor defines the following symbols:"
18956 cppsymbols=`$cat Cppsym.true`
18957 cppsymbols=`echo $cppsymbols`
18958 cppccsymbols="$cppsymbols"
18960 if $test -s ccsym.com; then
18961 echo "Your C compiler and pre-processor define these symbols:"
18962 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
18965 cppccsymbols=`$cat ccsym.com`
18966 cppccsymbols=`echo $cppccsymbols`
18967 $test "$silent" || sleep 1
18969 if $test -s ccsym.cpp; then
18970 $test "$also" && echo " "
18971 echo "Your C pre-processor ${also}defines the following symbols:"
18972 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
18974 cppsymbols=`$cat ccsym.cpp`
18975 cppsymbols=`echo $cppsymbols`
18976 $test "$silent" || sleep 1
18978 if $test -s ccsym.own; then
18979 $test "$also" && echo " "
18980 echo "Your C compiler ${also}defines the following cpp symbols:"
18981 $sed -e 's/\(..*\)=1/\1/' ccsym.own
18982 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
18983 ccsymbols=`$cat ccsym.own`
18984 ccsymbols=`echo $ccsymbols`
18985 $test "$silent" || sleep 1
18989 : see if this is a termio system
18993 if $test `./findhdr termios.h`; then
18994 set tcsetattr i_termios
19000 "$define") echo "You have POSIX termios.h... good!" >&4;;
19001 *) if ./Cppsym pyr; then
19002 case "`/bin/universe`" in
19003 ucb) if $test `./findhdr sgtty.h`; then
19005 echo "<sgtty.h> found." >&4
19007 echo "System is pyramid with BSD universe."
19008 echo "<sgtty.h> not found--you could have problems." >&4
19010 *) if $test `./findhdr termio.h`; then
19012 echo "<termio.h> found." >&4
19014 echo "System is pyramid with USG universe."
19015 echo "<termio.h> not found--you could have problems." >&4
19019 if $test `./findhdr termio.h`; then
19020 echo "<termio.h> found." >&4
19022 elif $test `./findhdr sgtty.h`; then
19023 echo "<sgtty.h> found." >&4
19026 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
19029 if $test `./findhdr sgtty.h`; then
19030 echo "<sgtty.h> found." >&4
19032 elif $test `./findhdr termio.h`; then
19033 echo "<termio.h> found." >&4
19036 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
19040 set i_termio; eval $setvar
19041 val=$val2; set i_sgtty; eval $setvar
19042 val=$val3; set i_termios; eval $setvar
19044 : see if stddef is available
19045 set stddef.h i_stddef
19048 : see if this is a sunmath.h system
19049 set sunmath.h i_sunmath
19052 : see if sys/access.h is available
19053 set sys/access.h i_sysaccess
19056 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
19057 set sys/filio.h i_sysfilio
19060 if $test `./findhdr sys/ioctl.h`; then
19062 echo '<sys/ioctl.h> found.' >&4
19065 if $test $i_sysfilio = "$define"; then
19066 echo '<sys/ioctl.h> NOT found.' >&4
19068 $test $i_sgtty = "$define" && xxx="sgtty.h"
19069 $test $i_termio = "$define" && xxx="termio.h"
19070 $test $i_termios = "$define" && xxx="termios.h"
19071 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
19077 : see if socket ioctl defs are in sys/sockio.h
19079 xxx=`./findhdr sys/sockio.h`
19080 if $test "$xxx"; then
19081 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
19083 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
19086 echo "No socket ioctls found in <sys/sockio.h>." >&4
19091 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
19098 : see if this is a syslog.h system
19099 set syslog.h i_syslog
19103 : see if this is a sys/mode.h system
19104 set sys/mode.h i_sysmode
19107 : see if sys/resource.h has to be included
19108 set sys/resource.h i_sysresrc
19111 : see if sys/security.h is available
19112 set sys/security.h i_syssecrt
19115 : see if this is a sys/statvfs.h system
19116 set sys/statvfs.h i_sysstatvfs
19119 : see if this is a sys/un.h system
19120 set sys/un.h i_sysun
19124 : see if this is a sys/utsname.h system
19125 set sys/utsname.h i_sysutsname
19128 : see if this is a syswait system
19129 set sys/wait.h i_syswait
19132 : see if this is a ustat.h system
19133 set ustat.h i_ustat
19136 : see if this is an utime system
19137 set utime.h i_utime
19140 : see if this is a values.h system
19141 set values.h i_values
19144 : see if this is a vfork system
19147 set vfork.h i_vfork
19155 : see if gdbm.h is available
19160 : see if gdbm_open exists
19161 set gdbm_open d_gdbm_open
19163 case "$d_gdbm_open" in
19166 echo "We won't be including <gdbm.h>"
19176 echo "Looking for extensions..." >&4
19177 : If we are using the old config.sh, known_extensions may contain
19178 : old or inaccurate or duplicate values.
19179 known_extensions=''
19180 nonxs_extensions=''
19181 : We do not use find because it might not be available.
19182 : We do not just use MANIFEST because the user may have dropped
19183 : some additional extensions into the source tree and expect them
19186 : Function to recursively find available extensions, ignoring DynaLoader
19187 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
19191 DynaLoader|dynaload) ;;
19193 if $test -f $xxx/$xxx.xs; then
19194 known_extensions="$known_extensions $1$xxx";
19195 elif $test -f $xxx/Makefile.PL; then
19196 nonxs_extensions="$nonxs_extensions $1$xxx";
19198 if $test -d $xxx -a $# -lt 10; then
19201 eval $find_extensions;
19213 eval $find_extensions
19214 # Special case: Add in threads/shared since it is not picked up by the
19215 # recursive find above (and adding in general recursive finding breaks
19216 # SDBM_File/sdbm). A.D. 10/25/2001.
19217 known_extensions="$known_extensions threads/shared"
19218 set X $nonxs_extensions
19220 nonxs_extensions="$*"
19221 set X $known_extensions
19223 known_extensions="$*"
19226 : Now see which are supported on this system.
19228 for xxx in $known_extensions ; do
19232 $define) avail_ext="$avail_ext $xxx" ;;
19235 GDBM_File|gdbm_fil)
19237 $define) avail_ext="$avail_ext $xxx" ;;
19240 I18N/Langinfo|i18n_lan)
19241 case "$i_langinfo$d_nl_langinfo" in
19242 $define$define) avail_ext="$avail_ext $xxx" ;;
19245 NDBM_File|ndbm_fil)
19248 case "$osname-$use64bitint" in
19249 cygwin-*|hpux-define)
19251 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
19254 *) avail_ext="$avail_ext $xxx" ;;
19259 ODBM_File|odbm_fil)
19260 case "${i_dbm}${i_rpcsvcdbm}" in
19262 case "$osname-$use64bitint" in
19263 cygwin-*|hpux-define)
19265 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
19268 *) avail_ext="$avail_ext $xxx" ;;
19274 case "$useposix" in
19275 true|define|y) avail_ext="$avail_ext $xxx" ;;
19279 case "$useopcode" in
19280 true|define|y) avail_ext="$avail_ext $xxx" ;;
19284 case "$d_socket" in
19287 beos) ;; # not unless BONE
19288 *) avail_ext="$avail_ext $xxx" ;;
19293 Sys/Syslog|sys/syslog)
19294 : XXX syslog requires socket
19295 case "$d_socket" in
19296 true|$define|y) avail_ext="$avail_ext $xxx" ;;
19300 case "$usethreads" in
19302 case "$useithreads" in
19303 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
19307 threads|threads/shared)
19308 # threads and threads::shared are special cases.
19309 # To stop people from asking "Perl 5.8.0 was supposed
19310 # to have this new fancy threads implementation but my
19311 # perl doesn't have it" and from people trying to
19312 # (re)install the threads module using CPAN.pm and
19313 # CPAN.pm then offering to reinstall Perl 5.8.0,
19314 # the threads.pm and threads/shared.pm will always be
19315 # there, croaking informatively ("you need to rebuild
19316 # all of Perl with threads, sorry") when threads haven't
19317 # been compiled in.
19319 avail_ext="$avail_ext $xxx"
19322 : XXX Do we need a useipcsysv variable here
19323 case "${d_msg}${d_sem}${d_shm}" in
19324 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
19327 *) avail_ext="$avail_ext $xxx"
19336 : Now see which nonxs extensions are supported on this system.
19337 : For now assume all are.
19339 for xxx in $nonxs_extensions ; do
19341 *) nonxs_ext="$nonxs_ext $xxx"
19353 A number of extensions are supplied with $package. You may choose to
19354 compile these extensions for dynamic loading (the default), compile
19355 them into the $package executable (static loading), or not include
19356 them at all. Answer "none" to include no extensions.
19357 Note that DynaLoader is always built and need not be mentioned here.
19360 case "$dynamic_ext" in
19361 '') dflt="$avail_ext" ;;
19362 *) dflt="$dynamic_ext"
19363 # Perhaps we are reusing an old out-of-date config.sh.
19366 if test X"$dynamic_ext" != X"$avail_ext"; then
19368 NOTICE: Your previous config.sh list may be incorrect.
19369 The extensions now available to you are
19371 but the default list from your previous config.sh is
19383 rp="What extensions do you wish to load dynamically?"
19386 none) dynamic_ext=' ' ;;
19387 *) dynamic_ext="$ans" ;;
19390 case "$static_ext" in
19392 : Exclude those already listed in dynamic linking
19394 for xxx in $avail_ext; do
19395 case " $dynamic_ext " in
19397 *) dflt="$dflt $xxx" ;;
19404 *) dflt="$static_ext"
19411 rp="What extensions do you wish to load statically?"
19414 none) static_ext=' ' ;;
19415 *) static_ext="$ans" ;;
19420 A number of extensions are supplied with $package. Answer "none"
19421 to include no extensions.
19422 Note that DynaLoader is always built and need not be mentioned here.
19425 case "$static_ext" in
19426 '') dflt="$avail_ext" ;;
19427 *) dflt="$static_ext"
19428 # Perhaps we are reusing an old out-of-date config.sh.
19431 if test X"$static_ext" != X"$avail_ext"; then
19433 NOTICE: Your previous config.sh list may be incorrect.
19434 The extensions now available to you are
19436 but the default list from your previous config.sh is
19445 : Exclude those that are not xs extensions
19449 rp="What extensions do you wish to include?"
19452 none) static_ext=' ' ;;
19453 *) static_ext="$ans" ;;
19458 # Encode is a special case. If we are building Encode as a static
19459 # extension, we need to explicitly list its subextensions as well.
19460 # For other nested extensions, this is handled automatically by
19461 # the appropriate Makefile.PL.
19462 case " $static_ext " in
19463 *" Encode "*) # Add the subextensions of Encode
19465 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
19466 static_ext="$static_ext Encode/$xxx"
19472 set X $dynamic_ext $static_ext $nonxs_ext
19476 : Remove libraries needed only for extensions
19477 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
19478 : The exception is SunOS 4.x, which needs them.
19479 case "${osname}X${osvers}" in
19483 *) case "$usedl" in
19484 $define|true|[yY]*)
19485 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
19489 *) perllibs="$libs"
19495 : Remove build directory name from cppstdin so it can be used from
19496 : either the present location or the final installed location.
19498 : Get out of the UU directory to get correct path name.
19500 case "$cppstdin" in
19502 echo "Stripping down cppstdin path name"
19508 : end of configuration questions
19510 echo "End of configuration questions."
19513 : back to where it started
19514 if test -d ../UU; then
19518 : configuration may be patched via a 'config.arch' file
19519 if $test -f config.arch; then
19520 echo "I see a config.arch file, loading it."
19524 : configuration may be patched via a 'config.over' file
19525 if $test -f config.over; then
19528 rp='I see a config.over file. Do you wish to load it?'
19531 n*) echo "OK, I'll ignore it.";;
19533 echo "Configuration override changes have been loaded."
19538 : in case they want portability, strip down executable paths
19539 case "$d_portable" in
19542 echo "Stripping down executable paths..." >&4
19543 for file in $loclist $trylist; do
19545 eval $file=`basename $temp`
19550 : create config.sh file
19552 echo "Creating config.sh..." >&4
19553 $spitshell <<EOT >config.sh
19556 # This file was produced by running the Configure script. It holds all the
19557 # definitions figured out by Configure. Should you modify one of these values,
19558 # do not forget to propagate your changes by running "Configure -der". You may
19559 # instead choose to run each of the .SH files by yourself, or "Configure -S".
19562 # Package name : $package
19563 # Source directory : $src
19564 # Configuration time: $cf_time
19565 # Configured by : $cf_by
19566 # Target system : $myuname
19576 Revision='$Revision'
19584 alignbytes='$alignbytes'
19585 ansi2knr='$ansi2knr'
19586 aphostname='$aphostname'
19587 api_revision='$api_revision'
19588 api_subversion='$api_subversion'
19589 api_version='$api_version'
19590 api_versionstring='$api_versionstring'
19593 archlibexp='$archlibexp'
19594 archname64='$archname64'
19595 archname='$archname'
19596 archobjs='$archobjs'
19597 asctime_r_proto='$asctime_r_proto'
19605 byteorder='$byteorder'
19607 castflags='$castflags'
19610 cccdlflags='$cccdlflags'
19611 ccdlflags='$ccdlflags'
19613 ccflags_uselargefiles='$ccflags_uselargefiles'
19615 ccsymbols='$ccsymbols'
19616 ccversion='$ccversion'
19618 cf_email='$cf_email'
19620 charsize='$charsize'
19624 clocktype='$clocktype'
19626 compress='$compress'
19627 contains='$contains'
19631 cpp_stuff='$cpp_stuff'
19632 cppccsymbols='$cppccsymbols'
19633 cppflags='$cppflags'
19635 cppminus='$cppminus'
19637 cppstdin='$cppstdin'
19638 cppsymbols='$cppsymbols'
19639 crypt_r_proto='$crypt_r_proto'
19640 cryptlib='$cryptlib'
19642 ctermid_r_proto='$ctermid_r_proto'
19643 ctime_r_proto='$ctime_r_proto'
19644 d_Gconvert='$d_Gconvert'
19645 d_PRIEUldbl='$d_PRIEUldbl'
19646 d_PRIFUldbl='$d_PRIFUldbl'
19647 d_PRIGUldbl='$d_PRIGUldbl'
19648 d_PRIXU64='$d_PRIXU64'
19649 d_PRId64='$d_PRId64'
19650 d_PRIeldbl='$d_PRIeldbl'
19651 d_PRIfldbl='$d_PRIfldbl'
19652 d_PRIgldbl='$d_PRIgldbl'
19653 d_PRIi64='$d_PRIi64'
19654 d_PRIo64='$d_PRIo64'
19655 d_PRIu64='$d_PRIu64'
19656 d_PRIx64='$d_PRIx64'
19657 d_SCNfldbl='$d_SCNfldbl'
19658 d__fwalk='$d__fwalk'
19659 d_access='$d_access'
19660 d_accessx='$d_accessx'
19662 d_archlib='$d_archlib'
19663 d_asctime_r='$d_asctime_r'
19666 d_attribut='$d_attribut'
19670 d_bsdgetpgrp='$d_bsdgetpgrp'
19671 d_bsdsetpgrp='$d_bsdsetpgrp'
19673 d_casti32='$d_casti32'
19674 d_castneg='$d_castneg'
19675 d_charvspr='$d_charvspr'
19677 d_chroot='$d_chroot'
19678 d_chsize='$d_chsize'
19680 d_closedir='$d_closedir'
19681 d_cmsghdr_s='$d_cmsghdr_s'
19684 d_crypt_r='$d_crypt_r'
19686 d_ctermid_r='$d_ctermid_r'
19687 d_ctime_r='$d_ctime_r'
19688 d_cuserid='$d_cuserid'
19689 d_dbl_dig='$d_dbl_dig'
19690 d_dbminitproto='$d_dbminitproto'
19691 d_difftime='$d_difftime'
19693 d_dirnamlen='$d_dirnamlen'
19694 d_dlerror='$d_dlerror'
19695 d_dlopen='$d_dlopen'
19696 d_dlsymun='$d_dlsymun'
19697 d_dosuid='$d_dosuid'
19698 d_drand48_r='$d_drand48_r'
19699 d_drand48proto='$d_drand48proto'
19701 d_eaccess='$d_eaccess'
19702 d_endgrent='$d_endgrent'
19703 d_endgrent_r='$d_endgrent_r'
19704 d_endhent='$d_endhent'
19705 d_endhostent_r='$d_endhostent_r'
19706 d_endnent='$d_endnent'
19707 d_endnetent_r='$d_endnetent_r'
19708 d_endpent='$d_endpent'
19709 d_endprotoent_r='$d_endprotoent_r'
19710 d_endpwent='$d_endpwent'
19711 d_endpwent_r='$d_endpwent_r'
19712 d_endsent='$d_endsent'
19713 d_endservent_r='$d_endservent_r'
19714 d_eofnblk='$d_eofnblk'
19715 d_eunice='$d_eunice'
19716 d_fchdir='$d_fchdir'
19717 d_fchmod='$d_fchmod'
19718 d_fchown='$d_fchown'
19720 d_fcntl_can_lock='$d_fcntl_can_lock'
19721 d_fd_macros='$d_fd_macros'
19722 d_fd_set='$d_fd_set'
19723 d_fds_bits='$d_fds_bits'
19724 d_fgetpos='$d_fgetpos'
19725 d_finite='$d_finite'
19726 d_finitel='$d_finitel'
19727 d_flexfnam='$d_flexfnam'
19729 d_flockproto='$d_flockproto'
19731 d_fp_class='$d_fp_class'
19732 d_fpathconf='$d_fpathconf'
19733 d_fpclass='$d_fpclass'
19734 d_fpclassify='$d_fpclassify'
19735 d_fpclassl='$d_fpclassl'
19736 d_fpos64_t='$d_fpos64_t'
19737 d_frexpl='$d_frexpl'
19738 d_fs_data_s='$d_fs_data_s'
19739 d_fseeko='$d_fseeko'
19740 d_fsetpos='$d_fsetpos'
19741 d_fstatfs='$d_fstatfs'
19742 d_fstatvfs='$d_fstatvfs'
19744 d_ftello='$d_ftello'
19746 d_getcwd='$d_getcwd'
19747 d_getespwnam='$d_getespwnam'
19748 d_getfsstat='$d_getfsstat'
19749 d_getgrent='$d_getgrent'
19750 d_getgrent_r='$d_getgrent_r'
19751 d_getgrgid_r='$d_getgrgid_r'
19752 d_getgrnam_r='$d_getgrnam_r'
19753 d_getgrps='$d_getgrps'
19754 d_gethbyaddr='$d_gethbyaddr'
19755 d_gethbyname='$d_gethbyname'
19756 d_gethent='$d_gethent'
19757 d_gethname='$d_gethname'
19758 d_gethostbyaddr_r='$d_gethostbyaddr_r'
19759 d_gethostbyname_r='$d_gethostbyname_r'
19760 d_gethostent_r='$d_gethostent_r'
19761 d_gethostprotos='$d_gethostprotos'
19762 d_getitimer='$d_getitimer'
19763 d_getlogin='$d_getlogin'
19764 d_getlogin_r='$d_getlogin_r'
19765 d_getmnt='$d_getmnt'
19766 d_getmntent='$d_getmntent'
19767 d_getnbyaddr='$d_getnbyaddr'
19768 d_getnbyname='$d_getnbyname'
19769 d_getnent='$d_getnent'
19770 d_getnetbyaddr_r='$d_getnetbyaddr_r'
19771 d_getnetbyname_r='$d_getnetbyname_r'
19772 d_getnetent_r='$d_getnetent_r'
19773 d_getnetprotos='$d_getnetprotos'
19774 d_getpagsz='$d_getpagsz'
19775 d_getpbyname='$d_getpbyname'
19776 d_getpbynumber='$d_getpbynumber'
19777 d_getpent='$d_getpent'
19778 d_getpgid='$d_getpgid'
19779 d_getpgrp2='$d_getpgrp2'
19780 d_getpgrp='$d_getpgrp'
19781 d_getppid='$d_getppid'
19782 d_getprior='$d_getprior'
19783 d_getprotobyname_r='$d_getprotobyname_r'
19784 d_getprotobynumber_r='$d_getprotobynumber_r'
19785 d_getprotoent_r='$d_getprotoent_r'
19786 d_getprotoprotos='$d_getprotoprotos'
19787 d_getprpwnam='$d_getprpwnam'
19788 d_getpwent='$d_getpwent'
19789 d_getpwent_r='$d_getpwent_r'
19790 d_getpwnam_r='$d_getpwnam_r'
19791 d_getpwuid_r='$d_getpwuid_r'
19792 d_getsbyname='$d_getsbyname'
19793 d_getsbyport='$d_getsbyport'
19794 d_getsent='$d_getsent'
19795 d_getservbyname_r='$d_getservbyname_r'
19796 d_getservbyport_r='$d_getservbyport_r'
19797 d_getservent_r='$d_getservent_r'
19798 d_getservprotos='$d_getservprotos'
19799 d_getspnam='$d_getspnam'
19800 d_getspnam_r='$d_getspnam_r'
19801 d_gettimeod='$d_gettimeod'
19802 d_gmtime_r='$d_gmtime_r'
19803 d_gnulibc='$d_gnulibc'
19804 d_grpasswd='$d_grpasswd'
19805 d_hasmntopt='$d_hasmntopt'
19808 d_inetaton='$d_inetaton'
19809 d_int64_t='$d_int64_t'
19810 d_isascii='$d_isascii'
19811 d_isfinite='$d_isfinite'
19814 d_isnanl='$d_isnanl'
19815 d_killpg='$d_killpg'
19816 d_lchown='$d_lchown'
19817 d_ldbl_dig='$d_ldbl_dig'
19819 d_localtime_r='$d_localtime_r'
19820 d_locconv='$d_locconv'
19822 d_longdbl='$d_longdbl'
19823 d_longlong='$d_longlong'
19824 d_lseekproto='$d_lseekproto'
19826 d_madvise='$d_madvise'
19828 d_mbstowcs='$d_mbstowcs'
19829 d_mbtowc='$d_mbtowc'
19830 d_memchr='$d_memchr'
19831 d_memcmp='$d_memcmp'
19832 d_memcpy='$d_memcpy'
19833 d_memmove='$d_memmove'
19834 d_memset='$d_memset'
19836 d_mkdtemp='$d_mkdtemp'
19837 d_mkfifo='$d_mkfifo'
19838 d_mkstemp='$d_mkstemp'
19839 d_mkstemps='$d_mkstemps'
19840 d_mktime='$d_mktime'
19843 d_modfl_pow32_bug='$d_modfl_pow32_bug'
19844 d_mprotect='$d_mprotect'
19846 d_msg_ctrunc='$d_msg_ctrunc'
19847 d_msg_dontroute='$d_msg_dontroute'
19848 d_msg_oob='$d_msg_oob'
19849 d_msg_peek='$d_msg_peek'
19850 d_msg_proxy='$d_msg_proxy'
19851 d_msgctl='$d_msgctl'
19852 d_msgget='$d_msgget'
19853 d_msghdr_s='$d_msghdr_s'
19854 d_msgrcv='$d_msgrcv'
19855 d_msgsnd='$d_msgsnd'
19857 d_munmap='$d_munmap'
19858 d_mymalloc='$d_mymalloc'
19860 d_nl_langinfo='$d_nl_langinfo'
19861 d_nv_preserves_uv='$d_nv_preserves_uv'
19862 d_off64_t='$d_off64_t'
19863 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
19864 d_oldpthreads='$d_oldpthreads'
19865 d_oldsock='$d_oldsock'
19867 d_pathconf='$d_pathconf'
19869 d_perl_otherlibdirs='$d_perl_otherlibdirs'
19870 d_phostname='$d_phostname'
19873 d_portable='$d_portable'
19874 d_procselfexe='$d_procselfexe'
19875 d_pthread_atfork='$d_pthread_atfork'
19876 d_pthread_yield='$d_pthread_yield'
19878 d_pwchange='$d_pwchange'
19879 d_pwclass='$d_pwclass'
19880 d_pwcomment='$d_pwcomment'
19881 d_pwexpire='$d_pwexpire'
19882 d_pwgecos='$d_pwgecos'
19883 d_pwpasswd='$d_pwpasswd'
19884 d_pwquota='$d_pwquota'
19887 d_random_r='$d_random_r'
19888 d_readdir64_r='$d_readdir64_r'
19889 d_readdir='$d_readdir'
19890 d_readdir_r='$d_readdir_r'
19891 d_readlink='$d_readlink'
19893 d_recvmsg='$d_recvmsg'
19894 d_rename='$d_rename'
19895 d_rewinddir='$d_rewinddir'
19897 d_safebcpy='$d_safebcpy'
19898 d_safemcpy='$d_safemcpy'
19899 d_sanemcmp='$d_sanemcmp'
19900 d_sbrkproto='$d_sbrkproto'
19901 d_sched_yield='$d_sched_yield'
19902 d_scm_rights='$d_scm_rights'
19903 d_seekdir='$d_seekdir'
19904 d_select='$d_select'
19906 d_semctl='$d_semctl'
19907 d_semctl_semid_ds='$d_semctl_semid_ds'
19908 d_semctl_semun='$d_semctl_semun'
19909 d_semget='$d_semget'
19911 d_sendmsg='$d_sendmsg'
19912 d_setegid='$d_setegid'
19913 d_seteuid='$d_seteuid'
19914 d_setgrent='$d_setgrent'
19915 d_setgrent_r='$d_setgrent_r'
19916 d_setgrps='$d_setgrps'
19917 d_sethent='$d_sethent'
19918 d_sethostent_r='$d_sethostent_r'
19919 d_setitimer='$d_setitimer'
19920 d_setlinebuf='$d_setlinebuf'
19921 d_setlocale='$d_setlocale'
19922 d_setlocale_r='$d_setlocale_r'
19923 d_setnent='$d_setnent'
19924 d_setnetent_r='$d_setnetent_r'
19925 d_setpent='$d_setpent'
19926 d_setpgid='$d_setpgid'
19927 d_setpgrp2='$d_setpgrp2'
19928 d_setpgrp='$d_setpgrp'
19929 d_setprior='$d_setprior'
19930 d_setproctitle='$d_setproctitle'
19931 d_setprotoent_r='$d_setprotoent_r'
19932 d_setpwent='$d_setpwent'
19933 d_setpwent_r='$d_setpwent_r'
19934 d_setregid='$d_setregid'
19935 d_setresgid='$d_setresgid'
19936 d_setresuid='$d_setresuid'
19937 d_setreuid='$d_setreuid'
19938 d_setrgid='$d_setrgid'
19939 d_setruid='$d_setruid'
19940 d_setsent='$d_setsent'
19941 d_setservent_r='$d_setservent_r'
19942 d_setsid='$d_setsid'
19943 d_setvbuf='$d_setvbuf'
19947 d_shmatprototype='$d_shmatprototype'
19948 d_shmctl='$d_shmctl'
19950 d_shmget='$d_shmget'
19951 d_sigaction='$d_sigaction'
19952 d_sigprocmask='$d_sigprocmask'
19953 d_sigsetjmp='$d_sigsetjmp'
19954 d_sockatmark='$d_sockatmark'
19955 d_sockatmarkproto='$d_sockatmarkproto'
19956 d_socket='$d_socket'
19957 d_socklen_t='$d_socklen_t'
19958 d_sockpair='$d_sockpair'
19959 d_socks5_init='$d_socks5_init'
19961 d_srand48_r='$d_srand48_r'
19962 d_srandom_r='$d_srandom_r'
19963 d_sresgproto='$d_sresgproto'
19964 d_sresuproto='$d_sresuproto'
19965 d_statblks='$d_statblks'
19966 d_statfs_f_flags='$d_statfs_f_flags'
19967 d_statfs_s='$d_statfs_s'
19968 d_statvfs='$d_statvfs'
19969 d_stdio_cnt_lval='$d_stdio_cnt_lval'
19970 d_stdio_ptr_lval='$d_stdio_ptr_lval'
19971 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
19972 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
19973 d_stdio_stream_array='$d_stdio_stream_array'
19974 d_stdiobase='$d_stdiobase'
19975 d_stdstdio='$d_stdstdio'
19976 d_strchr='$d_strchr'
19977 d_strcoll='$d_strcoll'
19978 d_strctcpy='$d_strctcpy'
19979 d_strerrm='$d_strerrm'
19980 d_strerror='$d_strerror'
19981 d_strerror_r='$d_strerror_r'
19982 d_strftime='$d_strftime'
19983 d_strtod='$d_strtod'
19984 d_strtol='$d_strtol'
19985 d_strtold='$d_strtold'
19986 d_strtoll='$d_strtoll'
19987 d_strtoq='$d_strtoq'
19988 d_strtoul='$d_strtoul'
19989 d_strtoull='$d_strtoull'
19990 d_strtouq='$d_strtouq'
19991 d_strxfrm='$d_strxfrm'
19992 d_suidsafe='$d_suidsafe'
19993 d_symlink='$d_symlink'
19994 d_syscall='$d_syscall'
19995 d_syscallproto='$d_syscallproto'
19996 d_sysconf='$d_sysconf'
19997 d_sysernlst='$d_sysernlst'
19998 d_syserrlst='$d_syserrlst'
19999 d_system='$d_system'
20000 d_tcgetpgrp='$d_tcgetpgrp'
20001 d_tcsetpgrp='$d_tcsetpgrp'
20002 d_telldir='$d_telldir'
20003 d_telldirproto='$d_telldirproto'
20006 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
20007 d_tm_tm_zone='$d_tm_tm_zone'
20008 d_tmpnam_r='$d_tmpnam_r'
20009 d_truncate='$d_truncate'
20010 d_ttyname_r='$d_ttyname_r'
20011 d_tzname='$d_tzname'
20012 d_u32align='$d_u32align'
20013 d_ualarm='$d_ualarm'
20016 d_union_semun='$d_union_semun'
20017 d_unordered='$d_unordered'
20018 d_usleep='$d_usleep'
20019 d_usleepproto='$d_usleepproto'
20021 d_vendorarch='$d_vendorarch'
20022 d_vendorbin='$d_vendorbin'
20023 d_vendorlib='$d_vendorlib'
20025 d_void_closedir='$d_void_closedir'
20026 d_voidsig='$d_voidsig'
20027 d_voidtty='$d_voidtty'
20028 d_volatile='$d_volatile'
20029 d_vprintf='$d_vprintf'
20031 d_waitpid='$d_waitpid'
20032 d_wcstombs='$d_wcstombs'
20033 d_wctomb='$d_wctomb'
20034 d_writev='$d_writev'
20037 db_hashtype='$db_hashtype'
20038 db_prefixtype='$db_prefixtype'
20039 db_version_major='$db_version_major'
20040 db_version_minor='$db_version_minor'
20041 db_version_patch='$db_version_patch'
20042 defvoidused='$defvoidused'
20043 direntrytype='$direntrytype'
20046 doublesize='$doublesize'
20048 drand48_r_proto='$drand48_r_proto'
20049 dynamic_ext='$dynamic_ext'
20055 endgrent_r_proto='$endgrent_r_proto'
20056 endhostent_r_proto='$endhostent_r_proto'
20057 endnetent_r_proto='$endnetent_r_proto'
20058 endprotoent_r_proto='$endprotoent_r_proto'
20059 endpwent_r_proto='$endpwent_r_proto'
20060 endservent_r_proto='$endservent_r_proto'
20061 eunicefix='$eunicefix'
20064 extensions='$extensions'
20066 fflushNULL='$fflushNULL'
20067 fflushall='$fflushall'
20069 firstmakefile='$firstmakefile'
20071 fpossize='$fpossize'
20072 fpostype='$fpostype'
20073 freetype='$freetype'
20076 full_csh='$full_csh'
20077 full_sed='$full_sed'
20078 gccosandvers='$gccosandvers'
20079 gccversion='$gccversion'
20080 getgrent_r_proto='$getgrent_r_proto'
20081 getgrgid_r_proto='$getgrgid_r_proto'
20082 getgrnam_r_proto='$getgrnam_r_proto'
20083 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
20084 gethostbyname_r_proto='$gethostbyname_r_proto'
20085 gethostent_r_proto='$gethostent_r_proto'
20086 getlogin_r_proto='$getlogin_r_proto'
20087 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
20088 getnetbyname_r_proto='$getnetbyname_r_proto'
20089 getnetent_r_proto='$getnetent_r_proto'
20090 getprotobyname_r_proto='$getprotobyname_r_proto'
20091 getprotobynumber_r_proto='$getprotobynumber_r_proto'
20092 getprotoent_r_proto='$getprotoent_r_proto'
20093 getpwent_r_proto='$getpwent_r_proto'
20094 getpwnam_r_proto='$getpwnam_r_proto'
20095 getpwuid_r_proto='$getpwuid_r_proto'
20096 getservbyname_r_proto='$getservbyname_r_proto'
20097 getservbyport_r_proto='$getservbyport_r_proto'
20098 getservent_r_proto='$getservent_r_proto'
20099 getspnam_r_proto='$getspnam_r_proto'
20100 gidformat='$gidformat'
20106 gmtime_r_proto='$gmtime_r_proto'
20108 groupcat='$groupcat'
20109 groupstype='$groupstype'
20112 h_sysfile='$h_sysfile'
20123 i_arpainet='$i_arpainet'
20124 i_bsdioctl='$i_bsdioctl'
20128 i_dirent='$i_dirent'
20134 i_fp_class='$i_fp_class'
20137 i_ieeefp='$i_ieeefp'
20138 i_inttypes='$i_inttypes'
20139 i_langinfo='$i_langinfo'
20140 i_libutil='$i_libutil'
20141 i_limits='$i_limits'
20142 i_locale='$i_locale'
20143 i_machcthr='$i_machcthr'
20144 i_malloc='$i_malloc'
20146 i_memory='$i_memory'
20147 i_mntent='$i_mntent'
20150 i_neterrno='$i_neterrno'
20151 i_netinettcp='$i_netinettcp'
20155 i_pthread='$i_pthread'
20157 i_rpcsvcdbm='$i_rpcsvcdbm'
20160 i_shadow='$i_shadow'
20162 i_stdarg='$i_stdarg'
20163 i_stddef='$i_stddef'
20164 i_stdlib='$i_stdlib'
20165 i_string='$i_string'
20166 i_sunmath='$i_sunmath'
20167 i_sysaccess='$i_sysaccess'
20168 i_sysdir='$i_sysdir'
20169 i_sysfile='$i_sysfile'
20170 i_sysfilio='$i_sysfilio'
20172 i_sysioctl='$i_sysioctl'
20173 i_syslog='$i_syslog'
20174 i_sysmman='$i_sysmman'
20175 i_sysmode='$i_sysmode'
20176 i_sysmount='$i_sysmount'
20177 i_sysndir='$i_sysndir'
20178 i_sysparam='$i_sysparam'
20179 i_sysresrc='$i_sysresrc'
20180 i_syssecrt='$i_syssecrt'
20181 i_sysselct='$i_sysselct'
20182 i_syssockio='$i_syssockio'
20183 i_sysstat='$i_sysstat'
20184 i_sysstatfs='$i_sysstatfs'
20185 i_sysstatvfs='$i_sysstatvfs'
20186 i_systime='$i_systime'
20187 i_systimek='$i_systimek'
20188 i_systimes='$i_systimes'
20189 i_systypes='$i_systypes'
20190 i_sysuio='$i_sysuio'
20192 i_sysutsname='$i_sysutsname'
20193 i_sysvfs='$i_sysvfs'
20194 i_syswait='$i_syswait'
20195 i_termio='$i_termio'
20196 i_termios='$i_termios'
20198 i_unistd='$i_unistd'
20201 i_values='$i_values'
20202 i_varargs='$i_varargs'
20203 i_varhdr='$i_varhdr'
20205 ignore_versioned_solibs='$ignore_versioned_solibs'
20206 inc_version_list='$inc_version_list'
20207 inc_version_list_init='$inc_version_list_init'
20210 installarchlib='$installarchlib'
20211 installbin='$installbin'
20212 installman1dir='$installman1dir'
20213 installman3dir='$installman3dir'
20214 installprefix='$installprefix'
20215 installprefixexp='$installprefixexp'
20216 installprivlib='$installprivlib'
20217 installscript='$installscript'
20218 installsitearch='$installsitearch'
20219 installsitebin='$installsitebin'
20220 installsitelib='$installsitelib'
20221 installstyle='$installstyle'
20222 installusrbinperl='$installusrbinperl'
20223 installvendorarch='$installvendorarch'
20224 installvendorbin='$installvendorbin'
20225 installvendorlib='$installvendorlib'
20227 issymlink='$issymlink'
20228 ivdformat='$ivdformat'
20231 known_extensions='$known_extensions'
20234 lddlflags='$lddlflags'
20236 ldflags_uselargefiles='$ldflags_uselargefiles'
20237 ldlibpthname='$ldlibpthname'
20244 libsdirs='$libsdirs'
20245 libsfiles='$libsfiles'
20246 libsfound='$libsfound'
20247 libspath='$libspath'
20248 libswanted='$libswanted'
20249 libswanted_uselargefiles='$libswanted_uselargefiles'
20255 localtime_r_proto='$localtime_r_proto'
20256 locincpth='$locincpth'
20257 loclibpth='$loclibpth'
20258 longdblsize='$longdblsize'
20259 longlongsize='$longlongsize'
20260 longsize='$longsize'
20264 lseeksize='$lseeksize'
20265 lseektype='$lseektype'
20269 make_set_make='$make_set_make'
20270 mallocobj='$mallocobj'
20271 mallocsrc='$mallocsrc'
20272 malloctype='$malloctype'
20274 man1direxp='$man1direxp'
20277 man3direxp='$man3direxp'
20279 mips_type='$mips_type'
20281 mmaptype='$mmaptype'
20282 modetype='$modetype'
20284 multiarch='$multiarch'
20286 myarchname='$myarchname'
20287 mydomain='$mydomain'
20288 myhostname='$myhostname'
20291 need_va_copy='$need_va_copy'
20292 netdb_hlen_type='$netdb_hlen_type'
20293 netdb_host_type='$netdb_host_type'
20294 netdb_name_type='$netdb_name_type'
20295 netdb_net_type='$netdb_net_type'
20298 nm_so_opt='$nm_so_opt'
20299 nonxs_ext='$nonxs_ext'
20301 nvEUformat='$nvEUformat'
20302 nvFUformat='$nvFUformat'
20303 nvGUformat='$nvGUformat'
20304 nv_preserves_uv_bits='$nv_preserves_uv_bits'
20305 nveformat='$nveformat'
20306 nvfformat='$nvfformat'
20307 nvgformat='$nvgformat'
20310 o_nonblock='$o_nonblock'
20312 old_pthread_create_joinable='$old_pthread_create_joinable'
20313 optimize='$optimize'
20314 orderlib='$orderlib'
20317 otherlibdirs='$otherlibdirs'
20321 patchlevel='$patchlevel'
20322 path_sep='$path_sep'
20325 perl_patchlevel='$perl_patchlevel'
20326 perladmin='$perladmin'
20327 perllibs='$perllibs'
20328 perlpath='$perlpath'
20330 phostname='$phostname'
20333 pm_apiversion='$pm_apiversion'
20337 prefixexp='$prefixexp'
20339 privlibexp='$privlibexp'
20340 procselfexe='$procselfexe'
20341 prototype='$prototype'
20343 quadkind='$quadkind'
20344 quadtype='$quadtype'
20345 randbits='$randbits'
20346 randfunc='$randfunc'
20347 random_r_proto='$random_r_proto'
20348 randseedtype='$randseedtype'
20350 rd_nodata='$rd_nodata'
20351 readdir64_r_proto='$readdir64_r_proto'
20352 readdir_r_proto='$readdir_r_proto'
20353 revision='$revision'
20358 sPRIEUldbl='$sPRIEUldbl'
20359 sPRIFUldbl='$sPRIFUldbl'
20360 sPRIGUldbl='$sPRIGUldbl'
20361 sPRIXU64='$sPRIXU64'
20363 sPRIeldbl='$sPRIeldbl'
20364 sPRIfldbl='$sPRIfldbl'
20365 sPRIgldbl='$sPRIgldbl'
20370 sSCNfldbl='$sSCNfldbl'
20371 sched_yield='$sched_yield'
20372 scriptdir='$scriptdir'
20373 scriptdirexp='$scriptdirexp'
20375 seedfunc='$seedfunc'
20376 selectminbits='$selectminbits'
20377 selecttype='$selecttype'
20378 sendmail='$sendmail'
20379 setgrent_r_proto='$setgrent_r_proto'
20380 sethostent_r_proto='$sethostent_r_proto'
20381 setlocale_r_proto='$setlocale_r_proto'
20382 setnetent_r_proto='$setnetent_r_proto'
20383 setprotoent_r_proto='$setprotoent_r_proto'
20384 setpwent_r_proto='$setpwent_r_proto'
20385 setservent_r_proto='$setservent_r_proto'
20388 sharpbang='$sharpbang'
20389 shmattype='$shmattype'
20390 shortsize='$shortsize'
20393 sig_count='$sig_count'
20394 sig_name='$sig_name'
20395 sig_name_init='$sig_name_init'
20397 sig_num_init='$sig_num_init'
20398 sig_size='$sig_size'
20399 signal_t='$signal_t'
20400 sitearch='$sitearch'
20401 sitearchexp='$sitearchexp'
20403 sitebinexp='$sitebinexp'
20405 sitelib_stem='$sitelib_stem'
20406 sitelibexp='$sitelibexp'
20407 siteprefix='$siteprefix'
20408 siteprefixexp='$siteprefixexp'
20409 sizesize='$sizesize'
20410 sizetype='$sizetype'
20414 sockethdr='$sockethdr'
20415 socketlib='$socketlib'
20416 socksizetype='$socksizetype'
20418 spackage='$spackage'
20419 spitshell='$spitshell'
20420 srand48_r_proto='$srand48_r_proto'
20421 srandom_r_proto='$srandom_r_proto'
20423 ssizetype='$ssizetype'
20424 startperl='$startperl'
20426 static_ext='$static_ext'
20428 stdio_base='$stdio_base'
20429 stdio_bufsiz='$stdio_bufsiz'
20430 stdio_cnt='$stdio_cnt'
20431 stdio_filbuf='$stdio_filbuf'
20432 stdio_ptr='$stdio_ptr'
20433 stdio_stream_array='$stdio_stream_array'
20434 strerror_r_proto='$strerror_r_proto'
20437 subversion='$subversion'
20441 targetarch='$targetarch'
20445 timeincl='$timeincl'
20446 timetype='$timetype'
20447 tmpnam_r_proto='$tmpnam_r_proto'
20453 ttyname_r_proto='$ttyname_r_proto'
20462 uidformat='$uidformat'
20468 uquadtype='$uquadtype'
20469 use5005threads='$use5005threads'
20470 use64bitall='$use64bitall'
20471 use64bitint='$use64bitint'
20472 usecrosscompile='$usecrosscompile'
20474 useithreads='$useithreads'
20475 uselargefiles='$uselargefiles'
20476 uselongdouble='$uselongdouble'
20477 usemorebits='$usemorebits'
20478 usemultiplicity='$usemultiplicity'
20479 usemymalloc='$usemymalloc'
20481 useopcode='$useopcode'
20482 useperlio='$useperlio'
20483 useposix='$useposix'
20484 usereentrant='$usereentrant'
20486 useshrplib='$useshrplib'
20487 usesocks='$usesocks'
20488 usethreads='$usethreads'
20489 usevendorprefix='$usevendorprefix'
20490 usevfork='$usevfork'
20493 uvXUformat='$uvXUformat'
20494 uvoformat='$uvoformat'
20497 uvuformat='$uvuformat'
20498 uvxformat='$uvxformat'
20499 vendorarch='$vendorarch'
20500 vendorarchexp='$vendorarchexp'
20501 vendorbin='$vendorbin'
20502 vendorbinexp='$vendorbinexp'
20503 vendorlib='$vendorlib'
20504 vendorlib_stem='$vendorlib_stem'
20505 vendorlibexp='$vendorlibexp'
20506 vendorprefix='$vendorprefix'
20507 vendorprefixexp='$vendorprefixexp'
20509 version_patchlevel_string='$version_patchlevel_string'
20510 versiononly='$versiononly'
20512 voidflags='$voidflags'
20514 xs_apiversion='$xs_apiversion'
20516 yaccflags='$yaccflags'
20521 : Add in command line options if available
20522 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
20524 : add special variables
20525 $test -f $src/patchlevel.h && \
20526 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
20527 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
20528 echo "PERL_CONFIG_SH=true" >>config.sh
20530 : propagate old symbols
20531 if $test -f UU/config.sh; then
20532 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
20533 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
20534 $sort | $uniq -u >UU/oldsyms
20535 set X `cat UU/oldsyms`
20541 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
20543 echo "# Variables propagated from previous config.sh file." >>config.sh
20544 for sym in `cat UU/oldsyms`; do
20545 echo " Propagating $hint variable "'$'"$sym..."
20546 eval 'tmp="$'"${sym}"'"'
20548 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
20554 : Finish up by extracting the .SH files
20558 echo "Extraction done."
20568 If you'd like to make any changes to the config.sh file before I begin
20569 to configure things, do it as a shell escape now (e.g. !vi config.sh).
20572 rp="Press return or use a shell escape to edit config.sh:"
20577 *) : in case they cannot read
20578 sh 1>&4 -c "$ans";;
20583 : if this fails, just run all the .SH files by hand
20592 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
20599 Now you need to generate make dependencies by running "$make depend".
20600 You might prefer to run it in background: "$make depend > makedepend.out &"
20601 It can take a while, so you might not want to run it right now.
20606 rp="Run $make depend now?"
20610 $make depend && echo "Now you must run '$make'."
20613 echo "You must run '$make depend' then '$make'."
20616 elif test -f [Mm]akefile; then
20618 echo "Now you must run a $make."
20620 echo "Configure done."
20623 if $test -f Policy.sh; then
20626 If you compile $package on a different machine or from a different object
20627 directory, copy the Policy.sh file from this object directory to the
20628 new one before you run Configure -- this will help you with most of
20629 the policy defaults.
20633 if $test -f config.msg; then
20634 echo "Hmm. I also noted the following information while running:"
20636 $cat config.msg >&4
20639 $rm -f kit*isdone ark*isdone