3 # If these # comments don't work, trim them. Don't worry about any other
4 # shell scripts, Configure will trim # comments from them for you.
6 # (If you are trying to port this package to a machine without sh,
7 # I would suggest you have a look at the prototypical config_h.SH file
8 # and edit it to reflect your system. Some packages may include samples
9 # of config.h for certain machines, so you might look for one of those.)
11 # Yes, you may rip this off to use in other distribution packages. This
12 # script belongs to the public domain and cannot be copyrighted.
14 # (Note: this Configure script was generated automatically. Rather than
15 # working with this copy of Configure, you may wish to get metaconfig.
16 # The dist-3.0 package (which contains metaconfig) was posted in
17 # comp.sources.misc and is available on CPAN under authors/id/RAM so
18 # you may fetch it yourself from your nearest archive site.)
21 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
23 # Generated on Thu May 9 17:42:14 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 threading is a highly experimental feature, and
3439 some known race conditions still remain. If you choose to try
3440 it, be very sure to not actually deploy it for production
3441 purposes. README.threads has more details, and is required
3442 reading if you enable threads.
3444 If this doesn't make any sense to you, just accept the default '$dflt'.
3446 rp='Build a threading Perl?'
3449 y|Y) val="$define" ;;
3455 case "$usethreads" in
3459 As of release 5.6, Perl has two different threading implementations,
3460 an interpreter-based version (ithreads) with one interpreter per
3461 thread, and the 5.005 version (5005threads). Both implementations
3462 are considered experimental, but since 5.8 ithreads somewhat less so.
3463 The 5005threads is effectively unmaintained.
3466 : Default to ithreads unless overridden on command line or with
3469 case "$use5005threads" in
3470 $define|true|[yY]*) dflt='n';;
3472 case "$useithreads" in
3473 $undef|false|[nN]*) dflt='n';;
3475 rp='Use interpreter-based ithreads?'
3478 y|Y) val="$define" ;;
3483 : Now set use5005threads to the opposite value.
3484 case "$useithreads" in
3485 $define) val="$undef" ;;
3492 useithreads="$undef"
3493 use5005threads="$undef"
3497 case "$useithreads$use5005threads" in
3501 You cannot have both the ithreads and the 5.005 threads enabled
3502 at the same time. Disabling the 5.005 threads since they are
3503 much less stable than the ithreads.
3506 use5005threads="$undef"
3510 case "$d_oldpthreads" in
3511 '') : Configure tests would be welcome here. For now, assume undef.
3513 *) val="$d_oldpthreads" ;;
3519 case "$usethreads" in
3520 "$define"|true|[yY]*)
3521 : Look for a hint-file generated 'call-back-unit'. If the
3522 : user has specified that a threading perl is to be built,
3523 : we may need to set or change some other defaults.
3524 if $test -f usethreads.cbu; then
3525 echo "Your platform has some specific hints for threaded builds, using them..."
3529 (Your platform doesn't have any specific hints for threaded builds.
3530 Assuming POSIX threads, then.)
3538 Perl can be built so that multiple Perl interpreters can coexist
3539 within the same Perl executable.
3542 case "$useithreads" in
3545 This multiple interpreter support is required for interpreter-based threads.
3549 *) case "$usemultiplicity" in
3550 $define|true|[yY]*) dflt='y';;
3554 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3555 rp='Build Perl for multiplicity?'
3558 y|Y) val="$define" ;;
3567 case "$usemorebits" in
3568 "$define"|true|[yY]*)
3569 use64bitint="$define"
3570 uselongdouble="$define"
3571 usemorebits="$define"
3573 *) usemorebits="$undef"
3577 : make some quick guesses about what we are up against
3579 $echo $n "Hmm... $c"
3589 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3590 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3592 echo "Looks kind of like an OSF/1 system, but we'll see..."
3594 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3595 xxx=`./loc addbib blurfl $pth`
3596 if $test -f $xxx; then
3597 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3601 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3602 echo "Looks kind of like an extended USG system, but we'll see..."
3604 echo "Looks kind of like a USG system, but we'll see..."
3608 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3609 echo "Looks kind of like a BSD system, but we'll see..."
3613 echo "Looks kind of like a Version 7 system, but we'll see..."
3616 case "$eunicefix" in
3619 There is, however, a strange, musty smell in the air that reminds me of
3620 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3624 : it so happens the Eunice I know will not run shell scripts in Unix format
3628 echo "Congratulations. You aren't running Eunice."
3632 : Detect OS2. The p_ variable is set above in the Head.U unit.
3633 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3634 : semicolon as a patch separator
3639 I have the feeling something is not exactly right, however...don't tell me...
3640 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3641 (Or you may be running DOS with DJGPP.)
3646 if test -f /xenix; then
3647 echo "Actually, this looks more like a XENIX system..."
3652 echo "It's not Xenix..."
3657 if test -f /venix; then
3658 echo "Actually, this looks more like a VENIX system..."
3665 echo "Nor is it Venix..."
3668 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3669 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3676 rp="Use which C compiler?"
3680 : See if they have not cc but they do have gcc
3682 : Look for a hint-file generated 'call-back-unit'. Now that the
3683 : user has specified the compiler, we may need to set or change some
3685 if $test -f cc.cbu; then
3691 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3697 printf("%s\n", __VERSION__);
3699 printf("%s\n", "1");
3705 if $cc -o try $ccflags $ldflags try.c; then
3706 gccversion=`$run ./try`
3707 case "$gccversion" in
3708 '') echo "You are not using GNU cc." ;;
3709 *) echo "You are using GNU cc $gccversion."
3715 echo "*** WHOA THERE!!! ***" >&4
3716 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3717 case "$knowitall" in
3719 echo " You'd better start hunting for one and let me know about it." >&4
3725 case "$gccversion" in
3726 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3728 case "$gccversion" in
3729 '') gccosandvers='' ;;
3730 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3731 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3733 case "$gccosandvers" in
3734 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3735 $osname$osvers) ;; # looking good
3736 $osname*) cat <<EOM >&4
3738 *** WHOA THERE!!! ***
3740 Your gcc has not been compiled for the exact release of
3741 your operating system ($gccosandvers versus $osname$osvers).
3743 In general it is a good idea to keep gcc synchronized with
3744 the operating system because otherwise serious problems
3745 may ensue when trying to compile software, like Perl.
3747 I'm trying to be optimistic here, though, and will continue.
3748 If later during the configuration and build icky compilation
3749 problems appear (headerfile conflicts being the most common
3750 manifestation), I suggest reinstalling the gcc to match
3751 your operating system release.
3755 *) gccosandvers='' ;; # failed to parse, better be silent
3764 : decide how portable to be. Allow command line overrides.
3765 case "$d_portable" in
3767 *) d_portable="$define" ;;
3770 : set up shell script to do ~ expansion
3776 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3779 if $test -f /bin/csh; then
3780 /bin/csh -f -c "glob \$1"
3785 name=\`$expr x\$1 : '..\([^/]*\)'\`
3786 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3787 if $test ! -d "\$dir"; then
3789 echo "\$me: can't locate home directory for: \$name" >&2
3794 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3810 : now set up to get a file name
3814 cat <<'EOSC' >>getfile
3830 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3831 fn=`echo $fn | sed 's/(.*)//'`
3837 loc_file=`expr $fn : '.*:\(.*\)'`
3838 fn=`expr $fn : '\(.*\):.*'`
3846 */*) fullpath=true;;
3855 *e*) exp_file=true;;
3858 *p*) nopath_ok=true;;
3863 *d*) type='Directory';;
3864 *l*) type='Locate';;
3869 Locate) what='File';;
3874 case "$d_portable" in
3882 while test "$type"; do
3887 true) rp="$rp (~name ok)";;
3890 if test -f UU/getfile.ok && \
3891 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3910 value=`UU/filexp $ans`
3913 if test "$ans" != "$value"; then
3914 echo "(That expands to $value on this system.)"
3928 /*) value="$ansexp" ;;
3929 [a-zA-Z]:/*) value="$ansexp" ;;
3934 echo "I shall only accept a full path name, as in /bin/ls." >&4
3935 echo "Use a ! shell escape if you wish to check pathnames." >&4
3938 echo "Please give a full path name, starting with slash." >&4
3941 echo "Note that using ~name is ok provided it expands well." >&4
3954 for fp in $gfpth; do
3955 if test "X$fp" = X.; then
3960 if test -f "$pf"; then
3962 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3964 echo "($value is not a plain file, but that's ok.)"
3967 if test X"$type" = X; then
3974 for fp in $gfpth; do
3975 if test "X$fp" = X.; then
3980 direxp="$fp/$ansexp"
3982 if test -d "$direxp"; then
3990 if test -d "$ansexp"; then
3991 echo "(Looking for $loc_file in directory $value.)"
3992 value="$value/$loc_file"
3993 ansexp="$ansexp/$loc_file"
3995 if test -f "$ansexp"; then
3998 case "$nopath_ok" in
3999 true) case "$value" in
4001 *) echo "Assuming $value will be in people's path."
4017 if test "$fastread" = yes; then
4022 rp="$what $value doesn't exist. Use that name anyway?"
4041 test "X$gfpthkeep" != Xy && gfpth=""
4044 : What should the include directory be ?
4046 $echo $n "Hmm... $c"
4050 if $test -f /bin/mips && /bin/mips; then
4051 echo "Looks like a MIPS system..."
4052 $cat >usr.c <<'EOCP'
4053 #ifdef SYSTYPE_BSD43
4057 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4058 dflt='/bsd43/usr/include'
4062 mips_type='System V'
4064 $rm -f usr.c usr.out
4065 echo "and you're compiling with the $mips_type compiler and libraries."
4069 echo "Doesn't look like a MIPS system."
4079 case "$xxx_prompt" in
4082 rp='Where are the include files you want to use?'
4090 : see how we invoke the C preprocessor
4092 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4093 cat <<'EOT' >testcpp.c
4099 if test ! -f cppstdin; then
4100 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4101 # AIX cc -E doesn't show the absolute headerfile
4102 # locations but we'll cheat by using the -M flag.
4103 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
4105 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4108 echo "Keeping your $hint cppstdin wrapper."
4111 wrapper=`pwd`/cppstdin
4115 if $test "X$cppstdin" != "X" && \
4116 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4117 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4119 echo "You used to use $cppstdin $cppminus so we'll use that again."
4121 '') echo "But let's see if we can live without a wrapper..." ;;
4123 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4124 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4126 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4129 echo "(However, $cpprun $cpplast does not work, let's see...)"
4137 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4144 elif echo 'Maybe "'"$cc"' -E" will work...'; \
4145 $cc -E <testcpp.c >testcpp.out 2>&1; \
4146 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4147 echo "Yup, it does."
4150 elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
4151 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4152 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4153 echo "Yup, it does."
4156 elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
4157 $cc -P <testcpp.c >testcpp.out 2>&1; \
4158 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4159 echo "Yipee, that works!"
4162 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4163 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4164 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4165 echo "At long last!"
4168 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4169 $cpp <testcpp.c >testcpp.out 2>&1; \
4170 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4174 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4175 $cpp - <testcpp.c >testcpp.out 2>&1; \
4176 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4177 echo "Hooray, it works! I was beginning to wonder."
4180 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4181 $wrapper <testcpp.c >testcpp.out 2>&1; \
4182 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4188 rp="No dice. I can't find a C preprocessor. Name one:"
4192 $x_cpp <testcpp.c >testcpp.out 2>&1
4193 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4194 echo "OK, that will do." >&4
4196 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4211 echo "Perhaps can we force $cc -E using a wrapper..."
4212 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4213 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4219 echo "Nope, we'll have to live without it..."
4233 "$wrapper"|'cppstdin') ;;
4234 *) $rm -f $wrapper;;
4236 $rm -f testcpp.c testcpp.out
4238 : Set private lib path
4241 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4246 '') dlist="$loclibpth $plibpth $glibpth";;
4247 *) dlist="$libpth";;
4250 : Now check and see which directories actually exist, avoiding duplicates
4254 if $test -d $xxx; then
4257 *) libpth="$libpth $xxx";;
4263 Some systems have incompatible or broken versions of libraries. Among
4264 the directories listed in the question below, please remove any you
4265 know not to be holding relevant libraries, and add any that are needed.
4266 Say "none" for none.
4277 rp="Directories to use for library searches?"
4284 : compute shared library extension
4287 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4297 On some systems, shared libraries may be available. Answer 'none' if
4298 you want to suppress searching of shared libraries for the remainder
4299 of this configuration.
4302 rp='What is the file extension used for shared libraries?'
4306 : Define several unixisms.
4307 : Hints files or command line option can be used to override them.
4308 : The convoluted testing is in case hints files set either the old
4311 '') case "$exe_ext" in
4313 *) _exe="$exe_ext" ;;
4318 '') case "$lib_ext" in
4325 '') case "$obj_ext" in
4332 '') case "$path_sep" in
4343 : Which makefile gets called first. This is used by make depend.
4344 case "$firstmakefile" in
4345 '') firstmakefile='makefile';;
4349 $define|true|[yY]*) dflt='y';;
4354 Perl can be built to use the SOCKS proxy protocol library. To do so,
4355 Configure must be run with -Dusesocks. If you use SOCKS you also need
4356 to use the PerlIO abstraction layer, this will be implicitly selected.
4358 If this doesn't make any sense to you, just accept the default '$dflt'.
4360 rp='Build Perl for SOCKS?'
4363 y|Y) val="$define" ;;
4370 $define|true|[yY]*) useperlio="$define";;
4373 : Looking for optional libraries
4375 echo "Checking for optional libraries..." >&4
4380 case "$libswanted" in
4381 '') libswanted='c_s';;
4384 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4390 for thisdir in $libpth $xlibpth; do
4391 test -d $thisdir && libspath="$libspath $thisdir"
4393 for thislib in $libswanted; do
4394 for thisdir in $libspath; do
4396 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4397 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4398 $test -f "$xxx" && eval $libscheck
4399 $test -f "$xxx" && libstyle=shared
4401 if test ! -f "$xxx"; then
4402 xxx=$thisdir/lib$thislib.$so
4403 $test -f "$xxx" && eval $libscheck
4404 $test -f "$xxx" && libstyle=shared
4406 if test ! -f "$xxx"; then
4407 xxx=$thisdir/lib$thislib$_a
4408 $test -f "$xxx" && eval $libscheck
4409 $test -f "$xxx" && libstyle=static
4411 if test ! -f "$xxx"; then
4412 xxx=$thisdir/$thislib$_a
4413 $test -f "$xxx" && eval $libscheck
4414 $test -f "$xxx" && libstyle=static
4416 if test ! -f "$xxx"; then
4417 xxx=$thisdir/lib${thislib}_s$_a
4418 $test -f "$xxx" && eval $libscheck
4419 $test -f "$xxx" && libstyle=static
4420 $test -f "$xxx" && thislib=${thislib}_s
4422 if test ! -f "$xxx"; then
4423 xxx=$thisdir/Slib$thislib$_a
4424 $test -f "$xxx" && eval $libscheck
4425 $test -f "$xxx" && libstyle=static
4427 if $test -f "$xxx"; then
4429 shared) echo "Found -l$thislib (shared)." ;;
4430 static) echo "Found -l$thislib." ;;
4431 *) echo "Found -l$thislib ($libstyle)." ;;
4435 *) dflt="$dflt -l$thislib"
4436 libsfound="$libsfound $xxx"
4438 libsfiles="$libsfiles $yyy"
4439 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4440 case " $libsdirs " in
4442 *) libsdirs="$libsdirs $yyy" ;;
4449 if $test ! -f "$xxx"; then
4450 echo "No -l$thislib."
4461 ' '|'') dflt='none';;
4466 In order to compile $package on your machine, a number of libraries
4467 are usually needed. Include any other special libraries here as well.
4468 Say "none" for none. The default list is almost always right.
4472 rp="What libraries to use?"
4479 : determine optimization, if desired, or use for debug flag also
4481 ' '|$undef) dflt='none';;
4483 *) dflt="$optimize";;
4487 By default, $package compiles with the -O flag to use the optimizer.
4488 Alternately, you might want to use the symbolic debugger, which uses
4489 the -g flag (on traditional Unix systems). Either flag can be
4490 specified here. To use neither flag, specify the word "none".
4493 rp="What optimizer/debugger flag should be used?"
4497 'none') optimize=" ";;
4501 : We will not override a previous value, but we might want to
4502 : augment a hint file
4504 default|recommended)
4505 case "$gccversion" in
4506 1*) dflt='-fpcc-struct-return' ;;
4509 *-g*) dflt="$dflt -DDEBUGGING";;
4511 case "$gccversion" in
4512 2*) if test -d /etc/conf/kconfig.d &&
4513 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4519 case "$gccversion" in
4523 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4524 echo 'int main(void) { return 0; }' > gcctest.c
4525 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4526 echo "Yes, it does." 2>&1
4529 echo "Leaving current flags $ccflags alone." 2>&1
4531 *) dflt="$dflt -fno-strict-aliasing" ;;
4534 echo "Nope, it doesn't, but that's ok." 2>&1
4541 case "$mips_type" in
4542 *BSD*|'') inclwanted="$locincpth $usrinc";;
4543 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4545 for thisincl in $inclwanted; do
4546 if $test -d $thisincl; then
4547 if $test x$thisincl != x$usrinc; then
4549 *" -I$thisincl "*);;
4550 *) dflt="$dflt -I$thisincl ";;
4556 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4558 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4566 *) dflt="$dflt -D$2";;
4570 set signal.h LANGUAGE_C; eval $inctest
4574 ccflags="$ccflags -DSOCKS"
4579 default|recommended) dflt="$ccflags $dflt" ;;
4580 *) dflt="$ccflags";;
4589 Your C compiler may want other flags. For this question you should include
4590 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4591 but you should NOT include libraries or ld flags like -lwhatever. If you
4592 want $package to honor its debug switch, you should include -DDEBUGGING here.
4593 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4595 To use no flags, specify the word "none".
4601 rp="Any additional cc flags?"
4608 : the following weeds options from ccflags that are of no interest to cpp
4610 '') cppflags="$ccflags" ;;
4611 *) cppflags="$cppflags $ccflags" ;;
4613 case "$gccversion" in
4614 1*) cppflags="$cppflags -D__GNUC__"
4616 case "$mips_type" in
4618 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4624 echo "Let me guess what the preprocessor flags are..." >&4
4638 *) ftry="$previous $flag";;
4640 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4641 >cpp1.out 2>/dev/null && \
4642 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4643 >cpp2.out 2>/dev/null && \
4644 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4645 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4647 cppflags="$cppflags $ftry"
4657 *-*) echo "They appear to be: $cppflags";;
4659 $rm -f cpp.c cpp?.out
4663 : flags used in final linking phase
4665 '') if ./venix; then
4671 *-posix*) dflt="$dflt -posix" ;;
4674 *) dflt="$ldflags";;
4677 : Try to guess additional flags to pick up local libraries.
4678 for thislibdir in $libpth; do
4679 case " $loclibpth " in
4682 *"-L$thislibdir "*) ;;
4683 *) dflt="$dflt -L$thislibdir" ;;
4695 Your C linker may need flags. For this question you should
4696 include -L/whatever and any other flags used by the C linker, but you
4697 should NOT include libraries like -lwhatever.
4699 Make sure you include the appropriate -L/path flags if your C linker
4700 does not normally search all of the directories you specified above,
4703 To use no flags, specify the word "none".
4707 rp="Any additional ld flags (NOT including libraries)?"
4713 rmlist="$rmlist pdp11"
4717 echo "Checking your choice of C compiler and flags for coherency..." >&4
4718 $cat > try.c <<'EOF'
4720 int main() { printf("Ok\n"); exit(0); }
4722 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4724 $cat >try.msg <<'EOM'
4725 I've tried to compile and run the following simple program:
4728 $cat try.c >> try.msg
4730 $cat >> try.msg <<EOM
4737 and I got the following output:
4741 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4742 if $sh -c "$run ./try" >>try.msg 2>&1; then
4746 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4749 cat >> try.msg <<'EOQS'
4750 If $libs contains -lsfio, and sfio is mis-configured, then it
4751 sometimes (apparently) runs and exits with a 0 status, but with no
4752 output! It may have to do with sfio's use of _exit vs. exit.
4755 rp="You have a big problem. Shall I abort Configure"
4762 echo "The program compiled OK, but exited with status $?." >>try.msg
4763 rp="You have a problem. Shall I abort Configure"
4767 echo "I can't compile the test program." >>try.msg
4768 rp="You have a BIG problem. Shall I abort Configure"
4774 case "$knowitall" in
4776 echo "(The supplied flags or libraries might be incorrect.)"
4784 *) echo "Ok. Stopping Configure." >&4
4789 n) echo "OK, that should do.";;
4791 $rm -f try try.* core
4793 : define a shorthand compile call
4797 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4798 : define a shorthand compile call for compilations that should be ok.
4802 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4804 : check for lengths of integral types
4808 echo "Checking to see how big your integers are..." >&4
4809 $cat >try.c <<'EOCP'
4813 printf("intsize=%d;\n", (int)sizeof(int));
4814 printf("longsize=%d;\n", (int)sizeof(long));
4815 printf("shortsize=%d;\n", (int)sizeof(short));
4820 if eval $compile_ok && $run ./try > /dev/null; then
4822 echo "Your integers are $intsize bytes long."
4823 echo "Your long integers are $longsize bytes long."
4824 echo "Your short integers are $shortsize bytes long."
4828 Help! I can't compile and run the intsize test program: please enlighten me!
4829 (This is probably a misconfiguration in your system or libraries, and
4830 you really ought to fix it. Still, I'll try anyway.)
4834 rp="What is the size of an integer (in bytes)?"
4838 rp="What is the size of a long integer (in bytes)?"
4842 rp="What is the size of a short integer (in bytes)?"
4850 : check for long long
4852 echo "Checking to see if you have long long..." >&4
4853 echo 'int main() { long long x = 7; return 0; }' > try.c
4855 if eval $compile; then
4857 echo "You have long long."
4860 echo "You do not have long long."
4866 : check for length of long long
4867 case "${d_longlong}${longlongsize}" in
4870 echo "Checking to see how big your long longs are..." >&4
4871 $cat >try.c <<'EOCP'
4875 printf("%d\n", (int)sizeof(long long));
4880 if eval $compile_ok; then
4881 longlongsize=`$run ./try`
4882 echo "Your long longs are $longlongsize bytes long."
4886 echo "(I can't seem to compile the test program. Guessing...)"
4887 rp="What is the size of a long long (in bytes)?"
4891 if $test "X$longsize" = "X$longlongsize"; then
4892 echo "(That isn't any different from an ordinary long.)"
4898 : determine filename position in cpp output
4900 echo "Computing filename position in cpp output for #include directives..." >&4
4902 vos) testaccess=-e ;;
4905 echo '#include <stdio.h>' > foo.c
4908 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4909 $grep '^[ ]*#.*stdio\.h' | \
4910 while read cline; do
4913 while $test \$# -gt 0; do
4914 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
4919 pos=\`expr \$pos + 1\`
4931 *) pos="${fieldn}th";;
4933 echo "Your cpp writes the filename in the $pos field of the line."
4936 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4939 : locate header file
4944 for usrincdir in $usrinc
4946 if test -f \$usrincdir/\$wanted; then
4947 echo "\$usrincdir/\$wanted"
4951 awkprg='{ print \$$fieldn }'
4952 echo "#include <\$wanted>" > foo\$\$.c
4953 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4954 $cppfilter $grep "^[ ]*#.*\$wanted" | \
4955 while read cline; do
4956 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4958 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4959 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4964 # status = 0: grep returned 0 lines, case statement not executed
4965 # status = 1: headerfile found
4966 # status = 2: while loop executed, no headerfile found
4970 if test \$status -eq 1; then
4977 : define an alternate in-header-list? function
4978 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4979 cont=true; xxf="echo \"<\$1> found.\" >&4";
4980 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4981 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4983 case $# in 4) instead=instead;; *) instead="at last";; esac;
4984 while $test "$cont"; do
4986 var=$2; eval "was=\$$2";
4987 if $test "$xxx" && $test -r "$xxx";
4989 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4992 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4993 set $yyy; shift; shift; yyy=$@;
4994 case $# in 0) cont="";;
4995 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
4996 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
4997 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
4998 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5002 do set $yyy; var=$2; eval "was=\$$2";
5003 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5004 set $yyy; shift; shift; yyy=$@;
5007 : see if inttypes.h is available
5008 : we want a real compile instead of Inhdr because some systems
5009 : have an inttypes.h which includes non-existent headers
5012 #include <inttypes.h>
5014 static int32_t foo32 = 0x12345678;
5018 if eval $compile; then
5019 echo "<inttypes.h> found." >&4
5022 echo "<inttypes.h> NOT found." >&4
5031 echo "Checking to see if you have int64_t..." >&4
5033 #include <sys/types.h>
5034 #$i_inttypes I_INTTYPES
5036 #include <inttypes.h>
5038 int main() { int64_t x = 7; }
5041 if eval $compile; then
5043 echo "You have int64_t."
5046 echo "You do not have int64_t."
5054 echo "Checking which 64-bit integer type we could use..." >&4
5060 val='"unsigned int"'
5065 *) case "$longsize" in
5069 val='"unsigned long"'
5074 *) case "$d_longlong:$longlongsize" in
5079 val='"unsigned long long"'
5084 *) case "$d_int64_t" in
5103 '') echo "Alas, no 64-bit integer types in sight." >&4
5106 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5112 case "$uselonglong" in
5113 "$define"|true|[yY]*)
5116 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5118 use64bitint="$define"
5121 case "$use64bits" in
5122 "$define"|true|[yY]*)
5125 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5127 use64bitint="$define"
5130 case "$use64bitints" in
5131 "$define"|true|[yY]*)
5134 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5136 use64bitint="$define"
5139 case "$use64bitsint" in
5140 "$define"|true|[yY]*)
5143 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5145 use64bitint="$define"
5148 case "$uselonglongs" in
5149 "$define"|true|[yY]*)
5152 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5154 use64bitint="$define"
5157 case "$use64bitsall" in
5158 "$define"|true|[yY]*)
5161 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5163 use64bitall="$define"
5168 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5170 case "$use64bitall" in
5171 "$define"|true|[yY]*) use64bitint="$define" ;;
5177 You have natively 64-bit long integers.
5181 *) case "$use64bitint" in
5182 "$define"|true|[yY]*) dflt='y';;
5191 Perl can be built to take advantage of 64-bit integer types
5192 on some systems. To do so, Configure can be run with -Duse64bitint.
5193 Choosing this option will most probably introduce binary incompatibilities.
5195 If this doesn't make any sense to you, just accept the default '$dflt'.
5196 (The default has been chosen based on your configuration.)
5198 rp='Try to use 64-bit integers, if available?'
5201 [yY]*) val="$define" ;;
5209 case "$use64bitall" in
5210 "$define"|true|[yY]*) dflt='y' ;;
5211 *) case "$longsize" in
5219 You may also choose to try maximal 64-bitness. It means using as much
5220 64-bitness as possible on the platform. This in turn means even more
5221 binary incompatibilities. On the other hand, your platform may not
5222 have any more 64-bitness available than what you already have chosen.
5224 If this doesn't make any sense to you, just accept the default '$dflt'.
5225 (The default has been chosen based on your configuration.)
5227 rp='Try to use maximal 64-bit support, if available?'
5230 [yY]*) val="$define" ;;
5235 case "$use64bitall" in
5237 case "$use64bitint" in
5241 Since you have chosen a maximally 64-bit build, I'm also turning on
5242 the use of 64-bit integers.
5244 use64bitint="$define" ;;
5249 case "$use64bitint" in
5250 "$define"|true|[yY]*)
5251 : Look for a hint-file generated 'call-back-unit'. If the
5252 : user has specified that a 64-bit perl is to be built,
5253 : we may need to set or change some other defaults.
5254 if $test -f use64bitint.cbu; then
5255 echo "Your platform has some specific hints for 64-bit integers, using them..."
5259 4) case "$archname64" in
5260 '') archname64=64int ;;
5267 case "$use64bitall" in
5268 "$define"|true|[yY]*)
5269 : Look for a hint-file generated 'call-back-unit'. If the
5270 : user has specified that a maximally 64-bit perl is to be built,
5271 : we may need to set or change some other defaults.
5272 if $test -f use64bitall.cbu; then
5273 echo "Your platform has some specific hints for 64-bit builds, using them..."
5277 4) case "$archname64" in
5278 ''|64int) archname64=64all ;;
5286 echo "Checking for GNU C Library..." >&4
5299 if eval $compile_ok && $run ./try; then
5301 echo "You are using the GNU C Library"
5304 echo "You are not using the GNU C Library"
5310 : see if nm is to be used to determine whether a symbol is defined or not
5314 case "$d_gnulibc" in
5317 echo "nm probably won't work on the GNU C Library." >&4
5323 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5325 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5326 echo "'nm' won't be sufficient on this sytem." >&4
5332 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5333 if $test $dflt -gt 20; then
5343 true|$define) dflt=y;;
5350 I can use $nm to extract the symbols from your C libraries. This
5351 is a time consuming task which may generate huge output on the disk (up
5352 to 3 megabytes) but that should make the symbols extraction faster. The
5353 alternative is to skip the 'nm' extraction part and to compile a small
5354 test program instead to determine whether each symbol is present. If
5355 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5356 this may be the best solution.
5358 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5361 rp="Shall I use $nm to extract C symbols from the libraries?"
5364 [Nn]*) usenm=false;;
5373 : nm options which may be necessary
5375 '') if $test -f /mach_boot; then
5377 elif $test -d /usr/ccs/lib; then
5378 nm_opt='-p' # Solaris (and SunOS?)
5379 elif $test -f /dgux; then
5381 elif $test -f /lib64/rld; then
5382 nm_opt='-p' # 64-bit Irix
5388 : nm options which may be necessary for shared libraries but illegal
5389 : for archive libraries. Thank you, Linux.
5390 case "$nm_so_opt" in
5391 '') case "$myuname" in
5393 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5394 nm_so_opt='--dynamic'
5403 : get list of predefined functions in a handy place
5408 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5414 *) for thislib in $libs; do
5417 : Handle C library specially below.
5420 thislib=`echo $thislib | $sed -e 's/^-l//'`
5421 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5423 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5425 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5427 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5429 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5431 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5433 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5438 libnames="$libnames $try"
5440 *) libnames="$libnames $thislib" ;;
5449 for xxx in $libpth; do
5450 $test -r $1 || set $xxx/libc.$so
5451 : The messy sed command sorts on library version numbers.
5453 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5454 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5456 s/[0-9][0-9]*/0000&/g
5457 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5460 $sort | $sed -e 's/^.* //'`
5463 $test -r $1 || set /usr/ccs/lib/libc.$so
5464 $test -r $1 || set /lib/libsys_s$_a
5470 if $test -r "$1"; then
5471 echo "Your (shared) C library seems to be in $1."
5473 elif $test -r /lib/libc && $test -r /lib/clib; then
5474 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5476 libc='/lib/clib /lib/libc'
5477 if $test -r /lib/syslib; then
5478 echo "(Your math library is in /lib/syslib.)"
5479 libc="$libc /lib/syslib"
5481 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5482 echo "Your C library seems to be in $libc, as you said before."
5483 elif $test -r $incpath/usr/lib/libc$_a; then
5484 libc=$incpath/usr/lib/libc$_a;
5485 echo "Your C library seems to be in $libc. That's fine."
5486 elif $test -r /lib/libc$_a; then
5488 echo "Your C library seems to be in $libc. You're normal."
5490 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5492 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5493 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5494 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5496 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5498 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5501 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5503 if $test -r "$tans"; then
5504 echo "Your C library seems to be in $tans, of all places."
5510 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5514 If the guess above is wrong (which it might be if you're using a strange
5515 compiler, or your machine supports multiple models), you can override it here.
5520 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5522 I can't seem to find your C library. I've looked in the following places:
5525 $sed 's/^/ /' libpath
5528 None of these seems to contain your C library. I need to get its name...
5533 rp='Where is your C library?'
5538 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5539 set X `cat libnames`
5542 case $# in 1) xxx=file; esac
5543 echo "Extracting names from the following $xxx for later perusal:" >&4
5545 $sed 's/^/ /' libnames >&4
5547 $echo $n "This may take a while...$c" >&4
5551 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5552 *) $nm $nm_opt $file 2>/dev/null;;
5557 $grep fprintf libc.tmp > libc.ptf
5558 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5559 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
5561 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5563 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5565 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5567 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5569 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5571 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5573 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5575 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5577 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5579 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5581 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5583 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5585 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5586 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5588 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5590 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5592 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5594 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5596 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5598 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5600 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5602 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5604 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5606 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5608 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5610 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5612 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5614 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5616 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5619 $nm -p $* 2>/dev/null >libc.tmp
5620 $grep fprintf libc.tmp > libc.ptf
5621 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5622 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5628 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5630 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5631 for thisname in $libnames $libc; do
5632 $ar t $thisname >>libc.tmp
5634 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5636 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5637 # Repeat libc to extract forwarders to DLL entries too
5638 for thisname in $libnames $libc; do
5639 $ar tv $thisname >>libc.tmp
5640 # Revision 50 of EMX has bug in $ar.
5641 # it will not extract forwarders to DLL entries
5642 # Use emximp which will extract exactly them.
5643 emximp -o tmp.imp $thisname \
5645 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5646 < tmp.imp >>libc.tmp
5649 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5652 echo "$ar didn't seem to work right." >&4
5653 echo "Maybe this is a Cray...trying bld instead..." >&4
5654 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5656 for thisname in $libnames; do
5658 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5659 $ar t $thisname >>libc.tmp
5663 echo "That didn't work either. Giving up." >&4
5670 if $test -f /lib/syscalls.exp; then
5672 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5673 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
5677 $rm -f libnames libpath
5679 : is a C symbol defined?
5682 -v) tf=libc.tmp; tc=""; tdc="";;
5683 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5684 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5687 case "$reuseval-$4" in
5689 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5695 if $contains $tlook $tf >/dev/null 2>&1;
5700 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5701 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5709 $define) tval=true;;
5715 : define an is-in-libc? function
5716 inlibc='echo " "; td=$define; tu=$undef;
5717 sym=$1; var=$2; eval "was=\$$2";
5719 case "$reuseval$was" in
5729 echo "$sym() found." >&4;
5730 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5732 echo "$sym() NOT found." >&4;
5733 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5737 $define) echo "$sym() found." >&4;;
5738 *) echo "$sym() NOT found." >&4;;
5742 : see if sqrtl exists
5746 : check for length of double
5748 case "$doublesize" in
5750 echo "Checking to see how big your double precision numbers are..." >&4
5751 $cat >try.c <<'EOCP'
5755 printf("%d\n", (int)sizeof(double));
5760 if eval $compile_ok; then
5761 doublesize=`$run ./try`
5762 echo "Your double is $doublesize bytes long."
5765 echo "(I can't seem to compile the test program. Guessing...)"
5766 rp="What is the size of a double precision number (in bytes)?"
5774 : check for long doubles
5776 echo "Checking to see if you have long double..." >&4
5777 echo 'int main() { long double x = 7.0; }' > try.c
5779 if eval $compile; then
5781 echo "You have long double."
5784 echo "You do not have long double."
5790 : check for length of long double
5791 case "${d_longdbl}${longdblsize}" in
5794 echo "Checking to see how big your long doubles are..." >&4
5795 $cat >try.c <<'EOCP'
5799 printf("%d\n", sizeof(long double));
5804 if eval $compile; then
5805 longdblsize=`$run ./try`
5806 echo "Your long doubles are $longdblsize bytes long."
5810 echo "(I can't seem to compile the test program. Guessing...)" >&4
5811 rp="What is the size of a long double (in bytes)?"
5815 if $test "X$doublesize" = "X$longdblsize"; then
5816 echo "(That isn't any different from an ordinary double.)"
5824 if $test X"$d_longdbl" = X"$define"; then
5826 echo "Checking how to print long doubles..." >&4
5828 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
5829 $cat >try.c <<'EOCP'
5830 #include <sys/types.h>
5834 printf("%.3f\n", d);
5838 if eval $compile; then
5842 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
5843 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
5844 echo "We will use %f."
5850 if $test X"$sPRIfldbl" = X; then
5851 $cat >try.c <<'EOCP'
5852 #include <sys/types.h>
5855 long double d = 123.456;
5856 printf("%.3Lf\n", d);
5860 if eval $compile; then
5864 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
5865 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
5866 echo "We will use %Lf."
5872 if $test X"$sPRIfldbl" = X; then
5873 $cat >try.c <<'EOCP'
5874 #include <sys/types.h>
5877 long double d = 123.456;
5878 printf("%.3llf\n", d);
5882 if eval $compile; then
5886 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
5887 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
5888 echo "We will use %llf."
5894 if $test X"$sPRIfldbl" = X; then
5895 $cat >try.c <<'EOCP'
5896 #include <sys/types.h>
5899 long double d = 123.456;
5900 printf("%.3lf\n", d);
5904 if eval $compile; then
5908 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
5909 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
5910 echo "We will use %lf."
5916 if $test X"$sPRIfldbl" = X; then
5917 echo "Cannot figure out how to print long doubles." >&4
5919 sSCNfldbl=$sPRIfldbl # expect consistency
5926 case "$sPRIfldbl" in
5927 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
5928 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
5929 d_SCNfldbl="$undef";
5931 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
5932 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
5933 d_SCNfldbl="$define";
5937 : see if modfl exists
5941 d_modfl_pow32_bug="$undef"
5943 case "$d_longdbl$d_modfl" in
5946 Checking to see whether your modfl() is okay for large values...
5952 long double nv = 4294967303.15;
5958 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
5962 case "$osname:$gccversion" in
5963 aix:) saveccflags="$ccflags"
5964 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
5967 if eval $compile; then
5970 *" 4294967303.150000 1.150000 4294967302.000000")
5971 echo >&4 "Your modfl() is broken for large values."
5972 d_modfl_pow32_bug="$define"
5974 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
5978 *" 4294967303.150000 0.150000 4294967303.000000")
5979 echo >&4 "Your modfl() seems okay for large values."
5981 *) echo >&4 "I don't understand your modfl() at all."
5985 $rm -f try.* try core core.try.*
5987 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
5990 case "$osname:$gccversion" in
5991 aix:) ccflags="$saveccflags" ;; # restore
5997 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6000 case "$uselongdouble" in
6001 $define|true|[yY]*) dflt='y';;
6006 Perl can be built to take advantage of long doubles which
6007 (if available) may give more accuracy and range for floating point numbers.
6009 If this doesn't make any sense to you, just accept the default '$dflt'.
6011 rp='Try to use long doubles if available?'
6014 y|Y) val="$define" ;;
6020 case "$uselongdouble" in
6021 true|[yY]*) uselongdouble="$define" ;;
6024 case "$uselongdouble" in
6026 : Look for a hint-file generated 'call-back-unit'. If the
6027 : user has specified that long doubles should be used,
6028 : we may need to set or change some other defaults.
6029 if $test -f uselongdouble.cbu; then
6030 echo "Your platform has some specific hints for long doubles, using them..."
6031 . ./uselongdouble.cbu
6034 (Your platform doesn't have any specific hints for long doubles.)
6041 case "$uselongdouble:$d_sqrtl:$d_modfl" in
6042 $define:$define:$define)
6045 $define:$define:$undef)
6046 message="I could not find modfl"
6048 $define:$undef:$define)
6049 message="I could not find sqrtl"
6051 $define:$undef:$undef)
6052 message="I found neither sqrtl nor modfl"
6056 if $test "$message" != X; then
6059 *** You requested the use of long doubles but you do not seem to have
6060 *** the mathematic functions for long doubles.
6062 *** I'm disabling the use of long doubles.
6066 uselongdouble=$undef
6069 case "$useperlio" in
6070 $define|true|[yY]*|'') dflt='y';;
6075 Previous version of $package used the standard IO mechanisms as
6076 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
6077 alternate IO mechanisms via the PerlIO abstraction layer, but the
6078 stdio mechanism is still available if needed. The abstraction layer
6079 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
6080 Using PerlIO with sfio may cause problems with some extension modules.
6082 If this doesn't make any sense to you, just accept the default '$dflt'.
6084 rp='Use the PerlIO abstraction layer?'
6091 echo "Ok, doing things the stdio way."
6100 case "$useperlio" in
6101 $define|true|[yY]*) ;;
6104 You are using the SOCKS proxy protocol library which means that you
6105 should also use the PerlIO layer. You may be headed for trouble.
6114 : determine the architecture name
6116 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6117 tarch=`arch`"-$osname"
6118 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6119 if uname -m > tmparch 2>&1 ; then
6120 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6121 -e 's/$/'"-$osname/" tmparch`
6129 case "$myarchname" in
6132 echo "(Your architecture name used to be $myarchname.)"
6136 case "$targetarch" in
6138 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6143 *) dflt="$archname";;
6145 rp='What is your architecture name'
6148 case "$usethreads" in
6150 echo "Threads selected." >&4
6152 *-thread*) echo "...and architecture name already has -thread." >&4
6154 *) archname="$archname-thread"
6155 echo "...setting architecture name to $archname." >&4
6160 case "$usemultiplicity" in
6162 echo "Multiplicity selected." >&4
6164 *-multi*) echo "...and architecture name already has -multi." >&4
6166 *) archname="$archname-multi"
6167 echo "...setting architecture name to $archname." >&4
6172 case "$use64bitint$use64bitall" in
6174 case "$archname64" in
6176 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6179 case "$use64bitint" in
6180 "$define") echo "64 bit integers selected." >&4 ;;
6182 case "$use64bitall" in
6183 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6186 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6188 *) archname="$archname-$archname64"
6189 echo "...setting architecture name to $archname." >&4
6195 case "$uselongdouble" in
6197 echo "Long doubles selected." >&4
6198 case "$longdblsize" in
6200 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6204 *-ld*) echo "...and architecture name already has -ld." >&4
6206 *) archname="$archname-ld"
6207 echo "...setting architecture name to $archname." >&4
6214 case "$useperlio" in
6216 echo "Perlio selected." >&4
6219 echo "Perlio not selected, using stdio." >&4
6221 *-stdio*) echo "...and architecture name already has -stdio." >&4
6223 *) archname="$archname-stdio"
6224 echo "...setting architecture name to $archname." >&4
6230 : determine root of directory hierarchy where package will be installed.
6233 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
6241 By default, $package will be installed in $dflt/bin, manual pages
6242 under $dflt/man, etc..., i.e. with $dflt as prefix for all
6243 installation directories. Typically this is something like /usr/local.
6244 If you wish to have binaries under /usr/bin but other parts of the
6245 installation under /usr/local, that's ok: you will be prompted
6246 separately for each of the installation directories, the prefix being
6247 only used to set the defaults.
6251 rp='Installation prefix to use?'
6259 *) oldprefix="$prefix";;
6268 *) afsroot=$afsroot ;;
6274 $define|true) afs=true ;;
6275 $undef|false) afs=false ;;
6276 *) if test -d $afsroot; then
6284 echo "AFS may be running... I'll be extra cautious then..." >&4
6286 echo "AFS does not seem to be running..." >&4
6289 : determine installation prefix for where package is to be installed.
6293 Since you are running AFS, I need to distinguish the directory in which
6294 files will reside from the directory in which they are installed (and from
6295 which they are presumably copied to the former directory by occult means).
6298 case "$installprefix" in
6299 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
6300 *) dflt="$installprefix";;
6305 In some special cases, particularly when building $package for distribution,
6306 it is convenient to distinguish between the directory in which files should
6307 be installed from the directory ($prefix) in which they
6308 will eventually reside. For most users, these two directories are the same.
6311 case "$installprefix" in
6313 *) dflt=$installprefix;;
6317 rp='What installation prefix should I use for installing files?'
6319 installprefix="$ans"
6320 installprefixexp="$ansexp"
6322 : set the prefixit variable, to compute a suitable default value
6323 prefixit='case "$3" in
6325 case "$oldprefix" in
6326 "") eval "$1=\"\$$2\"";;
6333 ""|" ") eval "$1=\"\$$2\"";;
6339 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6341 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6342 /*-$oldprefix/*|\~*-$oldprefix/*)
6343 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6344 *) eval "$1=\"\$$2\"";;
6348 : get the patchlevel
6350 echo "Getting the current patchlevel..." >&4
6351 if $test -r $rsrc/patchlevel.h;then
6352 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6353 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6354 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6355 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6356 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6357 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6358 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6367 $echo "(You do not have patchlevel.h. Eek.)"
6369 if $test -r $rsrc/.patch ; then
6370 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6371 perl_patchlevel=`cat $rsrc/.patch`
6374 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6375 version_patchlevel_string="version $patchlevel subversion $subversion"
6376 case "$perl_patchlevel" in
6378 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6381 $echo "(You have $package $version_patchlevel_string.)"
6385 : XXX Should be a Configure test for double-dots in filenames.
6386 version=`echo $revision $patchlevel $subversion | \
6387 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6388 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6389 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
6392 version=`echo $revision $patchlevel $subversion | \
6393 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6394 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6395 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6398 : Special case the 5.005_xx maintenance series, which used 5.005
6399 : without any subversion label as a subdirectory in $sitelib
6400 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6401 api_versionstring='5.005'
6404 : determine installation style
6405 : For now, try to deduce it from prefix unless it is already set.
6406 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6407 case "$installstyle" in
6408 '') case "$prefix" in
6409 *perl*) dflt='lib';;
6410 *) dflt='lib/perl5' ;;
6413 *) dflt="$installstyle" ;;
6415 : Probably not worth prompting for this since we prompt for all
6416 : the directories individually, and the prompt would be too long and
6420 : determine where private library files go
6421 : Usual default is /usr/local/lib/perl5/$version.
6422 : Also allow things like /opt/perl/lib/$version, since
6423 : /opt/perl/lib/perl5... would be redundant.
6424 : The default "style" setting is made in installstyle.U
6425 case "$installstyle" in
6426 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6427 *) set dflt privlib lib/$version ;;
6432 There are some auxiliary files for $package that need to be put into a
6433 private library directory that is accessible by everyone.
6437 rp='Pathname where the private library files will reside?'
6440 privlibexp="$ansexp"
6441 : Change installation prefix, if necessary.
6442 if $test X"$prefix" != X"$installprefix"; then
6443 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6445 installprivlib="$privlibexp"
6448 : set the prefixup variable, to restore leading tilda escape
6449 prefixup='case "$prefixexp" in
6451 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6454 : determine where public architecture dependent libraries go
6457 : privlib default is /usr/local/lib/$package/$version
6458 : archlib default is /usr/local/lib/$package/$version/$archname
6459 : privlib may have an optional trailing /share.
6460 tdflt=`echo $privlib | $sed 's,/share$,,'`
6461 tdflt=$tdflt/$archname
6470 $spackage contains architecture-dependent library files. If you are
6471 sharing libraries in a heterogeneous environment, you might store
6472 these files in a separate location. Otherwise, you can just include
6473 them with the rest of the public library files.
6477 rp='Where do you want to put the public architecture-dependent libraries?'
6480 archlibexp="$ansexp"
6481 if $test X"$archlib" = X"$privlib"; then
6486 : Change installation prefix, if necessary.
6487 if $test X"$prefix" != X"$installprefix"; then
6488 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6490 installarchlib="$archlibexp"
6493 : see if setuid scripts can be secure
6496 Some kernels have a bug that prevents setuid #! scripts from being
6497 secure. Some sites have disabled setuid #! scripts because of this.
6499 First let's decide if your kernel supports secure setuid #! scripts.
6500 (If setuid #! scripts would be secure but have been disabled anyway,
6501 don't say that they are secure if asked.)
6506 if $test -d /dev/fd; then
6507 echo "#!$ls" >reflect
6508 chmod +x,u+s reflect
6509 ./reflect >flect 2>&1
6510 if $contains "/dev/fd" flect >/dev/null; then
6511 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6515 If you are not sure if they are secure, I can check but I'll need a
6516 username and password different from the one you are using right now.
6517 If you don't have such a username or don't want me to test, simply
6521 rp='Other username to test security of setuid scripts with?'
6526 case "$d_suidsafe" in
6527 '') echo "I'll assume setuid scripts are *not* secure." >&4
6530 echo "Well, the $hint value is *not* secure." >&4
6532 *) echo "Well, the $hint value *is* secure." >&4
6537 $rm -f reflect flect
6538 echo "#!$ls" >reflect
6539 chmod +x,u+s reflect
6542 echo '"su" will (probably) prompt you for '"$ans's password."
6543 su $ans -c './reflect >flect'
6544 if $contains "/dev/fd" flect >/dev/null; then
6545 echo "Okay, it looks like setuid scripts are secure." >&4
6548 echo "I don't think setuid scripts are secure." >&4
6553 rp='Does your kernel have *secure* setuid scripts?'
6556 [yY]*) val="$define";;
6561 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6562 echo "(That's for file descriptors, not floppy disks.)"
6568 $rm -f reflect flect
6570 : now see if they want to do setuid emulation
6573 case "$d_suidsafe" in
6576 echo "No need to emulate SUID scripts since they are secure here." >&4
6580 Some systems have disabled setuid scripts, especially systems where
6581 setuid scripts cannot be secure. On systems where setuid scripts have
6582 been disabled, the setuid/setgid bits on scripts are currently
6583 useless. It is possible for $package to detect those bits and emulate
6584 setuid/setgid in a secure fashion. This emulation will only work if
6585 setuid scripts have been disabled in your kernel.
6589 "$define") dflt=y ;;
6592 rp="Do you want to do setuid/setgid emulation?"
6595 [yY]*) val="$define";;
6603 : see if this is a malloc.h system
6604 set malloc.h i_malloc
6607 : see if stdlib is available
6608 set stdlib.h i_stdlib
6611 : check for void type
6613 echo "Checking to see how well your C compiler groks the void type..." >&4
6614 case "$voidflags" in
6616 $cat >try.c <<'EOCP'
6622 extern void moo(); /* function returning void */
6623 void (*goo)(); /* ptr to func returning void */
6625 void *hue; /* generic ptr */
6638 int main() { sub(); }
6640 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6641 voidflags=$defvoidused
6642 echo "Good. It appears to support void to the level $package wants.">&4
6643 if $contains warning .out >/dev/null 2>&1; then
6644 echo "However, you might get some warnings that look like this:"
6648 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6649 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6650 echo "It supports 1..."
6651 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6652 echo "It also supports 2..."
6653 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6655 echo "And it supports 4 but not 8 definitely."
6657 echo "It doesn't support 4..."
6658 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6660 echo "But it supports 8."
6663 echo "Neither does it support 8."
6667 echo "It does not support 2..."
6668 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6670 echo "But it supports 4 and 8."
6672 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6674 echo "And it supports 4 but has not heard about 8."
6676 echo "However it supports 8 but not 4."
6681 echo "There is no support at all for void."
6686 case "$voidflags" in
6689 Support flag bits are:
6690 1: basic void declarations.
6691 2: arrays of pointers to functions returning void.
6692 4: operations between pointers to and addresses of void functions.
6693 8: generic void pointers.
6696 rp="Your void support flags add up to what?"
6703 : check for length of pointer
6707 echo "Checking to see how big your pointers are..." >&4
6708 if test "$voidflags" -gt 7; then
6709 echo '#define VOID_PTR char *' > try.c
6711 echo '#define VOID_PTR void *' > try.c
6713 $cat >>try.c <<'EOCP'
6717 printf("%d\n", (int)sizeof(VOID_PTR));
6722 if eval $compile_ok; then
6723 ptrsize=`$run ./try`
6724 echo "Your pointers are $ptrsize bytes long."
6727 echo "(I can't seem to compile the test program. Guessing...)" >&4
6728 rp="What is the size of a pointer (in bytes)?"
6735 case "$use64bitall" in
6736 "$define"|true|[yY]*)
6740 *** You have chosen a maximally 64-bit build, but your pointers
6741 *** are only 4 bytes wide, disabling maximal 64-bitness.
6744 use64bitall="$undef"
6745 case "$use64bitint" in
6746 "$define"|true|[yY]*) ;;
6749 *** Downgrading from maximal 64-bitness to using 64-bit integers.
6752 use64bitint="$define"
6761 : determine which malloc to compile in
6763 case "$usemymalloc" in
6764 [yY]*|true|$define) dflt='y' ;;
6765 [nN]*|false|$undef) dflt='n' ;;
6766 *) case "$ptrsize" in
6772 rp="Do you wish to attempt to use the malloc that comes with $package?"
6778 mallocsrc='malloc.c'
6779 mallocobj="malloc$_o"
6780 d_mymalloc="$define"
6783 : Remove malloc from list of libraries to use
6784 echo "Removing unneeded -lmalloc from library list" >&4
6785 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6788 echo "libs = $libs" >&4
6800 : compute the return types of malloc and free
6802 $cat >malloc.c <<END
6806 #include <sys/types.h>
6820 case "$malloctype" in
6822 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6829 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6833 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6840 echo "Your system uses $freetype free(), it would seem." >&4
6844 After $package is installed, you may wish to install various
6845 add-on modules and utilities. Typically, these add-ons will
6846 be installed under $prefix with the rest
6847 of this package. However, you may wish to install such add-ons
6848 elsewhere under a different prefix.
6850 If you do not wish to put everything under a single prefix, that's
6851 ok. You will be prompted for the individual locations; this siteprefix
6852 is only used to suggest the defaults.
6854 The default should be fine for most people.
6858 rp='Installation prefix to use for add-on modules and utilities?'
6859 : XXX Here might be another good place for an installstyle setting.
6860 case "$siteprefix" in
6862 *) dflt=$siteprefix ;;
6865 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6867 case "$siteprefix" in
6871 *) oldsiteprefix="$prefix";;
6876 siteprefixexp="$ansexp"
6878 : determine where site specific libraries go.
6879 : Usual default is /usr/local/lib/perl5/site_perl/$version
6880 : The default "style" setting is made in installstyle.U
6881 : XXX No longer works with Prefixit stuff.
6882 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6884 '') case "$installstyle" in
6885 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6886 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6894 The installation process will create a directory for
6895 site-specific extensions and modules. Most users find it convenient
6896 to place all site-specific files in this directory rather than in the
6897 main distribution directory.
6901 rp='Pathname for the site-specific library files?'
6904 sitelibexp="$ansexp"
6905 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6906 : Change installation prefix, if necessary.
6907 if $test X"$prefix" != X"$installprefix"; then
6908 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6910 installsitelib="$sitelibexp"
6913 : determine where site specific architecture-dependent libraries go.
6914 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6915 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6916 : sitelib may have an optional trailing /share.
6918 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6919 dflt="$dflt/$archname"
6924 set sitearch sitearch none
6928 The installation process will also create a directory for
6929 architecture-dependent site-specific extensions and modules.
6933 rp='Pathname for the site-specific architecture-dependent library files?'
6936 sitearchexp="$ansexp"
6937 : Change installation prefix, if necessary.
6938 if $test X"$prefix" != X"$installprefix"; then
6939 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6941 installsitearch="$sitearchexp"
6946 The installation process will also create a directory for
6947 vendor-supplied add-ons. Vendors who supply perl with their system
6948 may find it convenient to place all vendor-supplied files in this
6949 directory rather than in the main distribution directory. This will
6950 ease upgrades between binary-compatible maintenance versions of perl.
6952 Of course you may also use these directories in whatever way you see
6953 fit. For example, you might use them to access modules shared over a
6954 company-wide network.
6956 The default answer should be fine for most people.
6957 This causes further questions about vendor add-ons to be skipped
6958 and no vendor-specific directories will be configured for perl.
6961 rp='Do you want to configure vendor-specific add-on directories?'
6962 case "$usevendorprefix" in
6963 define|true|[yY]*) dflt=y ;;
6964 *) : User may have set vendorprefix directly on Configure command line.
6965 case "$vendorprefix" in
6974 rp='Installation prefix to use for vendor-supplied add-ons?'
6975 case "$vendorprefix" in
6977 *) dflt=$vendorprefix ;;
6980 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6982 case "$vendorprefix" in
6986 *) oldvendorprefix="$prefix";;
6990 usevendorprefix="$define"
6992 vendorprefixexp="$ansexp"
6994 *) usevendorprefix="$undef"
7000 case "$vendorprefix" in
7001 '') d_vendorlib="$undef"
7005 *) d_vendorlib="$define"
7006 : determine where vendor-supplied modules go.
7007 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7008 case "$vendorlib" in
7010 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7011 case "$installstyle" in
7012 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7013 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7016 *) dflt="$vendorlib"
7020 rp='Pathname for the vendor-supplied library files?'
7023 vendorlibexp="$ansexp"
7026 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7027 : Change installation prefix, if necessary.
7028 if $test X"$prefix" != X"$installprefix"; then
7029 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
7031 installvendorlib="$vendorlibexp"
7034 case "$vendorprefix" in
7035 '') d_vendorarch="$undef"
7039 *) d_vendorarch="$define"
7040 : determine where vendor-supplied architecture-dependent libraries go.
7041 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7042 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7043 : vendorlib may have an optional trailing /share.
7044 case "$vendorarch" in
7045 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7046 dflt="$dflt/$archname"
7048 *) dflt="$vendorarch" ;;
7051 rp='Pathname for vendor-supplied architecture-dependent files?'
7054 vendorarchexp="$ansexp"
7057 : Change installation prefix, if necessary.
7058 if $test X"$prefix" != X"$installprefix"; then
7059 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
7061 installvendorarch="$vendorarchexp"
7064 : Final catch-all directories to search
7067 Lastly, you can have perl look in other directories for extensions and
7068 modules in addition to those already specified.
7069 These directories will be searched after
7073 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7074 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7076 case "$otherlibdirs" in
7077 ''|' ') dflt='none' ;;
7078 *) dflt="$otherlibdirs" ;;
7081 Enter a colon-separated set of extra paths to include in perl's @INC
7082 search path, or enter 'none' for no extra paths.
7086 rp='Colon-separated list of additional directories for perl to search?'
7089 ' '|''|none) otherlibdirs=' ' ;;
7090 *) otherlibdirs="$ans" ;;
7092 case "$otherlibdirs" in
7096 set d_perl_otherlibdirs
7099 : Cruising for prototypes
7101 echo "Checking out function prototypes..." >&4
7102 $cat >prototype.c <<'EOCP'
7103 int main(int argc, char *argv[]) {
7106 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7107 echo "Your C compiler appears to support function prototypes."
7110 echo "Your C compiler doesn't seem to understand function prototypes."
7117 case "$prototype" in
7119 *) ansi2knr='ansi2knr'
7124 This version of $package can only be compiled by a compiler that
7125 understands function prototypes. Unfortunately, your C compiler
7127 doesn't seem to understand them. Sorry about that.
7129 If GNU cc is available for your system, perhaps you could try that instead.
7131 Eventually, we hope to support building Perl with pre-ANSI compilers.
7132 If you would like to help in that effort, please contact <perlbug@perl.org>.
7134 Aborting Configure now.
7140 : determine where public executables go
7145 rp='Pathname where the public executables will reside?'
7147 if $test "X$ansexp" != "X$binexp"; then
7152 : Change installation prefix, if necessary.
7153 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7154 if $test X"$prefix" != X"$installprefix"; then
7155 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
7157 installbin="$binexp"
7166 Perl can be built with extra modules or bundles of modules which
7167 will be fetched from the CPAN and installed alongside Perl.
7169 Notice that you will need access to the CPAN; either via the Internet,
7170 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7171 be asked later to configure the CPAN.pm module which will in turn do
7172 the installation of the rest of the extra modules or bundles.)
7174 Notice also that if the modules require any external software such as
7175 libraries and headers (the libz library and the zlib.h header for the
7176 Compress::Zlib module, for example) you MUST have any such software
7177 already installed, this configuration process will NOT install such
7180 If this doesn't make any sense to you, just accept the default '$dflt'.
7182 rp='Install any extra modules (y or n)?'
7188 Please list any extra modules or bundles to be installed from CPAN,
7189 with spaces between the names. The names can be in any format the
7190 'install' command of CPAN.pm will understand. (Answer 'none',
7191 without the quotes, to install no extra modules or bundles.)
7201 $rm -f ../extras.lst
7203 *) echo "(Saving the list of extras for later...)"
7204 echo "$extras" > ../extras.lst
7212 : Find perl5.005 or later.
7213 echo "Looking for a previously installed perl5.005 or later... "
7215 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7216 : Check if this perl is recent and can load a simple module
7217 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7220 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7230 '') echo "None found. That's ok.";;
7231 *) echo "Using $perl5." ;;
7234 : Determine list of previous versions to include in @INC
7235 $cat > getverlist <<EOPL
7238 \$api_versionstring = "$api_versionstring";
7239 \$version = "$version";
7240 \$stem = "$sitelib_stem";
7241 \$archname = "$archname";
7243 $cat >> getverlist <<'EOPL'
7244 # Can't have leading @ because metaconfig interprets it as a command!
7245 ;@inc_version_list=();
7246 # XXX Redo to do opendir/readdir?
7249 ;@candidates = glob("5.*");
7255 # XXX ToDo: These comparisons must be reworked when two-digit
7256 # subversions come along, so that 5.7.10 compares as greater than
7257 # 5.7.3! By that time, hope that 5.6.x is sufficiently
7258 # widespread that we can use the built-in version vectors rather
7259 # than reinventing them here. For 5.6.0, however, we must
7260 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
7261 foreach $d (@candidates) {
7262 if ($d lt $version) {
7263 if ($d ge $api_versionstring) {
7264 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
7266 elsif ($d ge "5.005") {
7267 unshift(@inc_version_list, grep { -d } $d);
7271 # Skip newer version. I.e. don't look in
7272 # 5.7.0 if we're installing 5.6.1.
7276 if (@inc_version_list) {
7277 print join(' ', @inc_version_list);
7280 # Blank space to preserve value for next Configure run.
7285 case "$inc_version_list" in
7286 '') if test -x "$perl5$exe_ext"; then
7287 dflt=`$perl5 getverlist`
7292 $undef) dflt='none' ;;
7293 *) eval dflt=\"$inc_version_list\" ;;
7296 ''|' ') dflt=none ;;
7303 In order to ease the process of upgrading, this version of perl
7304 can be configured to use modules built and installed with earlier
7305 versions of perl that were installed under $prefix. Specify here
7306 the list of earlier versions that this version of perl should check.
7307 If Configure detected no earlier versions of perl installed under
7308 $prefix, then the list will be empty. Answer 'none' to tell perl
7309 to not search earlier versions.
7311 The default should almost always be sensible, so if you're not sure,
7312 just accept the default.
7315 rp='List of earlier versions to include in @INC?'
7318 [Nn]one|''|' ') inc_version_list=' ' ;;
7319 *) inc_version_list="$ans" ;;
7321 case "$inc_version_list" in
7323 inc_version_list_init='0';;
7324 *) inc_version_list_init=`echo $inc_version_list |
7325 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7330 : determine whether to install perl also as /usr/bin/perl
7333 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7335 Many scripts expect perl to be installed as /usr/bin/perl.
7336 I can install the perl you are about to compile also as /usr/bin/perl
7337 (in addition to $installbin/perl).
7339 case "$installusrbinperl" in
7340 "$undef"|[nN]*) dflt='n';;
7343 rp="Do you want to install perl as /usr/bin/perl?"
7346 [yY]*) val="$define";;
7352 set installusrbinperl
7355 : see if dld is available
7359 : see if dlopen exists
7366 : determine which dynamic loading, if any, to compile in
7368 dldir="ext/DynaLoader"
7381 $define) dflt='y' ;;
7384 $define) dflt='y' ;;
7386 : Does a dl_xxx.xs file exist for this operating system
7387 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7390 rp="Do you wish to use dynamic loading?"
7397 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7398 dflt="$dldir/dl_${osname}.xs"
7399 elif $test "$d_dlopen" = "$define" ; then
7400 dflt="$dldir/dl_dlopen.xs"
7401 elif $test "$i_dld" = "$define" ; then
7402 dflt="$dldir/dl_dld.xs"
7407 *) dflt="$dldir/$dlsrc"
7410 echo "The following dynamic loading files are available:"
7411 : Can not go over to $dldir because getfile has path hard-coded in.
7412 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7413 rp="Source file to use for dynamic loading"
7419 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7423 Some systems may require passing special flags to $cc -c to
7424 compile modules that will be used to create a shared library.
7425 To use no flags, say "none".
7428 case "$cccdlflags" in
7429 '') case "$gccversion" in
7430 '') case "$osname" in
7432 next) dflt='none' ;;
7433 irix*) dflt='-KPIC' ;;
7434 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7435 sunos) dflt='-pic' ;;
7439 *) case "$osname" in
7440 darwin) dflt='none' ;;
7441 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7446 *) dflt="$cccdlflags" ;;
7448 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7451 none) cccdlflags=' ' ;;
7452 *) cccdlflags="$ans" ;;
7457 Some systems use ld to create libraries that can be dynamically loaded,
7458 while other systems (such as those using ELF) use $cc.
7462 '') $cat >try.c <<'EOM'
7463 /* Test for whether ELF binaries are produced */
7468 int i = open("a.out",O_RDONLY);
7471 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7472 exit(0); /* succeed (yes, it's ELF) */
7477 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7479 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7483 echo "I'll use ld to build dynamic libraries."
7492 rp="What command should be used to create dynamic libraries?"
7498 Some systems may require passing special flags to $ld to create a
7499 library that can be dynamically loaded. If your ld flags include
7500 -L/other/path options to locate libraries outside your loader's normal
7501 search path, you may need to specify those -L options here as well. To
7502 use no flags, say "none".
7505 case "$lddlflags" in
7506 '') case "$osname" in
7507 beos) dflt='-nostart' ;;
7509 case "$gccversion" in
7510 '') dflt="$dflt +vnocompatwarnings" ;;
7513 linux|irix*) dflt='-shared' ;;
7514 next) dflt='none' ;;
7515 solaris) dflt='-G' ;;
7516 sunos) dflt='-assert nodefinitions' ;;
7517 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7521 *) dflt="$lddlflags" ;;
7524 : Try to guess additional flags to pick up local libraries.
7525 : Be careful not to append to a plain 'none'
7529 for thisflag in $ldflags; do
7534 *) dflt="$dflt $thisflag" ;;
7541 ''|' ') dflt='none' ;;
7544 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7547 none) lddlflags=' ' ;;
7548 *) lddlflags="$ans" ;;
7553 Some systems may require passing special flags to $cc to indicate that
7554 the resulting executable will use dynamic linking. To use no flags,
7558 case "$ccdlflags" in
7559 '') case "$osname" in
7560 hpux) dflt='-Wl,-E' ;;
7561 linux) dflt='-rdynamic' ;;
7562 next) dflt='none' ;;
7563 sunos) dflt='none' ;;
7567 *) dflt="$ccdlflags" ;;
7569 rp="Any special flags to pass to $cc to use dynamic linking?"
7572 none) ccdlflags=' ' ;;
7573 *) ccdlflags="$ans" ;;
7587 # No dynamic loading being used, so don't bother even to prompt.
7590 *) case "$useshrplib" in
7591 '') case "$osname" in
7592 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7594 also='Building a shared libperl is required for dynamic loading to work on your system.'
7599 also='Building a shared libperl is needed for MAB support.'
7617 The perl executable is normally obtained by linking perlmain.c with
7618 libperl${_a}, any static extensions (usually just DynaLoader), and
7619 any other libraries needed on this system (such as -lm, etc.). Since
7620 your system supports dynamic loading, it is probably possible to build
7621 a shared libperl.$so. If you will have more than one executable linked
7622 to libperl.$so, this will significantly reduce the size of each
7623 executable, but it may have a noticeable affect on performance. The
7624 default is probably sensible for your system.
7628 rp="Build a shared libperl.$so (y/n)"
7632 useshrplib='true' ;;
7633 *) useshrplib='false' ;;
7638 case "$useshrplib" in
7642 # Figure out a good name for libperl.so. Since it gets stored in
7643 # a version-specific architecture-dependent library, the version
7644 # number isn't really that important, except for making cc/ld happy.
7646 # A name such as libperl.so.3.1
7647 majmin="libperl.$so.$patchlevel.$subversion"
7648 # A name such as libperl.so.301
7649 majonly=`echo $patchlevel $subversion |
7650 $awk '{printf "%d%02d", $1, $2}'`
7651 majonly=libperl.$so.$majonly
7652 # I'd prefer to keep the os-specific stuff here to a minimum, and
7653 # rely on figuring it out from the naming of libc.
7654 case "${osname}${osvers}" in
7657 # XXX How handle the --version stuff for MAB?
7659 linux*) # ld won't link with a bare -lperl otherwise.
7662 cygwin*) # ld links against an importlib
7663 dflt=libperl$lib_ext
7665 *) # Try to guess based on whether libc has major.minor.
7667 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7668 *libc.$so.[0-9]*) dflt=$majonly ;;
7669 *) dflt=libperl.$so ;;
7679 I need to select a good name for the shared libperl. If your system uses
7680 library names with major and minor numbers, then you might want something
7681 like $majmin. Alternatively, if your system uses a single version
7682 number for shared libraries, then you might want to use $majonly.
7683 Or, your system might be quite happy with a simple libperl.$so.
7685 Since the shared libperl will get installed into a version-specific
7686 architecture-dependent directory, the version number of the shared perl
7687 library probably isn't important, so the default should be o.k.
7690 rp='What name do you want to give to the shared libperl?'
7693 echo "Ok, I'll use $libperl"
7696 libperl="libperl${_a}"
7700 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7704 WARNING: Use of the shrpdir variable for the installation location of
7705 the shared $libperl is not supported. It was never documented and
7706 will not work in this version. Let me (perlbug@perl.org)
7707 know of any problems this may cause.
7713 But your current setting of $shrpdir is
7714 the default anyway, so it's harmless.
7719 Further, your current attempted setting of $shrpdir
7720 conflicts with the value of $archlibexp/CORE
7721 that installperl will use.
7728 # How will the perl executable find the installed shared $libperl?
7729 # Add $xxx to ccdlflags.
7730 # If we can't figure out a command-line option, use $shrpenv to
7731 # set env LD_RUN_PATH. The main perl makefile uses this.
7732 shrpdir=$archlibexp/CORE
7735 if "$useshrplib"; then
7738 # We'll set it in Makefile.SH...
7744 xxx="-Wl,-R$shrpdir"
7746 bsdos|linux|irix*|dec_osf)
7747 xxx="-Wl,-rpath,$shrpdir"
7750 # next doesn't like the default...
7753 # beos doesn't like the default, either.
7756 # hpux doesn't like the default, either.
7757 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7760 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7766 # Only add $xxx if it isn't already in ccdlflags.
7767 case " $ccdlflags " in
7769 *) ccdlflags="$ccdlflags $xxx"
7772 Adding $xxx to the flags
7773 passed to $ld so that the perl executable will find the
7774 installed shared $libperl.
7782 # Fix ccdlflags in AIX for building external extensions.
7783 # (For building Perl itself bare -bE:perl.exp is needed,
7784 # Makefile.SH takes care of this.)
7786 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7788 # Respect a hint or command-line value.
7790 '') shrpenv="$tmp_shrpenv" ;;
7792 case "$ldlibpthname" in
7793 '') ldlibpthname=LD_LIBRARY_PATH ;;
7794 none) ldlibpthname='' ;;
7797 : determine where manual pages are on this system
7801 syspath='/usr/share/man/man1 /usr/man/man1'
7802 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7803 syspath="$syspath /usr/man/u_man/man1"
7804 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7805 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7806 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7807 sysman=`./loc . /usr/man/man1 $syspath`
7810 if $test -d "$sysman"; then
7811 echo "System manual is in $sysman." >&4
7813 echo "Could not find manual pages in source form." >&4
7816 : determine where manual pages go
7817 set man1dir man1dir none
7821 $spackage has manual pages available in source form.
7825 echo "However, you don't have nroff, so they're probably useless to you."
7827 '') man1dir="none";;
7830 echo "If you don't want the manual sources installed, answer 'none'."
7835 lookpath="$prefixexp/share/man/man1"
7836 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7837 lookpath="$lookpath $prefixexp/man/p_man/man1"
7838 lookpath="$lookpath $prefixexp/man/u_man/man1"
7839 lookpath="$lookpath $prefixexp/man/man.1"
7841 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7842 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7852 rp="Where do the main $spackage manual pages (source) go?"
7854 if $test "X$man1direxp" != "X$ansexp"; then
7858 man1direxp="$ansexp"
7864 : Change installation prefix, if necessary.
7865 if $test X"$prefix" != X"$installprefix"; then
7866 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7868 installman1dir="$man1direxp"
7871 : What suffix to use on installed man pages
7878 rp="What suffix should be used for the main $spackage man pages?"
7880 '') case "$man1dir" in
7894 *) dflt="$man1ext";;
7901 : see if we can have long filenames
7903 first=123456789abcdef
7905 if (echo hi >$first) 2>/dev/null; then
7906 if $test -f 123456789abcde; then
7907 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7910 echo 'You can have filenames longer than 14 characters.'>&4
7915 You can't have filenames longer than 14 chars.
7916 You can't even think about them!
7922 $rm -rf 123456789abcde*
7924 : determine where library module manual pages go
7925 set man3dir man3dir none
7929 $spackage has manual pages for many of the library modules.
7935 However, you don't have nroff, so they're probably useless to you.
7938 '') man3dir="none";;
7942 case "$d_flexfnam" in
7945 However, your system can't handle the long file names like File::Basename.3.
7948 '') man3dir="none";;
7952 echo "If you don't want the manual sources installed, answer 'none'."
7953 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7955 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7956 if $test -d "$privlib/man/man3"; then
7959 WARNING: Previous versions of perl installed man3 pages into
7960 $privlib/man/man3. This version will suggest a
7961 new default of $dflt.
7965 rp='Do you wish to preserve the old behavior?(y/n)'
7968 y*) dflt="$privlib/man/man3" ;;
7973 *) dflt="$man3dir" ;;
7980 rp="Where do the $package library man pages (source) go?"
7983 man3direxp="$ansexp"
7989 : Change installation prefix, if necessary.
7990 if $test X"$prefix" != X"$installprefix"; then
7991 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7993 installman3dir="$man3direxp"
7996 : What suffix to use on installed man pages
8002 rp="What suffix should be used for the $package library man pages?"
8004 '') case "$man3dir" in
8018 *) dflt="$man3ext";;
8025 : see if we have to deal with yellow pages, now NIS.
8026 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8027 if $test -f /usr/etc/nibindd; then
8029 echo "I'm fairly confident you're on a NeXT."
8031 rp='Do you get the hosts file via NetInfo?'
8040 y*) hostcat='nidump hosts .';;
8041 *) case "$hostcat" in
8042 nidump*) hostcat='';;
8052 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8060 rp='Are you getting the hosts file via yellow pages?'
8063 y*) hostcat='ypcat hosts';;
8064 *) hostcat='cat /etc/hosts';;
8070 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8073 '') test -f /etc/group && groupcat='cat /etc/group';;
8076 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8079 : now get the host name
8081 echo "Figuring out host name..." >&4
8082 case "$myhostname" in
8084 echo 'Maybe "hostname" will work...'
8085 if tans=`sh -c hostname 2>&1` ; then
8093 if $test "$cont"; then
8095 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8096 if tans=`cat /etc/systemid 2>&1` ; then
8098 phostname='cat /etc/systemid'
8099 echo "Whadyaknow. Xenix always was a bit strange..."
8102 elif $test -r /etc/systemid; then
8103 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8106 if $test "$cont"; then
8107 echo 'No, maybe "uuname -l" will work...'
8108 if tans=`sh -c 'uuname -l' 2>&1` ; then
8110 phostname='uuname -l'
8112 echo 'Strange. Maybe "uname -n" will work...'
8113 if tans=`sh -c 'uname -n' 2>&1` ; then
8115 phostname='uname -n'
8117 echo 'Oh well, maybe I can mine it out of whoami.h...'
8118 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8119 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8120 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8122 case "$myhostname" in
8123 '') echo "Does this machine have an identity crisis or something?"
8126 echo "Well, you said $myhostname before..."
8127 phostname='echo $myhostname';;
8133 case "$myhostname" in
8134 '') myhostname=noname ;;
8136 : you do not want to know about this
8141 if $test "$myhostname" ; then
8143 rp='Your host name appears to be "'$myhostname'".'" Right?"
8151 : bad guess or no guess
8152 while $test "X$myhostname" = X ; do
8154 rp="Please type the (one word) name of your host:"
8159 : translate upper to lower if necessary
8160 case "$myhostname" in
8162 echo "(Normalizing case in your host name)"
8163 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8167 case "$myhostname" in
8169 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8170 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8171 echo "(Trimming domain name from host name--host name is now $myhostname)"
8173 *) case "$mydomain" in
8176 test "X$hostcat" = "Xypcat hosts" &&
8177 ypmatch "$myhostname" hosts 2>/dev/null |\
8178 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8181 test "X$hostcat" != "X" &&
8182 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8183 /[ ]$myhostname[ . ]/p" > hosts
8186 if $test -f hosts; then
8187 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8188 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8189 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8190 hosts | $sort | $uniq | \
8191 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8192 case `$echo X$dflt` in
8193 X*\ *) echo "(Several hosts in the database matched hostname)"
8196 X.) echo "(You do not have fully-qualified names in the hosts database)"
8200 echo "(I cannot locate a hosts database anywhere)"
8205 tans=`./loc resolv.conf X /etc /usr/etc`
8206 if $test -f "$tans"; then
8207 echo "(Attempting domain name extraction from $tans)"
8208 dflt=.`$sed -n -e 's/ / /g' \
8209 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8210 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8212 .) dflt=.`$sed -n -e 's/ / /g' \
8213 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8214 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8221 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8222 dflt=.`sh -c domainname 2>/dev/null`
8225 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8229 case "$dflt$osname" in
8230 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8231 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8235 .) echo "(Lost all hope -- silly guess then)"
8241 *) dflt="$mydomain";;
8245 rp="What is your domain name?"
8255 : translate upper to lower if necessary
8258 echo "(Normalizing case in your domain name)"
8259 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8263 : a little sanity check here
8264 case "$phostname" in
8267 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8268 $myhostname$mydomain|$myhostname) ;;
8270 case "$phostname" in
8272 echo "(That doesn't agree with your whoami.h file, by the way.)"
8275 echo "(That doesn't agree with your $phostname command, by the way.)"
8285 I need to get your e-mail address in Internet format if possible, i.e.
8286 something like user@host.domain. Please answer accurately since I have
8287 no easy means to double check it. The default value provided below
8288 is most probably close to reality but may not be valid from outside
8289 your organization...
8293 while test "$cont"; do
8295 '') dflt="$cf_by@$myhostname$mydomain";;
8296 *) dflt="$cf_email";;
8298 rp='What is your e-mail address?'
8304 rp='Address does not look like an Internet one. Use it anyway?'
8320 If you or somebody else will be maintaining perl at your site, please
8321 fill in the correct e-mail address here so that they may be contacted
8322 if necessary. Currently, the "perlbug" program included with perl
8323 will send mail to this address in addition to perlbug@perl.org. You may
8324 enter "none" for no administrator.
8327 case "$perladmin" in
8328 '') dflt="$cf_email";;
8329 *) dflt="$perladmin";;
8331 rp='Perl administrator e-mail address'
8335 : determine whether to only install version-specific parts.
8338 Do you want to install only the version-specific parts of the perl
8339 distribution? Usually you do *not* want to do this.
8341 case "$versiononly" in
8342 "$define"|[Yy]*|true) dflt='y' ;;
8345 rp="Do you want to install only the version-specific parts of perl?"
8348 [yY]*) val="$define";;
8354 case "$versiononly" in
8355 "$define") inc_version_list=''
8356 inc_version_list_init=0
8360 : figure out how to guarantee perl startup
8361 case "$startperl" in
8363 case "$sharpbang" in
8367 I can use the #! construct to start perl on your system. This will
8368 make startup of perl scripts faster, but may cause problems if you
8369 want to share those scripts and perl is not in a standard place
8370 ($binexp/perl) on all your platforms. The alternative is to force
8371 a shell by starting the script with a single ':' character.
8374 case "$versiononly" in
8375 "$define") dflt="$binexp/perl$version";;
8376 *) dflt="$binexp/perl";;
8378 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8381 none) startperl=": # use perl";;
8382 *) startperl="#!$ans"
8383 if $test 30 -lt `echo "$ans" | wc -c`; then
8386 WARNING: Some systems limit the #! command to 32 characters.
8387 If you experience difficulty running Perl scripts with #!, try
8388 installing Perl in a directory with a shorter pathname.
8394 *) startperl=": # use perl"
8399 echo "I'll use $startperl to start perl scripts."
8401 : figure best path for perl in scripts
8404 case "$versiononly" in
8405 "$define") perlpath="$binexp/perl$version";;
8406 *) perlpath="$binexp/perl";;
8408 case "$startperl" in
8413 I will use the "eval 'exec'" idiom to start Perl on your system.
8414 I can use the full path of your Perl binary for this purpose, but
8415 doing so may cause problems if you want to share those scripts and
8416 Perl is not always in a standard place ($binexp/perl).
8420 rp="What path shall I use in \"eval 'exec'\"?"
8427 case "$startperl" in
8429 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8432 : determine where public executable scripts go
8433 set scriptdir scriptdir
8435 case "$scriptdir" in
8438 : guess some guesses
8439 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8440 $test -d /usr/share/bin && dflt=/usr/share/bin
8441 $test -d /usr/local/script && dflt=/usr/local/script
8442 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8443 $test -d $prefixexp/script && dflt=$prefixexp/script
8447 *) dflt="$scriptdir"
8452 Some installations have a separate directory just for executable scripts so
8453 that they can mount it across multiple architectures but keep the scripts in
8454 one spot. You might, for example, have a subdirectory of /usr/share for this.
8455 Or you might just lump your scripts in with all your other executables.
8459 rp='Where do you keep publicly executable scripts?'
8461 if $test "X$ansexp" != "X$scriptdirexp"; then
8465 scriptdirexp="$ansexp"
8466 : Change installation prefix, if necessary.
8467 if $test X"$prefix" != X"$installprefix"; then
8468 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8470 installscript="$scriptdirexp"
8473 : determine where add-on public executables go
8475 '') dflt=$siteprefix/bin ;;
8479 rp='Pathname where the add-on public executables should be installed?'
8482 sitebinexp="$ansexp"
8483 : Change installation prefix, if necessary.
8484 if $test X"$prefix" != X"$installprefix"; then
8485 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8487 installsitebin="$sitebinexp"
8490 : define an is-a-typedef? function
8491 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8493 "") inclist="sys/types.h";;
8495 eval "varval=\$$var";
8499 for inc in $inclist; do
8500 echo "#include <$inc>" >>temp.c;
8502 echo "#ifdef $type" >> temp.c;
8503 echo "printf(\"We have $type\");" >> temp.c;
8504 echo "#endif" >> temp.c;
8505 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8506 if $contains $type temp.E >/dev/null 2>&1; then
8512 *) eval "$var=\$varval";;
8515 : define an is-a-typedef? function that prompts if the type is not available.
8516 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8518 "") inclist="sys/types.h";;
8520 eval "varval=\$$var";
8524 for inc in $inclist; do
8525 echo "#include <$inc>" >>temp.c;
8527 echo "#ifdef $type" >> temp.c;
8528 echo "printf(\"We have $type\");" >> temp.c;
8529 echo "#endif" >> temp.c;
8530 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8532 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8533 if $contains $type temp.E >/dev/null 2>&1; then
8534 echo "$type found." >&4;
8537 echo "$type NOT found." >&4;
8543 *) eval "$var=\$varval";;
8546 : see what type lseek is declared as in the kernel
8547 rp="What is the type used for lseek's offset on this system?"
8548 set off_t lseektype long stdio.h sys/types.h
8552 echo "Checking to see how big your file offsets are..." >&4
8554 #include <sys/types.h>
8558 printf("%d\n", (int)sizeof($lseektype));
8563 if eval $compile_ok; then
8564 lseeksize=`$run ./try`
8565 echo "Your file offsets are $lseeksize bytes long."
8569 echo "(I can't seem to compile the test program. Guessing...)"
8570 rp="What is the size of your file offsets (in bytes)?"
8576 : see what type file positions are declared as in the library
8577 rp="What is the type for file position used by fsetpos()?"
8578 set fpos_t fpostype long stdio.h sys/types.h
8583 *_t) zzz="$fpostype" ;;
8586 echo "Checking the size of $zzz..." >&4
8588 #include <sys/types.h>
8591 printf("%d\n", (int)sizeof($fpostype));
8596 if eval $compile_ok; then
8600 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8603 echo "Your $zzz is $fpossize bytes long."
8609 echo "(I can't compile the test program. Guessing...)" >&4
8610 rp="What is the size of your file positions (in bytes)?"
8617 # Backward compatibility (uselfs is deprecated).
8619 "$define"|true|[yY]*)
8622 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8624 uselargefiles="$define"
8628 case "$lseeksize:$fpossize" in
8631 You can have files larger than 2 gigabytes.
8634 *) case "$uselargefiles" in
8635 "$undef"|false|[nN]*) dflt='n' ;;
8640 Perl can be built to understand large files (files larger than 2 gigabytes)
8641 on some systems. To do so, Configure can be run with -Duselargefiles.
8643 If this doesn't make any sense to you, just accept the default '$dflt'.
8645 rp='Try to understand large files, if available?'
8648 y|Y) val="$define" ;;
8655 case "$uselargefiles" in
8657 : Look for a hint-file generated 'call-back-unit'. If the
8658 : user has specified that a large files perl is to be built,
8659 : we may need to set or change some other defaults.
8660 if $test -f uselargefiles.cbu; then
8661 echo "Your platform has some specific hints for large file builds, using them..."
8662 . ./uselargefiles.cbu
8664 echo "Rechecking to see how big your file offsets are..." >&4
8666 #include <sys/types.h>
8670 printf("%d\n", (int)sizeof($lseektype));
8675 if eval $compile_ok; then
8676 lseeksize=`$run ./try`
8677 $echo "Your file offsets are now $lseeksize bytes long."
8681 echo "(I can't seem to compile the test program. Guessing...)"
8682 rp="What is the size of your file offsets (in bytes)?"
8687 *_t) zzz="$fpostype" ;;
8690 $echo $n "Rechecking the size of $zzz...$c" >&4
8692 #include <sys/types.h>
8695 printf("%d\n", (int)sizeof($fpostype));
8700 if eval $compile_ok; then
8705 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8708 echo " $fpossize bytes." >&4
8714 echo "(I can't compile the test program. Guessing...)" >&4
8715 rp="What is the size of your file positions (in bytes)?"
8724 case "$vendorprefix" in
8725 '') d_vendorbin="$undef"
8729 *) d_vendorbin="$define"
8730 : determine where vendor-supplied executables go.
8731 case "$vendorbin" in
8732 '') dflt=$vendorprefix/bin ;;
8733 *) dflt="$vendorbin" ;;
8736 rp='Pathname for the vendor-supplied executables directory?'
8739 vendorbinexp="$ansexp"
8742 : Change installation prefix, if necessary.
8743 if $test X"$prefix" != X"$installprefix"; then
8744 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
8746 installvendorbin="$vendorbinexp"
8749 : see if qgcvt exists
8753 : Check how to convert floats to strings.
8755 if test "X$d_Gconvert" = X; then
8758 echo "Checking for an efficient way to convert floats to strings."
8760 case "$uselongdouble" in
8761 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8763 case "$d_longdbl" in
8764 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8766 case "$d_PRIgldbl" in
8767 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8771 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8772 char *myname = "gconvert";
8775 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8776 char *myname = "gcvt";
8779 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8780 char *myname = "qgcvt";
8781 #define DOUBLETYPE long double
8784 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8786 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8788 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
8791 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8793 char *myname = "sprintf";
8797 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8798 #define DOUBLETYPE long double
8800 #define DOUBLETYPE double
8806 #define I_STDLIB $i_stdlib
8812 checkit(expect, got)
8816 if (strcmp(expect, got)) {
8817 printf("%s oddity: Expected %s, got %s\n",
8818 myname, expect, got);
8828 /* This must be 1st test on (which?) platform */
8829 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8830 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8831 checkit("0.1", buf);
8833 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
8834 checkit("0.01", buf);
8836 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
8837 checkit("0.001", buf);
8839 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
8840 checkit("0.0001", buf);
8842 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
8843 if (strlen(buf) > 5)
8844 checkit("9e-005", buf); /* for Microsoft ?? */
8846 checkit("9e-05", buf);
8848 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8851 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8852 checkit("1.1", buf);
8854 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8855 checkit("1.01", buf);
8857 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8858 checkit("1.001", buf);
8860 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8861 checkit("1.0001", buf);
8863 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8864 checkit("1.00001", buf);
8866 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8867 checkit("1.000001", buf);
8869 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8872 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8875 /* Some Linux gcvt's give 1.e+5 here. */
8876 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8877 checkit("100000", buf);
8879 /* Some Linux gcvt's give -1.e+5 here. */
8880 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8881 checkit("-100000", buf);
8883 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8884 checkit("123.456", buf);
8886 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
8887 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
8888 /* 34 should be enough to scare even long double
8889 * places into using the e notation. */
8890 if (strlen(buf) > 5)
8891 checkit("1e+034", buf); /* for Microsoft */
8893 checkit("1e+34", buf);
8895 /* For Perl, if you add additional tests here, also add them to
8896 * t/base/num.t for benefit of platforms not using Configure or
8897 * overriding d_Gconvert */
8902 : first add preferred functions to our list
8904 for xxx_convert in $gconvert_preference; do
8905 case $xxx_convert in
8906 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
8907 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
8910 : then add any others
8911 for xxx_convert in gconvert gcvt sprintf; do
8914 *) xxx_list="$xxx_list $xxx_convert" ;;
8918 case "$d_longdbl$uselongdouble" in
8920 : again, add prefered functions to our list first
8922 for xxx_convert in $gconvert_ld_preference; do
8923 case $xxx_convert in
8924 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
8925 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
8928 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
8929 for xxx_convert in qgcvt sprintf $xxx_list; do
8930 case "$xxx_ld_list" in
8931 $xxx_convert*|*" $xxx_convert"*) ;;
8932 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
8935 : if sprintf cannot do long doubles, move it to the end
8936 if test "$d_PRIgldbl" != "$define"; then
8937 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
8939 : if no qgcvt, remove it
8940 if test "$d_qgcvt" != "$define"; then
8941 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
8944 xxx_list="$xxx_ld_list"
8948 for xxx_convert in $xxx_list; do
8949 echo "Trying $xxx_convert..."
8951 set try -DTRY_$xxx_convert
8952 if eval $compile; then
8953 echo "$xxx_convert() found." >&4
8955 echo "I'll use $xxx_convert to convert floats into a string." >&4
8958 echo "...But $xxx_convert didn't work as I expected."
8962 echo "$xxx_convert NOT found." >&4
8966 if test X$xxx_convert = X; then
8967 echo "*** WHOA THERE!!! ***" >&4
8968 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
8972 case "$xxx_convert" in
8973 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8974 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8975 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8976 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8977 "$define$define$define")
8978 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8979 "$define$define$undef")
8980 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
8981 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8988 : see if _fwalk exists
8992 : Initialize h_fcntl
8995 : Initialize h_sysfile
8998 : access call always available on UNIX
9002 : locate the flags for 'access()'
9006 $cat >access.c <<'EOCP'
9007 #include <sys/types.h>
9012 #include <sys/file.h>
9021 : check sys/file.h first, no particular reason here
9022 if $test `./findhdr sys/file.h` && \
9023 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9025 echo "<sys/file.h> defines the *_OK access constants." >&4
9026 elif $test `./findhdr fcntl.h` && \
9027 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9029 echo "<fcntl.h> defines the *_OK access constants." >&4
9030 elif $test `./findhdr unistd.h` && \
9031 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9032 echo "<unistd.h> defines the *_OK access constants." >&4
9034 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9040 : see if accessx exists
9041 set accessx d_accessx
9044 : see if alarm exists
9048 : see if POSIX threads are available
9049 set pthread.h i_pthread
9052 : define a fucntion to check prototypes
9053 $cat > protochk <<EOSH
9056 optimize="$optimize"
9058 prototype="$prototype"
9061 usethreads=$usethreads
9062 i_pthread=$i_pthread
9063 pthread_h_first=$pthread_h_first
9066 $cat >> protochk <<'EOSH'
9071 while test $# -ge 2; do
9073 $define) echo "#include <$2>" >> try.c ;;
9074 literal) echo "$2" >> try.c ;;
9076 # Extra magic for the benefit of systems that need pthread.h
9077 # to be included early to correctly detect threadsafe functions.
9078 # Such functions must guarantee themselves, though, that the usethreads
9079 # and i_pthread have been defined, before calling protochk.
9080 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9081 echo "#include <pthread.h>" >> try.c
9086 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9087 cat >> try.c <<'EOCP'
9088 #ifdef CAN_PROTOTYPE
9089 #define _(args) args
9094 echo "$foo" >> try.c
9095 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9096 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9104 hasproto='varname=$1; func=$2; shift; shift;
9105 while $test $# -ge 2; do
9107 $define) echo "#include <$2>";;
9111 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9112 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9113 echo "$func() prototype found.";
9116 echo "$func() prototype NOT found.";
9121 $rm -f try.c tryout.c'
9123 : see if sys/types.h has to be included
9124 set sys/types.h i_systypes
9127 : see if sys/select.h has to be included
9128 set sys/select.h i_sysselct
9131 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9132 while $test $# -ge 2; do
9134 $define) echo "#include <$2>";;
9138 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9140 if eval $compile; then
9149 : see if we should include time.h, sys/time.h, or both
9151 if test "X$timeincl" = X; then
9152 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9153 $echo $n "I'm now running the test program...$c"
9154 $cat >try.c <<'EOCP'
9155 #include <sys/types.h>
9160 #ifdef SYSTIMEKERNEL
9163 #include <sys/time.h>
9166 #include <sys/select.h>
9175 struct timezone tzp;
9177 if (foo.tm_sec == foo.tm_sec)
9180 if (bar.tv_sec == bar.tv_sec)
9187 for s_timezone in '-DS_TIMEZONE' ''; do
9189 for s_timeval in '-DS_TIMEVAL' ''; do
9190 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9191 for i_time in '' '-DI_TIME'; do
9192 for i_systime in '-DI_SYSTIME' ''; do
9195 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9196 if eval $compile; then
9197 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9201 $echo $n "Succeeded with $flags$c"
9213 *SYSTIMEKERNEL*) i_systimek="$define"
9214 timeincl=`./findhdr sys/time.h`
9215 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9216 *) i_systimek="$undef";;
9219 *I_TIME*) i_time="$define"
9220 timeincl=`./findhdr time.h`" $timeincl"
9221 echo "We'll include <time.h>." >&4;;
9222 *) i_time="$undef";;
9225 *I_SYSTIME*) i_systime="$define"
9226 timeincl=`./findhdr sys/time.h`" $timeincl"
9227 echo "We'll include <sys/time.h>." >&4;;
9228 *) i_systime="$undef";;
9232 : see if struct tm knows about tm_zone
9233 case "$i_systime$i_time" in
9236 echo "Checking to see if your struct tm has tm_zone field..." >&4
9237 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9245 case "$d_tm_tm_zone" in
9246 "$define") echo "Yes, it does." ;;
9247 *) echo "No, it doesn't." ;;
9249 : see if struct tm knows about tm_gmtoff
9250 case "$i_systime$i_time" in
9253 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9254 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9262 case "$d_tm_tm_gmtoff" in
9263 "$define") echo "Yes, it does." ;;
9264 *) echo "No, it doesn't." ;;
9267 : see if asctime_r exists
9268 set asctime_r d_asctime_r
9270 case "$d_asctime_r" in
9272 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9273 case "$d_asctime_r_proto:$usethreads" in
9274 ":define") d_asctime_r_proto=define
9275 set d_asctime_r_proto asctime_r $hdrs
9279 case "$d_asctime_r_proto" in
9281 case "$asctime_r_proto" in
9282 ''|0) try='char* asctime_r(const struct tm*, char*);'
9283 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9285 case "$asctime_r_proto" in
9286 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9287 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9289 case "$asctime_r_proto" in
9290 ''|0) try='int asctime_r(const struct tm*, char*);'
9291 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9293 case "$asctime_r_proto" in
9294 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9295 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9297 case "$asctime_r_proto" in
9298 ''|0) d_asctime_r=undef
9300 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9301 * ) case "$asctime_r_proto" in
9302 REENTRANT_PROTO*) ;;
9303 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9305 echo "Prototype: $try" ;;
9308 *) case "$usethreads" in
9309 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9316 *) asctime_r_proto=0
9320 : see if atolf exists
9324 : see if atoll exists
9328 : Look for GNU-cc style attribute checking
9330 echo "Checking whether your compiler can handle __attribute__ ..." >&4
9331 $cat >attrib.c <<'EOCP'
9333 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
9335 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9336 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9337 echo "Your C compiler doesn't fully support __attribute__."
9340 echo "Your C compiler supports __attribute__."
9344 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9351 : see if bcmp exists
9355 : see if bcopy exists
9359 : see if this is a unistd.h system
9360 set unistd.h i_unistd
9363 : see if getpgrp exists
9364 set getpgrp d_getpgrp
9367 case "$d_getpgrp" in
9370 echo "Checking to see which flavor of getpgrp is in use..."
9373 #include <sys/types.h>
9375 # include <unistd.h>
9379 if (getuid() == 0) {
9380 printf("(I see you are running Configure as super-user...)\n");
9384 if (getpgrp(1) == 0)
9393 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9394 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
9396 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9397 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
9400 echo "I can't seem to compile and run the test program."
9402 xxx="a USG one, i.e. you use getpgrp()."
9404 # SVR4 systems can appear rather BSD-ish.
9407 xxx="a BSD one, i.e. you use getpgrp(pid)."
9411 xxx="probably a USG one, i.e. you use getpgrp()."
9416 echo "Assuming your getpgrp is $xxx" >&4
9425 : see if setpgrp exists
9426 set setpgrp d_setpgrp
9429 case "$d_setpgrp" in
9432 echo "Checking to see which flavor of setpgrp is in use..."
9435 #include <sys/types.h>
9437 # include <unistd.h>
9441 if (getuid() == 0) {
9442 printf("(I see you are running Configure as super-user...)\n");
9446 if (-1 == setpgrp(1, 1))
9449 if (setpgrp() != -1)
9455 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9456 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
9458 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9459 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
9462 echo "(I can't seem to compile and run the test program.)"
9464 xxx="a USG one, i.e. you use setpgrp()."
9466 # SVR4 systems can appear rather BSD-ish.
9469 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
9473 xxx="probably a USG one, i.e. you use setpgrp()."
9478 echo "Assuming your setpgrp is $xxx" >&4
9486 : see if bzero exists
9490 : see if signal is declared as pointer to function returning int or void
9492 xxx=`./findhdr signal.h`
9493 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
9494 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9495 echo "You have int (*signal())() instead of void." >&4
9497 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9498 echo "You have void (*signal())()." >&4
9500 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
9501 echo "You have int (*signal())() instead of void." >&4
9503 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
9504 echo "You have void (*signal())()." >&4
9507 case "$d_voidsig" in
9509 echo "I can't determine whether signal handler returns void or int..." >&4
9511 rp="What type does your signal handler return?"
9518 echo "As you already told me, signal handler returns void." >&4
9521 *) echo "As you already told me, signal handler returns int." >&4
9528 case "$d_voidsig" in
9529 "$define") signal_t="void";;
9534 : check for ability to cast large floats to 32-bit ints.
9536 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
9537 if $test "$intsize" -ge 4; then
9544 #include <sys/types.h>
9546 $signal_t blech(s) int s; { exit(3); }
9553 signal(SIGFPE, blech);
9555 /* Don't let compiler optimize the test away. Store the number
9556 in a writable string for gcc to pass to sscanf under HP/UX.
9558 sprintf(str, "2147483647");
9559 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
9563 /* x86 processors will probably give 0x8000 0000, which is a
9564 sign change. We don't want that. We want to mimic SPARC
9565 behavior here, which is to preserve the sign and give
9568 if (i32 != ($xxx) f)
9574 if eval $compile_ok; then
9578 echo "(I can't seem to compile the test program--assuming it can't)"
9586 echo "Nope, it can't."
9593 : check for ability to cast negative floats to unsigned
9595 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
9598 #include <sys/types.h>
9600 $signal_t blech(s) int s; { exit(7); }
9601 $signal_t blech_in_list(s) int s; { exit(4); }
9602 unsigned long dummy_long(p) unsigned long p; { return p; }
9603 unsigned int dummy_int(p) unsigned int p; { return p; }
9604 unsigned short dummy_short(p) unsigned short p; { return p; }
9608 unsigned long along;
9610 unsigned short ashort;
9614 /* Frustrate gcc-2.7.2's optimizer which failed this test with
9615 a direct f = -123. assignment. gcc-2.8.0 reportedly
9616 optimized the whole file away
9618 /* Store the number in a writable string for gcc to pass to
9621 sprintf(str, "-123");
9622 sscanf(str, "%lf", &f); /* f = -123.; */
9624 signal(SIGFPE, blech);
9625 along = (unsigned long)f;
9626 aint = (unsigned int)f;
9627 ashort = (unsigned short)f;
9628 if (along != (unsigned long)-123)
9630 if (aint != (unsigned int)-123)
9632 if (ashort != (unsigned short)-123)
9634 sprintf(str, "1073741824.");
9635 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
9638 along = (unsigned long)f;
9639 if (along != 0x80000000)
9643 along = (unsigned long)f;
9644 if (along != 0x7fffffff)
9648 along = (unsigned long)f;
9649 if (along != 0x80000001)
9653 signal(SIGFPE, blech_in_list);
9654 sprintf(str, "123.");
9655 sscanf(str, "%lf", &f); /* f = 123.; */
9656 along = dummy_long((unsigned long)f);
9657 aint = dummy_int((unsigned int)f);
9658 ashort = dummy_short((unsigned short)f);
9659 if (along != (unsigned long)123)
9661 if (aint != (unsigned int)123)
9663 if (ashort != (unsigned short)123)
9670 if eval $compile_ok; then
9674 echo "(I can't seem to compile the test program--assuming it can't)"
9677 case "$castflags" in
9682 echo "Nope, it can't."
9689 : see if vprintf exists
9691 if set vprintf val -f d_vprintf; eval $csym; $val; then
9692 echo 'vprintf() found.' >&4
9695 #include <varargs.h>
9697 int main() { xxx("foo"); }
9706 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
9710 if eval $compile && $run ./try; then
9711 echo "Your vsprintf() returns (int)." >&4
9714 echo "Your vsprintf() returns (char*)." >&4
9718 echo 'vprintf() NOT found.' >&4
9729 : see if chown exists
9733 : see if chroot exists
9737 : see if chsize exists
9741 : see if class exists
9745 hasstruct='varname=$1; struct=$2; shift; shift;
9746 while $test $# -ge 2; do
9748 $define) echo "#include <$2>";;
9752 echo "int main () { struct $struct foo; }" >> try.c;
9754 if eval $compile; then
9765 : see whether socket exists
9767 $echo $n "Hmm... $c" >&4
9768 if set socket val -f d_socket; eval $csym; $val; then
9769 echo "Looks like you have Berkeley networking support." >&4
9771 if set setsockopt val -f; eval $csym; $val; then
9774 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9778 if $contains socklib libc.list >/dev/null 2>&1; then
9779 echo "Looks like you have Berkeley networking support." >&4
9781 : we will have to assume that it supports the 4.2 BSD interface
9784 echo "You don't have Berkeley networking in libc$_a..." >&4
9785 if test "X$d_socket" = "X$define"; then
9786 echo "...but you seem to believe that you have sockets." >&4
9788 for net in net socket
9790 if test -f /usr/lib/lib$net$_a; then
9791 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9792 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9793 if $contains socket libc.list >/dev/null 2>&1; then
9798 echo "...but the Wollongong group seems to have hacked it in." >&4
9799 sockethdr="-I/usr/netinclude"
9802 echo "Found Berkeley sockets interface in lib$net." >&4
9803 if $contains setsockopt libc.list >/dev/null 2>&1; then
9806 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9813 if test "X$d_socket" != "X$define"; then
9814 echo "or anywhere else I see." >&4
9822 : see if socketpair exists
9823 set socketpair d_sockpair
9828 echo "Checking the availability of certain socket constants..." >&4
9829 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9830 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9832 #include <sys/types.h>
9833 #include <sys/socket.h>
9839 set try; if eval $compile; then
9842 set d_${enum}; eval $setvar
9846 : see if this is a sys/uio.h system
9847 set sys/uio.h i_sysuio
9852 echo "Checking to see if your system supports struct cmsghdr..." >&4
9853 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
9855 case "$d_cmsghdr_s" in
9856 "$define") echo "Yes, it does." ;;
9857 *) echo "No, it doesn't." ;;
9861 : check for const keyword
9863 echo 'Checking to see if your C compiler knows about "const"...' >&4
9864 $cat >const.c <<'EOCP'
9865 typedef struct spug { int drokk; } spug;
9872 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
9874 echo "Yup, it does."
9877 echo "Nope, it doesn't."
9882 : see if crypt exists
9887 $define) cryptlib='' ;;
9888 *) if set crypt val -f d_crypt; eval $csym; $val; then
9889 echo 'crypt() found.' >&4
9893 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
9894 if $test -z "$cryptlib"; then
9895 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
9899 if $test -z "$cryptlib"; then
9900 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
9904 if $test -z "$cryptlib"; then
9905 cryptlib=`./loc libcrypt$_a "" $libpth`
9909 if $test -z "$cryptlib"; then
9910 echo 'crypt() NOT found.' >&4
9921 : see if this is a crypt.h system
9925 : see if crypt_r exists
9926 set crypt_r d_crypt_r
9928 case "$d_crypt_r" in
9930 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
9931 case "$d_crypt_r_proto:$usethreads" in
9932 ":define") d_crypt_r_proto=define
9933 set d_crypt_r_proto crypt_r $hdrs
9937 case "$d_crypt_r_proto" in
9939 case "$crypt_r_proto" in
9940 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
9941 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
9943 case "$crypt_r_proto" in
9944 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
9945 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
9947 case "$crypt_r_proto" in
9948 ''|0) d_crypt_r=undef
9950 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
9951 * ) case "$crypt_r_proto" in
9952 REENTRANT_PROTO*) ;;
9953 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
9955 echo "Prototype: $try" ;;
9958 *) case "$usethreads" in
9959 define) echo "crypt_r has no prototype, not using it." >&4 ;;
9970 : get csh whereabouts
9972 'csh') val="$undef" ;;
9977 : Respect a hint or command line value for full_csh.
9979 '') full_csh=$csh ;;
9982 : see if ctermid_r exists
9983 set ctermid_r d_ctermid_r
9985 case "$d_ctermid_r" in
9987 hdrs="$i_systypes sys/types.h define stdio.h "
9988 case "$d_ctermid_r_proto:$usethreads" in
9989 ":define") d_ctermid_r_proto=define
9990 set d_ctermid_r_proto ctermid_r $hdrs
9994 case "$d_ctermid_r_proto" in
9996 case "$ctermid_r_proto" in
9997 ''|0) try='char* ctermid_r(char*);'
9998 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10000 case "$ctermid_r_proto" in
10001 ''|0) d_ctermid_r=undef
10003 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10004 * ) case "$ctermid_r_proto" in
10005 REENTRANT_PROTO*) ;;
10006 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10008 echo "Prototype: $try" ;;
10011 *) case "$usethreads" in
10012 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10019 *) ctermid_r_proto=0
10023 : see if ctime_r exists
10024 set ctime_r d_ctime_r
10026 case "$d_ctime_r" in
10028 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10029 case "$d_ctime_r_proto:$usethreads" in
10030 ":define") d_ctime_r_proto=define
10031 set d_ctime_r_proto ctime_r $hdrs
10035 case "$d_ctime_r_proto" in
10037 case "$ctime_r_proto" in
10038 ''|0) try='char* ctime_r(const time_t*, char*);'
10039 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10041 case "$ctime_r_proto" in
10042 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10043 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10045 case "$ctime_r_proto" in
10046 ''|0) try='int ctime_r(const time_t*, char*);'
10047 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10049 case "$ctime_r_proto" in
10050 ''|0) try='int ctime_r(const time_t*, char*, int);'
10051 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10053 case "$ctime_r_proto" in
10054 ''|0) d_ctime_r=undef
10056 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10057 * ) case "$ctime_r_proto" in
10058 REENTRANT_PROTO*) ;;
10059 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10061 echo "Prototype: $try" ;;
10064 *) case "$usethreads" in
10065 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10076 : see if cuserid exists
10077 set cuserid d_cuserid
10080 : see if this is a limits.h system
10081 set limits.h i_limits
10084 : see if this is a float.h system
10085 set float.h i_float
10088 : See if number of significant digits in a double precision number is known
10090 $cat >dbl_dig.c <<EOM
10091 #$i_limits I_LIMITS
10094 #include <limits.h>
10100 printf("Contains DBL_DIG");
10103 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10104 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10105 echo "DBL_DIG found." >&4
10108 echo "DBL_DIG NOT found." >&4
10115 : see if dbm.h is available
10116 : see if dbmclose exists
10117 set dbmclose d_dbmclose
10120 case "$d_dbmclose" in
10130 *) set rpcsvc/dbm.h i_rpcsvcdbm
10135 *) echo "We won't be including <dbm.h>"
10145 : see if prototype for dbminit is available
10147 set d_dbminitproto dbminit $i_dbm dbm.h
10150 : see if difftime exists
10151 set difftime d_difftime
10154 : see if this is a dirent system
10156 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10158 echo "<dirent.h> found." >&4
10161 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10162 echo "<sys/dir.h> found." >&4
10165 xinc=`./findhdr sys/ndir.h`
10167 echo "<dirent.h> NOT found." >&4
10172 : Look for type of directory structure.
10174 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10176 case "$direntrytype" in
10178 case "$i_dirent" in
10179 $define) guess1='struct dirent' ;;
10180 *) guess1='struct direct' ;;
10183 *) guess1="$direntrytype"
10188 'struct dirent') guess2='struct direct' ;;
10189 *) guess2='struct dirent' ;;
10192 if $contains "$guess1" try.c >/dev/null 2>&1; then
10193 direntrytype="$guess1"
10194 echo "Your directory entries are $direntrytype." >&4
10195 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10196 direntrytype="$guess2"
10197 echo "Your directory entries seem to be $direntrytype." >&4
10199 echo "I don't recognize your system's directory entries." >&4
10200 rp="What type is used for directory entries on this system?"
10203 direntrytype="$ans"
10208 : see if the directory entry stores field length
10210 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10211 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10212 echo "Good, your directory entry keeps length information in d_namlen." >&4
10215 echo "Your directory entry does not know about the d_namlen field." >&4
10222 : see if this is an sysdir system
10223 set sys/dir.h i_sysdir
10226 : see if this is an sysndir system
10227 set sys/ndir.h i_sysndir
10232 $cat >dirfd.c <<EOM
10234 #$i_dirent I_DIRENT /**/
10235 #$i_sysdir I_SYS_DIR /**/
10236 #$i_sysndir I_SYS_NDIR /**/
10237 #$i_systypes I_SYS_TYPES /**/
10238 #if defined(I_SYS_TYPES)
10239 #include <sys/types.h>
10241 #if defined(I_DIRENT)
10242 #include <dirent.h>
10243 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10244 #include <sys/dir.h>
10248 #include <sys/ndir.h>
10252 #include <ndir.h> /* may be wrong in the future */
10254 #include <sys/dir.h>
10260 DIR *dirp = opendir(".");
10261 if (dirfd(dirp) >= 0)
10268 if eval $compile; then
10272 $define) echo "dirfd() found." >&4 ;;
10273 *) echo "dirfd() NOT found." >&4 ;;
10279 : see if dlerror exists
10282 set dlerror d_dlerror
10286 : see if dlfcn is available
10287 set dlfcn.h i_dlfcn
10294 On a few systems, the dynamically loaded modules that perl generates and uses
10295 will need a different extension than shared libs. The default will probably
10301 *) dflt="$dlext" ;;
10303 rp='What is the extension of dynamically loaded modules'
10312 : Check if dlsym need a leading underscore
10318 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
10319 $cat >dyna.c <<'EOM'
10328 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
10330 #include <sys/types.h>
10335 extern int fred() ;
10344 int mode = RTLD_LAZY ;
10346 handle = dlopen("./dyna.$dlext", mode) ;
10347 if (handle == NULL) {
10352 symbol = dlsym(handle, "fred") ;
10353 if (symbol == NULL) {
10354 /* try putting a leading underscore */
10355 symbol = dlsym(handle, "_fred") ;
10356 if (symbol == NULL) {
10369 : Call the object file tmp-dyna.o in case dlext=o.
10370 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
10371 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
10372 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
10373 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
10376 1) echo "Test program failed using dlopen." >&4
10377 echo "Perhaps you should not use dynamic loading." >&4;;
10378 2) echo "Test program failed using dlsym." >&4
10379 echo "Perhaps you should not use dynamic loading." >&4;;
10380 3) echo "dlsym needs a leading underscore" >&4
10382 4) echo "dlsym doesn't need a leading underscore." >&4;;
10385 echo "I can't compile and run the test program." >&4
10386 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
10391 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
10396 : see if drand48_r exists
10397 set drand48_r d_drand48_r
10399 case "$d_drand48_r" in
10401 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
10402 case "$d_drand48_r_proto:$usethreads" in
10403 ":define") d_drand48_r_proto=define
10404 set d_drand48_r_proto drand48_r $hdrs
10408 case "$d_drand48_r_proto" in
10410 case "$drand48_r_proto" in
10411 ''|0) try='int drand48_r(struct drand48_data*, double*);'
10412 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
10414 case "$drand48_r_proto" in
10415 ''|0) d_drand48_r=undef
10417 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
10418 * ) case "$drand48_r_proto" in
10419 REENTRANT_PROTO*) ;;
10420 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
10422 echo "Prototype: $try" ;;
10425 *) case "$usethreads" in
10426 define) echo "drand48_r has no prototype, not using it." >&4 ;;
10433 *) drand48_r_proto=0
10437 : see if prototype for drand48 is available
10439 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
10442 : see if dup2 exists
10446 : see if eaccess exists
10447 set eaccess d_eaccess
10450 : see if endgrent exists
10451 set endgrent d_endgrent
10454 : see if this is an grp system
10460 xxx=`./findhdr grp.h`
10461 $cppstdin $cppflags $cppminus < $xxx >$$.h
10463 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10475 set d_grpasswd; eval $setvar
10479 : see if endgrent_r exists
10480 set endgrent_r d_endgrent_r
10482 case "$d_endgrent_r" in
10484 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
10485 case "$d_endgrent_r_proto:$usethreads" in
10486 ":define") d_endgrent_r_proto=define
10487 set d_endgrent_r_proto endgrent_r $hdrs
10491 case "$d_endgrent_r_proto" in
10493 case "$endgrent_r_proto" in
10494 ''|0) try='int endgrent_r(FILE**);'
10495 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
10497 case "$endgrent_r_proto" in
10498 ''|0) try='void endgrent_r(FILE**);'
10499 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
10501 case "$endgrent_r_proto" in
10502 ''|0) d_endgrent_r=undef
10504 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
10505 * ) case "$endgrent_r_proto" in
10506 REENTRANT_PROTO*) ;;
10507 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
10509 echo "Prototype: $try" ;;
10512 *) case "$usethreads" in
10513 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
10520 *) endgrent_r_proto=0
10524 : see if endhostent exists
10525 set endhostent d_endhent
10528 : see if this is a netdb.h system
10529 set netdb.h i_netdb
10532 : see if endhostent_r exists
10533 set endhostent_r d_endhostent_r
10535 case "$d_endhostent_r" in
10537 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10538 case "$d_endhostent_r_proto:$usethreads" in
10539 ":define") d_endhostent_r_proto=define
10540 set d_endhostent_r_proto endhostent_r $hdrs
10544 case "$d_endhostent_r_proto" in
10546 case "$endhostent_r_proto" in
10547 ''|0) try='int endhostent_r(struct hostent_data*);'
10548 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
10550 case "$endhostent_r_proto" in
10551 ''|0) try='void endhostent_r(struct hostent_data*);'
10552 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
10554 case "$endhostent_r_proto" in
10555 ''|0) d_endhostent_r=undef
10556 endhostent_r_proto=0
10557 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
10558 * ) case "$endhostent_r_proto" in
10559 REENTRANT_PROTO*) ;;
10560 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
10562 echo "Prototype: $try" ;;
10565 *) case "$usethreads" in
10566 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
10568 d_endhostent_r=undef
10569 endhostent_r_proto=0
10573 *) endhostent_r_proto=0
10577 : see if endnetent exists
10578 set endnetent d_endnent
10581 : see if endnetent_r exists
10582 set endnetent_r d_endnetent_r
10584 case "$d_endnetent_r" in
10586 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10587 case "$d_endnetent_r_proto:$usethreads" in
10588 ":define") d_endnetent_r_proto=define
10589 set d_endnetent_r_proto endnetent_r $hdrs
10593 case "$d_endnetent_r_proto" in
10595 case "$endnetent_r_proto" in
10596 ''|0) try='int endnetent_r(struct netent_data*);'
10597 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
10599 case "$endnetent_r_proto" in
10600 ''|0) try='void endnetent_r(struct netent_data*);'
10601 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
10603 case "$endnetent_r_proto" in
10604 ''|0) d_endnetent_r=undef
10605 endnetent_r_proto=0
10606 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
10607 * ) case "$endnetent_r_proto" in
10608 REENTRANT_PROTO*) ;;
10609 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
10611 echo "Prototype: $try" ;;
10614 *) case "$usethreads" in
10615 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
10617 d_endnetent_r=undef
10618 endnetent_r_proto=0
10622 *) endnetent_r_proto=0
10626 : see if endprotoent exists
10627 set endprotoent d_endpent
10630 : see if endprotoent_r exists
10631 set endprotoent_r d_endprotoent_r
10633 case "$d_endprotoent_r" in
10635 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10636 case "$d_endprotoent_r_proto:$usethreads" in
10637 ":define") d_endprotoent_r_proto=define
10638 set d_endprotoent_r_proto endprotoent_r $hdrs
10642 case "$d_endprotoent_r_proto" in
10644 case "$endprotoent_r_proto" in
10645 ''|0) try='int endprotoent_r(struct protoent_data*);'
10646 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
10648 case "$endprotoent_r_proto" in
10649 ''|0) try='void endprotoent_r(struct protoent_data*);'
10650 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
10652 case "$endprotoent_r_proto" in
10653 ''|0) d_endprotoent_r=undef
10654 endprotoent_r_proto=0
10655 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
10656 * ) case "$endprotoent_r_proto" in
10657 REENTRANT_PROTO*) ;;
10658 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
10660 echo "Prototype: $try" ;;
10663 *) case "$usethreads" in
10664 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
10666 d_endprotoent_r=undef
10667 endprotoent_r_proto=0
10671 *) endprotoent_r_proto=0
10675 : see if endpwent exists
10676 set endpwent d_endpwent
10679 : see if this is a pwd.h system
10685 xxx=`./findhdr pwd.h`
10686 $cppstdin $cppflags $cppminus < $xxx >$$.h
10688 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10696 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10704 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10712 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10720 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10728 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10736 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10744 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10756 set d_pwquota; eval $setvar
10757 set d_pwage; eval $setvar
10758 set d_pwchange; eval $setvar
10759 set d_pwclass; eval $setvar
10760 set d_pwexpire; eval $setvar
10761 set d_pwcomment; eval $setvar
10762 set d_pwgecos; eval $setvar
10763 set d_pwpasswd; eval $setvar
10767 : see if endpwent_r exists
10768 set endpwent_r d_endpwent_r
10770 case "$d_endpwent_r" in
10772 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
10773 case "$d_endpwent_r_proto:$usethreads" in
10774 ":define") d_endpwent_r_proto=define
10775 set d_endpwent_r_proto endpwent_r $hdrs
10779 case "$d_endpwent_r_proto" in
10781 case "$endpwent_r_proto" in
10782 ''|0) try='int endpwent_r(FILE**);'
10783 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
10785 case "$endpwent_r_proto" in
10786 ''|0) try='void endpwent_r(FILE**);'
10787 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
10789 case "$endpwent_r_proto" in
10790 ''|0) d_endpwent_r=undef
10792 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
10793 * ) case "$endpwent_r_proto" in
10794 REENTRANT_PROTO*) ;;
10795 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
10797 echo "Prototype: $try" ;;
10800 *) case "$usethreads" in
10801 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
10808 *) endpwent_r_proto=0
10812 : see if endservent exists
10813 set endservent d_endsent
10816 : see if endservent_r exists
10817 set endservent_r d_endservent_r
10819 case "$d_endservent_r" in
10821 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10822 case "$d_endservent_r_proto:$usethreads" in
10823 ":define") d_endservent_r_proto=define
10824 set d_endservent_r_proto endservent_r $hdrs
10828 case "$d_endservent_r_proto" in
10830 case "$endservent_r_proto" in
10831 ''|0) try='int endservent_r(struct servent_data*);'
10832 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
10834 case "$endservent_r_proto" in
10835 ''|0) try='void endservent_r(struct servent_data*);'
10836 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
10838 case "$endservent_r_proto" in
10839 ''|0) d_endservent_r=undef
10840 endservent_r_proto=0
10841 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
10842 * ) case "$endservent_r_proto" in
10843 REENTRANT_PROTO*) ;;
10844 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
10846 echo "Prototype: $try" ;;
10849 *) case "$usethreads" in
10850 define) echo "endservent_r has no prototype, not using it." >&4 ;;
10852 d_endservent_r=undef
10853 endservent_r_proto=0
10857 *) endservent_r_proto=0
10861 : Locate the flags for 'open()'
10863 $cat >try.c <<'EOCP'
10864 #include <sys/types.h>
10869 #include <sys/file.h>
10880 : check sys/file.h first to get FREAD on Sun
10881 if $test `./findhdr sys/file.h` && \
10882 set try -DI_SYS_FILE && eval $compile; then
10884 echo "<sys/file.h> defines the O_* constants..." >&4
10885 if $run ./try; then
10886 echo "and you have the 3 argument form of open()." >&4
10889 echo "but not the 3 argument form of open(). Oh, well." >&4
10892 elif $test `./findhdr fcntl.h` && \
10893 set try -DI_FCNTL && eval $compile; then
10895 echo "<fcntl.h> defines the O_* constants..." >&4
10896 if $run ./try; then
10897 echo "and you have the 3 argument form of open()." >&4
10900 echo "but not the 3 argument form of open(). Oh, well." >&4
10905 echo "I can't find the O_* constant definitions! You got problems." >&4
10911 : see which of string.h or strings.h is needed
10913 strings=`./findhdr string.h`
10914 if $test "$strings" && $test -r "$strings"; then
10915 echo "Using <string.h> instead of <strings.h>." >&4
10919 strings=`./findhdr strings.h`
10920 if $test "$strings" && $test -r "$strings"; then
10921 echo "Using <strings.h> instead of <string.h>." >&4
10923 echo "No string header found -- You'll surely have problems." >&4
10928 case "$i_string" in
10929 "$undef") strings=`./findhdr strings.h`;;
10930 *) strings=`./findhdr string.h`;;
10933 : see if this is a sys/file.h system
10938 : do we need to include sys/file.h ?
10942 if $h_sysfile; then
10944 echo "We'll be including <sys/file.h>." >&4
10947 echo "We won't be including <sys/file.h>." >&4
10957 : see if fcntl.h is there
10962 : see if we can include fcntl.h
10968 echo "We'll be including <fcntl.h>." >&4
10971 if $h_sysfile; then
10972 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
10974 echo "We won't be including <fcntl.h>." >&4
10986 : check for non-blocking I/O stuff
10987 case "$h_sysfile" in
10988 true) echo "#include <sys/file.h>" > head.c;;
10991 true) echo "#include <fcntl.h>" > head.c;;
10992 *) echo "#include <sys/fcntl.h>" > head.c;;
10997 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
10998 case "$o_nonblock" in
11000 $cat head.c > try.c
11001 $cat >>try.c <<EOCP
11003 #include <stdlib.h>
11010 printf("O_NONBLOCK\n");
11014 printf("O_NDELAY\n");
11018 printf("FNDELAY\n");
11025 if eval $compile_ok; then
11026 o_nonblock=`$run ./try`
11027 case "$o_nonblock" in
11028 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11029 *) echo "Seems like we can use $o_nonblock.";;
11032 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11035 *) echo "Using $hint value $o_nonblock.";;
11037 $rm -f try try.* .out core
11040 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11043 $cat head.c > try.c
11044 $cat >>try.c <<EOCP
11046 #include <sys/types.h>
11047 #include <signal.h>
11049 #include <stdlib.h>
11054 #define MY_O_NONBLOCK $o_nonblock
11055 #ifndef errno /* XXX need better Configure test */
11058 #$i_unistd I_UNISTD
11060 #include <unistd.h>
11062 #$i_string I_STRING
11064 #include <string.h>
11066 #include <strings.h>
11068 $signal_t blech(x) int x; { exit(3); }
11070 $cat >> try.c <<'EOCP'
11078 pipe(pd); /* Down: child -> parent */
11079 pipe(pu); /* Up: parent -> child */
11082 close(pd[1]); /* Parent reads from pd[0] */
11083 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11085 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11090 signal(SIGALRM, blech);
11092 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11094 sprintf(string, "%d\n", ret);
11095 write(2, string, strlen(string));
11098 if (errno == EAGAIN) {
11099 printf("EAGAIN\n");
11104 if (errno == EWOULDBLOCK)
11105 printf("EWOULDBLOCK\n");
11108 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11109 sleep(2); /* Give it time to close our pipe */
11111 ret = read(pd[0], buf, 1); /* Should read EOF */
11113 sprintf(string, "%d\n", ret);
11114 write(4, string, strlen(string));
11118 close(pd[0]); /* We write to pd[1] */
11119 close(pu[1]); /* We read from pu[0] */
11120 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11121 close(pd[1]); /* Pipe pd is now fully closed! */
11122 exit(0); /* Bye bye, thank you for playing! */
11126 if eval $compile_ok; then
11127 echo "$startsh" >mtry
11128 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11130 ./mtry >/dev/null 2>&1
11132 0) eagain=`$cat try.out`;;
11133 1) echo "Could not perform non-blocking setting!";;
11134 2) echo "I did a successful read() for something that was not there!";;
11135 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11136 4) echo "Could not find F_SETFL!";;
11137 *) echo "Something terribly wrong happened during testing.";;
11139 rd_nodata=`$cat try.ret`
11140 echo "A read() system call with no data present returns $rd_nodata."
11141 case "$rd_nodata" in
11144 echo "(That's peculiar, fixing that to be -1.)"
11150 echo "Forcing errno EAGAIN on read() with no data available."
11154 echo "Your read() sets errno to $eagain when no data is available."
11157 status=`$cat try.err`
11159 0) echo "And it correctly returns 0 to signal EOF.";;
11160 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11161 *) echo "However, your read() returns '$status' on EOF??";;
11164 if test "$status" = "$rd_nodata"; then
11165 echo "WARNING: you can't distinguish between EOF and no data!"
11169 echo "I can't compile the test program--assuming errno EAGAIN will do."
11176 echo "Using $hint value $eagain."
11177 echo "Your read() returns $rd_nodata when no data is present."
11178 case "$d_eofnblk" in
11179 "$define") echo "And you can see EOF because read() returns 0.";;
11180 "$undef") echo "But you can't see EOF status from read() returned value.";;
11182 echo "(Assuming you can't see EOF status from read anyway.)"
11188 $rm -f try try.* .out core head.c mtry
11190 : see if fchdir exists
11191 set fchdir d_fchdir
11194 : see if fchmod exists
11195 set fchmod d_fchmod
11198 : see if fchown exists
11199 set fchown d_fchown
11202 : see if this is an fcntl system
11207 : See if fcntl-based locking works.
11209 #include <stdlib.h>
11210 #include <unistd.h>
11212 #include <signal.h>
11213 $signal_t blech(x) int x; { exit(3); }
11215 #if defined(F_SETLK) && defined(F_SETLKW)
11216 struct flock flock;
11218 fd = open("try.c", O_RDONLY);
11219 flock.l_type = F_RDLCK;
11220 flock.l_whence = SEEK_SET;
11221 flock.l_start = flock.l_len = 0;
11222 signal(SIGALRM, blech);
11224 retval = fcntl(fd, F_SETLK, &flock);
11226 (retval < 0 ? exit(2) : exit(0));
11232 echo "Checking if fcntl-based file locking works... "
11236 if eval $compile_ok; then
11237 if $run ./try; then
11238 echo "Yes, it seems to work."
11241 echo "Nope, it didn't work."
11246 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
11247 *** This is (almost) impossible.
11248 *** If your NFS lock daemons are not feeling well, something like
11249 *** this may happen, please investigate. Cannot continue, aborting.
11257 echo "I'm unable to compile the test program, so I'll assume not."
11262 echo "Nope, since you don't even have fcntl()."
11265 set d_fcntl_can_lock
11270 : check for fd_set items
11273 Checking to see how well your C compiler handles fd_set and friends ...
11276 #$i_systime I_SYS_TIME
11277 #$i_sysselct I_SYS_SELECT
11278 #$d_socket HAS_SOCKET
11279 #include <sys/types.h>
11281 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
11284 #include <sys/time.h>
11286 #ifdef I_SYS_SELECT
11287 #include <sys/select.h>
11296 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
11304 if eval $compile; then
11305 d_fds_bits="$define"
11307 echo "Well, your system knows about the normal fd_set typedef..." >&4
11308 if $run ./try; then
11309 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
11310 d_fd_macros="$define"
11313 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
11315 d_fd_macros="$undef"
11319 Hmm, your compiler has some difficulty with fd_set. Checking further...
11322 if eval $compile; then
11323 d_fds_bits="$undef"
11325 echo "Well, your system has some sort of fd_set available..." >&4
11326 if $run ./try; then
11327 echo "and you have the normal fd_set macros." >&4
11328 d_fd_macros="$define"
11331 but not the normal fd_set macros! Gross! More work for me...
11333 d_fd_macros="$undef"
11336 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
11338 d_fds_bits="$undef"
11339 d_fd_macros="$undef"
11344 : see if fgetpos exists
11345 set fgetpos d_fgetpos
11348 : see if finite exists
11349 set finite d_finite
11352 : see if finitel exists
11353 set finitel d_finitel
11356 : see if flock exists
11360 : see if prototype for flock is available
11362 set d_flockproto flock $i_sysfile sys/file.h
11365 : see if fork exists
11369 : see if fp_class exists
11370 set fp_class d_fp_class
11373 : see if pathconf exists
11374 set pathconf d_pathconf
11377 : see if fpathconf exists
11378 set fpathconf d_fpathconf
11381 : see if fpclass exists
11382 set fpclass d_fpclass
11385 : see if fpclassify exists
11386 set fpclassify d_fpclassify
11389 : see if fpclassl exists
11390 set fpclassl d_fpclassl
11394 : check for fpos64_t
11396 echo "Checking to see if you have fpos64_t..." >&4
11399 int main() { fpos64_t x = 7; }
11402 if eval $compile; then
11404 echo "You have fpos64_t."
11407 echo "You do not have fpos64_t."
11408 case "$fpossize" in
11409 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
11416 : see if frexpl exists
11417 set frexpl d_frexpl
11420 : see if this is a sys/param system
11421 set sys/param.h i_sysparam
11424 : see if this is a sys/mount.h system
11425 set sys/mount.h i_sysmount
11430 echo "Checking to see if your system supports struct fs_data..." >&4
11431 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
11433 case "$d_fs_data_s" in
11434 "$define") echo "Yes, it does." ;;
11435 *) echo "No, it doesn't." ;;
11438 : see if fseeko exists
11439 set fseeko d_fseeko
11441 case "$longsize" in
11442 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
11445 : see if fsetpos exists
11446 set fsetpos d_fsetpos
11450 : see if fstatfs exists
11451 set fstatfs d_fstatfs
11455 : see if statvfs exists
11456 set statvfs d_statvfs
11459 : see if fstatvfs exists
11460 set fstatvfs d_fstatvfs
11464 : see if fsync exists
11468 : see if ftello exists
11469 set ftello d_ftello
11471 case "$longsize" in
11472 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
11475 : see if getcwd exists
11476 set getcwd d_getcwd
11479 : see if getespwnam exists
11480 set getespwnam d_getespwnam
11484 : see if getfsstat exists
11485 set getfsstat d_getfsstat
11488 : see if getgrent exists
11489 set getgrent d_getgrent
11492 : see if getgrent_r exists
11493 set getgrent_r d_getgrent_r
11495 case "$d_getgrent_r" in
11497 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11498 case "$d_getgrent_r_proto:$usethreads" in
11499 ":define") d_getgrent_r_proto=define
11500 set d_getgrent_r_proto getgrent_r $hdrs
11504 case "$d_getgrent_r_proto" in
11506 case "$getgrent_r_proto" in
11507 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
11508 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
11510 case "$getgrent_r_proto" in
11511 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
11512 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
11514 case "$getgrent_r_proto" in
11515 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
11516 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
11518 case "$getgrent_r_proto" in
11519 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
11520 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
11522 case "$getgrent_r_proto" in
11523 ''|0) try='int getgrent_r(struct group*, char*, int);'
11524 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
11526 case "$getgrent_r_proto" in
11527 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
11528 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
11530 case "$getgrent_r_proto" in
11531 ''|0) d_getgrent_r=undef
11533 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
11534 * ) case "$getgrent_r_proto" in
11535 REENTRANT_PROTO*) ;;
11536 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
11538 echo "Prototype: $try" ;;
11541 *) case "$usethreads" in
11542 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
11549 *) getgrent_r_proto=0
11553 : see if getgrgid_r exists
11554 set getgrgid_r d_getgrgid_r
11556 case "$d_getgrgid_r" in
11558 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11559 case "$d_getgrgid_r_proto:$usethreads" in
11560 ":define") d_getgrgid_r_proto=define
11561 set d_getgrgid_r_proto getgrgid_r $hdrs
11565 case "$d_getgrgid_r_proto" in
11567 case "$getgrgid_r_proto" in
11568 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
11569 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
11571 case "$getgrgid_r_proto" in
11572 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
11573 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
11575 case "$getgrgid_r_proto" in
11576 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
11577 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
11579 case "$getgrgid_r_proto" in
11580 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
11581 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
11583 case "$getgrgid_r_proto" in
11584 ''|0) d_getgrgid_r=undef
11586 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
11587 * ) case "$getgrgid_r_proto" in
11588 REENTRANT_PROTO*) ;;
11589 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
11591 echo "Prototype: $try" ;;
11594 *) case "$usethreads" in
11595 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
11602 *) getgrgid_r_proto=0
11606 : see if getgrnam_r exists
11607 set getgrnam_r d_getgrnam_r
11609 case "$d_getgrnam_r" in
11611 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11612 case "$d_getgrnam_r_proto:$usethreads" in
11613 ":define") d_getgrnam_r_proto=define
11614 set d_getgrnam_r_proto getgrnam_r $hdrs
11618 case "$d_getgrnam_r_proto" in
11620 case "$getgrnam_r_proto" in
11621 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
11622 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
11624 case "$getgrnam_r_proto" in
11625 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
11626 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
11628 case "$getgrnam_r_proto" in
11629 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
11630 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
11632 case "$getgrnam_r_proto" in
11633 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
11634 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
11636 case "$getgrnam_r_proto" in
11637 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
11638 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
11640 case "$getgrnam_r_proto" in
11641 ''|0) d_getgrnam_r=undef
11643 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
11644 * ) case "$getgrnam_r_proto" in
11645 REENTRANT_PROTO*) ;;
11646 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
11648 echo "Prototype: $try" ;;
11651 *) case "$usethreads" in
11652 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
11659 *) getgrnam_r_proto=0
11663 : see if gethostbyaddr exists
11664 set gethostbyaddr d_gethbyaddr
11667 : see if gethostbyname exists
11668 set gethostbyname d_gethbyname
11671 : see if gethostent exists
11672 set gethostent d_gethent
11675 : see how we will look up host name
11678 if set gethostname val -f d_gethname; eval $csym; $val; then
11679 echo 'gethostname() found.' >&4
11680 d_gethname="$define"
11683 if set uname val -f d_uname; eval $csym; $val; then
11686 uname() was found, but you're running xenix, and older versions of xenix
11687 have a broken uname(). If you don't really know whether your xenix is old
11688 enough to have a broken system call, use the default answer.
11693 "$define") dflt=n;;
11695 rp='Is your uname() broken?'
11698 n*) d_uname="$define"; call=uname;;
11701 echo 'uname() found.' >&4
11708 case "$d_gethname" in
11709 '') d_gethname="$undef";;
11712 '') d_uname="$undef";;
11714 case "$d_uname$d_gethname" in
11719 Every now and then someone has a $call() that lies about the hostname
11720 but can't be fixed for political or economic reasons. If you wish, I can
11721 pretend $call() isn't there and maybe compute hostname at run-time
11722 thanks to the '$phostname' command.
11725 rp="Shall I ignore $call() from now on?"
11728 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
11731 case "$phostname" in
11732 '') aphostname='';;
11733 *) case "$aphostname" in
11735 *) set X $phostname
11739 file=`./loc $file $file $pth`
11740 aphostname=`echo $file $*`
11745 case "$d_uname$d_gethname" in
11748 case "$phostname" in
11750 echo "There will be no way for $package to get your hostname." >&4;;
11752 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
11756 case "$d_phostname" in
11757 '') d_phostname="$undef";;
11760 : see if gethostbyaddr_r exists
11761 set gethostbyaddr_r d_gethostbyaddr_r
11763 case "$d_gethostbyaddr_r" in
11765 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11766 case "$d_gethostbyaddr_r_proto:$usethreads" in
11767 ":define") d_gethostbyaddr_r_proto=define
11768 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
11772 case "$d_gethostbyaddr_r_proto" in
11774 case "$gethostbyaddr_r_proto" in
11775 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
11776 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
11778 case "$gethostbyaddr_r_proto" in
11779 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
11780 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
11782 case "$gethostbyaddr_r_proto" in
11783 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
11784 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
11786 case "$gethostbyaddr_r_proto" in
11787 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
11788 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
11790 case "$gethostbyaddr_r_proto" in
11791 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
11792 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
11794 case "$gethostbyaddr_r_proto" in
11795 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
11796 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
11798 case "$gethostbyaddr_r_proto" in
11799 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
11800 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
11802 case "$gethostbyaddr_r_proto" in
11803 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
11804 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
11806 case "$gethostbyaddr_r_proto" in
11807 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
11808 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
11810 case "$gethostbyaddr_r_proto" in
11811 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
11812 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
11814 case "$gethostbyaddr_r_proto" in
11815 ''|0) d_gethostbyaddr_r=undef
11816 gethostbyaddr_r_proto=0
11817 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
11818 * ) case "$gethostbyaddr_r_proto" in
11819 REENTRANT_PROTO*) ;;
11820 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
11822 echo "Prototype: $try" ;;
11825 *) case "$usethreads" in
11826 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
11828 d_gethostbyaddr_r=undef
11829 gethostbyaddr_r_proto=0
11833 *) gethostbyaddr_r_proto=0
11837 : see if gethostbyname_r exists
11838 set gethostbyname_r d_gethostbyname_r
11840 case "$d_gethostbyname_r" in
11842 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11843 case "$d_gethostbyname_r_proto:$usethreads" in
11844 ":define") d_gethostbyname_r_proto=define
11845 set d_gethostbyname_r_proto gethostbyname_r $hdrs
11849 case "$d_gethostbyname_r_proto" in
11851 case "$gethostbyname_r_proto" in
11852 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
11853 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
11855 case "$gethostbyname_r_proto" in
11856 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
11857 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
11859 case "$gethostbyname_r_proto" in
11860 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
11861 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
11863 case "$gethostbyname_r_proto" in
11864 ''|0) d_gethostbyname_r=undef
11865 gethostbyname_r_proto=0
11866 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
11867 * ) case "$gethostbyname_r_proto" in
11868 REENTRANT_PROTO*) ;;
11869 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
11871 echo "Prototype: $try" ;;
11874 *) case "$usethreads" in
11875 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
11877 d_gethostbyname_r=undef
11878 gethostbyname_r_proto=0
11882 *) gethostbyname_r_proto=0
11886 : see if gethostent_r exists
11887 set gethostent_r d_gethostent_r
11889 case "$d_gethostent_r" in
11891 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11892 case "$d_gethostent_r_proto:$usethreads" in
11893 ":define") d_gethostent_r_proto=define
11894 set d_gethostent_r_proto gethostent_r $hdrs
11898 case "$d_gethostent_r_proto" in
11900 case "$gethostent_r_proto" in
11901 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
11902 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
11904 case "$gethostent_r_proto" in
11905 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
11906 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
11908 case "$gethostent_r_proto" in
11909 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
11910 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
11912 case "$gethostent_r_proto" in
11913 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
11914 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
11916 case "$gethostent_r_proto" in
11917 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
11918 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
11920 case "$gethostent_r_proto" in
11921 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
11922 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
11924 case "$gethostent_r_proto" in
11925 ''|0) d_gethostent_r=undef
11926 gethostent_r_proto=0
11927 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
11928 * ) case "$gethostent_r_proto" in
11929 REENTRANT_PROTO*) ;;
11930 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
11932 echo "Prototype: $try" ;;
11935 *) case "$usethreads" in
11936 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
11938 d_gethostent_r=undef
11939 gethostent_r_proto=0
11943 *) gethostent_r_proto=0
11947 : see if prototypes for various gethostxxx netdb.h functions are available
11949 set d_gethostprotos gethostent $i_netdb netdb.h
11952 : see if getitimer exists
11953 set getitimer d_getitimer
11956 : see if getlogin exists
11957 set getlogin d_getlogin
11960 : see if getlogin_r exists
11961 set getlogin_r d_getlogin_r
11963 case "$d_getlogin_r" in
11965 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
11966 case "$d_getlogin_r_proto:$usethreads" in
11967 ":define") d_getlogin_r_proto=define
11968 set d_getlogin_r_proto getlogin_r $hdrs
11972 case "$d_getlogin_r_proto" in
11974 case "$getlogin_r_proto" in
11975 ''|0) try='int getlogin_r(char*, size_t);'
11976 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
11978 case "$getlogin_r_proto" in
11979 ''|0) try='int getlogin_r(char*, int);'
11980 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
11982 case "$getlogin_r_proto" in
11983 ''|0) try='char* getlogin_r(char*, size_t);'
11984 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
11986 case "$getlogin_r_proto" in
11987 ''|0) try='char* getlogin_r(char*, int);'
11988 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
11990 case "$getlogin_r_proto" in
11991 ''|0) d_getlogin_r=undef
11993 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
11994 * ) case "$getlogin_r_proto" in
11995 REENTRANT_PROTO*) ;;
11996 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
11998 echo "Prototype: $try" ;;
12001 *) case "$usethreads" in
12002 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
12009 *) getlogin_r_proto=0
12013 : see if getmnt exists
12014 set getmnt d_getmnt
12017 : see if getmntent exists
12018 set getmntent d_getmntent
12021 : see if getnetbyaddr exists
12022 set getnetbyaddr d_getnbyaddr
12025 : see if getnetbyname exists
12026 set getnetbyname d_getnbyname
12029 : see if getnetent exists
12030 set getnetent d_getnent
12033 : see if getnetbyaddr_r exists
12034 set getnetbyaddr_r d_getnetbyaddr_r
12036 case "$d_getnetbyaddr_r" in
12038 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12039 case "$d_getnetbyaddr_r_proto:$usethreads" in
12040 ":define") d_getnetbyaddr_r_proto=define
12041 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
12045 case "$d_getnetbyaddr_r_proto" in
12047 case "$getnetbyaddr_r_proto" in
12048 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
12049 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
12051 case "$getnetbyaddr_r_proto" in
12052 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
12053 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
12055 case "$getnetbyaddr_r_proto" in
12056 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
12057 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
12059 case "$getnetbyaddr_r_proto" in
12060 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
12061 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
12063 case "$getnetbyaddr_r_proto" in
12064 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
12065 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
12067 case "$getnetbyaddr_r_proto" in
12068 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
12069 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
12071 case "$getnetbyaddr_r_proto" in
12072 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
12073 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
12075 case "$getnetbyaddr_r_proto" in
12076 ''|0) d_getnetbyaddr_r=undef
12077 getnetbyaddr_r_proto=0
12078 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
12079 * ) case "$getnetbyaddr_r_proto" in
12080 REENTRANT_PROTO*) ;;
12081 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
12083 echo "Prototype: $try" ;;
12086 *) case "$usethreads" in
12087 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
12089 d_getnetbyaddr_r=undef
12090 getnetbyaddr_r_proto=0
12094 *) getnetbyaddr_r_proto=0
12098 : see if getnetbyname_r exists
12099 set getnetbyname_r d_getnetbyname_r
12101 case "$d_getnetbyname_r" in
12103 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12104 case "$d_getnetbyname_r_proto:$usethreads" in
12105 ":define") d_getnetbyname_r_proto=define
12106 set d_getnetbyname_r_proto getnetbyname_r $hdrs
12110 case "$d_getnetbyname_r_proto" in
12112 case "$getnetbyname_r_proto" in
12113 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
12114 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
12116 case "$getnetbyname_r_proto" in
12117 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
12118 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
12120 case "$getnetbyname_r_proto" in
12121 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
12122 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
12124 case "$getnetbyname_r_proto" in
12125 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
12126 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
12128 case "$getnetbyname_r_proto" in
12129 ''|0) d_getnetbyname_r=undef
12130 getnetbyname_r_proto=0
12131 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
12132 * ) case "$getnetbyname_r_proto" in
12133 REENTRANT_PROTO*) ;;
12134 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
12136 echo "Prototype: $try" ;;
12139 *) case "$usethreads" in
12140 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
12142 d_getnetbyname_r=undef
12143 getnetbyname_r_proto=0
12147 *) getnetbyname_r_proto=0
12151 : see if getnetent_r exists
12152 set getnetent_r d_getnetent_r
12154 case "$d_getnetent_r" in
12156 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12157 case "$d_getnetent_r_proto:$usethreads" in
12158 ":define") d_getnetent_r_proto=define
12159 set d_getnetent_r_proto getnetent_r $hdrs
12163 case "$d_getnetent_r_proto" in
12165 case "$getnetent_r_proto" in
12166 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
12167 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
12169 case "$getnetent_r_proto" in
12170 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
12171 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
12173 case "$getnetent_r_proto" in
12174 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
12175 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
12177 case "$getnetent_r_proto" in
12178 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
12179 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
12181 case "$getnetent_r_proto" in
12182 ''|0) try='int getnetent_r(struct netent*, char*, int);'
12183 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
12185 case "$getnetent_r_proto" in
12186 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
12187 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
12189 case "$getnetent_r_proto" in
12190 ''|0) d_getnetent_r=undef
12191 getnetent_r_proto=0
12192 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
12193 * ) case "$getnetent_r_proto" in
12194 REENTRANT_PROTO*) ;;
12195 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
12197 echo "Prototype: $try" ;;
12200 *) case "$usethreads" in
12201 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
12203 d_getnetent_r=undef
12204 getnetent_r_proto=0
12208 *) getnetent_r_proto=0
12212 : see if prototypes for various getnetxxx netdb.h functions are available
12214 set d_getnetprotos getnetent $i_netdb netdb.h
12217 : see if getpagesize exists
12218 set getpagesize d_getpagsz
12222 : see if getprotobyname exists
12223 set getprotobyname d_getpbyname
12226 : see if getprotobynumber exists
12227 set getprotobynumber d_getpbynumber
12230 : see if getprotoent exists
12231 set getprotoent d_getpent
12234 : see if getpgid exists
12235 set getpgid d_getpgid
12238 : see if getpgrp2 exists
12239 set getpgrp2 d_getpgrp2
12242 : see if getppid exists
12243 set getppid d_getppid
12246 : see if getpriority exists
12247 set getpriority d_getprior
12250 : see if getprotobyname_r exists
12251 set getprotobyname_r d_getprotobyname_r
12253 case "$d_getprotobyname_r" in
12255 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12256 case "$d_getprotobyname_r_proto:$usethreads" in
12257 ":define") d_getprotobyname_r_proto=define
12258 set d_getprotobyname_r_proto getprotobyname_r $hdrs
12262 case "$d_getprotobyname_r_proto" in
12264 case "$getprotobyname_r_proto" in
12265 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
12266 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
12268 case "$getprotobyname_r_proto" in
12269 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
12270 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
12272 case "$getprotobyname_r_proto" in
12273 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
12274 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
12276 case "$getprotobyname_r_proto" in
12277 ''|0) d_getprotobyname_r=undef
12278 getprotobyname_r_proto=0
12279 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
12280 * ) case "$getprotobyname_r_proto" in
12281 REENTRANT_PROTO*) ;;
12282 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
12284 echo "Prototype: $try" ;;
12287 *) case "$usethreads" in
12288 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
12290 d_getprotobyname_r=undef
12291 getprotobyname_r_proto=0
12295 *) getprotobyname_r_proto=0
12299 : see if getprotobynumber_r exists
12300 set getprotobynumber_r d_getprotobynumber_r
12302 case "$d_getprotobynumber_r" in
12304 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12305 case "$d_getprotobynumber_r_proto:$usethreads" in
12306 ":define") d_getprotobynumber_r_proto=define
12307 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
12311 case "$d_getprotobynumber_r_proto" in
12313 case "$getprotobynumber_r_proto" in
12314 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
12315 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
12317 case "$getprotobynumber_r_proto" in
12318 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
12319 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
12321 case "$getprotobynumber_r_proto" in
12322 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
12323 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
12325 case "$getprotobynumber_r_proto" in
12326 ''|0) d_getprotobynumber_r=undef
12327 getprotobynumber_r_proto=0
12328 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
12329 * ) case "$getprotobynumber_r_proto" in
12330 REENTRANT_PROTO*) ;;
12331 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
12333 echo "Prototype: $try" ;;
12336 *) case "$usethreads" in
12337 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
12339 d_getprotobynumber_r=undef
12340 getprotobynumber_r_proto=0
12344 *) getprotobynumber_r_proto=0
12348 : see if getprotoent_r exists
12349 set getprotoent_r d_getprotoent_r
12351 case "$d_getprotoent_r" in
12353 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12354 case "$d_getprotoent_r_proto:$usethreads" in
12355 ":define") d_getprotoent_r_proto=define
12356 set d_getprotoent_r_proto getprotoent_r $hdrs
12360 case "$d_getprotoent_r_proto" in
12362 case "$getprotoent_r_proto" in
12363 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
12364 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
12366 case "$getprotoent_r_proto" in
12367 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
12368 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
12370 case "$getprotoent_r_proto" in
12371 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
12372 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
12374 case "$getprotoent_r_proto" in
12375 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
12376 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
12378 case "$getprotoent_r_proto" in
12379 ''|0) d_getprotoent_r=undef
12380 getprotoent_r_proto=0
12381 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
12382 * ) case "$getprotoent_r_proto" in
12383 REENTRANT_PROTO*) ;;
12384 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
12386 echo "Prototype: $try" ;;
12389 *) case "$usethreads" in
12390 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
12392 d_getprotoent_r=undef
12393 getprotoent_r_proto=0
12397 *) getprotoent_r_proto=0
12401 : see if prototypes for various getprotoxxx netdb.h functions are available
12403 set d_getprotoprotos getprotoent $i_netdb netdb.h
12406 : see if getprpwnam exists
12407 set getprpwnam d_getprpwnam
12410 : see if getpwent exists
12411 set getpwent d_getpwent
12414 : see if getpwent_r exists
12415 set getpwent_r d_getpwent_r
12417 case "$d_getpwent_r" in
12419 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12420 case "$d_getpwent_r_proto:$usethreads" in
12421 ":define") d_getpwent_r_proto=define
12422 set d_getpwent_r_proto getpwent_r $hdrs
12426 case "$d_getpwent_r_proto" in
12428 case "$getpwent_r_proto" in
12429 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
12430 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
12432 case "$getpwent_r_proto" in
12433 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
12434 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
12436 case "$getpwent_r_proto" in
12437 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
12438 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
12440 case "$getpwent_r_proto" in
12441 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
12442 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
12444 case "$getpwent_r_proto" in
12445 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
12446 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
12448 case "$getpwent_r_proto" in
12449 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
12450 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
12452 case "$getpwent_r_proto" in
12453 ''|0) d_getpwent_r=undef
12455 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
12456 * ) case "$getpwent_r_proto" in
12457 REENTRANT_PROTO*) ;;
12458 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
12460 echo "Prototype: $try" ;;
12463 *) case "$usethreads" in
12464 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
12471 *) getpwent_r_proto=0
12475 : see if getpwnam_r exists
12476 set getpwnam_r d_getpwnam_r
12478 case "$d_getpwnam_r" in
12480 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12481 case "$d_getpwnam_r_proto:$usethreads" in
12482 ":define") d_getpwnam_r_proto=define
12483 set d_getpwnam_r_proto getpwnam_r $hdrs
12487 case "$d_getpwnam_r_proto" in
12489 case "$getpwnam_r_proto" in
12490 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
12491 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
12493 case "$getpwnam_r_proto" in
12494 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
12495 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
12497 case "$getpwnam_r_proto" in
12498 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
12499 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
12501 case "$getpwnam_r_proto" in
12502 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
12503 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
12505 case "$getpwnam_r_proto" in
12506 ''|0) d_getpwnam_r=undef
12508 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
12509 * ) case "$getpwnam_r_proto" in
12510 REENTRANT_PROTO*) ;;
12511 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
12513 echo "Prototype: $try" ;;
12516 *) case "$usethreads" in
12517 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
12524 *) getpwnam_r_proto=0
12528 : see if getpwuid_r exists
12529 set getpwuid_r d_getpwuid_r
12531 case "$d_getpwuid_r" in
12533 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12534 case "$d_getpwuid_r_proto:$usethreads" in
12535 ":define") d_getpwuid_r_proto=define
12536 set d_getpwuid_r_proto getpwuid_r $hdrs
12540 case "$d_getpwuid_r_proto" in
12542 case "$getpwuid_r_proto" in
12543 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
12544 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
12546 case "$getpwuid_r_proto" in
12547 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
12548 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
12550 case "$getpwuid_r_proto" in
12551 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
12552 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
12554 case "$getpwuid_r_proto" in
12555 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
12556 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
12558 case "$getpwuid_r_proto" in
12559 ''|0) d_getpwuid_r=undef
12561 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
12562 * ) case "$getpwuid_r_proto" in
12563 REENTRANT_PROTO*) ;;
12564 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
12566 echo "Prototype: $try" ;;
12569 *) case "$usethreads" in
12570 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
12577 *) getpwuid_r_proto=0
12582 : see if getservbyname exists
12583 set getservbyname d_getsbyname
12586 : see if getservbyport exists
12587 set getservbyport d_getsbyport
12590 : see if getservent exists
12591 set getservent d_getsent
12594 : see if getservbyname_r exists
12595 set getservbyname_r d_getservbyname_r
12597 case "$d_getservbyname_r" in
12599 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12600 case "$d_getservbyname_r_proto:$usethreads" in
12601 ":define") d_getservbyname_r_proto=define
12602 set d_getservbyname_r_proto getservbyname_r $hdrs
12606 case "$d_getservbyname_r_proto" in
12608 case "$getservbyname_r_proto" in
12609 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
12610 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
12612 case "$getservbyname_r_proto" in
12613 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
12614 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
12616 case "$getservbyname_r_proto" in
12617 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
12618 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
12620 case "$getservbyname_r_proto" in
12621 ''|0) d_getservbyname_r=undef
12622 getservbyname_r_proto=0
12623 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
12624 * ) case "$getservbyname_r_proto" in
12625 REENTRANT_PROTO*) ;;
12626 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
12628 echo "Prototype: $try" ;;
12631 *) case "$usethreads" in
12632 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
12634 d_getservbyname_r=undef
12635 getservbyname_r_proto=0
12639 *) getservbyname_r_proto=0
12643 : see if getservbyport_r exists
12644 set getservbyport_r d_getservbyport_r
12646 case "$d_getservbyport_r" in
12648 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12649 case "$d_getservbyport_r_proto:$usethreads" in
12650 ":define") d_getservbyport_r_proto=define
12651 set d_getservbyport_r_proto getservbyport_r $hdrs
12655 case "$d_getservbyport_r_proto" in
12657 case "$getservbyport_r_proto" in
12658 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
12659 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
12661 case "$getservbyport_r_proto" in
12662 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
12663 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
12665 case "$getservbyport_r_proto" in
12666 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
12667 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
12669 case "$getservbyport_r_proto" in
12670 ''|0) d_getservbyport_r=undef
12671 getservbyport_r_proto=0
12672 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
12673 * ) case "$getservbyport_r_proto" in
12674 REENTRANT_PROTO*) ;;
12675 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
12677 echo "Prototype: $try" ;;
12680 *) case "$usethreads" in
12681 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
12683 d_getservbyport_r=undef
12684 getservbyport_r_proto=0
12688 *) getservbyport_r_proto=0
12692 : see if getservent_r exists
12693 set getservent_r d_getservent_r
12695 case "$d_getservent_r" in
12697 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12698 case "$d_getservent_r_proto:$usethreads" in
12699 ":define") d_getservent_r_proto=define
12700 set d_getservent_r_proto getservent_r $hdrs
12704 case "$d_getservent_r_proto" in
12706 case "$getservent_r_proto" in
12707 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
12708 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
12710 case "$getservent_r_proto" in
12711 ''|0) try='int getservent_r(struct servent*, char*, int);'
12712 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
12714 case "$getservent_r_proto" in
12715 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
12716 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
12718 case "$getservent_r_proto" in
12719 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
12720 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
12722 case "$getservent_r_proto" in
12723 ''|0) d_getservent_r=undef
12724 getservent_r_proto=0
12725 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
12726 * ) case "$getservent_r_proto" in
12727 REENTRANT_PROTO*) ;;
12728 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
12730 echo "Prototype: $try" ;;
12733 *) case "$usethreads" in
12734 define) echo "getservent_r has no prototype, not using it." >&4 ;;
12736 d_getservent_r=undef
12737 getservent_r_proto=0
12741 *) getservent_r_proto=0
12745 : see if prototypes for various getservxxx netdb.h functions are available
12747 set d_getservprotos getservent $i_netdb netdb.h
12750 : see if getspnam exists
12751 set getspnam d_getspnam
12754 : see if this is a shadow.h system
12755 set shadow.h i_shadow
12758 : see if getspnam_r exists
12759 set getspnam_r d_getspnam_r
12761 case "$d_getspnam_r" in
12763 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
12764 case "$d_getspnam_r_proto:$usethreads" in
12765 ":define") d_getspnam_r_proto=define
12766 set d_getspnam_r_proto getspnam_r $hdrs
12770 case "$d_getspnam_r_proto" in
12772 case "$getspnam_r_proto" in
12773 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
12774 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
12776 case "$getspnam_r_proto" in
12777 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
12778 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
12780 case "$getspnam_r_proto" in
12781 ''|0) d_getspnam_r=undef
12783 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
12784 * ) case "$getspnam_r_proto" in
12785 REENTRANT_PROTO*) ;;
12786 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
12788 echo "Prototype: $try" ;;
12791 *) case "$usethreads" in
12792 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
12799 *) getspnam_r_proto=0
12803 : see if gettimeofday or ftime exists
12804 set gettimeofday d_gettimeod
12806 case "$d_gettimeod" in
12812 val="$undef"; set d_ftime; eval $setvar
12815 case "$d_gettimeod$d_ftime" in
12818 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
12822 : see if gmtime_r exists
12823 set gmtime_r d_gmtime_r
12825 case "$d_gmtime_r" in
12827 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12828 case "$d_gmtime_r_proto:$usethreads" in
12829 ":define") d_gmtime_r_proto=define
12830 set d_gmtime_r_proto gmtime_r $hdrs
12834 case "$d_gmtime_r_proto" in
12836 case "$gmtime_r_proto" in
12837 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
12838 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
12840 case "$gmtime_r_proto" in
12841 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
12842 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
12844 case "$gmtime_r_proto" in
12845 ''|0) d_gmtime_r=undef
12847 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
12848 * ) case "$gmtime_r_proto" in
12849 REENTRANT_PROTO*) ;;
12850 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
12852 echo "Prototype: $try" ;;
12855 *) case "$usethreads" in
12856 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
12863 *) gmtime_r_proto=0
12867 : see if hasmntopt exists
12868 set hasmntopt d_hasmntopt
12871 : see if this is a netinet/in.h or sys/in.h system
12872 set netinet/in.h i_niin sys/in.h i_sysin
12875 : see if arpa/inet.h has to be included
12876 set arpa/inet.h i_arpainet
12879 : see if htonl --and friends-- exists
12884 : Maybe they are macros.
12887 $cat >htonl.c <<EOM
12889 #include <sys/types.h>
12890 #$i_niin I_NETINET_IN
12892 #$i_arpainet I_ARPA_INET
12893 #ifdef I_NETINET_IN
12894 #include <netinet/in.h>
12897 #include <sys/in.h>
12900 #include <arpa/inet.h>
12903 printf("Defined as a macro.");
12906 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
12907 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
12909 echo "But it seems to be defined as a macro." >&4
12919 if set index val -f; eval $csym; $val; then
12920 if set strchr val -f d_strchr; eval $csym; $val; then
12921 if $contains strchr "$strings" >/dev/null 2>&1 ; then
12924 echo "strchr() found." >&4
12928 echo "index() found." >&4
12933 echo "index() found." >&4
12936 if set strchr val -f d_strchr; eval $csym; $val; then
12939 echo "strchr() found." >&4
12941 echo "No index() or strchr() found!" >&4
12946 set d_strchr; eval $setvar
12948 set d_index; eval $setvar
12950 : check whether inet_aton exists
12951 set inet_aton d_inetaton
12956 $cat >isascii.c <<'EOCP'
12968 if eval $compile; then
12969 echo "isascii() found." >&4
12972 echo "isascii() NOT found." >&4
12979 : see if isfinite exists
12980 set isfinite d_isfinite
12983 : see if isinf exists
12987 : see if isnan exists
12991 : see if isnanl exists
12992 set isnanl d_isnanl
12995 : see if killpg exists
12996 set killpg d_killpg
12999 : see if lchown exists
13001 $cat > try.c <<'EOCP'
13002 /* System header to define __stub macros and hopefully few prototypes,
13003 which can conflict with char lchown(); below. */
13004 #include <assert.h>
13005 /* Override any gcc2 internal prototype to avoid an error. */
13006 /* We use char because int might match the return type of a gcc2
13007 builtin and then its argument prototype would still apply. */
13010 /* The GNU C library defines this for functions which it implements
13011 to always fail with ENOSYS. Some functions are actually named
13012 something starting with __ and the normal name is an alias. */
13013 #if defined (__stub_lchown) || defined (__stub___lchown)
13021 if eval $compile; then
13022 $echo "lchown() found." >&4
13025 $echo "lchown() NOT found." >&4
13031 : See if number of significant digits in a double precision number is known
13033 $cat >ldbl_dig.c <<EOM
13034 #$i_limits I_LIMITS
13037 #include <limits.h>
13043 printf("Contains LDBL_DIG");
13046 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
13047 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
13048 echo "LDBL_DIG found." >&4
13051 echo "LDBL_DIG NOT found." >&4
13058 : see if link exists
13062 : see if localtime_r exists
13063 set localtime_r d_localtime_r
13065 case "$d_localtime_r" in
13067 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13068 case "$d_localtime_r_proto:$usethreads" in
13069 ":define") d_localtime_r_proto=define
13070 set d_localtime_r_proto localtime_r $hdrs
13074 case "$d_localtime_r_proto" in
13076 case "$localtime_r_proto" in
13077 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
13078 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
13080 case "$localtime_r_proto" in
13081 ''|0) try='int localtime_r(const time_t*, struct tm*);'
13082 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
13084 case "$localtime_r_proto" in
13085 ''|0) d_localtime_r=undef
13086 localtime_r_proto=0
13087 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
13088 * ) case "$localtime_r_proto" in
13089 REENTRANT_PROTO*) ;;
13090 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
13092 echo "Prototype: $try" ;;
13095 *) case "$usethreads" in
13096 define) echo "localtime_r has no prototype, not using it." >&4 ;;
13098 d_localtime_r=undef
13099 localtime_r_proto=0
13103 *) localtime_r_proto=0
13107 : see if localeconv exists
13108 set localeconv d_locconv
13111 : see if lockf exists
13115 : see if prototype for lseek is available
13117 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
13120 : see if lstat exists
13124 : see if madvise exists
13125 set madvise d_madvise
13128 : see if mblen exists
13132 : see if mbstowcs exists
13133 set mbstowcs d_mbstowcs
13136 : see if mbtowc exists
13137 set mbtowc d_mbtowc
13140 : see if memchr exists
13141 set memchr d_memchr
13144 : see if memcmp exists
13145 set memcmp d_memcmp
13148 : see if memcpy exists
13149 set memcpy d_memcpy
13152 : see if memmove exists
13153 set memmove d_memmove
13156 : see if memset exists
13157 set memset d_memset
13160 : see if mkdir exists
13164 : see if mkdtemp exists
13165 set mkdtemp d_mkdtemp
13168 : see if mkfifo exists
13169 set mkfifo d_mkfifo
13172 : see if mkstemp exists
13173 set mkstemp d_mkstemp
13176 : see if mkstemps exists
13177 set mkstemps d_mkstemps
13180 : see if mktime exists
13181 set mktime d_mktime
13184 : see if this is a sys/mman.h system
13185 set sys/mman.h i_sysmman
13188 : see if mmap exists
13191 : see what shmat returns
13192 : default to something harmless
13194 case "$i_sysmman$d_mmap" in
13196 $cat >mmap.c <<'END'
13197 #include <sys/mman.h>
13200 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
13205 echo "and it returns ($mmaptype)." >&4
13211 : see if mprotect exists
13212 set mprotect d_mprotect
13215 : see if msgctl exists
13216 set msgctl d_msgctl
13219 : see if msgget exists
13220 set msgget d_msgget
13223 : see if msgsnd exists
13224 set msgsnd d_msgsnd
13227 : see if msgrcv exists
13228 set msgrcv d_msgrcv
13231 : see how much of the 'msg*(2)' library is present.
13234 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
13235 *"$undef"*) h_msg=false;;
13239 case "`ipcs 2>&1`" in
13240 "SVID messages"*"not configured"*)
13241 echo "Your $osname does not have the msg*(2) configured." >&4
13244 set msgctl d_msgctl
13246 set msgget d_msgget
13248 set msgsnd d_msgsnd
13250 set msgrcv d_msgrcv
13256 : we could also check for sys/ipc.h ...
13257 if $h_msg && $test `./findhdr sys/msg.h`; then
13258 echo "You have the full msg*(2) library." >&4
13261 echo "You don't have the full msg*(2) library." >&4
13269 echo "Checking to see if your system supports struct msghdr..." >&4
13270 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
13272 case "$d_msghdr_s" in
13273 "$define") echo "Yes, it does." ;;
13274 *) echo "No, it doesn't." ;;
13278 : see if msync exists
13282 : see if munmap exists
13283 set munmap d_munmap
13286 : see if nice exists
13290 : see if this is a langinfo.h system
13291 set langinfo.h i_langinfo
13294 : see if nl_langinfo exists
13295 set nl_langinfo d_nl_langinfo
13298 : check for length of character
13300 case "$charsize" in
13302 echo "Checking to see how big your characters are (hey, you never know)..." >&4
13303 $cat >try.c <<'EOCP'
13307 printf("%d\n", (int)sizeof(char));
13312 if eval $compile_ok; then
13316 echo "(I can't seem to compile the test program. Guessing...)"
13323 rp="What is the size of a character (in bytes)?"
13328 : check for volatile keyword
13330 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
13331 $cat >try.c <<'EOCP'
13334 typedef struct _goo_struct goo_struct;
13335 goo_struct * volatile goo = ((goo_struct *)0);
13336 struct _goo_struct {
13341 typedef unsigned short foo_t;
13342 char *volatile foo;
13344 volatile foo_t blech;
13348 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
13350 echo "Yup, it does."
13353 echo "Nope, it doesn't."
13361 $echo "Choosing the C types to be used for Perl's internal types..." >&4
13363 case "$use64bitint:$d_quad:$quadtype" in
13366 uvtype="$uquadtype"
13371 uvtype="unsigned long"
13377 case "$uselongdouble:$d_longdbl" in
13379 nvtype="long double"
13380 nvsize=$longdblsize
13387 $echo "(IV will be "$ivtype", $ivsize bytes)"
13388 $echo "(UV will be "$uvtype", $uvsize bytes)"
13389 $echo "(NV will be "$nvtype", $nvsize bytes)"
13392 #$i_inttypes I_INTTYPES
13394 #include <inttypes.h>
13399 int8_t i = INT8_MAX;
13400 uint8_t u = UINT8_MAX;
13401 printf("int8_t\n");
13404 int16_t i = INT16_MAX;
13405 uint16_t i = UINT16_MAX;
13406 printf("int16_t\n");
13409 int32_t i = INT32_MAX;
13410 uint32_t u = UINT32_MAX;
13411 printf("int32_t\n");
13417 '') case "$charsize" in
13419 u8type="unsigned char"
13428 if eval $compile; then
13429 case "`$run ./try`" in
13430 int8_t) i8type=int8_t
13440 '') if $test $charsize -ge 1; then
13442 u8type="unsigned char"
13450 '') case "$shortsize" in
13452 u16type="unsigned short"
13460 '') set try -DINT16
13461 if eval $compile; then
13462 case "`$run ./try`" in
13474 '') if $test $shortsize -ge 2; then
13476 u16type="unsigned short"
13484 '') case "$longsize" in
13486 u32type="unsigned long"
13490 *) case "$intsize" in
13492 u32type="unsigned int"
13502 '') set try -DINT32
13503 if eval $compile; then
13504 case "`$run ./try`" in
13516 '') if $test $intsize -ge 4; then
13518 u32type="unsigned int"
13526 '') case "$d_quad:$quadtype" in
13528 i64type="$quadtype"
13529 u64type="$uquadtype"
13537 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
13538 : volatile so that the compiler has to store it out to memory.
13539 if test X"$d_volatile" = X"$define"; then
13544 #include <sys/types.h>
13545 #include <signal.h>
13547 $volatile int bletched = 0;
13548 $signal_t blech(s) int s; { bletched = 1; }
13553 int n = 8 * $uvsize;
13556 signal(SIGFPE, blech);
13559 for (i = 0; i < n; i++) {
13560 u = u << 1 | ($uvtype)1;
13562 if (($uvtype)d != u)
13566 d = ($nvtype)(u - 1);
13567 if (($uvtype)d != (u - 1))
13575 printf("%d\n", ((i == n) ? -n : i));
13581 d_nv_preserves_uv="$undef"
13582 if eval $compile; then
13583 nv_preserves_uv_bits="`$run ./try`"
13585 case "$nv_preserves_uv_bits" in
13587 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
13588 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
13589 d_nv_preserves_uv="$define"
13591 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
13592 d_nv_preserves_uv="$undef" ;;
13593 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
13594 nv_preserves_uv_bits="$undef" ;;
13600 : check for off64_t
13602 echo "Checking to see if you have off64_t..." >&4
13604 #include <sys/types.h>
13605 #include <unistd.h>
13606 int main() { off64_t x = 7; }
13609 if eval $compile; then
13611 echo "You have off64_t."
13614 echo "You do not have off64_t."
13615 case "$lseeksize" in
13616 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
13623 : how to create joinable pthreads
13624 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
13626 echo "Checking what constant to use for creating joinable pthreads..." >&4
13627 $cat >try.c <<'EOCP'
13628 #include <pthread.h>
13630 int detachstate = JOINABLE;
13633 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
13634 if eval $compile; then
13635 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
13636 val="$undef" # Yes, undef.
13637 set d_old_pthread_create_joinable
13640 set old_pthread_create_joinable
13643 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
13644 if eval $compile; then
13645 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
13647 set d_old_pthread_create_joinable
13649 val=PTHREAD_CREATE_UNDETACHED
13650 set old_pthread_create_joinable
13653 set try -DJOINABLE=__UNDETACHED
13654 if eval $compile; then
13655 echo "You seem to use __UNDETACHED." >&4
13657 set d_old_pthread_create_joinable
13660 set old_pthread_create_joinable
13663 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
13665 set d_old_pthread_create_joinable
13668 set old_pthread_create_joinable
13675 d_old_pthread_create_joinable="$undef"
13676 old_pthread_create_joinable=""
13679 : see if pause exists
13683 : see if pipe exists
13687 : see if poll exists
13691 : see if readlink exists
13692 set readlink d_readlink
13698 case "$d_readlink" in
13700 if $issymlink /proc/self/exe ; then
13701 $ls -l /proc/self/exe > reflect
13702 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
13703 echo "You have Linux-like /proc/self/exe."
13704 procselfexe='"/proc/self/exe"'
13708 if $issymlink /proc/curproc/file ; then
13709 $ls -l /proc/curproc/file > reflect
13710 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
13711 echo "You have BSD-like /proc/curproc/file."
13712 procselfexe='"/proc/curproc/file"'
13722 : see whether the pthread_atfork exists
13724 #include <pthread.h>
13727 #ifdef PTHREAD_ATFORK
13728 pthread_atfork(NULL,NULL,NULL);
13733 : see if pthread_atfork exists
13734 set try -DPTHREAD_ATFORK
13735 if eval $compile; then
13740 case "$usethreads" in
13743 $define) echo 'pthread_atfork found.' >&4 ;;
13744 *) echo 'pthread_atfork NOT found.' >&4 ;;
13747 set d_pthread_atfork
13751 : see whether the various POSIXish _yields exist
13753 #include <pthread.h>
13759 #ifdef PTHREAD_YIELD
13762 #ifdef PTHREAD_YIELD_NULL
13763 pthread_yield(NULL);
13769 : see if sched_yield exists
13770 set try -DSCHED_YIELD
13771 if eval $compile; then
13773 sched_yield='sched_yield()'
13777 case "$usethreads" in
13780 $define) echo 'sched_yield() found.' >&4 ;;
13781 *) echo 'sched_yield() NOT found.' >&4 ;;
13787 : see if pthread_yield exists
13788 set try -DPTHREAD_YIELD
13789 if eval $compile; then
13791 case "$sched_yield" in
13792 '') sched_yield='pthread_yield()' ;;
13795 set try -DPTHREAD_YIELD_NULL
13796 if eval $compile; then
13798 case "$sched_yield" in
13799 '') sched_yield='pthread_yield(NULL)' ;;
13805 case "$usethreads" in
13808 $define) echo 'pthread_yield() found.' >&4 ;;
13809 *) echo 'pthread_yield() NOT found.' >&4 ;;
13813 set d_pthread_yield
13816 case "$sched_yield" in
13817 '') sched_yield=undef ;;
13822 : see if random_r exists
13823 set random_r d_random_r
13825 case "$d_random_r" in
13827 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
13828 case "$d_random_r_proto:$usethreads" in
13829 ":define") d_random_r_proto=define
13830 set d_random_r_proto random_r $hdrs
13834 case "$d_random_r_proto" in
13836 case "$random_r_proto" in
13837 ''|0) try='int random_r(int*, struct random_data*);'
13838 ./protochk "extern $try" $hdrs && random_r_proto=I_TS ;;
13840 case "$random_r_proto" in
13841 ''|0) d_random_r=undef
13843 echo "Disabling random_r, cannot determine prototype." >&4 ;;
13844 * ) case "$random_r_proto" in
13845 REENTRANT_PROTO*) ;;
13846 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
13848 echo "Prototype: $try" ;;
13851 *) case "$usethreads" in
13852 define) echo "random_r has no prototype, not using it." >&4 ;;
13859 *) random_r_proto=0
13863 : see if readdir and friends exist
13864 set readdir d_readdir
13866 set seekdir d_seekdir
13868 set telldir d_telldir
13870 set rewinddir d_rewinddir
13873 : see if readdir64_r exists
13874 set readdir64_r d_readdir64_r
13876 case "$d_readdir64_r" in
13878 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
13879 case "$d_readdir64_r_proto:$usethreads" in
13880 ":define") d_readdir64_r_proto=define
13881 set d_readdir64_r_proto readdir64_r $hdrs
13885 case "$d_readdir64_r_proto" in
13887 case "$readdir64_r_proto" in
13888 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
13889 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
13891 case "$readdir64_r_proto" in
13892 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
13893 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
13895 case "$readdir64_r_proto" in
13896 ''|0) d_readdir64_r=undef
13897 readdir64_r_proto=0
13898 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
13899 * ) case "$readdir64_r_proto" in
13900 REENTRANT_PROTO*) ;;
13901 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
13903 echo "Prototype: $try" ;;
13906 *) case "$usethreads" in
13907 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
13909 d_readdir64_r=undef
13910 readdir64_r_proto=0
13914 *) readdir64_r_proto=0
13918 : see if readdir_r exists
13919 set readdir_r d_readdir_r
13921 case "$d_readdir_r" in
13923 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
13924 case "$d_readdir_r_proto:$usethreads" in
13925 ":define") d_readdir_r_proto=define
13926 set d_readdir_r_proto readdir_r $hdrs
13930 case "$d_readdir_r_proto" in
13932 case "$readdir_r_proto" in
13933 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
13934 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
13936 case "$readdir_r_proto" in
13937 ''|0) try='int readdir_r(DIR*, struct dirent*);'
13938 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
13940 case "$readdir_r_proto" in
13941 ''|0) d_readdir_r=undef
13943 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
13944 * ) case "$readdir_r_proto" in
13945 REENTRANT_PROTO*) ;;
13946 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
13948 echo "Prototype: $try" ;;
13951 *) case "$usethreads" in
13952 define) echo "readdir_r has no prototype, not using it." >&4 ;;
13959 *) readdir_r_proto=0
13963 : see if readv exists
13967 : see if recvmsg exists
13968 set recvmsg d_recvmsg
13971 : see if rename exists
13972 set rename d_rename
13975 : see if rmdir exists
13979 : see if memory.h is available.
13984 : See if it conflicts with string.h
13990 $cppstdin $cppflags $cppminus < $strings > mem.h
13991 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
13993 echo "We won't be including <memory.h>."
14003 : can bcopy handle overlapping blocks?
14006 case "$d_memmove" in
14007 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
14008 *) case "$d_bcopy" in
14010 echo "Checking to see if bcopy() can do overlapping copies..." >&4
14012 #$i_memory I_MEMORY
14013 #$i_stdlib I_STDLIB
14014 #$i_string I_STRING
14015 #$i_unistd I_UNISTD
14017 $cat >>try.c <<'EOCP'
14020 # include <memory.h>
14023 # include <stdlib.h>
14026 # include <string.h>
14028 # include <strings.h>
14031 # include <unistd.h> /* Needed for NetBSD */
14035 char buf[128], abc[128];
14041 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14042 try to store the string in read-only memory. */
14043 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
14045 for (align = 7; align >= 0; align--) {
14046 for (len = 36; len; len--) {
14048 bcopy(abc, b, len);
14049 for (off = 1; off <= len; off++) {
14050 bcopy(b, b+off, len);
14051 bcopy(b+off, b, len);
14052 if (bcmp(b, abc, len))
14061 if eval $compile_ok; then
14062 if ./try 2>/dev/null; then
14063 echo "Yes, it can."
14066 echo "It can't, sorry."
14069 echo "(I can't compile the test program, so we'll assume not...)"
14073 $rm -f try.* try core
14079 : can memcpy handle overlapping blocks?
14082 case "$d_memmove" in
14083 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
14084 *) case "$d_memcpy" in
14086 echo "Checking to see if memcpy() can do overlapping copies..." >&4
14088 #$i_memory I_MEMORY
14089 #$i_stdlib I_STDLIB
14090 #$i_string I_STRING
14091 #$i_unistd I_UNISTD
14093 $cat >>try.c <<'EOCP'
14096 # include <memory.h>
14099 # include <stdlib.h>
14102 # include <string.h>
14104 # include <strings.h>
14107 # include <unistd.h> /* Needed for NetBSD */
14111 char buf[128], abc[128];
14117 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14118 try to store the string in read-only memory. */
14119 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
14121 for (align = 7; align >= 0; align--) {
14122 for (len = 36; len; len--) {
14124 memcpy(b, abc, len);
14125 for (off = 1; off <= len; off++) {
14126 memcpy(b+off, b, len);
14127 memcpy(b, b+off, len);
14128 if (memcmp(b, abc, len))
14137 if eval $compile_ok; then
14138 if ./try 2>/dev/null; then
14139 echo "Yes, it can."
14142 echo "It can't, sorry."
14145 echo "(I can't compile the test program, so we'll assume not...)"
14149 $rm -f try.* try core
14155 : can memcmp be trusted to compare relative magnitude?
14157 case "$d_memcmp" in
14160 echo "Checking if your memcmp() can compare relative magnitude..." >&4
14162 #$i_memory I_MEMORY
14163 #$i_stdlib I_STDLIB
14164 #$i_string I_STRING
14165 #$i_unistd I_UNISTD
14167 $cat >>try.c <<'EOCP'
14170 # include <memory.h>
14173 # include <stdlib.h>
14176 # include <string.h>
14178 # include <strings.h>
14181 # include <unistd.h> /* Needed for NetBSD */
14187 if ((a < b) && memcmp(&a, &b, 1) < 0)
14193 if eval $compile_ok; then
14194 if $run ./try 2>/dev/null; then
14195 echo "Yes, it can."
14198 echo "No, it can't (it uses signed chars)."
14201 echo "(I can't compile the test program, so we'll assume not...)"
14205 $rm -f try.* try core
14209 : see if prototype for sbrk is available
14211 set d_sbrkproto sbrk $i_unistd unistd.h
14214 : see if select exists
14215 set select d_select
14218 : see if semctl exists
14219 set semctl d_semctl
14222 : see if semget exists
14223 set semget d_semget
14226 : see if semop exists
14230 : see how much of the 'sem*(2)' library is present.
14233 case "$d_semctl$d_semget$d_semop" in
14234 *"$undef"*) h_sem=false;;
14238 case "`ipcs 2>&1`" in
14239 "SVID messages"*"not configured"*)
14240 echo "Your $osname does not have the sem*(2) configured." >&4
14243 set semctl d_semctl
14245 set semget d_semget
14253 : we could also check for sys/ipc.h ...
14254 if $h_sem && $test `./findhdr sys/sem.h`; then
14255 echo "You have the full sem*(2) library." >&4
14258 echo "You don't have the full sem*(2) library." >&4
14264 : see whether sys/sem.h defines union semun
14266 $cat > try.c <<'END'
14267 #include <sys/types.h>
14268 #include <sys/ipc.h>
14269 #include <sys/sem.h>
14270 int main () { union semun semun; semun.buf = 0; }
14273 if eval $compile; then
14274 echo "You have union semun in <sys/sem.h>." >&4
14277 echo "You do not have union semun in <sys/sem.h>." >&4
14280 $rm -f try try.c try.h
14284 : see how to do semctl IPC_STAT
14287 : see whether semctl IPC_STAT can use union semun
14292 # define S_IRUSR S_IREAD
14293 # define S_IWUSR S_IWRITE
14294 # define S_IXUSR S_IEXEC
14296 # define S_IRUSR 0400
14297 # define S_IWUSR 0200
14298 # define S_IXUSR 0100
14300 # define S_IRGRP (S_IRUSR>>3)
14301 # define S_IWGRP (S_IWUSR>>3)
14302 # define S_IXGRP (S_IXUSR>>3)
14303 # define S_IROTH (S_IRUSR>>6)
14304 # define S_IWOTH (S_IWUSR>>6)
14305 # define S_IXOTH (S_IXUSR>>6)
14308 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
14309 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
14310 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
14315 #include <sys/types.h>
14316 #include <sys/ipc.h>
14317 #include <sys/sem.h>
14318 #include <sys/stat.h>
14325 #$d_union_semun HAS_UNION_SEMUN
14328 #ifndef HAS_UNION_SEMUN
14331 struct semid_ds *buf;
14332 unsigned short *array;
14338 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14339 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14341 struct semid_ds argbuf;
14344 st = semctl(sem, 0, IPC_STAT, arg);
14348 # endif /* IPC_STAT */
14349 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14351 if (semctl(sem, 0, IPC_RMID, arg) != 0)
14352 # endif /* IPC_RMID */
14353 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14355 #endif /* IPC_PRIVATE && ... */
14356 printf("semget failed: errno = %d\n", errno);
14362 if eval $compile; then
14365 semun) val="$define" ;;
14371 case "$d_semctl_semun" in
14373 echo "You can use union semun for semctl IPC_STAT." >&4
14376 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
14381 : see whether semctl IPC_STAT can use struct semid_ds pointer
14382 $cat > try.c <<'END'
14383 #include <sys/types.h>
14384 #include <sys/ipc.h>
14385 #include <sys/sem.h>
14386 #include <sys/stat.h>
14394 struct semid_ds arg;
14397 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14398 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14401 st = semctl(sem, 0, IPC_STAT, &arg);
14403 printf("semid_ds\n");
14405 # endif /* IPC_STAT */
14406 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14408 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
14409 # endif /* IPC_RMID */
14410 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14412 #endif /* IPC_PRIVATE && ... */
14413 printf("semget failed: errno = %d\n", errno);
14420 if eval $compile; then
14423 semid_ds) val="$define" ;;
14427 set d_semctl_semid_ds
14429 case "$d_semctl_semid_ds" in
14431 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
14433 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
14440 # We do not have the full sem*(2) library, so assume we can not
14446 set d_semctl_semid_ds
14451 : see if sendmsg exists
14452 set sendmsg d_sendmsg
14455 : see if setegid exists
14456 set setegid d_setegid
14459 : see if seteuid exists
14460 set seteuid d_seteuid
14463 : see if setgrent exists
14464 set setgrent d_setgrent
14467 : see if setgrent_r exists
14468 set setgrent_r d_setgrent_r
14470 case "$d_setgrent_r" in
14472 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14473 case "$d_setgrent_r_proto:$usethreads" in
14474 ":define") d_setgrent_r_proto=define
14475 set d_setgrent_r_proto setgrent_r $hdrs
14479 case "$d_setgrent_r_proto" in
14481 case "$setgrent_r_proto" in
14482 ''|0) try='int setgrent_r(FILE**);'
14483 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
14485 case "$setgrent_r_proto" in
14486 ''|0) try='void setgrent_r(FILE**);'
14487 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
14489 case "$setgrent_r_proto" in
14490 ''|0) d_setgrent_r=undef
14492 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
14493 * ) case "$setgrent_r_proto" in
14494 REENTRANT_PROTO*) ;;
14495 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
14497 echo "Prototype: $try" ;;
14500 *) case "$usethreads" in
14501 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
14508 *) setgrent_r_proto=0
14512 : see if sethostent exists
14513 set sethostent d_sethent
14516 : see if sethostent_r exists
14517 set sethostent_r d_sethostent_r
14519 case "$d_sethostent_r" in
14521 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14522 case "$d_sethostent_r_proto:$usethreads" in
14523 ":define") d_sethostent_r_proto=define
14524 set d_sethostent_r_proto sethostent_r $hdrs
14528 case "$d_sethostent_r_proto" in
14530 case "$sethostent_r_proto" in
14531 ''|0) try='int sethostent_r(int, struct hostent_data*);'
14532 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
14534 case "$sethostent_r_proto" in
14535 ''|0) try='void sethostent_r(int, struct hostent_data*);'
14536 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
14538 case "$sethostent_r_proto" in
14539 ''|0) d_sethostent_r=undef
14540 sethostent_r_proto=0
14541 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
14542 * ) case "$sethostent_r_proto" in
14543 REENTRANT_PROTO*) ;;
14544 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
14546 echo "Prototype: $try" ;;
14549 *) case "$usethreads" in
14550 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
14552 d_sethostent_r=undef
14553 sethostent_r_proto=0
14557 *) sethostent_r_proto=0
14561 : see if setitimer exists
14562 set setitimer d_setitimer
14565 : see if setlinebuf exists
14566 set setlinebuf d_setlinebuf
14569 : see if setlocale exists
14570 set setlocale d_setlocale
14573 : see if locale.h is available
14574 set locale.h i_locale
14577 : see if setlocale_r exists
14578 set setlocale_r d_setlocale_r
14580 case "$d_setlocale_r" in
14582 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
14583 case "$d_setlocale_r_proto:$usethreads" in
14584 ":define") d_setlocale_r_proto=define
14585 set d_setlocale_r_proto setlocale_r $hdrs
14589 case "$d_setlocale_r_proto" in
14591 case "$setlocale_r_proto" in
14592 ''|0) try='int setlocale_r(int, const char*, char*, int);'
14593 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
14595 case "$setlocale_r_proto" in
14596 ''|0) d_setlocale_r=undef
14597 setlocale_r_proto=0
14598 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
14599 * ) case "$setlocale_r_proto" in
14600 REENTRANT_PROTO*) ;;
14601 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
14603 echo "Prototype: $try" ;;
14606 *) case "$usethreads" in
14607 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
14609 d_setlocale_r=undef
14610 setlocale_r_proto=0
14614 *) setlocale_r_proto=0
14618 : see if setnetent exists
14619 set setnetent d_setnent
14622 : see if setnetent_r exists
14623 set setnetent_r d_setnetent_r
14625 case "$d_setnetent_r" in
14627 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14628 case "$d_setnetent_r_proto:$usethreads" in
14629 ":define") d_setnetent_r_proto=define
14630 set d_setnetent_r_proto setnetent_r $hdrs
14634 case "$d_setnetent_r_proto" in
14636 case "$setnetent_r_proto" in
14637 ''|0) try='int setnetent_r(int, struct netent_data*);'
14638 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
14640 case "$setnetent_r_proto" in
14641 ''|0) try='void setnetent_r(int, struct netent_data*);'
14642 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
14644 case "$setnetent_r_proto" in
14645 ''|0) d_setnetent_r=undef
14646 setnetent_r_proto=0
14647 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
14648 * ) case "$setnetent_r_proto" in
14649 REENTRANT_PROTO*) ;;
14650 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
14652 echo "Prototype: $try" ;;
14655 *) case "$usethreads" in
14656 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
14658 d_setnetent_r=undef
14659 setnetent_r_proto=0
14663 *) setnetent_r_proto=0
14667 : see if setprotoent exists
14668 set setprotoent d_setpent
14671 : see if setpgid exists
14672 set setpgid d_setpgid
14675 : see if setpgrp2 exists
14676 set setpgrp2 d_setpgrp2
14679 : see if setpriority exists
14680 set setpriority d_setprior
14683 : see if setproctitle exists
14684 set setproctitle d_setproctitle
14687 : see if setprotoent_r exists
14688 set setprotoent_r d_setprotoent_r
14690 case "$d_setprotoent_r" in
14692 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14693 case "$d_setprotoent_r_proto:$usethreads" in
14694 ":define") d_setprotoent_r_proto=define
14695 set d_setprotoent_r_proto setprotoent_r $hdrs
14699 case "$d_setprotoent_r_proto" in
14701 case "$setprotoent_r_proto" in
14702 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
14703 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
14705 case "$setprotoent_r_proto" in
14706 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
14707 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
14709 case "$setprotoent_r_proto" in
14710 ''|0) d_setprotoent_r=undef
14711 setprotoent_r_proto=0
14712 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
14713 * ) case "$setprotoent_r_proto" in
14714 REENTRANT_PROTO*) ;;
14715 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
14717 echo "Prototype: $try" ;;
14720 *) case "$usethreads" in
14721 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
14723 d_setprotoent_r=undef
14724 setprotoent_r_proto=0
14728 *) setprotoent_r_proto=0
14732 : see if setpwent exists
14733 set setpwent d_setpwent
14736 : see if setpwent_r exists
14737 set setpwent_r d_setpwent_r
14739 case "$d_setpwent_r" in
14741 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14742 case "$d_setpwent_r_proto:$usethreads" in
14743 ":define") d_setpwent_r_proto=define
14744 set d_setpwent_r_proto setpwent_r $hdrs
14748 case "$d_setpwent_r_proto" in
14750 case "$setpwent_r_proto" in
14751 ''|0) try='int setpwent_r(FILE**);'
14752 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
14754 case "$setpwent_r_proto" in
14755 ''|0) try='void setpwent_r(FILE**);'
14756 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
14758 case "$setpwent_r_proto" in
14759 ''|0) d_setpwent_r=undef
14761 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
14762 * ) case "$setpwent_r_proto" in
14763 REENTRANT_PROTO*) ;;
14764 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
14766 echo "Prototype: $try" ;;
14769 *) case "$usethreads" in
14770 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
14777 *) setpwent_r_proto=0
14781 : see if setregid exists
14782 set setregid d_setregid
14784 set setresgid d_setresgid
14787 : see if setreuid exists
14788 set setreuid d_setreuid
14790 set setresuid d_setresuid
14793 : see if setrgid exists
14794 set setrgid d_setrgid
14797 : see if setruid exists
14798 set setruid d_setruid
14801 : see if setservent exists
14802 set setservent d_setsent
14805 : see if setservent_r exists
14806 set setservent_r d_setservent_r
14808 case "$d_setservent_r" in
14810 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14811 case "$d_setservent_r_proto:$usethreads" in
14812 ":define") d_setservent_r_proto=define
14813 set d_setservent_r_proto setservent_r $hdrs
14817 case "$d_setservent_r_proto" in
14819 case "$setservent_r_proto" in
14820 ''|0) try='int setservent_r(int, struct servent_data*);'
14821 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
14823 case "$setservent_r_proto" in
14824 ''|0) try='void setservent_r(int, struct servent_data*);'
14825 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
14827 case "$setservent_r_proto" in
14828 ''|0) d_setservent_r=undef
14829 setservent_r_proto=0
14830 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
14831 * ) case "$setservent_r_proto" in
14832 REENTRANT_PROTO*) ;;
14833 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
14835 echo "Prototype: $try" ;;
14838 *) case "$usethreads" in
14839 define) echo "setservent_r has no prototype, not using it." >&4 ;;
14841 d_setservent_r=undef
14842 setservent_r_proto=0
14846 *) setservent_r_proto=0
14850 : see if setsid exists
14851 set setsid d_setsid
14854 : see if setvbuf exists
14855 set setvbuf d_setvbuf
14858 : see if sfio.h is available
14863 : see if sfio library is available
14874 : Ok, but do we want to use it.
14878 true|$define|[yY]*) dflt='y';;
14881 echo "$package can use the sfio library, but it is experimental."
14882 case "$useperlio" in
14884 echo "For sfio also the PerlIO abstraction layer is needed."
14885 echo "Earlier you said you wouldn't want that."
14888 rp="You seem to have sfio available, do you want to try using it?"
14891 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
14892 useperlio="$define"
14895 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
14900 *) case "$usesfio" in
14901 true|$define|[yY]*)
14902 echo "Sorry, cannot find sfio on this machine." >&4
14903 echo "Ignoring your setting of usesfio=$usesfio." >&4
14912 $define) usesfio='true';;
14913 *) usesfio='false';;
14917 *) : Remove sfio from list of libraries to use
14920 echo "Removing unneeded -lsfio from library list" >&4
14921 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
14924 echo "libs = $libs" >&4
14931 : see if shmctl exists
14932 set shmctl d_shmctl
14935 : see if shmget exists
14936 set shmget d_shmget
14939 : see if shmat exists
14942 : see what shmat returns
14945 $cat >shmat.c <<'END'
14946 #include <sys/shm.h>
14949 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
14954 echo "and it returns ($shmattype)." >&4
14955 : see if a prototype for shmat is available
14956 xxx=`./findhdr sys/shm.h`
14957 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
14958 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
14969 set d_shmatprototype
14972 : see if shmdt exists
14976 : see how much of the 'shm*(2)' library is present.
14979 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
14980 *"$undef"*) h_shm=false;;
14984 case "`ipcs 2>&1`" in
14985 "SVID shared memory"*"not configured"*)
14986 echo "Your $osname does not have the shm*(2) configured." >&4
14989 set shmctl d_shmctl
14991 set shmget d_shmget
15001 : we could also check for sys/ipc.h ...
15002 if $h_shm && $test `./findhdr sys/shm.h`; then
15003 echo "You have the full shm*(2) library." >&4
15006 echo "You don't have the full shm*(2) library." >&4
15013 : see if we have sigaction
15014 if set sigaction val -f d_sigaction; eval $csym; $val; then
15015 echo 'sigaction() found.' >&4
15016 $cat > try.c <<'EOP'
15018 #include <sys/types.h>
15019 #include <signal.h>
15022 struct sigaction act, oact;
15024 oact.sa_handler = 0;
15025 /* so that act and oact are used */
15026 exit(act.sa_flags == 0 && oact.sa_handler == 0);
15030 if eval $compile_ok; then
15033 echo "But you don't seem to have a useable struct sigaction." >&4
15037 echo 'sigaction NOT found.' >&4
15040 set d_sigaction; eval $setvar
15041 $rm -f try try$_o try.c
15043 : see if sigprocmask exists
15044 set sigprocmask d_sigprocmask
15047 : see if sigsetjmp exists
15049 case "$d_sigsetjmp" in
15051 $cat >try.c <<'EOP'
15052 #include <setjmp.h>
15057 if (sigsetjmp(env,1))
15060 siglongjmp(env, 1);
15065 if eval $compile; then
15066 if $run ./try >/dev/null 2>&1; then
15067 echo "POSIX sigsetjmp found." >&4
15071 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
15077 echo "sigsetjmp not found." >&4
15081 *) val="$d_sigsetjmp"
15082 case "$d_sigsetjmp" in
15083 $define) echo "POSIX sigsetjmp found." >&4;;
15084 $undef) echo "sigsetjmp not found." >&4;;
15092 : see if sockatmark exists
15093 set sockatmark d_sockatmark
15096 : see if prototype for sockatmark is available
15098 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
15101 : see if socks5_init exists
15102 set socks5_init d_socks5_init
15105 : see if srand48_r exists
15106 set srand48_r d_srand48_r
15108 case "$d_srand48_r" in
15110 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15111 case "$d_srand48_r_proto:$usethreads" in
15112 ":define") d_srand48_r_proto=define
15113 set d_srand48_r_proto srand48_r $hdrs
15117 case "$d_srand48_r_proto" in
15119 case "$srand48_r_proto" in
15120 ''|0) try='int srand48_r(long, struct drand48_data*);'
15121 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
15123 case "$srand48_r_proto" in
15124 ''|0) d_srand48_r=undef
15126 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
15127 * ) case "$srand48_r_proto" in
15128 REENTRANT_PROTO*) ;;
15129 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
15131 echo "Prototype: $try" ;;
15134 *) case "$usethreads" in
15135 define) echo "srand48_r has no prototype, not using it." >&4 ;;
15142 *) srand48_r_proto=0
15146 : see if srandom_r exists
15147 set srandom_r d_srandom_r
15149 case "$d_srandom_r" in
15151 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15152 case "$d_srandom_r_proto:$usethreads" in
15153 ":define") d_srandom_r_proto=define
15154 set d_srandom_r_proto srandom_r $hdrs
15158 case "$d_srandom_r_proto" in
15160 case "$srandom_r_proto" in
15161 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
15162 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
15164 case "$srandom_r_proto" in
15165 ''|0) d_srandom_r=undef
15167 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
15168 * ) case "$srandom_r_proto" in
15169 REENTRANT_PROTO*) ;;
15170 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
15172 echo "Prototype: $try" ;;
15175 *) case "$usethreads" in
15176 define) echo "srandom_r has no prototype, not using it." >&4 ;;
15183 *) srandom_r_proto=0
15187 : see if prototype for setresgid is available
15189 set d_sresgproto setresgid $i_unistd unistd.h
15192 : see if prototype for setresuid is available
15194 set d_sresuproto setresuid $i_unistd unistd.h
15197 : see if sys/stat.h is available
15198 set sys/stat.h i_sysstat
15202 : see if stat knows about block sizes
15204 echo "Checking to see if your struct stat has st_blocks field..." >&4
15205 set d_statblks stat st_blocks $i_sysstat sys/stat.h
15209 : see if this is a sys/vfs.h system
15210 set sys/vfs.h i_sysvfs
15214 : see if this is a sys/statfs.h system
15215 set sys/statfs.h i_sysstatfs
15220 echo "Checking to see if your system supports struct statfs..." >&4
15221 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
15223 case "$d_statfs_s" in
15224 "$define") echo "Yes, it does." ;;
15225 *) echo "No, it doesn't." ;;
15230 : see if struct statfs knows about f_flags
15231 case "$d_statfs_s" in
15234 echo "Checking to see if your struct statfs has f_flags field..." >&4
15235 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
15239 set d_statfs_f_flags
15243 case "$d_statfs_f_flags" in
15244 "$define") echo "Yes, it does." ;;
15245 *) echo "No, it doesn't." ;;
15248 : see if _ptr and _cnt from stdio act std
15251 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
15252 echo "(Looks like you have stdio.h from BSD.)"
15253 case "$stdio_ptr" in
15254 '') stdio_ptr='((fp)->_p)'
15257 *) ptr_lval=$d_stdio_ptr_lval;;
15259 case "$stdio_cnt" in
15260 '') stdio_cnt='((fp)->_r)'
15263 *) cnt_lval=$d_stdio_cnt_lval;;
15265 case "$stdio_base" in
15266 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
15268 case "$stdio_bufsiz" in
15269 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
15271 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
15272 echo "(Looks like you have stdio.h from Linux.)"
15273 case "$stdio_ptr" in
15274 '') stdio_ptr='((fp)->_IO_read_ptr)'
15277 *) ptr_lval=$d_stdio_ptr_lval;;
15279 case "$stdio_cnt" in
15280 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
15283 *) cnt_lval=$d_stdio_cnt_lval;;
15285 case "$stdio_base" in
15286 '') stdio_base='((fp)->_IO_read_base)';;
15288 case "$stdio_bufsiz" in
15289 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
15292 case "$stdio_ptr" in
15293 '') stdio_ptr='((fp)->_ptr)'
15296 *) ptr_lval=$d_stdio_ptr_lval;;
15298 case "$stdio_cnt" in
15299 '') stdio_cnt='((fp)->_cnt)'
15302 *) cnt_lval=$d_stdio_cnt_lval;;
15304 case "$stdio_base" in
15305 '') stdio_base='((fp)->_base)';;
15307 case "$stdio_bufsiz" in
15308 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
15312 : test whether _ptr and _cnt really work
15313 echo "Checking how std your stdio is..." >&4
15316 #define FILE_ptr(fp) $stdio_ptr
15317 #define FILE_cnt(fp) $stdio_cnt
15319 FILE *fp = fopen("try.c", "r");
15322 18 <= FILE_cnt(fp) &&
15323 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15331 if eval $compile && $to try.c; then
15332 if $run ./try; then
15333 echo "Your stdio acts pretty std."
15336 echo "Your stdio isn't very std."
15339 echo "Your stdio doesn't appear very std."
15345 : Can _ptr be used as an lvalue?
15346 case "$d_stdstdio$ptr_lval" in
15347 $define$define) val=$define ;;
15350 set d_stdio_ptr_lval
15353 : Can _cnt be used as an lvalue?
15354 case "$d_stdstdio$cnt_lval" in
15355 $define$define) val=$define ;;
15358 set d_stdio_cnt_lval
15362 : test whether setting _ptr sets _cnt as a side effect
15363 d_stdio_ptr_lval_sets_cnt="$undef"
15364 d_stdio_ptr_lval_nochange_cnt="$undef"
15365 case "$d_stdio_ptr_lval$d_stdstdio" in
15367 echo "Checking to see what happens if we set the stdio ptr..." >&4
15370 /* Can we scream? */
15371 /* Eat dust sed :-) */
15372 /* In the buffer space, no one can hear you scream. */
15373 #define FILE_ptr(fp) $stdio_ptr
15374 #define FILE_cnt(fp) $stdio_cnt
15375 #include <sys/types.h>
15377 FILE *fp = fopen("try.c", "r");
15382 puts("Fail even to read");
15385 c = getc(fp); /* Read away the first # */
15387 puts("Fail even to read");
15391 18 <= FILE_cnt(fp) &&
15392 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15394 puts("Fail even to read");
15397 ptr = (char*) FILE_ptr(fp);
15398 cnt = (size_t)FILE_cnt(fp);
15400 FILE_ptr(fp) += 42;
15402 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
15403 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
15406 if (FILE_cnt(fp) <= 20) {
15407 printf ("Fail (<20 chars to test)");
15410 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
15411 puts("Fail compare");
15414 if (cnt == FILE_cnt(fp)) {
15415 puts("Pass_unchanged");
15418 if (FILE_cnt(fp) == (cnt - 42)) {
15419 puts("Pass_changed");
15422 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
15428 if eval $compile && $to try.c; then
15429 case `$run ./try` in
15431 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
15432 d_stdio_ptr_lval_sets_cnt="$define" ;;
15434 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
15435 d_stdio_ptr_lval_nochange_cnt="$define" ;;
15437 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
15439 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
15442 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
15448 : see if _base is also standard
15450 case "$d_stdstdio" in
15454 #define FILE_base(fp) $stdio_base
15455 #define FILE_bufsiz(fp) $stdio_bufsiz
15457 FILE *fp = fopen("try.c", "r");
15460 19 <= FILE_bufsiz(fp) &&
15461 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
15468 if eval $compile && $to try.c; then
15469 if $run ./try; then
15470 echo "And its _base field acts std."
15473 echo "But its _base field isn't std."
15476 echo "However, it seems to be lacking the _base field."
15485 Checking how to access stdio streams by file descriptor number...
15487 case "$stdio_stream_array" in
15488 '') $cat >try.c <<EOCP
15491 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
15495 for s in _iob __iob __sF
15497 set try -DSTDIO_STREAM_ARRAY=$s
15498 if eval $compile; then
15499 case "`$run ./try`" in
15500 yes) stdio_stream_array=$s; break ;;
15504 $rm -f try.* try$exe_ext
15506 case "$stdio_stream_array" in
15508 I can't figure out how to access stdio streams by file descriptor number.
15510 d_stdio_stream_array="$undef"
15513 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
15515 d_stdio_stream_array="$define"
15519 : see if strcoll exists
15520 set strcoll d_strcoll
15523 : check for structure copying
15525 echo "Checking to see if your C compiler can copy structs..." >&4
15526 $cat >try.c <<'EOCP'
15536 if $cc -c try.c >/dev/null 2>&1 ; then
15538 echo "Yup, it can."
15541 echo "Nope, it can't."
15547 : see if strerror and/or sys_errlist[] exist
15549 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
15550 if set strerror val -f d_strerror; eval $csym; $val; then
15551 echo 'strerror() found.' >&4
15552 d_strerror="$define"
15553 d_strerrm='strerror(e)'
15554 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15555 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
15556 d_syserrlst="$define"
15558 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
15559 d_syserrlst="$undef"
15561 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
15562 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
15563 echo 'strerror() found in string header.' >&4
15564 d_strerror="$define"
15565 d_strerrm='strerror(e)'
15566 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15567 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
15568 d_syserrlst="$define"
15570 echo "(You don't appear to have any sys_errlist[], how can this be?)"
15571 d_syserrlst="$undef"
15573 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15574 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
15575 d_strerror="$undef"
15576 d_syserrlst="$define"
15577 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
15579 echo 'strerror() and sys_errlist[] NOT found.' >&4
15580 d_strerror="$undef"
15581 d_syserrlst="$undef"
15582 d_strerrm='"unknown"'
15586 : see if strerror_r exists
15587 set strerror_r d_strerror_r
15589 case "$d_strerror_r" in
15591 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
15592 case "$d_strerror_r_proto:$usethreads" in
15593 ":define") d_strerror_r_proto=define
15594 set d_strerror_r_proto strerror_r $hdrs
15598 case "$d_strerror_r_proto" in
15600 case "$strerror_r_proto" in
15601 ''|0) try='int strerror_r(int, char*, size_t);'
15602 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
15604 case "$strerror_r_proto" in
15605 ''|0) try='int strerror_r(int, char*, int);'
15606 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
15608 case "$strerror_r_proto" in
15609 ''|0) try='char* strerror_r(int, char*, size_t);'
15610 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
15612 case "$strerror_r_proto" in
15613 ''|0) d_strerror_r=undef
15615 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
15616 * ) case "$strerror_r_proto" in
15617 REENTRANT_PROTO*) ;;
15618 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
15620 echo "Prototype: $try" ;;
15623 *) case "$usethreads" in
15624 define) echo "strerror_r has no prototype, not using it." >&4 ;;
15631 *) strerror_r_proto=0
15635 : see if strftime exists
15636 set strftime d_strftime
15639 : see if strtod exists
15640 set strtod d_strtod
15643 : see if strtol exists
15644 set strtol d_strtol
15647 : see if strtold exists
15648 set strtold d_strtold
15651 : see if strtoll exists
15652 set strtoll d_strtoll
15655 case "$d_longlong-$d_strtoll" in
15658 Checking whether your strtoll() works okay...
15660 $cat >try.c <<'EOCP'
15663 #define strtoll __strtoll
15666 #define strtoll _strtoll
15669 extern long long int strtoll(char *s, char **, int);
15670 static int bad = 0;
15671 int check(char *s, long long ell, int een) {
15674 gll = strtoll(s, 0, 10);
15675 if (!((gll == ell) && (errno == een)))
15679 check(" 1", 1LL, 0);
15680 check(" 0", 0LL, 0);
15681 check("-1", -1LL, 0);
15682 check("-9223372036854775808", -9223372036854775808LL, 0);
15683 check("-9223372036854775808", -9223372036854775808LL, 0);
15684 check(" 9223372036854775807", 9223372036854775807LL, 0);
15685 check("-9223372036854775808", -9223372036854775808LL, 0);
15686 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
15687 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
15693 if eval $compile; then
15696 ok) echo "Your strtoll() seems to be working okay." ;;
15698 Your strtoll() doesn't seem to be working okay.
15704 echo "(I can't seem to compile the test program--assuming it doesn't)"
15710 : see if strtoq exists
15711 set strtoq d_strtoq
15714 : see if strtoul exists
15715 set strtoul d_strtoul
15718 case "$d_strtoul" in
15721 Checking whether your strtoul() works okay...
15723 $cat >try.c <<'EOCP'
15726 extern unsigned long int strtoul(char *s, char **, int);
15727 static int bad = 0;
15728 void check(char *s, unsigned long eul, int een) {
15731 gul = strtoul(s, 0, 10);
15732 if (!((gul == eul) && (errno == een)))
15736 check(" 1", 1L, 0);
15737 check(" 0", 0L, 0);
15739 case "$longsize" in
15741 $cat >>try.c <<'EOCP'
15742 check("18446744073709551615", 18446744073709551615UL, 0);
15743 check("18446744073709551616", 18446744073709551615UL, ERANGE);
15744 #if 0 /* strtoul() for /^-/ strings is undefined. */
15745 check("-1", 18446744073709551615UL, 0);
15746 check("-18446744073709551614", 2, 0);
15747 check("-18446744073709551615", 1, 0);
15748 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
15749 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
15754 $cat >>try.c <<'EOCP'
15755 check("4294967295", 4294967295UL, 0);
15756 check("4294967296", 4294967295UL, ERANGE);
15757 #if 0 /* strtoul() for /^-/ strings is undefined. */
15758 check("-1", 4294967295UL, 0);
15759 check("-4294967294", 2, 0);
15760 check("-4294967295", 1, 0);
15761 check("-4294967296", 4294967295UL, ERANGE);
15762 check("-4294967297", 4294967295UL, ERANGE);
15767 : Should we write these tests to be more portable by sprintf-ing
15768 : ~0 and then manipulating that char string as input for strtol?
15771 $cat >>try.c <<'EOCP'
15778 if eval $compile; then
15779 case "`$run ./try`" in
15780 ok) echo "Your strtoul() seems to be working okay." ;;
15782 Your strtoul() doesn't seem to be working okay.
15791 : see if strtoull exists
15792 set strtoull d_strtoull
15795 case "$d_longlong-$d_strtoull" in
15798 Checking whether your strtoull() works okay...
15800 $cat >try.c <<'EOCP'
15803 #define strtoull __strtoull
15806 extern unsigned long long int strtoull(char *s, char **, int);
15807 static int bad = 0;
15808 int check(char *s, long long eull, int een) {
15811 gull = strtoull(s, 0, 10);
15812 if (!((gull == eull) && (errno == een)))
15816 check(" 1", 1LL, 0);
15817 check(" 0", 0LL, 0);
15818 check("18446744073709551615", 18446744073709551615ULL, 0);
15819 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
15820 #if 0 /* strtoull() for /^-/ strings is undefined. */
15821 check("-1", 18446744073709551615ULL, 0);
15822 check("-18446744073709551614", 2LL, 0);
15823 check("-18446744073709551615", 1LL, 0);
15824 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
15825 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
15832 if eval $compile; then
15833 case "`$run ./try`" in
15834 ok) echo "Your strtoull() seems to be working okay." ;;
15836 Your strtoull() doesn't seem to be working okay.
15838 d_strtoull="$undef"
15845 : see if strtouq exists
15846 set strtouq d_strtouq
15849 case "$d_strtouq" in
15852 Checking whether your strtouq() works okay...
15854 $cat >try.c <<'EOCP'
15857 extern unsigned long long int strtouq(char *s, char **, int);
15858 static int bad = 0;
15859 void check(char *s, unsigned long long eull, int een) {
15860 unsigned long long gull;
15862 gull = strtouq(s, 0, 10);
15863 if (!((gull == eull) && (errno == een)))
15867 check(" 1", 1LL, 0);
15868 check(" 0", 0LL, 0);
15869 check("18446744073709551615", 18446744073709551615ULL, 0);
15870 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
15871 #if 0 /* strtouq() for /^-/ strings is undefined. */
15872 check("-1", 18446744073709551615ULL, 0);
15873 check("-18446744073709551614", 2LL, 0);
15874 check("-18446744073709551615", 1LL, 0);
15875 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
15876 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
15884 if eval $compile; then
15885 case "`$run ./try`" in
15886 ok) echo "Your strtouq() seems to be working okay." ;;
15888 Your strtouq() doesn't seem to be working okay.
15897 : see if strxfrm exists
15898 set strxfrm d_strxfrm
15901 : see if symlink exists
15902 set symlink d_symlink
15905 : see if syscall exists
15906 set syscall d_syscall
15909 : see if prototype for syscall is available
15911 set d_syscallproto syscall $i_unistd unistd.h
15914 : see if sysconf exists
15915 set sysconf d_sysconf
15918 : see if system exists
15919 set system d_system
15922 : see if tcgetpgrp exists
15923 set tcgetpgrp d_tcgetpgrp
15926 : see if tcsetpgrp exists
15927 set tcsetpgrp d_tcsetpgrp
15930 : see if prototype for telldir is available
15932 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
15935 : see if time exists
15937 if test "X$d_time" = X -o X"$timetype" = X; then
15938 if set time val -f d_time; eval $csym; $val; then
15939 echo 'time() found.' >&4
15941 rp="What is the type returned by time() on this system?"
15942 set time_t timetype long stdio.h sys/types.h
15945 echo 'time() not found, hope that will do.' >&4
15953 : see if this is a sys/times.h system
15954 set sys/times.h i_systimes
15957 : see if times exists
15959 if set times val -f d_times; eval $csym; $val; then
15960 echo 'times() found.' >&4
15963 case "$i_systimes" in
15964 "$define") inc='sys/times.h';;
15966 rp="What is the type returned by times() on this system?"
15967 set clock_t clocktype long stdio.h sys/types.h $inc
15970 echo 'times() NOT found, hope that will do.' >&4
15975 : see if tmpnam_r exists
15976 set tmpnam_r d_tmpnam_r
15978 case "$d_tmpnam_r" in
15980 hdrs="$i_systypes sys/types.h define stdio.h "
15981 case "$d_tmpnam_r_proto:$usethreads" in
15982 ":define") d_tmpnam_r_proto=define
15983 set d_tmpnam_r_proto tmpnam_r $hdrs
15987 case "$d_tmpnam_r_proto" in
15989 case "$tmpnam_r_proto" in
15990 ''|0) try='char* tmpnam_r(char*);'
15991 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
15993 case "$tmpnam_r_proto" in
15994 ''|0) d_tmpnam_r=undef
15996 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
15997 * ) case "$tmpnam_r_proto" in
15998 REENTRANT_PROTO*) ;;
15999 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
16001 echo "Prototype: $try" ;;
16004 *) case "$usethreads" in
16005 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
16012 *) tmpnam_r_proto=0
16016 : see if truncate exists
16017 set truncate d_truncate
16020 : see if ttyname_r exists
16021 set ttyname_r d_ttyname_r
16023 case "$d_ttyname_r" in
16025 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
16026 case "$d_ttyname_r_proto:$usethreads" in
16027 ":define") d_ttyname_r_proto=define
16028 set d_ttyname_r_proto ttyname_r $hdrs
16032 case "$d_ttyname_r_proto" in
16034 case "$ttyname_r_proto" in
16035 ''|0) try='int ttyname_r(int, char*, size_t);'
16036 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
16038 case "$ttyname_r_proto" in
16039 ''|0) try='int ttyname_r(int, char*, int);'
16040 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
16042 case "$ttyname_r_proto" in
16043 ''|0) try='char* ttyname_r(int, char*, int);'
16044 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
16046 case "$ttyname_r_proto" in
16047 ''|0) d_ttyname_r=undef
16049 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
16050 * ) case "$ttyname_r_proto" in
16051 REENTRANT_PROTO*) ;;
16052 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
16054 echo "Prototype: $try" ;;
16057 *) case "$usethreads" in
16058 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
16065 *) ttyname_r_proto=0
16069 : see if tzname[] exists
16071 if set tzname val -a d_tzname; eval $csym; $val; then
16073 echo 'tzname[] found.' >&4
16076 echo 'tzname[] NOT found.' >&4
16082 next|rhapsody|darwin) multiarch="$define" ;;
16084 case "$multiarch" in
16085 ''|[nN]*) multiarch="$undef" ;;
16088 : check for ordering of bytes in a UV
16090 case "$usecrosscompile$multiarch" in
16093 You seem to be either cross-compiling or doing a multiarchitecture build,
16094 skipping the byteorder check.
16100 case "$byteorder" in
16103 In the following, larger digits indicate more significance. A big-endian
16104 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
16105 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
16106 machines may have weird orders like 3412. A Cray will report 87654321,
16107 an Alpha will report 12345678. If the test program works the default is
16109 I'm now running the test program...
16113 #include <sys/types.h>
16114 typedef $uvtype UV;
16124 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
16126 u.l = (UV)0x04030201;
16127 for (i = 0; i < $uvsize; i++)
16128 printf("%c", u.c[i]+'0');
16135 if eval $compile && ./try > /dev/null; then
16138 [1-4][1-4][1-4][1-4]|12345678|87654321)
16139 echo "(The test program ran ok.)"
16140 echo "byteorder=$dflt"
16143 ????|????????) echo "(The test program ran ok.)" ;;
16144 *) echo "(The test program didn't run right for some reason.)" ;;
16149 (I can't seem to compile the test program. Guessing big-endian...)
16152 case "$xxx_prompt" in
16154 rp="What is the order of bytes in $uvtype?"
16170 Checking to see whether you can access character data unalignedly...
16172 case "$d_u32align" in
16173 '') $cat >try.c <<EOCP
16175 #define U32 $u32type
16176 #define BYTEORDER 0x$byteorder
16178 #include <signal.h>
16180 $signal_t bletch(s) int s; { exit(4); }
16183 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
16188 if (sizeof(U32) != 4) {
16189 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
16196 signal(SIGBUS, bletch);
16208 for (i = 0; i < 4; i++) {
16209 up = (U32*)(buf + i);
16210 if (! ((*up == 1 << (8*i)) || /* big-endian */
16211 (*up == 1 << (8*(3-i))) /* little-endian */
16215 printf("read failed (%x)\n", *up);
16221 for (i = 0; i < 4; i++) {
16222 up = (U32*)(buf + i);
16224 if (*up != 0xBeef) {
16225 printf("write failed (%x)\n", *up);
16239 if eval $compile_ok; then
16240 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
16241 $run ./try 2>&1 >/dev/null
16244 You can access character data pretty unalignedly.
16246 d_u32align="$undef"
16249 It seems that you must access character data in an aligned manner.
16251 d_u32align="$define"
16255 rp='Can you access character data at unaligned addresses?'
16259 [yY]*) d_u32align="$undef" ;;
16260 *) d_u32align="$define" ;;
16263 $rm -f core core.try.* try.core
16267 : see if ualarm exists
16268 set ualarm d_ualarm
16271 : see if umask exists
16275 : see if unordered exists
16276 set unordered d_unordered
16279 : see if usleep exists
16280 set usleep d_usleep
16283 : see if prototype for usleep is available
16285 set d_usleepproto usleep $i_unistd unistd.h
16288 : see if ustat exists
16292 : backward compatibility for d_hvfork
16293 if test X$d_hvfork != X; then
16294 d_vfork="$d_hvfork"
16297 : see if there is a vfork
16302 : Ok, but do we want to use it. vfork is reportedly unreliable in
16303 : perl on Solaris 2.x, and probably elsewhere.
16307 case "$usevfork" in
16313 Perl can only use a vfork() that doesn't suffer from strict
16314 restrictions on calling functions or modifying global data in
16315 the child. For example, glibc-2.1 contains such a vfork()
16316 that is unsuitable. If your system provides a proper fork()
16317 call, chances are that you do NOT want perl to use vfork().
16320 rp="Do you still want to use vfork()?"
16325 echo "Ok, we won't use vfork()."
16334 $define) usevfork='true';;
16335 *) usevfork='false';;
16338 : see if closedir exists
16339 set closedir d_closedir
16342 case "$d_closedir" in
16345 echo "Checking whether closedir() returns a status..." >&4
16347 #$i_dirent I_DIRENT /**/
16348 #$i_sysdir I_SYS_DIR /**/
16349 #$i_sysndir I_SYS_NDIR /**/
16350 #$i_systypes I_SYS_TYPES /**/
16352 #if defined(I_SYS_TYPES)
16353 #include <sys/types.h>
16355 #if defined(I_DIRENT)
16356 #include <dirent.h>
16357 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
16358 #include <sys/dir.h>
16362 #include <sys/ndir.h>
16366 #include <ndir.h> /* may be wrong in the future */
16368 #include <sys/dir.h>
16373 int main() { return closedir(opendir(".")); }
16376 if eval $compile_ok; then
16377 if $run ./try > /dev/null 2>&1 ; then
16378 echo "Yes, it does."
16381 echo "No, it doesn't."
16385 echo "(I can't seem to compile the test program--assuming it doesn't)"
16393 set d_void_closedir
16396 : see if there is a wait4
16400 : see if waitpid exists
16401 set waitpid d_waitpid
16404 : see if wcstombs exists
16405 set wcstombs d_wcstombs
16408 : see if wctomb exists
16409 set wctomb d_wctomb
16412 : see if writev exists
16413 set writev d_writev
16416 : preserve RCS keywords in files with variable substitution, grrr
16421 Revision='$Revision'
16423 : check for alignment requirements
16425 case "$usecrosscompile$multiarch" in
16428 You seem to be either cross-compiling or doing a multiarchitecture build,
16429 skipping the memory alignment check.
16432 case "$alignbytes" in
16433 '') alignbytes=8 ;;
16437 case "$alignbytes" in
16438 '') echo "Checking alignment constraints..." >&4
16439 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
16440 $cat >try.c <<'EOCP'
16441 typedef long double NV;
16444 $cat >try.c <<'EOCP'
16448 $cat >>try.c <<'EOCP'
16456 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
16461 if eval $compile_ok; then
16465 echo "(I can't seem to compile the test program...)"
16468 *) dflt="$alignbytes"
16471 rp="Doubles must be aligned on a how-many-byte boundary?"
16479 : set the base revision
16482 : how do we catenate cpp tokens here?
16484 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
16485 $cat >cpp_stuff.c <<'EOCP'
16486 #define RCAT(a,b)a/**/b
16487 #define ACAT(a,b)a ## b
16491 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
16492 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
16493 echo "Oh! Smells like ANSI's been here." >&4
16494 echo "We can catify or stringify, separately or together!"
16496 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
16497 echo "Ah, yes! The good old days!" >&4
16498 echo "However, in the good old days we don't know how to stringify and"
16499 echo "catify at the same time."
16503 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
16504 to have to edit the values of CAT[2-5] in config.h...
16506 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
16510 : see if this is a db.h system
16516 : Check db version.
16518 echo "Checking Berkeley DB version ..." >&4
16524 #include <sys/types.h>
16527 int main(int argc, char *argv[])
16529 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
16530 int Major, Minor, Patch ;
16531 unsigned long Version ;
16532 (void)db_version(&Major, &Minor, &Patch) ;
16534 printf("%d %d %d %d %d %d\n",
16535 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
16536 Major, Minor, Patch);
16539 printf("You have Berkeley DB Version 2 or greater.\n");
16541 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
16542 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
16543 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
16544 Major, Minor, Patch) ;
16546 /* check that db.h & libdb are compatible */
16547 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
16548 printf("db.h and libdb are incompatible.\n") ;
16552 printf("db.h and libdb are compatible.\n") ;
16554 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
16555 + DB_VERSION_PATCH ;
16557 /* needs to be >= 2.3.4 */
16558 if (Version < 2003004) {
16559 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
16560 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
16566 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
16571 printf("You have Berkeley DB Version 1.\n");
16572 exit(0); /* DB version < 2: the coast is clear. */
16574 exit(1); /* <db.h> not Berkeley DB? */
16580 if eval $compile_ok && $run ./try; then
16581 echo 'Looks OK.' >&4
16583 db_version_major=$1
16584 db_version_minor=$2
16585 db_version_patch=$3
16587 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
16591 : Remove db from list of libraries to use
16592 echo "Removing unusable -ldb from library list" >&4
16593 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
16596 echo "libs = $libs" >&4
16606 : Check the return type needed for hash
16608 echo "Checking return type needed for hash for Berkeley DB ..." >&4
16614 #include <sys/types.h>
16617 #ifndef DB_VERSION_MAJOR
16618 u_int32_t hash_cb (ptr, size)
16626 info.hash = hash_cb;
16630 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16631 if $contains warning try.out >>/dev/null 2>&1 ; then
16634 db_hashtype='u_int32_t'
16637 : XXX Maybe we should just give up here.
16638 db_hashtype=u_int32_t
16640 echo "Help: I can't seem to compile the db test program." >&4
16641 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
16644 echo "Your version of Berkeley DB uses $db_hashtype for hash."
16646 *) db_hashtype=u_int32_t
16651 : Check the return type needed for prefix
16653 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
16659 #include <sys/types.h>
16662 #ifndef DB_VERSION_MAJOR
16663 size_t prefix_cb (key1, key2)
16671 info.prefix = prefix_cb;
16675 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16676 if $contains warning try.out >>/dev/null 2>&1 ; then
16677 db_prefixtype='int'
16679 db_prefixtype='size_t'
16682 db_prefixtype='size_t'
16683 : XXX Maybe we should just give up here.
16685 echo "Help: I can't seem to compile the db test program." >&4
16686 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
16689 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
16691 *) db_prefixtype='size_t'
16696 : How can we generate normalized random numbers ?
16698 echo "Looking for a random number function..." >&4
16699 case "$randfunc" in
16701 if set drand48 val -f; eval $csym; $val; then
16703 echo "Good, found drand48()." >&4
16704 elif set random val -f; eval $csym; $val; then
16706 echo "OK, found random()." >&4
16709 echo "Yick, looks like I have to use rand()." >&4
16720 *-Dmy_rand=*|*-Dmy_srand=*)
16721 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
16722 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
16723 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
16724 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
16728 while $test "$cont"; do
16729 rp="Use which function to generate random numbers?"
16731 if $test "$ans" = "$dflt"; then
16737 if set $ans val -f; eval $csym; $val; then
16741 rp="I cannot find function $ans. Use that name anyway?"
16750 case "$randfunc" in
16752 drand01="drand48()"
16758 case "$randbits" in
16760 echo "Checking to see how many bits your $randfunc() function produces..." >&4
16762 #$i_unistd I_UNISTD
16763 #$i_stdlib I_STDLIB
16766 # include <unistd.h>
16769 # include <stdlib.h>
16774 register unsigned long tmp;
16775 register unsigned long max = 0L;
16777 for (i = 1000; i; i--) {
16778 tmp = (unsigned long) $randfunc();
16779 if (tmp > max) max = tmp;
16781 for (i = 0; max; i++)
16787 if eval $compile_ok; then
16791 echo "(I can't seem to compile the test program...)"
16798 rp="How many bits does your $randfunc() function produce?"
16802 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
16803 seedfunc="s$randfunc"
16804 randseedtype=unsigned
16808 rp="How many bits does your $randfunc() function produce?"
16811 seedfunc="s$randfunc"
16812 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
16813 if set $seedfunc val -f; eval $csym; $val; then
16814 echo "(Using $seedfunc() to seed random generator)"
16816 echo "(Warning: no $seedfunc() to seed random generator)"
16819 randseedtype=unsigned
16827 echo "Determining whether or not we are on an EBCDIC system..." >&4
16828 $cat >try.c <<'EOM'
16831 if ('M'==0xd4) return 0;
16838 if eval $compile_ok; then
16839 if $run ./try; then
16840 echo "You seem to speak EBCDIC." >&4
16843 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
16846 echo "I'm unable to compile the test program." >&4
16847 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
16855 Checking how to flush all pending stdio output...
16857 # I only know how to find the first 32 possibly open files on SunOS.
16858 # See also hints/sunos_4_1.sh and util.c --AD
16860 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
16862 $cat >>try.c <<EOCP
16864 #$i_unistd I_UNISTD
16866 # include <unistd.h>
16868 #$d_sysconf HAS_SYSCONF
16869 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
16870 #ifdef HAS_STDIO_STREAM_ARRAY
16871 # define STDIO_STREAM_ARRAY $stdio_stream_array
16876 p = fopen("try.out", "w");
16880 # ifdef TRY_FPRINTF
16884 #ifdef TRY_FFLUSH_NULL
16887 #ifdef TRY_FFLUSH_ALL
16889 long open_max = -1;
16890 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
16891 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
16893 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
16894 open_max = sysconf(_SC_OPEN_MAX);
16897 open_max = FOPEN_MAX;
16900 open_max = OPEN_MAX;
16909 # ifdef HAS_STDIO_STREAM_ARRAY
16910 if (open_max > 0) {
16912 for (i = 0; i < open_max; i++)
16913 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
16914 STDIO_STREAM_ARRAY[i]._file < open_max &&
16915 STDIO_STREAM_ARRAY[i]._flag)
16916 fflush(&STDIO_STREAM_ARRAY[i]);
16924 : first we have to find out how _not_ to flush
16926 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
16928 set try -DTRY_FPUTC
16929 if eval $compile; then
16930 $run ./try 2>/dev/null
16933 if $test ! -s try.out -a "X$code" = X42; then
16939 set try -DTRY_FPRINTF
16940 if eval $compile; then
16941 $run ./try 2>/dev/null
16944 if $test ! -s try.out -a "X$code" = X42; then
16945 output=-DTRY_FPRINTF
16951 : check for fflush NULL behaviour
16952 case "$fflushNULL" in
16953 '') set try -DTRY_FFLUSH_NULL $output
16954 if eval $compile; then
16955 $run ./try 2>/dev/null
16958 if $test -s try.out -a "X$code" = X42; then
16959 fflushNULL="`$cat try.out`"
16961 if $test "X$code" != X42; then
16963 (If this test failed, don't worry, we'll try another method shortly.)
16968 $rm -f core try.core core.try.*
16969 case "$fflushNULL" in
16971 Your fflush(NULL) works okay for output streams.
16972 Let's see if it clobbers input pipes...
16974 # As of mid-March 2000 all versions of Solaris appear to have a stdio
16975 # bug that improperly flushes the input end of pipes. So we avoid the
16976 # autoflush on fork/system/exec support for now. :-(
16977 $cat >tryp.c <<EOCP
16980 main(int argc, char **argv)
16986 while ((i = getc(stdin)) != -1
16987 && (*bp++ = i) != '\n'
16988 && bp < &buf[1024])
16991 fprintf(stdout, "%s", buf);
16999 fflushNULL="$define"
17001 if eval $compile; then
17003 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17004 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17006 fflush(NULL) seems to behave okay with input streams.
17008 fflushNULL="$define"
17011 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
17013 fflushNULL="$undef"
17016 $rm -f core tryp.c tryp.core core.tryp.*
17019 Your fflush(NULL) isn't working (contrary to ANSI C).
17021 fflushNULL="$undef"
17024 Cannot figure out whether your fflush(NULL) works or not.
17025 I'm assuming it doesn't (contrary to ANSI C).
17027 fflushNULL="$undef"
17031 $define|true|[yY]*)
17032 fflushNULL="$define"
17035 fflushNULL="$undef"
17038 : check explicit looping only if NULL did not work, and if the pipe
17039 : bug does not show up on an explicit flush too
17040 case "$fflushNULL" in
17042 $cat >tryp.c <<EOCP
17045 main(int argc, char **argv)
17051 while ((i = getc(stdin)) != -1
17052 && (*bp++ = i) != '\n'
17053 && bp < &buf[1024])
17056 fprintf(stdout, "%s", buf);
17065 if eval $compile; then
17067 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17068 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17070 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
17072 : now check for fflushall behaviour
17073 case "$fflushall" in
17074 '') set try -DTRY_FFLUSH_ALL $output
17075 if eval $compile; then
17077 (Now testing the other method--but note that this also may fail.)
17079 $run ./try 2>/dev/null
17082 if $test -s try.out -a "X$code" = X42; then
17083 fflushall="`$cat try.out`"
17086 $rm -f core try.core core.try.*
17087 case "$fflushall" in
17089 Whew. Flushing explicitly all the stdio streams works.
17091 fflushall="$define"
17094 Sigh. Flushing explicitly all the stdio streams doesn't work.
17099 Cannot figure out whether flushing stdio streams explicitly works or not.
17100 I'm assuming it doesn't.
17106 "$define"|true|[yY]*)
17107 fflushall="$define"
17115 All is futile. Even fflush(stdin) clobbers input pipes!
17122 $rm -f core tryp.c tryp.core core.tryp.*
17124 *) fflushall="$undef"
17128 case "$fflushNULL$fflushall" in
17131 OK, I give up. I cannot figure out how to flush pending stdio output.
17132 We won't be flushing handles at all before fork/exec/popen.
17136 $rm -f try.* try$exe_ext
17138 : Store the full pathname to the ar program for use in the C program
17139 : Respect a hint or command line value for full_ar.
17144 : Store the full pathname to the sed program for use in the C program
17147 : see what type gids are declared as in the kernel
17149 echo "Looking for the type for group ids returned by getgid()."
17150 set gid_t gidtype xxx stdio.h sys/types.h
17154 xxx=`./findhdr sys/user.h`
17155 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
17157 unsigned) dflt="$1 $2" ;;
17161 *) dflt="$gidtype";;
17164 gid_t) echo "gid_t found." ;;
17165 *) rp="What is the type for group ids returned by getgid()?"
17173 *_t) zzz="$gidtype" ;;
17176 echo "Checking the size of $zzz..." >&4
17178 #include <sys/types.h>
17181 printf("%d\n", (int)sizeof($gidtype));
17186 if eval $compile_ok; then
17190 echo "(I can't execute the test program--guessing $gidsize.)" >&4
17193 echo "Your $zzz is $gidsize bytes long."
17198 echo "(I can't compile the test program--guessing $gidsize.)" >&4
17204 *_t) zzz="$gidtype" ;;
17207 echo "Checking the sign of $zzz..." >&4
17209 #include <sys/types.h>
17220 if eval $compile; then
17224 echo "(I can't execute the test program--guessing unsigned.)" >&4
17228 1) echo "Your $zzz is unsigned." ;;
17229 -1) echo "Your $zzz is signed." ;;
17235 echo "(I can't compile the test program--guessing unsigned.)" >&4
17241 if $test X"$quadtype" != X; then
17243 echo "Checking how to print 64-bit integers..." >&4
17245 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
17246 $cat >try.c <<'EOCP'
17247 #include <sys/types.h>
17250 int q = 12345678901;
17251 printf("%ld\n", q);
17255 if eval $compile; then
17259 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
17260 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
17261 echo "We will use %d."
17267 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
17268 $cat >try.c <<'EOCP'
17269 #include <sys/types.h>
17272 long q = 12345678901;
17273 printf("%ld\n", q);
17277 if eval $compile; then
17281 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
17282 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
17283 echo "We will use %ld."
17289 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
17290 $cat >try.c <<'EOCP'
17291 #include <sys/types.h>
17292 #include <inttypes.h>
17295 int64_t q = 12345678901;
17296 printf("%" PRId64 "\n", q);
17300 if eval $compile; then
17304 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
17305 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
17306 echo "We will use the C9X style."
17312 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17314 #include <sys/types.h>
17317 $quadtype q = 12345678901;
17318 printf("%Ld\n", q);
17322 if eval $compile; then
17326 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
17327 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
17328 echo "We will use %Ld."
17334 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
17335 $cat >try.c <<'EOCP'
17336 #include <sys/types.h>
17339 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
17340 printf("%lld\n", q);
17344 if eval $compile; then
17348 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
17349 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
17350 echo "We will use the %lld style."
17356 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17358 #include <sys/types.h>
17361 $quadtype q = 12345678901;
17362 printf("%qd\n", q);
17366 if eval $compile; then
17370 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
17371 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
17372 echo "We will use %qd."
17378 if $test X"$sPRId64" = X; then
17379 echo "Cannot figure out how to print 64-bit integers." >&4
17387 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
17388 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
17390 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
17391 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
17397 $echo "Checking the format strings to be used for Perl's internal types..." >&4
17399 if $test X"$ivsize" = X8; then
17400 ivdformat="$sPRId64"
17401 uvuformat="$sPRIu64"
17402 uvoformat="$sPRIo64"
17403 uvxformat="$sPRIx64"
17404 uvXUformat="$sPRIXU64"
17406 if $test X"$ivsize" = X"$longsize"; then
17413 if $test X"$ivsize" = X"$intsize"; then
17421 if $test X"$ivsize" = X"$shortsize"; then
17432 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
17433 nveformat="$sPRIeldbl"
17434 nvfformat="$sPRIfldbl"
17435 nvgformat="$sPRIgldbl"
17436 nvEUformat="$sPRIEUldbl"
17437 nvFUformat="$sPRIFUldbl"
17438 nvGUformat="$sPRIGUldbl"
17448 case "$ivdformat" in
17449 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
17456 $echo "Checking the format string to be used for gids..." >&4
17459 -1) if $test X"$gidsize" = X"$ivsize"; then
17460 gidformat="$ivdformat"
17462 if $test X"$gidsize" = X"$longsize"; then
17465 if $test X"$gidsize" = X"$intsize"; then
17468 if $test X"$gidsize" = X"$shortsize"; then
17475 *) if $test X"$gidsize" = X"$uvsize"; then
17476 gidformat="$uvuformat"
17478 if $test X"$gidsize" = X"$longsize"; then
17481 if $test X"$gidsize" = X"$intsize"; then
17484 if $test X"$gidsize" = X"$shortsize"; then
17493 : see if getgroups exists
17494 set getgroups d_getgrps
17497 : see if setgroups exists
17498 set setgroups d_setgrps
17502 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
17504 case "$d_getgrps$d_setgrps" in
17506 case "$groupstype" in
17507 '') dflt="$gidtype" ;;
17508 *) dflt="$groupstype" ;;
17511 What type of pointer is the second argument to getgroups() and setgroups()?
17512 Usually this is the same as group ids, $gidtype, but not always.
17515 rp='What type pointer is the second argument to getgroups() and setgroups()?'
17519 *) groupstype="$gidtype";;
17523 echo "Checking if your $make program sets \$(MAKE)..." >&4
17524 case "$make_set_make" in
17526 $sed 's/^X //' > testmake.mak << 'EOF'
17528 X @echo 'maketemp="$(MAKE)"'
17530 case "`$make -f testmake.mak 2>/dev/null`" in
17531 *maketemp=*) make_set_make='#' ;;
17532 *) make_set_make="MAKE=$make" ;;
17534 $rm -f testmake.mak
17537 case "$make_set_make" in
17538 '#') echo "Yup, it does.";;
17539 *) echo "Nope, it doesn't.";;
17542 : see what type is used for mode_t
17543 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
17544 set mode_t modetype int stdio.h sys/types.h
17547 : see if stdarg is available
17549 if $test `./findhdr stdarg.h`; then
17550 echo "<stdarg.h> found." >&4
17553 echo "<stdarg.h> NOT found." >&4
17557 : see if varags is available
17559 if $test `./findhdr varargs.h`; then
17560 echo "<varargs.h> found." >&4
17562 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
17565 : set up the varargs testing programs
17566 $cat > varargs.c <<EOP
17568 #include <stdarg.h>
17571 #include <varargs.h>
17575 int f(char *p, ...)
17589 p = va_arg(ap, char *);
17594 $cat > varargs <<EOP
17596 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
17605 : now check which varargs header should be included
17610 if `./varargs I_STDARG`; then
17612 elif `./varargs I_VARARGS`; then
17617 if `./varargs I_VARARGS`; then
17624 echo "I could not find the definition for va_dcl... You have problems..." >&4
17625 val="$undef"; set i_stdarg; eval $setvar
17626 val="$undef"; set i_varargs; eval $setvar
17631 case "$i_varhdr" in
17633 val="$define"; set i_stdarg; eval $setvar
17634 val="$undef"; set i_varargs; eval $setvar
17637 val="$undef"; set i_stdarg; eval $setvar
17638 val="$define"; set i_varargs; eval $setvar
17641 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
17645 : see if we need va_copy
17647 case "$i_stdarg" in
17650 #include <stdarg.h>
17652 #$i_stdlib I_STDLIB
17654 #include <stdlib.h>
17656 #include <signal.h>
17659 ivfprintf(FILE *f, const char *fmt, va_list *valp)
17661 return vfprintf(f, fmt, *valp);
17665 myvfprintf(FILE *f, const char *fmt, va_list val)
17667 return ivfprintf(f, fmt, &val);
17671 myprintf(char *fmt, ...)
17674 va_start(val, fmt);
17675 return myvfprintf(stdout, fmt, val);
17679 main(int ac, char **av)
17681 signal(SIGSEGV, exit);
17683 myprintf("%s%cs all right, then\n", "that", '\'');
17688 if eval $compile && $run ./try 2>&1 >/dev/null; then
17689 case "`$run ./try`" in
17690 "that's all right, then")
17696 yes) echo "It seems that you don't need va_copy()." >&4
17697 need_va_copy="$undef"
17699 *) echo "It seems that va_copy() or similar will be needed." >&4
17700 need_va_copy="$define"
17703 $rm -f try.* core core.* *.core *.core.*
17705 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
17709 : see what type is used for size_t
17710 rp="What is the type used for the length parameter for string functions?"
17711 set size_t sizetype 'unsigned int' stdio.h sys/types.h
17714 : check for type of arguments to gethostbyaddr.
17715 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
17716 case "$d_gethbyaddr" in
17720 Checking to see what type of arguments are accepted by gethostbyaddr().
17722 hdrs="$define sys/types.h
17723 $d_socket sys/socket.h
17724 $i_niin netinet/in.h
17726 $i_unistd unistd.h"
17727 : The first arg can 'char *' or 'void *'
17728 : The second arg is some of integral type
17729 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
17730 for yyy in size_t long int; do
17731 case "$netdb_host_type" in
17732 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
17733 if ./protochk "$try" $hdrs; then
17734 echo "Your system accepts $xxx for the first arg."
17735 echo "...and $yyy for the second arg."
17736 netdb_host_type="$xxx"
17737 netdb_hlen_type="$yyy"
17743 : In case none of those worked, prompt the user.
17744 case "$netdb_host_type" in
17745 '') rp='What is the type for the 1st argument to gethostbyaddr?'
17748 netdb_host_type=$ans
17749 rp='What is the type for the 2nd argument to gethostbyaddr?'
17752 netdb_hlen_type=$ans
17756 *) : no gethostbyaddr, so pick harmless defaults
17757 netdb_host_type='char *'
17758 netdb_hlen_type="$sizetype"
17761 # Remove the "const" if needed. -- but then we'll have a
17763 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
17766 : check for type of argument to gethostbyname.
17767 if test "X$netdb_name_type" = X ; then
17768 case "$d_gethbyname" in
17772 Checking to see what type of argument is accepted by gethostbyname().
17774 hdrs="$define sys/types.h
17775 $d_socket sys/socket.h
17776 $i_niin netinet/in.h
17778 $i_unistd unistd.h"
17779 for xxx in "const char *" "char *"; do
17780 case "$netdb_name_type" in
17781 '') try="extern struct hostent *gethostbyname($xxx);"
17782 if ./protochk "$try" $hdrs; then
17783 echo "Your system accepts $xxx."
17784 netdb_name_type="$xxx"
17789 : In case none of those worked, prompt the user.
17790 case "$netdb_name_type" in
17791 '') rp='What is the type for the 1st argument to gethostbyname?'
17794 netdb_name_type=$ans
17798 *) : no gethostbyname, so pick harmless default
17799 netdb_name_type='char *'
17804 : check for type of 1st argument to getnetbyaddr.
17805 if test "X$netdb_net_type" = X ; then
17806 case "$d_getnbyaddr" in
17810 Checking to see what type of 1st argument is accepted by getnetbyaddr().
17812 hdrs="$define sys/types.h
17813 $d_socket sys/socket.h
17814 $i_niin netinet/in.h
17816 $i_unistd unistd.h"
17817 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
17818 case "$netdb_net_type" in
17819 '') try="extern struct netent *getnetbyaddr($xxx, int);"
17820 if ./protochk "$try" $hdrs; then
17821 echo "Your system accepts $xxx."
17822 netdb_net_type="$xxx"
17827 : In case none of those worked, prompt the user.
17828 case "$netdb_net_type" in
17829 '') rp='What is the type for the 1st argument to getnetbyaddr?'
17832 netdb_net_type=$ans
17836 *) : no getnetbyaddr, so pick harmless default
17837 netdb_net_type='long'
17841 : locate the preferred pager for this system
17847 [a-zA-Z]:/*) dflt=$pg;;
17851 [a-zA-Z]:/*) dflt=$more;;
17855 [a-zA-Z]:/*) dflt=$less;;
17858 '') dflt=/usr/ucb/more;;
17865 rp='What pager is used on your system?'
17869 : see what type pids are declared as in the kernel
17870 rp="What is the type of process ids on this system?"
17871 set pid_t pidtype int stdio.h sys/types.h
17874 : Find earliest binary compatible site_perl subdirectory perl can use.
17875 xs_apiversion=$version # The current site_perl version.
17876 : Find earliest pure perl site_perl subdirectory perl can use.
17877 : The versioned directories started at 5.005.
17878 pm_apiversion='5.005'
17880 : see if ar generates random libraries by itself
17882 echo "Checking how to generate random libraries on your machine..." >&4
17883 echo 'int bar1() { return bar2(); }' > bar1.c
17884 echo 'int bar2() { return 2; }' > bar2.c
17885 $cat > foo.c <<'EOP'
17886 int main() { printf("%d\n", bar1()); exit(0); }
17888 $cc $ccflags -c bar1.c >/dev/null 2>&1
17889 $cc $ccflags -c bar2.c >/dev/null 2>&1
17890 $cc $ccflags -c foo.c >/dev/null 2>&1
17891 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
17892 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
17893 $run ./foobar >/dev/null 2>&1; then
17894 echo "$ar appears to generate random libraries itself."
17897 elif $ar ts bar$_a >/dev/null 2>&1 &&
17898 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
17899 $run ./foobar >/dev/null 2>&1; then
17900 echo "a table of contents needs to be added with '$ar ts'."
17907 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
17908 $test -f $ranlib || ranlib=''
17911 if $test -n "$ranlib"; then
17912 echo "your system has '$ranlib'; we'll use that."
17915 echo "your system doesn't seem to support random libraries"
17916 echo "so we'll use lorder and tsort to order the libraries."
17923 : check for type of arguments to select.
17924 case "$selecttype" in
17925 '') case "$d_select" in
17929 Checking to see what type of arguments are accepted by select().
17931 hdrs="$define sys/types.h
17932 $i_systime sys/time.h
17933 $i_sysselct sys/select.h
17934 $d_socket sys/socket.h"
17935 : The first arg can be int, unsigned, or size_t
17936 : The last arg may or may not be 'const'
17938 : void pointer has been seen but using that
17939 : breaks the selectminbits test
17940 for xxx in 'fd_set *' 'int *'; do
17941 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
17942 for tmo in 'struct timeval *' 'const struct timeval *'; do
17944 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
17945 if ./protochk "$try" $hdrs; then
17946 echo "Your system accepts $xxx."
17955 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
17956 case "$d_fd_set" in
17957 $define) dflt="fd_set *" ;;
17966 *) : no select, so pick a harmless default
17973 : check for the select 'width'
17974 case "$selectminbits" in
17975 '') case "$d_select" in
17979 Checking to see on how many bits at a time your select() operates...
17982 #include <sys/types.h>
17984 #$i_systime I_SYS_TIME
17985 #$i_systimek I_SYS_TIME_KERNEL
17990 # ifdef I_SYS_TIME_KERNEL
17993 # include <sys/time.h>
17994 # ifdef I_SYS_TIME_KERNEL
17998 #$i_sysselct I_SYS_SELECT
17999 #ifdef I_SYS_SELECT
18000 #include <sys/select.h>
18002 #$d_socket HAS_SOCKET
18004 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
18008 #define S sizeof(*(b))
18010 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
18011 #define NBITS (NBYTES * 8)
18020 fp = fopen("try.c", "r");
18026 b = ($selecttype)s;
18027 for (i = 0; i < NBITS; i++)
18031 select(fd + 1, b, 0, 0, &t);
18032 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
18033 printf("%d\n", i + 1);
18038 if eval $compile_ok; then
18039 selectminbits=`$run ./try`
18040 case "$selectminbits" in
18042 Cannot figure out on how many bits at a time your select() operates.
18043 I'll play safe and guess it is 32 bits.
18049 *) bits="$selectminbits bits" ;;
18051 echo "Your select() operates on $bits at a time." >&4
18053 rp='What is the minimum number of bits your select() operates on?'
18054 case "$byteorder" in
18055 1234|12345678) dflt=32 ;;
18060 selectminbits="$val"
18064 *) : no select, so pick a harmless default
18071 : Trace out the files included by signal.h, then look for SIGxxx names.
18072 : Remove SIGARRAYSIZE used by HPUX.
18073 : Remove SIGSTKSIZE used by Linux.
18074 : Remove SIGSTKSZ used by Posix.
18075 : Remove SIGTYP void lines used by OS2.
18076 : Some cpps, like os390, dont give the file name anywhere
18077 if [ "X$fieldn" = X ]; then
18078 : Just make some guesses. We check them later.
18079 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
18081 xxx=`echo '#include <signal.h>' |
18082 $cppstdin $cppminus $cppflags 2>/dev/null |
18083 $grep '^[ ]*#.*include' |
18084 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
18086 : Check this list of files to be sure we have parsed the cpp output ok.
18087 : This will also avoid potentially non-existent files, such
18090 for xx in $xxx /dev/null ; do
18091 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
18093 : If we have found no files, at least try signal.h
18094 case "$xxxfiles" in
18095 '') xxxfiles=`./findhdr signal.h` ;;
18098 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
18099 print substr($2, 4, 20)
18101 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
18102 print substr($3, 4, 20)
18104 : Append some common names just in case the awk scan failed.
18105 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
18106 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
18107 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
18108 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
18109 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
18111 : generate a few handy files for later
18112 $cat > signal.c <<'EOCP'
18113 #include <sys/types.h>
18114 #include <signal.h>
18118 /* Strange style to avoid deeply-nested #if/#else/#endif */
18121 # define NSIG (_NSIG)
18127 # define NSIG (SIGMAX+1)
18133 # define NSIG (SIG_MAX+1)
18139 # define NSIG (MAXSIG+1)
18145 # define NSIG (MAX_SIG+1)
18150 # ifdef SIGARRAYSIZE
18151 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
18157 # define NSIG (_sys_nsig) /* Solaris 2.5 */
18161 /* Default to some arbitrary number that's big enough to get most
18162 of the common signals.
18168 printf("NSIG %d\n", NSIG);
18174 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
18176 printf "#ifdef SIG"; printf $1; printf "\n"
18177 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
18178 printf $1; printf ");\n"
18182 printf "#endif /* JUST_NSIG */\n";
18183 printf "exit(0);\n}\n";
18186 $cat >signal.awk <<'EOP'
18187 BEGIN { ndups = 0 }
18188 $1 ~ /^NSIG$/ { nsig = $2 }
18189 ($1 !~ /^NSIG$/) && (NF == 2) {
18190 if ($2 > maxsig) { maxsig = $2 }
18191 if (sig_name[$2]) {
18192 dup_name[ndups] = $1
18193 dup_num[ndups] = $2
18205 printf("NSIG %d\n", nsig);
18206 for (n = 1; n < nsig; n++) {
18208 printf("%s %d\n", sig_name[n], sig_num[n])
18211 printf("NUM%d %d\n", n, n)
18214 for (n = 0; n < ndups; n++) {
18215 printf("%s %d\n", dup_name[n], dup_num[n])
18219 $cat >signal_cmd <<EOS
18221 if $test -s signal.lst; then
18222 echo "Using your existing signal.lst file"
18227 $cat >>signal_cmd <<'EOS'
18230 if eval $compile_ok; then
18231 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
18233 echo "(I can't seem be able to compile the whole test program)" >&4
18234 echo "(I'll try it in little pieces.)" >&4
18235 set signal -DJUST_NSIG
18236 if eval $compile_ok; then
18237 $run ./signal$_exe > signal.nsg
18240 echo "I can't seem to figure out how many signals you have." >&4
18241 echo "Guessing 50." >&4
18242 echo 'NSIG 50' > signal.nsg
18244 : Now look at all the signal names, one at a time.
18245 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
18246 $cat > signal.c <<EOCP
18247 #include <sys/types.h>
18248 #include <signal.h>
18251 printf("$xx %d\n", SIG${xx});
18256 if eval $compile; then
18257 echo "SIG${xx} found."
18258 $run ./signal$_exe >> signal.ls1
18260 echo "SIG${xx} NOT found."
18263 if $test -s signal.ls1; then
18264 $cat signal.nsg signal.ls1 |
18265 $sort -n | $uniq | $awk -f signal.awk >signal.lst
18269 if $test -s signal.lst; then
18272 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
18273 echo 'kill -l' >signal
18274 set X `csh -f <signal`
18278 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
18280 echo $@ | $tr ' ' $trnl | \
18281 $awk '{ printf "%s %d\n", $1, ++s; }
18282 END { printf "NSIG %d\n", ++s }' >signal.lst
18284 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
18286 chmod a+x signal_cmd
18287 $eunicefix signal_cmd
18289 : generate list of signal names
18291 case "$sig_name_init" in
18293 *) case "$sig_num_init" in
18294 ''|*,*) doinit=yes ;;
18299 echo "Generating a list of signal names and numbers..." >&4
18301 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
18302 sig_name=`$awk 'BEGIN { printf "ZERO " }
18303 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
18304 sig_num=`$awk 'BEGIN { printf "0 " }
18305 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
18306 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
18307 !/^NSIG/ { printf "\"%s\", ", $1 }
18308 END { printf "0\n" }' signal.lst`
18309 sig_num_init=`$awk 'BEGIN { printf "0, " }
18310 !/^NSIG/ { printf "%d, ", $2}
18311 END { printf "0\n"}' signal.lst`
18314 echo "The following $sig_count signals are available:"
18316 echo $sig_name | $awk \
18317 'BEGIN { linelen = 0 }
18319 for (i = 1; i <= NF; i++) {
18320 name = "SIG" $i " "
18321 linelen = linelen + length(name)
18322 if (linelen > 70) {
18324 linelen = length(name)
18330 sig_size=`echo $sig_name | awk '{print NF}'`
18331 $rm -f signal signal.c signal.awk signal.lst signal_cmd
18334 case "$sizetype" in
18335 *_t) zzz="$sizetype" ;;
18336 *) zzz="filesize" ;;
18338 echo "Checking the size of $zzz..." >&4
18340 #include <sys/types.h>
18343 printf("%d\n", (int)sizeof($sizetype));
18348 if eval $compile_ok; then
18352 echo "(I can't execute the test program--guessing $sizesize.)" >&4
18355 echo "Your $zzz size is $sizesize bytes."
18360 echo "(I can't compile the test program--guessing $sizesize.)" >&4
18364 : check for socklen_t
18366 echo "Checking to see if you have socklen_t..." >&4
18368 #include <sys/types.h>
18369 #$d_socket HAS_SOCKET
18371 #include <sys/socket.h>
18373 int main() { socklen_t x = 16; }
18376 if eval $compile; then
18378 echo "You have socklen_t."
18381 echo "You do not have socklen_t."
18382 case "$sizetype" in
18383 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
18390 : see if this is a socks.h system
18391 set socks.h i_socks
18394 : check for type of the size argument to socket calls
18395 case "$d_socket" in
18399 Checking to see what type is the last argument of accept().
18402 case "$d_socklen_t" in
18403 "$define") yyy="$yyy socklen_t"
18405 yyy="$yyy $sizetype int long unsigned"
18406 for xxx in $yyy; do
18407 case "$socksizetype" in
18408 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
18409 case "$usesocks" in
18411 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
18412 echo "Your system accepts '$xxx *' for the last argument of accept()."
18413 socksizetype="$xxx"
18416 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
18417 echo "Your system accepts '$xxx *' for the last argument of accept()."
18418 socksizetype="$xxx"
18425 : In case none of those worked, prompt the user.
18426 case "$socksizetype" in
18427 '') rp='What is the type for socket address structure sizes?'
18434 *) : no sockets, so pick relatively harmless default
18439 : see what type is used for signed size_t
18440 set ssize_t ssizetype int stdio.h sys/types.h
18445 #include <sys/types.h>
18446 #define Size_t $sizetype
18447 #define SSize_t $dflt
18450 if (sizeof(Size_t) == sizeof(SSize_t))
18452 else if (sizeof(Size_t) == sizeof(int))
18461 if eval $compile_ok && $run ./try > /dev/null; then
18462 ssizetype=`$run ./try`
18463 echo "I'll be using $ssizetype for functions returning a byte count." >&4
18466 Help! I can't compile and run the ssize_t test program: please enlighten me!
18467 (This is probably a misconfiguration in your system or libraries, and
18468 you really ought to fix it. Still, I'll try anyway.)
18470 I need a type that is the same size as $sizetype, but is guaranteed to
18471 be signed. Common values are ssize_t, int and long.
18474 rp="What signed type is the same size as $sizetype?"
18480 : see what type of char stdio uses.
18482 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
18483 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
18484 echo "Your stdio uses unsigned chars." >&4
18485 stdchar="unsigned char"
18487 echo "Your stdio uses signed chars." >&4
18494 : see what type uids are declared as in the kernel
18496 echo "Looking for the type for user ids returned by getuid()."
18497 set uid_t uidtype xxx stdio.h sys/types.h
18501 xxx=`./findhdr sys/user.h`
18502 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18504 unsigned) dflt="$1 $2" ;;
18508 *) dflt="$uidtype";;
18511 uid_t) echo "uid_t found." ;;
18512 *) rp="What is the type for user ids returned by getuid()?"
18520 *_t) zzz="$uidtype" ;;
18523 echo "Checking the size of $zzz..." >&4
18525 #include <sys/types.h>
18528 printf("%d\n", (int)sizeof($uidtype));
18533 if eval $compile_ok; then
18537 echo "(I can't execute the test program--guessing $uidsize.)" >&4
18540 echo "Your $zzz is $uidsize bytes long."
18545 echo "(I can't compile the test program--guessing $uidsize.)" >&4
18550 *_t) zzz="$uidtype" ;;
18553 echo "Checking the sign of $zzz..." >&4
18555 #include <sys/types.h>
18566 if eval $compile; then
18570 echo "(I can't execute the test program--guessing unsigned.)" >&4
18574 1) echo "Your $zzz is unsigned." ;;
18575 -1) echo "Your $zzz is signed." ;;
18581 echo "(I can't compile the test program--guessing unsigned.)" >&4
18587 $echo "Checking the format string to be used for uids..." >&4
18590 -1) if $test X"$uidsize" = X"$ivsize"; then
18591 uidformat="$ivdformat"
18593 if $test X"$uidsize" = X"$longsize"; then
18596 if $test X"$uidsize" = X"$intsize"; then
18599 if $test X"$uidsize" = X"$shortsize"; then
18606 *) if $test X"$uidsize" = X"$uvsize"; then
18607 uidformat="$uvuformat"
18609 if $test X"$uidsize" = X"$longsize"; then
18612 if $test X"$uidsize" = X"$intsize"; then
18615 if $test X"$uidsize" = X"$shortsize"; then
18624 : determine compiler compiler
18633 if $test -f "$byacc$_exe"; then
18635 comp="byacc or $comp"
18637 if $test -f "$bison$_exe"; then
18638 comp="$comp or bison -y"
18640 rp="Which compiler compiler ($comp) shall I use?"
18649 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
18655 : see if this is a fp.h system
18659 : see if this is a fp_class.h system
18660 set fp_class.h i_fp_class
18663 : see if this is a ieeefp.h system
18664 case "$i_ieeefp" in
18665 '' ) set ieeefp.h i_ieeefp
18670 : see if this is a libutil.h system
18671 set libutil.h i_libutil
18674 : see if mach cthreads are available
18675 if test "X$usethreads" = "X$define"; then
18676 set mach/cthreads.h i_machcthr
18679 i_machcthr="$undef"
18684 : see if this is a math.h system
18688 : see if this is a mntent.h system
18689 set mntent.h i_mntent
18692 : see if ndbm.h is available
18698 # Some Linux distributions such as RedHat 7.1 put the
18699 # ndbm.h header in /usr/include/gdbm/ndbm.h.
18700 if $test -f /usr/include/gdbm/ndbm.h; then
18701 echo '<gdbm/ndbm.h> found.'
18702 ccflags="$ccflags -I/usr/include/gdbm"
18703 cppflags="$cppflags -I/usr/include/gdbm"
18711 : see if dbm_open exists
18712 set dbm_open d_dbm_open
18714 case "$d_dbm_open" in
18717 echo "We won't be including <ndbm.h>"
18726 : see if net/errno.h is available
18728 set net/errno.h val
18731 : Unfortunately, it causes problems on some systems. Arrgh.
18734 cat > try.c <<'EOM'
18737 #include <net/errno.h>
18743 if $cc $ccflags -c try.c >/dev/null 2>&1; then
18744 echo "We'll be including <net/errno.h>." >&4
18746 echo "We won't be including <net/errno.h>." >&4
18755 : see if netinet/tcp.h is available
18756 set netinet/tcp.h i_netinettcp
18759 : see if this is a poll.h system
18763 : see if this is a prot.h system
18768 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
18769 $cat <<'EOSH' > Cppsym.know
18770 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
18771 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
18772 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
18773 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
18774 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
18775 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
18776 bull c cadmus clipper CMU COFF COMPILER_VERSION
18777 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
18778 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
18779 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
18780 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
18782 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
18783 H3050R H3050RX hbullx20 hcx host_mips
18784 hp200 hp300 hp700 HP700 hp800 hp9000
18785 hp9000s200 hp9000s300 hp9000s400 hp9000s500
18786 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
18787 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
18788 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
18789 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
18790 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
18791 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
18792 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
18793 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
18794 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
18795 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
18796 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
18797 MATH_HAS_NO_SIDE_EFFECTS
18798 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
18799 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
18800 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
18801 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
18802 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
18803 NetBSD news1500 news1700 news1800 news1900 news3700
18804 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
18805 ns32016 ns32332 ns32k nsc32000
18806 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
18807 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
18808 pc532 pdp11 PGC PIC plexus PORTAR posix
18809 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
18810 POSIX_C_SOURCE POSIX_SOURCE POWER
18811 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
18812 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
18813 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
18814 sony sony_news sonyrisc sparc sparclite spectrum
18815 stardent stdc STDC_EXT stratos sun sun3 sun386
18816 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
18817 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
18818 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
18819 sysV68 sysV88 Tek4132 Tek4300 titan
18820 TM3200 TM5400 TM5600
18821 tower tower32 tower32_200 tower32_600 tower32_700
18822 tower32_800 tower32_850 tss
18823 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
18824 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
18825 unix UNIX95 UNIX99 unixpc unos
18826 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
18827 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
18828 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
18830 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
18831 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
18832 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
18835 # Maybe put other stuff here too.
18836 cat <<EOSH >>Cppsym.know
18839 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
18840 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
18841 $cat Cppsym.know > Cppsym.c
18842 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
18843 $rm -f Cppsym.a Cppsym.b Cppsym.c
18844 cat <<EOSH > Cppsym
18846 if $test \$# -gt 0; then
18847 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
18848 if $test -s Cppsym.got; then
18855 $tr " " "$trnl" | ./Cppsym.try
18861 cat <<EOSH > Cppsym.try
18863 cat <<'EOCP' > try.c
18869 cat <<'EOSH' >> Cppsym.try
18871 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
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
18876 echo 'return 0;}' >> try.c
18878 cat <<EOSH >> Cppsym.try
18880 case "$osname-$gccversion" in
18881 irix-) ccflags="\$ccflags -woff 1178" ;;
18882 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
18884 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
18886 chmod +x Cppsym.try
18887 $eunicefix Cppsym.try
18888 ./Cppsym < Cppsym.know > Cppsym.true
18889 : now check the C compiler for additional symbols
18890 postprocess_cc_v=''
18892 aix) postprocess_cc_v="|$tr , ' '" ;;
18899 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
18902 -D*) echo "\$i" | $sed 's/^-D//';;
18903 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
18908 postprocess_cc_v=''
18911 ./ccsym > ccsym1.raw
18912 if $test -s ccsym1.raw; then
18913 $sort ccsym1.raw | $uniq >ccsym.raw
18915 mv ccsym1.raw ccsym.raw
18918 $awk '/\=/ { print $0; next }
18919 { print $0"=1" }' ccsym.raw >ccsym.list
18920 $awk '/\=/ { print $0; next }
18921 { print $0"=1" }' Cppsym.true >ccsym.true
18922 $comm -13 ccsym.true ccsym.list >ccsym.own
18923 $comm -12 ccsym.true ccsym.list >ccsym.com
18924 $comm -23 ccsym.true ccsym.list >ccsym.cpp
18926 if $test -z ccsym.raw; then
18927 echo "Your C compiler doesn't seem to define any symbols!" >&4
18929 echo "However, your C preprocessor defines the following symbols:"
18932 cppsymbols=`$cat Cppsym.true`
18933 cppsymbols=`echo $cppsymbols`
18934 cppccsymbols="$cppsymbols"
18936 if $test -s ccsym.com; then
18937 echo "Your C compiler and pre-processor define these symbols:"
18938 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
18941 cppccsymbols=`$cat ccsym.com`
18942 cppccsymbols=`echo $cppccsymbols`
18943 $test "$silent" || sleep 1
18945 if $test -s ccsym.cpp; then
18946 $test "$also" && echo " "
18947 echo "Your C pre-processor ${also}defines the following symbols:"
18948 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
18950 cppsymbols=`$cat ccsym.cpp`
18951 cppsymbols=`echo $cppsymbols`
18952 $test "$silent" || sleep 1
18954 if $test -s ccsym.own; then
18955 $test "$also" && echo " "
18956 echo "Your C compiler ${also}defines the following cpp symbols:"
18957 $sed -e 's/\(..*\)=1/\1/' ccsym.own
18958 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
18959 ccsymbols=`$cat ccsym.own`
18960 ccsymbols=`echo $ccsymbols`
18961 $test "$silent" || sleep 1
18965 : see if this is a termio system
18969 if $test `./findhdr termios.h`; then
18970 set tcsetattr i_termios
18976 "$define") echo "You have POSIX termios.h... good!" >&4;;
18977 *) if ./Cppsym pyr; then
18978 case "`/bin/universe`" in
18979 ucb) if $test `./findhdr sgtty.h`; then
18981 echo "<sgtty.h> found." >&4
18983 echo "System is pyramid with BSD universe."
18984 echo "<sgtty.h> not found--you could have problems." >&4
18986 *) if $test `./findhdr termio.h`; then
18988 echo "<termio.h> found." >&4
18990 echo "System is pyramid with USG universe."
18991 echo "<termio.h> not found--you could have problems." >&4
18995 if $test `./findhdr termio.h`; then
18996 echo "<termio.h> found." >&4
18998 elif $test `./findhdr sgtty.h`; then
18999 echo "<sgtty.h> found." >&4
19002 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
19005 if $test `./findhdr sgtty.h`; then
19006 echo "<sgtty.h> found." >&4
19008 elif $test `./findhdr termio.h`; then
19009 echo "<termio.h> found." >&4
19012 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
19016 set i_termio; eval $setvar
19017 val=$val2; set i_sgtty; eval $setvar
19018 val=$val3; set i_termios; eval $setvar
19020 : see if stddef is available
19021 set stddef.h i_stddef
19024 : see if this is a sunmath.h system
19025 set sunmath.h i_sunmath
19028 : see if sys/access.h is available
19029 set sys/access.h i_sysaccess
19032 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
19033 set sys/filio.h i_sysfilio
19036 if $test `./findhdr sys/ioctl.h`; then
19038 echo '<sys/ioctl.h> found.' >&4
19041 if $test $i_sysfilio = "$define"; then
19042 echo '<sys/ioctl.h> NOT found.' >&4
19044 $test $i_sgtty = "$define" && xxx="sgtty.h"
19045 $test $i_termio = "$define" && xxx="termio.h"
19046 $test $i_termios = "$define" && xxx="termios.h"
19047 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
19053 : see if socket ioctl defs are in sys/sockio.h
19055 xxx=`./findhdr sys/sockio.h`
19056 if $test "$xxx"; then
19057 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
19059 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
19062 echo "No socket ioctls found in <sys/sockio.h>." >&4
19067 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
19074 : see if this is a syslog.h system
19075 set syslog.h i_syslog
19079 : see if this is a sys/mode.h system
19080 set sys/mode.h i_sysmode
19083 : see if sys/resource.h has to be included
19084 set sys/resource.h i_sysresrc
19087 : see if sys/security.h is available
19088 set sys/security.h i_syssecrt
19091 : see if this is a sys/statvfs.h system
19092 set sys/statvfs.h i_sysstatvfs
19095 : see if this is a sys/un.h system
19096 set sys/un.h i_sysun
19100 : see if this is a sys/utsname.h system
19101 set sys/utsname.h i_sysutsname
19104 : see if this is a syswait system
19105 set sys/wait.h i_syswait
19108 : see if this is a ustat.h system
19109 set ustat.h i_ustat
19112 : see if this is an utime system
19113 set utime.h i_utime
19116 : see if this is a values.h system
19117 set values.h i_values
19120 : see if this is a vfork system
19123 set vfork.h i_vfork
19131 : see if gdbm.h is available
19136 : see if gdbm_open exists
19137 set gdbm_open d_gdbm_open
19139 case "$d_gdbm_open" in
19142 echo "We won't be including <gdbm.h>"
19152 echo "Looking for extensions..." >&4
19153 : If we are using the old config.sh, known_extensions may contain
19154 : old or inaccurate or duplicate values.
19155 known_extensions=''
19156 nonxs_extensions=''
19157 : We do not use find because it might not be available.
19158 : We do not just use MANIFEST because the user may have dropped
19159 : some additional extensions into the source tree and expect them
19162 : Function to recursively find available extensions, ignoring DynaLoader
19163 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
19167 DynaLoader|dynaload) ;;
19169 if $test -f $xxx/$xxx.xs; then
19170 known_extensions="$known_extensions $1$xxx";
19171 elif $test -f $xxx/Makefile.PL; then
19172 nonxs_extensions="$nonxs_extensions $1$xxx";
19174 if $test -d $xxx -a $# -lt 10; then
19177 eval $find_extensions;
19189 eval $find_extensions
19190 # Special case: Add in threads/shared since it is not picked up by the
19191 # recursive find above (and adding in general recursive finding breaks
19192 # SDBM_File/sdbm). A.D. 10/25/2001.
19193 known_extensions="$known_extensions threads/shared"
19194 set X $nonxs_extensions
19196 nonxs_extensions="$*"
19197 set X $known_extensions
19199 known_extensions="$*"
19202 : Now see which are supported on this system.
19204 for xxx in $known_extensions ; do
19208 $define) avail_ext="$avail_ext $xxx" ;;
19211 GDBM_File|gdbm_fil)
19213 $define) avail_ext="$avail_ext $xxx" ;;
19216 I18N/Langinfo|i18n_lan)
19217 case "$i_langinfo$d_nl_langinfo" in
19218 $define$define) avail_ext="$avail_ext $xxx" ;;
19221 NDBM_File|ndbm_fil)
19224 case "$osname-$use64bitint" in
19225 cygwin-*|hpux-define)
19227 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
19230 *) avail_ext="$avail_ext $xxx" ;;
19235 ODBM_File|odbm_fil)
19236 case "${i_dbm}${i_rpcsvcdbm}" in
19238 case "$osname-$use64bitint" in
19239 cygwin-*|hpux-define)
19241 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
19244 *) avail_ext="$avail_ext $xxx" ;;
19250 case "$useposix" in
19251 true|define|y) avail_ext="$avail_ext $xxx" ;;
19255 case "$useopcode" in
19256 true|define|y) avail_ext="$avail_ext $xxx" ;;
19260 case "$d_socket" in
19263 beos) ;; # not unless BONE
19264 *) avail_ext="$avail_ext $xxx" ;;
19269 Sys/Syslog|sys/syslog)
19270 : XXX syslog requires socket
19271 case "$d_socket" in
19272 true|$define|y) avail_ext="$avail_ext $xxx" ;;
19276 case "$usethreads" in
19278 case "$useithreads" in
19279 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
19283 threads|threads/shared)
19284 # threads and threads::shared are special cases.
19285 # To stop people from asking "Perl 5.8.0 was supposed
19286 # to have this new fancy threads implementation but my
19287 # perl doesn't have it" and from people trying to
19288 # (re)install the threads module using CPAN.pm and
19289 # CPAN.pm then offering to reinstall Perl 5.8.0,
19290 # the threads.pm and threads/shared.pm will always be
19291 # there, croaking informatively ("you need to rebuild
19292 # all of Perl with threads, sorry") when threads haven't
19293 # been compiled in.
19295 avail_ext="$avail_ext $xxx"
19298 : XXX Do we need a useipcsysv variable here
19299 case "${d_msg}${d_sem}${d_shm}" in
19300 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
19303 *) avail_ext="$avail_ext $xxx"
19312 : Now see which nonxs extensions are supported on this system.
19313 : For now assume all are.
19315 for xxx in $nonxs_extensions ; do
19317 *) nonxs_ext="$nonxs_ext $xxx"
19329 A number of extensions are supplied with $package. You may choose to
19330 compile these extensions for dynamic loading (the default), compile
19331 them into the $package executable (static loading), or not include
19332 them at all. Answer "none" to include no extensions.
19333 Note that DynaLoader is always built and need not be mentioned here.
19336 case "$dynamic_ext" in
19337 '') dflt="$avail_ext" ;;
19338 *) dflt="$dynamic_ext"
19339 # Perhaps we are reusing an old out-of-date config.sh.
19342 if test X"$dynamic_ext" != X"$avail_ext"; then
19344 NOTICE: Your previous config.sh list may be incorrect.
19345 The extensions now available to you are
19347 but the default list from your previous config.sh is
19359 rp="What extensions do you wish to load dynamically?"
19362 none) dynamic_ext=' ' ;;
19363 *) dynamic_ext="$ans" ;;
19366 case "$static_ext" in
19368 : Exclude those already listed in dynamic linking
19370 for xxx in $avail_ext; do
19371 case " $dynamic_ext " in
19373 *) dflt="$dflt $xxx" ;;
19380 *) dflt="$static_ext"
19387 rp="What extensions do you wish to load statically?"
19390 none) static_ext=' ' ;;
19391 *) static_ext="$ans" ;;
19396 A number of extensions are supplied with $package. Answer "none"
19397 to include no extensions.
19398 Note that DynaLoader is always built and need not be mentioned here.
19401 case "$static_ext" in
19402 '') dflt="$avail_ext" ;;
19403 *) dflt="$static_ext"
19404 # Perhaps we are reusing an old out-of-date config.sh.
19407 if test X"$static_ext" != X"$avail_ext"; then
19409 NOTICE: Your previous config.sh list may be incorrect.
19410 The extensions now available to you are
19412 but the default list from your previous config.sh is
19421 : Exclude those that are not xs extensions
19425 rp="What extensions do you wish to include?"
19428 none) static_ext=' ' ;;
19429 *) static_ext="$ans" ;;
19434 # Encode is a special case. If we are building Encode as a static
19435 # extension, we need to explicitly list its subextensions as well.
19436 # For other nested extensions, this is handled automatically by
19437 # the appropriate Makefile.PL.
19438 case " $static_ext " in
19439 *" Encode "*) # Add the subextensions of Encode
19441 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
19442 static_ext="$static_ext Encode/$xxx"
19448 set X $dynamic_ext $static_ext $nonxs_ext
19452 : Remove libraries needed only for extensions
19453 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
19454 : The exception is SunOS 4.x, which needs them.
19455 case "${osname}X${osvers}" in
19459 *) case "$usedl" in
19460 $define|true|[yY]*)
19461 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
19465 *) perllibs="$libs"
19471 : Remove build directory name from cppstdin so it can be used from
19472 : either the present location or the final installed location.
19474 : Get out of the UU directory to get correct path name.
19476 case "$cppstdin" in
19478 echo "Stripping down cppstdin path name"
19484 : end of configuration questions
19486 echo "End of configuration questions."
19489 : back to where it started
19490 if test -d ../UU; then
19494 : configuration may be patched via a 'config.arch' file
19495 if $test -f config.arch; then
19496 echo "I see a config.arch file, loading it."
19500 : configuration may be patched via a 'config.over' file
19501 if $test -f config.over; then
19504 rp='I see a config.over file. Do you wish to load it?'
19507 n*) echo "OK, I'll ignore it.";;
19509 echo "Configuration override changes have been loaded."
19514 : in case they want portability, strip down executable paths
19515 case "$d_portable" in
19518 echo "Stripping down executable paths..." >&4
19519 for file in $loclist $trylist; do
19521 eval $file=`basename $temp`
19526 : create config.sh file
19528 echo "Creating config.sh..." >&4
19529 $spitshell <<EOT >config.sh
19532 # This file was produced by running the Configure script. It holds all the
19533 # definitions figured out by Configure. Should you modify one of these values,
19534 # do not forget to propagate your changes by running "Configure -der". You may
19535 # instead choose to run each of the .SH files by yourself, or "Configure -S".
19538 # Package name : $package
19539 # Source directory : $src
19540 # Configuration time: $cf_time
19541 # Configured by : $cf_by
19542 # Target system : $myuname
19552 Revision='$Revision'
19560 alignbytes='$alignbytes'
19561 ansi2knr='$ansi2knr'
19562 aphostname='$aphostname'
19563 api_revision='$api_revision'
19564 api_subversion='$api_subversion'
19565 api_version='$api_version'
19566 api_versionstring='$api_versionstring'
19569 archlibexp='$archlibexp'
19570 archname64='$archname64'
19571 archname='$archname'
19572 archobjs='$archobjs'
19573 asctime_r_proto='$asctime_r_proto'
19581 byteorder='$byteorder'
19583 castflags='$castflags'
19586 cccdlflags='$cccdlflags'
19587 ccdlflags='$ccdlflags'
19589 ccflags_uselargefiles='$ccflags_uselargefiles'
19591 ccsymbols='$ccsymbols'
19592 ccversion='$ccversion'
19594 cf_email='$cf_email'
19596 charsize='$charsize'
19600 clocktype='$clocktype'
19602 compress='$compress'
19603 contains='$contains'
19607 cpp_stuff='$cpp_stuff'
19608 cppccsymbols='$cppccsymbols'
19609 cppflags='$cppflags'
19611 cppminus='$cppminus'
19613 cppstdin='$cppstdin'
19614 cppsymbols='$cppsymbols'
19615 crypt_r_proto='$crypt_r_proto'
19616 cryptlib='$cryptlib'
19618 ctermid_r_proto='$ctermid_r_proto'
19619 ctime_r_proto='$ctime_r_proto'
19620 d_Gconvert='$d_Gconvert'
19621 d_PRIEUldbl='$d_PRIEUldbl'
19622 d_PRIFUldbl='$d_PRIFUldbl'
19623 d_PRIGUldbl='$d_PRIGUldbl'
19624 d_PRIXU64='$d_PRIXU64'
19625 d_PRId64='$d_PRId64'
19626 d_PRIeldbl='$d_PRIeldbl'
19627 d_PRIfldbl='$d_PRIfldbl'
19628 d_PRIgldbl='$d_PRIgldbl'
19629 d_PRIi64='$d_PRIi64'
19630 d_PRIo64='$d_PRIo64'
19631 d_PRIu64='$d_PRIu64'
19632 d_PRIx64='$d_PRIx64'
19633 d_SCNfldbl='$d_SCNfldbl'
19634 d__fwalk='$d__fwalk'
19635 d_access='$d_access'
19636 d_accessx='$d_accessx'
19638 d_archlib='$d_archlib'
19639 d_asctime_r='$d_asctime_r'
19642 d_attribut='$d_attribut'
19646 d_bsdgetpgrp='$d_bsdgetpgrp'
19647 d_bsdsetpgrp='$d_bsdsetpgrp'
19649 d_casti32='$d_casti32'
19650 d_castneg='$d_castneg'
19651 d_charvspr='$d_charvspr'
19653 d_chroot='$d_chroot'
19654 d_chsize='$d_chsize'
19656 d_closedir='$d_closedir'
19657 d_cmsghdr_s='$d_cmsghdr_s'
19660 d_crypt_r='$d_crypt_r'
19662 d_ctermid_r='$d_ctermid_r'
19663 d_ctime_r='$d_ctime_r'
19664 d_cuserid='$d_cuserid'
19665 d_dbl_dig='$d_dbl_dig'
19666 d_dbminitproto='$d_dbminitproto'
19667 d_difftime='$d_difftime'
19669 d_dirnamlen='$d_dirnamlen'
19670 d_dlerror='$d_dlerror'
19671 d_dlopen='$d_dlopen'
19672 d_dlsymun='$d_dlsymun'
19673 d_dosuid='$d_dosuid'
19674 d_drand48_r='$d_drand48_r'
19675 d_drand48proto='$d_drand48proto'
19677 d_eaccess='$d_eaccess'
19678 d_endgrent='$d_endgrent'
19679 d_endgrent_r='$d_endgrent_r'
19680 d_endhent='$d_endhent'
19681 d_endhostent_r='$d_endhostent_r'
19682 d_endnent='$d_endnent'
19683 d_endnetent_r='$d_endnetent_r'
19684 d_endpent='$d_endpent'
19685 d_endprotoent_r='$d_endprotoent_r'
19686 d_endpwent='$d_endpwent'
19687 d_endpwent_r='$d_endpwent_r'
19688 d_endsent='$d_endsent'
19689 d_endservent_r='$d_endservent_r'
19690 d_eofnblk='$d_eofnblk'
19691 d_eunice='$d_eunice'
19692 d_fchdir='$d_fchdir'
19693 d_fchmod='$d_fchmod'
19694 d_fchown='$d_fchown'
19696 d_fcntl_can_lock='$d_fcntl_can_lock'
19697 d_fd_macros='$d_fd_macros'
19698 d_fd_set='$d_fd_set'
19699 d_fds_bits='$d_fds_bits'
19700 d_fgetpos='$d_fgetpos'
19701 d_finite='$d_finite'
19702 d_finitel='$d_finitel'
19703 d_flexfnam='$d_flexfnam'
19705 d_flockproto='$d_flockproto'
19707 d_fp_class='$d_fp_class'
19708 d_fpathconf='$d_fpathconf'
19709 d_fpclass='$d_fpclass'
19710 d_fpclassify='$d_fpclassify'
19711 d_fpclassl='$d_fpclassl'
19712 d_fpos64_t='$d_fpos64_t'
19713 d_frexpl='$d_frexpl'
19714 d_fs_data_s='$d_fs_data_s'
19715 d_fseeko='$d_fseeko'
19716 d_fsetpos='$d_fsetpos'
19717 d_fstatfs='$d_fstatfs'
19718 d_fstatvfs='$d_fstatvfs'
19720 d_ftello='$d_ftello'
19722 d_getcwd='$d_getcwd'
19723 d_getespwnam='$d_getespwnam'
19724 d_getfsstat='$d_getfsstat'
19725 d_getgrent='$d_getgrent'
19726 d_getgrent_r='$d_getgrent_r'
19727 d_getgrgid_r='$d_getgrgid_r'
19728 d_getgrnam_r='$d_getgrnam_r'
19729 d_getgrps='$d_getgrps'
19730 d_gethbyaddr='$d_gethbyaddr'
19731 d_gethbyname='$d_gethbyname'
19732 d_gethent='$d_gethent'
19733 d_gethname='$d_gethname'
19734 d_gethostbyaddr_r='$d_gethostbyaddr_r'
19735 d_gethostbyname_r='$d_gethostbyname_r'
19736 d_gethostent_r='$d_gethostent_r'
19737 d_gethostprotos='$d_gethostprotos'
19738 d_getitimer='$d_getitimer'
19739 d_getlogin='$d_getlogin'
19740 d_getlogin_r='$d_getlogin_r'
19741 d_getmnt='$d_getmnt'
19742 d_getmntent='$d_getmntent'
19743 d_getnbyaddr='$d_getnbyaddr'
19744 d_getnbyname='$d_getnbyname'
19745 d_getnent='$d_getnent'
19746 d_getnetbyaddr_r='$d_getnetbyaddr_r'
19747 d_getnetbyname_r='$d_getnetbyname_r'
19748 d_getnetent_r='$d_getnetent_r'
19749 d_getnetprotos='$d_getnetprotos'
19750 d_getpagsz='$d_getpagsz'
19751 d_getpbyname='$d_getpbyname'
19752 d_getpbynumber='$d_getpbynumber'
19753 d_getpent='$d_getpent'
19754 d_getpgid='$d_getpgid'
19755 d_getpgrp2='$d_getpgrp2'
19756 d_getpgrp='$d_getpgrp'
19757 d_getppid='$d_getppid'
19758 d_getprior='$d_getprior'
19759 d_getprotobyname_r='$d_getprotobyname_r'
19760 d_getprotobynumber_r='$d_getprotobynumber_r'
19761 d_getprotoent_r='$d_getprotoent_r'
19762 d_getprotoprotos='$d_getprotoprotos'
19763 d_getprpwnam='$d_getprpwnam'
19764 d_getpwent='$d_getpwent'
19765 d_getpwent_r='$d_getpwent_r'
19766 d_getpwnam_r='$d_getpwnam_r'
19767 d_getpwuid_r='$d_getpwuid_r'
19768 d_getsbyname='$d_getsbyname'
19769 d_getsbyport='$d_getsbyport'
19770 d_getsent='$d_getsent'
19771 d_getservbyname_r='$d_getservbyname_r'
19772 d_getservbyport_r='$d_getservbyport_r'
19773 d_getservent_r='$d_getservent_r'
19774 d_getservprotos='$d_getservprotos'
19775 d_getspnam='$d_getspnam'
19776 d_getspnam_r='$d_getspnam_r'
19777 d_gettimeod='$d_gettimeod'
19778 d_gmtime_r='$d_gmtime_r'
19779 d_gnulibc='$d_gnulibc'
19780 d_grpasswd='$d_grpasswd'
19781 d_hasmntopt='$d_hasmntopt'
19784 d_inetaton='$d_inetaton'
19785 d_int64_t='$d_int64_t'
19786 d_isascii='$d_isascii'
19787 d_isfinite='$d_isfinite'
19790 d_isnanl='$d_isnanl'
19791 d_killpg='$d_killpg'
19792 d_lchown='$d_lchown'
19793 d_ldbl_dig='$d_ldbl_dig'
19795 d_localtime_r='$d_localtime_r'
19796 d_locconv='$d_locconv'
19798 d_longdbl='$d_longdbl'
19799 d_longlong='$d_longlong'
19800 d_lseekproto='$d_lseekproto'
19802 d_madvise='$d_madvise'
19804 d_mbstowcs='$d_mbstowcs'
19805 d_mbtowc='$d_mbtowc'
19806 d_memchr='$d_memchr'
19807 d_memcmp='$d_memcmp'
19808 d_memcpy='$d_memcpy'
19809 d_memmove='$d_memmove'
19810 d_memset='$d_memset'
19812 d_mkdtemp='$d_mkdtemp'
19813 d_mkfifo='$d_mkfifo'
19814 d_mkstemp='$d_mkstemp'
19815 d_mkstemps='$d_mkstemps'
19816 d_mktime='$d_mktime'
19819 d_modfl_pow32_bug='$d_modfl_pow32_bug'
19820 d_mprotect='$d_mprotect'
19822 d_msg_ctrunc='$d_msg_ctrunc'
19823 d_msg_dontroute='$d_msg_dontroute'
19824 d_msg_oob='$d_msg_oob'
19825 d_msg_peek='$d_msg_peek'
19826 d_msg_proxy='$d_msg_proxy'
19827 d_msgctl='$d_msgctl'
19828 d_msgget='$d_msgget'
19829 d_msghdr_s='$d_msghdr_s'
19830 d_msgrcv='$d_msgrcv'
19831 d_msgsnd='$d_msgsnd'
19833 d_munmap='$d_munmap'
19834 d_mymalloc='$d_mymalloc'
19836 d_nl_langinfo='$d_nl_langinfo'
19837 d_nv_preserves_uv='$d_nv_preserves_uv'
19838 d_off64_t='$d_off64_t'
19839 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
19840 d_oldpthreads='$d_oldpthreads'
19841 d_oldsock='$d_oldsock'
19843 d_pathconf='$d_pathconf'
19845 d_perl_otherlibdirs='$d_perl_otherlibdirs'
19846 d_phostname='$d_phostname'
19849 d_portable='$d_portable'
19850 d_procselfexe='$d_procselfexe'
19851 d_pthread_atfork='$d_pthread_atfork'
19852 d_pthread_yield='$d_pthread_yield'
19854 d_pwchange='$d_pwchange'
19855 d_pwclass='$d_pwclass'
19856 d_pwcomment='$d_pwcomment'
19857 d_pwexpire='$d_pwexpire'
19858 d_pwgecos='$d_pwgecos'
19859 d_pwpasswd='$d_pwpasswd'
19860 d_pwquota='$d_pwquota'
19863 d_random_r='$d_random_r'
19864 d_readdir64_r='$d_readdir64_r'
19865 d_readdir='$d_readdir'
19866 d_readdir_r='$d_readdir_r'
19867 d_readlink='$d_readlink'
19869 d_recvmsg='$d_recvmsg'
19870 d_rename='$d_rename'
19871 d_rewinddir='$d_rewinddir'
19873 d_safebcpy='$d_safebcpy'
19874 d_safemcpy='$d_safemcpy'
19875 d_sanemcmp='$d_sanemcmp'
19876 d_sbrkproto='$d_sbrkproto'
19877 d_sched_yield='$d_sched_yield'
19878 d_scm_rights='$d_scm_rights'
19879 d_seekdir='$d_seekdir'
19880 d_select='$d_select'
19882 d_semctl='$d_semctl'
19883 d_semctl_semid_ds='$d_semctl_semid_ds'
19884 d_semctl_semun='$d_semctl_semun'
19885 d_semget='$d_semget'
19887 d_sendmsg='$d_sendmsg'
19888 d_setegid='$d_setegid'
19889 d_seteuid='$d_seteuid'
19890 d_setgrent='$d_setgrent'
19891 d_setgrent_r='$d_setgrent_r'
19892 d_setgrps='$d_setgrps'
19893 d_sethent='$d_sethent'
19894 d_sethostent_r='$d_sethostent_r'
19895 d_setitimer='$d_setitimer'
19896 d_setlinebuf='$d_setlinebuf'
19897 d_setlocale='$d_setlocale'
19898 d_setlocale_r='$d_setlocale_r'
19899 d_setnent='$d_setnent'
19900 d_setnetent_r='$d_setnetent_r'
19901 d_setpent='$d_setpent'
19902 d_setpgid='$d_setpgid'
19903 d_setpgrp2='$d_setpgrp2'
19904 d_setpgrp='$d_setpgrp'
19905 d_setprior='$d_setprior'
19906 d_setproctitle='$d_setproctitle'
19907 d_setprotoent_r='$d_setprotoent_r'
19908 d_setpwent='$d_setpwent'
19909 d_setpwent_r='$d_setpwent_r'
19910 d_setregid='$d_setregid'
19911 d_setresgid='$d_setresgid'
19912 d_setresuid='$d_setresuid'
19913 d_setreuid='$d_setreuid'
19914 d_setrgid='$d_setrgid'
19915 d_setruid='$d_setruid'
19916 d_setsent='$d_setsent'
19917 d_setservent_r='$d_setservent_r'
19918 d_setsid='$d_setsid'
19919 d_setvbuf='$d_setvbuf'
19923 d_shmatprototype='$d_shmatprototype'
19924 d_shmctl='$d_shmctl'
19926 d_shmget='$d_shmget'
19927 d_sigaction='$d_sigaction'
19928 d_sigprocmask='$d_sigprocmask'
19929 d_sigsetjmp='$d_sigsetjmp'
19930 d_sockatmark='$d_sockatmark'
19931 d_sockatmarkproto='$d_sockatmarkproto'
19932 d_socket='$d_socket'
19933 d_socklen_t='$d_socklen_t'
19934 d_sockpair='$d_sockpair'
19935 d_socks5_init='$d_socks5_init'
19937 d_srand48_r='$d_srand48_r'
19938 d_srandom_r='$d_srandom_r'
19939 d_sresgproto='$d_sresgproto'
19940 d_sresuproto='$d_sresuproto'
19941 d_statblks='$d_statblks'
19942 d_statfs_f_flags='$d_statfs_f_flags'
19943 d_statfs_s='$d_statfs_s'
19944 d_statvfs='$d_statvfs'
19945 d_stdio_cnt_lval='$d_stdio_cnt_lval'
19946 d_stdio_ptr_lval='$d_stdio_ptr_lval'
19947 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
19948 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
19949 d_stdio_stream_array='$d_stdio_stream_array'
19950 d_stdiobase='$d_stdiobase'
19951 d_stdstdio='$d_stdstdio'
19952 d_strchr='$d_strchr'
19953 d_strcoll='$d_strcoll'
19954 d_strctcpy='$d_strctcpy'
19955 d_strerrm='$d_strerrm'
19956 d_strerror='$d_strerror'
19957 d_strerror_r='$d_strerror_r'
19958 d_strftime='$d_strftime'
19959 d_strtod='$d_strtod'
19960 d_strtol='$d_strtol'
19961 d_strtold='$d_strtold'
19962 d_strtoll='$d_strtoll'
19963 d_strtoq='$d_strtoq'
19964 d_strtoul='$d_strtoul'
19965 d_strtoull='$d_strtoull'
19966 d_strtouq='$d_strtouq'
19967 d_strxfrm='$d_strxfrm'
19968 d_suidsafe='$d_suidsafe'
19969 d_symlink='$d_symlink'
19970 d_syscall='$d_syscall'
19971 d_syscallproto='$d_syscallproto'
19972 d_sysconf='$d_sysconf'
19973 d_sysernlst='$d_sysernlst'
19974 d_syserrlst='$d_syserrlst'
19975 d_system='$d_system'
19976 d_tcgetpgrp='$d_tcgetpgrp'
19977 d_tcsetpgrp='$d_tcsetpgrp'
19978 d_telldir='$d_telldir'
19979 d_telldirproto='$d_telldirproto'
19982 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
19983 d_tm_tm_zone='$d_tm_tm_zone'
19984 d_tmpnam_r='$d_tmpnam_r'
19985 d_truncate='$d_truncate'
19986 d_ttyname_r='$d_ttyname_r'
19987 d_tzname='$d_tzname'
19988 d_u32align='$d_u32align'
19989 d_ualarm='$d_ualarm'
19992 d_union_semun='$d_union_semun'
19993 d_unordered='$d_unordered'
19994 d_usleep='$d_usleep'
19995 d_usleepproto='$d_usleepproto'
19997 d_vendorarch='$d_vendorarch'
19998 d_vendorbin='$d_vendorbin'
19999 d_vendorlib='$d_vendorlib'
20001 d_void_closedir='$d_void_closedir'
20002 d_voidsig='$d_voidsig'
20003 d_voidtty='$d_voidtty'
20004 d_volatile='$d_volatile'
20005 d_vprintf='$d_vprintf'
20007 d_waitpid='$d_waitpid'
20008 d_wcstombs='$d_wcstombs'
20009 d_wctomb='$d_wctomb'
20010 d_writev='$d_writev'
20013 db_hashtype='$db_hashtype'
20014 db_prefixtype='$db_prefixtype'
20015 db_version_major='$db_version_major'
20016 db_version_minor='$db_version_minor'
20017 db_version_patch='$db_version_patch'
20018 defvoidused='$defvoidused'
20019 direntrytype='$direntrytype'
20022 doublesize='$doublesize'
20024 drand48_r_proto='$drand48_r_proto'
20025 dynamic_ext='$dynamic_ext'
20031 endgrent_r_proto='$endgrent_r_proto'
20032 endhostent_r_proto='$endhostent_r_proto'
20033 endnetent_r_proto='$endnetent_r_proto'
20034 endprotoent_r_proto='$endprotoent_r_proto'
20035 endpwent_r_proto='$endpwent_r_proto'
20036 endservent_r_proto='$endservent_r_proto'
20037 eunicefix='$eunicefix'
20040 extensions='$extensions'
20042 fflushNULL='$fflushNULL'
20043 fflushall='$fflushall'
20045 firstmakefile='$firstmakefile'
20047 fpossize='$fpossize'
20048 fpostype='$fpostype'
20049 freetype='$freetype'
20052 full_csh='$full_csh'
20053 full_sed='$full_sed'
20054 gccosandvers='$gccosandvers'
20055 gccversion='$gccversion'
20056 getgrent_r_proto='$getgrent_r_proto'
20057 getgrgid_r_proto='$getgrgid_r_proto'
20058 getgrnam_r_proto='$getgrnam_r_proto'
20059 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
20060 gethostbyname_r_proto='$gethostbyname_r_proto'
20061 gethostent_r_proto='$gethostent_r_proto'
20062 getlogin_r_proto='$getlogin_r_proto'
20063 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
20064 getnetbyname_r_proto='$getnetbyname_r_proto'
20065 getnetent_r_proto='$getnetent_r_proto'
20066 getprotobyname_r_proto='$getprotobyname_r_proto'
20067 getprotobynumber_r_proto='$getprotobynumber_r_proto'
20068 getprotoent_r_proto='$getprotoent_r_proto'
20069 getpwent_r_proto='$getpwent_r_proto'
20070 getpwnam_r_proto='$getpwnam_r_proto'
20071 getpwuid_r_proto='$getpwuid_r_proto'
20072 getservbyname_r_proto='$getservbyname_r_proto'
20073 getservbyport_r_proto='$getservbyport_r_proto'
20074 getservent_r_proto='$getservent_r_proto'
20075 getspnam_r_proto='$getspnam_r_proto'
20076 gidformat='$gidformat'
20082 gmtime_r_proto='$gmtime_r_proto'
20084 groupcat='$groupcat'
20085 groupstype='$groupstype'
20088 h_sysfile='$h_sysfile'
20099 i_arpainet='$i_arpainet'
20100 i_bsdioctl='$i_bsdioctl'
20104 i_dirent='$i_dirent'
20110 i_fp_class='$i_fp_class'
20113 i_ieeefp='$i_ieeefp'
20114 i_inttypes='$i_inttypes'
20115 i_langinfo='$i_langinfo'
20116 i_libutil='$i_libutil'
20117 i_limits='$i_limits'
20118 i_locale='$i_locale'
20119 i_machcthr='$i_machcthr'
20120 i_malloc='$i_malloc'
20122 i_memory='$i_memory'
20123 i_mntent='$i_mntent'
20126 i_neterrno='$i_neterrno'
20127 i_netinettcp='$i_netinettcp'
20131 i_pthread='$i_pthread'
20133 i_rpcsvcdbm='$i_rpcsvcdbm'
20136 i_shadow='$i_shadow'
20138 i_stdarg='$i_stdarg'
20139 i_stddef='$i_stddef'
20140 i_stdlib='$i_stdlib'
20141 i_string='$i_string'
20142 i_sunmath='$i_sunmath'
20143 i_sysaccess='$i_sysaccess'
20144 i_sysdir='$i_sysdir'
20145 i_sysfile='$i_sysfile'
20146 i_sysfilio='$i_sysfilio'
20148 i_sysioctl='$i_sysioctl'
20149 i_syslog='$i_syslog'
20150 i_sysmman='$i_sysmman'
20151 i_sysmode='$i_sysmode'
20152 i_sysmount='$i_sysmount'
20153 i_sysndir='$i_sysndir'
20154 i_sysparam='$i_sysparam'
20155 i_sysresrc='$i_sysresrc'
20156 i_syssecrt='$i_syssecrt'
20157 i_sysselct='$i_sysselct'
20158 i_syssockio='$i_syssockio'
20159 i_sysstat='$i_sysstat'
20160 i_sysstatfs='$i_sysstatfs'
20161 i_sysstatvfs='$i_sysstatvfs'
20162 i_systime='$i_systime'
20163 i_systimek='$i_systimek'
20164 i_systimes='$i_systimes'
20165 i_systypes='$i_systypes'
20166 i_sysuio='$i_sysuio'
20168 i_sysutsname='$i_sysutsname'
20169 i_sysvfs='$i_sysvfs'
20170 i_syswait='$i_syswait'
20171 i_termio='$i_termio'
20172 i_termios='$i_termios'
20174 i_unistd='$i_unistd'
20177 i_values='$i_values'
20178 i_varargs='$i_varargs'
20179 i_varhdr='$i_varhdr'
20181 ignore_versioned_solibs='$ignore_versioned_solibs'
20182 inc_version_list='$inc_version_list'
20183 inc_version_list_init='$inc_version_list_init'
20186 installarchlib='$installarchlib'
20187 installbin='$installbin'
20188 installman1dir='$installman1dir'
20189 installman3dir='$installman3dir'
20190 installprefix='$installprefix'
20191 installprefixexp='$installprefixexp'
20192 installprivlib='$installprivlib'
20193 installscript='$installscript'
20194 installsitearch='$installsitearch'
20195 installsitebin='$installsitebin'
20196 installsitelib='$installsitelib'
20197 installstyle='$installstyle'
20198 installusrbinperl='$installusrbinperl'
20199 installvendorarch='$installvendorarch'
20200 installvendorbin='$installvendorbin'
20201 installvendorlib='$installvendorlib'
20203 issymlink='$issymlink'
20204 ivdformat='$ivdformat'
20207 known_extensions='$known_extensions'
20210 lddlflags='$lddlflags'
20212 ldflags_uselargefiles='$ldflags_uselargefiles'
20213 ldlibpthname='$ldlibpthname'
20220 libsdirs='$libsdirs'
20221 libsfiles='$libsfiles'
20222 libsfound='$libsfound'
20223 libspath='$libspath'
20224 libswanted='$libswanted'
20225 libswanted_uselargefiles='$libswanted_uselargefiles'
20231 localtime_r_proto='$localtime_r_proto'
20232 locincpth='$locincpth'
20233 loclibpth='$loclibpth'
20234 longdblsize='$longdblsize'
20235 longlongsize='$longlongsize'
20236 longsize='$longsize'
20240 lseeksize='$lseeksize'
20241 lseektype='$lseektype'
20245 make_set_make='$make_set_make'
20246 mallocobj='$mallocobj'
20247 mallocsrc='$mallocsrc'
20248 malloctype='$malloctype'
20250 man1direxp='$man1direxp'
20253 man3direxp='$man3direxp'
20255 mips_type='$mips_type'
20257 mmaptype='$mmaptype'
20258 modetype='$modetype'
20260 multiarch='$multiarch'
20262 myarchname='$myarchname'
20263 mydomain='$mydomain'
20264 myhostname='$myhostname'
20267 need_va_copy='$need_va_copy'
20268 netdb_hlen_type='$netdb_hlen_type'
20269 netdb_host_type='$netdb_host_type'
20270 netdb_name_type='$netdb_name_type'
20271 netdb_net_type='$netdb_net_type'
20274 nm_so_opt='$nm_so_opt'
20275 nonxs_ext='$nonxs_ext'
20277 nvEUformat='$nvEUformat'
20278 nvFUformat='$nvFUformat'
20279 nvGUformat='$nvGUformat'
20280 nv_preserves_uv_bits='$nv_preserves_uv_bits'
20281 nveformat='$nveformat'
20282 nvfformat='$nvfformat'
20283 nvgformat='$nvgformat'
20286 o_nonblock='$o_nonblock'
20288 old_pthread_create_joinable='$old_pthread_create_joinable'
20289 optimize='$optimize'
20290 orderlib='$orderlib'
20293 otherlibdirs='$otherlibdirs'
20297 patchlevel='$patchlevel'
20298 path_sep='$path_sep'
20301 perl_patchlevel='$perl_patchlevel'
20302 perladmin='$perladmin'
20303 perllibs='$perllibs'
20304 perlpath='$perlpath'
20306 phostname='$phostname'
20309 pm_apiversion='$pm_apiversion'
20313 prefixexp='$prefixexp'
20315 privlibexp='$privlibexp'
20316 procselfexe='$procselfexe'
20317 prototype='$prototype'
20319 quadkind='$quadkind'
20320 quadtype='$quadtype'
20321 randbits='$randbits'
20322 randfunc='$randfunc'
20323 random_r_proto='$random_r_proto'
20324 randseedtype='$randseedtype'
20326 rd_nodata='$rd_nodata'
20327 readdir64_r_proto='$readdir64_r_proto'
20328 readdir_r_proto='$readdir_r_proto'
20329 revision='$revision'
20334 sPRIEUldbl='$sPRIEUldbl'
20335 sPRIFUldbl='$sPRIFUldbl'
20336 sPRIGUldbl='$sPRIGUldbl'
20337 sPRIXU64='$sPRIXU64'
20339 sPRIeldbl='$sPRIeldbl'
20340 sPRIfldbl='$sPRIfldbl'
20341 sPRIgldbl='$sPRIgldbl'
20346 sSCNfldbl='$sSCNfldbl'
20347 sched_yield='$sched_yield'
20348 scriptdir='$scriptdir'
20349 scriptdirexp='$scriptdirexp'
20351 seedfunc='$seedfunc'
20352 selectminbits='$selectminbits'
20353 selecttype='$selecttype'
20354 sendmail='$sendmail'
20355 setgrent_r_proto='$setgrent_r_proto'
20356 sethostent_r_proto='$sethostent_r_proto'
20357 setlocale_r_proto='$setlocale_r_proto'
20358 setnetent_r_proto='$setnetent_r_proto'
20359 setprotoent_r_proto='$setprotoent_r_proto'
20360 setpwent_r_proto='$setpwent_r_proto'
20361 setservent_r_proto='$setservent_r_proto'
20364 sharpbang='$sharpbang'
20365 shmattype='$shmattype'
20366 shortsize='$shortsize'
20369 sig_count='$sig_count'
20370 sig_name='$sig_name'
20371 sig_name_init='$sig_name_init'
20373 sig_num_init='$sig_num_init'
20374 sig_size='$sig_size'
20375 signal_t='$signal_t'
20376 sitearch='$sitearch'
20377 sitearchexp='$sitearchexp'
20379 sitebinexp='$sitebinexp'
20381 sitelib_stem='$sitelib_stem'
20382 sitelibexp='$sitelibexp'
20383 siteprefix='$siteprefix'
20384 siteprefixexp='$siteprefixexp'
20385 sizesize='$sizesize'
20386 sizetype='$sizetype'
20390 sockethdr='$sockethdr'
20391 socketlib='$socketlib'
20392 socksizetype='$socksizetype'
20394 spackage='$spackage'
20395 spitshell='$spitshell'
20396 srand48_r_proto='$srand48_r_proto'
20397 srandom_r_proto='$srandom_r_proto'
20399 ssizetype='$ssizetype'
20400 startperl='$startperl'
20402 static_ext='$static_ext'
20404 stdio_base='$stdio_base'
20405 stdio_bufsiz='$stdio_bufsiz'
20406 stdio_cnt='$stdio_cnt'
20407 stdio_filbuf='$stdio_filbuf'
20408 stdio_ptr='$stdio_ptr'
20409 stdio_stream_array='$stdio_stream_array'
20410 strerror_r_proto='$strerror_r_proto'
20413 subversion='$subversion'
20417 targetarch='$targetarch'
20421 timeincl='$timeincl'
20422 timetype='$timetype'
20423 tmpnam_r_proto='$tmpnam_r_proto'
20429 ttyname_r_proto='$ttyname_r_proto'
20438 uidformat='$uidformat'
20444 uquadtype='$uquadtype'
20445 use5005threads='$use5005threads'
20446 use64bitall='$use64bitall'
20447 use64bitint='$use64bitint'
20448 usecrosscompile='$usecrosscompile'
20450 useithreads='$useithreads'
20451 uselargefiles='$uselargefiles'
20452 uselongdouble='$uselongdouble'
20453 usemorebits='$usemorebits'
20454 usemultiplicity='$usemultiplicity'
20455 usemymalloc='$usemymalloc'
20457 useopcode='$useopcode'
20458 useperlio='$useperlio'
20459 useposix='$useposix'
20460 usereentrant='$usereentrant'
20462 useshrplib='$useshrplib'
20463 usesocks='$usesocks'
20464 usethreads='$usethreads'
20465 usevendorprefix='$usevendorprefix'
20466 usevfork='$usevfork'
20469 uvXUformat='$uvXUformat'
20470 uvoformat='$uvoformat'
20473 uvuformat='$uvuformat'
20474 uvxformat='$uvxformat'
20475 vendorarch='$vendorarch'
20476 vendorarchexp='$vendorarchexp'
20477 vendorbin='$vendorbin'
20478 vendorbinexp='$vendorbinexp'
20479 vendorlib='$vendorlib'
20480 vendorlib_stem='$vendorlib_stem'
20481 vendorlibexp='$vendorlibexp'
20482 vendorprefix='$vendorprefix'
20483 vendorprefixexp='$vendorprefixexp'
20485 version_patchlevel_string='$version_patchlevel_string'
20486 versiononly='$versiononly'
20488 voidflags='$voidflags'
20490 xs_apiversion='$xs_apiversion'
20492 yaccflags='$yaccflags'
20497 : Add in command line options if available
20498 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
20500 : add special variables
20501 $test -f $src/patchlevel.h && \
20502 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
20503 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
20504 echo "PERL_CONFIG_SH=true" >>config.sh
20506 : propagate old symbols
20507 if $test -f UU/config.sh; then
20508 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
20509 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
20510 $sort | $uniq -u >UU/oldsyms
20511 set X `cat UU/oldsyms`
20517 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
20519 echo "# Variables propagated from previous config.sh file." >>config.sh
20520 for sym in `cat UU/oldsyms`; do
20521 echo " Propagating $hint variable "'$'"$sym..."
20522 eval 'tmp="$'"${sym}"'"'
20524 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
20530 : Finish up by extracting the .SH files
20534 echo "Extraction done."
20544 If you'd like to make any changes to the config.sh file before I begin
20545 to configure things, do it as a shell escape now (e.g. !vi config.sh).
20548 rp="Press return or use a shell escape to edit config.sh:"
20553 *) : in case they cannot read
20554 sh 1>&4 -c "$ans";;
20559 : if this fails, just run all the .SH files by hand
20568 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
20575 Now you need to generate make dependencies by running "$make depend".
20576 You might prefer to run it in background: "$make depend > makedepend.out &"
20577 It can take a while, so you might not want to run it right now.
20582 rp="Run $make depend now?"
20586 $make depend && echo "Now you must run '$make'."
20589 echo "You must run '$make depend' then '$make'."
20592 elif test -f [Mm]akefile; then
20594 echo "Now you must run a $make."
20596 echo "Configure done."
20599 if $test -f Policy.sh; then
20602 If you compile $package on a different machine or from a different object
20603 directory, copy the Policy.sh file from this object directory to the
20604 new one before you run Configure -- this will help you with most of
20605 the policy defaults.
20609 if $test -f config.msg; then
20610 echo "Hmm. I also noted the following information while running:"
20612 $cat config.msg >&4
20615 $rm -f kit*isdone ark*isdone