3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Sat May 11 22:27:01 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
1863 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1869 : compute the number of columns on the terminal for proper question formatting
1874 : set up the echo used in my read
1875 myecho="case \"\$xxxm\" in
1876 '') echo $n \"\$rp $c\" >&4;;
1878 '') echo $n \"[\$xxxm] $c\";;
1880 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1882 echo $n \"[\$xxxm] $c\" >&4
1884 echo $n \"\$rp [\$xxxm] $c\" >&4
1890 : now set up to do reads with possible shell escape and default assignment
1896 case "\$fastread" in
1897 yes) case "\$dflt" in
1900 case "\$silent-\$rp" in
1905 *) case "\$silent" in
1906 true) case "\$rp" in
1911 while expr "X\$ans" : "X!" >/dev/null; do
1915 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1923 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1932 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1937 echo "(OK, I'll run with -d after this question.)" >&4
1940 echo "*** Sorry, \$1 not supported yet." >&4
1950 echo "*** Substitution done -- please confirm."
1952 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1957 echo "*** Error -- try again."
1964 case "\$ans\$xxxm\$nostick" in
1976 : create .config dir to save info across Configure sessions
1977 test -d ../.config || mkdir ../.config
1978 cat >../.config/README <<EOF
1979 This directory created by Configure to save information that should
1980 persist across sessions for $package.
1982 You may safely delete it if you wish.
1985 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1987 $define|true|[yY]*) ;;
1988 *) case "$xversion" in
1991 *** WHOA THERE!!! ***
1993 This is an UNSTABLE DEVELOPMENT release.
1994 The version of this $package distribution is $xversion, that is, odd,
1995 (as opposed to even) and that signifies a development release.
1996 If you want a maintenance release, you want an even-numbered version.
1998 Do ***NOT*** install this into production use.
1999 Data corruption and crashes are possible.
2001 It is most seriously suggested that you do not continue any further
2002 unless you want to help in developing and debugging Perl.
2004 If you *still* want to build perl, you can answer 'y' now,
2005 or pass -Dusedevel to Configure.
2008 rp='Do you really want to continue?'
2012 [yY]) echo >&4 "Okay, continuing."
2013 usedevel="$define" ;;
2014 *) echo >&4 "Okay, bye."
2024 case "$versiononly" in
2025 '') versiononly="$define" ;;
2027 case "$installusrbinperl" in
2028 '') installusrbinperl="$undef" ;;
2033 : general instructions
2036 user=`(logname) 2>/dev/null`
2038 '') user=`whoami 2>&1`;;
2040 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2043 rp='Would you like to see the instructions?'
2054 This installation shell script will examine your system and ask you questions
2055 to determine how the perl5 package should be installed. If you get
2056 stuck on a question, you may use a ! shell escape to start a subshell or
2057 execute a command. Many of the questions will have default answers in square
2058 brackets; typing carriage return will give you the default.
2060 On some of the questions which ask for file or directory names you are allowed
2061 to use the ~name construct to specify the login directory belonging to "name",
2062 even if you don't have a shell which knows about that. Questions where this is
2063 allowed will be marked "(~name ok)".
2067 dflt='Type carriage return to continue'
2071 The prompter used in this script allows you to use shell variables and
2072 backticks in your answers. You may use $1, $2, etc... to refer to the words
2073 in the default answer, as if the default line was a set of arguments given to a
2074 script shell. This means you may also use $* to repeat the whole default line,
2075 so you do not have to re-type everything to add something to the default.
2077 Everytime there is a substitution, you will have to confirm. If there is an
2078 error (e.g. an unmatched backtick), the default answer will remain unchanged
2079 and you will be prompted again.
2081 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2082 the questions and use the computed defaults (or the previous answers if there
2083 was already a config.sh file). Type 'Configure -h' for a list of options.
2084 You may also start interactively and then answer '& -d' at any prompt to turn
2085 on the non-interactive behaviour for the remainder of the execution.
2091 Much effort has been expended to ensure that this shell script will run on any
2092 Unix system. If despite that it blows up on yours, your best bet is to edit
2093 Configure and run it again. If you can't run Configure for some reason,
2094 you'll have to generate a config.sh file by hand. Whatever problems you
2095 have, let me (perlbug@perl.org) know how I blew it.
2097 This installation script affects things in two ways:
2099 1) it may do direct variable substitutions on some of the files included
2101 2) it builds a config.h file for inclusion in C programs. You may edit
2102 any of these files as the need arises after running this script.
2104 If you make a mistake on a question, there is no easy way to back up to it
2105 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2106 files. Configure will offer to let you do this before it runs the SH files.
2109 dflt='Type carriage return to continue'
2111 case "$firsttime" in
2112 true) echo $user >>../.config/instruct;;
2116 : find out where common programs are
2118 echo "Locating common programs..." >&4
2131 if test -d \$dir/\$thing; then
2137 for thisthing in \$dir/\$thing; do
2138 : just loop through to pick last item
2140 if test -f \$thisthing; then
2143 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2146 elif test -f \$dir/\$thing.exe; then
2147 if test -n "$DJGPP"; then
2148 echo \$dir/\$thing.exe
2150 : on Eunice apparently
2203 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2204 pth="$pth /lib /usr/lib"
2205 for file in $loclist; do
2209 if test -f "$xxx"; then
2212 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2213 xxx=`./loc $file $file $pth`
2216 '') xxx=`./loc $file $file $pth`;;
2217 *) xxx=`./loc $xxx $xxx $pth`;;
2219 eval $file=$xxx$_exe
2223 echo $file is in $xxx.
2226 echo $file is in $xxx.
2229 echo "I don't know where '$file' is, and my life depends on it." >&4
2230 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2236 echo "Don't worry if any of the following aren't found..."
2238 for file in $trylist; do
2242 if test -f "$xxx"; then
2245 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2246 xxx=`./loc $file $file $pth`
2249 '') xxx=`./loc $file $file $pth`;;
2250 *) xxx=`./loc $xxx $xxx $pth`;;
2252 eval $file=$xxx$_exe
2256 echo $file is in $xxx.
2259 echo $file is in $xxx.
2262 echo "I don't see $file out there, $say."
2269 echo "Substituting grep for egrep."
2276 echo "Substituting cp for ln."
2285 echo "I can't find make or gmake, and my life depends on it." >&4
2286 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2294 *) # We can't have osname yet.
2295 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2296 # Assume that gmake, if found, is definitely GNU make
2297 # and prefer it over the system make.
2298 echo "Substituting gmake for make."
2306 echo "Hopefully test is built into your sh."
2309 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2310 echo "Using the test built into your sh."
2318 echo "Hopefully echo is built into your sh."
2323 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2324 $echo $n "hi there$c" >foo1
2325 echo $n "hi there$c" >foo2
2326 if cmp foo1 foo2 >/dev/null 2>&1; then
2327 echo "They are compatible. In fact, they may be identical."
2334 They are not compatible! You are probably running ksh on a non-USG system.
2335 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2336 have echo built in and we may have to run some Bourne shell scripts. That
2337 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2340 $echo $n "The star should be here-->$c"
2350 cat <<'EOSC' >>trygcc
2355 int main(int argc, char *argv[]) {
2359 if $cc -o try $ccflags $ldflags try.c; then
2362 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2368 case "`$cc -v -c try.c 2>&1`" in
2371 if $test X"$trygcc" = Xyes; then
2372 if gcc -o try -c try.c; then
2374 echo "You seem to have a working gcc, though." >&4
2375 rp="Would you like to use it?"
2377 if $test -f myread; then
2380 if $test -f UU/myread; then
2383 echo "Cannot find myread, sorry. Aborting." >&2
2388 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2389 if $test -f usethreads.cbu; then
2392 *** However, any setting of the C compiler flags (e.g. for thread support)
2393 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2394 *** (together with e.g. -Dusethreads).
2410 cat <<'EOSC' >>checkcc
2415 int main(int argc, char *argv[]) {
2419 if $cc -o try $ccflags $ldflags try.c; then
2422 if $test X"$despair" = Xyes; then
2423 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2426 You need to find a working C compiler.
2427 Either (purchase and) install the C compiler supplied by your OS vendor,
2428 or for a free C compiler try http://gcc.gnu.org/
2429 I cannot continue any further, aborting.
2438 : determine whether symbolic links are supported
2441 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2442 echo "Symbolic links are supported." >&4
2445 echo "Symbolic links are NOT supported." >&4
2450 : determine whether symbolic links are supported
2454 echo "Checking how to test for symbolic links..." >&4
2456 if $test "X$issymlink" = X; then
2458 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2459 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2461 if test $? = 0; then
2464 echo "Your builtin 'test -h' may be broken." >&4
2467 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2470 if test -f "$p/$test"; then
2479 echo "Trying external '$test -h'." >&4
2480 issymlink="$test -h"
2481 if $test ! -h sym >/dev/null 2>&1; then
2482 echo "External '$test -h' is broken, too." >&4
2490 if $test "X$issymlink" = X; then
2491 if $test -L sym 2>/dev/null; then
2492 issymlink="$test -L"
2493 echo "The builtin '$test -L' worked." >&4
2496 if $test "X$issymlink" != X; then
2497 echo "You can test for symbolic links with '$issymlink'." >&4
2499 echo "I do not know how you can test for symbolic links." >&4
2503 *) echo "No symbolic links, so not testing for their testing..." >&4
2509 case "$mksymlinks" in
2512 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2515 *) case "$lns:$issymlink" in
2516 *"ln"*" -s:"*"test -"?)
2517 echo "Creating the symbolic links..." >&4
2518 echo "(First creating the subdirectories...)" >&4
2520 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2522 test -z "$directory" && break
2526 if test ! -d t/base; then
2527 echo "Failed to create the subdirectories. Aborting." >&4
2530 echo "(Then creating the symlinks...)" >&4
2531 awk '{print $1}' $src/MANIFEST | while true; do
2533 test -z "$filename" && break
2534 if test -f $filename; then
2535 if $issymlink $filename; then
2539 if test -f $filename; then
2540 echo "$filename already exists, not symlinking."
2542 ln -s $src/$filename $filename
2546 if test ! -f t/base/lex.t; then
2547 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2552 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2561 case "$usecrosscompile" in
2563 $echo "Cross-compiling..."
2566 *-*-gcc) # A cross-compiling gcc, probably.
2567 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2569 # leave out ld, choosing it is more complex
2571 ranlib=$targetarch-ranlib
2572 $echo 'extern int foo;' > try.c
2573 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2575 if $test $# -gt 0; then
2577 incpth="`$echo $incpth|$sed 's/^ //'`"
2578 echo "Guessing incpth '$incpth'." >&4
2580 j="`$echo $i|$sed 's,/include$,/lib,'`"
2581 if $test -d $j; then
2585 libpth="`$echo $libpth|$sed 's/^ //'`"
2586 echo "Guessing libpth '$libpth'." >&4
2591 case "$targetarch" in
2592 '') echo "Targetarch not defined." >&4; croak=y ;;
2593 *) echo "Using targetarch $targetarch." >&4 ;;
2596 '') echo "Incpth not defined." >&4; croak=y ;;
2597 *) echo "Using incpth '$incpth'." >&4 ;;
2600 '') echo "Libpth not defined." >&4; croak=y ;;
2601 *) echo "Using libpth '$libpth'." >&4 ;;
2604 '') for i in $incpth; do
2605 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2607 echo "Guessing usrinc $usrinc." >&4
2612 '') echo "Usrinc not defined." >&4; croak=y ;;
2615 *) echo "Using usrinc $usrinc." >&4 ;;
2617 case "$targethost" in
2618 '') echo "Targethost not defined." >&4; croak=y ;;
2619 *) echo "Using targethost $targethost." >&4
2624 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2627 /*) run=$src/Cross/run
2628 targetmkdir=$src/Cross/mkdir
2630 from=$src/Cross/from
2632 *) pwd=`$test -f ../Configure & cd ..; pwd`
2634 targetmkdir=$pwd/Cross/mkdir
2636 from=$pwd/Cross/from
2639 case "$targetrun" in
2640 '') targetrun=ssh ;;
2645 case "$targetfrom" in
2646 '') targetfrom=scp ;;
2650 from=$from-$targetfrom
2651 case "$targetdir" in
2653 echo "Guessing targetdir $targetdir." >&4
2656 case "$targetuser" in
2658 echo "Guessing targetuser $targetuser." >&4
2661 case "$targetfrom" in
2665 case "$targetrun" in
2677 '') cwd=$targetdir ;;
2681 if $test ! -f \$exe.xok; then
2685 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2688 *) echo "Unknown targetrun '$targetrun'" >&4
2692 case "$targetmkdir" in
2694 cat >$targetmkdir <<EOF
2696 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2698 $chmod a+rx $targetmkdir
2700 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2712 $targetmkdir \`dirname \$f\`
2713 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2716 $targetmkdir $targetdir/\`dirname \$f\`
2717 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2730 $mkdir -p $targetdir/\`dirname \$f\`
2731 $cp \$f $targetdir/\$f || exit 1
2734 $targetmkdir $targetdir/\`dirname \$f\`
2735 $cp \$f $targetdir/\$f || exit 1
2742 *) echo "Unknown targetto '$targetto'" >&4
2746 case "$targetfrom" in
2753 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2758 cp) cat >$from <<EOF
2763 cp $targetdir/\$f . || exit 1
2768 *) echo "Unknown targetfrom '$targetfrom'" >&4
2772 if $test ! -f $run; then
2773 echo "Target 'run' script '$run' not found." >&4
2777 if $test ! -f $to; then
2778 echo "Target 'to' script '$to' not found." >&4
2782 if $test ! -f $from; then
2783 echo "Target 'from' script '$from' not found." >&4
2787 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2791 Using '$run' for remote execution,
2792 and '$from' and '$to'
2793 for remote file transfer.
2799 usecrosscompile='undef'
2804 : see whether [:lower:] and [:upper:] are supported character classes
2806 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2808 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2812 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2813 # (0xc9 and 0xd1), therefore that is a nice testing point.
2814 if test "X$up" = X -o "X$low" = X; then
2815 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2821 if test "X$up" = X -o "X$low" = X; then
2822 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2828 if test "X$up" = X -o "X$low" = X; then
2829 case "`echo IJ | od -x 2>/dev/null`" in
2831 echo "Hey, this might be EBCDIC." >&4
2832 if test "X$up" = X -o "X$low" = X; then
2833 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2834 ij) up='[A-IJ-RS-Z]'
2839 if test "X$up" = X -o "X$low" = X; then
2840 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2850 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2852 echo "Using $up and $low to convert case." >&4
2855 echo "I don't know how to translate letters from upper to lower case." >&4
2856 echo "Your tr is not acting any way I know of." >&4
2860 : set up the translation script tr, must be called with ./tr of course
2864 '[A-Z][a-z]') exec $tr '$up' '$low';;
2865 '[a-z][A-Z]') exec $tr '$low' '$up';;
2872 : Try to determine whether config.sh was made on this system
2873 case "$config_sh" in
2875 myuname=`$uname -a 2>/dev/null`
2876 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2877 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2878 # because the A-Z/a-z are not consecutive.
2879 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2880 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2881 newmyuname="$myuname"
2883 case "$knowitall" in
2885 if test -f ../config.sh; then
2886 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2887 eval "`grep myuname= ../config.sh`"
2889 if test "X$myuname" = "X$newmyuname"; then
2897 : Get old answers from old config file if Configure was run on the
2898 : same system, otherwise use the hints.
2901 if test -f config.sh; then
2903 rp="I see a config.sh file. Shall I use it to set the defaults?"
2906 n*|N*) echo "OK, I'll ignore it."
2907 mv config.sh config.sh.old
2908 myuname="$newmyuname"
2910 *) echo "Fetching default answers from your old config.sh file..." >&4
2918 : Older versions did not always set $sh. Catch re-use of such
2928 if test ! -f config.sh; then
2931 First time through, eh? I have some defaults handy for some systems
2932 that need some extra help getting the Configure answers right:
2935 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2937 : Half the following guesses are probably wrong... If you have better
2938 : tests or hints, please send them to perlbug@perl.org
2939 : The metaconfig authors would also appreciate a copy...
2940 $test -f /irix && osname=irix
2941 $test -f /xenix && osname=sco_xenix
2942 $test -f /dynix && osname=dynix
2943 $test -f /dnix && osname=dnix
2944 $test -f /lynx.os && osname=lynxos
2945 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2946 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2947 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2948 $test -f /bin/mips && /bin/mips && osname=mips
2949 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2950 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2951 $test -d /usr/apollo/bin && osname=apollo
2952 $test -f /etc/saf/_sactab && osname=svr4
2953 $test -d /usr/include/minix && osname=minix
2954 $test -f /system/gnu_library/bin/ar.pm && osname=vos
2955 if $test -d /MachTen -o -d /MachTen_Folder; then
2957 if $test -x /sbin/version; then
2958 osvers=`/sbin/version | $awk '{print $2}' |
2959 $sed -e 's/[A-Za-z]$//'`
2960 elif $test -x /usr/etc/version; then
2961 osvers=`/usr/etc/version | $awk '{print $2}' |
2962 $sed -e 's/[A-Za-z]$//'`
2968 $test -f /sys/posix.dll &&
2969 $test -f /usr/bin/what &&
2970 set X `/usr/bin/what /sys/posix.dll` &&
2971 $test "$3" = UWIN &&
2975 if $test -f $uname; then
2983 umips) osname=umips ;;
2986 [23]100) osname=mips ;;
2987 next*) osname=next ;;
2989 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2990 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2993 elif $test -f /etc/kconfig; then
2995 if test "$lns" = "$ln -s"; then
2997 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
2999 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3006 if test -n "$DJGPP"; then
3015 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3017 'not found') osvers="$4"."$3" ;;
3018 '<3240'|'<>3240') osvers=3.2.0 ;;
3019 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3020 '=3250'|'>3250') osvers=3.2.5 ;;
3024 bsd386) osname=bsd386
3027 cygwin*) osname=cygwin
3030 *dc.osx) osname=dcosx
3036 domainos) osname=apollo
3042 dynixptx*) osname=dynixptx
3043 osvers=`echo "$4"|sed 's/^v//'`
3045 freebsd) osname=freebsd
3047 genix) osname=genix ;;
3049 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3065 netbsd*) osname=netbsd
3068 news-os) osvers="$3"
3070 4*) osname=newsos4 ;;
3074 next*) osname=next ;;
3075 nonstop-ux) osname=nonstopux ;;
3076 openbsd) osname=openbsd
3079 POSIX-BC | posix-bc ) osname=posix-bc
3082 powerux | power_ux | powermax_os | powermaxos | \
3083 powerunix | power_unix) osname=powerux
3089 solaris) osname=solaris
3091 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3098 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3102 titanos) osname=titanos
3111 ultrix) osname=ultrix
3114 osf1|mls+) case "$5" in
3117 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3120 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3123 hp*) osname=hp_osf1 ;;
3124 mips) osname=mips_osf1 ;;
3127 unixware) osname=svr5
3135 $2) case "$osname" in
3139 : svr4.x or possibly later
3149 if test -f /stand/boot ; then
3150 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3151 if test -n "$INITPROG" -a -f "$INITPROG"; then
3152 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3153 if test -n "$isesix"; then
3161 *) if test -f /etc/systemid; then
3163 set `echo $3 | $sed 's/\./ /g'` $4
3164 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3166 elif $test -f $src/hints/sco_$1_$2.sh; then
3168 elif $test -f $src/hints/sco_$1.sh; then
3173 '') : Still unknown. Probably a generic Sys V.
3182 *) case "$osname" in
3183 '') : Still unknown. Probably a generic BSD.
3191 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3192 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3193 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3196 $rm -f UU/kernel.what
3197 elif test -d c:/.; then
3204 case "$targetarch" in
3207 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3212 : Now look for a hint file osname_osvers, unless one has been
3213 : specified already.
3216 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3217 : Also try without trailing minor version numbers.
3218 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3219 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3220 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3221 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3224 *) case "$osvers" in
3227 *) if $test -f $src/hints/$file.sh ; then
3229 elif $test -f $src/hints/$xfile.sh ; then
3231 elif $test -f $src/hints/$xxfile.sh ; then
3233 elif $test -f $src/hints/$xxxfile.sh ; then
3235 elif $test -f $src/hints/$xxxxfile.sh ; then
3237 elif $test -f "$src/hints/${osname}.sh" ; then
3246 if $test -f Policy.sh ; then
3249 none) dflt="Policy" ;;
3250 *) dflt="Policy $dflt" ;;
3255 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3259 if $test -f Policy.sh ; then
3262 There's also a Policy hint file available, which should make the
3263 site-specific (policy) questions easier to answer.
3270 You may give one or more space-separated answers, or "none" if appropriate.
3271 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3272 is a good thing. DO NOT give a wrong version or a wrong OS.
3276 rp="Which of these apply, if any?"
3279 for file in $tans; do
3280 if $test X$file = XPolicy -a -f Policy.sh; then
3282 $cat Policy.sh >> UU/config.sh
3283 elif $test -f $src/hints/$file.sh; then
3284 . $src/hints/$file.sh
3285 $cat $src/hints/$file.sh >> UU/config.sh
3286 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3289 : Give one chance to correct a possible typo.
3290 echo "$file.sh does not exist"
3292 rp="hint to use instead?"
3294 for file in $ans; do
3295 if $test -f "$src/hints/$file.sh"; then
3296 . $src/hints/$file.sh
3297 $cat $src/hints/$file.sh >> UU/config.sh
3298 elif $test X$ans = X -o X$ans = Xnone ; then
3301 echo "$file.sh does not exist -- ignored."
3308 : Remember our hint file for later.
3309 if $test -f "$src/hints/$file.sh" ; then
3319 echo "Fetching default answers from $config_sh..." >&4
3323 cp $config_sh config.sh 2>/dev/null
3333 test "$override" && . ./optdef.sh
3335 : Restore computed paths
3336 for file in $loclist $trylist; do
3337 eval $file="\$_$file"
3342 Configure uses the operating system name and version to set some defaults.
3343 The default value is probably right if the name rings a bell. Otherwise,
3344 since spelling matters for me, either accept the default or answer "none"
3351 ''|' '|none) dflt=none ;;
3352 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3355 *) dflt="$osname" ;;
3357 rp="Operating system name?"
3361 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3367 ''|' '|none) dflt=none ;;
3368 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3369 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3371 ''|' ') dflt=none ;;
3376 *) dflt="$osvers" ;;
3378 rp="Operating system version?"
3388 : who configured the system
3389 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3390 cf_by=`(logname) 2>/dev/null`
3393 cf_by=`(whoami) 2>/dev/null`
3395 "") cf_by=unknown ;;
3399 : set up the script used to warn in case of inconsistency
3406 echo "*** WHOA THERE!!! ***" >&4
3407 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3408 rp=" Keep the $hint value?"
3411 y) td=$was; tu=$was;;
3415 : function used to set $1 to $val
3416 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3418 $define$undef) . ./whoa; eval "$var=\$td";;
3419 $undef$define) . ./whoa; eval "$var=\$tu";;
3420 *) eval "$var=$val";;
3423 case "$usethreads" in
3424 $define|true|[yY]*) dflt='y';;
3425 *) # Catch case where user specified ithreads or 5005threads but
3426 # forgot -Dusethreads (A.D. 4/2002)
3427 case "$useithreads$use5005threads" in
3428 *$define*) dflt='y' ;;
3435 Perl can be built to take advantage of threads on some systems.
3436 To do so, Configure can be run with -Dusethreads.
3438 Note that Perl built with threading support runs slightly slower
3439 and uses more memory than plain Perl. The current implementation
3440 is believed to be stable, but it is fairly new, and so should be
3441 treated with caution.
3443 If this doesn't make any sense to you, just accept the default '$dflt'.
3445 rp='Build a threading Perl?'
3448 y|Y) val="$define" ;;
3454 case "$usethreads" in
3458 Since release 5.6, Perl has had two different threading implementations,
3459 the newer interpreter-based version (ithreads) with one interpreter per
3460 thread, and the older 5.005 version (5005threads).
3461 The 5005threads version is effectively unmaintained and will probably be
3462 removed in Perl 5.10, so there should be no need to build a Perl using it
3463 unless needed for backwards compatibility with some existing 5.005threads
3467 : Default to ithreads unless overridden on command line or with
3470 case "$use5005threads" in
3471 $define|true|[yY]*) dflt='n';;
3473 case "$useithreads" in
3474 $undef|false|[nN]*) dflt='n';;
3476 rp='Use the newer interpreter-based ithreads?'
3479 y|Y) val="$define" ;;
3484 : Now set use5005threads to the opposite value.
3485 case "$useithreads" in
3486 $define) val="$undef" ;;
3493 useithreads="$undef"
3494 use5005threads="$undef"
3498 case "$useithreads$use5005threads" in
3502 You cannot have both the ithreads and the 5.005 threads enabled
3503 at the same time. Disabling the 5.005 threads since they are
3504 much less stable than the ithreads.
3507 use5005threads="$undef"
3511 case "$d_oldpthreads" in
3512 '') : Configure tests would be welcome here. For now, assume undef.
3514 *) val="$d_oldpthreads" ;;
3520 case "$usethreads" in
3521 "$define"|true|[yY]*)
3522 : Look for a hint-file generated 'call-back-unit'. If the
3523 : user has specified that a threading perl is to be built,
3524 : we may need to set or change some other defaults.
3525 if $test -f usethreads.cbu; then
3526 echo "Your platform has some specific hints for threaded builds, using them..."
3530 (Your platform doesn't have any specific hints for threaded builds.
3531 Assuming POSIX threads, then.)
3539 Perl can be built so that multiple Perl interpreters can coexist
3540 within the same Perl executable.
3543 case "$useithreads" in
3546 This multiple interpreter support is required for interpreter-based threads.
3550 *) case "$usemultiplicity" in
3551 $define|true|[yY]*) dflt='y';;
3555 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3556 rp='Build Perl for multiplicity?'
3559 y|Y) val="$define" ;;
3568 case "$usemorebits" in
3569 "$define"|true|[yY]*)
3570 use64bitint="$define"
3571 uselongdouble="$define"
3572 usemorebits="$define"
3574 *) usemorebits="$undef"
3578 : make some quick guesses about what we are up against
3580 $echo $n "Hmm... $c"
3590 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3591 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3593 echo "Looks kind of like an OSF/1 system, but we'll see..."
3595 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3596 xxx=`./loc addbib blurfl $pth`
3597 if $test -f $xxx; then
3598 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3602 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3603 echo "Looks kind of like an extended USG system, but we'll see..."
3605 echo "Looks kind of like a USG system, but we'll see..."
3609 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3610 echo "Looks kind of like a BSD system, but we'll see..."
3614 echo "Looks kind of like a Version 7 system, but we'll see..."
3617 case "$eunicefix" in
3620 There is, however, a strange, musty smell in the air that reminds me of
3621 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3625 : it so happens the Eunice I know will not run shell scripts in Unix format
3629 echo "Congratulations. You aren't running Eunice."
3633 : Detect OS2. The p_ variable is set above in the Head.U unit.
3634 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3635 : semicolon as a patch separator
3640 I have the feeling something is not exactly right, however...don't tell me...
3641 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3642 (Or you may be running DOS with DJGPP.)
3647 if test -f /xenix; then
3648 echo "Actually, this looks more like a XENIX system..."
3653 echo "It's not Xenix..."
3658 if test -f /venix; then
3659 echo "Actually, this looks more like a VENIX system..."
3666 echo "Nor is it Venix..."
3669 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3670 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3677 rp="Use which C compiler?"
3681 : See if they have not cc but they do have gcc
3683 : Look for a hint-file generated 'call-back-unit'. Now that the
3684 : user has specified the compiler, we may need to set or change some
3686 if $test -f cc.cbu; then
3692 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3698 printf("%s\n", __VERSION__);
3700 printf("%s\n", "1");
3706 if $cc -o try $ccflags $ldflags try.c; then
3707 gccversion=`$run ./try`
3708 case "$gccversion" in
3709 '') echo "You are not using GNU cc." ;;
3710 *) echo "You are using GNU cc $gccversion."
3716 echo "*** WHOA THERE!!! ***" >&4
3717 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3718 case "$knowitall" in
3720 echo " You'd better start hunting for one and let me know about it." >&4
3726 case "$gccversion" in
3727 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3729 case "$gccversion" in
3730 '') gccosandvers='' ;;
3731 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3732 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3734 case "$gccosandvers" in
3735 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3736 $osname$osvers) ;; # looking good
3737 $osname*) cat <<EOM >&4
3739 *** WHOA THERE!!! ***
3741 Your gcc has not been compiled for the exact release of
3742 your operating system ($gccosandvers versus $osname$osvers).
3744 In general it is a good idea to keep gcc synchronized with
3745 the operating system because otherwise serious problems
3746 may ensue when trying to compile software, like Perl.
3748 I'm trying to be optimistic here, though, and will continue.
3749 If later during the configuration and build icky compilation
3750 problems appear (headerfile conflicts being the most common
3751 manifestation), I suggest reinstalling the gcc to match
3752 your operating system release.
3756 *) gccosandvers='' ;; # failed to parse, better be silent
3765 : decide how portable to be. Allow command line overrides.
3766 case "$d_portable" in
3768 *) d_portable="$define" ;;
3771 : set up shell script to do ~ expansion
3777 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3780 if $test -f /bin/csh; then
3781 /bin/csh -f -c "glob \$1"
3786 name=\`$expr x\$1 : '..\([^/]*\)'\`
3787 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3788 if $test ! -d "\$dir"; then
3790 echo "\$me: can't locate home directory for: \$name" >&2
3795 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3811 : now set up to get a file name
3815 cat <<'EOSC' >>getfile
3831 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3832 fn=`echo $fn | sed 's/(.*)//'`
3838 loc_file=`expr $fn : '.*:\(.*\)'`
3839 fn=`expr $fn : '\(.*\):.*'`
3847 */*) fullpath=true;;
3856 *e*) exp_file=true;;
3859 *p*) nopath_ok=true;;
3864 *d*) type='Directory';;
3865 *l*) type='Locate';;
3870 Locate) what='File';;
3875 case "$d_portable" in
3883 while test "$type"; do
3888 true) rp="$rp (~name ok)";;
3891 if test -f UU/getfile.ok && \
3892 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3911 value=`UU/filexp $ans`
3914 if test "$ans" != "$value"; then
3915 echo "(That expands to $value on this system.)"
3929 /*) value="$ansexp" ;;
3930 [a-zA-Z]:/*) value="$ansexp" ;;
3935 echo "I shall only accept a full path name, as in /bin/ls." >&4
3936 echo "Use a ! shell escape if you wish to check pathnames." >&4
3939 echo "Please give a full path name, starting with slash." >&4
3942 echo "Note that using ~name is ok provided it expands well." >&4
3955 for fp in $gfpth; do
3956 if test "X$fp" = X.; then
3961 if test -f "$pf"; then
3963 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3965 echo "($value is not a plain file, but that's ok.)"
3968 if test X"$type" = X; then
3975 for fp in $gfpth; do
3976 if test "X$fp" = X.; then
3981 direxp="$fp/$ansexp"
3983 if test -d "$direxp"; then
3991 if test -d "$ansexp"; then
3992 echo "(Looking for $loc_file in directory $value.)"
3993 value="$value/$loc_file"
3994 ansexp="$ansexp/$loc_file"
3996 if test -f "$ansexp"; then
3999 case "$nopath_ok" in
4000 true) case "$value" in
4002 *) echo "Assuming $value will be in people's path."
4018 if test "$fastread" = yes; then
4023 rp="$what $value doesn't exist. Use that name anyway?"
4042 test "X$gfpthkeep" != Xy && gfpth=""
4045 : What should the include directory be ?
4047 $echo $n "Hmm... $c"
4051 if $test -f /bin/mips && /bin/mips; then
4052 echo "Looks like a MIPS system..."
4053 $cat >usr.c <<'EOCP'
4054 #ifdef SYSTYPE_BSD43
4058 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4059 dflt='/bsd43/usr/include'
4063 mips_type='System V'
4065 $rm -f usr.c usr.out
4066 echo "and you're compiling with the $mips_type compiler and libraries."
4070 echo "Doesn't look like a MIPS system."
4080 case "$xxx_prompt" in
4083 rp='Where are the include files you want to use?'
4091 : see how we invoke the C preprocessor
4093 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4094 cat <<'EOT' >testcpp.c
4100 if test ! -f cppstdin; then
4101 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4102 # AIX cc -E doesn't show the absolute headerfile
4103 # locations but we'll cheat by using the -M flag.
4104 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
4106 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4109 echo "Keeping your $hint cppstdin wrapper."
4112 wrapper=`pwd`/cppstdin
4116 if $test "X$cppstdin" != "X" && \
4117 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4118 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4120 echo "You used to use $cppstdin $cppminus so we'll use that again."
4122 '') echo "But let's see if we can live without a wrapper..." ;;
4124 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4125 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4127 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4130 echo "(However, $cpprun $cpplast does not work, let's see...)"
4138 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4145 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4146 $cc -E <testcpp.c >testcpp.out 2>&1; \
4147 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4148 echo "Yup, it does."
4151 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4152 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4153 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4154 echo "Yup, it does."
4157 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4158 $cc -P <testcpp.c >testcpp.out 2>&1; \
4159 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4160 echo "Yipee, that works!"
4163 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4164 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4165 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4166 echo "At long last!"
4169 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4170 $cpp <testcpp.c >testcpp.out 2>&1; \
4171 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4175 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4176 $cpp - <testcpp.c >testcpp.out 2>&1; \
4177 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4178 echo "Hooray, it works! I was beginning to wonder."
4181 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4182 $wrapper <testcpp.c >testcpp.out 2>&1; \
4183 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4189 rp="No dice. I can't find a C preprocessor. Name one:"
4193 $x_cpp <testcpp.c >testcpp.out 2>&1
4194 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4195 echo "OK, that will do." >&4
4197 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4212 echo "Perhaps can we force $cc -E using a wrapper..."
4213 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4214 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4220 echo "Nope, we'll have to live without it..."
4234 "$wrapper"|'cppstdin') ;;
4235 *) $rm -f $wrapper;;
4237 $rm -f testcpp.c testcpp.out
4239 : Set private lib path
4242 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4247 '') dlist="$loclibpth $plibpth $glibpth";;
4248 *) dlist="$libpth";;
4251 : Now check and see which directories actually exist, avoiding duplicates
4255 if $test -d $xxx; then
4258 *) libpth="$libpth $xxx";;
4264 Some systems have incompatible or broken versions of libraries. Among
4265 the directories listed in the question below, please remove any you
4266 know not to be holding relevant libraries, and add any that are needed.
4267 Say "none" for none.
4278 rp="Directories to use for library searches?"
4285 : compute shared library extension
4288 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4298 On some systems, shared libraries may be available. Answer 'none' if
4299 you want to suppress searching of shared libraries for the remainder
4300 of this configuration.
4303 rp='What is the file extension used for shared libraries?'
4307 : Define several unixisms.
4308 : Hints files or command line option can be used to override them.
4309 : The convoluted testing is in case hints files set either the old
4312 '') case "$exe_ext" in
4314 *) _exe="$exe_ext" ;;
4319 '') case "$lib_ext" in
4326 '') case "$obj_ext" in
4333 '') case "$path_sep" in
4344 : Which makefile gets called first. This is used by make depend.
4345 case "$firstmakefile" in
4346 '') firstmakefile='makefile';;
4350 $define|true|[yY]*) dflt='y';;
4355 Perl can be built to use the SOCKS proxy protocol library. To do so,
4356 Configure must be run with -Dusesocks. If you use SOCKS you also need
4357 to use the PerlIO abstraction layer, this will be implicitly selected.
4359 If this doesn't make any sense to you, just accept the default '$dflt'.
4361 rp='Build Perl for SOCKS?'
4364 y|Y) val="$define" ;;
4371 $define|true|[yY]*) useperlio="$define";;
4374 : Looking for optional libraries
4376 echo "Checking for optional libraries..." >&4
4381 case "$libswanted" in
4382 '') libswanted='c_s';;
4385 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4391 for thisdir in $libpth $xlibpth; do
4392 test -d $thisdir && libspath="$libspath $thisdir"
4394 for thislib in $libswanted; do
4395 for thisdir in $libspath; do
4397 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4398 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4399 $test -f "$xxx" && eval $libscheck
4400 $test -f "$xxx" && libstyle=shared
4402 if test ! -f "$xxx"; then
4403 xxx=$thisdir/lib$thislib.$so
4404 $test -f "$xxx" && eval $libscheck
4405 $test -f "$xxx" && libstyle=shared
4407 if test ! -f "$xxx"; then
4408 xxx=$thisdir/lib$thislib$_a
4409 $test -f "$xxx" && eval $libscheck
4410 $test -f "$xxx" && libstyle=static
4412 if test ! -f "$xxx"; then
4413 xxx=$thisdir/$thislib$_a
4414 $test -f "$xxx" && eval $libscheck
4415 $test -f "$xxx" && libstyle=static
4417 if test ! -f "$xxx"; then
4418 xxx=$thisdir/lib${thislib}_s$_a
4419 $test -f "$xxx" && eval $libscheck
4420 $test -f "$xxx" && libstyle=static
4421 $test -f "$xxx" && thislib=${thislib}_s
4423 if test ! -f "$xxx"; then
4424 xxx=$thisdir/Slib$thislib$_a
4425 $test -f "$xxx" && eval $libscheck
4426 $test -f "$xxx" && libstyle=static
4428 if $test -f "$xxx"; then
4430 shared) echo "Found -l$thislib (shared)." ;;
4431 static) echo "Found -l$thislib." ;;
4432 *) echo "Found -l$thislib ($libstyle)." ;;
4436 *) dflt="$dflt -l$thislib"
4437 libsfound="$libsfound $xxx"
4439 libsfiles="$libsfiles $yyy"
4440 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4441 case " $libsdirs " in
4443 *) libsdirs="$libsdirs $yyy" ;;
4450 if $test ! -f "$xxx"; then
4451 echo "No -l$thislib."
4462 ' '|'') dflt='none';;
4467 In order to compile $package on your machine, a number of libraries
4468 are usually needed. Include any other special libraries here as well.
4469 Say "none" for none. The default list is almost always right.
4473 rp="What libraries to use?"
4480 : determine optimization, if desired, or use for debug flag also
4482 ' '|$undef) dflt='none';;
4484 *) dflt="$optimize";;
4488 By default, $package compiles with the -O flag to use the optimizer.
4489 Alternately, you might want to use the symbolic debugger, which uses
4490 the -g flag (on traditional Unix systems). Either flag can be
4491 specified here. To use neither flag, specify the word "none".
4494 rp="What optimizer/debugger flag should be used?"
4498 'none') optimize=" ";;
4502 : We will not override a previous value, but we might want to
4503 : augment a hint file
4505 default|recommended)
4506 case "$gccversion" in
4507 1*) dflt='-fpcc-struct-return' ;;
4510 *-g*) dflt="$dflt -DDEBUGGING";;
4512 case "$gccversion" in
4513 2*) if test -d /etc/conf/kconfig.d &&
4514 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4520 case "$gccversion" in
4524 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4525 echo 'int main(void) { return 0; }' > gcctest.c
4526 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4527 echo "Yes, it does." 2>&1
4530 echo "Leaving current flags $ccflags alone." 2>&1
4532 *) dflt="$dflt -fno-strict-aliasing" ;;
4535 echo "Nope, it doesn't, but that's ok." 2>&1
4542 case "$mips_type" in
4543 *BSD*|'') inclwanted="$locincpth $usrinc";;
4544 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4546 for thisincl in $inclwanted; do
4547 if $test -d $thisincl; then
4548 if $test x$thisincl != x$usrinc; then
4550 *" -I$thisincl "*);;
4551 *) dflt="$dflt -I$thisincl ";;
4557 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4559 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4567 *) dflt="$dflt -D$2";;
4571 set signal.h LANGUAGE_C; eval $inctest
4575 ccflags="$ccflags -DSOCKS"
4580 default|recommended) dflt="$ccflags $dflt" ;;
4581 *) dflt="$ccflags";;
4590 Your C compiler may want other flags. For this question you should include
4591 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4592 but you should NOT include libraries or ld flags like -lwhatever. If you
4593 want $package to honor its debug switch, you should include -DDEBUGGING here.
4594 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4596 To use no flags, specify the word "none".
4602 rp="Any additional cc flags?"
4609 : the following weeds options from ccflags that are of no interest to cpp
4611 '') cppflags="$ccflags" ;;
4612 *) cppflags="$cppflags $ccflags" ;;
4614 case "$gccversion" in
4615 1*) cppflags="$cppflags -D__GNUC__"
4617 case "$mips_type" in
4619 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4625 echo "Let me guess what the preprocessor flags are..." >&4
4639 *) ftry="$previous $flag";;
4641 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4642 >cpp1.out 2>/dev/null && \
4643 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4644 >cpp2.out 2>/dev/null && \
4645 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4646 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4648 cppflags="$cppflags $ftry"
4658 *-*) echo "They appear to be: $cppflags";;
4660 $rm -f cpp.c cpp?.out
4664 : flags used in final linking phase
4666 '') if ./venix; then
4672 *-posix*) dflt="$dflt -posix" ;;
4675 *) dflt="$ldflags";;
4678 : Try to guess additional flags to pick up local libraries.
4679 for thislibdir in $libpth; do
4680 case " $loclibpth " in
4683 *"-L$thislibdir "*) ;;
4684 *) dflt="$dflt -L$thislibdir" ;;
4696 Your C linker may need flags. For this question you should
4697 include -L/whatever and any other flags used by the C linker, but you
4698 should NOT include libraries like -lwhatever.
4700 Make sure you include the appropriate -L/path flags if your C linker
4701 does not normally search all of the directories you specified above,
4704 To use no flags, specify the word "none".
4708 rp="Any additional ld flags (NOT including libraries)?"
4714 rmlist="$rmlist pdp11"
4718 echo "Checking your choice of C compiler and flags for coherency..." >&4
4719 $cat > try.c <<'EOF'
4721 int main() { printf("Ok\n"); exit(0); }
4723 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4725 $cat >try.msg <<'EOM'
4726 I've tried to compile and run the following simple program:
4729 $cat try.c >> try.msg
4731 $cat >> try.msg <<EOM
4738 and I got the following output:
4742 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4743 if $sh -c "$run ./try" >>try.msg 2>&1; then
4747 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4750 cat >> try.msg <<'EOQS'
4751 If $libs contains -lsfio, and sfio is mis-configured, then it
4752 sometimes (apparently) runs and exits with a 0 status, but with no
4753 output! It may have to do with sfio's use of _exit vs. exit.
4756 rp="You have a big problem. Shall I abort Configure"
4763 echo "The program compiled OK, but exited with status $?." >>try.msg
4764 rp="You have a problem. Shall I abort Configure"
4768 echo "I can't compile the test program." >>try.msg
4769 rp="You have a BIG problem. Shall I abort Configure"
4775 case "$knowitall" in
4777 echo "(The supplied flags or libraries might be incorrect.)"
4785 *) echo "Ok. Stopping Configure." >&4
4790 n) echo "OK, that should do.";;
4792 $rm -f try try.* core
4794 : define a shorthand compile call
4798 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4799 : define a shorthand compile call for compilations that should be ok.
4803 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4805 : check for lengths of integral types
4809 echo "Checking to see how big your integers are..." >&4
4810 $cat >try.c <<'EOCP'
4814 printf("intsize=%d;\n", (int)sizeof(int));
4815 printf("longsize=%d;\n", (int)sizeof(long));
4816 printf("shortsize=%d;\n", (int)sizeof(short));
4821 if eval $compile_ok && $run ./try > /dev/null; then
4823 echo "Your integers are $intsize bytes long."
4824 echo "Your long integers are $longsize bytes long."
4825 echo "Your short integers are $shortsize bytes long."
4829 Help! I can't compile and run the intsize test program: please enlighten me!
4830 (This is probably a misconfiguration in your system or libraries, and
4831 you really ought to fix it. Still, I'll try anyway.)
4835 rp="What is the size of an integer (in bytes)?"
4839 rp="What is the size of a long integer (in bytes)?"
4843 rp="What is the size of a short integer (in bytes)?"
4851 : check for long long
4853 echo "Checking to see if you have long long..." >&4
4854 echo 'int main() { long long x = 7; return 0; }' > try.c
4856 if eval $compile; then
4858 echo "You have long long."
4861 echo "You do not have long long."
4867 : check for length of long long
4868 case "${d_longlong}${longlongsize}" in
4871 echo "Checking to see how big your long longs are..." >&4
4872 $cat >try.c <<'EOCP'
4876 printf("%d\n", (int)sizeof(long long));
4881 if eval $compile_ok; then
4882 longlongsize=`$run ./try`
4883 echo "Your long longs are $longlongsize bytes long."
4887 echo "(I can't seem to compile the test program. Guessing...)"
4888 rp="What is the size of a long long (in bytes)?"
4892 if $test "X$longsize" = "X$longlongsize"; then
4893 echo "(That isn't any different from an ordinary long.)"
4899 : determine filename position in cpp output
4901 echo "Computing filename position in cpp output for #include directives..." >&4
4903 vos) testaccess=-e ;;
4906 echo '#include <stdio.h>' > foo.c
4909 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4910 $grep '^[ ]*#.*stdio\.h' | \
4911 while read cline; do
4914 while $test \$# -gt 0; do
4915 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
4920 pos=\`expr \$pos + 1\`
4932 *) pos="${fieldn}th";;
4934 echo "Your cpp writes the filename in the $pos field of the line."
4937 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4940 : locate header file
4945 for usrincdir in $usrinc
4947 if test -f \$usrincdir/\$wanted; then
4948 echo "\$usrincdir/\$wanted"
4952 awkprg='{ print \$$fieldn }'
4953 echo "#include <\$wanted>" > foo\$\$.c
4954 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4955 $cppfilter $grep "^[ ]*#.*\$wanted" | \
4956 while read cline; do
4957 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4959 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4960 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4965 # status = 0: grep returned 0 lines, case statement not executed
4966 # status = 1: headerfile found
4967 # status = 2: while loop executed, no headerfile found
4971 if test \$status -eq 1; then
4978 : define an alternate in-header-list? function
4979 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4980 cont=true; xxf="echo \"<\$1> found.\" >&4";
4981 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4982 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4984 case $# in 4) instead=instead;; *) instead="at last";; esac;
4985 while $test "$cont"; do
4987 var=$2; eval "was=\$$2";
4988 if $test "$xxx" && $test -r "$xxx";
4990 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4993 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4994 set $yyy; shift; shift; yyy=$@;
4995 case $# in 0) cont="";;
4996 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4997 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4998 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4999 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5003 do set $yyy; var=$2; eval "was=\$$2";
5004 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5005 set $yyy; shift; shift; yyy=$@;
5008 : see if inttypes.h is available
5009 : we want a real compile instead of Inhdr because some systems
5010 : have an inttypes.h which includes non-existent headers
5013 #include <inttypes.h>
5015 static int32_t foo32 = 0x12345678;
5019 if eval $compile; then
5020 echo "<inttypes.h> found." >&4
5023 echo "<inttypes.h> NOT found." >&4
5032 echo "Checking to see if you have int64_t..." >&4
5034 #include <sys/types.h>
5035 #$i_inttypes I_INTTYPES
5037 #include <inttypes.h>
5039 int main() { int64_t x = 7; }
5042 if eval $compile; then
5044 echo "You have int64_t."
5047 echo "You do not have int64_t."
5055 echo "Checking which 64-bit integer type we could use..." >&4
5061 val='"unsigned int"'
5066 *) case "$longsize" in
5070 val='"unsigned long"'
5075 *) case "$d_longlong:$longlongsize" in
5080 val='"unsigned long long"'
5085 *) case "$d_int64_t" in
5104 '') echo "Alas, no 64-bit integer types in sight." >&4
5107 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5113 case "$uselonglong" in
5114 "$define"|true|[yY]*)
5117 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5119 use64bitint="$define"
5122 case "$use64bits" in
5123 "$define"|true|[yY]*)
5126 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5128 use64bitint="$define"
5131 case "$use64bitints" in
5132 "$define"|true|[yY]*)
5135 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5137 use64bitint="$define"
5140 case "$use64bitsint" in
5141 "$define"|true|[yY]*)
5144 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5146 use64bitint="$define"
5149 case "$uselonglongs" in
5150 "$define"|true|[yY]*)
5153 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5155 use64bitint="$define"
5158 case "$use64bitsall" in
5159 "$define"|true|[yY]*)
5162 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5164 use64bitall="$define"
5169 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5171 case "$use64bitall" in
5172 "$define"|true|[yY]*) use64bitint="$define" ;;
5178 You have natively 64-bit long integers.
5182 *) case "$use64bitint" in
5183 "$define"|true|[yY]*) dflt='y';;
5192 Perl can be built to take advantage of 64-bit integer types
5193 on some systems. To do so, Configure can be run with -Duse64bitint.
5194 Choosing this option will most probably introduce binary incompatibilities.
5196 If this doesn't make any sense to you, just accept the default '$dflt'.
5197 (The default has been chosen based on your configuration.)
5199 rp='Try to use 64-bit integers, if available?'
5202 [yY]*) val="$define" ;;
5210 case "$use64bitall" in
5211 "$define"|true|[yY]*) dflt='y' ;;
5212 *) case "$longsize" in
5220 You may also choose to try maximal 64-bitness. It means using as much
5221 64-bitness as possible on the platform. This in turn means even more
5222 binary incompatibilities. On the other hand, your platform may not
5223 have any more 64-bitness available than what you already have chosen.
5225 If this doesn't make any sense to you, just accept the default '$dflt'.
5226 (The default has been chosen based on your configuration.)
5228 rp='Try to use maximal 64-bit support, if available?'
5231 [yY]*) val="$define" ;;
5236 case "$use64bitall" in
5238 case "$use64bitint" in
5242 Since you have chosen a maximally 64-bit build, I'm also turning on
5243 the use of 64-bit integers.
5245 use64bitint="$define" ;;
5250 case "$use64bitint" in
5251 "$define"|true|[yY]*)
5252 : Look for a hint-file generated 'call-back-unit'. If the
5253 : user has specified that a 64-bit perl is to be built,
5254 : we may need to set or change some other defaults.
5255 if $test -f use64bitint.cbu; then
5256 echo "Your platform has some specific hints for 64-bit integers, using them..."
5260 4) case "$archname64" in
5261 '') archname64=64int ;;
5268 case "$use64bitall" in
5269 "$define"|true|[yY]*)
5270 : Look for a hint-file generated 'call-back-unit'. If the
5271 : user has specified that a maximally 64-bit perl is to be built,
5272 : we may need to set or change some other defaults.
5273 if $test -f use64bitall.cbu; then
5274 echo "Your platform has some specific hints for 64-bit builds, using them..."
5278 4) case "$archname64" in
5279 ''|64int) archname64=64all ;;
5287 echo "Checking for GNU C Library..." >&4
5300 if eval $compile_ok && $run ./try; then
5302 echo "You are using the GNU C Library"
5305 echo "You are not using the GNU C Library"
5311 : see if nm is to be used to determine whether a symbol is defined or not
5315 case "$d_gnulibc" in
5318 echo "nm probably won't work on the GNU C Library." >&4
5324 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5326 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5327 echo "'nm' won't be sufficient on this sytem." >&4
5333 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5334 if $test $dflt -gt 20; then
5344 true|$define) dflt=y;;
5351 I can use $nm to extract the symbols from your C libraries. This
5352 is a time consuming task which may generate huge output on the disk (up
5353 to 3 megabytes) but that should make the symbols extraction faster. The
5354 alternative is to skip the 'nm' extraction part and to compile a small
5355 test program instead to determine whether each symbol is present. If
5356 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5357 this may be the best solution.
5359 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5362 rp="Shall I use $nm to extract C symbols from the libraries?"
5365 [Nn]*) usenm=false;;
5374 : nm options which may be necessary
5376 '') if $test -f /mach_boot; then
5378 elif $test -d /usr/ccs/lib; then
5379 nm_opt='-p' # Solaris (and SunOS?)
5380 elif $test -f /dgux; then
5382 elif $test -f /lib64/rld; then
5383 nm_opt='-p' # 64-bit Irix
5389 : nm options which may be necessary for shared libraries but illegal
5390 : for archive libraries. Thank you, Linux.
5391 case "$nm_so_opt" in
5392 '') case "$myuname" in
5394 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5395 nm_so_opt='--dynamic'
5404 : get list of predefined functions in a handy place
5409 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5415 *) for thislib in $libs; do
5418 : Handle C library specially below.
5421 thislib=`echo $thislib | $sed -e 's/^-l//'`
5422 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5424 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5426 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5428 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5430 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5432 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5434 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5439 libnames="$libnames $try"
5441 *) libnames="$libnames $thislib" ;;
5450 for xxx in $libpth; do
5451 $test -r $1 || set $xxx/libc.$so
5452 : The messy sed command sorts on library version numbers.
5454 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5455 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5457 s/[0-9][0-9]*/0000&/g
5458 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5461 $sort | $sed -e 's/^.* //'`
5464 $test -r $1 || set /usr/ccs/lib/libc.$so
5465 $test -r $1 || set /lib/libsys_s$_a
5471 if $test -r "$1"; then
5472 echo "Your (shared) C library seems to be in $1."
5474 elif $test -r /lib/libc && $test -r /lib/clib; then
5475 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5477 libc='/lib/clib /lib/libc'
5478 if $test -r /lib/syslib; then
5479 echo "(Your math library is in /lib/syslib.)"
5480 libc="$libc /lib/syslib"
5482 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5483 echo "Your C library seems to be in $libc, as you said before."
5484 elif $test -r $incpath/usr/lib/libc$_a; then
5485 libc=$incpath/usr/lib/libc$_a;
5486 echo "Your C library seems to be in $libc. That's fine."
5487 elif $test -r /lib/libc$_a; then
5489 echo "Your C library seems to be in $libc. You're normal."
5491 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5493 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5494 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5495 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5497 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5499 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5502 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5504 if $test -r "$tans"; then
5505 echo "Your C library seems to be in $tans, of all places."
5511 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5515 If the guess above is wrong (which it might be if you're using a strange
5516 compiler, or your machine supports multiple models), you can override it here.
5521 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5523 I can't seem to find your C library. I've looked in the following places:
5526 $sed 's/^/ /' libpath
5529 None of these seems to contain your C library. I need to get its name...
5534 rp='Where is your C library?'
5539 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5540 set X `cat libnames`
5543 case $# in 1) xxx=file; esac
5544 echo "Extracting names from the following $xxx for later perusal:" >&4
5546 $sed 's/^/ /' libnames >&4
5548 $echo $n "This may take a while...$c" >&4
5552 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5553 *) $nm $nm_opt $file 2>/dev/null;;
5558 $grep fprintf libc.tmp > libc.ptf
5559 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5560 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
5562 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5564 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5566 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5568 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5570 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5572 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5574 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5576 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5578 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5580 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5582 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5584 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5586 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5587 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5589 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5591 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5593 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5595 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5597 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5599 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5601 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5603 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5605 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5607 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5609 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5611 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5613 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5615 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5617 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5620 $nm -p $* 2>/dev/null >libc.tmp
5621 $grep fprintf libc.tmp > libc.ptf
5622 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5623 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5629 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5631 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5632 for thisname in $libnames $libc; do
5633 $ar t $thisname >>libc.tmp
5635 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5637 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5638 # Repeat libc to extract forwarders to DLL entries too
5639 for thisname in $libnames $libc; do
5640 $ar tv $thisname >>libc.tmp
5641 # Revision 50 of EMX has bug in $ar.
5642 # it will not extract forwarders to DLL entries
5643 # Use emximp which will extract exactly them.
5644 emximp -o tmp.imp $thisname \
5646 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5647 < tmp.imp >>libc.tmp
5650 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5653 echo "$ar didn't seem to work right." >&4
5654 echo "Maybe this is a Cray...trying bld instead..." >&4
5655 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5657 for thisname in $libnames; do
5659 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5660 $ar t $thisname >>libc.tmp
5664 echo "That didn't work either. Giving up." >&4
5671 if $test -f /lib/syscalls.exp; then
5673 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5674 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
5678 $rm -f libnames libpath
5680 : is a C symbol defined?
5683 -v) tf=libc.tmp; tc=""; tdc="";;
5684 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5685 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5688 case "$reuseval-$4" in
5690 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5696 if $contains $tlook $tf >/dev/null 2>&1;
5701 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5702 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5710 $define) tval=true;;
5716 : define an is-in-libc? function
5717 inlibc='echo " "; td=$define; tu=$undef;
5718 sym=$1; var=$2; eval "was=\$$2";
5720 case "$reuseval$was" in
5730 echo "$sym() found." >&4;
5731 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5733 echo "$sym() NOT found." >&4;
5734 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5738 $define) echo "$sym() found." >&4;;
5739 *) echo "$sym() NOT found." >&4;;
5743 : see if sqrtl exists
5747 : check for length of double
5749 case "$doublesize" in
5751 echo "Checking to see how big your double precision numbers are..." >&4
5752 $cat >try.c <<'EOCP'
5756 printf("%d\n", (int)sizeof(double));
5761 if eval $compile_ok; then
5762 doublesize=`$run ./try`
5763 echo "Your double is $doublesize bytes long."
5766 echo "(I can't seem to compile the test program. Guessing...)"
5767 rp="What is the size of a double precision number (in bytes)?"
5775 : check for long doubles
5777 echo "Checking to see if you have long double..." >&4
5778 echo 'int main() { long double x = 7.0; }' > try.c
5780 if eval $compile; then
5782 echo "You have long double."
5785 echo "You do not have long double."
5791 : check for length of long double
5792 case "${d_longdbl}${longdblsize}" in
5795 echo "Checking to see how big your long doubles are..." >&4
5796 $cat >try.c <<'EOCP'
5800 printf("%d\n", sizeof(long double));
5805 if eval $compile; then
5806 longdblsize=`$run ./try`
5807 echo "Your long doubles are $longdblsize bytes long."
5811 echo "(I can't seem to compile the test program. Guessing...)" >&4
5812 rp="What is the size of a long double (in bytes)?"
5816 if $test "X$doublesize" = "X$longdblsize"; then
5817 echo "(That isn't any different from an ordinary double.)"
5825 if $test X"$d_longdbl" = X"$define"; then
5827 echo "Checking how to print long doubles..." >&4
5829 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
5830 $cat >try.c <<'EOCP'
5831 #include <sys/types.h>
5835 printf("%.3f\n", d);
5839 if eval $compile; then
5843 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
5844 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
5845 echo "We will use %f."
5851 if $test X"$sPRIfldbl" = X; then
5852 $cat >try.c <<'EOCP'
5853 #include <sys/types.h>
5856 long double d = 123.456;
5857 printf("%.3Lf\n", d);
5861 if eval $compile; then
5865 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
5866 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
5867 echo "We will use %Lf."
5873 if $test X"$sPRIfldbl" = X; then
5874 $cat >try.c <<'EOCP'
5875 #include <sys/types.h>
5878 long double d = 123.456;
5879 printf("%.3llf\n", d);
5883 if eval $compile; then
5887 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
5888 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
5889 echo "We will use %llf."
5895 if $test X"$sPRIfldbl" = X; then
5896 $cat >try.c <<'EOCP'
5897 #include <sys/types.h>
5900 long double d = 123.456;
5901 printf("%.3lf\n", d);
5905 if eval $compile; then
5909 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
5910 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
5911 echo "We will use %lf."
5917 if $test X"$sPRIfldbl" = X; then
5918 echo "Cannot figure out how to print long doubles." >&4
5920 sSCNfldbl=$sPRIfldbl # expect consistency
5927 case "$sPRIfldbl" in
5928 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
5929 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
5930 d_SCNfldbl="$undef";
5932 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
5933 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
5934 d_SCNfldbl="$define";
5938 : see if modfl exists
5942 d_modfl_pow32_bug="$undef"
5944 case "$d_longdbl$d_modfl" in
5947 Checking to see whether your modfl() is okay for large values...
5953 long double nv = 4294967303.15;
5959 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
5963 case "$osname:$gccversion" in
5964 aix:) saveccflags="$ccflags"
5965 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
5968 if eval $compile; then
5971 *" 4294967303.150000 1.150000 4294967302.000000")
5972 echo >&4 "Your modfl() is broken for large values."
5973 d_modfl_pow32_bug="$define"
5975 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
5979 *" 4294967303.150000 0.150000 4294967303.000000")
5980 echo >&4 "Your modfl() seems okay for large values."
5982 *) echo >&4 "I don't understand your modfl() at all."
5986 $rm -f try.* try core core.try.*
5988 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
5991 case "$osname:$gccversion" in
5992 aix:) ccflags="$saveccflags" ;; # restore
5998 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6001 case "$uselongdouble" in
6002 $define|true|[yY]*) dflt='y';;
6007 Perl can be built to take advantage of long doubles which
6008 (if available) may give more accuracy and range for floating point numbers.
6010 If this doesn't make any sense to you, just accept the default '$dflt'.
6012 rp='Try to use long doubles if available?'
6015 y|Y) val="$define" ;;
6021 case "$uselongdouble" in
6022 true|[yY]*) uselongdouble="$define" ;;
6025 case "$uselongdouble" in
6027 : Look for a hint-file generated 'call-back-unit'. If the
6028 : user has specified that long doubles should be used,
6029 : we may need to set or change some other defaults.
6030 if $test -f uselongdouble.cbu; then
6031 echo "Your platform has some specific hints for long doubles, using them..."
6032 . ./uselongdouble.cbu
6035 (Your platform doesn't have any specific hints for long doubles.)
6042 case "$uselongdouble:$d_sqrtl:$d_modfl" in
6043 $define:$define:$define)
6046 $define:$define:$undef)
6047 message="I could not find modfl"
6049 $define:$undef:$define)
6050 message="I could not find sqrtl"
6052 $define:$undef:$undef)
6053 message="I found neither sqrtl nor modfl"
6057 if $test "$message" != X; then
6060 *** You requested the use of long doubles but you do not seem to have
6061 *** the mathematic functions for long doubles.
6063 *** I'm disabling the use of long doubles.
6067 uselongdouble=$undef
6070 case "$useperlio" in
6071 $define|true|[yY]*|'') dflt='y';;
6076 Previous version of $package used the standard IO mechanisms as
6077 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
6078 alternate IO mechanisms via the PerlIO abstraction layer, but the
6079 stdio mechanism is still available if needed. The abstraction layer
6080 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
6081 Using PerlIO with sfio may cause problems with some extension modules.
6083 If this doesn't make any sense to you, just accept the default '$dflt'.
6085 rp='Use the PerlIO abstraction layer?'
6092 echo "Ok, doing things the stdio way."
6101 case "$useperlio" in
6102 $define|true|[yY]*) ;;
6105 You are using the SOCKS proxy protocol library which means that you
6106 should also use the PerlIO layer. You may be headed for trouble.
6115 : determine the architecture name
6117 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6118 tarch=`arch`"-$osname"
6119 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6120 if uname -m > tmparch 2>&1 ; then
6121 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6122 -e 's/$/'"-$osname/" tmparch`
6130 case "$myarchname" in
6133 echo "(Your architecture name used to be $myarchname.)"
6137 case "$targetarch" in
6139 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6144 *) dflt="$archname";;
6146 rp='What is your architecture name'
6149 case "$usethreads" in
6151 echo "Threads selected." >&4
6153 *-thread*) echo "...and architecture name already has -thread." >&4
6155 *) archname="$archname-thread"
6156 echo "...setting architecture name to $archname." >&4
6161 case "$usemultiplicity" in
6163 echo "Multiplicity selected." >&4
6165 *-multi*) echo "...and architecture name already has -multi." >&4
6167 *) archname="$archname-multi"
6168 echo "...setting architecture name to $archname." >&4
6173 case "$use64bitint$use64bitall" in
6175 case "$archname64" in
6177 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6180 case "$use64bitint" in
6181 "$define") echo "64 bit integers selected." >&4 ;;
6183 case "$use64bitall" in
6184 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6187 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6189 *) archname="$archname-$archname64"
6190 echo "...setting architecture name to $archname." >&4
6196 case "$uselongdouble" in
6198 echo "Long doubles selected." >&4
6199 case "$longdblsize" in
6201 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6205 *-ld*) echo "...and architecture name already has -ld." >&4
6207 *) archname="$archname-ld"
6208 echo "...setting architecture name to $archname." >&4
6215 case "$useperlio" in
6217 echo "Perlio selected." >&4
6220 echo "Perlio not selected, using stdio." >&4
6222 *-stdio*) echo "...and architecture name already has -stdio." >&4
6224 *) archname="$archname-stdio"
6225 echo "...setting architecture name to $archname." >&4
6231 : determine root of directory hierarchy where package will be installed.
6234 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
6242 By default, $package will be installed in $dflt/bin, manual pages
6243 under $dflt/man, etc..., i.e. with $dflt as prefix for all
6244 installation directories. Typically this is something like /usr/local.
6245 If you wish to have binaries under /usr/bin but other parts of the
6246 installation under /usr/local, that's ok: you will be prompted
6247 separately for each of the installation directories, the prefix being
6248 only used to set the defaults.
6252 rp='Installation prefix to use?'
6260 *) oldprefix="$prefix";;
6269 *) afsroot=$afsroot ;;
6275 $define|true) afs=true ;;
6276 $undef|false) afs=false ;;
6277 *) if test -d $afsroot; then
6285 echo "AFS may be running... I'll be extra cautious then..." >&4
6287 echo "AFS does not seem to be running..." >&4
6290 : determine installation prefix for where package is to be installed.
6294 Since you are running AFS, I need to distinguish the directory in which
6295 files will reside from the directory in which they are installed (and from
6296 which they are presumably copied to the former directory by occult means).
6299 case "$installprefix" in
6300 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
6301 *) dflt="$installprefix";;
6306 In some special cases, particularly when building $package for distribution,
6307 it is convenient to distinguish between the directory in which files should
6308 be installed from the directory ($prefix) in which they
6309 will eventually reside. For most users, these two directories are the same.
6312 case "$installprefix" in
6314 *) dflt=$installprefix;;
6318 rp='What installation prefix should I use for installing files?'
6320 installprefix="$ans"
6321 installprefixexp="$ansexp"
6323 : set the prefixit variable, to compute a suitable default value
6324 prefixit='case "$3" in
6326 case "$oldprefix" in
6327 "") eval "$1=\"\$$2\"";;
6334 ""|" ") eval "$1=\"\$$2\"";;
6340 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6342 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6343 /*-$oldprefix/*|\~*-$oldprefix/*)
6344 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6345 *) eval "$1=\"\$$2\"";;
6349 : get the patchlevel
6351 echo "Getting the current patchlevel..." >&4
6352 if $test -r $rsrc/patchlevel.h;then
6353 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6354 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6355 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6356 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6357 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6358 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6359 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6368 $echo "(You do not have patchlevel.h. Eek.)"
6370 if $test -r $rsrc/.patch ; then
6371 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6372 perl_patchlevel=`cat $rsrc/.patch`
6375 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6376 version_patchlevel_string="version $patchlevel subversion $subversion"
6377 case "$perl_patchlevel" in
6379 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6382 $echo "(You have $package $version_patchlevel_string.)"
6386 : XXX Should be a Configure test for double-dots in filenames.
6387 version=`echo $revision $patchlevel $subversion | \
6388 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6389 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6390 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6393 version=`echo $revision $patchlevel $subversion | \
6394 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6395 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6396 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6399 : Special case the 5.005_xx maintenance series, which used 5.005
6400 : without any subversion label as a subdirectory in $sitelib
6401 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6402 api_versionstring='5.005'
6405 : determine installation style
6406 : For now, try to deduce it from prefix unless it is already set.
6407 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6408 case "$installstyle" in
6409 '') case "$prefix" in
6410 *perl*) dflt='lib';;
6411 *) dflt='lib/perl5' ;;
6414 *) dflt="$installstyle" ;;
6416 : Probably not worth prompting for this since we prompt for all
6417 : the directories individually, and the prompt would be too long and
6421 : determine where private library files go
6422 : Usual default is /usr/local/lib/perl5/$version.
6423 : Also allow things like /opt/perl/lib/$version, since
6424 : /opt/perl/lib/perl5... would be redundant.
6425 : The default "style" setting is made in installstyle.U
6426 case "$installstyle" in
6427 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6428 *) set dflt privlib lib/$version ;;
6433 There are some auxiliary files for $package that need to be put into a
6434 private library directory that is accessible by everyone.
6438 rp='Pathname where the private library files will reside?'
6441 privlibexp="$ansexp"
6442 : Change installation prefix, if necessary.
6443 if $test X"$prefix" != X"$installprefix"; then
6444 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6446 installprivlib="$privlibexp"
6449 : set the prefixup variable, to restore leading tilda escape
6450 prefixup='case "$prefixexp" in
6452 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6455 : determine where public architecture dependent libraries go
6458 : privlib default is /usr/local/lib/$package/$version
6459 : archlib default is /usr/local/lib/$package/$version/$archname
6460 : privlib may have an optional trailing /share.
6461 tdflt=`echo $privlib | $sed 's,/share$,,'`
6462 tdflt=$tdflt/$archname
6471 $spackage contains architecture-dependent library files. If you are
6472 sharing libraries in a heterogeneous environment, you might store
6473 these files in a separate location. Otherwise, you can just include
6474 them with the rest of the public library files.
6478 rp='Where do you want to put the public architecture-dependent libraries?'
6481 archlibexp="$ansexp"
6482 if $test X"$archlib" = X"$privlib"; then
6487 : Change installation prefix, if necessary.
6488 if $test X"$prefix" != X"$installprefix"; then
6489 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6491 installarchlib="$archlibexp"
6494 : see if setuid scripts can be secure
6497 Some kernels have a bug that prevents setuid #! scripts from being
6498 secure. Some sites have disabled setuid #! scripts because of this.
6500 First let's decide if your kernel supports secure setuid #! scripts.
6501 (If setuid #! scripts would be secure but have been disabled anyway,
6502 don't say that they are secure if asked.)
6507 if $test -d /dev/fd; then
6508 echo "#!$ls" >reflect
6509 chmod +x,u+s reflect
6510 ./reflect >flect 2>&1
6511 if $contains "/dev/fd" flect >/dev/null; then
6512 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6516 If you are not sure if they are secure, I can check but I'll need a
6517 username and password different from the one you are using right now.
6518 If you don't have such a username or don't want me to test, simply
6522 rp='Other username to test security of setuid scripts with?'
6527 case "$d_suidsafe" in
6528 '') echo "I'll assume setuid scripts are *not* secure." >&4
6531 echo "Well, the $hint value is *not* secure." >&4
6533 *) echo "Well, the $hint value *is* secure." >&4
6538 $rm -f reflect flect
6539 echo "#!$ls" >reflect
6540 chmod +x,u+s reflect
6543 echo '"su" will (probably) prompt you for '"$ans's password."
6544 su $ans -c './reflect >flect'
6545 if $contains "/dev/fd" flect >/dev/null; then
6546 echo "Okay, it looks like setuid scripts are secure." >&4
6549 echo "I don't think setuid scripts are secure." >&4
6554 rp='Does your kernel have *secure* setuid scripts?'
6557 [yY]*) val="$define";;
6562 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6563 echo "(That's for file descriptors, not floppy disks.)"
6569 $rm -f reflect flect
6571 : now see if they want to do setuid emulation
6574 case "$d_suidsafe" in
6577 echo "No need to emulate SUID scripts since they are secure here." >&4
6581 Some systems have disabled setuid scripts, especially systems where
6582 setuid scripts cannot be secure. On systems where setuid scripts have
6583 been disabled, the setuid/setgid bits on scripts are currently
6584 useless. It is possible for $package to detect those bits and emulate
6585 setuid/setgid in a secure fashion. This emulation will only work if
6586 setuid scripts have been disabled in your kernel.
6590 "$define") dflt=y ;;
6593 rp="Do you want to do setuid/setgid emulation?"
6596 [yY]*) val="$define";;
6604 : see if this is a malloc.h system
6605 set malloc.h i_malloc
6608 : see if stdlib is available
6609 set stdlib.h i_stdlib
6612 : check for void type
6614 echo "Checking to see how well your C compiler groks the void type..." >&4
6615 case "$voidflags" in
6617 $cat >try.c <<'EOCP'
6623 extern void moo(); /* function returning void */
6624 void (*goo)(); /* ptr to func returning void */
6626 void *hue; /* generic ptr */
6639 int main() { sub(); }
6641 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6642 voidflags=$defvoidused
6643 echo "Good. It appears to support void to the level $package wants.">&4
6644 if $contains warning .out >/dev/null 2>&1; then
6645 echo "However, you might get some warnings that look like this:"
6649 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6650 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6651 echo "It supports 1..."
6652 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6653 echo "It also supports 2..."
6654 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6656 echo "And it supports 4 but not 8 definitely."
6658 echo "It doesn't support 4..."
6659 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6661 echo "But it supports 8."
6664 echo "Neither does it support 8."
6668 echo "It does not support 2..."
6669 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6671 echo "But it supports 4 and 8."
6673 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6675 echo "And it supports 4 but has not heard about 8."
6677 echo "However it supports 8 but not 4."
6682 echo "There is no support at all for void."
6687 case "$voidflags" in
6690 Support flag bits are:
6691 1: basic void declarations.
6692 2: arrays of pointers to functions returning void.
6693 4: operations between pointers to and addresses of void functions.
6694 8: generic void pointers.
6697 rp="Your void support flags add up to what?"
6704 : check for length of pointer
6708 echo "Checking to see how big your pointers are..." >&4
6709 if test "$voidflags" -gt 7; then
6710 echo '#define VOID_PTR char *' > try.c
6712 echo '#define VOID_PTR void *' > try.c
6714 $cat >>try.c <<'EOCP'
6718 printf("%d\n", (int)sizeof(VOID_PTR));
6723 if eval $compile_ok; then
6724 ptrsize=`$run ./try`
6725 echo "Your pointers are $ptrsize bytes long."
6728 echo "(I can't seem to compile the test program. Guessing...)" >&4
6729 rp="What is the size of a pointer (in bytes)?"
6736 case "$use64bitall" in
6737 "$define"|true|[yY]*)
6741 *** You have chosen a maximally 64-bit build, but your pointers
6742 *** are only 4 bytes wide, disabling maximal 64-bitness.
6745 use64bitall="$undef"
6746 case "$use64bitint" in
6747 "$define"|true|[yY]*) ;;
6750 *** Downgrading from maximal 64-bitness to using 64-bit integers.
6753 use64bitint="$define"
6762 : determine which malloc to compile in
6764 case "$usemymalloc" in
6765 [yY]*|true|$define) dflt='y' ;;
6766 [nN]*|false|$undef) dflt='n' ;;
6767 *) case "$ptrsize" in
6773 rp="Do you wish to attempt to use the malloc that comes with $package?"
6779 mallocsrc='malloc.c'
6780 mallocobj="malloc$_o"
6781 d_mymalloc="$define"
6784 : Remove malloc from list of libraries to use
6785 echo "Removing unneeded -lmalloc from library list" >&4
6786 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6789 echo "libs = $libs" >&4
6801 : compute the return types of malloc and free
6803 $cat >malloc.c <<END
6807 #include <sys/types.h>
6821 case "$malloctype" in
6823 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6830 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6834 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6841 echo "Your system uses $freetype free(), it would seem." >&4
6845 After $package is installed, you may wish to install various
6846 add-on modules and utilities. Typically, these add-ons will
6847 be installed under $prefix with the rest
6848 of this package. However, you may wish to install such add-ons
6849 elsewhere under a different prefix.
6851 If you do not wish to put everything under a single prefix, that's
6852 ok. You will be prompted for the individual locations; this siteprefix
6853 is only used to suggest the defaults.
6855 The default should be fine for most people.
6859 rp='Installation prefix to use for add-on modules and utilities?'
6860 : XXX Here might be another good place for an installstyle setting.
6861 case "$siteprefix" in
6863 *) dflt=$siteprefix ;;
6866 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6868 case "$siteprefix" in
6872 *) oldsiteprefix="$prefix";;
6877 siteprefixexp="$ansexp"
6879 : determine where site specific libraries go.
6880 : Usual default is /usr/local/lib/perl5/site_perl/$version
6881 : The default "style" setting is made in installstyle.U
6882 : XXX No longer works with Prefixit stuff.
6883 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6885 '') case "$installstyle" in
6886 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6887 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6895 The installation process will create a directory for
6896 site-specific extensions and modules. Most users find it convenient
6897 to place all site-specific files in this directory rather than in the
6898 main distribution directory.
6902 rp='Pathname for the site-specific library files?'
6905 sitelibexp="$ansexp"
6906 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6907 : Change installation prefix, if necessary.
6908 if $test X"$prefix" != X"$installprefix"; then
6909 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6911 installsitelib="$sitelibexp"
6914 : determine where site specific architecture-dependent libraries go.
6915 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6916 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6917 : sitelib may have an optional trailing /share.
6919 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6920 dflt="$dflt/$archname"
6925 set sitearch sitearch none
6929 The installation process will also create a directory for
6930 architecture-dependent site-specific extensions and modules.
6934 rp='Pathname for the site-specific architecture-dependent library files?'
6937 sitearchexp="$ansexp"
6938 : Change installation prefix, if necessary.
6939 if $test X"$prefix" != X"$installprefix"; then
6940 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6942 installsitearch="$sitearchexp"
6947 The installation process will also create a directory for
6948 vendor-supplied add-ons. Vendors who supply perl with their system
6949 may find it convenient to place all vendor-supplied files in this
6950 directory rather than in the main distribution directory. This will
6951 ease upgrades between binary-compatible maintenance versions of perl.
6953 Of course you may also use these directories in whatever way you see
6954 fit. For example, you might use them to access modules shared over a
6955 company-wide network.
6957 The default answer should be fine for most people.
6958 This causes further questions about vendor add-ons to be skipped
6959 and no vendor-specific directories will be configured for perl.
6962 rp='Do you want to configure vendor-specific add-on directories?'
6963 case "$usevendorprefix" in
6964 define|true|[yY]*) dflt=y ;;
6965 *) : User may have set vendorprefix directly on Configure command line.
6966 case "$vendorprefix" in
6975 rp='Installation prefix to use for vendor-supplied add-ons?'
6976 case "$vendorprefix" in
6978 *) dflt=$vendorprefix ;;
6981 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6983 case "$vendorprefix" in
6987 *) oldvendorprefix="$prefix";;
6991 usevendorprefix="$define"
6993 vendorprefixexp="$ansexp"
6995 *) usevendorprefix="$undef"
7001 case "$vendorprefix" in
7002 '') d_vendorlib="$undef"
7006 *) d_vendorlib="$define"
7007 : determine where vendor-supplied modules go.
7008 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7009 case "$vendorlib" in
7011 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7012 case "$installstyle" in
7013 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7014 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7017 *) dflt="$vendorlib"
7021 rp='Pathname for the vendor-supplied library files?'
7024 vendorlibexp="$ansexp"
7027 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7028 : Change installation prefix, if necessary.
7029 if $test X"$prefix" != X"$installprefix"; then
7030 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
7032 installvendorlib="$vendorlibexp"
7035 case "$vendorprefix" in
7036 '') d_vendorarch="$undef"
7040 *) d_vendorarch="$define"
7041 : determine where vendor-supplied architecture-dependent libraries go.
7042 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7043 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7044 : vendorlib may have an optional trailing /share.
7045 case "$vendorarch" in
7046 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7047 dflt="$dflt/$archname"
7049 *) dflt="$vendorarch" ;;
7052 rp='Pathname for vendor-supplied architecture-dependent files?'
7055 vendorarchexp="$ansexp"
7058 : Change installation prefix, if necessary.
7059 if $test X"$prefix" != X"$installprefix"; then
7060 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
7062 installvendorarch="$vendorarchexp"
7065 : Final catch-all directories to search
7068 Lastly, you can have perl look in other directories for extensions and
7069 modules in addition to those already specified.
7070 These directories will be searched after
7074 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7075 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7077 case "$otherlibdirs" in
7078 ''|' ') dflt='none' ;;
7079 *) dflt="$otherlibdirs" ;;
7082 Enter a colon-separated set of extra paths to include in perl's @INC
7083 search path, or enter 'none' for no extra paths.
7087 rp='Colon-separated list of additional directories for perl to search?'
7090 ' '|''|none) otherlibdirs=' ' ;;
7091 *) otherlibdirs="$ans" ;;
7093 case "$otherlibdirs" in
7097 set d_perl_otherlibdirs
7100 : Cruising for prototypes
7102 echo "Checking out function prototypes..." >&4
7103 $cat >prototype.c <<'EOCP'
7104 int main(int argc, char *argv[]) {
7107 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7108 echo "Your C compiler appears to support function prototypes."
7111 echo "Your C compiler doesn't seem to understand function prototypes."
7118 case "$prototype" in
7120 *) ansi2knr='ansi2knr'
7125 This version of $package can only be compiled by a compiler that
7126 understands function prototypes. Unfortunately, your C compiler
7128 doesn't seem to understand them. Sorry about that.
7130 If GNU cc is available for your system, perhaps you could try that instead.
7132 Eventually, we hope to support building Perl with pre-ANSI compilers.
7133 If you would like to help in that effort, please contact <perlbug@perl.org>.
7135 Aborting Configure now.
7141 : determine where public executables go
7146 rp='Pathname where the public executables will reside?'
7148 if $test "X$ansexp" != "X$binexp"; then
7153 : Change installation prefix, if necessary.
7154 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7155 if $test X"$prefix" != X"$installprefix"; then
7156 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
7158 installbin="$binexp"
7167 Perl can be built with extra modules or bundles of modules which
7168 will be fetched from the CPAN and installed alongside Perl.
7170 Notice that you will need access to the CPAN; either via the Internet,
7171 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7172 be asked later to configure the CPAN.pm module which will in turn do
7173 the installation of the rest of the extra modules or bundles.)
7175 Notice also that if the modules require any external software such as
7176 libraries and headers (the libz library and the zlib.h header for the
7177 Compress::Zlib module, for example) you MUST have any such software
7178 already installed, this configuration process will NOT install such
7181 If this doesn't make any sense to you, just accept the default '$dflt'.
7183 rp='Install any extra modules (y or n)?'
7189 Please list any extra modules or bundles to be installed from CPAN,
7190 with spaces between the names. The names can be in any format the
7191 'install' command of CPAN.pm will understand. (Answer 'none',
7192 without the quotes, to install no extra modules or bundles.)
7202 $rm -f ../extras.lst
7204 *) echo "(Saving the list of extras for later...)"
7205 echo "$extras" > ../extras.lst
7213 : Find perl5.005 or later.
7214 echo "Looking for a previously installed perl5.005 or later... "
7216 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7217 : Check if this perl is recent and can load a simple module
7218 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7221 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7231 '') echo "None found. That's ok.";;
7232 *) echo "Using $perl5." ;;
7235 : Determine list of previous versions to include in @INC
7236 $cat > getverlist <<EOPL
7239 \$api_versionstring = "$api_versionstring";
7240 \$version = "$version";
7241 \$stem = "$sitelib_stem";
7242 \$archname = "$archname";
7244 $cat >> getverlist <<'EOPL'
7245 # Can't have leading @ because metaconfig interprets it as a command!
7246 ;@inc_version_list=();
7247 # XXX Redo to do opendir/readdir?
7250 ;@candidates = glob("5.*");
7256 # XXX ToDo: These comparisons must be reworked when two-digit
7257 # subversions come along, so that 5.7.10 compares as greater than
7258 # 5.7.3! By that time, hope that 5.6.x is sufficiently
7259 # widespread that we can use the built-in version vectors rather
7260 # than reinventing them here. For 5.6.0, however, we must
7261 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
7262 foreach $d (@candidates) {
7263 if ($d lt $version) {
7264 if ($d ge $api_versionstring) {
7265 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
7267 elsif ($d ge "5.005") {
7268 unshift(@inc_version_list, grep { -d } $d);
7272 # Skip newer version. I.e. don't look in
7273 # 5.7.0 if we're installing 5.6.1.
7277 if (@inc_version_list) {
7278 print join(' ', @inc_version_list);
7281 # Blank space to preserve value for next Configure run.
7286 case "$inc_version_list" in
7287 '') if test -x "$perl5$exe_ext"; then
7288 dflt=`$perl5 getverlist`
7293 $undef) dflt='none' ;;
7294 *) eval dflt=\"$inc_version_list\" ;;
7297 ''|' ') dflt=none ;;
7304 In order to ease the process of upgrading, this version of perl
7305 can be configured to use modules built and installed with earlier
7306 versions of perl that were installed under $prefix. Specify here
7307 the list of earlier versions that this version of perl should check.
7308 If Configure detected no earlier versions of perl installed under
7309 $prefix, then the list will be empty. Answer 'none' to tell perl
7310 to not search earlier versions.
7312 The default should almost always be sensible, so if you're not sure,
7313 just accept the default.
7316 rp='List of earlier versions to include in @INC?'
7319 [Nn]one|''|' ') inc_version_list=' ' ;;
7320 *) inc_version_list="$ans" ;;
7322 case "$inc_version_list" in
7324 inc_version_list_init='0';;
7325 *) inc_version_list_init=`echo $inc_version_list |
7326 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7331 : determine whether to install perl also as /usr/bin/perl
7334 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7336 Many scripts expect perl to be installed as /usr/bin/perl.
7337 I can install the perl you are about to compile also as /usr/bin/perl
7338 (in addition to $installbin/perl).
7340 case "$installusrbinperl" in
7341 "$undef"|[nN]*) dflt='n';;
7344 rp="Do you want to install perl as /usr/bin/perl?"
7347 [yY]*) val="$define";;
7353 set installusrbinperl
7356 : see if dld is available
7360 : see if dlopen exists
7367 : determine which dynamic loading, if any, to compile in
7369 dldir="ext/DynaLoader"
7382 $define) dflt='y' ;;
7385 $define) dflt='y' ;;
7387 : Does a dl_xxx.xs file exist for this operating system
7388 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7391 rp="Do you wish to use dynamic loading?"
7398 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7399 dflt="$dldir/dl_${osname}.xs"
7400 elif $test "$d_dlopen" = "$define" ; then
7401 dflt="$dldir/dl_dlopen.xs"
7402 elif $test "$i_dld" = "$define" ; then
7403 dflt="$dldir/dl_dld.xs"
7408 *) dflt="$dldir/$dlsrc"
7411 echo "The following dynamic loading files are available:"
7412 : Can not go over to $dldir because getfile has path hard-coded in.
7413 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7414 rp="Source file to use for dynamic loading"
7420 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7424 Some systems may require passing special flags to $cc -c to
7425 compile modules that will be used to create a shared library.
7426 To use no flags, say "none".
7429 case "$cccdlflags" in
7430 '') case "$gccversion" in
7431 '') case "$osname" in
7433 next) dflt='none' ;;
7434 irix*) dflt='-KPIC' ;;
7435 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7436 sunos) dflt='-pic' ;;
7440 *) case "$osname" in
7441 darwin) dflt='none' ;;
7442 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7447 *) dflt="$cccdlflags" ;;
7449 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7452 none) cccdlflags=' ' ;;
7453 *) cccdlflags="$ans" ;;
7458 Some systems use ld to create libraries that can be dynamically loaded,
7459 while other systems (such as those using ELF) use $cc.
7463 '') $cat >try.c <<'EOM'
7464 /* Test for whether ELF binaries are produced */
7469 int i = open("a.out",O_RDONLY);
7472 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7473 exit(0); /* succeed (yes, it's ELF) */
7478 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7480 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7484 echo "I'll use ld to build dynamic libraries."
7493 rp="What command should be used to create dynamic libraries?"
7499 Some systems may require passing special flags to $ld to create a
7500 library that can be dynamically loaded. If your ld flags include
7501 -L/other/path options to locate libraries outside your loader's normal
7502 search path, you may need to specify those -L options here as well. To
7503 use no flags, say "none".
7506 case "$lddlflags" in
7507 '') case "$osname" in
7508 beos) dflt='-nostart' ;;
7510 case "$gccversion" in
7511 '') dflt="$dflt +vnocompatwarnings" ;;
7514 linux|irix*) dflt='-shared' ;;
7515 next) dflt='none' ;;
7516 solaris) dflt='-G' ;;
7517 sunos) dflt='-assert nodefinitions' ;;
7518 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7522 *) dflt="$lddlflags" ;;
7525 : Try to guess additional flags to pick up local libraries.
7526 : Be careful not to append to a plain 'none'
7530 for thisflag in $ldflags; do
7535 *) dflt="$dflt $thisflag" ;;
7542 ''|' ') dflt='none' ;;
7545 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7548 none) lddlflags=' ' ;;
7549 *) lddlflags="$ans" ;;
7554 Some systems may require passing special flags to $cc to indicate that
7555 the resulting executable will use dynamic linking. To use no flags,
7559 case "$ccdlflags" in
7560 '') case "$osname" in
7561 hpux) dflt='-Wl,-E' ;;
7562 linux) dflt='-rdynamic' ;;
7563 next) dflt='none' ;;
7564 sunos) dflt='none' ;;
7568 *) dflt="$ccdlflags" ;;
7570 rp="Any special flags to pass to $cc to use dynamic linking?"
7573 none) ccdlflags=' ' ;;
7574 *) ccdlflags="$ans" ;;
7588 # No dynamic loading being used, so don't bother even to prompt.
7591 *) case "$useshrplib" in
7592 '') case "$osname" in
7593 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7595 also='Building a shared libperl is required for dynamic loading to work on your system.'
7600 also='Building a shared libperl is needed for MAB support.'
7618 The perl executable is normally obtained by linking perlmain.c with
7619 libperl${_a}, any static extensions (usually just DynaLoader), and
7620 any other libraries needed on this system (such as -lm, etc.). Since
7621 your system supports dynamic loading, it is probably possible to build
7622 a shared libperl.$so. If you will have more than one executable linked
7623 to libperl.$so, this will significantly reduce the size of each
7624 executable, but it may have a noticeable affect on performance. The
7625 default is probably sensible for your system.
7629 rp="Build a shared libperl.$so (y/n)"
7633 useshrplib='true' ;;
7634 *) useshrplib='false' ;;
7639 case "$useshrplib" in
7643 # Figure out a good name for libperl.so. Since it gets stored in
7644 # a version-specific architecture-dependent library, the version
7645 # number isn't really that important, except for making cc/ld happy.
7647 # A name such as libperl.so.3.1
7648 majmin="libperl.$so.$patchlevel.$subversion"
7649 # A name such as libperl.so.301
7650 majonly=`echo $patchlevel $subversion |
7651 $awk '{printf "%d%02d", $1, $2}'`
7652 majonly=libperl.$so.$majonly
7653 # I'd prefer to keep the os-specific stuff here to a minimum, and
7654 # rely on figuring it out from the naming of libc.
7655 case "${osname}${osvers}" in
7658 # XXX How handle the --version stuff for MAB?
7660 linux*) # ld won't link with a bare -lperl otherwise.
7663 cygwin*) # ld links against an importlib
7664 dflt=libperl$lib_ext
7666 *) # Try to guess based on whether libc has major.minor.
7668 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7669 *libc.$so.[0-9]*) dflt=$majonly ;;
7670 *) dflt=libperl.$so ;;
7680 I need to select a good name for the shared libperl. If your system uses
7681 library names with major and minor numbers, then you might want something
7682 like $majmin. Alternatively, if your system uses a single version
7683 number for shared libraries, then you might want to use $majonly.
7684 Or, your system might be quite happy with a simple libperl.$so.
7686 Since the shared libperl will get installed into a version-specific
7687 architecture-dependent directory, the version number of the shared perl
7688 library probably isn't important, so the default should be o.k.
7691 rp='What name do you want to give to the shared libperl?'
7694 echo "Ok, I'll use $libperl"
7697 libperl="libperl${_a}"
7701 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7705 WARNING: Use of the shrpdir variable for the installation location of
7706 the shared $libperl is not supported. It was never documented and
7707 will not work in this version. Let me (perlbug@perl.org)
7708 know of any problems this may cause.
7714 But your current setting of $shrpdir is
7715 the default anyway, so it's harmless.
7720 Further, your current attempted setting of $shrpdir
7721 conflicts with the value of $archlibexp/CORE
7722 that installperl will use.
7729 # How will the perl executable find the installed shared $libperl?
7730 # Add $xxx to ccdlflags.
7731 # If we can't figure out a command-line option, use $shrpenv to
7732 # set env LD_RUN_PATH. The main perl makefile uses this.
7733 shrpdir=$archlibexp/CORE
7736 if "$useshrplib"; then
7739 # We'll set it in Makefile.SH...
7745 xxx="-Wl,-R$shrpdir"
7747 bsdos|linux|irix*|dec_osf)
7748 xxx="-Wl,-rpath,$shrpdir"
7751 # next doesn't like the default...
7754 # beos doesn't like the default, either.
7757 # hpux doesn't like the default, either.
7758 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7761 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7767 # Only add $xxx if it isn't already in ccdlflags.
7768 case " $ccdlflags " in
7770 *) ccdlflags="$ccdlflags $xxx"
7773 Adding $xxx to the flags
7774 passed to $ld so that the perl executable will find the
7775 installed shared $libperl.
7783 # Fix ccdlflags in AIX for building external extensions.
7784 # (For building Perl itself bare -bE:perl.exp is needed,
7785 # Makefile.SH takes care of this.)
7787 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7789 # Respect a hint or command-line value.
7791 '') shrpenv="$tmp_shrpenv" ;;
7793 case "$ldlibpthname" in
7794 '') ldlibpthname=LD_LIBRARY_PATH ;;
7795 none) ldlibpthname='' ;;
7798 : determine where manual pages are on this system
7802 syspath='/usr/share/man/man1 /usr/man/man1'
7803 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7804 syspath="$syspath /usr/man/u_man/man1"
7805 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7806 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7807 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7808 sysman=`./loc . /usr/man/man1 $syspath`
7811 if $test -d "$sysman"; then
7812 echo "System manual is in $sysman." >&4
7814 echo "Could not find manual pages in source form." >&4
7817 : determine where manual pages go
7818 set man1dir man1dir none
7822 $spackage has manual pages available in source form.
7826 echo "However, you don't have nroff, so they're probably useless to you."
7828 '') man1dir="none";;
7831 echo "If you don't want the manual sources installed, answer 'none'."
7836 lookpath="$prefixexp/share/man/man1"
7837 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7838 lookpath="$lookpath $prefixexp/man/p_man/man1"
7839 lookpath="$lookpath $prefixexp/man/u_man/man1"
7840 lookpath="$lookpath $prefixexp/man/man.1"
7842 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7843 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7853 rp="Where do the main $spackage manual pages (source) go?"
7855 if $test "X$man1direxp" != "X$ansexp"; then
7859 man1direxp="$ansexp"
7865 : Change installation prefix, if necessary.
7866 if $test X"$prefix" != X"$installprefix"; then
7867 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7869 installman1dir="$man1direxp"
7872 : What suffix to use on installed man pages
7879 rp="What suffix should be used for the main $spackage man pages?"
7881 '') case "$man1dir" in
7895 *) dflt="$man1ext";;
7902 : see if we can have long filenames
7904 first=123456789abcdef
7906 if (echo hi >$first) 2>/dev/null; then
7907 if $test -f 123456789abcde; then
7908 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7911 echo 'You can have filenames longer than 14 characters.'>&4
7916 You can't have filenames longer than 14 chars.
7917 You can't even think about them!
7923 $rm -rf 123456789abcde*
7925 : determine where library module manual pages go
7926 set man3dir man3dir none
7930 $spackage has manual pages for many of the library modules.
7936 However, you don't have nroff, so they're probably useless to you.
7939 '') man3dir="none";;
7943 case "$d_flexfnam" in
7946 However, your system can't handle the long file names like File::Basename.3.
7949 '') man3dir="none";;
7953 echo "If you don't want the manual sources installed, answer 'none'."
7954 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7956 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7957 if $test -d "$privlib/man/man3"; then
7960 WARNING: Previous versions of perl installed man3 pages into
7961 $privlib/man/man3. This version will suggest a
7962 new default of $dflt.
7966 rp='Do you wish to preserve the old behavior?(y/n)'
7969 y*) dflt="$privlib/man/man3" ;;
7974 *) dflt="$man3dir" ;;
7981 rp="Where do the $package library man pages (source) go?"
7984 man3direxp="$ansexp"
7990 : Change installation prefix, if necessary.
7991 if $test X"$prefix" != X"$installprefix"; then
7992 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7994 installman3dir="$man3direxp"
7997 : What suffix to use on installed man pages
8003 rp="What suffix should be used for the $package library man pages?"
8005 '') case "$man3dir" in
8019 *) dflt="$man3ext";;
8026 : see if we have to deal with yellow pages, now NIS.
8027 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8028 if $test -f /usr/etc/nibindd; then
8030 echo "I'm fairly confident you're on a NeXT."
8032 rp='Do you get the hosts file via NetInfo?'
8041 y*) hostcat='nidump hosts .';;
8042 *) case "$hostcat" in
8043 nidump*) hostcat='';;
8053 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8061 rp='Are you getting the hosts file via yellow pages?'
8064 y*) hostcat='ypcat hosts';;
8065 *) hostcat='cat /etc/hosts';;
8071 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8074 '') test -f /etc/group && groupcat='cat /etc/group';;
8077 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8080 : now get the host name
8082 echo "Figuring out host name..." >&4
8083 case "$myhostname" in
8085 echo 'Maybe "hostname" will work...'
8086 if tans=`sh -c hostname 2>&1` ; then
8094 if $test "$cont"; then
8096 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8097 if tans=`cat /etc/systemid 2>&1` ; then
8099 phostname='cat /etc/systemid'
8100 echo "Whadyaknow. Xenix always was a bit strange..."
8103 elif $test -r /etc/systemid; then
8104 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8107 if $test "$cont"; then
8108 echo 'No, maybe "uuname -l" will work...'
8109 if tans=`sh -c 'uuname -l' 2>&1` ; then
8111 phostname='uuname -l'
8113 echo 'Strange. Maybe "uname -n" will work...'
8114 if tans=`sh -c 'uname -n' 2>&1` ; then
8116 phostname='uname -n'
8118 echo 'Oh well, maybe I can mine it out of whoami.h...'
8119 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8120 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8121 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8123 case "$myhostname" in
8124 '') echo "Does this machine have an identity crisis or something?"
8127 echo "Well, you said $myhostname before..."
8128 phostname='echo $myhostname';;
8134 case "$myhostname" in
8135 '') myhostname=noname ;;
8137 : you do not want to know about this
8142 if $test "$myhostname" ; then
8144 rp='Your host name appears to be "'$myhostname'".'" Right?"
8152 : bad guess or no guess
8153 while $test "X$myhostname" = X ; do
8155 rp="Please type the (one word) name of your host:"
8160 : translate upper to lower if necessary
8161 case "$myhostname" in
8163 echo "(Normalizing case in your host name)"
8164 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8168 case "$myhostname" in
8170 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8171 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8172 echo "(Trimming domain name from host name--host name is now $myhostname)"
8174 *) case "$mydomain" in
8177 test "X$hostcat" = "Xypcat hosts" &&
8178 ypmatch "$myhostname" hosts 2>/dev/null |\
8179 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8182 test "X$hostcat" != "X" &&
8183 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8184 /[ ]$myhostname[ . ]/p" > hosts
8187 if $test -f hosts; then
8188 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8189 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8190 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8191 hosts | $sort | $uniq | \
8192 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8193 case `$echo X$dflt` in
8194 X*\ *) echo "(Several hosts in the database matched hostname)"
8197 X.) echo "(You do not have fully-qualified names in the hosts database)"
8201 echo "(I cannot locate a hosts database anywhere)"
8206 tans=`./loc resolv.conf X /etc /usr/etc`
8207 if $test -f "$tans"; then
8208 echo "(Attempting domain name extraction from $tans)"
8209 dflt=.`$sed -n -e 's/ / /g' \
8210 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8211 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8213 .) dflt=.`$sed -n -e 's/ / /g' \
8214 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8215 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8222 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8223 dflt=.`sh -c domainname 2>/dev/null`
8226 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8230 case "$dflt$osname" in
8231 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8232 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8236 .) echo "(Lost all hope -- silly guess then)"
8242 *) dflt="$mydomain";;
8246 rp="What is your domain name?"
8256 : translate upper to lower if necessary
8259 echo "(Normalizing case in your domain name)"
8260 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8264 : a little sanity check here
8265 case "$phostname" in
8268 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8269 $myhostname$mydomain|$myhostname) ;;
8271 case "$phostname" in
8273 echo "(That doesn't agree with your whoami.h file, by the way.)"
8276 echo "(That doesn't agree with your $phostname command, by the way.)"
8286 I need to get your e-mail address in Internet format if possible, i.e.
8287 something like user@host.domain. Please answer accurately since I have
8288 no easy means to double check it. The default value provided below
8289 is most probably close to reality but may not be valid from outside
8290 your organization...
8294 while test "$cont"; do
8296 '') dflt="$cf_by@$myhostname$mydomain";;
8297 *) dflt="$cf_email";;
8299 rp='What is your e-mail address?'
8305 rp='Address does not look like an Internet one. Use it anyway?'
8321 If you or somebody else will be maintaining perl at your site, please
8322 fill in the correct e-mail address here so that they may be contacted
8323 if necessary. Currently, the "perlbug" program included with perl
8324 will send mail to this address in addition to perlbug@perl.org. You may
8325 enter "none" for no administrator.
8328 case "$perladmin" in
8329 '') dflt="$cf_email";;
8330 *) dflt="$perladmin";;
8332 rp='Perl administrator e-mail address'
8336 : determine whether to only install version-specific parts.
8339 Do you want to install only the version-specific parts of the perl
8340 distribution? Usually you do *not* want to do this.
8342 case "$versiononly" in
8343 "$define"|[Yy]*|true) dflt='y' ;;
8346 rp="Do you want to install only the version-specific parts of perl?"
8349 [yY]*) val="$define";;
8355 case "$versiononly" in
8356 "$define") inc_version_list=''
8357 inc_version_list_init=0
8361 : figure out how to guarantee perl startup
8362 case "$startperl" in
8364 case "$sharpbang" in
8368 I can use the #! construct to start perl on your system. This will
8369 make startup of perl scripts faster, but may cause problems if you
8370 want to share those scripts and perl is not in a standard place
8371 ($binexp/perl) on all your platforms. The alternative is to force
8372 a shell by starting the script with a single ':' character.
8375 case "$versiononly" in
8376 "$define") dflt="$binexp/perl$version";;
8377 *) dflt="$binexp/perl";;
8379 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8382 none) startperl=": # use perl";;
8383 *) startperl="#!$ans"
8384 if $test 30 -lt `echo "$ans" | wc -c`; then
8387 WARNING: Some systems limit the #! command to 32 characters.
8388 If you experience difficulty running Perl scripts with #!, try
8389 installing Perl in a directory with a shorter pathname.
8395 *) startperl=": # use perl"
8400 echo "I'll use $startperl to start perl scripts."
8402 : figure best path for perl in scripts
8405 case "$versiononly" in
8406 "$define") perlpath="$binexp/perl$version";;
8407 *) perlpath="$binexp/perl";;
8409 case "$startperl" in
8414 I will use the "eval 'exec'" idiom to start Perl on your system.
8415 I can use the full path of your Perl binary for this purpose, but
8416 doing so may cause problems if you want to share those scripts and
8417 Perl is not always in a standard place ($binexp/perl).
8421 rp="What path shall I use in \"eval 'exec'\"?"
8428 case "$startperl" in
8430 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8433 : determine where public executable scripts go
8434 set scriptdir scriptdir
8436 case "$scriptdir" in
8439 : guess some guesses
8440 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8441 $test -d /usr/share/bin && dflt=/usr/share/bin
8442 $test -d /usr/local/script && dflt=/usr/local/script
8443 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8444 $test -d $prefixexp/script && dflt=$prefixexp/script
8448 *) dflt="$scriptdir"
8453 Some installations have a separate directory just for executable scripts so
8454 that they can mount it across multiple architectures but keep the scripts in
8455 one spot. You might, for example, have a subdirectory of /usr/share for this.
8456 Or you might just lump your scripts in with all your other executables.
8460 rp='Where do you keep publicly executable scripts?'
8462 if $test "X$ansexp" != "X$scriptdirexp"; then
8466 scriptdirexp="$ansexp"
8467 : Change installation prefix, if necessary.
8468 if $test X"$prefix" != X"$installprefix"; then
8469 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8471 installscript="$scriptdirexp"
8474 : determine where add-on public executables go
8476 '') dflt=$siteprefix/bin ;;
8480 rp='Pathname where the add-on public executables should be installed?'
8483 sitebinexp="$ansexp"
8484 : Change installation prefix, if necessary.
8485 if $test X"$prefix" != X"$installprefix"; then
8486 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8488 installsitebin="$sitebinexp"
8491 : define an is-a-typedef? function
8492 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8494 "") inclist="sys/types.h";;
8496 eval "varval=\$$var";
8500 for inc in $inclist; do
8501 echo "#include <$inc>" >>temp.c;
8503 echo "#ifdef $type" >> temp.c;
8504 echo "printf(\"We have $type\");" >> temp.c;
8505 echo "#endif" >> temp.c;
8506 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8507 if $contains $type temp.E >/dev/null 2>&1; then
8513 *) eval "$var=\$varval";;
8516 : define an is-a-typedef? function that prompts if the type is not available.
8517 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8519 "") inclist="sys/types.h";;
8521 eval "varval=\$$var";
8525 for inc in $inclist; do
8526 echo "#include <$inc>" >>temp.c;
8528 echo "#ifdef $type" >> temp.c;
8529 echo "printf(\"We have $type\");" >> temp.c;
8530 echo "#endif" >> temp.c;
8531 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8533 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8534 if $contains $type temp.E >/dev/null 2>&1; then
8535 echo "$type found." >&4;
8538 echo "$type NOT found." >&4;
8544 *) eval "$var=\$varval";;
8547 : see what type lseek is declared as in the kernel
8548 rp="What is the type used for lseek's offset on this system?"
8549 set off_t lseektype long stdio.h sys/types.h
8553 echo "Checking to see how big your file offsets are..." >&4
8555 #include <sys/types.h>
8559 printf("%d\n", (int)sizeof($lseektype));
8564 if eval $compile_ok; then
8565 lseeksize=`$run ./try`
8566 echo "Your file offsets are $lseeksize bytes long."
8570 echo "(I can't seem to compile the test program. Guessing...)"
8571 rp="What is the size of your file offsets (in bytes)?"
8577 : see what type file positions are declared as in the library
8578 rp="What is the type for file position used by fsetpos()?"
8579 set fpos_t fpostype long stdio.h sys/types.h
8584 *_t) zzz="$fpostype" ;;
8587 echo "Checking the size of $zzz..." >&4
8589 #include <sys/types.h>
8592 printf("%d\n", (int)sizeof($fpostype));
8597 if eval $compile_ok; then
8601 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8604 echo "Your $zzz is $fpossize bytes long."
8610 echo "(I can't compile the test program. Guessing...)" >&4
8611 rp="What is the size of your file positions (in bytes)?"
8618 # Backward compatibility (uselfs is deprecated).
8620 "$define"|true|[yY]*)
8623 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8625 uselargefiles="$define"
8629 case "$lseeksize:$fpossize" in
8632 You can have files larger than 2 gigabytes.
8635 *) case "$uselargefiles" in
8636 "$undef"|false|[nN]*) dflt='n' ;;
8641 Perl can be built to understand large files (files larger than 2 gigabytes)
8642 on some systems. To do so, Configure can be run with -Duselargefiles.
8644 If this doesn't make any sense to you, just accept the default '$dflt'.
8646 rp='Try to understand large files, if available?'
8649 y|Y) val="$define" ;;
8656 case "$uselargefiles" in
8658 : Look for a hint-file generated 'call-back-unit'. If the
8659 : user has specified that a large files perl is to be built,
8660 : we may need to set or change some other defaults.
8661 if $test -f uselargefiles.cbu; then
8662 echo "Your platform has some specific hints for large file builds, using them..."
8663 . ./uselargefiles.cbu
8665 echo "Rechecking to see how big your file offsets are..." >&4
8667 #include <sys/types.h>
8671 printf("%d\n", (int)sizeof($lseektype));
8676 if eval $compile_ok; then
8677 lseeksize=`$run ./try`
8678 $echo "Your file offsets are now $lseeksize bytes long."
8682 echo "(I can't seem to compile the test program. Guessing...)"
8683 rp="What is the size of your file offsets (in bytes)?"
8688 *_t) zzz="$fpostype" ;;
8691 $echo $n "Rechecking the size of $zzz...$c" >&4
8693 #include <sys/types.h>
8696 printf("%d\n", (int)sizeof($fpostype));
8701 if eval $compile_ok; then
8706 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8709 echo " $fpossize bytes." >&4
8715 echo "(I can't compile the test program. Guessing...)" >&4
8716 rp="What is the size of your file positions (in bytes)?"
8725 case "$vendorprefix" in
8726 '') d_vendorbin="$undef"
8730 *) d_vendorbin="$define"
8731 : determine where vendor-supplied executables go.
8732 case "$vendorbin" in
8733 '') dflt=$vendorprefix/bin ;;
8734 *) dflt="$vendorbin" ;;
8737 rp='Pathname for the vendor-supplied executables directory?'
8740 vendorbinexp="$ansexp"
8743 : Change installation prefix, if necessary.
8744 if $test X"$prefix" != X"$installprefix"; then
8745 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
8747 installvendorbin="$vendorbinexp"
8750 : see if qgcvt exists
8754 : Check how to convert floats to strings.
8756 if test "X$d_Gconvert" = X; then
8759 echo "Checking for an efficient way to convert floats to strings."
8761 case "$uselongdouble" in
8762 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8764 case "$d_longdbl" in
8765 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8767 case "$d_PRIgldbl" in
8768 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8772 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8773 char *myname = "gconvert";
8776 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8777 char *myname = "gcvt";
8780 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8781 char *myname = "qgcvt";
8782 #define DOUBLETYPE long double
8785 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8787 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8789 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
8792 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8794 char *myname = "sprintf";
8798 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8799 #define DOUBLETYPE long double
8801 #define DOUBLETYPE double
8807 #define I_STDLIB $i_stdlib
8813 checkit(expect, got)
8817 if (strcmp(expect, got)) {
8818 printf("%s oddity: Expected %s, got %s\n",
8819 myname, expect, got);
8829 /* This must be 1st test on (which?) platform */
8830 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8831 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8832 checkit("0.1", buf);
8834 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
8835 checkit("0.01", buf);
8837 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
8838 checkit("0.001", buf);
8840 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
8841 checkit("0.0001", buf);
8843 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
8844 if (strlen(buf) > 5)
8845 checkit("9e-005", buf); /* for Microsoft ?? */
8847 checkit("9e-05", buf);
8849 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8852 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8853 checkit("1.1", buf);
8855 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8856 checkit("1.01", buf);
8858 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8859 checkit("1.001", buf);
8861 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8862 checkit("1.0001", buf);
8864 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8865 checkit("1.00001", buf);
8867 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8868 checkit("1.000001", buf);
8870 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8873 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8876 /* Some Linux gcvt's give 1.e+5 here. */
8877 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8878 checkit("100000", buf);
8880 /* Some Linux gcvt's give -1.e+5 here. */
8881 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8882 checkit("-100000", buf);
8884 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8885 checkit("123.456", buf);
8887 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
8888 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
8889 /* 34 should be enough to scare even long double
8890 * places into using the e notation. */
8891 if (strlen(buf) > 5)
8892 checkit("1e+034", buf); /* for Microsoft */
8894 checkit("1e+34", buf);
8896 /* For Perl, if you add additional tests here, also add them to
8897 * t/base/num.t for benefit of platforms not using Configure or
8898 * overriding d_Gconvert */
8903 : first add preferred functions to our list
8905 for xxx_convert in $gconvert_preference; do
8906 case $xxx_convert in
8907 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
8908 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
8911 : then add any others
8912 for xxx_convert in gconvert gcvt sprintf; do
8915 *) xxx_list="$xxx_list $xxx_convert" ;;
8919 case "$d_longdbl$uselongdouble" in
8921 : again, add prefered functions to our list first
8923 for xxx_convert in $gconvert_ld_preference; do
8924 case $xxx_convert in
8925 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
8926 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
8929 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
8930 for xxx_convert in qgcvt sprintf $xxx_list; do
8931 case "$xxx_ld_list" in
8932 $xxx_convert*|*" $xxx_convert"*) ;;
8933 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
8936 : if sprintf cannot do long doubles, move it to the end
8937 if test "$d_PRIgldbl" != "$define"; then
8938 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
8940 : if no qgcvt, remove it
8941 if test "$d_qgcvt" != "$define"; then
8942 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
8945 xxx_list="$xxx_ld_list"
8949 for xxx_convert in $xxx_list; do
8950 echo "Trying $xxx_convert..."
8952 set try -DTRY_$xxx_convert
8953 if eval $compile; then
8954 echo "$xxx_convert() found." >&4
8956 echo "I'll use $xxx_convert to convert floats into a string." >&4
8959 echo "...But $xxx_convert didn't work as I expected."
8963 echo "$xxx_convert NOT found." >&4
8967 if test X$xxx_convert = X; then
8968 echo "*** WHOA THERE!!! ***" >&4
8969 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
8973 case "$xxx_convert" in
8974 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8975 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8976 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8977 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8978 "$define$define$define")
8979 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8980 "$define$define$undef")
8981 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
8982 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8989 : see if _fwalk exists
8993 : Initialize h_fcntl
8996 : Initialize h_sysfile
8999 : access call always available on UNIX
9003 : locate the flags for 'access()'
9007 $cat >access.c <<'EOCP'
9008 #include <sys/types.h>
9013 #include <sys/file.h>
9022 : check sys/file.h first, no particular reason here
9023 if $test `./findhdr sys/file.h` && \
9024 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9026 echo "<sys/file.h> defines the *_OK access constants." >&4
9027 elif $test `./findhdr fcntl.h` && \
9028 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9030 echo "<fcntl.h> defines the *_OK access constants." >&4
9031 elif $test `./findhdr unistd.h` && \
9032 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9033 echo "<unistd.h> defines the *_OK access constants." >&4
9035 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9041 : see if accessx exists
9042 set accessx d_accessx
9045 : see if alarm exists
9049 : see if POSIX threads are available
9050 set pthread.h i_pthread
9053 : define a fucntion to check prototypes
9054 $cat > protochk <<EOSH
9057 optimize="$optimize"
9059 prototype="$prototype"
9062 usethreads=$usethreads
9063 i_pthread=$i_pthread
9064 pthread_h_first=$pthread_h_first
9067 $cat >> protochk <<'EOSH'
9072 while test $# -ge 2; do
9074 $define) echo "#include <$2>" >> try.c ;;
9075 literal) echo "$2" >> try.c ;;
9077 # Extra magic for the benefit of systems that need pthread.h
9078 # to be included early to correctly detect threadsafe functions.
9079 # Such functions must guarantee themselves, though, that the usethreads
9080 # and i_pthread have been defined, before calling protochk.
9081 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9082 echo "#include <pthread.h>" >> try.c
9087 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9088 cat >> try.c <<'EOCP'
9089 #ifdef CAN_PROTOTYPE
9090 #define _(args) args
9095 echo "$foo" >> try.c
9096 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9097 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9105 hasproto='varname=$1; func=$2; shift; shift;
9106 while $test $# -ge 2; do
9108 $define) echo "#include <$2>";;
9112 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9113 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9114 echo "$func() prototype found.";
9117 echo "$func() prototype NOT found.";
9122 $rm -f try.c tryout.c'
9124 : see if sys/types.h has to be included
9125 set sys/types.h i_systypes
9128 : see if sys/select.h has to be included
9129 set sys/select.h i_sysselct
9132 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9133 while $test $# -ge 2; do
9135 $define) echo "#include <$2>";;
9139 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9141 if eval $compile; then
9150 : see if we should include time.h, sys/time.h, or both
9152 if test "X$timeincl" = X; then
9153 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9154 $echo $n "I'm now running the test program...$c"
9155 $cat >try.c <<'EOCP'
9156 #include <sys/types.h>
9161 #ifdef SYSTIMEKERNEL
9164 #include <sys/time.h>
9167 #include <sys/select.h>
9176 struct timezone tzp;
9178 if (foo.tm_sec == foo.tm_sec)
9181 if (bar.tv_sec == bar.tv_sec)
9188 for s_timezone in '-DS_TIMEZONE' ''; do
9190 for s_timeval in '-DS_TIMEVAL' ''; do
9191 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9192 for i_time in '' '-DI_TIME'; do
9193 for i_systime in '-DI_SYSTIME' ''; do
9196 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9197 if eval $compile; then
9198 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9202 $echo $n "Succeeded with $flags$c"
9214 *SYSTIMEKERNEL*) i_systimek="$define"
9215 timeincl=`./findhdr sys/time.h`
9216 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9217 *) i_systimek="$undef";;
9220 *I_TIME*) i_time="$define"
9221 timeincl=`./findhdr time.h`" $timeincl"
9222 echo "We'll include <time.h>." >&4;;
9223 *) i_time="$undef";;
9226 *I_SYSTIME*) i_systime="$define"
9227 timeincl=`./findhdr sys/time.h`" $timeincl"
9228 echo "We'll include <sys/time.h>." >&4;;
9229 *) i_systime="$undef";;
9233 : see if struct tm knows about tm_zone
9234 case "$i_systime$i_time" in
9237 echo "Checking to see if your struct tm has tm_zone field..." >&4
9238 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9246 case "$d_tm_tm_zone" in
9247 "$define") echo "Yes, it does." ;;
9248 *) echo "No, it doesn't." ;;
9250 : see if struct tm knows about tm_gmtoff
9251 case "$i_systime$i_time" in
9254 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9255 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9263 case "$d_tm_tm_gmtoff" in
9264 "$define") echo "Yes, it does." ;;
9265 *) echo "No, it doesn't." ;;
9268 : see if asctime_r exists
9269 set asctime_r d_asctime_r
9271 case "$d_asctime_r" in
9273 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9274 case "$d_asctime_r_proto:$usethreads" in
9275 ":define") d_asctime_r_proto=define
9276 set d_asctime_r_proto asctime_r $hdrs
9280 case "$d_asctime_r_proto" in
9282 case "$asctime_r_proto" in
9283 ''|0) try='char* asctime_r(const struct tm*, char*);'
9284 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9286 case "$asctime_r_proto" in
9287 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9288 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9290 case "$asctime_r_proto" in
9291 ''|0) try='int asctime_r(const struct tm*, char*);'
9292 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9294 case "$asctime_r_proto" in
9295 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9296 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9298 case "$asctime_r_proto" in
9299 ''|0) d_asctime_r=undef
9301 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9302 * ) case "$asctime_r_proto" in
9303 REENTRANT_PROTO*) ;;
9304 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9306 echo "Prototype: $try" ;;
9309 *) case "$usethreads" in
9310 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9317 *) asctime_r_proto=0
9321 : see if atolf exists
9325 : see if atoll exists
9329 : Look for GNU-cc style attribute checking
9331 echo "Checking whether your compiler can handle __attribute__ ..." >&4
9332 $cat >attrib.c <<'EOCP'
9334 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
9336 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9337 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9338 echo "Your C compiler doesn't fully support __attribute__."
9341 echo "Your C compiler supports __attribute__."
9345 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9352 : see if bcmp exists
9356 : see if bcopy exists
9360 : see if this is a unistd.h system
9361 set unistd.h i_unistd
9364 : see if getpgrp exists
9365 set getpgrp d_getpgrp
9368 case "$d_getpgrp" in
9371 echo "Checking to see which flavor of getpgrp is in use..."
9374 #include <sys/types.h>
9376 # include <unistd.h>
9380 if (getuid() == 0) {
9381 printf("(I see you are running Configure as super-user...)\n");
9385 if (getpgrp(1) == 0)
9394 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9395 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
9397 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9398 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
9401 echo "I can't seem to compile and run the test program."
9403 xxx="a USG one, i.e. you use getpgrp()."
9405 # SVR4 systems can appear rather BSD-ish.
9408 xxx="a BSD one, i.e. you use getpgrp(pid)."
9412 xxx="probably a USG one, i.e. you use getpgrp()."
9417 echo "Assuming your getpgrp is $xxx" >&4
9426 : see if setpgrp exists
9427 set setpgrp d_setpgrp
9430 case "$d_setpgrp" in
9433 echo "Checking to see which flavor of setpgrp is in use..."
9436 #include <sys/types.h>
9438 # include <unistd.h>
9442 if (getuid() == 0) {
9443 printf("(I see you are running Configure as super-user...)\n");
9447 if (-1 == setpgrp(1, 1))
9450 if (setpgrp() != -1)
9456 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9457 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
9459 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9460 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
9463 echo "(I can't seem to compile and run the test program.)"
9465 xxx="a USG one, i.e. you use setpgrp()."
9467 # SVR4 systems can appear rather BSD-ish.
9470 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
9474 xxx="probably a USG one, i.e. you use setpgrp()."
9479 echo "Assuming your setpgrp is $xxx" >&4
9487 : see if bzero exists
9491 : see if signal is declared as pointer to function returning int or void
9493 xxx=`./findhdr signal.h`
9494 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
9495 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9496 echo "You have int (*signal())() instead of void." >&4
9498 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9499 echo "You have void (*signal())()." >&4
9501 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
9502 echo "You have int (*signal())() instead of void." >&4
9504 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
9505 echo "You have void (*signal())()." >&4
9508 case "$d_voidsig" in
9510 echo "I can't determine whether signal handler returns void or int..." >&4
9512 rp="What type does your signal handler return?"
9519 echo "As you already told me, signal handler returns void." >&4
9522 *) echo "As you already told me, signal handler returns int." >&4
9529 case "$d_voidsig" in
9530 "$define") signal_t="void";;
9535 : check for ability to cast large floats to 32-bit ints.
9537 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
9538 if $test "$intsize" -ge 4; then
9545 #include <sys/types.h>
9547 $signal_t blech(s) int s; { exit(3); }
9554 signal(SIGFPE, blech);
9556 /* Don't let compiler optimize the test away. Store the number
9557 in a writable string for gcc to pass to sscanf under HP/UX.
9559 sprintf(str, "2147483647");
9560 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
9564 /* x86 processors will probably give 0x8000 0000, which is a
9565 sign change. We don't want that. We want to mimic SPARC
9566 behavior here, which is to preserve the sign and give
9569 if (i32 != ($xxx) f)
9575 if eval $compile_ok; then
9579 echo "(I can't seem to compile the test program--assuming it can't)"
9587 echo "Nope, it can't."
9594 : check for ability to cast negative floats to unsigned
9596 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
9599 #include <sys/types.h>
9601 $signal_t blech(s) int s; { exit(7); }
9602 $signal_t blech_in_list(s) int s; { exit(4); }
9603 unsigned long dummy_long(p) unsigned long p; { return p; }
9604 unsigned int dummy_int(p) unsigned int p; { return p; }
9605 unsigned short dummy_short(p) unsigned short p; { return p; }
9609 unsigned long along;
9611 unsigned short ashort;
9615 /* Frustrate gcc-2.7.2's optimizer which failed this test with
9616 a direct f = -123. assignment. gcc-2.8.0 reportedly
9617 optimized the whole file away
9619 /* Store the number in a writable string for gcc to pass to
9622 sprintf(str, "-123");
9623 sscanf(str, "%lf", &f); /* f = -123.; */
9625 signal(SIGFPE, blech);
9626 along = (unsigned long)f;
9627 aint = (unsigned int)f;
9628 ashort = (unsigned short)f;
9629 if (along != (unsigned long)-123)
9631 if (aint != (unsigned int)-123)
9633 if (ashort != (unsigned short)-123)
9635 sprintf(str, "1073741824.");
9636 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
9639 along = (unsigned long)f;
9640 if (along != 0x80000000)
9644 along = (unsigned long)f;
9645 if (along != 0x7fffffff)
9649 along = (unsigned long)f;
9650 if (along != 0x80000001)
9654 signal(SIGFPE, blech_in_list);
9655 sprintf(str, "123.");
9656 sscanf(str, "%lf", &f); /* f = 123.; */
9657 along = dummy_long((unsigned long)f);
9658 aint = dummy_int((unsigned int)f);
9659 ashort = dummy_short((unsigned short)f);
9660 if (along != (unsigned long)123)
9662 if (aint != (unsigned int)123)
9664 if (ashort != (unsigned short)123)
9671 if eval $compile_ok; then
9675 echo "(I can't seem to compile the test program--assuming it can't)"
9678 case "$castflags" in
9683 echo "Nope, it can't."
9690 : see if vprintf exists
9692 if set vprintf val -f d_vprintf; eval $csym; $val; then
9693 echo 'vprintf() found.' >&4
9696 #include <varargs.h>
9698 int main() { xxx("foo"); }
9707 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
9711 if eval $compile && $run ./try; then
9712 echo "Your vsprintf() returns (int)." >&4
9715 echo "Your vsprintf() returns (char*)." >&4
9719 echo 'vprintf() NOT found.' >&4
9730 : see if chown exists
9734 : see if chroot exists
9738 : see if chsize exists
9742 : see if class exists
9746 hasstruct='varname=$1; struct=$2; shift; shift;
9747 while $test $# -ge 2; do
9749 $define) echo "#include <$2>";;
9753 echo "int main () { struct $struct foo; }" >> try.c;
9755 if eval $compile; then
9766 : see whether socket exists
9768 $echo $n "Hmm... $c" >&4
9769 if set socket val -f d_socket; eval $csym; $val; then
9770 echo "Looks like you have Berkeley networking support." >&4
9772 if set setsockopt val -f; eval $csym; $val; then
9775 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9779 if $contains socklib libc.list >/dev/null 2>&1; then
9780 echo "Looks like you have Berkeley networking support." >&4
9782 : we will have to assume that it supports the 4.2 BSD interface
9785 echo "You don't have Berkeley networking in libc$_a..." >&4
9786 if test "X$d_socket" = "X$define"; then
9787 echo "...but you seem to believe that you have sockets." >&4
9789 for net in net socket
9791 if test -f /usr/lib/lib$net$_a; then
9792 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9793 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9794 if $contains socket libc.list >/dev/null 2>&1; then
9799 echo "...but the Wollongong group seems to have hacked it in." >&4
9800 sockethdr="-I/usr/netinclude"
9803 echo "Found Berkeley sockets interface in lib$net." >&4
9804 if $contains setsockopt libc.list >/dev/null 2>&1; then
9807 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9814 if test "X$d_socket" != "X$define"; then
9815 echo "or anywhere else I see." >&4
9823 : see if socketpair exists
9824 set socketpair d_sockpair
9829 echo "Checking the availability of certain socket constants..." >&4
9830 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9831 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9833 #include <sys/types.h>
9834 #include <sys/socket.h>
9840 set try; if eval $compile; then
9843 set d_${enum}; eval $setvar
9847 : see if this is a sys/uio.h system
9848 set sys/uio.h i_sysuio
9853 echo "Checking to see if your system supports struct cmsghdr..." >&4
9854 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
9856 case "$d_cmsghdr_s" in
9857 "$define") echo "Yes, it does." ;;
9858 *) echo "No, it doesn't." ;;
9862 : check for const keyword
9864 echo 'Checking to see if your C compiler knows about "const"...' >&4
9865 $cat >const.c <<'EOCP'
9866 typedef struct spug { int drokk; } spug;
9873 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
9875 echo "Yup, it does."
9878 echo "Nope, it doesn't."
9883 : see if crypt exists
9888 $define) cryptlib='' ;;
9889 *) if set crypt val -f d_crypt; eval $csym; $val; then
9890 echo 'crypt() found.' >&4
9894 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
9895 if $test -z "$cryptlib"; then
9896 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
9900 if $test -z "$cryptlib"; then
9901 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
9905 if $test -z "$cryptlib"; then
9906 cryptlib=`./loc libcrypt$_a "" $libpth`
9910 if $test -z "$cryptlib"; then
9911 echo 'crypt() NOT found.' >&4
9922 : see if this is a crypt.h system
9926 : see if crypt_r exists
9927 set crypt_r d_crypt_r
9929 case "$d_crypt_r" in
9931 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
9932 case "$d_crypt_r_proto:$usethreads" in
9933 ":define") d_crypt_r_proto=define
9934 set d_crypt_r_proto crypt_r $hdrs
9938 case "$d_crypt_r_proto" in
9940 case "$crypt_r_proto" in
9941 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
9942 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
9944 case "$crypt_r_proto" in
9945 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
9946 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
9948 case "$crypt_r_proto" in
9949 ''|0) d_crypt_r=undef
9951 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
9952 * ) case "$crypt_r_proto" in
9953 REENTRANT_PROTO*) ;;
9954 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
9956 echo "Prototype: $try" ;;
9959 *) case "$usethreads" in
9960 define) echo "crypt_r has no prototype, not using it." >&4 ;;
9971 : get csh whereabouts
9973 'csh') val="$undef" ;;
9978 : Respect a hint or command line value for full_csh.
9980 '') full_csh=$csh ;;
9983 : see if ctermid_r exists
9984 set ctermid_r d_ctermid_r
9986 case "$d_ctermid_r" in
9988 hdrs="$i_systypes sys/types.h define stdio.h "
9989 case "$d_ctermid_r_proto:$usethreads" in
9990 ":define") d_ctermid_r_proto=define
9991 set d_ctermid_r_proto ctermid_r $hdrs
9995 case "$d_ctermid_r_proto" in
9997 case "$ctermid_r_proto" in
9998 ''|0) try='char* ctermid_r(char*);'
9999 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10001 case "$ctermid_r_proto" in
10002 ''|0) d_ctermid_r=undef
10004 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10005 * ) case "$ctermid_r_proto" in
10006 REENTRANT_PROTO*) ;;
10007 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10009 echo "Prototype: $try" ;;
10012 *) case "$usethreads" in
10013 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10020 *) ctermid_r_proto=0
10024 : see if ctime_r exists
10025 set ctime_r d_ctime_r
10027 case "$d_ctime_r" in
10029 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10030 case "$d_ctime_r_proto:$usethreads" in
10031 ":define") d_ctime_r_proto=define
10032 set d_ctime_r_proto ctime_r $hdrs
10036 case "$d_ctime_r_proto" in
10038 case "$ctime_r_proto" in
10039 ''|0) try='char* ctime_r(const time_t*, char*);'
10040 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10042 case "$ctime_r_proto" in
10043 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10044 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10046 case "$ctime_r_proto" in
10047 ''|0) try='int ctime_r(const time_t*, char*);'
10048 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10050 case "$ctime_r_proto" in
10051 ''|0) try='int ctime_r(const time_t*, char*, int);'
10052 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10054 case "$ctime_r_proto" in
10055 ''|0) d_ctime_r=undef
10057 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10058 * ) case "$ctime_r_proto" in
10059 REENTRANT_PROTO*) ;;
10060 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10062 echo "Prototype: $try" ;;
10065 *) case "$usethreads" in
10066 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10077 : see if cuserid exists
10078 set cuserid d_cuserid
10081 : see if this is a limits.h system
10082 set limits.h i_limits
10085 : see if this is a float.h system
10086 set float.h i_float
10089 : See if number of significant digits in a double precision number is known
10091 $cat >dbl_dig.c <<EOM
10092 #$i_limits I_LIMITS
10095 #include <limits.h>
10101 printf("Contains DBL_DIG");
10104 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10105 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10106 echo "DBL_DIG found." >&4
10109 echo "DBL_DIG NOT found." >&4
10116 : see if dbm.h is available
10117 : see if dbmclose exists
10118 set dbmclose d_dbmclose
10121 case "$d_dbmclose" in
10131 *) set rpcsvc/dbm.h i_rpcsvcdbm
10136 *) echo "We won't be including <dbm.h>"
10146 : see if prototype for dbminit is available
10148 set d_dbminitproto dbminit $i_dbm dbm.h
10151 : see if difftime exists
10152 set difftime d_difftime
10155 : see if this is a dirent system
10157 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10159 echo "<dirent.h> found." >&4
10162 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10163 echo "<sys/dir.h> found." >&4
10166 xinc=`./findhdr sys/ndir.h`
10168 echo "<dirent.h> NOT found." >&4
10173 : Look for type of directory structure.
10175 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10177 case "$direntrytype" in
10179 case "$i_dirent" in
10180 $define) guess1='struct dirent' ;;
10181 *) guess1='struct direct' ;;
10184 *) guess1="$direntrytype"
10189 'struct dirent') guess2='struct direct' ;;
10190 *) guess2='struct dirent' ;;
10193 if $contains "$guess1" try.c >/dev/null 2>&1; then
10194 direntrytype="$guess1"
10195 echo "Your directory entries are $direntrytype." >&4
10196 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10197 direntrytype="$guess2"
10198 echo "Your directory entries seem to be $direntrytype." >&4
10200 echo "I don't recognize your system's directory entries." >&4
10201 rp="What type is used for directory entries on this system?"
10204 direntrytype="$ans"
10209 : see if the directory entry stores field length
10211 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10212 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10213 echo "Good, your directory entry keeps length information in d_namlen." >&4
10216 echo "Your directory entry does not know about the d_namlen field." >&4
10223 : see if this is an sysdir system
10224 set sys/dir.h i_sysdir
10227 : see if this is an sysndir system
10228 set sys/ndir.h i_sysndir
10233 $cat >dirfd.c <<EOM
10235 #$i_dirent I_DIRENT /**/
10236 #$i_sysdir I_SYS_DIR /**/
10237 #$i_sysndir I_SYS_NDIR /**/
10238 #$i_systypes I_SYS_TYPES /**/
10239 #if defined(I_SYS_TYPES)
10240 #include <sys/types.h>
10242 #if defined(I_DIRENT)
10243 #include <dirent.h>
10244 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10245 #include <sys/dir.h>
10249 #include <sys/ndir.h>
10253 #include <ndir.h> /* may be wrong in the future */
10255 #include <sys/dir.h>
10261 DIR *dirp = opendir(".");
10262 if (dirfd(dirp) >= 0)
10269 if eval $compile; then
10273 $define) echo "dirfd() found." >&4 ;;
10274 *) echo "dirfd() NOT found." >&4 ;;
10280 : see if dlerror exists
10283 set dlerror d_dlerror
10287 : see if dlfcn is available
10288 set dlfcn.h i_dlfcn
10295 On a few systems, the dynamically loaded modules that perl generates and uses
10296 will need a different extension than shared libs. The default will probably
10302 *) dflt="$dlext" ;;
10304 rp='What is the extension of dynamically loaded modules'
10313 : Check if dlsym need a leading underscore
10319 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
10320 $cat >dyna.c <<'EOM'
10329 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
10331 #include <sys/types.h>
10336 extern int fred() ;
10345 int mode = RTLD_LAZY ;
10347 handle = dlopen("./dyna.$dlext", mode) ;
10348 if (handle == NULL) {
10353 symbol = dlsym(handle, "fred") ;
10354 if (symbol == NULL) {
10355 /* try putting a leading underscore */
10356 symbol = dlsym(handle, "_fred") ;
10357 if (symbol == NULL) {
10370 : Call the object file tmp-dyna.o in case dlext=o.
10371 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
10372 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
10373 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
10374 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
10377 1) echo "Test program failed using dlopen." >&4
10378 echo "Perhaps you should not use dynamic loading." >&4;;
10379 2) echo "Test program failed using dlsym." >&4
10380 echo "Perhaps you should not use dynamic loading." >&4;;
10381 3) echo "dlsym needs a leading underscore" >&4
10383 4) echo "dlsym doesn't need a leading underscore." >&4;;
10386 echo "I can't compile and run the test program." >&4
10387 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
10392 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
10397 : see if drand48_r exists
10398 set drand48_r d_drand48_r
10400 case "$d_drand48_r" in
10402 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
10403 case "$d_drand48_r_proto:$usethreads" in
10404 ":define") d_drand48_r_proto=define
10405 set d_drand48_r_proto drand48_r $hdrs
10409 case "$d_drand48_r_proto" in
10411 case "$drand48_r_proto" in
10412 ''|0) try='int drand48_r(struct drand48_data*, double*);'
10413 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
10415 case "$drand48_r_proto" in
10416 ''|0) d_drand48_r=undef
10418 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
10419 * ) case "$drand48_r_proto" in
10420 REENTRANT_PROTO*) ;;
10421 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
10423 echo "Prototype: $try" ;;
10426 *) case "$usethreads" in
10427 define) echo "drand48_r has no prototype, not using it." >&4 ;;
10434 *) drand48_r_proto=0
10438 : see if prototype for drand48 is available
10440 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
10443 : see if dup2 exists
10447 : see if eaccess exists
10448 set eaccess d_eaccess
10451 : see if endgrent exists
10452 set endgrent d_endgrent
10455 : see if this is an grp system
10461 xxx=`./findhdr grp.h`
10462 $cppstdin $cppflags $cppminus < $xxx >$$.h
10464 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10476 set d_grpasswd; eval $setvar
10480 : see if endgrent_r exists
10481 set endgrent_r d_endgrent_r
10483 case "$d_endgrent_r" in
10485 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
10486 case "$d_endgrent_r_proto:$usethreads" in
10487 ":define") d_endgrent_r_proto=define
10488 set d_endgrent_r_proto endgrent_r $hdrs
10492 case "$d_endgrent_r_proto" in
10494 case "$endgrent_r_proto" in
10495 ''|0) try='int endgrent_r(FILE**);'
10496 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
10498 case "$endgrent_r_proto" in
10499 ''|0) try='void endgrent_r(FILE**);'
10500 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
10502 case "$endgrent_r_proto" in
10503 ''|0) d_endgrent_r=undef
10505 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
10506 * ) case "$endgrent_r_proto" in
10507 REENTRANT_PROTO*) ;;
10508 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
10510 echo "Prototype: $try" ;;
10513 *) case "$usethreads" in
10514 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
10521 *) endgrent_r_proto=0
10525 : see if endhostent exists
10526 set endhostent d_endhent
10529 : see if this is a netdb.h system
10530 set netdb.h i_netdb
10533 : see if endhostent_r exists
10534 set endhostent_r d_endhostent_r
10536 case "$d_endhostent_r" in
10538 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10539 case "$d_endhostent_r_proto:$usethreads" in
10540 ":define") d_endhostent_r_proto=define
10541 set d_endhostent_r_proto endhostent_r $hdrs
10545 case "$d_endhostent_r_proto" in
10547 case "$endhostent_r_proto" in
10548 ''|0) try='int endhostent_r(struct hostent_data*);'
10549 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
10551 case "$endhostent_r_proto" in
10552 ''|0) try='void endhostent_r(struct hostent_data*);'
10553 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
10555 case "$endhostent_r_proto" in
10556 ''|0) d_endhostent_r=undef
10557 endhostent_r_proto=0
10558 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
10559 * ) case "$endhostent_r_proto" in
10560 REENTRANT_PROTO*) ;;
10561 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
10563 echo "Prototype: $try" ;;
10566 *) case "$usethreads" in
10567 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
10569 d_endhostent_r=undef
10570 endhostent_r_proto=0
10574 *) endhostent_r_proto=0
10578 : see if endnetent exists
10579 set endnetent d_endnent
10582 : see if endnetent_r exists
10583 set endnetent_r d_endnetent_r
10585 case "$d_endnetent_r" in
10587 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10588 case "$d_endnetent_r_proto:$usethreads" in
10589 ":define") d_endnetent_r_proto=define
10590 set d_endnetent_r_proto endnetent_r $hdrs
10594 case "$d_endnetent_r_proto" in
10596 case "$endnetent_r_proto" in
10597 ''|0) try='int endnetent_r(struct netent_data*);'
10598 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
10600 case "$endnetent_r_proto" in
10601 ''|0) try='void endnetent_r(struct netent_data*);'
10602 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
10604 case "$endnetent_r_proto" in
10605 ''|0) d_endnetent_r=undef
10606 endnetent_r_proto=0
10607 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
10608 * ) case "$endnetent_r_proto" in
10609 REENTRANT_PROTO*) ;;
10610 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
10612 echo "Prototype: $try" ;;
10615 *) case "$usethreads" in
10616 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
10618 d_endnetent_r=undef
10619 endnetent_r_proto=0
10623 *) endnetent_r_proto=0
10627 : see if endprotoent exists
10628 set endprotoent d_endpent
10631 : see if endprotoent_r exists
10632 set endprotoent_r d_endprotoent_r
10634 case "$d_endprotoent_r" in
10636 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10637 case "$d_endprotoent_r_proto:$usethreads" in
10638 ":define") d_endprotoent_r_proto=define
10639 set d_endprotoent_r_proto endprotoent_r $hdrs
10643 case "$d_endprotoent_r_proto" in
10645 case "$endprotoent_r_proto" in
10646 ''|0) try='int endprotoent_r(struct protoent_data*);'
10647 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
10649 case "$endprotoent_r_proto" in
10650 ''|0) try='void endprotoent_r(struct protoent_data*);'
10651 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
10653 case "$endprotoent_r_proto" in
10654 ''|0) d_endprotoent_r=undef
10655 endprotoent_r_proto=0
10656 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
10657 * ) case "$endprotoent_r_proto" in
10658 REENTRANT_PROTO*) ;;
10659 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
10661 echo "Prototype: $try" ;;
10664 *) case "$usethreads" in
10665 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
10667 d_endprotoent_r=undef
10668 endprotoent_r_proto=0
10672 *) endprotoent_r_proto=0
10676 : see if endpwent exists
10677 set endpwent d_endpwent
10680 : see if this is a pwd.h system
10686 xxx=`./findhdr pwd.h`
10687 $cppstdin $cppflags $cppminus < $xxx >$$.h
10689 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10697 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10705 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10713 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10721 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10729 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10737 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10745 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10757 set d_pwquota; eval $setvar
10758 set d_pwage; eval $setvar
10759 set d_pwchange; eval $setvar
10760 set d_pwclass; eval $setvar
10761 set d_pwexpire; eval $setvar
10762 set d_pwcomment; eval $setvar
10763 set d_pwgecos; eval $setvar
10764 set d_pwpasswd; eval $setvar
10768 : see if endpwent_r exists
10769 set endpwent_r d_endpwent_r
10771 case "$d_endpwent_r" in
10773 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
10774 case "$d_endpwent_r_proto:$usethreads" in
10775 ":define") d_endpwent_r_proto=define
10776 set d_endpwent_r_proto endpwent_r $hdrs
10780 case "$d_endpwent_r_proto" in
10782 case "$endpwent_r_proto" in
10783 ''|0) try='int endpwent_r(FILE**);'
10784 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
10786 case "$endpwent_r_proto" in
10787 ''|0) try='void endpwent_r(FILE**);'
10788 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
10790 case "$endpwent_r_proto" in
10791 ''|0) d_endpwent_r=undef
10793 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
10794 * ) case "$endpwent_r_proto" in
10795 REENTRANT_PROTO*) ;;
10796 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
10798 echo "Prototype: $try" ;;
10801 *) case "$usethreads" in
10802 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
10809 *) endpwent_r_proto=0
10813 : see if endservent exists
10814 set endservent d_endsent
10817 : see if endservent_r exists
10818 set endservent_r d_endservent_r
10820 case "$d_endservent_r" in
10822 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10823 case "$d_endservent_r_proto:$usethreads" in
10824 ":define") d_endservent_r_proto=define
10825 set d_endservent_r_proto endservent_r $hdrs
10829 case "$d_endservent_r_proto" in
10831 case "$endservent_r_proto" in
10832 ''|0) try='int endservent_r(struct servent_data*);'
10833 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
10835 case "$endservent_r_proto" in
10836 ''|0) try='void endservent_r(struct servent_data*);'
10837 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
10839 case "$endservent_r_proto" in
10840 ''|0) d_endservent_r=undef
10841 endservent_r_proto=0
10842 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
10843 * ) case "$endservent_r_proto" in
10844 REENTRANT_PROTO*) ;;
10845 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
10847 echo "Prototype: $try" ;;
10850 *) case "$usethreads" in
10851 define) echo "endservent_r has no prototype, not using it." >&4 ;;
10853 d_endservent_r=undef
10854 endservent_r_proto=0
10858 *) endservent_r_proto=0
10862 : Locate the flags for 'open()'
10864 $cat >try.c <<'EOCP'
10865 #include <sys/types.h>
10870 #include <sys/file.h>
10881 : check sys/file.h first to get FREAD on Sun
10882 if $test `./findhdr sys/file.h` && \
10883 set try -DI_SYS_FILE && eval $compile; then
10885 echo "<sys/file.h> defines the O_* constants..." >&4
10886 if $run ./try; then
10887 echo "and you have the 3 argument form of open()." >&4
10890 echo "but not the 3 argument form of open(). Oh, well." >&4
10893 elif $test `./findhdr fcntl.h` && \
10894 set try -DI_FCNTL && eval $compile; then
10896 echo "<fcntl.h> defines the O_* constants..." >&4
10897 if $run ./try; then
10898 echo "and you have the 3 argument form of open()." >&4
10901 echo "but not the 3 argument form of open(). Oh, well." >&4
10906 echo "I can't find the O_* constant definitions! You got problems." >&4
10912 : see which of string.h or strings.h is needed
10914 strings=`./findhdr string.h`
10915 if $test "$strings" && $test -r "$strings"; then
10916 echo "Using <string.h> instead of <strings.h>." >&4
10920 strings=`./findhdr strings.h`
10921 if $test "$strings" && $test -r "$strings"; then
10922 echo "Using <strings.h> instead of <string.h>." >&4
10924 echo "No string header found -- You'll surely have problems." >&4
10929 case "$i_string" in
10930 "$undef") strings=`./findhdr strings.h`;;
10931 *) strings=`./findhdr string.h`;;
10934 : see if this is a sys/file.h system
10939 : do we need to include sys/file.h ?
10943 if $h_sysfile; then
10945 echo "We'll be including <sys/file.h>." >&4
10948 echo "We won't be including <sys/file.h>." >&4
10958 : see if fcntl.h is there
10963 : see if we can include fcntl.h
10969 echo "We'll be including <fcntl.h>." >&4
10972 if $h_sysfile; then
10973 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
10975 echo "We won't be including <fcntl.h>." >&4
10987 : check for non-blocking I/O stuff
10988 case "$h_sysfile" in
10989 true) echo "#include <sys/file.h>" > head.c;;
10992 true) echo "#include <fcntl.h>" > head.c;;
10993 *) echo "#include <sys/fcntl.h>" > head.c;;
10998 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
10999 case "$o_nonblock" in
11001 $cat head.c > try.c
11002 $cat >>try.c <<EOCP
11004 #include <stdlib.h>
11011 printf("O_NONBLOCK\n");
11015 printf("O_NDELAY\n");
11019 printf("FNDELAY\n");
11026 if eval $compile_ok; then
11027 o_nonblock=`$run ./try`
11028 case "$o_nonblock" in
11029 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11030 *) echo "Seems like we can use $o_nonblock.";;
11033 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11036 *) echo "Using $hint value $o_nonblock.";;
11038 $rm -f try try.* .out core
11041 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11044 $cat head.c > try.c
11045 $cat >>try.c <<EOCP
11047 #include <sys/types.h>
11048 #include <signal.h>
11050 #include <stdlib.h>
11055 #define MY_O_NONBLOCK $o_nonblock
11056 #ifndef errno /* XXX need better Configure test */
11059 #$i_unistd I_UNISTD
11061 #include <unistd.h>
11063 #$i_string I_STRING
11065 #include <string.h>
11067 #include <strings.h>
11069 $signal_t blech(x) int x; { exit(3); }
11071 $cat >> try.c <<'EOCP'
11079 pipe(pd); /* Down: child -> parent */
11080 pipe(pu); /* Up: parent -> child */
11083 close(pd[1]); /* Parent reads from pd[0] */
11084 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11086 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11091 signal(SIGALRM, blech);
11093 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11095 sprintf(string, "%d\n", ret);
11096 write(2, string, strlen(string));
11099 if (errno == EAGAIN) {
11100 printf("EAGAIN\n");
11105 if (errno == EWOULDBLOCK)
11106 printf("EWOULDBLOCK\n");
11109 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11110 sleep(2); /* Give it time to close our pipe */
11112 ret = read(pd[0], buf, 1); /* Should read EOF */
11114 sprintf(string, "%d\n", ret);
11115 write(4, string, strlen(string));
11119 close(pd[0]); /* We write to pd[1] */
11120 close(pu[1]); /* We read from pu[0] */
11121 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11122 close(pd[1]); /* Pipe pd is now fully closed! */
11123 exit(0); /* Bye bye, thank you for playing! */
11127 if eval $compile_ok; then
11128 echo "$startsh" >mtry
11129 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11131 ./mtry >/dev/null 2>&1
11133 0) eagain=`$cat try.out`;;
11134 1) echo "Could not perform non-blocking setting!";;
11135 2) echo "I did a successful read() for something that was not there!";;
11136 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11137 4) echo "Could not find F_SETFL!";;
11138 *) echo "Something terribly wrong happened during testing.";;
11140 rd_nodata=`$cat try.ret`
11141 echo "A read() system call with no data present returns $rd_nodata."
11142 case "$rd_nodata" in
11145 echo "(That's peculiar, fixing that to be -1.)"
11151 echo "Forcing errno EAGAIN on read() with no data available."
11155 echo "Your read() sets errno to $eagain when no data is available."
11158 status=`$cat try.err`
11160 0) echo "And it correctly returns 0 to signal EOF.";;
11161 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11162 *) echo "However, your read() returns '$status' on EOF??";;
11165 if test "$status" = "$rd_nodata"; then
11166 echo "WARNING: you can't distinguish between EOF and no data!"
11170 echo "I can't compile the test program--assuming errno EAGAIN will do."
11177 echo "Using $hint value $eagain."
11178 echo "Your read() returns $rd_nodata when no data is present."
11179 case "$d_eofnblk" in
11180 "$define") echo "And you can see EOF because read() returns 0.";;
11181 "$undef") echo "But you can't see EOF status from read() returned value.";;
11183 echo "(Assuming you can't see EOF status from read anyway.)"
11189 $rm -f try try.* .out core head.c mtry
11191 : see if fchdir exists
11192 set fchdir d_fchdir
11195 : see if fchmod exists
11196 set fchmod d_fchmod
11199 : see if fchown exists
11200 set fchown d_fchown
11203 : see if this is an fcntl system
11208 : See if fcntl-based locking works.
11210 #include <stdlib.h>
11211 #include <unistd.h>
11213 #include <signal.h>
11214 $signal_t blech(x) int x; { exit(3); }
11216 #if defined(F_SETLK) && defined(F_SETLKW)
11217 struct flock flock;
11219 fd = open("try.c", O_RDONLY);
11220 flock.l_type = F_RDLCK;
11221 flock.l_whence = SEEK_SET;
11222 flock.l_start = flock.l_len = 0;
11223 signal(SIGALRM, blech);
11225 retval = fcntl(fd, F_SETLK, &flock);
11227 (retval < 0 ? exit(2) : exit(0));
11233 echo "Checking if fcntl-based file locking works... "
11237 if eval $compile_ok; then
11238 if $run ./try; then
11239 echo "Yes, it seems to work."
11242 echo "Nope, it didn't work."
11247 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
11248 *** This is (almost) impossible.
11249 *** If your NFS lock daemons are not feeling well, something like
11250 *** this may happen, please investigate. Cannot continue, aborting.
11258 echo "I'm unable to compile the test program, so I'll assume not."
11263 echo "Nope, since you don't even have fcntl()."
11266 set d_fcntl_can_lock
11271 : check for fd_set items
11274 Checking to see how well your C compiler handles fd_set and friends ...
11277 #$i_systime I_SYS_TIME
11278 #$i_sysselct I_SYS_SELECT
11279 #$d_socket HAS_SOCKET
11280 #include <sys/types.h>
11282 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
11285 #include <sys/time.h>
11287 #ifdef I_SYS_SELECT
11288 #include <sys/select.h>
11297 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
11305 if eval $compile; then
11306 d_fds_bits="$define"
11308 echo "Well, your system knows about the normal fd_set typedef..." >&4
11309 if $run ./try; then
11310 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
11311 d_fd_macros="$define"
11314 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
11316 d_fd_macros="$undef"
11320 Hmm, your compiler has some difficulty with fd_set. Checking further...
11323 if eval $compile; then
11324 d_fds_bits="$undef"
11326 echo "Well, your system has some sort of fd_set available..." >&4
11327 if $run ./try; then
11328 echo "and you have the normal fd_set macros." >&4
11329 d_fd_macros="$define"
11332 but not the normal fd_set macros! Gross! More work for me...
11334 d_fd_macros="$undef"
11337 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
11339 d_fds_bits="$undef"
11340 d_fd_macros="$undef"
11345 : see if fgetpos exists
11346 set fgetpos d_fgetpos
11349 : see if finite exists
11350 set finite d_finite
11353 : see if finitel exists
11354 set finitel d_finitel
11357 : see if flock exists
11361 : see if prototype for flock is available
11363 set d_flockproto flock $i_sysfile sys/file.h
11366 : see if fork exists
11370 : see if fp_class exists
11371 set fp_class d_fp_class
11374 : see if pathconf exists
11375 set pathconf d_pathconf
11378 : see if fpathconf exists
11379 set fpathconf d_fpathconf
11382 : see if fpclass exists
11383 set fpclass d_fpclass
11386 : see if fpclassify exists
11387 set fpclassify d_fpclassify
11390 : see if fpclassl exists
11391 set fpclassl d_fpclassl
11395 : check for fpos64_t
11397 echo "Checking to see if you have fpos64_t..." >&4
11400 int main() { fpos64_t x = 7; }
11403 if eval $compile; then
11405 echo "You have fpos64_t."
11408 echo "You do not have fpos64_t."
11409 case "$fpossize" in
11410 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
11417 : see if frexpl exists
11418 set frexpl d_frexpl
11421 : see if this is a sys/param system
11422 set sys/param.h i_sysparam
11425 : see if this is a sys/mount.h system
11426 set sys/mount.h i_sysmount
11431 echo "Checking to see if your system supports struct fs_data..." >&4
11432 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
11434 case "$d_fs_data_s" in
11435 "$define") echo "Yes, it does." ;;
11436 *) echo "No, it doesn't." ;;
11439 : see if fseeko exists
11440 set fseeko d_fseeko
11442 case "$longsize" in
11443 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
11446 : see if fsetpos exists
11447 set fsetpos d_fsetpos
11451 : see if fstatfs exists
11452 set fstatfs d_fstatfs
11456 : see if statvfs exists
11457 set statvfs d_statvfs
11460 : see if fstatvfs exists
11461 set fstatvfs d_fstatvfs
11465 : see if fsync exists
11469 : see if ftello exists
11470 set ftello d_ftello
11472 case "$longsize" in
11473 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
11476 : see if getcwd exists
11477 set getcwd d_getcwd
11480 : see if getespwnam exists
11481 set getespwnam d_getespwnam
11485 : see if getfsstat exists
11486 set getfsstat d_getfsstat
11489 : see if getgrent exists
11490 set getgrent d_getgrent
11493 : see if getgrent_r exists
11494 set getgrent_r d_getgrent_r
11496 case "$d_getgrent_r" in
11498 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11499 case "$d_getgrent_r_proto:$usethreads" in
11500 ":define") d_getgrent_r_proto=define
11501 set d_getgrent_r_proto getgrent_r $hdrs
11505 case "$d_getgrent_r_proto" in
11507 case "$getgrent_r_proto" in
11508 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
11509 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
11511 case "$getgrent_r_proto" in
11512 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
11513 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
11515 case "$getgrent_r_proto" in
11516 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
11517 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
11519 case "$getgrent_r_proto" in
11520 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
11521 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
11523 case "$getgrent_r_proto" in
11524 ''|0) try='int getgrent_r(struct group*, char*, int);'
11525 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
11527 case "$getgrent_r_proto" in
11528 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
11529 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
11531 case "$getgrent_r_proto" in
11532 ''|0) d_getgrent_r=undef
11534 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
11535 * ) case "$getgrent_r_proto" in
11536 REENTRANT_PROTO*) ;;
11537 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
11539 echo "Prototype: $try" ;;
11542 *) case "$usethreads" in
11543 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
11550 *) getgrent_r_proto=0
11554 : see if getgrgid_r exists
11555 set getgrgid_r d_getgrgid_r
11557 case "$d_getgrgid_r" in
11559 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11560 case "$d_getgrgid_r_proto:$usethreads" in
11561 ":define") d_getgrgid_r_proto=define
11562 set d_getgrgid_r_proto getgrgid_r $hdrs
11566 case "$d_getgrgid_r_proto" in
11568 case "$getgrgid_r_proto" in
11569 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
11570 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
11572 case "$getgrgid_r_proto" in
11573 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
11574 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
11576 case "$getgrgid_r_proto" in
11577 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
11578 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
11580 case "$getgrgid_r_proto" in
11581 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
11582 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
11584 case "$getgrgid_r_proto" in
11585 ''|0) d_getgrgid_r=undef
11587 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
11588 * ) case "$getgrgid_r_proto" in
11589 REENTRANT_PROTO*) ;;
11590 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
11592 echo "Prototype: $try" ;;
11595 *) case "$usethreads" in
11596 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
11603 *) getgrgid_r_proto=0
11607 : see if getgrnam_r exists
11608 set getgrnam_r d_getgrnam_r
11610 case "$d_getgrnam_r" in
11612 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11613 case "$d_getgrnam_r_proto:$usethreads" in
11614 ":define") d_getgrnam_r_proto=define
11615 set d_getgrnam_r_proto getgrnam_r $hdrs
11619 case "$d_getgrnam_r_proto" in
11621 case "$getgrnam_r_proto" in
11622 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
11623 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
11625 case "$getgrnam_r_proto" in
11626 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
11627 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
11629 case "$getgrnam_r_proto" in
11630 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
11631 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
11633 case "$getgrnam_r_proto" in
11634 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
11635 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
11637 case "$getgrnam_r_proto" in
11638 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
11639 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
11641 case "$getgrnam_r_proto" in
11642 ''|0) d_getgrnam_r=undef
11644 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
11645 * ) case "$getgrnam_r_proto" in
11646 REENTRANT_PROTO*) ;;
11647 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
11649 echo "Prototype: $try" ;;
11652 *) case "$usethreads" in
11653 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
11660 *) getgrnam_r_proto=0
11664 : see if gethostbyaddr exists
11665 set gethostbyaddr d_gethbyaddr
11668 : see if gethostbyname exists
11669 set gethostbyname d_gethbyname
11672 : see if gethostent exists
11673 set gethostent d_gethent
11676 : see how we will look up host name
11679 if set gethostname val -f d_gethname; eval $csym; $val; then
11680 echo 'gethostname() found.' >&4
11681 d_gethname="$define"
11684 if set uname val -f d_uname; eval $csym; $val; then
11687 uname() was found, but you're running xenix, and older versions of xenix
11688 have a broken uname(). If you don't really know whether your xenix is old
11689 enough to have a broken system call, use the default answer.
11694 "$define") dflt=n;;
11696 rp='Is your uname() broken?'
11699 n*) d_uname="$define"; call=uname;;
11702 echo 'uname() found.' >&4
11709 case "$d_gethname" in
11710 '') d_gethname="$undef";;
11713 '') d_uname="$undef";;
11715 case "$d_uname$d_gethname" in
11720 Every now and then someone has a $call() that lies about the hostname
11721 but can't be fixed for political or economic reasons. If you wish, I can
11722 pretend $call() isn't there and maybe compute hostname at run-time
11723 thanks to the '$phostname' command.
11726 rp="Shall I ignore $call() from now on?"
11729 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
11732 case "$phostname" in
11733 '') aphostname='';;
11734 *) case "$aphostname" in
11736 *) set X $phostname
11740 file=`./loc $file $file $pth`
11741 aphostname=`echo $file $*`
11746 case "$d_uname$d_gethname" in
11749 case "$phostname" in
11751 echo "There will be no way for $package to get your hostname." >&4;;
11753 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
11757 case "$d_phostname" in
11758 '') d_phostname="$undef";;
11761 : see if gethostbyaddr_r exists
11762 set gethostbyaddr_r d_gethostbyaddr_r
11764 case "$d_gethostbyaddr_r" in
11766 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11767 case "$d_gethostbyaddr_r_proto:$usethreads" in
11768 ":define") d_gethostbyaddr_r_proto=define
11769 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
11773 case "$d_gethostbyaddr_r_proto" in
11775 case "$gethostbyaddr_r_proto" in
11776 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
11777 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
11779 case "$gethostbyaddr_r_proto" in
11780 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
11781 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
11783 case "$gethostbyaddr_r_proto" in
11784 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
11785 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
11787 case "$gethostbyaddr_r_proto" in
11788 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
11789 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
11791 case "$gethostbyaddr_r_proto" in
11792 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
11793 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
11795 case "$gethostbyaddr_r_proto" in
11796 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
11797 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
11799 case "$gethostbyaddr_r_proto" in
11800 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
11801 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
11803 case "$gethostbyaddr_r_proto" in
11804 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
11805 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
11807 case "$gethostbyaddr_r_proto" in
11808 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
11809 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
11811 case "$gethostbyaddr_r_proto" in
11812 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
11813 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
11815 case "$gethostbyaddr_r_proto" in
11816 ''|0) d_gethostbyaddr_r=undef
11817 gethostbyaddr_r_proto=0
11818 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
11819 * ) case "$gethostbyaddr_r_proto" in
11820 REENTRANT_PROTO*) ;;
11821 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
11823 echo "Prototype: $try" ;;
11826 *) case "$usethreads" in
11827 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
11829 d_gethostbyaddr_r=undef
11830 gethostbyaddr_r_proto=0
11834 *) gethostbyaddr_r_proto=0
11838 : see if gethostbyname_r exists
11839 set gethostbyname_r d_gethostbyname_r
11841 case "$d_gethostbyname_r" in
11843 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11844 case "$d_gethostbyname_r_proto:$usethreads" in
11845 ":define") d_gethostbyname_r_proto=define
11846 set d_gethostbyname_r_proto gethostbyname_r $hdrs
11850 case "$d_gethostbyname_r_proto" in
11852 case "$gethostbyname_r_proto" in
11853 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
11854 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
11856 case "$gethostbyname_r_proto" in
11857 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
11858 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
11860 case "$gethostbyname_r_proto" in
11861 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
11862 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
11864 case "$gethostbyname_r_proto" in
11865 ''|0) d_gethostbyname_r=undef
11866 gethostbyname_r_proto=0
11867 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
11868 * ) case "$gethostbyname_r_proto" in
11869 REENTRANT_PROTO*) ;;
11870 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
11872 echo "Prototype: $try" ;;
11875 *) case "$usethreads" in
11876 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
11878 d_gethostbyname_r=undef
11879 gethostbyname_r_proto=0
11883 *) gethostbyname_r_proto=0
11887 : see if gethostent_r exists
11888 set gethostent_r d_gethostent_r
11890 case "$d_gethostent_r" in
11892 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11893 case "$d_gethostent_r_proto:$usethreads" in
11894 ":define") d_gethostent_r_proto=define
11895 set d_gethostent_r_proto gethostent_r $hdrs
11899 case "$d_gethostent_r_proto" in
11901 case "$gethostent_r_proto" in
11902 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
11903 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
11905 case "$gethostent_r_proto" in
11906 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
11907 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
11909 case "$gethostent_r_proto" in
11910 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
11911 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
11913 case "$gethostent_r_proto" in
11914 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
11915 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
11917 case "$gethostent_r_proto" in
11918 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
11919 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
11921 case "$gethostent_r_proto" in
11922 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
11923 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
11925 case "$gethostent_r_proto" in
11926 ''|0) d_gethostent_r=undef
11927 gethostent_r_proto=0
11928 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
11929 * ) case "$gethostent_r_proto" in
11930 REENTRANT_PROTO*) ;;
11931 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
11933 echo "Prototype: $try" ;;
11936 *) case "$usethreads" in
11937 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
11939 d_gethostent_r=undef
11940 gethostent_r_proto=0
11944 *) gethostent_r_proto=0
11948 : see if prototypes for various gethostxxx netdb.h functions are available
11950 set d_gethostprotos gethostent $i_netdb netdb.h
11953 : see if getitimer exists
11954 set getitimer d_getitimer
11957 : see if getlogin exists
11958 set getlogin d_getlogin
11961 : see if getlogin_r exists
11962 set getlogin_r d_getlogin_r
11964 case "$d_getlogin_r" in
11966 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
11967 case "$d_getlogin_r_proto:$usethreads" in
11968 ":define") d_getlogin_r_proto=define
11969 set d_getlogin_r_proto getlogin_r $hdrs
11973 case "$d_getlogin_r_proto" in
11975 case "$getlogin_r_proto" in
11976 ''|0) try='int getlogin_r(char*, size_t);'
11977 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
11979 case "$getlogin_r_proto" in
11980 ''|0) try='int getlogin_r(char*, int);'
11981 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
11983 case "$getlogin_r_proto" in
11984 ''|0) try='char* getlogin_r(char*, size_t);'
11985 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
11987 case "$getlogin_r_proto" in
11988 ''|0) try='char* getlogin_r(char*, int);'
11989 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
11991 case "$getlogin_r_proto" in
11992 ''|0) d_getlogin_r=undef
11994 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
11995 * ) case "$getlogin_r_proto" in
11996 REENTRANT_PROTO*) ;;
11997 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
11999 echo "Prototype: $try" ;;
12002 *) case "$usethreads" in
12003 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
12010 *) getlogin_r_proto=0
12014 : see if getmnt exists
12015 set getmnt d_getmnt
12018 : see if getmntent exists
12019 set getmntent d_getmntent
12022 : see if getnetbyaddr exists
12023 set getnetbyaddr d_getnbyaddr
12026 : see if getnetbyname exists
12027 set getnetbyname d_getnbyname
12030 : see if getnetent exists
12031 set getnetent d_getnent
12034 : see if getnetbyaddr_r exists
12035 set getnetbyaddr_r d_getnetbyaddr_r
12037 case "$d_getnetbyaddr_r" in
12039 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12040 case "$d_getnetbyaddr_r_proto:$usethreads" in
12041 ":define") d_getnetbyaddr_r_proto=define
12042 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
12046 case "$d_getnetbyaddr_r_proto" in
12048 case "$getnetbyaddr_r_proto" in
12049 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
12050 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
12052 case "$getnetbyaddr_r_proto" in
12053 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
12054 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
12056 case "$getnetbyaddr_r_proto" in
12057 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
12058 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
12060 case "$getnetbyaddr_r_proto" in
12061 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
12062 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
12064 case "$getnetbyaddr_r_proto" in
12065 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
12066 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
12068 case "$getnetbyaddr_r_proto" in
12069 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
12070 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
12072 case "$getnetbyaddr_r_proto" in
12073 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
12074 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
12076 case "$getnetbyaddr_r_proto" in
12077 ''|0) d_getnetbyaddr_r=undef
12078 getnetbyaddr_r_proto=0
12079 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
12080 * ) case "$getnetbyaddr_r_proto" in
12081 REENTRANT_PROTO*) ;;
12082 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
12084 echo "Prototype: $try" ;;
12087 *) case "$usethreads" in
12088 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
12090 d_getnetbyaddr_r=undef
12091 getnetbyaddr_r_proto=0
12095 *) getnetbyaddr_r_proto=0
12099 : see if getnetbyname_r exists
12100 set getnetbyname_r d_getnetbyname_r
12102 case "$d_getnetbyname_r" in
12104 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12105 case "$d_getnetbyname_r_proto:$usethreads" in
12106 ":define") d_getnetbyname_r_proto=define
12107 set d_getnetbyname_r_proto getnetbyname_r $hdrs
12111 case "$d_getnetbyname_r_proto" in
12113 case "$getnetbyname_r_proto" in
12114 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
12115 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
12117 case "$getnetbyname_r_proto" in
12118 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
12119 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
12121 case "$getnetbyname_r_proto" in
12122 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
12123 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
12125 case "$getnetbyname_r_proto" in
12126 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
12127 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
12129 case "$getnetbyname_r_proto" in
12130 ''|0) d_getnetbyname_r=undef
12131 getnetbyname_r_proto=0
12132 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
12133 * ) case "$getnetbyname_r_proto" in
12134 REENTRANT_PROTO*) ;;
12135 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
12137 echo "Prototype: $try" ;;
12140 *) case "$usethreads" in
12141 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
12143 d_getnetbyname_r=undef
12144 getnetbyname_r_proto=0
12148 *) getnetbyname_r_proto=0
12152 : see if getnetent_r exists
12153 set getnetent_r d_getnetent_r
12155 case "$d_getnetent_r" in
12157 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12158 case "$d_getnetent_r_proto:$usethreads" in
12159 ":define") d_getnetent_r_proto=define
12160 set d_getnetent_r_proto getnetent_r $hdrs
12164 case "$d_getnetent_r_proto" in
12166 case "$getnetent_r_proto" in
12167 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
12168 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
12170 case "$getnetent_r_proto" in
12171 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
12172 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
12174 case "$getnetent_r_proto" in
12175 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
12176 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
12178 case "$getnetent_r_proto" in
12179 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
12180 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
12182 case "$getnetent_r_proto" in
12183 ''|0) try='int getnetent_r(struct netent*, char*, int);'
12184 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
12186 case "$getnetent_r_proto" in
12187 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
12188 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
12190 case "$getnetent_r_proto" in
12191 ''|0) d_getnetent_r=undef
12192 getnetent_r_proto=0
12193 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
12194 * ) case "$getnetent_r_proto" in
12195 REENTRANT_PROTO*) ;;
12196 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
12198 echo "Prototype: $try" ;;
12201 *) case "$usethreads" in
12202 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
12204 d_getnetent_r=undef
12205 getnetent_r_proto=0
12209 *) getnetent_r_proto=0
12213 : see if prototypes for various getnetxxx netdb.h functions are available
12215 set d_getnetprotos getnetent $i_netdb netdb.h
12218 : see if getpagesize exists
12219 set getpagesize d_getpagsz
12223 : see if getprotobyname exists
12224 set getprotobyname d_getpbyname
12227 : see if getprotobynumber exists
12228 set getprotobynumber d_getpbynumber
12231 : see if getprotoent exists
12232 set getprotoent d_getpent
12235 : see if getpgid exists
12236 set getpgid d_getpgid
12239 : see if getpgrp2 exists
12240 set getpgrp2 d_getpgrp2
12243 : see if getppid exists
12244 set getppid d_getppid
12247 : see if getpriority exists
12248 set getpriority d_getprior
12251 : see if getprotobyname_r exists
12252 set getprotobyname_r d_getprotobyname_r
12254 case "$d_getprotobyname_r" in
12256 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12257 case "$d_getprotobyname_r_proto:$usethreads" in
12258 ":define") d_getprotobyname_r_proto=define
12259 set d_getprotobyname_r_proto getprotobyname_r $hdrs
12263 case "$d_getprotobyname_r_proto" in
12265 case "$getprotobyname_r_proto" in
12266 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
12267 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
12269 case "$getprotobyname_r_proto" in
12270 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
12271 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
12273 case "$getprotobyname_r_proto" in
12274 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
12275 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
12277 case "$getprotobyname_r_proto" in
12278 ''|0) d_getprotobyname_r=undef
12279 getprotobyname_r_proto=0
12280 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
12281 * ) case "$getprotobyname_r_proto" in
12282 REENTRANT_PROTO*) ;;
12283 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
12285 echo "Prototype: $try" ;;
12288 *) case "$usethreads" in
12289 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
12291 d_getprotobyname_r=undef
12292 getprotobyname_r_proto=0
12296 *) getprotobyname_r_proto=0
12300 : see if getprotobynumber_r exists
12301 set getprotobynumber_r d_getprotobynumber_r
12303 case "$d_getprotobynumber_r" in
12305 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12306 case "$d_getprotobynumber_r_proto:$usethreads" in
12307 ":define") d_getprotobynumber_r_proto=define
12308 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
12312 case "$d_getprotobynumber_r_proto" in
12314 case "$getprotobynumber_r_proto" in
12315 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
12316 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
12318 case "$getprotobynumber_r_proto" in
12319 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
12320 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
12322 case "$getprotobynumber_r_proto" in
12323 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
12324 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
12326 case "$getprotobynumber_r_proto" in
12327 ''|0) d_getprotobynumber_r=undef
12328 getprotobynumber_r_proto=0
12329 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
12330 * ) case "$getprotobynumber_r_proto" in
12331 REENTRANT_PROTO*) ;;
12332 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
12334 echo "Prototype: $try" ;;
12337 *) case "$usethreads" in
12338 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
12340 d_getprotobynumber_r=undef
12341 getprotobynumber_r_proto=0
12345 *) getprotobynumber_r_proto=0
12349 : see if getprotoent_r exists
12350 set getprotoent_r d_getprotoent_r
12352 case "$d_getprotoent_r" in
12354 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12355 case "$d_getprotoent_r_proto:$usethreads" in
12356 ":define") d_getprotoent_r_proto=define
12357 set d_getprotoent_r_proto getprotoent_r $hdrs
12361 case "$d_getprotoent_r_proto" in
12363 case "$getprotoent_r_proto" in
12364 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
12365 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
12367 case "$getprotoent_r_proto" in
12368 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
12369 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
12371 case "$getprotoent_r_proto" in
12372 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
12373 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
12375 case "$getprotoent_r_proto" in
12376 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
12377 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
12379 case "$getprotoent_r_proto" in
12380 ''|0) d_getprotoent_r=undef
12381 getprotoent_r_proto=0
12382 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
12383 * ) case "$getprotoent_r_proto" in
12384 REENTRANT_PROTO*) ;;
12385 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
12387 echo "Prototype: $try" ;;
12390 *) case "$usethreads" in
12391 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
12393 d_getprotoent_r=undef
12394 getprotoent_r_proto=0
12398 *) getprotoent_r_proto=0
12402 : see if prototypes for various getprotoxxx netdb.h functions are available
12404 set d_getprotoprotos getprotoent $i_netdb netdb.h
12407 : see if getprpwnam exists
12408 set getprpwnam d_getprpwnam
12411 : see if getpwent exists
12412 set getpwent d_getpwent
12415 : see if getpwent_r exists
12416 set getpwent_r d_getpwent_r
12418 case "$d_getpwent_r" in
12420 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12421 case "$d_getpwent_r_proto:$usethreads" in
12422 ":define") d_getpwent_r_proto=define
12423 set d_getpwent_r_proto getpwent_r $hdrs
12427 case "$d_getpwent_r_proto" in
12429 case "$getpwent_r_proto" in
12430 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
12431 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
12433 case "$getpwent_r_proto" in
12434 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
12435 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
12437 case "$getpwent_r_proto" in
12438 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
12439 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
12441 case "$getpwent_r_proto" in
12442 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
12443 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
12445 case "$getpwent_r_proto" in
12446 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
12447 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
12449 case "$getpwent_r_proto" in
12450 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
12451 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
12453 case "$getpwent_r_proto" in
12454 ''|0) d_getpwent_r=undef
12456 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
12457 * ) case "$getpwent_r_proto" in
12458 REENTRANT_PROTO*) ;;
12459 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
12461 echo "Prototype: $try" ;;
12464 *) case "$usethreads" in
12465 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
12472 *) getpwent_r_proto=0
12476 : see if getpwnam_r exists
12477 set getpwnam_r d_getpwnam_r
12479 case "$d_getpwnam_r" in
12481 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12482 case "$d_getpwnam_r_proto:$usethreads" in
12483 ":define") d_getpwnam_r_proto=define
12484 set d_getpwnam_r_proto getpwnam_r $hdrs
12488 case "$d_getpwnam_r_proto" in
12490 case "$getpwnam_r_proto" in
12491 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
12492 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
12494 case "$getpwnam_r_proto" in
12495 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
12496 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
12498 case "$getpwnam_r_proto" in
12499 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
12500 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
12502 case "$getpwnam_r_proto" in
12503 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
12504 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
12506 case "$getpwnam_r_proto" in
12507 ''|0) d_getpwnam_r=undef
12509 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
12510 * ) case "$getpwnam_r_proto" in
12511 REENTRANT_PROTO*) ;;
12512 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
12514 echo "Prototype: $try" ;;
12517 *) case "$usethreads" in
12518 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
12525 *) getpwnam_r_proto=0
12529 : see if getpwuid_r exists
12530 set getpwuid_r d_getpwuid_r
12532 case "$d_getpwuid_r" in
12534 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12535 case "$d_getpwuid_r_proto:$usethreads" in
12536 ":define") d_getpwuid_r_proto=define
12537 set d_getpwuid_r_proto getpwuid_r $hdrs
12541 case "$d_getpwuid_r_proto" in
12543 case "$getpwuid_r_proto" in
12544 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
12545 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
12547 case "$getpwuid_r_proto" in
12548 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
12549 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
12551 case "$getpwuid_r_proto" in
12552 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
12553 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
12555 case "$getpwuid_r_proto" in
12556 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
12557 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
12559 case "$getpwuid_r_proto" in
12560 ''|0) d_getpwuid_r=undef
12562 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
12563 * ) case "$getpwuid_r_proto" in
12564 REENTRANT_PROTO*) ;;
12565 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
12567 echo "Prototype: $try" ;;
12570 *) case "$usethreads" in
12571 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
12578 *) getpwuid_r_proto=0
12583 : see if getservbyname exists
12584 set getservbyname d_getsbyname
12587 : see if getservbyport exists
12588 set getservbyport d_getsbyport
12591 : see if getservent exists
12592 set getservent d_getsent
12595 : see if getservbyname_r exists
12596 set getservbyname_r d_getservbyname_r
12598 case "$d_getservbyname_r" in
12600 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12601 case "$d_getservbyname_r_proto:$usethreads" in
12602 ":define") d_getservbyname_r_proto=define
12603 set d_getservbyname_r_proto getservbyname_r $hdrs
12607 case "$d_getservbyname_r_proto" in
12609 case "$getservbyname_r_proto" in
12610 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
12611 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
12613 case "$getservbyname_r_proto" in
12614 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
12615 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
12617 case "$getservbyname_r_proto" in
12618 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
12619 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
12621 case "$getservbyname_r_proto" in
12622 ''|0) d_getservbyname_r=undef
12623 getservbyname_r_proto=0
12624 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
12625 * ) case "$getservbyname_r_proto" in
12626 REENTRANT_PROTO*) ;;
12627 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
12629 echo "Prototype: $try" ;;
12632 *) case "$usethreads" in
12633 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
12635 d_getservbyname_r=undef
12636 getservbyname_r_proto=0
12640 *) getservbyname_r_proto=0
12644 : see if getservbyport_r exists
12645 set getservbyport_r d_getservbyport_r
12647 case "$d_getservbyport_r" in
12649 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12650 case "$d_getservbyport_r_proto:$usethreads" in
12651 ":define") d_getservbyport_r_proto=define
12652 set d_getservbyport_r_proto getservbyport_r $hdrs
12656 case "$d_getservbyport_r_proto" in
12658 case "$getservbyport_r_proto" in
12659 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
12660 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
12662 case "$getservbyport_r_proto" in
12663 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
12664 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
12666 case "$getservbyport_r_proto" in
12667 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
12668 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
12670 case "$getservbyport_r_proto" in
12671 ''|0) d_getservbyport_r=undef
12672 getservbyport_r_proto=0
12673 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
12674 * ) case "$getservbyport_r_proto" in
12675 REENTRANT_PROTO*) ;;
12676 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
12678 echo "Prototype: $try" ;;
12681 *) case "$usethreads" in
12682 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
12684 d_getservbyport_r=undef
12685 getservbyport_r_proto=0
12689 *) getservbyport_r_proto=0
12693 : see if getservent_r exists
12694 set getservent_r d_getservent_r
12696 case "$d_getservent_r" in
12698 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12699 case "$d_getservent_r_proto:$usethreads" in
12700 ":define") d_getservent_r_proto=define
12701 set d_getservent_r_proto getservent_r $hdrs
12705 case "$d_getservent_r_proto" in
12707 case "$getservent_r_proto" in
12708 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
12709 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
12711 case "$getservent_r_proto" in
12712 ''|0) try='int getservent_r(struct servent*, char*, int);'
12713 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
12715 case "$getservent_r_proto" in
12716 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
12717 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
12719 case "$getservent_r_proto" in
12720 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
12721 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
12723 case "$getservent_r_proto" in
12724 ''|0) d_getservent_r=undef
12725 getservent_r_proto=0
12726 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
12727 * ) case "$getservent_r_proto" in
12728 REENTRANT_PROTO*) ;;
12729 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
12731 echo "Prototype: $try" ;;
12734 *) case "$usethreads" in
12735 define) echo "getservent_r has no prototype, not using it." >&4 ;;
12737 d_getservent_r=undef
12738 getservent_r_proto=0
12742 *) getservent_r_proto=0
12746 : see if prototypes for various getservxxx netdb.h functions are available
12748 set d_getservprotos getservent $i_netdb netdb.h
12751 : see if getspnam exists
12752 set getspnam d_getspnam
12755 : see if this is a shadow.h system
12756 set shadow.h i_shadow
12759 : see if getspnam_r exists
12760 set getspnam_r d_getspnam_r
12762 case "$d_getspnam_r" in
12764 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
12765 case "$d_getspnam_r_proto:$usethreads" in
12766 ":define") d_getspnam_r_proto=define
12767 set d_getspnam_r_proto getspnam_r $hdrs
12771 case "$d_getspnam_r_proto" in
12773 case "$getspnam_r_proto" in
12774 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
12775 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
12777 case "$getspnam_r_proto" in
12778 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
12779 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
12781 case "$getspnam_r_proto" in
12782 ''|0) d_getspnam_r=undef
12784 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
12785 * ) case "$getspnam_r_proto" in
12786 REENTRANT_PROTO*) ;;
12787 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
12789 echo "Prototype: $try" ;;
12792 *) case "$usethreads" in
12793 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
12800 *) getspnam_r_proto=0
12804 : see if gettimeofday or ftime exists
12805 set gettimeofday d_gettimeod
12807 case "$d_gettimeod" in
12813 val="$undef"; set d_ftime; eval $setvar
12816 case "$d_gettimeod$d_ftime" in
12819 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
12823 : see if gmtime_r exists
12824 set gmtime_r d_gmtime_r
12826 case "$d_gmtime_r" in
12828 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12829 case "$d_gmtime_r_proto:$usethreads" in
12830 ":define") d_gmtime_r_proto=define
12831 set d_gmtime_r_proto gmtime_r $hdrs
12835 case "$d_gmtime_r_proto" in
12837 case "$gmtime_r_proto" in
12838 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
12839 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
12841 case "$gmtime_r_proto" in
12842 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
12843 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
12845 case "$gmtime_r_proto" in
12846 ''|0) d_gmtime_r=undef
12848 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
12849 * ) case "$gmtime_r_proto" in
12850 REENTRANT_PROTO*) ;;
12851 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
12853 echo "Prototype: $try" ;;
12856 *) case "$usethreads" in
12857 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
12864 *) gmtime_r_proto=0
12868 : see if hasmntopt exists
12869 set hasmntopt d_hasmntopt
12872 : see if this is a netinet/in.h or sys/in.h system
12873 set netinet/in.h i_niin sys/in.h i_sysin
12876 : see if arpa/inet.h has to be included
12877 set arpa/inet.h i_arpainet
12880 : see if htonl --and friends-- exists
12885 : Maybe they are macros.
12888 $cat >htonl.c <<EOM
12890 #include <sys/types.h>
12891 #$i_niin I_NETINET_IN
12893 #$i_arpainet I_ARPA_INET
12894 #ifdef I_NETINET_IN
12895 #include <netinet/in.h>
12898 #include <sys/in.h>
12901 #include <arpa/inet.h>
12904 printf("Defined as a macro.");
12907 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
12908 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
12910 echo "But it seems to be defined as a macro." >&4
12920 if set index val -f; eval $csym; $val; then
12921 if set strchr val -f d_strchr; eval $csym; $val; then
12922 if $contains strchr "$strings" >/dev/null 2>&1 ; then
12925 echo "strchr() found." >&4
12929 echo "index() found." >&4
12934 echo "index() found." >&4
12937 if set strchr val -f d_strchr; eval $csym; $val; then
12940 echo "strchr() found." >&4
12942 echo "No index() or strchr() found!" >&4
12947 set d_strchr; eval $setvar
12949 set d_index; eval $setvar
12951 : check whether inet_aton exists
12952 set inet_aton d_inetaton
12957 $cat >isascii.c <<'EOCP'
12969 if eval $compile; then
12970 echo "isascii() found." >&4
12973 echo "isascii() NOT found." >&4
12980 : see if isfinite exists
12981 set isfinite d_isfinite
12984 : see if isinf exists
12988 : see if isnan exists
12992 : see if isnanl exists
12993 set isnanl d_isnanl
12996 : see if killpg exists
12997 set killpg d_killpg
13000 : see if lchown exists
13002 $cat > try.c <<'EOCP'
13003 /* System header to define __stub macros and hopefully few prototypes,
13004 which can conflict with char lchown(); below. */
13005 #include <assert.h>
13006 /* Override any gcc2 internal prototype to avoid an error. */
13007 /* We use char because int might match the return type of a gcc2
13008 builtin and then its argument prototype would still apply. */
13011 /* The GNU C library defines this for functions which it implements
13012 to always fail with ENOSYS. Some functions are actually named
13013 something starting with __ and the normal name is an alias. */
13014 #if defined (__stub_lchown) || defined (__stub___lchown)
13022 if eval $compile; then
13023 $echo "lchown() found." >&4
13026 $echo "lchown() NOT found." >&4
13032 : See if number of significant digits in a double precision number is known
13034 $cat >ldbl_dig.c <<EOM
13035 #$i_limits I_LIMITS
13038 #include <limits.h>
13044 printf("Contains LDBL_DIG");
13047 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
13048 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
13049 echo "LDBL_DIG found." >&4
13052 echo "LDBL_DIG NOT found." >&4
13059 : see if link exists
13063 : see if localtime_r exists
13064 set localtime_r d_localtime_r
13066 case "$d_localtime_r" in
13068 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13069 case "$d_localtime_r_proto:$usethreads" in
13070 ":define") d_localtime_r_proto=define
13071 set d_localtime_r_proto localtime_r $hdrs
13075 case "$d_localtime_r_proto" in
13077 case "$localtime_r_proto" in
13078 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
13079 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
13081 case "$localtime_r_proto" in
13082 ''|0) try='int localtime_r(const time_t*, struct tm*);'
13083 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
13085 case "$localtime_r_proto" in
13086 ''|0) d_localtime_r=undef
13087 localtime_r_proto=0
13088 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
13089 * ) case "$localtime_r_proto" in
13090 REENTRANT_PROTO*) ;;
13091 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
13093 echo "Prototype: $try" ;;
13096 *) case "$usethreads" in
13097 define) echo "localtime_r has no prototype, not using it." >&4 ;;
13099 d_localtime_r=undef
13100 localtime_r_proto=0
13104 *) localtime_r_proto=0
13108 : see if localeconv exists
13109 set localeconv d_locconv
13112 : see if lockf exists
13116 : see if prototype for lseek is available
13118 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
13121 : see if lstat exists
13125 : see if madvise exists
13126 set madvise d_madvise
13129 : see if mblen exists
13133 : see if mbstowcs exists
13134 set mbstowcs d_mbstowcs
13137 : see if mbtowc exists
13138 set mbtowc d_mbtowc
13141 : see if memchr exists
13142 set memchr d_memchr
13145 : see if memcmp exists
13146 set memcmp d_memcmp
13149 : see if memcpy exists
13150 set memcpy d_memcpy
13153 : see if memmove exists
13154 set memmove d_memmove
13157 : see if memset exists
13158 set memset d_memset
13161 : see if mkdir exists
13165 : see if mkdtemp exists
13166 set mkdtemp d_mkdtemp
13169 : see if mkfifo exists
13170 set mkfifo d_mkfifo
13173 : see if mkstemp exists
13174 set mkstemp d_mkstemp
13177 : see if mkstemps exists
13178 set mkstemps d_mkstemps
13181 : see if mktime exists
13182 set mktime d_mktime
13185 : see if this is a sys/mman.h system
13186 set sys/mman.h i_sysmman
13189 : see if mmap exists
13192 : see what shmat returns
13193 : default to something harmless
13195 case "$i_sysmman$d_mmap" in
13197 $cat >mmap.c <<'END'
13198 #include <sys/mman.h>
13201 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
13206 echo "and it returns ($mmaptype)." >&4
13212 : see if mprotect exists
13213 set mprotect d_mprotect
13216 : see if msgctl exists
13217 set msgctl d_msgctl
13220 : see if msgget exists
13221 set msgget d_msgget
13224 : see if msgsnd exists
13225 set msgsnd d_msgsnd
13228 : see if msgrcv exists
13229 set msgrcv d_msgrcv
13232 : see how much of the 'msg*(2)' library is present.
13235 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
13236 *"$undef"*) h_msg=false;;
13240 case "`ipcs 2>&1`" in
13241 "SVID messages"*"not configured"*)
13242 echo "Your $osname does not have the msg*(2) configured." >&4
13245 set msgctl d_msgctl
13247 set msgget d_msgget
13249 set msgsnd d_msgsnd
13251 set msgrcv d_msgrcv
13257 : we could also check for sys/ipc.h ...
13258 if $h_msg && $test `./findhdr sys/msg.h`; then
13259 echo "You have the full msg*(2) library." >&4
13262 echo "You don't have the full msg*(2) library." >&4
13270 echo "Checking to see if your system supports struct msghdr..." >&4
13271 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
13273 case "$d_msghdr_s" in
13274 "$define") echo "Yes, it does." ;;
13275 *) echo "No, it doesn't." ;;
13279 : see if msync exists
13283 : see if munmap exists
13284 set munmap d_munmap
13287 : see if nice exists
13291 : see if this is a langinfo.h system
13292 set langinfo.h i_langinfo
13295 : see if nl_langinfo exists
13296 set nl_langinfo d_nl_langinfo
13299 : check for length of character
13301 case "$charsize" in
13303 echo "Checking to see how big your characters are (hey, you never know)..." >&4
13304 $cat >try.c <<'EOCP'
13308 printf("%d\n", (int)sizeof(char));
13313 if eval $compile_ok; then
13317 echo "(I can't seem to compile the test program. Guessing...)"
13324 rp="What is the size of a character (in bytes)?"
13329 : check for volatile keyword
13331 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
13332 $cat >try.c <<'EOCP'
13335 typedef struct _goo_struct goo_struct;
13336 goo_struct * volatile goo = ((goo_struct *)0);
13337 struct _goo_struct {
13342 typedef unsigned short foo_t;
13343 char *volatile foo;
13345 volatile foo_t blech;
13349 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
13351 echo "Yup, it does."
13354 echo "Nope, it doesn't."
13362 $echo "Choosing the C types to be used for Perl's internal types..." >&4
13364 case "$use64bitint:$d_quad:$quadtype" in
13367 uvtype="$uquadtype"
13372 uvtype="unsigned long"
13378 case "$uselongdouble:$d_longdbl" in
13380 nvtype="long double"
13381 nvsize=$longdblsize
13388 $echo "(IV will be "$ivtype", $ivsize bytes)"
13389 $echo "(UV will be "$uvtype", $uvsize bytes)"
13390 $echo "(NV will be "$nvtype", $nvsize bytes)"
13393 #$i_inttypes I_INTTYPES
13395 #include <inttypes.h>
13400 int8_t i = INT8_MAX;
13401 uint8_t u = UINT8_MAX;
13402 printf("int8_t\n");
13405 int16_t i = INT16_MAX;
13406 uint16_t i = UINT16_MAX;
13407 printf("int16_t\n");
13410 int32_t i = INT32_MAX;
13411 uint32_t u = UINT32_MAX;
13412 printf("int32_t\n");
13418 '') case "$charsize" in
13420 u8type="unsigned char"
13429 if eval $compile; then
13430 case "`$run ./try`" in
13431 int8_t) i8type=int8_t
13441 '') if $test $charsize -ge 1; then
13443 u8type="unsigned char"
13451 '') case "$shortsize" in
13453 u16type="unsigned short"
13461 '') set try -DINT16
13462 if eval $compile; then
13463 case "`$run ./try`" in
13475 '') if $test $shortsize -ge 2; then
13477 u16type="unsigned short"
13485 '') case "$longsize" in
13487 u32type="unsigned long"
13491 *) case "$intsize" in
13493 u32type="unsigned int"
13503 '') set try -DINT32
13504 if eval $compile; then
13505 case "`$run ./try`" in
13517 '') if $test $intsize -ge 4; then
13519 u32type="unsigned int"
13527 '') case "$d_quad:$quadtype" in
13529 i64type="$quadtype"
13530 u64type="$uquadtype"
13538 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
13539 : volatile so that the compiler has to store it out to memory.
13540 if test X"$d_volatile" = X"$define"; then
13545 #include <sys/types.h>
13546 #include <signal.h>
13548 $volatile int bletched = 0;
13549 $signal_t blech(s) int s; { bletched = 1; }
13554 int n = 8 * $uvsize;
13557 signal(SIGFPE, blech);
13560 for (i = 0; i < n; i++) {
13561 u = u << 1 | ($uvtype)1;
13563 if (($uvtype)d != u)
13567 d = ($nvtype)(u - 1);
13568 if (($uvtype)d != (u - 1))
13576 printf("%d\n", ((i == n) ? -n : i));
13582 d_nv_preserves_uv="$undef"
13583 if eval $compile; then
13584 nv_preserves_uv_bits="`$run ./try`"
13586 case "$nv_preserves_uv_bits" in
13588 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
13589 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
13590 d_nv_preserves_uv="$define"
13592 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
13593 d_nv_preserves_uv="$undef" ;;
13594 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
13595 nv_preserves_uv_bits="$undef" ;;
13601 : check for off64_t
13603 echo "Checking to see if you have off64_t..." >&4
13605 #include <sys/types.h>
13606 #include <unistd.h>
13607 int main() { off64_t x = 7; }
13610 if eval $compile; then
13612 echo "You have off64_t."
13615 echo "You do not have off64_t."
13616 case "$lseeksize" in
13617 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
13624 : how to create joinable pthreads
13625 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
13627 echo "Checking what constant to use for creating joinable pthreads..." >&4
13628 $cat >try.c <<'EOCP'
13629 #include <pthread.h>
13631 int detachstate = JOINABLE;
13634 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
13635 if eval $compile; then
13636 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
13637 val="$undef" # Yes, undef.
13638 set d_old_pthread_create_joinable
13641 set old_pthread_create_joinable
13644 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
13645 if eval $compile; then
13646 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
13648 set d_old_pthread_create_joinable
13650 val=PTHREAD_CREATE_UNDETACHED
13651 set old_pthread_create_joinable
13654 set try -DJOINABLE=__UNDETACHED
13655 if eval $compile; then
13656 echo "You seem to use __UNDETACHED." >&4
13658 set d_old_pthread_create_joinable
13661 set old_pthread_create_joinable
13664 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
13666 set d_old_pthread_create_joinable
13669 set old_pthread_create_joinable
13676 d_old_pthread_create_joinable="$undef"
13677 old_pthread_create_joinable=""
13680 : see if pause exists
13684 : see if pipe exists
13688 : see if poll exists
13692 : see if readlink exists
13693 set readlink d_readlink
13699 case "$d_readlink" in
13701 if $issymlink /proc/self/exe ; then
13702 $ls -l /proc/self/exe > reflect
13703 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
13704 echo "You have Linux-like /proc/self/exe."
13705 procselfexe='"/proc/self/exe"'
13709 if $issymlink /proc/curproc/file ; then
13710 $ls -l /proc/curproc/file > reflect
13711 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
13712 echo "You have BSD-like /proc/curproc/file."
13713 procselfexe='"/proc/curproc/file"'
13723 : see whether the pthread_atfork exists
13725 #include <pthread.h>
13728 #ifdef PTHREAD_ATFORK
13729 pthread_atfork(NULL,NULL,NULL);
13734 : see if pthread_atfork exists
13735 set try -DPTHREAD_ATFORK
13736 if eval $compile; then
13741 case "$usethreads" in
13744 $define) echo 'pthread_atfork found.' >&4 ;;
13745 *) echo 'pthread_atfork NOT found.' >&4 ;;
13748 set d_pthread_atfork
13752 : see whether the various POSIXish _yields exist
13754 #include <pthread.h>
13760 #ifdef PTHREAD_YIELD
13763 #ifdef PTHREAD_YIELD_NULL
13764 pthread_yield(NULL);
13770 : see if sched_yield exists
13771 set try -DSCHED_YIELD
13772 if eval $compile; then
13774 sched_yield='sched_yield()'
13778 case "$usethreads" in
13781 $define) echo 'sched_yield() found.' >&4 ;;
13782 *) echo 'sched_yield() NOT found.' >&4 ;;
13788 : see if pthread_yield exists
13789 set try -DPTHREAD_YIELD
13790 if eval $compile; then
13792 case "$sched_yield" in
13793 '') sched_yield='pthread_yield()' ;;
13796 set try -DPTHREAD_YIELD_NULL
13797 if eval $compile; then
13799 case "$sched_yield" in
13800 '') sched_yield='pthread_yield(NULL)' ;;
13806 case "$usethreads" in
13809 $define) echo 'pthread_yield() found.' >&4 ;;
13810 *) echo 'pthread_yield() NOT found.' >&4 ;;
13814 set d_pthread_yield
13817 case "$sched_yield" in
13818 '') sched_yield=undef ;;
13823 : see if random_r exists
13824 set random_r d_random_r
13826 case "$d_random_r" in
13828 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
13829 case "$d_random_r_proto:$usethreads" in
13830 ":define") d_random_r_proto=define
13831 set d_random_r_proto random_r $hdrs
13835 case "$d_random_r_proto" in
13837 case "$random_r_proto" in
13838 ''|0) try='int random_r(int*, struct random_data*);'
13839 ./protochk "extern $try" $hdrs && random_r_proto=I_TS ;;
13841 case "$random_r_proto" in
13842 ''|0) d_random_r=undef
13844 echo "Disabling random_r, cannot determine prototype." >&4 ;;
13845 * ) case "$random_r_proto" in
13846 REENTRANT_PROTO*) ;;
13847 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
13849 echo "Prototype: $try" ;;
13852 *) case "$usethreads" in
13853 define) echo "random_r has no prototype, not using it." >&4 ;;
13860 *) random_r_proto=0
13864 : see if readdir and friends exist
13865 set readdir d_readdir
13867 set seekdir d_seekdir
13869 set telldir d_telldir
13871 set rewinddir d_rewinddir
13874 : see if readdir64_r exists
13875 set readdir64_r d_readdir64_r
13877 case "$d_readdir64_r" in
13879 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
13880 case "$d_readdir64_r_proto:$usethreads" in
13881 ":define") d_readdir64_r_proto=define
13882 set d_readdir64_r_proto readdir64_r $hdrs
13886 case "$d_readdir64_r_proto" in
13888 case "$readdir64_r_proto" in
13889 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
13890 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
13892 case "$readdir64_r_proto" in
13893 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
13894 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
13896 case "$readdir64_r_proto" in
13897 ''|0) d_readdir64_r=undef
13898 readdir64_r_proto=0
13899 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
13900 * ) case "$readdir64_r_proto" in
13901 REENTRANT_PROTO*) ;;
13902 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
13904 echo "Prototype: $try" ;;
13907 *) case "$usethreads" in
13908 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
13910 d_readdir64_r=undef
13911 readdir64_r_proto=0
13915 *) readdir64_r_proto=0
13919 : see if readdir_r exists
13920 set readdir_r d_readdir_r
13922 case "$d_readdir_r" in
13924 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
13925 case "$d_readdir_r_proto:$usethreads" in
13926 ":define") d_readdir_r_proto=define
13927 set d_readdir_r_proto readdir_r $hdrs
13931 case "$d_readdir_r_proto" in
13933 case "$readdir_r_proto" in
13934 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
13935 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
13937 case "$readdir_r_proto" in
13938 ''|0) try='int readdir_r(DIR*, struct dirent*);'
13939 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
13941 case "$readdir_r_proto" in
13942 ''|0) d_readdir_r=undef
13944 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
13945 * ) case "$readdir_r_proto" in
13946 REENTRANT_PROTO*) ;;
13947 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
13949 echo "Prototype: $try" ;;
13952 *) case "$usethreads" in
13953 define) echo "readdir_r has no prototype, not using it." >&4 ;;
13960 *) readdir_r_proto=0
13964 : see if readv exists
13968 : see if recvmsg exists
13969 set recvmsg d_recvmsg
13972 : see if rename exists
13973 set rename d_rename
13976 : see if rmdir exists
13980 : see if memory.h is available.
13985 : See if it conflicts with string.h
13991 $cppstdin $cppflags $cppminus < $strings > mem.h
13992 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
13994 echo "We won't be including <memory.h>."
14004 : can bcopy handle overlapping blocks?
14007 case "$d_memmove" in
14008 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
14009 *) case "$d_bcopy" in
14011 echo "Checking to see if bcopy() can do overlapping copies..." >&4
14013 #$i_memory I_MEMORY
14014 #$i_stdlib I_STDLIB
14015 #$i_string I_STRING
14016 #$i_unistd I_UNISTD
14018 $cat >>try.c <<'EOCP'
14021 # include <memory.h>
14024 # include <stdlib.h>
14027 # include <string.h>
14029 # include <strings.h>
14032 # include <unistd.h> /* Needed for NetBSD */
14036 char buf[128], abc[128];
14042 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14043 try to store the string in read-only memory. */
14044 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
14046 for (align = 7; align >= 0; align--) {
14047 for (len = 36; len; len--) {
14049 bcopy(abc, b, len);
14050 for (off = 1; off <= len; off++) {
14051 bcopy(b, b+off, len);
14052 bcopy(b+off, b, len);
14053 if (bcmp(b, abc, len))
14062 if eval $compile_ok; then
14063 if ./try 2>/dev/null; then
14064 echo "Yes, it can."
14067 echo "It can't, sorry."
14070 echo "(I can't compile the test program, so we'll assume not...)"
14074 $rm -f try.* try core
14080 : can memcpy handle overlapping blocks?
14083 case "$d_memmove" in
14084 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
14085 *) case "$d_memcpy" in
14087 echo "Checking to see if memcpy() can do overlapping copies..." >&4
14089 #$i_memory I_MEMORY
14090 #$i_stdlib I_STDLIB
14091 #$i_string I_STRING
14092 #$i_unistd I_UNISTD
14094 $cat >>try.c <<'EOCP'
14097 # include <memory.h>
14100 # include <stdlib.h>
14103 # include <string.h>
14105 # include <strings.h>
14108 # include <unistd.h> /* Needed for NetBSD */
14112 char buf[128], abc[128];
14118 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14119 try to store the string in read-only memory. */
14120 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
14122 for (align = 7; align >= 0; align--) {
14123 for (len = 36; len; len--) {
14125 memcpy(b, abc, len);
14126 for (off = 1; off <= len; off++) {
14127 memcpy(b+off, b, len);
14128 memcpy(b, b+off, len);
14129 if (memcmp(b, abc, len))
14138 if eval $compile_ok; then
14139 if ./try 2>/dev/null; then
14140 echo "Yes, it can."
14143 echo "It can't, sorry."
14146 echo "(I can't compile the test program, so we'll assume not...)"
14150 $rm -f try.* try core
14156 : can memcmp be trusted to compare relative magnitude?
14158 case "$d_memcmp" in
14161 echo "Checking if your memcmp() can compare relative magnitude..." >&4
14163 #$i_memory I_MEMORY
14164 #$i_stdlib I_STDLIB
14165 #$i_string I_STRING
14166 #$i_unistd I_UNISTD
14168 $cat >>try.c <<'EOCP'
14171 # include <memory.h>
14174 # include <stdlib.h>
14177 # include <string.h>
14179 # include <strings.h>
14182 # include <unistd.h> /* Needed for NetBSD */
14188 if ((a < b) && memcmp(&a, &b, 1) < 0)
14194 if eval $compile_ok; then
14195 if $run ./try 2>/dev/null; then
14196 echo "Yes, it can."
14199 echo "No, it can't (it uses signed chars)."
14202 echo "(I can't compile the test program, so we'll assume not...)"
14206 $rm -f try.* try core
14210 : see if prototype for sbrk is available
14212 set d_sbrkproto sbrk $i_unistd unistd.h
14215 : see if select exists
14216 set select d_select
14219 : see if semctl exists
14220 set semctl d_semctl
14223 : see if semget exists
14224 set semget d_semget
14227 : see if semop exists
14231 : see how much of the 'sem*(2)' library is present.
14234 case "$d_semctl$d_semget$d_semop" in
14235 *"$undef"*) h_sem=false;;
14239 case "`ipcs 2>&1`" in
14240 "SVID messages"*"not configured"*)
14241 echo "Your $osname does not have the sem*(2) configured." >&4
14244 set semctl d_semctl
14246 set semget d_semget
14254 : we could also check for sys/ipc.h ...
14255 if $h_sem && $test `./findhdr sys/sem.h`; then
14256 echo "You have the full sem*(2) library." >&4
14259 echo "You don't have the full sem*(2) library." >&4
14265 : see whether sys/sem.h defines union semun
14267 $cat > try.c <<'END'
14268 #include <sys/types.h>
14269 #include <sys/ipc.h>
14270 #include <sys/sem.h>
14271 int main () { union semun semun; semun.buf = 0; }
14274 if eval $compile; then
14275 echo "You have union semun in <sys/sem.h>." >&4
14278 echo "You do not have union semun in <sys/sem.h>." >&4
14281 $rm -f try try.c try.h
14285 : see how to do semctl IPC_STAT
14288 : see whether semctl IPC_STAT can use union semun
14293 # define S_IRUSR S_IREAD
14294 # define S_IWUSR S_IWRITE
14295 # define S_IXUSR S_IEXEC
14297 # define S_IRUSR 0400
14298 # define S_IWUSR 0200
14299 # define S_IXUSR 0100
14301 # define S_IRGRP (S_IRUSR>>3)
14302 # define S_IWGRP (S_IWUSR>>3)
14303 # define S_IXGRP (S_IXUSR>>3)
14304 # define S_IROTH (S_IRUSR>>6)
14305 # define S_IWOTH (S_IWUSR>>6)
14306 # define S_IXOTH (S_IXUSR>>6)
14309 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
14310 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
14311 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
14316 #include <sys/types.h>
14317 #include <sys/ipc.h>
14318 #include <sys/sem.h>
14319 #include <sys/stat.h>
14326 #$d_union_semun HAS_UNION_SEMUN
14329 #ifndef HAS_UNION_SEMUN
14332 struct semid_ds *buf;
14333 unsigned short *array;
14339 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14340 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14342 struct semid_ds argbuf;
14345 st = semctl(sem, 0, IPC_STAT, arg);
14349 # endif /* IPC_STAT */
14350 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14352 if (semctl(sem, 0, IPC_RMID, arg) != 0)
14353 # endif /* IPC_RMID */
14354 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14356 #endif /* IPC_PRIVATE && ... */
14357 printf("semget failed: errno = %d\n", errno);
14363 if eval $compile; then
14366 semun) val="$define" ;;
14372 case "$d_semctl_semun" in
14374 echo "You can use union semun for semctl IPC_STAT." >&4
14377 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
14382 : see whether semctl IPC_STAT can use struct semid_ds pointer
14383 $cat > try.c <<'END'
14384 #include <sys/types.h>
14385 #include <sys/ipc.h>
14386 #include <sys/sem.h>
14387 #include <sys/stat.h>
14395 struct semid_ds arg;
14398 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14399 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14402 st = semctl(sem, 0, IPC_STAT, &arg);
14404 printf("semid_ds\n");
14406 # endif /* IPC_STAT */
14407 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14409 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
14410 # endif /* IPC_RMID */
14411 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14413 #endif /* IPC_PRIVATE && ... */
14414 printf("semget failed: errno = %d\n", errno);
14421 if eval $compile; then
14424 semid_ds) val="$define" ;;
14428 set d_semctl_semid_ds
14430 case "$d_semctl_semid_ds" in
14432 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
14434 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
14441 # We do not have the full sem*(2) library, so assume we can not
14447 set d_semctl_semid_ds
14452 : see if sendmsg exists
14453 set sendmsg d_sendmsg
14456 : see if setegid exists
14457 set setegid d_setegid
14460 : see if seteuid exists
14461 set seteuid d_seteuid
14464 : see if setgrent exists
14465 set setgrent d_setgrent
14468 : see if setgrent_r exists
14469 set setgrent_r d_setgrent_r
14471 case "$d_setgrent_r" in
14473 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14474 case "$d_setgrent_r_proto:$usethreads" in
14475 ":define") d_setgrent_r_proto=define
14476 set d_setgrent_r_proto setgrent_r $hdrs
14480 case "$d_setgrent_r_proto" in
14482 case "$setgrent_r_proto" in
14483 ''|0) try='int setgrent_r(FILE**);'
14484 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
14486 case "$setgrent_r_proto" in
14487 ''|0) try='void setgrent_r(FILE**);'
14488 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
14490 case "$setgrent_r_proto" in
14491 ''|0) d_setgrent_r=undef
14493 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
14494 * ) case "$setgrent_r_proto" in
14495 REENTRANT_PROTO*) ;;
14496 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
14498 echo "Prototype: $try" ;;
14501 *) case "$usethreads" in
14502 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
14509 *) setgrent_r_proto=0
14513 : see if sethostent exists
14514 set sethostent d_sethent
14517 : see if sethostent_r exists
14518 set sethostent_r d_sethostent_r
14520 case "$d_sethostent_r" in
14522 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14523 case "$d_sethostent_r_proto:$usethreads" in
14524 ":define") d_sethostent_r_proto=define
14525 set d_sethostent_r_proto sethostent_r $hdrs
14529 case "$d_sethostent_r_proto" in
14531 case "$sethostent_r_proto" in
14532 ''|0) try='int sethostent_r(int, struct hostent_data*);'
14533 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
14535 case "$sethostent_r_proto" in
14536 ''|0) try='void sethostent_r(int, struct hostent_data*);'
14537 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
14539 case "$sethostent_r_proto" in
14540 ''|0) d_sethostent_r=undef
14541 sethostent_r_proto=0
14542 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
14543 * ) case "$sethostent_r_proto" in
14544 REENTRANT_PROTO*) ;;
14545 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
14547 echo "Prototype: $try" ;;
14550 *) case "$usethreads" in
14551 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
14553 d_sethostent_r=undef
14554 sethostent_r_proto=0
14558 *) sethostent_r_proto=0
14562 : see if setitimer exists
14563 set setitimer d_setitimer
14566 : see if setlinebuf exists
14567 set setlinebuf d_setlinebuf
14570 : see if setlocale exists
14571 set setlocale d_setlocale
14574 : see if locale.h is available
14575 set locale.h i_locale
14578 : see if setlocale_r exists
14579 set setlocale_r d_setlocale_r
14581 case "$d_setlocale_r" in
14583 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
14584 case "$d_setlocale_r_proto:$usethreads" in
14585 ":define") d_setlocale_r_proto=define
14586 set d_setlocale_r_proto setlocale_r $hdrs
14590 case "$d_setlocale_r_proto" in
14592 case "$setlocale_r_proto" in
14593 ''|0) try='int setlocale_r(int, const char*, char*, int);'
14594 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
14596 case "$setlocale_r_proto" in
14597 ''|0) d_setlocale_r=undef
14598 setlocale_r_proto=0
14599 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
14600 * ) case "$setlocale_r_proto" in
14601 REENTRANT_PROTO*) ;;
14602 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
14604 echo "Prototype: $try" ;;
14607 *) case "$usethreads" in
14608 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
14610 d_setlocale_r=undef
14611 setlocale_r_proto=0
14615 *) setlocale_r_proto=0
14619 : see if setnetent exists
14620 set setnetent d_setnent
14623 : see if setnetent_r exists
14624 set setnetent_r d_setnetent_r
14626 case "$d_setnetent_r" in
14628 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14629 case "$d_setnetent_r_proto:$usethreads" in
14630 ":define") d_setnetent_r_proto=define
14631 set d_setnetent_r_proto setnetent_r $hdrs
14635 case "$d_setnetent_r_proto" in
14637 case "$setnetent_r_proto" in
14638 ''|0) try='int setnetent_r(int, struct netent_data*);'
14639 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
14641 case "$setnetent_r_proto" in
14642 ''|0) try='void setnetent_r(int, struct netent_data*);'
14643 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
14645 case "$setnetent_r_proto" in
14646 ''|0) d_setnetent_r=undef
14647 setnetent_r_proto=0
14648 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
14649 * ) case "$setnetent_r_proto" in
14650 REENTRANT_PROTO*) ;;
14651 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
14653 echo "Prototype: $try" ;;
14656 *) case "$usethreads" in
14657 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
14659 d_setnetent_r=undef
14660 setnetent_r_proto=0
14664 *) setnetent_r_proto=0
14668 : see if setprotoent exists
14669 set setprotoent d_setpent
14672 : see if setpgid exists
14673 set setpgid d_setpgid
14676 : see if setpgrp2 exists
14677 set setpgrp2 d_setpgrp2
14680 : see if setpriority exists
14681 set setpriority d_setprior
14684 : see if setproctitle exists
14685 set setproctitle d_setproctitle
14688 : see if setprotoent_r exists
14689 set setprotoent_r d_setprotoent_r
14691 case "$d_setprotoent_r" in
14693 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14694 case "$d_setprotoent_r_proto:$usethreads" in
14695 ":define") d_setprotoent_r_proto=define
14696 set d_setprotoent_r_proto setprotoent_r $hdrs
14700 case "$d_setprotoent_r_proto" in
14702 case "$setprotoent_r_proto" in
14703 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
14704 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
14706 case "$setprotoent_r_proto" in
14707 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
14708 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
14710 case "$setprotoent_r_proto" in
14711 ''|0) d_setprotoent_r=undef
14712 setprotoent_r_proto=0
14713 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
14714 * ) case "$setprotoent_r_proto" in
14715 REENTRANT_PROTO*) ;;
14716 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
14718 echo "Prototype: $try" ;;
14721 *) case "$usethreads" in
14722 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
14724 d_setprotoent_r=undef
14725 setprotoent_r_proto=0
14729 *) setprotoent_r_proto=0
14733 : see if setpwent exists
14734 set setpwent d_setpwent
14737 : see if setpwent_r exists
14738 set setpwent_r d_setpwent_r
14740 case "$d_setpwent_r" in
14742 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14743 case "$d_setpwent_r_proto:$usethreads" in
14744 ":define") d_setpwent_r_proto=define
14745 set d_setpwent_r_proto setpwent_r $hdrs
14749 case "$d_setpwent_r_proto" in
14751 case "$setpwent_r_proto" in
14752 ''|0) try='int setpwent_r(FILE**);'
14753 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
14755 case "$setpwent_r_proto" in
14756 ''|0) try='void setpwent_r(FILE**);'
14757 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
14759 case "$setpwent_r_proto" in
14760 ''|0) d_setpwent_r=undef
14762 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
14763 * ) case "$setpwent_r_proto" in
14764 REENTRANT_PROTO*) ;;
14765 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
14767 echo "Prototype: $try" ;;
14770 *) case "$usethreads" in
14771 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
14778 *) setpwent_r_proto=0
14782 : see if setregid exists
14783 set setregid d_setregid
14785 set setresgid d_setresgid
14788 : see if setreuid exists
14789 set setreuid d_setreuid
14791 set setresuid d_setresuid
14794 : see if setrgid exists
14795 set setrgid d_setrgid
14798 : see if setruid exists
14799 set setruid d_setruid
14802 : see if setservent exists
14803 set setservent d_setsent
14806 : see if setservent_r exists
14807 set setservent_r d_setservent_r
14809 case "$d_setservent_r" in
14811 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14812 case "$d_setservent_r_proto:$usethreads" in
14813 ":define") d_setservent_r_proto=define
14814 set d_setservent_r_proto setservent_r $hdrs
14818 case "$d_setservent_r_proto" in
14820 case "$setservent_r_proto" in
14821 ''|0) try='int setservent_r(int, struct servent_data*);'
14822 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
14824 case "$setservent_r_proto" in
14825 ''|0) try='void setservent_r(int, struct servent_data*);'
14826 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
14828 case "$setservent_r_proto" in
14829 ''|0) d_setservent_r=undef
14830 setservent_r_proto=0
14831 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
14832 * ) case "$setservent_r_proto" in
14833 REENTRANT_PROTO*) ;;
14834 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
14836 echo "Prototype: $try" ;;
14839 *) case "$usethreads" in
14840 define) echo "setservent_r has no prototype, not using it." >&4 ;;
14842 d_setservent_r=undef
14843 setservent_r_proto=0
14847 *) setservent_r_proto=0
14851 : see if setsid exists
14852 set setsid d_setsid
14855 : see if setvbuf exists
14856 set setvbuf d_setvbuf
14859 : see if sfio.h is available
14864 : see if sfio library is available
14875 : Ok, but do we want to use it.
14879 true|$define|[yY]*) dflt='y';;
14882 echo "$package can use the sfio library, but it is experimental."
14883 case "$useperlio" in
14885 echo "For sfio also the PerlIO abstraction layer is needed."
14886 echo "Earlier you said you wouldn't want that."
14889 rp="You seem to have sfio available, do you want to try using it?"
14892 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
14893 useperlio="$define"
14896 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
14901 *) case "$usesfio" in
14902 true|$define|[yY]*)
14903 echo "Sorry, cannot find sfio on this machine." >&4
14904 echo "Ignoring your setting of usesfio=$usesfio." >&4
14913 $define) usesfio='true';;
14914 *) usesfio='false';;
14918 *) : Remove sfio from list of libraries to use
14921 echo "Removing unneeded -lsfio from library list" >&4
14922 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
14925 echo "libs = $libs" >&4
14932 : see if shmctl exists
14933 set shmctl d_shmctl
14936 : see if shmget exists
14937 set shmget d_shmget
14940 : see if shmat exists
14943 : see what shmat returns
14946 $cat >shmat.c <<'END'
14947 #include <sys/shm.h>
14950 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
14955 echo "and it returns ($shmattype)." >&4
14956 : see if a prototype for shmat is available
14957 xxx=`./findhdr sys/shm.h`
14958 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
14959 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
14970 set d_shmatprototype
14973 : see if shmdt exists
14977 : see how much of the 'shm*(2)' library is present.
14980 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
14981 *"$undef"*) h_shm=false;;
14985 case "`ipcs 2>&1`" in
14986 "SVID shared memory"*"not configured"*)
14987 echo "Your $osname does not have the shm*(2) configured." >&4
14990 set shmctl d_shmctl
14992 set shmget d_shmget
15002 : we could also check for sys/ipc.h ...
15003 if $h_shm && $test `./findhdr sys/shm.h`; then
15004 echo "You have the full shm*(2) library." >&4
15007 echo "You don't have the full shm*(2) library." >&4
15014 : see if we have sigaction
15015 if set sigaction val -f d_sigaction; eval $csym; $val; then
15016 echo 'sigaction() found.' >&4
15017 $cat > try.c <<'EOP'
15019 #include <sys/types.h>
15020 #include <signal.h>
15023 struct sigaction act, oact;
15025 oact.sa_handler = 0;
15026 /* so that act and oact are used */
15027 exit(act.sa_flags == 0 && oact.sa_handler == 0);
15031 if eval $compile_ok; then
15034 echo "But you don't seem to have a useable struct sigaction." >&4
15038 echo 'sigaction NOT found.' >&4
15041 set d_sigaction; eval $setvar
15042 $rm -f try try$_o try.c
15044 : see if sigprocmask exists
15045 set sigprocmask d_sigprocmask
15048 : see if sigsetjmp exists
15050 case "$d_sigsetjmp" in
15052 $cat >try.c <<'EOP'
15053 #include <setjmp.h>
15058 if (sigsetjmp(env,1))
15061 siglongjmp(env, 1);
15066 if eval $compile; then
15067 if $run ./try >/dev/null 2>&1; then
15068 echo "POSIX sigsetjmp found." >&4
15072 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
15078 echo "sigsetjmp not found." >&4
15082 *) val="$d_sigsetjmp"
15083 case "$d_sigsetjmp" in
15084 $define) echo "POSIX sigsetjmp found." >&4;;
15085 $undef) echo "sigsetjmp not found." >&4;;
15093 : see if sockatmark exists
15094 set sockatmark d_sockatmark
15097 : see if prototype for sockatmark is available
15099 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
15102 : see if socks5_init exists
15103 set socks5_init d_socks5_init
15106 : see if srand48_r exists
15107 set srand48_r d_srand48_r
15109 case "$d_srand48_r" in
15111 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15112 case "$d_srand48_r_proto:$usethreads" in
15113 ":define") d_srand48_r_proto=define
15114 set d_srand48_r_proto srand48_r $hdrs
15118 case "$d_srand48_r_proto" in
15120 case "$srand48_r_proto" in
15121 ''|0) try='int srand48_r(long, struct drand48_data*);'
15122 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
15124 case "$srand48_r_proto" in
15125 ''|0) d_srand48_r=undef
15127 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
15128 * ) case "$srand48_r_proto" in
15129 REENTRANT_PROTO*) ;;
15130 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
15132 echo "Prototype: $try" ;;
15135 *) case "$usethreads" in
15136 define) echo "srand48_r has no prototype, not using it." >&4 ;;
15143 *) srand48_r_proto=0
15147 : see if srandom_r exists
15148 set srandom_r d_srandom_r
15150 case "$d_srandom_r" in
15152 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15153 case "$d_srandom_r_proto:$usethreads" in
15154 ":define") d_srandom_r_proto=define
15155 set d_srandom_r_proto srandom_r $hdrs
15159 case "$d_srandom_r_proto" in
15161 case "$srandom_r_proto" in
15162 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
15163 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
15165 case "$srandom_r_proto" in
15166 ''|0) d_srandom_r=undef
15168 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
15169 * ) case "$srandom_r_proto" in
15170 REENTRANT_PROTO*) ;;
15171 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
15173 echo "Prototype: $try" ;;
15176 *) case "$usethreads" in
15177 define) echo "srandom_r has no prototype, not using it." >&4 ;;
15184 *) srandom_r_proto=0
15188 : see if prototype for setresgid is available
15190 set d_sresgproto setresgid $i_unistd unistd.h
15193 : see if prototype for setresuid is available
15195 set d_sresuproto setresuid $i_unistd unistd.h
15198 : see if sys/stat.h is available
15199 set sys/stat.h i_sysstat
15203 : see if stat knows about block sizes
15205 echo "Checking to see if your struct stat has st_blocks field..." >&4
15206 set d_statblks stat st_blocks $i_sysstat sys/stat.h
15210 : see if this is a sys/vfs.h system
15211 set sys/vfs.h i_sysvfs
15215 : see if this is a sys/statfs.h system
15216 set sys/statfs.h i_sysstatfs
15221 echo "Checking to see if your system supports struct statfs..." >&4
15222 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
15224 case "$d_statfs_s" in
15225 "$define") echo "Yes, it does." ;;
15226 *) echo "No, it doesn't." ;;
15231 : see if struct statfs knows about f_flags
15232 case "$d_statfs_s" in
15235 echo "Checking to see if your struct statfs has f_flags field..." >&4
15236 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
15240 set d_statfs_f_flags
15244 case "$d_statfs_f_flags" in
15245 "$define") echo "Yes, it does." ;;
15246 *) echo "No, it doesn't." ;;
15249 : see if _ptr and _cnt from stdio act std
15252 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
15253 echo "(Looks like you have stdio.h from BSD.)"
15254 case "$stdio_ptr" in
15255 '') stdio_ptr='((fp)->_p)'
15258 *) ptr_lval=$d_stdio_ptr_lval;;
15260 case "$stdio_cnt" in
15261 '') stdio_cnt='((fp)->_r)'
15264 *) cnt_lval=$d_stdio_cnt_lval;;
15266 case "$stdio_base" in
15267 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
15269 case "$stdio_bufsiz" in
15270 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
15272 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
15273 echo "(Looks like you have stdio.h from Linux.)"
15274 case "$stdio_ptr" in
15275 '') stdio_ptr='((fp)->_IO_read_ptr)'
15278 *) ptr_lval=$d_stdio_ptr_lval;;
15280 case "$stdio_cnt" in
15281 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
15284 *) cnt_lval=$d_stdio_cnt_lval;;
15286 case "$stdio_base" in
15287 '') stdio_base='((fp)->_IO_read_base)';;
15289 case "$stdio_bufsiz" in
15290 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
15293 case "$stdio_ptr" in
15294 '') stdio_ptr='((fp)->_ptr)'
15297 *) ptr_lval=$d_stdio_ptr_lval;;
15299 case "$stdio_cnt" in
15300 '') stdio_cnt='((fp)->_cnt)'
15303 *) cnt_lval=$d_stdio_cnt_lval;;
15305 case "$stdio_base" in
15306 '') stdio_base='((fp)->_base)';;
15308 case "$stdio_bufsiz" in
15309 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
15313 : test whether _ptr and _cnt really work
15314 echo "Checking how std your stdio is..." >&4
15317 #define FILE_ptr(fp) $stdio_ptr
15318 #define FILE_cnt(fp) $stdio_cnt
15320 FILE *fp = fopen("try.c", "r");
15323 18 <= FILE_cnt(fp) &&
15324 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15332 if eval $compile && $to try.c; then
15333 if $run ./try; then
15334 echo "Your stdio acts pretty std."
15337 echo "Your stdio isn't very std."
15340 echo "Your stdio doesn't appear very std."
15346 : Can _ptr be used as an lvalue?
15347 case "$d_stdstdio$ptr_lval" in
15348 $define$define) val=$define ;;
15351 set d_stdio_ptr_lval
15354 : Can _cnt be used as an lvalue?
15355 case "$d_stdstdio$cnt_lval" in
15356 $define$define) val=$define ;;
15359 set d_stdio_cnt_lval
15363 : test whether setting _ptr sets _cnt as a side effect
15364 d_stdio_ptr_lval_sets_cnt="$undef"
15365 d_stdio_ptr_lval_nochange_cnt="$undef"
15366 case "$d_stdio_ptr_lval$d_stdstdio" in
15368 echo "Checking to see what happens if we set the stdio ptr..." >&4
15371 /* Can we scream? */
15372 /* Eat dust sed :-) */
15373 /* In the buffer space, no one can hear you scream. */
15374 #define FILE_ptr(fp) $stdio_ptr
15375 #define FILE_cnt(fp) $stdio_cnt
15376 #include <sys/types.h>
15378 FILE *fp = fopen("try.c", "r");
15383 puts("Fail even to read");
15386 c = getc(fp); /* Read away the first # */
15388 puts("Fail even to read");
15392 18 <= FILE_cnt(fp) &&
15393 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15395 puts("Fail even to read");
15398 ptr = (char*) FILE_ptr(fp);
15399 cnt = (size_t)FILE_cnt(fp);
15401 FILE_ptr(fp) += 42;
15403 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
15404 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
15407 if (FILE_cnt(fp) <= 20) {
15408 printf ("Fail (<20 chars to test)");
15411 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
15412 puts("Fail compare");
15415 if (cnt == FILE_cnt(fp)) {
15416 puts("Pass_unchanged");
15419 if (FILE_cnt(fp) == (cnt - 42)) {
15420 puts("Pass_changed");
15423 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
15429 if eval $compile && $to try.c; then
15430 case `$run ./try` in
15432 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
15433 d_stdio_ptr_lval_sets_cnt="$define" ;;
15435 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
15436 d_stdio_ptr_lval_nochange_cnt="$define" ;;
15438 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
15440 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
15443 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
15449 : see if _base is also standard
15451 case "$d_stdstdio" in
15455 #define FILE_base(fp) $stdio_base
15456 #define FILE_bufsiz(fp) $stdio_bufsiz
15458 FILE *fp = fopen("try.c", "r");
15461 19 <= FILE_bufsiz(fp) &&
15462 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
15469 if eval $compile && $to try.c; then
15470 if $run ./try; then
15471 echo "And its _base field acts std."
15474 echo "But its _base field isn't std."
15477 echo "However, it seems to be lacking the _base field."
15486 Checking how to access stdio streams by file descriptor number...
15488 case "$stdio_stream_array" in
15489 '') $cat >try.c <<EOCP
15492 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
15496 for s in _iob __iob __sF
15498 set try -DSTDIO_STREAM_ARRAY=$s
15499 if eval $compile; then
15500 case "`$run ./try`" in
15501 yes) stdio_stream_array=$s; break ;;
15505 $rm -f try.* try$exe_ext
15507 case "$stdio_stream_array" in
15509 I can't figure out how to access stdio streams by file descriptor number.
15511 d_stdio_stream_array="$undef"
15514 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
15516 d_stdio_stream_array="$define"
15520 : see if strcoll exists
15521 set strcoll d_strcoll
15524 : check for structure copying
15526 echo "Checking to see if your C compiler can copy structs..." >&4
15527 $cat >try.c <<'EOCP'
15537 if $cc -c try.c >/dev/null 2>&1 ; then
15539 echo "Yup, it can."
15542 echo "Nope, it can't."
15548 : see if strerror and/or sys_errlist[] exist
15550 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
15551 if set strerror val -f d_strerror; eval $csym; $val; then
15552 echo 'strerror() found.' >&4
15553 d_strerror="$define"
15554 d_strerrm='strerror(e)'
15555 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15556 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
15557 d_syserrlst="$define"
15559 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
15560 d_syserrlst="$undef"
15562 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
15563 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
15564 echo 'strerror() found in string header.' >&4
15565 d_strerror="$define"
15566 d_strerrm='strerror(e)'
15567 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15568 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
15569 d_syserrlst="$define"
15571 echo "(You don't appear to have any sys_errlist[], how can this be?)"
15572 d_syserrlst="$undef"
15574 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15575 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
15576 d_strerror="$undef"
15577 d_syserrlst="$define"
15578 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
15580 echo 'strerror() and sys_errlist[] NOT found.' >&4
15581 d_strerror="$undef"
15582 d_syserrlst="$undef"
15583 d_strerrm='"unknown"'
15587 : see if strerror_r exists
15588 set strerror_r d_strerror_r
15590 case "$d_strerror_r" in
15592 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
15593 case "$d_strerror_r_proto:$usethreads" in
15594 ":define") d_strerror_r_proto=define
15595 set d_strerror_r_proto strerror_r $hdrs
15599 case "$d_strerror_r_proto" in
15601 case "$strerror_r_proto" in
15602 ''|0) try='int strerror_r(int, char*, size_t);'
15603 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
15605 case "$strerror_r_proto" in
15606 ''|0) try='int strerror_r(int, char*, int);'
15607 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
15609 case "$strerror_r_proto" in
15610 ''|0) try='char* strerror_r(int, char*, size_t);'
15611 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
15613 case "$strerror_r_proto" in
15614 ''|0) d_strerror_r=undef
15616 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
15617 * ) case "$strerror_r_proto" in
15618 REENTRANT_PROTO*) ;;
15619 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
15621 echo "Prototype: $try" ;;
15624 *) case "$usethreads" in
15625 define) echo "strerror_r has no prototype, not using it." >&4 ;;
15632 *) strerror_r_proto=0
15636 : see if strftime exists
15637 set strftime d_strftime
15640 : see if strtod exists
15641 set strtod d_strtod
15644 : see if strtol exists
15645 set strtol d_strtol
15648 : see if strtold exists
15649 set strtold d_strtold
15652 : see if strtoll exists
15653 set strtoll d_strtoll
15656 case "$d_longlong-$d_strtoll" in
15659 Checking whether your strtoll() works okay...
15661 $cat >try.c <<'EOCP'
15664 #define strtoll __strtoll
15667 #define strtoll _strtoll
15670 extern long long int strtoll(char *s, char **, int);
15671 static int bad = 0;
15672 int check(char *s, long long ell, int een) {
15675 gll = strtoll(s, 0, 10);
15676 if (!((gll == ell) && (errno == een)))
15680 check(" 1", 1LL, 0);
15681 check(" 0", 0LL, 0);
15682 check("-1", -1LL, 0);
15683 check("-9223372036854775808", -9223372036854775808LL, 0);
15684 check("-9223372036854775808", -9223372036854775808LL, 0);
15685 check(" 9223372036854775807", 9223372036854775807LL, 0);
15686 check("-9223372036854775808", -9223372036854775808LL, 0);
15687 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
15688 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
15694 if eval $compile; then
15697 ok) echo "Your strtoll() seems to be working okay." ;;
15699 Your strtoll() doesn't seem to be working okay.
15705 echo "(I can't seem to compile the test program--assuming it doesn't)"
15711 : see if strtoq exists
15712 set strtoq d_strtoq
15715 : see if strtoul exists
15716 set strtoul d_strtoul
15719 case "$d_strtoul" in
15722 Checking whether your strtoul() works okay...
15724 $cat >try.c <<'EOCP'
15727 extern unsigned long int strtoul(char *s, char **, int);
15728 static int bad = 0;
15729 void check(char *s, unsigned long eul, int een) {
15732 gul = strtoul(s, 0, 10);
15733 if (!((gul == eul) && (errno == een)))
15737 check(" 1", 1L, 0);
15738 check(" 0", 0L, 0);
15740 case "$longsize" in
15742 $cat >>try.c <<'EOCP'
15743 check("18446744073709551615", 18446744073709551615UL, 0);
15744 check("18446744073709551616", 18446744073709551615UL, ERANGE);
15745 #if 0 /* strtoul() for /^-/ strings is undefined. */
15746 check("-1", 18446744073709551615UL, 0);
15747 check("-18446744073709551614", 2, 0);
15748 check("-18446744073709551615", 1, 0);
15749 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
15750 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
15755 $cat >>try.c <<'EOCP'
15756 check("4294967295", 4294967295UL, 0);
15757 check("4294967296", 4294967295UL, ERANGE);
15758 #if 0 /* strtoul() for /^-/ strings is undefined. */
15759 check("-1", 4294967295UL, 0);
15760 check("-4294967294", 2, 0);
15761 check("-4294967295", 1, 0);
15762 check("-4294967296", 4294967295UL, ERANGE);
15763 check("-4294967297", 4294967295UL, ERANGE);
15768 : Should we write these tests to be more portable by sprintf-ing
15769 : ~0 and then manipulating that char string as input for strtol?
15772 $cat >>try.c <<'EOCP'
15779 if eval $compile; then
15780 case "`$run ./try`" in
15781 ok) echo "Your strtoul() seems to be working okay." ;;
15783 Your strtoul() doesn't seem to be working okay.
15792 : see if strtoull exists
15793 set strtoull d_strtoull
15796 case "$d_longlong-$d_strtoull" in
15799 Checking whether your strtoull() works okay...
15801 $cat >try.c <<'EOCP'
15804 #define strtoull __strtoull
15807 extern unsigned long long int strtoull(char *s, char **, int);
15808 static int bad = 0;
15809 int check(char *s, long long eull, int een) {
15812 gull = strtoull(s, 0, 10);
15813 if (!((gull == eull) && (errno == een)))
15817 check(" 1", 1LL, 0);
15818 check(" 0", 0LL, 0);
15819 check("18446744073709551615", 18446744073709551615ULL, 0);
15820 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
15821 #if 0 /* strtoull() for /^-/ strings is undefined. */
15822 check("-1", 18446744073709551615ULL, 0);
15823 check("-18446744073709551614", 2LL, 0);
15824 check("-18446744073709551615", 1LL, 0);
15825 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
15826 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
15833 if eval $compile; then
15834 case "`$run ./try`" in
15835 ok) echo "Your strtoull() seems to be working okay." ;;
15837 Your strtoull() doesn't seem to be working okay.
15839 d_strtoull="$undef"
15846 : see if strtouq exists
15847 set strtouq d_strtouq
15850 case "$d_strtouq" in
15853 Checking whether your strtouq() works okay...
15855 $cat >try.c <<'EOCP'
15858 extern unsigned long long int strtouq(char *s, char **, int);
15859 static int bad = 0;
15860 void check(char *s, unsigned long long eull, int een) {
15861 unsigned long long gull;
15863 gull = strtouq(s, 0, 10);
15864 if (!((gull == eull) && (errno == een)))
15868 check(" 1", 1LL, 0);
15869 check(" 0", 0LL, 0);
15870 check("18446744073709551615", 18446744073709551615ULL, 0);
15871 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
15872 #if 0 /* strtouq() for /^-/ strings is undefined. */
15873 check("-1", 18446744073709551615ULL, 0);
15874 check("-18446744073709551614", 2LL, 0);
15875 check("-18446744073709551615", 1LL, 0);
15876 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
15877 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
15885 if eval $compile; then
15886 case "`$run ./try`" in
15887 ok) echo "Your strtouq() seems to be working okay." ;;
15889 Your strtouq() doesn't seem to be working okay.
15898 : see if strxfrm exists
15899 set strxfrm d_strxfrm
15902 : see if symlink exists
15903 set symlink d_symlink
15906 : see if syscall exists
15907 set syscall d_syscall
15910 : see if prototype for syscall is available
15912 set d_syscallproto syscall $i_unistd unistd.h
15915 : see if sysconf exists
15916 set sysconf d_sysconf
15919 : see if system exists
15920 set system d_system
15923 : see if tcgetpgrp exists
15924 set tcgetpgrp d_tcgetpgrp
15927 : see if tcsetpgrp exists
15928 set tcsetpgrp d_tcsetpgrp
15931 : see if prototype for telldir is available
15933 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
15936 : see if time exists
15938 if test "X$d_time" = X -o X"$timetype" = X; then
15939 if set time val -f d_time; eval $csym; $val; then
15940 echo 'time() found.' >&4
15942 rp="What is the type returned by time() on this system?"
15943 set time_t timetype long stdio.h sys/types.h
15946 echo 'time() not found, hope that will do.' >&4
15954 : see if this is a sys/times.h system
15955 set sys/times.h i_systimes
15958 : see if times exists
15960 if set times val -f d_times; eval $csym; $val; then
15961 echo 'times() found.' >&4
15964 case "$i_systimes" in
15965 "$define") inc='sys/times.h';;
15967 rp="What is the type returned by times() on this system?"
15968 set clock_t clocktype long stdio.h sys/types.h $inc
15971 echo 'times() NOT found, hope that will do.' >&4
15976 : see if tmpnam_r exists
15977 set tmpnam_r d_tmpnam_r
15979 case "$d_tmpnam_r" in
15981 hdrs="$i_systypes sys/types.h define stdio.h "
15982 case "$d_tmpnam_r_proto:$usethreads" in
15983 ":define") d_tmpnam_r_proto=define
15984 set d_tmpnam_r_proto tmpnam_r $hdrs
15988 case "$d_tmpnam_r_proto" in
15990 case "$tmpnam_r_proto" in
15991 ''|0) try='char* tmpnam_r(char*);'
15992 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
15994 case "$tmpnam_r_proto" in
15995 ''|0) d_tmpnam_r=undef
15997 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
15998 * ) case "$tmpnam_r_proto" in
15999 REENTRANT_PROTO*) ;;
16000 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
16002 echo "Prototype: $try" ;;
16005 *) case "$usethreads" in
16006 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
16013 *) tmpnam_r_proto=0
16017 : see if truncate exists
16018 set truncate d_truncate
16021 : see if ttyname_r exists
16022 set ttyname_r d_ttyname_r
16024 case "$d_ttyname_r" in
16026 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
16027 case "$d_ttyname_r_proto:$usethreads" in
16028 ":define") d_ttyname_r_proto=define
16029 set d_ttyname_r_proto ttyname_r $hdrs
16033 case "$d_ttyname_r_proto" in
16035 case "$ttyname_r_proto" in
16036 ''|0) try='int ttyname_r(int, char*, size_t);'
16037 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
16039 case "$ttyname_r_proto" in
16040 ''|0) try='int ttyname_r(int, char*, int);'
16041 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
16043 case "$ttyname_r_proto" in
16044 ''|0) try='char* ttyname_r(int, char*, int);'
16045 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
16047 case "$ttyname_r_proto" in
16048 ''|0) d_ttyname_r=undef
16050 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
16051 * ) case "$ttyname_r_proto" in
16052 REENTRANT_PROTO*) ;;
16053 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
16055 echo "Prototype: $try" ;;
16058 *) case "$usethreads" in
16059 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
16066 *) ttyname_r_proto=0
16070 : see if tzname[] exists
16072 if set tzname val -a d_tzname; eval $csym; $val; then
16074 echo 'tzname[] found.' >&4
16077 echo 'tzname[] NOT found.' >&4
16083 next|rhapsody|darwin) multiarch="$define" ;;
16085 case "$multiarch" in
16086 ''|[nN]*) multiarch="$undef" ;;
16089 : check for ordering of bytes in a UV
16091 case "$usecrosscompile$multiarch" in
16094 You seem to be either cross-compiling or doing a multiarchitecture build,
16095 skipping the byteorder check.
16101 case "$byteorder" in
16104 In the following, larger digits indicate more significance. A big-endian
16105 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
16106 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
16107 machines may have weird orders like 3412. A Cray will report 87654321,
16108 an Alpha will report 12345678. If the test program works the default is
16110 I'm now running the test program...
16114 #include <sys/types.h>
16115 typedef $uvtype UV;
16125 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
16127 u.l = (UV)0x04030201;
16128 for (i = 0; i < $uvsize; i++)
16129 printf("%c", u.c[i]+'0');
16136 if eval $compile && ./try > /dev/null; then
16139 [1-4][1-4][1-4][1-4]|12345678|87654321)
16140 echo "(The test program ran ok.)"
16141 echo "byteorder=$dflt"
16144 ????|????????) echo "(The test program ran ok.)" ;;
16145 *) echo "(The test program didn't run right for some reason.)" ;;
16150 (I can't seem to compile the test program. Guessing big-endian...)
16153 case "$xxx_prompt" in
16155 rp="What is the order of bytes in $uvtype?"
16171 Checking to see whether you can access character data unalignedly...
16173 case "$d_u32align" in
16174 '') $cat >try.c <<EOCP
16176 #define U32 $u32type
16177 #define BYTEORDER 0x$byteorder
16179 #include <signal.h>
16181 $signal_t bletch(s) int s; { exit(4); }
16184 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
16189 if (sizeof(U32) != 4) {
16190 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
16197 signal(SIGBUS, bletch);
16209 for (i = 0; i < 4; i++) {
16210 up = (U32*)(buf + i);
16211 if (! ((*up == 1 << (8*i)) || /* big-endian */
16212 (*up == 1 << (8*(3-i))) /* little-endian */
16216 printf("read failed (%x)\n", *up);
16222 for (i = 0; i < 4; i++) {
16223 up = (U32*)(buf + i);
16225 if (*up != 0xBeef) {
16226 printf("write failed (%x)\n", *up);
16240 if eval $compile_ok; then
16241 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
16242 $run ./try 2>&1 >/dev/null
16245 You can access character data pretty unalignedly.
16247 d_u32align="$undef"
16250 It seems that you must access character data in an aligned manner.
16252 d_u32align="$define"
16256 rp='Can you access character data at unaligned addresses?'
16260 [yY]*) d_u32align="$undef" ;;
16261 *) d_u32align="$define" ;;
16264 $rm -f core core.try.* try.core
16268 : see if ualarm exists
16269 set ualarm d_ualarm
16272 : see if umask exists
16276 : see if unordered exists
16277 set unordered d_unordered
16280 : see if usleep exists
16281 set usleep d_usleep
16284 : see if prototype for usleep is available
16286 set d_usleepproto usleep $i_unistd unistd.h
16289 : see if ustat exists
16293 : backward compatibility for d_hvfork
16294 if test X$d_hvfork != X; then
16295 d_vfork="$d_hvfork"
16298 : see if there is a vfork
16303 : Ok, but do we want to use it. vfork is reportedly unreliable in
16304 : perl on Solaris 2.x, and probably elsewhere.
16308 case "$usevfork" in
16314 Perl can only use a vfork() that doesn't suffer from strict
16315 restrictions on calling functions or modifying global data in
16316 the child. For example, glibc-2.1 contains such a vfork()
16317 that is unsuitable. If your system provides a proper fork()
16318 call, chances are that you do NOT want perl to use vfork().
16321 rp="Do you still want to use vfork()?"
16326 echo "Ok, we won't use vfork()."
16335 $define) usevfork='true';;
16336 *) usevfork='false';;
16339 : see if closedir exists
16340 set closedir d_closedir
16343 case "$d_closedir" in
16346 echo "Checking whether closedir() returns a status..." >&4
16348 #$i_dirent I_DIRENT /**/
16349 #$i_sysdir I_SYS_DIR /**/
16350 #$i_sysndir I_SYS_NDIR /**/
16351 #$i_systypes I_SYS_TYPES /**/
16353 #if defined(I_SYS_TYPES)
16354 #include <sys/types.h>
16356 #if defined(I_DIRENT)
16357 #include <dirent.h>
16358 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
16359 #include <sys/dir.h>
16363 #include <sys/ndir.h>
16367 #include <ndir.h> /* may be wrong in the future */
16369 #include <sys/dir.h>
16374 int main() { return closedir(opendir(".")); }
16377 if eval $compile_ok; then
16378 if $run ./try > /dev/null 2>&1 ; then
16379 echo "Yes, it does."
16382 echo "No, it doesn't."
16386 echo "(I can't seem to compile the test program--assuming it doesn't)"
16394 set d_void_closedir
16397 : see if there is a wait4
16401 : see if waitpid exists
16402 set waitpid d_waitpid
16405 : see if wcstombs exists
16406 set wcstombs d_wcstombs
16409 : see if wctomb exists
16410 set wctomb d_wctomb
16413 : see if writev exists
16414 set writev d_writev
16417 : preserve RCS keywords in files with variable substitution, grrr
16422 Revision='$Revision'
16424 : check for alignment requirements
16426 case "$usecrosscompile$multiarch" in
16429 You seem to be either cross-compiling or doing a multiarchitecture build,
16430 skipping the memory alignment check.
16433 case "$alignbytes" in
16434 '') alignbytes=8 ;;
16438 case "$alignbytes" in
16439 '') echo "Checking alignment constraints..." >&4
16440 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
16441 $cat >try.c <<'EOCP'
16442 typedef long double NV;
16445 $cat >try.c <<'EOCP'
16449 $cat >>try.c <<'EOCP'
16457 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
16462 if eval $compile_ok; then
16466 echo "(I can't seem to compile the test program...)"
16469 *) dflt="$alignbytes"
16472 rp="Doubles must be aligned on a how-many-byte boundary?"
16480 : set the base revision
16483 : how do we catenate cpp tokens here?
16485 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
16486 $cat >cpp_stuff.c <<'EOCP'
16487 #define RCAT(a,b)a/**/b
16488 #define ACAT(a,b)a ## b
16492 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
16493 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
16494 echo "Oh! Smells like ANSI's been here." >&4
16495 echo "We can catify or stringify, separately or together!"
16497 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
16498 echo "Ah, yes! The good old days!" >&4
16499 echo "However, in the good old days we don't know how to stringify and"
16500 echo "catify at the same time."
16504 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
16505 to have to edit the values of CAT[2-5] in config.h...
16507 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
16511 : see if this is a db.h system
16517 : Check db version.
16519 echo "Checking Berkeley DB version ..." >&4
16525 #include <sys/types.h>
16528 int main(int argc, char *argv[])
16530 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
16531 int Major, Minor, Patch ;
16532 unsigned long Version ;
16533 (void)db_version(&Major, &Minor, &Patch) ;
16535 printf("%d %d %d %d %d %d\n",
16536 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
16537 Major, Minor, Patch);
16540 printf("You have Berkeley DB Version 2 or greater.\n");
16542 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
16543 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
16544 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
16545 Major, Minor, Patch) ;
16547 /* check that db.h & libdb are compatible */
16548 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
16549 printf("db.h and libdb are incompatible.\n") ;
16553 printf("db.h and libdb are compatible.\n") ;
16555 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
16556 + DB_VERSION_PATCH ;
16558 /* needs to be >= 2.3.4 */
16559 if (Version < 2003004) {
16560 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
16561 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
16567 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
16572 printf("You have Berkeley DB Version 1.\n");
16573 exit(0); /* DB version < 2: the coast is clear. */
16575 exit(1); /* <db.h> not Berkeley DB? */
16581 if eval $compile_ok && $run ./try; then
16582 echo 'Looks OK.' >&4
16584 db_version_major=$1
16585 db_version_minor=$2
16586 db_version_patch=$3
16588 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
16592 : Remove db from list of libraries to use
16593 echo "Removing unusable -ldb from library list" >&4
16594 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
16597 echo "libs = $libs" >&4
16607 : Check the return type needed for hash
16609 echo "Checking return type needed for hash for Berkeley DB ..." >&4
16615 #include <sys/types.h>
16618 #ifndef DB_VERSION_MAJOR
16619 u_int32_t hash_cb (ptr, size)
16627 info.hash = hash_cb;
16631 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16632 if $contains warning try.out >>/dev/null 2>&1 ; then
16635 db_hashtype='u_int32_t'
16638 : XXX Maybe we should just give up here.
16639 db_hashtype=u_int32_t
16641 echo "Help: I can't seem to compile the db test program." >&4
16642 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
16645 echo "Your version of Berkeley DB uses $db_hashtype for hash."
16647 *) db_hashtype=u_int32_t
16652 : Check the return type needed for prefix
16654 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
16660 #include <sys/types.h>
16663 #ifndef DB_VERSION_MAJOR
16664 size_t prefix_cb (key1, key2)
16672 info.prefix = prefix_cb;
16676 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16677 if $contains warning try.out >>/dev/null 2>&1 ; then
16678 db_prefixtype='int'
16680 db_prefixtype='size_t'
16683 db_prefixtype='size_t'
16684 : XXX Maybe we should just give up here.
16686 echo "Help: I can't seem to compile the db test program." >&4
16687 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
16690 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
16692 *) db_prefixtype='size_t'
16697 : How can we generate normalized random numbers ?
16699 echo "Looking for a random number function..." >&4
16700 case "$randfunc" in
16702 if set drand48 val -f; eval $csym; $val; then
16704 echo "Good, found drand48()." >&4
16705 elif set random val -f; eval $csym; $val; then
16707 echo "OK, found random()." >&4
16710 echo "Yick, looks like I have to use rand()." >&4
16721 *-Dmy_rand=*|*-Dmy_srand=*)
16722 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
16723 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
16724 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
16725 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
16729 while $test "$cont"; do
16730 rp="Use which function to generate random numbers?"
16732 if $test "$ans" = "$dflt"; then
16738 if set $ans val -f; eval $csym; $val; then
16742 rp="I cannot find function $ans. Use that name anyway?"
16751 case "$randfunc" in
16753 drand01="drand48()"
16759 case "$randbits" in
16761 echo "Checking to see how many bits your $randfunc() function produces..." >&4
16763 #$i_unistd I_UNISTD
16764 #$i_stdlib I_STDLIB
16767 # include <unistd.h>
16770 # include <stdlib.h>
16775 register unsigned long tmp;
16776 register unsigned long max = 0L;
16778 for (i = 1000; i; i--) {
16779 tmp = (unsigned long) $randfunc();
16780 if (tmp > max) max = tmp;
16782 for (i = 0; max; i++)
16788 if eval $compile_ok; then
16792 echo "(I can't seem to compile the test program...)"
16799 rp="How many bits does your $randfunc() function produce?"
16803 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
16804 seedfunc="s$randfunc"
16805 randseedtype=unsigned
16809 rp="How many bits does your $randfunc() function produce?"
16812 seedfunc="s$randfunc"
16813 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
16814 if set $seedfunc val -f; eval $csym; $val; then
16815 echo "(Using $seedfunc() to seed random generator)"
16817 echo "(Warning: no $seedfunc() to seed random generator)"
16820 randseedtype=unsigned
16828 echo "Determining whether or not we are on an EBCDIC system..." >&4
16829 $cat >try.c <<'EOM'
16832 if ('M'==0xd4) return 0;
16839 if eval $compile_ok; then
16840 if $run ./try; then
16841 echo "You seem to speak EBCDIC." >&4
16844 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
16847 echo "I'm unable to compile the test program." >&4
16848 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
16856 Checking how to flush all pending stdio output...
16858 # I only know how to find the first 32 possibly open files on SunOS.
16859 # See also hints/sunos_4_1.sh and util.c --AD
16861 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
16863 $cat >>try.c <<EOCP
16865 #$i_unistd I_UNISTD
16867 # include <unistd.h>
16869 #$d_sysconf HAS_SYSCONF
16870 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
16871 #ifdef HAS_STDIO_STREAM_ARRAY
16872 # define STDIO_STREAM_ARRAY $stdio_stream_array
16877 p = fopen("try.out", "w");
16881 # ifdef TRY_FPRINTF
16885 #ifdef TRY_FFLUSH_NULL
16888 #ifdef TRY_FFLUSH_ALL
16890 long open_max = -1;
16891 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
16892 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
16894 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
16895 open_max = sysconf(_SC_OPEN_MAX);
16898 open_max = FOPEN_MAX;
16901 open_max = OPEN_MAX;
16910 # ifdef HAS_STDIO_STREAM_ARRAY
16911 if (open_max > 0) {
16913 for (i = 0; i < open_max; i++)
16914 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
16915 STDIO_STREAM_ARRAY[i]._file < open_max &&
16916 STDIO_STREAM_ARRAY[i]._flag)
16917 fflush(&STDIO_STREAM_ARRAY[i]);
16925 : first we have to find out how _not_ to flush
16927 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
16929 set try -DTRY_FPUTC
16930 if eval $compile; then
16931 $run ./try 2>/dev/null
16934 if $test ! -s try.out -a "X$code" = X42; then
16940 set try -DTRY_FPRINTF
16941 if eval $compile; then
16942 $run ./try 2>/dev/null
16945 if $test ! -s try.out -a "X$code" = X42; then
16946 output=-DTRY_FPRINTF
16952 : check for fflush NULL behaviour
16953 case "$fflushNULL" in
16954 '') set try -DTRY_FFLUSH_NULL $output
16955 if eval $compile; then
16956 $run ./try 2>/dev/null
16959 if $test -s try.out -a "X$code" = X42; then
16960 fflushNULL="`$cat try.out`"
16962 if $test "X$code" != X42; then
16964 (If this test failed, don't worry, we'll try another method shortly.)
16969 $rm -f core try.core core.try.*
16970 case "$fflushNULL" in
16972 Your fflush(NULL) works okay for output streams.
16973 Let's see if it clobbers input pipes...
16975 # As of mid-March 2000 all versions of Solaris appear to have a stdio
16976 # bug that improperly flushes the input end of pipes. So we avoid the
16977 # autoflush on fork/system/exec support for now. :-(
16978 $cat >tryp.c <<EOCP
16981 main(int argc, char **argv)
16987 while ((i = getc(stdin)) != -1
16988 && (*bp++ = i) != '\n'
16989 && bp < &buf[1024])
16992 fprintf(stdout, "%s", buf);
17000 fflushNULL="$define"
17002 if eval $compile; then
17004 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17005 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17007 fflush(NULL) seems to behave okay with input streams.
17009 fflushNULL="$define"
17012 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
17014 fflushNULL="$undef"
17017 $rm -f core tryp.c tryp.core core.tryp.*
17020 Your fflush(NULL) isn't working (contrary to ANSI C).
17022 fflushNULL="$undef"
17025 Cannot figure out whether your fflush(NULL) works or not.
17026 I'm assuming it doesn't (contrary to ANSI C).
17028 fflushNULL="$undef"
17032 $define|true|[yY]*)
17033 fflushNULL="$define"
17036 fflushNULL="$undef"
17039 : check explicit looping only if NULL did not work, and if the pipe
17040 : bug does not show up on an explicit flush too
17041 case "$fflushNULL" in
17043 $cat >tryp.c <<EOCP
17046 main(int argc, char **argv)
17052 while ((i = getc(stdin)) != -1
17053 && (*bp++ = i) != '\n'
17054 && bp < &buf[1024])
17057 fprintf(stdout, "%s", buf);
17066 if eval $compile; then
17068 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17069 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17071 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
17073 : now check for fflushall behaviour
17074 case "$fflushall" in
17075 '') set try -DTRY_FFLUSH_ALL $output
17076 if eval $compile; then
17078 (Now testing the other method--but note that this also may fail.)
17080 $run ./try 2>/dev/null
17083 if $test -s try.out -a "X$code" = X42; then
17084 fflushall="`$cat try.out`"
17087 $rm -f core try.core core.try.*
17088 case "$fflushall" in
17090 Whew. Flushing explicitly all the stdio streams works.
17092 fflushall="$define"
17095 Sigh. Flushing explicitly all the stdio streams doesn't work.
17100 Cannot figure out whether flushing stdio streams explicitly works or not.
17101 I'm assuming it doesn't.
17107 "$define"|true|[yY]*)
17108 fflushall="$define"
17116 All is futile. Even fflush(stdin) clobbers input pipes!
17123 $rm -f core tryp.c tryp.core core.tryp.*
17125 *) fflushall="$undef"
17129 case "$fflushNULL$fflushall" in
17132 OK, I give up. I cannot figure out how to flush pending stdio output.
17133 We won't be flushing handles at all before fork/exec/popen.
17137 $rm -f try.* try$exe_ext
17139 : Store the full pathname to the ar program for use in the C program
17140 : Respect a hint or command line value for full_ar.
17145 : Store the full pathname to the sed program for use in the C program
17148 : see what type gids are declared as in the kernel
17150 echo "Looking for the type for group ids returned by getgid()."
17151 set gid_t gidtype xxx stdio.h sys/types.h
17155 xxx=`./findhdr sys/user.h`
17156 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
17158 unsigned) dflt="$1 $2" ;;
17162 *) dflt="$gidtype";;
17165 gid_t) echo "gid_t found." ;;
17166 *) rp="What is the type for group ids returned by getgid()?"
17174 *_t) zzz="$gidtype" ;;
17177 echo "Checking the size of $zzz..." >&4
17179 #include <sys/types.h>
17182 printf("%d\n", (int)sizeof($gidtype));
17187 if eval $compile_ok; then
17191 echo "(I can't execute the test program--guessing $gidsize.)" >&4
17194 echo "Your $zzz is $gidsize bytes long."
17199 echo "(I can't compile the test program--guessing $gidsize.)" >&4
17205 *_t) zzz="$gidtype" ;;
17208 echo "Checking the sign of $zzz..." >&4
17210 #include <sys/types.h>
17221 if eval $compile; then
17225 echo "(I can't execute the test program--guessing unsigned.)" >&4
17229 1) echo "Your $zzz is unsigned." ;;
17230 -1) echo "Your $zzz is signed." ;;
17236 echo "(I can't compile the test program--guessing unsigned.)" >&4
17242 if $test X"$quadtype" != X; then
17244 echo "Checking how to print 64-bit integers..." >&4
17246 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
17247 $cat >try.c <<'EOCP'
17248 #include <sys/types.h>
17251 int q = 12345678901;
17252 printf("%ld\n", q);
17256 if eval $compile; then
17260 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
17261 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
17262 echo "We will use %d."
17268 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
17269 $cat >try.c <<'EOCP'
17270 #include <sys/types.h>
17273 long q = 12345678901;
17274 printf("%ld\n", q);
17278 if eval $compile; then
17282 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
17283 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
17284 echo "We will use %ld."
17290 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
17291 $cat >try.c <<'EOCP'
17292 #include <sys/types.h>
17293 #include <inttypes.h>
17296 int64_t q = 12345678901;
17297 printf("%" PRId64 "\n", q);
17301 if eval $compile; then
17305 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
17306 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
17307 echo "We will use the C9X style."
17313 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17315 #include <sys/types.h>
17318 $quadtype q = 12345678901;
17319 printf("%Ld\n", q);
17323 if eval $compile; then
17327 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
17328 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
17329 echo "We will use %Ld."
17335 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
17336 $cat >try.c <<'EOCP'
17337 #include <sys/types.h>
17340 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
17341 printf("%lld\n", q);
17345 if eval $compile; then
17349 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
17350 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
17351 echo "We will use the %lld style."
17357 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17359 #include <sys/types.h>
17362 $quadtype q = 12345678901;
17363 printf("%qd\n", q);
17367 if eval $compile; then
17371 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
17372 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
17373 echo "We will use %qd."
17379 if $test X"$sPRId64" = X; then
17380 echo "Cannot figure out how to print 64-bit integers." >&4
17388 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
17389 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
17391 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
17392 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
17398 $echo "Checking the format strings to be used for Perl's internal types..." >&4
17400 if $test X"$ivsize" = X8; then
17401 ivdformat="$sPRId64"
17402 uvuformat="$sPRIu64"
17403 uvoformat="$sPRIo64"
17404 uvxformat="$sPRIx64"
17405 uvXUformat="$sPRIXU64"
17407 if $test X"$ivsize" = X"$longsize"; then
17414 if $test X"$ivsize" = X"$intsize"; then
17422 if $test X"$ivsize" = X"$shortsize"; then
17433 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
17434 nveformat="$sPRIeldbl"
17435 nvfformat="$sPRIfldbl"
17436 nvgformat="$sPRIgldbl"
17437 nvEUformat="$sPRIEUldbl"
17438 nvFUformat="$sPRIFUldbl"
17439 nvGUformat="$sPRIGUldbl"
17449 case "$ivdformat" in
17450 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
17457 $echo "Checking the format string to be used for gids..." >&4
17460 -1) if $test X"$gidsize" = X"$ivsize"; then
17461 gidformat="$ivdformat"
17463 if $test X"$gidsize" = X"$longsize"; then
17466 if $test X"$gidsize" = X"$intsize"; then
17469 if $test X"$gidsize" = X"$shortsize"; then
17476 *) if $test X"$gidsize" = X"$uvsize"; then
17477 gidformat="$uvuformat"
17479 if $test X"$gidsize" = X"$longsize"; then
17482 if $test X"$gidsize" = X"$intsize"; then
17485 if $test X"$gidsize" = X"$shortsize"; then
17494 : see if getgroups exists
17495 set getgroups d_getgrps
17498 : see if setgroups exists
17499 set setgroups d_setgrps
17503 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
17505 case "$d_getgrps$d_setgrps" in
17507 case "$groupstype" in
17508 '') dflt="$gidtype" ;;
17509 *) dflt="$groupstype" ;;
17512 What type of pointer is the second argument to getgroups() and setgroups()?
17513 Usually this is the same as group ids, $gidtype, but not always.
17516 rp='What type pointer is the second argument to getgroups() and setgroups()?'
17520 *) groupstype="$gidtype";;
17524 echo "Checking if your $make program sets \$(MAKE)..." >&4
17525 case "$make_set_make" in
17527 $sed 's/^X //' > testmake.mak << 'EOF'
17529 X @echo 'maketemp="$(MAKE)"'
17531 case "`$make -f testmake.mak 2>/dev/null`" in
17532 *maketemp=*) make_set_make='#' ;;
17533 *) make_set_make="MAKE=$make" ;;
17535 $rm -f testmake.mak
17538 case "$make_set_make" in
17539 '#') echo "Yup, it does.";;
17540 *) echo "Nope, it doesn't.";;
17543 : see what type is used for mode_t
17544 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
17545 set mode_t modetype int stdio.h sys/types.h
17548 : see if stdarg is available
17550 if $test `./findhdr stdarg.h`; then
17551 echo "<stdarg.h> found." >&4
17554 echo "<stdarg.h> NOT found." >&4
17558 : see if varags is available
17560 if $test `./findhdr varargs.h`; then
17561 echo "<varargs.h> found." >&4
17563 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
17566 : set up the varargs testing programs
17567 $cat > varargs.c <<EOP
17569 #include <stdarg.h>
17572 #include <varargs.h>
17576 int f(char *p, ...)
17590 p = va_arg(ap, char *);
17595 $cat > varargs <<EOP
17597 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
17606 : now check which varargs header should be included
17611 if `./varargs I_STDARG`; then
17613 elif `./varargs I_VARARGS`; then
17618 if `./varargs I_VARARGS`; then
17625 echo "I could not find the definition for va_dcl... You have problems..." >&4
17626 val="$undef"; set i_stdarg; eval $setvar
17627 val="$undef"; set i_varargs; eval $setvar
17632 case "$i_varhdr" in
17634 val="$define"; set i_stdarg; eval $setvar
17635 val="$undef"; set i_varargs; eval $setvar
17638 val="$undef"; set i_stdarg; eval $setvar
17639 val="$define"; set i_varargs; eval $setvar
17642 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
17646 : see if we need va_copy
17648 case "$i_stdarg" in
17651 #include <stdarg.h>
17653 #$i_stdlib I_STDLIB
17655 #include <stdlib.h>
17657 #include <signal.h>
17660 ivfprintf(FILE *f, const char *fmt, va_list *valp)
17662 return vfprintf(f, fmt, *valp);
17666 myvfprintf(FILE *f, const char *fmt, va_list val)
17668 return ivfprintf(f, fmt, &val);
17672 myprintf(char *fmt, ...)
17675 va_start(val, fmt);
17676 return myvfprintf(stdout, fmt, val);
17680 main(int ac, char **av)
17682 signal(SIGSEGV, exit);
17684 myprintf("%s%cs all right, then\n", "that", '\'');
17689 if eval $compile && $run ./try 2>&1 >/dev/null; then
17690 case "`$run ./try`" in
17691 "that's all right, then")
17697 yes) echo "It seems that you don't need va_copy()." >&4
17698 need_va_copy="$undef"
17700 *) echo "It seems that va_copy() or similar will be needed." >&4
17701 need_va_copy="$define"
17704 $rm -f try.* core core.* *.core *.core.*
17706 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
17710 : see what type is used for size_t
17711 rp="What is the type used for the length parameter for string functions?"
17712 set size_t sizetype 'unsigned int' stdio.h sys/types.h
17715 : check for type of arguments to gethostbyaddr.
17716 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
17717 case "$d_gethbyaddr" in
17721 Checking to see what type of arguments are accepted by gethostbyaddr().
17723 hdrs="$define sys/types.h
17724 $d_socket sys/socket.h
17725 $i_niin netinet/in.h
17727 $i_unistd unistd.h"
17728 : The first arg can 'char *' or 'void *'
17729 : The second arg is some of integral type
17730 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
17731 for yyy in size_t long int; do
17732 case "$netdb_host_type" in
17733 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
17734 if ./protochk "$try" $hdrs; then
17735 echo "Your system accepts $xxx for the first arg."
17736 echo "...and $yyy for the second arg."
17737 netdb_host_type="$xxx"
17738 netdb_hlen_type="$yyy"
17744 : In case none of those worked, prompt the user.
17745 case "$netdb_host_type" in
17746 '') rp='What is the type for the 1st argument to gethostbyaddr?'
17749 netdb_host_type=$ans
17750 rp='What is the type for the 2nd argument to gethostbyaddr?'
17753 netdb_hlen_type=$ans
17757 *) : no gethostbyaddr, so pick harmless defaults
17758 netdb_host_type='char *'
17759 netdb_hlen_type="$sizetype"
17762 # Remove the "const" if needed. -- but then we'll have a
17764 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
17767 : check for type of argument to gethostbyname.
17768 if test "X$netdb_name_type" = X ; then
17769 case "$d_gethbyname" in
17773 Checking to see what type of argument is accepted by gethostbyname().
17775 hdrs="$define sys/types.h
17776 $d_socket sys/socket.h
17777 $i_niin netinet/in.h
17779 $i_unistd unistd.h"
17780 for xxx in "const char *" "char *"; do
17781 case "$netdb_name_type" in
17782 '') try="extern struct hostent *gethostbyname($xxx);"
17783 if ./protochk "$try" $hdrs; then
17784 echo "Your system accepts $xxx."
17785 netdb_name_type="$xxx"
17790 : In case none of those worked, prompt the user.
17791 case "$netdb_name_type" in
17792 '') rp='What is the type for the 1st argument to gethostbyname?'
17795 netdb_name_type=$ans
17799 *) : no gethostbyname, so pick harmless default
17800 netdb_name_type='char *'
17805 : check for type of 1st argument to getnetbyaddr.
17806 if test "X$netdb_net_type" = X ; then
17807 case "$d_getnbyaddr" in
17811 Checking to see what type of 1st argument is accepted by getnetbyaddr().
17813 hdrs="$define sys/types.h
17814 $d_socket sys/socket.h
17815 $i_niin netinet/in.h
17817 $i_unistd unistd.h"
17818 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
17819 case "$netdb_net_type" in
17820 '') try="extern struct netent *getnetbyaddr($xxx, int);"
17821 if ./protochk "$try" $hdrs; then
17822 echo "Your system accepts $xxx."
17823 netdb_net_type="$xxx"
17828 : In case none of those worked, prompt the user.
17829 case "$netdb_net_type" in
17830 '') rp='What is the type for the 1st argument to getnetbyaddr?'
17833 netdb_net_type=$ans
17837 *) : no getnetbyaddr, so pick harmless default
17838 netdb_net_type='long'
17842 : locate the preferred pager for this system
17848 [a-zA-Z]:/*) dflt=$pg;;
17852 [a-zA-Z]:/*) dflt=$more;;
17856 [a-zA-Z]:/*) dflt=$less;;
17859 '') dflt=/usr/ucb/more;;
17866 rp='What pager is used on your system?'
17870 : see what type pids are declared as in the kernel
17871 rp="What is the type of process ids on this system?"
17872 set pid_t pidtype int stdio.h sys/types.h
17875 : Find earliest binary compatible site_perl subdirectory perl can use.
17876 xs_apiversion=$version # The current site_perl version.
17877 : Find earliest pure perl site_perl subdirectory perl can use.
17878 : The versioned directories started at 5.005.
17879 pm_apiversion='5.005'
17881 : see if ar generates random libraries by itself
17883 echo "Checking how to generate random libraries on your machine..." >&4
17884 echo 'int bar1() { return bar2(); }' > bar1.c
17885 echo 'int bar2() { return 2; }' > bar2.c
17886 $cat > foo.c <<'EOP'
17887 int main() { printf("%d\n", bar1()); exit(0); }
17889 $cc $ccflags -c bar1.c >/dev/null 2>&1
17890 $cc $ccflags -c bar2.c >/dev/null 2>&1
17891 $cc $ccflags -c foo.c >/dev/null 2>&1
17892 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
17893 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
17894 $run ./foobar >/dev/null 2>&1; then
17895 echo "$ar appears to generate random libraries itself."
17898 elif $ar ts bar$_a >/dev/null 2>&1 &&
17899 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
17900 $run ./foobar >/dev/null 2>&1; then
17901 echo "a table of contents needs to be added with '$ar ts'."
17908 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
17909 $test -f $ranlib || ranlib=''
17912 if $test -n "$ranlib"; then
17913 echo "your system has '$ranlib'; we'll use that."
17916 echo "your system doesn't seem to support random libraries"
17917 echo "so we'll use lorder and tsort to order the libraries."
17924 : check for type of arguments to select.
17925 case "$selecttype" in
17926 '') case "$d_select" in
17930 Checking to see what type of arguments are accepted by select().
17932 hdrs="$define sys/types.h
17933 $i_systime sys/time.h
17934 $i_sysselct sys/select.h
17935 $d_socket sys/socket.h"
17936 : The first arg can be int, unsigned, or size_t
17937 : The last arg may or may not be 'const'
17939 : void pointer has been seen but using that
17940 : breaks the selectminbits test
17941 for xxx in 'fd_set *' 'int *'; do
17942 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
17943 for tmo in 'struct timeval *' 'const struct timeval *'; do
17945 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
17946 if ./protochk "$try" $hdrs; then
17947 echo "Your system accepts $xxx."
17956 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
17957 case "$d_fd_set" in
17958 $define) dflt="fd_set *" ;;
17967 *) : no select, so pick a harmless default
17974 : check for the select 'width'
17975 case "$selectminbits" in
17976 '') case "$d_select" in
17980 Checking to see on how many bits at a time your select() operates...
17983 #include <sys/types.h>
17985 #$i_systime I_SYS_TIME
17986 #$i_systimek I_SYS_TIME_KERNEL
17991 # ifdef I_SYS_TIME_KERNEL
17994 # include <sys/time.h>
17995 # ifdef I_SYS_TIME_KERNEL
17999 #$i_sysselct I_SYS_SELECT
18000 #ifdef I_SYS_SELECT
18001 #include <sys/select.h>
18003 #$d_socket HAS_SOCKET
18005 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
18009 #define S sizeof(*(b))
18011 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
18012 #define NBITS (NBYTES * 8)
18021 fp = fopen("try.c", "r");
18027 b = ($selecttype)s;
18028 for (i = 0; i < NBITS; i++)
18032 select(fd + 1, b, 0, 0, &t);
18033 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
18034 printf("%d\n", i + 1);
18039 if eval $compile_ok; then
18040 selectminbits=`$run ./try`
18041 case "$selectminbits" in
18043 Cannot figure out on how many bits at a time your select() operates.
18044 I'll play safe and guess it is 32 bits.
18050 *) bits="$selectminbits bits" ;;
18052 echo "Your select() operates on $bits at a time." >&4
18054 rp='What is the minimum number of bits your select() operates on?'
18055 case "$byteorder" in
18056 1234|12345678) dflt=32 ;;
18061 selectminbits="$val"
18065 *) : no select, so pick a harmless default
18072 : Trace out the files included by signal.h, then look for SIGxxx names.
18073 : Remove SIGARRAYSIZE used by HPUX.
18074 : Remove SIGSTKSIZE used by Linux.
18075 : Remove SIGSTKSZ used by Posix.
18076 : Remove SIGTYP void lines used by OS2.
18077 : Some cpps, like os390, dont give the file name anywhere
18078 if [ "X$fieldn" = X ]; then
18079 : Just make some guesses. We check them later.
18080 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
18082 xxx=`echo '#include <signal.h>' |
18083 $cppstdin $cppminus $cppflags 2>/dev/null |
18084 $grep '^[ ]*#.*include' |
18085 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
18087 : Check this list of files to be sure we have parsed the cpp output ok.
18088 : This will also avoid potentially non-existent files, such
18091 for xx in $xxx /dev/null ; do
18092 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
18094 : If we have found no files, at least try signal.h
18095 case "$xxxfiles" in
18096 '') xxxfiles=`./findhdr signal.h` ;;
18099 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
18100 print substr($2, 4, 20)
18102 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
18103 print substr($3, 4, 20)
18105 : Append some common names just in case the awk scan failed.
18106 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
18107 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
18108 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
18109 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
18110 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
18112 : generate a few handy files for later
18113 $cat > signal.c <<'EOCP'
18114 #include <sys/types.h>
18115 #include <signal.h>
18119 /* Strange style to avoid deeply-nested #if/#else/#endif */
18122 # define NSIG (_NSIG)
18128 # define NSIG (SIGMAX+1)
18134 # define NSIG (SIG_MAX+1)
18140 # define NSIG (MAXSIG+1)
18146 # define NSIG (MAX_SIG+1)
18151 # ifdef SIGARRAYSIZE
18152 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
18158 # define NSIG (_sys_nsig) /* Solaris 2.5 */
18162 /* Default to some arbitrary number that's big enough to get most
18163 of the common signals.
18169 printf("NSIG %d\n", NSIG);
18175 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
18177 printf "#ifdef SIG"; printf $1; printf "\n"
18178 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
18179 printf $1; printf ");\n"
18183 printf "#endif /* JUST_NSIG */\n";
18184 printf "exit(0);\n}\n";
18187 $cat >signal.awk <<'EOP'
18188 BEGIN { ndups = 0 }
18189 $1 ~ /^NSIG$/ { nsig = $2 }
18190 ($1 !~ /^NSIG$/) && (NF == 2) {
18191 if ($2 > maxsig) { maxsig = $2 }
18192 if (sig_name[$2]) {
18193 dup_name[ndups] = $1
18194 dup_num[ndups] = $2
18206 printf("NSIG %d\n", nsig);
18207 for (n = 1; n < nsig; n++) {
18209 printf("%s %d\n", sig_name[n], sig_num[n])
18212 printf("NUM%d %d\n", n, n)
18215 for (n = 0; n < ndups; n++) {
18216 printf("%s %d\n", dup_name[n], dup_num[n])
18220 $cat >signal_cmd <<EOS
18222 if $test -s signal.lst; then
18223 echo "Using your existing signal.lst file"
18228 $cat >>signal_cmd <<'EOS'
18231 if eval $compile_ok; then
18232 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
18234 echo "(I can't seem be able to compile the whole test program)" >&4
18235 echo "(I'll try it in little pieces.)" >&4
18236 set signal -DJUST_NSIG
18237 if eval $compile_ok; then
18238 $run ./signal$_exe > signal.nsg
18241 echo "I can't seem to figure out how many signals you have." >&4
18242 echo "Guessing 50." >&4
18243 echo 'NSIG 50' > signal.nsg
18245 : Now look at all the signal names, one at a time.
18246 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
18247 $cat > signal.c <<EOCP
18248 #include <sys/types.h>
18249 #include <signal.h>
18252 printf("$xx %d\n", SIG${xx});
18257 if eval $compile; then
18258 echo "SIG${xx} found."
18259 $run ./signal$_exe >> signal.ls1
18261 echo "SIG${xx} NOT found."
18264 if $test -s signal.ls1; then
18265 $cat signal.nsg signal.ls1 |
18266 $sort -n | $uniq | $awk -f signal.awk >signal.lst
18270 if $test -s signal.lst; then
18273 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
18274 echo 'kill -l' >signal
18275 set X `csh -f <signal`
18279 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
18281 echo $@ | $tr ' ' $trnl | \
18282 $awk '{ printf "%s %d\n", $1, ++s; }
18283 END { printf "NSIG %d\n", ++s }' >signal.lst
18285 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
18287 chmod a+x signal_cmd
18288 $eunicefix signal_cmd
18290 : generate list of signal names
18292 case "$sig_name_init" in
18294 *) case "$sig_num_init" in
18295 ''|*,*) doinit=yes ;;
18300 echo "Generating a list of signal names and numbers..." >&4
18302 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
18303 sig_name=`$awk 'BEGIN { printf "ZERO " }
18304 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
18305 sig_num=`$awk 'BEGIN { printf "0 " }
18306 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
18307 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
18308 !/^NSIG/ { printf "\"%s\", ", $1 }
18309 END { printf "0\n" }' signal.lst`
18310 sig_num_init=`$awk 'BEGIN { printf "0, " }
18311 !/^NSIG/ { printf "%d, ", $2}
18312 END { printf "0\n"}' signal.lst`
18315 echo "The following $sig_count signals are available:"
18317 echo $sig_name | $awk \
18318 'BEGIN { linelen = 0 }
18320 for (i = 1; i <= NF; i++) {
18321 name = "SIG" $i " "
18322 linelen = linelen + length(name)
18323 if (linelen > 70) {
18325 linelen = length(name)
18331 sig_size=`echo $sig_name | awk '{print NF}'`
18332 $rm -f signal signal.c signal.awk signal.lst signal_cmd
18335 case "$sizetype" in
18336 *_t) zzz="$sizetype" ;;
18337 *) zzz="filesize" ;;
18339 echo "Checking the size of $zzz..." >&4
18341 #include <sys/types.h>
18344 printf("%d\n", (int)sizeof($sizetype));
18349 if eval $compile_ok; then
18353 echo "(I can't execute the test program--guessing $sizesize.)" >&4
18356 echo "Your $zzz size is $sizesize bytes."
18361 echo "(I can't compile the test program--guessing $sizesize.)" >&4
18365 : check for socklen_t
18367 echo "Checking to see if you have socklen_t..." >&4
18369 #include <sys/types.h>
18370 #$d_socket HAS_SOCKET
18372 #include <sys/socket.h>
18374 int main() { socklen_t x = 16; }
18377 if eval $compile; then
18379 echo "You have socklen_t."
18382 echo "You do not have socklen_t."
18383 case "$sizetype" in
18384 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
18391 : see if this is a socks.h system
18392 set socks.h i_socks
18395 : check for type of the size argument to socket calls
18396 case "$d_socket" in
18400 Checking to see what type is the last argument of accept().
18403 case "$d_socklen_t" in
18404 "$define") yyy="$yyy socklen_t"
18406 yyy="$yyy $sizetype int long unsigned"
18407 for xxx in $yyy; do
18408 case "$socksizetype" in
18409 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
18410 case "$usesocks" in
18412 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
18413 echo "Your system accepts '$xxx *' for the last argument of accept()."
18414 socksizetype="$xxx"
18417 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
18418 echo "Your system accepts '$xxx *' for the last argument of accept()."
18419 socksizetype="$xxx"
18426 : In case none of those worked, prompt the user.
18427 case "$socksizetype" in
18428 '') rp='What is the type for socket address structure sizes?'
18435 *) : no sockets, so pick relatively harmless default
18440 : see what type is used for signed size_t
18441 set ssize_t ssizetype int stdio.h sys/types.h
18446 #include <sys/types.h>
18447 #define Size_t $sizetype
18448 #define SSize_t $dflt
18451 if (sizeof(Size_t) == sizeof(SSize_t))
18453 else if (sizeof(Size_t) == sizeof(int))
18462 if eval $compile_ok && $run ./try > /dev/null; then
18463 ssizetype=`$run ./try`
18464 echo "I'll be using $ssizetype for functions returning a byte count." >&4
18467 Help! I can't compile and run the ssize_t test program: please enlighten me!
18468 (This is probably a misconfiguration in your system or libraries, and
18469 you really ought to fix it. Still, I'll try anyway.)
18471 I need a type that is the same size as $sizetype, but is guaranteed to
18472 be signed. Common values are ssize_t, int and long.
18475 rp="What signed type is the same size as $sizetype?"
18481 : see what type of char stdio uses.
18483 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
18484 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
18485 echo "Your stdio uses unsigned chars." >&4
18486 stdchar="unsigned char"
18488 echo "Your stdio uses signed chars." >&4
18495 : see what type uids are declared as in the kernel
18497 echo "Looking for the type for user ids returned by getuid()."
18498 set uid_t uidtype xxx stdio.h sys/types.h
18502 xxx=`./findhdr sys/user.h`
18503 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18505 unsigned) dflt="$1 $2" ;;
18509 *) dflt="$uidtype";;
18512 uid_t) echo "uid_t found." ;;
18513 *) rp="What is the type for user ids returned by getuid()?"
18521 *_t) zzz="$uidtype" ;;
18524 echo "Checking the size of $zzz..." >&4
18526 #include <sys/types.h>
18529 printf("%d\n", (int)sizeof($uidtype));
18534 if eval $compile_ok; then
18538 echo "(I can't execute the test program--guessing $uidsize.)" >&4
18541 echo "Your $zzz is $uidsize bytes long."
18546 echo "(I can't compile the test program--guessing $uidsize.)" >&4
18551 *_t) zzz="$uidtype" ;;
18554 echo "Checking the sign of $zzz..." >&4
18556 #include <sys/types.h>
18567 if eval $compile; then
18571 echo "(I can't execute the test program--guessing unsigned.)" >&4
18575 1) echo "Your $zzz is unsigned." ;;
18576 -1) echo "Your $zzz is signed." ;;
18582 echo "(I can't compile the test program--guessing unsigned.)" >&4
18588 $echo "Checking the format string to be used for uids..." >&4
18591 -1) if $test X"$uidsize" = X"$ivsize"; then
18592 uidformat="$ivdformat"
18594 if $test X"$uidsize" = X"$longsize"; then
18597 if $test X"$uidsize" = X"$intsize"; then
18600 if $test X"$uidsize" = X"$shortsize"; then
18607 *) if $test X"$uidsize" = X"$uvsize"; then
18608 uidformat="$uvuformat"
18610 if $test X"$uidsize" = X"$longsize"; then
18613 if $test X"$uidsize" = X"$intsize"; then
18616 if $test X"$uidsize" = X"$shortsize"; then
18625 : determine compiler compiler
18634 if $test -f "$byacc$_exe"; then
18636 comp="byacc or $comp"
18638 if $test -f "$bison$_exe"; then
18639 comp="$comp or bison -y"
18641 rp="Which compiler compiler ($comp) shall I use?"
18650 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
18656 : see if this is a fp.h system
18660 : see if this is a fp_class.h system
18661 set fp_class.h i_fp_class
18664 : see if this is a ieeefp.h system
18665 case "$i_ieeefp" in
18666 '' ) set ieeefp.h i_ieeefp
18671 : see if this is a libutil.h system
18672 set libutil.h i_libutil
18675 : see if mach cthreads are available
18676 if test "X$usethreads" = "X$define"; then
18677 set mach/cthreads.h i_machcthr
18680 i_machcthr="$undef"
18685 : see if this is a math.h system
18689 : see if this is a mntent.h system
18690 set mntent.h i_mntent
18693 : see if ndbm.h is available
18699 # Some Linux distributions such as RedHat 7.1 put the
18700 # ndbm.h header in /usr/include/gdbm/ndbm.h.
18701 if $test -f /usr/include/gdbm/ndbm.h; then
18702 echo '<gdbm/ndbm.h> found.'
18703 ccflags="$ccflags -I/usr/include/gdbm"
18704 cppflags="$cppflags -I/usr/include/gdbm"
18712 : see if dbm_open exists
18713 set dbm_open d_dbm_open
18715 case "$d_dbm_open" in
18718 echo "We won't be including <ndbm.h>"
18727 : see if net/errno.h is available
18729 set net/errno.h val
18732 : Unfortunately, it causes problems on some systems. Arrgh.
18735 cat > try.c <<'EOM'
18738 #include <net/errno.h>
18744 if $cc $ccflags -c try.c >/dev/null 2>&1; then
18745 echo "We'll be including <net/errno.h>." >&4
18747 echo "We won't be including <net/errno.h>." >&4
18756 : see if netinet/tcp.h is available
18757 set netinet/tcp.h i_netinettcp
18760 : see if this is a poll.h system
18764 : see if this is a prot.h system
18769 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
18770 $cat <<'EOSH' > Cppsym.know
18771 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
18772 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
18773 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
18774 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
18775 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
18776 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
18777 bull c cadmus clipper CMU COFF COMPILER_VERSION
18778 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
18779 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
18780 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
18781 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
18783 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
18784 H3050R H3050RX hbullx20 hcx host_mips
18785 hp200 hp300 hp700 HP700 hp800 hp9000
18786 hp9000s200 hp9000s300 hp9000s400 hp9000s500
18787 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
18788 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
18789 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
18790 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
18791 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
18792 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
18793 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
18794 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
18795 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
18796 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
18797 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
18798 MATH_HAS_NO_SIDE_EFFECTS
18799 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
18800 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
18801 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
18802 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
18803 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
18804 NetBSD news1500 news1700 news1800 news1900 news3700
18805 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
18806 ns32016 ns32332 ns32k nsc32000
18807 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
18808 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
18809 pc532 pdp11 PGC PIC plexus PORTAR posix
18810 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
18811 POSIX_C_SOURCE POSIX_SOURCE POWER
18812 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
18813 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
18814 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
18815 sony sony_news sonyrisc sparc sparclite spectrum
18816 stardent stdc STDC_EXT stratos sun sun3 sun386
18817 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
18818 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
18819 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
18820 sysV68 sysV88 Tek4132 Tek4300 titan
18821 TM3200 TM5400 TM5600
18822 tower tower32 tower32_200 tower32_600 tower32_700
18823 tower32_800 tower32_850 tss
18824 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
18825 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
18826 unix UNIX95 UNIX99 unixpc unos
18827 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
18828 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
18829 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
18831 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
18832 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
18833 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
18836 # Maybe put other stuff here too.
18837 cat <<EOSH >>Cppsym.know
18840 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
18841 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
18842 $cat Cppsym.know > Cppsym.c
18843 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
18844 $rm -f Cppsym.a Cppsym.b Cppsym.c
18845 cat <<EOSH > Cppsym
18847 if $test \$# -gt 0; then
18848 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
18849 if $test -s Cppsym.got; then
18856 $tr " " "$trnl" | ./Cppsym.try
18862 cat <<EOSH > Cppsym.try
18864 cat <<'EOCP' > try.c
18870 cat <<'EOSH' >> Cppsym.try
18872 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
18873 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
18874 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
18875 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
18877 echo 'return 0;}' >> try.c
18879 cat <<EOSH >> Cppsym.try
18881 case "$osname-$gccversion" in
18882 irix-) ccflags="\$ccflags -woff 1178" ;;
18883 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
18885 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
18887 chmod +x Cppsym.try
18888 $eunicefix Cppsym.try
18889 ./Cppsym < Cppsym.know > Cppsym.true
18890 : now check the C compiler for additional symbols
18891 postprocess_cc_v=''
18893 aix) postprocess_cc_v="|$tr , ' '" ;;
18900 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
18903 -D*) echo "\$i" | $sed 's/^-D//';;
18904 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
18909 postprocess_cc_v=''
18912 ./ccsym > ccsym1.raw
18913 if $test -s ccsym1.raw; then
18914 $sort ccsym1.raw | $uniq >ccsym.raw
18916 mv ccsym1.raw ccsym.raw
18919 $awk '/\=/ { print $0; next }
18920 { print $0"=1" }' ccsym.raw >ccsym.list
18921 $awk '/\=/ { print $0; next }
18922 { print $0"=1" }' Cppsym.true >ccsym.true
18923 $comm -13 ccsym.true ccsym.list >ccsym.own
18924 $comm -12 ccsym.true ccsym.list >ccsym.com
18925 $comm -23 ccsym.true ccsym.list >ccsym.cpp
18927 if $test -z ccsym.raw; then
18928 echo "Your C compiler doesn't seem to define any symbols!" >&4
18930 echo "However, your C preprocessor defines the following symbols:"
18933 cppsymbols=`$cat Cppsym.true`
18934 cppsymbols=`echo $cppsymbols`
18935 cppccsymbols="$cppsymbols"
18937 if $test -s ccsym.com; then
18938 echo "Your C compiler and pre-processor define these symbols:"
18939 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
18942 cppccsymbols=`$cat ccsym.com`
18943 cppccsymbols=`echo $cppccsymbols`
18944 $test "$silent" || sleep 1
18946 if $test -s ccsym.cpp; then
18947 $test "$also" && echo " "
18948 echo "Your C pre-processor ${also}defines the following symbols:"
18949 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
18951 cppsymbols=`$cat ccsym.cpp`
18952 cppsymbols=`echo $cppsymbols`
18953 $test "$silent" || sleep 1
18955 if $test -s ccsym.own; then
18956 $test "$also" && echo " "
18957 echo "Your C compiler ${also}defines the following cpp symbols:"
18958 $sed -e 's/\(..*\)=1/\1/' ccsym.own
18959 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
18960 ccsymbols=`$cat ccsym.own`
18961 ccsymbols=`echo $ccsymbols`
18962 $test "$silent" || sleep 1
18966 : see if this is a termio system
18970 if $test `./findhdr termios.h`; then
18971 set tcsetattr i_termios
18977 "$define") echo "You have POSIX termios.h... good!" >&4;;
18978 *) if ./Cppsym pyr; then
18979 case "`/bin/universe`" in
18980 ucb) if $test `./findhdr sgtty.h`; then
18982 echo "<sgtty.h> found." >&4
18984 echo "System is pyramid with BSD universe."
18985 echo "<sgtty.h> not found--you could have problems." >&4
18987 *) if $test `./findhdr termio.h`; then
18989 echo "<termio.h> found." >&4
18991 echo "System is pyramid with USG universe."
18992 echo "<termio.h> not found--you could have problems." >&4
18996 if $test `./findhdr termio.h`; then
18997 echo "<termio.h> found." >&4
18999 elif $test `./findhdr sgtty.h`; then
19000 echo "<sgtty.h> found." >&4
19003 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
19006 if $test `./findhdr sgtty.h`; then
19007 echo "<sgtty.h> found." >&4
19009 elif $test `./findhdr termio.h`; then
19010 echo "<termio.h> found." >&4
19013 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
19017 set i_termio; eval $setvar
19018 val=$val2; set i_sgtty; eval $setvar
19019 val=$val3; set i_termios; eval $setvar
19021 : see if stddef is available
19022 set stddef.h i_stddef
19025 : see if this is a sunmath.h system
19026 set sunmath.h i_sunmath
19029 : see if sys/access.h is available
19030 set sys/access.h i_sysaccess
19033 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
19034 set sys/filio.h i_sysfilio
19037 if $test `./findhdr sys/ioctl.h`; then
19039 echo '<sys/ioctl.h> found.' >&4
19042 if $test $i_sysfilio = "$define"; then
19043 echo '<sys/ioctl.h> NOT found.' >&4
19045 $test $i_sgtty = "$define" && xxx="sgtty.h"
19046 $test $i_termio = "$define" && xxx="termio.h"
19047 $test $i_termios = "$define" && xxx="termios.h"
19048 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
19054 : see if socket ioctl defs are in sys/sockio.h
19056 xxx=`./findhdr sys/sockio.h`
19057 if $test "$xxx"; then
19058 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
19060 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
19063 echo "No socket ioctls found in <sys/sockio.h>." >&4
19068 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
19075 : see if this is a syslog.h system
19076 set syslog.h i_syslog
19080 : see if this is a sys/mode.h system
19081 set sys/mode.h i_sysmode
19084 : see if sys/resource.h has to be included
19085 set sys/resource.h i_sysresrc
19088 : see if sys/security.h is available
19089 set sys/security.h i_syssecrt
19092 : see if this is a sys/statvfs.h system
19093 set sys/statvfs.h i_sysstatvfs
19096 : see if this is a sys/un.h system
19097 set sys/un.h i_sysun
19101 : see if this is a sys/utsname.h system
19102 set sys/utsname.h i_sysutsname
19105 : see if this is a syswait system
19106 set sys/wait.h i_syswait
19109 : see if this is a ustat.h system
19110 set ustat.h i_ustat
19113 : see if this is an utime system
19114 set utime.h i_utime
19117 : see if this is a values.h system
19118 set values.h i_values
19121 : see if this is a vfork system
19124 set vfork.h i_vfork
19132 : see if gdbm.h is available
19137 : see if gdbm_open exists
19138 set gdbm_open d_gdbm_open
19140 case "$d_gdbm_open" in
19143 echo "We won't be including <gdbm.h>"
19153 echo "Looking for extensions..." >&4
19154 : If we are using the old config.sh, known_extensions may contain
19155 : old or inaccurate or duplicate values.
19156 known_extensions=''
19157 nonxs_extensions=''
19158 : We do not use find because it might not be available.
19159 : We do not just use MANIFEST because the user may have dropped
19160 : some additional extensions into the source tree and expect them
19163 : Function to recursively find available extensions, ignoring DynaLoader
19164 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
19168 DynaLoader|dynaload) ;;
19170 if $test -f $xxx/$xxx.xs; then
19171 known_extensions="$known_extensions $1$xxx";
19172 elif $test -f $xxx/Makefile.PL; then
19173 nonxs_extensions="$nonxs_extensions $1$xxx";
19175 if $test -d $xxx -a $# -lt 10; then
19178 eval $find_extensions;
19190 eval $find_extensions
19191 # Special case: Add in threads/shared since it is not picked up by the
19192 # recursive find above (and adding in general recursive finding breaks
19193 # SDBM_File/sdbm). A.D. 10/25/2001.
19194 known_extensions="$known_extensions threads/shared"
19195 set X $nonxs_extensions
19197 nonxs_extensions="$*"
19198 set X $known_extensions
19200 known_extensions="$*"
19203 : Now see which are supported on this system.
19205 for xxx in $known_extensions ; do
19209 $define) avail_ext="$avail_ext $xxx" ;;
19212 GDBM_File|gdbm_fil)
19214 $define) avail_ext="$avail_ext $xxx" ;;
19217 I18N/Langinfo|i18n_lan)
19218 case "$i_langinfo$d_nl_langinfo" in
19219 $define$define) avail_ext="$avail_ext $xxx" ;;
19222 NDBM_File|ndbm_fil)
19225 case "$osname-$use64bitint" in
19226 cygwin-*|hpux-define)
19228 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
19231 *) avail_ext="$avail_ext $xxx" ;;
19236 ODBM_File|odbm_fil)
19237 case "${i_dbm}${i_rpcsvcdbm}" in
19239 case "$osname-$use64bitint" in
19240 cygwin-*|hpux-define)
19242 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
19245 *) avail_ext="$avail_ext $xxx" ;;
19251 case "$useposix" in
19252 true|define|y) avail_ext="$avail_ext $xxx" ;;
19256 case "$useopcode" in
19257 true|define|y) avail_ext="$avail_ext $xxx" ;;
19261 case "$d_socket" in
19264 beos) ;; # not unless BONE
19265 *) avail_ext="$avail_ext $xxx" ;;
19270 Sys/Syslog|sys/syslog)
19271 : XXX syslog requires socket
19272 case "$d_socket" in
19273 true|$define|y) avail_ext="$avail_ext $xxx" ;;
19277 case "$usethreads" in
19279 case "$useithreads" in
19280 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
19284 threads|threads/shared)
19285 # threads and threads::shared are special cases.
19286 # To stop people from asking "Perl 5.8.0 was supposed
19287 # to have this new fancy threads implementation but my
19288 # perl doesn't have it" and from people trying to
19289 # (re)install the threads module using CPAN.pm and
19290 # CPAN.pm then offering to reinstall Perl 5.8.0,
19291 # the threads.pm and threads/shared.pm will always be
19292 # there, croaking informatively ("you need to rebuild
19293 # all of Perl with threads, sorry") when threads haven't
19294 # been compiled in.
19296 avail_ext="$avail_ext $xxx"
19299 : XXX Do we need a useipcsysv variable here
19300 case "${d_msg}${d_sem}${d_shm}" in
19301 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
19304 *) avail_ext="$avail_ext $xxx"
19313 : Now see which nonxs extensions are supported on this system.
19314 : For now assume all are.
19316 for xxx in $nonxs_extensions ; do
19318 *) nonxs_ext="$nonxs_ext $xxx"
19330 A number of extensions are supplied with $package. You may choose to
19331 compile these extensions for dynamic loading (the default), compile
19332 them into the $package executable (static loading), or not include
19333 them at all. Answer "none" to include no extensions.
19334 Note that DynaLoader is always built and need not be mentioned here.
19337 case "$dynamic_ext" in
19338 '') dflt="$avail_ext" ;;
19339 *) dflt="$dynamic_ext"
19340 # Perhaps we are reusing an old out-of-date config.sh.
19343 if test X"$dynamic_ext" != X"$avail_ext"; then
19345 NOTICE: Your previous config.sh list may be incorrect.
19346 The extensions now available to you are
19348 but the default list from your previous config.sh is
19360 rp="What extensions do you wish to load dynamically?"
19363 none) dynamic_ext=' ' ;;
19364 *) dynamic_ext="$ans" ;;
19367 case "$static_ext" in
19369 : Exclude those already listed in dynamic linking
19371 for xxx in $avail_ext; do
19372 case " $dynamic_ext " in
19374 *) dflt="$dflt $xxx" ;;
19381 *) dflt="$static_ext"
19388 rp="What extensions do you wish to load statically?"
19391 none) static_ext=' ' ;;
19392 *) static_ext="$ans" ;;
19397 A number of extensions are supplied with $package. Answer "none"
19398 to include no extensions.
19399 Note that DynaLoader is always built and need not be mentioned here.
19402 case "$static_ext" in
19403 '') dflt="$avail_ext" ;;
19404 *) dflt="$static_ext"
19405 # Perhaps we are reusing an old out-of-date config.sh.
19408 if test X"$static_ext" != X"$avail_ext"; then
19410 NOTICE: Your previous config.sh list may be incorrect.
19411 The extensions now available to you are
19413 but the default list from your previous config.sh is
19422 : Exclude those that are not xs extensions
19426 rp="What extensions do you wish to include?"
19429 none) static_ext=' ' ;;
19430 *) static_ext="$ans" ;;
19435 # Encode is a special case. If we are building Encode as a static
19436 # extension, we need to explicitly list its subextensions as well.
19437 # For other nested extensions, this is handled automatically by
19438 # the appropriate Makefile.PL.
19439 case " $static_ext " in
19440 *" Encode "*) # Add the subextensions of Encode
19442 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
19443 static_ext="$static_ext Encode/$xxx"
19449 set X $dynamic_ext $static_ext $nonxs_ext
19453 : Remove libraries needed only for extensions
19454 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
19455 : The exception is SunOS 4.x, which needs them.
19456 case "${osname}X${osvers}" in
19460 *) case "$usedl" in
19461 $define|true|[yY]*)
19462 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
19466 *) perllibs="$libs"
19472 : Remove build directory name from cppstdin so it can be used from
19473 : either the present location or the final installed location.
19475 : Get out of the UU directory to get correct path name.
19477 case "$cppstdin" in
19479 echo "Stripping down cppstdin path name"
19485 : end of configuration questions
19487 echo "End of configuration questions."
19490 : back to where it started
19491 if test -d ../UU; then
19495 : configuration may be patched via a 'config.arch' file
19496 if $test -f config.arch; then
19497 echo "I see a config.arch file, loading it."
19501 : configuration may be patched via a 'config.over' file
19502 if $test -f config.over; then
19505 rp='I see a config.over file. Do you wish to load it?'
19508 n*) echo "OK, I'll ignore it.";;
19510 echo "Configuration override changes have been loaded."
19515 : in case they want portability, strip down executable paths
19516 case "$d_portable" in
19519 echo "Stripping down executable paths..." >&4
19520 for file in $loclist $trylist; do
19522 eval $file=`basename $temp`
19527 : create config.sh file
19529 echo "Creating config.sh..." >&4
19530 $spitshell <<EOT >config.sh
19533 # This file was produced by running the Configure script. It holds all the
19534 # definitions figured out by Configure. Should you modify one of these values,
19535 # do not forget to propagate your changes by running "Configure -der". You may
19536 # instead choose to run each of the .SH files by yourself, or "Configure -S".
19539 # Package name : $package
19540 # Source directory : $src
19541 # Configuration time: $cf_time
19542 # Configured by : $cf_by
19543 # Target system : $myuname
19553 Revision='$Revision'
19561 alignbytes='$alignbytes'
19562 ansi2knr='$ansi2knr'
19563 aphostname='$aphostname'
19564 api_revision='$api_revision'
19565 api_subversion='$api_subversion'
19566 api_version='$api_version'
19567 api_versionstring='$api_versionstring'
19570 archlibexp='$archlibexp'
19571 archname64='$archname64'
19572 archname='$archname'
19573 archobjs='$archobjs'
19574 asctime_r_proto='$asctime_r_proto'
19582 byteorder='$byteorder'
19584 castflags='$castflags'
19587 cccdlflags='$cccdlflags'
19588 ccdlflags='$ccdlflags'
19590 ccflags_uselargefiles='$ccflags_uselargefiles'
19592 ccsymbols='$ccsymbols'
19593 ccversion='$ccversion'
19595 cf_email='$cf_email'
19597 charsize='$charsize'
19601 clocktype='$clocktype'
19603 compress='$compress'
19604 contains='$contains'
19608 cpp_stuff='$cpp_stuff'
19609 cppccsymbols='$cppccsymbols'
19610 cppflags='$cppflags'
19612 cppminus='$cppminus'
19614 cppstdin='$cppstdin'
19615 cppsymbols='$cppsymbols'
19616 crypt_r_proto='$crypt_r_proto'
19617 cryptlib='$cryptlib'
19619 ctermid_r_proto='$ctermid_r_proto'
19620 ctime_r_proto='$ctime_r_proto'
19621 d_Gconvert='$d_Gconvert'
19622 d_PRIEUldbl='$d_PRIEUldbl'
19623 d_PRIFUldbl='$d_PRIFUldbl'
19624 d_PRIGUldbl='$d_PRIGUldbl'
19625 d_PRIXU64='$d_PRIXU64'
19626 d_PRId64='$d_PRId64'
19627 d_PRIeldbl='$d_PRIeldbl'
19628 d_PRIfldbl='$d_PRIfldbl'
19629 d_PRIgldbl='$d_PRIgldbl'
19630 d_PRIi64='$d_PRIi64'
19631 d_PRIo64='$d_PRIo64'
19632 d_PRIu64='$d_PRIu64'
19633 d_PRIx64='$d_PRIx64'
19634 d_SCNfldbl='$d_SCNfldbl'
19635 d__fwalk='$d__fwalk'
19636 d_access='$d_access'
19637 d_accessx='$d_accessx'
19639 d_archlib='$d_archlib'
19640 d_asctime_r='$d_asctime_r'
19643 d_attribut='$d_attribut'
19647 d_bsdgetpgrp='$d_bsdgetpgrp'
19648 d_bsdsetpgrp='$d_bsdsetpgrp'
19650 d_casti32='$d_casti32'
19651 d_castneg='$d_castneg'
19652 d_charvspr='$d_charvspr'
19654 d_chroot='$d_chroot'
19655 d_chsize='$d_chsize'
19657 d_closedir='$d_closedir'
19658 d_cmsghdr_s='$d_cmsghdr_s'
19661 d_crypt_r='$d_crypt_r'
19663 d_ctermid_r='$d_ctermid_r'
19664 d_ctime_r='$d_ctime_r'
19665 d_cuserid='$d_cuserid'
19666 d_dbl_dig='$d_dbl_dig'
19667 d_dbminitproto='$d_dbminitproto'
19668 d_difftime='$d_difftime'
19670 d_dirnamlen='$d_dirnamlen'
19671 d_dlerror='$d_dlerror'
19672 d_dlopen='$d_dlopen'
19673 d_dlsymun='$d_dlsymun'
19674 d_dosuid='$d_dosuid'
19675 d_drand48_r='$d_drand48_r'
19676 d_drand48proto='$d_drand48proto'
19678 d_eaccess='$d_eaccess'
19679 d_endgrent='$d_endgrent'
19680 d_endgrent_r='$d_endgrent_r'
19681 d_endhent='$d_endhent'
19682 d_endhostent_r='$d_endhostent_r'
19683 d_endnent='$d_endnent'
19684 d_endnetent_r='$d_endnetent_r'
19685 d_endpent='$d_endpent'
19686 d_endprotoent_r='$d_endprotoent_r'
19687 d_endpwent='$d_endpwent'
19688 d_endpwent_r='$d_endpwent_r'
19689 d_endsent='$d_endsent'
19690 d_endservent_r='$d_endservent_r'
19691 d_eofnblk='$d_eofnblk'
19692 d_eunice='$d_eunice'
19693 d_fchdir='$d_fchdir'
19694 d_fchmod='$d_fchmod'
19695 d_fchown='$d_fchown'
19697 d_fcntl_can_lock='$d_fcntl_can_lock'
19698 d_fd_macros='$d_fd_macros'
19699 d_fd_set='$d_fd_set'
19700 d_fds_bits='$d_fds_bits'
19701 d_fgetpos='$d_fgetpos'
19702 d_finite='$d_finite'
19703 d_finitel='$d_finitel'
19704 d_flexfnam='$d_flexfnam'
19706 d_flockproto='$d_flockproto'
19708 d_fp_class='$d_fp_class'
19709 d_fpathconf='$d_fpathconf'
19710 d_fpclass='$d_fpclass'
19711 d_fpclassify='$d_fpclassify'
19712 d_fpclassl='$d_fpclassl'
19713 d_fpos64_t='$d_fpos64_t'
19714 d_frexpl='$d_frexpl'
19715 d_fs_data_s='$d_fs_data_s'
19716 d_fseeko='$d_fseeko'
19717 d_fsetpos='$d_fsetpos'
19718 d_fstatfs='$d_fstatfs'
19719 d_fstatvfs='$d_fstatvfs'
19721 d_ftello='$d_ftello'
19723 d_getcwd='$d_getcwd'
19724 d_getespwnam='$d_getespwnam'
19725 d_getfsstat='$d_getfsstat'
19726 d_getgrent='$d_getgrent'
19727 d_getgrent_r='$d_getgrent_r'
19728 d_getgrgid_r='$d_getgrgid_r'
19729 d_getgrnam_r='$d_getgrnam_r'
19730 d_getgrps='$d_getgrps'
19731 d_gethbyaddr='$d_gethbyaddr'
19732 d_gethbyname='$d_gethbyname'
19733 d_gethent='$d_gethent'
19734 d_gethname='$d_gethname'
19735 d_gethostbyaddr_r='$d_gethostbyaddr_r'
19736 d_gethostbyname_r='$d_gethostbyname_r'
19737 d_gethostent_r='$d_gethostent_r'
19738 d_gethostprotos='$d_gethostprotos'
19739 d_getitimer='$d_getitimer'
19740 d_getlogin='$d_getlogin'
19741 d_getlogin_r='$d_getlogin_r'
19742 d_getmnt='$d_getmnt'
19743 d_getmntent='$d_getmntent'
19744 d_getnbyaddr='$d_getnbyaddr'
19745 d_getnbyname='$d_getnbyname'
19746 d_getnent='$d_getnent'
19747 d_getnetbyaddr_r='$d_getnetbyaddr_r'
19748 d_getnetbyname_r='$d_getnetbyname_r'
19749 d_getnetent_r='$d_getnetent_r'
19750 d_getnetprotos='$d_getnetprotos'
19751 d_getpagsz='$d_getpagsz'
19752 d_getpbyname='$d_getpbyname'
19753 d_getpbynumber='$d_getpbynumber'
19754 d_getpent='$d_getpent'
19755 d_getpgid='$d_getpgid'
19756 d_getpgrp2='$d_getpgrp2'
19757 d_getpgrp='$d_getpgrp'
19758 d_getppid='$d_getppid'
19759 d_getprior='$d_getprior'
19760 d_getprotobyname_r='$d_getprotobyname_r'
19761 d_getprotobynumber_r='$d_getprotobynumber_r'
19762 d_getprotoent_r='$d_getprotoent_r'
19763 d_getprotoprotos='$d_getprotoprotos'
19764 d_getprpwnam='$d_getprpwnam'
19765 d_getpwent='$d_getpwent'
19766 d_getpwent_r='$d_getpwent_r'
19767 d_getpwnam_r='$d_getpwnam_r'
19768 d_getpwuid_r='$d_getpwuid_r'
19769 d_getsbyname='$d_getsbyname'
19770 d_getsbyport='$d_getsbyport'
19771 d_getsent='$d_getsent'
19772 d_getservbyname_r='$d_getservbyname_r'
19773 d_getservbyport_r='$d_getservbyport_r'
19774 d_getservent_r='$d_getservent_r'
19775 d_getservprotos='$d_getservprotos'
19776 d_getspnam='$d_getspnam'
19777 d_getspnam_r='$d_getspnam_r'
19778 d_gettimeod='$d_gettimeod'
19779 d_gmtime_r='$d_gmtime_r'
19780 d_gnulibc='$d_gnulibc'
19781 d_grpasswd='$d_grpasswd'
19782 d_hasmntopt='$d_hasmntopt'
19785 d_inetaton='$d_inetaton'
19786 d_int64_t='$d_int64_t'
19787 d_isascii='$d_isascii'
19788 d_isfinite='$d_isfinite'
19791 d_isnanl='$d_isnanl'
19792 d_killpg='$d_killpg'
19793 d_lchown='$d_lchown'
19794 d_ldbl_dig='$d_ldbl_dig'
19796 d_localtime_r='$d_localtime_r'
19797 d_locconv='$d_locconv'
19799 d_longdbl='$d_longdbl'
19800 d_longlong='$d_longlong'
19801 d_lseekproto='$d_lseekproto'
19803 d_madvise='$d_madvise'
19805 d_mbstowcs='$d_mbstowcs'
19806 d_mbtowc='$d_mbtowc'
19807 d_memchr='$d_memchr'
19808 d_memcmp='$d_memcmp'
19809 d_memcpy='$d_memcpy'
19810 d_memmove='$d_memmove'
19811 d_memset='$d_memset'
19813 d_mkdtemp='$d_mkdtemp'
19814 d_mkfifo='$d_mkfifo'
19815 d_mkstemp='$d_mkstemp'
19816 d_mkstemps='$d_mkstemps'
19817 d_mktime='$d_mktime'
19820 d_modfl_pow32_bug='$d_modfl_pow32_bug'
19821 d_mprotect='$d_mprotect'
19823 d_msg_ctrunc='$d_msg_ctrunc'
19824 d_msg_dontroute='$d_msg_dontroute'
19825 d_msg_oob='$d_msg_oob'
19826 d_msg_peek='$d_msg_peek'
19827 d_msg_proxy='$d_msg_proxy'
19828 d_msgctl='$d_msgctl'
19829 d_msgget='$d_msgget'
19830 d_msghdr_s='$d_msghdr_s'
19831 d_msgrcv='$d_msgrcv'
19832 d_msgsnd='$d_msgsnd'
19834 d_munmap='$d_munmap'
19835 d_mymalloc='$d_mymalloc'
19837 d_nl_langinfo='$d_nl_langinfo'
19838 d_nv_preserves_uv='$d_nv_preserves_uv'
19839 d_off64_t='$d_off64_t'
19840 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
19841 d_oldpthreads='$d_oldpthreads'
19842 d_oldsock='$d_oldsock'
19844 d_pathconf='$d_pathconf'
19846 d_perl_otherlibdirs='$d_perl_otherlibdirs'
19847 d_phostname='$d_phostname'
19850 d_portable='$d_portable'
19851 d_procselfexe='$d_procselfexe'
19852 d_pthread_atfork='$d_pthread_atfork'
19853 d_pthread_yield='$d_pthread_yield'
19855 d_pwchange='$d_pwchange'
19856 d_pwclass='$d_pwclass'
19857 d_pwcomment='$d_pwcomment'
19858 d_pwexpire='$d_pwexpire'
19859 d_pwgecos='$d_pwgecos'
19860 d_pwpasswd='$d_pwpasswd'
19861 d_pwquota='$d_pwquota'
19864 d_random_r='$d_random_r'
19865 d_readdir64_r='$d_readdir64_r'
19866 d_readdir='$d_readdir'
19867 d_readdir_r='$d_readdir_r'
19868 d_readlink='$d_readlink'
19870 d_recvmsg='$d_recvmsg'
19871 d_rename='$d_rename'
19872 d_rewinddir='$d_rewinddir'
19874 d_safebcpy='$d_safebcpy'
19875 d_safemcpy='$d_safemcpy'
19876 d_sanemcmp='$d_sanemcmp'
19877 d_sbrkproto='$d_sbrkproto'
19878 d_sched_yield='$d_sched_yield'
19879 d_scm_rights='$d_scm_rights'
19880 d_seekdir='$d_seekdir'
19881 d_select='$d_select'
19883 d_semctl='$d_semctl'
19884 d_semctl_semid_ds='$d_semctl_semid_ds'
19885 d_semctl_semun='$d_semctl_semun'
19886 d_semget='$d_semget'
19888 d_sendmsg='$d_sendmsg'
19889 d_setegid='$d_setegid'
19890 d_seteuid='$d_seteuid'
19891 d_setgrent='$d_setgrent'
19892 d_setgrent_r='$d_setgrent_r'
19893 d_setgrps='$d_setgrps'
19894 d_sethent='$d_sethent'
19895 d_sethostent_r='$d_sethostent_r'
19896 d_setitimer='$d_setitimer'
19897 d_setlinebuf='$d_setlinebuf'
19898 d_setlocale='$d_setlocale'
19899 d_setlocale_r='$d_setlocale_r'
19900 d_setnent='$d_setnent'
19901 d_setnetent_r='$d_setnetent_r'
19902 d_setpent='$d_setpent'
19903 d_setpgid='$d_setpgid'
19904 d_setpgrp2='$d_setpgrp2'
19905 d_setpgrp='$d_setpgrp'
19906 d_setprior='$d_setprior'
19907 d_setproctitle='$d_setproctitle'
19908 d_setprotoent_r='$d_setprotoent_r'
19909 d_setpwent='$d_setpwent'
19910 d_setpwent_r='$d_setpwent_r'
19911 d_setregid='$d_setregid'
19912 d_setresgid='$d_setresgid'
19913 d_setresuid='$d_setresuid'
19914 d_setreuid='$d_setreuid'
19915 d_setrgid='$d_setrgid'
19916 d_setruid='$d_setruid'
19917 d_setsent='$d_setsent'
19918 d_setservent_r='$d_setservent_r'
19919 d_setsid='$d_setsid'
19920 d_setvbuf='$d_setvbuf'
19924 d_shmatprototype='$d_shmatprototype'
19925 d_shmctl='$d_shmctl'
19927 d_shmget='$d_shmget'
19928 d_sigaction='$d_sigaction'
19929 d_sigprocmask='$d_sigprocmask'
19930 d_sigsetjmp='$d_sigsetjmp'
19931 d_sockatmark='$d_sockatmark'
19932 d_sockatmarkproto='$d_sockatmarkproto'
19933 d_socket='$d_socket'
19934 d_socklen_t='$d_socklen_t'
19935 d_sockpair='$d_sockpair'
19936 d_socks5_init='$d_socks5_init'
19938 d_srand48_r='$d_srand48_r'
19939 d_srandom_r='$d_srandom_r'
19940 d_sresgproto='$d_sresgproto'
19941 d_sresuproto='$d_sresuproto'
19942 d_statblks='$d_statblks'
19943 d_statfs_f_flags='$d_statfs_f_flags'
19944 d_statfs_s='$d_statfs_s'
19945 d_statvfs='$d_statvfs'
19946 d_stdio_cnt_lval='$d_stdio_cnt_lval'
19947 d_stdio_ptr_lval='$d_stdio_ptr_lval'
19948 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
19949 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
19950 d_stdio_stream_array='$d_stdio_stream_array'
19951 d_stdiobase='$d_stdiobase'
19952 d_stdstdio='$d_stdstdio'
19953 d_strchr='$d_strchr'
19954 d_strcoll='$d_strcoll'
19955 d_strctcpy='$d_strctcpy'
19956 d_strerrm='$d_strerrm'
19957 d_strerror='$d_strerror'
19958 d_strerror_r='$d_strerror_r'
19959 d_strftime='$d_strftime'
19960 d_strtod='$d_strtod'
19961 d_strtol='$d_strtol'
19962 d_strtold='$d_strtold'
19963 d_strtoll='$d_strtoll'
19964 d_strtoq='$d_strtoq'
19965 d_strtoul='$d_strtoul'
19966 d_strtoull='$d_strtoull'
19967 d_strtouq='$d_strtouq'
19968 d_strxfrm='$d_strxfrm'
19969 d_suidsafe='$d_suidsafe'
19970 d_symlink='$d_symlink'
19971 d_syscall='$d_syscall'
19972 d_syscallproto='$d_syscallproto'
19973 d_sysconf='$d_sysconf'
19974 d_sysernlst='$d_sysernlst'
19975 d_syserrlst='$d_syserrlst'
19976 d_system='$d_system'
19977 d_tcgetpgrp='$d_tcgetpgrp'
19978 d_tcsetpgrp='$d_tcsetpgrp'
19979 d_telldir='$d_telldir'
19980 d_telldirproto='$d_telldirproto'
19983 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
19984 d_tm_tm_zone='$d_tm_tm_zone'
19985 d_tmpnam_r='$d_tmpnam_r'
19986 d_truncate='$d_truncate'
19987 d_ttyname_r='$d_ttyname_r'
19988 d_tzname='$d_tzname'
19989 d_u32align='$d_u32align'
19990 d_ualarm='$d_ualarm'
19993 d_union_semun='$d_union_semun'
19994 d_unordered='$d_unordered'
19995 d_usleep='$d_usleep'
19996 d_usleepproto='$d_usleepproto'
19998 d_vendorarch='$d_vendorarch'
19999 d_vendorbin='$d_vendorbin'
20000 d_vendorlib='$d_vendorlib'
20002 d_void_closedir='$d_void_closedir'
20003 d_voidsig='$d_voidsig'
20004 d_voidtty='$d_voidtty'
20005 d_volatile='$d_volatile'
20006 d_vprintf='$d_vprintf'
20008 d_waitpid='$d_waitpid'
20009 d_wcstombs='$d_wcstombs'
20010 d_wctomb='$d_wctomb'
20011 d_writev='$d_writev'
20014 db_hashtype='$db_hashtype'
20015 db_prefixtype='$db_prefixtype'
20016 db_version_major='$db_version_major'
20017 db_version_minor='$db_version_minor'
20018 db_version_patch='$db_version_patch'
20019 defvoidused='$defvoidused'
20020 direntrytype='$direntrytype'
20023 doublesize='$doublesize'
20025 drand48_r_proto='$drand48_r_proto'
20026 dynamic_ext='$dynamic_ext'
20032 endgrent_r_proto='$endgrent_r_proto'
20033 endhostent_r_proto='$endhostent_r_proto'
20034 endnetent_r_proto='$endnetent_r_proto'
20035 endprotoent_r_proto='$endprotoent_r_proto'
20036 endpwent_r_proto='$endpwent_r_proto'
20037 endservent_r_proto='$endservent_r_proto'
20038 eunicefix='$eunicefix'
20041 extensions='$extensions'
20043 fflushNULL='$fflushNULL'
20044 fflushall='$fflushall'
20046 firstmakefile='$firstmakefile'
20048 fpossize='$fpossize'
20049 fpostype='$fpostype'
20050 freetype='$freetype'
20053 full_csh='$full_csh'
20054 full_sed='$full_sed'
20055 gccosandvers='$gccosandvers'
20056 gccversion='$gccversion'
20057 getgrent_r_proto='$getgrent_r_proto'
20058 getgrgid_r_proto='$getgrgid_r_proto'
20059 getgrnam_r_proto='$getgrnam_r_proto'
20060 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
20061 gethostbyname_r_proto='$gethostbyname_r_proto'
20062 gethostent_r_proto='$gethostent_r_proto'
20063 getlogin_r_proto='$getlogin_r_proto'
20064 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
20065 getnetbyname_r_proto='$getnetbyname_r_proto'
20066 getnetent_r_proto='$getnetent_r_proto'
20067 getprotobyname_r_proto='$getprotobyname_r_proto'
20068 getprotobynumber_r_proto='$getprotobynumber_r_proto'
20069 getprotoent_r_proto='$getprotoent_r_proto'
20070 getpwent_r_proto='$getpwent_r_proto'
20071 getpwnam_r_proto='$getpwnam_r_proto'
20072 getpwuid_r_proto='$getpwuid_r_proto'
20073 getservbyname_r_proto='$getservbyname_r_proto'
20074 getservbyport_r_proto='$getservbyport_r_proto'
20075 getservent_r_proto='$getservent_r_proto'
20076 getspnam_r_proto='$getspnam_r_proto'
20077 gidformat='$gidformat'
20083 gmtime_r_proto='$gmtime_r_proto'
20085 groupcat='$groupcat'
20086 groupstype='$groupstype'
20089 h_sysfile='$h_sysfile'
20100 i_arpainet='$i_arpainet'
20101 i_bsdioctl='$i_bsdioctl'
20105 i_dirent='$i_dirent'
20111 i_fp_class='$i_fp_class'
20114 i_ieeefp='$i_ieeefp'
20115 i_inttypes='$i_inttypes'
20116 i_langinfo='$i_langinfo'
20117 i_libutil='$i_libutil'
20118 i_limits='$i_limits'
20119 i_locale='$i_locale'
20120 i_machcthr='$i_machcthr'
20121 i_malloc='$i_malloc'
20123 i_memory='$i_memory'
20124 i_mntent='$i_mntent'
20127 i_neterrno='$i_neterrno'
20128 i_netinettcp='$i_netinettcp'
20132 i_pthread='$i_pthread'
20134 i_rpcsvcdbm='$i_rpcsvcdbm'
20137 i_shadow='$i_shadow'
20139 i_stdarg='$i_stdarg'
20140 i_stddef='$i_stddef'
20141 i_stdlib='$i_stdlib'
20142 i_string='$i_string'
20143 i_sunmath='$i_sunmath'
20144 i_sysaccess='$i_sysaccess'
20145 i_sysdir='$i_sysdir'
20146 i_sysfile='$i_sysfile'
20147 i_sysfilio='$i_sysfilio'
20149 i_sysioctl='$i_sysioctl'
20150 i_syslog='$i_syslog'
20151 i_sysmman='$i_sysmman'
20152 i_sysmode='$i_sysmode'
20153 i_sysmount='$i_sysmount'
20154 i_sysndir='$i_sysndir'
20155 i_sysparam='$i_sysparam'
20156 i_sysresrc='$i_sysresrc'
20157 i_syssecrt='$i_syssecrt'
20158 i_sysselct='$i_sysselct'
20159 i_syssockio='$i_syssockio'
20160 i_sysstat='$i_sysstat'
20161 i_sysstatfs='$i_sysstatfs'
20162 i_sysstatvfs='$i_sysstatvfs'
20163 i_systime='$i_systime'
20164 i_systimek='$i_systimek'
20165 i_systimes='$i_systimes'
20166 i_systypes='$i_systypes'
20167 i_sysuio='$i_sysuio'
20169 i_sysutsname='$i_sysutsname'
20170 i_sysvfs='$i_sysvfs'
20171 i_syswait='$i_syswait'
20172 i_termio='$i_termio'
20173 i_termios='$i_termios'
20175 i_unistd='$i_unistd'
20178 i_values='$i_values'
20179 i_varargs='$i_varargs'
20180 i_varhdr='$i_varhdr'
20182 ignore_versioned_solibs='$ignore_versioned_solibs'
20183 inc_version_list='$inc_version_list'
20184 inc_version_list_init='$inc_version_list_init'
20187 installarchlib='$installarchlib'
20188 installbin='$installbin'
20189 installman1dir='$installman1dir'
20190 installman3dir='$installman3dir'
20191 installprefix='$installprefix'
20192 installprefixexp='$installprefixexp'
20193 installprivlib='$installprivlib'
20194 installscript='$installscript'
20195 installsitearch='$installsitearch'
20196 installsitebin='$installsitebin'
20197 installsitelib='$installsitelib'
20198 installstyle='$installstyle'
20199 installusrbinperl='$installusrbinperl'
20200 installvendorarch='$installvendorarch'
20201 installvendorbin='$installvendorbin'
20202 installvendorlib='$installvendorlib'
20204 issymlink='$issymlink'
20205 ivdformat='$ivdformat'
20208 known_extensions='$known_extensions'
20211 lddlflags='$lddlflags'
20213 ldflags_uselargefiles='$ldflags_uselargefiles'
20214 ldlibpthname='$ldlibpthname'
20221 libsdirs='$libsdirs'
20222 libsfiles='$libsfiles'
20223 libsfound='$libsfound'
20224 libspath='$libspath'
20225 libswanted='$libswanted'
20226 libswanted_uselargefiles='$libswanted_uselargefiles'
20232 localtime_r_proto='$localtime_r_proto'
20233 locincpth='$locincpth'
20234 loclibpth='$loclibpth'
20235 longdblsize='$longdblsize'
20236 longlongsize='$longlongsize'
20237 longsize='$longsize'
20241 lseeksize='$lseeksize'
20242 lseektype='$lseektype'
20246 make_set_make='$make_set_make'
20247 mallocobj='$mallocobj'
20248 mallocsrc='$mallocsrc'
20249 malloctype='$malloctype'
20251 man1direxp='$man1direxp'
20254 man3direxp='$man3direxp'
20256 mips_type='$mips_type'
20258 mmaptype='$mmaptype'
20259 modetype='$modetype'
20261 multiarch='$multiarch'
20263 myarchname='$myarchname'
20264 mydomain='$mydomain'
20265 myhostname='$myhostname'
20268 need_va_copy='$need_va_copy'
20269 netdb_hlen_type='$netdb_hlen_type'
20270 netdb_host_type='$netdb_host_type'
20271 netdb_name_type='$netdb_name_type'
20272 netdb_net_type='$netdb_net_type'
20275 nm_so_opt='$nm_so_opt'
20276 nonxs_ext='$nonxs_ext'
20278 nvEUformat='$nvEUformat'
20279 nvFUformat='$nvFUformat'
20280 nvGUformat='$nvGUformat'
20281 nv_preserves_uv_bits='$nv_preserves_uv_bits'
20282 nveformat='$nveformat'
20283 nvfformat='$nvfformat'
20284 nvgformat='$nvgformat'
20287 o_nonblock='$o_nonblock'
20289 old_pthread_create_joinable='$old_pthread_create_joinable'
20290 optimize='$optimize'
20291 orderlib='$orderlib'
20294 otherlibdirs='$otherlibdirs'
20298 patchlevel='$patchlevel'
20299 path_sep='$path_sep'
20302 perl_patchlevel='$perl_patchlevel'
20303 perladmin='$perladmin'
20304 perllibs='$perllibs'
20305 perlpath='$perlpath'
20307 phostname='$phostname'
20310 pm_apiversion='$pm_apiversion'
20314 prefixexp='$prefixexp'
20316 privlibexp='$privlibexp'
20317 procselfexe='$procselfexe'
20318 prototype='$prototype'
20320 quadkind='$quadkind'
20321 quadtype='$quadtype'
20322 randbits='$randbits'
20323 randfunc='$randfunc'
20324 random_r_proto='$random_r_proto'
20325 randseedtype='$randseedtype'
20327 rd_nodata='$rd_nodata'
20328 readdir64_r_proto='$readdir64_r_proto'
20329 readdir_r_proto='$readdir_r_proto'
20330 revision='$revision'
20335 sPRIEUldbl='$sPRIEUldbl'
20336 sPRIFUldbl='$sPRIFUldbl'
20337 sPRIGUldbl='$sPRIGUldbl'
20338 sPRIXU64='$sPRIXU64'
20340 sPRIeldbl='$sPRIeldbl'
20341 sPRIfldbl='$sPRIfldbl'
20342 sPRIgldbl='$sPRIgldbl'
20347 sSCNfldbl='$sSCNfldbl'
20348 sched_yield='$sched_yield'
20349 scriptdir='$scriptdir'
20350 scriptdirexp='$scriptdirexp'
20352 seedfunc='$seedfunc'
20353 selectminbits='$selectminbits'
20354 selecttype='$selecttype'
20355 sendmail='$sendmail'
20356 setgrent_r_proto='$setgrent_r_proto'
20357 sethostent_r_proto='$sethostent_r_proto'
20358 setlocale_r_proto='$setlocale_r_proto'
20359 setnetent_r_proto='$setnetent_r_proto'
20360 setprotoent_r_proto='$setprotoent_r_proto'
20361 setpwent_r_proto='$setpwent_r_proto'
20362 setservent_r_proto='$setservent_r_proto'
20365 sharpbang='$sharpbang'
20366 shmattype='$shmattype'
20367 shortsize='$shortsize'
20370 sig_count='$sig_count'
20371 sig_name='$sig_name'
20372 sig_name_init='$sig_name_init'
20374 sig_num_init='$sig_num_init'
20375 sig_size='$sig_size'
20376 signal_t='$signal_t'
20377 sitearch='$sitearch'
20378 sitearchexp='$sitearchexp'
20380 sitebinexp='$sitebinexp'
20382 sitelib_stem='$sitelib_stem'
20383 sitelibexp='$sitelibexp'
20384 siteprefix='$siteprefix'
20385 siteprefixexp='$siteprefixexp'
20386 sizesize='$sizesize'
20387 sizetype='$sizetype'
20391 sockethdr='$sockethdr'
20392 socketlib='$socketlib'
20393 socksizetype='$socksizetype'
20395 spackage='$spackage'
20396 spitshell='$spitshell'
20397 srand48_r_proto='$srand48_r_proto'
20398 srandom_r_proto='$srandom_r_proto'
20400 ssizetype='$ssizetype'
20401 startperl='$startperl'
20403 static_ext='$static_ext'
20405 stdio_base='$stdio_base'
20406 stdio_bufsiz='$stdio_bufsiz'
20407 stdio_cnt='$stdio_cnt'
20408 stdio_filbuf='$stdio_filbuf'
20409 stdio_ptr='$stdio_ptr'
20410 stdio_stream_array='$stdio_stream_array'
20411 strerror_r_proto='$strerror_r_proto'
20414 subversion='$subversion'
20418 targetarch='$targetarch'
20422 timeincl='$timeincl'
20423 timetype='$timetype'
20424 tmpnam_r_proto='$tmpnam_r_proto'
20430 ttyname_r_proto='$ttyname_r_proto'
20439 uidformat='$uidformat'
20445 uquadtype='$uquadtype'
20446 use5005threads='$use5005threads'
20447 use64bitall='$use64bitall'
20448 use64bitint='$use64bitint'
20449 usecrosscompile='$usecrosscompile'
20451 useithreads='$useithreads'
20452 uselargefiles='$uselargefiles'
20453 uselongdouble='$uselongdouble'
20454 usemorebits='$usemorebits'
20455 usemultiplicity='$usemultiplicity'
20456 usemymalloc='$usemymalloc'
20458 useopcode='$useopcode'
20459 useperlio='$useperlio'
20460 useposix='$useposix'
20461 usereentrant='$usereentrant'
20463 useshrplib='$useshrplib'
20464 usesocks='$usesocks'
20465 usethreads='$usethreads'
20466 usevendorprefix='$usevendorprefix'
20467 usevfork='$usevfork'
20470 uvXUformat='$uvXUformat'
20471 uvoformat='$uvoformat'
20474 uvuformat='$uvuformat'
20475 uvxformat='$uvxformat'
20476 vendorarch='$vendorarch'
20477 vendorarchexp='$vendorarchexp'
20478 vendorbin='$vendorbin'
20479 vendorbinexp='$vendorbinexp'
20480 vendorlib='$vendorlib'
20481 vendorlib_stem='$vendorlib_stem'
20482 vendorlibexp='$vendorlibexp'
20483 vendorprefix='$vendorprefix'
20484 vendorprefixexp='$vendorprefixexp'
20486 version_patchlevel_string='$version_patchlevel_string'
20487 versiononly='$versiononly'
20489 voidflags='$voidflags'
20491 xs_apiversion='$xs_apiversion'
20493 yaccflags='$yaccflags'
20498 : Add in command line options if available
20499 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
20501 : add special variables
20502 $test -f $src/patchlevel.h && \
20503 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
20504 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
20505 echo "PERL_CONFIG_SH=true" >>config.sh
20507 : propagate old symbols
20508 if $test -f UU/config.sh; then
20509 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
20510 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
20511 $sort | $uniq -u >UU/oldsyms
20512 set X `cat UU/oldsyms`
20518 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
20520 echo "# Variables propagated from previous config.sh file." >>config.sh
20521 for sym in `cat UU/oldsyms`; do
20522 echo " Propagating $hint variable "'$'"$sym..."
20523 eval 'tmp="$'"${sym}"'"'
20525 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
20531 : Finish up by extracting the .SH files
20535 echo "Extraction done."
20545 If you'd like to make any changes to the config.sh file before I begin
20546 to configure things, do it as a shell escape now (e.g. !vi config.sh).
20549 rp="Press return or use a shell escape to edit config.sh:"
20554 *) : in case they cannot read
20555 sh 1>&4 -c "$ans";;
20560 : if this fails, just run all the .SH files by hand
20569 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
20576 Now you need to generate make dependencies by running "$make depend".
20577 You might prefer to run it in background: "$make depend > makedepend.out &"
20578 It can take a while, so you might not want to run it right now.
20583 rp="Run $make depend now?"
20587 $make depend && echo "Now you must run '$make'."
20590 echo "You must run '$make depend' then '$make'."
20593 elif test -f [Mm]akefile; then
20595 echo "Now you must run a $make."
20597 echo "Configure done."
20600 if $test -f Policy.sh; then
20603 If you compile $package on a different machine or from a different object
20604 directory, copy the Policy.sh file from this object directory to the
20605 new one before you run Configure -- this will help you with most of
20606 the policy defaults.
20610 if $test -f config.msg; then
20611 echo "Hmm. I also noted the following information while running:"
20613 $cat config.msg >&4
20616 $rm -f kit*isdone ark*isdone