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 16 17:03:39 EET DST 2002 [metaconfig 3.0 PL70]
24 # (with additional metaconfig patches by perlbug@perl.org)
29 SCO csh still thinks true is false. Write to SCO today and tell them that next
30 year Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
32 (Actually, Configure ought to just patch csh in place. Hmm. Hmmmmm. All
33 we'd have to do is go in and swap the && and || tokens, wherever they are.)
35 [End of diatribe. We now return you to your regularly scheduled programming...]
39 OOPS! You naughty creature! You didn't run Configure with sh!
40 I will attempt to remedy the situation by running sh for you...
44 true || exec sh $0 $argv:q
46 (exit $?0) || cat c2$$
47 (exit $?0) || exec sh $0 $argv:q
50 : compute my invocation name
54 me=`echo $0 | sed -e 's!.*/\(.*\)!\1!' 2>/dev/null`
59 : Proper separator for the PATH environment variable
61 : On OS/2 this directory should exist if this is not floppy only system :-]
62 if test -d c:/. ; then
63 if test -n "$OS2_SHELL"; then
65 PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
66 OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
67 elif test -n "$DJGPP"; then
68 case "X${MACHTYPE:-nonesuchmach}" in
76 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
77 paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
78 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
79 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
80 paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
81 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
82 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
83 paths="$paths /sbin /usr/sbin /usr/libexec"
84 paths="$paths /system/gnu_library/bin"
90 *) test -d $p && PATH=$PATH$p_$p ;;
97 : shall we be using ksh?
103 if (PATH=.; alias -x) >/dev/null 2>&1; then
106 if test -f /hp-ux -a -f /bin/ksh; then
107 needksh='to avoid sh bug in "here document" expansion'
109 if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
110 if test X`/usr/bin/uname -v` = X4; then
111 avoidksh="to avoid AIX 4's /bin/sh"
115 if test -f /osf_boot -a -f /usr/sbin/setld; then
116 if test X`/usr/bin/uname -s` = XOSF1; then
117 avoidksh="to avoid Digital UNIX' ksh"
119 unset BIN_SH # if this is 'xpg4' sh will start up ksh
122 case "$inksh/$needksh" in
129 case "$inksh/$avoidksh" in
135 case "$inksh/$needksh-$avoidksh-" in
138 (I see you are using the Korn shell. Some ksh's blow up on $me,
139 mainly on older exotic systems. If yours does, try the Bourne shell instead.)
146 echo "(Feeding myself to $newsh $reason.)"
148 Configure|*/Configure) exec $newsh $0 "$@";;
149 *) exec $newsh Configure "$@";;
154 : if needed set CDPATH to a harmless value that is not chatty
155 : avoid bash 2.02 problems with empty CDPATH.
159 *bash*) CDPATH='.' ;;
164 : Configure runs within the UU subdirectory
165 test -d UU || mkdir UU
373 endhostent_r_proto=''
379 endprotoent_r_proto=''
385 endservent_r_proto=''
435 gethostbyaddr_r_proto=''
437 gethostbyname_r_proto=''
439 gethostent_r_proto=''
451 getnetbyaddr_r_proto=''
453 getnetbyname_r_proto=''
467 d_getprotobyname_r=''
468 getprotobyname_r_proto=''
469 d_getprotobynumber_r=''
470 getprotobynumber_r_proto=''
472 getprotoent_r_proto=''
484 getservbyname_r_proto=''
486 getservbyport_r_proto=''
488 getservent_r_proto=''
561 d_old_pthread_create_joinable=''
562 old_pthread_create_joinable=''
601 sethostent_r_proto=''
618 setprotoent_r_proto=''
630 setservent_r_proto=''
674 d_stdio_ptr_lval_nochange_cnt=''
675 d_stdio_ptr_lval_sets_cnt=''
869 inc_version_list_init=''
888 ignore_versioned_solibs=''
947 d_perl_otherlibdirs=''
961 version_patchlevel_string=''
976 nv_preserves_uv_bits=''
1065 d_stdio_stream_array=''
1066 stdio_stream_array=''
1076 ccflags_uselargefiles=''
1077 ldflags_uselargefiles=''
1078 libswanted_uselargefiles=''
1098 installvendorarch=''
1124 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
1127 : We must find out about Eunice early
1129 if test -f /etc/unixtovms; then
1130 eunicefix=/etc/unixtovms
1132 if test -f /etc/unixtovms.exe; then
1133 eunicefix=/etc/unixtovms.exe
1136 : Set executable suffix now -- needed before hints available
1137 if test -f "/libs/version.library"; then
1140 elif test -f "/system/gnu_library/bin/ar.pm"; then
1143 elif test -n "$DJGPP"; then
1146 elif test -d c:/. ; then
1155 : set useposix=false in your hint file to disable the POSIX extension.
1157 : set useopcode=false in your hint file to disable the Opcode extension.
1159 : Trailing extension. Override this in a hint file, if needed.
1160 : Extra object files, if any, needed on this platform.
1163 : Possible local include directories to search.
1164 : Set locincpth to "" in a hint file to defeat local include searches.
1165 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
1166 locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
1168 : no include file wanted by default
1173 : change the next line if compiling for Xenix/286 on Xenix/386
1174 xlibpth='/usr/lib/386 /lib/386'
1175 : Possible local library directories to search.
1176 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
1177 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
1179 : general looking path for locating libraries
1180 glibpth="/lib /usr/lib $xlibpth"
1181 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
1182 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
1183 test -f /shlib/libc.so && glibpth="/shlib $glibpth"
1185 : Private path used by Configure to find libraries. Its value
1186 : is prepended to libpth. This variable takes care of special
1187 : machines, like the mips. Usually, it should be empty.
1190 : default library list
1192 : some systems want to use only the non-versioned libso:s
1193 ignore_versioned_solibs=''
1195 ccflags_uselargefiles=''
1196 ldflags_uselargefiles=''
1197 libswanted_uselargefiles=''
1198 : set usemultiplicity on the Configure command line to enable multiplicity.
1199 : set usesocks on the Configure command line to enable socks.
1200 : set usethreads on the Configure command line to enable threads.
1201 usereentrant='undef'
1202 : full support for void wanted by default
1205 : List of libraries we want.
1206 : If anyone needs -lnet, put it in a hint file.
1207 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
1208 libswanted="$libswanted dld ld sun m c cposix posix"
1209 libswanted="$libswanted ndir dir crypt sec"
1210 libswanted="$libswanted ucb bsd BSD PW x util"
1211 : We probably want to search /usr/shlib before most other libraries.
1212 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
1213 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
1214 glibpth="/usr/shlib $glibpth"
1215 : Do not use vfork unless overridden by a hint file.
1218 : Find the basic shell for Bourne shell scripts
1222 *bsd*|sys5*) xxx="/$SYSTYPE/bin/sh";;
1225 if test -f "$xxx"; then
1228 : Build up a list and do a single loop so we can 'break' out.
1229 pth=`echo $PATH | sed -e "s/$p_/ /g"`
1230 for xxx in sh bash ksh pdksh ash; do
1232 try="$try ${p}/${xxx}"
1236 if test -f "$xxx"; then
1239 elif test "X$_exe" != X -a -f "$xxx$_exe"; then
1242 elif test -f "$xxx.exe"; then
1253 $me: Fatal Error: I can't find a Bourne Shell anywhere.
1255 Usually it's in /bin/sh. How did you even get this far?
1256 Please contact me (Perl Maintainers) at perlbug@perl.org and
1257 we'll try to straighten this all out.
1263 : see if sh knows # comments
1264 if `$sh -c '#' >/dev/null 2>&1`; then
1268 test -f $xcat$_exe || xcat=/usr/bin/cat
1269 if test ! -f $xcat$_exe; then
1270 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
1271 if test -f $p/cat$_exe; then
1276 if test ! -f $xcat$_exe; then
1277 echo "Can't find cat anywhere!"
1281 echo "#!$xcat" >sharp
1285 if test -s today; then
1288 echo "#! $xcat" > sharp
1292 if test -s today; then
1300 echo "Your $sh doesn't grok # comments--I will strip them later on."
1303 echo "exec grep -v '^[ ]*#'" >spitshell
1305 $eunicefix spitshell
1306 spitshell=`pwd`/spitshell
1308 echo "I presume that if # doesn't work, #! won't work either!"
1313 : figure out how to guarantee sh startup
1315 '') startsh=${sharpbang}${sh} ;;
1327 : echo "Yup, it does."
1329 echo "Hmm... '$startsh' does not guarantee sh startup..."
1330 echo "You may have to fix up the shell scripts to make sure $sh runs them."
1335 : Save command line options in file UU/cmdline.opt for later use in
1336 : generating config.sh.
1337 cat > cmdline.opt <<EOSH
1338 # Configure command line arguments.
1347 cat >>cmdline.opt <<EOSH
1348 config_arg$argn='$arg'
1350 # Extreme backslashitis: replace each ' by '"'"'
1351 cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
1354 arg_exp=`cat cmdl.opt`
1355 args_exp="$args_exp$args_sep'$arg_exp'"
1356 argn=`expr $argn + 1`
1359 # args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
1360 # used by ./hints/os2.sh
1363 : produce awk script to parse command line options
1364 cat >options.awk <<'EOF'
1366 optstr = "A:dD:eEf:hKOrsSU:V"; # getopt-style specification
1368 len = length(optstr);
1369 for (i = 1; i <= len; i++) {
1370 c = substr(optstr, i, 1);
1371 if (i < len) a = substr(optstr, i + 1, 1); else a = "";
1382 if (substr(str, 1, 1) != "-") {
1383 printf("'%s'\n", str);
1387 for (i = 2; i <= len; i++) {
1388 c = substr(str, i, 1);
1390 printf("-%s\n", substr(str, i));
1396 printf("'%s'\n", substr(str, i + 1));
1409 : process the command line options
1410 set X `for arg in "$@"; do echo "X$arg"; done |
1411 sed -e s/X// | awk -f options.awk`
1416 : set up default values
1426 rm -f optdef.sh posthint.sh
1427 cat >optdef.sh <<EOS
1433 while test $# -gt 0; do
1435 -d) shift; fastread=yes;;
1436 -e) shift; alldone=cont;;
1440 if test -r "$1"; then
1443 echo "$me: cannot read config file $1." >&2
1448 -h) shift; error=true;;
1449 -r) shift; reuseval=true;;
1450 -s) shift; silent=true; realsilent=true;;
1451 -E) shift; alldone=exit;;
1452 -K) shift; knowitall=true;;
1453 -O) shift; override=true;;
1454 -S) shift; silent=true; extractsh=true;;
1459 echo "$me: use '-U symbol=', not '-D symbol='." >&2
1460 echo "$me: ignoring -D $1" >&2
1463 sed -e "s/'/'\"'\"'/g" -e "s/=\(.*\)/='\1'/" >> optdef.sh;;
1464 *) echo "$1='define'" >> optdef.sh;;
1471 *=) echo "$1" >> optdef.sh;;
1473 echo "$me: use '-D symbol=val', not '-U symbol=val'." >&2
1474 echo "$me: ignoring -U $1" >&2
1476 *) echo "$1='undef'" >> optdef.sh;;
1487 *=*) zzz=`echo $yyy|sed 's!=.*!!'`
1491 zzz=" "`echo $yyy|sed 's!^[^=]*=!!'`
1492 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1498 *:*) xxx=`echo $yyy|sed 's!:.*!!'`
1499 yyy=`echo $yyy|sed 's!^[^:]*:!!'`
1500 zzz=`echo $yyy|sed 's!^[^=]*=!!'`
1501 yyy=`echo $yyy|sed 's!=.*!!'` ;;
1502 *) xxx=`echo $yyy|sed 's!:.*!!'`
1503 yyy=`echo $yyy|sed 's!^[^:]*:!!'` ;;
1509 echo "$yyy=\"\${$yyy}$zzz\"" >> posthint.sh ;;
1511 echo "$yyy=''" >> posthint.sh ;;
1516 echo "$yyy='$zzz'" >> posthint.sh ;;
1518 echo "eval \"$yyy=$zzz\"" >> posthint.sh ;;
1520 echo "$yyy=\"$zzz\${$yyy}\"" >> posthint.sh ;;
1525 echo "$yyy=$zzz" >> posthint.sh ;;
1526 *) echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
1530 -V) echo "$me generated by metaconfig 3.0 PL70." >&2
1533 -*) echo "$me: unknown option $1" >&2; shift; error=true;;
1541 Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
1542 [-U symbol] [-U symbol=] [-A command:symbol...]
1543 -d : use defaults for all answers.
1544 -e : go on without questioning past the production of config.sh.
1545 -f : specify an alternate default configuration file.
1546 -h : print this help message and exit (with an error status).
1547 -r : reuse C symbols value if possible (skips costly nm extraction).
1548 -s : silent mode, only echoes questions and essential information.
1549 -D : define symbol to have some value:
1550 -D symbol symbol gets the value 'define'
1551 -D symbol=value symbol gets the value 'value'
1552 -E : stop at the end of questions, after having produced config.sh.
1553 -K : do not use unless you know what you are doing.
1554 -O : let -D and -U override definitions from loaded configuration file.
1555 -S : perform variable substitutions on all .SH files (can mix with -f)
1556 -U : undefine symbol:
1557 -U symbol symbol gets the value 'undef'
1558 -U symbol= symbol gets completely empty
1559 -A : manipulate symbol after the platform specific hints have been applied:
1560 -A symbol=value append " "value to symbol
1561 -A append:symbol=value append value to symbol
1562 -A define:symbol=value define symbol to have value
1563 -A clear:symbol define symbol to be ''
1564 -A define:symbol define symbol to be 'define'
1565 -A eval:symbol=value define symbol to be eval of value
1566 -A prepend:symbol=value prepend value to symbol
1567 -A undef:symbol define symbol to be 'undef'
1568 -A undef:symbol= define symbol to be ''
1569 -V : print version number and exit (with a zero status).
1576 case "$fastread$alldone" in
1579 case "$extractsh" in
1582 if test ! -t 0; then
1583 echo "Say 'sh Configure', not 'sh <Configure'"
1593 true) exec 1>/dev/null;;
1596 : run the defines and the undefines, if any, but leave the file out there...
1599 : create the posthint manipulation script and leave the file out there...
1604 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
1605 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
1606 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
1607 ABYZ) spackage=`echo $first | tr '[:lower:]' '[:upper:]'`$last;;
1608 *) spackage=`echo $first | tr '[a-z]' '[A-Z]'`$last;;
1611 : Some greps do not return status, grrr.
1612 echo "grimblepritz" >grimble
1613 if grep blurfldyick grimble >/dev/null 2>&1 ; then
1615 elif grep grimblepritz grimble >/dev/null 2>&1 ; then
1621 : the following should work in any shell
1625 echo "AGH! Grep doesn't return a status. Attempting remedial action."
1626 cat >contains <<'EOSS'
1627 grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
1632 : Find the path to the source tree
1635 */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
1639 *) src=`cd ../$src && pwd` ;;
1652 if test -f $rsrc/Configure && \
1653 $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
1655 : found it, so we are ok.
1658 for src in . .. ../.. ../../.. ../../../..; do
1659 if test -f ../$src/Configure && \
1660 $contains "^package=$package$" ../$src/Configure >/dev/null 2>&1
1671 Sorry, I can't seem to locate the source dir for $package. Please start
1672 Configure with an explicit path -- i.e. /some/path/Configure.
1680 echo "Sources for $package found in \"$src\"." >&4
1684 : script used to extract .SH files with variable substitutions
1685 cat >extract <<'EOS'
1687 echo "Doing variable substitutions on .SH files..."
1688 if test -f MANIFEST; then
1689 set x `awk '{print $1}' < MANIFEST | grep '\.SH$'`
1691 echo "(Looking for .SH files under the source directory.)"
1692 set x `(cd "$src"; find . -name "*.SH" -print)`
1696 0) set x `(cd "$src"; echo *.SH)`; shift;;
1698 if test ! -f "$src/$1"; then
1704 while test $name; do
1705 if test ! -d "$name"; then
1706 create="$name $create";
1707 name=`echo $name | sed -e "s|^[^/]*$||"`;
1708 name=`echo $name | sed -e "s|\(.*\)/.*|\1|"`;
1713 for file in $create; do
1722 dir=`expr X$file : 'X\(.*\)/'`
1723 file=`expr X$file : 'X.*/\(.*\)'`
1724 (cd "$dir" && . ./$file)
1734 dir=`expr X$file : 'X\(.*\)/'`
1735 file=`expr X$file : 'X.*/\(.*\)'`
1736 (set x $dir; shift; eval $mkdir_p)
1737 sh <"$src/$dir/$file"
1746 if test -f "$src/config_h.SH"; then
1747 if test ! -f config.h; then
1748 : oops, they left it out of MANIFEST, probably, so do it anyway.
1749 . "$src/config_h.SH"
1754 : extract files and exit if asked to do so
1755 case "$extractsh" in
1757 case "$realsilent" in
1761 case "$config_sh" in
1762 '') config_sh='config.sh';;
1765 echo "Fetching answers from $config_sh..."
1768 test "$override" && . ./optdef.sh
1772 echo "Extraction done."
1777 : Eunice requires " " instead of "", can you believe it
1780 echo "Beginning of configuration questions for $package."
1782 trap 'echo " "; test -d ../UU && rm -rf X $rmlist; exit 1' 1 2 3 15
1784 : first determine how to suppress newline on echo command
1786 echo "Checking echo to see how to suppress newlines..."
1787 (echo "hi there\c" ; echo " ") >.echotmp
1788 if $contains c .echotmp >/dev/null 2>&1 ; then
1799 echo $n "The star should be here-->$c"
1803 : Now test for existence of everything in MANIFEST
1805 if test -f "$rsrc/MANIFEST"; then
1806 echo "First let's make sure your kit is complete. Checking..." >&4
1807 awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
1810 for filelist in x??; do
1811 (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
1813 if test -s missing; then
1817 THIS PACKAGE SEEMS TO BE INCOMPLETE.
1819 You have the option of continuing the configuration process, despite the
1820 distinct possibility that your kit is damaged, by typing 'y'es. If you
1821 do, don't blame me if something goes wrong. I advise you to type 'n'o
1822 and contact the author (perlbug@perl.org).
1825 echo $n "Continue? [n] $c" >&4
1829 echo "Continuing..." >&4
1833 echo "ABORTING..." >&4
1838 echo "Looks good..."
1841 echo "There is no MANIFEST file. I hope your kit is complete !"
1846 : Find the appropriate value for a newline for tr
1847 if test -n "$DJGPP"; then
1850 if test X"$trnl" = X; then
1851 case "`echo foo|tr '\n' x 2>/dev/null`" in
1855 if test X"$trnl" = X; then
1856 case "`echo foo|tr '\012' x 2>/dev/null`" in
1857 foox) trnl='\012' ;;
1860 if test X"$trnl" = X; then
1861 case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
1862 fooxy) trnl='\n\r' ;;
1865 if test X"$trnl" = X; then
1868 $me: Fatal Error: cannot figure out how to translate newlines with 'tr'.
1874 : compute the number of columns on the terminal for proper question formatting
1879 : set up the echo used in my read
1880 myecho="case \"\$xxxm\" in
1881 '') echo $n \"\$rp $c\" >&4;;
1883 '') echo $n \"[\$xxxm] $c\";;
1885 if test \`echo \"\$rp [\$xxxm] \" | wc -c\` -ge $COLUMNS; then
1887 echo $n \"[\$xxxm] $c\" >&4
1889 echo $n \"\$rp [\$xxxm] $c\" >&4
1895 : now set up to do reads with possible shell escape and default assignment
1901 case "\$fastread" in
1902 yes) case "\$dflt" in
1905 case "\$silent-\$rp" in
1910 *) case "\$silent" in
1911 true) case "\$rp" in
1916 while expr "X\$ans" : "X!" >/dev/null; do
1920 aok=''; eval "ans=\\"\$answ\\"" && aok=y
1928 set x \`expr "X\$ans" : "X!\(.*\)\$"\`
1937 set x \`expr "X\$ans" : "X&\(.*\)\$"\`
1942 echo "(OK, I'll run with -d after this question.)" >&4
1945 echo "*** Sorry, \$1 not supported yet." >&4
1955 echo "*** Substitution done -- please confirm."
1957 ans=\`echo $n "\$ans$c" | tr '$trnl' ' '\`
1962 echo "*** Error -- try again."
1969 case "\$ans\$xxxm\$nostick" in
1981 : create .config dir to save info across Configure sessions
1982 test -d ../.config || mkdir ../.config
1983 cat >../.config/README <<EOF
1984 This directory created by Configure to save information that should
1985 persist across sessions for $package.
1987 You may safely delete it if you wish.
1990 xversion=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
1992 $define|true|[yY]*) ;;
1993 *) case "$xversion" in
1996 *** WHOA THERE!!! ***
1998 This is an UNSTABLE DEVELOPMENT release.
1999 The version of this $package distribution is $xversion, that is, odd,
2000 (as opposed to even) and that signifies a development release.
2001 If you want a maintenance release, you want an even-numbered version.
2003 Do ***NOT*** install this into production use.
2004 Data corruption and crashes are possible.
2006 It is most seriously suggested that you do not continue any further
2007 unless you want to help in developing and debugging Perl.
2009 If you *still* want to build perl, you can answer 'y' now,
2010 or pass -Dusedevel to Configure.
2013 rp='Do you really want to continue?'
2017 [yY]) echo >&4 "Okay, continuing."
2018 usedevel="$define" ;;
2019 *) echo >&4 "Okay, bye."
2029 case "$versiononly" in
2030 '') versiononly="$define" ;;
2032 case "$installusrbinperl" in
2033 '') installusrbinperl="$undef" ;;
2038 : general instructions
2041 user=`(logname) 2>/dev/null`
2043 '') user=`whoami 2>&1`;;
2045 if $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
2048 rp='Would you like to see the instructions?'
2059 This installation shell script will examine your system and ask you questions
2060 to determine how the perl5 package should be installed. If you get
2061 stuck on a question, you may use a ! shell escape to start a subshell or
2062 execute a command. Many of the questions will have default answers in square
2063 brackets; typing carriage return will give you the default.
2065 On some of the questions which ask for file or directory names you are allowed
2066 to use the ~name construct to specify the login directory belonging to "name",
2067 even if you don't have a shell which knows about that. Questions where this is
2068 allowed will be marked "(~name ok)".
2072 dflt='Type carriage return to continue'
2076 The prompter used in this script allows you to use shell variables and
2077 backticks in your answers. You may use $1, $2, etc... to refer to the words
2078 in the default answer, as if the default line was a set of arguments given to a
2079 script shell. This means you may also use $* to repeat the whole default line,
2080 so you do not have to re-type everything to add something to the default.
2082 Everytime there is a substitution, you will have to confirm. If there is an
2083 error (e.g. an unmatched backtick), the default answer will remain unchanged
2084 and you will be prompted again.
2086 If you are in a hurry, you may run 'Configure -d'. This will bypass nearly all
2087 the questions and use the computed defaults (or the previous answers if there
2088 was already a config.sh file). Type 'Configure -h' for a list of options.
2089 You may also start interactively and then answer '& -d' at any prompt to turn
2090 on the non-interactive behaviour for the remainder of the execution.
2096 Much effort has been expended to ensure that this shell script will run on any
2097 Unix system. If despite that it blows up on yours, your best bet is to edit
2098 Configure and run it again. If you can't run Configure for some reason,
2099 you'll have to generate a config.sh file by hand. Whatever problems you
2100 have, let me (perlbug@perl.org) know how I blew it.
2102 This installation script affects things in two ways:
2104 1) it may do direct variable substitutions on some of the files included
2106 2) it builds a config.h file for inclusion in C programs. You may edit
2107 any of these files as the need arises after running this script.
2109 If you make a mistake on a question, there is no easy way to back up to it
2110 currently. The easiest thing to do is to edit config.sh and rerun all the SH
2111 files. Configure will offer to let you do this before it runs the SH files.
2114 dflt='Type carriage return to continue'
2116 case "$firsttime" in
2117 true) echo $user >>../.config/instruct;;
2121 : find out where common programs are
2123 echo "Locating common programs..." >&4
2136 if test -d \$dir/\$thing; then
2142 for thisthing in \$dir/\$thing; do
2143 : just loop through to pick last item
2145 if test -f \$thisthing; then
2148 elif test "X$_exe" != X -a -f \$thisthing$_exe; then
2151 elif test -f \$dir/\$thing.exe; then
2152 if test -n "$DJGPP"; then
2153 echo \$dir/\$thing.exe
2155 : on Eunice apparently
2208 pth=`echo $PATH | sed -e "s/$p_/ /g"`
2209 pth="$pth /lib /usr/lib"
2210 for file in $loclist; do
2214 if test -f "$xxx"; then
2217 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2218 xxx=`./loc $file $file $pth`
2221 '') xxx=`./loc $file $file $pth`;;
2222 *) xxx=`./loc $xxx $xxx $pth`;;
2224 eval $file=$xxx$_exe
2228 echo $file is in $xxx.
2231 echo $file is in $xxx.
2234 echo "I don't know where '$file' is, and my life depends on it." >&4
2235 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2241 echo "Don't worry if any of the following aren't found..."
2243 for file in $trylist; do
2247 if test -f "$xxx"; then
2250 echo "WARNING: no $xxx -- ignoring your setting for $file." >&4
2251 xxx=`./loc $file $file $pth`
2254 '') xxx=`./loc $file $file $pth`;;
2255 *) xxx=`./loc $xxx $xxx $pth`;;
2257 eval $file=$xxx$_exe
2261 echo $file is in $xxx.
2264 echo $file is in $xxx.
2267 echo "I don't see $file out there, $say."
2274 echo "Substituting grep for egrep."
2281 echo "Substituting cp for ln."
2290 echo "I can't find make or gmake, and my life depends on it." >&4
2291 echo "Go find a public domain implementation or fix your PATH setting!" >&4
2299 *) # We can't have osname yet.
2300 if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
2301 # Assume that gmake, if found, is definitely GNU make
2302 # and prefer it over the system make.
2303 echo "Substituting gmake for make."
2311 echo "Hopefully test is built into your sh."
2314 if `sh -c "PATH= test true" >/dev/null 2>&1`; then
2315 echo "Using the test built into your sh."
2323 echo "Hopefully echo is built into your sh."
2328 echo "Checking compatibility between $echo and builtin echo (if any)..." >&4
2329 $echo $n "hi there$c" >foo1
2330 echo $n "hi there$c" >foo2
2331 if cmp foo1 foo2 >/dev/null 2>&1; then
2332 echo "They are compatible. In fact, they may be identical."
2339 They are not compatible! You are probably running ksh on a non-USG system.
2340 I'll have to use $echo instead of the builtin, since Bourne shell doesn't
2341 have echo built in and we may have to run some Bourne shell scripts. That
2342 means I'll have to use '$n$c' to suppress newlines now. Life is ridiculous.
2345 $echo $n "The star should be here-->$c"
2355 cat <<'EOSC' >>trygcc
2360 int main(int argc, char *argv[]) {
2364 if $cc -o try $ccflags $ldflags try.c; then
2367 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2373 case "`$cc -v -c try.c 2>&1`" in
2376 if $test X"$trygcc" = Xyes; then
2377 if gcc -o try -c try.c; then
2379 echo "You seem to have a working gcc, though." >&4
2380 rp="Would you like to use it?"
2382 if $test -f myread; then
2385 if $test -f UU/myread; then
2388 echo "Cannot find myread, sorry. Aborting." >&2
2393 [yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
2394 if $test -f usethreads.cbu; then
2397 *** However, any setting of the C compiler flags (e.g. for thread support)
2398 *** has been lost. It may be necessary to pass -Dcc=gcc to Configure
2399 *** (together with e.g. -Dusethreads).
2415 cat <<'EOSC' >>checkcc
2420 int main(int argc, char *argv[]) {
2424 if $cc -o try $ccflags $ldflags try.c; then
2427 if $test X"$despair" = Xyes; then
2428 echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
2431 You need to find a working C compiler.
2432 Either (purchase and) install the C compiler supplied by your OS vendor,
2433 or for a free C compiler try http://gcc.gnu.org/
2434 I cannot continue any further, aborting.
2443 : determine whether symbolic links are supported
2446 if $ln -s blurfl sym > /dev/null 2>&1 ; then
2447 echo "Symbolic links are supported." >&4
2450 echo "Symbolic links are NOT supported." >&4
2455 : determine whether symbolic links are supported
2459 echo "Checking how to test for symbolic links..." >&4
2461 if $test "X$issymlink" = X; then
2463 '') sh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2464 *) $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
2466 if test $? = 0; then
2469 echo "Your builtin 'test -h' may be broken." >&4
2472 *) pth=`echo $PATH | sed -e "s/$p_/ /g"`
2475 if test -f "$p/$test"; then
2484 echo "Trying external '$test -h'." >&4
2485 issymlink="$test -h"
2486 if $test ! -h sym >/dev/null 2>&1; then
2487 echo "External '$test -h' is broken, too." >&4
2495 if $test "X$issymlink" = X; then
2496 if $test -L sym 2>/dev/null; then
2497 issymlink="$test -L"
2498 echo "The builtin '$test -L' worked." >&4
2501 if $test "X$issymlink" != X; then
2502 echo "You can test for symbolic links with '$issymlink'." >&4
2504 echo "I do not know how you can test for symbolic links." >&4
2508 *) echo "No symbolic links, so not testing for their testing..." >&4
2514 case "$mksymlinks" in
2517 ''|'.') echo "Cannot create symlinks in the original directory." >&4
2520 *) case "$lns:$issymlink" in
2521 *"ln"*" -s:"*"test -"?)
2522 echo "Creating the symbolic links..." >&4
2523 echo "(First creating the subdirectories...)" >&4
2525 awk '{print $1}' $src/MANIFEST | grep / | sed 's:/[^/]*$::' | sort -u | while true; do
2527 test -z "$directory" && break
2531 if test ! -d t/base; then
2532 echo "Failed to create the subdirectories. Aborting." >&4
2535 echo "(Then creating the symlinks...)" >&4
2536 awk '{print $1}' $src/MANIFEST | while true; do
2538 test -z "$filename" && break
2539 if test -f $filename; then
2540 if $issymlink $filename; then
2544 if test -f $filename; then
2545 echo "$filename already exists, not symlinking."
2547 ln -s $src/$filename $filename
2551 if test ! -f t/base/lex.t; then
2552 echo "Failed to create the symlinks (t/base/lex.t missing). Aborting." >&4
2557 *) echo "(I cannot figure out how to do symbolic links, ignoring mksymlinks)." >&4
2566 case "$usecrosscompile" in
2568 $echo "Cross-compiling..."
2571 *-*-gcc) # A cross-compiling gcc, probably.
2572 targetarch=`$echo $cc|$sed 's/-gcc$//'`
2574 # leave out ld, choosing it is more complex
2576 ranlib=$targetarch-ranlib
2577 $echo 'extern int foo;' > try.c
2578 set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
2580 if $test $# -gt 0; then
2582 incpth="`$echo $incpth|$sed 's/^ //'`"
2583 echo "Guessing incpth '$incpth'." >&4
2585 j="`$echo $i|$sed 's,/include$,/lib,'`"
2586 if $test -d $j; then
2590 libpth="`$echo $libpth|$sed 's/^ //'`"
2591 echo "Guessing libpth '$libpth'." >&4
2596 case "$targetarch" in
2597 '') echo "Targetarch not defined." >&4; croak=y ;;
2598 *) echo "Using targetarch $targetarch." >&4 ;;
2601 '') echo "Incpth not defined." >&4; croak=y ;;
2602 *) echo "Using incpth '$incpth'." >&4 ;;
2605 '') echo "Libpth not defined." >&4; croak=y ;;
2606 *) echo "Using libpth '$libpth'." >&4 ;;
2609 '') for i in $incpth; do
2610 if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
2612 echo "Guessing usrinc $usrinc." >&4
2617 '') echo "Usrinc not defined." >&4; croak=y ;;
2620 *) echo "Using usrinc $usrinc." >&4 ;;
2622 case "$targethost" in
2623 '') echo "Targethost not defined." >&4; croak=y ;;
2624 *) echo "Using targethost $targethost." >&4
2629 y) echo "Cannot continue, aborting." >&4; exit 1 ;;
2632 /*) run=$src/Cross/run
2633 targetmkdir=$src/Cross/mkdir
2635 from=$src/Cross/from
2637 *) pwd=`$test -f ../Configure & cd ..; pwd`
2639 targetmkdir=$pwd/Cross/mkdir
2641 from=$pwd/Cross/from
2644 case "$targetrun" in
2645 '') targetrun=ssh ;;
2650 case "$targetfrom" in
2651 '') targetfrom=scp ;;
2655 from=$from-$targetfrom
2656 case "$targetdir" in
2658 echo "Guessing targetdir $targetdir." >&4
2661 case "$targetuser" in
2663 echo "Guessing targetuser $targetuser." >&4
2666 case "$targetfrom" in
2670 case "$targetrun" in
2682 '') cwd=$targetdir ;;
2686 if $test ! -f \$exe.xok; then
2690 $targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
2693 *) echo "Unknown targetrun '$targetrun'" >&4
2697 case "$targetmkdir" in
2699 cat >$targetmkdir <<EOF
2701 $targetrun -l $targetuser $targethost "mkdir -p \$@"
2703 $chmod a+rx $targetmkdir
2705 *) echo "Unknown targetmkdir '$targetmkdir'" >&4
2717 $targetmkdir \`dirname \$f\`
2718 $targetto $q \$f $targetuser@$targethost:\$f || exit 1
2721 $targetmkdir $targetdir/\`dirname \$f\`
2722 $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
2735 $mkdir -p $targetdir/\`dirname \$f\`
2736 $cp \$f $targetdir/\$f || exit 1
2739 $targetmkdir $targetdir/\`dirname \$f\`
2740 $cp \$f $targetdir/\$f || exit 1
2747 *) echo "Unknown targetto '$targetto'" >&4
2751 case "$targetfrom" in
2758 $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
2763 cp) cat >$from <<EOF
2768 cp $targetdir/\$f . || exit 1
2773 *) echo "Unknown targetfrom '$targetfrom'" >&4
2777 if $test ! -f $run; then
2778 echo "Target 'run' script '$run' not found." >&4
2782 if $test ! -f $to; then
2783 echo "Target 'to' script '$to' not found." >&4
2787 if $test ! -f $from; then
2788 echo "Target 'from' script '$from' not found." >&4
2792 if $test ! -f $run -o ! -f $to -o ! -f $from; then
2796 Using '$run' for remote execution,
2797 and '$from' and '$to'
2798 for remote file transfer.
2804 usecrosscompile='undef'
2809 : see whether [:lower:] and [:upper:] are supported character classes
2811 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
2813 echo "Good, your tr supports [:lower:] and [:upper:] to convert case." >&4
2817 *) # There is a discontinuity in EBCDIC between 'I' and 'J'
2818 # (0xc9 and 0xd1), therefore that is a nice testing point.
2819 if test "X$up" = X -o "X$low" = X; then
2820 case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
2826 if test "X$up" = X -o "X$low" = X; then
2827 case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
2833 if test "X$up" = X -o "X$low" = X; then
2834 case "`echo IJ | od -x 2>/dev/null`" in
2836 echo "Hey, this might be EBCDIC." >&4
2837 if test "X$up" = X -o "X$low" = X; then
2838 case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
2839 ij) up='[A-IJ-RS-Z]'
2844 if test "X$up" = X -o "X$low" = X; then
2845 case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
2855 case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
2857 echo "Using $up and $low to convert case." >&4
2860 echo "I don't know how to translate letters from upper to lower case." >&4
2861 echo "Your tr is not acting any way I know of." >&4
2865 : set up the translation script tr, must be called with ./tr of course
2869 '[A-Z][a-z]') exec $tr '$up' '$low';;
2870 '[a-z][A-Z]') exec $tr '$low' '$up';;
2877 : Try to determine whether config.sh was made on this system
2878 case "$config_sh" in
2880 myuname=`$uname -a 2>/dev/null`
2881 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
2882 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
2883 # because the A-Z/a-z are not consecutive.
2884 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e 's/\///g' | \
2885 ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
2886 newmyuname="$myuname"
2888 case "$knowitall" in
2890 if test -f ../config.sh; then
2891 if $contains myuname= ../config.sh >/dev/null 2>&1; then
2892 eval "`grep myuname= ../config.sh`"
2894 if test "X$myuname" = "X$newmyuname"; then
2902 : Get old answers from old config file if Configure was run on the
2903 : same system, otherwise use the hints.
2906 if test -f config.sh; then
2908 rp="I see a config.sh file. Shall I use it to set the defaults?"
2911 n*|N*) echo "OK, I'll ignore it."
2912 mv config.sh config.sh.old
2913 myuname="$newmyuname"
2915 *) echo "Fetching default answers from your old config.sh file..." >&4
2923 : Older versions did not always set $sh. Catch re-use of such
2933 if test ! -f config.sh; then
2936 First time through, eh? I have some defaults handy for some systems
2937 that need some extra help getting the Configure answers right:
2940 (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/ /g' >&4
2942 : Half the following guesses are probably wrong... If you have better
2943 : tests or hints, please send them to perlbug@perl.org
2944 : The metaconfig authors would also appreciate a copy...
2945 $test -f /irix && osname=irix
2946 $test -f /xenix && osname=sco_xenix
2947 $test -f /dynix && osname=dynix
2948 $test -f /dnix && osname=dnix
2949 $test -f /lynx.os && osname=lynxos
2950 $test -f /unicos && osname=unicos && osvers=`$uname -r`
2951 $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
2952 $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
2953 $test -f /bin/mips && /bin/mips && osname=mips
2954 $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
2955 $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
2956 $test -d /usr/apollo/bin && osname=apollo
2957 $test -f /etc/saf/_sactab && osname=svr4
2958 $test -d /usr/include/minix && osname=minix
2959 $test -f /system/gnu_library/bin/ar.pm && osname=vos
2960 if $test -d /MachTen -o -d /MachTen_Folder; then
2962 if $test -x /sbin/version; then
2963 osvers=`/sbin/version | $awk '{print $2}' |
2964 $sed -e 's/[A-Za-z]$//'`
2965 elif $test -x /usr/etc/version; then
2966 osvers=`/usr/etc/version | $awk '{print $2}' |
2967 $sed -e 's/[A-Za-z]$//'`
2973 $test -f /sys/posix.dll &&
2974 $test -f /usr/bin/what &&
2975 set X `/usr/bin/what /sys/posix.dll` &&
2976 $test "$3" = UWIN &&
2980 if $test -f $uname; then
2988 umips) osname=umips ;;
2991 [23]100) osname=mips ;;
2992 next*) osname=next ;;
2994 tmp=`/bin/uname -X 2>/dev/null|awk '/3\.2v[45]/{ print $(NF) }'`
2995 if $test "$tmp" != "" -a "$3" = "3.2" -a -f '/etc/systemid'; then
2998 elif $test -f /etc/kconfig; then
3000 if test "$lns" = "$ln -s"; then
3002 elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
3004 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
3011 if test -n "$DJGPP"; then
3020 tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
3022 'not found') osvers="$4"."$3" ;;
3023 '<3240'|'<>3240') osvers=3.2.0 ;;
3024 '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
3025 '=3250'|'>3250') osvers=3.2.5 ;;
3029 bsd386) osname=bsd386
3032 cygwin*) osname=cygwin
3035 *dc.osx) osname=dcosx
3041 domainos) osname=apollo
3047 dynixptx*) osname=dynixptx
3048 osvers=`echo "$4"|sed 's/^v//'`
3050 freebsd) osname=freebsd
3052 genix) osname=genix ;;
3054 osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
3070 netbsd*) osname=netbsd
3073 news-os) osvers="$3"
3075 4*) osname=newsos4 ;;
3079 next*) osname=next ;;
3080 nonstop-ux) osname=nonstopux ;;
3081 openbsd) osname=openbsd
3084 POSIX-BC | posix-bc ) osname=posix-bc
3087 powerux | power_ux | powermax_os | powermaxos | \
3088 powerunix | power_unix) osname=powerux
3094 solaris) osname=solaris
3096 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3103 osvers=`echo $3 | $sed 's/^5/2/g'` ;;
3107 titanos) osname=titanos
3116 ultrix) osname=ultrix
3119 osf1|mls+) case "$5" in
3122 osvers=`sizer -v | awk '{print $3}' | tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
3125 *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
3128 hp*) osname=hp_osf1 ;;
3129 mips) osname=mips_osf1 ;;
3132 unixware) osname=svr5
3140 $2) case "$osname" in
3144 : svr4.x or possibly later
3154 if test -f /stand/boot ; then
3155 eval `grep '^INITPROG=[a-z/0-9]*$' /stand/boot`
3156 if test -n "$INITPROG" -a -f "$INITPROG"; then
3157 isesix=`strings -a $INITPROG|grep 'ESIX SYSTEM V/386 Release 4.0'`
3158 if test -n "$isesix"; then
3166 *) if test -f /etc/systemid; then
3168 set `echo $3 | $sed 's/\./ /g'` $4
3169 if $test -f $src/hints/sco_$1_$2_$3.sh; then
3171 elif $test -f $src/hints/sco_$1_$2.sh; then
3173 elif $test -f $src/hints/sco_$1.sh; then
3178 '') : Still unknown. Probably a generic Sys V.
3187 *) case "$osname" in
3188 '') : Still unknown. Probably a generic BSD.
3196 if test -f /vmunix -a -f $src/hints/news_os.sh; then
3197 (what /vmunix | UU/tr '[A-Z]' '[a-z]') > UU/kernel.what 2>&1
3198 if $contains news-os UU/kernel.what >/dev/null 2>&1; then
3201 $rm -f UU/kernel.what
3202 elif test -d c:/.; then
3209 case "$targetarch" in
3212 osname=`echo $targetarch|sed 's,^[^-]*-,,'`
3217 : Now look for a hint file osname_osvers, unless one has been
3218 : specified already.
3221 file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
3222 : Also try without trailing minor version numbers.
3223 xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
3224 xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
3225 xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
3226 xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
3229 *) case "$osvers" in
3232 *) if $test -f $src/hints/$file.sh ; then
3234 elif $test -f $src/hints/$xfile.sh ; then
3236 elif $test -f $src/hints/$xxfile.sh ; then
3238 elif $test -f $src/hints/$xxxfile.sh ; then
3240 elif $test -f $src/hints/$xxxxfile.sh ; then
3242 elif $test -f "$src/hints/${osname}.sh" ; then
3251 if $test -f Policy.sh ; then
3254 none) dflt="Policy" ;;
3255 *) dflt="Policy $dflt" ;;
3260 dflt=`echo $hintfile | $sed 's/\.sh$//'`
3264 if $test -f Policy.sh ; then
3267 There's also a Policy hint file available, which should make the
3268 site-specific (policy) questions easier to answer.
3275 You may give one or more space-separated answers, or "none" if appropriate.
3276 A well-behaved OS will have no hints, so answering "none" or just "Policy"
3277 is a good thing. DO NOT give a wrong version or a wrong OS.
3281 rp="Which of these apply, if any?"
3284 for file in $tans; do
3285 if $test X$file = XPolicy -a -f Policy.sh; then
3287 $cat Policy.sh >> UU/config.sh
3288 elif $test -f $src/hints/$file.sh; then
3289 . $src/hints/$file.sh
3290 $cat $src/hints/$file.sh >> UU/config.sh
3291 elif $test X"$tans" = X -o X"$tans" = Xnone ; then
3294 : Give one chance to correct a possible typo.
3295 echo "$file.sh does not exist"
3297 rp="hint to use instead?"
3299 for file in $ans; do
3300 if $test -f "$src/hints/$file.sh"; then
3301 . $src/hints/$file.sh
3302 $cat $src/hints/$file.sh >> UU/config.sh
3303 elif $test X$ans = X -o X$ans = Xnone ; then
3306 echo "$file.sh does not exist -- ignored."
3313 : Remember our hint file for later.
3314 if $test -f "$src/hints/$file.sh" ; then
3324 echo "Fetching default answers from $config_sh..." >&4
3328 cp $config_sh config.sh 2>/dev/null
3338 test "$override" && . ./optdef.sh
3340 : Restore computed paths
3341 for file in $loclist $trylist; do
3342 eval $file="\$_$file"
3347 Configure uses the operating system name and version to set some defaults.
3348 The default value is probably right if the name rings a bell. Otherwise,
3349 since spelling matters for me, either accept the default or answer "none"
3356 ''|' '|none) dflt=none ;;
3357 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/_.*$//'` ;;
3360 *) dflt="$osname" ;;
3362 rp="Operating system name?"
3366 *) osname=`echo "$ans" | $sed -e 's/[ ][ ]*/_/g' | ./tr '[A-Z]' '[a-z]'`;;
3372 ''|' '|none) dflt=none ;;
3373 *) dflt=`echo $hintfile | $sed -e 's/\.sh$//' -e 's/^[^_]*//'`
3374 dflt=`echo $dflt | $sed -e 's/^_//' -e 's/_/./g'`
3376 ''|' ') dflt=none ;;
3381 *) dflt="$osvers" ;;
3383 rp="Operating system version?"
3393 : who configured the system
3394 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
3395 cf_by=`(logname) 2>/dev/null`
3398 cf_by=`(whoami) 2>/dev/null`
3400 "") cf_by=unknown ;;
3404 : set up the script used to warn in case of inconsistency
3411 echo "*** WHOA THERE!!! ***" >&4
3412 echo " The $hint value for \$$var on this machine was \"$was\"!" >&4
3413 rp=" Keep the $hint value?"
3416 y) td=$was; tu=$was;;
3420 : function used to set $1 to $val
3421 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
3423 $define$undef) . ./whoa; eval "$var=\$td";;
3424 $undef$define) . ./whoa; eval "$var=\$tu";;
3425 *) eval "$var=$val";;
3428 case "$usethreads" in
3429 $define|true|[yY]*) dflt='y';;
3430 *) # Catch case where user specified ithreads or 5005threads but
3431 # forgot -Dusethreads (A.D. 4/2002)
3432 case "$useithreads$use5005threads" in
3433 *$define*) dflt='y' ;;
3440 Perl can be built to take advantage of threads on some systems.
3441 To do so, Configure can be run with -Dusethreads.
3443 Note that Perl built with threading support runs slightly slower
3444 and uses more memory than plain Perl. The current implementation
3445 is believed to be stable, but it is fairly new, and so should be
3446 treated with caution.
3448 If this doesn't make any sense to you, just accept the default '$dflt'.
3450 rp='Build a threading Perl?'
3453 y|Y) val="$define" ;;
3459 case "$usethreads" in
3463 Since release 5.6, Perl has had two different threading implementations,
3464 the newer interpreter-based version (ithreads) with one interpreter per
3465 thread, and the older 5.005 version (5005threads).
3466 The 5005threads version is effectively unmaintained and will probably be
3467 removed in Perl 5.10, so there should be no need to build a Perl using it
3468 unless needed for backwards compatibility with some existing 5.005threads
3472 : Default to ithreads unless overridden on command line or with
3475 case "$use5005threads" in
3476 $define|true|[yY]*) dflt='n';;
3478 case "$useithreads" in
3479 $undef|false|[nN]*) dflt='n';;
3481 rp='Use the newer interpreter-based ithreads?'
3484 y|Y) val="$define" ;;
3489 : Now set use5005threads to the opposite value.
3490 case "$useithreads" in
3491 $define) val="$undef" ;;
3498 useithreads="$undef"
3499 use5005threads="$undef"
3503 case "$useithreads$use5005threads" in
3507 You cannot have both the ithreads and the 5.005 threads enabled
3508 at the same time. Disabling the 5.005 threads since they are
3509 much less stable than the ithreads.
3512 use5005threads="$undef"
3516 case "$d_oldpthreads" in
3517 '') : Configure tests would be welcome here. For now, assume undef.
3519 *) val="$d_oldpthreads" ;;
3525 case "$usethreads" in
3526 "$define"|true|[yY]*)
3527 : Look for a hint-file generated 'call-back-unit'. If the
3528 : user has specified that a threading perl is to be built,
3529 : we may need to set or change some other defaults.
3530 if $test -f usethreads.cbu; then
3531 echo "Your platform has some specific hints for threaded builds, using them..."
3535 (Your platform doesn't have any specific hints for threaded builds.
3536 Assuming POSIX threads, then.)
3544 Perl can be built so that multiple Perl interpreters can coexist
3545 within the same Perl executable.
3548 case "$useithreads" in
3551 This multiple interpreter support is required for interpreter-based threads.
3555 *) case "$usemultiplicity" in
3556 $define|true|[yY]*) dflt='y';;
3560 echo "If this doesn't make any sense to you, just accept the default '$dflt'."
3561 rp='Build Perl for multiplicity?'
3564 y|Y) val="$define" ;;
3573 case "$usemorebits" in
3574 "$define"|true|[yY]*)
3575 use64bitint="$define"
3576 uselongdouble="$define"
3577 usemorebits="$define"
3579 *) usemorebits="$undef"
3583 : make some quick guesses about what we are up against
3585 $echo $n "Hmm... $c"
3595 $cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
3596 if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
3598 echo "Looks kind of like an OSF/1 system, but we'll see..."
3600 elif test `echo abc | $tr a-z A-Z` = Abc ; then
3601 xxx=`./loc addbib blurfl $pth`
3602 if $test -f $xxx; then
3603 echo "Looks kind of like a USG system with BSD features, but we'll see..."
3607 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
3608 echo "Looks kind of like an extended USG system, but we'll see..."
3610 echo "Looks kind of like a USG system, but we'll see..."
3614 elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
3615 echo "Looks kind of like a BSD system, but we'll see..."
3619 echo "Looks kind of like a Version 7 system, but we'll see..."
3622 case "$eunicefix" in
3625 There is, however, a strange, musty smell in the air that reminds me of
3626 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
3630 : it so happens the Eunice I know will not run shell scripts in Unix format
3634 echo "Congratulations. You aren't running Eunice."
3638 : Detect OS2. The p_ variable is set above in the Head.U unit.
3639 : Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
3640 : semicolon as a patch separator
3645 I have the feeling something is not exactly right, however...don't tell me...
3646 lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
3647 (Or you may be running DOS with DJGPP.)
3652 if test -f /xenix; then
3653 echo "Actually, this looks more like a XENIX system..."
3658 echo "It's not Xenix..."
3663 if test -f /venix; then
3664 echo "Actually, this looks more like a VENIX system..."
3671 echo "Nor is it Venix..."
3674 chmod +x bsd usg v7 osf1 eunice xenix venix os2
3675 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
3682 rp="Use which C compiler?"
3686 : See if they have not cc but they do have gcc
3688 : Look for a hint-file generated 'call-back-unit'. Now that the
3689 : user has specified the compiler, we may need to set or change some
3691 if $test -f cc.cbu; then
3697 echo "Checking for GNU cc in disguise and/or its version number..." >&4
3703 printf("%s\n", __VERSION__);
3705 printf("%s\n", "1");
3711 if $cc -o try $ccflags $ldflags try.c; then
3712 gccversion=`$run ./try`
3713 case "$gccversion" in
3714 '') echo "You are not using GNU cc." ;;
3715 *) echo "You are using GNU cc $gccversion."
3721 echo "*** WHOA THERE!!! ***" >&4
3722 echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4
3723 case "$knowitall" in
3725 echo " You'd better start hunting for one and let me know about it." >&4
3731 case "$gccversion" in
3732 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
3734 case "$gccversion" in
3735 '') gccosandvers='' ;;
3736 *) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
3737 gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
3739 case "$gccosandvers" in
3740 $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
3741 $osname$osvers) ;; # looking good
3742 $osname*) cat <<EOM >&4
3744 *** WHOA THERE!!! ***
3746 Your gcc has not been compiled for the exact release of
3747 your operating system ($gccosandvers versus $osname$osvers).
3749 In general it is a good idea to keep gcc synchronized with
3750 the operating system because otherwise serious problems
3751 may ensue when trying to compile software, like Perl.
3753 I'm trying to be optimistic here, though, and will continue.
3754 If later during the configuration and build icky compilation
3755 problems appear (headerfile conflicts being the most common
3756 manifestation), I suggest reinstalling the gcc to match
3757 your operating system release.
3761 *) gccosandvers='' ;; # failed to parse, better be silent
3770 : decide how portable to be. Allow command line overrides.
3771 case "$d_portable" in
3773 *) d_portable="$define" ;;
3776 : set up shell script to do ~ expansion
3782 echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
3785 if $test -f /bin/csh; then
3786 /bin/csh -f -c "glob \$1"
3791 name=\`$expr x\$1 : '..\([^/]*\)'\`
3792 dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
3793 if $test ! -d "\$dir"; then
3795 echo "\$me: can't locate home directory for: \$name" >&2
3800 echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
3816 : now set up to get a file name
3820 cat <<'EOSC' >>getfile
3836 expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
3837 fn=`echo $fn | sed 's/(.*)//'`
3843 loc_file=`expr $fn : '.*:\(.*\)'`
3844 fn=`expr $fn : '\(.*\):.*'`
3852 */*) fullpath=true;;
3861 *e*) exp_file=true;;
3864 *p*) nopath_ok=true;;
3869 *d*) type='Directory';;
3870 *l*) type='Locate';;
3875 Locate) what='File';;
3880 case "$d_portable" in
3888 while test "$type"; do
3893 true) rp="$rp (~name ok)";;
3896 if test -f UU/getfile.ok && \
3897 $contains "^$ans\$" UU/getfile.ok >/dev/null 2>&1
3916 value=`UU/filexp $ans`
3919 if test "$ans" != "$value"; then
3920 echo "(That expands to $value on this system.)"
3934 /*) value="$ansexp" ;;
3935 [a-zA-Z]:/*) value="$ansexp" ;;
3940 echo "I shall only accept a full path name, as in /bin/ls." >&4
3941 echo "Use a ! shell escape if you wish to check pathnames." >&4
3944 echo "Please give a full path name, starting with slash." >&4
3947 echo "Note that using ~name is ok provided it expands well." >&4
3960 for fp in $gfpth; do
3961 if test "X$fp" = X.; then
3966 if test -f "$pf"; then
3968 elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
3970 echo "($value is not a plain file, but that's ok.)"
3973 if test X"$type" = X; then
3980 for fp in $gfpth; do
3981 if test "X$fp" = X.; then
3986 direxp="$fp/$ansexp"
3988 if test -d "$direxp"; then
3996 if test -d "$ansexp"; then
3997 echo "(Looking for $loc_file in directory $value.)"
3998 value="$value/$loc_file"
3999 ansexp="$ansexp/$loc_file"
4001 if test -f "$ansexp"; then
4004 case "$nopath_ok" in
4005 true) case "$value" in
4007 *) echo "Assuming $value will be in people's path."
4023 if test "$fastread" = yes; then
4028 rp="$what $value doesn't exist. Use that name anyway?"
4047 test "X$gfpthkeep" != Xy && gfpth=""
4050 : What should the include directory be ?
4052 $echo $n "Hmm... $c"
4056 if $test -f /bin/mips && /bin/mips; then
4057 echo "Looks like a MIPS system..."
4058 $cat >usr.c <<'EOCP'
4059 #ifdef SYSTYPE_BSD43
4063 if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
4064 dflt='/bsd43/usr/include'
4068 mips_type='System V'
4070 $rm -f usr.c usr.out
4071 echo "and you're compiling with the $mips_type compiler and libraries."
4075 echo "Doesn't look like a MIPS system."
4085 case "$xxx_prompt" in
4088 rp='Where are the include files you want to use?'
4096 : see how we invoke the C preprocessor
4098 echo "Now, how can we feed standard input to your C preprocessor..." >&4
4099 cat <<'EOT' >testcpp.c
4105 if test ! -f cppstdin; then
4106 if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
4107 # AIX cc -E doesn't show the absolute headerfile
4108 # locations but we'll cheat by using the -M flag.
4109 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
4111 echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
4114 echo "Keeping your $hint cppstdin wrapper."
4117 wrapper=`pwd`/cppstdin
4121 if $test "X$cppstdin" != "X" && \
4122 $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
4123 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4125 echo "You used to use $cppstdin $cppminus so we'll use that again."
4127 '') echo "But let's see if we can live without a wrapper..." ;;
4129 if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
4130 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4132 echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
4135 echo "(However, $cpprun $cpplast does not work, let's see...)"
4143 echo "Good old $cppstdin $cppminus does not seem to be of any help..."
4150 elif echo '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"' -E -" will work...'; \
4157 $cc -E - <testcpp.c >testcpp.out 2>&1; \
4158 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4159 echo "Yup, it does."
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 "Yipee, that works!"
4168 elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
4169 $cc -P - <testcpp.c >testcpp.out 2>&1; \
4170 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4171 echo "At long last!"
4174 elif echo 'No such luck, maybe "'$cpp'" will work...'; \
4175 $cpp <testcpp.c >testcpp.out 2>&1; \
4176 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4180 elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
4181 $cpp - <testcpp.c >testcpp.out 2>&1; \
4182 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4183 echo "Hooray, it works! I was beginning to wonder."
4186 elif echo 'Uh-uh. Time to get fancy. Trying a wrapper...'; \
4187 $wrapper <testcpp.c >testcpp.out 2>&1; \
4188 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4194 rp="No dice. I can't find a C preprocessor. Name one:"
4198 $x_cpp <testcpp.c >testcpp.out 2>&1
4199 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
4200 echo "OK, that will do." >&4
4202 echo "Sorry, I can't get that to work. Go find one and rerun Configure." >&4
4217 echo "Perhaps can we force $cc -E using a wrapper..."
4218 if $wrapper <testcpp.c >testcpp.out 2>&1; \
4219 $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
4225 echo "Nope, we'll have to live without it..."
4239 "$wrapper"|'cppstdin') ;;
4240 *) $rm -f $wrapper;;
4242 $rm -f testcpp.c testcpp.out
4244 : Set private lib path
4247 plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
4252 '') dlist="$loclibpth $plibpth $glibpth";;
4253 *) dlist="$libpth";;
4256 : Now check and see which directories actually exist, avoiding duplicates
4260 if $test -d $xxx; then
4263 *) libpth="$libpth $xxx";;
4269 Some systems have incompatible or broken versions of libraries. Among
4270 the directories listed in the question below, please remove any you
4271 know not to be holding relevant libraries, and add any that are needed.
4272 Say "none" for none.
4283 rp="Directories to use for library searches?"
4290 : compute shared library extension
4293 if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
4303 On some systems, shared libraries may be available. Answer 'none' if
4304 you want to suppress searching of shared libraries for the remainder
4305 of this configuration.
4308 rp='What is the file extension used for shared libraries?'
4312 : Define several unixisms.
4313 : Hints files or command line option can be used to override them.
4314 : The convoluted testing is in case hints files set either the old
4317 '') case "$exe_ext" in
4319 *) _exe="$exe_ext" ;;
4324 '') case "$lib_ext" in
4331 '') case "$obj_ext" in
4338 '') case "$path_sep" in
4349 : Which makefile gets called first. This is used by make depend.
4350 case "$firstmakefile" in
4351 '') firstmakefile='makefile';;
4355 $define|true|[yY]*) dflt='y';;
4360 Perl can be built to use the SOCKS proxy protocol library. To do so,
4361 Configure must be run with -Dusesocks. If you use SOCKS you also need
4362 to use the PerlIO abstraction layer, this will be implicitly selected.
4364 If this doesn't make any sense to you, just accept the default '$dflt'.
4366 rp='Build Perl for SOCKS?'
4369 y|Y) val="$define" ;;
4376 $define|true|[yY]*) useperlio="$define";;
4379 : Looking for optional libraries
4381 echo "Checking for optional libraries..." >&4
4386 case "$libswanted" in
4387 '') libswanted='c_s';;
4390 "$define") libswanted="$libswanted socks5 socks5_sh" ;;
4396 for thisdir in $libpth $xlibpth; do
4397 test -d $thisdir && libspath="$libspath $thisdir"
4399 for thislib in $libswanted; do
4400 for thisdir in $libspath; do
4402 if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
4403 xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|sed -n '$p'`
4404 $test -f "$xxx" && eval $libscheck
4405 $test -f "$xxx" && libstyle=shared
4407 if test ! -f "$xxx"; then
4408 xxx=$thisdir/lib$thislib.$so
4409 $test -f "$xxx" && eval $libscheck
4410 $test -f "$xxx" && libstyle=shared
4412 if test ! -f "$xxx"; then
4413 xxx=$thisdir/lib$thislib$_a
4414 $test -f "$xxx" && eval $libscheck
4415 $test -f "$xxx" && libstyle=static
4417 if test ! -f "$xxx"; then
4418 xxx=$thisdir/$thislib$_a
4419 $test -f "$xxx" && eval $libscheck
4420 $test -f "$xxx" && libstyle=static
4422 if test ! -f "$xxx"; then
4423 xxx=$thisdir/lib${thislib}_s$_a
4424 $test -f "$xxx" && eval $libscheck
4425 $test -f "$xxx" && libstyle=static
4426 $test -f "$xxx" && thislib=${thislib}_s
4428 if test ! -f "$xxx"; then
4429 xxx=$thisdir/Slib$thislib$_a
4430 $test -f "$xxx" && eval $libscheck
4431 $test -f "$xxx" && libstyle=static
4433 if $test -f "$xxx"; then
4435 shared) echo "Found -l$thislib (shared)." ;;
4436 static) echo "Found -l$thislib." ;;
4437 *) echo "Found -l$thislib ($libstyle)." ;;
4441 *) dflt="$dflt -l$thislib"
4442 libsfound="$libsfound $xxx"
4444 libsfiles="$libsfiles $yyy"
4445 yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
4446 case " $libsdirs " in
4448 *) libsdirs="$libsdirs $yyy" ;;
4455 if $test ! -f "$xxx"; then
4456 echo "No -l$thislib."
4467 ' '|'') dflt='none';;
4472 In order to compile $package on your machine, a number of libraries
4473 are usually needed. Include any other special libraries here as well.
4474 Say "none" for none. The default list is almost always right.
4478 rp="What libraries to use?"
4485 : determine optimization, if desired, or use for debug flag also
4487 ' '|$undef) dflt='none';;
4489 *) dflt="$optimize";;
4493 By default, $package compiles with the -O flag to use the optimizer.
4494 Alternately, you might want to use the symbolic debugger, which uses
4495 the -g flag (on traditional Unix systems). Either flag can be
4496 specified here. To use neither flag, specify the word "none".
4499 rp="What optimizer/debugger flag should be used?"
4503 'none') optimize=" ";;
4507 : We will not override a previous value, but we might want to
4508 : augment a hint file
4510 default|recommended)
4511 case "$gccversion" in
4512 1*) dflt='-fpcc-struct-return' ;;
4515 *-g*) dflt="$dflt -DDEBUGGING";;
4517 case "$gccversion" in
4518 2*) if test -d /etc/conf/kconfig.d &&
4519 $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
4525 case "$gccversion" in
4529 echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
4530 echo 'int main(void) { return 0; }' > gcctest.c
4531 if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
4532 echo "Yes, it does." 2>&1
4535 echo "Leaving current flags $ccflags alone." 2>&1
4537 *) dflt="$dflt -fno-strict-aliasing" ;;
4540 echo "Nope, it doesn't, but that's ok." 2>&1
4547 case "$mips_type" in
4548 *BSD*|'') inclwanted="$locincpth $usrinc";;
4549 *) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
4551 for thisincl in $inclwanted; do
4552 if $test -d $thisincl; then
4553 if $test x$thisincl != x$usrinc; then
4555 *" -I$thisincl "*);;
4556 *) dflt="$dflt -I$thisincl ";;
4562 inctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
4564 elif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
4572 *) dflt="$dflt -D$2";;
4576 set signal.h LANGUAGE_C; eval $inctest
4580 ccflags="$ccflags -DSOCKS"
4585 default|recommended) dflt="$ccflags $dflt" ;;
4586 *) dflt="$ccflags";;
4595 Your C compiler may want other flags. For this question you should include
4596 -I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
4597 but you should NOT include libraries or ld flags like -lwhatever. If you
4598 want $package to honor its debug switch, you should include -DDEBUGGING here.
4599 Your C compiler might also need additional flags, such as -D_POSIX_SOURCE.
4601 To use no flags, specify the word "none".
4607 rp="Any additional cc flags?"
4614 : the following weeds options from ccflags that are of no interest to cpp
4616 '') cppflags="$ccflags" ;;
4617 *) cppflags="$cppflags $ccflags" ;;
4619 case "$gccversion" in
4620 1*) cppflags="$cppflags -D__GNUC__"
4622 case "$mips_type" in
4624 *BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
4630 echo "Let me guess what the preprocessor flags are..." >&4
4644 *) ftry="$previous $flag";;
4646 if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
4647 >cpp1.out 2>/dev/null && \
4648 $cpprun -DLFRULB=bar $cppflags $ftry $cpplast <cpp.c \
4649 >cpp2.out 2>/dev/null && \
4650 $contains 'foo.*xx.*bar' cpp1.out >/dev/null 2>&1 && \
4651 $contains 'foo.*xx.*bar' cpp2.out >/dev/null 2>&1
4653 cppflags="$cppflags $ftry"
4663 *-*) echo "They appear to be: $cppflags";;
4665 $rm -f cpp.c cpp?.out
4669 : flags used in final linking phase
4671 '') if ./venix; then
4677 *-posix*) dflt="$dflt -posix" ;;
4680 *) dflt="$ldflags";;
4683 : Try to guess additional flags to pick up local libraries.
4684 for thislibdir in $libpth; do
4685 case " $loclibpth " in
4688 *"-L$thislibdir "*) ;;
4689 *) dflt="$dflt -L$thislibdir" ;;
4701 Your C linker may need flags. For this question you should
4702 include -L/whatever and any other flags used by the C linker, but you
4703 should NOT include libraries like -lwhatever.
4705 Make sure you include the appropriate -L/path flags if your C linker
4706 does not normally search all of the directories you specified above,
4709 To use no flags, specify the word "none".
4713 rp="Any additional ld flags (NOT including libraries)?"
4719 rmlist="$rmlist pdp11"
4723 echo "Checking your choice of C compiler and flags for coherency..." >&4
4724 $cat > try.c <<'EOF'
4726 int main() { printf("Ok\n"); exit(0); }
4728 set X $cc -o try $optimize $ccflags $ldflags try.c $libs
4730 $cat >try.msg <<'EOM'
4731 I've tried to compile and run the following simple program:
4734 $cat try.c >> try.msg
4736 $cat >> try.msg <<EOM
4743 and I got the following output:
4747 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
4748 if $sh -c "$run ./try" >>try.msg 2>&1; then
4752 *) echo 'The program compiled OK, but produced no output.' >> try.msg
4755 cat >> try.msg <<'EOQS'
4756 If $libs contains -lsfio, and sfio is mis-configured, then it
4757 sometimes (apparently) runs and exits with a 0 status, but with no
4758 output! It may have to do with sfio's use of _exit vs. exit.
4761 rp="You have a big problem. Shall I abort Configure"
4768 echo "The program compiled OK, but exited with status $?." >>try.msg
4769 rp="You have a problem. Shall I abort Configure"
4773 echo "I can't compile the test program." >>try.msg
4774 rp="You have a BIG problem. Shall I abort Configure"
4780 case "$knowitall" in
4782 echo "(The supplied flags or libraries might be incorrect.)"
4790 *) echo "Ok. Stopping Configure." >&4
4795 n) echo "OK, that should do.";;
4797 $rm -f try try.* core
4799 : define a shorthand compile call
4803 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
4804 : define a shorthand compile call for compilations that should be ok.
4808 $cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
4810 : check for lengths of integral types
4814 echo "Checking to see how big your integers are..." >&4
4815 $cat >try.c <<'EOCP'
4819 printf("intsize=%d;\n", (int)sizeof(int));
4820 printf("longsize=%d;\n", (int)sizeof(long));
4821 printf("shortsize=%d;\n", (int)sizeof(short));
4826 if eval $compile_ok && $run ./try > /dev/null; then
4828 echo "Your integers are $intsize bytes long."
4829 echo "Your long integers are $longsize bytes long."
4830 echo "Your short integers are $shortsize bytes long."
4834 Help! I can't compile and run the intsize test program: please enlighten me!
4835 (This is probably a misconfiguration in your system or libraries, and
4836 you really ought to fix it. Still, I'll try anyway.)
4840 rp="What is the size of an integer (in bytes)?"
4844 rp="What is the size of a long integer (in bytes)?"
4848 rp="What is the size of a short integer (in bytes)?"
4856 : check for long long
4858 echo "Checking to see if you have long long..." >&4
4859 echo 'int main() { long long x = 7; return 0; }' > try.c
4861 if eval $compile; then
4863 echo "You have long long."
4866 echo "You do not have long long."
4872 : check for length of long long
4873 case "${d_longlong}${longlongsize}" in
4876 echo "Checking to see how big your long longs are..." >&4
4877 $cat >try.c <<'EOCP'
4881 printf("%d\n", (int)sizeof(long long));
4886 if eval $compile_ok; then
4887 longlongsize=`$run ./try`
4888 echo "Your long longs are $longlongsize bytes long."
4892 echo "(I can't seem to compile the test program. Guessing...)"
4893 rp="What is the size of a long long (in bytes)?"
4897 if $test "X$longsize" = "X$longlongsize"; then
4898 echo "(That isn't any different from an ordinary long.)"
4904 : determine filename position in cpp output
4906 echo "Computing filename position in cpp output for #include directives..." >&4
4908 vos) testaccess=-e ;;
4911 echo '#include <stdio.h>' > foo.c
4914 $cppstdin $cppflags $cppminus <foo.c 2>/dev/null | \
4915 $grep '^[ ]*#.*stdio\.h' | \
4916 while read cline; do
4919 while $test \$# -gt 0; do
4920 if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
4925 pos=\`expr \$pos + 1\`
4937 *) pos="${fieldn}th";;
4939 echo "Your cpp writes the filename in the $pos field of the line."
4942 vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
4945 : locate header file
4950 for usrincdir in $usrinc
4952 if test -f \$usrincdir/\$wanted; then
4953 echo "\$usrincdir/\$wanted"
4957 awkprg='{ print \$$fieldn }'
4958 echo "#include <\$wanted>" > foo\$\$.c
4959 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
4960 $cppfilter $grep "^[ ]*#.*\$wanted" | \
4961 while read cline; do
4962 name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
4964 *[/\\\\]\$wanted) echo "\$name"; exit 1;;
4965 *[\\\\/]\$wanted) echo "\$name"; exit 1;;
4970 # status = 0: grep returned 0 lines, case statement not executed
4971 # status = 1: headerfile found
4972 # status = 2: while loop executed, no headerfile found
4976 if test \$status -eq 1; then
4983 : define an alternate in-header-list? function
4984 inhdr='echo " "; td=$define; tu=$undef; yyy=$@;
4985 cont=true; xxf="echo \"<\$1> found.\" >&4";
4986 case $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
4987 *) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
4989 case $# in 4) instead=instead;; *) instead="at last";; esac;
4990 while $test "$cont"; do
4992 var=$2; eval "was=\$$2";
4993 if $test "$xxx" && $test -r "$xxx";
4995 eval "case \"\$$var\" in $undef) . ./whoa; esac"; eval "$var=\$td";
4998 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu"; fi;
4999 set $yyy; shift; shift; yyy=$@;
5000 case $# in 0) cont="";;
5001 2) xxf="echo \"but I found <\$1> $instead.\" >&4";
5002 xxnf="echo \"and I did not find <\$1> either.\" >&4";;
5003 *) xxf="echo \"but I found <\$1\> instead.\" >&4";
5004 xxnf="echo \"there is no <\$1>, ...\" >&4";;
5008 do set $yyy; var=$2; eval "was=\$$2";
5009 eval "case \"\$$var\" in $define) . ./whoa; esac"; eval "$var=\$tu";
5010 set $yyy; shift; shift; yyy=$@;
5013 : see if inttypes.h is available
5014 : we want a real compile instead of Inhdr because some systems
5015 : have an inttypes.h which includes non-existent headers
5018 #include <inttypes.h>
5020 static int32_t foo32 = 0x12345678;
5024 if eval $compile; then
5025 echo "<inttypes.h> found." >&4
5028 echo "<inttypes.h> NOT found." >&4
5037 echo "Checking to see if you have int64_t..." >&4
5039 #include <sys/types.h>
5040 #$i_inttypes I_INTTYPES
5042 #include <inttypes.h>
5044 int main() { int64_t x = 7; }
5047 if eval $compile; then
5049 echo "You have int64_t."
5052 echo "You do not have int64_t."
5060 echo "Checking which 64-bit integer type we could use..." >&4
5066 val='"unsigned int"'
5071 *) case "$longsize" in
5075 val='"unsigned long"'
5080 *) case "$d_longlong:$longlongsize" in
5085 val='"unsigned long long"'
5090 *) case "$d_int64_t" in
5109 '') echo "Alas, no 64-bit integer types in sight." >&4
5112 *) echo "We could use '$quadtype' for 64-bit integers." >&4
5118 case "$uselonglong" in
5119 "$define"|true|[yY]*)
5122 *** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
5124 use64bitint="$define"
5127 case "$use64bits" in
5128 "$define"|true|[yY]*)
5131 *** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
5133 use64bitint="$define"
5136 case "$use64bitints" in
5137 "$define"|true|[yY]*)
5140 *** There is no Configure -Duse64bitints, using -Duse64bitint instead.
5142 use64bitint="$define"
5145 case "$use64bitsint" in
5146 "$define"|true|[yY]*)
5149 *** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
5151 use64bitint="$define"
5154 case "$uselonglongs" in
5155 "$define"|true|[yY]*)
5158 *** There is no Configure -Duselonglongs, using -Duse64bitint instead.
5160 use64bitint="$define"
5163 case "$use64bitsall" in
5164 "$define"|true|[yY]*)
5167 *** There is no Configure -Duse64bitsall, using -Duse64bitall instead.
5169 use64bitall="$define"
5174 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
5176 case "$use64bitall" in
5177 "$define"|true|[yY]*) use64bitint="$define" ;;
5183 You have natively 64-bit long integers.
5187 *) case "$use64bitint" in
5188 "$define"|true|[yY]*) dflt='y';;
5197 Perl can be built to take advantage of 64-bit integer types
5198 on some systems. To do so, Configure can be run with -Duse64bitint.
5199 Choosing this option will most probably introduce binary incompatibilities.
5201 If this doesn't make any sense to you, just accept the default '$dflt'.
5202 (The default has been chosen based on your configuration.)
5204 rp='Try to use 64-bit integers, if available?'
5207 [yY]*) val="$define" ;;
5215 case "$use64bitall" in
5216 "$define"|true|[yY]*) dflt='y' ;;
5217 *) case "$longsize" in
5225 You may also choose to try maximal 64-bitness. It means using as much
5226 64-bitness as possible on the platform. This in turn means even more
5227 binary incompatibilities. On the other hand, your platform may not
5228 have any more 64-bitness available than what you already have chosen.
5230 If this doesn't make any sense to you, just accept the default '$dflt'.
5231 (The default has been chosen based on your configuration.)
5233 rp='Try to use maximal 64-bit support, if available?'
5236 [yY]*) val="$define" ;;
5241 case "$use64bitall" in
5243 case "$use64bitint" in
5247 Since you have chosen a maximally 64-bit build, I'm also turning on
5248 the use of 64-bit integers.
5250 use64bitint="$define" ;;
5255 case "$use64bitint" in
5256 "$define"|true|[yY]*)
5257 : Look for a hint-file generated 'call-back-unit'. If the
5258 : user has specified that a 64-bit perl is to be built,
5259 : we may need to set or change some other defaults.
5260 if $test -f use64bitint.cbu; then
5261 echo "Your platform has some specific hints for 64-bit integers, using them..."
5265 4) case "$archname64" in
5266 '') archname64=64int ;;
5273 case "$use64bitall" in
5274 "$define"|true|[yY]*)
5275 : Look for a hint-file generated 'call-back-unit'. If the
5276 : user has specified that a maximally 64-bit perl is to be built,
5277 : we may need to set or change some other defaults.
5278 if $test -f use64bitall.cbu; then
5279 echo "Your platform has some specific hints for 64-bit builds, using them..."
5283 4) case "$archname64" in
5284 ''|64int) archname64=64all ;;
5292 echo "Checking for GNU C Library..." >&4
5305 if eval $compile_ok && $run ./try; then
5307 echo "You are using the GNU C Library"
5310 echo "You are not using the GNU C Library"
5316 : see if nm is to be used to determine whether a symbol is defined or not
5320 case "$d_gnulibc" in
5323 echo "nm probably won't work on the GNU C Library." >&4
5329 if $test "$osname" = aix -a ! -f /lib/syscalls.exp; then
5331 echo "Whoops! This is an AIX system without /lib/syscalls.exp!" >&4
5332 echo "'nm' won't be sufficient on this sytem." >&4
5338 '') dflt=`$egrep 'inlibc|csym' $rsrc/Configure | wc -l 2>/dev/null`
5339 if $test $dflt -gt 20; then
5349 true|$define) dflt=y;;
5356 I can use $nm to extract the symbols from your C libraries. This
5357 is a time consuming task which may generate huge output on the disk (up
5358 to 3 megabytes) but that should make the symbols extraction faster. The
5359 alternative is to skip the 'nm' extraction part and to compile a small
5360 test program instead to determine whether each symbol is present. If
5361 you have a fast C compiler and/or if your 'nm' output cannot be parsed,
5362 this may be the best solution.
5364 You probably shouldn't let me use 'nm' if you are using the GNU C Library.
5367 rp="Shall I use $nm to extract C symbols from the libraries?"
5370 [Nn]*) usenm=false;;
5379 : nm options which may be necessary
5381 '') if $test -f /mach_boot; then
5383 elif $test -d /usr/ccs/lib; then
5384 nm_opt='-p' # Solaris (and SunOS?)
5385 elif $test -f /dgux; then
5387 elif $test -f /lib64/rld; then
5388 nm_opt='-p' # 64-bit Irix
5394 : nm options which may be necessary for shared libraries but illegal
5395 : for archive libraries. Thank you, Linux.
5396 case "$nm_so_opt" in
5397 '') case "$myuname" in
5399 if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
5400 nm_so_opt='--dynamic'
5409 : get list of predefined functions in a handy place
5414 *-lc_s*) libc=`./loc libc_s$_a $libc $libpth`
5420 *) for thislib in $libs; do
5423 : Handle C library specially below.
5426 thislib=`echo $thislib | $sed -e 's/^-l//'`
5427 if try=`./loc lib$thislib.$so.'*' X $libpth`; $test -f "$try"; then
5429 elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
5431 elif try=`./loc lib$thislib$_a X $libpth`; $test -f "$try"; then
5433 elif try=`./loc $thislib$_a X $libpth`; $test -f "$try"; then
5435 elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
5437 elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
5439 elif try=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$try"; then
5444 libnames="$libnames $try"
5446 *) libnames="$libnames $thislib" ;;
5455 for xxx in $libpth; do
5456 $test -r $1 || set $xxx/libc.$so
5457 : The messy sed command sorts on library version numbers.
5459 set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
5460 tr ' ' $trnl | egrep -v '\.[A-Za-z]*$' | $sed -e '
5462 s/[0-9][0-9]*/0000&/g
5463 s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
5466 $sort | $sed -e 's/^.* //'`
5469 $test -r $1 || set /usr/ccs/lib/libc.$so
5470 $test -r $1 || set /lib/libsys_s$_a
5476 if $test -r "$1"; then
5477 echo "Your (shared) C library seems to be in $1."
5479 elif $test -r /lib/libc && $test -r /lib/clib; then
5480 echo "Your C library seems to be in both /lib/clib and /lib/libc."
5482 libc='/lib/clib /lib/libc'
5483 if $test -r /lib/syslib; then
5484 echo "(Your math library is in /lib/syslib.)"
5485 libc="$libc /lib/syslib"
5487 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5488 echo "Your C library seems to be in $libc, as you said before."
5489 elif $test -r $incpath/usr/lib/libc$_a; then
5490 libc=$incpath/usr/lib/libc$_a;
5491 echo "Your C library seems to be in $libc. That's fine."
5492 elif $test -r /lib/libc$_a; then
5494 echo "Your C library seems to be in $libc. You're normal."
5496 if tans=`./loc libc$_a blurfl/dyick $libpth`; $test -r "$tans"; then
5498 elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
5499 libnames="$libnames "`./loc clib blurfl/dyick $libpth`
5500 elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
5502 elif tans=`./loc Slibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5504 elif tans=`./loc Mlibc$_a blurfl/dyick $xlibpth`; $test -r "$tans"; then
5507 tans=`./loc Llibc$_a blurfl/dyick $xlibpth`
5509 if $test -r "$tans"; then
5510 echo "Your C library seems to be in $tans, of all places."
5516 if $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
5520 If the guess above is wrong (which it might be if you're using a strange
5521 compiler, or your machine supports multiple models), you can override it here.
5526 echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
5528 I can't seem to find your C library. I've looked in the following places:
5531 $sed 's/^/ /' libpath
5534 None of these seems to contain your C library. I need to get its name...
5539 rp='Where is your C library?'
5544 echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
5545 set X `cat libnames`
5548 case $# in 1) xxx=file; esac
5549 echo "Extracting names from the following $xxx for later perusal:" >&4
5551 $sed 's/^/ /' libnames >&4
5553 $echo $n "This may take a while...$c" >&4
5557 *$so*) $nm $nm_so_opt $nm_opt $file 2>/dev/null;;
5558 *) $nm $nm_opt $file 2>/dev/null;;
5563 $grep fprintf libc.tmp > libc.ptf
5564 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
5565 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
5567 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx *_[_.]*//p' -e 's/^.* $xxx *//p'";\
5569 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5571 elif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
5573 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5575 elif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
5577 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5579 elif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
5581 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5583 elif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
5585 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5587 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
5589 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5591 elif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
5592 -e '/ file/d' -e 's/^\([^ ]*\).*/\1/p'";\
5594 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5596 elif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
5598 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5600 elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
5602 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5604 elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
5606 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5608 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
5610 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5612 elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
5614 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5616 elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
5618 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5620 elif com="sed -n -e 's/^__.*//' -e 's/[ ]*D[ ]*[0-9]*.*//p'";\
5622 $contains '^fprintf$' libc.list >/dev/null 2>&1; then
5625 $nm -p $* 2>/dev/null >libc.tmp
5626 $grep fprintf libc.tmp > libc.ptf
5627 if com="$sed -n -e 's/^.* [ADTSIW] *_[_.]*//p' -e 's/^.* [ADTSIW] //p'";\
5628 eval $xscan; $contains '^fprintf$' libc.list >/dev/null 2>&1
5634 echo "$nm didn't seem to work right. Trying $ar instead..." >&4
5636 if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
5637 for thisname in $libnames $libc; do
5638 $ar t $thisname >>libc.tmp
5640 $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
5642 elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
5643 # Repeat libc to extract forwarders to DLL entries too
5644 for thisname in $libnames $libc; do
5645 $ar tv $thisname >>libc.tmp
5646 # Revision 50 of EMX has bug in $ar.
5647 # it will not extract forwarders to DLL entries
5648 # Use emximp which will extract exactly them.
5649 emximp -o tmp.imp $thisname \
5651 $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
5652 < tmp.imp >>libc.tmp
5655 $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
5658 echo "$ar didn't seem to work right." >&4
5659 echo "Maybe this is a Cray...trying bld instead..." >&4
5660 if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
5662 for thisname in $libnames; do
5664 $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" >>libc.list
5665 $ar t $thisname >>libc.tmp
5669 echo "That didn't work either. Giving up." >&4
5676 if $test -f /lib/syscalls.exp; then
5678 echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
5679 $sed -n 's/^\([^ ]*\)[ ]*syscall[0-9]*[ ]*$/\1/p' /lib/syscalls.exp >>libc.list
5683 $rm -f libnames libpath
5685 : is a C symbol defined?
5688 -v) tf=libc.tmp; tc=""; tdc="";;
5689 -a) tf=libc.tmp; tc="[0]"; tdc="[]";;
5690 *) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
5693 case "$reuseval-$4" in
5695 true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
5701 if $contains $tlook $tf >/dev/null 2>&1;
5706 echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
5707 if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
5715 $define) tval=true;;
5721 : define an is-in-libc? function
5722 inlibc='echo " "; td=$define; tu=$undef;
5723 sym=$1; var=$2; eval "was=\$$2";
5725 case "$reuseval$was" in
5735 echo "$sym() found." >&4;
5736 case "$was" in $undef) . ./whoa; esac; eval "$var=\$td";;
5738 echo "$sym() NOT found." >&4;
5739 case "$was" in $define) . ./whoa; esac; eval "$var=\$tu";;
5743 $define) echo "$sym() found." >&4;;
5744 *) echo "$sym() NOT found." >&4;;
5748 : see if sqrtl exists
5752 : check for length of double
5754 case "$doublesize" in
5756 echo "Checking to see how big your double precision numbers are..." >&4
5757 $cat >try.c <<'EOCP'
5761 printf("%d\n", (int)sizeof(double));
5766 if eval $compile_ok; then
5767 doublesize=`$run ./try`
5768 echo "Your double is $doublesize bytes long."
5771 echo "(I can't seem to compile the test program. Guessing...)"
5772 rp="What is the size of a double precision number (in bytes)?"
5780 : check for long doubles
5782 echo "Checking to see if you have long double..." >&4
5783 echo 'int main() { long double x = 7.0; }' > try.c
5785 if eval $compile; then
5787 echo "You have long double."
5790 echo "You do not have long double."
5796 : check for length of long double
5797 case "${d_longdbl}${longdblsize}" in
5800 echo "Checking to see how big your long doubles are..." >&4
5801 $cat >try.c <<'EOCP'
5805 printf("%d\n", sizeof(long double));
5810 if eval $compile; then
5811 longdblsize=`$run ./try`
5812 echo "Your long doubles are $longdblsize bytes long."
5816 echo "(I can't seem to compile the test program. Guessing...)" >&4
5817 rp="What is the size of a long double (in bytes)?"
5821 if $test "X$doublesize" = "X$longdblsize"; then
5822 echo "(That isn't any different from an ordinary double.)"
5830 if $test X"$d_longdbl" = X"$define"; then
5832 echo "Checking how to print long doubles..." >&4
5834 if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
5835 $cat >try.c <<'EOCP'
5836 #include <sys/types.h>
5840 printf("%.3f\n", d);
5844 if eval $compile; then
5848 sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
5849 sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
5850 echo "We will use %f."
5856 if $test X"$sPRIfldbl" = X; then
5857 $cat >try.c <<'EOCP'
5858 #include <sys/types.h>
5861 long double d = 123.456;
5862 printf("%.3Lf\n", d);
5866 if eval $compile; then
5870 sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
5871 sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
5872 echo "We will use %Lf."
5878 if $test X"$sPRIfldbl" = X; then
5879 $cat >try.c <<'EOCP'
5880 #include <sys/types.h>
5883 long double d = 123.456;
5884 printf("%.3llf\n", d);
5888 if eval $compile; then
5892 sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
5893 sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
5894 echo "We will use %llf."
5900 if $test X"$sPRIfldbl" = X; then
5901 $cat >try.c <<'EOCP'
5902 #include <sys/types.h>
5905 long double d = 123.456;
5906 printf("%.3lf\n", d);
5910 if eval $compile; then
5914 sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
5915 sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
5916 echo "We will use %lf."
5922 if $test X"$sPRIfldbl" = X; then
5923 echo "Cannot figure out how to print long doubles." >&4
5925 sSCNfldbl=$sPRIfldbl # expect consistency
5932 case "$sPRIfldbl" in
5933 '') d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef";
5934 d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef";
5935 d_SCNfldbl="$undef";
5937 *) d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define";
5938 d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define";
5939 d_SCNfldbl="$define";
5943 : see if modfl exists
5947 d_modfl_pow32_bug="$undef"
5949 case "$d_longdbl$d_modfl" in
5952 Checking to see whether your modfl() is okay for large values...
5958 long double nv = 4294967303.15;
5964 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
5968 case "$osname:$gccversion" in
5969 aix:) saveccflags="$ccflags"
5970 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
5973 if eval $compile; then
5976 *" 4294967303.150000 1.150000 4294967302.000000")
5977 echo >&4 "Your modfl() is broken for large values."
5978 d_modfl_pow32_bug="$define"
5980 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
5984 *" 4294967303.150000 0.150000 4294967303.000000")
5985 echo >&4 "Your modfl() seems okay for large values."
5987 *) echo >&4 "I don't understand your modfl() at all."
5991 $rm -f try.* try core core.try.*
5993 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
5996 case "$osname:$gccversion" in
5997 aix:) ccflags="$saveccflags" ;; # restore
6003 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
6006 case "$uselongdouble" in
6007 $define|true|[yY]*) dflt='y';;
6012 Perl can be built to take advantage of long doubles which
6013 (if available) may give more accuracy and range for floating point numbers.
6015 If this doesn't make any sense to you, just accept the default '$dflt'.
6017 rp='Try to use long doubles if available?'
6020 y|Y) val="$define" ;;
6026 case "$uselongdouble" in
6027 true|[yY]*) uselongdouble="$define" ;;
6030 case "$uselongdouble" in
6032 : Look for a hint-file generated 'call-back-unit'. If the
6033 : user has specified that long doubles should be used,
6034 : we may need to set or change some other defaults.
6035 if $test -f uselongdouble.cbu; then
6036 echo "Your platform has some specific hints for long doubles, using them..."
6037 . ./uselongdouble.cbu
6040 (Your platform doesn't have any specific hints for long doubles.)
6047 case "$uselongdouble:$d_sqrtl:$d_modfl" in
6048 $define:$define:$define)
6051 $define:$define:$undef)
6052 message="I could not find modfl"
6054 $define:$undef:$define)
6055 message="I could not find sqrtl"
6057 $define:$undef:$undef)
6058 message="I found neither sqrtl nor modfl"
6062 if $test "$message" != X; then
6065 *** You requested the use of long doubles but you do not seem to have
6066 *** the mathematic functions for long doubles.
6068 *** I'm disabling the use of long doubles.
6072 uselongdouble=$undef
6075 case "$useperlio" in
6076 $define|true|[yY]*|'') dflt='y';;
6081 Previous version of $package used the standard IO mechanisms as
6082 defined in <stdio.h>. Versions 5.003_02 and later of $package allow
6083 alternate IO mechanisms via the PerlIO abstraction layer, but the
6084 stdio mechanism is still available if needed. The abstraction layer
6085 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
6086 Using PerlIO with sfio may cause problems with some extension modules.
6088 If this doesn't make any sense to you, just accept the default '$dflt'.
6090 rp='Use the PerlIO abstraction layer?'
6097 echo "Ok, doing things the stdio way."
6106 case "$useperlio" in
6107 $define|true|[yY]*) ;;
6110 You are using the SOCKS proxy protocol library which means that you
6111 should also use the PerlIO layer. You may be headed for trouble.
6120 : determine the architecture name
6122 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
6123 tarch=`arch`"-$osname"
6124 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
6125 if uname -m > tmparch 2>&1 ; then
6126 tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
6127 -e 's/$/'"-$osname/" tmparch`
6135 case "$myarchname" in
6138 echo "(Your architecture name used to be $myarchname.)"
6142 case "$targetarch" in
6144 *) archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
6149 *) dflt="$archname";;
6151 rp='What is your architecture name'
6154 case "$usethreads" in
6156 echo "Threads selected." >&4
6158 *-thread*) echo "...and architecture name already has -thread." >&4
6160 *) archname="$archname-thread"
6161 echo "...setting architecture name to $archname." >&4
6166 case "$usemultiplicity" in
6168 echo "Multiplicity selected." >&4
6170 *-multi*) echo "...and architecture name already has -multi." >&4
6172 *) archname="$archname-multi"
6173 echo "...setting architecture name to $archname." >&4
6178 case "$use64bitint$use64bitall" in
6180 case "$archname64" in
6182 echo "This architecture is naturally 64-bit, not changing architecture name." >&4
6185 case "$use64bitint" in
6186 "$define") echo "64 bit integers selected." >&4 ;;
6188 case "$use64bitall" in
6189 "$define") echo "Maximal 64 bitness selected." >&4 ;;
6192 *-$archname64*) echo "...and architecture name already has $archname64." >&4
6194 *) archname="$archname-$archname64"
6195 echo "...setting architecture name to $archname." >&4
6201 case "$uselongdouble" in
6203 echo "Long doubles selected." >&4
6204 case "$longdblsize" in
6206 echo "...but long doubles are equal to doubles, not changing architecture name." >&4
6210 *-ld*) echo "...and architecture name already has -ld." >&4
6212 *) archname="$archname-ld"
6213 echo "...setting architecture name to $archname." >&4
6220 case "$useperlio" in
6222 echo "Perlio selected." >&4
6225 echo "Perlio not selected, using stdio." >&4
6227 *-stdio*) echo "...and architecture name already has -stdio." >&4
6229 *) archname="$archname-stdio"
6230 echo "...setting architecture name to $archname." >&4
6236 : determine root of directory hierarchy where package will be installed.
6239 dflt=`./loc . /usr/local /usr/local /local /opt /usr`
6247 By default, $package will be installed in $dflt/bin, manual pages
6248 under $dflt/man, etc..., i.e. with $dflt as prefix for all
6249 installation directories. Typically this is something like /usr/local.
6250 If you wish to have binaries under /usr/bin but other parts of the
6251 installation under /usr/local, that's ok: you will be prompted
6252 separately for each of the installation directories, the prefix being
6253 only used to set the defaults.
6257 rp='Installation prefix to use?'
6265 *) oldprefix="$prefix";;
6274 *) afsroot=$afsroot ;;
6280 $define|true) afs=true ;;
6281 $undef|false) afs=false ;;
6282 *) if test -d $afsroot; then
6290 echo "AFS may be running... I'll be extra cautious then..." >&4
6292 echo "AFS does not seem to be running..." >&4
6295 : determine installation prefix for where package is to be installed.
6299 Since you are running AFS, I need to distinguish the directory in which
6300 files will reside from the directory in which they are installed (and from
6301 which they are presumably copied to the former directory by occult means).
6304 case "$installprefix" in
6305 '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
6306 *) dflt="$installprefix";;
6311 In some special cases, particularly when building $package for distribution,
6312 it is convenient to distinguish between the directory in which files should
6313 be installed from the directory ($prefix) in which they
6314 will eventually reside. For most users, these two directories are the same.
6317 case "$installprefix" in
6319 *) dflt=$installprefix;;
6323 rp='What installation prefix should I use for installing files?'
6325 installprefix="$ans"
6326 installprefixexp="$ansexp"
6328 : set the prefixit variable, to compute a suitable default value
6329 prefixit='case "$3" in
6331 case "$oldprefix" in
6332 "") eval "$1=\"\$$2\"";;
6339 ""|" ") eval "$1=\"\$$2\"";;
6345 eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
6347 --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
6348 /*-$oldprefix/*|\~*-$oldprefix/*)
6349 eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
6350 *) eval "$1=\"\$$2\"";;
6354 : get the patchlevel
6356 echo "Getting the current patchlevel..." >&4
6357 if $test -r $rsrc/patchlevel.h;then
6358 revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
6359 patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
6360 subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6361 api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
6362 api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
6363 api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
6364 perl_patchlevel=`grep ',"DEVEL[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
6373 $echo "(You do not have patchlevel.h. Eek.)"
6375 if $test -r $rsrc/.patch ; then
6376 if $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
6377 perl_patchlevel=`cat $rsrc/.patch`
6380 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
6381 version_patchlevel_string="version $patchlevel subversion $subversion"
6382 case "$perl_patchlevel" in
6384 *) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
6387 $echo "(You have $package $version_patchlevel_string.)"
6391 : XXX Should be a Configure test for double-dots in filenames.
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 version=`echo $revision $patchlevel $subversion | \
6399 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6400 api_versionstring=`echo $api_revision $api_version $api_subversion | \
6401 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
6404 : Special case the 5.005_xx maintenance series, which used 5.005
6405 : without any subversion label as a subdirectory in $sitelib
6406 if test "${api_revision}${api_version}${api_subversion}" = "550"; then
6407 api_versionstring='5.005'
6410 : determine installation style
6411 : For now, try to deduce it from prefix unless it is already set.
6412 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
6413 case "$installstyle" in
6414 '') case "$prefix" in
6415 *perl*) dflt='lib';;
6416 *) dflt='lib/perl5' ;;
6419 *) dflt="$installstyle" ;;
6421 : Probably not worth prompting for this since we prompt for all
6422 : the directories individually, and the prompt would be too long and
6426 : determine where private library files go
6427 : Usual default is /usr/local/lib/perl5/$version.
6428 : Also allow things like /opt/perl/lib/$version, since
6429 : /opt/perl/lib/perl5... would be redundant.
6430 : The default "style" setting is made in installstyle.U
6431 case "$installstyle" in
6432 *lib/perl5*) set dflt privlib lib/$package/$version ;;
6433 *) set dflt privlib lib/$version ;;
6438 There are some auxiliary files for $package that need to be put into a
6439 private library directory that is accessible by everyone.
6443 rp='Pathname where the private library files will reside?'
6446 privlibexp="$ansexp"
6447 : Change installation prefix, if necessary.
6448 if $test X"$prefix" != X"$installprefix"; then
6449 installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
6451 installprivlib="$privlibexp"
6454 : set the prefixup variable, to restore leading tilda escape
6455 prefixup='case "$prefixexp" in
6457 *) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
6460 : determine where public architecture dependent libraries go
6463 : privlib default is /usr/local/lib/$package/$version
6464 : archlib default is /usr/local/lib/$package/$version/$archname
6465 : privlib may have an optional trailing /share.
6466 tdflt=`echo $privlib | $sed 's,/share$,,'`
6467 tdflt=$tdflt/$archname
6476 $spackage contains architecture-dependent library files. If you are
6477 sharing libraries in a heterogeneous environment, you might store
6478 these files in a separate location. Otherwise, you can just include
6479 them with the rest of the public library files.
6483 rp='Where do you want to put the public architecture-dependent libraries?'
6486 archlibexp="$ansexp"
6487 if $test X"$archlib" = X"$privlib"; then
6492 : Change installation prefix, if necessary.
6493 if $test X"$prefix" != X"$installprefix"; then
6494 installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
6496 installarchlib="$archlibexp"
6499 : see if setuid scripts can be secure
6502 Some kernels have a bug that prevents setuid #! scripts from being
6503 secure. Some sites have disabled setuid #! scripts because of this.
6505 First let's decide if your kernel supports secure setuid #! scripts.
6506 (If setuid #! scripts would be secure but have been disabled anyway,
6507 don't say that they are secure if asked.)
6512 if $test -d /dev/fd; then
6513 echo "#!$ls" >reflect
6514 chmod +x,u+s reflect
6515 ./reflect >flect 2>&1
6516 if $contains "/dev/fd" flect >/dev/null; then
6517 echo "Congratulations, your kernel has secure setuid scripts!" >&4
6521 If you are not sure if they are secure, I can check but I'll need a
6522 username and password different from the one you are using right now.
6523 If you don't have such a username or don't want me to test, simply
6527 rp='Other username to test security of setuid scripts with?'
6532 case "$d_suidsafe" in
6533 '') echo "I'll assume setuid scripts are *not* secure." >&4
6536 echo "Well, the $hint value is *not* secure." >&4
6538 *) echo "Well, the $hint value *is* secure." >&4
6543 $rm -f reflect flect
6544 echo "#!$ls" >reflect
6545 chmod +x,u+s reflect
6548 echo '"su" will (probably) prompt you for '"$ans's password."
6549 su $ans -c './reflect >flect'
6550 if $contains "/dev/fd" flect >/dev/null; then
6551 echo "Okay, it looks like setuid scripts are secure." >&4
6554 echo "I don't think setuid scripts are secure." >&4
6559 rp='Does your kernel have *secure* setuid scripts?'
6562 [yY]*) val="$define";;
6567 echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
6568 echo "(That's for file descriptors, not floppy disks.)"
6574 $rm -f reflect flect
6576 : now see if they want to do setuid emulation
6579 case "$d_suidsafe" in
6582 echo "No need to emulate SUID scripts since they are secure here." >&4
6586 Some systems have disabled setuid scripts, especially systems where
6587 setuid scripts cannot be secure. On systems where setuid scripts have
6588 been disabled, the setuid/setgid bits on scripts are currently
6589 useless. It is possible for $package to detect those bits and emulate
6590 setuid/setgid in a secure fashion. This emulation will only work if
6591 setuid scripts have been disabled in your kernel.
6595 "$define") dflt=y ;;
6598 rp="Do you want to do setuid/setgid emulation?"
6601 [yY]*) val="$define";;
6609 : see if this is a malloc.h system
6610 set malloc.h i_malloc
6613 : see if stdlib is available
6614 set stdlib.h i_stdlib
6617 : check for void type
6619 echo "Checking to see how well your C compiler groks the void type..." >&4
6620 case "$voidflags" in
6622 $cat >try.c <<'EOCP'
6628 extern void moo(); /* function returning void */
6629 void (*goo)(); /* ptr to func returning void */
6631 void *hue; /* generic ptr */
6644 int main() { sub(); }
6646 if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
6647 voidflags=$defvoidused
6648 echo "Good. It appears to support void to the level $package wants.">&4
6649 if $contains warning .out >/dev/null 2>&1; then
6650 echo "However, you might get some warnings that look like this:"
6654 echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
6655 if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
6656 echo "It supports 1..."
6657 if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
6658 echo "It also supports 2..."
6659 if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
6661 echo "And it supports 4 but not 8 definitely."
6663 echo "It doesn't support 4..."
6664 if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
6666 echo "But it supports 8."
6669 echo "Neither does it support 8."
6673 echo "It does not support 2..."
6674 if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
6676 echo "But it supports 4 and 8."
6678 if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
6680 echo "And it supports 4 but has not heard about 8."
6682 echo "However it supports 8 but not 4."
6687 echo "There is no support at all for void."
6692 case "$voidflags" in
6695 Support flag bits are:
6696 1: basic void declarations.
6697 2: arrays of pointers to functions returning void.
6698 4: operations between pointers to and addresses of void functions.
6699 8: generic void pointers.
6702 rp="Your void support flags add up to what?"
6709 : check for length of pointer
6713 echo "Checking to see how big your pointers are..." >&4
6714 if test "$voidflags" -gt 7; then
6715 echo '#define VOID_PTR char *' > try.c
6717 echo '#define VOID_PTR void *' > try.c
6719 $cat >>try.c <<'EOCP'
6723 printf("%d\n", (int)sizeof(VOID_PTR));
6728 if eval $compile_ok; then
6729 ptrsize=`$run ./try`
6730 echo "Your pointers are $ptrsize bytes long."
6733 echo "(I can't seem to compile the test program. Guessing...)" >&4
6734 rp="What is the size of a pointer (in bytes)?"
6741 case "$use64bitall" in
6742 "$define"|true|[yY]*)
6746 *** You have chosen a maximally 64-bit build, but your pointers
6747 *** are only 4 bytes wide, disabling maximal 64-bitness.
6750 use64bitall="$undef"
6751 case "$use64bitint" in
6752 "$define"|true|[yY]*) ;;
6755 *** Downgrading from maximal 64-bitness to using 64-bit integers.
6758 use64bitint="$define"
6767 : determine which malloc to compile in
6769 case "$usemymalloc" in
6770 [yY]*|true|$define) dflt='y' ;;
6771 [nN]*|false|$undef) dflt='n' ;;
6772 *) case "$ptrsize" in
6778 rp="Do you wish to attempt to use the malloc that comes with $package?"
6784 mallocsrc='malloc.c'
6785 mallocobj="malloc$_o"
6786 d_mymalloc="$define"
6789 : Remove malloc from list of libraries to use
6790 echo "Removing unneeded -lmalloc from library list" >&4
6791 set `echo X $libs | $sed -e 's/-lmalloc / /' -e 's/-lmalloc$//'`
6794 echo "libs = $libs" >&4
6806 : compute the return types of malloc and free
6808 $cat >malloc.c <<END
6812 #include <sys/types.h>
6826 case "$malloctype" in
6828 if $cc $ccflags -c -DTRY_MALLOC malloc.c >/dev/null 2>&1; then
6835 echo "Your system wants malloc to return '$malloctype', it would seem." >&4
6839 if $cc $ccflags -c -DTRY_FREE malloc.c >/dev/null 2>&1; then
6846 echo "Your system uses $freetype free(), it would seem." >&4
6850 After $package is installed, you may wish to install various
6851 add-on modules and utilities. Typically, these add-ons will
6852 be installed under $prefix with the rest
6853 of this package. However, you may wish to install such add-ons
6854 elsewhere under a different prefix.
6856 If you do not wish to put everything under a single prefix, that's
6857 ok. You will be prompted for the individual locations; this siteprefix
6858 is only used to suggest the defaults.
6860 The default should be fine for most people.
6864 rp='Installation prefix to use for add-on modules and utilities?'
6865 : XXX Here might be another good place for an installstyle setting.
6866 case "$siteprefix" in
6868 *) dflt=$siteprefix ;;
6871 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6873 case "$siteprefix" in
6877 *) oldsiteprefix="$prefix";;
6882 siteprefixexp="$ansexp"
6884 : determine where site specific libraries go.
6885 : Usual default is /usr/local/lib/perl5/site_perl/$version
6886 : The default "style" setting is made in installstyle.U
6887 : XXX No longer works with Prefixit stuff.
6888 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
6890 '') case "$installstyle" in
6891 *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
6892 *) dflt=$siteprefix/lib/site_$prog/$version ;;
6900 The installation process will create a directory for
6901 site-specific extensions and modules. Most users find it convenient
6902 to place all site-specific files in this directory rather than in the
6903 main distribution directory.
6907 rp='Pathname for the site-specific library files?'
6910 sitelibexp="$ansexp"
6911 sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
6912 : Change installation prefix, if necessary.
6913 if $test X"$prefix" != X"$installprefix"; then
6914 installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
6916 installsitelib="$sitelibexp"
6919 : determine where site specific architecture-dependent libraries go.
6920 : sitelib default is /usr/local/lib/perl5/site_perl/$version
6921 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
6922 : sitelib may have an optional trailing /share.
6924 '') dflt=`echo $sitelib | $sed 's,/share$,,'`
6925 dflt="$dflt/$archname"
6930 set sitearch sitearch none
6934 The installation process will also create a directory for
6935 architecture-dependent site-specific extensions and modules.
6939 rp='Pathname for the site-specific architecture-dependent library files?'
6942 sitearchexp="$ansexp"
6943 : Change installation prefix, if necessary.
6944 if $test X"$prefix" != X"$installprefix"; then
6945 installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
6947 installsitearch="$sitearchexp"
6952 The installation process will also create a directory for
6953 vendor-supplied add-ons. Vendors who supply perl with their system
6954 may find it convenient to place all vendor-supplied files in this
6955 directory rather than in the main distribution directory. This will
6956 ease upgrades between binary-compatible maintenance versions of perl.
6958 Of course you may also use these directories in whatever way you see
6959 fit. For example, you might use them to access modules shared over a
6960 company-wide network.
6962 The default answer should be fine for most people.
6963 This causes further questions about vendor add-ons to be skipped
6964 and no vendor-specific directories will be configured for perl.
6967 rp='Do you want to configure vendor-specific add-on directories?'
6968 case "$usevendorprefix" in
6969 define|true|[yY]*) dflt=y ;;
6970 *) : User may have set vendorprefix directly on Configure command line.
6971 case "$vendorprefix" in
6980 rp='Installation prefix to use for vendor-supplied add-ons?'
6981 case "$vendorprefix" in
6983 *) dflt=$vendorprefix ;;
6986 : XXX Prefixit unit does not yet support siteprefix and vendorprefix
6988 case "$vendorprefix" in
6992 *) oldvendorprefix="$prefix";;
6996 usevendorprefix="$define"
6998 vendorprefixexp="$ansexp"
7000 *) usevendorprefix="$undef"
7006 case "$vendorprefix" in
7007 '') d_vendorlib="$undef"
7011 *) d_vendorlib="$define"
7012 : determine where vendor-supplied modules go.
7013 : Usual default is /usr/local/lib/perl5/vendor_perl/$version
7014 case "$vendorlib" in
7016 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7017 case "$installstyle" in
7018 *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
7019 *) dflt=$vendorprefix/lib/vendor_$prog/$version ;;
7022 *) dflt="$vendorlib"
7026 rp='Pathname for the vendor-supplied library files?'
7029 vendorlibexp="$ansexp"
7032 vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
7033 : Change installation prefix, if necessary.
7034 if $test X"$prefix" != X"$installprefix"; then
7035 installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
7037 installvendorlib="$vendorlibexp"
7040 case "$vendorprefix" in
7041 '') d_vendorarch="$undef"
7045 *) d_vendorarch="$define"
7046 : determine where vendor-supplied architecture-dependent libraries go.
7047 : vendorlib default is /usr/local/lib/perl5/vendor_perl/$version
7048 : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
7049 : vendorlib may have an optional trailing /share.
7050 case "$vendorarch" in
7051 '') dflt=`echo $vendorlib | $sed 's,/share$,,'`
7052 dflt="$dflt/$archname"
7054 *) dflt="$vendorarch" ;;
7057 rp='Pathname for vendor-supplied architecture-dependent files?'
7060 vendorarchexp="$ansexp"
7063 : Change installation prefix, if necessary.
7064 if $test X"$prefix" != X"$installprefix"; then
7065 installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
7067 installvendorarch="$vendorarchexp"
7070 : Final catch-all directories to search
7073 Lastly, you can have perl look in other directories for extensions and
7074 modules in addition to those already specified.
7075 These directories will be searched after
7079 test X"$vendorlib" != "X" && echo ' ' $vendorlib
7080 test X"$vendorarch" != "X" && echo ' ' $vendorarch
7082 case "$otherlibdirs" in
7083 ''|' ') dflt='none' ;;
7084 *) dflt="$otherlibdirs" ;;
7087 Enter a colon-separated set of extra paths to include in perl's @INC
7088 search path, or enter 'none' for no extra paths.
7092 rp='Colon-separated list of additional directories for perl to search?'
7095 ' '|''|none) otherlibdirs=' ' ;;
7096 *) otherlibdirs="$ans" ;;
7098 case "$otherlibdirs" in
7102 set d_perl_otherlibdirs
7105 : Cruising for prototypes
7107 echo "Checking out function prototypes..." >&4
7108 $cat >prototype.c <<'EOCP'
7109 int main(int argc, char *argv[]) {
7112 if $cc $ccflags -c prototype.c >prototype.out 2>&1 ; then
7113 echo "Your C compiler appears to support function prototypes."
7116 echo "Your C compiler doesn't seem to understand function prototypes."
7123 case "$prototype" in
7125 *) ansi2knr='ansi2knr'
7130 This version of $package can only be compiled by a compiler that
7131 understands function prototypes. Unfortunately, your C compiler
7133 doesn't seem to understand them. Sorry about that.
7135 If GNU cc is available for your system, perhaps you could try that instead.
7137 Eventually, we hope to support building Perl with pre-ANSI compilers.
7138 If you would like to help in that effort, please contact <perlbug@perl.org>.
7140 Aborting Configure now.
7146 : determine where public executables go
7151 rp='Pathname where the public executables will reside?'
7153 if $test "X$ansexp" != "X$binexp"; then
7158 : Change installation prefix, if necessary.
7159 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
7160 if $test X"$prefix" != X"$installprefix"; then
7161 installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
7163 installbin="$binexp"
7172 Perl can be built with extra modules or bundles of modules which
7173 will be fetched from the CPAN and installed alongside Perl.
7175 Notice that you will need access to the CPAN; either via the Internet,
7176 or a local copy, for example a CD-ROM or a local CPAN mirror. (You will
7177 be asked later to configure the CPAN.pm module which will in turn do
7178 the installation of the rest of the extra modules or bundles.)
7180 Notice also that if the modules require any external software such as
7181 libraries and headers (the libz library and the zlib.h header for the
7182 Compress::Zlib module, for example) you MUST have any such software
7183 already installed, this configuration process will NOT install such
7186 If this doesn't make any sense to you, just accept the default '$dflt'.
7188 rp='Install any extra modules (y or n)?'
7194 Please list any extra modules or bundles to be installed from CPAN,
7195 with spaces between the names. The names can be in any format the
7196 'install' command of CPAN.pm will understand. (Answer 'none',
7197 without the quotes, to install no extra modules or bundles.)
7207 $rm -f ../extras.lst
7209 *) echo "(Saving the list of extras for later...)"
7210 echo "$extras" > ../extras.lst
7218 : Find perl5.005 or later.
7219 echo "Looking for a previously installed perl5.005 or later... "
7221 '') for tdir in `echo "$binexp$path_sep$PATH" | $sed "s/$path_sep/ /g"`; do
7222 : Check if this perl is recent and can load a simple module
7223 if $test -x $tdir/perl$exe_ext && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7226 elif $test -x $tdir/perl5$exe_ext && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
7236 '') echo "None found. That's ok.";;
7237 *) echo "Using $perl5." ;;
7240 : Determine list of previous versions to include in @INC
7241 $cat > getverlist <<EOPL
7244 \$api_versionstring = "$api_versionstring";
7245 \$version = "$version";
7246 \$stem = "$sitelib_stem";
7247 \$archname = "$archname";
7249 $cat >> getverlist <<'EOPL'
7250 # Can't have leading @ because metaconfig interprets it as a command!
7251 ;@inc_version_list=();
7252 # XXX Redo to do opendir/readdir?
7255 ;@candidates = glob("5.*");
7261 # XXX ToDo: These comparisons must be reworked when two-digit
7262 # subversions come along, so that 5.7.10 compares as greater than
7263 # 5.7.3! By that time, hope that 5.6.x is sufficiently
7264 # widespread that we can use the built-in version vectors rather
7265 # than reinventing them here. For 5.6.0, however, we must
7266 # assume this script will likely be run by 5.005_0x. --AD 1/2000.
7267 foreach $d (@candidates) {
7268 if ($d lt $version) {
7269 if ($d ge $api_versionstring) {
7270 unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
7272 elsif ($d ge "5.005") {
7273 unshift(@inc_version_list, grep { -d } $d);
7277 # Skip newer version. I.e. don't look in
7278 # 5.7.0 if we're installing 5.6.1.
7282 if (@inc_version_list) {
7283 print join(' ', @inc_version_list);
7286 # Blank space to preserve value for next Configure run.
7291 case "$inc_version_list" in
7292 '') if test -x "$perl5$exe_ext"; then
7293 dflt=`$perl5 getverlist`
7298 $undef) dflt='none' ;;
7299 *) eval dflt=\"$inc_version_list\" ;;
7302 ''|' ') dflt=none ;;
7309 In order to ease the process of upgrading, this version of perl
7310 can be configured to use modules built and installed with earlier
7311 versions of perl that were installed under $prefix. Specify here
7312 the list of earlier versions that this version of perl should check.
7313 If Configure detected no earlier versions of perl installed under
7314 $prefix, then the list will be empty. Answer 'none' to tell perl
7315 to not search earlier versions.
7317 The default should almost always be sensible, so if you're not sure,
7318 just accept the default.
7321 rp='List of earlier versions to include in @INC?'
7324 [Nn]one|''|' ') inc_version_list=' ' ;;
7325 *) inc_version_list="$ans" ;;
7327 case "$inc_version_list" in
7329 inc_version_list_init='0';;
7330 *) inc_version_list_init=`echo $inc_version_list |
7331 $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
7336 : determine whether to install perl also as /usr/bin/perl
7339 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
7341 Many scripts expect perl to be installed as /usr/bin/perl.
7342 I can install the perl you are about to compile also as /usr/bin/perl
7343 (in addition to $installbin/perl).
7345 case "$installusrbinperl" in
7346 "$undef"|[nN]*) dflt='n';;
7349 rp="Do you want to install perl as /usr/bin/perl?"
7352 [yY]*) val="$define";;
7358 set installusrbinperl
7361 : see if dld is available
7365 : see if dlopen exists
7372 : determine which dynamic loading, if any, to compile in
7374 dldir="ext/DynaLoader"
7387 $define) dflt='y' ;;
7390 $define) dflt='y' ;;
7392 : Does a dl_xxx.xs file exist for this operating system
7393 $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
7396 rp="Do you wish to use dynamic loading?"
7403 if $test -f $rsrc/$dldir/dl_${osname}.xs ; then
7404 dflt="$dldir/dl_${osname}.xs"
7405 elif $test "$d_dlopen" = "$define" ; then
7406 dflt="$dldir/dl_dlopen.xs"
7407 elif $test "$i_dld" = "$define" ; then
7408 dflt="$dldir/dl_dld.xs"
7413 *) dflt="$dldir/$dlsrc"
7416 echo "The following dynamic loading files are available:"
7417 : Can not go over to $dldir because getfile has path hard-coded in.
7418 tdir=`pwd`; cd "$rsrc"; $ls -C $dldir/dl*.xs; cd "$tdir"
7419 rp="Source file to use for dynamic loading"
7425 dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
7429 Some systems may require passing special flags to $cc -c to
7430 compile modules that will be used to create a shared library.
7431 To use no flags, say "none".
7434 case "$cccdlflags" in
7435 '') case "$gccversion" in
7436 '') case "$osname" in
7438 next) dflt='none' ;;
7439 irix*) dflt='-KPIC' ;;
7440 svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
7441 sunos) dflt='-pic' ;;
7445 *) case "$osname" in
7446 darwin) dflt='none' ;;
7447 svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
7452 *) dflt="$cccdlflags" ;;
7454 rp="Any special flags to pass to $cc -c to compile shared library modules?"
7457 none) cccdlflags=' ' ;;
7458 *) cccdlflags="$ans" ;;
7463 Some systems use ld to create libraries that can be dynamically loaded,
7464 while other systems (such as those using ELF) use $cc.
7468 '') $cat >try.c <<'EOM'
7469 /* Test for whether ELF binaries are produced */
7474 int i = open("a.out",O_RDONLY);
7477 if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
7478 exit(0); /* succeed (yes, it's ELF) */
7483 if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
7485 You appear to have ELF support. I'll use $cc to build dynamic libraries.
7489 echo "I'll use ld to build dynamic libraries."
7498 rp="What command should be used to create dynamic libraries?"
7504 Some systems may require passing special flags to $ld to create a
7505 library that can be dynamically loaded. If your ld flags include
7506 -L/other/path options to locate libraries outside your loader's normal
7507 search path, you may need to specify those -L options here as well. To
7508 use no flags, say "none".
7511 case "$lddlflags" in
7512 '') case "$osname" in
7513 beos) dflt='-nostart' ;;
7515 case "$gccversion" in
7516 '') dflt="$dflt +vnocompatwarnings" ;;
7519 linux|irix*) dflt='-shared' ;;
7520 next) dflt='none' ;;
7521 solaris) dflt='-G' ;;
7522 sunos) dflt='-assert nodefinitions' ;;
7523 svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
7527 *) dflt="$lddlflags" ;;
7530 : Try to guess additional flags to pick up local libraries.
7531 : Be careful not to append to a plain 'none'
7535 for thisflag in $ldflags; do
7540 *) dflt="$dflt $thisflag" ;;
7547 ''|' ') dflt='none' ;;
7550 rp="Any special flags to pass to $ld to create a dynamically loaded library?"
7553 none) lddlflags=' ' ;;
7554 *) lddlflags="$ans" ;;
7559 Some systems may require passing special flags to $cc to indicate that
7560 the resulting executable will use dynamic linking. To use no flags,
7564 case "$ccdlflags" in
7565 '') case "$osname" in
7566 hpux) dflt='-Wl,-E' ;;
7567 linux) dflt='-rdynamic' ;;
7568 next) dflt='none' ;;
7569 sunos) dflt='none' ;;
7573 *) dflt="$ccdlflags" ;;
7575 rp="Any special flags to pass to $cc to use dynamic linking?"
7578 none) ccdlflags=' ' ;;
7579 *) ccdlflags="$ans" ;;
7593 # No dynamic loading being used, so don't bother even to prompt.
7596 *) case "$useshrplib" in
7597 '') case "$osname" in
7598 svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
7600 also='Building a shared libperl is required for dynamic loading to work on your system.'
7605 also='Building a shared libperl is needed for MAB support.'
7623 The perl executable is normally obtained by linking perlmain.c with
7624 libperl${_a}, any static extensions (usually just DynaLoader), and
7625 any other libraries needed on this system (such as -lm, etc.). Since
7626 your system supports dynamic loading, it is probably possible to build
7627 a shared libperl.$so. If you will have more than one executable linked
7628 to libperl.$so, this will significantly reduce the size of each
7629 executable, but it may have a noticeable affect on performance. The
7630 default is probably sensible for your system.
7634 rp="Build a shared libperl.$so (y/n)"
7638 useshrplib='true' ;;
7639 *) useshrplib='false' ;;
7644 case "$useshrplib" in
7648 # Figure out a good name for libperl.so. Since it gets stored in
7649 # a version-specific architecture-dependent library, the version
7650 # number isn't really that important, except for making cc/ld happy.
7652 # A name such as libperl.so.3.1
7653 majmin="libperl.$so.$patchlevel.$subversion"
7654 # A name such as libperl.so.301
7655 majonly=`echo $patchlevel $subversion |
7656 $awk '{printf "%d%02d", $1, $2}'`
7657 majonly=libperl.$so.$majonly
7658 # I'd prefer to keep the os-specific stuff here to a minimum, and
7659 # rely on figuring it out from the naming of libc.
7660 case "${osname}${osvers}" in
7663 # XXX How handle the --version stuff for MAB?
7665 linux*) # ld won't link with a bare -lperl otherwise.
7668 cygwin*) # ld links against an importlib
7669 dflt=libperl$lib_ext
7671 *) # Try to guess based on whether libc has major.minor.
7673 *libc.$so.[0-9]*.[0-9]*) dflt=$majmin ;;
7674 *libc.$so.[0-9]*) dflt=$majonly ;;
7675 *) dflt=libperl.$so ;;
7685 I need to select a good name for the shared libperl. If your system uses
7686 library names with major and minor numbers, then you might want something
7687 like $majmin. Alternatively, if your system uses a single version
7688 number for shared libraries, then you might want to use $majonly.
7689 Or, your system might be quite happy with a simple libperl.$so.
7691 Since the shared libperl will get installed into a version-specific
7692 architecture-dependent directory, the version number of the shared perl
7693 library probably isn't important, so the default should be o.k.
7696 rp='What name do you want to give to the shared libperl?'
7699 echo "Ok, I'll use $libperl"
7702 libperl="libperl${_a}"
7706 # Detect old use of shrpdir via undocumented Configure -Dshrpdir
7710 WARNING: Use of the shrpdir variable for the installation location of
7711 the shared $libperl is not supported. It was never documented and
7712 will not work in this version. Let me (perlbug@perl.org)
7713 know of any problems this may cause.
7719 But your current setting of $shrpdir is
7720 the default anyway, so it's harmless.
7725 Further, your current attempted setting of $shrpdir
7726 conflicts with the value of $archlibexp/CORE
7727 that installperl will use.
7734 # How will the perl executable find the installed shared $libperl?
7735 # Add $xxx to ccdlflags.
7736 # If we can't figure out a command-line option, use $shrpenv to
7737 # set env LD_RUN_PATH. The main perl makefile uses this.
7738 shrpdir=$archlibexp/CORE
7741 if "$useshrplib"; then
7744 # We'll set it in Makefile.SH...
7750 xxx="-Wl,-R$shrpdir"
7752 bsdos|linux|irix*|dec_osf)
7753 xxx="-Wl,-rpath,$shrpdir"
7756 # next doesn't like the default...
7759 # beos doesn't like the default, either.
7762 # hpux doesn't like the default, either.
7763 tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
7766 tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
7772 # Only add $xxx if it isn't already in ccdlflags.
7773 case " $ccdlflags " in
7775 *) ccdlflags="$ccdlflags $xxx"
7778 Adding $xxx to the flags
7779 passed to $ld so that the perl executable will find the
7780 installed shared $libperl.
7788 # Fix ccdlflags in AIX for building external extensions.
7789 # (For building Perl itself bare -bE:perl.exp is needed,
7790 # Makefile.SH takes care of this.)
7792 aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
7794 # Respect a hint or command-line value.
7796 '') shrpenv="$tmp_shrpenv" ;;
7798 case "$ldlibpthname" in
7799 '') ldlibpthname=LD_LIBRARY_PATH ;;
7800 none) ldlibpthname='' ;;
7803 : determine where manual pages are on this system
7807 syspath='/usr/share/man/man1 /usr/man/man1'
7808 syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
7809 syspath="$syspath /usr/man/u_man/man1"
7810 syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
7811 syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
7812 syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
7813 sysman=`./loc . /usr/man/man1 $syspath`
7816 if $test -d "$sysman"; then
7817 echo "System manual is in $sysman." >&4
7819 echo "Could not find manual pages in source form." >&4
7822 : determine where manual pages go
7823 set man1dir man1dir none
7827 $spackage has manual pages available in source form.
7831 echo "However, you don't have nroff, so they're probably useless to you."
7833 '') man1dir="none";;
7836 echo "If you don't want the manual sources installed, answer 'none'."
7841 lookpath="$prefixexp/share/man/man1"
7842 lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
7843 lookpath="$lookpath $prefixexp/man/p_man/man1"
7844 lookpath="$lookpath $prefixexp/man/u_man/man1"
7845 lookpath="$lookpath $prefixexp/man/man.1"
7847 */?_man*) dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
7848 *) dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
7858 rp="Where do the main $spackage manual pages (source) go?"
7860 if $test "X$man1direxp" != "X$ansexp"; then
7864 man1direxp="$ansexp"
7870 : Change installation prefix, if necessary.
7871 if $test X"$prefix" != X"$installprefix"; then
7872 installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
7874 installman1dir="$man1direxp"
7877 : What suffix to use on installed man pages
7884 rp="What suffix should be used for the main $spackage man pages?"
7886 '') case "$man1dir" in
7900 *) dflt="$man1ext";;
7907 : see if we can have long filenames
7909 first=123456789abcdef
7911 if (echo hi >$first) 2>/dev/null; then
7912 if $test -f 123456789abcde; then
7913 echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
7916 echo 'You can have filenames longer than 14 characters.'>&4
7921 You can't have filenames longer than 14 chars.
7922 You can't even think about them!
7928 $rm -rf 123456789abcde*
7930 : determine where library module manual pages go
7931 set man3dir man3dir none
7935 $spackage has manual pages for many of the library modules.
7941 However, you don't have nroff, so they're probably useless to you.
7944 '') man3dir="none";;
7948 case "$d_flexfnam" in
7951 However, your system can't handle the long file names like File::Basename.3.
7954 '') man3dir="none";;
7958 echo "If you don't want the manual sources installed, answer 'none'."
7959 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
7961 '') dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
7962 if $test -d "$privlib/man/man3"; then
7965 WARNING: Previous versions of perl installed man3 pages into
7966 $privlib/man/man3. This version will suggest a
7967 new default of $dflt.
7971 rp='Do you wish to preserve the old behavior?(y/n)'
7974 y*) dflt="$privlib/man/man3" ;;
7979 *) dflt="$man3dir" ;;
7986 rp="Where do the $package library man pages (source) go?"
7989 man3direxp="$ansexp"
7995 : Change installation prefix, if necessary.
7996 if $test X"$prefix" != X"$installprefix"; then
7997 installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
7999 installman3dir="$man3direxp"
8002 : What suffix to use on installed man pages
8008 rp="What suffix should be used for the $package library man pages?"
8010 '') case "$man3dir" in
8024 *) dflt="$man3ext";;
8031 : see if we have to deal with yellow pages, now NIS.
8032 if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
8033 if $test -f /usr/etc/nibindd; then
8035 echo "I'm fairly confident you're on a NeXT."
8037 rp='Do you get the hosts file via NetInfo?'
8046 y*) hostcat='nidump hosts .';;
8047 *) case "$hostcat" in
8048 nidump*) hostcat='';;
8058 '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
8066 rp='Are you getting the hosts file via yellow pages?'
8069 y*) hostcat='ypcat hosts';;
8070 *) hostcat='cat /etc/hosts';;
8076 '') test -f /etc/hosts && hostcat='cat /etc/hosts';;
8079 '') test -f /etc/group && groupcat='cat /etc/group';;
8082 '') test -f /etc/passwd && passcat='cat /etc/passwd';;
8085 : now get the host name
8087 echo "Figuring out host name..." >&4
8088 case "$myhostname" in
8090 echo 'Maybe "hostname" will work...'
8091 if tans=`sh -c hostname 2>&1` ; then
8099 if $test "$cont"; then
8101 echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
8102 if tans=`cat /etc/systemid 2>&1` ; then
8104 phostname='cat /etc/systemid'
8105 echo "Whadyaknow. Xenix always was a bit strange..."
8108 elif $test -r /etc/systemid; then
8109 echo "(What is a non-Xenix system doing with /etc/systemid?)"
8112 if $test "$cont"; then
8113 echo 'No, maybe "uuname -l" will work...'
8114 if tans=`sh -c 'uuname -l' 2>&1` ; then
8116 phostname='uuname -l'
8118 echo 'Strange. Maybe "uname -n" will work...'
8119 if tans=`sh -c 'uname -n' 2>&1` ; then
8121 phostname='uname -n'
8123 echo 'Oh well, maybe I can mine it out of whoami.h...'
8124 if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
8125 myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
8126 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
8128 case "$myhostname" in
8129 '') echo "Does this machine have an identity crisis or something?"
8132 echo "Well, you said $myhostname before..."
8133 phostname='echo $myhostname';;
8139 case "$myhostname" in
8140 '') myhostname=noname ;;
8142 : you do not want to know about this
8147 if $test "$myhostname" ; then
8149 rp='Your host name appears to be "'$myhostname'".'" Right?"
8157 : bad guess or no guess
8158 while $test "X$myhostname" = X ; do
8160 rp="Please type the (one word) name of your host:"
8165 : translate upper to lower if necessary
8166 case "$myhostname" in
8168 echo "(Normalizing case in your host name)"
8169 myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
8173 case "$myhostname" in
8175 dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
8176 myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
8177 echo "(Trimming domain name from host name--host name is now $myhostname)"
8179 *) case "$mydomain" in
8182 test "X$hostcat" = "Xypcat hosts" &&
8183 ypmatch "$myhostname" hosts 2>/dev/null |\
8184 $sed -e 's/[ ]*#.*//; s/$/ /' > hosts && \
8187 test "X$hostcat" != "X" &&
8188 $hostcat | $sed -n -e "s/[ ]*#.*//; s/\$/ /
8189 /[ ]$myhostname[ . ]/p" > hosts
8192 if $test -f hosts; then
8193 $test x`$awk "/[0-9].*[ ]$myhostname$tmp_re/ { sum++ }
8194 END { print sum }" hosts` = x1 || tmp_re="[ ]"
8195 dflt=.`$awk "/[0-9].*[ ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
8196 hosts | $sort | $uniq | \
8197 $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
8198 case `$echo X$dflt` in
8199 X*\ *) echo "(Several hosts in the database matched hostname)"
8202 X.) echo "(You do not have fully-qualified names in the hosts database)"
8206 echo "(I cannot locate a hosts database anywhere)"
8211 tans=`./loc resolv.conf X /etc /usr/etc`
8212 if $test -f "$tans"; then
8213 echo "(Attempting domain name extraction from $tans)"
8214 dflt=.`$sed -n -e 's/ / /g' \
8215 -e 's/^search *\([^ ]*\).*/\1/p' $tans \
8216 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8218 .) dflt=.`$sed -n -e 's/ / /g' \
8219 -e 's/^domain *\([^ ]*\).*/\1/p' $tans \
8220 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
8227 .) echo "(No help from resolv.conf either -- attempting clever guess)"
8228 dflt=.`sh -c domainname 2>/dev/null`
8231 .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
8235 case "$dflt$osname" in
8236 .os390) echo "(Attempting domain name extraction from //'SYS1.TCPPARMS(TCPDATA)')"
8237 dflt=.`awk '/^DOMAINORIGIN/ {print $2}' "//'SYS1.TCPPARMS(TCPDATA)'" 2>/dev/null`
8241 .) echo "(Lost all hope -- silly guess then)"
8247 *) dflt="$mydomain";;
8251 rp="What is your domain name?"
8261 : translate upper to lower if necessary
8264 echo "(Normalizing case in your domain name)"
8265 mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
8269 : a little sanity check here
8270 case "$phostname" in
8273 case `$phostname | ./tr '[A-Z]' '[a-z]'` in
8274 $myhostname$mydomain|$myhostname) ;;
8276 case "$phostname" in
8278 echo "(That doesn't agree with your whoami.h file, by the way.)"
8281 echo "(That doesn't agree with your $phostname command, by the way.)"
8291 I need to get your e-mail address in Internet format if possible, i.e.
8292 something like user@host.domain. Please answer accurately since I have
8293 no easy means to double check it. The default value provided below
8294 is most probably close to reality but may not be valid from outside
8295 your organization...
8299 while test "$cont"; do
8301 '') dflt="$cf_by@$myhostname$mydomain";;
8302 *) dflt="$cf_email";;
8304 rp='What is your e-mail address?'
8310 rp='Address does not look like an Internet one. Use it anyway?'
8326 If you or somebody else will be maintaining perl at your site, please
8327 fill in the correct e-mail address here so that they may be contacted
8328 if necessary. Currently, the "perlbug" program included with perl
8329 will send mail to this address in addition to perlbug@perl.org. You may
8330 enter "none" for no administrator.
8333 case "$perladmin" in
8334 '') dflt="$cf_email";;
8335 *) dflt="$perladmin";;
8337 rp='Perl administrator e-mail address'
8341 : determine whether to only install version-specific parts.
8344 Do you want to install only the version-specific parts of the perl
8345 distribution? Usually you do *not* want to do this.
8347 case "$versiononly" in
8348 "$define"|[Yy]*|true) dflt='y' ;;
8351 rp="Do you want to install only the version-specific parts of perl?"
8354 [yY]*) val="$define";;
8360 case "$versiononly" in
8361 "$define") inc_version_list=''
8362 inc_version_list_init=0
8366 : figure out how to guarantee perl startup
8367 case "$startperl" in
8369 case "$sharpbang" in
8373 I can use the #! construct to start perl on your system. This will
8374 make startup of perl scripts faster, but may cause problems if you
8375 want to share those scripts and perl is not in a standard place
8376 ($binexp/perl) on all your platforms. The alternative is to force
8377 a shell by starting the script with a single ':' character.
8380 case "$versiononly" in
8381 "$define") dflt="$binexp/perl$version";;
8382 *) dflt="$binexp/perl";;
8384 rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
8387 none) startperl=": # use perl";;
8388 *) startperl="#!$ans"
8389 if $test 30 -lt `echo "$ans" | wc -c`; then
8392 WARNING: Some systems limit the #! command to 32 characters.
8393 If you experience difficulty running Perl scripts with #!, try
8394 installing Perl in a directory with a shorter pathname.
8400 *) startperl=": # use perl"
8405 echo "I'll use $startperl to start perl scripts."
8407 : figure best path for perl in scripts
8410 case "$versiononly" in
8411 "$define") perlpath="$binexp/perl$version";;
8412 *) perlpath="$binexp/perl";;
8414 case "$startperl" in
8419 I will use the "eval 'exec'" idiom to start Perl on your system.
8420 I can use the full path of your Perl binary for this purpose, but
8421 doing so may cause problems if you want to share those scripts and
8422 Perl is not always in a standard place ($binexp/perl).
8426 rp="What path shall I use in \"eval 'exec'\"?"
8433 case "$startperl" in
8435 *) echo "I'll use $perlpath in \"eval 'exec'\"" ;;
8438 : determine where public executable scripts go
8439 set scriptdir scriptdir
8441 case "$scriptdir" in
8444 : guess some guesses
8445 $test -d /usr/share/scripts && dflt=/usr/share/scripts
8446 $test -d /usr/share/bin && dflt=/usr/share/bin
8447 $test -d /usr/local/script && dflt=/usr/local/script
8448 $test -d /usr/local/scripts && dflt=/usr/local/scripts
8449 $test -d $prefixexp/script && dflt=$prefixexp/script
8453 *) dflt="$scriptdir"
8458 Some installations have a separate directory just for executable scripts so
8459 that they can mount it across multiple architectures but keep the scripts in
8460 one spot. You might, for example, have a subdirectory of /usr/share for this.
8461 Or you might just lump your scripts in with all your other executables.
8465 rp='Where do you keep publicly executable scripts?'
8467 if $test "X$ansexp" != "X$scriptdirexp"; then
8471 scriptdirexp="$ansexp"
8472 : Change installation prefix, if necessary.
8473 if $test X"$prefix" != X"$installprefix"; then
8474 installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
8476 installscript="$scriptdirexp"
8479 : determine where add-on public executables go
8481 '') dflt=$siteprefix/bin ;;
8485 rp='Pathname where the add-on public executables should be installed?'
8488 sitebinexp="$ansexp"
8489 : Change installation prefix, if necessary.
8490 if $test X"$prefix" != X"$installprefix"; then
8491 installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
8493 installsitebin="$sitebinexp"
8496 : define an is-a-typedef? function
8497 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8499 "") inclist="sys/types.h";;
8501 eval "varval=\$$var";
8505 for inc in $inclist; do
8506 echo "#include <$inc>" >>temp.c;
8508 echo "#ifdef $type" >> temp.c;
8509 echo "printf(\"We have $type\");" >> temp.c;
8510 echo "#endif" >> temp.c;
8511 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8512 if $contains $type temp.E >/dev/null 2>&1; then
8518 *) eval "$var=\$varval";;
8521 : define an is-a-typedef? function that prompts if the type is not available.
8522 typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
8524 "") inclist="sys/types.h";;
8526 eval "varval=\$$var";
8530 for inc in $inclist; do
8531 echo "#include <$inc>" >>temp.c;
8533 echo "#ifdef $type" >> temp.c;
8534 echo "printf(\"We have $type\");" >> temp.c;
8535 echo "#endif" >> temp.c;
8536 $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
8538 echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
8539 if $contains $type temp.E >/dev/null 2>&1; then
8540 echo "$type found." >&4;
8543 echo "$type NOT found." >&4;
8549 *) eval "$var=\$varval";;
8552 : see what type lseek is declared as in the kernel
8553 rp="What is the type used for lseek's offset on this system?"
8554 set off_t lseektype long stdio.h sys/types.h
8558 echo "Checking to see how big your file offsets are..." >&4
8560 #include <sys/types.h>
8564 printf("%d\n", (int)sizeof($lseektype));
8569 if eval $compile_ok; then
8570 lseeksize=`$run ./try`
8571 echo "Your file offsets are $lseeksize bytes long."
8575 echo "(I can't seem to compile the test program. Guessing...)"
8576 rp="What is the size of your file offsets (in bytes)?"
8582 : see what type file positions are declared as in the library
8583 rp="What is the type for file position used by fsetpos()?"
8584 set fpos_t fpostype long stdio.h sys/types.h
8589 *_t) zzz="$fpostype" ;;
8592 echo "Checking the size of $zzz..." >&4
8594 #include <sys/types.h>
8597 printf("%d\n", (int)sizeof($fpostype));
8602 if eval $compile_ok; then
8606 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8609 echo "Your $zzz is $fpossize bytes long."
8615 echo "(I can't compile the test program. Guessing...)" >&4
8616 rp="What is the size of your file positions (in bytes)?"
8623 # Backward compatibility (uselfs is deprecated).
8625 "$define"|true|[yY]*)
8628 *** Configure -Duselfs is deprecated, using -Duselargefiles instead.
8630 uselargefiles="$define"
8634 case "$lseeksize:$fpossize" in
8637 You can have files larger than 2 gigabytes.
8640 *) case "$uselargefiles" in
8641 "$undef"|false|[nN]*) dflt='n' ;;
8646 Perl can be built to understand large files (files larger than 2 gigabytes)
8647 on some systems. To do so, Configure can be run with -Duselargefiles.
8649 If this doesn't make any sense to you, just accept the default '$dflt'.
8651 rp='Try to understand large files, if available?'
8654 y|Y) val="$define" ;;
8661 case "$uselargefiles" in
8663 : Look for a hint-file generated 'call-back-unit'. If the
8664 : user has specified that a large files perl is to be built,
8665 : we may need to set or change some other defaults.
8666 if $test -f uselargefiles.cbu; then
8667 echo "Your platform has some specific hints for large file builds, using them..."
8668 . ./uselargefiles.cbu
8670 echo "Rechecking to see how big your file offsets are..." >&4
8672 #include <sys/types.h>
8676 printf("%d\n", (int)sizeof($lseektype));
8681 if eval $compile_ok; then
8682 lseeksize=`$run ./try`
8683 $echo "Your file offsets are now $lseeksize bytes long."
8687 echo "(I can't seem to compile the test program. Guessing...)"
8688 rp="What is the size of your file offsets (in bytes)?"
8693 *_t) zzz="$fpostype" ;;
8696 $echo $n "Rechecking the size of $zzz...$c" >&4
8698 #include <sys/types.h>
8701 printf("%d\n", (int)sizeof($fpostype));
8706 if eval $compile_ok; then
8711 echo "(I can't execute the test program--guessing $fpossize.)" >&4
8714 echo " $fpossize bytes." >&4
8720 echo "(I can't compile the test program. Guessing...)" >&4
8721 rp="What is the size of your file positions (in bytes)?"
8730 case "$vendorprefix" in
8731 '') d_vendorbin="$undef"
8735 *) d_vendorbin="$define"
8736 : determine where vendor-supplied executables go.
8737 case "$vendorbin" in
8738 '') dflt=$vendorprefix/bin ;;
8739 *) dflt="$vendorbin" ;;
8742 rp='Pathname for the vendor-supplied executables directory?'
8745 vendorbinexp="$ansexp"
8748 : Change installation prefix, if necessary.
8749 if $test X"$prefix" != X"$installprefix"; then
8750 installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
8752 installvendorbin="$vendorbinexp"
8755 : see if qgcvt exists
8759 : Check how to convert floats to strings.
8761 if test "X$d_Gconvert" = X; then
8764 echo "Checking for an efficient way to convert floats to strings."
8766 case "$uselongdouble" in
8767 "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
8769 case "$d_longdbl" in
8770 "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
8772 case "$d_PRIgldbl" in
8773 "$define") echo "#define HAS_PRIgldbl" >>try.c ;;
8777 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
8778 char *myname = "gconvert";
8781 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
8782 char *myname = "gcvt";
8785 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
8786 char *myname = "qgcvt";
8787 #define DOUBLETYPE long double
8790 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8792 #define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
8794 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(double)(x))
8797 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
8799 char *myname = "sprintf";
8803 #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
8804 #define DOUBLETYPE long double
8806 #define DOUBLETYPE double
8812 #define I_STDLIB $i_stdlib
8818 checkit(expect, got)
8822 if (strcmp(expect, got)) {
8823 printf("%s oddity: Expected %s, got %s\n",
8824 myname, expect, got);
8834 /* This must be 1st test on (which?) platform */
8835 /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
8836 Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
8837 checkit("0.1", buf);
8839 Gconvert((DOUBLETYPE)0.01, 8, 0, buf);
8840 checkit("0.01", buf);
8842 Gconvert((DOUBLETYPE)0.001, 8, 0, buf);
8843 checkit("0.001", buf);
8845 Gconvert((DOUBLETYPE)0.0001, 8, 0, buf);
8846 checkit("0.0001", buf);
8848 Gconvert((DOUBLETYPE)0.00009, 8, 0, buf);
8849 if (strlen(buf) > 5)
8850 checkit("9e-005", buf); /* for Microsoft ?? */
8852 checkit("9e-05", buf);
8854 Gconvert((DOUBLETYPE)1.0, 8, 0, buf);
8857 Gconvert((DOUBLETYPE)1.1, 8, 0, buf);
8858 checkit("1.1", buf);
8860 Gconvert((DOUBLETYPE)1.01, 8, 0, buf);
8861 checkit("1.01", buf);
8863 Gconvert((DOUBLETYPE)1.001, 8, 0, buf);
8864 checkit("1.001", buf);
8866 Gconvert((DOUBLETYPE)1.0001, 8, 0, buf);
8867 checkit("1.0001", buf);
8869 Gconvert((DOUBLETYPE)1.00001, 8, 0, buf);
8870 checkit("1.00001", buf);
8872 Gconvert((DOUBLETYPE)1.000001, 8, 0, buf);
8873 checkit("1.000001", buf);
8875 Gconvert((DOUBLETYPE)0.0, 8, 0, buf);
8878 Gconvert((DOUBLETYPE)-1.0, 8, 0, buf);
8881 /* Some Linux gcvt's give 1.e+5 here. */
8882 Gconvert((DOUBLETYPE)100000.0, 8, 0, buf);
8883 checkit("100000", buf);
8885 /* Some Linux gcvt's give -1.e+5 here. */
8886 Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf);
8887 checkit("-100000", buf);
8889 Gconvert((DOUBLETYPE)123.456, 8, 0, buf);
8890 checkit("123.456", buf);
8892 /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
8893 Gconvert((DOUBLETYPE)1e34, 8, 0, buf);
8894 /* 34 should be enough to scare even long double
8895 * places into using the e notation. */
8896 if (strlen(buf) > 5)
8897 checkit("1e+034", buf); /* for Microsoft */
8899 checkit("1e+34", buf);
8901 /* For Perl, if you add additional tests here, also add them to
8902 * t/base/num.t for benefit of platforms not using Configure or
8903 * overriding d_Gconvert */
8908 : first add preferred functions to our list
8910 for xxx_convert in $gconvert_preference; do
8911 case $xxx_convert in
8912 gcvt|gconvert|sprintf) xxx_list="$xxx_list $xxx_convert" ;;
8913 *) echo "Discarding unrecognized gconvert_preference $xxx_convert" >&4 ;;
8916 : then add any others
8917 for xxx_convert in gconvert gcvt sprintf; do
8920 *) xxx_list="$xxx_list $xxx_convert" ;;
8924 case "$d_longdbl$uselongdouble" in
8926 : again, add prefered functions to our list first
8928 for xxx_convert in $gconvert_ld_preference; do
8929 case $xxx_convert in
8930 qgcvt|gcvt|gconvert|sprintf) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
8931 *) echo "Discarding unrecognized gconvert_ld_preference $xxx_convert" ;;
8934 : then add qgcvt, sprintf--then, in xxx_list order, gconvert and gcvt
8935 for xxx_convert in qgcvt sprintf $xxx_list; do
8936 case "$xxx_ld_list" in
8937 $xxx_convert*|*" $xxx_convert"*) ;;
8938 *) xxx_ld_list="$xxx_ld_list $xxx_convert" ;;
8941 : if sprintf cannot do long doubles, move it to the end
8942 if test "$d_PRIgldbl" != "$define"; then
8943 xxx_ld_list="`echo $xxx_ld_list|sed s/sprintf//` sprintf"
8945 : if no qgcvt, remove it
8946 if test "$d_qgcvt" != "$define"; then
8947 xxx_ld_list="`echo $xxx_ld_list|sed s/qgcvt//`"
8950 xxx_list="$xxx_ld_list"
8954 for xxx_convert in $xxx_list; do
8955 echo "Trying $xxx_convert..."
8957 set try -DTRY_$xxx_convert
8958 if eval $compile; then
8959 echo "$xxx_convert() found." >&4
8961 echo "I'll use $xxx_convert to convert floats into a string." >&4
8964 echo "...But $xxx_convert didn't work as I expected."
8968 echo "$xxx_convert NOT found." >&4
8972 if test X$xxx_convert = X; then
8973 echo "*** WHOA THERE!!! ***" >&4
8974 echo "None of ($xxx_list) seemed to work properly. I'll use sprintf." >&4
8978 case "$xxx_convert" in
8979 gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
8980 gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
8981 qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
8982 *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
8983 "$define$define$define")
8984 d_Gconvert="sprintf((b),\"%.*\"$sPRIgldbl,(n),(x))" ;;
8985 "$define$define$undef")
8986 d_Gconvert='sprintf((b),"%.*g",(n),(double)(x))' ;;
8987 *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
8994 : see if _fwalk exists
8998 : Initialize h_fcntl
9001 : Initialize h_sysfile
9004 : access call always available on UNIX
9008 : locate the flags for 'access()'
9012 $cat >access.c <<'EOCP'
9013 #include <sys/types.h>
9018 #include <sys/file.h>
9027 : check sys/file.h first, no particular reason here
9028 if $test `./findhdr sys/file.h` && \
9029 $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
9031 echo "<sys/file.h> defines the *_OK access constants." >&4
9032 elif $test `./findhdr fcntl.h` && \
9033 $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
9035 echo "<fcntl.h> defines the *_OK access constants." >&4
9036 elif $test `./findhdr unistd.h` && \
9037 $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
9038 echo "<unistd.h> defines the *_OK access constants." >&4
9040 echo "I can't find the four *_OK access constants--I'll use mine." >&4
9046 : see if accessx exists
9047 set accessx d_accessx
9050 : see if alarm exists
9054 : see if POSIX threads are available
9055 set pthread.h i_pthread
9058 : define a fucntion to check prototypes
9059 $cat > protochk <<EOSH
9062 optimize="$optimize"
9064 prototype="$prototype"
9067 usethreads=$usethreads
9068 i_pthread=$i_pthread
9069 pthread_h_first=$pthread_h_first
9072 $cat >> protochk <<'EOSH'
9077 while test $# -ge 2; do
9079 $define) echo "#include <$2>" >> try.c ;;
9080 literal) echo "$2" >> try.c ;;
9082 # Extra magic for the benefit of systems that need pthread.h
9083 # to be included early to correctly detect threadsafe functions.
9084 # Such functions must guarantee themselves, though, that the usethreads
9085 # and i_pthread have been defined, before calling protochk.
9086 if test "$usethreads" = "$define" -a "$i_pthread" = "$define" -a "$pthread_h_first" = "$define" -a "$pthread_h_done" = ""; then
9087 echo "#include <pthread.h>" >> try.c
9092 test "$prototype" = "$define" && echo '#define CAN_PROTOTYPE' >> try.c
9093 cat >> try.c <<'EOCP'
9094 #ifdef CAN_PROTOTYPE
9095 #define _(args) args
9100 echo "$foo" >> try.c
9101 echo 'int no_real_function_has_this_name _((void)) { return 0; }' >> try.c
9102 $cc $optimize $ccflags -c try.c > /dev/null 2>&1
9110 hasproto='varname=$1; func=$2; shift; shift;
9111 while $test $# -ge 2; do
9113 $define) echo "#include <$2>";;
9117 $cppstdin $cppflags $cppminus < try.c > tryout.c 2>/dev/null;
9118 if $contains "$func.*(" tryout.c >/dev/null 2>&1; then
9119 echo "$func() prototype found.";
9122 echo "$func() prototype NOT found.";
9127 $rm -f try.c tryout.c'
9129 : see if sys/types.h has to be included
9130 set sys/types.h i_systypes
9133 : see if sys/select.h has to be included
9134 set sys/select.h i_sysselct
9137 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
9138 while $test $# -ge 2; do
9140 $define) echo "#include <$2>";;
9144 echo "int main () { struct $struct foo; char* bar; bar = (char*)foo.$field; }" >> try.c;
9146 if eval $compile; then
9155 : see if we should include time.h, sys/time.h, or both
9157 if test "X$timeincl" = X; then
9158 echo "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
9159 $echo $n "I'm now running the test program...$c"
9160 $cat >try.c <<'EOCP'
9161 #include <sys/types.h>
9166 #ifdef SYSTIMEKERNEL
9169 #include <sys/time.h>
9172 #include <sys/select.h>
9181 struct timezone tzp;
9183 if (foo.tm_sec == foo.tm_sec)
9186 if (bar.tv_sec == bar.tv_sec)
9193 for s_timezone in '-DS_TIMEZONE' ''; do
9195 for s_timeval in '-DS_TIMEVAL' ''; do
9196 for i_systimek in '' '-DSYSTIMEKERNEL'; do
9197 for i_time in '' '-DI_TIME'; do
9198 for i_systime in '-DI_SYSTIME' ''; do
9201 set try $i_time $i_systime $i_systimek $sysselect $s_timeval $s_timezone
9202 if eval $compile; then
9203 set X $i_time $i_systime $i_systimek $sysselect $s_timeval
9207 $echo $n "Succeeded with $flags$c"
9219 *SYSTIMEKERNEL*) i_systimek="$define"
9220 timeincl=`./findhdr sys/time.h`
9221 echo "We'll include <sys/time.h> with KERNEL defined." >&4;;
9222 *) i_systimek="$undef";;
9225 *I_TIME*) i_time="$define"
9226 timeincl=`./findhdr time.h`" $timeincl"
9227 echo "We'll include <time.h>." >&4;;
9228 *) i_time="$undef";;
9231 *I_SYSTIME*) i_systime="$define"
9232 timeincl=`./findhdr sys/time.h`" $timeincl"
9233 echo "We'll include <sys/time.h>." >&4;;
9234 *) i_systime="$undef";;
9238 : see if struct tm knows about tm_zone
9239 case "$i_systime$i_time" in
9242 echo "Checking to see if your struct tm has tm_zone field..." >&4
9243 set d_tm_tm_zone tm tm_zone $i_systime sys/time.h $i_time time.h
9251 case "$d_tm_tm_zone" in
9252 "$define") echo "Yes, it does." ;;
9253 *) echo "No, it doesn't." ;;
9255 : see if struct tm knows about tm_gmtoff
9256 case "$i_systime$i_time" in
9259 echo "Checking to see if your struct tm has tm_gmtoff field..." >&4
9260 set d_tm_tm_gmtoff tm tm_gmtoff $i_systime sys/time.h $i_time time.h
9268 case "$d_tm_tm_gmtoff" in
9269 "$define") echo "Yes, it does." ;;
9270 *) echo "No, it doesn't." ;;
9273 : see if asctime_r exists
9274 set asctime_r d_asctime_r
9276 case "$d_asctime_r" in
9278 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
9279 case "$d_asctime_r_proto:$usethreads" in
9280 ":define") d_asctime_r_proto=define
9281 set d_asctime_r_proto asctime_r $hdrs
9285 case "$d_asctime_r_proto" in
9287 case "$asctime_r_proto" in
9288 ''|0) try='char* asctime_r(const struct tm*, char*);'
9289 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SB ;;
9291 case "$asctime_r_proto" in
9292 ''|0) try='char* asctime_r(const struct tm*, char*, int);'
9293 ./protochk "extern $try" $hdrs && asctime_r_proto=B_SBI ;;
9295 case "$asctime_r_proto" in
9296 ''|0) try='int asctime_r(const struct tm*, char*);'
9297 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SB ;;
9299 case "$asctime_r_proto" in
9300 ''|0) try='int asctime_r(const struct tm*, char*, int);'
9301 ./protochk "extern $try" $hdrs && asctime_r_proto=I_SBI ;;
9303 case "$asctime_r_proto" in
9304 ''|0) d_asctime_r=undef
9306 echo "Disabling asctime_r, cannot determine prototype." >&4 ;;
9307 * ) case "$asctime_r_proto" in
9308 REENTRANT_PROTO*) ;;
9309 *) asctime_r_proto="REENTRANT_PROTO_$asctime_r_proto" ;;
9311 echo "Prototype: $try" ;;
9314 *) case "$usethreads" in
9315 define) echo "asctime_r has no prototype, not using it." >&4 ;;
9322 *) asctime_r_proto=0
9326 : see if atolf exists
9330 : see if atoll exists
9334 : Look for GNU-cc style attribute checking
9336 echo "Checking whether your compiler can handle __attribute__ ..." >&4
9337 $cat >attrib.c <<'EOCP'
9339 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
9341 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
9342 if $contains 'warning' attrib.out >/dev/null 2>&1; then
9343 echo "Your C compiler doesn't fully support __attribute__."
9346 echo "Your C compiler supports __attribute__."
9350 echo "Your C compiler doesn't seem to understand __attribute__ at all."
9357 : see if bcmp exists
9361 : see if bcopy exists
9365 : see if this is a unistd.h system
9366 set unistd.h i_unistd
9369 : see if getpgrp exists
9370 set getpgrp d_getpgrp
9373 case "$d_getpgrp" in
9376 echo "Checking to see which flavor of getpgrp is in use..."
9379 #include <sys/types.h>
9381 # include <unistd.h>
9385 if (getuid() == 0) {
9386 printf("(I see you are running Configure as super-user...)\n");
9390 if (getpgrp(1) == 0)
9399 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9400 echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
9402 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9403 echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
9406 echo "I can't seem to compile and run the test program."
9408 xxx="a USG one, i.e. you use getpgrp()."
9410 # SVR4 systems can appear rather BSD-ish.
9413 xxx="a BSD one, i.e. you use getpgrp(pid)."
9417 xxx="probably a USG one, i.e. you use getpgrp()."
9422 echo "Assuming your getpgrp is $xxx" >&4
9431 : see if setpgrp exists
9432 set setpgrp d_setpgrp
9435 case "$d_setpgrp" in
9438 echo "Checking to see which flavor of setpgrp is in use..."
9441 #include <sys/types.h>
9443 # include <unistd.h>
9447 if (getuid() == 0) {
9448 printf("(I see you are running Configure as super-user...)\n");
9452 if (-1 == setpgrp(1, 1))
9455 if (setpgrp() != -1)
9461 if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9462 echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
9464 elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
9465 echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
9468 echo "(I can't seem to compile and run the test program.)"
9470 xxx="a USG one, i.e. you use setpgrp()."
9472 # SVR4 systems can appear rather BSD-ish.
9475 xxx="a BSD one, i.e. you use setpgrp(pid,pgrp)."
9479 xxx="probably a USG one, i.e. you use setpgrp()."
9484 echo "Assuming your setpgrp is $xxx" >&4
9492 : see if bzero exists
9496 : see if signal is declared as pointer to function returning int or void
9498 xxx=`./findhdr signal.h`
9499 $test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
9500 if $contains 'int.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9501 echo "You have int (*signal())() instead of void." >&4
9503 elif $contains 'void.*\*[ ]*signal' $$.tmp >/dev/null 2>&1 ; then
9504 echo "You have void (*signal())()." >&4
9506 elif $contains 'extern[ ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
9507 echo "You have int (*signal())() instead of void." >&4
9509 elif $contains 'void.*\*.*sig' $$.tmp >/dev/null 2>&1 ; then
9510 echo "You have void (*signal())()." >&4
9513 case "$d_voidsig" in
9515 echo "I can't determine whether signal handler returns void or int..." >&4
9517 rp="What type does your signal handler return?"
9524 echo "As you already told me, signal handler returns void." >&4
9527 *) echo "As you already told me, signal handler returns int." >&4
9534 case "$d_voidsig" in
9535 "$define") signal_t="void";;
9540 : check for ability to cast large floats to 32-bit ints.
9542 echo 'Checking whether your C compiler can cast large floats to int32.' >&4
9543 if $test "$intsize" -ge 4; then
9550 #include <sys/types.h>
9552 $signal_t blech(s) int s; { exit(3); }
9559 signal(SIGFPE, blech);
9561 /* Don't let compiler optimize the test away. Store the number
9562 in a writable string for gcc to pass to sscanf under HP/UX.
9564 sprintf(str, "2147483647");
9565 sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
9569 /* x86 processors will probably give 0x8000 0000, which is a
9570 sign change. We don't want that. We want to mimic SPARC
9571 behavior here, which is to preserve the sign and give
9574 if (i32 != ($xxx) f)
9580 if eval $compile_ok; then
9584 echo "(I can't seem to compile the test program--assuming it can't)"
9592 echo "Nope, it can't."
9599 : check for ability to cast negative floats to unsigned
9601 echo 'Checking whether your C compiler can cast negative float to unsigned.' >&4
9604 #include <sys/types.h>
9606 $signal_t blech(s) int s; { exit(7); }
9607 $signal_t blech_in_list(s) int s; { exit(4); }
9608 unsigned long dummy_long(p) unsigned long p; { return p; }
9609 unsigned int dummy_int(p) unsigned int p; { return p; }
9610 unsigned short dummy_short(p) unsigned short p; { return p; }
9614 unsigned long along;
9616 unsigned short ashort;
9620 /* Frustrate gcc-2.7.2's optimizer which failed this test with
9621 a direct f = -123. assignment. gcc-2.8.0 reportedly
9622 optimized the whole file away
9624 /* Store the number in a writable string for gcc to pass to
9627 sprintf(str, "-123");
9628 sscanf(str, "%lf", &f); /* f = -123.; */
9630 signal(SIGFPE, blech);
9631 along = (unsigned long)f;
9632 aint = (unsigned int)f;
9633 ashort = (unsigned short)f;
9634 if (along != (unsigned long)-123)
9636 if (aint != (unsigned int)-123)
9638 if (ashort != (unsigned short)-123)
9640 sprintf(str, "1073741824.");
9641 sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
9644 along = (unsigned long)f;
9645 if (along != 0x80000000)
9649 along = (unsigned long)f;
9650 if (along != 0x7fffffff)
9654 along = (unsigned long)f;
9655 if (along != 0x80000001)
9659 signal(SIGFPE, blech_in_list);
9660 sprintf(str, "123.");
9661 sscanf(str, "%lf", &f); /* f = 123.; */
9662 along = dummy_long((unsigned long)f);
9663 aint = dummy_int((unsigned int)f);
9664 ashort = dummy_short((unsigned short)f);
9665 if (along != (unsigned long)123)
9667 if (aint != (unsigned int)123)
9669 if (ashort != (unsigned short)123)
9676 if eval $compile_ok; then
9680 echo "(I can't seem to compile the test program--assuming it can't)"
9683 case "$castflags" in
9688 echo "Nope, it can't."
9695 : see if vprintf exists
9697 if set vprintf val -f d_vprintf; eval $csym; $val; then
9698 echo 'vprintf() found.' >&4
9701 #include <varargs.h>
9703 int main() { xxx("foo"); }
9712 exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
9716 if eval $compile && $run ./try; then
9717 echo "Your vsprintf() returns (int)." >&4
9720 echo "Your vsprintf() returns (char*)." >&4
9724 echo 'vprintf() NOT found.' >&4
9735 : see if chown exists
9739 : see if chroot exists
9743 : see if chsize exists
9747 : see if class exists
9751 hasstruct='varname=$1; struct=$2; shift; shift;
9752 while $test $# -ge 2; do
9754 $define) echo "#include <$2>";;
9758 echo "int main () { struct $struct foo; }" >> try.c;
9760 if eval $compile; then
9771 : see whether socket exists
9773 $echo $n "Hmm... $c" >&4
9774 if set socket val -f d_socket; eval $csym; $val; then
9775 echo "Looks like you have Berkeley networking support." >&4
9777 if set setsockopt val -f; eval $csym; $val; then
9780 echo "...but it uses the old BSD 4.1c interface, rather than 4.2." >&4
9784 if $contains socklib libc.list >/dev/null 2>&1; then
9785 echo "Looks like you have Berkeley networking support." >&4
9787 : we will have to assume that it supports the 4.2 BSD interface
9790 echo "You don't have Berkeley networking in libc$_a..." >&4
9791 if test "X$d_socket" = "X$define"; then
9792 echo "...but you seem to believe that you have sockets." >&4
9794 for net in net socket
9796 if test -f /usr/lib/lib$net$_a; then
9797 ( ($nm $nm_opt /usr/lib/lib$net$_a | eval $nm_extract) || \
9798 $ar t /usr/lib/lib$net$_a) 2>/dev/null >> libc.list
9799 if $contains socket libc.list >/dev/null 2>&1; then
9804 echo "...but the Wollongong group seems to have hacked it in." >&4
9805 sockethdr="-I/usr/netinclude"
9808 echo "Found Berkeley sockets interface in lib$net." >&4
9809 if $contains setsockopt libc.list >/dev/null 2>&1; then
9812 echo "...using the old BSD 4.1c interface, rather than 4.2." >&4
9819 if test "X$d_socket" != "X$define"; then
9820 echo "or anywhere else I see." >&4
9828 : see if socketpair exists
9829 set socketpair d_sockpair
9834 echo "Checking the availability of certain socket constants..." >&4
9835 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
9836 enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
9838 #include <sys/types.h>
9839 #include <sys/socket.h>
9845 set try; if eval $compile; then
9848 set d_${enum}; eval $setvar
9852 : see if this is a sys/uio.h system
9853 set sys/uio.h i_sysuio
9858 echo "Checking to see if your system supports struct cmsghdr..." >&4
9859 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
9861 case "$d_cmsghdr_s" in
9862 "$define") echo "Yes, it does." ;;
9863 *) echo "No, it doesn't." ;;
9867 : check for const keyword
9869 echo 'Checking to see if your C compiler knows about "const"...' >&4
9870 $cat >const.c <<'EOCP'
9871 typedef struct spug { int drokk; } spug;
9878 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
9880 echo "Yup, it does."
9883 echo "Nope, it doesn't."
9888 : see if crypt exists
9893 $define) cryptlib='' ;;
9894 *) if set crypt val -f d_crypt; eval $csym; $val; then
9895 echo 'crypt() found.' >&4
9899 cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
9900 if $test -z "$cryptlib"; then
9901 cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
9905 if $test -z "$cryptlib"; then
9906 cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
9910 if $test -z "$cryptlib"; then
9911 cryptlib=`./loc libcrypt$_a "" $libpth`
9915 if $test -z "$cryptlib"; then
9916 echo 'crypt() NOT found.' >&4
9927 : see if this is a crypt.h system
9931 : see if crypt_r exists
9932 set crypt_r d_crypt_r
9934 case "$d_crypt_r" in
9936 hdrs="$i_systypes sys/types.h define stdio.h $i_crypt crypt.h"
9937 case "$d_crypt_r_proto:$usethreads" in
9938 ":define") d_crypt_r_proto=define
9939 set d_crypt_r_proto crypt_r $hdrs
9943 case "$d_crypt_r_proto" in
9945 case "$crypt_r_proto" in
9946 ''|0) try='char* crypt_r(const char*, const char*, struct crypt_data*);'
9947 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCS ;;
9949 case "$crypt_r_proto" in
9950 ''|0) try='char* crypt_r(const char*, const char*, CRYPTD*);'
9951 ./protochk "extern $try" $hdrs && crypt_r_proto=B_CCD ;;
9953 case "$crypt_r_proto" in
9954 ''|0) d_crypt_r=undef
9956 echo "Disabling crypt_r, cannot determine prototype." >&4 ;;
9957 * ) case "$crypt_r_proto" in
9958 REENTRANT_PROTO*) ;;
9959 *) crypt_r_proto="REENTRANT_PROTO_$crypt_r_proto" ;;
9961 echo "Prototype: $try" ;;
9964 *) case "$usethreads" in
9965 define) echo "crypt_r has no prototype, not using it." >&4 ;;
9976 : get csh whereabouts
9978 'csh') val="$undef" ;;
9983 : Respect a hint or command line value for full_csh.
9985 '') full_csh=$csh ;;
9988 : see if ctermid_r exists
9989 set ctermid_r d_ctermid_r
9991 case "$d_ctermid_r" in
9993 hdrs="$i_systypes sys/types.h define stdio.h "
9994 case "$d_ctermid_r_proto:$usethreads" in
9995 ":define") d_ctermid_r_proto=define
9996 set d_ctermid_r_proto ctermid_r $hdrs
10000 case "$d_ctermid_r_proto" in
10002 case "$ctermid_r_proto" in
10003 ''|0) try='char* ctermid_r(char*);'
10004 ./protochk "extern $try" $hdrs && ctermid_r_proto=B_B ;;
10006 case "$ctermid_r_proto" in
10007 ''|0) d_ctermid_r=undef
10009 echo "Disabling ctermid_r, cannot determine prototype." >&4 ;;
10010 * ) case "$ctermid_r_proto" in
10011 REENTRANT_PROTO*) ;;
10012 *) ctermid_r_proto="REENTRANT_PROTO_$ctermid_r_proto" ;;
10014 echo "Prototype: $try" ;;
10017 *) case "$usethreads" in
10018 define) echo "ctermid_r has no prototype, not using it." >&4 ;;
10025 *) ctermid_r_proto=0
10029 : see if ctime_r exists
10030 set ctime_r d_ctime_r
10032 case "$d_ctime_r" in
10034 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
10035 case "$d_ctime_r_proto:$usethreads" in
10036 ":define") d_ctime_r_proto=define
10037 set d_ctime_r_proto ctime_r $hdrs
10041 case "$d_ctime_r_proto" in
10043 case "$ctime_r_proto" in
10044 ''|0) try='char* ctime_r(const time_t*, char*);'
10045 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SB ;;
10047 case "$ctime_r_proto" in
10048 ''|0) try='char* ctime_r(const time_t*, char*, int);'
10049 ./protochk "extern $try" $hdrs && ctime_r_proto=B_SBI ;;
10051 case "$ctime_r_proto" in
10052 ''|0) try='int ctime_r(const time_t*, char*);'
10053 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SB ;;
10055 case "$ctime_r_proto" in
10056 ''|0) try='int ctime_r(const time_t*, char*, int);'
10057 ./protochk "extern $try" $hdrs && ctime_r_proto=I_SBI ;;
10059 case "$ctime_r_proto" in
10060 ''|0) d_ctime_r=undef
10062 echo "Disabling ctime_r, cannot determine prototype." >&4 ;;
10063 * ) case "$ctime_r_proto" in
10064 REENTRANT_PROTO*) ;;
10065 *) ctime_r_proto="REENTRANT_PROTO_$ctime_r_proto" ;;
10067 echo "Prototype: $try" ;;
10070 *) case "$usethreads" in
10071 define) echo "ctime_r has no prototype, not using it." >&4 ;;
10082 : see if cuserid exists
10083 set cuserid d_cuserid
10086 : see if this is a limits.h system
10087 set limits.h i_limits
10090 : see if this is a float.h system
10091 set float.h i_float
10094 : See if number of significant digits in a double precision number is known
10096 $cat >dbl_dig.c <<EOM
10097 #$i_limits I_LIMITS
10100 #include <limits.h>
10106 printf("Contains DBL_DIG");
10109 $cppstdin $cppflags $cppminus < dbl_dig.c >dbl_dig.E 2>/dev/null
10110 if $contains 'DBL_DIG' dbl_dig.E >/dev/null 2>&1; then
10111 echo "DBL_DIG found." >&4
10114 echo "DBL_DIG NOT found." >&4
10121 : see if dbm.h is available
10122 : see if dbmclose exists
10123 set dbmclose d_dbmclose
10126 case "$d_dbmclose" in
10136 *) set rpcsvc/dbm.h i_rpcsvcdbm
10141 *) echo "We won't be including <dbm.h>"
10151 : see if prototype for dbminit is available
10153 set d_dbminitproto dbminit $i_dbm dbm.h
10156 : see if difftime exists
10157 set difftime d_difftime
10160 : see if this is a dirent system
10162 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
10164 echo "<dirent.h> found." >&4
10167 if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
10168 echo "<sys/dir.h> found." >&4
10171 xinc=`./findhdr sys/ndir.h`
10173 echo "<dirent.h> NOT found." >&4
10178 : Look for type of directory structure.
10180 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10182 case "$direntrytype" in
10184 case "$i_dirent" in
10185 $define) guess1='struct dirent' ;;
10186 *) guess1='struct direct' ;;
10189 *) guess1="$direntrytype"
10194 'struct dirent') guess2='struct direct' ;;
10195 *) guess2='struct dirent' ;;
10198 if $contains "$guess1" try.c >/dev/null 2>&1; then
10199 direntrytype="$guess1"
10200 echo "Your directory entries are $direntrytype." >&4
10201 elif $contains "$guess2" try.c >/dev/null 2>&1; then
10202 direntrytype="$guess2"
10203 echo "Your directory entries seem to be $direntrytype." >&4
10205 echo "I don't recognize your system's directory entries." >&4
10206 rp="What type is used for directory entries on this system?"
10209 direntrytype="$ans"
10214 : see if the directory entry stores field length
10216 $cppstdin $cppflags $cppminus < "$xinc" > try.c
10217 if $contains 'd_namlen' try.c >/dev/null 2>&1; then
10218 echo "Good, your directory entry keeps length information in d_namlen." >&4
10221 echo "Your directory entry does not know about the d_namlen field." >&4
10228 : see if this is an sysdir system
10229 set sys/dir.h i_sysdir
10232 : see if this is an sysndir system
10233 set sys/ndir.h i_sysndir
10238 $cat >dirfd.c <<EOM
10240 #$i_dirent I_DIRENT /**/
10241 #$i_sysdir I_SYS_DIR /**/
10242 #$i_sysndir I_SYS_NDIR /**/
10243 #$i_systypes I_SYS_TYPES /**/
10244 #if defined(I_SYS_TYPES)
10245 #include <sys/types.h>
10247 #if defined(I_DIRENT)
10248 #include <dirent.h>
10249 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
10250 #include <sys/dir.h>
10254 #include <sys/ndir.h>
10258 #include <ndir.h> /* may be wrong in the future */
10260 #include <sys/dir.h>
10266 DIR *dirp = opendir(".");
10267 if (dirfd(dirp) >= 0)
10274 if eval $compile; then
10278 $define) echo "dirfd() found." >&4 ;;
10279 *) echo "dirfd() NOT found." >&4 ;;
10285 : see if dlerror exists
10288 set dlerror d_dlerror
10292 : see if dlfcn is available
10293 set dlfcn.h i_dlfcn
10300 On a few systems, the dynamically loaded modules that perl generates and uses
10301 will need a different extension than shared libs. The default will probably
10307 *) dflt="$dlext" ;;
10309 rp='What is the extension of dynamically loaded modules'
10318 : Check if dlsym need a leading underscore
10324 echo "Checking whether your dlsym() needs a leading underscore ..." >&4
10325 $cat >dyna.c <<'EOM'
10334 #include <dlfcn.h> /* the dynamic linker include file for SunOS/Solaris */
10336 #include <sys/types.h>
10341 extern int fred() ;
10350 int mode = RTLD_LAZY ;
10352 handle = dlopen("./dyna.$dlext", mode) ;
10353 if (handle == NULL) {
10358 symbol = dlsym(handle, "fred") ;
10359 if (symbol == NULL) {
10360 /* try putting a leading underscore */
10361 symbol = dlsym(handle, "_fred") ;
10362 if (symbol == NULL) {
10375 : Call the object file tmp-dyna.o in case dlext=o.
10376 if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 &&
10377 mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 &&
10378 $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 &&
10379 $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
10382 1) echo "Test program failed using dlopen." >&4
10383 echo "Perhaps you should not use dynamic loading." >&4;;
10384 2) echo "Test program failed using dlsym." >&4
10385 echo "Perhaps you should not use dynamic loading." >&4;;
10386 3) echo "dlsym needs a leading underscore" >&4
10388 4) echo "dlsym doesn't need a leading underscore." >&4;;
10391 echo "I can't compile and run the test program." >&4
10392 echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
10397 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
10402 : see if drand48_r exists
10403 set drand48_r d_drand48_r
10405 case "$d_drand48_r" in
10407 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
10408 case "$d_drand48_r_proto:$usethreads" in
10409 ":define") d_drand48_r_proto=define
10410 set d_drand48_r_proto drand48_r $hdrs
10414 case "$d_drand48_r_proto" in
10416 case "$drand48_r_proto" in
10417 ''|0) try='int drand48_r(struct drand48_data*, double*);'
10418 ./protochk "extern $try" $hdrs && drand48_r_proto=I_ST ;;
10420 case "$drand48_r_proto" in
10421 ''|0) d_drand48_r=undef
10423 echo "Disabling drand48_r, cannot determine prototype." >&4 ;;
10424 * ) case "$drand48_r_proto" in
10425 REENTRANT_PROTO*) ;;
10426 *) drand48_r_proto="REENTRANT_PROTO_$drand48_r_proto" ;;
10428 echo "Prototype: $try" ;;
10431 *) case "$usethreads" in
10432 define) echo "drand48_r has no prototype, not using it." >&4 ;;
10439 *) drand48_r_proto=0
10443 : see if prototype for drand48 is available
10445 set d_drand48proto drand48 $i_stdlib stdlib.h $i_unistd unistd.h
10448 : see if dup2 exists
10452 : see if eaccess exists
10453 set eaccess d_eaccess
10456 : see if endgrent exists
10457 set endgrent d_endgrent
10460 : see if this is an grp system
10466 xxx=`./findhdr grp.h`
10467 $cppstdin $cppflags $cppminus < $xxx >$$.h
10469 if $contains 'gr_passwd' $$.h >/dev/null 2>&1; then
10481 set d_grpasswd; eval $setvar
10485 : see if endgrent_r exists
10486 set endgrent_r d_endgrent_r
10488 case "$d_endgrent_r" in
10490 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
10491 case "$d_endgrent_r_proto:$usethreads" in
10492 ":define") d_endgrent_r_proto=define
10493 set d_endgrent_r_proto endgrent_r $hdrs
10497 case "$d_endgrent_r_proto" in
10499 case "$endgrent_r_proto" in
10500 ''|0) try='int endgrent_r(FILE**);'
10501 ./protochk "extern $try" $hdrs && endgrent_r_proto=I_H ;;
10503 case "$endgrent_r_proto" in
10504 ''|0) try='void endgrent_r(FILE**);'
10505 ./protochk "extern $try" $hdrs && endgrent_r_proto=V_H ;;
10507 case "$endgrent_r_proto" in
10508 ''|0) d_endgrent_r=undef
10510 echo "Disabling endgrent_r, cannot determine prototype." >&4 ;;
10511 * ) case "$endgrent_r_proto" in
10512 REENTRANT_PROTO*) ;;
10513 *) endgrent_r_proto="REENTRANT_PROTO_$endgrent_r_proto" ;;
10515 echo "Prototype: $try" ;;
10518 *) case "$usethreads" in
10519 define) echo "endgrent_r has no prototype, not using it." >&4 ;;
10526 *) endgrent_r_proto=0
10530 : see if endhostent exists
10531 set endhostent d_endhent
10534 : see if this is a netdb.h system
10535 set netdb.h i_netdb
10538 : see if endhostent_r exists
10539 set endhostent_r d_endhostent_r
10541 case "$d_endhostent_r" in
10543 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10544 case "$d_endhostent_r_proto:$usethreads" in
10545 ":define") d_endhostent_r_proto=define
10546 set d_endhostent_r_proto endhostent_r $hdrs
10550 case "$d_endhostent_r_proto" in
10552 case "$endhostent_r_proto" in
10553 ''|0) try='int endhostent_r(struct hostent_data*);'
10554 ./protochk "extern $try" $hdrs && endhostent_r_proto=I_D ;;
10556 case "$endhostent_r_proto" in
10557 ''|0) try='void endhostent_r(struct hostent_data*);'
10558 ./protochk "extern $try" $hdrs && endhostent_r_proto=V_D ;;
10560 case "$endhostent_r_proto" in
10561 ''|0) d_endhostent_r=undef
10562 endhostent_r_proto=0
10563 echo "Disabling endhostent_r, cannot determine prototype." >&4 ;;
10564 * ) case "$endhostent_r_proto" in
10565 REENTRANT_PROTO*) ;;
10566 *) endhostent_r_proto="REENTRANT_PROTO_$endhostent_r_proto" ;;
10568 echo "Prototype: $try" ;;
10571 *) case "$usethreads" in
10572 define) echo "endhostent_r has no prototype, not using it." >&4 ;;
10574 d_endhostent_r=undef
10575 endhostent_r_proto=0
10579 *) endhostent_r_proto=0
10583 : see if endnetent exists
10584 set endnetent d_endnent
10587 : see if endnetent_r exists
10588 set endnetent_r d_endnetent_r
10590 case "$d_endnetent_r" in
10592 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10593 case "$d_endnetent_r_proto:$usethreads" in
10594 ":define") d_endnetent_r_proto=define
10595 set d_endnetent_r_proto endnetent_r $hdrs
10599 case "$d_endnetent_r_proto" in
10601 case "$endnetent_r_proto" in
10602 ''|0) try='int endnetent_r(struct netent_data*);'
10603 ./protochk "extern $try" $hdrs && endnetent_r_proto=I_D ;;
10605 case "$endnetent_r_proto" in
10606 ''|0) try='void endnetent_r(struct netent_data*);'
10607 ./protochk "extern $try" $hdrs && endnetent_r_proto=V_D ;;
10609 case "$endnetent_r_proto" in
10610 ''|0) d_endnetent_r=undef
10611 endnetent_r_proto=0
10612 echo "Disabling endnetent_r, cannot determine prototype." >&4 ;;
10613 * ) case "$endnetent_r_proto" in
10614 REENTRANT_PROTO*) ;;
10615 *) endnetent_r_proto="REENTRANT_PROTO_$endnetent_r_proto" ;;
10617 echo "Prototype: $try" ;;
10620 *) case "$usethreads" in
10621 define) echo "endnetent_r has no prototype, not using it." >&4 ;;
10623 d_endnetent_r=undef
10624 endnetent_r_proto=0
10628 *) endnetent_r_proto=0
10632 : see if endprotoent exists
10633 set endprotoent d_endpent
10636 : see if endprotoent_r exists
10637 set endprotoent_r d_endprotoent_r
10639 case "$d_endprotoent_r" in
10641 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10642 case "$d_endprotoent_r_proto:$usethreads" in
10643 ":define") d_endprotoent_r_proto=define
10644 set d_endprotoent_r_proto endprotoent_r $hdrs
10648 case "$d_endprotoent_r_proto" in
10650 case "$endprotoent_r_proto" in
10651 ''|0) try='int endprotoent_r(struct protoent_data*);'
10652 ./protochk "extern $try" $hdrs && endprotoent_r_proto=I_D ;;
10654 case "$endprotoent_r_proto" in
10655 ''|0) try='void endprotoent_r(struct protoent_data*);'
10656 ./protochk "extern $try" $hdrs && endprotoent_r_proto=V_D ;;
10658 case "$endprotoent_r_proto" in
10659 ''|0) d_endprotoent_r=undef
10660 endprotoent_r_proto=0
10661 echo "Disabling endprotoent_r, cannot determine prototype." >&4 ;;
10662 * ) case "$endprotoent_r_proto" in
10663 REENTRANT_PROTO*) ;;
10664 *) endprotoent_r_proto="REENTRANT_PROTO_$endprotoent_r_proto" ;;
10666 echo "Prototype: $try" ;;
10669 *) case "$usethreads" in
10670 define) echo "endprotoent_r has no prototype, not using it." >&4 ;;
10672 d_endprotoent_r=undef
10673 endprotoent_r_proto=0
10677 *) endprotoent_r_proto=0
10681 : see if endpwent exists
10682 set endpwent d_endpwent
10685 : see if this is a pwd.h system
10691 xxx=`./findhdr pwd.h`
10692 $cppstdin $cppflags $cppminus < $xxx >$$.h
10694 if $contains 'pw_quota' $$.h >/dev/null 2>&1; then
10702 if $contains 'pw_age' $$.h >/dev/null 2>&1; then
10710 if $contains 'pw_change' $$.h >/dev/null 2>&1; then
10718 if $contains 'pw_class' $$.h >/dev/null 2>&1; then
10726 if $contains 'pw_expire' $$.h >/dev/null 2>&1; then
10734 if $contains 'pw_comment' $$.h >/dev/null 2>&1; then
10742 if $contains 'pw_gecos' $$.h >/dev/null 2>&1; then
10750 if $contains 'pw_passwd' $$.h >/dev/null 2>&1; then
10762 set d_pwquota; eval $setvar
10763 set d_pwage; eval $setvar
10764 set d_pwchange; eval $setvar
10765 set d_pwclass; eval $setvar
10766 set d_pwexpire; eval $setvar
10767 set d_pwcomment; eval $setvar
10768 set d_pwgecos; eval $setvar
10769 set d_pwpasswd; eval $setvar
10773 : see if endpwent_r exists
10774 set endpwent_r d_endpwent_r
10776 case "$d_endpwent_r" in
10778 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
10779 case "$d_endpwent_r_proto:$usethreads" in
10780 ":define") d_endpwent_r_proto=define
10781 set d_endpwent_r_proto endpwent_r $hdrs
10785 case "$d_endpwent_r_proto" in
10787 case "$endpwent_r_proto" in
10788 ''|0) try='int endpwent_r(FILE**);'
10789 ./protochk "extern $try" $hdrs && endpwent_r_proto=I_H ;;
10791 case "$endpwent_r_proto" in
10792 ''|0) try='void endpwent_r(FILE**);'
10793 ./protochk "extern $try" $hdrs && endpwent_r_proto=V_H ;;
10795 case "$endpwent_r_proto" in
10796 ''|0) d_endpwent_r=undef
10798 echo "Disabling endpwent_r, cannot determine prototype." >&4 ;;
10799 * ) case "$endpwent_r_proto" in
10800 REENTRANT_PROTO*) ;;
10801 *) endpwent_r_proto="REENTRANT_PROTO_$endpwent_r_proto" ;;
10803 echo "Prototype: $try" ;;
10806 *) case "$usethreads" in
10807 define) echo "endpwent_r has no prototype, not using it." >&4 ;;
10814 *) endpwent_r_proto=0
10818 : see if endservent exists
10819 set endservent d_endsent
10822 : see if endservent_r exists
10823 set endservent_r d_endservent_r
10825 case "$d_endservent_r" in
10827 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
10828 case "$d_endservent_r_proto:$usethreads" in
10829 ":define") d_endservent_r_proto=define
10830 set d_endservent_r_proto endservent_r $hdrs
10834 case "$d_endservent_r_proto" in
10836 case "$endservent_r_proto" in
10837 ''|0) try='int endservent_r(struct servent_data*);'
10838 ./protochk "extern $try" $hdrs && endservent_r_proto=I_D ;;
10840 case "$endservent_r_proto" in
10841 ''|0) try='void endservent_r(struct servent_data*);'
10842 ./protochk "extern $try" $hdrs && endservent_r_proto=V_D ;;
10844 case "$endservent_r_proto" in
10845 ''|0) d_endservent_r=undef
10846 endservent_r_proto=0
10847 echo "Disabling endservent_r, cannot determine prototype." >&4 ;;
10848 * ) case "$endservent_r_proto" in
10849 REENTRANT_PROTO*) ;;
10850 *) endservent_r_proto="REENTRANT_PROTO_$endservent_r_proto" ;;
10852 echo "Prototype: $try" ;;
10855 *) case "$usethreads" in
10856 define) echo "endservent_r has no prototype, not using it." >&4 ;;
10858 d_endservent_r=undef
10859 endservent_r_proto=0
10863 *) endservent_r_proto=0
10867 : Locate the flags for 'open()'
10869 $cat >try.c <<'EOCP'
10870 #include <sys/types.h>
10875 #include <sys/file.h>
10886 : check sys/file.h first to get FREAD on Sun
10887 if $test `./findhdr sys/file.h` && \
10888 set try -DI_SYS_FILE && eval $compile; then
10890 echo "<sys/file.h> defines the O_* constants..." >&4
10891 if $run ./try; then
10892 echo "and you have the 3 argument form of open()." >&4
10895 echo "but not the 3 argument form of open(). Oh, well." >&4
10898 elif $test `./findhdr fcntl.h` && \
10899 set try -DI_FCNTL && eval $compile; then
10901 echo "<fcntl.h> defines the O_* constants..." >&4
10902 if $run ./try; then
10903 echo "and you have the 3 argument form of open()." >&4
10906 echo "but not the 3 argument form of open(). Oh, well." >&4
10911 echo "I can't find the O_* constant definitions! You got problems." >&4
10917 : see which of string.h or strings.h is needed
10919 strings=`./findhdr string.h`
10920 if $test "$strings" && $test -r "$strings"; then
10921 echo "Using <string.h> instead of <strings.h>." >&4
10925 strings=`./findhdr strings.h`
10926 if $test "$strings" && $test -r "$strings"; then
10927 echo "Using <strings.h> instead of <string.h>." >&4
10929 echo "No string header found -- You'll surely have problems." >&4
10934 case "$i_string" in
10935 "$undef") strings=`./findhdr strings.h`;;
10936 *) strings=`./findhdr string.h`;;
10939 : see if this is a sys/file.h system
10944 : do we need to include sys/file.h ?
10948 if $h_sysfile; then
10950 echo "We'll be including <sys/file.h>." >&4
10953 echo "We won't be including <sys/file.h>." >&4
10963 : see if fcntl.h is there
10968 : see if we can include fcntl.h
10974 echo "We'll be including <fcntl.h>." >&4
10977 if $h_sysfile; then
10978 echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
10980 echo "We won't be including <fcntl.h>." >&4
10992 : check for non-blocking I/O stuff
10993 case "$h_sysfile" in
10994 true) echo "#include <sys/file.h>" > head.c;;
10997 true) echo "#include <fcntl.h>" > head.c;;
10998 *) echo "#include <sys/fcntl.h>" > head.c;;
11003 echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
11004 case "$o_nonblock" in
11006 $cat head.c > try.c
11007 $cat >>try.c <<EOCP
11009 #include <stdlib.h>
11016 printf("O_NONBLOCK\n");
11020 printf("O_NDELAY\n");
11024 printf("FNDELAY\n");
11031 if eval $compile_ok; then
11032 o_nonblock=`$run ./try`
11033 case "$o_nonblock" in
11034 '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
11035 *) echo "Seems like we can use $o_nonblock.";;
11038 echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
11041 *) echo "Using $hint value $o_nonblock.";;
11043 $rm -f try try.* .out core
11046 echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
11049 $cat head.c > try.c
11050 $cat >>try.c <<EOCP
11052 #include <sys/types.h>
11053 #include <signal.h>
11055 #include <stdlib.h>
11060 #define MY_O_NONBLOCK $o_nonblock
11061 #ifndef errno /* XXX need better Configure test */
11064 #$i_unistd I_UNISTD
11066 #include <unistd.h>
11068 #$i_string I_STRING
11070 #include <string.h>
11072 #include <strings.h>
11074 $signal_t blech(x) int x; { exit(3); }
11076 $cat >> try.c <<'EOCP'
11084 pipe(pd); /* Down: child -> parent */
11085 pipe(pu); /* Up: parent -> child */
11088 close(pd[1]); /* Parent reads from pd[0] */
11089 close(pu[0]); /* Parent writes (blocking) to pu[1] */
11091 if (-1 == fcntl(pd[0], F_SETFL, MY_O_NONBLOCK))
11096 signal(SIGALRM, blech);
11098 if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
11100 sprintf(string, "%d\n", ret);
11101 write(2, string, strlen(string));
11104 if (errno == EAGAIN) {
11105 printf("EAGAIN\n");
11110 if (errno == EWOULDBLOCK)
11111 printf("EWOULDBLOCK\n");
11114 write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
11115 sleep(2); /* Give it time to close our pipe */
11117 ret = read(pd[0], buf, 1); /* Should read EOF */
11119 sprintf(string, "%d\n", ret);
11120 write(4, string, strlen(string));
11124 close(pd[0]); /* We write to pd[1] */
11125 close(pu[1]); /* We read from pu[0] */
11126 read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
11127 close(pd[1]); /* Pipe pd is now fully closed! */
11128 exit(0); /* Bye bye, thank you for playing! */
11132 if eval $compile_ok; then
11133 echo "$startsh" >mtry
11134 echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
11136 ./mtry >/dev/null 2>&1
11138 0) eagain=`$cat try.out`;;
11139 1) echo "Could not perform non-blocking setting!";;
11140 2) echo "I did a successful read() for something that was not there!";;
11141 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
11142 4) echo "Could not find F_SETFL!";;
11143 *) echo "Something terribly wrong happened during testing.";;
11145 rd_nodata=`$cat try.ret`
11146 echo "A read() system call with no data present returns $rd_nodata."
11147 case "$rd_nodata" in
11150 echo "(That's peculiar, fixing that to be -1.)"
11156 echo "Forcing errno EAGAIN on read() with no data available."
11160 echo "Your read() sets errno to $eagain when no data is available."
11163 status=`$cat try.err`
11165 0) echo "And it correctly returns 0 to signal EOF.";;
11166 -1) echo "But it also returns -1 to signal EOF, so be careful!";;
11167 *) echo "However, your read() returns '$status' on EOF??";;
11170 if test "$status" = "$rd_nodata"; then
11171 echo "WARNING: you can't distinguish between EOF and no data!"
11175 echo "I can't compile the test program--assuming errno EAGAIN will do."
11182 echo "Using $hint value $eagain."
11183 echo "Your read() returns $rd_nodata when no data is present."
11184 case "$d_eofnblk" in
11185 "$define") echo "And you can see EOF because read() returns 0.";;
11186 "$undef") echo "But you can't see EOF status from read() returned value.";;
11188 echo "(Assuming you can't see EOF status from read anyway.)"
11194 $rm -f try try.* .out core head.c mtry
11196 : see if fchdir exists
11197 set fchdir d_fchdir
11200 : see if fchmod exists
11201 set fchmod d_fchmod
11204 : see if fchown exists
11205 set fchown d_fchown
11208 : see if this is an fcntl system
11213 : See if fcntl-based locking works.
11215 #include <stdlib.h>
11216 #include <unistd.h>
11218 #include <signal.h>
11219 $signal_t blech(x) int x; { exit(3); }
11221 #if defined(F_SETLK) && defined(F_SETLKW)
11222 struct flock flock;
11224 fd = open("try.c", O_RDONLY);
11225 flock.l_type = F_RDLCK;
11226 flock.l_whence = SEEK_SET;
11227 flock.l_start = flock.l_len = 0;
11228 signal(SIGALRM, blech);
11230 retval = fcntl(fd, F_SETLK, &flock);
11232 (retval < 0 ? exit(2) : exit(0));
11238 echo "Checking if fcntl-based file locking works... "
11242 if eval $compile_ok; then
11243 if $run ./try; then
11244 echo "Yes, it seems to work."
11247 echo "Nope, it didn't work."
11252 *** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
11253 *** This is (almost) impossible.
11254 *** If your NFS lock daemons are not feeling well, something like
11255 *** this may happen, please investigate. Cannot continue, aborting.
11263 echo "I'm unable to compile the test program, so I'll assume not."
11268 echo "Nope, since you don't even have fcntl()."
11271 set d_fcntl_can_lock
11276 : check for fd_set items
11279 Checking to see how well your C compiler handles fd_set and friends ...
11282 #$i_systime I_SYS_TIME
11283 #$i_sysselct I_SYS_SELECT
11284 #$d_socket HAS_SOCKET
11285 #include <sys/types.h>
11287 #include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
11290 #include <sys/time.h>
11292 #ifdef I_SYS_SELECT
11293 #include <sys/select.h>
11302 #if defined(FD_SET) && defined(FD_CLR) && defined(FD_ISSET) && defined(FD_ZERO)
11310 if eval $compile; then
11311 d_fds_bits="$define"
11313 echo "Well, your system knows about the normal fd_set typedef..." >&4
11314 if $run ./try; then
11315 echo "and you have the normal fd_set macros (just as I'd expect)." >&4
11316 d_fd_macros="$define"
11319 but not the normal fd_set macros! Gaaack! I'll have to cover for you.
11321 d_fd_macros="$undef"
11325 Hmm, your compiler has some difficulty with fd_set. Checking further...
11328 if eval $compile; then
11329 d_fds_bits="$undef"
11331 echo "Well, your system has some sort of fd_set available..." >&4
11332 if $run ./try; then
11333 echo "and you have the normal fd_set macros." >&4
11334 d_fd_macros="$define"
11337 but not the normal fd_set macros! Gross! More work for me...
11339 d_fd_macros="$undef"
11342 echo "Well, you got zip. That's OK, I can roll my own fd_set stuff." >&4
11344 d_fds_bits="$undef"
11345 d_fd_macros="$undef"
11350 : see if fgetpos exists
11351 set fgetpos d_fgetpos
11354 : see if finite exists
11355 set finite d_finite
11358 : see if finitel exists
11359 set finitel d_finitel
11362 : see if flock exists
11366 : see if prototype for flock is available
11368 set d_flockproto flock $i_sysfile sys/file.h
11371 : see if fork exists
11375 : see if fp_class exists
11376 set fp_class d_fp_class
11379 : see if pathconf exists
11380 set pathconf d_pathconf
11383 : see if fpathconf exists
11384 set fpathconf d_fpathconf
11387 : see if fpclass exists
11388 set fpclass d_fpclass
11391 : see if fpclassify exists
11392 set fpclassify d_fpclassify
11395 : see if fpclassl exists
11396 set fpclassl d_fpclassl
11400 : check for fpos64_t
11402 echo "Checking to see if you have fpos64_t..." >&4
11405 int main() { fpos64_t x = 7; }
11408 if eval $compile; then
11410 echo "You have fpos64_t."
11413 echo "You do not have fpos64_t."
11414 case "$fpossize" in
11415 8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
11422 : see if frexpl exists
11423 set frexpl d_frexpl
11426 : see if this is a sys/param system
11427 set sys/param.h i_sysparam
11430 : see if this is a sys/mount.h system
11431 set sys/mount.h i_sysmount
11436 echo "Checking to see if your system supports struct fs_data..." >&4
11437 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
11439 case "$d_fs_data_s" in
11440 "$define") echo "Yes, it does." ;;
11441 *) echo "No, it doesn't." ;;
11444 : see if fseeko exists
11445 set fseeko d_fseeko
11447 case "$longsize" in
11448 8) echo "(Your long is 64 bits, so you could use fseek.)" ;;
11451 : see if fsetpos exists
11452 set fsetpos d_fsetpos
11456 : see if fstatfs exists
11457 set fstatfs d_fstatfs
11461 : see if statvfs exists
11462 set statvfs d_statvfs
11465 : see if fstatvfs exists
11466 set fstatvfs d_fstatvfs
11470 : see if fsync exists
11474 : see if ftello exists
11475 set ftello d_ftello
11477 case "$longsize" in
11478 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
11481 : see if getcwd exists
11482 set getcwd d_getcwd
11485 : see if getespwnam exists
11486 set getespwnam d_getespwnam
11490 : see if getfsstat exists
11491 set getfsstat d_getfsstat
11494 : see if getgrent exists
11495 set getgrent d_getgrent
11498 : see if getgrent_r exists
11499 set getgrent_r d_getgrent_r
11501 case "$d_getgrent_r" in
11503 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11504 case "$d_getgrent_r_proto:$usethreads" in
11505 ":define") d_getgrent_r_proto=define
11506 set d_getgrent_r_proto getgrent_r $hdrs
11510 case "$d_getgrent_r_proto" in
11512 case "$getgrent_r_proto" in
11513 ''|0) try='int getgrent_r(struct group*, char*, size_t, struct group**);'
11514 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBWR ;;
11516 case "$getgrent_r_proto" in
11517 ''|0) try='int getgrent_r(struct group*, char*, int, struct group**);'
11518 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIR ;;
11520 case "$getgrent_r_proto" in
11521 ''|0) try='struct group* getgrent_r(struct group*, char*, size_t);'
11522 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBW ;;
11524 case "$getgrent_r_proto" in
11525 ''|0) try='struct group* getgrent_r(struct group*, char*, int);'
11526 ./protochk "extern $try" $hdrs && getgrent_r_proto=S_SBI ;;
11528 case "$getgrent_r_proto" in
11529 ''|0) try='int getgrent_r(struct group*, char*, int);'
11530 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBI ;;
11532 case "$getgrent_r_proto" in
11533 ''|0) try='int getgrent_r(struct group*, char*, int, FILE**);'
11534 ./protochk "extern $try" $hdrs && getgrent_r_proto=I_SBIH ;;
11536 case "$getgrent_r_proto" in
11537 ''|0) d_getgrent_r=undef
11539 echo "Disabling getgrent_r, cannot determine prototype." >&4 ;;
11540 * ) case "$getgrent_r_proto" in
11541 REENTRANT_PROTO*) ;;
11542 *) getgrent_r_proto="REENTRANT_PROTO_$getgrent_r_proto" ;;
11544 echo "Prototype: $try" ;;
11547 *) case "$usethreads" in
11548 define) echo "getgrent_r has no prototype, not using it." >&4 ;;
11555 *) getgrent_r_proto=0
11559 : see if getgrgid_r exists
11560 set getgrgid_r d_getgrgid_r
11562 case "$d_getgrgid_r" in
11564 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11565 case "$d_getgrgid_r_proto:$usethreads" in
11566 ":define") d_getgrgid_r_proto=define
11567 set d_getgrgid_r_proto getgrgid_r $hdrs
11571 case "$d_getgrgid_r_proto" in
11573 case "$getgrgid_r_proto" in
11574 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, size_t, struct group**);'
11575 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBWR ;;
11577 case "$getgrgid_r_proto" in
11578 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int, struct group**);'
11579 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBIR ;;
11581 case "$getgrgid_r_proto" in
11582 ''|0) try='int getgrgid_r(gid_t, struct group*, char*, int);'
11583 ./protochk "extern $try" $hdrs && getgrgid_r_proto=I_TSBI ;;
11585 case "$getgrgid_r_proto" in
11586 ''|0) try='struct group* getgrgid_r(gid_t, struct group*, char*, int);'
11587 ./protochk "extern $try" $hdrs && getgrgid_r_proto=S_TSBI ;;
11589 case "$getgrgid_r_proto" in
11590 ''|0) d_getgrgid_r=undef
11592 echo "Disabling getgrgid_r, cannot determine prototype." >&4 ;;
11593 * ) case "$getgrgid_r_proto" in
11594 REENTRANT_PROTO*) ;;
11595 *) getgrgid_r_proto="REENTRANT_PROTO_$getgrgid_r_proto" ;;
11597 echo "Prototype: $try" ;;
11600 *) case "$usethreads" in
11601 define) echo "getgrgid_r has no prototype, not using it." >&4 ;;
11608 *) getgrgid_r_proto=0
11612 : see if getgrnam_r exists
11613 set getgrnam_r d_getgrnam_r
11615 case "$d_getgrnam_r" in
11617 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
11618 case "$d_getgrnam_r_proto:$usethreads" in
11619 ":define") d_getgrnam_r_proto=define
11620 set d_getgrnam_r_proto getgrnam_r $hdrs
11624 case "$d_getgrnam_r_proto" in
11626 case "$getgrnam_r_proto" in
11627 ''|0) try='int getgrnam_r(const char*, struct group*, char*, size_t, struct group**);'
11628 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBWR ;;
11630 case "$getgrnam_r_proto" in
11631 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int, struct group**);'
11632 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBIR ;;
11634 case "$getgrnam_r_proto" in
11635 ''|0) try='struct group* getgrnam_r(const char*, char*, int);'
11636 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CBI ;;
11638 case "$getgrnam_r_proto" in
11639 ''|0) try='int getgrnam_r(const char*, struct group*, char*, int);'
11640 ./protochk "extern $try" $hdrs && getgrnam_r_proto=I_CSBI ;;
11642 case "$getgrnam_r_proto" in
11643 ''|0) try='struct group* getgrnam_r(const char*, struct group*, char*, int);'
11644 ./protochk "extern $try" $hdrs && getgrnam_r_proto=S_CSBI ;;
11646 case "$getgrnam_r_proto" in
11647 ''|0) d_getgrnam_r=undef
11649 echo "Disabling getgrnam_r, cannot determine prototype." >&4 ;;
11650 * ) case "$getgrnam_r_proto" in
11651 REENTRANT_PROTO*) ;;
11652 *) getgrnam_r_proto="REENTRANT_PROTO_$getgrnam_r_proto" ;;
11654 echo "Prototype: $try" ;;
11657 *) case "$usethreads" in
11658 define) echo "getgrnam_r has no prototype, not using it." >&4 ;;
11665 *) getgrnam_r_proto=0
11669 : see if gethostbyaddr exists
11670 set gethostbyaddr d_gethbyaddr
11673 : see if gethostbyname exists
11674 set gethostbyname d_gethbyname
11677 : see if gethostent exists
11678 set gethostent d_gethent
11681 : see how we will look up host name
11684 if set gethostname val -f d_gethname; eval $csym; $val; then
11685 echo 'gethostname() found.' >&4
11686 d_gethname="$define"
11689 if set uname val -f d_uname; eval $csym; $val; then
11692 uname() was found, but you're running xenix, and older versions of xenix
11693 have a broken uname(). If you don't really know whether your xenix is old
11694 enough to have a broken system call, use the default answer.
11699 "$define") dflt=n;;
11701 rp='Is your uname() broken?'
11704 n*) d_uname="$define"; call=uname;;
11707 echo 'uname() found.' >&4
11714 case "$d_gethname" in
11715 '') d_gethname="$undef";;
11718 '') d_uname="$undef";;
11720 case "$d_uname$d_gethname" in
11725 Every now and then someone has a $call() that lies about the hostname
11726 but can't be fixed for political or economic reasons. If you wish, I can
11727 pretend $call() isn't there and maybe compute hostname at run-time
11728 thanks to the '$phostname' command.
11731 rp="Shall I ignore $call() from now on?"
11734 y*) d_uname="$undef" d_gethname="$undef"; $echo $n "Okay...$c";;
11737 case "$phostname" in
11738 '') aphostname='';;
11739 *) case "$aphostname" in
11741 *) set X $phostname
11745 file=`./loc $file $file $pth`
11746 aphostname=`echo $file $*`
11751 case "$d_uname$d_gethname" in
11754 case "$phostname" in
11756 echo "There will be no way for $package to get your hostname." >&4;;
11758 echo "I'll use 'popen("'"'$aphostname'", "r")'"' to get your hostname." >&4
11762 case "$d_phostname" in
11763 '') d_phostname="$undef";;
11766 : see if gethostbyaddr_r exists
11767 set gethostbyaddr_r d_gethostbyaddr_r
11769 case "$d_gethostbyaddr_r" in
11771 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11772 case "$d_gethostbyaddr_r_proto:$usethreads" in
11773 ":define") d_gethostbyaddr_r_proto=define
11774 set d_gethostbyaddr_r_proto gethostbyaddr_r $hdrs
11778 case "$d_gethostbyaddr_r_proto" in
11780 case "$gethostbyaddr_r_proto" in
11781 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, struct hostent**, int*);'
11782 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISBWRE ;;
11784 case "$gethostbyaddr_r_proto" in
11785 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, size_t, int, int*);'
11786 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBWIE ;;
11788 case "$gethostbyaddr_r_proto" in
11789 ''|0) try='struct hostent* gethostbyaddr_r(const char*, size_t, int, struct hostent*, char*, int, int*);'
11790 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CWISBIE ;;
11792 case "$gethostbyaddr_r_proto" in
11793 ''|0) try='struct hostent* gethostbyaddr_r(const void*, size_t, int, struct hostent*, char*, int, int*);'
11794 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TWISBIE ;;
11796 case "$gethostbyaddr_r_proto" in
11797 ''|0) try='struct hostent* gethostbyaddr_r(const char*, int, int, struct hostent*, char*, int, int*);'
11798 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CIISBIE ;;
11800 case "$gethostbyaddr_r_proto" in
11801 ''|0) try='struct hostent* gethostbyaddr_r(const char*, struct hostent*, char*, int, int*);'
11802 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_CSBIE ;;
11804 case "$gethostbyaddr_r_proto" in
11805 ''|0) try='struct hostent* gethostbyaddr_r(const void*, struct hostent*, char*, int, int*);'
11806 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=S_TSBIE ;;
11808 case "$gethostbyaddr_r_proto" in
11809 ''|0) try='int gethostbyaddr_r(const char*, size_t, int, struct hostent*, struct hostent_data*);'
11810 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CWISD ;;
11812 case "$gethostbyaddr_r_proto" in
11813 ''|0) try='int gethostbyaddr_r(const char*, int, int, struct hostent*, struct hostent_data*);'
11814 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CIISD ;;
11816 case "$gethostbyaddr_r_proto" in
11817 ''|0) try='int gethostbyaddr_r(const char*, int, int);'
11818 ./protochk "extern $try" $hdrs && gethostbyaddr_r_proto=I_CII ;;
11820 case "$gethostbyaddr_r_proto" in
11821 ''|0) d_gethostbyaddr_r=undef
11822 gethostbyaddr_r_proto=0
11823 echo "Disabling gethostbyaddr_r, cannot determine prototype." >&4 ;;
11824 * ) case "$gethostbyaddr_r_proto" in
11825 REENTRANT_PROTO*) ;;
11826 *) gethostbyaddr_r_proto="REENTRANT_PROTO_$gethostbyaddr_r_proto" ;;
11828 echo "Prototype: $try" ;;
11831 *) case "$usethreads" in
11832 define) echo "gethostbyaddr_r has no prototype, not using it." >&4 ;;
11834 d_gethostbyaddr_r=undef
11835 gethostbyaddr_r_proto=0
11839 *) gethostbyaddr_r_proto=0
11843 : see if gethostbyname_r exists
11844 set gethostbyname_r d_gethostbyname_r
11846 case "$d_gethostbyname_r" in
11848 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11849 case "$d_gethostbyname_r_proto:$usethreads" in
11850 ":define") d_gethostbyname_r_proto=define
11851 set d_gethostbyname_r_proto gethostbyname_r $hdrs
11855 case "$d_gethostbyname_r_proto" in
11857 case "$gethostbyname_r_proto" in
11858 ''|0) try='int gethostbyname_r(const char*, struct hostent*, char*, size_t, struct hostent**, int*);'
11859 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSBWRE ;;
11861 case "$gethostbyname_r_proto" in
11862 ''|0) try='struct hostent* gethostbyname_r(const char*, struct hostent*, char*, int, int*);'
11863 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=S_CSBIE ;;
11865 case "$gethostbyname_r_proto" in
11866 ''|0) try='int gethostbyname_r(const char*, struct hostent*, struct hostent_data*);'
11867 ./protochk "extern $try" $hdrs && gethostbyname_r_proto=I_CSD ;;
11869 case "$gethostbyname_r_proto" in
11870 ''|0) d_gethostbyname_r=undef
11871 gethostbyname_r_proto=0
11872 echo "Disabling gethostbyname_r, cannot determine prototype." >&4 ;;
11873 * ) case "$gethostbyname_r_proto" in
11874 REENTRANT_PROTO*) ;;
11875 *) gethostbyname_r_proto="REENTRANT_PROTO_$gethostbyname_r_proto" ;;
11877 echo "Prototype: $try" ;;
11880 *) case "$usethreads" in
11881 define) echo "gethostbyname_r has no prototype, not using it." >&4 ;;
11883 d_gethostbyname_r=undef
11884 gethostbyname_r_proto=0
11888 *) gethostbyname_r_proto=0
11892 : see if gethostent_r exists
11893 set gethostent_r d_gethostent_r
11895 case "$d_gethostent_r" in
11897 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
11898 case "$d_gethostent_r_proto:$usethreads" in
11899 ":define") d_gethostent_r_proto=define
11900 set d_gethostent_r_proto gethostent_r $hdrs
11904 case "$d_gethostent_r_proto" in
11906 case "$gethostent_r_proto" in
11907 ''|0) try='int gethostent_r(struct hostent*, char*, size_t, struct hostent**, int*);'
11908 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBWRE ;;
11910 case "$gethostent_r_proto" in
11911 ''|0) try='int gethostent_r(struct hostent*, char*, int, int*);'
11912 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBIE ;;
11914 case "$gethostent_r_proto" in
11915 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int, int*);'
11916 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBIE ;;
11918 case "$gethostent_r_proto" in
11919 ''|0) try='struct hostent* gethostent_r(struct hostent*, char*, int);'
11920 ./protochk "extern $try" $hdrs && gethostent_r_proto=S_SBI ;;
11922 case "$gethostent_r_proto" in
11923 ''|0) try='int gethostent_r(struct hostent*, char*, int);'
11924 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SBI ;;
11926 case "$gethostent_r_proto" in
11927 ''|0) try='int gethostent_r(struct hostent*, struct hostent_data*);'
11928 ./protochk "extern $try" $hdrs && gethostent_r_proto=I_SD ;;
11930 case "$gethostent_r_proto" in
11931 ''|0) d_gethostent_r=undef
11932 gethostent_r_proto=0
11933 echo "Disabling gethostent_r, cannot determine prototype." >&4 ;;
11934 * ) case "$gethostent_r_proto" in
11935 REENTRANT_PROTO*) ;;
11936 *) gethostent_r_proto="REENTRANT_PROTO_$gethostent_r_proto" ;;
11938 echo "Prototype: $try" ;;
11941 *) case "$usethreads" in
11942 define) echo "gethostent_r has no prototype, not using it." >&4 ;;
11944 d_gethostent_r=undef
11945 gethostent_r_proto=0
11949 *) gethostent_r_proto=0
11953 : see if prototypes for various gethostxxx netdb.h functions are available
11955 set d_gethostprotos gethostent $i_netdb netdb.h
11958 : see if getitimer exists
11959 set getitimer d_getitimer
11962 : see if getlogin exists
11963 set getlogin d_getlogin
11966 : see if getlogin_r exists
11967 set getlogin_r d_getlogin_r
11969 case "$d_getlogin_r" in
11971 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
11972 case "$d_getlogin_r_proto:$usethreads" in
11973 ":define") d_getlogin_r_proto=define
11974 set d_getlogin_r_proto getlogin_r $hdrs
11978 case "$d_getlogin_r_proto" in
11980 case "$getlogin_r_proto" in
11981 ''|0) try='int getlogin_r(char*, size_t);'
11982 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BW ;;
11984 case "$getlogin_r_proto" in
11985 ''|0) try='int getlogin_r(char*, int);'
11986 ./protochk "extern $try" $hdrs && getlogin_r_proto=I_BI ;;
11988 case "$getlogin_r_proto" in
11989 ''|0) try='char* getlogin_r(char*, size_t);'
11990 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BW ;;
11992 case "$getlogin_r_proto" in
11993 ''|0) try='char* getlogin_r(char*, int);'
11994 ./protochk "extern $try" $hdrs && getlogin_r_proto=B_BI ;;
11996 case "$getlogin_r_proto" in
11997 ''|0) d_getlogin_r=undef
11999 echo "Disabling getlogin_r, cannot determine prototype." >&4 ;;
12000 * ) case "$getlogin_r_proto" in
12001 REENTRANT_PROTO*) ;;
12002 *) getlogin_r_proto="REENTRANT_PROTO_$getlogin_r_proto" ;;
12004 echo "Prototype: $try" ;;
12007 *) case "$usethreads" in
12008 define) echo "getlogin_r has no prototype, not using it." >&4 ;;
12015 *) getlogin_r_proto=0
12019 : see if getmnt exists
12020 set getmnt d_getmnt
12023 : see if getmntent exists
12024 set getmntent d_getmntent
12027 : see if getnetbyaddr exists
12028 set getnetbyaddr d_getnbyaddr
12031 : see if getnetbyname exists
12032 set getnetbyname d_getnbyname
12035 : see if getnetent exists
12036 set getnetent d_getnent
12039 : see if getnetbyaddr_r exists
12040 set getnetbyaddr_r d_getnetbyaddr_r
12042 case "$d_getnetbyaddr_r" in
12044 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12045 case "$d_getnetbyaddr_r_proto:$usethreads" in
12046 ":define") d_getnetbyaddr_r_proto=define
12047 set d_getnetbyaddr_r_proto getnetbyaddr_r $hdrs
12051 case "$d_getnetbyaddr_r_proto" in
12053 case "$getnetbyaddr_r_proto" in
12054 ''|0) try='int getnetbyaddr_r(unsigned long, int, struct netent*, char*, size_t, struct netent**, int*);'
12055 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_UISBWRE ;;
12057 case "$getnetbyaddr_r_proto" in
12058 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, char*, int);'
12059 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISBI ;;
12061 case "$getnetbyaddr_r_proto" in
12062 ''|0) try='struct netent* getnetbyaddr_r(in_addr_t, int, struct netent*, char*, int);'
12063 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_TISBI ;;
12065 case "$getnetbyaddr_r_proto" in
12066 ''|0) try='struct netent* getnetbyaddr_r(long, int, struct netent*, char*, int);'
12067 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=S_LISBI ;;
12069 case "$getnetbyaddr_r_proto" in
12070 ''|0) try='int getnetbyaddr_r(in_addr_t, int, struct netent*, struct netent_data*);'
12071 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_TISD ;;
12073 case "$getnetbyaddr_r_proto" in
12074 ''|0) try='int getnetbyaddr_r(long, int, struct netent*, struct netent_data*);'
12075 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_LISD ;;
12077 case "$getnetbyaddr_r_proto" in
12078 ''|0) try='int getnetbyaddr_r(int, int, struct netent*, struct netent_data*);'
12079 ./protochk "extern $try" $hdrs && getnetbyaddr_r_proto=I_IISD ;;
12081 case "$getnetbyaddr_r_proto" in
12082 ''|0) d_getnetbyaddr_r=undef
12083 getnetbyaddr_r_proto=0
12084 echo "Disabling getnetbyaddr_r, cannot determine prototype." >&4 ;;
12085 * ) case "$getnetbyaddr_r_proto" in
12086 REENTRANT_PROTO*) ;;
12087 *) getnetbyaddr_r_proto="REENTRANT_PROTO_$getnetbyaddr_r_proto" ;;
12089 echo "Prototype: $try" ;;
12092 *) case "$usethreads" in
12093 define) echo "getnetbyaddr_r has no prototype, not using it." >&4 ;;
12095 d_getnetbyaddr_r=undef
12096 getnetbyaddr_r_proto=0
12100 *) getnetbyaddr_r_proto=0
12104 : see if getnetbyname_r exists
12105 set getnetbyname_r d_getnetbyname_r
12107 case "$d_getnetbyname_r" in
12109 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12110 case "$d_getnetbyname_r_proto:$usethreads" in
12111 ":define") d_getnetbyname_r_proto=define
12112 set d_getnetbyname_r_proto getnetbyname_r $hdrs
12116 case "$d_getnetbyname_r_proto" in
12118 case "$getnetbyname_r_proto" in
12119 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, size_t, struct netent**, int*);'
12120 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBWRE ;;
12122 case "$getnetbyname_r_proto" in
12123 ''|0) try='int getnetbyname_r(const char*, struct netent*, char*, int);'
12124 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSBI ;;
12126 case "$getnetbyname_r_proto" in
12127 ''|0) try='struct netent* getnetbyname_r(const char*, struct netent*, char*, int);'
12128 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=S_CSBI ;;
12130 case "$getnetbyname_r_proto" in
12131 ''|0) try='int getnetbyname_r(const char*, struct netent*, struct netent_data*);'
12132 ./protochk "extern $try" $hdrs && getnetbyname_r_proto=I_CSD ;;
12134 case "$getnetbyname_r_proto" in
12135 ''|0) d_getnetbyname_r=undef
12136 getnetbyname_r_proto=0
12137 echo "Disabling getnetbyname_r, cannot determine prototype." >&4 ;;
12138 * ) case "$getnetbyname_r_proto" in
12139 REENTRANT_PROTO*) ;;
12140 *) getnetbyname_r_proto="REENTRANT_PROTO_$getnetbyname_r_proto" ;;
12142 echo "Prototype: $try" ;;
12145 *) case "$usethreads" in
12146 define) echo "getnetbyname_r has no prototype, not using it." >&4 ;;
12148 d_getnetbyname_r=undef
12149 getnetbyname_r_proto=0
12153 *) getnetbyname_r_proto=0
12157 : see if getnetent_r exists
12158 set getnetent_r d_getnetent_r
12160 case "$d_getnetent_r" in
12162 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12163 case "$d_getnetent_r_proto:$usethreads" in
12164 ":define") d_getnetent_r_proto=define
12165 set d_getnetent_r_proto getnetent_r $hdrs
12169 case "$d_getnetent_r_proto" in
12171 case "$getnetent_r_proto" in
12172 ''|0) try='int getnetent_r(struct netent*, char*, size_t, struct netent**, int*);'
12173 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBWRE ;;
12175 case "$getnetent_r_proto" in
12176 ''|0) try='int getnetent_r(struct netent*, char*, int, int*);'
12177 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBIE ;;
12179 case "$getnetent_r_proto" in
12180 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int, int*);'
12181 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBIE ;;
12183 case "$getnetent_r_proto" in
12184 ''|0) try='struct netent* getnetent_r(struct netent*, char*, int);'
12185 ./protochk "extern $try" $hdrs && getnetent_r_proto=S_SBI ;;
12187 case "$getnetent_r_proto" in
12188 ''|0) try='int getnetent_r(struct netent*, char*, int);'
12189 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SBI ;;
12191 case "$getnetent_r_proto" in
12192 ''|0) try='int getnetent_r(struct netent*, struct netent_data*);'
12193 ./protochk "extern $try" $hdrs && getnetent_r_proto=I_SD ;;
12195 case "$getnetent_r_proto" in
12196 ''|0) d_getnetent_r=undef
12197 getnetent_r_proto=0
12198 echo "Disabling getnetent_r, cannot determine prototype." >&4 ;;
12199 * ) case "$getnetent_r_proto" in
12200 REENTRANT_PROTO*) ;;
12201 *) getnetent_r_proto="REENTRANT_PROTO_$getnetent_r_proto" ;;
12203 echo "Prototype: $try" ;;
12206 *) case "$usethreads" in
12207 define) echo "getnetent_r has no prototype, not using it." >&4 ;;
12209 d_getnetent_r=undef
12210 getnetent_r_proto=0
12214 *) getnetent_r_proto=0
12218 : see if prototypes for various getnetxxx netdb.h functions are available
12220 set d_getnetprotos getnetent $i_netdb netdb.h
12223 : see if getpagesize exists
12224 set getpagesize d_getpagsz
12228 : see if getprotobyname exists
12229 set getprotobyname d_getpbyname
12232 : see if getprotobynumber exists
12233 set getprotobynumber d_getpbynumber
12236 : see if getprotoent exists
12237 set getprotoent d_getpent
12240 : see if getpgid exists
12241 set getpgid d_getpgid
12244 : see if getpgrp2 exists
12245 set getpgrp2 d_getpgrp2
12248 : see if getppid exists
12249 set getppid d_getppid
12252 : see if getpriority exists
12253 set getpriority d_getprior
12256 : see if getprotobyname_r exists
12257 set getprotobyname_r d_getprotobyname_r
12259 case "$d_getprotobyname_r" in
12261 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12262 case "$d_getprotobyname_r_proto:$usethreads" in
12263 ":define") d_getprotobyname_r_proto=define
12264 set d_getprotobyname_r_proto getprotobyname_r $hdrs
12268 case "$d_getprotobyname_r_proto" in
12270 case "$getprotobyname_r_proto" in
12271 ''|0) try='int getprotobyname_r(const char*, struct protoent*, char*, size_t, struct protoent**);'
12272 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSBWR ;;
12274 case "$getprotobyname_r_proto" in
12275 ''|0) try='struct protoent* getprotobyname_r(const char*, struct protoent*, char*, int);'
12276 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=S_CSBI ;;
12278 case "$getprotobyname_r_proto" in
12279 ''|0) try='int getprotobyname_r(const char*, struct protoent*, struct protoent_data*);'
12280 ./protochk "extern $try" $hdrs && getprotobyname_r_proto=I_CSD ;;
12282 case "$getprotobyname_r_proto" in
12283 ''|0) d_getprotobyname_r=undef
12284 getprotobyname_r_proto=0
12285 echo "Disabling getprotobyname_r, cannot determine prototype." >&4 ;;
12286 * ) case "$getprotobyname_r_proto" in
12287 REENTRANT_PROTO*) ;;
12288 *) getprotobyname_r_proto="REENTRANT_PROTO_$getprotobyname_r_proto" ;;
12290 echo "Prototype: $try" ;;
12293 *) case "$usethreads" in
12294 define) echo "getprotobyname_r has no prototype, not using it." >&4 ;;
12296 d_getprotobyname_r=undef
12297 getprotobyname_r_proto=0
12301 *) getprotobyname_r_proto=0
12305 : see if getprotobynumber_r exists
12306 set getprotobynumber_r d_getprotobynumber_r
12308 case "$d_getprotobynumber_r" in
12310 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12311 case "$d_getprotobynumber_r_proto:$usethreads" in
12312 ":define") d_getprotobynumber_r_proto=define
12313 set d_getprotobynumber_r_proto getprotobynumber_r $hdrs
12317 case "$d_getprotobynumber_r_proto" in
12319 case "$getprotobynumber_r_proto" in
12320 ''|0) try='int getprotobynumber_r(int, struct protoent*, char*, size_t, struct protoent**);'
12321 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISBWR ;;
12323 case "$getprotobynumber_r_proto" in
12324 ''|0) try='struct protoent* getprotobynumber_r(int, struct protoent*, char*, int);'
12325 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=S_ISBI ;;
12327 case "$getprotobynumber_r_proto" in
12328 ''|0) try='int getprotobynumber_r(int, struct protoent*, struct protoent_data*);'
12329 ./protochk "extern $try" $hdrs && getprotobynumber_r_proto=I_ISD ;;
12331 case "$getprotobynumber_r_proto" in
12332 ''|0) d_getprotobynumber_r=undef
12333 getprotobynumber_r_proto=0
12334 echo "Disabling getprotobynumber_r, cannot determine prototype." >&4 ;;
12335 * ) case "$getprotobynumber_r_proto" in
12336 REENTRANT_PROTO*) ;;
12337 *) getprotobynumber_r_proto="REENTRANT_PROTO_$getprotobynumber_r_proto" ;;
12339 echo "Prototype: $try" ;;
12342 *) case "$usethreads" in
12343 define) echo "getprotobynumber_r has no prototype, not using it." >&4 ;;
12345 d_getprotobynumber_r=undef
12346 getprotobynumber_r_proto=0
12350 *) getprotobynumber_r_proto=0
12354 : see if getprotoent_r exists
12355 set getprotoent_r d_getprotoent_r
12357 case "$d_getprotoent_r" in
12359 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12360 case "$d_getprotoent_r_proto:$usethreads" in
12361 ":define") d_getprotoent_r_proto=define
12362 set d_getprotoent_r_proto getprotoent_r $hdrs
12366 case "$d_getprotoent_r_proto" in
12368 case "$getprotoent_r_proto" in
12369 ''|0) try='int getprotoent_r(struct protoent*, char*, size_t, struct protoent**);'
12370 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBWR ;;
12372 case "$getprotoent_r_proto" in
12373 ''|0) try='int getprotoent_r(struct protoent*, char*, int);'
12374 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SBI ;;
12376 case "$getprotoent_r_proto" in
12377 ''|0) try='struct protoent* getprotoent_r(struct protoent*, char*, int);'
12378 ./protochk "extern $try" $hdrs && getprotoent_r_proto=S_SBI ;;
12380 case "$getprotoent_r_proto" in
12381 ''|0) try='int getprotoent_r(struct protoent*, struct protoent_data*);'
12382 ./protochk "extern $try" $hdrs && getprotoent_r_proto=I_SD ;;
12384 case "$getprotoent_r_proto" in
12385 ''|0) d_getprotoent_r=undef
12386 getprotoent_r_proto=0
12387 echo "Disabling getprotoent_r, cannot determine prototype." >&4 ;;
12388 * ) case "$getprotoent_r_proto" in
12389 REENTRANT_PROTO*) ;;
12390 *) getprotoent_r_proto="REENTRANT_PROTO_$getprotoent_r_proto" ;;
12392 echo "Prototype: $try" ;;
12395 *) case "$usethreads" in
12396 define) echo "getprotoent_r has no prototype, not using it." >&4 ;;
12398 d_getprotoent_r=undef
12399 getprotoent_r_proto=0
12403 *) getprotoent_r_proto=0
12407 : see if prototypes for various getprotoxxx netdb.h functions are available
12409 set d_getprotoprotos getprotoent $i_netdb netdb.h
12412 : see if getprpwnam exists
12413 set getprpwnam d_getprpwnam
12416 : see if getpwent exists
12417 set getpwent d_getpwent
12420 : see if getpwent_r exists
12421 set getpwent_r d_getpwent_r
12423 case "$d_getpwent_r" in
12425 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12426 case "$d_getpwent_r_proto:$usethreads" in
12427 ":define") d_getpwent_r_proto=define
12428 set d_getpwent_r_proto getpwent_r $hdrs
12432 case "$d_getpwent_r_proto" in
12434 case "$getpwent_r_proto" in
12435 ''|0) try='int getpwent_r(struct passwd*, char*, size_t, struct passwd**);'
12436 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBWR ;;
12438 case "$getpwent_r_proto" in
12439 ''|0) try='int getpwent_r(struct passwd*, char*, int, struct passwd**);'
12440 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIR ;;
12442 case "$getpwent_r_proto" in
12443 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, size_t);'
12444 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBW ;;
12446 case "$getpwent_r_proto" in
12447 ''|0) try='struct passwd* getpwent_r(struct passwd*, char*, int);'
12448 ./protochk "extern $try" $hdrs && getpwent_r_proto=S_SBI ;;
12450 case "$getpwent_r_proto" in
12451 ''|0) try='int getpwent_r(struct passwd*, char*, int);'
12452 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBI ;;
12454 case "$getpwent_r_proto" in
12455 ''|0) try='int getpwent_r(struct passwd*, char*, int, FILE**);'
12456 ./protochk "extern $try" $hdrs && getpwent_r_proto=I_SBIH ;;
12458 case "$getpwent_r_proto" in
12459 ''|0) d_getpwent_r=undef
12461 echo "Disabling getpwent_r, cannot determine prototype." >&4 ;;
12462 * ) case "$getpwent_r_proto" in
12463 REENTRANT_PROTO*) ;;
12464 *) getpwent_r_proto="REENTRANT_PROTO_$getpwent_r_proto" ;;
12466 echo "Prototype: $try" ;;
12469 *) case "$usethreads" in
12470 define) echo "getpwent_r has no prototype, not using it." >&4 ;;
12477 *) getpwent_r_proto=0
12481 : see if getpwnam_r exists
12482 set getpwnam_r d_getpwnam_r
12484 case "$d_getpwnam_r" in
12486 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12487 case "$d_getpwnam_r_proto:$usethreads" in
12488 ":define") d_getpwnam_r_proto=define
12489 set d_getpwnam_r_proto getpwnam_r $hdrs
12493 case "$d_getpwnam_r_proto" in
12495 case "$getpwnam_r_proto" in
12496 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, size_t, struct passwd**);'
12497 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBWR ;;
12499 case "$getpwnam_r_proto" in
12500 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int, struct passwd**);'
12501 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBIR ;;
12503 case "$getpwnam_r_proto" in
12504 ''|0) try='struct passwd* getpwnam_r(const char*, struct passwd*, char*, int);'
12505 ./protochk "extern $try" $hdrs && getpwnam_r_proto=S_CSBI ;;
12507 case "$getpwnam_r_proto" in
12508 ''|0) try='int getpwnam_r(const char*, struct passwd*, char*, int);'
12509 ./protochk "extern $try" $hdrs && getpwnam_r_proto=I_CSBI ;;
12511 case "$getpwnam_r_proto" in
12512 ''|0) d_getpwnam_r=undef
12514 echo "Disabling getpwnam_r, cannot determine prototype." >&4 ;;
12515 * ) case "$getpwnam_r_proto" in
12516 REENTRANT_PROTO*) ;;
12517 *) getpwnam_r_proto="REENTRANT_PROTO_$getpwnam_r_proto" ;;
12519 echo "Prototype: $try" ;;
12522 *) case "$usethreads" in
12523 define) echo "getpwnam_r has no prototype, not using it." >&4 ;;
12530 *) getpwnam_r_proto=0
12534 : see if getpwuid_r exists
12535 set getpwuid_r d_getpwuid_r
12537 case "$d_getpwuid_r" in
12539 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
12540 case "$d_getpwuid_r_proto:$usethreads" in
12541 ":define") d_getpwuid_r_proto=define
12542 set d_getpwuid_r_proto getpwuid_r $hdrs
12546 case "$d_getpwuid_r_proto" in
12548 case "$getpwuid_r_proto" in
12549 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, size_t, struct passwd**);'
12550 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBWR ;;
12552 case "$getpwuid_r_proto" in
12553 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int, struct passwd**);'
12554 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBIR ;;
12556 case "$getpwuid_r_proto" in
12557 ''|0) try='int getpwuid_r(uid_t, struct passwd*, char*, int);'
12558 ./protochk "extern $try" $hdrs && getpwuid_r_proto=I_TSBI ;;
12560 case "$getpwuid_r_proto" in
12561 ''|0) try='struct passwd* getpwuid_r(uid_t, struct passwd*, char*, int);'
12562 ./protochk "extern $try" $hdrs && getpwuid_r_proto=S_TSBI ;;
12564 case "$getpwuid_r_proto" in
12565 ''|0) d_getpwuid_r=undef
12567 echo "Disabling getpwuid_r, cannot determine prototype." >&4 ;;
12568 * ) case "$getpwuid_r_proto" in
12569 REENTRANT_PROTO*) ;;
12570 *) getpwuid_r_proto="REENTRANT_PROTO_$getpwuid_r_proto" ;;
12572 echo "Prototype: $try" ;;
12575 *) case "$usethreads" in
12576 define) echo "getpwuid_r has no prototype, not using it." >&4 ;;
12583 *) getpwuid_r_proto=0
12588 : see if getservbyname exists
12589 set getservbyname d_getsbyname
12592 : see if getservbyport exists
12593 set getservbyport d_getsbyport
12596 : see if getservent exists
12597 set getservent d_getsent
12600 : see if getservbyname_r exists
12601 set getservbyname_r d_getservbyname_r
12603 case "$d_getservbyname_r" in
12605 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12606 case "$d_getservbyname_r_proto:$usethreads" in
12607 ":define") d_getservbyname_r_proto=define
12608 set d_getservbyname_r_proto getservbyname_r $hdrs
12612 case "$d_getservbyname_r_proto" in
12614 case "$getservbyname_r_proto" in
12615 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, char*, size_t, struct servent**);'
12616 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSBWR ;;
12618 case "$getservbyname_r_proto" in
12619 ''|0) try='struct servent* getservbyname_r(const char*, const char*, struct servent*, char*, int);'
12620 ./protochk "extern $try" $hdrs && getservbyname_r_proto=S_CCSBI ;;
12622 case "$getservbyname_r_proto" in
12623 ''|0) try='int getservbyname_r(const char*, const char*, struct servent*, struct servent_data*);'
12624 ./protochk "extern $try" $hdrs && getservbyname_r_proto=I_CCSD ;;
12626 case "$getservbyname_r_proto" in
12627 ''|0) d_getservbyname_r=undef
12628 getservbyname_r_proto=0
12629 echo "Disabling getservbyname_r, cannot determine prototype." >&4 ;;
12630 * ) case "$getservbyname_r_proto" in
12631 REENTRANT_PROTO*) ;;
12632 *) getservbyname_r_proto="REENTRANT_PROTO_$getservbyname_r_proto" ;;
12634 echo "Prototype: $try" ;;
12637 *) case "$usethreads" in
12638 define) echo "getservbyname_r has no prototype, not using it." >&4 ;;
12640 d_getservbyname_r=undef
12641 getservbyname_r_proto=0
12645 *) getservbyname_r_proto=0
12649 : see if getservbyport_r exists
12650 set getservbyport_r d_getservbyport_r
12652 case "$d_getservbyport_r" in
12654 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12655 case "$d_getservbyport_r_proto:$usethreads" in
12656 ":define") d_getservbyport_r_proto=define
12657 set d_getservbyport_r_proto getservbyport_r $hdrs
12661 case "$d_getservbyport_r_proto" in
12663 case "$getservbyport_r_proto" in
12664 ''|0) try='int getservbyport_r(int, const char*, struct servent*, char*, size_t, struct servent**);'
12665 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSBWR ;;
12667 case "$getservbyport_r_proto" in
12668 ''|0) try='struct servent* getservbyport_r(int, const char*, struct servent*, char*, int);'
12669 ./protochk "extern $try" $hdrs && getservbyport_r_proto=S_ICSBI ;;
12671 case "$getservbyport_r_proto" in
12672 ''|0) try='int getservbyport_r(int, const char*, struct servent*, struct servent_data*);'
12673 ./protochk "extern $try" $hdrs && getservbyport_r_proto=I_ICSD ;;
12675 case "$getservbyport_r_proto" in
12676 ''|0) d_getservbyport_r=undef
12677 getservbyport_r_proto=0
12678 echo "Disabling getservbyport_r, cannot determine prototype." >&4 ;;
12679 * ) case "$getservbyport_r_proto" in
12680 REENTRANT_PROTO*) ;;
12681 *) getservbyport_r_proto="REENTRANT_PROTO_$getservbyport_r_proto" ;;
12683 echo "Prototype: $try" ;;
12686 *) case "$usethreads" in
12687 define) echo "getservbyport_r has no prototype, not using it." >&4 ;;
12689 d_getservbyport_r=undef
12690 getservbyport_r_proto=0
12694 *) getservbyport_r_proto=0
12698 : see if getservent_r exists
12699 set getservent_r d_getservent_r
12701 case "$d_getservent_r" in
12703 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
12704 case "$d_getservent_r_proto:$usethreads" in
12705 ":define") d_getservent_r_proto=define
12706 set d_getservent_r_proto getservent_r $hdrs
12710 case "$d_getservent_r_proto" in
12712 case "$getservent_r_proto" in
12713 ''|0) try='int getservent_r(struct servent*, char*, size_t, struct servent**);'
12714 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBWR ;;
12716 case "$getservent_r_proto" in
12717 ''|0) try='int getservent_r(struct servent*, char*, int);'
12718 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SBI ;;
12720 case "$getservent_r_proto" in
12721 ''|0) try='struct servent* getservent_r(struct servent*, char*, int);'
12722 ./protochk "extern $try" $hdrs && getservent_r_proto=S_SBI ;;
12724 case "$getservent_r_proto" in
12725 ''|0) try='int getservent_r(struct servent*, struct servent_data*);'
12726 ./protochk "extern $try" $hdrs && getservent_r_proto=I_SD ;;
12728 case "$getservent_r_proto" in
12729 ''|0) d_getservent_r=undef
12730 getservent_r_proto=0
12731 echo "Disabling getservent_r, cannot determine prototype." >&4 ;;
12732 * ) case "$getservent_r_proto" in
12733 REENTRANT_PROTO*) ;;
12734 *) getservent_r_proto="REENTRANT_PROTO_$getservent_r_proto" ;;
12736 echo "Prototype: $try" ;;
12739 *) case "$usethreads" in
12740 define) echo "getservent_r has no prototype, not using it." >&4 ;;
12742 d_getservent_r=undef
12743 getservent_r_proto=0
12747 *) getservent_r_proto=0
12751 : see if prototypes for various getservxxx netdb.h functions are available
12753 set d_getservprotos getservent $i_netdb netdb.h
12756 : see if getspnam exists
12757 set getspnam d_getspnam
12760 : see if this is a shadow.h system
12761 set shadow.h i_shadow
12764 : see if getspnam_r exists
12765 set getspnam_r d_getspnam_r
12767 case "$d_getspnam_r" in
12769 hdrs="$i_systypes sys/types.h define stdio.h $i_shadow shadow.h"
12770 case "$d_getspnam_r_proto:$usethreads" in
12771 ":define") d_getspnam_r_proto=define
12772 set d_getspnam_r_proto getspnam_r $hdrs
12776 case "$d_getspnam_r_proto" in
12778 case "$getspnam_r_proto" in
12779 ''|0) try='int getspnam_r(const char*, struct spwd*, char*, size_t, struct spwd**);'
12780 ./protochk "extern $try" $hdrs && getspnam_r_proto=I_CSBWR ;;
12782 case "$getspnam_r_proto" in
12783 ''|0) try='struct spwd* getspnam_r(const char*, struct spwd*, char*, int);'
12784 ./protochk "extern $try" $hdrs && getspnam_r_proto=S_CSBI ;;
12786 case "$getspnam_r_proto" in
12787 ''|0) d_getspnam_r=undef
12789 echo "Disabling getspnam_r, cannot determine prototype." >&4 ;;
12790 * ) case "$getspnam_r_proto" in
12791 REENTRANT_PROTO*) ;;
12792 *) getspnam_r_proto="REENTRANT_PROTO_$getspnam_r_proto" ;;
12794 echo "Prototype: $try" ;;
12797 *) case "$usethreads" in
12798 define) echo "getspnam_r has no prototype, not using it." >&4 ;;
12805 *) getspnam_r_proto=0
12809 : see if gettimeofday or ftime exists
12810 set gettimeofday d_gettimeod
12812 case "$d_gettimeod" in
12818 val="$undef"; set d_ftime; eval $setvar
12821 case "$d_gettimeod$d_ftime" in
12824 echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
12828 : see if gmtime_r exists
12829 set gmtime_r d_gmtime_r
12831 case "$d_gmtime_r" in
12833 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
12834 case "$d_gmtime_r_proto:$usethreads" in
12835 ":define") d_gmtime_r_proto=define
12836 set d_gmtime_r_proto gmtime_r $hdrs
12840 case "$d_gmtime_r_proto" in
12842 case "$gmtime_r_proto" in
12843 ''|0) try='struct tm* gmtime_r(const time_t*, struct tm*);'
12844 ./protochk "extern $try" $hdrs && gmtime_r_proto=S_TS ;;
12846 case "$gmtime_r_proto" in
12847 ''|0) try='int gmtime_r(const time_t*, struct tm*);'
12848 ./protochk "extern $try" $hdrs && gmtime_r_proto=I_TS ;;
12850 case "$gmtime_r_proto" in
12851 ''|0) d_gmtime_r=undef
12853 echo "Disabling gmtime_r, cannot determine prototype." >&4 ;;
12854 * ) case "$gmtime_r_proto" in
12855 REENTRANT_PROTO*) ;;
12856 *) gmtime_r_proto="REENTRANT_PROTO_$gmtime_r_proto" ;;
12858 echo "Prototype: $try" ;;
12861 *) case "$usethreads" in
12862 define) echo "gmtime_r has no prototype, not using it." >&4 ;;
12869 *) gmtime_r_proto=0
12873 : see if hasmntopt exists
12874 set hasmntopt d_hasmntopt
12877 : see if this is a netinet/in.h or sys/in.h system
12878 set netinet/in.h i_niin sys/in.h i_sysin
12881 : see if arpa/inet.h has to be included
12882 set arpa/inet.h i_arpainet
12885 : see if htonl --and friends-- exists
12890 : Maybe they are macros.
12893 $cat >htonl.c <<EOM
12895 #include <sys/types.h>
12896 #$i_niin I_NETINET_IN
12898 #$i_arpainet I_ARPA_INET
12899 #ifdef I_NETINET_IN
12900 #include <netinet/in.h>
12903 #include <sys/in.h>
12906 #include <arpa/inet.h>
12909 printf("Defined as a macro.");
12912 $cppstdin $cppflags $cppminus < htonl.c >htonl.E 2>/dev/null
12913 if $contains 'Defined as a macro' htonl.E >/dev/null 2>&1; then
12915 echo "But it seems to be defined as a macro." >&4
12925 if set index val -f; eval $csym; $val; then
12926 if set strchr val -f d_strchr; eval $csym; $val; then
12927 if $contains strchr "$strings" >/dev/null 2>&1 ; then
12930 echo "strchr() found." >&4
12934 echo "index() found." >&4
12939 echo "index() found." >&4
12942 if set strchr val -f d_strchr; eval $csym; $val; then
12945 echo "strchr() found." >&4
12947 echo "No index() or strchr() found!" >&4
12952 set d_strchr; eval $setvar
12954 set d_index; eval $setvar
12956 : check whether inet_aton exists
12957 set inet_aton d_inetaton
12962 $cat >isascii.c <<'EOCP'
12974 if eval $compile; then
12975 echo "isascii() found." >&4
12978 echo "isascii() NOT found." >&4
12985 : see if isfinite exists
12986 set isfinite d_isfinite
12989 : see if isinf exists
12993 : see if isnan exists
12997 : see if isnanl exists
12998 set isnanl d_isnanl
13001 : see if killpg exists
13002 set killpg d_killpg
13005 : see if lchown exists
13007 $cat > try.c <<'EOCP'
13008 /* System header to define __stub macros and hopefully few prototypes,
13009 which can conflict with char lchown(); below. */
13010 #include <assert.h>
13011 /* Override any gcc2 internal prototype to avoid an error. */
13012 /* We use char because int might match the return type of a gcc2
13013 builtin and then its argument prototype would still apply. */
13016 /* The GNU C library defines this for functions which it implements
13017 to always fail with ENOSYS. Some functions are actually named
13018 something starting with __ and the normal name is an alias. */
13019 #if defined (__stub_lchown) || defined (__stub___lchown)
13027 if eval $compile; then
13028 $echo "lchown() found." >&4
13031 $echo "lchown() NOT found." >&4
13037 : See if number of significant digits in a double precision number is known
13039 $cat >ldbl_dig.c <<EOM
13040 #$i_limits I_LIMITS
13043 #include <limits.h>
13049 printf("Contains LDBL_DIG");
13052 $cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
13053 if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
13054 echo "LDBL_DIG found." >&4
13057 echo "LDBL_DIG NOT found." >&4
13064 : see if link exists
13068 : see if localtime_r exists
13069 set localtime_r d_localtime_r
13071 case "$d_localtime_r" in
13073 hdrs="$i_systypes sys/types.h define stdio.h $i_time time.h $i_systime sys/time.h"
13074 case "$d_localtime_r_proto:$usethreads" in
13075 ":define") d_localtime_r_proto=define
13076 set d_localtime_r_proto localtime_r $hdrs
13080 case "$d_localtime_r_proto" in
13082 case "$localtime_r_proto" in
13083 ''|0) try='struct tm* localtime_r(const time_t*, struct tm*);'
13084 ./protochk "extern $try" $hdrs && localtime_r_proto=S_TS ;;
13086 case "$localtime_r_proto" in
13087 ''|0) try='int localtime_r(const time_t*, struct tm*);'
13088 ./protochk "extern $try" $hdrs && localtime_r_proto=I_TS ;;
13090 case "$localtime_r_proto" in
13091 ''|0) d_localtime_r=undef
13092 localtime_r_proto=0
13093 echo "Disabling localtime_r, cannot determine prototype." >&4 ;;
13094 * ) case "$localtime_r_proto" in
13095 REENTRANT_PROTO*) ;;
13096 *) localtime_r_proto="REENTRANT_PROTO_$localtime_r_proto" ;;
13098 echo "Prototype: $try" ;;
13101 *) case "$usethreads" in
13102 define) echo "localtime_r has no prototype, not using it." >&4 ;;
13104 d_localtime_r=undef
13105 localtime_r_proto=0
13109 *) localtime_r_proto=0
13113 : see if localeconv exists
13114 set localeconv d_locconv
13117 : see if lockf exists
13121 : see if prototype for lseek is available
13123 set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
13126 : see if lstat exists
13130 : see if madvise exists
13131 set madvise d_madvise
13134 : see if mblen exists
13138 : see if mbstowcs exists
13139 set mbstowcs d_mbstowcs
13142 : see if mbtowc exists
13143 set mbtowc d_mbtowc
13146 : see if memchr exists
13147 set memchr d_memchr
13150 : see if memcmp exists
13151 set memcmp d_memcmp
13154 : see if memcpy exists
13155 set memcpy d_memcpy
13158 : see if memmove exists
13159 set memmove d_memmove
13162 : see if memset exists
13163 set memset d_memset
13166 : see if mkdir exists
13170 : see if mkdtemp exists
13171 set mkdtemp d_mkdtemp
13174 : see if mkfifo exists
13175 set mkfifo d_mkfifo
13178 : see if mkstemp exists
13179 set mkstemp d_mkstemp
13182 : see if mkstemps exists
13183 set mkstemps d_mkstemps
13186 : see if mktime exists
13187 set mktime d_mktime
13190 : see if this is a sys/mman.h system
13191 set sys/mman.h i_sysmman
13194 : see if mmap exists
13197 : see what shmat returns
13198 : default to something harmless
13200 case "$i_sysmman$d_mmap" in
13202 $cat >mmap.c <<'END'
13203 #include <sys/mman.h>
13206 if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
13211 echo "and it returns ($mmaptype)." >&4
13217 : see if mprotect exists
13218 set mprotect d_mprotect
13221 : see if msgctl exists
13222 set msgctl d_msgctl
13225 : see if msgget exists
13226 set msgget d_msgget
13229 : see if msgsnd exists
13230 set msgsnd d_msgsnd
13233 : see if msgrcv exists
13234 set msgrcv d_msgrcv
13237 : see how much of the 'msg*(2)' library is present.
13240 case "$d_msgctl$d_msgget$d_msgsnd$d_msgrcv" in
13241 *"$undef"*) h_msg=false;;
13245 case "`ipcs 2>&1`" in
13246 "SVID messages"*"not configured"*)
13247 echo "Your $osname does not have the msg*(2) configured." >&4
13250 set msgctl d_msgctl
13252 set msgget d_msgget
13254 set msgsnd d_msgsnd
13256 set msgrcv d_msgrcv
13262 : we could also check for sys/ipc.h ...
13263 if $h_msg && $test `./findhdr sys/msg.h`; then
13264 echo "You have the full msg*(2) library." >&4
13267 echo "You don't have the full msg*(2) library." >&4
13275 echo "Checking to see if your system supports struct msghdr..." >&4
13276 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
13278 case "$d_msghdr_s" in
13279 "$define") echo "Yes, it does." ;;
13280 *) echo "No, it doesn't." ;;
13284 : see if msync exists
13288 : see if munmap exists
13289 set munmap d_munmap
13292 : see if nice exists
13296 : see if this is a langinfo.h system
13297 set langinfo.h i_langinfo
13300 : see if nl_langinfo exists
13301 set nl_langinfo d_nl_langinfo
13304 : check for length of character
13306 case "$charsize" in
13308 echo "Checking to see how big your characters are (hey, you never know)..." >&4
13309 $cat >try.c <<'EOCP'
13313 printf("%d\n", (int)sizeof(char));
13318 if eval $compile_ok; then
13322 echo "(I can't seem to compile the test program. Guessing...)"
13329 rp="What is the size of a character (in bytes)?"
13334 : check for volatile keyword
13336 echo 'Checking to see if your C compiler knows about "volatile"...' >&4
13337 $cat >try.c <<'EOCP'
13340 typedef struct _goo_struct goo_struct;
13341 goo_struct * volatile goo = ((goo_struct *)0);
13342 struct _goo_struct {
13347 typedef unsigned short foo_t;
13348 char *volatile foo;
13350 volatile foo_t blech;
13354 if $cc -c $ccflags try.c >/dev/null 2>&1 ; then
13356 echo "Yup, it does."
13359 echo "Nope, it doesn't."
13367 $echo "Choosing the C types to be used for Perl's internal types..." >&4
13369 case "$use64bitint:$d_quad:$quadtype" in
13372 uvtype="$uquadtype"
13377 uvtype="unsigned long"
13383 case "$uselongdouble:$d_longdbl" in
13385 nvtype="long double"
13386 nvsize=$longdblsize
13393 $echo "(IV will be "$ivtype", $ivsize bytes)"
13394 $echo "(UV will be "$uvtype", $uvsize bytes)"
13395 $echo "(NV will be "$nvtype", $nvsize bytes)"
13398 #$i_inttypes I_INTTYPES
13400 #include <inttypes.h>
13405 int8_t i = INT8_MAX;
13406 uint8_t u = UINT8_MAX;
13407 printf("int8_t\n");
13410 int16_t i = INT16_MAX;
13411 uint16_t i = UINT16_MAX;
13412 printf("int16_t\n");
13415 int32_t i = INT32_MAX;
13416 uint32_t u = UINT32_MAX;
13417 printf("int32_t\n");
13423 '') case "$charsize" in
13425 u8type="unsigned char"
13434 if eval $compile; then
13435 case "`$run ./try`" in
13436 int8_t) i8type=int8_t
13446 '') if $test $charsize -ge 1; then
13448 u8type="unsigned char"
13456 '') case "$shortsize" in
13458 u16type="unsigned short"
13466 '') set try -DINT16
13467 if eval $compile; then
13468 case "`$run ./try`" in
13480 '') if $test $shortsize -ge 2; then
13482 u16type="unsigned short"
13490 '') case "$longsize" in
13492 u32type="unsigned long"
13496 *) case "$intsize" in
13498 u32type="unsigned int"
13508 '') set try -DINT32
13509 if eval $compile; then
13510 case "`$run ./try`" in
13522 '') if $test $intsize -ge 4; then
13524 u32type="unsigned int"
13532 '') case "$d_quad:$quadtype" in
13534 i64type="$quadtype"
13535 u64type="$uquadtype"
13543 $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
13544 : volatile so that the compiler has to store it out to memory.
13545 if test X"$d_volatile" = X"$define"; then
13550 #include <sys/types.h>
13551 #include <signal.h>
13553 $volatile int bletched = 0;
13554 $signal_t blech(s) int s; { bletched = 1; }
13559 int n = 8 * $uvsize;
13562 signal(SIGFPE, blech);
13565 for (i = 0; i < n; i++) {
13566 u = u << 1 | ($uvtype)1;
13568 if (($uvtype)d != u)
13572 d = ($nvtype)(u - 1);
13573 if (($uvtype)d != (u - 1))
13581 printf("%d\n", ((i == n) ? -n : i));
13587 d_nv_preserves_uv="$undef"
13588 if eval $compile; then
13589 nv_preserves_uv_bits="`$run ./try`"
13591 case "$nv_preserves_uv_bits" in
13593 nv_preserves_uv_bits=`expr 0 - $nv_preserves_uv_bits`
13594 $echo "Your NVs can preserve all $nv_preserves_uv_bits bits of your UVs." 2>&1
13595 d_nv_preserves_uv="$define"
13597 [1-9]*) $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs." 2>&1
13598 d_nv_preserves_uv="$undef" ;;
13599 *) $echo "Can't figure out how many bits your NVs preserve." 2>&1
13600 nv_preserves_uv_bits="$undef" ;;
13606 : check for off64_t
13608 echo "Checking to see if you have off64_t..." >&4
13610 #include <sys/types.h>
13611 #include <unistd.h>
13612 int main() { off64_t x = 7; }
13615 if eval $compile; then
13617 echo "You have off64_t."
13620 echo "You do not have off64_t."
13621 case "$lseeksize" in
13622 8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
13629 : how to create joinable pthreads
13630 if test "X$usethreads" = "X$define" -a "X$i_pthread" = "X$define"; then
13632 echo "Checking what constant to use for creating joinable pthreads..." >&4
13633 $cat >try.c <<'EOCP'
13634 #include <pthread.h>
13636 int detachstate = JOINABLE;
13639 set try -DJOINABLE=PTHREAD_CREATE_JOINABLE
13640 if eval $compile; then
13641 echo "You seem to use PTHREAD_CREATE_JOINABLE." >&4
13642 val="$undef" # Yes, undef.
13643 set d_old_pthread_create_joinable
13646 set old_pthread_create_joinable
13649 set try -DJOINABLE=PTHREAD_CREATE_UNDETACHED
13650 if eval $compile; then
13651 echo "You seem to use PTHREAD_CREATE_UNDETACHED." >&4
13653 set d_old_pthread_create_joinable
13655 val=PTHREAD_CREATE_UNDETACHED
13656 set old_pthread_create_joinable
13659 set try -DJOINABLE=__UNDETACHED
13660 if eval $compile; then
13661 echo "You seem to use __UNDETACHED." >&4
13663 set d_old_pthread_create_joinable
13666 set old_pthread_create_joinable
13669 echo "Egads, nothing obvious found. Guessing that you use 0." >&4
13671 set d_old_pthread_create_joinable
13674 set old_pthread_create_joinable
13681 d_old_pthread_create_joinable="$undef"
13682 old_pthread_create_joinable=""
13685 : see if pause exists
13689 : see if pipe exists
13693 : see if poll exists
13697 : see if readlink exists
13698 set readlink d_readlink
13704 case "$d_readlink" in
13706 if $issymlink /proc/self/exe ; then
13707 $ls -l /proc/self/exe > reflect
13708 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
13709 echo "You have Linux-like /proc/self/exe."
13710 procselfexe='"/proc/self/exe"'
13714 if $issymlink /proc/curproc/file ; then
13715 $ls -l /proc/curproc/file > reflect
13716 if $contains /`basename $ls` reflect >/dev/null 2>&1; then
13717 echo "You have BSD-like /proc/curproc/file."
13718 procselfexe='"/proc/curproc/file"'
13728 : see whether the pthread_atfork exists
13730 #include <pthread.h>
13733 #ifdef PTHREAD_ATFORK
13734 pthread_atfork(NULL,NULL,NULL);
13739 : see if pthread_atfork exists
13740 set try -DPTHREAD_ATFORK
13741 if eval $compile; then
13746 case "$usethreads" in
13749 $define) echo 'pthread_atfork found.' >&4 ;;
13750 *) echo 'pthread_atfork NOT found.' >&4 ;;
13753 set d_pthread_atfork
13757 : see whether the various POSIXish _yields exist
13759 #include <pthread.h>
13765 #ifdef PTHREAD_YIELD
13768 #ifdef PTHREAD_YIELD_NULL
13769 pthread_yield(NULL);
13775 : see if sched_yield exists
13776 set try -DSCHED_YIELD
13777 if eval $compile; then
13779 sched_yield='sched_yield()'
13783 case "$usethreads" in
13786 $define) echo 'sched_yield() found.' >&4 ;;
13787 *) echo 'sched_yield() NOT found.' >&4 ;;
13793 : see if pthread_yield exists
13794 set try -DPTHREAD_YIELD
13795 if eval $compile; then
13797 case "$sched_yield" in
13798 '') sched_yield='pthread_yield()' ;;
13801 set try -DPTHREAD_YIELD_NULL
13802 if eval $compile; then
13804 case "$sched_yield" in
13805 '') sched_yield='pthread_yield(NULL)' ;;
13811 case "$usethreads" in
13814 $define) echo 'pthread_yield() found.' >&4 ;;
13815 *) echo 'pthread_yield() NOT found.' >&4 ;;
13819 set d_pthread_yield
13822 case "$sched_yield" in
13823 '') sched_yield=undef ;;
13828 : see if random_r exists
13829 set random_r d_random_r
13831 case "$d_random_r" in
13833 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
13834 case "$d_random_r_proto:$usethreads" in
13835 ":define") d_random_r_proto=define
13836 set d_random_r_proto random_r $hdrs
13840 case "$d_random_r_proto" in
13842 case "$random_r_proto" in
13843 ''|0) try='int random_r(int*, struct random_data*);'
13844 ./protochk "extern $try" $hdrs && random_r_proto=I_TS ;;
13846 case "$random_r_proto" in
13847 ''|0) d_random_r=undef
13849 echo "Disabling random_r, cannot determine prototype." >&4 ;;
13850 * ) case "$random_r_proto" in
13851 REENTRANT_PROTO*) ;;
13852 *) random_r_proto="REENTRANT_PROTO_$random_r_proto" ;;
13854 echo "Prototype: $try" ;;
13857 *) case "$usethreads" in
13858 define) echo "random_r has no prototype, not using it." >&4 ;;
13865 *) random_r_proto=0
13869 : see if readdir and friends exist
13870 set readdir d_readdir
13872 set seekdir d_seekdir
13874 set telldir d_telldir
13876 set rewinddir d_rewinddir
13879 : see if readdir64_r exists
13880 set readdir64_r d_readdir64_r
13882 case "$d_readdir64_r" in
13884 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
13885 case "$d_readdir64_r_proto:$usethreads" in
13886 ":define") d_readdir64_r_proto=define
13887 set d_readdir64_r_proto readdir64_r $hdrs
13891 case "$d_readdir64_r_proto" in
13893 case "$readdir64_r_proto" in
13894 ''|0) try='int readdir64_r(DIR*, struct dirent64*, struct dirent64**);'
13895 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TSR ;;
13897 case "$readdir64_r_proto" in
13898 ''|0) try='int readdir64_r(DIR*, struct dirent64*);'
13899 ./protochk "extern $try" $hdrs && readdir64_r_proto=I_TS ;;
13901 case "$readdir64_r_proto" in
13902 ''|0) d_readdir64_r=undef
13903 readdir64_r_proto=0
13904 echo "Disabling readdir64_r, cannot determine prototype." >&4 ;;
13905 * ) case "$readdir64_r_proto" in
13906 REENTRANT_PROTO*) ;;
13907 *) readdir64_r_proto="REENTRANT_PROTO_$readdir64_r_proto" ;;
13909 echo "Prototype: $try" ;;
13912 *) case "$usethreads" in
13913 define) echo "readdir64_r has no prototype, not using it." >&4 ;;
13915 d_readdir64_r=undef
13916 readdir64_r_proto=0
13920 *) readdir64_r_proto=0
13924 : see if readdir_r exists
13925 set readdir_r d_readdir_r
13927 case "$d_readdir_r" in
13929 hdrs="$i_systypes sys/types.h define stdio.h $i_dirent dirent.h"
13930 case "$d_readdir_r_proto:$usethreads" in
13931 ":define") d_readdir_r_proto=define
13932 set d_readdir_r_proto readdir_r $hdrs
13936 case "$d_readdir_r_proto" in
13938 case "$readdir_r_proto" in
13939 ''|0) try='int readdir_r(DIR*, struct dirent*, struct dirent**);'
13940 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TSR ;;
13942 case "$readdir_r_proto" in
13943 ''|0) try='int readdir_r(DIR*, struct dirent*);'
13944 ./protochk "extern $try" $hdrs && readdir_r_proto=I_TS ;;
13946 case "$readdir_r_proto" in
13947 ''|0) d_readdir_r=undef
13949 echo "Disabling readdir_r, cannot determine prototype." >&4 ;;
13950 * ) case "$readdir_r_proto" in
13951 REENTRANT_PROTO*) ;;
13952 *) readdir_r_proto="REENTRANT_PROTO_$readdir_r_proto" ;;
13954 echo "Prototype: $try" ;;
13957 *) case "$usethreads" in
13958 define) echo "readdir_r has no prototype, not using it." >&4 ;;
13965 *) readdir_r_proto=0
13969 : see if readv exists
13973 : see if recvmsg exists
13974 set recvmsg d_recvmsg
13977 : see if rename exists
13978 set rename d_rename
13981 : see if rmdir exists
13985 : see if memory.h is available.
13990 : See if it conflicts with string.h
13996 $cppstdin $cppflags $cppminus < $strings > mem.h
13997 if $contains 'memcpy' mem.h >/dev/null 2>&1; then
13999 echo "We won't be including <memory.h>."
14009 : can bcopy handle overlapping blocks?
14012 case "$d_memmove" in
14013 "$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
14014 *) case "$d_bcopy" in
14016 echo "Checking to see if bcopy() can do overlapping copies..." >&4
14018 #$i_memory I_MEMORY
14019 #$i_stdlib I_STDLIB
14020 #$i_string I_STRING
14021 #$i_unistd I_UNISTD
14023 $cat >>try.c <<'EOCP'
14026 # include <memory.h>
14029 # include <stdlib.h>
14032 # include <string.h>
14034 # include <strings.h>
14037 # include <unistd.h> /* Needed for NetBSD */
14041 char buf[128], abc[128];
14047 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14048 try to store the string in read-only memory. */
14049 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
14051 for (align = 7; align >= 0; align--) {
14052 for (len = 36; len; len--) {
14054 bcopy(abc, b, len);
14055 for (off = 1; off <= len; off++) {
14056 bcopy(b, b+off, len);
14057 bcopy(b+off, b, len);
14058 if (bcmp(b, abc, len))
14067 if eval $compile_ok; then
14068 if ./try 2>/dev/null; then
14069 echo "Yes, it can."
14072 echo "It can't, sorry."
14075 echo "(I can't compile the test program, so we'll assume not...)"
14079 $rm -f try.* try core
14085 : can memcpy handle overlapping blocks?
14088 case "$d_memmove" in
14089 "$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
14090 *) case "$d_memcpy" in
14092 echo "Checking to see if memcpy() can do overlapping copies..." >&4
14094 #$i_memory I_MEMORY
14095 #$i_stdlib I_STDLIB
14096 #$i_string I_STRING
14097 #$i_unistd I_UNISTD
14099 $cat >>try.c <<'EOCP'
14102 # include <memory.h>
14105 # include <stdlib.h>
14108 # include <string.h>
14110 # include <strings.h>
14113 # include <unistd.h> /* Needed for NetBSD */
14117 char buf[128], abc[128];
14123 /* Copy "abcde..." string to char abc[] so that gcc doesn't
14124 try to store the string in read-only memory. */
14125 memcpy(abc, "abcdefghijklmnopqrstuvwxyz0123456789", 36);
14127 for (align = 7; align >= 0; align--) {
14128 for (len = 36; len; len--) {
14130 memcpy(b, abc, len);
14131 for (off = 1; off <= len; off++) {
14132 memcpy(b+off, b, len);
14133 memcpy(b, b+off, len);
14134 if (memcmp(b, abc, len))
14143 if eval $compile_ok; then
14144 if ./try 2>/dev/null; then
14145 echo "Yes, it can."
14148 echo "It can't, sorry."
14151 echo "(I can't compile the test program, so we'll assume not...)"
14155 $rm -f try.* try core
14161 : can memcmp be trusted to compare relative magnitude?
14163 case "$d_memcmp" in
14166 echo "Checking if your memcmp() can compare relative magnitude..." >&4
14168 #$i_memory I_MEMORY
14169 #$i_stdlib I_STDLIB
14170 #$i_string I_STRING
14171 #$i_unistd I_UNISTD
14173 $cat >>try.c <<'EOCP'
14176 # include <memory.h>
14179 # include <stdlib.h>
14182 # include <string.h>
14184 # include <strings.h>
14187 # include <unistd.h> /* Needed for NetBSD */
14193 if ((a < b) && memcmp(&a, &b, 1) < 0)
14199 if eval $compile_ok; then
14200 if $run ./try 2>/dev/null; then
14201 echo "Yes, it can."
14204 echo "No, it can't (it uses signed chars)."
14207 echo "(I can't compile the test program, so we'll assume not...)"
14211 $rm -f try.* try core
14215 : see if prototype for sbrk is available
14217 set d_sbrkproto sbrk $i_unistd unistd.h
14220 : see if select exists
14221 set select d_select
14224 : see if semctl exists
14225 set semctl d_semctl
14228 : see if semget exists
14229 set semget d_semget
14232 : see if semop exists
14236 : see how much of the 'sem*(2)' library is present.
14239 case "$d_semctl$d_semget$d_semop" in
14240 *"$undef"*) h_sem=false;;
14244 case "`ipcs 2>&1`" in
14245 "SVID messages"*"not configured"*)
14246 echo "Your $osname does not have the sem*(2) configured." >&4
14249 set semctl d_semctl
14251 set semget d_semget
14259 : we could also check for sys/ipc.h ...
14260 if $h_sem && $test `./findhdr sys/sem.h`; then
14261 echo "You have the full sem*(2) library." >&4
14264 echo "You don't have the full sem*(2) library." >&4
14270 : see whether sys/sem.h defines union semun
14272 $cat > try.c <<'END'
14273 #include <sys/types.h>
14274 #include <sys/ipc.h>
14275 #include <sys/sem.h>
14276 int main () { union semun semun; semun.buf = 0; }
14279 if eval $compile; then
14280 echo "You have union semun in <sys/sem.h>." >&4
14283 echo "You do not have union semun in <sys/sem.h>." >&4
14286 $rm -f try try.c try.h
14290 : see how to do semctl IPC_STAT
14293 : see whether semctl IPC_STAT can use union semun
14298 # define S_IRUSR S_IREAD
14299 # define S_IWUSR S_IWRITE
14300 # define S_IXUSR S_IEXEC
14302 # define S_IRUSR 0400
14303 # define S_IWUSR 0200
14304 # define S_IXUSR 0100
14306 # define S_IRGRP (S_IRUSR>>3)
14307 # define S_IWGRP (S_IWUSR>>3)
14308 # define S_IXGRP (S_IXUSR>>3)
14309 # define S_IROTH (S_IRUSR>>6)
14310 # define S_IWOTH (S_IWUSR>>6)
14311 # define S_IXOTH (S_IXUSR>>6)
14314 # define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)
14315 # define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)
14316 # define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
14321 #include <sys/types.h>
14322 #include <sys/ipc.h>
14323 #include <sys/sem.h>
14324 #include <sys/stat.h>
14331 #$d_union_semun HAS_UNION_SEMUN
14334 #ifndef HAS_UNION_SEMUN
14337 struct semid_ds *buf;
14338 unsigned short *array;
14344 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14345 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14347 struct semid_ds argbuf;
14350 st = semctl(sem, 0, IPC_STAT, arg);
14354 # endif /* IPC_STAT */
14355 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14357 if (semctl(sem, 0, IPC_RMID, arg) != 0)
14358 # endif /* IPC_RMID */
14359 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14361 #endif /* IPC_PRIVATE && ... */
14362 printf("semget failed: errno = %d\n", errno);
14368 if eval $compile; then
14371 semun) val="$define" ;;
14377 case "$d_semctl_semun" in
14379 echo "You can use union semun for semctl IPC_STAT." >&4
14382 *) echo "You cannot use union semun for semctl IPC_STAT." >&4
14387 : see whether semctl IPC_STAT can use struct semid_ds pointer
14388 $cat > try.c <<'END'
14389 #include <sys/types.h>
14390 #include <sys/ipc.h>
14391 #include <sys/sem.h>
14392 #include <sys/stat.h>
14400 struct semid_ds arg;
14403 #if defined(IPC_PRIVATE) && defined(S_IRWXU) && defined(S_IRWXG) && defined(S_IRWXO) && defined(IPC_CREAT)
14404 sem = semget(IPC_PRIVATE, 1, S_IRWXU|S_IRWXG|S_IRWXO|IPC_CREAT);
14407 st = semctl(sem, 0, IPC_STAT, &arg);
14409 printf("semid_ds\n");
14411 # endif /* IPC_STAT */
14412 printf("semctl IPC_STAT failed: errno = %d\n", errno);
14414 if (semctl(sem, 0, IPC_RMID, &arg) != 0)
14415 # endif /* IPC_RMID */
14416 printf("semctl IPC_RMID failed: errno = %d\n", errno);
14418 #endif /* IPC_PRIVATE && ... */
14419 printf("semget failed: errno = %d\n", errno);
14426 if eval $compile; then
14429 semid_ds) val="$define" ;;
14433 set d_semctl_semid_ds
14435 case "$d_semctl_semid_ds" in
14437 echo "You can $also use struct semid_ds* for semctl IPC_STAT." >&4
14439 *) echo "You cannot use struct semid_ds* for semctl IPC_STAT." >&4
14446 # We do not have the full sem*(2) library, so assume we can not
14452 set d_semctl_semid_ds
14457 : see if sendmsg exists
14458 set sendmsg d_sendmsg
14461 : see if setegid exists
14462 set setegid d_setegid
14465 : see if seteuid exists
14466 set seteuid d_seteuid
14469 : see if setgrent exists
14470 set setgrent d_setgrent
14473 : see if setgrent_r exists
14474 set setgrent_r d_setgrent_r
14476 case "$d_setgrent_r" in
14478 hdrs="$i_systypes sys/types.h define stdio.h $i_grp grp.h"
14479 case "$d_setgrent_r_proto:$usethreads" in
14480 ":define") d_setgrent_r_proto=define
14481 set d_setgrent_r_proto setgrent_r $hdrs
14485 case "$d_setgrent_r_proto" in
14487 case "$setgrent_r_proto" in
14488 ''|0) try='int setgrent_r(FILE**);'
14489 ./protochk "extern $try" $hdrs && setgrent_r_proto=I_H ;;
14491 case "$setgrent_r_proto" in
14492 ''|0) try='void setgrent_r(FILE**);'
14493 ./protochk "extern $try" $hdrs && setgrent_r_proto=V_H ;;
14495 case "$setgrent_r_proto" in
14496 ''|0) d_setgrent_r=undef
14498 echo "Disabling setgrent_r, cannot determine prototype." >&4 ;;
14499 * ) case "$setgrent_r_proto" in
14500 REENTRANT_PROTO*) ;;
14501 *) setgrent_r_proto="REENTRANT_PROTO_$setgrent_r_proto" ;;
14503 echo "Prototype: $try" ;;
14506 *) case "$usethreads" in
14507 define) echo "setgrent_r has no prototype, not using it." >&4 ;;
14514 *) setgrent_r_proto=0
14518 : see if sethostent exists
14519 set sethostent d_sethent
14522 : see if sethostent_r exists
14523 set sethostent_r d_sethostent_r
14525 case "$d_sethostent_r" in
14527 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14528 case "$d_sethostent_r_proto:$usethreads" in
14529 ":define") d_sethostent_r_proto=define
14530 set d_sethostent_r_proto sethostent_r $hdrs
14534 case "$d_sethostent_r_proto" in
14536 case "$sethostent_r_proto" in
14537 ''|0) try='int sethostent_r(int, struct hostent_data*);'
14538 ./protochk "extern $try" $hdrs && sethostent_r_proto=I_ID ;;
14540 case "$sethostent_r_proto" in
14541 ''|0) try='void sethostent_r(int, struct hostent_data*);'
14542 ./protochk "extern $try" $hdrs && sethostent_r_proto=V_ID ;;
14544 case "$sethostent_r_proto" in
14545 ''|0) d_sethostent_r=undef
14546 sethostent_r_proto=0
14547 echo "Disabling sethostent_r, cannot determine prototype." >&4 ;;
14548 * ) case "$sethostent_r_proto" in
14549 REENTRANT_PROTO*) ;;
14550 *) sethostent_r_proto="REENTRANT_PROTO_$sethostent_r_proto" ;;
14552 echo "Prototype: $try" ;;
14555 *) case "$usethreads" in
14556 define) echo "sethostent_r has no prototype, not using it." >&4 ;;
14558 d_sethostent_r=undef
14559 sethostent_r_proto=0
14563 *) sethostent_r_proto=0
14567 : see if setitimer exists
14568 set setitimer d_setitimer
14571 : see if setlinebuf exists
14572 set setlinebuf d_setlinebuf
14575 : see if setlocale exists
14576 set setlocale d_setlocale
14579 : see if locale.h is available
14580 set locale.h i_locale
14583 : see if setlocale_r exists
14584 set setlocale_r d_setlocale_r
14586 case "$d_setlocale_r" in
14588 hdrs="$i_systypes sys/types.h define stdio.h $i_locale locale.h"
14589 case "$d_setlocale_r_proto:$usethreads" in
14590 ":define") d_setlocale_r_proto=define
14591 set d_setlocale_r_proto setlocale_r $hdrs
14595 case "$d_setlocale_r_proto" in
14597 case "$setlocale_r_proto" in
14598 ''|0) try='int setlocale_r(int, const char*, char*, int);'
14599 ./protochk "extern $try" $hdrs && setlocale_r_proto=I_ICBI ;;
14601 case "$setlocale_r_proto" in
14602 ''|0) d_setlocale_r=undef
14603 setlocale_r_proto=0
14604 echo "Disabling setlocale_r, cannot determine prototype." >&4 ;;
14605 * ) case "$setlocale_r_proto" in
14606 REENTRANT_PROTO*) ;;
14607 *) setlocale_r_proto="REENTRANT_PROTO_$setlocale_r_proto" ;;
14609 echo "Prototype: $try" ;;
14612 *) case "$usethreads" in
14613 define) echo "setlocale_r has no prototype, not using it." >&4 ;;
14615 d_setlocale_r=undef
14616 setlocale_r_proto=0
14620 *) setlocale_r_proto=0
14624 : see if setnetent exists
14625 set setnetent d_setnent
14628 : see if setnetent_r exists
14629 set setnetent_r d_setnetent_r
14631 case "$d_setnetent_r" in
14633 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14634 case "$d_setnetent_r_proto:$usethreads" in
14635 ":define") d_setnetent_r_proto=define
14636 set d_setnetent_r_proto setnetent_r $hdrs
14640 case "$d_setnetent_r_proto" in
14642 case "$setnetent_r_proto" in
14643 ''|0) try='int setnetent_r(int, struct netent_data*);'
14644 ./protochk "extern $try" $hdrs && setnetent_r_proto=I_ID ;;
14646 case "$setnetent_r_proto" in
14647 ''|0) try='void setnetent_r(int, struct netent_data*);'
14648 ./protochk "extern $try" $hdrs && setnetent_r_proto=V_ID ;;
14650 case "$setnetent_r_proto" in
14651 ''|0) d_setnetent_r=undef
14652 setnetent_r_proto=0
14653 echo "Disabling setnetent_r, cannot determine prototype." >&4 ;;
14654 * ) case "$setnetent_r_proto" in
14655 REENTRANT_PROTO*) ;;
14656 *) setnetent_r_proto="REENTRANT_PROTO_$setnetent_r_proto" ;;
14658 echo "Prototype: $try" ;;
14661 *) case "$usethreads" in
14662 define) echo "setnetent_r has no prototype, not using it." >&4 ;;
14664 d_setnetent_r=undef
14665 setnetent_r_proto=0
14669 *) setnetent_r_proto=0
14673 : see if setprotoent exists
14674 set setprotoent d_setpent
14677 : see if setpgid exists
14678 set setpgid d_setpgid
14681 : see if setpgrp2 exists
14682 set setpgrp2 d_setpgrp2
14685 : see if setpriority exists
14686 set setpriority d_setprior
14689 : see if setproctitle exists
14690 set setproctitle d_setproctitle
14693 : see if setprotoent_r exists
14694 set setprotoent_r d_setprotoent_r
14696 case "$d_setprotoent_r" in
14698 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14699 case "$d_setprotoent_r_proto:$usethreads" in
14700 ":define") d_setprotoent_r_proto=define
14701 set d_setprotoent_r_proto setprotoent_r $hdrs
14705 case "$d_setprotoent_r_proto" in
14707 case "$setprotoent_r_proto" in
14708 ''|0) try='int setprotoent_r(int, struct protoent_data*);'
14709 ./protochk "extern $try" $hdrs && setprotoent_r_proto=I_ID ;;
14711 case "$setprotoent_r_proto" in
14712 ''|0) try='void setprotoent_r(int, struct protoent_data*);'
14713 ./protochk "extern $try" $hdrs && setprotoent_r_proto=V_ID ;;
14715 case "$setprotoent_r_proto" in
14716 ''|0) d_setprotoent_r=undef
14717 setprotoent_r_proto=0
14718 echo "Disabling setprotoent_r, cannot determine prototype." >&4 ;;
14719 * ) case "$setprotoent_r_proto" in
14720 REENTRANT_PROTO*) ;;
14721 *) setprotoent_r_proto="REENTRANT_PROTO_$setprotoent_r_proto" ;;
14723 echo "Prototype: $try" ;;
14726 *) case "$usethreads" in
14727 define) echo "setprotoent_r has no prototype, not using it." >&4 ;;
14729 d_setprotoent_r=undef
14730 setprotoent_r_proto=0
14734 *) setprotoent_r_proto=0
14738 : see if setpwent exists
14739 set setpwent d_setpwent
14742 : see if setpwent_r exists
14743 set setpwent_r d_setpwent_r
14745 case "$d_setpwent_r" in
14747 hdrs="$i_systypes sys/types.h define stdio.h $i_pwd pwd.h"
14748 case "$d_setpwent_r_proto:$usethreads" in
14749 ":define") d_setpwent_r_proto=define
14750 set d_setpwent_r_proto setpwent_r $hdrs
14754 case "$d_setpwent_r_proto" in
14756 case "$setpwent_r_proto" in
14757 ''|0) try='int setpwent_r(FILE**);'
14758 ./protochk "extern $try" $hdrs && setpwent_r_proto=I_H ;;
14760 case "$setpwent_r_proto" in
14761 ''|0) try='void setpwent_r(FILE**);'
14762 ./protochk "extern $try" $hdrs && setpwent_r_proto=V_H ;;
14764 case "$setpwent_r_proto" in
14765 ''|0) d_setpwent_r=undef
14767 echo "Disabling setpwent_r, cannot determine prototype." >&4 ;;
14768 * ) case "$setpwent_r_proto" in
14769 REENTRANT_PROTO*) ;;
14770 *) setpwent_r_proto="REENTRANT_PROTO_$setpwent_r_proto" ;;
14772 echo "Prototype: $try" ;;
14775 *) case "$usethreads" in
14776 define) echo "setpwent_r has no prototype, not using it." >&4 ;;
14783 *) setpwent_r_proto=0
14787 : see if setregid exists
14788 set setregid d_setregid
14790 set setresgid d_setresgid
14793 : see if setreuid exists
14794 set setreuid d_setreuid
14796 set setresuid d_setresuid
14799 : see if setrgid exists
14800 set setrgid d_setrgid
14803 : see if setruid exists
14804 set setruid d_setruid
14807 : see if setservent exists
14808 set setservent d_setsent
14811 : see if setservent_r exists
14812 set setservent_r d_setservent_r
14814 case "$d_setservent_r" in
14816 hdrs="$i_systypes sys/types.h define stdio.h $i_netdb netdb.h"
14817 case "$d_setservent_r_proto:$usethreads" in
14818 ":define") d_setservent_r_proto=define
14819 set d_setservent_r_proto setservent_r $hdrs
14823 case "$d_setservent_r_proto" in
14825 case "$setservent_r_proto" in
14826 ''|0) try='int setservent_r(int, struct servent_data*);'
14827 ./protochk "extern $try" $hdrs && setservent_r_proto=I_ID ;;
14829 case "$setservent_r_proto" in
14830 ''|0) try='void setservent_r(int, struct servent_data*);'
14831 ./protochk "extern $try" $hdrs && setservent_r_proto=V_ID ;;
14833 case "$setservent_r_proto" in
14834 ''|0) d_setservent_r=undef
14835 setservent_r_proto=0
14836 echo "Disabling setservent_r, cannot determine prototype." >&4 ;;
14837 * ) case "$setservent_r_proto" in
14838 REENTRANT_PROTO*) ;;
14839 *) setservent_r_proto="REENTRANT_PROTO_$setservent_r_proto" ;;
14841 echo "Prototype: $try" ;;
14844 *) case "$usethreads" in
14845 define) echo "setservent_r has no prototype, not using it." >&4 ;;
14847 d_setservent_r=undef
14848 setservent_r_proto=0
14852 *) setservent_r_proto=0
14856 : see if setsid exists
14857 set setsid d_setsid
14860 : see if setvbuf exists
14861 set setvbuf d_setvbuf
14864 : see if sfio.h is available
14869 : see if sfio library is available
14880 : Ok, but do we want to use it.
14884 true|$define|[yY]*) dflt='y';;
14887 echo "$package can use the sfio library, but it is experimental."
14888 case "$useperlio" in
14890 echo "For sfio also the PerlIO abstraction layer is needed."
14891 echo "Earlier you said you wouldn't want that."
14894 rp="You seem to have sfio available, do you want to try using it?"
14897 y|Y) echo "Ok, turning on both sfio and PerlIO, then."
14898 useperlio="$define"
14901 *) echo "Ok, avoiding sfio this time. I'll use stdio instead."
14906 *) case "$usesfio" in
14907 true|$define|[yY]*)
14908 echo "Sorry, cannot find sfio on this machine." >&4
14909 echo "Ignoring your setting of usesfio=$usesfio." >&4
14918 $define) usesfio='true';;
14919 *) usesfio='false';;
14923 *) : Remove sfio from list of libraries to use
14926 echo "Removing unneeded -lsfio from library list" >&4
14927 set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
14930 echo "libs = $libs" >&4
14937 : see if shmctl exists
14938 set shmctl d_shmctl
14941 : see if shmget exists
14942 set shmget d_shmget
14945 : see if shmat exists
14948 : see what shmat returns
14951 $cat >shmat.c <<'END'
14952 #include <sys/shm.h>
14955 if $cc $ccflags -c shmat.c >/dev/null 2>&1; then
14960 echo "and it returns ($shmattype)." >&4
14961 : see if a prototype for shmat is available
14962 xxx=`./findhdr sys/shm.h`
14963 $cppstdin $cppflags $cppminus < $xxx > shmat.c 2>/dev/null
14964 if $contains 'shmat.*(' shmat.c >/dev/null 2>&1; then
14975 set d_shmatprototype
14978 : see if shmdt exists
14982 : see how much of the 'shm*(2)' library is present.
14985 case "$d_shmctl$d_shmget$d_shmat$d_shmdt" in
14986 *"$undef"*) h_shm=false;;
14990 case "`ipcs 2>&1`" in
14991 "SVID shared memory"*"not configured"*)
14992 echo "Your $osname does not have the shm*(2) configured." >&4
14995 set shmctl d_shmctl
14997 set shmget d_shmget
15007 : we could also check for sys/ipc.h ...
15008 if $h_shm && $test `./findhdr sys/shm.h`; then
15009 echo "You have the full shm*(2) library." >&4
15012 echo "You don't have the full shm*(2) library." >&4
15019 : see if we have sigaction
15020 if set sigaction val -f d_sigaction; eval $csym; $val; then
15021 echo 'sigaction() found.' >&4
15022 $cat > try.c <<'EOP'
15024 #include <sys/types.h>
15025 #include <signal.h>
15028 struct sigaction act, oact;
15030 oact.sa_handler = 0;
15031 /* so that act and oact are used */
15032 exit(act.sa_flags == 0 && oact.sa_handler == 0);
15036 if eval $compile_ok; then
15039 echo "But you don't seem to have a useable struct sigaction." >&4
15043 echo 'sigaction NOT found.' >&4
15046 set d_sigaction; eval $setvar
15047 $rm -f try try$_o try.c
15049 : see if sigprocmask exists
15050 set sigprocmask d_sigprocmask
15053 : see if sigsetjmp exists
15055 case "$d_sigsetjmp" in
15057 $cat >try.c <<'EOP'
15058 #include <setjmp.h>
15063 if (sigsetjmp(env,1))
15066 siglongjmp(env, 1);
15071 if eval $compile; then
15072 if $run ./try >/dev/null 2>&1; then
15073 echo "POSIX sigsetjmp found." >&4
15077 Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
15083 echo "sigsetjmp not found." >&4
15087 *) val="$d_sigsetjmp"
15088 case "$d_sigsetjmp" in
15089 $define) echo "POSIX sigsetjmp found." >&4;;
15090 $undef) echo "sigsetjmp not found." >&4;;
15098 : see if sockatmark exists
15099 set sockatmark d_sockatmark
15102 : see if prototype for sockatmark is available
15104 set d_sockatmarkproto sockatmark $d_socket sys/socket.h
15107 : see if socks5_init exists
15108 set socks5_init d_socks5_init
15111 : see if srand48_r exists
15112 set srand48_r d_srand48_r
15114 case "$d_srand48_r" in
15116 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15117 case "$d_srand48_r_proto:$usethreads" in
15118 ":define") d_srand48_r_proto=define
15119 set d_srand48_r_proto srand48_r $hdrs
15123 case "$d_srand48_r_proto" in
15125 case "$srand48_r_proto" in
15126 ''|0) try='int srand48_r(long, struct drand48_data*);'
15127 ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
15129 case "$srand48_r_proto" in
15130 ''|0) d_srand48_r=undef
15132 echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
15133 * ) case "$srand48_r_proto" in
15134 REENTRANT_PROTO*) ;;
15135 *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
15137 echo "Prototype: $try" ;;
15140 *) case "$usethreads" in
15141 define) echo "srand48_r has no prototype, not using it." >&4 ;;
15148 *) srand48_r_proto=0
15152 : see if srandom_r exists
15153 set srandom_r d_srandom_r
15155 case "$d_srandom_r" in
15157 hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
15158 case "$d_srandom_r_proto:$usethreads" in
15159 ":define") d_srandom_r_proto=define
15160 set d_srandom_r_proto srandom_r $hdrs
15164 case "$d_srandom_r_proto" in
15166 case "$srandom_r_proto" in
15167 ''|0) try='int srandom_r(unsigned int, struct random_data*);'
15168 ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
15170 case "$srandom_r_proto" in
15171 ''|0) d_srandom_r=undef
15173 echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
15174 * ) case "$srandom_r_proto" in
15175 REENTRANT_PROTO*) ;;
15176 *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
15178 echo "Prototype: $try" ;;
15181 *) case "$usethreads" in
15182 define) echo "srandom_r has no prototype, not using it." >&4 ;;
15189 *) srandom_r_proto=0
15193 : see if prototype for setresgid is available
15195 set d_sresgproto setresgid $i_unistd unistd.h
15198 : see if prototype for setresuid is available
15200 set d_sresuproto setresuid $i_unistd unistd.h
15203 : see if sys/stat.h is available
15204 set sys/stat.h i_sysstat
15208 : see if stat knows about block sizes
15210 echo "Checking to see if your struct stat has st_blocks field..." >&4
15211 set d_statblks stat st_blocks $i_sysstat sys/stat.h
15215 : see if this is a sys/vfs.h system
15216 set sys/vfs.h i_sysvfs
15220 : see if this is a sys/statfs.h system
15221 set sys/statfs.h i_sysstatfs
15226 echo "Checking to see if your system supports struct statfs..." >&4
15227 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
15229 case "$d_statfs_s" in
15230 "$define") echo "Yes, it does." ;;
15231 *) echo "No, it doesn't." ;;
15236 : see if struct statfs knows about f_flags
15237 case "$d_statfs_s" in
15240 echo "Checking to see if your struct statfs has f_flags field..." >&4
15241 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
15245 set d_statfs_f_flags
15249 case "$d_statfs_f_flags" in
15250 "$define") echo "Yes, it does." ;;
15251 *) echo "No, it doesn't." ;;
15254 : see if _ptr and _cnt from stdio act std
15257 if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
15258 echo "(Looks like you have stdio.h from BSD.)"
15259 case "$stdio_ptr" in
15260 '') stdio_ptr='((fp)->_p)'
15263 *) ptr_lval=$d_stdio_ptr_lval;;
15265 case "$stdio_cnt" in
15266 '') stdio_cnt='((fp)->_r)'
15269 *) cnt_lval=$d_stdio_cnt_lval;;
15271 case "$stdio_base" in
15272 '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
15274 case "$stdio_bufsiz" in
15275 '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
15277 elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
15278 echo "(Looks like you have stdio.h from Linux.)"
15279 case "$stdio_ptr" in
15280 '') stdio_ptr='((fp)->_IO_read_ptr)'
15283 *) ptr_lval=$d_stdio_ptr_lval;;
15285 case "$stdio_cnt" in
15286 '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
15289 *) cnt_lval=$d_stdio_cnt_lval;;
15291 case "$stdio_base" in
15292 '') stdio_base='((fp)->_IO_read_base)';;
15294 case "$stdio_bufsiz" in
15295 '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
15298 case "$stdio_ptr" in
15299 '') stdio_ptr='((fp)->_ptr)'
15302 *) ptr_lval=$d_stdio_ptr_lval;;
15304 case "$stdio_cnt" in
15305 '') stdio_cnt='((fp)->_cnt)'
15308 *) cnt_lval=$d_stdio_cnt_lval;;
15310 case "$stdio_base" in
15311 '') stdio_base='((fp)->_base)';;
15313 case "$stdio_bufsiz" in
15314 '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
15318 : test whether _ptr and _cnt really work
15319 echo "Checking how std your stdio is..." >&4
15322 #define FILE_ptr(fp) $stdio_ptr
15323 #define FILE_cnt(fp) $stdio_cnt
15325 FILE *fp = fopen("try.c", "r");
15328 18 <= FILE_cnt(fp) &&
15329 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15337 if eval $compile && $to try.c; then
15338 if $run ./try; then
15339 echo "Your stdio acts pretty std."
15342 echo "Your stdio isn't very std."
15345 echo "Your stdio doesn't appear very std."
15351 : Can _ptr be used as an lvalue?
15352 case "$d_stdstdio$ptr_lval" in
15353 $define$define) val=$define ;;
15356 set d_stdio_ptr_lval
15359 : Can _cnt be used as an lvalue?
15360 case "$d_stdstdio$cnt_lval" in
15361 $define$define) val=$define ;;
15364 set d_stdio_cnt_lval
15368 : test whether setting _ptr sets _cnt as a side effect
15369 d_stdio_ptr_lval_sets_cnt="$undef"
15370 d_stdio_ptr_lval_nochange_cnt="$undef"
15371 case "$d_stdio_ptr_lval$d_stdstdio" in
15373 echo "Checking to see what happens if we set the stdio ptr..." >&4
15376 /* Can we scream? */
15377 /* Eat dust sed :-) */
15378 /* In the buffer space, no one can hear you scream. */
15379 #define FILE_ptr(fp) $stdio_ptr
15380 #define FILE_cnt(fp) $stdio_cnt
15381 #include <sys/types.h>
15383 FILE *fp = fopen("try.c", "r");
15388 puts("Fail even to read");
15391 c = getc(fp); /* Read away the first # */
15393 puts("Fail even to read");
15397 18 <= FILE_cnt(fp) &&
15398 strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
15400 puts("Fail even to read");
15403 ptr = (char*) FILE_ptr(fp);
15404 cnt = (size_t)FILE_cnt(fp);
15406 FILE_ptr(fp) += 42;
15408 if ((char*)FILE_ptr(fp) != (ptr + 42)) {
15409 printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
15412 if (FILE_cnt(fp) <= 20) {
15413 printf ("Fail (<20 chars to test)");
15416 if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
15417 puts("Fail compare");
15420 if (cnt == FILE_cnt(fp)) {
15421 puts("Pass_unchanged");
15424 if (FILE_cnt(fp) == (cnt - 42)) {
15425 puts("Pass_changed");
15428 printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
15434 if eval $compile && $to try.c; then
15435 case `$run ./try` in
15437 echo "Increasing ptr in your stdio decreases cnt by the same amount. Good." >&4
15438 d_stdio_ptr_lval_sets_cnt="$define" ;;
15440 echo "Increasing ptr in your stdio leaves cnt unchanged. Good." >&4
15441 d_stdio_ptr_lval_nochange_cnt="$define" ;;
15443 echo "Increasing ptr in your stdio didn't do exactly what I expected. We'll not be doing that then." >&4 ;;
15445 echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
15448 echo "It seems we can't set ptr in your stdio. Nevermind." >&4
15454 : see if _base is also standard
15456 case "$d_stdstdio" in
15460 #define FILE_base(fp) $stdio_base
15461 #define FILE_bufsiz(fp) $stdio_bufsiz
15463 FILE *fp = fopen("try.c", "r");
15466 19 <= FILE_bufsiz(fp) &&
15467 strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
15474 if eval $compile && $to try.c; then
15475 if $run ./try; then
15476 echo "And its _base field acts std."
15479 echo "But its _base field isn't std."
15482 echo "However, it seems to be lacking the _base field."
15491 Checking how to access stdio streams by file descriptor number...
15493 case "$stdio_stream_array" in
15494 '') $cat >try.c <<EOCP
15497 if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
15501 for s in _iob __iob __sF
15503 set try -DSTDIO_STREAM_ARRAY=$s
15504 if eval $compile; then
15505 case "`$run ./try`" in
15506 yes) stdio_stream_array=$s; break ;;
15510 $rm -f try.* try$exe_ext
15512 case "$stdio_stream_array" in
15514 I can't figure out how to access stdio streams by file descriptor number.
15516 d_stdio_stream_array="$undef"
15519 You can access stdio streams by file descriptor number by the $stdio_stream_array array.
15521 d_stdio_stream_array="$define"
15525 : see if strcoll exists
15526 set strcoll d_strcoll
15529 : check for structure copying
15531 echo "Checking to see if your C compiler can copy structs..." >&4
15532 $cat >try.c <<'EOCP'
15542 if $cc -c try.c >/dev/null 2>&1 ; then
15544 echo "Yup, it can."
15547 echo "Nope, it can't."
15553 : see if strerror and/or sys_errlist[] exist
15555 if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
15556 if set strerror val -f d_strerror; eval $csym; $val; then
15557 echo 'strerror() found.' >&4
15558 d_strerror="$define"
15559 d_strerrm='strerror(e)'
15560 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15561 echo "(You also have sys_errlist[], so we could roll our own strerror.)"
15562 d_syserrlst="$define"
15564 echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
15565 d_syserrlst="$undef"
15567 elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
15568 $contains '#[ ]*define.*strerror' "$xxx" >/dev/null 2>&1; then
15569 echo 'strerror() found in string header.' >&4
15570 d_strerror="$define"
15571 d_strerrm='strerror(e)'
15572 if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15573 echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
15574 d_syserrlst="$define"
15576 echo "(You don't appear to have any sys_errlist[], how can this be?)"
15577 d_syserrlst="$undef"
15579 elif set sys_errlist val -a d_syserrlst; eval $csym; $val; then
15580 echo "strerror() not found, but you have sys_errlist[] so we'll use that." >&4
15581 d_strerror="$undef"
15582 d_syserrlst="$define"
15583 d_strerrm='((e)<0||(e)>=sys_nerr?"unknown":sys_errlist[e])'
15585 echo 'strerror() and sys_errlist[] NOT found.' >&4
15586 d_strerror="$undef"
15587 d_syserrlst="$undef"
15588 d_strerrm='"unknown"'
15592 : see if strerror_r exists
15593 set strerror_r d_strerror_r
15595 case "$d_strerror_r" in
15597 hdrs="$i_systypes sys/types.h define stdio.h $i_string string.h"
15598 case "$d_strerror_r_proto:$usethreads" in
15599 ":define") d_strerror_r_proto=define
15600 set d_strerror_r_proto strerror_r $hdrs
15604 case "$d_strerror_r_proto" in
15606 case "$strerror_r_proto" in
15607 ''|0) try='int strerror_r(int, char*, size_t);'
15608 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBW ;;
15610 case "$strerror_r_proto" in
15611 ''|0) try='int strerror_r(int, char*, int);'
15612 ./protochk "extern $try" $hdrs && strerror_r_proto=I_IBI ;;
15614 case "$strerror_r_proto" in
15615 ''|0) try='char* strerror_r(int, char*, size_t);'
15616 ./protochk "extern $try" $hdrs && strerror_r_proto=B_IBW ;;
15618 case "$strerror_r_proto" in
15619 ''|0) d_strerror_r=undef
15621 echo "Disabling strerror_r, cannot determine prototype." >&4 ;;
15622 * ) case "$strerror_r_proto" in
15623 REENTRANT_PROTO*) ;;
15624 *) strerror_r_proto="REENTRANT_PROTO_$strerror_r_proto" ;;
15626 echo "Prototype: $try" ;;
15629 *) case "$usethreads" in
15630 define) echo "strerror_r has no prototype, not using it." >&4 ;;
15637 *) strerror_r_proto=0
15641 : see if strftime exists
15642 set strftime d_strftime
15645 : see if strtod exists
15646 set strtod d_strtod
15649 : see if strtol exists
15650 set strtol d_strtol
15653 : see if strtold exists
15654 set strtold d_strtold
15657 : see if strtoll exists
15658 set strtoll d_strtoll
15661 case "$d_longlong-$d_strtoll" in
15664 Checking whether your strtoll() works okay...
15666 $cat >try.c <<'EOCP'
15669 #define strtoll __strtoll
15672 #define strtoll _strtoll
15675 extern long long int strtoll(char *s, char **, int);
15676 static int bad = 0;
15677 int check(char *s, long long ell, int een) {
15680 gll = strtoll(s, 0, 10);
15681 if (!((gll == ell) && (errno == een)))
15685 check(" 1", 1LL, 0);
15686 check(" 0", 0LL, 0);
15687 check("-1", -1LL, 0);
15688 check("-9223372036854775808", -9223372036854775808LL, 0);
15689 check("-9223372036854775808", -9223372036854775808LL, 0);
15690 check(" 9223372036854775807", 9223372036854775807LL, 0);
15691 check("-9223372036854775808", -9223372036854775808LL, 0);
15692 check(" 9223372036854775808", 9223372036854775807LL, ERANGE);
15693 check("-9223372036854775809", -9223372036854775808LL, ERANGE);
15699 if eval $compile; then
15702 ok) echo "Your strtoll() seems to be working okay." ;;
15704 Your strtoll() doesn't seem to be working okay.
15710 echo "(I can't seem to compile the test program--assuming it doesn't)"
15716 : see if strtoq exists
15717 set strtoq d_strtoq
15720 : see if strtoul exists
15721 set strtoul d_strtoul
15724 case "$d_strtoul" in
15727 Checking whether your strtoul() works okay...
15729 $cat >try.c <<'EOCP'
15732 extern unsigned long int strtoul(char *s, char **, int);
15733 static int bad = 0;
15734 void check(char *s, unsigned long eul, int een) {
15737 gul = strtoul(s, 0, 10);
15738 if (!((gul == eul) && (errno == een)))
15742 check(" 1", 1L, 0);
15743 check(" 0", 0L, 0);
15745 case "$longsize" in
15747 $cat >>try.c <<'EOCP'
15748 check("18446744073709551615", 18446744073709551615UL, 0);
15749 check("18446744073709551616", 18446744073709551615UL, ERANGE);
15750 #if 0 /* strtoul() for /^-/ strings is undefined. */
15751 check("-1", 18446744073709551615UL, 0);
15752 check("-18446744073709551614", 2, 0);
15753 check("-18446744073709551615", 1, 0);
15754 check("-18446744073709551616", 18446744073709551615UL, ERANGE);
15755 check("-18446744073709551617", 18446744073709551615UL, ERANGE);
15760 $cat >>try.c <<'EOCP'
15761 check("4294967295", 4294967295UL, 0);
15762 check("4294967296", 4294967295UL, ERANGE);
15763 #if 0 /* strtoul() for /^-/ strings is undefined. */
15764 check("-1", 4294967295UL, 0);
15765 check("-4294967294", 2, 0);
15766 check("-4294967295", 1, 0);
15767 check("-4294967296", 4294967295UL, ERANGE);
15768 check("-4294967297", 4294967295UL, ERANGE);
15773 : Should we write these tests to be more portable by sprintf-ing
15774 : ~0 and then manipulating that char string as input for strtol?
15777 $cat >>try.c <<'EOCP'
15784 if eval $compile; then
15785 case "`$run ./try`" in
15786 ok) echo "Your strtoul() seems to be working okay." ;;
15788 Your strtoul() doesn't seem to be working okay.
15797 : see if strtoull exists
15798 set strtoull d_strtoull
15801 case "$d_longlong-$d_strtoull" in
15804 Checking whether your strtoull() works okay...
15806 $cat >try.c <<'EOCP'
15809 #define strtoull __strtoull
15812 extern unsigned long long int strtoull(char *s, char **, int);
15813 static int bad = 0;
15814 int check(char *s, long long eull, int een) {
15817 gull = strtoull(s, 0, 10);
15818 if (!((gull == eull) && (errno == een)))
15822 check(" 1", 1LL, 0);
15823 check(" 0", 0LL, 0);
15824 check("18446744073709551615", 18446744073709551615ULL, 0);
15825 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
15826 #if 0 /* strtoull() for /^-/ strings is undefined. */
15827 check("-1", 18446744073709551615ULL, 0);
15828 check("-18446744073709551614", 2LL, 0);
15829 check("-18446744073709551615", 1LL, 0);
15830 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
15831 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
15838 if eval $compile; then
15839 case "`$run ./try`" in
15840 ok) echo "Your strtoull() seems to be working okay." ;;
15842 Your strtoull() doesn't seem to be working okay.
15844 d_strtoull="$undef"
15851 : see if strtouq exists
15852 set strtouq d_strtouq
15855 case "$d_strtouq" in
15858 Checking whether your strtouq() works okay...
15860 $cat >try.c <<'EOCP'
15863 extern unsigned long long int strtouq(char *s, char **, int);
15864 static int bad = 0;
15865 void check(char *s, unsigned long long eull, int een) {
15866 unsigned long long gull;
15868 gull = strtouq(s, 0, 10);
15869 if (!((gull == eull) && (errno == een)))
15873 check(" 1", 1LL, 0);
15874 check(" 0", 0LL, 0);
15875 check("18446744073709551615", 18446744073709551615ULL, 0);
15876 check("18446744073709551616", 18446744073709551615ULL, ERANGE);
15877 #if 0 /* strtouq() for /^-/ strings is undefined. */
15878 check("-1", 18446744073709551615ULL, 0);
15879 check("-18446744073709551614", 2LL, 0);
15880 check("-18446744073709551615", 1LL, 0);
15881 check("-18446744073709551616", 18446744073709551615ULL, ERANGE);
15882 check("-18446744073709551617", 18446744073709551615ULL, ERANGE);
15890 if eval $compile; then
15891 case "`$run ./try`" in
15892 ok) echo "Your strtouq() seems to be working okay." ;;
15894 Your strtouq() doesn't seem to be working okay.
15903 : see if strxfrm exists
15904 set strxfrm d_strxfrm
15907 : see if symlink exists
15908 set symlink d_symlink
15911 : see if syscall exists
15912 set syscall d_syscall
15915 : see if prototype for syscall is available
15917 set d_syscallproto syscall $i_unistd unistd.h
15920 : see if sysconf exists
15921 set sysconf d_sysconf
15924 : see if system exists
15925 set system d_system
15928 : see if tcgetpgrp exists
15929 set tcgetpgrp d_tcgetpgrp
15932 : see if tcsetpgrp exists
15933 set tcsetpgrp d_tcsetpgrp
15936 : see if prototype for telldir is available
15938 set d_telldirproto telldir $i_systypes sys/types.h $i_dirent dirent.h
15941 : see if time exists
15943 if test "X$d_time" = X -o X"$timetype" = X; then
15944 if set time val -f d_time; eval $csym; $val; then
15945 echo 'time() found.' >&4
15947 rp="What is the type returned by time() on this system?"
15948 set time_t timetype long stdio.h sys/types.h
15951 echo 'time() not found, hope that will do.' >&4
15959 : see if this is a sys/times.h system
15960 set sys/times.h i_systimes
15963 : see if times exists
15965 if set times val -f d_times; eval $csym; $val; then
15966 echo 'times() found.' >&4
15969 case "$i_systimes" in
15970 "$define") inc='sys/times.h';;
15972 rp="What is the type returned by times() on this system?"
15973 set clock_t clocktype long stdio.h sys/types.h $inc
15976 echo 'times() NOT found, hope that will do.' >&4
15981 : see if tmpnam_r exists
15982 set tmpnam_r d_tmpnam_r
15984 case "$d_tmpnam_r" in
15986 hdrs="$i_systypes sys/types.h define stdio.h "
15987 case "$d_tmpnam_r_proto:$usethreads" in
15988 ":define") d_tmpnam_r_proto=define
15989 set d_tmpnam_r_proto tmpnam_r $hdrs
15993 case "$d_tmpnam_r_proto" in
15995 case "$tmpnam_r_proto" in
15996 ''|0) try='char* tmpnam_r(char*);'
15997 ./protochk "extern $try" $hdrs && tmpnam_r_proto=B_B ;;
15999 case "$tmpnam_r_proto" in
16000 ''|0) d_tmpnam_r=undef
16002 echo "Disabling tmpnam_r, cannot determine prototype." >&4 ;;
16003 * ) case "$tmpnam_r_proto" in
16004 REENTRANT_PROTO*) ;;
16005 *) tmpnam_r_proto="REENTRANT_PROTO_$tmpnam_r_proto" ;;
16007 echo "Prototype: $try" ;;
16010 *) case "$usethreads" in
16011 define) echo "tmpnam_r has no prototype, not using it." >&4 ;;
16018 *) tmpnam_r_proto=0
16022 : see if truncate exists
16023 set truncate d_truncate
16026 : see if ttyname_r exists
16027 set ttyname_r d_ttyname_r
16029 case "$d_ttyname_r" in
16031 hdrs="$i_systypes sys/types.h define stdio.h $i_unistd unistd.h"
16032 case "$d_ttyname_r_proto:$usethreads" in
16033 ":define") d_ttyname_r_proto=define
16034 set d_ttyname_r_proto ttyname_r $hdrs
16038 case "$d_ttyname_r_proto" in
16040 case "$ttyname_r_proto" in
16041 ''|0) try='int ttyname_r(int, char*, size_t);'
16042 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBW ;;
16044 case "$ttyname_r_proto" in
16045 ''|0) try='int ttyname_r(int, char*, int);'
16046 ./protochk "extern $try" $hdrs && ttyname_r_proto=I_IBI ;;
16048 case "$ttyname_r_proto" in
16049 ''|0) try='char* ttyname_r(int, char*, int);'
16050 ./protochk "extern $try" $hdrs && ttyname_r_proto=B_IBI ;;
16052 case "$ttyname_r_proto" in
16053 ''|0) d_ttyname_r=undef
16055 echo "Disabling ttyname_r, cannot determine prototype." >&4 ;;
16056 * ) case "$ttyname_r_proto" in
16057 REENTRANT_PROTO*) ;;
16058 *) ttyname_r_proto="REENTRANT_PROTO_$ttyname_r_proto" ;;
16060 echo "Prototype: $try" ;;
16063 *) case "$usethreads" in
16064 define) echo "ttyname_r has no prototype, not using it." >&4 ;;
16071 *) ttyname_r_proto=0
16075 : see if tzname[] exists
16077 if set tzname val -a d_tzname; eval $csym; $val; then
16079 echo 'tzname[] found.' >&4
16082 echo 'tzname[] NOT found.' >&4
16088 next|rhapsody|darwin) multiarch="$define" ;;
16090 case "$multiarch" in
16091 ''|[nN]*) multiarch="$undef" ;;
16094 : check for ordering of bytes in a UV
16096 case "$usecrosscompile$multiarch" in
16099 You seem to be either cross-compiling or doing a multiarchitecture build,
16100 skipping the byteorder check.
16106 case "$byteorder" in
16109 In the following, larger digits indicate more significance. A big-endian
16110 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
16111 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
16112 machines may have weird orders like 3412. A Cray will report 87654321,
16113 an Alpha will report 12345678. If the test program works the default is
16115 I'm now running the test program...
16119 #include <sys/types.h>
16120 typedef $uvtype UV;
16130 u.l = (((UV)0x08070605) << 32) | (UV)0x04030201;
16132 u.l = (UV)0x04030201;
16133 for (i = 0; i < $uvsize; i++)
16134 printf("%c", u.c[i]+'0');
16141 if eval $compile && ./try > /dev/null; then
16144 [1-4][1-4][1-4][1-4]|12345678|87654321)
16145 echo "(The test program ran ok.)"
16146 echo "byteorder=$dflt"
16149 ????|????????) echo "(The test program ran ok.)" ;;
16150 *) echo "(The test program didn't run right for some reason.)" ;;
16155 (I can't seem to compile the test program. Guessing big-endian...)
16158 case "$xxx_prompt" in
16160 rp="What is the order of bytes in $uvtype?"
16176 Checking to see whether you can access character data unalignedly...
16178 case "$d_u32align" in
16179 '') $cat >try.c <<EOCP
16181 #define U32 $u32type
16182 #define BYTEORDER 0x$byteorder
16184 #include <signal.h>
16186 $signal_t bletch(s) int s; { exit(4); }
16189 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
16194 if (sizeof(U32) != 4) {
16195 printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
16202 signal(SIGBUS, bletch);
16214 for (i = 0; i < 4; i++) {
16215 up = (U32*)(buf + i);
16216 if (! ((*up == 1 << (8*i)) || /* big-endian */
16217 (*up == 1 << (8*(3-i))) /* little-endian */
16221 printf("read failed (%x)\n", *up);
16227 for (i = 0; i < 4; i++) {
16228 up = (U32*)(buf + i);
16230 if (*up != 0xBeef) {
16231 printf("write failed (%x)\n", *up);
16245 if eval $compile_ok; then
16246 echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
16247 $run ./try 2>&1 >/dev/null
16250 You can access character data pretty unalignedly.
16252 d_u32align="$undef"
16255 It seems that you must access character data in an aligned manner.
16257 d_u32align="$define"
16261 rp='Can you access character data at unaligned addresses?'
16265 [yY]*) d_u32align="$undef" ;;
16266 *) d_u32align="$define" ;;
16269 $rm -f core core.try.* try.core
16273 : see if ualarm exists
16274 set ualarm d_ualarm
16277 : see if umask exists
16281 : see if unordered exists
16282 set unordered d_unordered
16285 : see if usleep exists
16286 set usleep d_usleep
16289 : see if prototype for usleep is available
16291 set d_usleepproto usleep $i_unistd unistd.h
16294 : see if ustat exists
16298 : backward compatibility for d_hvfork
16299 if test X$d_hvfork != X; then
16300 d_vfork="$d_hvfork"
16303 : see if there is a vfork
16308 : Ok, but do we want to use it. vfork is reportedly unreliable in
16309 : perl on Solaris 2.x, and probably elsewhere.
16313 case "$usevfork" in
16319 Perl can only use a vfork() that doesn't suffer from strict
16320 restrictions on calling functions or modifying global data in
16321 the child. For example, glibc-2.1 contains such a vfork()
16322 that is unsuitable. If your system provides a proper fork()
16323 call, chances are that you do NOT want perl to use vfork().
16326 rp="Do you still want to use vfork()?"
16331 echo "Ok, we won't use vfork()."
16340 $define) usevfork='true';;
16341 *) usevfork='false';;
16344 : see if closedir exists
16345 set closedir d_closedir
16348 case "$d_closedir" in
16351 echo "Checking whether closedir() returns a status..." >&4
16353 #$i_dirent I_DIRENT /**/
16354 #$i_sysdir I_SYS_DIR /**/
16355 #$i_sysndir I_SYS_NDIR /**/
16356 #$i_systypes I_SYS_TYPES /**/
16358 #if defined(I_SYS_TYPES)
16359 #include <sys/types.h>
16361 #if defined(I_DIRENT)
16362 #include <dirent.h>
16363 #if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
16364 #include <sys/dir.h>
16368 #include <sys/ndir.h>
16372 #include <ndir.h> /* may be wrong in the future */
16374 #include <sys/dir.h>
16379 int main() { return closedir(opendir(".")); }
16382 if eval $compile_ok; then
16383 if $run ./try > /dev/null 2>&1 ; then
16384 echo "Yes, it does."
16387 echo "No, it doesn't."
16391 echo "(I can't seem to compile the test program--assuming it doesn't)"
16399 set d_void_closedir
16402 : see if there is a wait4
16406 : see if waitpid exists
16407 set waitpid d_waitpid
16410 : see if wcstombs exists
16411 set wcstombs d_wcstombs
16414 : see if wctomb exists
16415 set wctomb d_wctomb
16418 : see if writev exists
16419 set writev d_writev
16422 : preserve RCS keywords in files with variable substitution, grrr
16427 Revision='$Revision'
16429 : check for alignment requirements
16431 case "$usecrosscompile$multiarch" in
16434 You seem to be either cross-compiling or doing a multiarchitecture build,
16435 skipping the memory alignment check.
16438 case "$alignbytes" in
16439 '') alignbytes=8 ;;
16443 case "$alignbytes" in
16444 '') echo "Checking alignment constraints..." >&4
16445 if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
16446 $cat >try.c <<'EOCP'
16447 typedef long double NV;
16450 $cat >try.c <<'EOCP'
16454 $cat >>try.c <<'EOCP'
16462 printf("%d\n", (int)((char *)&try_algn.bar - (char *)&try_algn.foo));
16467 if eval $compile_ok; then
16471 echo "(I can't seem to compile the test program...)"
16474 *) dflt="$alignbytes"
16477 rp="Doubles must be aligned on a how-many-byte boundary?"
16485 : set the base revision
16488 : how do we catenate cpp tokens here?
16490 echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
16491 $cat >cpp_stuff.c <<'EOCP'
16492 #define RCAT(a,b)a/**/b
16493 #define ACAT(a,b)a ## b
16497 $cppstdin $cppflags $cppminus <cpp_stuff.c >cpp_stuff.out 2>&1
16498 if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then
16499 echo "Oh! Smells like ANSI's been here." >&4
16500 echo "We can catify or stringify, separately or together!"
16502 elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
16503 echo "Ah, yes! The good old days!" >&4
16504 echo "However, in the good old days we don't know how to stringify and"
16505 echo "catify at the same time."
16509 Hmm, I don't seem to be able to catenate tokens with your cpp. You're going
16510 to have to edit the values of CAT[2-5] in config.h...
16512 cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
16516 : see if this is a db.h system
16522 : Check db version.
16524 echo "Checking Berkeley DB version ..." >&4
16530 #include <sys/types.h>
16533 int main(int argc, char *argv[])
16535 #ifdef DB_VERSION_MAJOR /* DB version >= 2 */
16536 int Major, Minor, Patch ;
16537 unsigned long Version ;
16538 (void)db_version(&Major, &Minor, &Patch) ;
16540 printf("%d %d %d %d %d %d\n",
16541 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH,
16542 Major, Minor, Patch);
16545 printf("You have Berkeley DB Version 2 or greater.\n");
16547 printf("db.h is from Berkeley DB Version %d.%d.%d\n",
16548 DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
16549 printf("libdb is from Berkeley DB Version %d.%d.%d\n",
16550 Major, Minor, Patch) ;
16552 /* check that db.h & libdb are compatible */
16553 if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
16554 printf("db.h and libdb are incompatible.\n") ;
16558 printf("db.h and libdb are compatible.\n") ;
16560 Version = DB_VERSION_MAJOR * 1000000 + DB_VERSION_MINOR * 1000
16561 + DB_VERSION_PATCH ;
16563 /* needs to be >= 2.3.4 */
16564 if (Version < 2003004) {
16565 /* if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) { */
16566 printf("Perl needs Berkeley DB 2.3.4 or greater.\n") ;
16572 #if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
16577 printf("You have Berkeley DB Version 1.\n");
16578 exit(0); /* DB version < 2: the coast is clear. */
16580 exit(1); /* <db.h> not Berkeley DB? */
16586 if eval $compile_ok && $run ./try; then
16587 echo 'Looks OK.' >&4
16589 db_version_major=$1
16590 db_version_minor=$2
16591 db_version_patch=$3
16593 echo "I can't use Berkeley DB with your <db.h>. I'll disable Berkeley DB." >&4
16597 : Remove db from list of libraries to use
16598 echo "Removing unusable -ldb from library list" >&4
16599 set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
16602 echo "libs = $libs" >&4
16612 : Check the return type needed for hash
16614 echo "Checking return type needed for hash for Berkeley DB ..." >&4
16620 #include <sys/types.h>
16623 #ifndef DB_VERSION_MAJOR
16624 u_int32_t hash_cb (ptr, size)
16632 info.hash = hash_cb;
16636 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16637 if $contains warning try.out >>/dev/null 2>&1 ; then
16640 db_hashtype='u_int32_t'
16643 : XXX Maybe we should just give up here.
16644 db_hashtype=u_int32_t
16646 echo "Help: I can't seem to compile the db test program." >&4
16647 echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
16650 echo "Your version of Berkeley DB uses $db_hashtype for hash."
16652 *) db_hashtype=u_int32_t
16657 : Check the return type needed for prefix
16659 echo "Checking return type needed for prefix for Berkeley DB ..." >&4
16665 #include <sys/types.h>
16668 #ifndef DB_VERSION_MAJOR
16669 size_t prefix_cb (key1, key2)
16677 info.prefix = prefix_cb;
16681 if $cc $ccflags -c try.c >try.out 2>&1 ; then
16682 if $contains warning try.out >>/dev/null 2>&1 ; then
16683 db_prefixtype='int'
16685 db_prefixtype='size_t'
16688 db_prefixtype='size_t'
16689 : XXX Maybe we should just give up here.
16691 echo "Help: I can't seem to compile the db test program." >&4
16692 echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
16695 echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
16697 *) db_prefixtype='size_t'
16702 : How can we generate normalized random numbers ?
16704 echo "Looking for a random number function..." >&4
16705 case "$randfunc" in
16707 if set drand48 val -f; eval $csym; $val; then
16709 echo "Good, found drand48()." >&4
16710 elif set random val -f; eval $csym; $val; then
16712 echo "OK, found random()." >&4
16715 echo "Yick, looks like I have to use rand()." >&4
16726 *-Dmy_rand=*|*-Dmy_srand=*)
16727 echo "Removing obsolete -Dmy_rand, -Dmy_srand, and -Drandbits from ccflags." >&4
16728 ccflags="`echo $ccflags | sed -e 's/-Dmy_rand=random/ /'`"
16729 ccflags="`echo $ccflags | sed -e 's/-Dmy_srand=srandom/ /'`"
16730 ccflags="`echo $ccflags | sed -e 's/-Drandbits=[0-9][0-9]*/ /'`"
16734 while $test "$cont"; do
16735 rp="Use which function to generate random numbers?"
16737 if $test "$ans" = "$dflt"; then
16743 if set $ans val -f; eval $csym; $val; then
16747 rp="I cannot find function $ans. Use that name anyway?"
16756 case "$randfunc" in
16758 drand01="drand48()"
16764 case "$randbits" in
16766 echo "Checking to see how many bits your $randfunc() function produces..." >&4
16768 #$i_unistd I_UNISTD
16769 #$i_stdlib I_STDLIB
16772 # include <unistd.h>
16775 # include <stdlib.h>
16780 register unsigned long tmp;
16781 register unsigned long max = 0L;
16783 for (i = 1000; i; i--) {
16784 tmp = (unsigned long) $randfunc();
16785 if (tmp > max) max = tmp;
16787 for (i = 0; max; i++)
16793 if eval $compile_ok; then
16797 echo "(I can't seem to compile the test program...)"
16804 rp="How many bits does your $randfunc() function produce?"
16808 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
16809 seedfunc="s$randfunc"
16810 randseedtype=unsigned
16814 rp="How many bits does your $randfunc() function produce?"
16817 seedfunc="s$randfunc"
16818 drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
16819 if set $seedfunc val -f; eval $csym; $val; then
16820 echo "(Using $seedfunc() to seed random generator)"
16822 echo "(Warning: no $seedfunc() to seed random generator)"
16825 randseedtype=unsigned
16833 echo "Determining whether or not we are on an EBCDIC system..." >&4
16834 $cat >try.c <<'EOM'
16837 if ('M'==0xd4) return 0;
16844 if eval $compile_ok; then
16845 if $run ./try; then
16846 echo "You seem to speak EBCDIC." >&4
16849 echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
16852 echo "I'm unable to compile the test program." >&4
16853 echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
16861 Checking how to flush all pending stdio output...
16863 # I only know how to find the first 32 possibly open files on SunOS.
16864 # See also hints/sunos_4_1.sh and util.c --AD
16866 sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
16868 $cat >>try.c <<EOCP
16870 #$i_unistd I_UNISTD
16872 # include <unistd.h>
16874 #$d_sysconf HAS_SYSCONF
16875 #$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
16876 #ifdef HAS_STDIO_STREAM_ARRAY
16877 # define STDIO_STREAM_ARRAY $stdio_stream_array
16882 p = fopen("try.out", "w");
16886 # ifdef TRY_FPRINTF
16890 #ifdef TRY_FFLUSH_NULL
16893 #ifdef TRY_FFLUSH_ALL
16895 long open_max = -1;
16896 # ifdef PERL_FFLUSH_ALL_FOPEN_MAX
16897 open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
16899 # if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
16900 open_max = sysconf(_SC_OPEN_MAX);
16903 open_max = FOPEN_MAX;
16906 open_max = OPEN_MAX;
16915 # ifdef HAS_STDIO_STREAM_ARRAY
16916 if (open_max > 0) {
16918 for (i = 0; i < open_max; i++)
16919 if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
16920 STDIO_STREAM_ARRAY[i]._file < open_max &&
16921 STDIO_STREAM_ARRAY[i]._flag)
16922 fflush(&STDIO_STREAM_ARRAY[i]);
16930 : first we have to find out how _not_ to flush
16932 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
16934 set try -DTRY_FPUTC
16935 if eval $compile; then
16936 $run ./try 2>/dev/null
16939 if $test ! -s try.out -a "X$code" = X42; then
16945 set try -DTRY_FPRINTF
16946 if eval $compile; then
16947 $run ./try 2>/dev/null
16950 if $test ! -s try.out -a "X$code" = X42; then
16951 output=-DTRY_FPRINTF
16957 : check for fflush NULL behaviour
16958 case "$fflushNULL" in
16959 '') set try -DTRY_FFLUSH_NULL $output
16960 if eval $compile; then
16961 $run ./try 2>/dev/null
16964 if $test -s try.out -a "X$code" = X42; then
16965 fflushNULL="`$cat try.out`"
16967 if $test "X$code" != X42; then
16969 (If this test failed, don't worry, we'll try another method shortly.)
16974 $rm -f core try.core core.try.*
16975 case "$fflushNULL" in
16977 Your fflush(NULL) works okay for output streams.
16978 Let's see if it clobbers input pipes...
16980 # As of mid-March 2000 all versions of Solaris appear to have a stdio
16981 # bug that improperly flushes the input end of pipes. So we avoid the
16982 # autoflush on fork/system/exec support for now. :-(
16983 $cat >tryp.c <<EOCP
16986 main(int argc, char **argv)
16992 while ((i = getc(stdin)) != -1
16993 && (*bp++ = i) != '\n'
16994 && bp < &buf[1024])
16997 fprintf(stdout, "%s", buf);
17005 fflushNULL="$define"
17007 if eval $compile; then
17009 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17010 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17012 fflush(NULL) seems to behave okay with input streams.
17014 fflushNULL="$define"
17017 Ouch, fflush(NULL) clobbers input pipes! We will not use it.
17019 fflushNULL="$undef"
17022 $rm -f core tryp.c tryp.core core.tryp.*
17025 Your fflush(NULL) isn't working (contrary to ANSI C).
17027 fflushNULL="$undef"
17030 Cannot figure out whether your fflush(NULL) works or not.
17031 I'm assuming it doesn't (contrary to ANSI C).
17033 fflushNULL="$undef"
17037 $define|true|[yY]*)
17038 fflushNULL="$define"
17041 fflushNULL="$undef"
17044 : check explicit looping only if NULL did not work, and if the pipe
17045 : bug does not show up on an explicit flush too
17046 case "$fflushNULL" in
17048 $cat >tryp.c <<EOCP
17051 main(int argc, char **argv)
17057 while ((i = getc(stdin)) != -1
17058 && (*bp++ = i) != '\n'
17059 && bp < &buf[1024])
17062 fprintf(stdout, "%s", buf);
17071 if eval $compile; then
17073 $cat tryp.c | $run ./tryp 2>/dev/null > tryp.out
17074 if cmp tryp.c tryp.out >/dev/null 2>&1; then
17076 Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
17078 : now check for fflushall behaviour
17079 case "$fflushall" in
17080 '') set try -DTRY_FFLUSH_ALL $output
17081 if eval $compile; then
17083 (Now testing the other method--but note that this also may fail.)
17085 $run ./try 2>/dev/null
17088 if $test -s try.out -a "X$code" = X42; then
17089 fflushall="`$cat try.out`"
17092 $rm -f core try.core core.try.*
17093 case "$fflushall" in
17095 Whew. Flushing explicitly all the stdio streams works.
17097 fflushall="$define"
17100 Sigh. Flushing explicitly all the stdio streams doesn't work.
17105 Cannot figure out whether flushing stdio streams explicitly works or not.
17106 I'm assuming it doesn't.
17112 "$define"|true|[yY]*)
17113 fflushall="$define"
17121 All is futile. Even fflush(stdin) clobbers input pipes!
17128 $rm -f core tryp.c tryp.core core.tryp.*
17130 *) fflushall="$undef"
17134 case "$fflushNULL$fflushall" in
17137 OK, I give up. I cannot figure out how to flush pending stdio output.
17138 We won't be flushing handles at all before fork/exec/popen.
17142 $rm -f try.* try$exe_ext
17144 : Store the full pathname to the ar program for use in the C program
17145 : Respect a hint or command line value for full_ar.
17150 : Store the full pathname to the sed program for use in the C program
17153 : see what type gids are declared as in the kernel
17155 echo "Looking for the type for group ids returned by getgid()."
17156 set gid_t gidtype xxx stdio.h sys/types.h
17160 xxx=`./findhdr sys/user.h`
17161 set `grep 'groups\[NGROUPS\];' "$xxx" 2>/dev/null` unsigned short
17163 unsigned) dflt="$1 $2" ;;
17167 *) dflt="$gidtype";;
17170 gid_t) echo "gid_t found." ;;
17171 *) rp="What is the type for group ids returned by getgid()?"
17179 *_t) zzz="$gidtype" ;;
17182 echo "Checking the size of $zzz..." >&4
17184 #include <sys/types.h>
17187 printf("%d\n", (int)sizeof($gidtype));
17192 if eval $compile_ok; then
17196 echo "(I can't execute the test program--guessing $gidsize.)" >&4
17199 echo "Your $zzz is $gidsize bytes long."
17204 echo "(I can't compile the test program--guessing $gidsize.)" >&4
17210 *_t) zzz="$gidtype" ;;
17213 echo "Checking the sign of $zzz..." >&4
17215 #include <sys/types.h>
17226 if eval $compile; then
17230 echo "(I can't execute the test program--guessing unsigned.)" >&4
17234 1) echo "Your $zzz is unsigned." ;;
17235 -1) echo "Your $zzz is signed." ;;
17241 echo "(I can't compile the test program--guessing unsigned.)" >&4
17247 if $test X"$quadtype" != X; then
17249 echo "Checking how to print 64-bit integers..." >&4
17251 if $test X"$sPRId64" = X -a X"$quadtype" = Xint; then
17252 $cat >try.c <<'EOCP'
17253 #include <sys/types.h>
17256 int q = 12345678901;
17257 printf("%ld\n", q);
17261 if eval $compile; then
17265 sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
17266 sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
17267 echo "We will use %d."
17273 if $test X"$sPRId64" = X -a X"$quadtype" = Xlong; then
17274 $cat >try.c <<'EOCP'
17275 #include <sys/types.h>
17278 long q = 12345678901;
17279 printf("%ld\n", q);
17283 if eval $compile; then
17287 sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
17288 sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
17289 echo "We will use %ld."
17295 if $test X"$sPRId64" = X -a X"$i_inttypes" = X"$define" -a X"$quadtype" = Xint64_t; then
17296 $cat >try.c <<'EOCP'
17297 #include <sys/types.h>
17298 #include <inttypes.h>
17301 int64_t q = 12345678901;
17302 printf("%" PRId64 "\n", q);
17306 if eval $compile; then
17310 sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
17311 sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
17312 echo "We will use the C9X style."
17318 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17320 #include <sys/types.h>
17323 $quadtype q = 12345678901;
17324 printf("%Ld\n", q);
17328 if eval $compile; then
17332 sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
17333 sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
17334 echo "We will use %Ld."
17340 if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
17341 $cat >try.c <<'EOCP'
17342 #include <sys/types.h>
17345 long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
17346 printf("%lld\n", q);
17350 if eval $compile; then
17354 sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
17355 sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
17356 echo "We will use the %lld style."
17362 if $test X"$sPRId64" = X -a X"$quadtype" != X; then
17364 #include <sys/types.h>
17367 $quadtype q = 12345678901;
17368 printf("%qd\n", q);
17372 if eval $compile; then
17376 sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
17377 sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
17378 echo "We will use %qd."
17384 if $test X"$sPRId64" = X; then
17385 echo "Cannot figure out how to print 64-bit integers." >&4
17393 '') d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef";
17394 d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef";
17396 *) d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define";
17397 d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define";
17403 $echo "Checking the format strings to be used for Perl's internal types..." >&4
17405 if $test X"$ivsize" = X8; then
17406 ivdformat="$sPRId64"
17407 uvuformat="$sPRIu64"
17408 uvoformat="$sPRIo64"
17409 uvxformat="$sPRIx64"
17410 uvXUformat="$sPRIXU64"
17412 if $test X"$ivsize" = X"$longsize"; then
17419 if $test X"$ivsize" = X"$intsize"; then
17427 if $test X"$ivsize" = X"$shortsize"; then
17438 if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PRIgldbl" = X"$define"; then
17439 nveformat="$sPRIeldbl"
17440 nvfformat="$sPRIfldbl"
17441 nvgformat="$sPRIgldbl"
17442 nvEUformat="$sPRIEUldbl"
17443 nvFUformat="$sPRIFUldbl"
17444 nvGUformat="$sPRIGUldbl"
17454 case "$ivdformat" in
17455 '') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
17462 $echo "Checking the format string to be used for gids..." >&4
17465 -1) if $test X"$gidsize" = X"$ivsize"; then
17466 gidformat="$ivdformat"
17468 if $test X"$gidsize" = X"$longsize"; then
17471 if $test X"$gidsize" = X"$intsize"; then
17474 if $test X"$gidsize" = X"$shortsize"; then
17481 *) if $test X"$gidsize" = X"$uvsize"; then
17482 gidformat="$uvuformat"
17484 if $test X"$gidsize" = X"$longsize"; then
17487 if $test X"$gidsize" = X"$intsize"; then
17490 if $test X"$gidsize" = X"$shortsize"; then
17499 : see if getgroups exists
17500 set getgroups d_getgrps
17503 : see if setgroups exists
17504 set setgroups d_setgrps
17508 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
17510 case "$d_getgrps$d_setgrps" in
17512 case "$groupstype" in
17513 '') dflt="$gidtype" ;;
17514 *) dflt="$groupstype" ;;
17517 What type of pointer is the second argument to getgroups() and setgroups()?
17518 Usually this is the same as group ids, $gidtype, but not always.
17521 rp='What type pointer is the second argument to getgroups() and setgroups()?'
17525 *) groupstype="$gidtype";;
17529 echo "Checking if your $make program sets \$(MAKE)..." >&4
17530 case "$make_set_make" in
17532 $sed 's/^X //' > testmake.mak << 'EOF'
17534 X @echo 'maketemp="$(MAKE)"'
17536 case "`$make -f testmake.mak 2>/dev/null`" in
17537 *maketemp=*) make_set_make='#' ;;
17538 *) make_set_make="MAKE=$make" ;;
17540 $rm -f testmake.mak
17543 case "$make_set_make" in
17544 '#') echo "Yup, it does.";;
17545 *) echo "Nope, it doesn't.";;
17548 : see what type is used for mode_t
17549 rp="What is the type used for file modes for system calls (e.g. fchmod())?"
17550 set mode_t modetype int stdio.h sys/types.h
17553 : see if stdarg is available
17555 if $test `./findhdr stdarg.h`; then
17556 echo "<stdarg.h> found." >&4
17559 echo "<stdarg.h> NOT found." >&4
17563 : see if varags is available
17565 if $test `./findhdr varargs.h`; then
17566 echo "<varargs.h> found." >&4
17568 echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
17571 : set up the varargs testing programs
17572 $cat > varargs.c <<EOP
17574 #include <stdarg.h>
17577 #include <varargs.h>
17581 int f(char *p, ...)
17595 p = va_arg(ap, char *);
17600 $cat > varargs <<EOP
17602 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
17611 : now check which varargs header should be included
17616 if `./varargs I_STDARG`; then
17618 elif `./varargs I_VARARGS`; then
17623 if `./varargs I_VARARGS`; then
17630 echo "I could not find the definition for va_dcl... You have problems..." >&4
17631 val="$undef"; set i_stdarg; eval $setvar
17632 val="$undef"; set i_varargs; eval $setvar
17637 case "$i_varhdr" in
17639 val="$define"; set i_stdarg; eval $setvar
17640 val="$undef"; set i_varargs; eval $setvar
17643 val="$undef"; set i_stdarg; eval $setvar
17644 val="$define"; set i_varargs; eval $setvar
17647 echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
17651 : see if we need va_copy
17653 case "$i_stdarg" in
17656 #include <stdarg.h>
17658 #$i_stdlib I_STDLIB
17660 #include <stdlib.h>
17662 #include <signal.h>
17665 ivfprintf(FILE *f, const char *fmt, va_list *valp)
17667 return vfprintf(f, fmt, *valp);
17671 myvfprintf(FILE *f, const char *fmt, va_list val)
17673 return ivfprintf(f, fmt, &val);
17677 myprintf(char *fmt, ...)
17680 va_start(val, fmt);
17681 return myvfprintf(stdout, fmt, val);
17685 main(int ac, char **av)
17687 signal(SIGSEGV, exit);
17689 myprintf("%s%cs all right, then\n", "that", '\'');
17694 if eval $compile && $run ./try 2>&1 >/dev/null; then
17695 case "`$run ./try`" in
17696 "that's all right, then")
17702 yes) echo "It seems that you don't need va_copy()." >&4
17703 need_va_copy="$undef"
17705 *) echo "It seems that va_copy() or similar will be needed." >&4
17706 need_va_copy="$define"
17709 $rm -f try.* core core.* *.core *.core.*
17711 *) echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
17715 : see what type is used for size_t
17716 rp="What is the type used for the length parameter for string functions?"
17717 set size_t sizetype 'unsigned int' stdio.h sys/types.h
17720 : check for type of arguments to gethostbyaddr.
17721 if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
17722 case "$d_gethbyaddr" in
17726 Checking to see what type of arguments are accepted by gethostbyaddr().
17728 hdrs="$define sys/types.h
17729 $d_socket sys/socket.h
17730 $i_niin netinet/in.h
17732 $i_unistd unistd.h"
17733 : The first arg can 'char *' or 'void *'
17734 : The second arg is some of integral type
17735 for xxx in in_addr_t 'const void *' 'const char *' 'void *' 'char *'; do
17736 for yyy in size_t long int; do
17737 case "$netdb_host_type" in
17738 '') try="extern struct hostent *gethostbyaddr($xxx, $yyy, int);"
17739 if ./protochk "$try" $hdrs; then
17740 echo "Your system accepts $xxx for the first arg."
17741 echo "...and $yyy for the second arg."
17742 netdb_host_type="$xxx"
17743 netdb_hlen_type="$yyy"
17749 : In case none of those worked, prompt the user.
17750 case "$netdb_host_type" in
17751 '') rp='What is the type for the 1st argument to gethostbyaddr?'
17754 netdb_host_type=$ans
17755 rp='What is the type for the 2nd argument to gethostbyaddr?'
17758 netdb_hlen_type=$ans
17762 *) : no gethostbyaddr, so pick harmless defaults
17763 netdb_host_type='char *'
17764 netdb_hlen_type="$sizetype"
17767 # Remove the "const" if needed. -- but then we'll have a
17769 # netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
17772 : check for type of argument to gethostbyname.
17773 if test "X$netdb_name_type" = X ; then
17774 case "$d_gethbyname" in
17778 Checking to see what type of argument is accepted by gethostbyname().
17780 hdrs="$define sys/types.h
17781 $d_socket sys/socket.h
17782 $i_niin netinet/in.h
17784 $i_unistd unistd.h"
17785 for xxx in "const char *" "char *"; do
17786 case "$netdb_name_type" in
17787 '') try="extern struct hostent *gethostbyname($xxx);"
17788 if ./protochk "$try" $hdrs; then
17789 echo "Your system accepts $xxx."
17790 netdb_name_type="$xxx"
17795 : In case none of those worked, prompt the user.
17796 case "$netdb_name_type" in
17797 '') rp='What is the type for the 1st argument to gethostbyname?'
17800 netdb_name_type=$ans
17804 *) : no gethostbyname, so pick harmless default
17805 netdb_name_type='char *'
17810 : check for type of 1st argument to getnetbyaddr.
17811 if test "X$netdb_net_type" = X ; then
17812 case "$d_getnbyaddr" in
17816 Checking to see what type of 1st argument is accepted by getnetbyaddr().
17818 hdrs="$define sys/types.h
17819 $d_socket sys/socket.h
17820 $i_niin netinet/in.h
17822 $i_unistd unistd.h"
17823 for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
17824 case "$netdb_net_type" in
17825 '') try="extern struct netent *getnetbyaddr($xxx, int);"
17826 if ./protochk "$try" $hdrs; then
17827 echo "Your system accepts $xxx."
17828 netdb_net_type="$xxx"
17833 : In case none of those worked, prompt the user.
17834 case "$netdb_net_type" in
17835 '') rp='What is the type for the 1st argument to getnetbyaddr?'
17838 netdb_net_type=$ans
17842 *) : no getnetbyaddr, so pick harmless default
17843 netdb_net_type='long'
17847 : locate the preferred pager for this system
17853 [a-zA-Z]:/*) dflt=$pg;;
17857 [a-zA-Z]:/*) dflt=$more;;
17861 [a-zA-Z]:/*) dflt=$less;;
17864 '') dflt=/usr/ucb/more;;
17871 rp='What pager is used on your system?'
17875 : see what type pids are declared as in the kernel
17876 rp="What is the type of process ids on this system?"
17877 set pid_t pidtype int stdio.h sys/types.h
17880 : Find earliest binary compatible site_perl subdirectory perl can use.
17881 xs_apiversion=$version # The current site_perl version.
17882 : Find earliest pure perl site_perl subdirectory perl can use.
17883 : The versioned directories started at 5.005.
17884 pm_apiversion='5.005'
17886 : see if ar generates random libraries by itself
17888 echo "Checking how to generate random libraries on your machine..." >&4
17889 echo 'int bar1() { return bar2(); }' > bar1.c
17890 echo 'int bar2() { return 2; }' > bar2.c
17891 $cat > foo.c <<'EOP'
17892 int main() { printf("%d\n", bar1()); exit(0); }
17894 $cc $ccflags -c bar1.c >/dev/null 2>&1
17895 $cc $ccflags -c bar2.c >/dev/null 2>&1
17896 $cc $ccflags -c foo.c >/dev/null 2>&1
17897 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
17898 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
17899 $run ./foobar >/dev/null 2>&1; then
17900 echo "$ar appears to generate random libraries itself."
17903 elif $ar ts bar$_a >/dev/null 2>&1 &&
17904 $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
17905 $run ./foobar >/dev/null 2>&1; then
17906 echo "a table of contents needs to be added with '$ar ts'."
17913 ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
17914 $test -f $ranlib || ranlib=''
17917 if $test -n "$ranlib"; then
17918 echo "your system has '$ranlib'; we'll use that."
17921 echo "your system doesn't seem to support random libraries"
17922 echo "so we'll use lorder and tsort to order the libraries."
17929 : check for type of arguments to select.
17930 case "$selecttype" in
17931 '') case "$d_select" in
17935 Checking to see what type of arguments are accepted by select().
17937 hdrs="$define sys/types.h
17938 $i_systime sys/time.h
17939 $i_sysselct sys/select.h
17940 $d_socket sys/socket.h"
17941 : The first arg can be int, unsigned, or size_t
17942 : The last arg may or may not be 'const'
17944 : void pointer has been seen but using that
17945 : breaks the selectminbits test
17946 for xxx in 'fd_set *' 'int *'; do
17947 for nfd in 'int' 'size_t' 'unsigned long' 'unsigned' ; do
17948 for tmo in 'struct timeval *' 'const struct timeval *'; do
17950 '') try="extern select _(($nfd, $xxx, $xxx, $xxx, $tmo));"
17951 if ./protochk "$try" $hdrs; then
17952 echo "Your system accepts $xxx."
17961 '') rp='What is the type for the 2nd, 3rd, and 4th arguments to select?'
17962 case "$d_fd_set" in
17963 $define) dflt="fd_set *" ;;
17972 *) : no select, so pick a harmless default
17979 : check for the select 'width'
17980 case "$selectminbits" in
17981 '') case "$d_select" in
17985 Checking to see on how many bits at a time your select() operates...
17988 #include <sys/types.h>
17990 #$i_systime I_SYS_TIME
17991 #$i_systimek I_SYS_TIME_KERNEL
17996 # ifdef I_SYS_TIME_KERNEL
17999 # include <sys/time.h>
18000 # ifdef I_SYS_TIME_KERNEL
18004 #$i_sysselct I_SYS_SELECT
18005 #ifdef I_SYS_SELECT
18006 #include <sys/select.h>
18008 #$d_socket HAS_SOCKET
18010 # include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
18014 #define S sizeof(*(b))
18016 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
18017 #define NBITS (NBYTES * 8)
18026 fp = fopen("try.c", "r");
18032 b = ($selecttype)s;
18033 for (i = 0; i < NBITS; i++)
18037 select(fd + 1, b, 0, 0, &t);
18038 for (i = NBITS - 1; i > fd && FD_ISSET(i, b); i--);
18039 printf("%d\n", i + 1);
18044 if eval $compile_ok; then
18045 selectminbits=`$run ./try`
18046 case "$selectminbits" in
18048 Cannot figure out on how many bits at a time your select() operates.
18049 I'll play safe and guess it is 32 bits.
18055 *) bits="$selectminbits bits" ;;
18057 echo "Your select() operates on $bits at a time." >&4
18059 rp='What is the minimum number of bits your select() operates on?'
18060 case "$byteorder" in
18061 1234|12345678) dflt=32 ;;
18066 selectminbits="$val"
18070 *) : no select, so pick a harmless default
18077 : Trace out the files included by signal.h, then look for SIGxxx names.
18078 : Remove SIGARRAYSIZE used by HPUX.
18079 : Remove SIGSTKSIZE used by Linux.
18080 : Remove SIGSTKSZ used by Posix.
18081 : Remove SIGTYP void lines used by OS2.
18082 : Some cpps, like os390, dont give the file name anywhere
18083 if [ "X$fieldn" = X ]; then
18084 : Just make some guesses. We check them later.
18085 xxx='/usr/include/signal.h /usr/include/sys/signal.h'
18087 xxx=`echo '#include <signal.h>' |
18088 $cppstdin $cppminus $cppflags 2>/dev/null |
18089 $grep '^[ ]*#.*include' |
18090 $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
18092 : Check this list of files to be sure we have parsed the cpp output ok.
18093 : This will also avoid potentially non-existent files, such
18096 for xx in $xxx /dev/null ; do
18097 $test -f "$xx" && xxxfiles="$xxxfiles $xx"
18099 : If we have found no files, at least try signal.h
18100 case "$xxxfiles" in
18101 '') xxxfiles=`./findhdr signal.h` ;;
18104 $1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ && $2 !~ /SIGSTKSIZE/ && $2 !~ /SIGSTKSZ/ && $3 !~ /void/ {
18105 print substr($2, 4, 20)
18107 $1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ && $4 !~ /void/ {
18108 print substr($3, 4, 20)
18110 : Append some common names just in case the awk scan failed.
18111 xxx="$xxx ABRT ALRM BUS CANCEL CHLD CLD CONT DIL EMT FPE"
18112 xxx="$xxx FREEZE HUP ILL INT IO IOT KILL LOST LWP PHONE"
18113 xxx="$xxx PIPE POLL PROF PWR QUIT RTMAX RTMIN SEGV STKFLT STOP"
18114 xxx="$xxx SYS TERM THAW TRAP TSTP TTIN TTOU URG USR1 USR2"
18115 xxx="$xxx USR3 USR4 VTALRM WAITING WINCH WIND WINDOW XCPU XFSZ"
18117 : generate a few handy files for later
18118 $cat > signal.c <<'EOCP'
18119 #include <sys/types.h>
18120 #include <signal.h>
18124 /* Strange style to avoid deeply-nested #if/#else/#endif */
18127 # define NSIG (_NSIG)
18133 # define NSIG (SIGMAX+1)
18139 # define NSIG (SIG_MAX+1)
18145 # define NSIG (MAXSIG+1)
18151 # define NSIG (MAX_SIG+1)
18156 # ifdef SIGARRAYSIZE
18157 # define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
18163 # define NSIG (_sys_nsig) /* Solaris 2.5 */
18167 /* Default to some arbitrary number that's big enough to get most
18168 of the common signals.
18174 printf("NSIG %d\n", NSIG);
18180 echo $xxx | $tr ' ' $trnl | $sort | $uniq | $awk '
18182 printf "#ifdef SIG"; printf $1; printf "\n"
18183 printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
18184 printf $1; printf ");\n"
18188 printf "#endif /* JUST_NSIG */\n";
18189 printf "exit(0);\n}\n";
18192 $cat >signal.awk <<'EOP'
18193 BEGIN { ndups = 0 }
18194 $1 ~ /^NSIG$/ { nsig = $2 }
18195 ($1 !~ /^NSIG$/) && (NF == 2) {
18196 if ($2 > maxsig) { maxsig = $2 }
18197 if (sig_name[$2]) {
18198 dup_name[ndups] = $1
18199 dup_num[ndups] = $2
18211 printf("NSIG %d\n", nsig);
18212 for (n = 1; n < nsig; n++) {
18214 printf("%s %d\n", sig_name[n], sig_num[n])
18217 printf("NUM%d %d\n", n, n)
18220 for (n = 0; n < ndups; n++) {
18221 printf("%s %d\n", dup_name[n], dup_num[n])
18225 $cat >signal_cmd <<EOS
18227 if $test -s signal.lst; then
18228 echo "Using your existing signal.lst file"
18233 $cat >>signal_cmd <<'EOS'
18236 if eval $compile_ok; then
18237 $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
18239 echo "(I can't seem be able to compile the whole test program)" >&4
18240 echo "(I'll try it in little pieces.)" >&4
18241 set signal -DJUST_NSIG
18242 if eval $compile_ok; then
18243 $run ./signal$_exe > signal.nsg
18246 echo "I can't seem to figure out how many signals you have." >&4
18247 echo "Guessing 50." >&4
18248 echo 'NSIG 50' > signal.nsg
18250 : Now look at all the signal names, one at a time.
18251 for xx in `echo $xxx | $tr ' ' $trnl | $sort | $uniq`; do
18252 $cat > signal.c <<EOCP
18253 #include <sys/types.h>
18254 #include <signal.h>
18257 printf("$xx %d\n", SIG${xx});
18262 if eval $compile; then
18263 echo "SIG${xx} found."
18264 $run ./signal$_exe >> signal.ls1
18266 echo "SIG${xx} NOT found."
18269 if $test -s signal.ls1; then
18270 $cat signal.nsg signal.ls1 |
18271 $sort -n | $uniq | $awk -f signal.awk >signal.lst
18275 if $test -s signal.lst; then
18278 echo "(AAK! I can't compile the test programs -- Guessing)" >&4
18279 echo 'kill -l' >signal
18280 set X `csh -f <signal`
18284 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
18286 echo $@ | $tr ' ' $trnl | \
18287 $awk '{ printf "%s %d\n", $1, ++s; }
18288 END { printf "NSIG %d\n", ++s }' >signal.lst
18290 $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
18292 chmod a+x signal_cmd
18293 $eunicefix signal_cmd
18295 : generate list of signal names
18297 case "$sig_name_init" in
18299 *) case "$sig_num_init" in
18300 ''|*,*) doinit=yes ;;
18305 echo "Generating a list of signal names and numbers..." >&4
18307 sig_count=`$awk '/^NSIG/ { printf "%d", $2 }' signal.lst`
18308 sig_name=`$awk 'BEGIN { printf "ZERO " }
18309 !/^NSIG/ { printf "%s ", $1 }' signal.lst`
18310 sig_num=`$awk 'BEGIN { printf "0 " }
18311 !/^NSIG/ { printf "%d ", $2 }' signal.lst`
18312 sig_name_init=`$awk 'BEGIN { printf "\"ZERO\", " }
18313 !/^NSIG/ { printf "\"%s\", ", $1 }
18314 END { printf "0\n" }' signal.lst`
18315 sig_num_init=`$awk 'BEGIN { printf "0, " }
18316 !/^NSIG/ { printf "%d, ", $2}
18317 END { printf "0\n"}' signal.lst`
18320 echo "The following $sig_count signals are available:"
18322 echo $sig_name | $awk \
18323 'BEGIN { linelen = 0 }
18325 for (i = 1; i <= NF; i++) {
18326 name = "SIG" $i " "
18327 linelen = linelen + length(name)
18328 if (linelen > 70) {
18330 linelen = length(name)
18336 sig_size=`echo $sig_name | awk '{print NF}'`
18337 $rm -f signal signal.c signal.awk signal.lst signal_cmd
18340 case "$sizetype" in
18341 *_t) zzz="$sizetype" ;;
18342 *) zzz="filesize" ;;
18344 echo "Checking the size of $zzz..." >&4
18346 #include <sys/types.h>
18349 printf("%d\n", (int)sizeof($sizetype));
18354 if eval $compile_ok; then
18358 echo "(I can't execute the test program--guessing $sizesize.)" >&4
18361 echo "Your $zzz size is $sizesize bytes."
18366 echo "(I can't compile the test program--guessing $sizesize.)" >&4
18370 : check for socklen_t
18372 echo "Checking to see if you have socklen_t..." >&4
18374 #include <sys/types.h>
18375 #$d_socket HAS_SOCKET
18377 #include <sys/socket.h>
18379 int main() { socklen_t x = 16; }
18382 if eval $compile; then
18384 echo "You have socklen_t."
18387 echo "You do not have socklen_t."
18388 case "$sizetype" in
18389 size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
18396 : see if this is a socks.h system
18397 set socks.h i_socks
18400 : check for type of the size argument to socket calls
18401 case "$d_socket" in
18405 Checking to see what type is the last argument of accept().
18408 case "$d_socklen_t" in
18409 "$define") yyy="$yyy socklen_t"
18411 yyy="$yyy $sizetype int long unsigned"
18412 for xxx in $yyy; do
18413 case "$socksizetype" in
18414 '') try="extern int accept(int, struct sockaddr *, $xxx *);"
18415 case "$usesocks" in
18417 if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h literal '#define INCLUDE_PROTOTYPES' $i_socks socks.h.; then
18418 echo "Your system accepts '$xxx *' for the last argument of accept()."
18419 socksizetype="$xxx"
18422 *) if ./protochk "$try" $i_systypes sys/types.h $d_socket sys/socket.h; then
18423 echo "Your system accepts '$xxx *' for the last argument of accept()."
18424 socksizetype="$xxx"
18431 : In case none of those worked, prompt the user.
18432 case "$socksizetype" in
18433 '') rp='What is the type for socket address structure sizes?'
18440 *) : no sockets, so pick relatively harmless default
18445 : see what type is used for signed size_t
18446 set ssize_t ssizetype int stdio.h sys/types.h
18451 #include <sys/types.h>
18452 #define Size_t $sizetype
18453 #define SSize_t $dflt
18456 if (sizeof(Size_t) == sizeof(SSize_t))
18458 else if (sizeof(Size_t) == sizeof(int))
18467 if eval $compile_ok && $run ./try > /dev/null; then
18468 ssizetype=`$run ./try`
18469 echo "I'll be using $ssizetype for functions returning a byte count." >&4
18472 Help! I can't compile and run the ssize_t test program: please enlighten me!
18473 (This is probably a misconfiguration in your system or libraries, and
18474 you really ought to fix it. Still, I'll try anyway.)
18476 I need a type that is the same size as $sizetype, but is guaranteed to
18477 be signed. Common values are ssize_t, int and long.
18480 rp="What signed type is the same size as $sizetype?"
18486 : see what type of char stdio uses.
18488 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
18489 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
18490 echo "Your stdio uses unsigned chars." >&4
18491 stdchar="unsigned char"
18493 echo "Your stdio uses signed chars." >&4
18500 : see what type uids are declared as in the kernel
18502 echo "Looking for the type for user ids returned by getuid()."
18503 set uid_t uidtype xxx stdio.h sys/types.h
18507 xxx=`./findhdr sys/user.h`
18508 set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
18510 unsigned) dflt="$1 $2" ;;
18514 *) dflt="$uidtype";;
18517 uid_t) echo "uid_t found." ;;
18518 *) rp="What is the type for user ids returned by getuid()?"
18526 *_t) zzz="$uidtype" ;;
18529 echo "Checking the size of $zzz..." >&4
18531 #include <sys/types.h>
18534 printf("%d\n", (int)sizeof($uidtype));
18539 if eval $compile_ok; then
18543 echo "(I can't execute the test program--guessing $uidsize.)" >&4
18546 echo "Your $zzz is $uidsize bytes long."
18551 echo "(I can't compile the test program--guessing $uidsize.)" >&4
18556 *_t) zzz="$uidtype" ;;
18559 echo "Checking the sign of $zzz..." >&4
18561 #include <sys/types.h>
18572 if eval $compile; then
18576 echo "(I can't execute the test program--guessing unsigned.)" >&4
18580 1) echo "Your $zzz is unsigned." ;;
18581 -1) echo "Your $zzz is signed." ;;
18587 echo "(I can't compile the test program--guessing unsigned.)" >&4
18593 $echo "Checking the format string to be used for uids..." >&4
18596 -1) if $test X"$uidsize" = X"$ivsize"; then
18597 uidformat="$ivdformat"
18599 if $test X"$uidsize" = X"$longsize"; then
18602 if $test X"$uidsize" = X"$intsize"; then
18605 if $test X"$uidsize" = X"$shortsize"; then
18612 *) if $test X"$uidsize" = X"$uvsize"; then
18613 uidformat="$uvuformat"
18615 if $test X"$uidsize" = X"$longsize"; then
18618 if $test X"$uidsize" = X"$intsize"; then
18621 if $test X"$uidsize" = X"$shortsize"; then
18630 : determine compiler compiler
18639 if $test -f "$byacc$_exe"; then
18641 comp="byacc or $comp"
18643 if $test -f "$bison$_exe"; then
18644 comp="$comp or bison -y"
18646 rp="Which compiler compiler ($comp) shall I use?"
18655 echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
18661 : see if this is a fp.h system
18665 : see if this is a fp_class.h system
18666 set fp_class.h i_fp_class
18669 : see if this is a ieeefp.h system
18670 case "$i_ieeefp" in
18671 '' ) set ieeefp.h i_ieeefp
18676 : see if this is a libutil.h system
18677 set libutil.h i_libutil
18680 : see if mach cthreads are available
18681 if test "X$usethreads" = "X$define"; then
18682 set mach/cthreads.h i_machcthr
18685 i_machcthr="$undef"
18690 : see if this is a math.h system
18694 : see if this is a mntent.h system
18695 set mntent.h i_mntent
18698 : see if ndbm.h is available
18704 # Some Linux distributions such as RedHat 7.1 put the
18705 # ndbm.h header in /usr/include/gdbm/ndbm.h.
18706 if $test -f /usr/include/gdbm/ndbm.h; then
18707 echo '<gdbm/ndbm.h> found.'
18708 ccflags="$ccflags -I/usr/include/gdbm"
18709 cppflags="$cppflags -I/usr/include/gdbm"
18717 : see if dbm_open exists
18718 set dbm_open d_dbm_open
18720 case "$d_dbm_open" in
18723 echo "We won't be including <ndbm.h>"
18732 : see if net/errno.h is available
18734 set net/errno.h val
18737 : Unfortunately, it causes problems on some systems. Arrgh.
18740 cat > try.c <<'EOM'
18743 #include <net/errno.h>
18749 if $cc $ccflags -c try.c >/dev/null 2>&1; then
18750 echo "We'll be including <net/errno.h>." >&4
18752 echo "We won't be including <net/errno.h>." >&4
18761 : see if netinet/tcp.h is available
18762 set netinet/tcp.h i_netinettcp
18765 : see if this is a poll.h system
18769 : see if this is a prot.h system
18774 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
18775 $cat <<'EOSH' > Cppsym.know
18776 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
18777 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
18778 alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
18779 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
18780 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
18781 BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
18782 bull c cadmus clipper CMU COFF COMPILER_VERSION
18783 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
18784 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
18785 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
18786 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
18788 GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
18789 H3050R H3050RX hbullx20 hcx host_mips
18790 hp200 hp300 hp700 HP700 hp800 hp9000
18791 hp9000s200 hp9000s300 hp9000s400 hp9000s500
18792 hp9000s700 hp9000s800 hp9k8 hp_osf hppa hpux HPUX_SOURCE
18793 i186 i286 i386 i486 i586 i686 i8086 i80960 i860 I960
18794 IA64 iAPX286 ibm ibm032 ibmesa IBMR2 ibmrt ILP32 ILP64
18795 INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
18796 LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
18797 LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
18798 Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
18799 LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
18800 M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
18801 M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
18802 M_SYS5 M_SYSIII M_SYSV M_UNIX M_XENIX MACH machine MachTen
18803 MATH_HAS_NO_SIDE_EFFECTS
18804 mc300 mc500 mc68000 mc68010 mc68020 mc68030 mc68040
18805 mc68060 mc68k mc68k32 mc700 mc88000 mc88100 merlin
18806 mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
18807 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
18808 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
18809 NetBSD news1500 news1700 news1800 news1900 news3700
18810 news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
18811 ns32016 ns32332 ns32k nsc32000
18812 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
18813 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
18814 pc532 pdp11 PGC PIC plexus PORTAR posix
18815 POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
18816 POSIX_C_SOURCE POSIX_SOURCE POWER
18817 PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
18818 riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
18819 SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
18820 sony sony_news sonyrisc sparc sparclite spectrum
18821 stardent stdc STDC_EXT stratos sun sun3 sun386
18822 Sun386i svr3 svr4 SVR4_2 SVR4_SOURCE svr5
18823 SX system SYSTYPE_BSD SYSTYPE_BSD43 SYSTYPE_BSD44
18824 SYSTYPE_SVR4 SYSTYPE_SVR5 SYSTYPE_SYSV SYSV SYSV3 SYSV4 SYSV5
18825 sysV68 sysV88 Tek4132 Tek4300 titan
18826 TM3200 TM5400 TM5600
18827 tower tower32 tower32_200 tower32_600 tower32_700
18828 tower32_800 tower32_850 tss
18829 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
18830 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
18831 unix UNIX95 UNIX99 unixpc unos
18832 USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
18833 USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
18834 USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
18836 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
18837 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
18838 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
18841 # Maybe put other stuff here too.
18842 cat <<EOSH >>Cppsym.know
18845 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
18846 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
18847 $cat Cppsym.know > Cppsym.c
18848 $cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
18849 $rm -f Cppsym.a Cppsym.b Cppsym.c
18850 cat <<EOSH > Cppsym
18852 if $test \$# -gt 0; then
18853 echo \$* | $tr " " "$trnl" | ./Cppsym.try > Cppsym.got
18854 if $test -s Cppsym.got; then
18861 $tr " " "$trnl" | ./Cppsym.try
18867 cat <<EOSH > Cppsym.try
18869 cat <<'EOCP' > try.c
18875 cat <<'EOSH' >> Cppsym.try
18877 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
18878 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
18879 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
18880 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
18882 echo 'return 0;}' >> try.c
18884 cat <<EOSH >> Cppsym.try
18886 case "$osname-$gccversion" in
18887 irix-) ccflags="\$ccflags -woff 1178" ;;
18888 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
18890 $cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
18892 chmod +x Cppsym.try
18893 $eunicefix Cppsym.try
18894 ./Cppsym < Cppsym.know > Cppsym.true
18895 : now check the C compiler for additional symbols
18896 postprocess_cc_v=''
18898 aix) postprocess_cc_v="|$tr , ' '" ;;
18905 for i in \`$cc -v -c tmp.c 2>&1 $postprocess_cc_v\`
18908 -D*) echo "\$i" | $sed 's/^-D//';;
18909 -A*) $test "$gccversion" && echo "\$i" | $sed 's/^-A//' | $sed 's/\(.*\)(\(.*\))/\1=\2/';;
18914 postprocess_cc_v=''
18917 ./ccsym > ccsym1.raw
18918 if $test -s ccsym1.raw; then
18919 $sort ccsym1.raw | $uniq >ccsym.raw
18921 mv ccsym1.raw ccsym.raw
18924 $awk '/\=/ { print $0; next }
18925 { print $0"=1" }' ccsym.raw >ccsym.list
18926 $awk '/\=/ { print $0; next }
18927 { print $0"=1" }' Cppsym.true >ccsym.true
18928 $comm -13 ccsym.true ccsym.list >ccsym.own
18929 $comm -12 ccsym.true ccsym.list >ccsym.com
18930 $comm -23 ccsym.true ccsym.list >ccsym.cpp
18932 if $test -z ccsym.raw; then
18933 echo "Your C compiler doesn't seem to define any symbols!" >&4
18935 echo "However, your C preprocessor defines the following symbols:"
18938 cppsymbols=`$cat Cppsym.true`
18939 cppsymbols=`echo $cppsymbols`
18940 cppccsymbols="$cppsymbols"
18942 if $test -s ccsym.com; then
18943 echo "Your C compiler and pre-processor define these symbols:"
18944 $sed -e 's/\(..*\)=.*/\1/' ccsym.com
18947 cppccsymbols=`$cat ccsym.com`
18948 cppccsymbols=`echo $cppccsymbols`
18949 $test "$silent" || sleep 1
18951 if $test -s ccsym.cpp; then
18952 $test "$also" && echo " "
18953 echo "Your C pre-processor ${also}defines the following symbols:"
18954 $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
18956 cppsymbols=`$cat ccsym.cpp`
18957 cppsymbols=`echo $cppsymbols`
18958 $test "$silent" || sleep 1
18960 if $test -s ccsym.own; then
18961 $test "$also" && echo " "
18962 echo "Your C compiler ${also}defines the following cpp symbols:"
18963 $sed -e 's/\(..*\)=1/\1/' ccsym.own
18964 $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
18965 ccsymbols=`$cat ccsym.own`
18966 ccsymbols=`echo $ccsymbols`
18967 $test "$silent" || sleep 1
18971 : see if this is a termio system
18975 if $test `./findhdr termios.h`; then
18976 set tcsetattr i_termios
18982 "$define") echo "You have POSIX termios.h... good!" >&4;;
18983 *) if ./Cppsym pyr; then
18984 case "`/bin/universe`" in
18985 ucb) if $test `./findhdr sgtty.h`; then
18987 echo "<sgtty.h> found." >&4
18989 echo "System is pyramid with BSD universe."
18990 echo "<sgtty.h> not found--you could have problems." >&4
18992 *) if $test `./findhdr termio.h`; then
18994 echo "<termio.h> found." >&4
18996 echo "System is pyramid with USG universe."
18997 echo "<termio.h> not found--you could have problems." >&4
19001 if $test `./findhdr termio.h`; then
19002 echo "<termio.h> found." >&4
19004 elif $test `./findhdr sgtty.h`; then
19005 echo "<sgtty.h> found." >&4
19008 echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
19011 if $test `./findhdr sgtty.h`; then
19012 echo "<sgtty.h> found." >&4
19014 elif $test `./findhdr termio.h`; then
19015 echo "<termio.h> found." >&4
19018 echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
19022 set i_termio; eval $setvar
19023 val=$val2; set i_sgtty; eval $setvar
19024 val=$val3; set i_termios; eval $setvar
19026 : see if stddef is available
19027 set stddef.h i_stddef
19030 : see if this is a sunmath.h system
19031 set sunmath.h i_sunmath
19034 : see if sys/access.h is available
19035 set sys/access.h i_sysaccess
19038 : see if ioctl defs are in sgtty, termio, sys/filio or sys/ioctl
19039 set sys/filio.h i_sysfilio
19042 if $test `./findhdr sys/ioctl.h`; then
19044 echo '<sys/ioctl.h> found.' >&4
19047 if $test $i_sysfilio = "$define"; then
19048 echo '<sys/ioctl.h> NOT found.' >&4
19050 $test $i_sgtty = "$define" && xxx="sgtty.h"
19051 $test $i_termio = "$define" && xxx="termio.h"
19052 $test $i_termios = "$define" && xxx="termios.h"
19053 echo "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
19059 : see if socket ioctl defs are in sys/sockio.h
19061 xxx=`./findhdr sys/sockio.h`
19062 if $test "$xxx"; then
19063 if $contains SIOCATMARK $xxx >/dev/null 2>&1; then
19065 echo "You have socket ioctls defined in <sys/sockio.h>." >&4
19068 echo "No socket ioctls found in <sys/sockio.h>." >&4
19073 <sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
19080 : see if this is a syslog.h system
19081 set syslog.h i_syslog
19085 : see if this is a sys/mode.h system
19086 set sys/mode.h i_sysmode
19089 : see if sys/resource.h has to be included
19090 set sys/resource.h i_sysresrc
19093 : see if sys/security.h is available
19094 set sys/security.h i_syssecrt
19097 : see if this is a sys/statvfs.h system
19098 set sys/statvfs.h i_sysstatvfs
19101 : see if this is a sys/un.h system
19102 set sys/un.h i_sysun
19106 : see if this is a sys/utsname.h system
19107 set sys/utsname.h i_sysutsname
19110 : see if this is a syswait system
19111 set sys/wait.h i_syswait
19114 : see if this is a ustat.h system
19115 set ustat.h i_ustat
19118 : see if this is an utime system
19119 set utime.h i_utime
19122 : see if this is a values.h system
19123 set values.h i_values
19126 : see if this is a vfork system
19129 set vfork.h i_vfork
19137 : see if gdbm.h is available
19142 : see if gdbm_open exists
19143 set gdbm_open d_gdbm_open
19145 case "$d_gdbm_open" in
19148 echo "We won't be including <gdbm.h>"
19158 echo "Looking for extensions..." >&4
19159 : If we are using the old config.sh, known_extensions may contain
19160 : old or inaccurate or duplicate values.
19161 known_extensions=''
19162 nonxs_extensions=''
19163 : We do not use find because it might not be available.
19164 : We do not just use MANIFEST because the user may have dropped
19165 : some additional extensions into the source tree and expect them
19168 : Function to recursively find available extensions, ignoring DynaLoader
19169 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
19173 DynaLoader|dynaload) ;;
19175 if $test -f $xxx/$xxx.xs; then
19176 known_extensions="$known_extensions $1$xxx";
19177 elif $test -f $xxx/Makefile.PL; then
19178 nonxs_extensions="$nonxs_extensions $1$xxx";
19180 if $test -d $xxx -a $# -lt 10; then
19183 eval $find_extensions;
19195 eval $find_extensions
19196 # Special case: Add in threads/shared since it is not picked up by the
19197 # recursive find above (and adding in general recursive finding breaks
19198 # SDBM_File/sdbm). A.D. 10/25/2001.
19199 known_extensions="$known_extensions threads/shared"
19200 set X $nonxs_extensions
19202 nonxs_extensions="$*"
19203 set X $known_extensions
19205 known_extensions="$*"
19208 : Now see which are supported on this system.
19210 for xxx in $known_extensions ; do
19214 $define) avail_ext="$avail_ext $xxx" ;;
19217 GDBM_File|gdbm_fil)
19219 $define) avail_ext="$avail_ext $xxx" ;;
19222 I18N/Langinfo|i18n_lan)
19223 case "$i_langinfo$d_nl_langinfo" in
19224 $define$define) avail_ext="$avail_ext $xxx" ;;
19227 NDBM_File|ndbm_fil)
19230 case "$osname-$use64bitint" in
19231 cygwin-*|hpux-define)
19233 *-lndbm*) avail_ext="$avail_ext $xxx" ;;
19236 *) avail_ext="$avail_ext $xxx" ;;
19241 ODBM_File|odbm_fil)
19242 case "${i_dbm}${i_rpcsvcdbm}" in
19244 case "$osname-$use64bitint" in
19245 cygwin-*|hpux-define)
19247 *-ldbm*) avail_ext="$avail_ext $xxx" ;;
19250 *) avail_ext="$avail_ext $xxx" ;;
19256 case "$useposix" in
19257 true|define|y) avail_ext="$avail_ext $xxx" ;;
19261 case "$useopcode" in
19262 true|define|y) avail_ext="$avail_ext $xxx" ;;
19266 case "$d_socket" in
19269 beos) ;; # not unless BONE
19270 *) avail_ext="$avail_ext $xxx" ;;
19275 Sys/Syslog|sys/syslog)
19276 : XXX syslog requires socket
19277 case "$d_socket" in
19278 true|$define|y) avail_ext="$avail_ext $xxx" ;;
19282 case "$usethreads" in
19284 case "$useithreads" in
19285 $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
19289 threads|threads/shared)
19290 # threads and threads::shared are special cases.
19291 # To stop people from asking "Perl 5.8.0 was supposed
19292 # to have this new fancy threads implementation but my
19293 # perl doesn't have it" and from people trying to
19294 # (re)install the threads module using CPAN.pm and
19295 # CPAN.pm then offering to reinstall Perl 5.8.0,
19296 # the threads.pm and threads/shared.pm will always be
19297 # there, croaking informatively ("you need to rebuild
19298 # all of Perl with threads, sorry") when threads haven't
19299 # been compiled in.
19301 avail_ext="$avail_ext $xxx"
19304 : XXX Do we need a useipcsysv variable here
19305 case "${d_msg}${d_sem}${d_shm}" in
19306 *"${define}"*) avail_ext="$avail_ext $xxx" ;;
19309 *) avail_ext="$avail_ext $xxx"
19318 : Now see which nonxs extensions are supported on this system.
19319 : For now assume all are.
19321 for xxx in $nonxs_extensions ; do
19323 *) nonxs_ext="$nonxs_ext $xxx"
19335 A number of extensions are supplied with $package. You may choose to
19336 compile these extensions for dynamic loading (the default), compile
19337 them into the $package executable (static loading), or not include
19338 them at all. Answer "none" to include no extensions.
19339 Note that DynaLoader is always built and need not be mentioned here.
19342 case "$dynamic_ext" in
19343 '') dflt="$avail_ext" ;;
19344 *) dflt="$dynamic_ext"
19345 # Perhaps we are reusing an old out-of-date config.sh.
19348 if test X"$dynamic_ext" != X"$avail_ext"; then
19350 NOTICE: Your previous config.sh list may be incorrect.
19351 The extensions now available to you are
19353 but the default list from your previous config.sh is
19365 rp="What extensions do you wish to load dynamically?"
19368 none) dynamic_ext=' ' ;;
19369 *) dynamic_ext="$ans" ;;
19372 case "$static_ext" in
19374 : Exclude those already listed in dynamic linking
19376 for xxx in $avail_ext; do
19377 case " $dynamic_ext " in
19379 *) dflt="$dflt $xxx" ;;
19386 *) dflt="$static_ext"
19393 rp="What extensions do you wish to load statically?"
19396 none) static_ext=' ' ;;
19397 *) static_ext="$ans" ;;
19402 A number of extensions are supplied with $package. Answer "none"
19403 to include no extensions.
19404 Note that DynaLoader is always built and need not be mentioned here.
19407 case "$static_ext" in
19408 '') dflt="$avail_ext" ;;
19409 *) dflt="$static_ext"
19410 # Perhaps we are reusing an old out-of-date config.sh.
19413 if test X"$static_ext" != X"$avail_ext"; then
19415 NOTICE: Your previous config.sh list may be incorrect.
19416 The extensions now available to you are
19418 but the default list from your previous config.sh is
19427 : Exclude those that are not xs extensions
19431 rp="What extensions do you wish to include?"
19434 none) static_ext=' ' ;;
19435 *) static_ext="$ans" ;;
19440 # Encode is a special case. If we are building Encode as a static
19441 # extension, we need to explicitly list its subextensions as well.
19442 # For other nested extensions, this is handled automatically by
19443 # the appropriate Makefile.PL.
19444 case " $static_ext " in
19445 *" Encode "*) # Add the subextensions of Encode
19447 for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
19448 static_ext="$static_ext Encode/$xxx"
19454 set X $dynamic_ext $static_ext $nonxs_ext
19458 : Remove libraries needed only for extensions
19459 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
19460 : The exception is SunOS 4.x, which needs them.
19461 case "${osname}X${osvers}" in
19465 *) case "$usedl" in
19466 $define|true|[yY]*)
19467 set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
19471 *) perllibs="$libs"
19477 : Remove build directory name from cppstdin so it can be used from
19478 : either the present location or the final installed location.
19480 : Get out of the UU directory to get correct path name.
19482 case "$cppstdin" in
19484 echo "Stripping down cppstdin path name"
19490 : end of configuration questions
19492 echo "End of configuration questions."
19495 : back to where it started
19496 if test -d ../UU; then
19500 : configuration may be patched via a 'config.arch' file
19501 if $test -f config.arch; then
19502 echo "I see a config.arch file, loading it."
19506 : configuration may be patched via a 'config.over' file
19507 if $test -f config.over; then
19510 rp='I see a config.over file. Do you wish to load it?'
19513 n*) echo "OK, I'll ignore it.";;
19515 echo "Configuration override changes have been loaded."
19520 : in case they want portability, strip down executable paths
19521 case "$d_portable" in
19524 echo "Stripping down executable paths..." >&4
19525 for file in $loclist $trylist; do
19527 eval $file=`basename $temp`
19532 : create config.sh file
19534 echo "Creating config.sh..." >&4
19535 $spitshell <<EOT >config.sh
19538 # This file was produced by running the Configure script. It holds all the
19539 # definitions figured out by Configure. Should you modify one of these values,
19540 # do not forget to propagate your changes by running "Configure -der". You may
19541 # instead choose to run each of the .SH files by yourself, or "Configure -S".
19544 # Package name : $package
19545 # Source directory : $src
19546 # Configuration time: $cf_time
19547 # Configured by : $cf_by
19548 # Target system : $myuname
19558 Revision='$Revision'
19566 alignbytes='$alignbytes'
19567 ansi2knr='$ansi2knr'
19568 aphostname='$aphostname'
19569 api_revision='$api_revision'
19570 api_subversion='$api_subversion'
19571 api_version='$api_version'
19572 api_versionstring='$api_versionstring'
19575 archlibexp='$archlibexp'
19576 archname64='$archname64'
19577 archname='$archname'
19578 archobjs='$archobjs'
19579 asctime_r_proto='$asctime_r_proto'
19587 byteorder='$byteorder'
19589 castflags='$castflags'
19592 cccdlflags='$cccdlflags'
19593 ccdlflags='$ccdlflags'
19595 ccflags_uselargefiles='$ccflags_uselargefiles'
19597 ccsymbols='$ccsymbols'
19598 ccversion='$ccversion'
19600 cf_email='$cf_email'
19602 charsize='$charsize'
19606 clocktype='$clocktype'
19608 compress='$compress'
19609 contains='$contains'
19613 cpp_stuff='$cpp_stuff'
19614 cppccsymbols='$cppccsymbols'
19615 cppflags='$cppflags'
19617 cppminus='$cppminus'
19619 cppstdin='$cppstdin'
19620 cppsymbols='$cppsymbols'
19621 crypt_r_proto='$crypt_r_proto'
19622 cryptlib='$cryptlib'
19624 ctermid_r_proto='$ctermid_r_proto'
19625 ctime_r_proto='$ctime_r_proto'
19626 d_Gconvert='$d_Gconvert'
19627 d_PRIEUldbl='$d_PRIEUldbl'
19628 d_PRIFUldbl='$d_PRIFUldbl'
19629 d_PRIGUldbl='$d_PRIGUldbl'
19630 d_PRIXU64='$d_PRIXU64'
19631 d_PRId64='$d_PRId64'
19632 d_PRIeldbl='$d_PRIeldbl'
19633 d_PRIfldbl='$d_PRIfldbl'
19634 d_PRIgldbl='$d_PRIgldbl'
19635 d_PRIi64='$d_PRIi64'
19636 d_PRIo64='$d_PRIo64'
19637 d_PRIu64='$d_PRIu64'
19638 d_PRIx64='$d_PRIx64'
19639 d_SCNfldbl='$d_SCNfldbl'
19640 d__fwalk='$d__fwalk'
19641 d_access='$d_access'
19642 d_accessx='$d_accessx'
19644 d_archlib='$d_archlib'
19645 d_asctime_r='$d_asctime_r'
19648 d_attribut='$d_attribut'
19652 d_bsdgetpgrp='$d_bsdgetpgrp'
19653 d_bsdsetpgrp='$d_bsdsetpgrp'
19655 d_casti32='$d_casti32'
19656 d_castneg='$d_castneg'
19657 d_charvspr='$d_charvspr'
19659 d_chroot='$d_chroot'
19660 d_chsize='$d_chsize'
19662 d_closedir='$d_closedir'
19663 d_cmsghdr_s='$d_cmsghdr_s'
19666 d_crypt_r='$d_crypt_r'
19668 d_ctermid_r='$d_ctermid_r'
19669 d_ctime_r='$d_ctime_r'
19670 d_cuserid='$d_cuserid'
19671 d_dbl_dig='$d_dbl_dig'
19672 d_dbminitproto='$d_dbminitproto'
19673 d_difftime='$d_difftime'
19675 d_dirnamlen='$d_dirnamlen'
19676 d_dlerror='$d_dlerror'
19677 d_dlopen='$d_dlopen'
19678 d_dlsymun='$d_dlsymun'
19679 d_dosuid='$d_dosuid'
19680 d_drand48_r='$d_drand48_r'
19681 d_drand48proto='$d_drand48proto'
19683 d_eaccess='$d_eaccess'
19684 d_endgrent='$d_endgrent'
19685 d_endgrent_r='$d_endgrent_r'
19686 d_endhent='$d_endhent'
19687 d_endhostent_r='$d_endhostent_r'
19688 d_endnent='$d_endnent'
19689 d_endnetent_r='$d_endnetent_r'
19690 d_endpent='$d_endpent'
19691 d_endprotoent_r='$d_endprotoent_r'
19692 d_endpwent='$d_endpwent'
19693 d_endpwent_r='$d_endpwent_r'
19694 d_endsent='$d_endsent'
19695 d_endservent_r='$d_endservent_r'
19696 d_eofnblk='$d_eofnblk'
19697 d_eunice='$d_eunice'
19698 d_fchdir='$d_fchdir'
19699 d_fchmod='$d_fchmod'
19700 d_fchown='$d_fchown'
19702 d_fcntl_can_lock='$d_fcntl_can_lock'
19703 d_fd_macros='$d_fd_macros'
19704 d_fd_set='$d_fd_set'
19705 d_fds_bits='$d_fds_bits'
19706 d_fgetpos='$d_fgetpos'
19707 d_finite='$d_finite'
19708 d_finitel='$d_finitel'
19709 d_flexfnam='$d_flexfnam'
19711 d_flockproto='$d_flockproto'
19713 d_fp_class='$d_fp_class'
19714 d_fpathconf='$d_fpathconf'
19715 d_fpclass='$d_fpclass'
19716 d_fpclassify='$d_fpclassify'
19717 d_fpclassl='$d_fpclassl'
19718 d_fpos64_t='$d_fpos64_t'
19719 d_frexpl='$d_frexpl'
19720 d_fs_data_s='$d_fs_data_s'
19721 d_fseeko='$d_fseeko'
19722 d_fsetpos='$d_fsetpos'
19723 d_fstatfs='$d_fstatfs'
19724 d_fstatvfs='$d_fstatvfs'
19726 d_ftello='$d_ftello'
19728 d_getcwd='$d_getcwd'
19729 d_getespwnam='$d_getespwnam'
19730 d_getfsstat='$d_getfsstat'
19731 d_getgrent='$d_getgrent'
19732 d_getgrent_r='$d_getgrent_r'
19733 d_getgrgid_r='$d_getgrgid_r'
19734 d_getgrnam_r='$d_getgrnam_r'
19735 d_getgrps='$d_getgrps'
19736 d_gethbyaddr='$d_gethbyaddr'
19737 d_gethbyname='$d_gethbyname'
19738 d_gethent='$d_gethent'
19739 d_gethname='$d_gethname'
19740 d_gethostbyaddr_r='$d_gethostbyaddr_r'
19741 d_gethostbyname_r='$d_gethostbyname_r'
19742 d_gethostent_r='$d_gethostent_r'
19743 d_gethostprotos='$d_gethostprotos'
19744 d_getitimer='$d_getitimer'
19745 d_getlogin='$d_getlogin'
19746 d_getlogin_r='$d_getlogin_r'
19747 d_getmnt='$d_getmnt'
19748 d_getmntent='$d_getmntent'
19749 d_getnbyaddr='$d_getnbyaddr'
19750 d_getnbyname='$d_getnbyname'
19751 d_getnent='$d_getnent'
19752 d_getnetbyaddr_r='$d_getnetbyaddr_r'
19753 d_getnetbyname_r='$d_getnetbyname_r'
19754 d_getnetent_r='$d_getnetent_r'
19755 d_getnetprotos='$d_getnetprotos'
19756 d_getpagsz='$d_getpagsz'
19757 d_getpbyname='$d_getpbyname'
19758 d_getpbynumber='$d_getpbynumber'
19759 d_getpent='$d_getpent'
19760 d_getpgid='$d_getpgid'
19761 d_getpgrp2='$d_getpgrp2'
19762 d_getpgrp='$d_getpgrp'
19763 d_getppid='$d_getppid'
19764 d_getprior='$d_getprior'
19765 d_getprotobyname_r='$d_getprotobyname_r'
19766 d_getprotobynumber_r='$d_getprotobynumber_r'
19767 d_getprotoent_r='$d_getprotoent_r'
19768 d_getprotoprotos='$d_getprotoprotos'
19769 d_getprpwnam='$d_getprpwnam'
19770 d_getpwent='$d_getpwent'
19771 d_getpwent_r='$d_getpwent_r'
19772 d_getpwnam_r='$d_getpwnam_r'
19773 d_getpwuid_r='$d_getpwuid_r'
19774 d_getsbyname='$d_getsbyname'
19775 d_getsbyport='$d_getsbyport'
19776 d_getsent='$d_getsent'
19777 d_getservbyname_r='$d_getservbyname_r'
19778 d_getservbyport_r='$d_getservbyport_r'
19779 d_getservent_r='$d_getservent_r'
19780 d_getservprotos='$d_getservprotos'
19781 d_getspnam='$d_getspnam'
19782 d_getspnam_r='$d_getspnam_r'
19783 d_gettimeod='$d_gettimeod'
19784 d_gmtime_r='$d_gmtime_r'
19785 d_gnulibc='$d_gnulibc'
19786 d_grpasswd='$d_grpasswd'
19787 d_hasmntopt='$d_hasmntopt'
19790 d_inetaton='$d_inetaton'
19791 d_int64_t='$d_int64_t'
19792 d_isascii='$d_isascii'
19793 d_isfinite='$d_isfinite'
19796 d_isnanl='$d_isnanl'
19797 d_killpg='$d_killpg'
19798 d_lchown='$d_lchown'
19799 d_ldbl_dig='$d_ldbl_dig'
19801 d_localtime_r='$d_localtime_r'
19802 d_locconv='$d_locconv'
19804 d_longdbl='$d_longdbl'
19805 d_longlong='$d_longlong'
19806 d_lseekproto='$d_lseekproto'
19808 d_madvise='$d_madvise'
19810 d_mbstowcs='$d_mbstowcs'
19811 d_mbtowc='$d_mbtowc'
19812 d_memchr='$d_memchr'
19813 d_memcmp='$d_memcmp'
19814 d_memcpy='$d_memcpy'
19815 d_memmove='$d_memmove'
19816 d_memset='$d_memset'
19818 d_mkdtemp='$d_mkdtemp'
19819 d_mkfifo='$d_mkfifo'
19820 d_mkstemp='$d_mkstemp'
19821 d_mkstemps='$d_mkstemps'
19822 d_mktime='$d_mktime'
19825 d_modfl_pow32_bug='$d_modfl_pow32_bug'
19826 d_mprotect='$d_mprotect'
19828 d_msg_ctrunc='$d_msg_ctrunc'
19829 d_msg_dontroute='$d_msg_dontroute'
19830 d_msg_oob='$d_msg_oob'
19831 d_msg_peek='$d_msg_peek'
19832 d_msg_proxy='$d_msg_proxy'
19833 d_msgctl='$d_msgctl'
19834 d_msgget='$d_msgget'
19835 d_msghdr_s='$d_msghdr_s'
19836 d_msgrcv='$d_msgrcv'
19837 d_msgsnd='$d_msgsnd'
19839 d_munmap='$d_munmap'
19840 d_mymalloc='$d_mymalloc'
19842 d_nl_langinfo='$d_nl_langinfo'
19843 d_nv_preserves_uv='$d_nv_preserves_uv'
19844 d_off64_t='$d_off64_t'
19845 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
19846 d_oldpthreads='$d_oldpthreads'
19847 d_oldsock='$d_oldsock'
19849 d_pathconf='$d_pathconf'
19851 d_perl_otherlibdirs='$d_perl_otherlibdirs'
19852 d_phostname='$d_phostname'
19855 d_portable='$d_portable'
19856 d_procselfexe='$d_procselfexe'
19857 d_pthread_atfork='$d_pthread_atfork'
19858 d_pthread_yield='$d_pthread_yield'
19860 d_pwchange='$d_pwchange'
19861 d_pwclass='$d_pwclass'
19862 d_pwcomment='$d_pwcomment'
19863 d_pwexpire='$d_pwexpire'
19864 d_pwgecos='$d_pwgecos'
19865 d_pwpasswd='$d_pwpasswd'
19866 d_pwquota='$d_pwquota'
19869 d_random_r='$d_random_r'
19870 d_readdir64_r='$d_readdir64_r'
19871 d_readdir='$d_readdir'
19872 d_readdir_r='$d_readdir_r'
19873 d_readlink='$d_readlink'
19875 d_recvmsg='$d_recvmsg'
19876 d_rename='$d_rename'
19877 d_rewinddir='$d_rewinddir'
19879 d_safebcpy='$d_safebcpy'
19880 d_safemcpy='$d_safemcpy'
19881 d_sanemcmp='$d_sanemcmp'
19882 d_sbrkproto='$d_sbrkproto'
19883 d_sched_yield='$d_sched_yield'
19884 d_scm_rights='$d_scm_rights'
19885 d_seekdir='$d_seekdir'
19886 d_select='$d_select'
19888 d_semctl='$d_semctl'
19889 d_semctl_semid_ds='$d_semctl_semid_ds'
19890 d_semctl_semun='$d_semctl_semun'
19891 d_semget='$d_semget'
19893 d_sendmsg='$d_sendmsg'
19894 d_setegid='$d_setegid'
19895 d_seteuid='$d_seteuid'
19896 d_setgrent='$d_setgrent'
19897 d_setgrent_r='$d_setgrent_r'
19898 d_setgrps='$d_setgrps'
19899 d_sethent='$d_sethent'
19900 d_sethostent_r='$d_sethostent_r'
19901 d_setitimer='$d_setitimer'
19902 d_setlinebuf='$d_setlinebuf'
19903 d_setlocale='$d_setlocale'
19904 d_setlocale_r='$d_setlocale_r'
19905 d_setnent='$d_setnent'
19906 d_setnetent_r='$d_setnetent_r'
19907 d_setpent='$d_setpent'
19908 d_setpgid='$d_setpgid'
19909 d_setpgrp2='$d_setpgrp2'
19910 d_setpgrp='$d_setpgrp'
19911 d_setprior='$d_setprior'
19912 d_setproctitle='$d_setproctitle'
19913 d_setprotoent_r='$d_setprotoent_r'
19914 d_setpwent='$d_setpwent'
19915 d_setpwent_r='$d_setpwent_r'
19916 d_setregid='$d_setregid'
19917 d_setresgid='$d_setresgid'
19918 d_setresuid='$d_setresuid'
19919 d_setreuid='$d_setreuid'
19920 d_setrgid='$d_setrgid'
19921 d_setruid='$d_setruid'
19922 d_setsent='$d_setsent'
19923 d_setservent_r='$d_setservent_r'
19924 d_setsid='$d_setsid'
19925 d_setvbuf='$d_setvbuf'
19929 d_shmatprototype='$d_shmatprototype'
19930 d_shmctl='$d_shmctl'
19932 d_shmget='$d_shmget'
19933 d_sigaction='$d_sigaction'
19934 d_sigprocmask='$d_sigprocmask'
19935 d_sigsetjmp='$d_sigsetjmp'
19936 d_sockatmark='$d_sockatmark'
19937 d_sockatmarkproto='$d_sockatmarkproto'
19938 d_socket='$d_socket'
19939 d_socklen_t='$d_socklen_t'
19940 d_sockpair='$d_sockpair'
19941 d_socks5_init='$d_socks5_init'
19943 d_srand48_r='$d_srand48_r'
19944 d_srandom_r='$d_srandom_r'
19945 d_sresgproto='$d_sresgproto'
19946 d_sresuproto='$d_sresuproto'
19947 d_statblks='$d_statblks'
19948 d_statfs_f_flags='$d_statfs_f_flags'
19949 d_statfs_s='$d_statfs_s'
19950 d_statvfs='$d_statvfs'
19951 d_stdio_cnt_lval='$d_stdio_cnt_lval'
19952 d_stdio_ptr_lval='$d_stdio_ptr_lval'
19953 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
19954 d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
19955 d_stdio_stream_array='$d_stdio_stream_array'
19956 d_stdiobase='$d_stdiobase'
19957 d_stdstdio='$d_stdstdio'
19958 d_strchr='$d_strchr'
19959 d_strcoll='$d_strcoll'
19960 d_strctcpy='$d_strctcpy'
19961 d_strerrm='$d_strerrm'
19962 d_strerror='$d_strerror'
19963 d_strerror_r='$d_strerror_r'
19964 d_strftime='$d_strftime'
19965 d_strtod='$d_strtod'
19966 d_strtol='$d_strtol'
19967 d_strtold='$d_strtold'
19968 d_strtoll='$d_strtoll'
19969 d_strtoq='$d_strtoq'
19970 d_strtoul='$d_strtoul'
19971 d_strtoull='$d_strtoull'
19972 d_strtouq='$d_strtouq'
19973 d_strxfrm='$d_strxfrm'
19974 d_suidsafe='$d_suidsafe'
19975 d_symlink='$d_symlink'
19976 d_syscall='$d_syscall'
19977 d_syscallproto='$d_syscallproto'
19978 d_sysconf='$d_sysconf'
19979 d_sysernlst='$d_sysernlst'
19980 d_syserrlst='$d_syserrlst'
19981 d_system='$d_system'
19982 d_tcgetpgrp='$d_tcgetpgrp'
19983 d_tcsetpgrp='$d_tcsetpgrp'
19984 d_telldir='$d_telldir'
19985 d_telldirproto='$d_telldirproto'
19988 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
19989 d_tm_tm_zone='$d_tm_tm_zone'
19990 d_tmpnam_r='$d_tmpnam_r'
19991 d_truncate='$d_truncate'
19992 d_ttyname_r='$d_ttyname_r'
19993 d_tzname='$d_tzname'
19994 d_u32align='$d_u32align'
19995 d_ualarm='$d_ualarm'
19998 d_union_semun='$d_union_semun'
19999 d_unordered='$d_unordered'
20000 d_usleep='$d_usleep'
20001 d_usleepproto='$d_usleepproto'
20003 d_vendorarch='$d_vendorarch'
20004 d_vendorbin='$d_vendorbin'
20005 d_vendorlib='$d_vendorlib'
20007 d_void_closedir='$d_void_closedir'
20008 d_voidsig='$d_voidsig'
20009 d_voidtty='$d_voidtty'
20010 d_volatile='$d_volatile'
20011 d_vprintf='$d_vprintf'
20013 d_waitpid='$d_waitpid'
20014 d_wcstombs='$d_wcstombs'
20015 d_wctomb='$d_wctomb'
20016 d_writev='$d_writev'
20019 db_hashtype='$db_hashtype'
20020 db_prefixtype='$db_prefixtype'
20021 db_version_major='$db_version_major'
20022 db_version_minor='$db_version_minor'
20023 db_version_patch='$db_version_patch'
20024 defvoidused='$defvoidused'
20025 direntrytype='$direntrytype'
20028 doublesize='$doublesize'
20030 drand48_r_proto='$drand48_r_proto'
20031 dynamic_ext='$dynamic_ext'
20037 endgrent_r_proto='$endgrent_r_proto'
20038 endhostent_r_proto='$endhostent_r_proto'
20039 endnetent_r_proto='$endnetent_r_proto'
20040 endprotoent_r_proto='$endprotoent_r_proto'
20041 endpwent_r_proto='$endpwent_r_proto'
20042 endservent_r_proto='$endservent_r_proto'
20043 eunicefix='$eunicefix'
20046 extensions='$extensions'
20048 fflushNULL='$fflushNULL'
20049 fflushall='$fflushall'
20051 firstmakefile='$firstmakefile'
20053 fpossize='$fpossize'
20054 fpostype='$fpostype'
20055 freetype='$freetype'
20058 full_csh='$full_csh'
20059 full_sed='$full_sed'
20060 gccosandvers='$gccosandvers'
20061 gccversion='$gccversion'
20062 getgrent_r_proto='$getgrent_r_proto'
20063 getgrgid_r_proto='$getgrgid_r_proto'
20064 getgrnam_r_proto='$getgrnam_r_proto'
20065 gethostbyaddr_r_proto='$gethostbyaddr_r_proto'
20066 gethostbyname_r_proto='$gethostbyname_r_proto'
20067 gethostent_r_proto='$gethostent_r_proto'
20068 getlogin_r_proto='$getlogin_r_proto'
20069 getnetbyaddr_r_proto='$getnetbyaddr_r_proto'
20070 getnetbyname_r_proto='$getnetbyname_r_proto'
20071 getnetent_r_proto='$getnetent_r_proto'
20072 getprotobyname_r_proto='$getprotobyname_r_proto'
20073 getprotobynumber_r_proto='$getprotobynumber_r_proto'
20074 getprotoent_r_proto='$getprotoent_r_proto'
20075 getpwent_r_proto='$getpwent_r_proto'
20076 getpwnam_r_proto='$getpwnam_r_proto'
20077 getpwuid_r_proto='$getpwuid_r_proto'
20078 getservbyname_r_proto='$getservbyname_r_proto'
20079 getservbyport_r_proto='$getservbyport_r_proto'
20080 getservent_r_proto='$getservent_r_proto'
20081 getspnam_r_proto='$getspnam_r_proto'
20082 gidformat='$gidformat'
20088 gmtime_r_proto='$gmtime_r_proto'
20090 groupcat='$groupcat'
20091 groupstype='$groupstype'
20094 h_sysfile='$h_sysfile'
20105 i_arpainet='$i_arpainet'
20106 i_bsdioctl='$i_bsdioctl'
20110 i_dirent='$i_dirent'
20116 i_fp_class='$i_fp_class'
20119 i_ieeefp='$i_ieeefp'
20120 i_inttypes='$i_inttypes'
20121 i_langinfo='$i_langinfo'
20122 i_libutil='$i_libutil'
20123 i_limits='$i_limits'
20124 i_locale='$i_locale'
20125 i_machcthr='$i_machcthr'
20126 i_malloc='$i_malloc'
20128 i_memory='$i_memory'
20129 i_mntent='$i_mntent'
20132 i_neterrno='$i_neterrno'
20133 i_netinettcp='$i_netinettcp'
20137 i_pthread='$i_pthread'
20139 i_rpcsvcdbm='$i_rpcsvcdbm'
20142 i_shadow='$i_shadow'
20144 i_stdarg='$i_stdarg'
20145 i_stddef='$i_stddef'
20146 i_stdlib='$i_stdlib'
20147 i_string='$i_string'
20148 i_sunmath='$i_sunmath'
20149 i_sysaccess='$i_sysaccess'
20150 i_sysdir='$i_sysdir'
20151 i_sysfile='$i_sysfile'
20152 i_sysfilio='$i_sysfilio'
20154 i_sysioctl='$i_sysioctl'
20155 i_syslog='$i_syslog'
20156 i_sysmman='$i_sysmman'
20157 i_sysmode='$i_sysmode'
20158 i_sysmount='$i_sysmount'
20159 i_sysndir='$i_sysndir'
20160 i_sysparam='$i_sysparam'
20161 i_sysresrc='$i_sysresrc'
20162 i_syssecrt='$i_syssecrt'
20163 i_sysselct='$i_sysselct'
20164 i_syssockio='$i_syssockio'
20165 i_sysstat='$i_sysstat'
20166 i_sysstatfs='$i_sysstatfs'
20167 i_sysstatvfs='$i_sysstatvfs'
20168 i_systime='$i_systime'
20169 i_systimek='$i_systimek'
20170 i_systimes='$i_systimes'
20171 i_systypes='$i_systypes'
20172 i_sysuio='$i_sysuio'
20174 i_sysutsname='$i_sysutsname'
20175 i_sysvfs='$i_sysvfs'
20176 i_syswait='$i_syswait'
20177 i_termio='$i_termio'
20178 i_termios='$i_termios'
20180 i_unistd='$i_unistd'
20183 i_values='$i_values'
20184 i_varargs='$i_varargs'
20185 i_varhdr='$i_varhdr'
20187 ignore_versioned_solibs='$ignore_versioned_solibs'
20188 inc_version_list='$inc_version_list'
20189 inc_version_list_init='$inc_version_list_init'
20192 installarchlib='$installarchlib'
20193 installbin='$installbin'
20194 installman1dir='$installman1dir'
20195 installman3dir='$installman3dir'
20196 installprefix='$installprefix'
20197 installprefixexp='$installprefixexp'
20198 installprivlib='$installprivlib'
20199 installscript='$installscript'
20200 installsitearch='$installsitearch'
20201 installsitebin='$installsitebin'
20202 installsitelib='$installsitelib'
20203 installstyle='$installstyle'
20204 installusrbinperl='$installusrbinperl'
20205 installvendorarch='$installvendorarch'
20206 installvendorbin='$installvendorbin'
20207 installvendorlib='$installvendorlib'
20209 issymlink='$issymlink'
20210 ivdformat='$ivdformat'
20213 known_extensions='$known_extensions'
20216 lddlflags='$lddlflags'
20218 ldflags_uselargefiles='$ldflags_uselargefiles'
20219 ldlibpthname='$ldlibpthname'
20226 libsdirs='$libsdirs'
20227 libsfiles='$libsfiles'
20228 libsfound='$libsfound'
20229 libspath='$libspath'
20230 libswanted='$libswanted'
20231 libswanted_uselargefiles='$libswanted_uselargefiles'
20237 localtime_r_proto='$localtime_r_proto'
20238 locincpth='$locincpth'
20239 loclibpth='$loclibpth'
20240 longdblsize='$longdblsize'
20241 longlongsize='$longlongsize'
20242 longsize='$longsize'
20246 lseeksize='$lseeksize'
20247 lseektype='$lseektype'
20251 make_set_make='$make_set_make'
20252 mallocobj='$mallocobj'
20253 mallocsrc='$mallocsrc'
20254 malloctype='$malloctype'
20256 man1direxp='$man1direxp'
20259 man3direxp='$man3direxp'
20261 mips_type='$mips_type'
20263 mmaptype='$mmaptype'
20264 modetype='$modetype'
20266 multiarch='$multiarch'
20268 myarchname='$myarchname'
20269 mydomain='$mydomain'
20270 myhostname='$myhostname'
20273 need_va_copy='$need_va_copy'
20274 netdb_hlen_type='$netdb_hlen_type'
20275 netdb_host_type='$netdb_host_type'
20276 netdb_name_type='$netdb_name_type'
20277 netdb_net_type='$netdb_net_type'
20280 nm_so_opt='$nm_so_opt'
20281 nonxs_ext='$nonxs_ext'
20283 nvEUformat='$nvEUformat'
20284 nvFUformat='$nvFUformat'
20285 nvGUformat='$nvGUformat'
20286 nv_preserves_uv_bits='$nv_preserves_uv_bits'
20287 nveformat='$nveformat'
20288 nvfformat='$nvfformat'
20289 nvgformat='$nvgformat'
20292 o_nonblock='$o_nonblock'
20294 old_pthread_create_joinable='$old_pthread_create_joinable'
20295 optimize='$optimize'
20296 orderlib='$orderlib'
20299 otherlibdirs='$otherlibdirs'
20303 patchlevel='$patchlevel'
20304 path_sep='$path_sep'
20307 perl_patchlevel='$perl_patchlevel'
20308 perladmin='$perladmin'
20309 perllibs='$perllibs'
20310 perlpath='$perlpath'
20312 phostname='$phostname'
20315 pm_apiversion='$pm_apiversion'
20319 prefixexp='$prefixexp'
20321 privlibexp='$privlibexp'
20322 procselfexe='$procselfexe'
20323 prototype='$prototype'
20325 quadkind='$quadkind'
20326 quadtype='$quadtype'
20327 randbits='$randbits'
20328 randfunc='$randfunc'
20329 random_r_proto='$random_r_proto'
20330 randseedtype='$randseedtype'
20332 rd_nodata='$rd_nodata'
20333 readdir64_r_proto='$readdir64_r_proto'
20334 readdir_r_proto='$readdir_r_proto'
20335 revision='$revision'
20340 sPRIEUldbl='$sPRIEUldbl'
20341 sPRIFUldbl='$sPRIFUldbl'
20342 sPRIGUldbl='$sPRIGUldbl'
20343 sPRIXU64='$sPRIXU64'
20345 sPRIeldbl='$sPRIeldbl'
20346 sPRIfldbl='$sPRIfldbl'
20347 sPRIgldbl='$sPRIgldbl'
20352 sSCNfldbl='$sSCNfldbl'
20353 sched_yield='$sched_yield'
20354 scriptdir='$scriptdir'
20355 scriptdirexp='$scriptdirexp'
20357 seedfunc='$seedfunc'
20358 selectminbits='$selectminbits'
20359 selecttype='$selecttype'
20360 sendmail='$sendmail'
20361 setgrent_r_proto='$setgrent_r_proto'
20362 sethostent_r_proto='$sethostent_r_proto'
20363 setlocale_r_proto='$setlocale_r_proto'
20364 setnetent_r_proto='$setnetent_r_proto'
20365 setprotoent_r_proto='$setprotoent_r_proto'
20366 setpwent_r_proto='$setpwent_r_proto'
20367 setservent_r_proto='$setservent_r_proto'
20370 sharpbang='$sharpbang'
20371 shmattype='$shmattype'
20372 shortsize='$shortsize'
20375 sig_count='$sig_count'
20376 sig_name='$sig_name'
20377 sig_name_init='$sig_name_init'
20379 sig_num_init='$sig_num_init'
20380 sig_size='$sig_size'
20381 signal_t='$signal_t'
20382 sitearch='$sitearch'
20383 sitearchexp='$sitearchexp'
20385 sitebinexp='$sitebinexp'
20387 sitelib_stem='$sitelib_stem'
20388 sitelibexp='$sitelibexp'
20389 siteprefix='$siteprefix'
20390 siteprefixexp='$siteprefixexp'
20391 sizesize='$sizesize'
20392 sizetype='$sizetype'
20396 sockethdr='$sockethdr'
20397 socketlib='$socketlib'
20398 socksizetype='$socksizetype'
20400 spackage='$spackage'
20401 spitshell='$spitshell'
20402 srand48_r_proto='$srand48_r_proto'
20403 srandom_r_proto='$srandom_r_proto'
20405 ssizetype='$ssizetype'
20406 startperl='$startperl'
20408 static_ext='$static_ext'
20410 stdio_base='$stdio_base'
20411 stdio_bufsiz='$stdio_bufsiz'
20412 stdio_cnt='$stdio_cnt'
20413 stdio_filbuf='$stdio_filbuf'
20414 stdio_ptr='$stdio_ptr'
20415 stdio_stream_array='$stdio_stream_array'
20416 strerror_r_proto='$strerror_r_proto'
20419 subversion='$subversion'
20423 targetarch='$targetarch'
20427 timeincl='$timeincl'
20428 timetype='$timetype'
20429 tmpnam_r_proto='$tmpnam_r_proto'
20435 ttyname_r_proto='$ttyname_r_proto'
20444 uidformat='$uidformat'
20450 uquadtype='$uquadtype'
20451 use5005threads='$use5005threads'
20452 use64bitall='$use64bitall'
20453 use64bitint='$use64bitint'
20454 usecrosscompile='$usecrosscompile'
20456 useithreads='$useithreads'
20457 uselargefiles='$uselargefiles'
20458 uselongdouble='$uselongdouble'
20459 usemorebits='$usemorebits'
20460 usemultiplicity='$usemultiplicity'
20461 usemymalloc='$usemymalloc'
20463 useopcode='$useopcode'
20464 useperlio='$useperlio'
20465 useposix='$useposix'
20466 usereentrant='$usereentrant'
20468 useshrplib='$useshrplib'
20469 usesocks='$usesocks'
20470 usethreads='$usethreads'
20471 usevendorprefix='$usevendorprefix'
20472 usevfork='$usevfork'
20475 uvXUformat='$uvXUformat'
20476 uvoformat='$uvoformat'
20479 uvuformat='$uvuformat'
20480 uvxformat='$uvxformat'
20481 vendorarch='$vendorarch'
20482 vendorarchexp='$vendorarchexp'
20483 vendorbin='$vendorbin'
20484 vendorbinexp='$vendorbinexp'
20485 vendorlib='$vendorlib'
20486 vendorlib_stem='$vendorlib_stem'
20487 vendorlibexp='$vendorlibexp'
20488 vendorprefix='$vendorprefix'
20489 vendorprefixexp='$vendorprefixexp'
20491 version_patchlevel_string='$version_patchlevel_string'
20492 versiononly='$versiononly'
20494 voidflags='$voidflags'
20496 xs_apiversion='$xs_apiversion'
20498 yaccflags='$yaccflags'
20503 : Add in command line options if available
20504 $test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
20506 : add special variables
20507 $test -f $src/patchlevel.h && \
20508 awk '/^#define[ ]+PERL_/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh
20509 echo "PERL_PATCHLEVEL=$perl_patchlevel" >>config.sh
20510 echo "PERL_CONFIG_SH=true" >>config.sh
20512 : propagate old symbols
20513 if $test -f UU/config.sh; then
20514 <UU/config.sh $sort | $uniq >UU/oldconfig.sh
20515 sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
20516 $sort | $uniq -u >UU/oldsyms
20517 set X `cat UU/oldsyms`
20523 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
20525 echo "# Variables propagated from previous config.sh file." >>config.sh
20526 for sym in `cat UU/oldsyms`; do
20527 echo " Propagating $hint variable "'$'"$sym..."
20528 eval 'tmp="$'"${sym}"'"'
20530 sed -e "s/'/'\"'\"'/g" -e "s/^/$sym='/" -e "s/$/'/" >>config.sh
20536 : Finish up by extracting the .SH files
20540 echo "Extraction done."
20550 If you'd like to make any changes to the config.sh file before I begin
20551 to configure things, do it as a shell escape now (e.g. !vi config.sh).
20554 rp="Press return or use a shell escape to edit config.sh:"
20559 *) : in case they cannot read
20560 sh 1>&4 -c "$ans";;
20565 : if this fails, just run all the .SH files by hand
20574 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
20581 Now you need to generate make dependencies by running "$make depend".
20582 You might prefer to run it in background: "$make depend > makedepend.out &"
20583 It can take a while, so you might not want to run it right now.
20588 rp="Run $make depend now?"
20592 $make depend && echo "Now you must run '$make'."
20595 echo "You must run '$make depend' then '$make'."
20598 elif test -f [Mm]akefile; then
20600 echo "Now you must run a $make."
20602 echo "Configure done."
20605 if $test -f Policy.sh; then
20608 If you compile $package on a different machine or from a different object
20609 directory, copy the Policy.sh file from this object directory to the
20610 new one before you run Configure -- this will help you with most of
20611 the policy defaults.
20615 if $test -f config.msg; then
20616 echo "Hmm. I also noted the following information while running:"
20618 $cat config.msg >&4
20621 $rm -f kit*isdone ark*isdone